SCSI & usb-storage: add try_rc_10_first flag
[linux-2.6.git] / include / scsi / iscsi_if.h
index 7ff9678..917741b 100644 (file)
@@ -61,6 +61,8 @@ enum iscsi_uevent_e {
        ISCSI_UEVENT_PATH_UPDATE        = UEVENT_BASE + 20,
        ISCSI_UEVENT_SET_IFACE_PARAMS   = UEVENT_BASE + 21,
        ISCSI_UEVENT_PING               = UEVENT_BASE + 22,
+       ISCSI_UEVENT_GET_CHAP           = UEVENT_BASE + 23,
+       ISCSI_UEVENT_DELETE_CHAP        = UEVENT_BASE + 24,
 
        /* up events */
        ISCSI_KEVENT_RECV_PDU           = KEVENT_BASE + 1,
@@ -196,6 +198,18 @@ struct iscsi_uevent {
                        uint32_t        pid;    /* unique ping id associated
                                                   with each ping request */
                } iscsi_ping;
+               struct msg_get_chap {
+                       uint32_t        host_no;
+                       uint32_t        num_entries; /* number of CHAP entries
+                                                     * on request, number of
+                                                     * valid CHAP entries on
+                                                     * response */
+                       uint16_t        chap_tbl_idx;
+               } get_chap;
+               struct msg_delete_chap {
+                      uint32_t        host_no;
+                      uint16_t        chap_tbl_idx;
+               } delete_chap;
        } u;
        union {
                /* messages k -> u */
@@ -247,7 +261,8 @@ struct iscsi_uevent {
                } host_event;
                struct msg_ping_comp {
                        uint32_t        host_no;
-                       uint32_t        status;
+                       uint32_t        status; /* enum
+                                                * iscsi_ping_status_code */
                        uint32_t        pid;    /* unique ping id associated
                                                   with each ping request */
                        uint32_t        data_size;
@@ -436,6 +451,9 @@ enum iscsi_param {
 
        ISCSI_PARAM_TGT_RESET_TMO,
        ISCSI_PARAM_TARGET_ALIAS,
+
+       ISCSI_PARAM_CHAP_IN_IDX,
+       ISCSI_PARAM_CHAP_OUT_IDX,
        /* must always be last */
        ISCSI_PARAM_MAX,
 };
@@ -466,6 +484,20 @@ enum iscsi_port_state {
        ISCSI_PORT_STATE_UP             = 0x2,
 };
 
+/* iSCSI PING status/error code */
+enum iscsi_ping_status_code {
+       ISCSI_PING_SUCCESS                      = 0,
+       ISCSI_PING_FW_DISABLED                  = 0x1,
+       ISCSI_PING_IPADDR_INVALID               = 0x2,
+       ISCSI_PING_LINKLOCAL_IPV6_ADDR_INVALID  = 0x3,
+       ISCSI_PING_TIMEOUT                      = 0x4,
+       ISCSI_PING_INVALID_DEST_ADDR            = 0x5,
+       ISCSI_PING_OVERSIZE_PACKET              = 0x6,
+       ISCSI_PING_ICMP_ERROR                   = 0x7,
+       ISCSI_PING_MAX_REQ_EXCEEDED             = 0x8,
+       ISCSI_PING_NO_ARP_RECEIVED              = 0x9,
+};
+
 #define iscsi_ptr(_handle) ((void*)(unsigned long)_handle)
 #define iscsi_handle(_ptr) ((uint64_t)(unsigned long)_ptr)
 
@@ -548,4 +580,19 @@ struct iscsi_stats {
                __attribute__ ((aligned (sizeof(uint64_t))));
 };
 
+enum chap_type_e {
+       CHAP_TYPE_OUT,
+       CHAP_TYPE_IN,
+};
+
+#define ISCSI_CHAP_AUTH_NAME_MAX_LEN   256
+#define ISCSI_CHAP_AUTH_SECRET_MAX_LEN 256
+struct iscsi_chap_rec {
+       uint16_t chap_tbl_idx;
+       enum chap_type_e chap_type;
+       char username[ISCSI_CHAP_AUTH_NAME_MAX_LEN];
+       uint8_t password[ISCSI_CHAP_AUTH_SECRET_MAX_LEN];
+       uint8_t password_length;
+};
+
 #endif