Lines Matching refs:dev_scsi

320 static int per_dev_options(struct scsi_id_device *dev_scsi, int *good_bad, int *page_code) {  in per_dev_options()  argument
369 static int set_inq_values(struct scsi_id_device *dev_scsi, const char *path) { in set_inq_values() argument
372 dev_scsi->use_sg = sg_version; in set_inq_values()
374 retval = scsi_std_inquiry(dev_scsi, path); in set_inq_values()
378 encode_devnode_name(dev_scsi->vendor, vendor_enc_str, sizeof(vendor_enc_str)); in set_inq_values()
379 encode_devnode_name(dev_scsi->model, model_enc_str, sizeof(model_enc_str)); in set_inq_values()
381 udev_replace_whitespace(dev_scsi->vendor, vendor_str, sizeof(vendor_str)-1); in set_inq_values()
383 udev_replace_whitespace(dev_scsi->model, model_str, sizeof(model_str)-1); in set_inq_values()
385 set_type(dev_scsi->type, type_str, sizeof(type_str)); in set_inq_values()
386 udev_replace_whitespace(dev_scsi->revision, revision_str, sizeof(revision_str)-1); in set_inq_values()
396 struct scsi_id_device dev_scsi = {}; in scsi_id() local
401 if (set_inq_values(&dev_scsi, maj_min_dev) < 0) { in scsi_id()
407 per_dev_options(&dev_scsi, &good_dev, &page_code); in scsi_id()
414 scsi_get_serial(&dev_scsi, maj_min_dev, page_code, MAX_SERIAL_LEN); in scsi_id()
426 if (dev_scsi.serial[0] != '\0') { in scsi_id()
427 udev_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str)-1); in scsi_id()
430 … udev_replace_whitespace(dev_scsi.serial_short, serial_str, sizeof(serial_str)-1); in scsi_id()
434 if (dev_scsi.wwn[0] != '\0') { in scsi_id()
435 printf("ID_WWN=0x%s\n", dev_scsi.wwn); in scsi_id()
436 if (dev_scsi.wwn_vendor_extension[0] != '\0') { in scsi_id()
437 … printf("ID_WWN_VENDOR_EXTENSION=0x%s\n", dev_scsi.wwn_vendor_extension); in scsi_id()
438 … printf("ID_WWN_WITH_EXTENSION=0x%s%s\n", dev_scsi.wwn, dev_scsi.wwn_vendor_extension); in scsi_id()
440 printf("ID_WWN_WITH_EXTENSION=0x%s\n", dev_scsi.wwn); in scsi_id()
442 if (dev_scsi.tgpt_group[0] != '\0') in scsi_id()
443 printf("ID_TARGET_PORT=%s\n", dev_scsi.tgpt_group); in scsi_id()
444 if (dev_scsi.unit_serial_number[0] != '\0') in scsi_id()
445 printf("ID_SCSI_SERIAL=%s\n", dev_scsi.unit_serial_number); in scsi_id()
449 if (dev_scsi.serial[0] == '\0') { in scsi_id()
457 udev_replace_whitespace(dev_scsi.serial, serial_str, sizeof(serial_str)-1); in scsi_id()
463 printf("%s\n", dev_scsi.serial); in scsi_id()