Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57022
b: refs/heads/master
c: e0b2e59
h: refs/heads/master
v: v3
  • Loading branch information
Ed Lin authored and James Bottomley committed May 16, 2007
1 parent 2276407 commit d5c47f6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 33 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: 5af23d263c33a3f6fc93facfd87d2a091eff2060
refs/heads/master: e0b2e597d5dd8c4f3778545f65c29a9c6aba0e3a
1 change: 1 addition & 0 deletions trunk/drivers/scsi/scsi_devinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ static struct {
{"PIONEER", "CD-ROM DRM-602X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"PIONEER", "CD-ROM DRM-604X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"PIONEER", "CD-ROM DRM-624X", NULL, BLIST_FORCELUN | BLIST_SINGLELUN},
{"Promise", "", NULL, BLIST_SPARSELUN},
{"REGAL", "CDC-4X", NULL, BLIST_MAX5LUN | BLIST_SINGLELUN},
{"SanDisk", "ImageMate CF-SD1", NULL, BLIST_FORCELUN},
{"SEAGATE", "ST34555N", "0930", BLIST_NOTQ}, /* Chokes on tagged INQUIRY */
Expand Down
60 changes: 28 additions & 32 deletions trunk/drivers/scsi/stex.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ enum {
SG_CF_64B = 0x40, /* 64 bit item */
SG_CF_HOST = 0x20, /* sg in host memory */

ST_MAX_ARRAY_SUPPORTED = 16,
ST_MAX_TARGET_NUM = (ST_MAX_ARRAY_SUPPORTED+1),
ST_MAX_LUN_PER_TARGET = 16,

st_shasta = 0,
st_vsc = 1,
st_vsc1 = 2,
Expand Down Expand Up @@ -586,7 +582,7 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
u16 tag;
host = cmd->device->host;
id = cmd->device->id;
lun = cmd->device->channel; /* firmware lun issue work around */
lun = cmd->device->lun;
hba = (struct st_hba *) &host->hostdata[0];

switch (cmd->cmnd[0]) {
Expand All @@ -605,8 +601,19 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
stex_invalid_field(cmd, done);
return 0;
}
case REPORT_LUNS:
/*
* The shasta firmware does not report actual luns in the
* target, so fail the command to force sequential lun scan.
* Also, the console device does not support this command.
*/
if (hba->cardtype == st_shasta || id == host->max_id - 1) {
stex_invalid_field(cmd, done);
return 0;
}
break;
case INQUIRY:
if (id != ST_MAX_ARRAY_SUPPORTED)
if (id != host->max_id - 1)
break;
if (lun == 0 && (cmd->cmnd[1] & INQUIRY_EVPD) == 0) {
stex_direct_copy(cmd, console_inq_page,
Expand All @@ -624,7 +631,7 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))
ver.oem = ST_OEM;
ver.build = ST_BUILD_VER;
ver.signature[0] = PASSTHRU_SIGNATURE;
ver.console_id = ST_MAX_ARRAY_SUPPORTED;
ver.console_id = host->max_id - 1;
ver.host_no = hba->host->host_no;
cmd->result = stex_direct_copy(cmd, &ver, sizeof(ver)) ?
DID_OK << 16 | COMMAND_COMPLETE << 8 :
Expand All @@ -645,13 +652,8 @@ stex_queuecommand(struct scsi_cmnd *cmd, void (* done)(struct scsi_cmnd *))

req = stex_alloc_req(hba);

if (hba->cardtype == st_yosemite) {
req->lun = lun * (ST_MAX_TARGET_NUM - 1) + id;
req->target = 0;
} else {
req->lun = lun;
req->target = id;
}
req->lun = lun;
req->target = id;

/* cdb */
memcpy(req->cdb, cmd->cmnd, STEX_CDB_LENGTH);
Expand Down Expand Up @@ -767,18 +769,6 @@ static void stex_ys_commands(struct st_hba *hba,
ccb->srb_status = SRB_STATUS_SELECTION_TIMEOUT;
else
ccb->srb_status = SRB_STATUS_SUCCESS;
} else if (ccb->cmd->cmnd[0] == REPORT_LUNS) {
u8 *report_lun_data = (u8 *)hba->copy_buffer;

count = STEX_EXTRA_SIZE;
stex_internal_copy(ccb->cmd, report_lun_data,
&count, ccb->sg_count, ST_FROM_CMD);
if (report_lun_data[2] || report_lun_data[3]) {
report_lun_data[2] = 0x00;
report_lun_data[3] = 0x08;
stex_internal_copy(ccb->cmd, report_lun_data,
&count, ccb->sg_count, ST_TO_CMD);
}
}
}

Expand Down Expand Up @@ -1229,12 +1219,18 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
hba->copy_buffer = hba->dma_mem + MU_BUFFER_SIZE;
hba->mu_status = MU_STATE_STARTING;

/* firmware uses id/lun pair for a logical drive, but lun would be
always 0 if CONFIG_SCSI_MULTI_LUN not configured, so we use
channel to map lun here */
host->max_channel = ST_MAX_LUN_PER_TARGET - 1;
host->max_id = ST_MAX_TARGET_NUM;
host->max_lun = 1;
if (hba->cardtype == st_shasta) {
host->max_lun = 8;
host->max_id = 16 + 1;
} else if (hba->cardtype == st_yosemite) {
host->max_lun = 128;
host->max_id = 1 + 1;
} else {
/* st_vsc and st_vsc1 */
host->max_lun = 1;
host->max_id = 128 + 1;
}
host->max_channel = 0;
host->unique_id = host->host_no;
host->max_cmd_len = STEX_CDB_LENGTH;

Expand Down

0 comments on commit d5c47f6

Please sign in to comment.