Commit c6ae008d authored by Xiaodong Liu's avatar Xiaodong Liu Committed by Changpeng Liu
Browse files

lnvm: add a quirk for identify LightNVM device

parent 269a4790
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -99,6 +99,13 @@ extern pid_t g_spdk_nvme_pid;
 */
#define NVME_QUIRK_IDENTIFY_CNS 0x40

/*
 * The controller supports LightNVM command set if matching additional
 * condition, like the first byte (value 0x1) in the vendor specific
 * bits of the namespace identify structure is set.
 */
#define NVME_QUIRK_LIGHTNVM 0x80

#define NVME_MAX_ASYNC_EVENTS	(8)

#define NVME_MIN_TIMEOUT_PERIOD		(5)
+3 −1
Original line number Diff line number Diff line
@@ -73,7 +73,8 @@ static const struct nvme_quirk nvme_quirks[] = {
		NVME_QUIRK_IDENTIFY_CNS
	},
	{	{SPDK_PCI_VID_CNEXLABS, 0x1f1f, SPDK_PCI_ANY_ID, SPDK_PCI_ANY_ID},
		NVME_QUIRK_IDENTIFY_CNS
		NVME_QUIRK_IDENTIFY_CNS |
		NVME_QUIRK_LIGHTNVM
	},
	{	{0x0000, 0x0000, 0x0000, 0x0000}, 0}
};
@@ -120,6 +121,7 @@ nvme_get_quirks(const struct spdk_pci_id *id)
			PRINT_QUIRK(NVME_QUIRK_DELAY_AFTER_QUEUE_ALLOC);
			PRINT_QUIRK(NVME_QUIRK_READ_ZERO_AFTER_DEALLOCATE);
			PRINT_QUIRK(NVME_QUIRK_IDENTIFY_CNS);
			PRINT_QUIRK(NVME_QUIRK_LIGHTNVM);

			return quirk->flags;
		}