Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hannes Reinecke and committed by
Christoph Hellwig
9cb78c16 755f516b

+438 -429
+1 -1
drivers/ata/libata-scsi.c
··· 3945 3945 * Zero. 3946 3946 */ 3947 3947 int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, 3948 - unsigned int id, unsigned int lun) 3948 + unsigned int id, u64 lun) 3949 3949 { 3950 3950 struct ata_port *ap = ata_shost_to_port(shost); 3951 3951 unsigned long flags;
+1 -1
drivers/ata/libata.h
··· 144 144 extern void ata_scsi_dev_rescan(struct work_struct *work); 145 145 extern int ata_bus_probe(struct ata_port *ap); 146 146 extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel, 147 - unsigned int id, unsigned int lun); 147 + unsigned int id, u64 lun); 148 148 149 149 150 150 /* libata-eh.c */
+1 -1
drivers/message/fusion/mptbase.h
··· 405 405 typedef struct _VirtDevice { 406 406 VirtTarget *vtarget; 407 407 u8 configured_lun; 408 - int lun; 408 + u64 lun; 409 409 } VirtDevice; 410 410 411 411 /*
+3 -3
drivers/message/fusion/mptfc.c
··· 204 204 || (loops > 0 && ioc->active == 0)) { 205 205 spin_unlock_irqrestore(shost->host_lock, flags); 206 206 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT 207 - "mptfc_block_error_handler.%d: %d:%d, port status is " 207 + "mptfc_block_error_handler.%d: %d:%llu, port status is " 208 208 "%x, active flag %d, deferring %s recovery.\n", 209 209 ioc->name, ioc->sh->host_no, 210 210 SCpnt->device->id, SCpnt->device->lun, ··· 218 218 if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata 219 219 || ioc->active == 0) { 220 220 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT 221 - "%s.%d: %d:%d, failing recovery, " 221 + "%s.%d: %d:%llu, failing recovery, " 222 222 "port state %x, active %d, vdevice %p.\n", caller, 223 223 ioc->name, ioc->sh->host_no, 224 224 SCpnt->device->id, SCpnt->device->lun, ready, ··· 226 226 return FAILED; 227 227 } 228 228 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT 229 - "%s.%d: %d:%d, executing recovery.\n", caller, 229 + "%s.%d: %d:%llu, executing recovery.\n", caller, 230 230 ioc->name, ioc->sh->host_no, 231 231 SCpnt->device->id, SCpnt->device->lun)); 232 232 return (*func)(SCpnt);
+7 -7
drivers/message/fusion/mptscsih.c
··· 95 95 static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply); 96 96 97 97 int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, 98 - int lun, int ctx2abort, ulong timeout); 98 + u64 lun, int ctx2abort, ulong timeout); 99 99 100 100 int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); 101 101 int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); ··· 536 536 } 537 537 538 538 scsi_print_command(sc); 539 - printk(MYIOC_s_DEBUG_FMT "\tfw_channel = %d, fw_id = %d, lun = %d\n", 539 + printk(MYIOC_s_DEBUG_FMT "\tfw_channel = %d, fw_id = %d, lun = %llu\n", 540 540 ioc->name, pScsiReply->Bus, pScsiReply->TargetID, sc->device->lun); 541 541 printk(MYIOC_s_DEBUG_FMT "\trequest_len = %d, underflow = %d, " 542 542 "resid = %d\n", ioc->name, scsi_bufflen(sc), sc->underflow, ··· 692 692 */ 693 693 if (scsi_state & MPI_SCSI_STATE_RESPONSE_INFO_VALID && 694 694 pScsiReply->ResponseInfo) { 695 - printk(MYIOC_s_NOTE_FMT "[%d:%d:%d:%d] " 695 + printk(MYIOC_s_NOTE_FMT "[%d:%d:%d:%llu] " 696 696 "FCP_ResponseInfo=%08xh\n", ioc->name, 697 697 sc->device->host->host_no, sc->device->channel, 698 698 sc->device->id, sc->device->lun, ··· 1155 1155 return; 1156 1156 ioc = hd->ioc; 1157 1157 if (time - hd->last_queue_full > 10 * HZ) { 1158 - dprintk(ioc, printk(MYIOC_s_WARN_FMT "Device (%d:%d:%d) reported QUEUE_FULL!\n", 1158 + dprintk(ioc, printk(MYIOC_s_WARN_FMT "Device (%d:%d:%llu) reported QUEUE_FULL!\n", 1159 1159 ioc->name, 0, sc->device->id, sc->device->lun)); 1160 1160 hd->last_queue_full = time; 1161 1161 } ··· 1518 1518 * 1519 1519 **/ 1520 1520 int 1521 - mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, 1521 + mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, u64 lun, 1522 1522 int ctx2abort, ulong timeout) 1523 1523 { 1524 1524 MPT_FRAME_HDR *mf; ··· 2380 2380 vdevice = sdev->hostdata; 2381 2381 2382 2382 dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2383 - "device @ %p, channel=%d, id=%d, lun=%d\n", 2383 + "device @ %p, channel=%d, id=%d, lun=%llu\n", 2384 2384 ioc->name, sdev, sdev->channel, sdev->id, sdev->lun)); 2385 2385 if (ioc->bus_type == SPI) 2386 2386 dsprintk(ioc, printk(MYIOC_s_DEBUG_FMT ··· 2971 2971 + (my_idx * MPT_SENSE_BUFFER_ALLOC)); 2972 2972 2973 2973 devtprintk(ioc, printk(MYIOC_s_DEBUG_FMT 2974 - "%s: Sending Command 0x%02x for fw_channel=%d fw_id=%d lun=%d\n", 2974 + "%s: Sending Command 0x%02x for fw_channel=%d fw_id=%d lun=%llu\n", 2975 2975 ioc->name, __func__, cmd, io->channel, io->id, io->lun)); 2976 2976 2977 2977 if (dir == MPI_SCSIIO_CONTROL_READ)
+2 -2
drivers/message/fusion/mptscsih.h
··· 98 98 u8 cmd; /* SCSI Op Code */ 99 99 u8 channel; /* bus number */ 100 100 u8 id; /* SCSI ID (virtual) */ 101 - int lun; 101 + u64 lun; 102 102 u8 flags; /* Bit Field - See above */ 103 103 u8 physDiskNum; /* Phys disk number, -1 else */ 104 104 u8 rsvd2; ··· 115 115 extern const char * mptscsih_info(struct Scsi_Host *SChost); 116 116 extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt); 117 117 extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, 118 - u8 id, int lun, int ctx2abort, ulong timeout); 118 + u8 id, u64 lun, int ctx2abort, ulong timeout); 119 119 extern void mptscsih_slave_destroy(struct scsi_device *device); 120 120 extern int mptscsih_slave_configure(struct scsi_device *device); 121 121 extern int mptscsih_abort(struct scsi_cmnd * SCpnt);
+5 -6
drivers/message/i2o/i2o_scsi.c
··· 78 78 struct i2o_scsi_host { 79 79 struct Scsi_Host *scsi_host; /* pointer to the SCSI host */ 80 80 struct i2o_controller *iop; /* pointer to the I2O controller */ 81 - unsigned int lun; /* lun's used for block devices */ 81 + u64 lun; /* lun's used for block devices */ 82 82 struct i2o_device *channel[0]; /* channel->i2o_dev mapping table */ 83 83 }; 84 84 ··· 287 287 } 288 288 289 289 if (le64_to_cpu(lun) >= scsi_host->max_lun) { 290 - osm_warn("SCSI device lun (%lu) >= max_lun of I2O host (%d)", 291 - (long unsigned int)le64_to_cpu(lun), 292 - scsi_host->max_lun); 290 + osm_warn("SCSI device lun (%llu) >= max_lun of I2O host (%d)", 291 + le64_to_cpu(lun), scsi_host->max_lun); 293 292 return -EFAULT; 294 293 } 295 294 ··· 307 308 if (rc) 308 309 goto err; 309 310 310 - osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %ld\n", 311 + osm_info("device added (TID: %03x) channel: %d, id: %d, lun: %llu\n", 311 312 i2o_dev->lct_data.tid, channel, le32_to_cpu(id), 312 - (long unsigned int)le64_to_cpu(lun)); 313 + le64_to_cpu(lun)); 313 314 314 315 return 0; 315 316
+2 -1
drivers/s390/scsi/zfcp_dbf.c
··· 418 418 rec->scsi_retries = sc->retries; 419 419 rec->scsi_allowed = sc->allowed; 420 420 rec->scsi_id = sc->device->id; 421 - rec->scsi_lun = sc->device->lun; 421 + /* struct zfcp_dbf_scsi needs to be updated to handle 64bit LUNs */ 422 + rec->scsi_lun = (u32)sc->device->lun; 422 423 rec->host_scribble = (unsigned long)sc->host_scribble; 423 424 424 425 memcpy(rec->scsi_opcode, sc->cmnd,
+2 -2
drivers/s390/scsi/zfcp_unit.c
··· 21 21 void zfcp_unit_scsi_scan(struct zfcp_unit *unit) 22 22 { 23 23 struct fc_rport *rport = unit->port->rport; 24 - unsigned int lun; 24 + u64 lun; 25 25 26 26 lun = scsilun_to_int((struct scsi_lun *) &unit->fcp_lun); 27 27 ··· 188 188 { 189 189 struct Scsi_Host *shost; 190 190 struct zfcp_port *port; 191 - unsigned int lun; 191 + u64 lun; 192 192 193 193 lun = scsilun_to_int((struct scsi_lun *) &unit->fcp_lun); 194 194 port = unit->port;
+4 -3
drivers/scsi/53c700.c
··· 1005 1005 DMA_TO_DEVICE); 1006 1006 1007 1007 cmnd[0] = REQUEST_SENSE; 1008 - cmnd[1] = (SCp->device->lun & 0x7) << 5; 1008 + cmnd[1] = (lun & 0x7) << 5; 1009 1009 cmnd[2] = 0; 1010 1010 cmnd[3] = 0; 1011 1011 cmnd[4] = SCSI_SENSE_BUFFERSIZE; ··· 1396 1396 struct NCR_700_Host_Parameters *hostdata = 1397 1397 (struct NCR_700_Host_Parameters *)SCp->device->host->hostdata[0]; 1398 1398 __u16 count = 1; /* for IDENTIFY message */ 1399 - 1399 + u8 lun = SCp->device->lun; 1400 + 1400 1401 if(hostdata->state != NCR_700_HOST_FREE) { 1401 1402 /* keep this inside the lock to close the race window where 1402 1403 * the running command finishes on another CPU while we don't ··· 1416 1415 1417 1416 hostdata->msgout[0] = NCR_700_identify((SCp->cmnd[0] != REQUEST_SENSE && 1418 1417 slot->flags != NCR_700_FLAG_AUTOSENSE), 1419 - SCp->device->lun); 1418 + lun); 1420 1419 /* for INQUIRY or REQUEST_SENSE commands, we cannot be sure 1421 1420 * if the negotiated transfer parameters still hold, so 1422 1421 * always renegotiate them */
+16 -15
drivers/scsi/NCR5380.c
··· 762 762 763 763 static void lprint_Scsi_Cmnd(Scsi_Cmnd * cmd, struct seq_file *m) 764 764 { 765 - SPRINTF("scsi%d : destination target %d, lun %d\n", cmd->device->host->host_no, cmd->device->id, cmd->device->lun); 765 + SPRINTF("scsi%d : destination target %d, lun %llu\n", cmd->device->host->host_no, cmd->device->id, cmd->device->lun); 766 766 SPRINTF(" command = "); 767 767 lprint_command(cmd->cmnd, m); 768 768 } ··· 1039 1039 for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble) 1040 1040 { 1041 1041 if (prev != tmp) 1042 - dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%d\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun); 1042 + dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%llu\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun); 1043 1043 /* When we find one, remove it from the issue queue. */ 1044 - if (!(hostdata->busy[tmp->device->id] & (1 << tmp->device->lun))) { 1044 + if (!(hostdata->busy[tmp->device->id] & 1045 + (1 << (u8)(tmp->device->lun & 0xff)))) { 1045 1046 if (prev) { 1046 1047 REMOVE(prev, prev->host_scribble, tmp, tmp->host_scribble); 1047 1048 prev->host_scribble = tmp->host_scribble; ··· 1058 1057 * On failure, we must add the command back to the 1059 1058 * issue queue so we can keep trying. 1060 1059 */ 1061 - dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, "scsi%d : main() : command for target %d lun %d removed from issue_queue\n", instance->host_no, tmp->device->id, tmp->device->lun); 1060 + dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, "scsi%d : main() : command for target %d lun %llu removed from issue_queue\n", instance->host_no, tmp->device->id, tmp->device->lun); 1062 1061 1063 1062 /* 1064 1063 * A successful selection is defined as one that ··· 1525 1524 dprintk(NDEBUG_SELECTION, "scsi%d : nexus established.\n", instance->host_no); 1526 1525 /* XXX need to handle errors here */ 1527 1526 hostdata->connected = cmd; 1528 - hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 1527 + hostdata->busy[cmd->device->id] |= (1 << (cmd->device->lun & 0xFF)); 1529 1528 1530 1529 initialize_SCp(cmd); 1531 1530 ··· 2211 2210 case LINKED_FLG_CMD_COMPLETE: 2212 2211 /* Accept message by clearing ACK */ 2213 2212 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2214 - dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %d linked command complete.\n", instance->host_no, cmd->device->id, cmd->device->lun); 2213 + dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %llu linked command complete.\n", instance->host_no, cmd->device->id, cmd->device->lun); 2215 2214 /* 2216 2215 * Sanity check : A linked command should only terminate with 2217 2216 * one of these messages if there are more linked commands 2218 2217 * available. 2219 2218 */ 2220 2219 if (!cmd->next_link) { 2221 - printk("scsi%d : target %d lun %d linked command complete, no next_link\n" instance->host_no, cmd->device->id, cmd->device->lun); 2220 + printk("scsi%d : target %d lun %llu linked command complete, no next_link\n" instance->host_no, cmd->device->id, cmd->device->lun); 2222 2221 sink = 1; 2223 2222 do_abort(instance); 2224 2223 return; ··· 2227 2226 /* The next command is still part of this process */ 2228 2227 cmd->next_link->tag = cmd->tag; 2229 2228 cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); 2230 - dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %d linked request done, calling scsi_done().\n", instance->host_no, cmd->device->id, cmd->device->lun); 2229 + dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %llu linked request done, calling scsi_done().\n", instance->host_no, cmd->device->id, cmd->device->lun); 2231 2230 collect_stats(hostdata, cmd); 2232 2231 cmd->scsi_done(cmd); 2233 2232 cmd = hostdata->connected; ··· 2239 2238 sink = 1; 2240 2239 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2241 2240 hostdata->connected = NULL; 2242 - dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d, lun %d completed\n", instance->host_no, cmd->device->id, cmd->device->lun); 2243 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 2241 + dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d, lun %llu completed\n", instance->host_no, cmd->device->id, cmd->device->lun); 2242 + hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xFF)); 2244 2243 2245 2244 /* 2246 2245 * I'm not sure what the correct thing to do here is : ··· 2305 2304 case ORDERED_QUEUE_TAG: 2306 2305 case SIMPLE_QUEUE_TAG: 2307 2306 cmd->device->simple_tags = 0; 2308 - hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 2307 + hostdata->busy[cmd->device->id] |= (1 << (cmd->device->lun & 0xFF)); 2309 2308 break; 2310 2309 default: 2311 2310 break; ··· 2319 2318 hostdata->disconnected_queue; 2320 2319 hostdata->connected = NULL; 2321 2320 hostdata->disconnected_queue = cmd; 2322 - dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d lun %d was moved from connected to" " the disconnected_queue\n", instance->host_no, cmd->device->id, cmd->device->lun); 2321 + dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d lun %llu was moved from connected to" " the disconnected_queue\n", instance->host_no, cmd->device->id, cmd->device->lun); 2323 2322 /* 2324 2323 * Restore phase bits to 0 so an interrupted selection, 2325 2324 * arbitration can resume. ··· 2427 2426 hostdata->last_message = msgout; 2428 2427 NCR5380_transfer_pio(instance, &phase, &len, &data); 2429 2428 if (msgout == ABORT) { 2430 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 2429 + hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xFF)); 2431 2430 hostdata->connected = NULL; 2432 2431 cmd->result = DID_ERROR << 16; 2433 2432 collect_stats(hostdata, cmd); ··· 2563 2562 2564 2563 2565 2564 for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble) 2566 - if ((target_mask == (1 << tmp->device->id)) && (lun == tmp->device->lun) 2565 + if ((target_mask == (1 << tmp->device->id)) && (lun == (u8)tmp->device->lun) 2567 2566 ) { 2568 2567 if (prev) { 2569 2568 REMOVE(prev, prev->host_scribble, tmp, tmp->host_scribble); ··· 2589 2588 do_abort(instance); 2590 2589 } else { 2591 2590 hostdata->connected = tmp; 2592 - dprintk(NDEBUG_RESELECTION, "scsi%d : nexus established, target = %d, lun = %d, tag = %d\n", instance->host_no, tmp->device->id, tmp->device->lun, tmp->tag); 2591 + dprintk(NDEBUG_RESELECTION, "scsi%d : nexus established, target = %d, lun = %llu, tag = %d\n", instance->host_no, tmp->device->id, tmp->device->lun, tmp->tag); 2593 2592 } 2594 2593 } 2595 2594
+1 -1
drivers/scsi/NCR53c406a.c
··· 698 698 int i; 699 699 700 700 VDEB(printk("NCR53c406a_queue called\n")); 701 - DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->target, SCpnt->lun, scsi_bufflen(SCpnt))); 701 + DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->device->target, (u8)SCpnt->device->lun, scsi_bufflen(SCpnt))); 702 702 703 703 #if 0 704 704 VDEB(for (i = 0; i < SCpnt->cmd_len; i++)
+1 -1
drivers/scsi/a100u2w.c
··· 891 891 printk("max cdb length= %x\b", cmd->cmd_len); 892 892 scb->cdb_len = IMAX_CDB; 893 893 } 894 - scb->ident = cmd->device->lun | DISC_ALLOW; 894 + scb->ident = (u8)(cmd->device->lun & 0xff) | DISC_ALLOW; 895 895 if (cmd->device->tagged_supported) { /* Tag Support */ 896 896 scb->tag_msg = SIMPLE_QUEUE_TAG; /* Do simple tag only */ 897 897 } else {
+1 -1
drivers/scsi/aacraid/linit.c
··· 551 551 int count; 552 552 int ret = FAILED; 553 553 554 - printk(KERN_ERR "%s: Host adapter abort request (%d,%d,%d,%d)\n", 554 + printk(KERN_ERR "%s: Host adapter abort request (%d,%d,%d,%llu)\n", 555 555 AAC_DRIVERNAME, 556 556 host->host_no, sdev_channel(dev), sdev_id(dev), dev->lun); 557 557 switch (cmd->cmnd[0]) {
+3 -3
drivers/scsi/aha152x.c
··· 321 321 #define CMDINFO(cmd) \ 322 322 (cmd) ? ((cmd)->device->host->host_no) : -1, \ 323 323 (cmd) ? ((cmd)->device->id & 0x0f) : -1, \ 324 - (cmd) ? ((cmd)->device->lun & 0x07) : -1 324 + (cmd) ? ((u8)(cmd)->device->lun & 0x07) : -1 325 325 326 326 static inline void 327 327 CMD_INC_RESID(struct scsi_cmnd *cmd, int inc) ··· 1602 1602 #if defined(AHA152X_DEBUG) 1603 1603 int hostno=DONE_SC->device->host->host_no; 1604 1604 int id=DONE_SC->device->id & 0xf; 1605 - int lun=DONE_SC->device->lun & 0x7; 1605 + int lun=((u8)DONE_SC->device->lun) & 0x7; 1606 1606 #endif 1607 1607 Scsi_Cmnd *ptr = DONE_SC; 1608 1608 DONE_SC=NULL; ··· 2984 2984 int i; 2985 2985 2986 2986 SPRINTF("%p: target=%d; lun=%d; cmnd=( ", 2987 - ptr, ptr->device->id, ptr->device->lun); 2987 + ptr, ptr->device->id, (u8)ptr->device->lun); 2988 2988 2989 2989 for (i = 0; i < COMMAND_SIZE(ptr->cmnd[0]); i++) 2990 2990 SPRINTF("0x%02x ", ptr->cmnd[i]);
+1 -1
drivers/scsi/aic7xxx/aic79xx.h
··· 115 115 #endif 116 116 117 117 #define AHD_BUILD_COL_IDX(target, lun) \ 118 - (((lun) << 4) | target) 118 + ((((u8)lun) << 4) | target) 119 119 120 120 #define AHD_GET_SCB_COL_IDX(ahd, scb) \ 121 121 ((SCB_GET_LUN(scb) << 4) | SCB_GET_TARGET(ahd, scb))
+3 -3
drivers/scsi/aic7xxx/aic79xx_osm.c
··· 2137 2137 if (do_fallback) { 2138 2138 printk("%s: device overrun (status %x) on %d:%d:%d\n", 2139 2139 ahd_name(ahd), status, cmd->device->channel, 2140 - cmd->device->id, cmd->device->lun); 2140 + cmd->device->id, (u8)cmd->device->lun); 2141 2141 } 2142 2142 2143 2143 ahd_cmd_set_transaction_status(cmd, new_status); ··· 2253 2253 disconnected = TRUE; 2254 2254 if (ahd_search_qinfifo(ahd, cmd->device->id, 2255 2255 cmd->device->channel + 'A', 2256 - cmd->device->lun, 2256 + cmd->device->lun, 2257 2257 pending_scb->hscb->tag, 2258 2258 ROLE_INITIATOR, CAM_REQ_ABORTED, 2259 2259 SEARCH_COMPLETE) > 0) { 2260 2260 printk("%s:%d:%d:%d: Cmd aborted from QINFIFO\n", 2261 2261 ahd_name(ahd), cmd->device->channel, 2262 - cmd->device->id, cmd->device->lun); 2262 + cmd->device->id, (u8)cmd->device->lun); 2263 2263 retval = SUCCESS; 2264 2264 goto done; 2265 2265 }
+1 -1
drivers/scsi/aic7xxx/aic79xx_proc.c
··· 197 197 198 198 seq_printf(m, "\tChannel %c Target %d Lun %d Settings\n", 199 199 sdev->sdev_target->channel + 'A', 200 - sdev->sdev_target->id, sdev->lun); 200 + sdev->sdev_target->id, (u8)sdev->lun); 201 201 202 202 seq_printf(m, "\t\tCommands Queued %ld\n", dev->commands_issued); 203 203 seq_printf(m, "\t\tCommands Active %d\n", dev->active);
+6 -5
drivers/scsi/aic7xxx/aic7xxx_osm.c
··· 2110 2110 */ 2111 2111 printk("%s:%d:%d:%d: Is not an active device\n", 2112 2112 ahc_name(ahc), cmd->device->channel, cmd->device->id, 2113 - cmd->device->lun); 2113 + (u8)cmd->device->lun); 2114 2114 retval = SUCCESS; 2115 2115 goto no_cmd; 2116 2116 } ··· 2118 2118 if ((dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED)) == 0 2119 2119 && ahc_search_untagged_queues(ahc, cmd, cmd->device->id, 2120 2120 cmd->device->channel + 'A', 2121 - cmd->device->lun, 2121 + (u8)cmd->device->lun, 2122 2122 CAM_REQ_ABORTED, SEARCH_COMPLETE) != 0) { 2123 2123 printk("%s:%d:%d:%d: Command found on untagged queue\n", 2124 2124 ahc_name(ahc), cmd->device->channel, cmd->device->id, 2125 - cmd->device->lun); 2125 + (u8)cmd->device->lun); 2126 2126 retval = SUCCESS; 2127 2127 goto done; 2128 2128 } ··· 2188 2188 SEARCH_COMPLETE) > 0) { 2189 2189 printk("%s:%d:%d:%d: Cmd aborted from QINFIFO\n", 2190 2190 ahc_name(ahc), cmd->device->channel, 2191 - cmd->device->id, cmd->device->lun); 2191 + cmd->device->id, (u8)cmd->device->lun); 2192 2192 retval = SUCCESS; 2193 2193 goto done; 2194 2194 } 2195 2195 } else if (ahc_search_qinfifo(ahc, cmd->device->id, 2196 2196 cmd->device->channel + 'A', 2197 - cmd->device->lun, pending_scb->hscb->tag, 2197 + cmd->device->lun, 2198 + pending_scb->hscb->tag, 2198 2199 ROLE_INITIATOR, /*status*/0, 2199 2200 SEARCH_COUNT) > 0) { 2200 2201 disconnected = FALSE;
+1 -1
drivers/scsi/aic7xxx/aic7xxx_proc.c
··· 175 175 176 176 seq_printf(m, "\tChannel %c Target %d Lun %d Settings\n", 177 177 sdev->sdev_target->channel + 'A', 178 - sdev->sdev_target->id, sdev->lun); 178 + sdev->sdev_target->id, (u8)sdev->lun); 179 179 180 180 seq_printf(m, "\t\tCommands Queued %ld\n", dev->commands_issued); 181 181 seq_printf(m, "\t\tCommands Active %d\n", dev->active);
+4 -4
drivers/scsi/arcmsr/arcmsr_hba.c
··· 2335 2335 " poll command abort successfully \n" 2336 2336 , acb->host->host_no 2337 2337 , ccb->pcmd->device->id 2338 - , ccb->pcmd->device->lun 2338 + , (u32)ccb->pcmd->device->lun 2339 2339 , ccb); 2340 2340 ccb->pcmd->result = DID_ABORT << 16; 2341 2341 arcmsr_ccb_complete(ccb); ··· 2399 2399 " poll command abort successfully \n" 2400 2400 ,acb->host->host_no 2401 2401 ,ccb->pcmd->device->id 2402 - ,ccb->pcmd->device->lun 2402 + ,(u32)ccb->pcmd->device->lun 2403 2403 ,ccb); 2404 2404 ccb->pcmd->result = DID_ABORT << 16; 2405 2405 arcmsr_ccb_complete(ccb); ··· 2456 2456 " poll command abort successfully \n" 2457 2457 , acb->host->host_no 2458 2458 , pCCB->pcmd->device->id 2459 - , pCCB->pcmd->device->lun 2459 + , (u32)pCCB->pcmd->device->lun 2460 2460 , pCCB); 2461 2461 pCCB->pcmd->result = DID_ABORT << 16; 2462 2462 arcmsr_ccb_complete(pCCB); ··· 3058 3058 int rtn = FAILED; 3059 3059 printk(KERN_NOTICE 3060 3060 "arcmsr%d: abort device command of scsi id = %d lun = %d \n", 3061 - acb->host->host_no, cmd->device->id, cmd->device->lun); 3061 + acb->host->host_no, cmd->device->id, (u32)cmd->device->lun); 3062 3062 acb->acb_flags |= ACB_F_ABORT; 3063 3063 acb->num_aborts++; 3064 3064 /*
+9 -5
drivers/scsi/arm/acornscsi.c
··· 760 760 SCpnt->tag = SCpnt->device->current_tag; 761 761 } else 762 762 #endif 763 - set_bit(SCpnt->device->id * 8 + SCpnt->device->lun, host->busyluns); 763 + set_bit(SCpnt->device->id * 8 + 764 + (u8)(SCpnt->device->lun & 0x07), host->busyluns); 764 765 765 766 host->stats.removes += 1; 766 767 ··· 864 863 if (!SCpnt->scsi_done) 865 864 panic("scsi%d.H: null scsi_done function in acornscsi_done", host->host->host_no); 866 865 867 - clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, host->busyluns); 866 + clear_bit(SCpnt->device->id * 8 + 867 + (u8)(SCpnt->device->lun & 0x7), host->busyluns); 868 868 869 869 SCpnt->scsi_done(SCpnt); 870 870 } else ··· 1578 1576 printk(KERN_NOTICE "scsi%d.%c: disabling tagged queueing\n", 1579 1577 host->host->host_no, acornscsi_target(host)); 1580 1578 host->SCpnt->device->simple_tags = 0; 1581 - set_bit(host->SCpnt->device->id * 8 + host->SCpnt->device->lun, host->busyluns); 1579 + set_bit(host->SCpnt->device->id * 8 + 1580 + (u8)(host->SCpnt->device->lun & 0x7), host->busyluns); 1582 1581 break; 1583 1582 #endif 1584 1583 case EXTENDED_MESSAGE | (EXTENDED_SDTR << 8): ··· 2674 2671 //#if (DEBUG & DEBUG_ABORT) 2675 2672 printk("clear "); 2676 2673 //#endif 2677 - clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, host->busyluns); 2674 + clear_bit(SCpnt->device->id * 8 + 2675 + (u8)(SCpnt->device->lun & 0x7), host->busyluns); 2678 2676 2679 2677 /* 2680 2678 * We found the command, and cleared it out. Either ··· 2857 2853 2858 2854 shost_for_each_device(scd, instance) { 2859 2855 seq_printf(m, "Device/Lun TaggedQ Sync\n"); 2860 - seq_printf(m, " %d/%d ", scd->id, scd->lun); 2856 + seq_printf(m, " %d/%llu ", scd->id, scd->lun); 2861 2857 if (scd->tagged_supported) 2862 2858 seq_printf(m, "%3sabled(%3d) ", 2863 2859 scd->simple_tags ? "en" : "dis",
+7 -4
drivers/scsi/arm/fas216.c
··· 1821 1821 SCpnt->tag = SCpnt->device->current_tag; 1822 1822 } else 1823 1823 #endif 1824 - set_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns); 1824 + set_bit(SCpnt->device->id * 8 + 1825 + (u8)(SCpnt->device->lun & 0x7), info->busyluns); 1825 1826 1826 1827 info->stats.removes += 1; 1827 1828 switch (SCpnt->cmnd[0]) { ··· 2172 2171 * status. 2173 2172 */ 2174 2173 info->device[SCpnt->device->id].parity_check = 0; 2175 - clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns); 2174 + clear_bit(SCpnt->device->id * 8 + 2175 + (u8)(SCpnt->device->lun & 0x7), info->busyluns); 2176 2176 2177 2177 fn = (void (*)(FAS216_Info *, struct scsi_cmnd *, unsigned int))SCpnt->host_scribble; 2178 2178 fn(info, SCpnt, result); ··· 2400 2398 * been set. 2401 2399 */ 2402 2400 info->origSCpnt = NULL; 2403 - clear_bit(SCpnt->device->id * 8 + SCpnt->device->lun, info->busyluns); 2401 + clear_bit(SCpnt->device->id * 8 + 2402 + (u8)(SCpnt->device->lun & 0x7), info->busyluns); 2404 2403 printk("waiting for execution "); 2405 2404 res = res_success; 2406 2405 } else ··· 3003 3000 3004 3001 shost_for_each_device(scd, info->host) { 3005 3002 dev = &info->device[scd->id]; 3006 - seq_printf(m, " %d/%d ", scd->id, scd->lun); 3003 + seq_printf(m, " %d/%llu ", scd->id, scd->lun); 3007 3004 if (scd->tagged_supported) 3008 3005 seq_printf(m, "%3sabled(%3d) ", 3009 3006 scd->simple_tags ? "en" : "dis",
+2 -1
drivers/scsi/arm/queue.c
··· 167 167 spin_lock_irqsave(&queue->queue_lock, flags); 168 168 list_for_each(l, &queue->head) { 169 169 QE_t *q = list_entry(l, QE_t, list); 170 - if (!test_bit(q->SCpnt->device->id * 8 + q->SCpnt->device->lun, exclude)) { 170 + if (!test_bit(q->SCpnt->device->id * 8 + 171 + (u8)(q->SCpnt->device->lun & 0x7), exclude)) { 171 172 SCpnt = __queue_remove(queue, l); 172 173 break; 173 174 }
+33 -29
drivers/scsi/atari_NCR5380.c
··· 361 361 362 362 static int is_lun_busy(Scsi_Cmnd *cmd, int should_be_tagged) 363 363 { 364 + u8 lun = cmd->device->lun; 364 365 SETUP_HOSTDATA(cmd->device->host); 365 366 366 - if (hostdata->busy[cmd->device->id] & (1 << cmd->device->lun)) 367 + if (hostdata->busy[cmd->device->id] & (1 << lun)) 367 368 return 1; 368 369 if (!should_be_tagged || 369 370 !setup_use_tagged_queuing || !cmd->device->tagged_supported) 370 371 return 0; 371 - if (TagAlloc[cmd->device->id][cmd->device->lun].nr_allocated >= 372 - TagAlloc[cmd->device->id][cmd->device->lun].queue_size) { 372 + if (TagAlloc[cmd->device->id][lun].nr_allocated >= 373 + TagAlloc[cmd->device->id][lun].queue_size) { 373 374 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d: no free tags\n", 374 - H_NO(cmd), cmd->device->id, cmd->device->lun); 375 + H_NO(cmd), cmd->device->id, lun); 375 376 return 1; 376 377 } 377 378 return 0; ··· 386 385 387 386 static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged) 388 387 { 388 + u8 lun = cmd->device->lun; 389 389 SETUP_HOSTDATA(cmd->device->host); 390 390 391 391 /* If we or the target don't support tagged queuing, allocate the LUN for ··· 395 393 if (!should_be_tagged || 396 394 !setup_use_tagged_queuing || !cmd->device->tagged_supported) { 397 395 cmd->tag = TAG_NONE; 398 - hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 396 + hostdata->busy[cmd->device->id] |= (1 << lun); 399 397 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d now allocated by untagged " 400 - "command\n", H_NO(cmd), cmd->device->id, cmd->device->lun); 398 + "command\n", H_NO(cmd), cmd->device->id, lun); 401 399 } else { 402 - TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 400 + TAG_ALLOC *ta = &TagAlloc[cmd->device->id][lun]; 403 401 404 402 cmd->tag = find_first_zero_bit(ta->allocated, MAX_TAGS); 405 403 set_bit(cmd->tag, ta->allocated); ··· 407 405 dprintk(NDEBUG_TAGS, "scsi%d: using tag %d for target %d lun %d " 408 406 "(now %d tags in use)\n", 409 407 H_NO(cmd), cmd->tag, cmd->device->id, 410 - cmd->device->lun, ta->nr_allocated); 408 + lun, ta->nr_allocated); 411 409 } 412 410 } 413 411 ··· 418 416 419 417 static void cmd_free_tag(Scsi_Cmnd *cmd) 420 418 { 419 + u8 lun = cmd->device->lun; 421 420 SETUP_HOSTDATA(cmd->device->host); 422 421 423 422 if (cmd->tag == TAG_NONE) { 424 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 423 + hostdata->busy[cmd->device->id] &= ~(1 << lun); 425 424 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d untagged cmd finished\n", 426 - H_NO(cmd), cmd->device->id, cmd->device->lun); 425 + H_NO(cmd), cmd->device->id, lun); 427 426 } else if (cmd->tag >= MAX_TAGS) { 428 427 printk(KERN_NOTICE "scsi%d: trying to free bad tag %d!\n", 429 428 H_NO(cmd), cmd->tag); 430 429 } else { 431 - TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 430 + TAG_ALLOC *ta = &TagAlloc[cmd->device->id][lun]; 432 431 clear_bit(cmd->tag, ta->allocated); 433 432 ta->nr_allocated--; 434 433 dprintk(NDEBUG_TAGS, "scsi%d: freed tag %d for target %d lun %d\n", 435 - H_NO(cmd), cmd->tag, cmd->device->id, cmd->device->lun); 434 + H_NO(cmd), cmd->tag, cmd->device->id, lun); 436 435 } 437 436 } 438 437 ··· 716 713 { 717 714 int i, s; 718 715 unsigned char *command; 719 - printk("scsi%d: destination target %d, lun %d\n", 716 + printk("scsi%d: destination target %d, lun %llu\n", 720 717 H_NO(cmd), cmd->device->id, cmd->device->lun); 721 718 printk(KERN_CONT " command = "); 722 719 command = cmd->cmnd; ··· 762 759 { 763 760 int i, s; 764 761 unsigned char *command; 765 - seq_printf(m, "scsi%d: destination target %d, lun %d\n", 762 + seq_printf(m, "scsi%d: destination target %d, lun %llu\n", 766 763 H_NO(cmd), cmd->device->id, cmd->device->lun); 767 764 seq_printf(m, " command = "); 768 765 command = cmd->cmnd; ··· 1063 1060 #endif 1064 1061 for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, 1065 1062 prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp)) { 1063 + u8 lun = tmp->device->lun; 1066 1064 1067 1065 #if (NDEBUG & NDEBUG_LISTS) 1068 1066 if (prev != tmp) 1069 - printk("MAIN tmp=%p target=%d busy=%d lun=%d\n", 1067 + printk("MAIN tmp=%p target=%d busy=%d lun=%llu\n", 1070 1068 tmp, tmp->device->id, hostdata->busy[tmp->device->id], 1071 - tmp->device->lun); 1069 + lun); 1072 1070 #endif 1073 1071 /* When we find one, remove it from the issue queue. */ 1074 1072 /* ++guenther: possible race with Falcon locking */ ··· 1077 1073 #ifdef SUPPORT_TAGS 1078 1074 !is_lun_busy( tmp, tmp->cmnd[0] != REQUEST_SENSE) 1079 1075 #else 1080 - !(hostdata->busy[tmp->device->id] & (1 << tmp->device->lun)) 1076 + !(hostdata->busy[tmp->device->id] & (1 << lun)) 1081 1077 #endif 1082 1078 ) { 1083 1079 /* ++guenther: just to be sure, this must be atomic */ ··· 1103 1099 */ 1104 1100 dprintk(NDEBUG_MAIN, "scsi%d: main(): command for target %d " 1105 1101 "lun %d removed from issue_queue\n", 1106 - HOSTNO, tmp->device->id, tmp->device->lun); 1102 + HOSTNO, tmp->device->id, lun); 1107 1103 /* 1108 1104 * REQUEST SENSE commands are issued without tagged 1109 1105 * queueing, even on SCSI-II devices because the ··· 2065 2061 * accesses to this device will use the 2066 2062 * polled-IO. */ 2067 2063 printk(KERN_NOTICE "scsi%d: switching target %d " 2068 - "lun %d to slow handshake\n", HOSTNO, 2064 + "lun %llu to slow handshake\n", HOSTNO, 2069 2065 cmd->device->id, cmd->device->lun); 2070 2066 cmd->device->borken = 1; 2071 2067 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ··· 2117 2113 /* Accept message by clearing ACK */ 2118 2114 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2119 2115 2120 - dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked command " 2116 + dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %llu linked command " 2121 2117 "complete.\n", HOSTNO, cmd->device->id, cmd->device->lun); 2122 2118 2123 2119 /* Enable reselect interrupts */ ··· 2129 2125 */ 2130 2126 2131 2127 if (!cmd->next_link) { 2132 - printk(KERN_NOTICE "scsi%d: target %d lun %d " 2128 + printk(KERN_NOTICE "scsi%d: target %d lun %llu " 2133 2129 "linked command complete, no next_link\n", 2134 2130 HOSTNO, cmd->device->id, cmd->device->lun); 2135 2131 sink = 1; ··· 2142 2138 * and don't free it! */ 2143 2139 cmd->next_link->tag = cmd->tag; 2144 2140 cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); 2145 - dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked request " 2141 + dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %llu linked request " 2146 2142 "done, calling scsi_done().\n", 2147 2143 HOSTNO, cmd->device->id, cmd->device->lun); 2148 2144 #ifdef NCR5380_STATS ··· 2159 2155 /* ++guenther: possible race with Falcon locking */ 2160 2156 falcon_dont_release++; 2161 2157 hostdata->connected = NULL; 2162 - dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d, lun %d " 2158 + dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d, lun %llu " 2163 2159 "completed\n", HOSTNO, cmd->device->id, cmd->device->lun); 2164 2160 #ifdef SUPPORT_TAGS 2165 2161 cmd_free_tag(cmd); ··· 2173 2169 /* ++Andreas: the mid level code knows about 2174 2170 QUEUE_FULL now. */ 2175 2171 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 2176 - dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d returned " 2172 + dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %llu returned " 2177 2173 "QUEUE_FULL after %d commands\n", 2178 2174 HOSTNO, cmd->device->id, cmd->device->lun, 2179 2175 ta->nr_allocated); ··· 2271 2267 cmd->device->tagged_supported = 0; 2272 2268 hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 2273 2269 cmd->tag = TAG_NONE; 2274 - dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d rejected " 2270 + dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %llu rejected " 2275 2271 "QUEUE_TAG message; tagged queuing " 2276 2272 "disabled\n", 2277 2273 HOSTNO, cmd->device->id, cmd->device->lun); ··· 2288 2284 hostdata->connected = NULL; 2289 2285 hostdata->disconnected_queue = cmd; 2290 2286 local_irq_restore(flags); 2291 - dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d lun %d was " 2287 + dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d lun %llu was " 2292 2288 "moved from connected to the " 2293 2289 "disconnected_queue\n", HOSTNO, 2294 2290 cmd->device->id, cmd->device->lun); ··· 2389 2385 printk("\n"); 2390 2386 } else if (tmp != EXTENDED_MESSAGE) 2391 2387 printk(KERN_DEBUG "scsi%d: rejecting unknown " 2392 - "message %02x from target %d, lun %d\n", 2388 + "message %02x from target %d, lun %llu\n", 2393 2389 HOSTNO, tmp, cmd->device->id, cmd->device->lun); 2394 2390 else 2395 2391 printk(KERN_DEBUG "scsi%d: rejecting unknown " 2396 2392 "extended message " 2397 - "code %02x, length %d from target %d, lun %d\n", 2393 + "code %02x, length %d from target %d, lun %llu\n", 2398 2394 HOSTNO, extended_msg[1], extended_msg[0], 2399 2395 cmd->device->id, cmd->device->lun); 2400 2396 ··· 2592 2588 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2593 2589 2594 2590 hostdata->connected = tmp; 2595 - dprintk(NDEBUG_RESELECTION, "scsi%d: nexus established, target = %d, lun = %d, tag = %d\n", 2591 + dprintk(NDEBUG_RESELECTION, "scsi%d: nexus established, target = %d, lun = %llu, tag = %d\n", 2596 2592 HOSTNO, tmp->device->id, tmp->device->lun, tmp->tag); 2597 2593 falcon_dont_release--; 2598 2594 }
+2 -2
drivers/scsi/bnx2fc/bnx2fc_io.c
··· 1450 1450 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; 1451 1451 struct bnx2fc_rport *tgt = io_req->tgt; 1452 1452 struct bnx2fc_cmd *cmd, *tmp; 1453 - int tm_lun = sc_cmd->device->lun; 1453 + u64 tm_lun = sc_cmd->device->lun; 1454 + u64 lun; 1454 1455 int rc = 0; 1455 - int lun; 1456 1456 1457 1457 /* called with tgt_lock held */ 1458 1458 BNX2FC_IO_DBG(io_req, "Entered bnx2fc_lun_reset_cmpl\n");
+8 -8
drivers/scsi/ch.c
··· 247 247 retry: 248 248 memset(cmd,0,sizeof(cmd)); 249 249 cmd[0] = READ_ELEMENT_STATUS; 250 - cmd[1] = (ch->device->lun << 5) | 250 + cmd[1] = ((ch->device->lun & 0x7) << 5) | 251 251 (ch->voltags ? 0x10 : 0) | 252 252 ch_elem_to_typecode(ch,elem); 253 253 cmd[2] = (elem >> 8) & 0xff; ··· 283 283 VPRINTK(KERN_INFO, "INITIALIZE ELEMENT STATUS, may take some time ...\n"); 284 284 memset(cmd,0,sizeof(cmd)); 285 285 cmd[0] = INITIALIZE_ELEMENT_STATUS; 286 - cmd[1] = ch->device->lun << 5; 286 + cmd[1] = (ch->device->lun & 0x7) << 5; 287 287 err = ch_do_scsi(ch, cmd, NULL, 0, DMA_NONE); 288 288 VPRINTK(KERN_INFO, "... finished\n"); 289 289 return err; ··· 303 303 304 304 memset(cmd,0,sizeof(cmd)); 305 305 cmd[0] = MODE_SENSE; 306 - cmd[1] = ch->device->lun << 5; 306 + cmd[1] = (ch->device->lun & 0x7) << 5; 307 307 cmd[2] = 0x1d; 308 308 cmd[4] = 255; 309 309 result = ch_do_scsi(ch, cmd, buffer, 255, DMA_FROM_DEVICE); ··· 428 428 trans = ch->firsts[CHET_MT]; 429 429 memset(cmd,0,sizeof(cmd)); 430 430 cmd[0] = POSITION_TO_ELEMENT; 431 - cmd[1] = ch->device->lun << 5; 431 + cmd[1] = (ch->device->lun & 0x7) << 5; 432 432 cmd[2] = (trans >> 8) & 0xff; 433 433 cmd[3] = trans & 0xff; 434 434 cmd[4] = (elem >> 8) & 0xff; ··· 447 447 trans = ch->firsts[CHET_MT]; 448 448 memset(cmd,0,sizeof(cmd)); 449 449 cmd[0] = MOVE_MEDIUM; 450 - cmd[1] = ch->device->lun << 5; 450 + cmd[1] = (ch->device->lun & 0x7) << 5; 451 451 cmd[2] = (trans >> 8) & 0xff; 452 452 cmd[3] = trans & 0xff; 453 453 cmd[4] = (src >> 8) & 0xff; ··· 470 470 trans = ch->firsts[CHET_MT]; 471 471 memset(cmd,0,sizeof(cmd)); 472 472 cmd[0] = EXCHANGE_MEDIUM; 473 - cmd[1] = ch->device->lun << 5; 473 + cmd[1] = (ch->device->lun & 0x7) << 5; 474 474 cmd[2] = (trans >> 8) & 0xff; 475 475 cmd[3] = trans & 0xff; 476 476 cmd[4] = (src >> 8) & 0xff; ··· 518 518 elem, tag); 519 519 memset(cmd,0,sizeof(cmd)); 520 520 cmd[0] = SEND_VOLUME_TAG; 521 - cmd[1] = (ch->device->lun << 5) | 521 + cmd[1] = ((ch->device->lun & 0x7) << 5) | 522 522 ch_elem_to_typecode(ch,elem); 523 523 cmd[2] = (elem >> 8) & 0xff; 524 524 cmd[3] = elem & 0xff; ··· 754 754 voltag_retry: 755 755 memset(ch_cmd, 0, sizeof(ch_cmd)); 756 756 ch_cmd[0] = READ_ELEMENT_STATUS; 757 - ch_cmd[1] = (ch->device->lun << 5) | 757 + ch_cmd[1] = ((ch->device->lun & 0x7) << 5) | 758 758 (ch->voltags ? 0x10 : 0) | 759 759 ch_elem_to_typecode(ch,elem); 760 760 ch_cmd[2] = (elem >> 8) & 0xff;
+12 -12
drivers/scsi/csiostor/csio_scsi.c
··· 1657 1657 case FW_SCSI_UNDER_FLOW_ERR: 1658 1658 csio_warn(hw, 1659 1659 "Under-flow error,cmnd:0x%x expected" 1660 - " len:0x%x resid:0x%x lun:0x%x ssn:0x%x\n", 1660 + " len:0x%x resid:0x%x lun:0x%llx ssn:0x%x\n", 1661 1661 cmnd->cmnd[0], scsi_bufflen(cmnd), 1662 1662 scsi_get_resid(cmnd), cmnd->device->lun, 1663 1663 rn->flowid); ··· 1957 1957 1958 1958 csio_dbg(hw, 1959 1959 "Request to abort ioreq:%p cmd:%p cdb:%08llx" 1960 - " ssni:0x%x lun:%d iq:0x%x\n", 1960 + " ssni:0x%x lun:%llu iq:0x%x\n", 1961 1961 ioreq, cmnd, *((uint64_t *)cmnd->cmnd), rn->flowid, 1962 1962 cmnd->device->lun, csio_q_physiqid(hw, ioreq->iq_idx)); 1963 1963 ··· 2015 2015 /* FW successfully aborted the request */ 2016 2016 if (host_byte(cmnd->result) == DID_REQUEUE) { 2017 2017 csio_info(hw, 2018 - "Aborted SCSI command to (%d:%d) serial#:0x%lx\n", 2018 + "Aborted SCSI command to (%d:%llu) serial#:0x%lx\n", 2019 2019 cmnd->device->id, cmnd->device->lun, 2020 2020 cmnd->serial_number); 2021 2021 return SUCCESS; 2022 2022 } else { 2023 2023 csio_info(hw, 2024 - "Failed to abort SCSI command, (%d:%d) serial#:0x%lx\n", 2024 + "Failed to abort SCSI command, (%d:%llu) serial#:0x%lx\n", 2025 2025 cmnd->device->id, cmnd->device->lun, 2026 2026 cmnd->serial_number); 2027 2027 return FAILED; ··· 2100 2100 if (!rn) 2101 2101 goto fail; 2102 2102 2103 - csio_dbg(hw, "Request to reset LUN:%d (ssni:0x%x tgtid:%d)\n", 2103 + csio_dbg(hw, "Request to reset LUN:%llu (ssni:0x%x tgtid:%d)\n", 2104 2104 cmnd->device->lun, rn->flowid, rn->scsi_id); 2105 2105 2106 2106 if (!csio_is_lnode_ready(ln)) { 2107 2107 csio_err(hw, 2108 2108 "LUN reset cannot be issued on non-ready" 2109 - " local node vnpi:0x%x (LUN:%d)\n", 2109 + " local node vnpi:0x%x (LUN:%llu)\n", 2110 2110 ln->vnp_flowid, cmnd->device->lun); 2111 2111 goto fail; 2112 2112 } ··· 2126 2126 if (fc_remote_port_chkready(rn->rport)) { 2127 2127 csio_err(hw, 2128 2128 "LUN reset cannot be issued on non-ready" 2129 - " remote node ssni:0x%x (LUN:%d)\n", 2129 + " remote node ssni:0x%x (LUN:%llu)\n", 2130 2130 rn->flowid, cmnd->device->lun); 2131 2131 goto fail; 2132 2132 } ··· 2168 2168 sld.level = CSIO_LEV_LUN; 2169 2169 sld.lnode = ioreq->lnode; 2170 2170 sld.rnode = ioreq->rnode; 2171 - sld.oslun = (uint64_t)cmnd->device->lun; 2171 + sld.oslun = cmnd->device->lun; 2172 2172 2173 2173 spin_lock_irqsave(&hw->lock, flags); 2174 2174 /* Kick off TM SM on the ioreq */ ··· 2190 2190 2191 2191 /* LUN reset timed-out */ 2192 2192 if (((struct scsi_cmnd *)csio_scsi_cmnd(ioreq)) == cmnd) { 2193 - csio_err(hw, "LUN reset (%d:%d) timed out\n", 2193 + csio_err(hw, "LUN reset (%d:%llu) timed out\n", 2194 2194 cmnd->device->id, cmnd->device->lun); 2195 2195 2196 2196 spin_lock_irq(&hw->lock); ··· 2203 2203 2204 2204 /* LUN reset returned, check cached status */ 2205 2205 if (cmnd->SCp.Status != FW_SUCCESS) { 2206 - csio_err(hw, "LUN reset failed (%d:%d), status: %d\n", 2206 + csio_err(hw, "LUN reset failed (%d:%llu), status: %d\n", 2207 2207 cmnd->device->id, cmnd->device->lun, cmnd->SCp.Status); 2208 2208 goto fail; 2209 2209 } ··· 2223 2223 /* Aborts may have timed out */ 2224 2224 if (retval != 0) { 2225 2225 csio_err(hw, 2226 - "Attempt to abort I/Os during LUN reset of %d" 2226 + "Attempt to abort I/Os during LUN reset of %llu" 2227 2227 " returned %d\n", cmnd->device->lun, retval); 2228 2228 /* Return I/Os back to active_q */ 2229 2229 spin_lock_irq(&hw->lock); ··· 2234 2234 2235 2235 CSIO_INC_STATS(rn, n_lun_rst); 2236 2236 2237 - csio_info(hw, "LUN reset occurred (%d:%d)\n", 2237 + csio_info(hw, "LUN reset occurred (%d:%llu)\n", 2238 2238 cmnd->device->id, cmnd->device->lun); 2239 2239 2240 2240 return SUCCESS;
+20 -20
drivers/scsi/dc395x.c
··· 1087 1087 struct AdapterCtlBlk *acb = 1088 1088 (struct AdapterCtlBlk *)cmd->device->host->hostdata; 1089 1089 dprintkdbg(DBG_0, "queue_command: (0x%p) <%02i-%i> cmnd=0x%02x\n", 1090 - cmd, cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 1090 + cmd, cmd->device->id, (u8)cmd->device->lun, cmd->cmnd[0]); 1091 1091 1092 1092 /* Assume BAD_TARGET; will be cleared later */ 1093 1093 cmd->result = DID_BAD_TARGET << 16; ··· 1102 1102 /* does the specified lun on the specified device exist */ 1103 1103 if (!(acb->dcb_map[cmd->device->id] & (1 << cmd->device->lun))) { 1104 1104 dprintkl(KERN_INFO, "queue_command: Ignore target <%02i-%i>\n", 1105 - cmd->device->id, cmd->device->lun); 1105 + cmd->device->id, (u8)cmd->device->lun); 1106 1106 goto complete; 1107 1107 } 1108 1108 ··· 1111 1111 if (!dcb) { 1112 1112 /* should never happen */ 1113 1113 dprintkl(KERN_ERR, "queue_command: No such device <%02i-%i>", 1114 - cmd->device->id, cmd->device->lun); 1114 + cmd->device->id, (u8)cmd->device->lun); 1115 1115 goto complete; 1116 1116 } 1117 1117 ··· 1207 1207 "cmnd=0x%02x <%02i-%i>\n", 1208 1208 srb, srb->cmd, 1209 1209 srb->cmd->cmnd[0], srb->cmd->device->id, 1210 - srb->cmd->device->lun); 1210 + (u8)srb->cmd->device->lun); 1211 1211 printk(" sglist=%p cnt=%i idx=%i len=%zu\n", 1212 1212 srb->segment_x, srb->sg_count, srb->sg_index, 1213 1213 srb->total_xfer_length); ··· 1302 1302 (struct AdapterCtlBlk *)cmd->device->host->hostdata; 1303 1303 dprintkl(KERN_INFO, 1304 1304 "eh_bus_reset: (0%p) target=<%02i-%i> cmd=%p\n", 1305 - cmd, cmd->device->id, cmd->device->lun, cmd); 1305 + cmd, cmd->device->id, (u8)cmd->device->lun, cmd); 1306 1306 1307 1307 if (timer_pending(&acb->waiting_timer)) 1308 1308 del_timer(&acb->waiting_timer); ··· 1369 1369 struct DeviceCtlBlk *dcb; 1370 1370 struct ScsiReqBlk *srb; 1371 1371 dprintkl(KERN_INFO, "eh_abort: (0x%p) target=<%02i-%i> cmd=%p\n", 1372 - cmd, cmd->device->id, cmd->device->lun, cmd); 1372 + cmd, cmd->device->id, (u8)cmd->device->lun, cmd); 1373 1373 1374 1374 dcb = find_dcb(acb, cmd->device->id, cmd->device->lun); 1375 1375 if (!dcb) { ··· 1605 1605 dprintkl(KERN_WARNING, "start_scsi: (0x%p) " 1606 1606 "Out of tags target=<%02i-%i>)\n", 1607 1607 srb->cmd, srb->cmd->device->id, 1608 - srb->cmd->device->lun); 1608 + (u8)srb->cmd->device->lun); 1609 1609 srb->state = SRB_READY; 1610 1610 DC395x_write16(acb, TRM_S1040_SCSI_CONTROL, 1611 1611 DO_HWRESELECT); ··· 1623 1623 /*polling:*/ 1624 1624 /* Send CDB ..command block ......... */ 1625 1625 dprintkdbg(DBG_KG, "start_scsi: (0x%p) <%02i-%i> cmnd=0x%02x tag=%i\n", 1626 - srb->cmd, srb->cmd->device->id, srb->cmd->device->lun, 1626 + srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun, 1627 1627 srb->cmd->cmnd[0], srb->tag_number); 1628 1628 if (srb->flag & AUTO_REQSENSE) { 1629 1629 DC395x_write8(acb, TRM_S1040_SCSI_FIFO, REQUEST_SENSE); ··· 2041 2041 u16 scsi_status = *pscsi_status; 2042 2042 u32 d_left_counter = 0; 2043 2043 dprintkdbg(DBG_0, "data_out_phase0: (0x%p) <%02i-%i>\n", 2044 - srb->cmd, srb->cmd->device->id, srb->cmd->device->lun); 2044 + srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun); 2045 2045 2046 2046 /* 2047 2047 * KG: We need to drain the buffers before we draw any conclusions! ··· 2171 2171 u16 *pscsi_status) 2172 2172 { 2173 2173 dprintkdbg(DBG_0, "data_out_phase1: (0x%p) <%02i-%i>\n", 2174 - srb->cmd, srb->cmd->device->id, srb->cmd->device->lun); 2174 + srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun); 2175 2175 clear_fifo(acb, "data_out_phase1"); 2176 2176 /* do prepare before transfer when data out phase */ 2177 2177 data_io_transfer(acb, srb, XFERDATAOUT); ··· 2183 2183 u16 scsi_status = *pscsi_status; 2184 2184 2185 2185 dprintkdbg(DBG_0, "data_in_phase0: (0x%p) <%02i-%i>\n", 2186 - srb->cmd, srb->cmd->device->id, srb->cmd->device->lun); 2186 + srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun); 2187 2187 2188 2188 /* 2189 2189 * KG: DataIn is much more tricky than DataOut. When the device is finished ··· 2394 2394 u16 *pscsi_status) 2395 2395 { 2396 2396 dprintkdbg(DBG_0, "data_in_phase1: (0x%p) <%02i-%i>\n", 2397 - srb->cmd, srb->cmd->device->id, srb->cmd->device->lun); 2397 + srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun); 2398 2398 data_io_transfer(acb, srb, XFERDATAIN); 2399 2399 } 2400 2400 ··· 2406 2406 u8 bval; 2407 2407 dprintkdbg(DBG_0, 2408 2408 "data_io_transfer: (0x%p) <%02i-%i> %c len=%i, sg=(%i/%i)\n", 2409 - srb->cmd, srb->cmd->device->id, srb->cmd->device->lun, 2409 + srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun, 2410 2410 ((io_dir & DMACMD_DIR) ? 'r' : 'w'), 2411 2411 srb->total_xfer_length, srb->sg_index, srb->sg_count); 2412 2412 if (srb == acb->tmp_srb) ··· 2579 2579 u16 *pscsi_status) 2580 2580 { 2581 2581 dprintkdbg(DBG_0, "status_phase0: (0x%p) <%02i-%i>\n", 2582 - srb->cmd, srb->cmd->device->id, srb->cmd->device->lun); 2582 + srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun); 2583 2583 srb->target_status = DC395x_read8(acb, TRM_S1040_SCSI_FIFO); 2584 2584 srb->end_message = DC395x_read8(acb, TRM_S1040_SCSI_FIFO); /* get message */ 2585 2585 srb->state = SRB_COMPLETED; ··· 2593 2593 u16 *pscsi_status) 2594 2594 { 2595 2595 dprintkdbg(DBG_0, "status_phase1: (0x%p) <%02i-%i>\n", 2596 - srb->cmd, srb->cmd->device->id, srb->cmd->device->lun); 2596 + srb->cmd, srb->cmd->device->id, (u8)srb->cmd->device->lun); 2597 2597 srb->state = SRB_STATUS; 2598 2598 DC395x_write16(acb, TRM_S1040_SCSI_CONTROL, DO_DATALATCH); /* it's important for atn stop */ 2599 2599 DC395x_write8(acb, TRM_S1040_SCSI_COMMAND, SCMD_COMP); ··· 3318 3318 int ckc_only = 1; 3319 3319 3320 3320 dprintkdbg(DBG_1, "srb_done: (0x%p) <%02i-%i>\n", srb->cmd, 3321 - srb->cmd->device->id, srb->cmd->device->lun); 3321 + srb->cmd->device->id, (u8)srb->cmd->device->lun); 3322 3322 dprintkdbg(DBG_SG, "srb_done: srb=%p sg=%i(%i/%i) buf=%p\n", 3323 3323 srb, scsi_sg_count(cmd), srb->sg_index, srb->sg_count, 3324 3324 scsi_sgtalbe(cmd)); ··· 3498 3498 if (srb->total_xfer_length) 3499 3499 dprintkdbg(DBG_KG, "srb_done: (0x%p) <%02i-%i> " 3500 3500 "cmnd=0x%02x Missed %i bytes\n", 3501 - cmd, cmd->device->id, cmd->device->lun, 3501 + cmd, cmd->device->id, (u8)cmd->device->lun, 3502 3502 cmd->cmnd[0], srb->total_xfer_length); 3503 3503 } 3504 3504 ··· 3538 3538 dir = p->sc_data_direction; 3539 3539 result = MK_RES(0, did_flag, 0, 0); 3540 3540 printk("G:%p(%02i-%i) ", p, 3541 - p->device->id, p->device->lun); 3541 + p->device->id, (u8)p->device->lun); 3542 3542 srb_going_remove(dcb, srb); 3543 3543 free_tag(dcb, srb); 3544 3544 srb_free_insert(acb, srb); ··· 3568 3568 3569 3569 result = MK_RES(0, did_flag, 0, 0); 3570 3570 printk("W:%p<%02i-%i>", p, p->device->id, 3571 - p->device->lun); 3571 + (u8)p->device->lun); 3572 3572 srb_waiting_remove(dcb, srb); 3573 3573 srb_free_insert(acb, srb); 3574 3574 p->result = result; ··· 3677 3677 { 3678 3678 struct scsi_cmnd *cmd = srb->cmd; 3679 3679 dprintkdbg(DBG_1, "request_sense: (0x%p) <%02i-%i>\n", 3680 - cmd, cmd->device->id, cmd->device->lun); 3680 + cmd, cmd->device->id, (u8)cmd->device->lun); 3681 3681 3682 3682 srb->flag |= AUTO_REQSENSE; 3683 3683 srb->adapter_status = 0;
+19 -19
drivers/scsi/dpt_i2o.c
··· 459 459 * to the device structure. This should be a TEST_UNIT_READY 460 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 463 // TODO: if any luns are at this bus, scsi id then fake a TEST_UNIT_READY and INQUIRY response 464 464 // with type 7F (for all luns less than the max for this bus,id) so the lun scan will continue. 465 465 cmd->result = (DID_NO_CONNECT << 16); ··· 579 579 seq_printf(m," Rev: %-8.8s\n", d->pScsi_dev->rev); 580 580 581 581 unit = d->pI2o_dev->lct_data.tid; 582 - seq_printf(m, "\tTID=%d, (Channel=%d, Target=%d, Lun=%d) (%s)\n\n", 583 - unit, (int)d->scsi_channel, (int)d->scsi_id, (int)d->scsi_lun, 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, d->scsi_lun, 584 584 scsi_device_online(d->pScsi_dev)? "online":"offline"); 585 585 d = d->next_lun; 586 586 } ··· 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 1167 struct adpt_device* d; 1168 1168 ··· 1462 1462 i2o_lct *lct = pHba->lct; 1463 1463 u8 bus_no = 0; 1464 1464 s16 scsi_id; 1465 - s16 scsi_lun; 1465 + u64 scsi_lun; 1466 1466 u32 buf[10]; // larger than 7, or 8 ... 1467 1467 struct adpt_device* pDev; 1468 1468 ··· 1496 1496 } 1497 1497 bus_no = buf[0]>>16; 1498 1498 scsi_id = buf[1]; 1499 - scsi_lun = (buf[2]>>8 )&0xff; 1499 + scsi_lun = scsilun_to_int((struct scsi_lun *)&buf[2]); 1500 1500 if(bus_no >= MAX_CHANNEL) { // Something wrong skip it 1501 1501 printk(KERN_WARNING"%s: Channel number %d out of range \n", pHba->name, bus_no); 1502 1502 continue; ··· 1571 1571 if(adpt_i2o_query_scalar(pHba, tid, 0x8000, -1, buf, 32)>=0) { 1572 1572 bus_no = buf[0]>>16; 1573 1573 scsi_id = buf[1]; 1574 - scsi_lun = (buf[2]>>8 )&0xff; 1574 + scsi_lun = scsilun_to_int((struct scsi_lun *)&buf[2]); 1575 1575 if(bus_no >= MAX_CHANNEL) { // Something wrong skip it 1576 1576 continue; 1577 1577 } ··· 2407 2407 case I2O_SCSI_DSC_COMMAND_TIMEOUT: 2408 2408 case I2O_SCSI_DSC_NO_ADAPTER: 2409 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", 2411 - pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, hba_status, dev_status, cmd->cmnd[0]); 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, cmd->device->lun, hba_status, dev_status, cmd->cmnd[0]); 2412 2412 cmd->result = (DID_TIME_OUT << 16); 2413 2413 break; 2414 2414 case I2O_SCSI_DSC_ADAPTER_BUSY: ··· 2447 2447 case I2O_SCSI_DSC_QUEUE_FROZEN: 2448 2448 case I2O_SCSI_DSC_REQUEST_INVALID: 2449 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", 2451 - pHba->name, detailed_status & I2O_SCSI_DSC_MASK, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, 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, cmd->device->lun, 2452 2452 hba_status, dev_status, cmd->cmnd[0]); 2453 2453 cmd->result = (DID_ERROR << 16); 2454 2454 break; ··· 2464 2464 cmd->sense_buffer[2] == DATA_PROTECT ){ 2465 2465 /* This is to handle an array failed */ 2466 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", 2468 - pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, 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, cmd->device->lun, 2469 2469 hba_status, dev_status, cmd->cmnd[0]); 2470 2470 2471 2471 } ··· 2476 2476 * for a limitted number of retries. 2477 2477 */ 2478 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", 2480 - pHba->name, (u32)cmd->device->channel, (u32)cmd->device->id, (u32)cmd->device->lun, 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, cmd->device->lun, 2481 2481 ((struct adpt_device*)(cmd->device->hostdata))->tid, cmd->cmnd[0]); 2482 2482 } 2483 2483 ··· 2517 2517 i2o_lct *lct = pHba->lct; 2518 2518 u8 bus_no = 0; 2519 2519 s16 scsi_id; 2520 - s16 scsi_lun; 2520 + u64 scsi_lun; 2521 2521 u32 buf[10]; // at least 8 u32's 2522 2522 struct adpt_device* pDev = NULL; 2523 2523 struct i2o_device* pI2o_dev = NULL; ··· 2564 2564 } 2565 2565 2566 2566 scsi_id = buf[1]; 2567 - scsi_lun = (buf[2]>>8 )&0xff; 2567 + scsi_lun = scsilun_to_int((struct scsi_lun *)&buf[2]); 2568 2568 pDev = pHba->channel[bus_no].device[scsi_id]; 2569 2569 /* da lun */ 2570 2570 while(pDev) { ··· 2633 2633 while(pDev) { 2634 2634 if(pDev->scsi_lun == scsi_lun) { 2635 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 2637 pHba->name,bus_no,scsi_id,scsi_lun); 2638 2638 if (pDev->pScsi_dev) { 2639 2639 scsi_device_set_state(pDev->pScsi_dev, SDEV_RUNNING); ··· 2665 2665 // in the LCT table 2666 2666 if (pDev->state & DPTI_DEV_UNSCANNED){ 2667 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 2669 if (pDev->pScsi_dev) { 2670 2670 scsi_device_set_state(pDev->pScsi_dev, SDEV_OFFLINE); 2671 2671 }
+3 -3
drivers/scsi/dpti.h
··· 184 184 u32 block_size; 185 185 u8 scsi_channel; 186 186 u8 scsi_id; 187 - u8 scsi_lun; 187 + u64 scsi_lun; 188 188 u8 state; 189 189 u16 tid; 190 190 struct i2o_device* pI2o_dev; ··· 231 231 u32 sg_tablesize; // Scatter/Gather List Size. 232 232 u8 top_scsi_channel; 233 233 u8 top_scsi_id; 234 - u8 top_scsi_lun; 234 + u64 top_scsi_lun; 235 235 u8 dma64; 236 236 237 237 i2o_status_block* status_block; ··· 300 300 static void adpt_i2o_delete_hba(adpt_hba* pHba); 301 301 static void adpt_inquiry(adpt_hba* pHba); 302 302 static void adpt_fail_posted_scbs(adpt_hba* pHba); 303 - static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun); 303 + static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u64 lun); 304 304 static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev) ; 305 305 static int adpt_i2o_online_hba(adpt_hba* pHba); 306 306 static void adpt_i2o_post_wait_complete(u32, int);
+1 -1
drivers/scsi/eata.c
··· 2449 2449 "target_status 0x%x, sense key 0x%x.\n", 2450 2450 ha->board_name, 2451 2451 SCpnt->device->channel, SCpnt->device->id, 2452 - SCpnt->device->lun, 2452 + (u8)SCpnt->device->lun, 2453 2453 spp->target_status, SCpnt->sense_buffer[2]); 2454 2454 2455 2455 ha->target_to[SCpnt->device->id][SCpnt->device->channel] = 0;
+2 -2
drivers/scsi/fnic/fnic_scsi.c
··· 1753 1753 tag = sc->request->tag; 1754 1754 FNIC_SCSI_DBG(KERN_DEBUG, 1755 1755 fnic->lport->host, 1756 - "Abort Cmd called FCID 0x%x, LUN 0x%x TAG %x flags %x\n", 1756 + "Abort Cmd called FCID 0x%x, LUN 0x%llx TAG %x flags %x\n", 1757 1757 rport->port_id, sc->device->lun, tag, CMD_FLAGS(sc)); 1758 1758 1759 1759 CMD_FLAGS(sc) = FNIC_NO_FLAGS; ··· 2207 2207 2208 2208 rport = starget_to_rport(scsi_target(sc->device)); 2209 2209 FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host, 2210 - "Device reset called FCID 0x%x, LUN 0x%x sc 0x%p\n", 2210 + "Device reset called FCID 0x%x, LUN 0x%llx sc 0x%p\n", 2211 2211 rport->port_id, sc->device->lun, sc); 2212 2212 2213 2213 if (lp->state != LPORT_ST_READY || !(lp->link_up))
+1 -1
drivers/scsi/g_NCR5380.c
··· 768 768 769 769 static void sprint_Scsi_Cmnd(struct seq_file *m, Scsi_Cmnd * cmd) 770 770 { 771 - PRINTP("host number %d destination target %d, lun %d\n" ANDP cmd->device->host->host_no ANDP cmd->device->id ANDP cmd->device->lun); 771 + PRINTP("host number %d destination target %d, lun %llu\n" ANDP cmd->device->host->host_no ANDP cmd->device->id ANDP cmd->device->lun); 772 772 PRINTP(" command = "); 773 773 sprint_command(m, cmd->cmnd); 774 774 }
+1 -1
drivers/scsi/hpsa.c
··· 4590 4590 return FAILED; 4591 4591 4592 4592 memset(msg, 0, sizeof(msg)); 4593 - ml += sprintf(msg+ml, "ABORT REQUEST on C%d:B%d:T%d:L%d ", 4593 + ml += sprintf(msg+ml, "ABORT REQUEST on C%d:B%d:T%d:L%llu ", 4594 4594 h->scsi_host->host_no, sc->device->channel, 4595 4595 sc->device->id, sc->device->lun); 4596 4596
+1 -1
drivers/scsi/hptiop.c
··· 1024 1024 1025 1025 _req->scp = scp; 1026 1026 1027 - dprintk("hptiop_queuecmd(scp=%p) %d/%d/%d/%d cdb=(%08x-%08x-%08x-%08x) " 1027 + dprintk("hptiop_queuecmd(scp=%p) %d/%d/%d/%llu cdb=(%08x-%08x-%08x-%08x) " 1028 1028 "req_index=%d, req=%p\n", 1029 1029 scp, 1030 1030 host->host_no, scp->device->channel,
+3 -3
drivers/scsi/in2000.c
··· 2251 2251 seq_printf(m, "\nconnected: "); 2252 2252 if (hd->connected) { 2253 2253 cmd = (Scsi_Cmnd *) hd->connected; 2254 - seq_printf(m, " %d:%d(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2254 + seq_printf(m, " %d:%llu(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2255 2255 } 2256 2256 } 2257 2257 if (hd->proc & PR_INPUTQ) { 2258 2258 seq_printf(m, "\ninput_Q: "); 2259 2259 cmd = (Scsi_Cmnd *) hd->input_Q; 2260 2260 while (cmd) { 2261 - seq_printf(m, " %d:%d(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2261 + seq_printf(m, " %d:%llu(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2262 2262 cmd = (Scsi_Cmnd *) cmd->host_scribble; 2263 2263 } 2264 2264 } ··· 2266 2266 seq_printf(m, "\ndisconnected_Q:"); 2267 2267 cmd = (Scsi_Cmnd *) hd->disconnected_Q; 2268 2268 while (cmd) { 2269 - seq_printf(m, " %d:%d(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2269 + seq_printf(m, " %d:%llu(%02x)", cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2270 2270 cmd = (Scsi_Cmnd *) cmd->host_scribble; 2271 2271 } 2272 2272 }
+4 -4
drivers/scsi/libiscsi.c
··· 260 260 { 261 261 struct iscsi_conn *conn = task->conn; 262 262 struct iscsi_tm *tmf = &conn->tmhdr; 263 - unsigned int hdr_lun; 263 + u64 hdr_lun; 264 264 265 265 if (conn->tmf_state == TMF_INITIAL) 266 266 return 0; ··· 1859 1859 * Fail commands. session lock held and recv side suspended and xmit 1860 1860 * thread flushed 1861 1861 */ 1862 - static void fail_scsi_tasks(struct iscsi_conn *conn, unsigned lun, 1863 - int error) 1862 + static void fail_scsi_tasks(struct iscsi_conn *conn, u64 lun, int error) 1864 1863 { 1865 1864 struct iscsi_task *task; 1866 1865 int i; ··· 2278 2279 cls_session = starget_to_session(scsi_target(sc->device)); 2279 2280 session = cls_session->dd_data; 2280 2281 2281 - ISCSI_DBG_EH(session, "LU Reset [sc %p lun %u]\n", sc, sc->device->lun); 2282 + ISCSI_DBG_EH(session, "LU Reset [sc %p lun %llu]\n", sc, 2283 + sc->device->lun); 2282 2284 2283 2285 mutex_lock(&session->eh_mutex); 2284 2286 spin_lock_bh(&session->frwd_lock);
+6 -5
drivers/scsi/libsas/sas_scsi_host.c
··· 404 404 405 405 int_to_scsilun(cmd->device->lun, &lun); 406 406 407 - SAS_DPRINTK("eh: device %llx LUN %x has the task\n", 407 + SAS_DPRINTK("eh: device %llx LUN %llx has the task\n", 408 408 SAS_ADDR(dev->sas_addr), 409 409 cmd->device->lun); 410 410 ··· 490 490 } 491 491 EXPORT_SYMBOL(sas_wait_eh); 492 492 493 - static int sas_queue_reset(struct domain_device *dev, int reset_type, int lun, int wait) 493 + static int sas_queue_reset(struct domain_device *dev, int reset_type, 494 + u64 lun, int wait) 494 495 { 495 496 struct sas_ha_struct *ha = dev->port->ha; 496 497 int scheduled = 0, tries = 100; ··· 690 689 reset: 691 690 tmf_resp = sas_recover_lu(task->dev, cmd); 692 691 if (tmf_resp == TMF_RESP_FUNC_COMPLETE) { 693 - SAS_DPRINTK("dev %016llx LU %x is " 692 + SAS_DPRINTK("dev %016llx LU %llx is " 694 693 "recovered\n", 695 694 SAS_ADDR(task->dev), 696 695 cmd->device->lun); ··· 743 742 * of effort could recover from errors. Quite 744 743 * possibly the HA just disappeared. 745 744 */ 746 - SAS_DPRINTK("error from device %llx, LUN %x " 745 + SAS_DPRINTK("error from device %llx, LUN %llx " 747 746 "couldn't be recovered in any way\n", 748 747 SAS_ADDR(task->dev->sas_addr), 749 748 cmd->device->lun); ··· 942 941 scsi_set_tag_type(scsi_dev, MSG_SIMPLE_TAG); 943 942 scsi_activate_tcq(scsi_dev, SAS_DEF_QD); 944 943 } else { 945 - SAS_DPRINTK("device %llx, LUN %x doesn't support " 944 + SAS_DPRINTK("device %llx, LUN %llx doesn't support " 946 945 "TCQ\n", SAS_ADDR(dev->sas_addr), 947 946 scsi_dev->lun); 948 947 scsi_dev->tagged_supported = 0;
+18 -18
drivers/scsi/lpfc/lpfc_scsi.c
··· 258 258 lpfc_send_sdev_queuedepth_change_event(struct lpfc_hba *phba, 259 259 struct lpfc_vport *vport, 260 260 struct lpfc_nodelist *ndlp, 261 - uint32_t lun, 261 + uint64_t lun, 262 262 uint32_t old_val, 263 263 uint32_t new_val) 264 264 { ··· 3823 3823 if (rsplen != 0 && rsplen != 4 && rsplen != 8) { 3824 3824 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, 3825 3825 "2719 Invalid response length: " 3826 - "tgt x%x lun x%x cmnd x%x rsplen x%x\n", 3826 + "tgt x%x lun x%llx cmnd x%x rsplen x%x\n", 3827 3827 cmnd->device->id, 3828 3828 cmnd->device->lun, cmnd->cmnd[0], 3829 3829 rsplen); ··· 3834 3834 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, 3835 3835 "2757 Protocol failure detected during " 3836 3836 "processing of FCP I/O op: " 3837 - "tgt x%x lun x%x cmnd x%x rspInfo3 x%x\n", 3837 + "tgt x%x lun x%llx cmnd x%x rspInfo3 x%x\n", 3838 3838 cmnd->device->id, 3839 3839 cmnd->device->lun, cmnd->cmnd[0], 3840 3840 fcprsp->rspInfo3); ··· 4045 4045 else 4046 4046 logit = LOG_FCP | LOG_FCP_UNDER; 4047 4047 lpfc_printf_vlog(vport, KERN_WARNING, logit, 4048 - "9030 FCP cmd x%x failed <%d/%d> " 4048 + "9030 FCP cmd x%x failed <%d/%lld> " 4049 4049 "status: x%x result: x%x " 4050 4050 "sid: x%x did: x%x oxid: x%x " 4051 4051 "Data: x%x x%x\n", ··· 4157 4157 uint32_t *lp = (uint32_t *)cmd->sense_buffer; 4158 4158 4159 4159 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, 4160 - "0710 Iodone <%d/%d> cmd %p, error " 4160 + "0710 Iodone <%d/%llu> cmd %p, error " 4161 4161 "x%x SNS x%x x%x Data: x%x x%x\n", 4162 4162 cmd->device->id, cmd->device->lun, cmd, 4163 4163 cmd->result, *lp, *(lp + 3), cmd->retries, ··· 4390 4390 static int 4391 4391 lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_vport *vport, 4392 4392 struct lpfc_scsi_buf *lpfc_cmd, 4393 - unsigned int lun, 4393 + uint64_t lun, 4394 4394 uint8_t task_mgmt_cmd) 4395 4395 { 4396 4396 struct lpfc_iocbq *piocbq; ··· 4719 4719 atomic_dec(&ndlp->cmd_pending); 4720 4720 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, 4721 4721 "3376 FCP could not issue IOCB err %x" 4722 - "FCP cmd x%x <%d/%d> " 4722 + "FCP cmd x%x <%d/%llu> " 4723 4723 "sid: x%x did: x%x oxid: x%x " 4724 4724 "Data: x%x x%x x%x x%x\n", 4725 4725 err, cmnd->cmnd[0], 4726 4726 cmnd->device ? cmnd->device->id : 0xffff, 4727 - cmnd->device ? cmnd->device->lun : 0xffff, 4727 + cmnd->device ? cmnd->device->lun : (u64) -1, 4728 4728 vport->fc_myDID, ndlp->nlp_DID, 4729 4729 phba->sli_rev == LPFC_SLI_REV4 ? 4730 4730 lpfc_cmd->cur_iocbq.sli4_xritag : 0xffff, ··· 4807 4807 spin_unlock_irqrestore(&phba->hbalock, flags); 4808 4808 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP, 4809 4809 "2873 SCSI Layer I/O Abort Request IO CMPL Status " 4810 - "x%x ID %d LUN %d\n", 4810 + "x%x ID %d LUN %llu\n", 4811 4811 SUCCESS, cmnd->device->id, cmnd->device->lun); 4812 4812 return SUCCESS; 4813 4813 } ··· 4924 4924 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, 4925 4925 "0748 abort handler timed out waiting " 4926 4926 "for abortng I/O (xri:x%x) to complete: " 4927 - "ret %#x, ID %d, LUN %d\n", 4927 + "ret %#x, ID %d, LUN %llu\n", 4928 4928 iocb->sli4_xritag, ret, 4929 4929 cmnd->device->id, cmnd->device->lun); 4930 4930 } ··· 4935 4935 out: 4936 4936 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP, 4937 4937 "0749 SCSI Layer I/O Abort Request Status x%x ID %d " 4938 - "LUN %d\n", ret, cmnd->device->id, 4938 + "LUN %llu\n", ret, cmnd->device->id, 4939 4939 cmnd->device->lun); 4940 4940 return ret; 4941 4941 } ··· 5047 5047 **/ 5048 5048 static int 5049 5049 lpfc_send_taskmgmt(struct lpfc_vport *vport, struct lpfc_rport_data *rdata, 5050 - unsigned tgt_id, unsigned int lun_id, 5050 + unsigned tgt_id, uint64_t lun_id, 5051 5051 uint8_t task_mgmt_cmd) 5052 5052 { 5053 5053 struct lpfc_hba *phba = vport->phba; ··· 5083 5083 iocbq->iocb_cmpl = lpfc_tskmgmt_def_cmpl; 5084 5084 5085 5085 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, 5086 - "0702 Issue %s to TGT %d LUN %d " 5086 + "0702 Issue %s to TGT %d LUN %llu " 5087 5087 "rpi x%x nlp_flag x%x Data: x%x x%x\n", 5088 5088 lpfc_taskmgmt_name(task_mgmt_cmd), tgt_id, lun_id, 5089 5089 pnode->nlp_rpi, pnode->nlp_flag, iocbq->sli4_xritag, ··· 5094 5094 if ((status != IOCB_SUCCESS) || 5095 5095 (iocbqrsp->iocb.ulpStatus != IOSTAT_SUCCESS)) { 5096 5096 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, 5097 - "0727 TMF %s to TGT %d LUN %d failed (%d, %d) " 5097 + "0727 TMF %s to TGT %d LUN %llu failed (%d, %d) " 5098 5098 "iocb_flag x%x\n", 5099 5099 lpfc_taskmgmt_name(task_mgmt_cmd), 5100 5100 tgt_id, lun_id, iocbqrsp->iocb.ulpStatus, ··· 5238 5238 struct lpfc_rport_data *rdata; 5239 5239 struct lpfc_nodelist *pnode; 5240 5240 unsigned tgt_id = cmnd->device->id; 5241 - unsigned int lun_id = cmnd->device->lun; 5241 + uint64_t lun_id = cmnd->device->lun; 5242 5242 struct lpfc_scsi_event_header scsi_event; 5243 5243 int status; 5244 5244 ··· 5273 5273 FCP_LUN_RESET); 5274 5274 5275 5275 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, 5276 - "0713 SCSI layer issued Device Reset (%d, %d) " 5276 + "0713 SCSI layer issued Device Reset (%d, %llu) " 5277 5277 "return x%x\n", tgt_id, lun_id, status); 5278 5278 5279 5279 /* ··· 5308 5308 struct lpfc_rport_data *rdata; 5309 5309 struct lpfc_nodelist *pnode; 5310 5310 unsigned tgt_id = cmnd->device->id; 5311 - unsigned int lun_id = cmnd->device->lun; 5311 + uint64_t lun_id = cmnd->device->lun; 5312 5312 struct lpfc_scsi_event_header scsi_event; 5313 5313 int status; 5314 5314 ··· 5343 5343 FCP_TARGET_RESET); 5344 5344 5345 5345 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, 5346 - "0723 SCSI layer issued Target Reset (%d, %d) " 5346 + "0723 SCSI layer issued Target Reset (%d, %llu) " 5347 5347 "return x%x\n", tgt_id, lun_id, status); 5348 5348 5349 5349 /*
+2 -2
drivers/scsi/megaraid.c
··· 1941 1941 1942 1942 printk(KERN_WARNING "megaraid: %s cmd=%x <c=%d t=%d l=%d>\n", 1943 1943 (aor == SCB_ABORT)? "ABORTING":"RESET", 1944 - cmd->cmnd[0], cmd->device->channel, 1945 - cmd->device->id, cmd->device->lun); 1944 + cmd->cmnd[0], cmd->device->channel, 1945 + cmd->device->id, (u32)cmd->device->lun); 1946 1946 1947 1947 if(list_empty(&adapter->pending_list)) 1948 1948 return FALSE;
+1 -1
drivers/scsi/megaraid/mega_common.h
··· 204 204 #define SCP2HOSTDATA(scp) SCP2HOST(scp)->hostdata // to soft state 205 205 #define SCP2CHANNEL(scp) (scp)->device->channel // to channel 206 206 #define SCP2TARGET(scp) (scp)->device->id // to target 207 - #define SCP2LUN(scp) (scp)->device->lun // to LUN 207 + #define SCP2LUN(scp) (u32)(scp)->device->lun // to LUN 208 208 209 209 // generic macro to convert scsi command and host to controller's soft state 210 210 #define SCSIHOST2ADAP(host) (((caddr_t *)(host->hostdata))[0])
+2 -2
drivers/scsi/megaraid/megaraid_sas_fusion.c
··· 1690 1690 MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); 1691 1691 } 1692 1692 io_request->RaidContext.VirtualDiskTgtId = cpu_to_le16(device_id); 1693 - io_request->LUN[1] = scmd->device->lun; 1693 + int_to_scsilun(scmd->device->lun, (struct scsi_lun *)io_request->LUN); 1694 1694 } 1695 1695 1696 1696 /** ··· 1713 1713 device_id = MEGASAS_DEV_INDEX(instance, scp); 1714 1714 1715 1715 /* Zero out some fields so they don't get reused */ 1716 - io_request->LUN[1] = 0; 1716 + memset(io_request->LUN, 0x0, 8); 1717 1717 io_request->CDB.EEDP32.PrimaryReferenceTag = 0; 1718 1718 io_request->CDB.EEDP32.PrimaryApplicationTagMask = 0; 1719 1719 io_request->EEDPFlags = 0;
+1 -1
drivers/scsi/mesh.c
··· 1230 1230 ms->msgphase = msg_out; 1231 1231 } else if (code != cmd->device->lun + IDENTIFY_BASE) { 1232 1232 printk(KERN_WARNING "mesh: lun mismatch " 1233 - "(%d != %d) on reselection from " 1233 + "(%d != %llu) on reselection from " 1234 1234 "target %d\n", code - IDENTIFY_BASE, 1235 1235 cmd->device->lun, ms->conn_tgt); 1236 1236 }
+1 -1
drivers/scsi/ncr53c8xx.c
··· 6633 6633 ** patch requested size into sense command 6634 6634 */ 6635 6635 cp->sensecmd[0] = 0x03; 6636 - cp->sensecmd[1] = cmd->device->lun << 5; 6636 + cp->sensecmd[1] = (cmd->device->lun & 0x7) << 5; 6637 6637 cp->sensecmd[4] = sizeof(cp->sense_buf); 6638 6638 6639 6639 /*
+1 -1
drivers/scsi/nsp32.c
··· 915 915 int ret; 916 916 917 917 nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND, 918 - "enter. target: 0x%x LUN: 0x%x cmnd: 0x%x cmndlen: 0x%x " 918 + "enter. target: 0x%x LUN: 0x%llu cmnd: 0x%x cmndlen: 0x%x " 919 919 "use_sg: 0x%x reqbuf: 0x%lx reqlen: 0x%x", 920 920 SCpnt->device->id, SCpnt->device->lun, SCpnt->cmnd[0], SCpnt->cmd_len, 921 921 scsi_sg_count(SCpnt), scsi_sglist(SCpnt), scsi_bufflen(SCpnt));
+1 -1
drivers/scsi/pcmcia/nsp_cs.c
··· 195 195 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; 196 196 197 197 nsp_dbg(NSP_DEBUG_QUEUECOMMAND, 198 - "SCpnt=0x%p target=%d lun=%d sglist=0x%p bufflen=%d sg_count=%d", 198 + "SCpnt=0x%p target=%d lun=%llu sglist=0x%p bufflen=%d sg_count=%d", 199 199 SCpnt, target, SCpnt->device->lun, scsi_sglist(SCpnt), 200 200 scsi_bufflen(SCpnt), scsi_sg_count(SCpnt)); 201 201 //nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "before CurrentSC=0x%p", data->CurrentSC);
+1 -1
drivers/scsi/pcmcia/sym53c500_cs.c
··· 558 558 559 559 DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", 560 560 SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->device->id, 561 - SCpnt->device->lun, scsi_bufflen(SCpnt))); 561 + (u8)SCpnt->device->lun, scsi_bufflen(SCpnt))); 562 562 563 563 VDEB(for (i = 0; i < SCpnt->cmd_len; i++) 564 564 printk("cmd[%d]=%02x ", i, SCpnt->cmnd[i]));
+1 -1
drivers/scsi/pmcraid.c
··· 237 237 scsi_dev->host->unique_id, 238 238 scsi_dev->channel, 239 239 scsi_dev->id, 240 - scsi_dev->lun); 240 + (u8)scsi_dev->lun); 241 241 242 242 if (RES_IS_GSCSI(res->cfg_entry)) { 243 243 scsi_dev->allow_restart = 1;
+1 -1
drivers/scsi/ps3rom.c
··· 78 78 struct ps3rom_private *priv = shost_priv(scsi_dev->host); 79 79 struct ps3_storage_device *dev = priv->dev; 80 80 81 - dev_dbg(&dev->sbd.core, "%s:%u: id %u, lun %u, channel %u\n", __func__, 81 + dev_dbg(&dev->sbd.core, "%s:%u: id %u, lun %llu, channel %u\n", __func__, 82 82 __LINE__, scsi_dev->id, scsi_dev->lun, scsi_dev->channel); 83 83 84 84 /*
+3 -3
drivers/scsi/qla2xxx/qla_def.h
··· 320 320 * defined in tsk_mgmt_entry struct 321 321 * for control_flags field in qla_fw.h. 322 322 */ 323 + uint64_t lun; 323 324 uint32_t flags; 324 - uint32_t lun; 325 325 uint32_t data; 326 326 struct completion comp; 327 327 __le16 comp_status; ··· 2529 2529 void (*disable_intrs) (struct qla_hw_data *); 2530 2530 2531 2531 int (*abort_command) (srb_t *); 2532 - int (*target_reset) (struct fc_port *, unsigned int, int); 2533 - int (*lun_reset) (struct fc_port *, unsigned int, int); 2532 + int (*target_reset) (struct fc_port *, uint64_t, int); 2533 + int (*lun_reset) (struct fc_port *, uint64_t, int); 2534 2534 int (*fabric_login) (struct scsi_qla_host *, uint16_t, uint8_t, 2535 2535 uint8_t, uint8_t, uint16_t *, uint8_t); 2536 2536 int (*fabric_logout) (struct scsi_qla_host *, uint16_t, uint8_t,
+8 -8
drivers/scsi/qla2xxx/qla_gbl.h
··· 212 212 extern int qla2x00_start_scsi(srb_t *sp); 213 213 extern int qla24xx_start_scsi(srb_t *sp); 214 214 int qla2x00_marker(struct scsi_qla_host *, struct req_que *, struct rsp_que *, 215 - uint16_t, uint16_t, uint8_t); 215 + uint16_t, uint64_t, uint8_t); 216 216 extern int qla2x00_start_sp(srb_t *); 217 217 extern int qla24xx_dif_start_scsi(srb_t *); 218 218 extern int qla2x00_start_bidir(srb_t *, struct scsi_qla_host *, uint32_t); ··· 262 262 qla2x00_abort_command(srb_t *); 263 263 264 264 extern int 265 - qla2x00_abort_target(struct fc_port *, unsigned int, int); 265 + qla2x00_abort_target(struct fc_port *, uint64_t, int); 266 266 267 267 extern int 268 - qla2x00_lun_reset(struct fc_port *, unsigned int, int); 268 + qla2x00_lun_reset(struct fc_port *, uint64_t, int); 269 269 270 270 extern int 271 271 qla2x00_get_adapter_id(scsi_qla_host_t *, uint16_t *, uint8_t *, uint8_t *, ··· 339 339 extern int qla24xx_abort_command(srb_t *); 340 340 extern int qla24xx_async_abort_command(srb_t *); 341 341 extern int 342 - qla24xx_abort_target(struct fc_port *, unsigned int, int); 342 + qla24xx_abort_target(struct fc_port *, uint64_t, int); 343 343 extern int 344 - qla24xx_lun_reset(struct fc_port *, unsigned int, int); 344 + qla24xx_lun_reset(struct fc_port *, uint64_t, int); 345 345 extern int 346 346 qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *, unsigned int, 347 - unsigned int, enum nexus_wait_type); 347 + uint64_t, enum nexus_wait_type); 348 348 extern int 349 349 qla2x00_system_error(scsi_qla_host_t *); 350 350 ··· 617 617 extern irqreturn_t qlafx00_intr_handler(int, void *); 618 618 extern void qlafx00_enable_intrs(struct qla_hw_data *); 619 619 extern void qlafx00_disable_intrs(struct qla_hw_data *); 620 - extern int qlafx00_abort_target(fc_port_t *, unsigned int, int); 621 - extern int qlafx00_lun_reset(fc_port_t *, unsigned int, int); 620 + extern int qlafx00_abort_target(fc_port_t *, uint64_t, int); 621 + extern int qlafx00_lun_reset(fc_port_t *, uint64_t, int); 622 622 extern int qlafx00_start_scsi(srb_t *); 623 623 extern int qlafx00_abort_isp(scsi_qla_host_t *); 624 624 extern int qlafx00_iospace_config(struct qla_hw_data *);
+5 -6
drivers/scsi/qla2xxx/qla_iocb.c
··· 520 520 static int 521 521 __qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, 522 522 struct rsp_que *rsp, uint16_t loop_id, 523 - uint16_t lun, uint8_t type) 523 + uint64_t lun, uint8_t type) 524 524 { 525 525 mrk_entry_t *mrk; 526 526 struct mrk_entry_24xx *mrk24 = NULL; ··· 543 543 if (IS_FWI2_CAPABLE(ha)) { 544 544 mrk24 = (struct mrk_entry_24xx *) mrk; 545 545 mrk24->nport_handle = cpu_to_le16(loop_id); 546 - mrk24->lun[1] = LSB(lun); 547 - mrk24->lun[2] = MSB(lun); 546 + int_to_scsilun(lun, (struct scsi_lun *)&mrk24->lun); 548 547 host_to_fcp_swap(mrk24->lun, sizeof(mrk24->lun)); 549 548 mrk24->vp_index = vha->vp_idx; 550 549 mrk24->handle = MAKE_HANDLE(req->id, mrk24->handle); 551 550 } else { 552 551 SET_TARGET_ID(ha, mrk->target, loop_id); 553 - mrk->lun = cpu_to_le16(lun); 552 + mrk->lun = cpu_to_le16((uint16_t)lun); 554 553 } 555 554 } 556 555 wmb(); ··· 561 562 562 563 int 563 564 qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, 564 - struct rsp_que *rsp, uint16_t loop_id, uint16_t lun, 565 + struct rsp_que *rsp, uint16_t loop_id, uint64_t lun, 565 566 uint8_t type) 566 567 { 567 568 int ret; ··· 2046 2047 qla24xx_tm_iocb(srb_t *sp, struct tsk_mgmt_entry *tsk) 2047 2048 { 2048 2049 uint32_t flags; 2049 - unsigned int lun; 2050 + uint64_t lun; 2050 2051 struct fc_port *fcport = sp->fcport; 2051 2052 scsi_qla_host_t *vha = fcport->vha; 2052 2053 struct qla_hw_data *ha = vha->hw;
+2 -2
drivers/scsi/qla2xxx/qla_isr.c
··· 1659 1659 1660 1660 if (sense_len) { 1661 1661 ql_dbg(ql_dbg_io + ql_dbg_buffer, vha, 0x301c, 1662 - "Check condition Sense data, nexus%ld:%d:%d cmd=%p.\n", 1662 + "Check condition Sense data, nexus%ld:%d:%llu cmd=%p.\n", 1663 1663 sp->fcport->vha->host_no, cp->device->id, cp->device->lun, 1664 1664 cp); 1665 1665 ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x302b, ··· 2281 2281 out: 2282 2282 if (logit) 2283 2283 ql_dbg(ql_dbg_io, fcport->vha, 0x3022, 2284 - "FCP command status: 0x%x-0x%x (0x%x) nexus=%ld:%d:%d " 2284 + "FCP command status: 0x%x-0x%x (0x%x) nexus=%ld:%d:%llu " 2285 2285 "portid=%02x%02x%02x oxid=0x%x cdb=%10phN len=0x%x " 2286 2286 "rsp_info=0x%x resid=0x%x fw_resid=0x%x.\n", 2287 2287 comp_status, scsi_status, res, vha->host_no,
+6 -6
drivers/scsi/qla2xxx/qla_mbx.c
··· 947 947 } 948 948 949 949 int 950 - qla2x00_abort_target(struct fc_port *fcport, unsigned int l, int tag) 950 + qla2x00_abort_target(struct fc_port *fcport, uint64_t l, int tag) 951 951 { 952 952 int rval, rval2; 953 953 mbx_cmd_t mc; ··· 1000 1000 } 1001 1001 1002 1002 int 1003 - qla2x00_lun_reset(struct fc_port *fcport, unsigned int l, int tag) 1003 + qla2x00_lun_reset(struct fc_port *fcport, uint64_t l, int tag) 1004 1004 { 1005 1005 int rval, rval2; 1006 1006 mbx_cmd_t mc; ··· 1022 1022 mcp->mb[1] = fcport->loop_id; 1023 1023 else 1024 1024 mcp->mb[1] = fcport->loop_id << 8; 1025 - mcp->mb[2] = l; 1025 + mcp->mb[2] = (u32)l; 1026 1026 mcp->mb[3] = 0; 1027 1027 mcp->mb[9] = vha->vp_idx; 1028 1028 ··· 2666 2666 2667 2667 static int 2668 2668 __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport, 2669 - unsigned int l, int tag) 2669 + uint64_t l, int tag) 2670 2670 { 2671 2671 int rval, rval2; 2672 2672 struct tsk_mgmt_cmd *tsk; ··· 2760 2760 } 2761 2761 2762 2762 int 2763 - qla24xx_abort_target(struct fc_port *fcport, unsigned int l, int tag) 2763 + qla24xx_abort_target(struct fc_port *fcport, uint64_t l, int tag) 2764 2764 { 2765 2765 struct qla_hw_data *ha = fcport->vha->hw; 2766 2766 ··· 2771 2771 } 2772 2772 2773 2773 int 2774 - qla24xx_lun_reset(struct fc_port *fcport, unsigned int l, int tag) 2774 + qla24xx_lun_reset(struct fc_port *fcport, uint64_t l, int tag) 2775 2775 { 2776 2776 struct qla_hw_data *ha = fcport->vha->hw; 2777 2777
+4 -4
drivers/scsi/qla2xxx/qla_mr.c
··· 726 726 } 727 727 728 728 int 729 - qlafx00_abort_target(fc_port_t *fcport, unsigned int l, int tag) 729 + qlafx00_abort_target(fc_port_t *fcport, uint64_t l, int tag) 730 730 { 731 731 return qla2x00_async_tm_cmd(fcport, TCF_TARGET_RESET, l, tag); 732 732 } 733 733 734 734 int 735 - qlafx00_lun_reset(fc_port_t *fcport, unsigned int l, int tag) 735 + qlafx00_lun_reset(fc_port_t *fcport, uint64_t l, int tag) 736 736 { 737 737 return qla2x00_async_tm_cmd(fcport, TCF_LUN_RESET, l, tag); 738 738 } ··· 2159 2159 2160 2160 if (sense_len) { 2161 2161 ql_dbg(ql_dbg_io + ql_dbg_buffer, vha, 0x3039, 2162 - "Check condition Sense data, nexus%ld:%d:%d cmd=%p.\n", 2162 + "Check condition Sense data, nexus%ld:%d:%llu cmd=%p.\n", 2163 2163 sp->fcport->vha->host_no, cp->device->id, cp->device->lun, 2164 2164 cp); 2165 2165 ql_dump_buffer(ql_dbg_io + ql_dbg_buffer, vha, 0x3049, ··· 2524 2524 2525 2525 if (logit) 2526 2526 ql_dbg(ql_dbg_io, fcport->vha, 0x3058, 2527 - "FCP command status: 0x%x-0x%x (0x%x) nexus=%ld:%d:%d " 2527 + "FCP command status: 0x%x-0x%x (0x%x) nexus=%ld:%d:%llu " 2528 2528 "tgt_id: 0x%x lscsi_status: 0x%x cdb=%10phN len=0x%x " 2529 2529 "rsp_info=0x%x resid=0x%x fw_resid=0x%x sense_len=0x%x, " 2530 2530 "par_sense_len=0x%x, rsp_info_len=0x%x\n",
+19 -16
drivers/scsi/qla2xxx/qla_os.c
··· 920 920 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 921 921 srb_t *sp; 922 922 int ret; 923 - unsigned int id, lun; 923 + unsigned int id; 924 + uint64_t lun; 924 925 unsigned long flags; 925 926 int rval, wait = 0; 926 927 struct qla_hw_data *ha = vha->hw; ··· 945 944 } 946 945 947 946 ql_dbg(ql_dbg_taskm, vha, 0x8002, 948 - "Aborting from RISC nexus=%ld:%d:%d sp=%p cmd=%p\n", 947 + "Aborting from RISC nexus=%ld:%d:%llu sp=%p cmd=%p\n", 949 948 vha->host_no, id, lun, sp, cmd); 950 949 951 950 /* Get a reference to the sp and drop the lock.*/ ··· 996 995 } 997 996 998 997 ql_log(ql_log_info, vha, 0x801c, 999 - "Abort command issued nexus=%ld:%d:%d -- %d %x.\n", 998 + "Abort command issued nexus=%ld:%d:%llu -- %d %x.\n", 1000 999 vha->host_no, id, lun, wait, ret); 1001 1000 1002 1001 return ret; ··· 1004 1003 1005 1004 int 1006 1005 qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t, 1007 - unsigned int l, enum nexus_wait_type type) 1006 + uint64_t l, enum nexus_wait_type type) 1008 1007 { 1009 1008 int cnt, match, status; 1010 1009 unsigned long flags; ··· 1061 1060 1062 1061 static int 1063 1062 __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type, 1064 - struct scsi_cmnd *cmd, int (*do_reset)(struct fc_port *, unsigned int, int)) 1063 + struct scsi_cmnd *cmd, int (*do_reset)(struct fc_port *, uint64_t, int)) 1065 1064 { 1066 1065 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 1067 1066 fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; ··· 1076 1075 return err; 1077 1076 1078 1077 ql_log(ql_log_info, vha, 0x8009, 1079 - "%s RESET ISSUED nexus=%ld:%d:%d cmd=%p.\n", name, vha->host_no, 1078 + "%s RESET ISSUED nexus=%ld:%d:%llu cmd=%p.\n", name, vha->host_no, 1080 1079 cmd->device->id, cmd->device->lun, cmd); 1081 1080 1082 1081 err = 0; ··· 1101 1100 } 1102 1101 1103 1102 ql_log(ql_log_info, vha, 0x800e, 1104 - "%s RESET SUCCEEDED nexus:%ld:%d:%d cmd=%p.\n", name, 1103 + "%s RESET SUCCEEDED nexus:%ld:%d:%llu cmd=%p.\n", name, 1105 1104 vha->host_no, cmd->device->id, cmd->device->lun, cmd); 1106 1105 1107 1106 return SUCCESS; 1108 1107 1109 1108 eh_reset_failed: 1110 1109 ql_log(ql_log_info, vha, 0x800f, 1111 - "%s RESET FAILED: %s nexus=%ld:%d:%d cmd=%p.\n", name, 1110 + "%s RESET FAILED: %s nexus=%ld:%d:%llu cmd=%p.\n", name, 1112 1111 reset_errors[err], vha->host_no, cmd->device->id, cmd->device->lun, 1113 1112 cmd); 1114 1113 return FAILED; ··· 1155 1154 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 1156 1155 fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; 1157 1156 int ret = FAILED; 1158 - unsigned int id, lun; 1157 + unsigned int id; 1158 + uint64_t lun; 1159 1159 1160 1160 id = cmd->device->id; 1161 1161 lun = cmd->device->lun; ··· 1171 1169 ret = FAILED; 1172 1170 1173 1171 ql_log(ql_log_info, vha, 0x8012, 1174 - "BUS RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun); 1172 + "BUS RESET ISSUED nexus=%ld:%d:%llu.\n", vha->host_no, id, lun); 1175 1173 1176 1174 if (qla2x00_wait_for_hba_online(vha) != QLA_SUCCESS) { 1177 1175 ql_log(ql_log_fatal, vha, 0x8013, ··· 1195 1193 1196 1194 eh_bus_reset_done: 1197 1195 ql_log(ql_log_warn, vha, 0x802b, 1198 - "BUS RESET %s nexus=%ld:%d:%d.\n", 1196 + "BUS RESET %s nexus=%ld:%d:%llu.\n", 1199 1197 (ret == FAILED) ? "FAILED" : "SUCCEEDED", vha->host_no, id, lun); 1200 1198 1201 1199 return ret; ··· 1222 1220 scsi_qla_host_t *vha = shost_priv(cmd->device->host); 1223 1221 struct qla_hw_data *ha = vha->hw; 1224 1222 int ret = FAILED; 1225 - unsigned int id, lun; 1223 + unsigned int id; 1224 + uint64_t lun; 1226 1225 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); 1227 1226 1228 1227 id = cmd->device->id; 1229 1228 lun = cmd->device->lun; 1230 1229 1231 1230 ql_log(ql_log_info, vha, 0x8018, 1232 - "ADAPTER RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun); 1231 + "ADAPTER RESET ISSUED nexus=%ld:%d:%llu.\n", vha->host_no, id, lun); 1233 1232 1234 1233 /* 1235 1234 * No point in issuing another reset if one is active. Also do not ··· 1276 1273 1277 1274 eh_host_reset_lock: 1278 1275 ql_log(ql_log_info, vha, 0x8017, 1279 - "ADAPTER RESET %s nexus=%ld:%d:%d.\n", 1276 + "ADAPTER RESET %s nexus=%ld:%d:%llu.\n", 1280 1277 (ret == FAILED) ? "FAILED" : "SUCCEEDED", vha->host_no, id, lun); 1281 1278 1282 1279 return ret; ··· 1412 1409 return; 1413 1410 1414 1411 ql_dbg(ql_dbg_io, fcport->vha, 0x3029, 1415 - "Queue depth adjusted-down to %d for nexus=%ld:%d:%d.\n", 1412 + "Queue depth adjusted-down to %d for nexus=%ld:%d:%llu.\n", 1416 1413 sdev->queue_depth, fcport->vha->host_no, sdev->id, sdev->lun); 1417 1414 } 1418 1415 ··· 1435 1432 scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, qdepth); 1436 1433 1437 1434 ql_dbg(ql_dbg_io, vha, 0x302a, 1438 - "Queue depth adjusted-up to %d for nexus=%ld:%d:%d.\n", 1435 + "Queue depth adjusted-up to %d for nexus=%ld:%d:%llu.\n", 1439 1436 sdev->queue_depth, fcport->vha->host_no, sdev->id, sdev->lun); 1440 1437 } 1441 1438
+2 -2
drivers/scsi/qla4xxx/ql4_glbl.h
··· 23 23 int qla4xxx_get_dhcp_ip_address(struct scsi_qla_host *ha); 24 24 int qla4xxx_abort_task(struct scsi_qla_host *ha, struct srb *srb); 25 25 int qla4xxx_reset_lun(struct scsi_qla_host *ha, struct ddb_entry *ddb_entry, 26 - int lun); 26 + uint64_t lun); 27 27 int qla4xxx_reset_target(struct scsi_qla_host *ha, 28 28 struct ddb_entry *ddb_entry); 29 29 int qla4xxx_get_flash(struct scsi_qla_host *ha, dma_addr_t dma_addr, ··· 76 76 uint32_t state, uint32_t conn_error); 77 77 void qla4xxx_dump_buffer(void *b, uint32_t size); 78 78 int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha, 79 - struct ddb_entry *ddb_entry, int lun, uint16_t mrkr_mod); 79 + struct ddb_entry *ddb_entry, uint64_t lun, uint16_t mrkr_mod); 80 80 int qla4xxx_set_flash(struct scsi_qla_host *ha, dma_addr_t dma_addr, 81 81 uint32_t offset, uint32_t length, uint32_t options); 82 82 int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
+1 -1
drivers/scsi/qla4xxx/ql4_iocb.c
··· 83 83 * This routine issues a marker IOCB. 84 84 **/ 85 85 int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha, 86 - struct ddb_entry *ddb_entry, int lun, uint16_t mrkr_mod) 86 + struct ddb_entry *ddb_entry, uint64_t lun, uint16_t mrkr_mod) 87 87 { 88 88 struct qla4_marker_entry *marker_entry; 89 89 unsigned long flags = 0;
+11 -11
drivers/scsi/qla4xxx/ql4_isr.c
··· 26 26 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); 27 27 sense_len = le16_to_cpu(sts_entry->senseDataByteCnt); 28 28 if (sense_len == 0) { 29 - DEBUG2(ql4_printk(KERN_INFO, ha, "scsi%ld:%d:%d:%d: %s:" 29 + DEBUG2(ql4_printk(KERN_INFO, ha, "scsi%ld:%d:%d:%llu: %s:" 30 30 " sense len 0\n", ha->host_no, 31 31 cmd->device->channel, cmd->device->id, 32 32 cmd->device->lun, __func__)); ··· 43 43 sense_len = min_t(uint16_t, sense_len, IOCB_MAX_SENSEDATA_LEN); 44 44 memcpy(cmd->sense_buffer, sts_entry->senseData, sense_len); 45 45 46 - DEBUG2(printk(KERN_INFO "scsi%ld:%d:%d:%d: %s: sense key = %x, " 46 + DEBUG2(printk(KERN_INFO "scsi%ld:%d:%d:%llu: %s: sense key = %x, " 47 47 "ASL= %02x, ASC/ASCQ = %02x/%02x\n", ha->host_no, 48 48 cmd->device->channel, cmd->device->id, 49 49 cmd->device->lun, __func__, ··· 169 169 170 170 cmd->result = DID_ERROR << 16; 171 171 172 - DEBUG2(printk("scsi%ld:%d:%d:%d: %s: " 172 + DEBUG2(printk("scsi%ld:%d:%d:%llu: %s: " 173 173 "Mid-layer Data underrun0, " 174 174 "xferlen = 0x%x, " 175 175 "residual = 0x%x\n", ha->host_no, ··· 197 197 break; 198 198 199 199 case SCS_RESET_OCCURRED: 200 - DEBUG2(printk("scsi%ld:%d:%d:%d: %s: Device RESET occurred\n", 200 + DEBUG2(printk("scsi%ld:%d:%d:%llu: %s: Device RESET occurred\n", 201 201 ha->host_no, cmd->device->channel, 202 202 cmd->device->id, cmd->device->lun, __func__)); 203 203 ··· 205 205 break; 206 206 207 207 case SCS_ABORTED: 208 - DEBUG2(printk("scsi%ld:%d:%d:%d: %s: Abort occurred\n", 208 + DEBUG2(printk("scsi%ld:%d:%d:%llu: %s: Abort occurred\n", 209 209 ha->host_no, cmd->device->channel, 210 210 cmd->device->id, cmd->device->lun, __func__)); 211 211 ··· 213 213 break; 214 214 215 215 case SCS_TIMEOUT: 216 - DEBUG2(printk(KERN_INFO "scsi%ld:%d:%d:%d: Timeout\n", 216 + DEBUG2(printk(KERN_INFO "scsi%ld:%d:%d:%llu: Timeout\n", 217 217 ha->host_no, cmd->device->channel, 218 218 cmd->device->id, cmd->device->lun)); 219 219 ··· 232 232 case SCS_DATA_OVERRUN: 233 233 if ((sts_entry->iscsiFlags & ISCSI_FLAG_RESIDUAL_OVER) || 234 234 (sts_entry->completionStatus == SCS_DATA_OVERRUN)) { 235 - DEBUG2(printk("scsi%ld:%d:%d:%d: %s: " "Data overrun\n", 235 + DEBUG2(printk("scsi%ld:%d:%d:%llu: %s: " "Data overrun\n", 236 236 ha->host_no, 237 237 cmd->device->channel, cmd->device->id, 238 238 cmd->device->lun, __func__)); ··· 259 259 if (!scsi_status && (scsi_bufflen(cmd) - residual) < 260 260 cmd->underflow) { 261 261 DEBUG2(ql4_printk(KERN_INFO, ha, 262 - "scsi%ld:%d:%d:%d: %s: Mid-layer Data underrun, xferlen = 0x%x,residual = 0x%x\n", 262 + "scsi%ld:%d:%d:%llu: %s: Mid-layer Data underrun, xferlen = 0x%x,residual = 0x%x\n", 263 263 ha->host_no, 264 264 cmd->device->channel, 265 265 cmd->device->id, ··· 291 291 */ 292 292 293 293 DEBUG2(ql4_printk(KERN_INFO, ha, 294 - "scsi%ld:%d:%d:%d: %s: Dropped frame(s) detected (0x%x of 0x%x bytes).\n", 294 + "scsi%ld:%d:%d:%llu: %s: Dropped frame(s) detected (0x%x of 0x%x bytes).\n", 295 295 ha->host_no, 296 296 cmd->device->channel, 297 297 cmd->device->id, ··· 313 313 314 314 case SCS_DEVICE_LOGGED_OUT: 315 315 case SCS_DEVICE_UNAVAILABLE: 316 - DEBUG2(printk(KERN_INFO "scsi%ld:%d:%d:%d: SCS_DEVICE " 316 + DEBUG2(printk(KERN_INFO "scsi%ld:%d:%d:%llu: SCS_DEVICE " 317 317 "state: 0x%x\n", ha->host_no, 318 318 cmd->device->channel, cmd->device->id, 319 319 cmd->device->lun, sts_entry->completionStatus)); ··· 333 333 * SCSI Mid-Layer handles device queue full 334 334 */ 335 335 cmd->result = DID_OK << 16 | sts_entry->scsiStatus; 336 - DEBUG2(printk("scsi%ld:%d:%d: %s: QUEUE FULL detected " 336 + DEBUG2(printk("scsi%ld:%d:%llu: %s: QUEUE FULL detected " 337 337 "compl=%02x, scsi=%02x, state=%02x, iFlags=%02x," 338 338 " iResp=%02x\n", ha->host_no, cmd->device->id, 339 339 cmd->device->lun, __func__,
+3 -3
drivers/scsi/qla4xxx/ql4_mbx.c
··· 1205 1205 if (mbox_sts[0] != MBOX_STS_COMMAND_COMPLETE) { 1206 1206 status = QLA_ERROR; 1207 1207 1208 - DEBUG2(printk(KERN_WARNING "scsi%ld:%d:%d: abort task FAILED: " 1208 + DEBUG2(printk(KERN_WARNING "scsi%ld:%d:%llu: abort task FAILED: " 1209 1209 "mbx0=%04X, mb1=%04X, mb2=%04X, mb3=%04X, mb4=%04X\n", 1210 1210 ha->host_no, cmd->device->id, cmd->device->lun, mbox_sts[0], 1211 1211 mbox_sts[1], mbox_sts[2], mbox_sts[3], mbox_sts[4])); ··· 1225 1225 * are valid before calling this routine. 1226 1226 **/ 1227 1227 int qla4xxx_reset_lun(struct scsi_qla_host * ha, struct ddb_entry * ddb_entry, 1228 - int lun) 1228 + uint64_t lun) 1229 1229 { 1230 1230 uint32_t mbox_cmd[MBOX_REG_COUNT]; 1231 1231 uint32_t mbox_sts[MBOX_REG_COUNT]; 1232 1232 uint32_t scsi_lun[2]; 1233 1233 int status = QLA_SUCCESS; 1234 1234 1235 - DEBUG2(printk("scsi%ld:%d:%d: lun reset issued\n", ha->host_no, 1235 + DEBUG2(printk("scsi%ld:%d:%llu: lun reset issued\n", ha->host_no, 1236 1236 ddb_entry->fw_ddb_index, lun)); 1237 1237 1238 1238 /*
+10 -10
drivers/scsi/qla4xxx/ql4_os.c
··· 9223 9223 { 9224 9224 struct scsi_qla_host *ha = to_qla_host(cmd->device->host); 9225 9225 unsigned int id = cmd->device->id; 9226 - unsigned int lun = cmd->device->lun; 9226 + uint64_t lun = cmd->device->lun; 9227 9227 unsigned long flags; 9228 9228 struct srb *srb = NULL; 9229 9229 int ret = SUCCESS; 9230 9230 int wait = 0; 9231 9231 9232 - ql4_printk(KERN_INFO, ha, "scsi%ld:%d:%d: Abort command issued cmd=%p, cdb=0x%x\n", 9232 + ql4_printk(KERN_INFO, ha, "scsi%ld:%d:%llu: Abort command issued cmd=%p, cdb=0x%x\n", 9233 9233 ha->host_no, id, lun, cmd, cmd->cmnd[0]); 9234 9234 9235 9235 spin_lock_irqsave(&ha->hardware_lock, flags); 9236 9236 srb = (struct srb *) CMD_SP(cmd); 9237 9237 if (!srb) { 9238 9238 spin_unlock_irqrestore(&ha->hardware_lock, flags); 9239 - ql4_printk(KERN_INFO, ha, "scsi%ld:%d:%d: Specified command has already completed.\n", 9239 + ql4_printk(KERN_INFO, ha, "scsi%ld:%d:%llu: Specified command has already completed.\n", 9240 9240 ha->host_no, id, lun); 9241 9241 return SUCCESS; 9242 9242 } ··· 9244 9244 spin_unlock_irqrestore(&ha->hardware_lock, flags); 9245 9245 9246 9246 if (qla4xxx_abort_task(ha, srb) != QLA_SUCCESS) { 9247 - DEBUG3(printk("scsi%ld:%d:%d: Abort_task mbx failed.\n", 9247 + DEBUG3(printk("scsi%ld:%d:%llu: Abort_task mbx failed.\n", 9248 9248 ha->host_no, id, lun)); 9249 9249 ret = FAILED; 9250 9250 } else { 9251 - DEBUG3(printk("scsi%ld:%d:%d: Abort_task mbx success.\n", 9251 + DEBUG3(printk("scsi%ld:%d:%llu: Abort_task mbx success.\n", 9252 9252 ha->host_no, id, lun)); 9253 9253 wait = 1; 9254 9254 } ··· 9258 9258 /* Wait for command to complete */ 9259 9259 if (wait) { 9260 9260 if (!qla4xxx_eh_wait_on_command(ha, cmd)) { 9261 - DEBUG2(printk("scsi%ld:%d:%d: Abort handler timed out\n", 9261 + DEBUG2(printk("scsi%ld:%d:%llu: Abort handler timed out\n", 9262 9262 ha->host_no, id, lun)); 9263 9263 ret = FAILED; 9264 9264 } 9265 9265 } 9266 9266 9267 9267 ql4_printk(KERN_INFO, ha, 9268 - "scsi%ld:%d:%d: Abort command - %s\n", 9268 + "scsi%ld:%d:%llu: Abort command - %s\n", 9269 9269 ha->host_no, id, lun, (ret == SUCCESS) ? "succeeded" : "failed"); 9270 9270 9271 9271 return ret; ··· 9293 9293 ret = FAILED; 9294 9294 9295 9295 ql4_printk(KERN_INFO, ha, 9296 - "scsi%ld:%d:%d:%d: DEVICE RESET ISSUED.\n", ha->host_no, 9296 + "scsi%ld:%d:%d:%llu: DEVICE RESET ISSUED.\n", ha->host_no, 9297 9297 cmd->device->channel, cmd->device->id, cmd->device->lun); 9298 9298 9299 9299 DEBUG2(printk(KERN_INFO ··· 9323 9323 goto eh_dev_reset_done; 9324 9324 9325 9325 ql4_printk(KERN_INFO, ha, 9326 - "scsi(%ld:%d:%d:%d): DEVICE RESET SUCCEEDED.\n", 9326 + "scsi(%ld:%d:%d:%llu): DEVICE RESET SUCCEEDED.\n", 9327 9327 ha->host_no, cmd->device->channel, cmd->device->id, 9328 9328 cmd->device->lun); 9329 9329 ··· 9440 9440 } 9441 9441 9442 9442 ql4_printk(KERN_INFO, ha, 9443 - "scsi(%ld:%d:%d:%d): HOST RESET ISSUED.\n", ha->host_no, 9443 + "scsi(%ld:%d:%d:%llu): HOST RESET ISSUED.\n", ha->host_no, 9444 9444 cmd->device->channel, cmd->device->id, cmd->device->lun); 9445 9445 9446 9446 if (qla4xxx_wait_for_hba_online(ha) != QLA_SUCCESS) {
+4 -4
drivers/scsi/scsi.c
··· 1291 1291 * really want to use scsi_device_lookup_by_target instead. 1292 1292 **/ 1293 1293 struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *starget, 1294 - uint lun) 1294 + u64 lun) 1295 1295 { 1296 1296 struct scsi_device *sdev; 1297 1297 ··· 1316 1316 * needs to be released with scsi_device_put once you're done with it. 1317 1317 **/ 1318 1318 struct scsi_device *scsi_device_lookup_by_target(struct scsi_target *starget, 1319 - uint lun) 1319 + u64 lun) 1320 1320 { 1321 1321 struct scsi_device *sdev; 1322 1322 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); ··· 1349 1349 * really want to use scsi_device_lookup instead. 1350 1350 **/ 1351 1351 struct scsi_device *__scsi_device_lookup(struct Scsi_Host *shost, 1352 - uint channel, uint id, uint lun) 1352 + uint channel, uint id, u64 lun) 1353 1353 { 1354 1354 struct scsi_device *sdev; 1355 1355 ··· 1375 1375 * needs to be released with scsi_device_put once you're done with it. 1376 1376 **/ 1377 1377 struct scsi_device *scsi_device_lookup(struct Scsi_Host *shost, 1378 - uint channel, uint id, uint lun) 1378 + uint channel, uint id, u64 lun) 1379 1379 { 1380 1380 struct scsi_device *sdev; 1381 1381 unsigned long flags;
+8 -7
drivers/scsi/scsi_debug.c
··· 228 228 unsigned char sense_buff[SDEBUG_SENSE_LEN]; /* weak nexus */ 229 229 unsigned int channel; 230 230 unsigned int target; 231 - unsigned int lun; 231 + u64 lun; 232 232 struct sdebug_host_info *sdbg_host; 233 - unsigned int wlun; 233 + u64 wlun; 234 234 char reset; 235 235 char stopped; 236 236 char used; ··· 2278 2278 struct sdebug_dev_info * devip) 2279 2279 { 2280 2280 unsigned int alloc_len; 2281 - int lun_cnt, i, upper, num, n, wlun, lun; 2281 + int lun_cnt, i, upper, num, n; 2282 + u64 wlun, lun; 2282 2283 unsigned char *cmd = (unsigned char *)scp->cmnd; 2283 2284 int select_report = (int)cmd[2]; 2284 2285 struct scsi_lun *one_lun; ··· 2463 2462 static int scsi_debug_slave_alloc(struct scsi_device *sdp) 2464 2463 { 2465 2464 if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) 2466 - printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %u>\n", 2465 + printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %llu>\n", 2467 2466 sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); 2468 2467 queue_flag_set_unlocked(QUEUE_FLAG_BIDI, sdp->request_queue); 2469 2468 return 0; ··· 2474 2473 struct sdebug_dev_info *devip; 2475 2474 2476 2475 if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) 2477 - printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %u>\n", 2476 + printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %llu>\n", 2478 2477 sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); 2479 2478 if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN) 2480 2479 sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN; ··· 2497 2496 (struct sdebug_dev_info *)sdp->hostdata; 2498 2497 2499 2498 if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) 2500 - printk(KERN_INFO "scsi_debug: slave_destroy <%u %u %u %u>\n", 2499 + printk(KERN_INFO "scsi_debug: slave_destroy <%u %u %u %llu>\n", 2501 2500 sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); 2502 2501 if (devip) { 2503 2502 /* make this slot available for re-use */ ··· 2709 2708 if (scsi_result) { 2710 2709 struct scsi_device * sdp = cmnd->device; 2711 2710 2712 - printk(KERN_INFO "scsi_debug: <%u %u %u %u> " 2711 + printk(KERN_INFO "scsi_debug: <%u %u %u %llu> " 2713 2712 "non-zero result=0x%x\n", sdp->host->host_no, 2714 2713 sdp->channel, sdp->id, sdp->lun, scsi_result); 2715 2714 }
+1 -1
drivers/scsi/scsi_priv.h
··· 115 115 extern char scsi_scan_type[]; 116 116 extern int scsi_complete_async_scans(void); 117 117 extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int, 118 - unsigned int, unsigned int, int); 118 + unsigned int, u64, int); 119 119 extern void scsi_forget_host(struct Scsi_Host *); 120 120 extern void scsi_rescan_device(struct device *); 121 121
+1 -1
drivers/scsi/scsi_proc.c
··· 185 185 186 186 sdev = to_scsi_device(dev); 187 187 seq_printf(s, 188 - "Host: scsi%d Channel: %02d Id: %02d Lun: %02d\n Vendor: ", 188 + "Host: scsi%d Channel: %02d Id: %02d Lun: %02llu\n Vendor: ", 189 189 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); 190 190 for (i = 0; i < 8; i++) { 191 191 if (sdev->vendor[i] >= 0x20)
+19 -35
drivers/scsi/scsi_scan.c
··· 220 220 * scsi_Device pointer, or NULL on failure. 221 221 **/ 222 222 static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, 223 - unsigned int lun, void *hostdata) 223 + u64 lun, void *hostdata) 224 224 { 225 225 struct scsi_device *sdev; 226 226 int display_failure_msg = 1, ret; ··· 1028 1028 * SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized 1029 1029 **/ 1030 1030 static int scsi_probe_and_add_lun(struct scsi_target *starget, 1031 - uint lun, int *bflagsp, 1031 + u64 lun, int *bflagsp, 1032 1032 struct scsi_device **sdevp, int rescan, 1033 1033 void *hostdata) 1034 1034 { ··· 1181 1181 static void scsi_sequential_lun_scan(struct scsi_target *starget, 1182 1182 int bflags, int scsi_level, int rescan) 1183 1183 { 1184 - unsigned int sparse_lun, lun, max_dev_lun; 1184 + uint max_dev_lun; 1185 + u64 sparse_lun, lun; 1185 1186 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 1186 1187 1187 1188 SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: Sequential scan of" ··· 1272 1271 * Given a struct scsi_lun of: 0a 04 0b 03 00 00 00 00, this function returns 1273 1272 * the integer: 0x0b030a04 1274 1273 **/ 1275 - int scsilun_to_int(struct scsi_lun *scsilun) 1274 + u64 scsilun_to_int(struct scsi_lun *scsilun) 1276 1275 { 1277 1276 int i; 1278 - unsigned int lun; 1277 + u64 lun; 1279 1278 1280 1279 lun = 0; 1281 1280 for (i = 0; i < sizeof(lun); i += 2) ··· 1303 1302 * scsi_lun of : struct scsi_lun of: 0a 04 0b 03 00 00 00 00 1304 1303 * 1305 1304 **/ 1306 - void int_to_scsilun(unsigned int lun, struct scsi_lun *scsilun) 1305 + void int_to_scsilun(u64 lun, struct scsi_lun *scsilun) 1307 1306 { 1308 1307 int i; 1309 1308 ··· 1343 1342 char devname[64]; 1344 1343 unsigned char scsi_cmd[MAX_COMMAND_SIZE]; 1345 1344 unsigned int length; 1346 - unsigned int lun; 1345 + u64 lun; 1347 1346 unsigned int num_luns; 1348 1347 unsigned int retries; 1349 1348 int result; ··· 1486 1485 for (lunp = &lun_data[1]; lunp <= &lun_data[num_luns]; lunp++) { 1487 1486 lun = scsilun_to_int(lunp); 1488 1487 1489 - /* 1490 - * Check if the unused part of lunp is non-zero, and so 1491 - * does not fit in lun. 1492 - */ 1493 - if (memcmp(&lunp->scsi_lun[sizeof(lun)], "\0\0\0\0", 4)) { 1494 - int i; 1495 - 1496 - /* 1497 - * Output an error displaying the LUN in byte order, 1498 - * this differs from what linux would print for the 1499 - * integer LUN value. 1500 - */ 1501 - printk(KERN_WARNING "scsi: %s lun 0x", devname); 1502 - data = (char *)lunp->scsi_lun; 1503 - for (i = 0; i < sizeof(struct scsi_lun); i++) 1504 - printk("%02x", data[i]); 1505 - printk(" has a LUN larger than currently supported.\n"); 1506 - } else if (lun > sdev->host->max_lun) { 1507 - printk(KERN_WARNING "scsi: %s lun%d has a LUN larger" 1488 + if (lun > sdev->host->max_lun) { 1489 + printk(KERN_WARNING "scsi: %s lun%llu has a LUN larger" 1508 1490 " than allowed by the host adapter\n", 1509 1491 devname, lun); 1510 1492 } else { ··· 1501 1517 */ 1502 1518 sdev_printk(KERN_ERR, sdev, 1503 1519 "Unexpected response" 1504 - " from lun %d while scanning, scan" 1505 - " aborted\n", lun); 1520 + " from lun %llu while scanning, scan" 1521 + " aborted\n", (unsigned long long)lun); 1506 1522 break; 1507 1523 } 1508 1524 } ··· 1521 1537 } 1522 1538 1523 1539 struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, 1524 - uint id, uint lun, void *hostdata) 1540 + uint id, u64 lun, void *hostdata) 1525 1541 { 1526 1542 struct scsi_device *sdev = ERR_PTR(-ENODEV); 1527 1543 struct device *parent = &shost->shost_gendev; ··· 1557 1573 EXPORT_SYMBOL(__scsi_add_device); 1558 1574 1559 1575 int scsi_add_device(struct Scsi_Host *host, uint channel, 1560 - uint target, uint lun) 1576 + uint target, u64 lun) 1561 1577 { 1562 1578 struct scsi_device *sdev = 1563 1579 __scsi_add_device(host, channel, target, lun, NULL); ··· 1586 1602 EXPORT_SYMBOL(scsi_rescan_device); 1587 1603 1588 1604 static void __scsi_scan_target(struct device *parent, unsigned int channel, 1589 - unsigned int id, unsigned int lun, int rescan) 1605 + unsigned int id, u64 lun, int rescan) 1590 1606 { 1591 1607 struct Scsi_Host *shost = dev_to_shost(parent); 1592 1608 int bflags = 0; ··· 1654 1670 * sequential scan of LUNs on the target id. 1655 1671 **/ 1656 1672 void scsi_scan_target(struct device *parent, unsigned int channel, 1657 - unsigned int id, unsigned int lun, int rescan) 1673 + unsigned int id, u64 lun, int rescan) 1658 1674 { 1659 1675 struct Scsi_Host *shost = dev_to_shost(parent); 1660 1676 ··· 1674 1690 EXPORT_SYMBOL(scsi_scan_target); 1675 1691 1676 1692 static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel, 1677 - unsigned int id, unsigned int lun, int rescan) 1693 + unsigned int id, u64 lun, int rescan) 1678 1694 { 1679 1695 uint order_id; 1680 1696 ··· 1705 1721 } 1706 1722 1707 1723 int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel, 1708 - unsigned int id, unsigned int lun, int rescan) 1724 + unsigned int id, u64 lun, int rescan) 1709 1725 { 1710 1726 SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost, 1711 - "%s: <%u:%u:%u>\n", 1727 + "%s: <%u:%u:%llu>\n", 1712 1728 __func__, channel, id, lun)); 1713 1729 1714 1730 if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) ||
+7 -7
drivers/scsi/scsi_sysfs.c
··· 80 80 return name; 81 81 } 82 82 83 - static int check_set(unsigned int *val, char *src) 83 + static int check_set(unsigned long long *val, char *src) 84 84 { 85 85 char *last; 86 86 ··· 90 90 /* 91 91 * Doesn't check for int overflow 92 92 */ 93 - *val = simple_strtoul(src, &last, 0); 93 + *val = simple_strtoull(src, &last, 0); 94 94 if (*last != '\0') 95 95 return 1; 96 96 } ··· 99 99 100 100 static int scsi_scan(struct Scsi_Host *shost, const char *str) 101 101 { 102 - char s1[15], s2[15], s3[15], junk; 103 - unsigned int channel, id, lun; 102 + char s1[15], s2[15], s3[17], junk; 103 + unsigned long long channel, id, lun; 104 104 int res; 105 105 106 - res = sscanf(str, "%10s %10s %10s %c", s1, s2, s3, &junk); 106 + res = sscanf(str, "%10s %10s %16s %c", s1, s2, s3, &junk); 107 107 if (res != 3) 108 108 return -EINVAL; 109 109 if (check_set(&channel, s1)) ··· 1230 1230 device_initialize(&sdev->sdev_gendev); 1231 1231 sdev->sdev_gendev.bus = &scsi_bus_type; 1232 1232 sdev->sdev_gendev.type = &scsi_dev_type; 1233 - dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%d", 1233 + dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%llu", 1234 1234 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); 1235 1235 1236 1236 device_initialize(&sdev->sdev_dev); 1237 1237 sdev->sdev_dev.parent = get_device(&sdev->sdev_gendev); 1238 1238 sdev->sdev_dev.class = &sdev_class; 1239 - dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%d", 1239 + dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%llu", 1240 1240 sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); 1241 1241 sdev->scsi_level = starget->scsi_level; 1242 1242 transport_setup_device(&sdev->sdev_gendev);
+2 -2
drivers/scsi/scsi_transport_fc.c
··· 2089 2089 * on the rport. 2090 2090 */ 2091 2091 static void 2092 - fc_user_scan_tgt(struct Scsi_Host *shost, uint channel, uint id, uint lun) 2092 + fc_user_scan_tgt(struct Scsi_Host *shost, uint channel, uint id, u64 lun) 2093 2093 { 2094 2094 struct fc_rport *rport; 2095 2095 unsigned long flags; ··· 2121 2121 * object as the parent. 2122 2122 */ 2123 2123 static int 2124 - fc_user_scan(struct Scsi_Host *shost, uint channel, uint id, uint lun) 2124 + fc_user_scan(struct Scsi_Host *shost, uint channel, uint id, u64 lun) 2125 2125 { 2126 2126 uint chlo, chhi; 2127 2127 uint tgtlo, tgthi;
+2 -2
drivers/scsi/scsi_transport_iscsi.c
··· 1780 1780 struct iscsi_scan_data { 1781 1781 unsigned int channel; 1782 1782 unsigned int id; 1783 - unsigned int lun; 1783 + u64 lun; 1784 1784 }; 1785 1785 1786 1786 static int iscsi_user_scan_session(struct device *dev, void *data) ··· 1827 1827 } 1828 1828 1829 1829 static int iscsi_user_scan(struct Scsi_Host *shost, uint channel, 1830 - uint id, uint lun) 1830 + uint id, u64 lun) 1831 1831 { 1832 1832 struct iscsi_scan_data scan_data; 1833 1833
+1 -1
drivers/scsi/scsi_transport_sas.c
··· 1705 1705 */ 1706 1706 1707 1707 static int sas_user_scan(struct Scsi_Host *shost, uint channel, 1708 - uint id, uint lun) 1708 + uint id, u64 lun) 1709 1709 { 1710 1710 struct sas_host_attrs *sas_host = to_sas_host_attrs(shost); 1711 1711 struct sas_rphy *rphy;
+2 -2
drivers/scsi/sg.c
··· 2542 2542 seq_puts(s, "-1\t-1\t-1\t-1\t-1\t-1\t-1\t-1\t-1\n"); 2543 2543 else { 2544 2544 scsidp = sdp->device; 2545 - seq_printf(s, "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", 2545 + seq_printf(s, "%d\t%d\t%d\t%llu\t%d\t%d\t%d\t%d\t%d\n", 2546 2546 scsidp->host->host_no, scsidp->channel, 2547 2547 scsidp->id, scsidp->lun, (int) scsidp->type, 2548 2548 1, ··· 2671 2671 else if (sdp->device) { 2672 2672 struct scsi_device *scsidp = sdp->device; 2673 2673 2674 - seq_printf(s, "%d:%d:%d:%d em=%d", 2674 + seq_printf(s, "%d:%d:%d:%llu em=%d", 2675 2675 scsidp->host->host_no, 2676 2676 scsidp->channel, scsidp->id, 2677 2677 scsidp->lun,
+30 -27
drivers/scsi/sun3_NCR5380.c
··· 355 355 356 356 static int is_lun_busy(struct scsi_cmnd *cmd, int should_be_tagged) 357 357 { 358 + u8 lun = cmd->device->lun; 358 359 SETUP_HOSTDATA(cmd->device->host); 359 360 360 - if (hostdata->busy[cmd->device->id] & (1 << cmd->device->lun)) 361 + if (hostdata->busy[cmd->device->id] & (1 << lun)) 361 362 return( 1 ); 362 363 if (!should_be_tagged || 363 364 !setup_use_tagged_queuing || !cmd->device->tagged_supported) 364 365 return( 0 ); 365 - if (TagAlloc[cmd->device->id][cmd->device->lun].nr_allocated >= 366 - TagAlloc[cmd->device->id][cmd->device->lun].queue_size ) { 366 + if (TagAlloc[cmd->device->id][lun].nr_allocated >= 367 + TagAlloc[cmd->device->id][lun].queue_size ) { 367 368 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d: no free tags\n", 368 - H_NO(cmd), cmd->device->id, cmd->device->lun ); 369 + H_NO(cmd), cmd->device->id, lun ); 369 370 return( 1 ); 370 371 } 371 372 return( 0 ); ··· 380 379 381 380 static void cmd_get_tag(struct scsi_cmnd *cmd, int should_be_tagged) 382 381 { 382 + u8 lun = cmd->device->lun; 383 383 SETUP_HOSTDATA(cmd->device->host); 384 384 385 385 /* If we or the target don't support tagged queuing, allocate the LUN for ··· 389 387 if (!should_be_tagged || 390 388 !setup_use_tagged_queuing || !cmd->device->tagged_supported) { 391 389 cmd->tag = TAG_NONE; 392 - hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 390 + hostdata->busy[cmd->device->id] |= (1 << lun); 393 391 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d now allocated by untagged " 394 - "command\n", H_NO(cmd), cmd->device->id, cmd->device->lun ); 392 + "command\n", H_NO(cmd), cmd->device->id, lun ); 395 393 } 396 394 else { 397 - TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 395 + TAG_ALLOC *ta = &TagAlloc[cmd->device->id][lun]; 398 396 399 397 cmd->tag = find_first_zero_bit( &ta->allocated, MAX_TAGS ); 400 398 set_bit( cmd->tag, &ta->allocated ); 401 399 ta->nr_allocated++; 402 400 dprintk(NDEBUG_TAGS, "scsi%d: using tag %d for target %d lun %d " 403 401 "(now %d tags in use)\n", 404 - H_NO(cmd), cmd->tag, cmd->device->id, cmd->device->lun, 402 + H_NO(cmd), cmd->tag, cmd->device->id, lun, 405 403 ta->nr_allocated ); 406 404 } 407 405 } ··· 413 411 414 412 static void cmd_free_tag(struct scsi_cmnd *cmd) 415 413 { 414 + u8 lun = cmd->device->lun; 416 415 SETUP_HOSTDATA(cmd->device->host); 417 416 418 417 if (cmd->tag == TAG_NONE) { 419 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 418 + hostdata->busy[cmd->device->id] &= ~(1 << lun); 420 419 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d untagged cmd finished\n", 421 - H_NO(cmd), cmd->device->id, cmd->device->lun ); 420 + H_NO(cmd), cmd->device->id, lun ); 422 421 } 423 422 else if (cmd->tag >= MAX_TAGS) { 424 423 printk(KERN_NOTICE "scsi%d: trying to free bad tag %d!\n", 425 424 H_NO(cmd), cmd->tag ); 426 425 } 427 426 else { 428 - TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 427 + TAG_ALLOC *ta = &TagAlloc[cmd->device->id][lun]; 429 428 clear_bit( cmd->tag, &ta->allocated ); 430 429 ta->nr_allocated--; 431 430 dprintk(NDEBUG_TAGS, "scsi%d: freed tag %d for target %d lun %d\n", 432 - H_NO(cmd), cmd->tag, cmd->device->id, cmd->device->lun ); 431 + H_NO(cmd), cmd->tag, cmd->device->id, lun ); 433 432 } 434 433 } 435 434 ··· 662 659 { 663 660 int i, s; 664 661 unsigned char *command; 665 - printk("scsi%d: destination target %d, lun %d\n", 662 + printk("scsi%d: destination target %d, lun %llu\n", 666 663 H_NO(cmd), cmd->device->id, cmd->device->lun); 667 664 printk(KERN_CONT " command = "); 668 665 command = cmd->cmnd; ··· 708 705 { 709 706 int i, s; 710 707 unsigned char *command; 711 - seq_printf(m, "scsi%d: destination target %d, lun %d\n", 708 + seq_printf(m, "scsi%d: destination target %d, lun %llu\n", 712 709 H_NO(cmd), cmd->device->id, cmd->device->lun); 713 710 seq_printf(m, " command = "); 714 711 command = cmd->cmnd; ··· 1010 1007 prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp) ) { 1011 1008 1012 1009 if (prev != tmp) 1013 - dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%d\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun); 1010 + dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%llu\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun); 1014 1011 /* When we find one, remove it from the issue queue. */ 1015 1012 /* ++guenther: possible race with Falcon locking */ 1016 1013 if ( ··· 1041 1038 * issue queue so we can keep trying. 1042 1039 */ 1043 1040 dprintk(NDEBUG_MAIN, "scsi%d: main(): command for target %d " 1044 - "lun %d removed from issue_queue\n", 1041 + "lun %llu removed from issue_queue\n", 1045 1042 HOSTNO, tmp->device->id, tmp->device->lun); 1046 1043 /* 1047 1044 * REQUEST SENSE commands are issued without tagged ··· 2023 2020 * accesses to this device will use the 2024 2021 * polled-IO. */ 2025 2022 printk(KERN_NOTICE "scsi%d: switching target %d " 2026 - "lun %d to slow handshake\n", HOSTNO, 2023 + "lun %llu to slow handshake\n", HOSTNO, 2027 2024 cmd->device->id, cmd->device->lun); 2028 2025 cmd->device->borken = 1; 2029 2026 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ··· 2081 2078 /* Accept message by clearing ACK */ 2082 2079 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2083 2080 2084 - dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked command " 2081 + dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %llu linked command " 2085 2082 "complete.\n", HOSTNO, cmd->device->id, cmd->device->lun); 2086 2083 2087 2084 /* Enable reselect interrupts */ ··· 2093 2090 */ 2094 2091 2095 2092 if (!cmd->next_link) { 2096 - printk(KERN_NOTICE "scsi%d: target %d lun %d " 2093 + printk(KERN_NOTICE "scsi%d: target %d lun %llu " 2097 2094 "linked command complete, no next_link\n", 2098 2095 HOSTNO, cmd->device->id, cmd->device->lun); 2099 2096 sink = 1; ··· 2106 2103 * and don't free it! */ 2107 2104 cmd->next_link->tag = cmd->tag; 2108 2105 cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); 2109 - dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked request " 2106 + dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %llu linked request " 2110 2107 "done, calling scsi_done().\n", 2111 2108 HOSTNO, cmd->device->id, cmd->device->lun); 2112 2109 #ifdef NCR5380_STATS ··· 2121 2118 /* Accept message by clearing ACK */ 2122 2119 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2123 2120 hostdata->connected = NULL; 2124 - dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d, lun %d " 2121 + dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d, lun %llu " 2125 2122 "completed\n", HOSTNO, cmd->device->id, cmd->device->lun); 2126 2123 #ifdef SUPPORT_TAGS 2127 2124 cmd_free_tag( cmd ); ··· 2135 2132 /* ++Andreas: the mid level code knows about 2136 2133 QUEUE_FULL now. */ 2137 2134 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 2138 - dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d returned " 2135 + dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %llu returned " 2139 2136 "QUEUE_FULL after %d commands\n", 2140 2137 HOSTNO, cmd->device->id, cmd->device->lun, 2141 2138 ta->nr_allocated); ··· 2231 2228 cmd->device->tagged_supported = 0; 2232 2229 hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 2233 2230 cmd->tag = TAG_NONE; 2234 - dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d rejected " 2231 + dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %llu rejected " 2235 2232 "QUEUE_TAG message; tagged queuing " 2236 2233 "disabled\n", 2237 2234 HOSTNO, cmd->device->id, cmd->device->lun); ··· 2248 2245 hostdata->connected = NULL; 2249 2246 hostdata->disconnected_queue = cmd; 2250 2247 local_irq_restore(flags); 2251 - dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d lun %d was " 2248 + dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d lun %llu was " 2252 2249 "moved from connected to the " 2253 2250 "disconnected_queue\n", HOSTNO, 2254 2251 cmd->device->id, cmd->device->lun); ··· 2352 2349 printk("\n"); 2353 2350 } else if (tmp != EXTENDED_MESSAGE) 2354 2351 printk(KERN_DEBUG "scsi%d: rejecting unknown " 2355 - "message %02x from target %d, lun %d\n", 2352 + "message %02x from target %d, lun %llu\n", 2356 2353 HOSTNO, tmp, cmd->device->id, cmd->device->lun); 2357 2354 else 2358 2355 printk(KERN_DEBUG "scsi%d: rejecting unknown " 2359 2356 "extended message " 2360 - "code %02x, length %d from target %d, lun %d\n", 2357 + "code %02x, length %d from target %d, lun %llu\n", 2361 2358 HOSTNO, extended_msg[1], extended_msg[0], 2362 2359 cmd->device->id, cmd->device->lun); 2363 2360 ··· 2579 2576 #endif 2580 2577 2581 2578 hostdata->connected = tmp; 2582 - dprintk(NDEBUG_RESELECTION, "scsi%d: nexus established, target = %d, lun = %d, tag = %d\n", 2579 + dprintk(NDEBUG_RESELECTION, "scsi%d: nexus established, target = %d, lun = %llu, tag = %d\n", 2583 2580 HOSTNO, tmp->device->id, tmp->device->lun, tmp->tag); 2584 2581 } 2585 2582
+1 -1
drivers/scsi/sym53c8xx_2/sym_glue.c
··· 851 851 * so let's try to stop all on-going I/O. 852 852 */ 853 853 starget_printk(KERN_WARNING, tp->starget, 854 - "Removing busy LCB (%d)\n", sdev->lun); 854 + "Removing busy LCB (%d)\n", (u8)sdev->lun); 855 855 sym_reset_scsi_bus(np, 1); 856 856 } 857 857
+1 -1
drivers/scsi/sym53c8xx_2/sym_hipd.h
··· 581 581 #define sym_lp(tp, lun) (!lun) ? (tp)->lun0p : NULL 582 582 #else 583 583 #define sym_lp(tp, lun) \ 584 - (!lun) ? (tp)->lun0p : (tp)->lunmp ? (tp)->lunmp[(lun)] : NULL 584 + (!lun) ? (tp)->lun0p : (tp)->lunmp ? (tp)->lunmp[((u8)lun)] : NULL 585 585 #endif 586 586 587 587 /*
+3 -3
drivers/scsi/tmscsim.c
··· 621 621 { 622 622 dc390_freetag (pDCB, pSRB); 623 623 DEBUG0(printk ("DC390: Interrupt during Start SCSI (target %02i-%02i)\n", 624 - scmd->device->id, scmd->device->lun)); 624 + scmd->device->id, (u8)scmd->device->lun)); 625 625 pSRB->SRBState = SRB_READY; 626 626 //DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD); 627 627 pACB->SelLost++; ··· 1726 1726 } else { 1727 1727 SET_RES_DRV(pcmd->result, DRIVER_SENSE); 1728 1728 //pSRB->ScsiCmdLen = (u8) (pSRB->Segment1[0] >> 8); 1729 - DEBUG0 (printk ("DC390: RETRY (%02x), target %02i-%02i\n", pcmd->cmnd[0], pcmd->device->id, pcmd->device->lun)); 1729 + DEBUG0 (printk ("DC390: RETRY (%02x), target %02i-%02i\n", pcmd->cmnd[0], pcmd->device->id, (u8)pcmd->device->lun)); 1730 1730 pSRB->TotalXferredLen = 0; 1731 1731 SET_RES_DID(pcmd->result, DID_SOFT_ERROR); 1732 1732 } ··· 1746 1746 else if (status == SAM_STAT_TASK_SET_FULL) 1747 1747 { 1748 1748 scsi_track_queue_full(pcmd->device, pDCB->GoingSRBCnt - 1); 1749 - DEBUG0 (printk ("DC390: RETRY (%02x), target %02i-%02i\n", pcmd->cmnd[0], pcmd->device->id, pcmd->device->lun)); 1749 + DEBUG0 (printk ("DC390: RETRY (%02x), target %02i-%02i\n", pcmd->cmnd[0], pcmd->device->id, (u8)pcmd->device->lun)); 1750 1750 pSRB->TotalXferredLen = 0; 1751 1751 SET_RES_DID(pcmd->result, DID_SOFT_ERROR); 1752 1752 }
+5 -5
drivers/scsi/u14-34f.c
··· 1285 1285 cpp->cpp_index = i; 1286 1286 SCpnt->host_scribble = (unsigned char *) &cpp->cpp_index; 1287 1287 1288 - if (do_trace) printk("%s: qcomm, mbox %d, target %d.%d:%d.\n", 1288 + if (do_trace) printk("%s: qcomm, mbox %d, target %d.%d:%llu.\n", 1289 1289 BN(j), i, SCpnt->device->channel, SCpnt->device->id, 1290 - SCpnt->device->lun); 1290 + (u8)SCpnt->device->lun); 1291 1291 1292 1292 cpp->opcode = OP_SCSI; 1293 1293 cpp->channel = SCpnt->device->channel; 1294 1294 cpp->target = SCpnt->device->id; 1295 - cpp->lun = SCpnt->device->lun; 1295 + cpp->lun = (u8)SCpnt->device->lun; 1296 1296 cpp->SCpnt = SCpnt; 1297 1297 cpp->cdb_len = SCpnt->cmd_len; 1298 1298 memcpy(cpp->cdb, SCpnt->cmnd, SCpnt->cmd_len); ··· 1663 1663 if (link_statistics && (overlap || !(flushcount % link_statistics))) 1664 1664 for (n = 0; n < n_ready; n++) { 1665 1665 k = il[n]; cpp = &HD(j)->cp[k]; SCpnt = cpp->SCpnt; 1666 - printk("%s %d.%d:%d mb %d fc %d nr %d sec %ld ns %u"\ 1666 + printk("%s %d.%d:%llu mb %d fc %d nr %d sec %ld ns %u"\ 1667 1667 " cur %ld s:%c r:%c rev:%c in:%c ov:%c xd %d.\n", 1668 1668 (ihdlr ? "ihdlr" : "qcomm"), SCpnt->channel, SCpnt->target, 1669 - SCpnt->lun, k, flushcount, n_ready, 1669 + (u8)SCpnt->lun, k, flushcount, n_ready, 1670 1670 blk_rq_pos(SCpnt->request), blk_rq_sectors(SCpnt->request), 1671 1671 cursec, YESNO(s), YESNO(r), YESNO(rev), YESNO(input_only), 1672 1672 YESNO(overlap), cpp->xdir);
+17 -16
drivers/scsi/wd33c93.c
··· 502 502 cmd = (struct scsi_cmnd *) hostdata->input_Q; 503 503 prev = NULL; 504 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 507 break; 507 508 prev = cmd; 508 509 cmd = (struct scsi_cmnd *) cmd->host_scribble; ··· 594 593 595 594 write_wd33c93(regs, WD_SOURCE_ID, ((cmd->SCp.phase) ? SRCID_ER : 0)); 596 595 597 - write_wd33c93(regs, WD_TARGET_LUN, cmd->device->lun); 596 + write_wd33c93(regs, WD_TARGET_LUN, (u8)cmd->device->lun); 598 597 write_wd33c93(regs, WD_SYNCHRONOUS_TRANSFER, 599 598 hostdata->sync_xfer[cmd->device->id]); 600 - hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 599 + hostdata->busy[cmd->device->id] |= (1 << (cmd->device->lun & 0xFF)); 601 600 602 601 if ((hostdata->level2 == L2_NONE) || 603 602 (hostdata->sync_stat[cmd->device->id] == SS_UNSET)) { ··· 863 862 } 864 863 865 864 cmd->result = DID_NO_CONNECT << 16; 866 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 865 + hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); 867 866 hostdata->state = S_UNCONNECTED; 868 867 cmd->scsi_done(cmd); 869 868 ··· 896 895 897 896 /* construct an IDENTIFY message with correct disconnect bit */ 898 897 899 - hostdata->outgoing_msg[0] = (0x80 | 0x00 | cmd->device->lun); 898 + hostdata->outgoing_msg[0] = IDENTIFY(0, cmd->device->lun); 900 899 if (cmd->SCp.phase) 901 900 hostdata->outgoing_msg[0] |= 0x40; 902 901 ··· 1180 1179 lun = read_wd33c93(regs, WD_TARGET_LUN); 1181 1180 DB(DB_INTR, printk(":%d.%d", cmd->SCp.Status, lun)) 1182 1181 hostdata->connected = NULL; 1183 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 1182 + hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); 1184 1183 hostdata->state = S_UNCONNECTED; 1185 1184 if (cmd->SCp.Status == ILLEGAL_STATUS_BYTE) 1186 1185 cmd->SCp.Status = lun; ··· 1269 1268 } 1270 1269 DB(DB_INTR, printk("UNEXP_DISC")) 1271 1270 hostdata->connected = NULL; 1272 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 1271 + hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); 1273 1272 hostdata->state = S_UNCONNECTED; 1274 1273 if (cmd->cmnd[0] == REQUEST_SENSE && cmd->SCp.Status != GOOD) 1275 1274 cmd->result = ··· 1301 1300 switch (hostdata->state) { 1302 1301 case S_PRE_CMP_DISC: 1303 1302 hostdata->connected = NULL; 1304 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 1303 + hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); 1305 1304 hostdata->state = S_UNCONNECTED; 1306 1305 DB(DB_INTR, printk(":%d", cmd->SCp.Status)) 1307 1306 if (cmd->cmnd[0] == REQUEST_SENSE ··· 1354 1353 if (hostdata->selecting) { 1355 1354 cmd = (struct scsi_cmnd *) hostdata->selecting; 1356 1355 hostdata->selecting = NULL; 1357 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 1356 + hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); 1358 1357 cmd->host_scribble = 1359 1358 (uchar *) hostdata->input_Q; 1360 1359 hostdata->input_Q = cmd; ··· 1366 1365 if (cmd) { 1367 1366 if (phs == 0x00) { 1368 1367 hostdata->busy[cmd->device->id] &= 1369 - ~(1 << cmd->device->lun); 1368 + ~(1 << (cmd->device->lun & 0xff)); 1370 1369 cmd->host_scribble = 1371 1370 (uchar *) hostdata->input_Q; 1372 1371 hostdata->input_Q = cmd; ··· 1449 1448 cmd = (struct scsi_cmnd *) hostdata->disconnected_Q; 1450 1449 patch = NULL; 1451 1450 while (cmd) { 1452 - if (id == cmd->device->id && lun == cmd->device->lun) 1451 + if (id == cmd->device->id && lun == (u8)cmd->device->lun) 1453 1452 break; 1454 1453 patch = cmd; 1455 1454 cmd = (struct scsi_cmnd *) cmd->host_scribble; ··· 1460 1459 if (!cmd) { 1461 1460 printk 1462 1461 ("---TROUBLE: target %d.%d not in disconnect queue---", 1463 - id, lun); 1462 + id, (u8)lun); 1464 1463 spin_unlock_irqrestore(&hostdata->lock, flags); 1465 1464 return; 1466 1465 } ··· 1706 1705 sr = read_wd33c93(regs, WD_SCSI_STATUS); 1707 1706 printk("asr=%02x, sr=%02x.", asr, sr); 1708 1707 1709 - hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 1708 + hostdata->busy[cmd->device->id] &= ~(1 << (cmd->device->lun & 0xff)); 1710 1709 hostdata->connected = NULL; 1711 1710 hostdata->state = S_UNCONNECTED; 1712 1711 cmd->result = DID_ABORT << 16; ··· 2170 2169 seq_printf(m, "\nconnected: "); 2171 2170 if (hd->connected) { 2172 2171 cmd = (struct scsi_cmnd *) hd->connected; 2173 - seq_printf(m, " %d:%d(%02x)", 2172 + seq_printf(m, " %d:%llu(%02x)", 2174 2173 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2175 2174 } 2176 2175 } ··· 2178 2177 seq_printf(m, "\ninput_Q: "); 2179 2178 cmd = (struct scsi_cmnd *) hd->input_Q; 2180 2179 while (cmd) { 2181 - seq_printf(m, " %d:%d(%02x)", 2180 + seq_printf(m, " %d:%llu(%02x)", 2182 2181 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2183 2182 cmd = (struct scsi_cmnd *) cmd->host_scribble; 2184 2183 } ··· 2187 2186 seq_printf(m, "\ndisconnected_Q:"); 2188 2187 cmd = (struct scsi_cmnd *) hd->disconnected_Q; 2189 2188 while (cmd) { 2190 - seq_printf(m, " %d:%d(%02x)", 2189 + seq_printf(m, " %d:%llu(%02x)", 2191 2190 cmd->device->id, cmd->device->lun, cmd->cmnd[0]); 2192 2191 cmd = (struct scsi_cmnd *) cmd->host_scribble; 2193 2192 }
+2 -2
drivers/staging/rts5208/rtsx.c
··· 465 465 else if (chip->srb->device->id) { 466 466 dev_err(&dev->pci->dev, "Bad target number (%d:%d)\n", 467 467 chip->srb->device->id, 468 - chip->srb->device->lun); 468 + (u8)chip->srb->device->lun); 469 469 chip->srb->result = DID_BAD_TARGET << 16; 470 470 } 471 471 472 472 else if (chip->srb->device->lun > chip->max_lun) { 473 473 dev_err(&dev->pci->dev, "Bad LUN (%d:%d)\n", 474 474 chip->srb->device->id, 475 - chip->srb->device->lun); 475 + (u8)chip->srb->device->lun); 476 476 chip->srb->result = DID_BAD_TARGET << 16; 477 477 } 478 478
+1 -1
drivers/target/loopback/tcm_loop.c
··· 252 252 { 253 253 struct tcm_loop_cmd *tl_cmd; 254 254 255 - pr_debug("tcm_loop_queuecommand() %d:%d:%d:%d got CDB: 0x%02x" 255 + pr_debug("tcm_loop_queuecommand() %d:%d:%d:%llu got CDB: 0x%02x" 256 256 " scsi_buf_len: %u\n", sc->device->host->host_no, 257 257 sc->device->id, sc->device->channel, sc->device->lun, 258 258 sc->cmnd[0], scsi_bufflen(sc));
+6 -6
drivers/target/target_core_pscsi.c
··· 312 312 if (!sd->queue_depth) { 313 313 sd->queue_depth = PSCSI_DEFAULT_QUEUEDEPTH; 314 314 315 - pr_err("Set broken SCSI Device %d:%d:%d" 315 + pr_err("Set broken SCSI Device %d:%d:%llu" 316 316 " queue_depth to %d\n", sd->channel, sd->id, 317 317 sd->lun, sd->queue_depth); 318 318 } ··· 375 375 int ret; 376 376 377 377 if (scsi_device_get(sd)) { 378 - pr_err("scsi_device_get() failed for %d:%d:%d:%d\n", 378 + pr_err("scsi_device_get() failed for %d:%d:%d:%llu\n", 379 379 sh->host_no, sd->channel, sd->id, sd->lun); 380 380 spin_unlock_irq(sh->host_lock); 381 381 return -EIO; ··· 401 401 return ret; 402 402 } 403 403 404 - pr_debug("CORE_PSCSI[%d] - Added TYPE_DISK for %d:%d:%d:%d\n", 404 + pr_debug("CORE_PSCSI[%d] - Added TYPE_DISK for %d:%d:%d:%llu\n", 405 405 phv->phv_host_id, sh->host_no, sd->channel, sd->id, sd->lun); 406 406 return 0; 407 407 } ··· 417 417 int ret; 418 418 419 419 if (scsi_device_get(sd)) { 420 - pr_err("scsi_device_get() failed for %d:%d:%d:%d\n", 420 + pr_err("scsi_device_get() failed for %d:%d:%d:%llu\n", 421 421 sh->host_no, sd->channel, sd->id, sd->lun); 422 422 spin_unlock_irq(sh->host_lock); 423 423 return -EIO; ··· 429 429 scsi_device_put(sd); 430 430 return ret; 431 431 } 432 - pr_debug("CORE_PSCSI[%d] - Added Type: %s for %d:%d:%d:%d\n", 432 + pr_debug("CORE_PSCSI[%d] - Added Type: %s for %d:%d:%d:%llu\n", 433 433 phv->phv_host_id, scsi_device_type(sd->type), sh->host_no, 434 434 sd->channel, sd->id, sd->lun); 435 435 ··· 452 452 if (ret) 453 453 return ret; 454 454 455 - pr_debug("CORE_PSCSI[%d] - Added Type: %s for %d:%d:%d:%d\n", 455 + pr_debug("CORE_PSCSI[%d] - Added Type: %s for %d:%d:%d:%llu\n", 456 456 phv->phv_host_id, scsi_device_type(sd->type), sh->host_no, 457 457 sd->channel, sd->id, sd->lun); 458 458 return 0;
+2 -2
drivers/usb/storage/sddr09.c
··· 1498 1498 { 1499 1499 int ret; 1500 1500 1501 - usb_stor_dbg(us, "LUN=%d\n", srb->device->lun); 1501 + usb_stor_dbg(us, "LUN=%d\n", (u8)srb->device->lun); 1502 1502 1503 1503 switch (srb->device->lun) { 1504 1504 case 0: ··· 1524 1524 break; 1525 1525 1526 1526 default: 1527 - usb_stor_dbg(us, "Invalid LUN %d\n", srb->device->lun); 1527 + usb_stor_dbg(us, "Invalid LUN %d\n", (u8)srb->device->lun); 1528 1528 ret = USB_STOR_TRANSPORT_ERROR; 1529 1529 break; 1530 1530 }
+6 -4
drivers/usb/storage/usb.c
··· 347 347 */ 348 348 else if (us->srb->device->id && 349 349 !(us->fflags & US_FL_SCM_MULT_TARG)) { 350 - usb_stor_dbg(us, "Bad target number (%d:%d)\n", 351 - us->srb->device->id, us->srb->device->lun); 350 + usb_stor_dbg(us, "Bad target number (%d:%llu)\n", 351 + us->srb->device->id, 352 + us->srb->device->lun); 352 353 us->srb->result = DID_BAD_TARGET << 16; 353 354 } 354 355 355 356 else if (us->srb->device->lun > us->max_lun) { 356 - usb_stor_dbg(us, "Bad LUN (%d:%d)\n", 357 - us->srb->device->id, us->srb->device->lun); 357 + usb_stor_dbg(us, "Bad LUN (%d:%llu)\n", 358 + us->srb->device->id, 359 + us->srb->device->lun); 358 360 us->srb->result = DID_BAD_TARGET << 16; 359 361 } 360 362
+1 -1
include/scsi/scsi.h
··· 385 385 #define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2) 386 386 #define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3) 387 387 388 - static inline int scsi_is_wlun(unsigned int lun) 388 + static inline int scsi_is_wlun(u64 lun) 389 389 { 390 390 return (lun & 0xff00) == SCSI_W_LUN_BASE; 391 391 }
+11 -11
include/scsi/scsi_device.h
··· 98 98 99 99 unsigned long last_queue_ramp_up; /* last queue ramp up time */ 100 100 101 - unsigned int id, lun, channel; 102 - 101 + unsigned int id, channel; 102 + u64 lun; 103 103 unsigned int manufacturer; /* Manufacturer of device, for using 104 104 * vendor-specific cmd's */ 105 105 unsigned sector_size; /* size in bytes */ ··· 321 321 dev_printk(prefix, &(starget)->dev, fmt, ##a) 322 322 323 323 extern struct scsi_device *__scsi_add_device(struct Scsi_Host *, 324 - uint, uint, uint, void *hostdata); 324 + uint, uint, u64, void *hostdata); 325 325 extern int scsi_add_device(struct Scsi_Host *host, uint channel, 326 - uint target, uint lun); 326 + uint target, u64 lun); 327 327 extern int scsi_register_device_handler(struct scsi_device_handler *scsi_dh); 328 328 extern void scsi_remove_device(struct scsi_device *); 329 329 extern int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh); ··· 332 332 extern int scsi_device_get(struct scsi_device *); 333 333 extern void scsi_device_put(struct scsi_device *); 334 334 extern struct scsi_device *scsi_device_lookup(struct Scsi_Host *, 335 - uint, uint, uint); 335 + uint, uint, u64); 336 336 extern struct scsi_device *__scsi_device_lookup(struct Scsi_Host *, 337 - uint, uint, uint); 337 + uint, uint, u64); 338 338 extern struct scsi_device *scsi_device_lookup_by_target(struct scsi_target *, 339 - uint); 339 + u64); 340 340 extern struct scsi_device *__scsi_device_lookup_by_target(struct scsi_target *, 341 - uint); 341 + u64); 342 342 extern void starget_for_each_device(struct scsi_target *, void *, 343 343 void (*fn)(struct scsi_device *, void *)); 344 344 extern void __starget_for_each_device(struct scsi_target *, void *, ··· 411 411 extern void scsi_target_quiesce(struct scsi_target *); 412 412 extern void scsi_target_resume(struct scsi_target *); 413 413 extern void scsi_scan_target(struct device *parent, unsigned int channel, 414 - unsigned int id, unsigned int lun, int rescan); 414 + unsigned int id, u64 lun, int rescan); 415 415 extern void scsi_target_reap(struct scsi_target *); 416 416 extern void scsi_target_block(struct device *); 417 417 extern void scsi_target_unblock(struct device *, enum scsi_device_state); 418 418 extern void scsi_remove_target(struct device *); 419 - extern void int_to_scsilun(unsigned int, struct scsi_lun *); 420 - extern int scsilun_to_int(struct scsi_lun *); 419 + extern void int_to_scsilun(u64, struct scsi_lun *); 420 + extern u64 scsilun_to_int(struct scsi_lun *); 421 421 extern const char *scsi_device_state_name(enum scsi_device_state); 422 422 extern int scsi_is_sdev_device(const struct device *); 423 423 extern int scsi_is_target_device(const struct device *);
+1 -1
include/scsi/scsi_transport.h
··· 35 35 /* 36 36 * If set, called from sysfs and legacy procfs rescanning code. 37 37 */ 38 - int (*user_scan)(struct Scsi_Host *, uint, uint, uint); 38 + int (*user_scan)(struct Scsi_Host *, uint, uint, u64); 39 39 40 40 /* The size of the specific transport attribute structure (a 41 41 * space of this size will be left at the end of the