aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2015-07-28 09:54:21 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-09-06 13:59:23 -0400
commit34d55434ba1f39093ea30cb770d70508fdb1edaa (patch)
treee8f4c8e3ca53e24557635e9c0076b54a118610cd /drivers
parentc1287970f4847a973830daf4076bc25929f3b2d9 (diff)
scsi_debug: use SCSI_W_LUN_REPORT_LUNS instead of SAM2_WLUN_REPORT_LUNS;
use SCSI_W_LUN_REPORT_LUNS from scsi.h instead of localy defined SAM2_WLUN_REPORT_LUNS Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi_debug.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 6e6bf0f03cf7..bbe04dae040c 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -204,7 +204,6 @@ static const char *scsi_debug_version_date = "20141022";
204/* If REPORT LUNS has luns >= 256 it can choose "flat space" (value 1) 204/* If REPORT LUNS has luns >= 256 it can choose "flat space" (value 1)
205 * or "peripheral device" addressing (value 0) */ 205 * or "peripheral device" addressing (value 0) */
206#define SAM2_LUN_ADDRESS_METHOD 0 206#define SAM2_LUN_ADDRESS_METHOD 0
207#define SAM2_WLUN_REPORT_LUNS 0xc101
208 207
209/* SCSI_DEBUG_CANQUEUE is the maximum number of commands that can be queued 208/* SCSI_DEBUG_CANQUEUE is the maximum number of commands that can be queued
210 * (for response) at one time. Can be reduced by max_queue option. Command 209 * (for response) at one time. Can be reduced by max_queue option. Command
@@ -701,7 +700,7 @@ static void sdebug_max_tgts_luns(void)
701 else 700 else
702 hpnt->max_id = scsi_debug_num_tgts; 701 hpnt->max_id = scsi_debug_num_tgts;
703 /* scsi_debug_max_luns; */ 702 /* scsi_debug_max_luns; */
704 hpnt->max_lun = SAM2_WLUN_REPORT_LUNS; 703 hpnt->max_lun = SCSI_W_LUN_REPORT_LUNS;
705 } 704 }
706 spin_unlock(&sdebug_host_list_lock); 705 spin_unlock(&sdebug_host_list_lock);
707} 706}
@@ -1291,7 +1290,7 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
1291 arr = kzalloc(SDEBUG_MAX_INQ_ARR_SZ, GFP_ATOMIC); 1290 arr = kzalloc(SDEBUG_MAX_INQ_ARR_SZ, GFP_ATOMIC);
1292 if (! arr) 1291 if (! arr)
1293 return DID_REQUEUE << 16; 1292 return DID_REQUEUE << 16;
1294 have_wlun = (scp->device->lun == SAM2_WLUN_REPORT_LUNS); 1293 have_wlun = (scp->device->lun == SCSI_W_LUN_REPORT_LUNS);
1295 if (have_wlun) 1294 if (have_wlun)
1296 pq_pdt = 0x1e; /* present, wlun */ 1295 pq_pdt = 0x1e; /* present, wlun */
1297 else if (scsi_debug_no_lun_0 && (0 == devip->lun)) 1296 else if (scsi_debug_no_lun_0 && (0 == devip->lun))
@@ -3367,8 +3366,8 @@ static int resp_report_luns(struct scsi_cmnd * scp,
3367 one_lun[i].scsi_lun[1] = lun & 0xff; 3366 one_lun[i].scsi_lun[1] = lun & 0xff;
3368 } 3367 }
3369 if (want_wlun) { 3368 if (want_wlun) {
3370 one_lun[i].scsi_lun[0] = (SAM2_WLUN_REPORT_LUNS >> 8) & 0xff; 3369 one_lun[i].scsi_lun[0] = (SCSI_W_LUN_REPORT_LUNS >> 8) & 0xff;
3371 one_lun[i].scsi_lun[1] = SAM2_WLUN_REPORT_LUNS & 0xff; 3370 one_lun[i].scsi_lun[1] = SCSI_W_LUN_REPORT_LUNS & 0xff;
3372 i++; 3371 i++;
3373 } 3372 }
3374 alloc_len = (unsigned char *)(one_lun + i) - arr; 3373 alloc_len = (unsigned char *)(one_lun + i) - arr;
@@ -5167,7 +5166,7 @@ scsi_debug_queuecommand(struct scsi_cmnd *scp)
5167 } 5166 }
5168 sdev_printk(KERN_INFO, sdp, "%s: cmd %s\n", my_name, b); 5167 sdev_printk(KERN_INFO, sdp, "%s: cmd %s\n", my_name, b);
5169 } 5168 }
5170 has_wlun_rl = (sdp->lun == SAM2_WLUN_REPORT_LUNS); 5169 has_wlun_rl = (sdp->lun == SCSI_W_LUN_REPORT_LUNS);
5171 if ((sdp->lun >= scsi_debug_max_luns) && !has_wlun_rl) 5170 if ((sdp->lun >= scsi_debug_max_luns) && !has_wlun_rl)
5172 return schedule_resp(scp, NULL, errsts_no_connect, 0); 5171 return schedule_resp(scp, NULL, errsts_no_connect, 0);
5173 5172
@@ -5338,7 +5337,7 @@ static int sdebug_driver_probe(struct device * dev)
5338 hpnt->max_id = scsi_debug_num_tgts + 1; 5337 hpnt->max_id = scsi_debug_num_tgts + 1;
5339 else 5338 else
5340 hpnt->max_id = scsi_debug_num_tgts; 5339 hpnt->max_id = scsi_debug_num_tgts;
5341 hpnt->max_lun = SAM2_WLUN_REPORT_LUNS; /* = scsi_debug_max_luns; */ 5340 hpnt->max_lun = SCSI_W_LUN_REPORT_LUNS; /* = scsi_debug_max_luns; */
5342 5341
5343 host_prot = 0; 5342 host_prot = 0;
5344 5343