Lines Matching refs:adapter

49 static int ixgb_sw_init(struct ixgb_adapter *adapter);
52 static void ixgb_configure_tx(struct ixgb_adapter *adapter);
53 static void ixgb_configure_rx(struct ixgb_adapter *adapter);
54 static void ixgb_setup_rctl(struct ixgb_adapter *adapter);
55 static void ixgb_clean_tx_ring(struct ixgb_adapter *adapter);
56 static void ixgb_clean_rx_ring(struct ixgb_adapter *adapter);
64 static bool ixgb_clean_tx_irq(struct ixgb_adapter *adapter);
73 static void ixgb_vlan_strip_enable(struct ixgb_adapter *adapter);
74 static void ixgb_vlan_strip_disable(struct ixgb_adapter *adapter);
79 static void ixgb_restore_vlan(struct ixgb_adapter *adapter);
148 ixgb_irq_disable(struct ixgb_adapter *adapter) in ixgb_irq_disable() argument
150 IXGB_WRITE_REG(&adapter->hw, IMC, ~0); in ixgb_irq_disable()
151 IXGB_WRITE_FLUSH(&adapter->hw); in ixgb_irq_disable()
152 synchronize_irq(adapter->pdev->irq); in ixgb_irq_disable()
161 ixgb_irq_enable(struct ixgb_adapter *adapter) in ixgb_irq_enable() argument
165 if (adapter->hw.subsystem_vendor_id == PCI_VENDOR_ID_SUN) in ixgb_irq_enable()
167 IXGB_WRITE_REG(&adapter->hw, IMS, val); in ixgb_irq_enable()
168 IXGB_WRITE_FLUSH(&adapter->hw); in ixgb_irq_enable()
172 ixgb_up(struct ixgb_adapter *adapter) in ixgb_up() argument
174 struct net_device *netdev = adapter->netdev; in ixgb_up()
177 struct ixgb_hw *hw = &adapter->hw; in ixgb_up()
184 ixgb_restore_vlan(adapter); in ixgb_up()
186 ixgb_configure_tx(adapter); in ixgb_up()
187 ixgb_setup_rctl(adapter); in ixgb_up()
188 ixgb_configure_rx(adapter); in ixgb_up()
189 ixgb_alloc_rx_buffers(adapter, IXGB_DESC_UNUSED(&adapter->rx_ring)); in ixgb_up()
192 IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff); in ixgb_up()
195 if (IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_PCIX_MODE) { in ixgb_up()
196 err = pci_enable_msi(adapter->pdev); in ixgb_up()
198 adapter->have_msi = true; in ixgb_up()
204 err = request_irq(adapter->pdev->irq, ixgb_intr, irq_flags, in ixgb_up()
207 if (adapter->have_msi) in ixgb_up()
208 pci_disable_msi(adapter->pdev); in ixgb_up()
209 netif_err(adapter, probe, adapter->netdev, in ixgb_up()
233 clear_bit(__IXGB_DOWN, &adapter->flags); in ixgb_up()
235 napi_enable(&adapter->napi); in ixgb_up()
236 ixgb_irq_enable(adapter); in ixgb_up()
240 mod_timer(&adapter->watchdog_timer, jiffies); in ixgb_up()
246 ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog) in ixgb_down() argument
248 struct net_device *netdev = adapter->netdev; in ixgb_down()
251 set_bit(__IXGB_DOWN, &adapter->flags); in ixgb_down()
255 napi_disable(&adapter->napi); in ixgb_down()
257 ixgb_irq_disable(adapter); in ixgb_down()
258 free_irq(adapter->pdev->irq, netdev); in ixgb_down()
260 if (adapter->have_msi) in ixgb_down()
261 pci_disable_msi(adapter->pdev); in ixgb_down()
264 del_timer_sync(&adapter->watchdog_timer); in ixgb_down()
266 adapter->link_speed = 0; in ixgb_down()
267 adapter->link_duplex = 0; in ixgb_down()
270 ixgb_reset(adapter); in ixgb_down()
271 ixgb_clean_tx_ring(adapter); in ixgb_down()
272 ixgb_clean_rx_ring(adapter); in ixgb_down()
276 ixgb_reset(struct ixgb_adapter *adapter) in ixgb_reset() argument
278 struct ixgb_hw *hw = &adapter->hw; in ixgb_reset()
282 netif_err(adapter, probe, adapter->netdev, "ixgb_init_hw failed\n"); in ixgb_reset()
312 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_set_features() local
318 adapter->rx_csum = !!(features & NETIF_F_RXCSUM); in ixgb_set_features()
321 ixgb_down(adapter, true); in ixgb_set_features()
322 ixgb_up(adapter); in ixgb_set_features()
325 ixgb_reset(adapter); in ixgb_set_features()
362 struct ixgb_adapter *adapter; in ixgb_probe() local
400 adapter = netdev_priv(netdev); in ixgb_probe()
401 adapter->netdev = netdev; in ixgb_probe()
402 adapter->pdev = pdev; in ixgb_probe()
403 adapter->hw.back = adapter; in ixgb_probe()
404 adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE); in ixgb_probe()
406 adapter->hw.hw_addr = pci_ioremap_bar(pdev, BAR_0); in ixgb_probe()
407 if (!adapter->hw.hw_addr) { in ixgb_probe()
416 adapter->hw.io_base = pci_resource_start(pdev, i); in ixgb_probe()
424 netif_napi_add(netdev, &adapter->napi, ixgb_clean, 64); in ixgb_probe()
428 adapter->bd_number = cards_found; in ixgb_probe()
429 adapter->link_speed = 0; in ixgb_probe()
430 adapter->link_duplex = 0; in ixgb_probe()
434 err = ixgb_sw_init(adapter); in ixgb_probe()
458 if (!ixgb_validate_eeprom_checksum(&adapter->hw)) { in ixgb_probe()
459 netif_err(adapter, probe, adapter->netdev, in ixgb_probe()
465 ixgb_get_ee_mac_addr(&adapter->hw, addr); in ixgb_probe()
469 netif_err(adapter, probe, adapter->netdev, "Invalid MAC Address\n"); in ixgb_probe()
474 adapter->part_num = ixgb_get_ee_pba_number(&adapter->hw); in ixgb_probe()
476 timer_setup(&adapter->watchdog_timer, ixgb_watchdog, 0); in ixgb_probe()
478 INIT_WORK(&adapter->tx_timeout_task, ixgb_tx_timeout_task); in ixgb_probe()
488 netif_info(adapter, probe, adapter->netdev, in ixgb_probe()
490 ixgb_check_options(adapter); in ixgb_probe()
493 ixgb_reset(adapter); in ixgb_probe()
501 iounmap(adapter->hw.hw_addr); in ixgb_probe()
526 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_remove() local
528 cancel_work_sync(&adapter->tx_timeout_task); in ixgb_remove()
532 iounmap(adapter->hw.hw_addr); in ixgb_remove()
549 ixgb_sw_init(struct ixgb_adapter *adapter) in ixgb_sw_init() argument
551 struct ixgb_hw *hw = &adapter->hw; in ixgb_sw_init()
552 struct net_device *netdev = adapter->netdev; in ixgb_sw_init()
553 struct pci_dev *pdev = adapter->pdev; in ixgb_sw_init()
563 adapter->rx_buffer_len = hw->max_frame_size + 8; /* + 8 for errata */ in ixgb_sw_init()
572 netif_err(adapter, probe, adapter->netdev, "unsupported device id\n"); in ixgb_sw_init()
578 set_bit(__IXGB_DOWN, &adapter->flags); in ixgb_sw_init()
598 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_open() local
602 err = ixgb_setup_tx_resources(adapter); in ixgb_open()
610 err = ixgb_setup_rx_resources(adapter); in ixgb_open()
614 err = ixgb_up(adapter); in ixgb_open()
623 ixgb_free_rx_resources(adapter); in ixgb_open()
625 ixgb_free_tx_resources(adapter); in ixgb_open()
627 ixgb_reset(adapter); in ixgb_open()
647 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_close() local
649 ixgb_down(adapter, true); in ixgb_close()
651 ixgb_free_tx_resources(adapter); in ixgb_close()
652 ixgb_free_rx_resources(adapter); in ixgb_close()
665 ixgb_setup_tx_resources(struct ixgb_adapter *adapter) in ixgb_setup_tx_resources() argument
667 struct ixgb_desc_ring *txdr = &adapter->tx_ring; in ixgb_setup_tx_resources()
668 struct pci_dev *pdev = adapter->pdev; in ixgb_setup_tx_resources()
702 ixgb_configure_tx(struct ixgb_adapter *adapter) in ixgb_configure_tx() argument
704 u64 tdba = adapter->tx_ring.dma; in ixgb_configure_tx()
705 u32 tdlen = adapter->tx_ring.count * sizeof(struct ixgb_tx_desc); in ixgb_configure_tx()
707 struct ixgb_hw *hw = &adapter->hw; in ixgb_configure_tx()
727 IXGB_WRITE_REG(hw, TIDV, adapter->tx_int_delay); in ixgb_configure_tx()
735 adapter->tx_cmd_type = in ixgb_configure_tx()
737 (adapter->tx_int_delay_enable ? IXGB_TX_DESC_CMD_IDE : 0); in ixgb_configure_tx()
748 ixgb_setup_rx_resources(struct ixgb_adapter *adapter) in ixgb_setup_rx_resources() argument
750 struct ixgb_desc_ring *rxdr = &adapter->rx_ring; in ixgb_setup_rx_resources()
751 struct pci_dev *pdev = adapter->pdev; in ixgb_setup_rx_resources()
784 ixgb_setup_rctl(struct ixgb_adapter *adapter) in ixgb_setup_rctl() argument
788 rctl = IXGB_READ_REG(&adapter->hw, RCTL); in ixgb_setup_rctl()
795 (adapter->hw.mc_filter_type << IXGB_RCTL_MO_SHIFT); in ixgb_setup_rctl()
799 if (adapter->rx_buffer_len <= IXGB_RXBUFFER_2048) in ixgb_setup_rctl()
801 else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_4096) in ixgb_setup_rctl()
803 else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_8192) in ixgb_setup_rctl()
805 else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_16384) in ixgb_setup_rctl()
808 IXGB_WRITE_REG(&adapter->hw, RCTL, rctl); in ixgb_setup_rctl()
819 ixgb_configure_rx(struct ixgb_adapter *adapter) in ixgb_configure_rx() argument
821 u64 rdba = adapter->rx_ring.dma; in ixgb_configure_rx()
822 u32 rdlen = adapter->rx_ring.count * sizeof(struct ixgb_rx_desc); in ixgb_configure_rx()
823 struct ixgb_hw *hw = &adapter->hw; in ixgb_configure_rx()
834 IXGB_WRITE_REG(hw, RDTR, adapter->rx_int_delay); in ixgb_configure_rx()
855 if (adapter->rx_csum) { in ixgb_configure_rx()
874 ixgb_free_tx_resources(struct ixgb_adapter *adapter) in ixgb_free_tx_resources() argument
876 struct pci_dev *pdev = adapter->pdev; in ixgb_free_tx_resources()
878 ixgb_clean_tx_ring(adapter); in ixgb_free_tx_resources()
880 vfree(adapter->tx_ring.buffer_info); in ixgb_free_tx_resources()
881 adapter->tx_ring.buffer_info = NULL; in ixgb_free_tx_resources()
883 dma_free_coherent(&pdev->dev, adapter->tx_ring.size, in ixgb_free_tx_resources()
884 adapter->tx_ring.desc, adapter->tx_ring.dma); in ixgb_free_tx_resources()
886 adapter->tx_ring.desc = NULL; in ixgb_free_tx_resources()
890 ixgb_unmap_and_free_tx_resource(struct ixgb_adapter *adapter, in ixgb_unmap_and_free_tx_resource() argument
895 dma_unmap_page(&adapter->pdev->dev, buffer_info->dma, in ixgb_unmap_and_free_tx_resource()
898 dma_unmap_single(&adapter->pdev->dev, buffer_info->dma, in ixgb_unmap_and_free_tx_resource()
919 ixgb_clean_tx_ring(struct ixgb_adapter *adapter) in ixgb_clean_tx_ring() argument
921 struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; in ixgb_clean_tx_ring()
930 ixgb_unmap_and_free_tx_resource(adapter, buffer_info); in ixgb_clean_tx_ring()
943 IXGB_WRITE_REG(&adapter->hw, TDH, 0); in ixgb_clean_tx_ring()
944 IXGB_WRITE_REG(&adapter->hw, TDT, 0); in ixgb_clean_tx_ring()
955 ixgb_free_rx_resources(struct ixgb_adapter *adapter) in ixgb_free_rx_resources() argument
957 struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; in ixgb_free_rx_resources()
958 struct pci_dev *pdev = adapter->pdev; in ixgb_free_rx_resources()
960 ixgb_clean_rx_ring(adapter); in ixgb_free_rx_resources()
977 ixgb_clean_rx_ring(struct ixgb_adapter *adapter) in ixgb_clean_rx_ring() argument
979 struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; in ixgb_clean_rx_ring()
981 struct pci_dev *pdev = adapter->pdev; in ixgb_clean_rx_ring()
1014 IXGB_WRITE_REG(&adapter->hw, RDH, 0); in ixgb_clean_rx_ring()
1015 IXGB_WRITE_REG(&adapter->hw, RDT, 0); in ixgb_clean_rx_ring()
1029 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_set_mac() local
1037 ixgb_rar_set(&adapter->hw, addr->sa_data, 0); in ixgb_set_mac()
1055 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_set_multi() local
1056 struct ixgb_hw *hw = &adapter->hw; in ixgb_set_multi()
1106 ixgb_vlan_strip_enable(adapter); in ixgb_set_multi()
1108 ixgb_vlan_strip_disable(adapter); in ixgb_set_multi()
1120 struct ixgb_adapter *adapter = from_timer(adapter, t, watchdog_timer); in ixgb_watchdog() local
1121 struct net_device *netdev = adapter->netdev; in ixgb_watchdog()
1122 struct ixgb_desc_ring *txdr = &adapter->tx_ring; in ixgb_watchdog()
1124 ixgb_check_for_link(&adapter->hw); in ixgb_watchdog()
1126 if (ixgb_check_for_bad_link(&adapter->hw)) { in ixgb_watchdog()
1131 if (adapter->hw.link_up) { in ixgb_watchdog()
1135 (adapter->hw.fc.type == ixgb_fc_full) ? in ixgb_watchdog()
1137 (adapter->hw.fc.type == ixgb_fc_rx_pause) ? in ixgb_watchdog()
1139 (adapter->hw.fc.type == ixgb_fc_tx_pause) ? in ixgb_watchdog()
1141 adapter->link_speed = 10000; in ixgb_watchdog()
1142 adapter->link_duplex = FULL_DUPLEX; in ixgb_watchdog()
1147 adapter->link_speed = 0; in ixgb_watchdog()
1148 adapter->link_duplex = 0; in ixgb_watchdog()
1154 ixgb_update_stats(adapter); in ixgb_watchdog()
1162 schedule_work(&adapter->tx_timeout_task); in ixgb_watchdog()
1169 adapter->detect_tx_hung = true; in ixgb_watchdog()
1172 IXGB_WRITE_REG(&adapter->hw, ICS, IXGB_INT_TXDW); in ixgb_watchdog()
1175 mod_timer(&adapter->watchdog_timer, jiffies + 2 * HZ); in ixgb_watchdog()
1183 ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) in ixgb_tso() argument
1214 i = adapter->tx_ring.next_to_use; in ixgb_tso()
1215 context_desc = IXGB_CONTEXT_DESC(adapter->tx_ring, i); in ixgb_tso()
1216 buffer_info = &adapter->tx_ring.buffer_info[i]; in ixgb_tso()
1237 if (++i == adapter->tx_ring.count) i = 0; in ixgb_tso()
1238 adapter->tx_ring.next_to_use = i; in ixgb_tso()
1247 ixgb_tx_csum(struct ixgb_adapter *adapter, struct sk_buff *skb) in ixgb_tx_csum() argument
1258 i = adapter->tx_ring.next_to_use; in ixgb_tx_csum()
1259 context_desc = IXGB_CONTEXT_DESC(adapter->tx_ring, i); in ixgb_tx_csum()
1260 buffer_info = &adapter->tx_ring.buffer_info[i]; in ixgb_tx_csum()
1275 if (++i == adapter->tx_ring.count) i = 0; in ixgb_tx_csum()
1276 adapter->tx_ring.next_to_use = i; in ixgb_tx_csum()
1288 ixgb_tx_map(struct ixgb_adapter *adapter, struct sk_buff *skb, in ixgb_tx_map() argument
1291 struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; in ixgb_tx_map()
1292 struct pci_dev *pdev = adapter->pdev; in ixgb_tx_map()
1381 ixgb_unmap_and_free_tx_resource(adapter, buffer_info); in ixgb_tx_map()
1388 ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,int tx_flags) in ixgb_tx_queue() argument
1390 struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; in ixgb_tx_queue()
1393 u32 cmd_type_len = adapter->tx_cmd_type; in ixgb_tx_queue()
1434 IXGB_WRITE_REG(&adapter->hw, TDT, i); in ixgb_tx_queue()
1439 struct ixgb_adapter *adapter = netdev_priv(netdev); in __ixgb_maybe_stop_tx() local
1440 struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; in __ixgb_maybe_stop_tx()
1455 ++adapter->restart_queue; in __ixgb_maybe_stop_tx()
1478 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_xmit_frame() local
1485 if (test_bit(__IXGB_DOWN, &adapter->flags)) { in ixgb_xmit_frame()
1495 if (unlikely(ixgb_maybe_stop_tx(netdev, &adapter->tx_ring, in ixgb_xmit_frame()
1504 first = adapter->tx_ring.next_to_use; in ixgb_xmit_frame()
1506 tso = ixgb_tso(adapter, skb); in ixgb_xmit_frame()
1514 else if (ixgb_tx_csum(adapter, skb)) in ixgb_xmit_frame()
1517 count = ixgb_tx_map(adapter, skb, first); in ixgb_xmit_frame()
1520 ixgb_tx_queue(adapter, count, vlan_id, tx_flags); in ixgb_xmit_frame()
1522 ixgb_maybe_stop_tx(netdev, &adapter->tx_ring, DESC_NEEDED); in ixgb_xmit_frame()
1526 adapter->tx_ring.buffer_info[first].time_stamp = 0; in ixgb_xmit_frame()
1527 adapter->tx_ring.next_to_use = first; in ixgb_xmit_frame()
1542 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_tx_timeout() local
1545 schedule_work(&adapter->tx_timeout_task); in ixgb_tx_timeout()
1551 struct ixgb_adapter *adapter = in ixgb_tx_timeout_task() local
1554 adapter->tx_timeout_count++; in ixgb_tx_timeout_task()
1555 ixgb_down(adapter, true); in ixgb_tx_timeout_task()
1556 ixgb_up(adapter); in ixgb_tx_timeout_task()
1570 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_change_mtu() local
1574 ixgb_down(adapter, true); in ixgb_change_mtu()
1576 adapter->rx_buffer_len = max_frame + 8; /* + 8 for errata */ in ixgb_change_mtu()
1581 ixgb_up(adapter); in ixgb_change_mtu()
1592 ixgb_update_stats(struct ixgb_adapter *adapter) in ixgb_update_stats() argument
1594 struct net_device *netdev = adapter->netdev; in ixgb_update_stats()
1595 struct pci_dev *pdev = adapter->pdev; in ixgb_update_stats()
1603 u64 multi = IXGB_READ_REG(&adapter->hw, MPRCL); in ixgb_update_stats()
1604 u32 bcast_l = IXGB_READ_REG(&adapter->hw, BPRCL); in ixgb_update_stats()
1605 u32 bcast_h = IXGB_READ_REG(&adapter->hw, BPRCH); in ixgb_update_stats()
1608 multi |= ((u64)IXGB_READ_REG(&adapter->hw, MPRCH) << 32); in ixgb_update_stats()
1613 adapter->stats.mprcl += (multi & 0xFFFFFFFF); in ixgb_update_stats()
1614 adapter->stats.mprch += (multi >> 32); in ixgb_update_stats()
1615 adapter->stats.bprcl += bcast_l; in ixgb_update_stats()
1616 adapter->stats.bprch += bcast_h; in ixgb_update_stats()
1618 adapter->stats.mprcl += IXGB_READ_REG(&adapter->hw, MPRCL); in ixgb_update_stats()
1619 adapter->stats.mprch += IXGB_READ_REG(&adapter->hw, MPRCH); in ixgb_update_stats()
1620 adapter->stats.bprcl += IXGB_READ_REG(&adapter->hw, BPRCL); in ixgb_update_stats()
1621 adapter->stats.bprch += IXGB_READ_REG(&adapter->hw, BPRCH); in ixgb_update_stats()
1623 adapter->stats.tprl += IXGB_READ_REG(&adapter->hw, TPRL); in ixgb_update_stats()
1624 adapter->stats.tprh += IXGB_READ_REG(&adapter->hw, TPRH); in ixgb_update_stats()
1625 adapter->stats.gprcl += IXGB_READ_REG(&adapter->hw, GPRCL); in ixgb_update_stats()
1626 adapter->stats.gprch += IXGB_READ_REG(&adapter->hw, GPRCH); in ixgb_update_stats()
1627 adapter->stats.uprcl += IXGB_READ_REG(&adapter->hw, UPRCL); in ixgb_update_stats()
1628 adapter->stats.uprch += IXGB_READ_REG(&adapter->hw, UPRCH); in ixgb_update_stats()
1629 adapter->stats.vprcl += IXGB_READ_REG(&adapter->hw, VPRCL); in ixgb_update_stats()
1630 adapter->stats.vprch += IXGB_READ_REG(&adapter->hw, VPRCH); in ixgb_update_stats()
1631 adapter->stats.jprcl += IXGB_READ_REG(&adapter->hw, JPRCL); in ixgb_update_stats()
1632 adapter->stats.jprch += IXGB_READ_REG(&adapter->hw, JPRCH); in ixgb_update_stats()
1633 adapter->stats.gorcl += IXGB_READ_REG(&adapter->hw, GORCL); in ixgb_update_stats()
1634 adapter->stats.gorch += IXGB_READ_REG(&adapter->hw, GORCH); in ixgb_update_stats()
1635 adapter->stats.torl += IXGB_READ_REG(&adapter->hw, TORL); in ixgb_update_stats()
1636 adapter->stats.torh += IXGB_READ_REG(&adapter->hw, TORH); in ixgb_update_stats()
1637 adapter->stats.rnbc += IXGB_READ_REG(&adapter->hw, RNBC); in ixgb_update_stats()
1638 adapter->stats.ruc += IXGB_READ_REG(&adapter->hw, RUC); in ixgb_update_stats()
1639 adapter->stats.roc += IXGB_READ_REG(&adapter->hw, ROC); in ixgb_update_stats()
1640 adapter->stats.rlec += IXGB_READ_REG(&adapter->hw, RLEC); in ixgb_update_stats()
1641 adapter->stats.crcerrs += IXGB_READ_REG(&adapter->hw, CRCERRS); in ixgb_update_stats()
1642 adapter->stats.icbc += IXGB_READ_REG(&adapter->hw, ICBC); in ixgb_update_stats()
1643 adapter->stats.ecbc += IXGB_READ_REG(&adapter->hw, ECBC); in ixgb_update_stats()
1644 adapter->stats.mpc += IXGB_READ_REG(&adapter->hw, MPC); in ixgb_update_stats()
1645 adapter->stats.tptl += IXGB_READ_REG(&adapter->hw, TPTL); in ixgb_update_stats()
1646 adapter->stats.tpth += IXGB_READ_REG(&adapter->hw, TPTH); in ixgb_update_stats()
1647 adapter->stats.gptcl += IXGB_READ_REG(&adapter->hw, GPTCL); in ixgb_update_stats()
1648 adapter->stats.gptch += IXGB_READ_REG(&adapter->hw, GPTCH); in ixgb_update_stats()
1649 adapter->stats.bptcl += IXGB_READ_REG(&adapter->hw, BPTCL); in ixgb_update_stats()
1650 adapter->stats.bptch += IXGB_READ_REG(&adapter->hw, BPTCH); in ixgb_update_stats()
1651 adapter->stats.mptcl += IXGB_READ_REG(&adapter->hw, MPTCL); in ixgb_update_stats()
1652 adapter->stats.mptch += IXGB_READ_REG(&adapter->hw, MPTCH); in ixgb_update_stats()
1653 adapter->stats.uptcl += IXGB_READ_REG(&adapter->hw, UPTCL); in ixgb_update_stats()
1654 adapter->stats.uptch += IXGB_READ_REG(&adapter->hw, UPTCH); in ixgb_update_stats()
1655 adapter->stats.vptcl += IXGB_READ_REG(&adapter->hw, VPTCL); in ixgb_update_stats()
1656 adapter->stats.vptch += IXGB_READ_REG(&adapter->hw, VPTCH); in ixgb_update_stats()
1657 adapter->stats.jptcl += IXGB_READ_REG(&adapter->hw, JPTCL); in ixgb_update_stats()
1658 adapter->stats.jptch += IXGB_READ_REG(&adapter->hw, JPTCH); in ixgb_update_stats()
1659 adapter->stats.gotcl += IXGB_READ_REG(&adapter->hw, GOTCL); in ixgb_update_stats()
1660 adapter->stats.gotch += IXGB_READ_REG(&adapter->hw, GOTCH); in ixgb_update_stats()
1661 adapter->stats.totl += IXGB_READ_REG(&adapter->hw, TOTL); in ixgb_update_stats()
1662 adapter->stats.toth += IXGB_READ_REG(&adapter->hw, TOTH); in ixgb_update_stats()
1663 adapter->stats.dc += IXGB_READ_REG(&adapter->hw, DC); in ixgb_update_stats()
1664 adapter->stats.plt64c += IXGB_READ_REG(&adapter->hw, PLT64C); in ixgb_update_stats()
1665 adapter->stats.tsctc += IXGB_READ_REG(&adapter->hw, TSCTC); in ixgb_update_stats()
1666 adapter->stats.tsctfc += IXGB_READ_REG(&adapter->hw, TSCTFC); in ixgb_update_stats()
1667 adapter->stats.ibic += IXGB_READ_REG(&adapter->hw, IBIC); in ixgb_update_stats()
1668 adapter->stats.rfc += IXGB_READ_REG(&adapter->hw, RFC); in ixgb_update_stats()
1669 adapter->stats.lfc += IXGB_READ_REG(&adapter->hw, LFC); in ixgb_update_stats()
1670 adapter->stats.pfrc += IXGB_READ_REG(&adapter->hw, PFRC); in ixgb_update_stats()
1671 adapter->stats.pftc += IXGB_READ_REG(&adapter->hw, PFTC); in ixgb_update_stats()
1672 adapter->stats.mcfrc += IXGB_READ_REG(&adapter->hw, MCFRC); in ixgb_update_stats()
1673 adapter->stats.mcftc += IXGB_READ_REG(&adapter->hw, MCFTC); in ixgb_update_stats()
1674 adapter->stats.xonrxc += IXGB_READ_REG(&adapter->hw, XONRXC); in ixgb_update_stats()
1675 adapter->stats.xontxc += IXGB_READ_REG(&adapter->hw, XONTXC); in ixgb_update_stats()
1676 adapter->stats.xoffrxc += IXGB_READ_REG(&adapter->hw, XOFFRXC); in ixgb_update_stats()
1677 adapter->stats.xofftxc += IXGB_READ_REG(&adapter->hw, XOFFTXC); in ixgb_update_stats()
1678 adapter->stats.rjc += IXGB_READ_REG(&adapter->hw, RJC); in ixgb_update_stats()
1682 netdev->stats.rx_packets = adapter->stats.gprcl; in ixgb_update_stats()
1683 netdev->stats.tx_packets = adapter->stats.gptcl; in ixgb_update_stats()
1684 netdev->stats.rx_bytes = adapter->stats.gorcl; in ixgb_update_stats()
1685 netdev->stats.tx_bytes = adapter->stats.gotcl; in ixgb_update_stats()
1686 netdev->stats.multicast = adapter->stats.mprcl; in ixgb_update_stats()
1692 /* adapter->stats.rnbc + */ adapter->stats.crcerrs + in ixgb_update_stats()
1693 adapter->stats.ruc + in ixgb_update_stats()
1694 adapter->stats.roc /*+ adapter->stats.rlec */ + in ixgb_update_stats()
1695 adapter->stats.icbc + in ixgb_update_stats()
1696 adapter->stats.ecbc + adapter->stats.mpc; in ixgb_update_stats()
1702 netdev->stats.rx_crc_errors = adapter->stats.crcerrs; in ixgb_update_stats()
1703 netdev->stats.rx_fifo_errors = adapter->stats.mpc; in ixgb_update_stats()
1704 netdev->stats.rx_missed_errors = adapter->stats.mpc; in ixgb_update_stats()
1705 netdev->stats.rx_over_errors = adapter->stats.mpc; in ixgb_update_stats()
1727 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_intr() local
1728 struct ixgb_hw *hw = &adapter->hw; in ixgb_intr()
1735 if (!test_bit(__IXGB_DOWN, &adapter->flags)) in ixgb_intr()
1736 mod_timer(&adapter->watchdog_timer, jiffies); in ixgb_intr()
1738 if (napi_schedule_prep(&adapter->napi)) { in ixgb_intr()
1744 IXGB_WRITE_REG(&adapter->hw, IMC, ~0); in ixgb_intr()
1745 __napi_schedule(&adapter->napi); in ixgb_intr()
1759 struct ixgb_adapter *adapter = container_of(napi, struct ixgb_adapter, napi); in ixgb_clean() local
1762 ixgb_clean_tx_irq(adapter); in ixgb_clean()
1763 ixgb_clean_rx_irq(adapter, &work_done, budget); in ixgb_clean()
1768 if (!test_bit(__IXGB_DOWN, &adapter->flags)) in ixgb_clean()
1769 ixgb_irq_enable(adapter); in ixgb_clean()
1781 ixgb_clean_tx_irq(struct ixgb_adapter *adapter) in ixgb_clean_tx_irq() argument
1783 struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; in ixgb_clean_tx_irq()
1784 struct net_device *netdev = adapter->netdev; in ixgb_clean_tx_irq()
1804 adapter->hw_csum_tx_good++; in ixgb_clean_tx_irq()
1806 ixgb_unmap_and_free_tx_resource(adapter, buffer_info); in ixgb_clean_tx_irq()
1827 !(test_bit(__IXGB_DOWN, &adapter->flags))) { in ixgb_clean_tx_irq()
1829 ++adapter->restart_queue; in ixgb_clean_tx_irq()
1833 if (adapter->detect_tx_hung) { in ixgb_clean_tx_irq()
1836 adapter->detect_tx_hung = false; in ixgb_clean_tx_irq()
1839 && !(IXGB_READ_REG(&adapter->hw, STATUS) & in ixgb_clean_tx_irq()
1842 netif_err(adapter, drv, adapter->netdev, in ixgb_clean_tx_irq()
1853 IXGB_READ_REG(&adapter->hw, TDH), in ixgb_clean_tx_irq()
1854 IXGB_READ_REG(&adapter->hw, TDT), in ixgb_clean_tx_irq()
1876 ixgb_rx_checksum(struct ixgb_adapter *adapter, in ixgb_rx_checksum() argument
1894 adapter->hw_csum_rx_error++; in ixgb_rx_checksum()
1898 adapter->hw_csum_rx_good++; in ixgb_rx_checksum()
1935 ixgb_clean_rx_irq(struct ixgb_adapter *adapter, int *work_done, int work_to_do) in ixgb_clean_rx_irq() argument
1937 struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; in ixgb_clean_rx_irq()
1938 struct net_device *netdev = adapter->netdev; in ixgb_clean_rx_irq()
1939 struct pci_dev *pdev = adapter->pdev; in ixgb_clean_rx_irq()
2009 ixgb_check_copybreak(&adapter->napi, buffer_info, length, &skb); in ixgb_clean_rx_irq()
2015 ixgb_rx_checksum(adapter, rx_desc, skb); in ixgb_clean_rx_irq()
2030 ixgb_alloc_rx_buffers(adapter, cleaned_count); in ixgb_clean_rx_irq()
2043 ixgb_alloc_rx_buffers(adapter, cleaned_count); in ixgb_clean_rx_irq()
2055 ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter, int cleaned_count) in ixgb_alloc_rx_buffers() argument
2057 struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; in ixgb_alloc_rx_buffers()
2058 struct net_device *netdev = adapter->netdev; in ixgb_alloc_rx_buffers()
2059 struct pci_dev *pdev = adapter->pdev; in ixgb_alloc_rx_buffers()
2080 skb = netdev_alloc_skb_ip_align(netdev, adapter->rx_buffer_len); in ixgb_alloc_rx_buffers()
2083 adapter->alloc_rx_buff_failed++; in ixgb_alloc_rx_buffers()
2088 buffer_info->length = adapter->rx_buffer_len; in ixgb_alloc_rx_buffers()
2092 adapter->rx_buffer_len, in ixgb_alloc_rx_buffers()
2095 adapter->alloc_rx_buff_failed++; in ixgb_alloc_rx_buffers()
2122 IXGB_WRITE_REG(&adapter->hw, RDT, i); in ixgb_alloc_rx_buffers()
2127 ixgb_vlan_strip_enable(struct ixgb_adapter *adapter) in ixgb_vlan_strip_enable() argument
2132 ctrl = IXGB_READ_REG(&adapter->hw, CTRL0); in ixgb_vlan_strip_enable()
2134 IXGB_WRITE_REG(&adapter->hw, CTRL0, ctrl); in ixgb_vlan_strip_enable()
2138 ixgb_vlan_strip_disable(struct ixgb_adapter *adapter) in ixgb_vlan_strip_disable() argument
2143 ctrl = IXGB_READ_REG(&adapter->hw, CTRL0); in ixgb_vlan_strip_disable()
2145 IXGB_WRITE_REG(&adapter->hw, CTRL0, ctrl); in ixgb_vlan_strip_disable()
2151 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_vlan_rx_add_vid() local
2157 vfta = IXGB_READ_REG_ARRAY(&adapter->hw, VFTA, index); in ixgb_vlan_rx_add_vid()
2159 ixgb_write_vfta(&adapter->hw, index, vfta); in ixgb_vlan_rx_add_vid()
2160 set_bit(vid, adapter->active_vlans); in ixgb_vlan_rx_add_vid()
2168 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_vlan_rx_kill_vid() local
2174 vfta = IXGB_READ_REG_ARRAY(&adapter->hw, VFTA, index); in ixgb_vlan_rx_kill_vid()
2176 ixgb_write_vfta(&adapter->hw, index, vfta); in ixgb_vlan_rx_kill_vid()
2177 clear_bit(vid, adapter->active_vlans); in ixgb_vlan_rx_kill_vid()
2183 ixgb_restore_vlan(struct ixgb_adapter *adapter) in ixgb_restore_vlan() argument
2187 for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID) in ixgb_restore_vlan()
2188 ixgb_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid); in ixgb_restore_vlan()
2203 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_io_error_detected() local
2211 ixgb_down(adapter, true); in ixgb_io_error_detected()
2231 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_io_slot_reset() local
2235 netif_err(adapter, probe, adapter->netdev, in ixgb_io_slot_reset()
2248 ixgb_reset(adapter); in ixgb_io_slot_reset()
2251 if (!ixgb_validate_eeprom_checksum(&adapter->hw)) { in ixgb_io_slot_reset()
2252 netif_err(adapter, probe, adapter->netdev, in ixgb_io_slot_reset()
2256 ixgb_get_ee_mac_addr(&adapter->hw, addr); in ixgb_io_slot_reset()
2261 netif_err(adapter, probe, adapter->netdev, in ixgb_io_slot_reset()
2280 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_io_resume() local
2285 if (ixgb_up(adapter)) { in ixgb_io_resume()
2292 mod_timer(&adapter->watchdog_timer, jiffies); in ixgb_io_resume()