Lines Matching defs:raid_device
396 * @device: either sas_device or raid_device object
411 struct _raid_device *raid_device;
428 raid_device = device;
429 sas_address = raid_device->wwid;
616 * This searches for raid_device based on target id, then return raid_device
622 struct _raid_device *raid_device, *r;
625 list_for_each_entry(raid_device, &ioc->raid_device_list, list) {
626 if (raid_device->id == id && raid_device->channel == channel) {
627 r = raid_device;
642 * This searches for raid_device based on handle, then return raid_device
648 struct _raid_device *raid_device, *r;
651 list_for_each_entry(raid_device, &ioc->raid_device_list, list) {
652 if (raid_device->handle != handle)
654 r = raid_device;
668 * This searches for raid_device based on wwid, then return raid_device
674 struct _raid_device *raid_device, *r;
677 list_for_each_entry(raid_device, &ioc->raid_device_list, list) {
678 if (raid_device->wwid != wwid)
680 r = raid_device;
689 * _scsih_raid_device_add - add raid_device object
691 * @raid_device: raid_device object
697 struct _raid_device *raid_device)
703 raid_device->handle, (unsigned long long)raid_device->wwid));
706 list_add_tail(&raid_device->list, &ioc->raid_device_list);
711 * _scsih_raid_device_remove - delete raid_device object
713 * @raid_device: raid_device object
719 struct _raid_device *raid_device)
724 list_del(&raid_device->list);
725 memset(raid_device, 0, sizeof(struct _raid_device));
726 kfree(raid_device);
1215 struct _raid_device *raid_device;
1230 raid_device = _scsih_raid_device_find_by_id(ioc, starget->id,
1232 if (raid_device) {
1233 sas_target_priv_data->handle = raid_device->handle;
1234 sas_target_priv_data->sas_address = raid_device->wwid;
1236 raid_device->starget = starget;
1276 struct _raid_device *raid_device;
1286 raid_device = _scsih_raid_device_find_by_id(ioc, starget->id,
1288 if (raid_device) {
1289 raid_device->starget = NULL;
1290 raid_device->sdev = NULL;
1327 struct _raid_device *raid_device;
1349 raid_device = _scsih_raid_device_find_by_id(ioc,
1351 if (raid_device)
1352 raid_device->sdev = sdev; /* raid is single lun */
1448 static struct _raid_device *raid_device;
1456 raid_device = _scsih_raid_device_find_by_id(ioc, sdev->id,
1460 if (!raid_device)
1464 MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle,
1473 percent_complete = raid_device->percent_complete;
1487 static struct _raid_device *raid_device;
1495 raid_device = _scsih_raid_device_find_by_id(ioc, sdev->id,
1499 if (!raid_device)
1503 MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle,
1536 * @raid_device: raid_device object
1539 _scsih_set_level(struct scsi_device *sdev, struct _raid_device *raid_device)
1543 switch (raid_device->volume_type) {
1564 * @sas_device: the raid_device object
1568 struct _raid_device *raid_device)
1577 if ((mpt2sas_config_get_number_pds(ioc, raid_device->handle,
1584 raid_device->num_pds = num_pds;
1595 MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle, sz))) {
1602 raid_device->volume_type = vol_pg0->VolumeType;
1613 raid_device->device_info =
1662 struct _raid_device *raid_device;
1679 raid_device = _scsih_raid_device_find_by_handle(ioc,
1682 if (!raid_device) {
1688 _scsih_get_volume_capabilities(ioc, raid_device);
1695 if (raid_device->device_info &
1701 if (raid_device->device_info &
1708 switch (raid_device->volume_type) {
1717 !(raid_device->num_pds % 2))
1739 r_level, raid_device->handle,
1740 (unsigned long long)raid_device->wwid,
1741 raid_device->num_pds, ds);
1744 _scsih_set_level(sdev, raid_device);
3043 struct _raid_device *raid_device;
3048 raid_device = _scsih_raid_device_find_by_handle(ioc, handle);
3049 if (raid_device && raid_device->starget &&
3050 raid_device->starget->hostdata) {
3052 raid_device->starget->hostdata;
3057 (unsigned long long) raid_device->wwid));
5219 struct _raid_device *raid_device;
5234 raid_device = _scsih_raid_device_find_by_wwid(ioc, wwid);
5237 if (raid_device)
5240 raid_device = kzalloc(sizeof(struct _raid_device), GFP_KERNEL);
5241 if (!raid_device) {
5248 raid_device->id = ioc->sas_id++;
5249 raid_device->channel = RAID_CHANNEL;
5250 raid_device->handle = handle;
5251 raid_device->wwid = wwid;
5252 _scsih_raid_device_add(ioc, raid_device);
5255 raid_device->id, 0);
5257 _scsih_raid_device_remove(ioc, raid_device);
5259 _scsih_determine_boot_device(ioc, raid_device, 1);
5273 struct _raid_device *raid_device;
5278 raid_device = _scsih_raid_device_find_by_handle(ioc, handle);
5280 if (!raid_device)
5282 if (raid_device->starget) {
5283 sas_target_priv_data = raid_device->starget->hostdata;
5285 scsi_remove_target(&raid_device->starget->dev);
5288 "(0x%016llx)\n", ioc->name, raid_device->handle,
5289 (unsigned long long) raid_device->wwid);
5290 _scsih_raid_device_remove(ioc, raid_device);
5581 struct _raid_device *raid_device;
5607 raid_device = _scsih_raid_device_find_by_handle(ioc, handle);
5610 if (raid_device)
5621 raid_device = kzalloc(sizeof(struct _raid_device), GFP_KERNEL);
5622 if (!raid_device) {
5629 raid_device->id = ioc->sas_id++;
5630 raid_device->channel = RAID_CHANNEL;
5631 raid_device->handle = handle;
5632 raid_device->wwid = wwid;
5633 _scsih_raid_device_add(ioc, raid_device);
5635 raid_device->id, 0);
5637 _scsih_raid_device_remove(ioc, raid_device);
5784 static struct _raid_device *raid_device;
5800 raid_device = _scsih_raid_device_find_by_handle(ioc, handle);
5803 if (!raid_device)
5807 raid_device->percent_complete =
5826 static struct _raid_device *raid_device;
5851 raid_device = _scsih_raid_device_find_by_handle(
5854 if (raid_device) {
5855 id = raid_device->id;
5856 channel = raid_device->channel;
5857 handle = raid_device->handle;
5858 sas_address = raid_device->wwid;
6015 * _scsih_mark_responding_raid_device - mark a raid_device as responding
6031 struct _raid_device *raid_device;
6035 list_for_each_entry(raid_device, &ioc->raid_device_list, list) {
6036 if (raid_device->wwid == wwid && raid_device->starget) {
6037 starget = raid_device->starget;
6043 raid_device->responding = 1;
6044 starget_printk(KERN_INFO, raid_device->starget,
6046 (unsigned long long)raid_device->wwid);
6047 if (raid_device->handle == handle)
6050 raid_device->handle);
6051 raid_device->handle = handle;
6215 struct _raid_device *raid_device, *raid_device_next;
6236 list_for_each_entry_safe(raid_device, raid_device_next,
6238 if (raid_device->responding) {
6239 raid_device->responding = 0;
6242 if (raid_device->starget) {
6243 starget_printk(KERN_INFO, raid_device->starget,
6245 raid_device->handle,
6246 (unsigned long long)raid_device->wwid);
6247 scsi_remove_target(&raid_device->starget->dev);
6249 _scsih_raid_device_remove(ioc, raid_device);
6711 struct _raid_device *raid_device, *next;
6728 list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list,
6730 if (raid_device->starget) {
6732 raid_device->starget->hostdata;
6734 scsi_remove_target(&raid_device->starget->dev);
6737 "(0x%016llx)\n", ioc->name, raid_device->handle,
6738 (unsigned long long) raid_device->wwid);
6739 _scsih_raid_device_remove(ioc, raid_device);
6795 struct _raid_device *raid_device;
6818 raid_device = device;
6820 raid_device->id, 0);
6822 _scsih_raid_device_remove(ioc, raid_device);
6851 struct _raid_device *raid_device, *raid_next;
6854 list_for_each_entry_safe(raid_device, raid_next,
6856 if (raid_device->starget)
6859 raid_device->id, 0);
6861 _scsih_raid_device_remove(ioc, raid_device);