Commit 2a168208 authored by Kevin Barnett's avatar Kevin Barnett Committed by Martin K. Petersen

hpsa: simplify check for device exposure

remove macros and cleanup device exposure checking
Reviewed-by: default avatarScott Teel <scott.teel@pmcs.com>
Reviewed-by: default avatarJustin Lindley <justin.lindley@pmcs.com>
Reviewed-by: default avatarKevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarDon Brace <don.brace@pmcs.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a736e9b6
...@@ -792,8 +792,7 @@ static ssize_t path_info_show(struct device *dev, ...@@ -792,8 +792,7 @@ static ssize_t path_info_show(struct device *dev,
PATH_STRING_LEN, PATH_STRING_LEN,
"PORT: %.2s ", "PORT: %.2s ",
phys_connector); phys_connector);
if (hdev->devtype == TYPE_DISK && if (hdev->devtype == TYPE_DISK && hdev->expose_device) {
hdev->expose_state != HPSA_DO_NOT_EXPOSE) {
if (box == 0 || box == 0xFF) { if (box == 0 || box == 0xFF) {
output_len += snprintf(path[i] + output_len, output_len += snprintf(path[i] + output_len,
PATH_STRING_LEN, PATH_STRING_LEN,
...@@ -1152,7 +1151,7 @@ static void hpsa_show_dev_msg(const char *level, struct ctlr_info *h, ...@@ -1152,7 +1151,7 @@ static void hpsa_show_dev_msg(const char *level, struct ctlr_info *h,
"RAID-?" : raid_label[dev->raid_level], "RAID-?" : raid_label[dev->raid_level],
dev->offload_config ? '+' : '-', dev->offload_config ? '+' : '-',
dev->offload_enabled ? '+' : '-', dev->offload_enabled ? '+' : '-',
dev->expose_state); dev->expose_device);
} }
/* Add an entry into h->dev[] array. */ /* Add an entry into h->dev[] array. */
...@@ -1225,7 +1224,7 @@ static int hpsa_scsi_add_entry(struct ctlr_info *h, ...@@ -1225,7 +1224,7 @@ static int hpsa_scsi_add_entry(struct ctlr_info *h,
added[*nadded] = device; added[*nadded] = device;
(*nadded)++; (*nadded)++;
hpsa_show_dev_msg(KERN_INFO, h, device, hpsa_show_dev_msg(KERN_INFO, h, device,
device->expose_state & HPSA_SCSI_ADD ? "added" : "masked"); device->expose_device ? "added" : "masked");
device->offload_to_be_enabled = device->offload_enabled; device->offload_to_be_enabled = device->offload_enabled;
device->offload_enabled = 0; device->offload_enabled = 0;
return 0; return 0;
...@@ -1788,7 +1787,7 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h, ...@@ -1788,7 +1787,7 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h,
for (i = 0; i < nremoved; i++) { for (i = 0; i < nremoved; i++) {
if (removed[i] == NULL) if (removed[i] == NULL)
continue; continue;
if (removed[i]->expose_state & HPSA_SCSI_ADD) { if (removed[i]->expose_device) {
struct scsi_device *sdev = struct scsi_device *sdev =
scsi_device_lookup(sh, removed[i]->bus, scsi_device_lookup(sh, removed[i]->bus,
removed[i]->target, removed[i]->lun); removed[i]->target, removed[i]->lun);
...@@ -1813,7 +1812,7 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h, ...@@ -1813,7 +1812,7 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h,
for (i = 0; i < nadded; i++) { for (i = 0; i < nadded; i++) {
if (added[i] == NULL) if (added[i] == NULL)
continue; continue;
if (!(added[i]->expose_state & HPSA_SCSI_ADD)) if (!(added[i]->expose_device))
continue; continue;
if (scsi_add_device(sh, added[i]->bus, if (scsi_add_device(sh, added[i]->bus,
added[i]->target, added[i]->lun) == 0) added[i]->target, added[i]->lun) == 0)
...@@ -1861,7 +1860,7 @@ static int hpsa_slave_alloc(struct scsi_device *sdev) ...@@ -1861,7 +1860,7 @@ static int hpsa_slave_alloc(struct scsi_device *sdev)
sdev_id(sdev), sdev->lun); sdev_id(sdev), sdev->lun);
if (likely(sd)) { if (likely(sd)) {
atomic_set(&sd->ioaccel_cmds_out, 0); atomic_set(&sd->ioaccel_cmds_out, 0);
sdev->hostdata = (sd->expose_state & HPSA_SCSI_ADD) ? sd : NULL; sdev->hostdata = sd->expose_device ? sd : NULL;
} else } else
sdev->hostdata = NULL; sdev->hostdata = NULL;
spin_unlock_irqrestore(&h->devlock, flags); spin_unlock_irqrestore(&h->devlock, flags);
...@@ -1875,7 +1874,7 @@ static int hpsa_slave_configure(struct scsi_device *sdev) ...@@ -1875,7 +1874,7 @@ static int hpsa_slave_configure(struct scsi_device *sdev)
int queue_depth; int queue_depth;
sd = sdev->hostdata; sd = sdev->hostdata;
sdev->no_uld_attach = !sd || !(sd->expose_state & HPSA_ULD_ATTACH); sdev->no_uld_attach = !sd || !sd->expose_device;
if (sd) if (sd)
queue_depth = sd->queue_depth != 0 ? queue_depth = sd->queue_depth != 0 ?
...@@ -3861,12 +3860,10 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) ...@@ -3861,12 +3860,10 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h)
/* do not expose masked devices */ /* do not expose masked devices */
if (MASKED_DEVICE(lunaddrbytes) && if (MASKED_DEVICE(lunaddrbytes) &&
i < nphysicals + (raid_ctlr_position == 0)) { i < nphysicals + (raid_ctlr_position == 0))
this_device->expose_state = HPSA_DO_NOT_EXPOSE; this_device->expose_device = 0;
} else { else
this_device->expose_state = this_device->expose_device = 1;
HPSA_SG_ATTACH | HPSA_ULD_ATTACH;
}
switch (this_device->devtype) { switch (this_device->devtype) {
case TYPE_ROM: case TYPE_ROM:
......
...@@ -37,6 +37,7 @@ struct hpsa_scsi_dev_t { ...@@ -37,6 +37,7 @@ struct hpsa_scsi_dev_t {
unsigned int devtype; unsigned int devtype;
int bus, target, lun; /* as presented to the OS */ int bus, target, lun; /* as presented to the OS */
unsigned char scsi3addr[8]; /* as presented to the HW */ unsigned char scsi3addr[8]; /* as presented to the HW */
u8 expose_device;
#define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0" #define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0"
unsigned char device_id[16]; /* from inquiry pg. 0x83 */ unsigned char device_id[16]; /* from inquiry pg. 0x83 */
unsigned char vendor[8]; /* bytes 8-15 of inquiry data */ unsigned char vendor[8]; /* bytes 8-15 of inquiry data */
...@@ -75,11 +76,6 @@ struct hpsa_scsi_dev_t { ...@@ -75,11 +76,6 @@ struct hpsa_scsi_dev_t {
struct hpsa_scsi_dev_t *phys_disk[RAID_MAP_MAX_ENTRIES]; struct hpsa_scsi_dev_t *phys_disk[RAID_MAP_MAX_ENTRIES];
int nphysical_disks; int nphysical_disks;
int supports_aborts; int supports_aborts;
#define HPSA_DO_NOT_EXPOSE 0x0
#define HPSA_SG_ATTACH 0x1
#define HPSA_ULD_ATTACH 0x2
#define HPSA_SCSI_ADD (HPSA_SG_ATTACH | HPSA_ULD_ATTACH)
u8 expose_state;
}; };
struct reply_queue_buffer { struct reply_queue_buffer {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment