aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-09-30 12:38:19 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-30 12:38:19 -0400
commit0cd43f83d381c4246a08cd775834833d6fd64805 (patch)
treee69ddf876edfb4ff7d5d5d0c6e7c2ff0be885492 /drivers/ieee1394/sbp2.h
parentdb1a19b38f3a85f475b4ad716c71be133d8ca48e (diff)
parent3253b669eed7194ae490acb4aadab7262bbfeb8d (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (48 commits) ieee1394: raw1394: arm functions slept in atomic context ieee1394: sbp2: enable auto spin-up for all SBP-2 devices MAINTAINERS: updates to IEEE 1394 subsystem maintainership ieee1394: ohci1394: check for errors in suspend or resume set power state of firewire host during suspend ieee1394: ohci1394: more obvious endianess handling ieee1394: ohci1394: fix endianess bug in debug message ieee1394: sbp2: don't prefer MODE SENSE 10 ieee1394: nodemgr: grab class.subsys.rwsem in nodemgr_resume_ne ieee1394: nodemgr: fix rwsem recursion ieee1394: sbp2: more help in Kconfig ieee1394: sbp2: prevent rare deadlock in shutdown ieee1394: sbp2: update includes ieee1394: sbp2: better handling of transport errors ieee1394: sbp2: recheck node generation in sbp2_update ieee1394: sbp2: safer agent reset in error handlers ieee1394: sbp2: handle "sbp2util_node_write_no_wait failed" CONFIG_PM=n slim: drivers/ieee1394/ohci1394.c ieee1394: safer definition of empty macros video1394: add poll file operation support ...
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,