Lines Matching refs:drv

187 				   drive_info_struct *drv);
439 drive_info_struct *drv = h->drv[*pos]; in cciss_seq_show() local
444 if (drv == NULL) /* it's possible for h->drv[] to have holes. */ in cciss_seq_show()
447 if (drv->heads == 0) in cciss_seq_show()
450 vol_sz = drv->nr_blocks; in cciss_seq_show()
455 if (drv->raid_level < 0 || drv->raid_level > RAID_UNKNOWN) in cciss_seq_show()
456 drv->raid_level = RAID_UNKNOWN; in cciss_seq_show()
460 raid_label[drv->raid_level]); in cciss_seq_show()
665 drive_info_struct *drv = to_drv(dev); in dev_show_unique_id() local
666 struct ctlr_info *h = to_hba(drv->dev.parent); in dev_show_unique_id()
675 memcpy(sn, drv->serial_no, sizeof(sn)); in dev_show_unique_id()
695 drive_info_struct *drv = to_drv(dev); in dev_show_vendor() local
696 struct ctlr_info *h = to_hba(drv->dev.parent); in dev_show_vendor()
705 memcpy(vendor, drv->vendor, VENDOR_LEN + 1); in dev_show_vendor()
711 return snprintf(buf, sizeof(vendor) + 1, "%s\n", drv->vendor); in dev_show_vendor()
719 drive_info_struct *drv = to_drv(dev); in dev_show_model() local
720 struct ctlr_info *h = to_hba(drv->dev.parent); in dev_show_model()
729 memcpy(model, drv->model, MODEL_LEN + 1); in dev_show_model()
735 return snprintf(buf, sizeof(model) + 1, "%s\n", drv->model); in dev_show_model()
743 drive_info_struct *drv = to_drv(dev); in dev_show_rev() local
744 struct ctlr_info *h = to_hba(drv->dev.parent); in dev_show_rev()
753 memcpy(rev, drv->rev, REV_LEN + 1); in dev_show_rev()
759 return snprintf(buf, sizeof(rev) + 1, "%s\n", drv->rev); in dev_show_rev()
766 drive_info_struct *drv = to_drv(dev); in cciss_show_lunid() local
767 struct ctlr_info *h = to_hba(drv->dev.parent); in cciss_show_lunid()
776 if (!drv->heads) { in cciss_show_lunid()
780 memcpy(lunid, drv->LunID, sizeof(lunid)); in cciss_show_lunid()
791 drive_info_struct *drv = to_drv(dev); in cciss_show_raid_level() local
792 struct ctlr_info *h = to_hba(drv->dev.parent); in cciss_show_raid_level()
801 raid = drv->raid_level; in cciss_show_raid_level()
814 drive_info_struct *drv = to_drv(dev); in cciss_show_usage_count() local
815 struct ctlr_info *h = to_hba(drv->dev.parent); in cciss_show_usage_count()
824 count = drv->usage_count; in cciss_show_usage_count()
924 drive_info_struct *drv = to_drv(dev); in cciss_device_release() local
925 kfree(drv); in cciss_device_release()
939 if (h->drv[drv_index]->device_initialized) in cciss_create_ld_sysfs_entry()
942 dev = &h->drv[drv_index]->dev; in cciss_create_ld_sysfs_entry()
948 h->drv[drv_index]->device_initialized = 1; in cciss_create_ld_sysfs_entry()
958 struct device *dev = &h->drv[drv_index]->dev; in cciss_destroy_ld_sysfs_entry()
966 h->drv[drv_index] = NULL; in cciss_destroy_ld_sysfs_entry()
1081 drive_info_struct *drv = get_drv(bdev->bd_disk); in cciss_open() local
1084 if (drv->busy_configuring) in cciss_open()
1094 if (drv->heads == 0) { in cciss_open()
1100 } else if (memcmp(drv->LunID, CTLR_LUNID, in cciss_open()
1101 sizeof(drv->LunID))) { in cciss_open()
1108 drv->usage_count++; in cciss_open()
1130 drive_info_struct *drv; in cciss_release() local
1134 drv = get_drv(disk); in cciss_release()
1136 drv->usage_count--; in cciss_release()
1264 drive_info_struct *drv = get_drv(bdev->bd_disk); in cciss_getgeo() local
1266 if (!drv->cylinders) in cciss_getgeo()
1269 geo->heads = drv->heads; in cciss_getgeo()
1270 geo->sectors = drv->sectors; in cciss_getgeo()
1271 geo->cylinders = drv->cylinders; in cciss_getgeo()
1449 drive_info_struct *drv = get_drv(disk); in cciss_getluninfo() local
1453 memcpy(&luninfo.LunID, drv->LunID, sizeof(luninfo.LunID)); in cciss_getluninfo()
1454 luninfo.num_opens = drv->usage_count; in cciss_getluninfo()
1789 if (!h->drv[curr_queue]) in cciss_check_queues()
1791 if (!(h->drv[curr_queue]->queue) || in cciss_check_queues()
1792 !(h->drv[curr_queue]->heads)) in cciss_check_queues()
1860 memcpy(scsi3addr, h->drv[log_unit]->LunID, in log_unit_to_scsi3addr()
1861 sizeof(h->drv[log_unit]->LunID)); in log_unit_to_scsi3addr()
1943 disk->private_data = h->drv[drv_index]; in cciss_add_disk()
1944 disk->driverfs_dev = &h->drv[drv_index]->dev; in cciss_add_disk()
1959 h->drv[drv_index]->block_size); in cciss_add_disk()
1965 h->drv[drv_index]->queue = disk->queue; in cciss_add_disk()
2034 memcpy(drvinfo->LunID, h->drv[drv_index]->LunID, in cciss_update_drive_info()
2038 if (h->drv[drv_index]->raid_level != -1 && in cciss_update_drive_info()
2040 h->drv[drv_index]->serial_no, 16) == 0) && in cciss_update_drive_info()
2041 drvinfo->block_size == h->drv[drv_index]->block_size && in cciss_update_drive_info()
2042 drvinfo->nr_blocks == h->drv[drv_index]->nr_blocks && in cciss_update_drive_info()
2043 drvinfo->heads == h->drv[drv_index]->heads && in cciss_update_drive_info()
2044 drvinfo->sectors == h->drv[drv_index]->sectors && in cciss_update_drive_info()
2045 drvinfo->cylinders == h->drv[drv_index]->cylinders)) in cciss_update_drive_info()
2055 if (h->drv[drv_index]->raid_level != -1 && drv_index != 0) { in cciss_update_drive_info()
2058 h->drv[drv_index]->busy_configuring = 1; in cciss_update_drive_info()
2076 if (h->drv[drv_index] == NULL) { in cciss_update_drive_info()
2078 h->drv[drv_index] = drvinfo; in cciss_update_drive_info()
2082 h->drv[drv_index]->block_size = drvinfo->block_size; in cciss_update_drive_info()
2083 h->drv[drv_index]->nr_blocks = drvinfo->nr_blocks; in cciss_update_drive_info()
2084 h->drv[drv_index]->heads = drvinfo->heads; in cciss_update_drive_info()
2085 h->drv[drv_index]->sectors = drvinfo->sectors; in cciss_update_drive_info()
2086 h->drv[drv_index]->cylinders = drvinfo->cylinders; in cciss_update_drive_info()
2087 h->drv[drv_index]->raid_level = drvinfo->raid_level; in cciss_update_drive_info()
2088 memcpy(h->drv[drv_index]->serial_no, drvinfo->serial_no, 16); in cciss_update_drive_info()
2089 memcpy(h->drv[drv_index]->vendor, drvinfo->vendor, in cciss_update_drive_info()
2091 memcpy(h->drv[drv_index]->model, drvinfo->model, MODEL_LEN + 1); in cciss_update_drive_info()
2092 memcpy(h->drv[drv_index]->rev, drvinfo->rev, REV_LEN + 1); in cciss_update_drive_info()
2097 set_capacity(disk, h->drv[drv_index]->nr_blocks); in cciss_update_drive_info()
2137 drive_info_struct *drv; in cciss_alloc_drive_info() local
2143 if (h->drv[i] && i != 0) in cciss_alloc_drive_info()
2149 if (i == 0 && h->drv[i] && h->drv[i]->raid_level != -1) in cciss_alloc_drive_info()
2160 if (i == 0 && h->drv[i] != NULL) in cciss_alloc_drive_info()
2167 drv = kzalloc(sizeof(*drv), GFP_KERNEL); in cciss_alloc_drive_info()
2168 if (!drv) in cciss_alloc_drive_info()
2170 drv->raid_level = -1; /* so we know it's new */ in cciss_alloc_drive_info()
2171 h->drv[i] = drv; in cciss_alloc_drive_info()
2179 kfree(h->drv[drv_index]); in cciss_free_drive_info()
2180 h->drv[drv_index] = NULL; in cciss_free_drive_info()
2218 memcpy(h->drv[drv_index]->LunID, lunid, in cciss_add_gendisk()
2219 sizeof(h->drv[drv_index]->LunID)); in cciss_add_gendisk()
2225 h->drv[drv_index]->busy_configuring = 0; in cciss_add_gendisk()
2252 h->drv[drv_index]->block_size = 512; in cciss_add_controller_node()
2253 h->drv[drv_index]->nr_blocks = 0; in cciss_add_controller_node()
2254 h->drv[drv_index]->heads = 0; in cciss_add_controller_node()
2255 h->drv[drv_index]->sectors = 0; in cciss_add_controller_node()
2256 h->drv[drv_index]->cylinders = 0; in cciss_add_controller_node()
2257 h->drv[drv_index]->raid_level = -1; in cciss_add_controller_node()
2258 memset(h->drv[drv_index]->serial_no, 0, 16); in cciss_add_controller_node()
2340 if (h->drv[i] == NULL) in rebuild_lun_table()
2345 if (memcmp(h->drv[i]->LunID, lunid, in rebuild_lun_table()
2354 h->drv[i]->busy_configuring = 1; in rebuild_lun_table()
2357 if (h->drv[i] != NULL) in rebuild_lun_table()
2358 h->drv[i]->busy_configuring = 0; in rebuild_lun_table()
2379 if (h->drv[j] != NULL && in rebuild_lun_table()
2380 memcmp(h->drv[j]->LunID, lunid, in rebuild_lun_table()
2381 sizeof(h->drv[j]->LunID)) == 0) { in rebuild_lun_table()
2456 drive_info_struct *drv; in deregister_disk() local
2462 drv = h->drv[drv_index]; in deregister_disk()
2467 if (drv->usage_count > via_ioctl) in deregister_disk()
2469 } else if (drv->usage_count > 0) in deregister_disk()
2472 recalculate_highest_lun = (drv == h->drv[h->highest_lun]); in deregister_disk()
2508 cciss_clear_drive_info(drv); in deregister_disk()
2518 if (h->drv[i] && h->drv[i]->heads) in deregister_disk()
2844 drive_info_struct *drv) in cciss_geometry_inquiry() argument
2859 drv->heads = 255; in cciss_geometry_inquiry()
2860 drv->sectors = 32; /* Sectors per track */ in cciss_geometry_inquiry()
2861 drv->cylinders = total_size + 1; in cciss_geometry_inquiry()
2862 drv->raid_level = RAID_UNKNOWN; in cciss_geometry_inquiry()
2864 drv->heads = inq_buff->data_byte[6]; in cciss_geometry_inquiry()
2865 drv->sectors = inq_buff->data_byte[7]; in cciss_geometry_inquiry()
2866 drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8; in cciss_geometry_inquiry()
2867 drv->cylinders += inq_buff->data_byte[5]; in cciss_geometry_inquiry()
2868 drv->raid_level = inq_buff->data_byte[8]; in cciss_geometry_inquiry()
2870 drv->block_size = block_size; in cciss_geometry_inquiry()
2871 drv->nr_blocks = total_size + 1; in cciss_geometry_inquiry()
2872 t = drv->heads * drv->sectors; in cciss_geometry_inquiry()
2878 drv->cylinders = real_size; in cciss_geometry_inquiry()
2946 drive_info_struct *drv = get_drv(disk); in cciss_revalidate() local
2954 if (!h->drv[logvol]) in cciss_revalidate()
2956 if (memcmp(h->drv[logvol]->LunID, drv->LunID, in cciss_revalidate()
2957 sizeof(drv->LunID)) == 0) { in cciss_revalidate()
2979 inq_buff, drv); in cciss_revalidate()
2981 blk_queue_logical_block_size(drv->queue, drv->block_size); in cciss_revalidate()
2982 set_capacity(disk, drv->nr_blocks); in cciss_revalidate()
3295 drive_info_struct *drv; in do_cciss_request() local
3320 drv = creq->rq_disk->private_data; in do_cciss_request()
3327 memcpy(&c->Header.LUN, drv->LunID, sizeof(drv->LunID)); in do_cciss_request()
5085 h->drv[j] = NULL; in cciss_init_one()