Lines Matching defs:pdev

495 	pci_write_config_dword(tp->pdev, TG3PCI_REG_BASE_ADDR, off);
496 pci_write_config_dword(tp->pdev, TG3PCI_REG_DATA, val);
512 pci_write_config_dword(tp->pdev, TG3PCI_REG_BASE_ADDR, off);
513 pci_read_config_dword(tp->pdev, TG3PCI_REG_DATA, &val);
523 pci_write_config_dword(tp->pdev, TG3PCI_RCV_RET_RING_CON_IDX +
528 pci_write_config_dword(tp->pdev, TG3PCI_STD_RING_PROD_IDX +
534 pci_write_config_dword(tp->pdev, TG3PCI_REG_BASE_ADDR, off + 0x5600);
535 pci_write_config_dword(tp->pdev, TG3PCI_REG_DATA, val);
543 pci_write_config_dword(tp->pdev, TG3PCI_MISC_LOCAL_CTRL,
554 pci_write_config_dword(tp->pdev, TG3PCI_REG_BASE_ADDR, off + 0x5600);
555 pci_read_config_dword(tp->pdev, TG3PCI_REG_DATA, &val);
635 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
636 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);
639 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
662 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, off);
663 pci_read_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);
666 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
755 if (pci_channel_offline(tp->pdev))
964 if (device_may_wakeup(&tp->pdev->dev) &&
1525 addr = ssb_gige_get_phyaddr(tp->pdev);
1542 snprintf(tp->mdio_bus->id, MII_BUS_ID_SIZE, "%x", pci_dev_id(tp->pdev));
1544 tp->mdio_bus->parent = &tp->pdev->dev;
1559 dev_warn(&tp->pdev->dev, "mdiobus_reg failed (0x%x)\n", i);
1567 dev_warn(&tp->pdev->dev, "No PHY devices\n");
1650 if (pci_channel_offline(tp->pdev))
1824 if (pci_channel_offline(tp->pdev))
1837 if (pci_channel_offline(tp->pdev)) {
2099 dev_err(&tp->pdev->dev, "Could not attach to PHY\n");
2871 } else if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761 ||
2872 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5761S) {
2975 if (tp->pdev_peer && tp->pdev_peer != tp->pdev) {
3591 if (pci_channel_offline(tp->pdev))
3999 pci_write_config_dword(tp->pdev,
4009 err = pci_set_power_state(tp->pdev, PCI_D0);
4031 pcie_capability_set_word(tp->pdev, PCI_EXP_LNKCTL,
4038 device_should_wake = device_may_wakeup(&tp->pdev->dev) &&
4271 pci_wake_from_d3(tp->pdev, tg3_flag(tp, WOL_ENABLE));
4272 pci_set_power_state(tp->pdev, PCI_D3hot);
5075 pcie_capability_clear_word(tp->pdev, PCI_EXP_LNKCTL,
5078 pcie_capability_set_word(tp->pdev, PCI_EXP_LNKCTL,
6445 if (tp->pdev->error_state != pci_channel_io_normal) {
6567 dma_unmap_single(&tp->pdev->dev, dma_unmap_addr(ri, mapping),
6585 dma_unmap_page(&tp->pdev->dev,
6647 dma_unmap_single(&tp->pdev->dev, dma_unmap_addr(ri, mapping), map_sz,
6712 mapping = dma_map_single(&tp->pdev->dev, data + TG3_RX_OFFSET(tp),
6714 if (unlikely(dma_mapping_error(&tp->pdev->dev, mapping))) {
6881 dma_unmap_single(&tp->pdev->dev, dma_addr, skb_size,
6910 dma_sync_single_for_cpu(&tp->pdev->dev, dma_addr, len,
6915 dma_sync_single_for_device(&tp->pdev->dev, dma_addr,
7766 dma_unmap_single(&tnapi->tp->pdev->dev, dma_unmap_addr(txb, mapping),
7781 dma_unmap_page(&tnapi->tp->pdev->dev,
7818 new_addr = dma_map_single(&tp->pdev->dev, new_skb->data,
7821 if (dma_mapping_error(&tp->pdev->dev, new_addr)) {
8047 mapping = dma_map_single(&tp->pdev->dev, skb->data, len,
8049 if (dma_mapping_error(&tp->pdev->dev, mapping))
8081 mapping = skb_frag_dma_map(&tp->pdev->dev, frag, 0,
8087 if (dma_mapping_error(&tp->pdev->dev, mapping))
8482 dma_free_coherent(&tp->pdev->dev, TG3_RX_STD_RING_BYTES(tp),
8487 dma_free_coherent(&tp->pdev->dev, TG3_RX_JMB_RING_BYTES(tp),
8501 tpr->rx_std = dma_alloc_coherent(&tp->pdev->dev,
8514 tpr->rx_jmb = dma_alloc_coherent(&tp->pdev->dev,
8613 dma_free_coherent(&tp->pdev->dev, TG3_TX_RING_BYTES,
8641 tnapi->tx_ring = dma_alloc_coherent(&tp->pdev->dev,
8668 dma_free_coherent(&tp->pdev->dev,
8701 tnapi->rx_rcb = dma_alloc_coherent(&tp->pdev->dev,
8728 dma_free_coherent(&tp->pdev->dev, TG3_HW_STATUS_SIZE,
8743 dma_free_coherent(&tp->pdev->dev, sizeof(struct tg3_hw_stats),
8757 tp->hw_stats = dma_alloc_coherent(&tp->pdev->dev,
8767 tnapi->hw_status = dma_alloc_coherent(&tp->pdev->dev,
8847 if (pci_channel_offline(tp->pdev)) {
8848 dev_err(&tp->pdev->dev,
8862 dev_err(&tp->pdev->dev,
8878 if (pci_channel_offline(tp->pdev)) {
8917 dev_err(&tp->pdev->dev,
8946 pci_read_config_word(tp->pdev, PCI_COMMAND, &tp->pci_cmd);
8955 pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL,
8968 pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, val);
8970 pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd);
8973 pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
8975 pci_write_config_byte(tp->pdev, PCI_LATENCY_TIMER,
8983 pci_read_config_word(tp->pdev, tp->pcix_cap + PCI_X_CMD,
8986 pci_write_config_word(tp->pdev, tp->pcix_cap + PCI_X_CMD,
8998 pci_read_config_word(tp->pdev,
9001 pci_write_config_word(tp->pdev,
9062 if (!pci_device_is_present(tp->pdev))
9184 pci_read_config_dword(tp->pdev, PCI_COMMAND, &val);
9188 if (tg3_flag(tp, PCI_EXPRESS) && pci_is_pcie(tp->pdev)) {
9199 pci_read_config_dword(tp->pdev, 0xc4, &cfg_val);
9200 pci_write_config_dword(tp->pdev, 0xc4,
9212 pcie_capability_clear_word(tp->pdev, PCI_EXP_DEVCTL, val16);
9215 pcie_capability_write_word(tp->pdev, PCI_EXP_DEVSTA,
10088 if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
10089 tp->pdev->subsystem_device == TG3PCI_SUBDEVICE_ID_DELL_5762) {
10516 pci_read_config_word(tp->pdev, tp->pcix_cap + PCI_X_CMD,
10525 pci_write_config_word(tp->pdev, tp->pcix_cap + PCI_X_CMD,
10857 struct pci_dev *pdev = tp->pdev;
10873 tp->hwmon_dev = hwmon_device_register_with_groups(&pdev->dev, "tg3",
10877 dev_err(&pdev->dev, "Cannot register hwmon device, aborting\n");
11191 tp->pdev->error_state != pci_channel_io_normal) {
11364 pci_read_config_word(tp->pdev, PCI_COMMAND, &pci_cmd);
11365 pci_write_config_word(tp->pdev, PCI_COMMAND,
11370 pci_write_config_word(tp->pdev, PCI_COMMAND, pci_cmd);
11386 pci_disable_msi(tp->pdev);
11389 tp->napi[0].irq_vec = tp->pdev->irq;
11415 if (request_firmware(&tp->fw, tp->fw_needed, &tp->pdev->dev)) {
11484 rc = pci_enable_msix_range(tp->pdev, msix_ent, 1, tp->irq_cnt);
11500 pci_disable_msix(tp->pdev);
11531 else if (tg3_flag(tp, SUPPORT_MSI) && pci_enable_msi(tp->pdev) == 0)
11545 tp->napi[0].irq_vec = tp->pdev->irq;
11559 pci_disable_msix(tp->pdev);
11561 pci_disable_msi(tp->pdev);
11769 pci_set_power_state(tp->pdev, PCI_D3hot);
11787 if (pci_device_is_present(tp->pdev)) {
12342 strscpy(info->bus_info, pci_name(tp->pdev), sizeof(info->bus_info));
12349 if (tg3_flag(tp, WOL_CAP) && device_can_wakeup(&tp->pdev->dev))
12354 if (tg3_flag(tp, WOL_ENABLE) && device_can_wakeup(&tp->pdev->dev))
12362 struct device *dp = &tp->pdev->dev;
12875 buf = pci_vpd_alloc(tp->pdev, vpdlen);
13505 map = dma_map_single(&tp->pdev->dev, skb->data, tx_len, DMA_TO_DEVICE);
13506 if (dma_mapping_error(&tp->pdev->dev, map)) {
13604 dma_sync_single_for_cpu(&tp->pdev->dev, map, rx_len,
15136 tp->pdev->subsystem_vendor) &&
15138 tp->pdev->subsystem_device))
15166 device_set_wakeup_enable(&tp->pdev->dev, true);
15277 tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
15285 if ((tp->pdev->subsystem_vendor ==
15287 (tp->pdev->subsystem_device == 0x205a ||
15288 tp->pdev->subsystem_device == 0x2063))
15312 device_set_wakeup_enable(&tp->pdev->dev, true);
15355 device_set_wakeup_enable(&tp->pdev->dev,
15358 device_set_wakeup_capable(&tp->pdev->dev, false);
15671 if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 ||
15672 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717_C)
15674 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718)
15679 if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57780)
15681 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57760)
15683 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57790)
15685 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57788)
15690 if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57761)
15692 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57765)
15694 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57781)
15696 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57785)
15698 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57791)
15700 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57795)
15705 if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57762)
15707 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57766)
15709 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57782)
15711 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57786)
15937 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5725)
16034 unsigned int func, devnr = tp->pdev->devfn & ~7;
16037 peer = pci_get_slot(tp->pdev->bus, devnr | func);
16038 if (peer && peer != tp->pdev)
16043 * tp->pdev in that case.
16046 peer = tp->pdev;
16070 if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 ||
16071 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717_C ||
16072 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
16073 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719 ||
16074 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5720 ||
16075 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57767 ||
16076 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57764 ||
16077 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5762 ||
16078 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5725 ||
16079 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5727 ||
16080 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57787)
16082 else if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_57781 ||
16083 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57785 ||
16084 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57761 ||
16085 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57765 ||
16086 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57791 ||
16087 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57795 ||
16088 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57762 ||
16089 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57766 ||
16090 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57782 ||
16091 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57786)
16096 pci_read_config_dword(tp->pdev, reg, &tp->pci_chip_rev_id);
16184 pci_read_config_word(tp->pdev, PCI_COMMAND, &pci_cmd);
16186 pci_write_config_word(tp->pdev, PCI_COMMAND, pci_cmd);
16193 pci_read_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL,
16197 pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL,
16252 tp->pdev->bus->number)) {
16282 tp->pdev->bus->number) &&
16284 tp->pdev->bus->number)) {
16300 tp->msi_cap = tp->pdev->msi_cap;
16310 tp->pdev->bus->number) &&
16312 tp->pdev->bus->number)) {
16379 tp->pdev_peer == tp->pdev))
16426 pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE,
16429 if (pci_is_pcie(tp->pdev)) {
16434 pcie_capability_read_word(tp->pdev, PCI_EXP_LNKCTL, &lnkctl);
16456 tp->pcix_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_PCIX);
16458 dev_err(&tp->pdev->dev,
16477 pci_read_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
16479 pci_read_config_byte(tp->pdev, PCI_LATENCY_TIMER,
16484 pci_write_config_byte(tp->pdev, PCI_LATENCY_TIMER,
16511 pci_read_config_dword(tp->pdev,
16512 tp->pdev->pm_cap + PCI_PM_CTRL,
16516 pci_write_config_dword(tp->pdev,
16517 tp->pdev->pm_cap + PCI_PM_CTRL,
16521 pci_read_config_word(tp->pdev, PCI_COMMAND, &pci_cmd);
16523 pci_write_config_word(tp->pdev, PCI_COMMAND, pci_cmd);
16536 pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, pci_state_reg);
16580 pci_read_config_word(tp->pdev, PCI_COMMAND, &pci_cmd);
16582 pci_write_config_word(tp->pdev, PCI_COMMAND, pci_cmd);
16605 tp->pci_fn = PCI_FUNC(tp->pdev->devfn) & 3;
16609 pci_read_config_dword(tp->pdev,
16656 pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE,
16685 if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761 ||
16686 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5761S) {
16745 if (tp->pdev->device != PCI_DEVICE_ID_TIGON3_5756 &&
16746 tp->pdev->device != PCI_DEVICE_ID_TIGON3_5722)
16748 if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5755M)
16810 pci_read_config_dword(tp->pdev, TG3PCI_PCISTATE,
16858 pci_write_config_dword(tp->pdev, TG3PCI_MISC_HOST_CTRL,
16873 dev_err(&tp->pdev->dev, "phy probe failed, err %d\n", err);
16903 if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
16956 if (!eth_platform_get_mac_address(&tp->pdev->dev, addr))
16960 err = ssb_gige_get_macaddr(tp->pdev, addr);
17033 pci_read_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE, &byte);
17219 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR,
17221 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_DATA, val);
17223 pci_write_config_dword(tp->pdev, TG3PCI_MEM_WIN_BASE_ADDR, 0);
17262 buf = dma_alloc_coherent(&tp->pdev->dev, TEST_BUFFER_SIZE,
17367 dev_err(&tp->pdev->dev,
17376 dev_err(&tp->pdev->dev, "%s: Buffer read failed. "
17393 dev_err(&tp->pdev->dev,
17425 dma_free_coherent(&tp->pdev->dev, TEST_BUFFER_SIZE, buf, buf_dma);
17585 static int tg3_init_one(struct pci_dev *pdev,
17597 err = pci_enable_device(pdev);
17599 dev_err(&pdev->dev, "Cannot enable PCI device, aborting\n");
17603 err = pci_request_regions(pdev, DRV_MODULE_NAME);
17605 dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting\n");
17609 pci_set_master(pdev);
17617 SET_NETDEV_DEV(dev, &pdev->dev);
17620 tp->pdev = pdev;
17632 if (pdev_is_ssb_gige_core(pdev)) {
17634 if (ssb_gige_must_flush_posted_writes(pdev))
17636 if (ssb_gige_one_dma_at_once(pdev))
17638 if (ssb_gige_have_roboswitch(pdev)) {
17642 if (ssb_gige_is_rgmii(pdev))
17671 tp->regs = pci_ioremap_bar(pdev, BAR_0);
17673 dev_err(&pdev->dev, "Cannot map device registers, aborting\n");
17678 if (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761 ||
17679 tp->pdev->device == PCI_DEVICE_ID_TIGON3_5761E ||
17680 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5761S ||
17681 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5761SE ||
17682 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 ||
17683 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717_C ||
17684 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
17685 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719 ||
17686 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5720 ||
17687 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57767 ||
17688 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57764 ||
17689 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5762 ||
17690 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5725 ||
17691 tp->pdev->device == TG3PCI_DEVICE_TIGON3_5727 ||
17692 tp->pdev->device == TG3PCI_DEVICE_TIGON3_57787) {
17694 tp->aperegs = pci_ioremap_bar(pdev, BAR_2);
17696 dev_err(&pdev->dev,
17709 dev->irq = pdev->irq;
17713 dev_err(&pdev->dev,
17736 err = dma_set_mask(&pdev->dev, dma_mask);
17739 err = dma_set_coherent_mask(&pdev->dev,
17742 dev_err(&pdev->dev, "Unable to obtain 64 bit "
17749 err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
17751 dev_err(&pdev->dev,
17820 dev_err(&pdev->dev,
17882 dev_err(&pdev->dev, "DMA engine test failed, aborting\n");
17888 pci_set_drvdata(pdev, dev);
17901 dev_err(&pdev->dev, "Cannot register net device, aborting\n");
17908 &tp->pdev->dev);
17944 pdev->dma_mask == DMA_BIT_MASK(32) ? 32 :
17945 ((u64)pdev->dma_mask) == DMA_BIT_MASK(40) ? 40 : 64);
17947 pci_save_state(pdev);
17967 pci_release_regions(pdev);
17970 if (pci_is_enabled(pdev))
17971 pci_disable_device(pdev);
17975 static void tg3_remove_one(struct pci_dev *pdev)
17977 struct net_device *dev = pci_get_drvdata(pdev);
18003 pci_release_regions(pdev);
18004 pci_disable_device(pdev);
18106 static void tg3_shutdown(struct pci_dev *pdev)
18108 struct net_device *dev = pci_get_drvdata(pdev);
18125 pci_disable_device(pdev);
18130 * @pdev: Pointer to PCI device
18136 static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev,
18139 struct net_device *netdev = pci_get_drvdata(pdev);
18179 pci_disable_device(pdev);
18189 * @pdev: Pointer to PCI device
18196 static pci_ers_result_t tg3_io_slot_reset(struct pci_dev *pdev)
18198 struct net_device *netdev = pci_get_drvdata(pdev);
18205 if (pci_enable_device(pdev)) {
18206 dev_err(&pdev->dev,
18211 pci_set_master(pdev);
18212 pci_restore_state(pdev);
18213 pci_save_state(pdev);
18238 * @pdev: Pointer to PCI device
18243 static void tg3_io_resume(struct pci_dev *pdev)
18245 struct net_device *netdev = pci_get_drvdata(pdev);