Lines Matching full:netdev

71 static int fbnic_open(struct net_device *netdev)  in fbnic_open()  argument
73 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_open()
85 static int fbnic_stop(struct net_device *netdev) in fbnic_stop() argument
87 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_stop()
104 static int fbnic_uc_sync(struct net_device *netdev, const unsigned char *addr) in fbnic_uc_sync() argument
106 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_uc_sync()
122 static int fbnic_uc_unsync(struct net_device *netdev, const unsigned char *addr) in fbnic_uc_unsync() argument
124 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_uc_unsync()
145 static int fbnic_mc_sync(struct net_device *netdev, const unsigned char *addr) in fbnic_mc_sync() argument
147 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_mc_sync()
163 static int fbnic_mc_unsync(struct net_device *netdev, const unsigned char *addr) in fbnic_mc_unsync() argument
165 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_mc_unsync()
189 struct net_device *netdev = fbd->netdev; in __fbnic_set_rx_mode() local
195 if (!ether_addr_equal(mac_addr->value.addr8, netdev->dev_addr) || in __fbnic_set_rx_mode()
197 ether_addr_copy(mac_addr->value.addr8, netdev->dev_addr); in __fbnic_set_rx_mode()
204 if (netdev->flags & IFF_BROADCAST) { in __fbnic_set_rx_mode()
216 err = __dev_uc_sync(netdev, fbnic_uc_sync, fbnic_uc_unsync); in __fbnic_set_rx_mode()
219 err = __dev_mc_sync(netdev, fbnic_mc_sync, fbnic_mc_unsync); in __fbnic_set_rx_mode()
223 uc_promisc |= !!(netdev->flags & IFF_PROMISC); in __fbnic_set_rx_mode()
224 mc_promisc |= !!(netdev->flags & IFF_ALLMULTI) || uc_promisc; in __fbnic_set_rx_mode()
241 static void fbnic_set_rx_mode(struct net_device *netdev) in fbnic_set_rx_mode() argument
243 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_set_rx_mode()
247 if (netif_running(netdev)) in fbnic_set_rx_mode()
251 static int fbnic_set_mac(struct net_device *netdev, void *p) in fbnic_set_mac() argument
258 eth_hw_addr_set(netdev, addr->sa_data); in fbnic_set_mac()
260 fbnic_set_rx_mode(netdev); in fbnic_set_mac()
284 struct net_device *netdev = fbd->netdev; in fbnic_clear_rx_mode() local
305 __dev_uc_unsync(netdev, NULL); in fbnic_clear_rx_mode()
306 __dev_mc_unsync(netdev, NULL); in fbnic_clear_rx_mode()
309 static int fbnic_hwtstamp_get(struct net_device *netdev, in fbnic_hwtstamp_get() argument
312 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_hwtstamp_get()
319 static int fbnic_hwtstamp_set(struct net_device *netdev, in fbnic_hwtstamp_set() argument
323 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_hwtstamp_set()
368 if (old_rx_filter != config->rx_filter && netif_running(fbn->netdev)) { in fbnic_hwtstamp_set()
524 static int fbnic_bpf(struct net_device *netdev, struct netdev_bpf *bpf) in fbnic_bpf() argument
527 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_bpf()
532 if (fbnic_check_split_frames(prog, netdev->mtu, in fbnic_bpf()
710 * fbnic_netdev_free - Free the netdev associate with fbnic
711 * @fbd: Driver specific structure to free netdev from
713 * Allocate and initialize the netdev and netdev private structure. Bind
714 * together the hardware, netdev, and pci data structures.
718 fbnic_phylink_destroy(fbd->netdev); in fbnic_netdev_free()
720 free_netdev(fbd->netdev); in fbnic_netdev_free()
721 fbd->netdev = NULL; in fbnic_netdev_free()
725 * fbnic_netdev_alloc - Allocate a netdev and associate with fbnic
726 * @fbd: Driver specific structure to associate netdev with
728 * Allocate and initialize the netdev and netdev private structure. Bind
729 * together the hardware, netdev, and pci data structures.
735 struct net_device *netdev; in fbnic_netdev_alloc() local
739 netdev = alloc_etherdev_mq(sizeof(*fbn), FBNIC_MAX_RXQS); in fbnic_netdev_alloc()
740 if (!netdev) in fbnic_netdev_alloc()
743 SET_NETDEV_DEV(netdev, fbd->dev); in fbnic_netdev_alloc()
744 fbd->netdev = netdev; in fbnic_netdev_alloc()
746 netdev->netdev_ops = &fbnic_netdev_ops; in fbnic_netdev_alloc()
747 netdev->stat_ops = &fbnic_stat_ops; in fbnic_netdev_alloc()
748 netdev->queue_mgmt_ops = &fbnic_queue_mgmt_ops; in fbnic_netdev_alloc()
749 netdev->netmem_tx = true; in fbnic_netdev_alloc()
751 fbnic_set_ethtool_ops(netdev); in fbnic_netdev_alloc()
753 fbn = netdev_priv(netdev); in fbnic_netdev_alloc()
755 fbn->netdev = netdev; in fbnic_netdev_alloc()
768 netdev->cfg->hds_thresh = FBNIC_HDS_THRESH_DEFAULT; in fbnic_netdev_alloc()
781 netdev->priv_flags |= IFF_UNICAST_FLT; in fbnic_netdev_alloc()
783 netdev->gso_partial_features = in fbnic_netdev_alloc()
790 netdev->features |= in fbnic_netdev_alloc()
791 netdev->gso_partial_features | in fbnic_netdev_alloc()
803 netdev->hw_features |= netdev->features; in fbnic_netdev_alloc()
804 netdev->vlan_features |= netdev->features; in fbnic_netdev_alloc()
805 netdev->hw_enc_features |= netdev->features; in fbnic_netdev_alloc()
806 netdev->features |= NETIF_F_NTUPLE; in fbnic_netdev_alloc()
808 netdev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_RX_SG; in fbnic_netdev_alloc()
810 netdev->min_mtu = IPV6_MIN_MTU; in fbnic_netdev_alloc()
811 netdev->max_mtu = FBNIC_MAX_JUMBO_FRAME_SIZE - ETH_HLEN; in fbnic_netdev_alloc()
816 netdev->ethtool->wol_enabled = true; in fbnic_netdev_alloc()
818 netif_carrier_off(netdev); in fbnic_netdev_alloc()
820 netif_tx_stop_all_queues(netdev); in fbnic_netdev_alloc()
822 if (fbnic_phylink_create(netdev)) { in fbnic_netdev_alloc()
827 return netdev; in fbnic_netdev_alloc()
844 * @netdev: Netdev containing structure to initialize and register
846 * Initialize the MAC address for the netdev and register it.
850 int fbnic_netdev_register(struct net_device *netdev) in fbnic_netdev_register() argument
852 struct fbnic_net *fbn = netdev_priv(netdev); in fbnic_netdev_register()
860 ether_addr_copy(netdev->perm_addr, addr); in fbnic_netdev_register()
861 eth_hw_addr_set(netdev, addr); in fbnic_netdev_register()
864 * issues so instead just fail to spawn the netdev and in fbnic_netdev_register()
871 return register_netdev(netdev); in fbnic_netdev_register()
874 void fbnic_netdev_unregister(struct net_device *netdev) in fbnic_netdev_unregister() argument
876 unregister_netdev(netdev); in fbnic_netdev_unregister()