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.h70
1 files changed, 8 insertions, 62 deletions
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h
index cd425be74841..900ea1d25e71 100644
--- a/drivers/ieee1394/sbp2.h
+++ b/drivers/ieee1394/sbp2.h
@@ -119,8 +119,8 @@ struct sbp2_query_logins_response {
119struct sbp2_reconnect_orb { 119struct sbp2_reconnect_orb {
120 u32 reserved1; 120 u32 reserved1;
121 u32 reserved2; 121 u32 reserved2;
122 u32 reserved3; 122 u32 reserved3;
123 u32 reserved4; 123 u32 reserved4;
124 u32 login_ID_misc; 124 u32 login_ID_misc;
125 u32 reserved5; 125 u32 reserved5;
126 u32 status_FIFO_hi; 126 u32 status_FIFO_hi;
@@ -130,8 +130,8 @@ struct sbp2_reconnect_orb {
130struct sbp2_logout_orb { 130struct sbp2_logout_orb {
131 u32 reserved1; 131 u32 reserved1;
132 u32 reserved2; 132 u32 reserved2;
133 u32 reserved3; 133 u32 reserved3;
134 u32 reserved4; 134 u32 reserved4;
135 u32 login_ID_misc; 135 u32 login_ID_misc;
136 u32 reserved5; 136 u32 reserved5;
137 u32 status_FIFO_hi; 137 u32 status_FIFO_hi;
@@ -188,7 +188,7 @@ struct sbp2_unrestricted_page_table {
188struct sbp2_status_block { 188struct sbp2_status_block {
189 u32 ORB_offset_hi_misc; 189 u32 ORB_offset_hi_misc;
190 u32 ORB_offset_lo; 190 u32 ORB_offset_lo;
191 u8 command_set_dependent[24]; 191 u8 command_set_dependent[24];
192}; 192};
193 193
194/* 194/*
@@ -211,7 +211,7 @@ struct sbp2_status_block {
211 * specified for write posting, where the ohci controller will 211 * specified for write posting, where the ohci controller will
212 * automatically send an ack_complete when the status is written by the 212 * automatically send an ack_complete when the status is written by the
213 * sbp2 device... saving a split transaction. =) 213 * sbp2 device... saving a split transaction. =)
214 */ 214 */
215#define SBP2_STATUS_FIFO_ADDRESS 0xfffe00000000ULL 215#define SBP2_STATUS_FIFO_ADDRESS 0xfffe00000000ULL
216#define SBP2_STATUS_FIFO_ADDRESS_HI 0xfffe 216#define SBP2_STATUS_FIFO_ADDRESS_HI 0xfffe
217#define SBP2_STATUS_FIFO_ADDRESS_LO 0x0 217#define SBP2_STATUS_FIFO_ADDRESS_LO 0x0
@@ -229,9 +229,6 @@ struct sbp2_status_block {
229#define SBP2_DEVICE_TYPE_AND_LUN_KEY 0x14 229#define SBP2_DEVICE_TYPE_AND_LUN_KEY 0x14
230#define SBP2_FIRMWARE_REVISION_KEY 0x3c 230#define SBP2_FIRMWARE_REVISION_KEY 0x3c
231 231
232#define SBP2_DEVICE_TYPE(q) (((q) >> 16) & 0x1f)
233#define SBP2_DEVICE_LUN(q) ((q) & 0xffff)
234
235#define SBP2_AGENT_STATE_OFFSET 0x00ULL 232#define SBP2_AGENT_STATE_OFFSET 0x00ULL
236#define SBP2_AGENT_RESET_OFFSET 0x04ULL 233#define SBP2_AGENT_RESET_OFFSET 0x04ULL
237#define SBP2_ORB_POINTER_OFFSET 0x08ULL 234#define SBP2_ORB_POINTER_OFFSET 0x08ULL
@@ -256,8 +253,6 @@ struct sbp2_status_block {
256 */ 253 */
257#define SBP2_128KB_BROKEN_FIRMWARE 0xa0b800 254#define SBP2_128KB_BROKEN_FIRMWARE 0xa0b800
258 255
259#define SBP2_DEVICE_TYPE_LUN_UNINITIALIZED 0xffffffff
260
261/* 256/*
262 * SCSI specific stuff 257 * SCSI specific stuff
263 */ 258 */
@@ -265,45 +260,7 @@ struct sbp2_status_block {
265#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000 260#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
266#define SBP2_MAX_UDS_PER_NODE 16 /* Maximum scsi devices per node */ 261#define SBP2_MAX_UDS_PER_NODE 16 /* Maximum scsi devices per node */
267#define SBP2_MAX_SECTORS 255 /* Max sectors supported */ 262#define SBP2_MAX_SECTORS 255 /* Max sectors supported */
268 263#define SBP2_MAX_CMDS 8 /* This should be safe */
269/*
270 * SCSI direction table...
271 * (now used as a back-up in case the direction passed down from above is "unknown")
272 *
273 * DIN = IN data direction
274 * DOU = OUT data direction
275 * DNO = No data transfer
276 * DUN = Unknown data direction
277 *
278 * Opcode 0xec (Teac specific "opc execute") possibly should be DNO,
279 * but we'll change it when somebody reports a problem with this.
280 */
281#define DIN ORB_DIRECTION_READ_FROM_MEDIA
282#define DOU ORB_DIRECTION_WRITE_TO_MEDIA
283#define DNO ORB_DIRECTION_NO_DATA_TRANSFER
284#define DUN DIN
285
286static unchar sbp2scsi_direction_table[0x100] = {
287 DNO,DNO,DIN,DIN,DOU,DIN,DIN,DOU,DIN,DUN,DOU,DOU,DUN,DUN,DUN,DIN,
288 DNO,DIN,DIN,DOU,DIN,DOU,DNO,DNO,DOU,DNO,DIN,DNO,DIN,DOU,DNO,DUN,
289 DIN,DUN,DIN,DIN,DOU,DIN,DUN,DUN,DIN,DIN,DOU,DNO,DUN,DIN,DOU,DOU,
290 DOU,DOU,DOU,DNO,DIN,DNO,DNO,DIN,DOU,DOU,DOU,DOU,DIN,DOU,DIN,DOU,
291 DOU,DOU,DIN,DIN,DIN,DNO,DIN,DNO,DNO,DNO,DUN,DNO,DOU,DIN,DNO,DUN,
292 DUN,DIN,DIN,DNO,DNO,DOU,DUN,DUN,DNO,DIN,DIN,DNO,DIN,DOU,DUN,DUN,
293 DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
294 DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
295 DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
296 DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
297 DUN,DNO,DOU,DOU,DIN,DNO,DNO,DNO,DIN,DNO,DOU,DUN,DNO,DIN,DOU,DOU,
298 DOU,DOU,DOU,DNO,DUN,DIN,DOU,DIN,DIN,DIN,DNO,DNO,DNO,DIN,DIN,DUN,
299 DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
300 DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,
301 DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DOU,DUN,DUN,DUN,DUN,DUN,
302 DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN,DUN
303};
304
305/* This should be safe */
306#define SBP2_MAX_CMDS 8
307 264
308/* This is the two dma types we use for cmd_dma below */ 265/* This is the two dma types we use for cmd_dma below */
309enum cmd_dma_types { 266enum cmd_dma_types {
@@ -338,10 +295,8 @@ struct sbp2_command_info {
338#define SBP2_BREAKAGE_128K_MAX_TRANSFER 0x1 295#define SBP2_BREAKAGE_128K_MAX_TRANSFER 0x1
339#define SBP2_BREAKAGE_INQUIRY_HACK 0x2 296#define SBP2_BREAKAGE_INQUIRY_HACK 0x2
340 297
341
342struct sbp2scsi_host_info; 298struct sbp2scsi_host_info;
343 299
344
345/* 300/*
346 * Information needed on a per scsi id basis (one for each sbp2 device) 301 * Information needed on a per scsi id basis (one for each sbp2 device)
347 */ 302 */
@@ -379,7 +334,7 @@ struct scsi_id_instance_data {
379 u32 sbp2_command_set_spec_id; 334 u32 sbp2_command_set_spec_id;
380 u32 sbp2_command_set; 335 u32 sbp2_command_set;
381 u32 sbp2_unit_characteristics; 336 u32 sbp2_unit_characteristics;
382 u32 sbp2_device_type_and_lun; 337 u32 sbp2_lun;
383 u32 sbp2_firmware_revision; 338 u32 sbp2_firmware_revision;
384 339
385 /* 340 /*
@@ -411,7 +366,6 @@ struct scsi_id_instance_data {
411 u32 workarounds; 366 u32 workarounds;
412}; 367};
413 368
414
415/* Sbp2 host data structure (one per IEEE1394 host) */ 369/* Sbp2 host data structure (one per IEEE1394 host) */
416struct sbp2scsi_host_info { 370struct sbp2scsi_host_info {
417 struct hpsb_host *host; /* IEEE1394 host */ 371 struct hpsb_host *host; /* IEEE1394 host */
@@ -456,20 +410,12 @@ static int sbp2_logout_device(struct scsi_id_instance_data *scsi_id);
456static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int destid, 410static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int destid,
457 quadlet_t *data, u64 addr, size_t length, u16 flags); 411 quadlet_t *data, u64 addr, size_t length, u16 flags);
458static int sbp2_agent_reset(struct scsi_id_instance_data *scsi_id, int wait); 412static int sbp2_agent_reset(struct scsi_id_instance_data *scsi_id, int wait);
459static int sbp2_create_command_orb(struct scsi_id_instance_data *scsi_id,
460 struct sbp2_command_info *command,
461 unchar *scsi_cmd,
462 unsigned int scsi_use_sg,
463 unsigned int scsi_request_bufflen,
464 void *scsi_request_buffer,
465 enum dma_data_direction dma_dir);
466static int sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id, 413static int sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id,
467 struct sbp2_command_info *command); 414 struct sbp2_command_info *command);
468static int sbp2_send_command(struct scsi_id_instance_data *scsi_id, 415static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
469 struct scsi_cmnd *SCpnt, 416 struct scsi_cmnd *SCpnt,
470 void (*done)(struct scsi_cmnd *)); 417 void (*done)(struct scsi_cmnd *));
471static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status, unchar *sense_data); 418static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status, unchar *sense_data);
472static void sbp2_check_sbp2_command(struct scsi_id_instance_data *scsi_id, unchar *cmd);
473static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id, 419static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
474 struct scsi_cmnd *SCpnt); 420 struct scsi_cmnd *SCpnt);
475static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id, 421static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,