Lines Matching refs:netdev
462 static void __alx_set_rx_mode(struct net_device *netdev) in __alx_set_rx_mode() argument
464 struct alx_priv *alx = netdev_priv(netdev); in __alx_set_rx_mode()
469 if (!(netdev->flags & IFF_ALLMULTI)) { in __alx_set_rx_mode()
470 netdev_for_each_mc_addr(ha, netdev) in __alx_set_rx_mode()
478 if (netdev->flags & IFF_PROMISC) in __alx_set_rx_mode()
480 if (netdev->flags & IFF_ALLMULTI) in __alx_set_rx_mode()
486 static void alx_set_rx_mode(struct net_device *netdev) in alx_set_rx_mode() argument
488 __alx_set_rx_mode(netdev); in alx_set_rx_mode()
491 static int alx_set_mac_address(struct net_device *netdev, void *data) in alx_set_mac_address() argument
493 struct alx_priv *alx = netdev_priv(netdev); in alx_set_mac_address()
500 if (netdev->addr_assign_type & NET_ADDR_RANDOM) in alx_set_mac_address()
501 netdev->addr_assign_type ^= NET_ADDR_RANDOM; in alx_set_mac_address()
503 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); in alx_set_mac_address()
504 memcpy(hw->mac_addr, addr->sa_data, netdev->addr_len); in alx_set_mac_address()
738 static netdev_features_t alx_fix_features(struct net_device *netdev, in alx_fix_features() argument
741 if (netdev->mtu > ALX_MAX_TSO_PKT_SIZE) in alx_fix_features()
806 static int alx_change_mtu(struct net_device *netdev, int mtu) in alx_change_mtu() argument
808 struct alx_priv *alx = netdev_priv(netdev); in alx_change_mtu()
815 if (netdev->mtu == mtu) in alx_change_mtu()
818 netdev->mtu = mtu; in alx_change_mtu()
822 netdev_update_features(netdev); in alx_change_mtu()
823 if (netif_running(netdev)) in alx_change_mtu()
954 static int alx_open(struct net_device *netdev) in alx_open() argument
956 return __alx_open(netdev_priv(netdev), false); in alx_open()
959 static int alx_stop(struct net_device *netdev) in alx_stop() argument
961 __alx_stop(netdev_priv(netdev)); in alx_stop()
1069 struct net_device *netdev) in alx_start_xmit() argument
1071 struct alx_priv *alx = netdev_priv(netdev); in alx_start_xmit()
1113 static int alx_mdio_read(struct net_device *netdev, in alx_mdio_read() argument
1116 struct alx_priv *alx = netdev_priv(netdev); in alx_mdio_read()
1134 static int alx_mdio_write(struct net_device *netdev, in alx_mdio_write() argument
1137 struct alx_priv *alx = netdev_priv(netdev); in alx_mdio_write()
1149 static int alx_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) in alx_ioctl() argument
1151 struct alx_priv *alx = netdev_priv(netdev); in alx_ioctl()
1153 if (!netif_running(netdev)) in alx_ioctl()
1160 static void alx_poll_controller(struct net_device *netdev) in alx_poll_controller() argument
1162 struct alx_priv *alx = netdev_priv(netdev); in alx_poll_controller()
1239 struct net_device *netdev; in alx_probe() local
1281 netdev = alloc_etherdev(sizeof(*alx)); in alx_probe()
1282 if (!netdev) { in alx_probe()
1287 SET_NETDEV_DEV(netdev, &pdev->dev); in alx_probe()
1288 alx = netdev_priv(netdev); in alx_probe()
1292 alx->dev = netdev; in alx_probe()
1306 netdev->netdev_ops = &alx_netdev_ops; in alx_probe()
1307 netdev->ethtool_ops = &alx_ethtool_ops; in alx_probe()
1308 netdev->irq = pdev->irq; in alx_probe()
1309 netdev->watchdog_timeo = ALX_WATCHDOG_TIME; in alx_probe()
1344 netdev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM; in alx_probe()
1349 eth_hw_addr_random(netdev); in alx_probe()
1350 memcpy(hw->perm_addr, netdev->dev_addr, netdev->addr_len); in alx_probe()
1354 memcpy(netdev->dev_addr, hw->mac_addr, ETH_ALEN); in alx_probe()
1355 memcpy(netdev->perm_addr, hw->perm_addr, ETH_ALEN); in alx_probe()
1359 hw->mdio.dev = netdev; in alx_probe()
1374 netif_carrier_off(netdev); in alx_probe()
1376 err = register_netdev(netdev); in alx_probe()
1382 netdev_info(netdev, in alx_probe()
1384 netdev->dev_addr); in alx_probe()
1391 free_netdev(netdev); in alx_probe()
1459 struct net_device *netdev = alx->dev; in alx_pci_error_detected() local
1466 if (netif_running(netdev)) { in alx_pci_error_detected()
1467 netif_device_detach(netdev); in alx_pci_error_detected()
1512 struct net_device *netdev = alx->dev; in alx_pci_error_resume() local
1518 if (netif_running(netdev)) { in alx_pci_error_resume()
1520 netif_device_attach(netdev); in alx_pci_error_resume()