SCSI: add asynchronous event notification API
[safe/jmp/linux-2.6] / include / scsi / libiscsi.h
index 2f303a3..b4b3113 100644 (file)
@@ -72,6 +72,8 @@ struct iscsi_nopin;
 #define ISCSI_AGE_SHIFT                        28
 #define ISCSI_AGE_MASK                 (0xf << ISCSI_AGE_SHIFT)
 
+#define ISCSI_ADDRESS_BUF_LEN          64
+
 struct iscsi_mgmt_task {
        /*
         * Becuae LLDs allocate their hdr differently, this is a pointer to
@@ -174,6 +176,12 @@ struct iscsi_conn {
        /* values userspace uses to id a conn */
        int                     persistent_port;
        char                    *persistent_address;
+       /* remote portal currently connected to */
+       int                     portal_port;
+       char                    portal_address[ISCSI_ADDRESS_BUF_LEN];
+       /* local address */
+       int                     local_port;
+       char                    local_address[ISCSI_ADDRESS_BUF_LEN];
 
        /* MIB-statistics */
        uint64_t                txdata_octets;
@@ -197,11 +205,21 @@ struct iscsi_queue {
 };
 
 struct iscsi_session {
+       /*
+        * Syncs up the scsi eh thread with the iscsi eh thread when sending
+        * task management functions. This must be taken before the session
+        * and recv lock.
+        */
+       struct mutex            eh_mutex;
+
        /* iSCSI session-wide sequencing */
        uint32_t                cmdsn;
        uint32_t                exp_cmdsn;
        uint32_t                max_cmdsn;
 
+       /* This tracks the reqs queued into the initiator */
+       uint32_t                queued_cmdsn;
+
        /* configuration */
        int                     initial_r2t_en;
        unsigned                max_r2t;
@@ -220,8 +238,9 @@ struct iscsi_session {
        char                    *password_in;
        char                    *targetname;
        char                    *initiatorname;
-       /* hw address being used for iscsi connection */
+       /* hw address or netdev iscsi connection is bound to */
        char                    *hwaddress;
+       char                    *netdev;
        /* control data */
        struct iscsi_transport  *tt;
        struct Scsi_Host        *host;