Lines Matching refs:netdev

254 	struct net_device *netdev = adapter->netdev;  in atl1c_check_link_status()  local
267 netif_carrier_off(netdev); in atl1c_check_link_status()
295 atl1c_driver_name, netdev->name, in atl1c_check_link_status()
300 if (!netif_carrier_ok(netdev)) in atl1c_check_link_status()
301 netif_carrier_on(netdev); in atl1c_check_link_status()
307 struct net_device *netdev = adapter->netdev; in atl1c_link_chg_event() local
316 if (netif_carrier_ok(netdev)) { in atl1c_link_chg_event()
318 netif_carrier_off(netdev); in atl1c_link_chg_event()
322 atl1c_driver_name, netdev->name); in atl1c_link_chg_event()
334 struct net_device *netdev; in atl1c_common_task() local
337 netdev = adapter->netdev; in atl1c_common_task()
343 netif_device_detach(netdev); in atl1c_common_task()
346 netif_device_attach(netdev); in atl1c_common_task()
369 static void atl1c_tx_timeout(struct net_device *netdev, unsigned int txqueue) in atl1c_tx_timeout() argument
371 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_tx_timeout()
387 static void atl1c_set_multi(struct net_device *netdev) in atl1c_set_multi() argument
389 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_set_multi()
398 if (netdev->flags & IFF_PROMISC) { in atl1c_set_multi()
400 } else if (netdev->flags & IFF_ALLMULTI) { in atl1c_set_multi()
414 netdev_for_each_mc_addr(ha, netdev) { in atl1c_set_multi()
431 static void atl1c_vlan_mode(struct net_device *netdev, in atl1c_vlan_mode() argument
434 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_vlan_mode()
454 atl1c_vlan_mode(adapter->netdev, adapter->netdev->features); in atl1c_restore_vlan()
464 static int atl1c_set_mac_addr(struct net_device *netdev, void *p) in atl1c_set_mac_addr() argument
466 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_set_mac_addr()
472 if (netif_running(netdev)) in atl1c_set_mac_addr()
475 eth_hw_addr_set(netdev, addr->sa_data); in atl1c_set_mac_addr()
476 memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len); in atl1c_set_mac_addr()
492 static netdev_features_t atl1c_fix_features(struct net_device *netdev, in atl1c_fix_features() argument
495 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_fix_features()
508 if (netdev->mtu > MAX_TSO_FRAME_SIZE) in atl1c_fix_features()
515 static int atl1c_set_features(struct net_device *netdev, in atl1c_set_features() argument
518 netdev_features_t changed = netdev->features ^ features; in atl1c_set_features()
521 atl1c_vlan_mode(netdev, features); in atl1c_set_features()
526 static void atl1c_set_max_mtu(struct net_device *netdev) in atl1c_set_max_mtu() argument
528 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_set_max_mtu()
536 netdev->max_mtu = MAX_JUMBO_FRAME_SIZE - in atl1c_set_max_mtu()
540 netdev->max_mtu = 9500; in atl1c_set_max_mtu()
544 netdev->max_mtu = ETH_DATA_LEN; in atl1c_set_max_mtu()
556 static int atl1c_change_mtu(struct net_device *netdev, int new_mtu) in atl1c_change_mtu() argument
558 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_change_mtu()
561 if (netif_running(netdev)) { in atl1c_change_mtu()
564 netdev->mtu = new_mtu; in atl1c_change_mtu()
566 atl1c_set_rxbufsize(adapter, netdev); in atl1c_change_mtu()
568 netdev_update_features(netdev); in atl1c_change_mtu()
578 static int atl1c_mdio_read(struct net_device *netdev, int phy_id, int reg_num) in atl1c_mdio_read() argument
580 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_mdio_read()
587 static void atl1c_mdio_write(struct net_device *netdev, int phy_id, in atl1c_mdio_write() argument
590 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_mdio_write()
595 static int atl1c_mii_ioctl(struct net_device *netdev, in atl1c_mii_ioctl() argument
598 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_mii_ioctl()
604 if (!netif_running(netdev)) in atl1c_mii_ioctl()
645 static int atl1c_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) in atl1c_ioctl() argument
651 return atl1c_mii_ioctl(netdev, ifr, cmd); in atl1c_ioctl()
815 hw->max_frame_size = adapter->netdev->mtu; in atl1c_sw_init()
835 atl1c_set_rxbufsize(adapter, adapter->netdev); in atl1c_sw_init()
888 netdev_tx_reset_queue(netdev_get_tx_queue(adapter->netdev, queue)); in atl1c_clean_tx_ring()
1470 struct net_device *netdev = adapter->netdev; in atl1c_configure() local
1486 atl1c_set_multi(netdev); in atl1c_configure()
1534 static struct net_device_stats *atl1c_get_stats(struct net_device *netdev) in atl1c_get_stats() argument
1536 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_get_stats()
1538 struct net_device_stats *net_stats = &netdev->stats; in atl1c_get_stats()
1618 if (netif_tx_queue_stopped(txq) && netif_carrier_ok(adapter->netdev)) in atl1c_clean_tx()
1671 struct net_device *netdev = data; in atl1c_intr() local
1672 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_intr()
1718 netdev->stats.tx_carrier_errors++; in atl1c_intr()
1779 skb = netdev_alloc_skb(adapter->netdev, adapter->rx_buffer_len + 64); in atl1c_alloc_rx_buffer()
1805 netif_warn(adapter, rx_err, adapter->netdev, "RX dma_map_single failed"); in atl1c_alloc_rx_buffer()
1876 struct net_device *netdev = adapter->netdev; in atl1c_clean_rx() local
1885 if (!netif_carrier_ok(adapter->netdev)) in atl1c_clean_rx()
1934 skb->protocol = eth_type_trans(skb, netdev); in atl1c_clean_rx()
1968 static void atl1c_netpoll(struct net_device *netdev) in atl1c_netpoll() argument
1970 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_netpoll()
1973 atl1c_intr(adapter->pdev->irq, netdev); in atl1c_netpoll()
2269 struct net_device *netdev) in atl1c_xmit_frame() argument
2271 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_xmit_frame()
2273 struct netdev_queue *txq = netdev_get_tx_queue(netdev, queue); in atl1c_xmit_frame()
2314 netif_info(adapter, tx_done, adapter->netdev, in atl1c_xmit_frame()
2331 struct net_device *netdev = adapter->netdev; in atl1c_free_irq() local
2333 free_irq(adapter->pdev->irq, netdev); in atl1c_free_irq()
2342 struct net_device *netdev = adapter->netdev; in atl1c_request_irq() local
2359 netdev->name, netdev); in atl1c_request_irq()
2387 struct net_device *netdev = adapter->netdev; in atl1c_up() local
2391 netif_carrier_off(netdev); in atl1c_up()
2408 netif_start_queue(netdev); in atl1c_up()
2419 struct net_device *netdev = adapter->netdev; in atl1c_down() local
2427 netif_carrier_off(netdev); in atl1c_down()
2457 static int atl1c_open(struct net_device *netdev) in atl1c_open() argument
2459 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_open()
2495 static int atl1c_close(struct net_device *netdev) in atl1c_close() argument
2497 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_close()
2509 struct net_device *netdev = dev_get_drvdata(dev); in atl1c_suspend() local
2510 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_suspend()
2515 if (netif_running(netdev)) { in atl1c_suspend()
2519 netif_device_detach(netdev); in atl1c_suspend()
2533 struct net_device *netdev = dev_get_drvdata(dev); in atl1c_resume() local
2534 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_resume()
2543 netif_device_attach(netdev); in atl1c_resume()
2544 if (netif_running(netdev)) in atl1c_resume()
2553 struct net_device *netdev = pci_get_drvdata(pdev); in atl1c_shutdown() local
2554 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_shutdown()
2579 static int atl1c_init_netdev(struct net_device *netdev, struct pci_dev *pdev) in atl1c_init_netdev() argument
2581 SET_NETDEV_DEV(netdev, &pdev->dev); in atl1c_init_netdev()
2582 pci_set_drvdata(pdev, netdev); in atl1c_init_netdev()
2584 netdev->netdev_ops = &atl1c_netdev_ops; in atl1c_init_netdev()
2585 netdev->watchdog_timeo = AT_TX_WATCHDOG; in atl1c_init_netdev()
2586 netdev->min_mtu = ETH_ZLEN - (ETH_HLEN + VLAN_HLEN); in atl1c_init_netdev()
2587 atl1c_set_ethtool_ops(netdev); in atl1c_init_netdev()
2590 netdev->hw_features = NETIF_F_SG | in atl1c_init_netdev()
2595 netdev->features = netdev->hw_features | in atl1c_init_netdev()
2613 struct net_device *netdev; in atl1c_probe() local
2662 netdev = alloc_etherdev_mq(sizeof(struct atl1c_adapter), queue_count); in atl1c_probe()
2663 if (netdev == NULL) { in atl1c_probe()
2668 err = atl1c_init_netdev(netdev, pdev); in atl1c_probe()
2673 adapter = netdev_priv(netdev); in atl1c_probe()
2675 adapter->netdev = netdev; in atl1c_probe()
2685 adapter->mii.dev = netdev; in atl1c_probe()
2690 dev_set_threaded(netdev, true); in atl1c_probe()
2692 netif_napi_add(netdev, &adapter->rrd_ring[i].napi, in atl1c_probe()
2695 netif_napi_add_tx(netdev, &adapter->tpd_ring[i].napi, in atl1c_probe()
2705 atl1c_set_max_mtu(netdev); in atl1c_probe()
2727 netdev->addr_assign_type = NET_ADDR_RANDOM; in atl1c_probe()
2729 eth_hw_addr_set(netdev, adapter->hw.mac_addr); in atl1c_probe()
2737 err = register_netdev(netdev); in atl1c_probe()
2750 free_netdev(netdev); in atl1c_probe()
2772 struct net_device *netdev = pci_get_drvdata(pdev); in atl1c_remove() local
2773 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_remove()
2775 unregister_netdev(netdev); in atl1c_remove()
2784 free_netdev(netdev); in atl1c_remove()
2798 struct net_device *netdev = pci_get_drvdata(pdev); in atl1c_io_error_detected() local
2799 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_io_error_detected()
2801 netif_device_detach(netdev); in atl1c_io_error_detected()
2806 if (netif_running(netdev)) in atl1c_io_error_detected()
2824 struct net_device *netdev = pci_get_drvdata(pdev); in atl1c_io_slot_reset() local
2825 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_io_slot_reset()
2853 struct net_device *netdev = pci_get_drvdata(pdev); in atl1c_io_resume() local
2854 struct atl1c_adapter *adapter = netdev_priv(netdev); in atl1c_io_resume()
2856 if (netif_running(netdev)) { in atl1c_io_resume()
2865 netif_device_attach(netdev); in atl1c_io_resume()