Lines Matching refs:dev
32 struct net_device *dev; member
55 struct net_device *dev = gp->dev; in gprs_writeable() local
58 netif_wake_queue(dev); in gprs_writeable()
70 struct net_device *dev = gp->dev; in gprs_state_change() local
72 netif_stop_queue(dev); in gprs_state_change()
73 netif_carrier_off(dev); in gprs_state_change()
79 struct net_device *dev = gp->dev; in gprs_recv() local
96 rskb = netdev_alloc_skb(dev, 0); in gprs_recv()
120 skb->dev = dev; in gprs_recv()
122 if (likely(dev->flags & IFF_UP)) { in gprs_recv()
123 dev->stats.rx_packets++; in gprs_recv()
124 dev->stats.rx_bytes += skb->len; in gprs_recv()
133 dev->stats.rx_dropped++; in gprs_recv()
155 if (netif_running(gp->dev)) in gprs_write_space()
163 static int gprs_open(struct net_device *dev) in gprs_open() argument
165 struct gprs_dev *gp = netdev_priv(dev); in gprs_open()
171 static int gprs_close(struct net_device *dev) in gprs_close() argument
173 netif_stop_queue(dev); in gprs_close()
177 static netdev_tx_t gprs_xmit(struct sk_buff *skb, struct net_device *dev) in gprs_xmit() argument
179 struct gprs_dev *gp = netdev_priv(dev); in gprs_xmit()
197 net_dbg_ratelimited("%s: TX error (%d)\n", dev->name, err); in gprs_xmit()
198 dev->stats.tx_aborted_errors++; in gprs_xmit()
199 dev->stats.tx_errors++; in gprs_xmit()
201 dev->stats.tx_packets++; in gprs_xmit()
202 dev->stats.tx_bytes += len; in gprs_xmit()
205 netif_stop_queue(dev); in gprs_xmit()
207 netif_wake_queue(dev); in gprs_xmit()
217 static void gprs_setup(struct net_device *dev) in gprs_setup() argument
219 dev->features = NETIF_F_FRAGLIST; in gprs_setup()
220 dev->type = ARPHRD_PHONET_PIPE; in gprs_setup()
221 dev->flags = IFF_POINTOPOINT | IFF_NOARP; in gprs_setup()
222 dev->mtu = GPRS_DEFAULT_MTU; in gprs_setup()
223 dev->min_mtu = 576; in gprs_setup()
224 dev->max_mtu = (PHONET_MAX_MTU - 11); in gprs_setup()
225 dev->hard_header_len = 0; in gprs_setup()
226 dev->addr_len = 0; in gprs_setup()
227 dev->tx_queue_len = 10; in gprs_setup()
229 dev->netdev_ops = &gprs_netdev_ops; in gprs_setup()
230 dev->needs_free_netdev = true; in gprs_setup()
245 struct net_device *dev; in gprs_attach() local
252 dev = alloc_netdev(sizeof(*gp), ifname, NET_NAME_UNKNOWN, gprs_setup); in gprs_attach()
253 if (!dev) in gprs_attach()
255 gp = netdev_priv(dev); in gprs_attach()
257 gp->dev = dev; in gprs_attach()
259 netif_stop_queue(dev); in gprs_attach()
260 err = register_netdev(dev); in gprs_attach()
262 free_netdev(dev); in gprs_attach()
286 printk(KERN_DEBUG"%s: attached\n", dev->name); in gprs_attach()
287 return dev->ifindex; in gprs_attach()
291 unregister_netdev(dev); in gprs_attach()
298 struct net_device *dev = gp->dev; in gprs_detach() local
307 printk(KERN_DEBUG"%s: detached\n", dev->name); in gprs_detach()
308 unregister_netdev(dev); in gprs_detach()