Commit 45c20ae5 authored by David S. Miller's avatar David S. Miller

[SCSI PLUTO/FCAL]: Update for scsi_cmnd changes.

parent 681453cc
...@@ -292,11 +292,12 @@ static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmn ...@@ -292,11 +292,12 @@ static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmn
if (SCpnt->cmnd[1] & 0xe0) return -EINVAL; if (SCpnt->cmnd[1] & 0xe0) return -EINVAL;
/* FC-PLDA tells us... */ /* FC-PLDA tells us... */
memset(addr, 0, 8); memset(addr, 0, 8);
f = (struct fcal *)SCpnt->host->hostdata; f = (struct fcal *)SCpnt->device->host->hostdata;
if (!f->map[SCpnt->target]) return -EINVAL; if (!f->map[SCpnt->device->id])
return -EINVAL;
/* Now, determine DID: It will be Native Identifier, so we zero upper /* Now, determine DID: It will be Native Identifier, so we zero upper
2 bytes of the 3 byte DID, lowest byte will be AL-PA */ 2 bytes of the 3 byte DID, lowest byte will be AL-PA */
fcmd->did = target2alpa[SCpnt->target]; fcmd->did = target2alpa[SCpnt->device->id];
FCALD(("trying DID %06x\n", fcmd->did)) FCALD(("trying DID %06x\n", fcmd->did))
return 0; return 0;
} }
......
...@@ -156,12 +156,12 @@ int __init pluto_detect(Scsi_Host_Template *tpnt) ...@@ -156,12 +156,12 @@ int __init pluto_detect(Scsi_Host_Template *tpnt)
pluto->fc = fc; pluto->fc = fc;
SCpnt->host = host;
SCpnt->cmnd[0] = INQUIRY; SCpnt->cmnd[0] = INQUIRY;
SCpnt->cmnd[4] = 255; SCpnt->cmnd[4] = 255;
/* FC layer requires this, so that SCpnt->device->tagged_supported is initially 0 */ /* FC layer requires this, so that SCpnt->device->tagged_supported is initially 0 */
SCpnt->device = &dev; SCpnt->device = &dev;
dev.host = host;
SCpnt->cmd_len = COMMAND_SIZE(INQUIRY); SCpnt->cmd_len = COMMAND_SIZE(INQUIRY);
...@@ -325,16 +325,18 @@ const char *pluto_info(struct Scsi_Host *host) ...@@ -325,16 +325,18 @@ const char *pluto_info(struct Scsi_Host *host)
*/ */
static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd) static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd)
{ {
PLND(("encode addr %d %d %d\n", SCpnt->channel, SCpnt->target, SCpnt->cmnd[1] & 0xe0)) PLND(("encode addr %d %d %d\n", SCpnt->device->channel, SCpnt->device->id, SCpnt->cmnd[1] & 0xe0))
/* We don't support LUNs - neither does SSA :) */ /* We don't support LUNs - neither does SSA :) */
if (SCpnt->cmnd[1] & 0xe0) return -EINVAL; if (SCpnt->cmnd[1] & 0xe0)
if (!SCpnt->channel) { return -EINVAL;
if (SCpnt->target) return -EINVAL; if (!SCpnt->device->channel) {
if (SCpnt->device->id)
return -EINVAL;
memset (addr, 0, 4 * sizeof(u16)); memset (addr, 0, 4 * sizeof(u16));
} else { } else {
addr[0] = 1; addr[0] = 1;
addr[1] = SCpnt->channel - 1; addr[1] = SCpnt->device->channel - 1;
addr[2] = SCpnt->target; addr[2] = SCpnt->device->id;
addr[3] = 0; addr[3] = 0;
} }
/* We're Point-to-Point, so target it to the default DID */ /* We're Point-to-Point, so target it to the default DID */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment