diff options
author | Matthew Wilcox <matthew@wil.cx> | 2006-07-04 14:15:20 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-08-06 16:59:26 -0400 |
commit | 4ff36718ede26ee2da73f2dae94d71e2b06845fc (patch) | |
tree | d9188d88bb3f60427c9976ed0f3da8bf433bb757 /drivers/block/cciss_scsi.c | |
parent | 008cd5bbfb4763322837cd1f7c621f02ebe22fef (diff) |
[SCSI] Improve inquiry printing
- Replace scsi_device_types array API with scsi_device_type function API.
Gets rid of a lot of common code, as well as being easier to use.
- Add the new device types in SPC4 r05a, and rename some of the older ones.
- Reformat the printing of inquiry data; now fits on one line and
includes PQ.
I think I've addressed all the feedback from the previous versions. My
current test box prints:
scsi 2:0:1:0: Direct access HP 18.2G ATLAS10K3_18_SCA HP05 PQ: 0 ANSI: 2
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/block/cciss_scsi.c')
-rw-r--r-- | drivers/block/cciss_scsi.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index afdff32f6724..05f79d7393f7 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
@@ -251,10 +251,6 @@ scsi_cmd_stack_free(int ctlr) | |||
251 | stk->pool = NULL; | 251 | stk->pool = NULL; |
252 | } | 252 | } |
253 | 253 | ||
254 | /* scsi_device_types comes from scsi.h */ | ||
255 | #define DEVICETYPE(n) (n<0 || n>MAX_SCSI_DEVICE_CODE) ? \ | ||
256 | "Unknown" : scsi_device_types[n] | ||
257 | |||
258 | #if 0 | 254 | #if 0 |
259 | static int xmargin=8; | 255 | static int xmargin=8; |
260 | static int amargin=60; | 256 | static int amargin=60; |
@@ -389,7 +385,7 @@ cciss_scsi_add_entry(int ctlr, int hostno, | |||
389 | time anyway (the scsi layer's inquiries will show that info) */ | 385 | time anyway (the scsi layer's inquiries will show that info) */ |
390 | if (hostno != -1) | 386 | if (hostno != -1) |
391 | printk("cciss%d: %s device c%db%dt%dl%d added.\n", | 387 | printk("cciss%d: %s device c%db%dt%dl%d added.\n", |
392 | ctlr, DEVICETYPE(sd->devtype), hostno, | 388 | ctlr, scsi_device_type(sd->devtype), hostno, |
393 | sd->bus, sd->target, sd->lun); | 389 | sd->bus, sd->target, sd->lun); |
394 | return 0; | 390 | return 0; |
395 | } | 391 | } |
@@ -407,7 +403,7 @@ cciss_scsi_remove_entry(int ctlr, int hostno, int entry) | |||
407 | ccissscsi[ctlr].dev[i] = ccissscsi[ctlr].dev[i+1]; | 403 | ccissscsi[ctlr].dev[i] = ccissscsi[ctlr].dev[i+1]; |
408 | ccissscsi[ctlr].ndevices--; | 404 | ccissscsi[ctlr].ndevices--; |
409 | printk("cciss%d: %s device c%db%dt%dl%d removed.\n", | 405 | printk("cciss%d: %s device c%db%dt%dl%d removed.\n", |
410 | ctlr, DEVICETYPE(sd.devtype), hostno, | 406 | ctlr, scsi_device_type(sd.devtype), hostno, |
411 | sd.bus, sd.target, sd.lun); | 407 | sd.bus, sd.target, sd.lun); |
412 | } | 408 | } |
413 | 409 | ||
@@ -458,7 +454,7 @@ adjust_cciss_scsi_table(int ctlr, int hostno, | |||
458 | if (found == 0) { /* device no longer present. */ | 454 | if (found == 0) { /* device no longer present. */ |
459 | changes++; | 455 | changes++; |
460 | /* printk("cciss%d: %s device c%db%dt%dl%d removed.\n", | 456 | /* printk("cciss%d: %s device c%db%dt%dl%d removed.\n", |
461 | ctlr, DEVICETYPE(csd->devtype), hostno, | 457 | ctlr, scsi_device_type(csd->devtype), hostno, |
462 | csd->bus, csd->target, csd->lun); */ | 458 | csd->bus, csd->target, csd->lun); */ |
463 | cciss_scsi_remove_entry(ctlr, hostno, i); | 459 | cciss_scsi_remove_entry(ctlr, hostno, i); |
464 | /* note, i not incremented */ | 460 | /* note, i not incremented */ |
@@ -468,7 +464,7 @@ adjust_cciss_scsi_table(int ctlr, int hostno, | |||
468 | printk("cciss%d: device c%db%dt%dl%d type changed " | 464 | printk("cciss%d: device c%db%dt%dl%d type changed " |
469 | "(device type now %s).\n", | 465 | "(device type now %s).\n", |
470 | ctlr, hostno, csd->bus, csd->target, csd->lun, | 466 | ctlr, hostno, csd->bus, csd->target, csd->lun, |
471 | DEVICETYPE(csd->devtype)); | 467 | scsi_device_type(csd->devtype)); |
472 | csd->devtype = sd[j].devtype; | 468 | csd->devtype = sd[j].devtype; |
473 | i++; /* so just move along. */ | 469 | i++; /* so just move along. */ |
474 | } else /* device is same as it ever was, */ | 470 | } else /* device is same as it ever was, */ |
@@ -1098,7 +1094,7 @@ cciss_update_non_disk_devices(int cntl_num, int hostno) | |||
1098 | if (ncurrent >= CCISS_MAX_SCSI_DEVS_PER_HBA) { | 1094 | if (ncurrent >= CCISS_MAX_SCSI_DEVS_PER_HBA) { |
1099 | printk(KERN_INFO "cciss%d: %s ignored, " | 1095 | printk(KERN_INFO "cciss%d: %s ignored, " |
1100 | "too many devices.\n", cntl_num, | 1096 | "too many devices.\n", cntl_num, |
1101 | DEVICETYPE(devtype)); | 1097 | scsi_device_type(devtype)); |
1102 | break; | 1098 | break; |
1103 | } | 1099 | } |
1104 | memcpy(¤tsd[ncurrent].scsi3addr[0], | 1100 | memcpy(¤tsd[ncurrent].scsi3addr[0], |