Lines Matching refs:netdev
128 spider_net_write_phy(struct net_device *netdev, int mii_id, in spider_net_write_phy() argument
131 struct spider_net_card *card = netdev_priv(netdev); in spider_net_write_phy()
152 spider_net_read_phy(struct net_device *netdev, int mii_id, int reg) in spider_net_read_phy() argument
154 struct spider_net_card *card = netdev_priv(netdev); in spider_net_read_phy()
183 bmsr = spider_net_read_phy(card->netdev, phy->mii_id, MII_BMSR); in spider_net_setup_aneg()
184 estat = spider_net_read_phy(card->netdev, phy->mii_id, MII_ESTATUS); in spider_net_setup_aneg()
246 struct net_device *netdev = card->netdev; in spider_net_set_promisc() local
248 if (netdev->flags & IFF_PROMISC) { in spider_net_set_promisc()
255 macu = netdev->dev_addr[0]; in spider_net_set_promisc()
257 macu |= netdev->dev_addr[1]; in spider_net_set_promisc()
258 memcpy(&macl, &netdev->dev_addr[2], sizeof(macl)); in spider_net_set_promisc()
407 descr->skb = netdev_alloc_skb(card->netdev, in spider_net_prepare_rx_descr()
411 dev_err(&card->netdev->dev, in spider_net_prepare_rx_descr()
433 dev_err(&card->netdev->dev, "Could not iommu-map rx buffer\n"); in spider_net_prepare_rx_descr()
568 spider_net_get_multicast_hash(struct net_device *netdev, __u8 *addr) in spider_net_get_multicast_hash() argument
580 crc = crc32_be(~0, addr_for_crc, netdev->addr_len); in spider_net_get_multicast_hash()
599 spider_net_set_multi(struct net_device *netdev) in spider_net_set_multi() argument
605 struct spider_net_card *card = netdev_priv(netdev); in spider_net_set_multi()
610 if (netdev->flags & IFF_ALLMULTI) { in spider_net_set_multi()
621 netdev_for_each_mc_addr(ha, netdev) { in spider_net_set_multi()
622 hash = spider_net_get_multicast_hash(netdev, ha->addr); in spider_net_set_multi()
668 dev_err(&card->netdev->dev, "could not iommu-map packet (%p, %i). " in spider_net_prepare_tx_descr()
708 netif_trans_update(card->netdev); /* set netdev watchdog timer */ in spider_net_prepare_tx_descr()
770 struct net_device *dev = card->netdev; in spider_net_release_tx_chain()
809 dev_err(&card->netdev->dev, "forcing end of tx descriptor " in spider_net_release_tx_chain()
886 spider_net_xmit(struct sk_buff *skb, struct net_device *netdev) in spider_net_xmit() argument
889 struct spider_net_card *card = netdev_priv(netdev); in spider_net_xmit()
894 netdev->stats.tx_dropped++; in spider_net_xmit()
895 netif_stop_queue(netdev); in spider_net_xmit()
918 (card->netdev->flags & IFF_UP)) { in spider_net_cleanup_tx_ring()
920 netif_wake_queue(card->netdev); in spider_net_cleanup_tx_ring()
934 spider_net_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) in spider_net_do_ioctl() argument
956 struct net_device *netdev = card->netdev; in spider_net_pass_skb_up() local
966 skb->protocol = eth_type_trans(skb, netdev); in spider_net_pass_skb_up()
970 if (netdev->features & NETIF_F_RXCSUM) { in spider_net_pass_skb_up()
982 netdev->stats.rx_packets++; in spider_net_pass_skb_up()
983 netdev->stats.rx_bytes += skb->len; in spider_net_pass_skb_up()
995 struct device *dev = &card->netdev->dev; in show_rx_chain()
1151 struct net_device *dev = card->netdev; in spider_net_decode_one_descr()
1187 dev_err(&card->netdev->dev, in spider_net_decode_one_descr()
1196 dev_err(&card->netdev->dev, in spider_net_decode_one_descr()
1204 dev_err(&card->netdev->dev, "bad status, cmd_status=x%08x\n", in spider_net_decode_one_descr()
1289 spider_net_change_mtu(struct net_device *netdev, int new_mtu) in spider_net_change_mtu() argument
1296 netdev->mtu = new_mtu; in spider_net_change_mtu()
1309 spider_net_set_mac(struct net_device *netdev, void *p) in spider_net_set_mac() argument
1311 struct spider_net_card *card = netdev_priv(netdev); in spider_net_set_mac()
1318 memcpy(netdev->dev_addr, addr->sa_data, ETH_ALEN); in spider_net_set_mac()
1326 macu = (netdev->dev_addr[0]<<24) + (netdev->dev_addr[1]<<16) + in spider_net_set_mac()
1327 (netdev->dev_addr[2]<<8) + (netdev->dev_addr[3]); in spider_net_set_mac()
1328 macl = (netdev->dev_addr[4]<<8) + (netdev->dev_addr[5]); in spider_net_set_mac()
1351 spider_net_link_reset(struct net_device *netdev) in spider_net_link_reset() argument
1354 struct spider_net_card *card = netdev_priv(netdev); in spider_net_link_reset()
1419 dev_err(&card->netdev->dev, "PHY write queue full\n"); in spider_net_handle_error_irq()
1586 dev_err(&card->netdev->dev, "Error interrupt, GHIINT0STS = 0x%08x, " in spider_net_handle_error_irq()
1609 struct net_device *netdev = ptr; in spider_net_interrupt() local
1610 struct spider_net_card *card = netdev_priv(netdev); in spider_net_interrupt()
1631 spider_net_link_reset(netdev); in spider_net_interrupt()
1651 spider_net_poll_controller(struct net_device *netdev) in spider_net_poll_controller() argument
1653 disable_irq(netdev->irq); in spider_net_poll_controller()
1654 spider_net_interrupt(netdev->irq, netdev); in spider_net_poll_controller()
1655 enable_irq(netdev->irq); in spider_net_poll_controller()
1881 dev_err(&card->netdev->dev, in spider_net_init_firmware()
1906 dev_err(&card->netdev->dev, in spider_net_init_firmware()
1917 dev_err(&card->netdev->dev, in spider_net_init_firmware()
1933 spider_net_open(struct net_device *netdev) in spider_net_open() argument
1935 struct spider_net_card *card = netdev_priv(netdev); in spider_net_open()
1963 spider_net_set_multi(netdev); in spider_net_open()
1968 if (request_irq(netdev->irq, spider_net_interrupt, in spider_net_open()
1969 IRQF_SHARED, netdev->name, netdev)) in spider_net_open()
1974 netif_start_queue(netdev); in spider_net_open()
1975 netif_carrier_on(netdev); in spider_net_open()
2008 card->netdev->name); in spider_net_link_phy()
2060 card->netdev->name, phy->speed, in spider_net_link_phy()
2083 phy->dev = card->netdev; in spider_net_setup_phy()
2089 id = spider_net_read_phy(card->netdev, phy->mii_id, MII_BMSR); in spider_net_setup_phy()
2142 spider_net_stop(struct net_device *netdev) in spider_net_stop() argument
2144 struct spider_net_card *card = netdev_priv(netdev); in spider_net_stop()
2147 netif_carrier_off(netdev); in spider_net_stop()
2148 netif_stop_queue(netdev); in spider_net_stop()
2154 free_irq(netdev->irq, netdev); in spider_net_stop()
2184 struct net_device *netdev = card->netdev; in spider_net_tx_timeout_task() local
2186 if (!(netdev->flags & IFF_UP)) in spider_net_tx_timeout_task()
2189 netif_device_detach(netdev); in spider_net_tx_timeout_task()
2190 spider_net_stop(netdev); in spider_net_tx_timeout_task()
2198 spider_net_open(netdev); in spider_net_tx_timeout_task()
2200 netif_device_attach(netdev); in spider_net_tx_timeout_task()
2213 spider_net_tx_timeout(struct net_device *netdev) in spider_net_tx_timeout() argument
2217 card = netdev_priv(netdev); in spider_net_tx_timeout()
2219 if (netdev->flags & IFF_UP) in spider_net_tx_timeout()
2250 spider_net_setup_netdev_ops(struct net_device *netdev) in spider_net_setup_netdev_ops() argument
2252 netdev->netdev_ops = &spider_net_ops; in spider_net_setup_netdev_ops()
2253 netdev->watchdog_timeo = SPIDER_NET_WATCHDOG_TIMEOUT; in spider_net_setup_netdev_ops()
2255 netdev->ethtool_ops = &spider_net_ethtool_ops; in spider_net_setup_netdev_ops()
2270 struct net_device *netdev = card->netdev; in spider_net_setup_netdev() local
2275 SET_NETDEV_DEV(netdev, &card->pdev->dev); in spider_net_setup_netdev()
2277 pci_set_drvdata(card->pdev, netdev); in spider_net_setup_netdev()
2283 netdev->irq = card->pdev->irq; in spider_net_setup_netdev()
2290 netif_napi_add(netdev, &card->napi, in spider_net_setup_netdev()
2293 spider_net_setup_netdev_ops(netdev); in spider_net_setup_netdev()
2295 netdev->hw_features = NETIF_F_RXCSUM | NETIF_F_IP_CSUM; in spider_net_setup_netdev()
2297 netdev->features |= NETIF_F_RXCSUM; in spider_net_setup_netdev()
2298 netdev->features |= NETIF_F_IP_CSUM | NETIF_F_LLTX; in spider_net_setup_netdev()
2302 netdev->irq = card->pdev->irq; in spider_net_setup_netdev()
2315 result = spider_net_set_mac(netdev, &addr); in spider_net_setup_netdev()
2317 dev_err(&card->netdev->dev, in spider_net_setup_netdev()
2320 result = register_netdev(netdev); in spider_net_setup_netdev()
2323 dev_err(&card->netdev->dev, in spider_net_setup_netdev()
2329 pr_info("Initialized device %s.\n", netdev->name); in spider_net_setup_netdev()
2344 struct net_device *netdev; in spider_net_alloc_card() local
2350 netdev = alloc_etherdev(alloc_size); in spider_net_alloc_card()
2351 if (!netdev) in spider_net_alloc_card()
2354 card = netdev_priv(netdev); in spider_net_alloc_card()
2355 card->netdev = netdev; in spider_net_alloc_card()
2431 card->netdev->mem_start = mmio_start; in spider_net_setup_pci_dev()
2432 card->netdev->mem_end = mmio_start + mmio_len; in spider_net_setup_pci_dev()
2485 free_netdev(card->netdev); in spider_net_probe()
2502 struct net_device *netdev; in spider_net_remove() local
2505 netdev = pci_get_drvdata(pdev); in spider_net_remove()
2506 card = netdev_priv(netdev); in spider_net_remove()
2511 unregister_netdev(netdev); in spider_net_remove()
2520 free_netdev(netdev); in spider_net_remove()