Lines Matching refs:dev
29 static netdev_tx_t nsim_start_xmit(struct sk_buff *skb, struct net_device *dev)
31 struct netdevsim *ns = netdev_priv(dev);
47 static void nsim_set_rx_mode(struct net_device *dev)
51 static int nsim_change_mtu(struct net_device *dev, int new_mtu)
53 struct netdevsim *ns = netdev_priv(dev);
58 dev->mtu = new_mtu;
64 nsim_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
66 struct netdevsim *ns = netdev_priv(dev);
82 static int nsim_set_vf_mac(struct net_device *dev, int vf, u8 *mac)
84 struct netdevsim *ns = netdev_priv(dev);
95 static int nsim_set_vf_vlan(struct net_device *dev, int vf,
98 struct netdevsim *ns = netdev_priv(dev);
111 static int nsim_set_vf_rate(struct net_device *dev, int vf, int min, int max)
113 struct netdevsim *ns = netdev_priv(dev);
125 static int nsim_set_vf_spoofchk(struct net_device *dev, int vf, bool val)
127 struct netdevsim *ns = netdev_priv(dev);
137 static int nsim_set_vf_rss_query_en(struct net_device *dev, int vf, bool val)
139 struct netdevsim *ns = netdev_priv(dev);
149 static int nsim_set_vf_trust(struct net_device *dev, int vf, bool val)
151 struct netdevsim *ns = netdev_priv(dev);
162 nsim_get_vf_config(struct net_device *dev, int vf, struct ifla_vf_info *ivi)
164 struct netdevsim *ns = netdev_priv(dev);
185 static int nsim_set_vf_link_state(struct net_device *dev, int vf, int state)
187 struct netdevsim *ns = netdev_priv(dev);
210 nsim_setup_tc(struct net_device *dev, enum tc_setup_type type, void *type_data)
212 struct netdevsim *ns = netdev_priv(dev);
226 nsim_set_features(struct net_device *dev, netdev_features_t features)
228 struct netdevsim *ns = netdev_priv(dev);
230 if ((dev->features & NETIF_F_HW_TC) > (features & NETIF_F_HW_TC))
236 static struct devlink_port *nsim_get_devlink_port(struct net_device *dev)
238 struct netdevsim *ns = netdev_priv(dev);
266 static void nsim_setup(struct net_device *dev)
268 ether_setup(dev);
269 eth_hw_addr_random(dev);
271 dev->tx_queue_len = 0;
272 dev->flags |= IFF_NOARP;
273 dev->flags &= ~IFF_MULTICAST;
274 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE |
276 dev->features |= NETIF_F_HIGHDMA |
281 dev->hw_features |= NETIF_F_HW_TC;
282 dev->max_mtu = ETH_MAX_MTU;
288 struct net_device *dev;
292 dev = alloc_netdev(sizeof(*ns), "eth%d", NET_NAME_UNKNOWN, nsim_setup);
293 if (!dev)
296 dev_net_set(dev, nsim_dev_net(nsim_dev));
297 ns = netdev_priv(dev);
298 ns->netdev = dev;
303 SET_NETDEV_DEV(dev, &ns->nsim_bus_dev->dev);
304 dev->netdev_ops = &nsim_netdev_ops;
307 err = nsim_udp_tunnels_info_create(nsim_dev, dev);
318 err = register_netdevice(dev);
330 nsim_udp_tunnels_info_destroy(dev);
332 free_netdev(dev);
338 struct net_device *dev = ns->netdev;
341 unregister_netdevice(dev);
345 nsim_udp_tunnels_info_destroy(dev);
346 free_netdev(dev);