Lines Matching refs:pcidev
163 NES_IDX_DST_IP_ADDR+(0x10*PCI_FUNC(nesdev->pcidev->devfn)), 0); in nes_inetaddr_event()
190 NES_IDX_DST_IP_ADDR+(0x10*PCI_FUNC(nesdev->pcidev->devfn)), in nes_inetaddr_event()
276 pci_free_consistent(nesdev->pcidev, nesqp->qp_mem_size, in nes_cqp_rem_ref_callback()
281 pci_free_consistent(nesdev->pcidev, 256, nesqp->pbl_vbase, nesqp->pbl_pbase); in nes_cqp_rem_ref_callback()
285 pci_free_consistent(nesdev->pcidev, nesqp->qp_mem_size, in nes_cqp_rem_ref_callback()
448 static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) in nes_probe() argument
456 assert(pcidev != NULL); in nes_probe()
460 DRV_VERSION, pci_name(pcidev)); in nes_probe()
462 ret = pci_enable_device(pcidev); in nes_probe()
464 printk(KERN_ERR PFX "Unable to enable PCI device. (%s)\n", pci_name(pcidev)); in nes_probe()
469 (long unsigned int)pci_resource_start(pcidev, BAR_0), in nes_probe()
470 (long unsigned int)pci_resource_len(pcidev, BAR_0)); in nes_probe()
472 (long unsigned int)pci_resource_start(pcidev, BAR_1), in nes_probe()
473 (long unsigned int)pci_resource_len(pcidev, BAR_1)); in nes_probe()
476 if (!(pci_resource_flags(pcidev, BAR_0) & IORESOURCE_MEM) || in nes_probe()
477 !(pci_resource_flags(pcidev, BAR_1) & IORESOURCE_MEM)) { in nes_probe()
484 ret = pci_request_regions(pcidev, DRV_NAME); in nes_probe()
486 printk(KERN_ERR PFX "Unable to request regions. (%s)\n", pci_name(pcidev)); in nes_probe()
491 ret = pci_set_dma_mask(pcidev, DMA_BIT_MASK(64)); in nes_probe()
496 ret = pci_set_consistent_dma_mask(pcidev, DMA_BIT_MASK(64)); in nes_probe()
502 ret = pci_set_dma_mask(pcidev, DMA_BIT_MASK(32)); in nes_probe()
507 ret = pci_set_consistent_dma_mask(pcidev, DMA_BIT_MASK(32)); in nes_probe()
514 pci_set_master(pcidev); in nes_probe()
519 printk(KERN_ERR PFX "%s: Unable to alloc hardware struct\n", pci_name(pcidev)); in nes_probe()
525 nesdev->pcidev = pcidev; in nes_probe()
526 pci_set_drvdata(pcidev, nesdev); in nes_probe()
528 pci_read_config_byte(pcidev, 0x0008, &hw_rev); in nes_probe()
534 mmio_regs = ioremap_nocache(pci_resource_start(pcidev, BAR_0), in nes_probe()
535 pci_resource_len(pcidev, BAR_0)); in nes_probe()
542 nesdev->index_reg = 0x50 + (PCI_FUNC(pcidev->devfn)*8) + mmio_regs; in nes_probe()
548 if (!pci_enable_msi(nesdev->pcidev)) { in nes_probe()
551 pci_name(pcidev)); in nes_probe()
554 pci_name(pcidev)); in nes_probe()
558 pci_name(pcidev)); in nes_probe()
561 nesdev->csr_start = pci_resource_start(nesdev->pcidev, BAR_0); in nes_probe()
562 nesdev->doorbell_region = pci_resource_start(nesdev->pcidev, BAR_1); in nes_probe()
579 switch (PCI_FUNC(nesdev->pcidev->devfn) % in nes_probe()
595 nesdev->mac_index = PCI_FUNC(nesdev->pcidev->devfn) % in nes_probe()
602 (pcie_get_readrq(pcidev) > 256)) { in nes_probe()
603 if (pcie_set_readrq(pcidev, 256)) in nes_probe()
621 PCI_FUNC(nesdev->pcidev->devfn)); in nes_probe()
625 nesdev->int_req = (0x101 << PCI_FUNC(nesdev->pcidev->devfn)) | in nes_probe()
626 (1 << (PCI_FUNC(nesdev->pcidev->devfn)+16)); in nes_probe()
627 if (PCI_FUNC(nesdev->pcidev->devfn) < 4) { in nes_probe()
632 if (PCI_FUNC(nesdev->pcidev->devfn) == 0) { in nes_probe()
639 nesdev->intf_int_req |= (1 << (PCI_FUNC(nesdev->pcidev->devfn)+16)); in nes_probe()
648 nesdev->timer_int_req = 0x101 << PCI_FUNC(nesdev->pcidev->devfn); in nes_probe()
651 PCI_FUNC(nesdev->pcidev->devfn), in nes_probe()
659 ret = request_irq(pcidev->irq, nes_interrupt, IRQF_SHARED, DRV_NAME, nesdev); in nes_probe()
662 pci_name(pcidev), pcidev->irq); in nes_probe()
697 pci_name(pcidev)); in nes_probe()
724 free_irq(pcidev->irq, nesdev); in nes_probe()
726 pci_disable_msi(pcidev); in nes_probe()
743 pci_release_regions(pcidev); in nes_probe()
746 pci_disable_device(pcidev); in nes_probe()
756 static void nes_remove(struct pci_dev *pcidev) in nes_remove() argument
758 struct nes_device *nesdev = pci_get_drvdata(pcidev); in nes_remove()
785 free_irq(pcidev->irq, nesdev); in nes_remove()
800 pci_disable_msi(pcidev); in nes_remove()
807 pci_release_regions(pcidev); in nes_remove()
808 pci_disable_device(pcidev); in nes_remove()
809 pci_set_drvdata(pcidev, NULL); in nes_remove()
829 devfn = nesdev->pcidev->devfn; in nes_show_adapter()
830 bus_number = nesdev->pcidev->bus->number; in nes_show_adapter()