Lines Matching +full:mbox +full:-

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()
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()
223 mbox_store_device_id(uint8_t *mbox, uint16_t device_id) in mbox_store_device_id() argument
226 mbox[0] = device_id & 0xff; in mbox_store_device_id()
227 mbox[1] = device_id >> 8; in mbox_store_device_id()
231 mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref) in mbox_store_pdref() argument
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()
275 uint8_t mbox[2]; in mfi_pd_get_info() local
277 mbox_store_device_id(&mbox[0], device_id); in mfi_pd_get_info()
279 sizeof(struct mfi_pd_info), mbox, 2, statusp)); in mfi_pd_get_info()
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()
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()
355 strcpy(rstr, "SCSI-CCS"); in mfi_pd_inq_string()
361 snprintf(rstr, sizeof (rstr), "SCSI-%d", in mfi_pd_inq_string()
376 uint8_t mbox[6]; in drive_set_state() local
407 mbox_store_pdref(&mbox[0], &info.ref); in drive_set_state()
408 mbox[4] = new_state & 0xff; in drive_set_state()
409 mbox[5] = new_state >> 8; in drive_set_state()
410 if (mfi_dcmd_command(fd, MFI_DCMD_PD_STATE_SET, NULL, 0, mbox, 6, in drive_set_state()
485 uint8_t mbox[4]; in start_rebuild() local
523 mbox_store_pdref(&mbox[0], &info.ref); in start_rebuild()
524 if (mfi_dcmd_command(fd, MFI_DCMD_PD_REBUILD_START, NULL, 0, mbox, 4, in start_rebuild()
542 uint8_t mbox[4]; in abort_rebuild() local
580 mbox_store_pdref(&mbox[0], &info.ref); in abort_rebuild()
581 if (mfi_dcmd_command(fd, MFI_DCMD_PD_REBUILD_ABORT, NULL, 0, mbox, 4, in abort_rebuild()
652 uint8_t mbox[4]; in drive_clear() local
694 mbox_store_pdref(&mbox[0], &info.ref); in drive_clear()
695 if (mfi_dcmd_command(fd, opcode, NULL, 0, mbox, 4, NULL) < 0) { in drive_clear()
715 uint8_t mbox[4]; in drive_locate() local
747 mbox_store_device_id(&mbox[0], device_id); in drive_locate()
748 mbox[2] = 0; in drive_locate()
749 mbox[3] = 0; in drive_locate()
750 if (mfi_dcmd_command(fd, opcode, NULL, 0, mbox, 4, NULL) < 0) { in drive_locate()