Lines Matching refs:ndev

124 static void print_eth_id(struct net_device *ndev)  in print_eth_id()  argument
126 netdev_info(ndev, "%s, Port %c\n", in print_eth_id()
127 BDX_NIC_NAME, (ndev->if_port == 0) ? 'A' : 'B'); in print_eth_id()
206 if (netif_carrier_ok(priv->ndev)) { in bdx_link_changed()
207 netif_stop_queue(priv->ndev); in bdx_link_changed()
208 netif_carrier_off(priv->ndev); in bdx_link_changed()
209 netdev_err(priv->ndev, "Link Down\n"); in bdx_link_changed()
212 if (!netif_carrier_ok(priv->ndev)) { in bdx_link_changed()
213 netif_wake_queue(priv->ndev); in bdx_link_changed()
214 netif_carrier_on(priv->ndev); in bdx_link_changed()
215 netdev_err(priv->ndev, "Link Up\n"); in bdx_link_changed()
231 netdev_err(priv->ndev, "PCI-E Link Fault\n"); in bdx_isr_extra()
234 netdev_err(priv->ndev, "PCI-E Time Out\n"); in bdx_isr_extra()
254 struct net_device *ndev = dev; in bdx_isr_napi() local
255 struct bdx_priv *priv = netdev_priv(ndev); in bdx_isr_napi()
352 netdev_err(priv->ndev, "firmware loading failed\n"); in bdx_fw_load()
360 DBG("%s: firmware loading success\n", priv->ndev->name); in bdx_fw_load()
365 static void bdx_restore_mac(struct net_device *ndev, struct bdx_priv *priv) in bdx_restore_mac() argument
374 val = (ndev->dev_addr[0] << 8) | (ndev->dev_addr[1]); in bdx_restore_mac()
376 val = (ndev->dev_addr[2] << 8) | (ndev->dev_addr[3]); in bdx_restore_mac()
378 val = (ndev->dev_addr[4] << 8) | (ndev->dev_addr[5]); in bdx_restore_mac()
394 struct net_device *ndev = priv->ndev; in bdx_hw_start() local
422 bdx_restore_mac(priv->ndev, priv); in bdx_hw_start()
430 ndev->name, ndev); in bdx_hw_start()
445 free_irq(priv->pdev->irq, priv->ndev); in bdx_hw_stop()
447 netif_carrier_off(priv->ndev); in bdx_hw_stop()
448 netif_stop_queue(priv->ndev); in bdx_hw_stop()
520 netdev_err(priv->ndev, "SW reset timeout. continuing anyway\n"); in bdx_sw_reset()
574 static int bdx_close(struct net_device *ndev) in bdx_close() argument
579 priv = netdev_priv(ndev); in bdx_close()
602 static int bdx_open(struct net_device *ndev) in bdx_open() argument
608 priv = netdev_priv(ndev); in bdx_open()
610 if (netif_running(ndev)) in bdx_open()
611 netif_stop_queue(priv->ndev); in bdx_open()
631 bdx_close(ndev); in bdx_open()
641 static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) in bdx_ioctl_priv() argument
643 struct bdx_priv *priv = netdev_priv(ndev); in bdx_ioctl_priv()
690 static int bdx_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) in bdx_ioctl() argument
694 RET(bdx_ioctl_priv(ndev, ifr, cmd)); in bdx_ioctl()
707 static void __bdx_vlan_rx_vid(struct net_device *ndev, uint16_t vid, int enable) in __bdx_vlan_rx_vid() argument
709 struct bdx_priv *priv = netdev_priv(ndev); in __bdx_vlan_rx_vid()
736 static int bdx_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) in bdx_vlan_rx_add_vid() argument
738 __bdx_vlan_rx_vid(ndev, vid, 1); in bdx_vlan_rx_add_vid()
747 static int bdx_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid) in bdx_vlan_rx_kill_vid() argument
749 __bdx_vlan_rx_vid(ndev, vid, 0); in bdx_vlan_rx_kill_vid()
760 static int bdx_change_mtu(struct net_device *ndev, int new_mtu) in bdx_change_mtu() argument
764 if (new_mtu == ndev->mtu) in bdx_change_mtu()
769 netdev_err(ndev, "mtu %d is less then minimal %d\n", in bdx_change_mtu()
774 ndev->mtu = new_mtu; in bdx_change_mtu()
775 if (netif_running(ndev)) { in bdx_change_mtu()
776 bdx_close(ndev); in bdx_change_mtu()
777 bdx_open(ndev); in bdx_change_mtu()
782 static void bdx_setmulti(struct net_device *ndev) in bdx_setmulti() argument
784 struct bdx_priv *priv = netdev_priv(ndev); in bdx_setmulti()
795 if (ndev->flags & IFF_PROMISC) { in bdx_setmulti()
797 } else if (ndev->flags & IFF_ALLMULTI) { in bdx_setmulti()
801 } else if (!netdev_mc_empty(ndev)) { in bdx_setmulti()
820 netdev_for_each_mc_addr(ha, ndev) { in bdx_setmulti()
831 DBG("only own mac %d\n", netdev_mc_count(ndev)); in bdx_setmulti()
840 static int bdx_set_mac(struct net_device *ndev, void *p) in bdx_set_mac() argument
842 struct bdx_priv *priv = netdev_priv(ndev); in bdx_set_mac()
850 memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len); in bdx_set_mac()
851 bdx_restore_mac(ndev, priv); in bdx_set_mac()
867 priv->ndev->dev_addr[i * 2 + 1] = macAddress[i]; in bdx_read_mac()
868 priv->ndev->dev_addr[i * 2] = macAddress[i] >> 8; in bdx_read_mac()
1018 priv->rxf_fifo0.m.pktsz = priv->ndev->mtu + VLAN_ETH_HLEN; in bdx_rx_init()
1022 netdev_err(priv->ndev, "Rx init failed\n"); in bdx_rx_init()
1104 skb = netdev_alloc_skb(priv->ndev, f->m.pktsz + NET_IP_ALIGN); in bdx_rx_alloc_skbs()
1148 priv->ndev->name, in NETIF_RX_MUX()
1208 struct net_device *ndev = priv->ndev; in bdx_rx_receive() local
1262 ndev->stats.rx_errors++; in bdx_rx_receive()
1273 (skb2 = netdev_alloc_skb(priv->ndev, len + NET_IP_ALIGN))) { in bdx_rx_receive()
1289 ndev->stats.rx_bytes += len; in bdx_rx_receive()
1292 skb->protocol = eth_type_trans(skb, ndev); in bdx_rx_receive()
1306 ndev->stats.rx_packets += done; in bdx_rx_receive()
1582 netdev_err(priv->ndev, "Tx init failed\n"); in bdx_tx_init()
1616 struct net_device *ndev) in bdx_tx_transmit() argument
1618 struct bdx_priv *priv = netdev_priv(ndev); in bdx_tx_transmit()
1636 BDX_DRV_NAME, ndev->name); in bdx_tx_transmit()
1710 ndev->trans_start = jiffies; /* NETIF_F_LLTX driver :( */ in bdx_tx_transmit()
1712 ndev->stats.tx_packets++; in bdx_tx_transmit()
1713 ndev->stats.tx_bytes += skb->len; in bdx_tx_transmit()
1717 BDX_DRV_NAME, ndev->name, priv->tx_level); in bdx_tx_transmit()
1718 netif_stop_queue(ndev); in bdx_tx_transmit()
1779 if (unlikely(netif_queue_stopped(priv->ndev) && in bdx_tx_cleanup()
1780 netif_carrier_ok(priv->ndev) && in bdx_tx_cleanup()
1783 BDX_DRV_NAME, priv->ndev->name, priv->tx_level); in bdx_tx_cleanup()
1784 netif_wake_queue(priv->ndev); in bdx_tx_cleanup()
1919 struct net_device *ndev; in bdx_probe() local
2005 ndev = alloc_etherdev(sizeof(struct bdx_priv)); in bdx_probe()
2006 if (!ndev) { in bdx_probe()
2011 ndev->netdev_ops = &bdx_netdev_ops; in bdx_probe()
2012 ndev->tx_queue_len = BDX_NDEV_TXQ_LEN; in bdx_probe()
2014 bdx_set_ethtool_ops(ndev); /* ethtool interface */ in bdx_probe()
2018 ndev->if_port = port; in bdx_probe()
2019 ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO in bdx_probe()
2023 ndev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG | in bdx_probe()
2027 ndev->features |= NETIF_F_HIGHDMA; in bdx_probe()
2030 priv = nic->priv[port] = netdev_priv(ndev); in bdx_probe()
2035 priv->ndev = ndev; in bdx_probe()
2039 netif_napi_add(ndev, &priv->napi, bdx_poll, 64); in bdx_probe()
2064 ndev->features |= NETIF_F_LLTX; in bdx_probe()
2073 SET_NETDEV_DEV(ndev, &pdev->dev); in bdx_probe()
2074 err = register_netdev(ndev); in bdx_probe()
2079 netif_carrier_off(ndev); in bdx_probe()
2080 netif_stop_queue(ndev); in bdx_probe()
2082 print_eth_id(ndev); in bdx_probe()
2087 free_netdev(ndev); in bdx_probe()
2426 struct net_device *ndev; in bdx_remove() local
2430 ndev = nic->priv[port]->ndev; in bdx_remove()
2431 unregister_netdev(ndev); in bdx_remove()
2432 free_netdev(ndev); in bdx_remove()