Lines Matching defs:device_id

55  * both).  We prefer pinfo if given, otherwise try to look it up by device_id.
58 mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id, uint32_t def)
72 if (device_id == 0xffff)
75 snprintf(buf, sizeof(buf), "%2u", device_id);
84 if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
85 warn("Failed to fetch info for drive %2u", device_id);
97 if (device_id == 0xffff)
100 error = snprintf(p, len, "%2u", device_id);
117 else if (pinfo->encl_device_id == pinfo->ref.v.device_id)
163 mfi_lookup_drive(int fd, char *drive, uint16_t *device_id)
177 *device_id = val;
219 *device_id = list->addr[i].device_id;
235 mbox_store_device_id(uint8_t *mbox, uint16_t device_id)
238 mbox[0] = device_id & 0xff;
239 mbox[1] = device_id >> 8;
246 mbox[0] = ref->v.device_id & 0xff;
247 mbox[1] = ref->v.device_id >> 8;
284 mfi_pd_get_info(int fd, uint16_t device_id, struct mfi_pd_info *info,
289 mbox_store_device_id(&mbox[0], device_id);
387 uint16_t device_id;
398 error = mfi_lookup_drive(fd, drive, &device_id);
405 if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
407 warn("Failed to fetch info for drive %u", device_id);
414 warnx("Drive %u is already in the desired state", device_id);
425 warn("Failed to set drive %u to %s", device_id,
496 uint16_t device_id;
513 error = mfi_lookup_drive(fd, av[1], &device_id);
520 if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
522 warn("Failed to fetch info for drive %u", device_id);
529 warnx("Drive %d is not in the REBUILD state", device_id);
539 warn("Failed to start rebuild on drive %u", device_id);
553 uint16_t device_id;
570 error = mfi_lookup_drive(fd, av[1], &device_id);
577 if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
579 warn("Failed to fetch info for drive %u", device_id);
586 warn("Drive %d is not in the REBUILD state", device_id);
596 warn("Failed to abort rebuild on drive %u", device_id);
610 uint16_t device_id;
626 error = mfi_lookup_drive(fd, av[1], &device_id);
633 if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
635 warn("Failed to fetch info for drive %u", device_id);
651 mfi_drive_name(NULL, device_id,
663 uint16_t device_id;
692 error = mfi_lookup_drive(fd, av[1], &device_id);
699 if (mfi_pd_get_info(fd, device_id, &info, NULL) < 0) {
701 warn("Failed to fetch info for drive %u", device_id);
711 device_id);
724 uint16_t device_id;
752 error = mfi_lookup_drive(fd, av[1], &device_id);
759 mbox_store_device_id(&mbox[0], device_id);
766 device_id);