Lines Matching full:netdev
66 static int fbnic_open(struct net_device *netdev) in fbnic_open() argument
68 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_open()
80 static int fbnic_stop(struct net_device *netdev) in fbnic_stop() argument
82 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_stop()
97 static int fbnic_uc_sync(struct net_device *netdev, const unsigned char *addr) in fbnic_uc_sync() argument
99 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_uc_sync()
115 static int fbnic_uc_unsync(struct net_device *netdev, const unsigned char *addr) in fbnic_uc_unsync() argument
117 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_uc_unsync()
138 static int fbnic_mc_sync(struct net_device *netdev, const unsigned char *addr) in fbnic_mc_sync() argument
140 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_mc_sync()
156 static int fbnic_mc_unsync(struct net_device *netdev, const unsigned char *addr) in fbnic_mc_unsync() argument
158 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_mc_unsync()
179 void __fbnic_set_rx_mode(struct net_device *netdev) in __fbnic_set_rx_mode() argument
181 struct fbnic_net *fbn = netdev_priv(netdev); in __fbnic_set_rx_mode()
189 if (!ether_addr_equal(mac_addr->value.addr8, netdev->dev_addr) || in __fbnic_set_rx_mode()
191 ether_addr_copy(mac_addr->value.addr8, netdev->dev_addr); in __fbnic_set_rx_mode()
198 if (netdev->flags & IFF_BROADCAST) { in __fbnic_set_rx_mode()
210 err = __dev_uc_sync(netdev, fbnic_uc_sync, fbnic_uc_unsync); in __fbnic_set_rx_mode()
213 err = __dev_mc_sync(netdev, fbnic_mc_sync, fbnic_mc_unsync); in __fbnic_set_rx_mode()
217 uc_promisc |= !!(netdev->flags & IFF_PROMISC); in __fbnic_set_rx_mode()
218 mc_promisc |= !!(netdev->flags & IFF_ALLMULTI) || uc_promisc; in __fbnic_set_rx_mode()
276 static void fbnic_set_rx_mode(struct net_device *netdev) in fbnic_set_rx_mode() argument
279 if (netif_running(netdev)) in fbnic_set_rx_mode()
280 __fbnic_set_rx_mode(netdev); in fbnic_set_rx_mode()
283 static int fbnic_set_mac(struct net_device *netdev, void *p) in fbnic_set_mac() argument
290 eth_hw_addr_set(netdev, addr->sa_data); in fbnic_set_mac()
292 fbnic_set_rx_mode(netdev); in fbnic_set_mac()
297 void fbnic_clear_rx_mode(struct net_device *netdev) in fbnic_clear_rx_mode() argument
299 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_clear_rx_mode()
321 __dev_uc_unsync(netdev, NULL); in fbnic_clear_rx_mode()
322 __dev_mc_unsync(netdev, NULL); in fbnic_clear_rx_mode()
325 static int fbnic_hwtstamp_get(struct net_device *netdev, in fbnic_hwtstamp_get() argument
328 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_hwtstamp_get()
335 static int fbnic_hwtstamp_set(struct net_device *netdev, in fbnic_hwtstamp_set() argument
339 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_hwtstamp_set()
384 if (old_rx_filter != config->rx_filter && netif_running(fbn->netdev)) { in fbnic_hwtstamp_set()
567 * fbnic_netdev_free - Free the netdev associate with fbnic
568 * @fbd: Driver specific structure to free netdev from
570 * Allocate and initialize the netdev and netdev private structure. Bind
571 * together the hardware, netdev, and pci data structures.
575 struct fbnic_net *fbn = netdev_priv(fbd->netdev); in fbnic_netdev_free()
580 free_netdev(fbd->netdev); in fbnic_netdev_free()
581 fbd->netdev = NULL; in fbnic_netdev_free()
585 * fbnic_netdev_alloc - Allocate a netdev and associate with fbnic
586 * @fbd: Driver specific structure to associate netdev with
588 * Allocate and initialize the netdev and netdev private structure. Bind
589 * together the hardware, netdev, and pci data structures.
595 struct net_device *netdev; in fbnic_netdev_alloc() local
599 netdev = alloc_etherdev_mq(sizeof(*fbn), FBNIC_MAX_RXQS); in fbnic_netdev_alloc()
600 if (!netdev) in fbnic_netdev_alloc()
603 SET_NETDEV_DEV(netdev, fbd->dev); in fbnic_netdev_alloc()
604 fbd->netdev = netdev; in fbnic_netdev_alloc()
606 netdev->netdev_ops = &fbnic_netdev_ops; in fbnic_netdev_alloc()
607 netdev->stat_ops = &fbnic_stat_ops; in fbnic_netdev_alloc()
609 fbnic_set_ethtool_ops(netdev); in fbnic_netdev_alloc()
611 fbn = netdev_priv(netdev); in fbnic_netdev_alloc()
613 fbn->netdev = netdev; in fbnic_netdev_alloc()
631 netdev->features |= in fbnic_netdev_alloc()
637 netdev->hw_features |= netdev->features; in fbnic_netdev_alloc()
638 netdev->vlan_features |= netdev->features; in fbnic_netdev_alloc()
639 netdev->hw_enc_features |= netdev->features; in fbnic_netdev_alloc()
641 netdev->min_mtu = IPV6_MIN_MTU; in fbnic_netdev_alloc()
642 netdev->max_mtu = FBNIC_MAX_JUMBO_FRAME_SIZE - ETH_HLEN; in fbnic_netdev_alloc()
647 netdev->ethtool->wol_enabled = true; in fbnic_netdev_alloc()
651 netif_carrier_off(netdev); in fbnic_netdev_alloc()
653 netif_tx_stop_all_queues(netdev); in fbnic_netdev_alloc()
655 if (fbnic_phylink_init(netdev)) { in fbnic_netdev_alloc()
660 return netdev; in fbnic_netdev_alloc()
677 * @netdev: Netdev containing structure to initialize and register
679 * Initialize the MAC address for the netdev and register it.
683 int fbnic_netdev_register(struct net_device *netdev) in fbnic_netdev_register() argument
685 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_netdev_register()
693 ether_addr_copy(netdev->perm_addr, addr); in fbnic_netdev_register()
694 eth_hw_addr_set(netdev, addr); in fbnic_netdev_register()
697 * issues so instead just fail to spawn the netdev and in fbnic_netdev_register()
704 return register_netdev(netdev); in fbnic_netdev_register()
707 void fbnic_netdev_unregister(struct net_device *netdev) in fbnic_netdev_unregister() argument
709 unregister_netdev(netdev); in fbnic_netdev_unregister()