Lines Matching refs:netdev
26 err = netif_set_real_num_tx_queues(fbn->netdev, in __fbnic_open()
31 err = netif_set_real_num_rx_queues(fbn->netdev, in __fbnic_open()
66 static int fbnic_open(struct net_device *netdev) in fbnic_open() argument
68 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_open()
78 static int fbnic_stop(struct net_device *netdev) in fbnic_stop() argument
80 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_stop()
93 static int fbnic_uc_sync(struct net_device *netdev, const unsigned char *addr) in fbnic_uc_sync() argument
95 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_uc_sync()
111 static int fbnic_uc_unsync(struct net_device *netdev, const unsigned char *addr) in fbnic_uc_unsync() argument
113 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_uc_unsync()
134 static int fbnic_mc_sync(struct net_device *netdev, const unsigned char *addr) in fbnic_mc_sync() argument
136 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_mc_sync()
152 static int fbnic_mc_unsync(struct net_device *netdev, const unsigned char *addr) in fbnic_mc_unsync() argument
154 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_mc_unsync()
175 void __fbnic_set_rx_mode(struct net_device *netdev) in __fbnic_set_rx_mode() argument
177 struct fbnic_net *fbn = netdev_priv(netdev); in __fbnic_set_rx_mode()
185 if (!ether_addr_equal(mac_addr->value.addr8, netdev->dev_addr) || in __fbnic_set_rx_mode()
187 ether_addr_copy(mac_addr->value.addr8, netdev->dev_addr); in __fbnic_set_rx_mode()
194 if (netdev->flags & IFF_BROADCAST) { in __fbnic_set_rx_mode()
206 err = __dev_uc_sync(netdev, fbnic_uc_sync, fbnic_uc_unsync); in __fbnic_set_rx_mode()
209 err = __dev_mc_sync(netdev, fbnic_mc_sync, fbnic_mc_unsync); in __fbnic_set_rx_mode()
213 uc_promisc |= !!(netdev->flags & IFF_PROMISC); in __fbnic_set_rx_mode()
214 mc_promisc |= !!(netdev->flags & IFF_ALLMULTI) || uc_promisc; in __fbnic_set_rx_mode()
271 static void fbnic_set_rx_mode(struct net_device *netdev) in fbnic_set_rx_mode() argument
274 if (netif_running(netdev)) in fbnic_set_rx_mode()
275 __fbnic_set_rx_mode(netdev); in fbnic_set_rx_mode()
278 static int fbnic_set_mac(struct net_device *netdev, void *p) in fbnic_set_mac() argument
285 eth_hw_addr_set(netdev, addr->sa_data); in fbnic_set_mac()
287 fbnic_set_rx_mode(netdev); in fbnic_set_mac()
292 void fbnic_clear_rx_mode(struct net_device *netdev) in fbnic_clear_rx_mode() argument
294 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_clear_rx_mode()
316 __dev_uc_unsync(netdev, NULL); in fbnic_clear_rx_mode()
317 __dev_mc_unsync(netdev, NULL); in fbnic_clear_rx_mode()
490 struct fbnic_net *fbn = netdev_priv(fbd->netdev); in fbnic_netdev_free()
495 free_netdev(fbd->netdev); in fbnic_netdev_free()
496 fbd->netdev = NULL; in fbnic_netdev_free()
510 struct net_device *netdev; in fbnic_netdev_alloc() local
514 netdev = alloc_etherdev_mq(sizeof(*fbn), FBNIC_MAX_RXQS); in fbnic_netdev_alloc()
515 if (!netdev) in fbnic_netdev_alloc()
518 SET_NETDEV_DEV(netdev, fbd->dev); in fbnic_netdev_alloc()
519 fbd->netdev = netdev; in fbnic_netdev_alloc()
521 netdev->netdev_ops = &fbnic_netdev_ops; in fbnic_netdev_alloc()
522 netdev->stat_ops = &fbnic_stat_ops; in fbnic_netdev_alloc()
524 fbnic_set_ethtool_ops(netdev); in fbnic_netdev_alloc()
526 fbn = netdev_priv(netdev); in fbnic_netdev_alloc()
528 fbn->netdev = netdev; in fbnic_netdev_alloc()
547 netdev->features |= in fbnic_netdev_alloc()
553 netdev->hw_features |= netdev->features; in fbnic_netdev_alloc()
554 netdev->vlan_features |= netdev->features; in fbnic_netdev_alloc()
555 netdev->hw_enc_features |= netdev->features; in fbnic_netdev_alloc()
557 netdev->min_mtu = IPV6_MIN_MTU; in fbnic_netdev_alloc()
558 netdev->max_mtu = FBNIC_MAX_JUMBO_FRAME_SIZE - ETH_HLEN; in fbnic_netdev_alloc()
563 netdev->ethtool->wol_enabled = true; in fbnic_netdev_alloc()
567 netif_carrier_off(netdev); in fbnic_netdev_alloc()
569 netif_tx_stop_all_queues(netdev); in fbnic_netdev_alloc()
571 if (fbnic_phylink_init(netdev)) { in fbnic_netdev_alloc()
576 return netdev; in fbnic_netdev_alloc()
599 int fbnic_netdev_register(struct net_device *netdev) in fbnic_netdev_register() argument
601 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_netdev_register()
609 ether_addr_copy(netdev->perm_addr, addr); in fbnic_netdev_register()
610 eth_hw_addr_set(netdev, addr); in fbnic_netdev_register()
620 return register_netdev(netdev); in fbnic_netdev_register()
623 void fbnic_netdev_unregister(struct net_device *netdev) in fbnic_netdev_unregister() argument
625 unregister_netdev(netdev); in fbnic_netdev_unregister()