Lines Matching defs:ld
135 static int ciss_identify_logical(struct ciss_softc *sc, struct ciss_ldrive *ld);
136 static int ciss_get_ldrive_status(struct ciss_softc *sc, struct ciss_ldrive *ld);
138 static int ciss_accept_media(struct ciss_softc *sc, struct ciss_ldrive *ld);
205 static void ciss_print_ldrive(struct ciss_softc *sc, struct ciss_ldrive *ld);
1504 struct ciss_ldrive *ld;
1509 ld = &sc->ciss_logical[bus][target];
1511 ld->cl_address = cll->lun[i];
1512 ld->cl_controller = &sc->ciss_controllers[bus];
1513 if (ciss_identify_logical(sc, ld) != 0)
1518 if (ld->cl_lstatus->media_exchanged)
1519 ciss_accept_media(sc, ld);
1701 ciss_inquiry_logical(struct ciss_softc *sc, struct ciss_ldrive *ld)
1711 bzero(&ld->cl_geometry, sizeof(ld->cl_geometry));
1717 cr->cr_data = &ld->cl_geometry;
1718 cr->cr_length = sizeof(ld->cl_geometry);
1721 cc->header.address = ld->cl_address;
1732 scsi_ulto2b(sizeof(ld->cl_geometry), inq->length);
1762 ciss_identify_logical(struct ciss_softc *sc, struct ciss_ldrive *ld)
1777 (void **)&ld->cl_ldrive,
1778 sizeof(*ld->cl_ldrive))) != 0)
1781 cc->header.address = *ld->cl_controller; /* target controller */
1783 cbc->log_drive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun);
1815 if ((error = ciss_get_ldrive_status(sc, ld)) != 0)
1821 if ((error = ciss_inquiry_logical(sc, ld)) != 0)
1829 CISS_LUN_TO_BUS(ld->cl_address.logical.lun),
1830 CISS_LUN_TO_TARGET(ld->cl_address.logical.lun),
1831 ciss_name_ldrive_org(ld->cl_ldrive->fault_tolerance),
1832 ((ld->cl_ldrive->blocks_available / (1024 * 1024)) *
1833 ld->cl_ldrive->block_size));
1835 ciss_print_ldrive(sc, ld);
1840 ld->cl_status = CISS_LD_NONEXISTENT;
1841 if (ld->cl_ldrive != NULL) {
1842 free(ld->cl_ldrive, CISS_MALLOC_CLASS);
1843 ld->cl_ldrive = NULL;
1845 if (ld->cl_lstatus != NULL) {
1846 free(ld->cl_lstatus, CISS_MALLOC_CLASS);
1847 ld->cl_lstatus = NULL;
1862 ciss_get_ldrive_status(struct ciss_softc *sc, struct ciss_ldrive *ld)
1873 (void **)&ld->cl_lstatus,
1874 sizeof(*ld->cl_lstatus))) != 0)
1877 cc->header.address = *ld->cl_controller; /* target controller */
1879 cbc->log_drive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun);
1912 ld->cl_status = ciss_decode_ldrive_status(ld->cl_lstatus->status);
1948 ciss_accept_media(struct ciss_softc *sc, struct ciss_ldrive *ld)
1956 ldrive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun);
1967 cc->header.address = *ld->cl_controller; /* target controller */
3042 struct ciss_ldrive *ld;
3046 ld = NULL;
3048 ld = &sc->ciss_logical[bus][target];
3054 if (physical || ld->cl_geometry.fault_tolerance == 0xFF) {
3062 ccg->heads = ld->cl_geometry.heads;
3063 ccg->secs_per_track = ld->cl_geometry.sectors;
3064 ccg->cylinders = ntohs(ld->cl_geometry.cylinders);
3979 struct ciss_ldrive *ld;
3999 ld = &sc->ciss_logical[i][j];
4001 if (ld->cl_update == 0)
4004 if (ld->cl_status != CISS_LD_ONLINE) {
4006 ld->cl_update = 0;
4007 if (ld->cl_ldrive)
4008 free(ld->cl_ldrive, CISS_MALLOC_CLASS);
4009 if (ld->cl_lstatus)
4010 free(ld->cl_lstatus, CISS_MALLOC_CLASS);
4012 ld->cl_ldrive = NULL;
4013 ld->cl_lstatus = NULL;
4026 ld = &sc->ciss_logical[bus][target];
4028 if (ld->cl_update == 0)
4031 ld->cl_update = 0;
4032 ld->cl_address = cll->lun[i];
4033 ld->cl_controller = &sc->ciss_controllers[bus];
4034 if (ciss_identify_logical(sc, ld) == 0) {
4051 struct ciss_ldrive *ld;
4058 ld = &sc->ciss_logical[bus][target];
4066 cn->data.logical_status.logical_drive, ld->cl_name,
4076 ld->cl_status = ciss_decode_ldrive_status(cn->data.logical_status.new_state);
4077 if (ld->cl_lstatus != NULL)
4078 ld->cl_lstatus->status = cn->data.logical_status.new_state;
4083 if (ostatus != ld->cl_status) {
4084 ld->cl_update = 1;
4093 cn->data.logical_status.logical_drive, ld->cl_name);
4094 ciss_accept_media(sc, ld);
4096 ld->cl_update = 1;
4097 ld->cl_status = ciss_decode_ldrive_status(cn->data.logical_status.new_state);
4105 ld->cl_name,
4115 ld->cl_name,
4126 ld->cl_name);
4338 ciss_print_ldrive(struct ciss_softc *sc, struct ciss_ldrive *ld)
4342 if (ld->cl_lstatus == NULL) {
4348 switch(ld->cl_lstatus->status) {
4359 bus = CISS_BIG_MAP_BUS(sc, ld->cl_lstatus->drive_rebuilding);
4360 target = CISS_BIG_MAP_BUS(sc, ld->cl_lstatus->drive_rebuilding);
4362 bus, target, ld->cl_lstatus->blocks_to_recover);
4366 ld->cl_lstatus->blocks_to_recover);
4387 bus = CISS_BIG_MAP_BUS(sc, ld->cl_lstatus->drive_failure_map[i]);
4388 target = CISS_BIG_MAP_TARGET(sc, ld->cl_lstatus->drive_failure_map[i]);
4392 ld->cl_lstatus->drive_failure_map[i]);