Lines Matching refs:inq_response
672 struct sg_io_hdr *hdr, u8 *inq_response, in nvme_trans_standard_inquiry_page() argument
713 memset(inq_response, 0, STANDARD_INQUIRY_LENGTH); in nvme_trans_standard_inquiry_page()
714 inq_response[2] = VERSION_SPC_4; in nvme_trans_standard_inquiry_page()
715 inq_response[3] = resp_data_format; /*normaca=0 | hisup=0 */ in nvme_trans_standard_inquiry_page()
716 inq_response[4] = ADDITIONAL_STD_INQ_LENGTH; in nvme_trans_standard_inquiry_page()
717 inq_response[5] = protect; /* sccs=0 | acc=0 | tpgs=0 | pc3=0 */ in nvme_trans_standard_inquiry_page()
718 inq_response[7] = cmdque; /* wbus16=0 | sync=0 | vs=0 */ in nvme_trans_standard_inquiry_page()
719 strncpy(&inq_response[8], "NVMe ", 8); in nvme_trans_standard_inquiry_page()
720 strncpy(&inq_response[16], dev->model, 16); in nvme_trans_standard_inquiry_page()
725 strncpy(&inq_response[32], dev->firmware_rev + fw_offset, 4); in nvme_trans_standard_inquiry_page()
728 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); in nvme_trans_standard_inquiry_page()
738 struct sg_io_hdr *hdr, u8 *inq_response, in nvme_trans_supported_vpd_pages() argument
744 memset(inq_response, 0, STANDARD_INQUIRY_LENGTH); in nvme_trans_supported_vpd_pages()
745 inq_response[1] = INQ_SUPPORTED_VPD_PAGES_PAGE; /* Page Code */ in nvme_trans_supported_vpd_pages()
746 inq_response[3] = INQ_NUM_SUPPORTED_VPD_PAGES; /* Page Length */ in nvme_trans_supported_vpd_pages()
747 inq_response[4] = INQ_SUPPORTED_VPD_PAGES_PAGE; in nvme_trans_supported_vpd_pages()
748 inq_response[5] = INQ_UNIT_SERIAL_NUMBER_PAGE; in nvme_trans_supported_vpd_pages()
749 inq_response[6] = INQ_DEVICE_IDENTIFICATION_PAGE; in nvme_trans_supported_vpd_pages()
750 inq_response[7] = INQ_EXTENDED_INQUIRY_DATA_PAGE; in nvme_trans_supported_vpd_pages()
751 inq_response[8] = INQ_BDEV_CHARACTERISTICS_PAGE; in nvme_trans_supported_vpd_pages()
752 inq_response[9] = INQ_BDEV_LIMITS_PAGE; in nvme_trans_supported_vpd_pages()
755 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); in nvme_trans_supported_vpd_pages()
761 struct sg_io_hdr *hdr, u8 *inq_response, in nvme_trans_unit_serial_page() argument
768 memset(inq_response, 0, STANDARD_INQUIRY_LENGTH); in nvme_trans_unit_serial_page()
769 inq_response[1] = INQ_UNIT_SERIAL_NUMBER_PAGE; /* Page Code */ in nvme_trans_unit_serial_page()
770 inq_response[3] = INQ_SERIAL_NUMBER_LENGTH; /* Page Length */ in nvme_trans_unit_serial_page()
771 strncpy(&inq_response[4], dev->serial, INQ_SERIAL_NUMBER_LENGTH); in nvme_trans_unit_serial_page()
774 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); in nvme_trans_unit_serial_page()
780 u8 *inq_response, int alloc_len) in nvme_trans_device_id_page() argument
797 memset(inq_response, 0, alloc_len); in nvme_trans_device_id_page()
798 inq_response[1] = INQ_DEVICE_IDENTIFICATION_PAGE; /* Page Code */ in nvme_trans_device_id_page()
822 inq_response[3] = 4 + len; /* Page Length */ in nvme_trans_device_id_page()
824 inq_response[4] = 0x01; /* Proto ID=0h | Code set=1h */ in nvme_trans_device_id_page()
825 inq_response[5] = 0x02; /* PIV=0b | Asso=00b | Designator Type=2h */ in nvme_trans_device_id_page()
826 inq_response[6] = 0x00; /* Rsvd */ in nvme_trans_device_id_page()
827 inq_response[7] = len; /* Designator Length */ in nvme_trans_device_id_page()
828 memcpy(&inq_response[8], eui, len); in nvme_trans_device_id_page()
838 inq_response[3] = 0x48; /* Page Length */ in nvme_trans_device_id_page()
840 inq_response[4] = 0x03; /* Proto ID=0h | Code set=3h */ in nvme_trans_device_id_page()
841 inq_response[5] = 0x08; /* PIV=0b | Asso=00b | Designator Type=8h */ in nvme_trans_device_id_page()
842 inq_response[6] = 0x00; /* Rsvd */ in nvme_trans_device_id_page()
843 inq_response[7] = 0x44; /* Designator Length */ in nvme_trans_device_id_page()
845 sprintf(&inq_response[8], "%04x", dev->pci_dev->vendor); in nvme_trans_device_id_page()
846 memcpy(&inq_response[12], dev->model, sizeof(dev->model)); in nvme_trans_device_id_page()
847 sprintf(&inq_response[52], "%04x", tmp_id); in nvme_trans_device_id_page()
848 memcpy(&inq_response[56], dev->serial, sizeof(dev->serial)); in nvme_trans_device_id_page()
851 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); in nvme_trans_device_id_page()
863 u8 *inq_response; in nvme_trans_ext_inq_page() local
880 inq_response = kmalloc(EXTENDED_INQUIRY_DATA_PAGE_LENGTH, GFP_KERNEL); in nvme_trans_ext_inq_page()
881 if (inq_response == NULL) { in nvme_trans_ext_inq_page()
921 memset(inq_response, 0, EXTENDED_INQUIRY_DATA_PAGE_LENGTH); in nvme_trans_ext_inq_page()
922 inq_response[1] = INQ_EXTENDED_INQUIRY_DATA_PAGE; /* Page Code */ in nvme_trans_ext_inq_page()
923 inq_response[2] = 0x00; /* Page Length MSB */ in nvme_trans_ext_inq_page()
924 inq_response[3] = 0x3C; /* Page Length LSB */ in nvme_trans_ext_inq_page()
925 inq_response[4] = microcode | spt | grd_chk | app_chk | ref_chk; in nvme_trans_ext_inq_page()
926 inq_response[5] = uask_sup; in nvme_trans_ext_inq_page()
927 inq_response[6] = v_sup; in nvme_trans_ext_inq_page()
928 inq_response[7] = luiclr; in nvme_trans_ext_inq_page()
929 inq_response[8] = 0; in nvme_trans_ext_inq_page()
930 inq_response[9] = 0; in nvme_trans_ext_inq_page()
933 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); in nvme_trans_ext_inq_page()
939 kfree(inq_response); in nvme_trans_ext_inq_page()
945 u8 *inq_response, int alloc_len) in nvme_trans_bdev_limits_page() argument
952 memset(inq_response, 0, STANDARD_INQUIRY_LENGTH); in nvme_trans_bdev_limits_page()
953 inq_response[1] = VPD_BLOCK_LIMITS; in nvme_trans_bdev_limits_page()
954 inq_response[3] = 0x3c; /* Page Length */ in nvme_trans_bdev_limits_page()
955 memcpy(&inq_response[8], &max_sectors, sizeof(u32)); in nvme_trans_bdev_limits_page()
956 memcpy(&inq_response[20], &max_discard, sizeof(u32)); in nvme_trans_bdev_limits_page()
959 memcpy(&inq_response[24], &discard_desc_count, sizeof(u32)); in nvme_trans_bdev_limits_page()
961 return nvme_trans_copy_to_user(hdr, inq_response, 0x3c); in nvme_trans_bdev_limits_page()
967 u8 *inq_response; in nvme_trans_bdev_char_page() local
971 inq_response = kzalloc(EXTENDED_INQUIRY_DATA_PAGE_LENGTH, GFP_KERNEL); in nvme_trans_bdev_char_page()
972 if (inq_response == NULL) { in nvme_trans_bdev_char_page()
977 inq_response[1] = INQ_BDEV_CHARACTERISTICS_PAGE; /* Page Code */ in nvme_trans_bdev_char_page()
978 inq_response[2] = 0x00; /* Page Length MSB */ in nvme_trans_bdev_char_page()
979 inq_response[3] = 0x3C; /* Page Length LSB */ in nvme_trans_bdev_char_page()
980 inq_response[4] = 0x00; /* Medium Rotation Rate MSB */ in nvme_trans_bdev_char_page()
981 inq_response[5] = 0x01; /* Medium Rotation Rate LSB */ in nvme_trans_bdev_char_page()
982 inq_response[6] = 0x00; /* Form Factor */ in nvme_trans_bdev_char_page()
985 res = nvme_trans_copy_to_user(hdr, inq_response, xfer_len); in nvme_trans_bdev_char_page()
987 kfree(inq_response); in nvme_trans_bdev_char_page()
2254 u8 *inq_response; in nvme_trans_inquiry() local
2260 inq_response = kmalloc(max(alloc_len, STANDARD_INQUIRY_LENGTH), in nvme_trans_inquiry()
2262 if (inq_response == NULL) { in nvme_trans_inquiry()
2270 inq_response, alloc_len); in nvme_trans_inquiry()
2282 inq_response, alloc_len); in nvme_trans_inquiry()
2285 res = nvme_trans_unit_serial_page(ns, hdr, inq_response, in nvme_trans_inquiry()
2289 res = nvme_trans_device_id_page(ns, hdr, inq_response, in nvme_trans_inquiry()
2296 res = nvme_trans_bdev_limits_page(ns, hdr, inq_response, in nvme_trans_inquiry()
2311 kfree(inq_response); in nvme_trans_inquiry()