Lines Matching refs:ndev
125 static void print_eth_id(struct net_device *ndev) in print_eth_id() argument
127 printk(KERN_INFO "%s: %s, Port %c\n", ndev->name, BDX_NIC_NAME, in print_eth_id()
128 (ndev->if_port == 0) ? 'A' : 'B'); in print_eth_id()
205 if (netif_carrier_ok(priv->ndev)) { in bdx_link_changed()
206 netif_stop_queue(priv->ndev); in bdx_link_changed()
207 netif_carrier_off(priv->ndev); in bdx_link_changed()
208 ERR("%s: Link Down\n", priv->ndev->name); in bdx_link_changed()
211 if (!netif_carrier_ok(priv->ndev)) { in bdx_link_changed()
212 netif_wake_queue(priv->ndev); in bdx_link_changed()
213 netif_carrier_on(priv->ndev); in bdx_link_changed()
214 ERR("%s: Link Up\n", priv->ndev->name); in bdx_link_changed()
230 ERR("%s: PCI-E Link Fault\n", priv->ndev->name); in bdx_isr_extra()
233 ERR("%s: PCI-E Time Out\n", priv->ndev->name); in bdx_isr_extra()
253 struct net_device *ndev = dev; in bdx_isr_napi() local
254 struct bdx_priv *priv = netdev_priv(ndev); in bdx_isr_napi()
338 ERR("%s: firmware loading failed\n", priv->ndev->name); in bdx_fw_load()
344 DBG("%s: firmware loading success\n", priv->ndev->name); in bdx_fw_load()
349 static void bdx_restore_mac(struct net_device *ndev, struct bdx_priv *priv) in bdx_restore_mac() argument
358 val = (ndev->dev_addr[0] << 8) | (ndev->dev_addr[1]); in bdx_restore_mac()
360 val = (ndev->dev_addr[2] << 8) | (ndev->dev_addr[3]); in bdx_restore_mac()
362 val = (ndev->dev_addr[4] << 8) | (ndev->dev_addr[5]); in bdx_restore_mac()
377 struct net_device *ndev = priv->ndev; in bdx_hw_start() local
405 bdx_restore_mac(priv->ndev, priv); in bdx_hw_start()
412 ndev->name, ndev))) in bdx_hw_start()
426 free_irq(priv->pdev->irq, priv->ndev); in bdx_hw_stop()
428 netif_carrier_off(priv->ndev); in bdx_hw_stop()
429 netif_stop_queue(priv->ndev); in bdx_hw_stop()
502 priv->ndev->name); in bdx_sw_reset()
556 static int bdx_close(struct net_device *ndev) in bdx_close() argument
561 priv = netdev_priv(ndev); in bdx_close()
584 static int bdx_open(struct net_device *ndev) in bdx_open() argument
590 priv = netdev_priv(ndev); in bdx_open()
592 if (netif_running(ndev)) in bdx_open()
593 netif_stop_queue(priv->ndev); in bdx_open()
616 bdx_close(ndev); in bdx_open()
633 static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd) in bdx_ioctl_priv() argument
635 struct bdx_priv *priv = netdev_priv(ndev); in bdx_ioctl_priv()
682 static int bdx_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) in bdx_ioctl() argument
686 RET(bdx_ioctl_priv(ndev, ifr, cmd)); in bdx_ioctl()
698 static void __bdx_vlan_rx_vid(struct net_device *ndev, uint16_t vid, int enable) in __bdx_vlan_rx_vid() argument
700 struct bdx_priv *priv = netdev_priv(ndev); in __bdx_vlan_rx_vid()
727 static void bdx_vlan_rx_add_vid(struct net_device *ndev, uint16_t vid) in bdx_vlan_rx_add_vid() argument
729 __bdx_vlan_rx_vid(ndev, vid, 1); in bdx_vlan_rx_add_vid()
737 static void bdx_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid) in bdx_vlan_rx_kill_vid() argument
739 __bdx_vlan_rx_vid(ndev, vid, 0); in bdx_vlan_rx_kill_vid()
748 bdx_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp) in bdx_vlan_rx_register() argument
750 struct bdx_priv *priv = netdev_priv(ndev); in bdx_vlan_rx_register()
753 DBG("device='%s', group='%p'\n", ndev->name, grp); in bdx_vlan_rx_register()
765 static int bdx_change_mtu(struct net_device *ndev, int new_mtu) in bdx_change_mtu() argument
769 if (new_mtu == ndev->mtu) in bdx_change_mtu()
775 BDX_DRV_NAME, ndev->name, new_mtu, ETH_ZLEN); in bdx_change_mtu()
779 ndev->mtu = new_mtu; in bdx_change_mtu()
780 if (netif_running(ndev)) { in bdx_change_mtu()
781 bdx_close(ndev); in bdx_change_mtu()
782 bdx_open(ndev); in bdx_change_mtu()
787 static void bdx_setmulti(struct net_device *ndev) in bdx_setmulti() argument
789 struct bdx_priv *priv = netdev_priv(ndev); in bdx_setmulti()
800 if (ndev->flags & IFF_PROMISC) { in bdx_setmulti()
802 } else if (ndev->flags & IFF_ALLMULTI) { in bdx_setmulti()
806 } else if (ndev->mc_count) { in bdx_setmulti()
824 mclist = ndev->mc_list; in bdx_setmulti()
838 DBG("only own mac %d\n", ndev->mc_count); in bdx_setmulti()
847 static int bdx_set_mac(struct net_device *ndev, void *p) in bdx_set_mac() argument
849 struct bdx_priv *priv = netdev_priv(ndev); in bdx_set_mac()
857 memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len); in bdx_set_mac()
858 bdx_restore_mac(ndev, priv); in bdx_set_mac()
874 priv->ndev->dev_addr[i * 2 + 1] = macAddress[i]; in bdx_read_mac()
875 priv->ndev->dev_addr[i * 2] = macAddress[i] >> 8; in bdx_read_mac()
929 static struct net_device_stats *bdx_get_stats(struct net_device *ndev) in bdx_get_stats() argument
931 struct bdx_priv *priv = netdev_priv(ndev); in bdx_get_stats()
1033 priv->rxf_fifo0.m.pktsz = priv->ndev->mtu + VLAN_ETH_HLEN; in bdx_rx_init()
1037 ERR("%s: %s: Rx init failed\n", BDX_DRV_NAME, priv->ndev->name); in bdx_rx_init()
1118 skb->dev = priv->ndev; in bdx_rx_alloc_skbs()
1160 priv->ndev->name, in NETIF_RX_MUX()
1306 skb->dev = priv->ndev; in bdx_rx_receive()
1308 skb->protocol = eth_type_trans(skb, priv->ndev); in bdx_rx_receive()
1592 ERR("tehuti: %s: Tx init failed\n", priv->ndev->name); in bdx_tx_init()
1623 static int bdx_tx_transmit(struct sk_buff *skb, struct net_device *ndev) in bdx_tx_transmit() argument
1625 struct bdx_priv *priv = netdev_priv(ndev); in bdx_tx_transmit()
1643 BDX_DRV_NAME, ndev->name); in bdx_tx_transmit()
1716 ndev->trans_start = jiffies; in bdx_tx_transmit()
1723 BDX_DRV_NAME, ndev->name, priv->tx_level); in bdx_tx_transmit()
1724 netif_stop_queue(ndev); in bdx_tx_transmit()
1783 if (unlikely(netif_queue_stopped(priv->ndev) in bdx_tx_cleanup()
1784 && netif_carrier_ok(priv->ndev) in bdx_tx_cleanup()
1787 BDX_DRV_NAME, priv->ndev->name, priv->tx_level); in bdx_tx_cleanup()
1788 netif_wake_queue(priv->ndev); in bdx_tx_cleanup()
1922 struct net_device *ndev; in bdx_probe() local
2005 if (!(ndev = alloc_etherdev(sizeof(struct bdx_priv)))) { 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_ethtool_ops(ndev); /* ethtool interface */ in bdx_probe()
2018 ndev->if_port = port; in bdx_probe()
2019 ndev->base_addr = pciaddr; in bdx_probe()
2020 ndev->mem_start = pciaddr; in bdx_probe()
2021 ndev->mem_end = pciaddr + regionSize; in bdx_probe()
2022 ndev->irq = pdev->irq; in bdx_probe()
2023 ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG | NETIF_F_TSO in bdx_probe()
2030 ndev->features |= NETIF_F_HIGHDMA; in bdx_probe()
2033 priv = nic->priv[port] = netdev_priv(ndev); in bdx_probe()
2039 priv->ndev = ndev; in bdx_probe()
2043 netif_napi_add(ndev, &priv->napi, bdx_poll, 64); in bdx_probe()
2068 ndev->features |= NETIF_F_LLTX; in bdx_probe()
2077 SET_NETDEV_DEV(ndev, &pdev->dev); in bdx_probe()
2078 if ((err = register_netdev(ndev))) { in bdx_probe()
2082 netif_carrier_off(ndev); in bdx_probe()
2083 netif_stop_queue(ndev); in bdx_probe()
2085 print_eth_id(ndev); in bdx_probe()
2090 free_netdev(ndev); in bdx_probe()
2459 struct net_device *ndev; in bdx_remove() local
2463 ndev = nic->priv[port]->ndev; in bdx_remove()
2464 unregister_netdev(ndev); in bdx_remove()
2465 free_netdev(ndev); in bdx_remove()