Lines Matching defs:device

241 			struct hpsa_scsi_dev_t *device);
242 static void hpsa_remove_sas_device(struct hpsa_scsi_dev_t *device);
410 "%s: a power on or device reset detected\n",
433 dev_warn(&h->pdev->dev, HPSA "device busy");
438 static ssize_t host_show_lockup_detected(struct device *dev,
451 static ssize_t host_store_hp_ssd_smart_path_status(struct device *dev,
475 static ssize_t host_store_raid_offload_debug(struct device *dev,
500 static ssize_t host_store_rescan(struct device *dev,
511 static void hpsa_turn_off_ioaccel_for_device(struct hpsa_scsi_dev_t *device)
513 device->offload_enabled = 0;
514 device->offload_to_be_enabled = 0;
517 static ssize_t host_show_firmware_revision(struct device *dev,
532 static ssize_t host_show_commands_outstanding(struct device *dev,
542 static ssize_t host_show_transport_mode(struct device *dev,
554 static ssize_t host_show_hp_ssd_smart_path_status(struct device *dev,
638 static ssize_t host_show_resettable(struct device *dev,
666 static inline bool is_logical_device(struct hpsa_scsi_dev_t *device)
668 return !device->physical_device;
671 static ssize_t raid_level_show(struct device *dev,
705 static ssize_t lunid_show(struct device *dev,
727 static ssize_t unique_id_show(struct device *dev,
755 static ssize_t sas_address_show(struct device *dev,
778 static ssize_t host_show_hp_ssd_smart_path_enabled(struct device *dev,
806 static ssize_t path_info_show(struct device *dev,
891 static ssize_t host_show_ctlr_num(struct device *dev,
901 static ssize_t host_show_legacy_board(struct device *dev,
1160 if (c->device && !c->retry_pending)
1161 atomic_inc(&c->device->commands_outstanding);
1205 /* finds an unused bus, target, lun for a new physical device
1285 struct hpsa_scsi_dev_t *device,
1301 if (device->lun != -1)
1302 /* Logical device, lun is already assigned. */
1305 /* If this device a non-zero lun of a multi-lun device
1309 if (device->scsi3addr[4] == 0) {
1310 /* This is not a non-zero lun of a multi-lun device */
1311 if (hpsa_find_target_lun(h, device->scsi3addr,
1312 device->bus, &device->target, &device->lun) != 0)
1317 /* This is a non-zero lun of a multi-lun device.
1318 * Search through our list and find the device which
1323 memcpy(addr1, device->scsi3addr, 8);
1333 device->bus = sd->bus;
1334 device->target = sd->target;
1335 device->lun = device->scsi3addr[4];
1339 if (device->lun == -1) {
1340 dev_warn(&h->pdev->dev, "physical device with no LUN=0,"
1348 h->dev[n] = device;
1350 added[*nadded] = device;
1352 hpsa_show_dev_msg(KERN_INFO, h, device,
1353 device->expose_device ? "added" : "masked");
1521 * that the device is a different device, nor that the OS
1551 * In the case of a minor device attribute change, such as RAID level, just
1552 * return DEVICE_UPDATED, along with the updated device's location in index.
1591 struct offline_device_entry *device;
1594 /* Check to see if device is already on the list */
1596 list_for_each_entry(device, &h->offline_device_list, offline_list) {
1597 if (memcmp(device->scsi3addr, scsi3addr,
1598 sizeof(device->scsi3addr)) == 0) {
1606 device = kmalloc(sizeof(*device), GFP_KERNEL);
1607 if (!device)
1610 memcpy(device->scsi3addr, scsi3addr, sizeof(device->scsi3addr));
1612 list_add_tail(&device->offline_list, &h->offline_device_list);
1814 static int hpsa_add_device(struct ctlr_info *h, struct hpsa_scsi_dev_t *device)
1821 if (is_logical_device(device)) /* RAID */
1822 rc = scsi_add_device(h->scsi_host, device->bus,
1823 device->target, device->lun);
1825 rc = hpsa_add_sas_device(h->sas_host, device);
1858 struct hpsa_scsi_dev_t *device)
1864 if (device->external)
1868 cmds = hpsa_find_outstanding_commands_for_dev(h, device);
1878 "%s: removing device [%d:%d:%d:%d] with %d outstanding commands!\n",
1881 device->bus, device->target, device->lun, cmds);
1886 struct hpsa_scsi_dev_t *device)
1896 device->removed = 1;
1897 hpsa_wait_for_outstanding_commands_for_dev(h, device);
1899 if (is_logical_device(device)) { /* RAID */
1900 sdev = scsi_device_lookup(h->scsi_host, device->bus,
1901 device->target, device->lun);
1908 * to this device will get a selection timeout as
1909 * if the device were gone.
1911 hpsa_show_dev_msg(KERN_WARNING, h, device,
1912 "didn't find device for removal.");
1916 hpsa_remove_sas_device(device);
1934 * A reset can cause a device status to change
1958 * devices which have changed, remove the old device
1959 * info and add the new device info.
1960 * If minor device attributes change, just update
1961 * the existing device structure.
1987 /* Now, make sure every device listed in sd[] is also
2017 "device unexpectedly changed.\n");
2018 /* but if it does happen, we just ignore that device */
2029 * We are updating the device list used for I/O requests.
2079 "addition failed %d, device not added.", rc);
2143 /* configure scsi device based on internal per-device structure */
2418 * of the disk to get the same device node.
2425 "%s: device is gone!\n", __func__);
2461 struct hpsa_scsi_dev_t *dev = c->device;
2584 if (!cmd->device) {
2589 dev = cmd->device->hostdata;
2738 /* We get CMD_INVALID if you address a non-existent device
2932 struct device *d = &cp->h->pdev->dev;
2966 dev_warn(d, "probably means device no longer present\n");
3091 c->device = dev;
3443 * struct hpsa_scsi_dev_t *encl_dev - device entry for enclosure
3617 /* Get a device id from inquiry page 0x83 */
3663 * Sets ioaccel status on the new device list, not the existing device list
3665 * The device list used during I/O will be updated later in
3714 /* Get the device id from inquiry page 0x83 */
3721 /* Does controller have VPD for device id? */
3827 static inline void hpsa_set_bus_target_lun(struct hpsa_scsi_dev_t *device,
3830 device->bus = bus;
3831 device->target = target;
3832 device->lun = lun;
3959 /* Do an inquiry to the device to see what it is. */
3963 "%s: inquiry failed, device will be skipped.\n",
3984 "hpsa%d: %s: can't get device id for [%d:%d:%d:%d]\t%s\t%.16s\n",
4018 "%s: LV failed, device will be skipped.\n",
4035 /* See if this is a One-Button-Disaster-Recovery device
4054 * physical device lun and target assignment are deferred (assigned
4058 u8 *lunaddrbytes, struct hpsa_scsi_dev_t *device)
4063 /* physical device, target and lun filled in later */
4067 if (!device->rev)
4069 hpsa_set_bus_target_lun(device,
4073 hpsa_set_bus_target_lun(device,
4077 /* It's a logical device */
4078 if (device->external) {
4079 hpsa_set_bus_target_lun(device,
4084 hpsa_set_bus_target_lun(device, HPSA_RAID_VOLUME_BUS,
4322 * performance hit because I/O to the RAID device
4387 * plus external target devices, and a device for the local RAID
4394 /* Allocate the per device structures */
4447 /* Get device type, vendor, model, device id, raid_map */
4488 * So we check that the device is really an OBDR tape
4489 * device by checking for "$DR-10" in bytes 43-48 of
4825 * Queue a command directly to a device behind the controller using the
4832 struct hpsa_scsi_dev_t *dev = cmd->device->hostdata;
4853 struct hpsa_scsi_dev_t *dev = cmd->device->hostdata;
4857 /* Are we doing encryption on this device */
4918 if (!cmd->device)
4921 if (!cmd->device->hostdata)
5048 if (!c->scsi_cmd->device)
5051 if (!c->scsi_cmd->device->hostdata)
5057 /* Try to honor the device's queue depth */
5106 struct hpsa_scsi_dev_t *dev = cmd->device->hostdata;
5521 c->device = dev;
5577 struct hpsa_scsi_dev_t *dev = cmd->device->hostdata;
5595 c->device = dev;
5596 if (retry) /* Resubmit but do not increment device->commands_outstanding. */
5605 c->device = dev;
5606 if (retry) /* Resubmit but do not increment device->commands_outstanding. */
5622 dev = cmd->device->hostdata;
5689 h = sdev_to_hba(cmd->device);
5693 dev = cmd->device->hostdata;
5956 /* Send test unit ready until device ready, or give up. */
5974 "waiting %d secs for device to become ready.\n",
6013 dev_warn(&h->pdev->dev, "giving up on device.\n");
6015 dev_warn(&h->pdev->dev, "device is ready.\n");
6035 h = sdev_to_hba(scsicmd->device);
6048 dev = scsicmd->device->hostdata;
6050 dev_err(&h->pdev->dev, "%s: device lookup failed\n", __func__);
6098 dev->in_reset = true; /* block any new cmds from OS for this device */
6240 c->device = NULL;
6888 /* LunID device */
7205 * state of the device. The normal operating state is D0,
7207 * the controller, place the interface device in D3 then to D0,
7412 static void print_cfg_table(struct device *dev, struct CfgTable __iomem *tb)
7884 dev_err(&h->pdev->dev, "failed to enable PCI device\n");
7981 dev_warn(&pdev->dev, "Failed to enable PCI device\n");
7988 dev_warn(&pdev->dev, "failed to enable device.\n");
8345 struct hpsa_scsi_dev_t *device;
8355 * Run through current device list used during I/O requests.
8361 device = h->dev[i];
8363 if (!device)
8365 if (!hpsa_vpd_page_supported(h, device->scsi3addr,
8371 rc = hpsa_scsi_do_inquiry(h, device->scsi3addr,
8406 hpsa_turn_off_ioaccel_for_device(device);
9061 dev_err(&pdev->dev, "unable to remove device\n");
9116 __attribute__((unused)) struct device *dev)
9122 (__attribute__((unused)) struct device *dev)
9701 static struct hpsa_sas_node *hpsa_alloc_sas_node(struct device *parent_dev)
9734 struct hpsa_scsi_dev_t *device;
9737 device = h->dev[i];
9738 if (!device->sas_port)
9740 if (device->sas_port->rphy == rphy)
9741 return device;
9750 struct device *parent_dev;
9798 struct hpsa_scsi_dev_t *device)
9804 hpsa_sas_port = hpsa_alloc_sas_port(hpsa_sas_node, device->sas_address);
9815 device->sas_port = hpsa_sas_port;
9827 device->sas_port = NULL;
9832 static void hpsa_remove_sas_device(struct hpsa_scsi_dev_t *device)
9834 if (device->sas_port) {
9835 hpsa_free_sas_port(device->sas_port);
9836 device->sas_port = NULL;