diff options
author | Hannes Reinecke <hare@suse.de> | 2014-06-25 09:27:36 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-17 16:07:37 -0400 |
commit | 9cb78c16f5dadefd8dc5ba0ae5a2f26cd59419b3 (patch) | |
tree | 576b86c3ec56dd7176285ec2d27f27ca55f77bc3 /drivers/scsi/wd33c93.c | |
parent | 755f516bbb983915d6cbfb5aa592cc0a5a99fd00 (diff) |
scsi: use 64-bit LUNs
The SCSI standard defines 64-bit values for LUNs, and large arrays
employing large or hierarchical LUN numbers become more and more
common.
So update the linux SCSI stack to use 64-bit LUN numbers.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/wd33c93.c')
-rw-r--r-- | drivers/scsi/wd33c93.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c index 41883a87931d..c0506de4f3b6 100644 --- a/drivers/scsi/wd33c93.c +++ b/drivers/scsi/wd33c93.c | |||
@@ -502,7 +502,8 @@ wd33c93_execute(struct Scsi_Host *instance) | |||
502 | cmd = (struct scsi_cmnd *) hostdata->input_Q; | 502 | cmd = (struct scsi_cmnd *) hostdata->input_Q; |
503 | prev = NULL; | 503 | prev = NULL; |
504 | while (cmd) { | 504 | while (cmd) { |
505 | if (!(hostdata->busy[cmd->device->id] & (1 << cmd->device->lun))) | 505 | if (!(hostdata->busy[cmd->device->id] & |
506 | (1 << (cmd->device->lun & 0xff)))) | ||
506 | break; | 507 | break; |
507 | prev = cmd; | 508 | prev = cmd; |
508 | cmd = (struct scsi_cmnd *) cmd->host_scribble; | 509 | cmd = (struct scsi_cmnd *) cmd->host_scribble; |
@@ -593,10 +594,10 @@ wd33c93_execute(struct Scsi_Host *instance) | |||
593 | 594 | ||
594 | write_wd33c93(regs, WD_SOURCE_ID, ((cmd->SCp.phase) ? SRCID_ER : 0)); | 595 | write_wd33c93(regs, WD_SOURCE_ID, ((cmd->SCp.phase) ? SRCID_ER : 0)); |
595 | 596 | ||
596 | write_wd33c93(regs, WD_TARGET_LUN, cmd->device->lun); | 597 | write_wd33c93(regs, WD_TARGET_LUN, (u8)cmd->device->lun); |
597 | write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER, | 598 | write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER, |
598 | hostdata->sync_xfer[cmd->device->id]); | 599 | hostdata->sync_xfer[cmd->device->id]); |
599 | hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); | 600 | hostdata->busy[cmd->device->id] |= (1 << (cmd->device->lun & 0xFF)); |
600 | 601 | ||
601 | if ((hostdata->level2 == L2_NONE) || | 602 | if ((hostdata->level2 == L2_NONE) || |
602 | (hostdata->sync_stat[cmd->device->id] == SS_UNSET)) { | 603 | (hostdata->sync_stat[cmd->device->id] == SS_UNSET)) { |
@@ -862,7 +863,7 @@ wd33c93_intr(struct Scsi_Host *instance) | |||
862 | } | 863 | } |
863 | 864 | ||
864 | cmd->result = DID_NO_CONNECT << 16; | 865 | cmd->result = DID_NO_CONNECT << 16; |
865 | hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); | 866 | hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); |
866 | hostdata->state = S_UNCONNECTED; | 867 | hostdata->state = S_UNCONNECTED; |
867 | cmd->scsi_done(cmd); | 868 | cmd->scsi_done(cmd); |
868 | 869 | ||
@@ -895,7 +896,7 @@ wd33c93_intr(struct Scsi_Host *instance) | |||
895 | 896 | ||
896 | /* construct an IDENTIFY message with correct disconnect bit */ | 897 | /* construct an IDENTIFY message with correct disconnect bit */ |
897 | 898 | ||
898 | hostdata->outgoing_msg[0] = (0x80 | 0x00 | cmd->device->lun); | 899 | hostdata->outgoing_msg[0] = IDENTIFY(0, cmd->device->lun); |
899 | if (cmd->SCp.phase) | 900 | if (cmd->SCp.phase) |
900 | hostdata->outgoing_msg[0] |= 0x40; | 901 | hostdata->outgoing_msg[0] |= 0x40; |
901 | 902 | ||
@@ -1179,7 +1180,7 @@ wd33c93_intr(struct Scsi_Host *instance) | |||
1179 | lun = read_wd33c93(regs, WD_TARGET_LUN); | 1180 | lun = read_wd33c93(regs, WD_TARGET_LUN); |
1180 | DB(DB_INTR, printk(":%d.%d", cmd->SCp.Status, lun)) | 1181 | DB(DB_INTR, printk(":%d.%d", cmd->SCp.Status, lun)) |
1181 | hostdata->connected = NULL; | 1182 | hostdata->connected = NULL; |
1182 | hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); | 1183 | hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); |
1183 | hostdata->state = S_UNCONNECTED; | 1184 | hostdata->state = S_UNCONNECTED; |
1184 | if (cmd->SCp.Status == ILLEGAL_STATUS_BYTE) | 1185 | if (cmd->SCp.Status == ILLEGAL_STATUS_BYTE) |
1185 | cmd->SCp.Status = lun; | 1186 | cmd->SCp.Status = lun; |
@@ -1268,7 +1269,7 @@ wd33c93_intr(struct Scsi_Host *instance) | |||
1268 | } | 1269 | } |
1269 | DB(DB_INTR, printk("UNEXP_DISC")) | 1270 | DB(DB_INTR, printk("UNEXP_DISC")) |
1270 | hostdata->connected = NULL; | 1271 | hostdata->connected = NULL; |
1271 | hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); | 1272 | hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); |
1272 | hostdata->state = S_UNCONNECTED; | 1273 | hostdata->state = S_UNCONNECTED; |
1273 | if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != GOOD) | 1274 | if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != GOOD) |
1274 | cmd->result = | 1275 | cmd->result = |
@@ -1300,7 +1301,7 @@ wd33c93_intr(struct Scsi_Host *instance) | |||
1300 | switch (hostdata->state) { | 1301 | switch (hostdata->state) { |
1301 | case S_PRE_CMP_DISC: | 1302 | case S_PRE_CMP_DISC: |
1302 | hostdata->connected = NULL; | 1303 | hostdata->connected = NULL; |
1303 | hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); | 1304 | hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); |
1304 | hostdata->state = S_UNCONNECTED; | 1305 | hostdata->state = S_UNCONNECTED; |
1305 | DB(DB_INTR, printk(":%d", cmd->SCp.Status)) | 1306 | DB(DB_INTR, printk(":%d", cmd->SCp.Status)) |
1306 | if (cmd->cmnd[0] == REQUEST_SENSE | 1307 | if (cmd->cmnd[0] == REQUEST_SENSE |
@@ -1353,7 +1354,7 @@ wd33c93_intr(struct Scsi_Host *instance) | |||
1353 | if (hostdata->selecting) { | 1354 | if (hostdata->selecting) { |
1354 | cmd = (struct scsi_cmnd *) hostdata->selecting; | 1355 | cmd = (struct scsi_cmnd *) hostdata->selecting; |
1355 | hostdata->selecting = NULL; | 1356 | hostdata->selecting = NULL; |
1356 | hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); | 1357 | hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); |
1357 | cmd->host_scribble = | 1358 | cmd->host_scribble = |
1358 | (uchar *) hostdata->input_Q; | 1359 | (uchar *) hostdata->input_Q; |
1359 | hostdata->input_Q = cmd; | 1360 | hostdata->input_Q = cmd; |
@@ -1365,7 +1366,7 @@ wd33c93_intr(struct Scsi_Host *instance) | |||
1365 | if (cmd) { | 1366 | if (cmd) { |
1366 | if (phs == 0x00) { | 1367 | if (phs == 0x00) { |
1367 | hostdata->busy[cmd->device->id] &= | 1368 | hostdata->busy[cmd->device->id] &= |
1368 | ~(1 << cmd->device->lun); | 1369 | ~(1 << (cmd->device->lun & 0xff)); |
1369 | cmd->host_scribble = | 1370 | cmd->host_scribble = |
1370 | (uchar *) hostdata->input_Q; | 1371 | (uchar *) hostdata->input_Q; |
1371 | hostdata->input_Q = cmd; | 1372 | hostdata->input_Q = cmd; |
@@ -1448,7 +1449,7 @@ wd33c93_intr(struct Scsi_Host *instance) | |||
1448 | cmd = (struct scsi_cmnd *) hostdata->disconnected_Q; | 1449 | cmd = (struct scsi_cmnd *) hostdata->disconnected_Q; |
1449 | patch = NULL; | 1450 | patch = NULL; |
1450 | while (cmd) { | 1451 | while (cmd) { |
1451 | if (id == cmd->device->id && lun == cmd->device->lun) | 1452 | if (id == cmd->device->id && lun == (u8)cmd->device->lun) |
1452 | break; | 1453 | break; |
1453 | patch = cmd; | 1454 | patch = cmd; |
1454 | cmd = (struct scsi_cmnd *) cmd->host_scribble; | 1455 | cmd = (struct scsi_cmnd *) cmd->host_scribble; |
@@ -1459,7 +1460,7 @@ wd33c93_intr(struct Scsi_Host *instance) | |||
1459 | if (!cmd) { | 1460 | if (!cmd) { |
1460 | printk | 1461 | printk |
1461 | ("---TROUBLE: target %d.%d not in disconnect queue---", | 1462 | ("---TROUBLE: target %d.%d not in disconnect queue---", |
1462 | id, lun); | 1463 | id, (u8)lun); |
1463 | spin_unlock_irqrestore(&hostdata->lock, flags); | 1464 | spin_unlock_irqrestore(&hostdata->lock, flags); |
1464 | return; | 1465 | return; |
1465 | } | 1466 | } |
@@ -1705,7 +1706,7 @@ wd33c93_abort(struct scsi_cmnd * cmd) | |||
1705 | sr = read_wd33c93(regs, WD_SCSI_STATUS); | 1706 | sr = read_wd33c93(regs, WD_SCSI_STATUS); |
1706 | printk("asr=%02x, sr=%02x.", asr, sr); | 1707 | printk("asr=%02x, sr=%02x.", asr, sr); |
1707 | 1708 | ||
1708 | hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); | 1709 | hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); |
1709 | hostdata->connected = NULL; | 1710 | hostdata->connected = NULL; |
1710 | hostdata->state = S_UNCONNECTED; | 1711 | hostdata->state = S_UNCONNECTED; |
1711 | cmd->result = DID_ABORT << 16; | 1712 | cmd->result = DID_ABORT << 16; |
@@ -2169,7 +2170,7 @@ wd33c93_show_info(struct seq_file *m, struct Scsi_Host *instance) | |||
2169 | seq_printf(m, "\nconnected: "); | 2170 | seq_printf(m, "\nconnected: "); |
2170 | if (hd->connected) { | 2171 | if (hd->connected) { |
2171 | cmd = (struct scsi_cmnd *) hd->connected; | 2172 | cmd = (struct scsi_cmnd *) hd->connected; |
2172 | seq_printf(m, " %d:%d(%02x)", | 2173 | seq_printf(m, " %d:%llu(%02x)", |
2173 | cmd->device->id, cmd->device->lun, cmd->cmnd[0]); | 2174 | cmd->device->id, cmd->device->lun, cmd->cmnd[0]); |
2174 | } | 2175 | } |
2175 | } | 2176 | } |
@@ -2177,7 +2178,7 @@ wd33c93_show_info(struct seq_file *m, struct Scsi_Host *instance) | |||
2177 | seq_printf(m, "\ninput_Q: "); | 2178 | seq_printf(m, "\ninput_Q: "); |
2178 | cmd = (struct scsi_cmnd *) hd->input_Q; | 2179 | cmd = (struct scsi_cmnd *) hd->input_Q; |
2179 | while (cmd) { | 2180 | while (cmd) { |
2180 | seq_printf(m, " %d:%d(%02x)", | 2181 | seq_printf(m, " %d:%llu(%02x)", |
2181 | cmd->device->id, cmd->device->lun, cmd->cmnd[0]); | 2182 | cmd->device->id, cmd->device->lun, cmd->cmnd[0]); |
2182 | cmd = (struct scsi_cmnd *) cmd->host_scribble; | 2183 | cmd = (struct scsi_cmnd *) cmd->host_scribble; |
2183 | } | 2184 | } |
@@ -2186,7 +2187,7 @@ wd33c93_show_info(struct seq_file *m, struct Scsi_Host *instance) | |||
2186 | seq_printf(m, "\ndisconnected_Q:"); | 2187 | seq_printf(m, "\ndisconnected_Q:"); |
2187 | cmd = (struct scsi_cmnd *) hd->disconnected_Q; | 2188 | cmd = (struct scsi_cmnd *) hd->disconnected_Q; |
2188 | while (cmd) { | 2189 | while (cmd) { |
2189 | seq_printf(m, " %d:%d(%02x)", | 2190 | seq_printf(m, " %d:%llu(%02x)", |
2190 | cmd->device->id, cmd->device->lun, cmd->cmnd[0]); | 2191 | cmd->device->id, cmd->device->lun, cmd->cmnd[0]); |
2191 | cmd = (struct scsi_cmnd *) cmd->host_scribble; | 2192 | cmd = (struct scsi_cmnd *) cmd->host_scribble; |
2192 | } | 2193 | } |