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/dpt_i2o.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/dpt_i2o.c')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index c0ae8fa57a3b..67283ef418ac 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -459,7 +459,7 @@ static int adpt_queue_lck(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd | |||
459 | * to the device structure. This should be a TEST_UNIT_READY | 459 | * to the device structure. This should be a TEST_UNIT_READY |
460 | * command from scan_scsis_single. | 460 | * command from scan_scsis_single. |
461 | */ | 461 | */ |
462 | if ((pDev = adpt_find_device(pHba, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun)) == NULL) { | 462 | if ((pDev = adpt_find_device(pHba, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun)) == NULL) { |
463 | // TODO: if any luns are at this bus, scsi id then fake a TEST_UNIT_READY and INQUIRY response | 463 | // TODO: if any luns are at this bus, scsi id then fake a TEST_UNIT_READY and INQUIRY response |
464 | // with type 7F (for all luns less than the max for this bus,id) so the lun scan will continue. | 464 | // with type 7F (for all luns less than the max for this bus,id) so the lun scan will continue. |
465 | cmd->result = (DID_NO_CONNECT << 16); | 465 | cmd->result = (DID_NO_CONNECT << 16); |
@@ -579,8 +579,8 @@ static int adpt_show_info(struct seq_file *m, struct Scsi_Host *host) | |||
579 | seq_printf(m," Rev: %-8.8s\n", d->pScsi_dev->rev); | 579 | seq_printf(m," Rev: %-8.8s\n", d->pScsi_dev->rev); |
580 | 580 | ||
581 | unit = d->pI2o_dev->lct_data.tid; | 581 | unit = d->pI2o_dev->lct_data.tid; |
582 | seq_printf(m, "\tTID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)\n\n", | 582 | seq_printf(m, "\tTID=%d, (Channel=%d, Target=%d, Lun=%llu) (%s)\n\n", |
583 | unit, (int)d->scsi_channel, (int)d->scsi_id, (int)d->scsi_lun, | 583 | unit, (int)d->scsi_channel, (int)d->scsi_id, d->scsi_lun, |
584 | scsi_device_online(d->pScsi_dev)? "online":"offline"); | 584 | scsi_device_online(d->pScsi_dev)? "online":"offline"); |
585 | d = d->next_lun; | 585 | d = d->next_lun; |
586 | } | 586 | } |
@@ -1162,7 +1162,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba) | |||
1162 | } | 1162 | } |
1163 | } | 1163 | } |
1164 | 1164 | ||
1165 | static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun) | 1165 | static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u64 lun) |
1166 | { | 1166 | { |
1167 | struct adpt_device* d; | 1167 | struct adpt_device* d; |
1168 | 1168 | ||
@@ -1462,7 +1462,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba) | |||
1462 | i2o_lct *lct = pHba->lct; | 1462 | i2o_lct *lct = pHba->lct; |
1463 | u8 bus_no = 0; | 1463 | u8 bus_no = 0; |
1464 | s16 scsi_id; | 1464 | s16 scsi_id; |
1465 | s16 scsi_lun; | 1465 | u64 scsi_lun; |
1466 | u32 buf[10]; // larger than 7, or 8 ... | 1466 | u32 buf[10]; // larger than 7, or 8 ... |
1467 | struct adpt_device* pDev; | 1467 | struct adpt_device* pDev; |
1468 | 1468 | ||
@@ -1496,7 +1496,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba) | |||
1496 | } | 1496 | } |
1497 | bus_no = buf[0]>>16; | 1497 | bus_no = buf[0]>>16; |
1498 | scsi_id = buf[1]; | 1498 | scsi_id = buf[1]; |
1499 | scsi_lun = (buf[2]>>8 )&0xff; | 1499 | scsi_lun = scsilun_to_int((struct scsi_lun *)&buf[2]); |
1500 | if(bus_no >= MAX_CHANNEL) { // Something wrong skip it | 1500 | if(bus_no >= MAX_CHANNEL) { // Something wrong skip it |
1501 | printk(KERN_WARNING"%s: Channel number %d out of range \n", pHba->name, bus_no); | 1501 | printk(KERN_WARNING"%s: Channel number %d out of range \n", pHba->name, bus_no); |
1502 | continue; | 1502 | continue; |
@@ -1571,7 +1571,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba) | |||
1571 | if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)>=0) { | 1571 | if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)>=0) { |
1572 | bus_no = buf[0]>>16; | 1572 | bus_no = buf[0]>>16; |
1573 | scsi_id = buf[1]; | 1573 | scsi_id = buf[1]; |
1574 | scsi_lun = (buf[2]>>8 )&0xff; | 1574 | scsi_lun = scsilun_to_int((struct scsi_lun *)&buf[2]); |
1575 | if(bus_no >= MAX_CHANNEL) { // Something wrong skip it | 1575 | if(bus_no >= MAX_CHANNEL) { // Something wrong skip it |
1576 | continue; | 1576 | continue; |
1577 | } | 1577 | } |
@@ -2407,8 +2407,8 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) | |||
2407 | case I2O_SCSI_DSC_COMMAND_TIMEOUT: | 2407 | case I2O_SCSI_DSC_COMMAND_TIMEOUT: |
2408 | case I2O_SCSI_DSC_NO_ADAPTER: | 2408 | case I2O_SCSI_DSC_NO_ADAPTER: |
2409 | case I2O_SCSI_DSC_RESOURCE_UNAVAILABLE: | 2409 | case I2O_SCSI_DSC_RESOURCE_UNAVAILABLE: |
2410 | printk(KERN_WARNING"%s: SCSI Timeout-Device (%d,%d,%d) hba status=0x%x, dev status=0x%x, cmd=0x%x\n", | 2410 | printk(KERN_WARNING"%s: SCSI Timeout-Device (%d,%d,%llu) hba status=0x%x, dev status=0x%x, cmd=0x%x\n", |
2411 | pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, hba_status, dev_status, cmd->cmnd[0]); | 2411 | pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun, hba_status, dev_status, cmd->cmnd[0]); |
2412 | cmd->result = (DID_TIME_OUT << 16); | 2412 | cmd->result = (DID_TIME_OUT << 16); |
2413 | break; | 2413 | break; |
2414 | case I2O_SCSI_DSC_ADAPTER_BUSY: | 2414 | case I2O_SCSI_DSC_ADAPTER_BUSY: |
@@ -2447,8 +2447,8 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) | |||
2447 | case I2O_SCSI_DSC_QUEUE_FROZEN: | 2447 | case I2O_SCSI_DSC_QUEUE_FROZEN: |
2448 | case I2O_SCSI_DSC_REQUEST_INVALID: | 2448 | case I2O_SCSI_DSC_REQUEST_INVALID: |
2449 | default: | 2449 | default: |
2450 | printk(KERN_WARNING"%s: SCSI error %0x-Device(%d,%d,%d) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n", | 2450 | printk(KERN_WARNING"%s: SCSI error %0x-Device(%d,%d,%llu) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n", |
2451 | pHba->name, detailed_status & I2O_SCSI_DSC_MASK, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, | 2451 | pHba->name, detailed_status & I2O_SCSI_DSC_MASK, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun, |
2452 | hba_status, dev_status, cmd->cmnd[0]); | 2452 | hba_status, dev_status, cmd->cmnd[0]); |
2453 | cmd->result = (DID_ERROR << 16); | 2453 | cmd->result = (DID_ERROR << 16); |
2454 | break; | 2454 | break; |
@@ -2464,8 +2464,8 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) | |||
2464 | cmd->sense_buffer[2] == DATA_PROTECT ){ | 2464 | cmd->sense_buffer[2] == DATA_PROTECT ){ |
2465 | /* This is to handle an array failed */ | 2465 | /* This is to handle an array failed */ |
2466 | cmd->result = (DID_TIME_OUT << 16); | 2466 | cmd->result = (DID_TIME_OUT << 16); |
2467 | printk(KERN_WARNING"%s: SCSI Data Protect-Device (%d,%d,%d) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n", | 2467 | printk(KERN_WARNING"%s: SCSI Data Protect-Device (%d,%d,%llu) hba_status=0x%x, dev_status=0x%x, cmd=0x%x\n", |
2468 | pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, | 2468 | pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun, |
2469 | hba_status, dev_status, cmd->cmnd[0]); | 2469 | hba_status, dev_status, cmd->cmnd[0]); |
2470 | 2470 | ||
2471 | } | 2471 | } |
@@ -2476,8 +2476,8 @@ static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) | |||
2476 | * for a limitted number of retries. | 2476 | * for a limitted number of retries. |
2477 | */ | 2477 | */ |
2478 | cmd->result = (DID_TIME_OUT << 16); | 2478 | cmd->result = (DID_TIME_OUT << 16); |
2479 | printk(KERN_WARNING"%s: I2O MSG_FAIL - Device (%d,%d,%d) tid=%d, cmd=0x%x\n", | 2479 | printk(KERN_WARNING"%s: I2O MSG_FAIL - Device (%d,%d,%llu) tid=%d, cmd=0x%x\n", |
2480 | pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, | 2480 | pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, cmd->device->lun, |
2481 | ((struct adpt_device*)(cmd->device->hostdata))->tid, cmd->cmnd[0]); | 2481 | ((struct adpt_device*)(cmd->device->hostdata))->tid, cmd->cmnd[0]); |
2482 | } | 2482 | } |
2483 | 2483 | ||
@@ -2517,7 +2517,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba) | |||
2517 | i2o_lct *lct = pHba->lct; | 2517 | i2o_lct *lct = pHba->lct; |
2518 | u8 bus_no = 0; | 2518 | u8 bus_no = 0; |
2519 | s16 scsi_id; | 2519 | s16 scsi_id; |
2520 | s16 scsi_lun; | 2520 | u64 scsi_lun; |
2521 | u32 buf[10]; // at least 8 u32's | 2521 | u32 buf[10]; // at least 8 u32's |
2522 | struct adpt_device* pDev = NULL; | 2522 | struct adpt_device* pDev = NULL; |
2523 | struct i2o_device* pI2o_dev = NULL; | 2523 | struct i2o_device* pI2o_dev = NULL; |
@@ -2564,7 +2564,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba) | |||
2564 | } | 2564 | } |
2565 | 2565 | ||
2566 | scsi_id = buf[1]; | 2566 | scsi_id = buf[1]; |
2567 | scsi_lun = (buf[2]>>8 )&0xff; | 2567 | scsi_lun = scsilun_to_int((struct scsi_lun *)&buf[2]); |
2568 | pDev = pHba->channel[bus_no].device[scsi_id]; | 2568 | pDev = pHba->channel[bus_no].device[scsi_id]; |
2569 | /* da lun */ | 2569 | /* da lun */ |
2570 | while(pDev) { | 2570 | while(pDev) { |
@@ -2633,7 +2633,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba) | |||
2633 | while(pDev) { | 2633 | while(pDev) { |
2634 | if(pDev->scsi_lun == scsi_lun) { | 2634 | if(pDev->scsi_lun == scsi_lun) { |
2635 | if(!scsi_device_online(pDev->pScsi_dev)) { | 2635 | if(!scsi_device_online(pDev->pScsi_dev)) { |
2636 | printk(KERN_WARNING"%s: Setting device (%d,%d,%d) back online\n", | 2636 | printk(KERN_WARNING"%s: Setting device (%d,%d,%llu) back online\n", |
2637 | pHba->name,bus_no,scsi_id,scsi_lun); | 2637 | pHba->name,bus_no,scsi_id,scsi_lun); |
2638 | if (pDev->pScsi_dev) { | 2638 | if (pDev->pScsi_dev) { |
2639 | scsi_device_set_state(pDev->pScsi_dev, SDEV_RUNNING); | 2639 | scsi_device_set_state(pDev->pScsi_dev, SDEV_RUNNING); |
@@ -2665,7 +2665,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba) | |||
2665 | // in the LCT table | 2665 | // in the LCT table |
2666 | if (pDev->state & DPTI_DEV_UNSCANNED){ | 2666 | if (pDev->state & DPTI_DEV_UNSCANNED){ |
2667 | pDev->state = DPTI_DEV_OFFLINE; | 2667 | pDev->state = DPTI_DEV_OFFLINE; |
2668 | printk(KERN_WARNING"%s: Device (%d,%d,%d) offline\n",pHba->name,pDev->scsi_channel,pDev->scsi_id,pDev->scsi_lun); | 2668 | printk(KERN_WARNING"%s: Device (%d,%d,%llu) offline\n",pHba->name,pDev->scsi_channel,pDev->scsi_id,pDev->scsi_lun); |
2669 | if (pDev->pScsi_dev) { | 2669 | if (pDev->pScsi_dev) { |
2670 | scsi_device_set_state(pDev->pScsi_dev, SDEV_OFFLINE); | 2670 | scsi_device_set_state(pDev->pScsi_dev, SDEV_OFFLINE); |
2671 | } | 2671 | } |