Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15384
b: refs/heads/master
c: 365c786
h: refs/heads/master
v: v3
  • Loading branch information
Ben Collins authored and Jody McIntyre committed Nov 7, 2005
1 parent de08ded commit 18e0dd4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 151 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7945619794314414a5c44df11fca4d3f2a3389cf
refs/heads/master: 365c786f0be44ee92e018773cb0bc4b19080b6aa
151 changes: 2 additions & 149 deletions trunk/drivers/ieee1394/sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,16 +1088,6 @@ static int sbp2_handle_physdma_read(struct hpsb_host *host, int nodeid, quadlet_
* SBP-2 protocol related section
**************************************/

/*
* This function determines if we should convert scsi commands for a particular sbp2 device type
*/
static __inline__ int sbp2_command_conversion_device_type(u8 device_type)
{
return (((device_type == TYPE_DISK) ||
(device_type == TYPE_RBC) ||
(device_type == TYPE_ROM)) ? 1:0);
}

/*
* This function queries the device for the maximum concurrent logins it
* supports.
Expand Down Expand Up @@ -2106,11 +2096,6 @@ static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
sbp2_create_command_orb(scsi_id, command, cmd, SCpnt->use_sg,
request_bufflen, SCpnt->request_buffer,
SCpnt->sc_data_direction);
/*
* Update our cdb if necessary (to handle sbp2 RBC command set
* differences). This is where the command set hacks go! =)
*/
sbp2_check_sbp2_command(scsi_id, command->command_orb.cdb);

sbp2util_packet_dump(&command->command_orb, sizeof(struct sbp2_command_orb),
"sbp2 command orb", command->command_orb_dma);
Expand All @@ -2129,110 +2114,6 @@ static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
}


/*
* This function deals with command set differences between Linux scsi
* command set and sbp2 RBC command set.
*/
static void sbp2_check_sbp2_command(struct scsi_id_instance_data *scsi_id, unchar *cmd)
{
unchar new_cmd[16];
u8 device_type = SBP2_DEVICE_TYPE (scsi_id->sbp2_device_type_and_lun);

SBP2_DEBUG("sbp2_check_sbp2_command");

switch (*cmd) {

case READ_6:

if (sbp2_command_conversion_device_type(device_type)) {

SBP2_DEBUG("Convert READ_6 to READ_10");

/*
* Need to turn read_6 into read_10
*/
new_cmd[0] = 0x28;
new_cmd[1] = (cmd[1] & 0xe0);
new_cmd[2] = 0x0;
new_cmd[3] = (cmd[1] & 0x1f);
new_cmd[4] = cmd[2];
new_cmd[5] = cmd[3];
new_cmd[6] = 0x0;
new_cmd[7] = 0x0;
new_cmd[8] = cmd[4];
new_cmd[9] = cmd[5];

memcpy(cmd, new_cmd, 10);

}

break;

case WRITE_6:

if (sbp2_command_conversion_device_type(device_type)) {

SBP2_DEBUG("Convert WRITE_6 to WRITE_10");

/*
* Need to turn write_6 into write_10
*/
new_cmd[0] = 0x2a;
new_cmd[1] = (cmd[1] & 0xe0);
new_cmd[2] = 0x0;
new_cmd[3] = (cmd[1] & 0x1f);
new_cmd[4] = cmd[2];
new_cmd[5] = cmd[3];
new_cmd[6] = 0x0;
new_cmd[7] = 0x0;
new_cmd[8] = cmd[4];
new_cmd[9] = cmd[5];

memcpy(cmd, new_cmd, 10);

}

break;

case MODE_SENSE:

if (sbp2_command_conversion_device_type(device_type)) {

SBP2_DEBUG("Convert MODE_SENSE_6 to MODE_SENSE_10");

/*
* Need to turn mode_sense_6 into mode_sense_10
*/
new_cmd[0] = 0x5a;
new_cmd[1] = cmd[1];
new_cmd[2] = cmd[2];
new_cmd[3] = 0x0;
new_cmd[4] = 0x0;
new_cmd[5] = 0x0;
new_cmd[6] = 0x0;
new_cmd[7] = 0x0;
new_cmd[8] = cmd[4];
new_cmd[9] = cmd[5];

memcpy(cmd, new_cmd, 10);

}

break;

case MODE_SELECT:

/*
* TODO. Probably need to change mode select to 10 byte version
*/

default:
break;
}

return;
}

/*
* Translates SBP-2 status into SCSI sense data for check conditions
*/
Expand Down Expand Up @@ -2271,7 +2152,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
struct scsi_cmnd *SCpnt)
{
u8 *scsi_buf = SCpnt->request_buffer;
u8 device_type = SBP2_DEVICE_TYPE (scsi_id->sbp2_device_type_and_lun);

SBP2_DEBUG("sbp2_check_sbp2_response");

Expand All @@ -2295,14 +2175,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
scsi_buf[4] = 36 - 5;
}

/*
* Check for Simple Direct Access Device and change it to TYPE_DISK
*/
if ((scsi_buf[0] & 0x1f) == TYPE_RBC) {
SBP2_DEBUG("Changing TYPE_RBC to TYPE_DISK");
scsi_buf[0] &= 0xe0;
}

/*
* Fix ansi revision and response data format
*/
Expand All @@ -2311,27 +2183,6 @@ static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,

break;

case MODE_SENSE:

if (sbp2_command_conversion_device_type(device_type)) {

SBP2_DEBUG("Modify mode sense response (10 byte version)");

scsi_buf[0] = scsi_buf[1]; /* Mode data length */
scsi_buf[1] = scsi_buf[2]; /* Medium type */
scsi_buf[2] = scsi_buf[3]; /* Device specific parameter */
scsi_buf[3] = scsi_buf[7]; /* Block descriptor length */
memcpy(scsi_buf + 4, scsi_buf + 8, scsi_buf[0]);
}

break;

case MODE_SELECT:

/*
* TODO. Probably need to change mode select to 10 byte version
*/

default:
break;
}
Expand Down Expand Up @@ -2713,6 +2564,8 @@ static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
static int sbp2scsi_slave_configure(struct scsi_device *sdev)
{
blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
sdev->use_10_for_rw = 1;
sdev->use_10_for_ms = 1;
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/ieee1394/sbp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
struct scsi_cmnd *SCpnt,
void (*done)(struct scsi_cmnd *));
static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status, unchar *sense_data);
static void sbp2_check_sbp2_command(struct scsi_id_instance_data *scsi_id, unchar *cmd);
static void sbp2_check_sbp2_response(struct scsi_id_instance_data *scsi_id,
struct scsi_cmnd *SCpnt);
static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,
Expand Down

0 comments on commit 18e0dd4

Please sign in to comment.