Lines Matching refs:drv
185 drive_info_struct *drv);
437 drive_info_struct *drv = h->drv[*pos]; in cciss_seq_show() local
442 if (drv == NULL) /* it's possible for h->drv[] to have holes. */ in cciss_seq_show()
445 if (drv->heads == 0) in cciss_seq_show()
448 vol_sz = drv->nr_blocks; in cciss_seq_show()
453 if (drv->raid_level < 0 || drv->raid_level > RAID_UNKNOWN) in cciss_seq_show()
454 drv->raid_level = RAID_UNKNOWN; in cciss_seq_show()
458 raid_label[drv->raid_level]); in cciss_seq_show()
681 drive_info_struct *drv = to_drv(dev); in dev_show_unique_id() local
682 struct ctlr_info *h = to_hba(drv->dev.parent); in dev_show_unique_id()
691 memcpy(sn, drv->serial_no, sizeof(sn)); in dev_show_unique_id()
711 drive_info_struct *drv = to_drv(dev); in dev_show_vendor() local
712 struct ctlr_info *h = to_hba(drv->dev.parent); in dev_show_vendor()
721 memcpy(vendor, drv->vendor, VENDOR_LEN + 1); in dev_show_vendor()
727 return snprintf(buf, sizeof(vendor) + 1, "%s\n", drv->vendor); in dev_show_vendor()
735 drive_info_struct *drv = to_drv(dev); in dev_show_model() local
736 struct ctlr_info *h = to_hba(drv->dev.parent); in dev_show_model()
745 memcpy(model, drv->model, MODEL_LEN + 1); in dev_show_model()
751 return snprintf(buf, sizeof(model) + 1, "%s\n", drv->model); in dev_show_model()
759 drive_info_struct *drv = to_drv(dev); in dev_show_rev() local
760 struct ctlr_info *h = to_hba(drv->dev.parent); in dev_show_rev()
769 memcpy(rev, drv->rev, REV_LEN + 1); in dev_show_rev()
775 return snprintf(buf, sizeof(rev) + 1, "%s\n", drv->rev); in dev_show_rev()
782 drive_info_struct *drv = to_drv(dev); in cciss_show_lunid() local
783 struct ctlr_info *h = to_hba(drv->dev.parent); in cciss_show_lunid()
792 if (!drv->heads) { in cciss_show_lunid()
796 memcpy(lunid, drv->LunID, sizeof(lunid)); in cciss_show_lunid()
807 drive_info_struct *drv = to_drv(dev); in cciss_show_raid_level() local
808 struct ctlr_info *h = to_hba(drv->dev.parent); in cciss_show_raid_level()
817 raid = drv->raid_level; in cciss_show_raid_level()
830 drive_info_struct *drv = to_drv(dev); in cciss_show_usage_count() local
831 struct ctlr_info *h = to_hba(drv->dev.parent); in cciss_show_usage_count()
840 count = drv->usage_count; in cciss_show_usage_count()
940 drive_info_struct *drv = to_drv(dev); in cciss_device_release() local
941 kfree(drv); in cciss_device_release()
955 if (h->drv[drv_index]->device_initialized) in cciss_create_ld_sysfs_entry()
958 dev = &h->drv[drv_index]->dev; in cciss_create_ld_sysfs_entry()
964 h->drv[drv_index]->device_initialized = 1; in cciss_create_ld_sysfs_entry()
974 struct device *dev = &h->drv[drv_index]->dev; in cciss_destroy_ld_sysfs_entry()
982 h->drv[drv_index] = NULL; in cciss_destroy_ld_sysfs_entry()
1097 drive_info_struct *drv = get_drv(bdev->bd_disk); in cciss_open() local
1100 if (drv->busy_configuring) in cciss_open()
1110 if (drv->heads == 0) { in cciss_open()
1116 } else if (memcmp(drv->LunID, CTLR_LUNID, in cciss_open()
1117 sizeof(drv->LunID))) { in cciss_open()
1124 drv->usage_count++; in cciss_open()
1146 drive_info_struct *drv; in cciss_release() local
1150 drv = get_drv(disk); in cciss_release()
1152 drv->usage_count--; in cciss_release()
1280 drive_info_struct *drv = get_drv(bdev->bd_disk); in cciss_getgeo() local
1282 if (!drv->cylinders) in cciss_getgeo()
1285 geo->heads = drv->heads; in cciss_getgeo()
1286 geo->sectors = drv->sectors; in cciss_getgeo()
1287 geo->cylinders = drv->cylinders; in cciss_getgeo()
1465 drive_info_struct *drv = get_drv(disk); in cciss_getluninfo() local
1469 memcpy(&luninfo.LunID, drv->LunID, sizeof(luninfo.LunID)); in cciss_getluninfo()
1470 luninfo.num_opens = drv->usage_count; in cciss_getluninfo()
1805 if (!h->drv[curr_queue]) in cciss_check_queues()
1807 if (!(h->drv[curr_queue]->queue) || in cciss_check_queues()
1808 !(h->drv[curr_queue]->heads)) in cciss_check_queues()
1876 memcpy(scsi3addr, h->drv[log_unit]->LunID, in log_unit_to_scsi3addr()
1877 sizeof(h->drv[log_unit]->LunID)); in log_unit_to_scsi3addr()
1959 disk->private_data = h->drv[drv_index]; in cciss_add_disk()
1960 disk->driverfs_dev = &h->drv[drv_index]->dev; in cciss_add_disk()
1975 h->drv[drv_index]->block_size); in cciss_add_disk()
1981 h->drv[drv_index]->queue = disk->queue; in cciss_add_disk()
2050 memcpy(drvinfo->LunID, h->drv[drv_index]->LunID, in cciss_update_drive_info()
2054 if (h->drv[drv_index]->raid_level != -1 && in cciss_update_drive_info()
2056 h->drv[drv_index]->serial_no, 16) == 0) && in cciss_update_drive_info()
2057 drvinfo->block_size == h->drv[drv_index]->block_size && in cciss_update_drive_info()
2058 drvinfo->nr_blocks == h->drv[drv_index]->nr_blocks && in cciss_update_drive_info()
2059 drvinfo->heads == h->drv[drv_index]->heads && in cciss_update_drive_info()
2060 drvinfo->sectors == h->drv[drv_index]->sectors && in cciss_update_drive_info()
2061 drvinfo->cylinders == h->drv[drv_index]->cylinders)) in cciss_update_drive_info()
2071 if (h->drv[drv_index]->raid_level != -1 && drv_index != 0) { in cciss_update_drive_info()
2074 h->drv[drv_index]->busy_configuring = 1; in cciss_update_drive_info()
2092 if (h->drv[drv_index] == NULL) { in cciss_update_drive_info()
2094 h->drv[drv_index] = drvinfo; in cciss_update_drive_info()
2098 h->drv[drv_index]->block_size = drvinfo->block_size; in cciss_update_drive_info()
2099 h->drv[drv_index]->nr_blocks = drvinfo->nr_blocks; in cciss_update_drive_info()
2100 h->drv[drv_index]->heads = drvinfo->heads; in cciss_update_drive_info()
2101 h->drv[drv_index]->sectors = drvinfo->sectors; in cciss_update_drive_info()
2102 h->drv[drv_index]->cylinders = drvinfo->cylinders; in cciss_update_drive_info()
2103 h->drv[drv_index]->raid_level = drvinfo->raid_level; in cciss_update_drive_info()
2104 memcpy(h->drv[drv_index]->serial_no, drvinfo->serial_no, 16); in cciss_update_drive_info()
2105 memcpy(h->drv[drv_index]->vendor, drvinfo->vendor, in cciss_update_drive_info()
2107 memcpy(h->drv[drv_index]->model, drvinfo->model, MODEL_LEN + 1); in cciss_update_drive_info()
2108 memcpy(h->drv[drv_index]->rev, drvinfo->rev, REV_LEN + 1); in cciss_update_drive_info()
2113 set_capacity(disk, h->drv[drv_index]->nr_blocks); in cciss_update_drive_info()
2153 drive_info_struct *drv; in cciss_alloc_drive_info() local
2159 if (h->drv[i] && i != 0) in cciss_alloc_drive_info()
2165 if (i == 0 && h->drv[i] && h->drv[i]->raid_level != -1) in cciss_alloc_drive_info()
2176 if (i == 0 && h->drv[i] != NULL) in cciss_alloc_drive_info()
2183 drv = kzalloc(sizeof(*drv), GFP_KERNEL); in cciss_alloc_drive_info()
2184 if (!drv) in cciss_alloc_drive_info()
2186 drv->raid_level = -1; /* so we know it's new */ in cciss_alloc_drive_info()
2187 h->drv[i] = drv; in cciss_alloc_drive_info()
2195 kfree(h->drv[drv_index]); in cciss_free_drive_info()
2196 h->drv[drv_index] = NULL; in cciss_free_drive_info()
2234 memcpy(h->drv[drv_index]->LunID, lunid, in cciss_add_gendisk()
2235 sizeof(h->drv[drv_index]->LunID)); in cciss_add_gendisk()
2241 h->drv[drv_index]->busy_configuring = 0; in cciss_add_gendisk()
2268 h->drv[drv_index]->block_size = 512; in cciss_add_controller_node()
2269 h->drv[drv_index]->nr_blocks = 0; in cciss_add_controller_node()
2270 h->drv[drv_index]->heads = 0; in cciss_add_controller_node()
2271 h->drv[drv_index]->sectors = 0; in cciss_add_controller_node()
2272 h->drv[drv_index]->cylinders = 0; in cciss_add_controller_node()
2273 h->drv[drv_index]->raid_level = -1; in cciss_add_controller_node()
2274 memset(h->drv[drv_index]->serial_no, 0, 16); in cciss_add_controller_node()
2356 if (h->drv[i] == NULL) in rebuild_lun_table()
2361 if (memcmp(h->drv[i]->LunID, lunid, in rebuild_lun_table()
2370 h->drv[i]->busy_configuring = 1; in rebuild_lun_table()
2373 if (h->drv[i] != NULL) in rebuild_lun_table()
2374 h->drv[i]->busy_configuring = 0; in rebuild_lun_table()
2395 if (h->drv[j] != NULL && in rebuild_lun_table()
2396 memcmp(h->drv[j]->LunID, lunid, in rebuild_lun_table()
2397 sizeof(h->drv[j]->LunID)) == 0) { in rebuild_lun_table()
2472 drive_info_struct *drv; in deregister_disk() local
2478 drv = h->drv[drv_index]; in deregister_disk()
2483 if (drv->usage_count > via_ioctl) in deregister_disk()
2485 } else if (drv->usage_count > 0) in deregister_disk()
2488 recalculate_highest_lun = (drv == h->drv[h->highest_lun]); in deregister_disk()
2524 cciss_clear_drive_info(drv); in deregister_disk()
2534 if (h->drv[i] && h->drv[i]->heads) in deregister_disk()
2860 drive_info_struct *drv) in cciss_geometry_inquiry() argument
2875 drv->heads = 255; in cciss_geometry_inquiry()
2876 drv->sectors = 32; /* Sectors per track */ in cciss_geometry_inquiry()
2877 drv->cylinders = total_size + 1; in cciss_geometry_inquiry()
2878 drv->raid_level = RAID_UNKNOWN; in cciss_geometry_inquiry()
2880 drv->heads = inq_buff->data_byte[6]; in cciss_geometry_inquiry()
2881 drv->sectors = inq_buff->data_byte[7]; in cciss_geometry_inquiry()
2882 drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8; in cciss_geometry_inquiry()
2883 drv->cylinders += inq_buff->data_byte[5]; in cciss_geometry_inquiry()
2884 drv->raid_level = inq_buff->data_byte[8]; in cciss_geometry_inquiry()
2886 drv->block_size = block_size; in cciss_geometry_inquiry()
2887 drv->nr_blocks = total_size + 1; in cciss_geometry_inquiry()
2888 t = drv->heads * drv->sectors; in cciss_geometry_inquiry()
2894 drv->cylinders = real_size; in cciss_geometry_inquiry()
2962 drive_info_struct *drv = get_drv(disk); in cciss_revalidate() local
2970 if (!h->drv[logvol]) in cciss_revalidate()
2972 if (memcmp(h->drv[logvol]->LunID, drv->LunID, in cciss_revalidate()
2973 sizeof(drv->LunID)) == 0) { in cciss_revalidate()
2995 inq_buff, drv); in cciss_revalidate()
2997 blk_queue_logical_block_size(drv->queue, drv->block_size); in cciss_revalidate()
2998 set_capacity(disk, drv->nr_blocks); in cciss_revalidate()
3311 drive_info_struct *drv; in do_cciss_request() local
3336 drv = creq->rq_disk->private_data; in do_cciss_request()
3343 memcpy(&c->Header.LUN, drv->LunID, sizeof(drv->LunID)); in do_cciss_request()
5100 h->drv[j] = NULL; in cciss_init_one()