Lines Matching refs:netdev

65 static void opa_vnic_get_stats64(struct net_device *netdev,  in opa_vnic_get_stats64()  argument
68 struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev); in opa_vnic_get_stats64()
73 adapter->rn_ops->ndo_get_stats64(netdev, &vstats.netstats); in opa_vnic_get_stats64()
80 struct net_device *netdev) in opa_netdev_start_xmit() argument
82 struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev); in opa_netdev_start_xmit()
94 return adapter->rn_ops->ndo_start_xmit(skb, netdev); in opa_netdev_start_xmit()
97 static u16 opa_vnic_select_queue(struct net_device *netdev, struct sk_buff *skb, in opa_vnic_select_queue() argument
100 struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev); in opa_vnic_select_queue()
108 rc = adapter->rn_ops->ndo_select_queue(netdev, skb, sb_dev); in opa_vnic_select_queue()
128 netif_dormant_off(adapter->netdev); in opa_vnic_update_state()
130 netif_dormant_on(adapter->netdev); in opa_vnic_update_state()
138 struct rdma_netdev *rn = netdev_priv(adapter->netdev); in opa_vnic_process_vema_config()
140 struct net_device *netdev = adapter->netdev; in opa_vnic_process_vema_config() local
152 eth_commit_mac_addr_change(netdev, &saddr); in opa_vnic_process_vema_config()
158 rn->set_id(netdev, info->vesw.vesw_id); in opa_vnic_process_vema_config()
162 netdev->max_mtu = max_t(unsigned int, info->vesw.eth_mtu, in opa_vnic_process_vema_config()
163 netdev->min_mtu); in opa_vnic_process_vema_config()
164 if (netdev->mtu > netdev->max_mtu) in opa_vnic_process_vema_config()
165 dev_set_mtu(netdev, netdev->max_mtu); in opa_vnic_process_vema_config()
187 opa_vnic_update_state(adapter, !!(netdev->flags & IFF_UP)); in opa_vnic_process_vema_config()
203 static int opa_vnic_set_mac_addr(struct net_device *netdev, void *addr) in opa_vnic_set_mac_addr() argument
205 struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev); in opa_vnic_set_mac_addr()
209 if (!memcmp(netdev->dev_addr, sa->sa_data, ETH_ALEN)) in opa_vnic_set_mac_addr()
213 rc = eth_mac_addr(netdev, addr); in opa_vnic_set_mac_addr()
229 static void opa_vnic_mac_send_event(struct net_device *netdev, u8 event) in opa_vnic_mac_send_event() argument
231 struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev); in opa_vnic_mac_send_event()
239 hw_list = &netdev->uc; in opa_vnic_mac_send_event()
244 hw_list = &netdev->mc; in opa_vnic_mac_send_event()
264 static void opa_vnic_set_rx_mode(struct net_device *netdev) in opa_vnic_set_rx_mode() argument
266 opa_vnic_mac_send_event(netdev, in opa_vnic_set_rx_mode()
269 opa_vnic_mac_send_event(netdev, in opa_vnic_set_rx_mode()
274 static int opa_netdev_open(struct net_device *netdev) in opa_netdev_open() argument
276 struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev); in opa_netdev_open()
279 rc = adapter->rn_ops->ndo_open(adapter->netdev); in opa_netdev_open()
293 static int opa_netdev_close(struct net_device *netdev) in opa_netdev_close() argument
295 struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev); in opa_netdev_close()
298 rc = adapter->rn_ops->ndo_stop(adapter->netdev); in opa_netdev_close()
327 struct net_device *netdev; in opa_vnic_add_netdev() local
331 netdev = ibdev->ops.alloc_rdma_netdev(ibdev, port_num, in opa_vnic_add_netdev()
335 if (!netdev) in opa_vnic_add_netdev()
337 else if (IS_ERR(netdev)) in opa_vnic_add_netdev()
338 return ERR_CAST(netdev); in opa_vnic_add_netdev()
340 rn = netdev_priv(netdev); in opa_vnic_add_netdev()
350 adapter->netdev = netdev; in opa_vnic_add_netdev()
354 adapter->rn_ops = netdev->netdev_ops; in opa_vnic_add_netdev()
356 netdev->netdev_ops = &opa_netdev_ops; in opa_vnic_add_netdev()
357 netdev->priv_flags |= IFF_LIVE_ADDR_CHANGE; in opa_vnic_add_netdev()
358 netdev->hard_header_len += OPA_VNIC_SKB_HEADROOM; in opa_vnic_add_netdev()
363 SET_NETDEV_DEV(netdev, ibdev->dev.parent); in opa_vnic_add_netdev()
365 opa_vnic_set_ethtool_ops(netdev); in opa_vnic_add_netdev()
369 rc = register_netdev(netdev); in opa_vnic_add_netdev()
373 netif_carrier_off(netdev); in opa_vnic_add_netdev()
374 netif_dormant_on(netdev); in opa_vnic_add_netdev()
383 rn->free_rdma_netdev(netdev); in opa_vnic_add_netdev()
391 struct net_device *netdev = adapter->netdev; in opa_vnic_rem_netdev() local
392 struct rdma_netdev *rn = netdev_priv(netdev); in opa_vnic_rem_netdev()
395 unregister_netdev(netdev); in opa_vnic_rem_netdev()
400 rn->free_rdma_netdev(netdev); in opa_vnic_rem_netdev()