Lines Matching refs:ndev
637 struct nvme_dev *ndev = dev_get_priv(udev->parent); in nvme_blk_probe() local
646 ns->dev = ndev; in nvme_blk_probe()
649 if (nvme_identify(ndev, ns->ns_id, 0, (dma_addr_t)id)) in nvme_blk_probe()
657 list_add(&ns->list, &ndev->namespaces); in nvme_blk_probe()
665 memcpy(desc->product, ndev->serial, sizeof(ndev->serial)); in nvme_blk_probe()
666 memcpy(desc->revision, ndev->firmware_rev, sizeof(ndev->firmware_rev)); in nvme_blk_probe()
771 struct nvme_dev *ndev = dev_get_priv(udev); in nvme_probe() local
773 ndev->instance = trailing_strtol(udev->name); in nvme_probe()
775 INIT_LIST_HEAD(&ndev->namespaces); in nvme_probe()
776 ndev->bar = dm_pci_map_bar(udev, PCI_BASE_ADDRESS_0, in nvme_probe()
778 if (readl(&ndev->bar->csts) == -1) { in nvme_probe()
784 ndev->queues = malloc(NVME_Q_NUM * sizeof(struct nvme_queue *)); in nvme_probe()
785 if (!ndev->queues) { in nvme_probe()
790 memset(ndev->queues, 0, NVME_Q_NUM * sizeof(struct nvme_queue *)); in nvme_probe()
792 ndev->prp_pool = malloc(MAX_PRP_POOL); in nvme_probe()
793 if (!ndev->prp_pool) { in nvme_probe()
798 ndev->prp_entry_num = MAX_PRP_POOL >> 3; in nvme_probe()
800 ndev->cap = nvme_readq(&ndev->bar->cap); in nvme_probe()
801 ndev->q_depth = min_t(int, NVME_CAP_MQES(ndev->cap) + 1, NVME_Q_DEPTH); in nvme_probe()
802 ndev->db_stride = 1 << NVME_CAP_STRIDE(ndev->cap); in nvme_probe()
803 ndev->dbs = ((void __iomem *)ndev->bar) + 4096; in nvme_probe()
805 ret = nvme_configure_admin_queue(ndev); in nvme_probe()
809 ret = nvme_setup_io_queues(ndev); in nvme_probe()
813 nvme_get_info_from_identify(ndev); in nvme_probe()
818 free((void *)ndev->queues); in nvme_probe()