Lines Matching refs:netdev
78 static int ixgb_open(struct net_device *netdev);
79 static int ixgb_close(struct net_device *netdev);
85 static void ixgb_set_multi(struct net_device *netdev);
88 struct net_device *netdev);
89 static struct net_device_stats *ixgb_get_stats(struct net_device *netdev);
90 static int ixgb_change_mtu(struct net_device *netdev, int new_mtu);
91 static int ixgb_set_mac(struct net_device *netdev, void *p);
104 static int ixgb_vlan_rx_add_vid(struct net_device *netdev,
106 static int ixgb_vlan_rx_kill_vid(struct net_device *netdev,
209 struct net_device *netdev = adapter->netdev; in ixgb_up() local
211 int max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; in ixgb_up()
216 ixgb_rar_set(hw, netdev->dev_addr, 0); in ixgb_up()
217 ixgb_set_multi(netdev); in ixgb_up()
240 netdev->name, netdev); in ixgb_up()
244 netif_err(adapter, probe, adapter->netdev, in ixgb_up()
273 netif_wake_queue(netdev); in ixgb_up()
283 struct net_device *netdev = adapter->netdev; in ixgb_down() local
288 netif_carrier_off(netdev); in ixgb_down()
293 free_irq(adapter->pdev->irq, netdev); in ixgb_down()
303 netif_stop_queue(netdev); in ixgb_down()
317 netif_err(adapter, probe, adapter->netdev, "ixgb_init_hw failed\n"); in ixgb_reset()
332 ixgb_fix_features(struct net_device *netdev, netdev_features_t features) in ixgb_fix_features() argument
345 ixgb_set_features(struct net_device *netdev, netdev_features_t features) in ixgb_set_features() argument
347 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_set_features()
348 netdev_features_t changed = features ^ netdev->features; in ixgb_set_features()
355 if (netif_running(netdev)) { in ixgb_set_features()
358 ixgb_set_speed_duplex(netdev); in ixgb_set_features()
400 struct net_device *netdev = NULL; in ixgb_probe() local
429 netdev = alloc_etherdev(sizeof(struct ixgb_adapter)); in ixgb_probe()
430 if (!netdev) { in ixgb_probe()
435 SET_NETDEV_DEV(netdev, &pdev->dev); in ixgb_probe()
437 pci_set_drvdata(pdev, netdev); in ixgb_probe()
438 adapter = netdev_priv(netdev); in ixgb_probe()
439 adapter->netdev = netdev; in ixgb_probe()
459 netdev->netdev_ops = &ixgb_netdev_ops; in ixgb_probe()
460 ixgb_set_ethtool_ops(netdev); in ixgb_probe()
461 netdev->watchdog_timeo = 5 * HZ; in ixgb_probe()
462 netif_napi_add(netdev, &adapter->napi, ixgb_clean, 64); in ixgb_probe()
464 strncpy(netdev->name, pci_name(pdev), sizeof(netdev->name) - 1); in ixgb_probe()
476 netdev->hw_features = NETIF_F_SG | in ixgb_probe()
481 netdev->features = netdev->hw_features | in ixgb_probe()
483 netdev->hw_features |= NETIF_F_RXCSUM; in ixgb_probe()
486 netdev->features |= NETIF_F_HIGHDMA; in ixgb_probe()
487 netdev->vlan_features |= NETIF_F_HIGHDMA; in ixgb_probe()
493 netif_err(adapter, probe, adapter->netdev, in ixgb_probe()
499 ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr); in ixgb_probe()
501 if (!is_valid_ether_addr(netdev->dev_addr)) { in ixgb_probe()
502 netif_err(adapter, probe, adapter->netdev, "Invalid MAC Address\n"); in ixgb_probe()
515 strcpy(netdev->name, "eth%d"); in ixgb_probe()
516 err = register_netdev(netdev); in ixgb_probe()
521 netif_carrier_off(netdev); in ixgb_probe()
523 netif_info(adapter, probe, adapter->netdev, in ixgb_probe()
538 free_netdev(netdev); in ixgb_probe()
560 struct net_device *netdev = pci_get_drvdata(pdev); in ixgb_remove() local
561 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_remove()
565 unregister_netdev(netdev); in ixgb_remove()
570 free_netdev(netdev); in ixgb_remove()
587 struct net_device *netdev = adapter->netdev; in ixgb_sw_init() local
597 hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; in ixgb_sw_init()
607 netif_err(adapter, probe, adapter->netdev, "unsupported device id\n"); in ixgb_sw_init()
631 ixgb_open(struct net_device *netdev) in ixgb_open() argument
633 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_open()
641 netif_carrier_off(netdev); in ixgb_open()
653 netif_start_queue(netdev); in ixgb_open()
680 ixgb_close(struct net_device *netdev) in ixgb_close() argument
682 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_close()
1063 ixgb_set_mac(struct net_device *netdev, void *p) in ixgb_set_mac() argument
1065 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_set_mac()
1071 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); in ixgb_set_mac()
1089 ixgb_set_multi(struct net_device *netdev) in ixgb_set_multi() argument
1091 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_set_multi()
1100 if (netdev->flags & IFF_PROMISC) { in ixgb_set_multi()
1106 if (netdev->flags & IFF_ALLMULTI) { in ixgb_set_multi()
1117 if (netdev_mc_count(netdev) > IXGB_MAX_NUM_MULTICAST_ADDRESSES) { in ixgb_set_multi()
1130 netdev_for_each_mc_addr(ha, netdev) { in ixgb_set_multi()
1135 ixgb_mc_addr_list_update(hw, mta, netdev_mc_count(netdev), 0); in ixgb_set_multi()
1140 if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) in ixgb_set_multi()
1156 struct net_device *netdev = adapter->netdev; in ixgb_watchdog() local
1163 netif_stop_queue(netdev); in ixgb_watchdog()
1167 if (!netif_carrier_ok(netdev)) { in ixgb_watchdog()
1168 netdev_info(netdev, in ixgb_watchdog()
1178 netif_carrier_on(netdev); in ixgb_watchdog()
1181 if (netif_carrier_ok(netdev)) { in ixgb_watchdog()
1184 netdev_info(netdev, "NIC Link is Down\n"); in ixgb_watchdog()
1185 netif_carrier_off(netdev); in ixgb_watchdog()
1191 if (!netif_carrier_ok(netdev)) { in ixgb_watchdog()
1474 static int __ixgb_maybe_stop_tx(struct net_device *netdev, int size) in __ixgb_maybe_stop_tx() argument
1476 struct ixgb_adapter *adapter = netdev_priv(netdev); in __ixgb_maybe_stop_tx()
1479 netif_stop_queue(netdev); in __ixgb_maybe_stop_tx()
1491 netif_start_queue(netdev); in __ixgb_maybe_stop_tx()
1496 static int ixgb_maybe_stop_tx(struct net_device *netdev, in ixgb_maybe_stop_tx() argument
1501 return __ixgb_maybe_stop_tx(netdev, size); in ixgb_maybe_stop_tx()
1513 ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) in ixgb_xmit_frame() argument
1515 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_xmit_frame()
1532 if (unlikely(ixgb_maybe_stop_tx(netdev, &adapter->tx_ring, in ixgb_xmit_frame()
1559 ixgb_maybe_stop_tx(netdev, &adapter->tx_ring, DESC_NEEDED); in ixgb_xmit_frame()
1576 ixgb_tx_timeout(struct net_device *netdev) in ixgb_tx_timeout() argument
1578 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_tx_timeout()
1604 ixgb_get_stats(struct net_device *netdev) in ixgb_get_stats() argument
1606 return &netdev->stats; in ixgb_get_stats()
1618 ixgb_change_mtu(struct net_device *netdev, int new_mtu) in ixgb_change_mtu() argument
1620 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_change_mtu()
1622 int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; in ixgb_change_mtu()
1627 netif_err(adapter, probe, adapter->netdev, in ixgb_change_mtu()
1635 if (netif_running(netdev)) in ixgb_change_mtu()
1640 netdev->mtu = new_mtu; in ixgb_change_mtu()
1642 if (netif_running(netdev)) in ixgb_change_mtu()
1656 struct net_device *netdev = adapter->netdev; in ixgb_update_stats() local
1663 if ((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) || in ixgb_update_stats()
1664 (netdev_mc_count(netdev) > IXGB_MAX_NUM_MULTICAST_ADDRESSES)) { in ixgb_update_stats()
1744 netdev->stats.rx_packets = adapter->stats.gprcl; in ixgb_update_stats()
1745 netdev->stats.tx_packets = adapter->stats.gptcl; in ixgb_update_stats()
1746 netdev->stats.rx_bytes = adapter->stats.gorcl; in ixgb_update_stats()
1747 netdev->stats.tx_bytes = adapter->stats.gotcl; in ixgb_update_stats()
1748 netdev->stats.multicast = adapter->stats.mprcl; in ixgb_update_stats()
1749 netdev->stats.collisions = 0; in ixgb_update_stats()
1753 netdev->stats.rx_errors = in ixgb_update_stats()
1764 netdev->stats.rx_crc_errors = adapter->stats.crcerrs; in ixgb_update_stats()
1765 netdev->stats.rx_fifo_errors = adapter->stats.mpc; in ixgb_update_stats()
1766 netdev->stats.rx_missed_errors = adapter->stats.mpc; in ixgb_update_stats()
1767 netdev->stats.rx_over_errors = adapter->stats.mpc; in ixgb_update_stats()
1769 netdev->stats.tx_errors = 0; in ixgb_update_stats()
1770 netdev->stats.rx_frame_errors = 0; in ixgb_update_stats()
1771 netdev->stats.tx_aborted_errors = 0; in ixgb_update_stats()
1772 netdev->stats.tx_carrier_errors = 0; in ixgb_update_stats()
1773 netdev->stats.tx_fifo_errors = 0; in ixgb_update_stats()
1774 netdev->stats.tx_heartbeat_errors = 0; in ixgb_update_stats()
1775 netdev->stats.tx_window_errors = 0; in ixgb_update_stats()
1788 struct net_device *netdev = data; in ixgb_intr() local
1789 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_intr()
1845 struct net_device *netdev = adapter->netdev; in ixgb_clean_tx_irq() local
1881 if (unlikely(cleaned && netif_carrier_ok(netdev) && in ixgb_clean_tx_irq()
1887 if (netif_queue_stopped(netdev) && in ixgb_clean_tx_irq()
1889 netif_wake_queue(netdev); in ixgb_clean_tx_irq()
1903 netif_err(adapter, drv, adapter->netdev, in ixgb_clean_tx_irq()
1922 netif_stop_queue(netdev); in ixgb_clean_tx_irq()
1997 struct net_device *netdev = adapter->netdev; in ixgb_clean_rx_irq() local
2076 skb->protocol = eth_type_trans(skb, netdev); in ixgb_clean_rx_irq()
2116 struct net_device *netdev = adapter->netdev; in ixgb_alloc_rx_buffers() local
2138 skb = netdev_alloc_skb_ip_align(netdev, adapter->rx_buffer_len); in ixgb_alloc_rx_buffers()
2207 ixgb_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid) in ixgb_vlan_rx_add_vid() argument
2209 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_vlan_rx_add_vid()
2224 ixgb_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid) in ixgb_vlan_rx_kill_vid() argument
2226 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_vlan_rx_kill_vid()
2246 ixgb_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid); in ixgb_restore_vlan()
2277 struct net_device *netdev = pci_get_drvdata(pdev); in ixgb_io_error_detected() local
2278 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_io_error_detected()
2280 netif_device_detach(netdev); in ixgb_io_error_detected()
2285 if (netif_running(netdev)) in ixgb_io_error_detected()
2305 struct net_device *netdev = pci_get_drvdata(pdev); in ixgb_io_slot_reset() local
2306 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_io_slot_reset()
2309 netif_err(adapter, probe, adapter->netdev, in ixgb_io_slot_reset()
2320 netif_carrier_off(netdev); in ixgb_io_slot_reset()
2321 netif_stop_queue(netdev); in ixgb_io_slot_reset()
2326 netif_err(adapter, probe, adapter->netdev, in ixgb_io_slot_reset()
2330 ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr); in ixgb_io_slot_reset()
2331 memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); in ixgb_io_slot_reset()
2333 if (!is_valid_ether_addr(netdev->perm_addr)) { in ixgb_io_slot_reset()
2334 netif_err(adapter, probe, adapter->netdev, in ixgb_io_slot_reset()
2352 struct net_device *netdev = pci_get_drvdata(pdev); in ixgb_io_resume() local
2353 struct ixgb_adapter *adapter = netdev_priv(netdev); in ixgb_io_resume()
2357 if (netif_running(netdev)) { in ixgb_io_resume()
2364 netif_device_attach(netdev); in ixgb_io_resume()