]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ieee1394/sbp2.h
Pull sbs into release branch
[linux-2.6-omap-h63xx.git] / drivers / ieee1394 / sbp2.h
index d1dbc0d6317782df117b37693b8b0c339417b9b5..333a4bb767434997bc0fa06e6fd922a063d46c86 100644 (file)
@@ -67,7 +67,7 @@ struct sbp2_command_orb {
 #define ORB_SET_LUN(v)                 ((v) & 0xffff)
 #define ORB_SET_FUNCTION(v)            (((v) & 0xf) << 16)
 #define ORB_SET_RECONNECT(v)           (((v) & 0xf) << 20)
-#define ORB_SET_EXCLUSIVE(v)           (((v) & 0x1) << 28)
+#define ORB_SET_EXCLUSIVE(v)           ((v) ? 1 << 28 : 0)
 #define ORB_SET_LOGIN_RESP_LENGTH(v)   ((v) & 0xffff)
 #define ORB_SET_PASSWD_LENGTH(v)       (((v) & 0xffff) << 16)
 
@@ -241,7 +241,7 @@ struct sbp2_status_block {
  * Representations of commands and devices
  */
 
-enum cmd_dma_types {
+enum sbp2_dma_types {
        CMD_DMA_NONE,
        CMD_DMA_PAGE,
        CMD_DMA_SINGLE
@@ -250,29 +250,30 @@ enum cmd_dma_types {
 /* Per SCSI command */
 struct sbp2_command_info {
        struct list_head list;
-       struct sbp2_command_orb command_orb ____cacheline_aligned;
-       dma_addr_t command_orb_dma ____cacheline_aligned;
+       struct sbp2_command_orb command_orb;
+       dma_addr_t command_orb_dma;
        struct scsi_cmnd *Current_SCpnt;
        void (*Current_done)(struct scsi_cmnd *);
 
        /* Also need s/g structure for each sbp2 command */
-       struct sbp2_unrestricted_page_table scatter_gather_element[SG_ALL] ____cacheline_aligned;
-       dma_addr_t sge_dma ____cacheline_aligned;
+       struct sbp2_unrestricted_page_table
+               scatter_gather_element[SG_ALL] __attribute__((aligned(8)));
+       dma_addr_t sge_dma;
        void *sge_buffer;
        dma_addr_t cmd_dma;
-       enum cmd_dma_types dma_type;
+       enum sbp2_dma_types dma_type;
        unsigned long dma_size;
-       int dma_dir;
+       enum dma_data_direction dma_dir;
 };
 
 /* Per FireWire host */
-struct sbp2scsi_host_info {
+struct sbp2_fwhost_info {
        struct hpsb_host *host;
-       struct list_head scsi_ids;
+       struct list_head logical_units;
 };
 
 /* Per logical unit */
-struct scsi_id_instance_data {
+struct sbp2_lu {
        /* Operation request blocks */
        struct sbp2_command_orb *last_orb;
        dma_addr_t last_orb_dma;
@@ -291,32 +292,26 @@ struct scsi_id_instance_data {
        struct sbp2_status_block status_block;
 
        /* How to talk to the unit */
-       u64 sbp2_management_agent_addr;
-       u64 sbp2_command_block_agent_addr;
+       u64 management_agent_addr;
+       u64 command_block_agent_addr;
        u32 speed_code;
        u32 max_payload_size;
-
-       /* Pulled from the device's unit directory */
-       u32 sbp2_command_set_spec_id;
-       u32 sbp2_command_set;
-       u32 sbp2_unit_characteristics;
-       u32 sbp2_lun;
-       u32 sbp2_firmware_revision;
+       u16 lun;
 
        /* Address for the unit to write status blocks to */
        u64 status_fifo_addr;
 
        /* Waitqueue flag for logins, reconnects, logouts, query logins */
-       int access_complete:1;
+       unsigned int access_complete:1;
 
        /* Pool of command ORBs for this logical unit */
-       spinlock_t sbp2_command_orb_lock;
-       struct list_head sbp2_command_orb_inuse;
-       struct list_head sbp2_command_orb_completed;
+       spinlock_t cmd_orb_lock;
+       struct list_head cmd_orb_inuse;
+       struct list_head cmd_orb_completed;
 
        /* Backlink to FireWire host; list of units attached to the host */
-       struct sbp2scsi_host_info *hi;
-       struct list_head scsi_list;
+       struct sbp2_fwhost_info *hi;
+       struct list_head lu_list;
 
        /* IEEE 1394 core's device representations */
        struct node_entry *ne;
@@ -324,7 +319,7 @@ struct scsi_id_instance_data {
 
        /* SCSI core's device representations */
        struct scsi_device *sdev;
-       struct Scsi_Host *scsi_host;
+       struct Scsi_Host *shost;
 
        /* Device specific workarounds/brokeness */
        unsigned workarounds;
@@ -336,14 +331,14 @@ struct scsi_id_instance_data {
        struct work_struct protocol_work;
 };
 
-/* For use in scsi_id_instance_data.state */
+/* For use in sbp2_lu.state */
 enum sbp2lu_state_types {
        SBP2LU_STATE_RUNNING,           /* all normal */
        SBP2LU_STATE_IN_RESET,          /* between bus reset and reconnect */
        SBP2LU_STATE_IN_SHUTDOWN        /* when sbp2_remove was called */
 };
 
-/* For use in scsi_id_instance_data.workarounds and in the corresponding
+/* For use in sbp2_lu.workarounds and in the corresponding
  * module load parameter */
 #define SBP2_WORKAROUND_128K_MAX_TRANS 0x1
 #define SBP2_WORKAROUND_INQUIRY_36     0x2