Lines Matching refs:drv_index
167 static int deregister_disk(ctlr_info_t *h, int drv_index,
1352 int drv_index) in cciss_add_disk() argument
1355 sprintf(disk->disk_name, "cciss/c%dd%d", h->ctlr, drv_index); in cciss_add_disk()
1357 disk->first_minor = drv_index << NWD_SHIFT; in cciss_add_disk()
1359 disk->private_data = &h->drv[drv_index]; in cciss_add_disk()
1378 h->drv[drv_index].block_size); in cciss_add_disk()
1384 h->drv[drv_index].queue = disk->queue; in cciss_add_disk()
1398 static void cciss_update_drive_info(int ctlr, int drv_index, int first_time) in cciss_update_drive_info() argument
1420 was_only_controller_node = (drv_index == 0 && in cciss_update_drive_info()
1425 cciss_read_capacity_16(h->ctlr, drv_index, 1, in cciss_update_drive_info()
1429 cciss_read_capacity(ctlr, drv_index, 1, in cciss_update_drive_info()
1436 cciss_read_capacity_16(ctlr, drv_index, 1, in cciss_update_drive_info()
1446 cciss_geometry_inquiry(ctlr, drv_index, 1, total_size, block_size, in cciss_update_drive_info()
1451 cciss_get_serial_no(ctlr, drv_index, 1, drvinfo->serial_no, in cciss_update_drive_info()
1455 if (h->drv[drv_index].raid_level != -1 && in cciss_update_drive_info()
1457 h->drv[drv_index].serial_no, 16) == 0) && in cciss_update_drive_info()
1458 drvinfo->block_size == h->drv[drv_index].block_size && in cciss_update_drive_info()
1459 drvinfo->nr_blocks == h->drv[drv_index].nr_blocks && in cciss_update_drive_info()
1460 drvinfo->heads == h->drv[drv_index].heads && in cciss_update_drive_info()
1461 drvinfo->sectors == h->drv[drv_index].sectors && in cciss_update_drive_info()
1462 drvinfo->cylinders == h->drv[drv_index].cylinders)) in cciss_update_drive_info()
1472 if (h->drv[drv_index].raid_level != -1 && drv_index != 0) { in cciss_update_drive_info()
1473 printk(KERN_WARNING "disk %d has changed.\n", drv_index); in cciss_update_drive_info()
1475 h->drv[drv_index].busy_configuring = 1; in cciss_update_drive_info()
1482 ret = deregister_disk(h, drv_index, 0); in cciss_update_drive_info()
1483 h->drv[drv_index].busy_configuring = 0; in cciss_update_drive_info()
1493 h->drv[drv_index].block_size = drvinfo->block_size; in cciss_update_drive_info()
1494 h->drv[drv_index].nr_blocks = drvinfo->nr_blocks; in cciss_update_drive_info()
1495 h->drv[drv_index].heads = drvinfo->heads; in cciss_update_drive_info()
1496 h->drv[drv_index].sectors = drvinfo->sectors; in cciss_update_drive_info()
1497 h->drv[drv_index].cylinders = drvinfo->cylinders; in cciss_update_drive_info()
1498 h->drv[drv_index].raid_level = drvinfo->raid_level; in cciss_update_drive_info()
1499 memcpy(h->drv[drv_index].serial_no, drvinfo->serial_no, 16); in cciss_update_drive_info()
1502 disk = h->gendisk[drv_index]; in cciss_update_drive_info()
1503 set_capacity(disk, h->drv[drv_index].nr_blocks); in cciss_update_drive_info()
1511 if (drv_index || first_time) in cciss_update_drive_info()
1512 cciss_add_disk(h, disk, drv_index); in cciss_update_drive_info()
1557 int drv_index; in cciss_add_gendisk() local
1559 drv_index = cciss_find_free_drive_index(h->ctlr, controller_node); in cciss_add_gendisk()
1560 if (drv_index == -1) in cciss_add_gendisk()
1563 if (!h->gendisk[drv_index]) { in cciss_add_gendisk()
1564 h->gendisk[drv_index] = in cciss_add_gendisk()
1566 if (!h->gendisk[drv_index]) { in cciss_add_gendisk()
1569 h->ctlr, drv_index); in cciss_add_gendisk()
1573 h->drv[drv_index].LunID = lunid; in cciss_add_gendisk()
1578 h->drv[drv_index].busy_configuring = 0; in cciss_add_gendisk()
1580 return drv_index; in cciss_add_gendisk()
1591 int drv_index; in cciss_add_controller_node() local
1596 drv_index = cciss_add_gendisk(h, 0, 1); in cciss_add_controller_node()
1597 if (drv_index == -1) { in cciss_add_controller_node()
1602 h->drv[drv_index].block_size = 512; in cciss_add_controller_node()
1603 h->drv[drv_index].nr_blocks = 0; in cciss_add_controller_node()
1604 h->drv[drv_index].heads = 0; in cciss_add_controller_node()
1605 h->drv[drv_index].sectors = 0; in cciss_add_controller_node()
1606 h->drv[drv_index].cylinders = 0; in cciss_add_controller_node()
1607 h->drv[drv_index].raid_level = -1; in cciss_add_controller_node()
1608 memset(h->drv[drv_index].serial_no, 0, 16); in cciss_add_controller_node()
1609 disk = h->gendisk[drv_index]; in cciss_add_controller_node()
1610 cciss_add_disk(h, disk, drv_index); in cciss_add_controller_node()
1630 int drv_index = 0; in rebuild_lun_table() local
1726 drv_index = j; in rebuild_lun_table()
1734 drv_index = cciss_add_gendisk(h, lunid, 0); in rebuild_lun_table()
1735 if (drv_index == -1) in rebuild_lun_table()
1738 cciss_update_drive_info(ctlr, drv_index, first_time); in rebuild_lun_table()
1770 static int deregister_disk(ctlr_info_t *h, int drv_index, in deregister_disk() argument
1780 drv = &h->drv[drv_index]; in deregister_disk()
1781 disk = h->gendisk[drv_index]; in deregister_disk()