Lines Matching defs:drv

182 				   drive_info_struct *drv);
435 drive_info_struct *drv = h->drv[*pos];
440 if (drv == NULL) /* it's possible for h->drv[] to have holes. */
443 if (drv->heads == 0)
446 vol_sz = drv->nr_blocks;
451 if (drv->raid_level < 0 || drv->raid_level > RAID_UNKNOWN)
452 drv->raid_level = RAID_UNKNOWN;
456 raid_label[drv->raid_level]);
661 drive_info_struct *drv = to_drv(dev);
662 struct ctlr_info *h = to_hba(drv->dev.parent);
671 memcpy(sn, drv->serial_no, sizeof(sn));
691 drive_info_struct *drv = to_drv(dev);
692 struct ctlr_info *h = to_hba(drv->dev.parent);
701 memcpy(vendor, drv->vendor, VENDOR_LEN + 1);
707 return snprintf(buf, sizeof(vendor) + 1, "%s\n", drv->vendor);
715 drive_info_struct *drv = to_drv(dev);
716 struct ctlr_info *h = to_hba(drv->dev.parent);
725 memcpy(model, drv->model, MODEL_LEN + 1);
731 return snprintf(buf, sizeof(model) + 1, "%s\n", drv->model);
739 drive_info_struct *drv = to_drv(dev);
740 struct ctlr_info *h = to_hba(drv->dev.parent);
749 memcpy(rev, drv->rev, REV_LEN + 1);
755 return snprintf(buf, sizeof(rev) + 1, "%s\n", drv->rev);
762 drive_info_struct *drv = to_drv(dev);
763 struct ctlr_info *h = to_hba(drv->dev.parent);
772 if (!drv->heads) {
776 memcpy(lunid, drv->LunID, sizeof(lunid));
787 drive_info_struct *drv = to_drv(dev);
788 struct ctlr_info *h = to_hba(drv->dev.parent);
797 raid = drv->raid_level;
810 drive_info_struct *drv = to_drv(dev);
811 struct ctlr_info *h = to_hba(drv->dev.parent);
820 count = drv->usage_count;
916 * of h->drv[x]dev goes to zero.
920 drive_info_struct *drv = to_drv(dev);
921 kfree(drv);
935 if (h->drv[drv_index]->device_initialized)
938 dev = &h->drv[drv_index]->dev;
944 h->drv[drv_index]->device_initialized = 1;
954 struct device *dev = &h->drv[drv_index]->dev;
962 h->drv[drv_index] = NULL;
1082 drive_info_struct *drv = get_drv(bdev->bd_disk);
1085 if (drv->busy_configuring)
1095 if (drv->heads == 0) {
1101 } else if (memcmp(drv->LunID, CTLR_LUNID,
1102 sizeof(drv->LunID))) {
1109 drv->usage_count++;
1131 drive_info_struct *drv;
1135 drv = get_drv(disk);
1137 drv->usage_count--;
1275 drive_info_struct *drv = get_drv(bdev->bd_disk);
1277 if (!drv->cylinders)
1280 geo->heads = drv->heads;
1281 geo->sectors = drv->sectors;
1282 geo->cylinders = drv->cylinders;
1448 drive_info_struct *drv = get_drv(disk);
1452 memcpy(&luninfo.LunID, drv->LunID, sizeof(luninfo.LunID));
1453 luninfo.num_opens = drv->usage_count;
1788 if (!h->drv[curr_queue])
1790 if (!(h->drv[curr_queue]->queue) ||
1791 !(h->drv[curr_queue]->heads))
1859 memcpy(scsi3addr, h->drv[log_unit]->LunID,
1860 sizeof(h->drv[log_unit]->LunID));
1942 disk->private_data = h->drv[drv_index];
1943 disk->driverfs_dev = &h->drv[drv_index]->dev;
1958 h->drv[drv_index]->block_size);
1961 /* setting h->drv[drv_index]->queue, as setting this */
1964 h->drv[drv_index]->queue = disk->queue;
2033 memcpy(drvinfo->LunID, h->drv[drv_index]->LunID,
2037 if (h->drv[drv_index]->raid_level != -1 &&
2039 h->drv[drv_index]->serial_no, 16) == 0) &&
2040 drvinfo->block_size == h->drv[drv_index]->block_size &&
2041 drvinfo->nr_blocks == h->drv[drv_index]->nr_blocks &&
2042 drvinfo->heads == h->drv[drv_index]->heads &&
2043 drvinfo->sectors == h->drv[drv_index]->sectors &&
2044 drvinfo->cylinders == h->drv[drv_index]->cylinders))
2054 if (h->drv[drv_index]->raid_level != -1 && drv_index != 0) {
2057 h->drv[drv_index]->busy_configuring = 1;
2060 /* deregister_disk sets h->drv[drv_index]->queue = NULL
2073 * above, then h->drv[drv_index] will be NULL.
2075 if (h->drv[drv_index] == NULL) {
2077 h->drv[drv_index] = drvinfo;
2081 h->drv[drv_index]->block_size = drvinfo->block_size;
2082 h->drv[drv_index]->nr_blocks = drvinfo->nr_blocks;
2083 h->drv[drv_index]->heads = drvinfo->heads;
2084 h->drv[drv_index]->sectors = drvinfo->sectors;
2085 h->drv[drv_index]->cylinders = drvinfo->cylinders;
2086 h->drv[drv_index]->raid_level = drvinfo->raid_level;
2087 memcpy(h->drv[drv_index]->serial_no, drvinfo->serial_no, 16);
2088 memcpy(h->drv[drv_index]->vendor, drvinfo->vendor,
2090 memcpy(h->drv[drv_index]->model, drvinfo->model, MODEL_LEN + 1);
2091 memcpy(h->drv[drv_index]->rev, drvinfo->rev, REV_LEN + 1);
2096 set_capacity(disk, h->drv[drv_index]->nr_blocks);
2124 * that has a null drv pointer and allocate the drive info struct and
2136 drive_info_struct *drv;
2142 if (h->drv[i] && i != 0)
2145 * If it's cxd0 case, and drv is alloc'ed already, and a
2148 if (i == 0 && h->drv[i] && h->drv[i]->raid_level != -1)
2159 if (i == 0 && h->drv[i] != NULL)
2166 drv = kzalloc(sizeof(*drv), GFP_KERNEL);
2167 if (!drv)
2169 drv->raid_level = -1; /* so we know it's new */
2170 h->drv[i] = drv;
2178 kfree(h->drv[drv_index]);
2179 h->drv[drv_index] = NULL;
2188 /* cciss_add_gendisk finds a free hba[]->drv structure
2191 * the ->drv[] array, or -1 if none are free.
2217 memcpy(h->drv[drv_index]->LunID, lunid,
2218 sizeof(h->drv[drv_index]->LunID));
2224 h->drv[drv_index]->busy_configuring = 0;
2251 h->drv[drv_index]->block_size = 512;
2252 h->drv[drv_index]->nr_blocks = 0;
2253 h->drv[drv_index]->heads = 0;
2254 h->drv[drv_index]->sectors = 0;
2255 h->drv[drv_index]->cylinders = 0;
2256 h->drv[drv_index]->raid_level = -1;
2257 memset(h->drv[drv_index]->serial_no, 0, 16);
2339 if (h->drv[i] == NULL)
2344 if (memcmp(h->drv[i]->LunID, lunid,
2353 h->drv[i]->busy_configuring = 1;
2356 if (h->drv[i] != NULL)
2357 h->drv[i]->busy_configuring = 0;
2378 if (h->drv[j] != NULL &&
2379 memcmp(h->drv[j]->LunID, lunid,
2380 sizeof(h->drv[j]->LunID)) == 0) {
2431 * drv structures busy_configuring flag set. It's parameters are:
2434 * drv = This is the drive_info_struct associated with the disk to be
2455 drive_info_struct *drv;
2461 drv = h->drv[drv_index];
2466 if (drv->usage_count > via_ioctl)
2468 } else if (drv->usage_count > 0)
2471 recalculate_highest_lun = (drv == h->drv[h->highest_lun]);
2507 cciss_clear_drive_info(drv);
2517 if (h->drv[i] && h->drv[i]->heads)
2843 drive_info_struct *drv)
2858 drv->heads = 255;
2859 drv->sectors = 32; /* Sectors per track */
2860 drv->cylinders = total_size + 1;
2861 drv->raid_level = RAID_UNKNOWN;
2863 drv->heads = inq_buff->data_byte[6];
2864 drv->sectors = inq_buff->data_byte[7];
2865 drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8;
2866 drv->cylinders += inq_buff->data_byte[5];
2867 drv->raid_level = inq_buff->data_byte[8];
2869 drv->block_size = block_size;
2870 drv->nr_blocks = total_size + 1;
2871 t = drv->heads * drv->sectors;
2877 drv->cylinders = real_size;
2945 drive_info_struct *drv = get_drv(disk);
2953 if (!h->drv[logvol])
2955 if (memcmp(h->drv[logvol]->LunID, drv->LunID,
2956 sizeof(drv->LunID)) == 0) {
2978 inq_buff, drv);
2980 blk_queue_logical_block_size(drv->queue, drv->block_size);
2981 set_capacity(disk, drv->nr_blocks);
3294 drive_info_struct *drv;
3319 drv = creq->rq_disk->private_data;
3326 memcpy(&c->Header.LUN, drv->LunID, sizeof(drv->LunID));
5078 h->drv[j] = NULL;