Lines Matching defs:net

36 #include <net/arp.h>
37 #include <net/route.h>
38 #include <net/sock.h>
39 #include <net/pkt_sched.h>
56 struct net_device *net;
63 struct net_device *net = swk->net;
65 struct net_device_context *ndevctx = netdev_priv(net);
77 if (net->flags & IFF_PROMISC)
90 static void netvsc_set_multicast_list(struct net_device *net)
97 swk->net = net;
102 static int netvsc_open(struct net_device *net)
104 struct net_device_context *net_device_ctx = netdev_priv(net);
111 netdev_err(net, "unable to open device (ret %d).\n", ret);
115 netif_start_queue(net);
120 static int netvsc_close(struct net_device *net)
122 struct net_device_context *net_device_ctx = netdev_priv(net);
126 netif_tx_disable(net);
130 netdev_err(net, "unable to close device (ret %d).\n", ret);
147 static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
149 struct net_device_context *net_device_ctx = netdev_priv(net);
165 netdev_err(net, "unable to allocate hv_netvsc_packet\n");
168 net->stats.tx_dropped++;
220 net->stats.tx_bytes += skb->len;
221 net->stats.tx_packets++;
224 net->stats.tx_dropped++;
238 struct net_device *net;
243 net = net_device->ndev;
245 if (!net) {
246 netdev_err(net, "got link status but net device "
252 netif_carrier_on(net);
253 netif_wake_queue(net);
254 ndev_ctx = netdev_priv(net);
258 netif_carrier_off(net);
259 netif_tx_disable(net);
270 struct net_device *net = dev_get_drvdata(&device_obj->device);
275 net = net_device->ndev;
277 if (!net) {
278 netdev_err(net, "got receive callback but net device"
284 skb = netdev_alloc_skb_ip_align(net, packet->total_data_buflen);
286 ++net->stats.rx_dropped;
297 skb->protocol = eth_type_trans(skb, net);
300 net->stats.rx_packets++;
301 net->stats.rx_bytes += packet->total_data_buflen;
313 static void netvsc_get_drvinfo(struct net_device *net,
379 struct net_device *net;
384 net = net_device->ndev;
385 netif_notify_peers(net);
392 struct net_device *net = NULL;
397 net = alloc_etherdev(sizeof(struct net_device_context));
398 if (!net)
402 netif_carrier_off(net);
404 net_device_ctx = netdev_priv(net);
406 hv_set_drvdata(dev, net);
409 net->netdev_ops = &device_ops;
412 net->hw_features = NETIF_F_SG;
413 net->features = NETIF_F_SG;
415 SET_ETHTOOL_OPS(net, &ethtool_ops);
416 SET_NETDEV_DEV(net, &dev->device);
418 ret = register_netdev(net);
421 free_netdev(net);
429 netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
430 unregister_netdev(net);
431 free_netdev(net);
435 memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
437 netif_carrier_on(net);
445 struct net_device *net;
450 net = net_device->ndev;
452 if (net == NULL) {
453 dev_err(&dev->device, "No net device to remove\n");
459 ndev_ctx = netdev_priv(net);
463 netif_tx_disable(net);
465 unregister_netdev(net);
473 free_netdev(net);