aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/sbp2.h')
-rw-r--r--drivers/ieee1394/sbp2.h37
1 files changed, 22 insertions, 15 deletions
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h
index b22ce1aa8fe4..abbe48e646c3 100644
--- a/drivers/ieee1394/sbp2.h
+++ b/drivers/ieee1394/sbp2.h
@@ -46,8 +46,8 @@
46#define ORB_SET_DIRECTION(value) ((value & 0x1) << 27) 46#define ORB_SET_DIRECTION(value) ((value & 0x1) << 27)
47 47
48struct sbp2_command_orb { 48struct sbp2_command_orb {
49 volatile u32 next_ORB_hi; 49 u32 next_ORB_hi;
50 volatile u32 next_ORB_lo; 50 u32 next_ORB_lo;
51 u32 data_descriptor_hi; 51 u32 data_descriptor_hi;
52 u32 data_descriptor_lo; 52 u32 data_descriptor_lo;
53 u32 misc; 53 u32 misc;
@@ -180,12 +180,14 @@ struct sbp2_unrestricted_page_table {
180 180
181#define SBP2_SCSI_STATUS_SELECTION_TIMEOUT 0xff 181#define SBP2_SCSI_STATUS_SELECTION_TIMEOUT 0xff
182 182
183#define STATUS_GET_ORB_OFFSET_HI(value) (value & 0xffff) 183#define STATUS_GET_SRC(value) (((value) >> 30) & 0x3)
184#define STATUS_GET_SBP_STATUS(value) ((value >> 16) & 0xff) 184#define STATUS_GET_RESP(value) (((value) >> 28) & 0x3)
185#define STATUS_GET_LENGTH(value) ((value >> 24) & 0x7) 185#define STATUS_GET_LEN(value) (((value) >> 24) & 0x7)
186#define STATUS_GET_DEAD_BIT(value) ((value >> 27) & 0x1) 186#define STATUS_GET_SBP_STATUS(value) (((value) >> 16) & 0xff)
187#define STATUS_GET_RESP(value) ((value >> 28) & 0x3) 187#define STATUS_GET_ORB_OFFSET_HI(value) ((value) & 0x0000ffff)
188#define STATUS_GET_SRC(value) ((value >> 30) & 0x3) 188#define STATUS_TEST_DEAD(value) ((value) & 0x08000000)
189/* test 'resp' | 'dead' | 'sbp2_status' */
190#define STATUS_TEST_RDS(value) ((value) & 0x38ff0000)
189 191
190struct sbp2_status_block { 192struct sbp2_status_block {
191 u32 ORB_offset_hi_misc; 193 u32 ORB_offset_hi_misc;
@@ -318,9 +320,9 @@ struct scsi_id_instance_data {
318 u64 status_fifo_addr; 320 u64 status_fifo_addr;
319 321
320 /* 322 /*
321 * Variable used for logins, reconnects, logouts, query logins 323 * Waitqueue flag for logins, reconnects, logouts, query logins
322 */ 324 */
323 atomic_t sbp2_login_complete; 325 int access_complete:1;
324 326
325 /* 327 /*
326 * Pool of command orbs, so we can have more than overlapped command per id 328 * Pool of command orbs, so we can have more than overlapped command per id
@@ -344,6 +346,16 @@ struct scsi_id_instance_data {
344 346
345 /* Device specific workarounds/brokeness */ 347 /* Device specific workarounds/brokeness */
346 unsigned workarounds; 348 unsigned workarounds;
349
350 atomic_t state;
351 struct work_struct protocol_work;
352};
353
354/* For use in scsi_id_instance_data.state */
355enum sbp2lu_state_types {
356 SBP2LU_STATE_RUNNING, /* all normal */
357 SBP2LU_STATE_IN_RESET, /* between bus reset and reconnect */
358 SBP2LU_STATE_IN_SHUTDOWN /* when sbp2_remove was called */
347}; 359};
348 360
349/* Sbp2 host data structure (one per IEEE1394 host) */ 361/* Sbp2 host data structure (one per IEEE1394 host) */
@@ -390,11 +402,6 @@ static int sbp2_logout_device(struct scsi_id_instance_data *scsi_id);
390static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int destid, 402static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int destid,
391 quadlet_t *data, u64 addr, size_t length, u16 flags); 403 quadlet_t *data, u64 addr, size_t length, u16 flags);
392static int sbp2_agent_reset(struct scsi_id_instance_data *scsi_id, int wait); 404static int sbp2_agent_reset(struct scsi_id_instance_data *scsi_id, int wait);
393static int sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id,
394 struct sbp2_command_info *command);
395static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
396 struct scsi_cmnd *SCpnt,
397 void (*done)(struct scsi_cmnd *));
398static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status, 405static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status,
399 unchar *sense_data); 406 unchar *sense_data);
400static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id, 407static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,