Lines Matching +full:serial +full:- +full:state
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
105 if (pinfo->encl_device_id == 0xffff) in mfi_drive_name()
107 pinfo->slot_number); in mfi_drive_name()
108 else if (pinfo->encl_device_id == pinfo->ref.v.device_id) in mfi_drive_name()
110 pinfo->encl_index); in mfi_drive_name()
113 pinfo->encl_index, pinfo->slot_number); in mfi_drive_name()
121 mfi_pdstate(enum mfi_pd_state state) in mfi_pdstate() argument
125 switch (state) { in mfi_pdstate()
145 sprintf(buf, "PSTATE 0x%04x", state); in mfi_pdstate()
199 for (i = 0; i < list->count; i++) { in mfi_lookup_drive()
200 if (list->addr[i].scsi_dev_type != 0) in mfi_lookup_drive()
204 list->addr[i].encl_device_id == 0xffff) || in mfi_lookup_drive()
205 list->addr[i].encl_index == encl) && in mfi_lookup_drive()
206 list->addr[i].slot_number == slot) { in mfi_lookup_drive()
207 *device_id = list->addr[i].device_id; in mfi_lookup_drive()
234 mbox[0] = ref->v.device_id & 0xff; in mbox_store_pdref()
235 mbox[1] = ref->v.device_id >> 8; in mbox_store_pdref()
236 mbox[2] = ref->v.seq_num & 0xff; in mbox_store_pdref()
237 mbox[3] = ref->v.seq_num >> 8; in mbox_store_pdref()
255 return (-1); in mfi_pd_get_list()
259 return (-1); in mfi_pd_get_list()
262 if (list->size > list_size) { in mfi_pd_get_list()
263 list_size = list->size; in mfi_pd_get_list()
288 src++, srclen--; in cam_strvis()
290 && (src[srclen-1] == ' ' || src[srclen-1] == '\0')) in cam_strvis()
291 srclen--; in cam_strvis()
297 /* SCSI-II Specifies that these should never occur. */ in cam_strvis()
298 /* non-printable character */ in cam_strvis()
312 srclen--; in cam_strvis()
313 dstlen -= cur_pos - dst; in cam_strvis()
324 char vendor[16], product[48], revision[16], rstr[12], serial[SID_VENDOR_SPECIFIC_0_SIZE]; in mfi_pd_inq_string() local
327 memcpy(inq_data, info->inquiry_data, in mfi_pd_inq_string()
328 (sizeof (iqd) < sizeof (info->inquiry_data))? in mfi_pd_inq_string()
329 sizeof (iqd) : sizeof (info->inquiry_data)); in mfi_pd_inq_string()
337 cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), in mfi_pd_inq_string()
339 cam_strvis(product, inq_data->product, sizeof(inq_data->product), in mfi_pd_inq_string()
341 cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision), in mfi_pd_inq_string()
343 cam_strvis(serial, (char *)inq_data->vendor_specific0, sizeof(inq_data->vendor_specific0), in mfi_pd_inq_string()
344 sizeof(serial)); in mfi_pd_inq_string()
348 snprintf(inq_string, sizeof(inq_string), "<%s %s serial=%s> SATA", in mfi_pd_inq_string()
349 product, revision, serial); in mfi_pd_inq_string()
355 strcpy(rstr, "SCSI-CCS"); in mfi_pd_inq_string()
361 snprintf(rstr, sizeof (rstr), "SCSI-%d", in mfi_pd_inq_string()
365 snprintf(inq_string, sizeof(inq_string), "<%s %s %s serial=%s> %s", vendor, in mfi_pd_inq_string()
366 product, revision, serial, rstr); in mfi_pd_inq_string()
370 /* Helper function to set a drive to a given state. */
400 /* Try to change the state. */ in drive_set_state()
402 warnx("Drive %u is already in the desired state", device_id); in drive_set_state()
515 /* Check the state, must be REBUILD. */ in start_rebuild()
517 warnx("Drive %d is not in the REBUILD state", device_id); in start_rebuild()
572 /* Check the state, must be REBUILD. */ in abort_rebuild()
574 warn("Drive %d is not in the REBUILD state", device_id); in abort_rebuild()
719 "drive and state required"); in drive_locate()
729 warnx("locate: invalid state %s", av[2]); in drive_locate()