Lines Matching +full:revision +full:- +full:id

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
16 * 3. Neither the name of the author nor the names of any co-contributors
55 switch (info->PhysDiskStatus.State) { in mpt_pdstate()
57 if ((info->PhysDiskStatus.Flags & in mpt_pdstate()
59 info->PhysDiskSettings.HotSparePool == 0) in mpt_pdstate()
78 sprintf(buf, "PSTATE 0x%02x", info->PhysDiskStatus.State); in mpt_pdstate()
88 * - IOC2 : This gives us a list of volumes, and by walking the volumes we
91 * - IOC3 : This gives us a list of all online physical drives including
94 * - IOC5 : This gives us a list of all spare drives including failed
116 for (i = 0; i < list->ndrives; i++) { in mpt_pd_insert()
117 if (list->drives[i]->PhysDiskNum == PhysDiskNum) in mpt_pd_insert()
119 if (list->drives[i]->PhysDiskNum > PhysDiskNum) in mpt_pd_insert()
127 for (j = list->ndrives - 1; j >= i; j--) in mpt_pd_insert()
128 list->drives[j + 1] = list->drives[j]; in mpt_pd_insert()
129 list->drives[i] = mpt_pd_info(fd, PhysDiskNum, NULL); in mpt_pd_insert()
130 if (list->drives[i] == NULL) in mpt_pd_insert()
132 list->ndrives++; in mpt_pd_insert()
182 volumes = malloc(sizeof(*volumes) * ioc2->NumActiveVolumes); in mpt_pd_list()
184 vol = ioc2->RaidVolume; in mpt_pd_list()
185 for (i = 0; i < ioc2->NumActiveVolumes; vol++, i++) { in mpt_pd_list()
186 volumes[i] = mpt_vol_info(fd, vol->VolumeBus, vol->VolumeID, in mpt_pd_list()
198 count += volumes[i]->NumPhysDisks; in mpt_pd_list()
200 count += ioc3->NumPhysDisks; in mpt_pd_list()
201 count += ioc5->NumHotSpares; in mpt_pd_list()
207 for (i = 0; i < ioc2->NumActiveVolumes; i++) { in mpt_pd_list()
208 rdisk = volumes[i]->PhysDisk; in mpt_pd_list()
209 for (j = 0; j < volumes[i]->NumPhysDisks; rdisk++, j++) in mpt_pd_list()
210 if (mpt_pd_insert(fd, list, rdisk->PhysDiskNum) < 0) { in mpt_pd_list()
223 spare = ioc5->HotSpare; in mpt_pd_list()
224 for (i = 0; i < ioc5->NumHotSpares; spare++, i++) in mpt_pd_list()
225 if (mpt_pd_insert(fd, list, spare->PhysDiskNum) < 0) { in mpt_pd_list()
233 disk = ioc3->PhysDisk; in mpt_pd_list()
234 for (i = 0; i < ioc3->NumPhysDisks; disk++, i++) in mpt_pd_list()
235 if (mpt_pd_insert(fd, list, disk->PhysDiskNum) < 0) { in mpt_pd_list()
250 for (i = 0; i < list->ndrives; i++) in mpt_free_pd_list()
251 free(list->drives[i]); in mpt_free_pd_list()
260 uint8_t bus, id; in mpt_lookup_drive() local
263 /* Look for a raw device id first. */ in mpt_lookup_drive()
272 /* Look for a <bus>:<id> string. */ in mpt_lookup_drive()
282 id = val; in mpt_lookup_drive()
284 for (val = 0; val < list->ndrives; val++) { in mpt_lookup_drive()
285 if (list->drives[val]->PhysDiskBus == bus && in mpt_lookup_drive()
286 list->drives[val]->PhysDiskID == id) { in mpt_lookup_drive()
287 *PhysDiskNum = list->drives[val]->PhysDiskNum; in mpt_lookup_drive()
303 u_char vendor[9], product[17], revision[5]; in mpt_pd_inq_string() local
306 inq_data = &pd_info->InquiryData; in mpt_pd_inq_string()
307 cam_strvis(vendor, inq_data->VendorID, sizeof(inq_data->VendorID), in mpt_pd_inq_string()
309 cam_strvis(product, inq_data->ProductID, sizeof(inq_data->ProductID), in mpt_pd_inq_string()
311 cam_strvis(revision, inq_data->ProductRevLevel, in mpt_pd_inq_string()
312 sizeof(inq_data->ProductRevLevel), sizeof(revision)); in mpt_pd_inq_string()
317 product, revision); in mpt_pd_inq_string()
320 vendor, product, revision); in mpt_pd_inq_string()
364 if (info->PhysDiskStatus.State == State) { in drive_set_state()