Lines Matching refs:dev

76 	skb->dev = priv->netdev;
116 static int delete_device(struct chnl_net *dev)
119 if (dev->netdev)
120 unregister_netdevice(dev->netdev);
126 struct chnl_net *dev = NULL;
132 dev = list_entry(list_node, struct chnl_net, list_field);
133 if (dev->state == CAIF_SHUTDOWN)
134 dev_close(dev->netdev);
201 struct net_device *dev)
208 priv = netdev_priv(dev);
213 dev->stats.tx_errors++;
220 dev->stats.tx_dropped++;
235 dev->stats.tx_dropped++;
240 dev->stats.tx_packets++;
241 dev->stats.tx_bytes += len;
246 static int chnl_net_open(struct net_device *dev)
253 priv = netdev_priv(dev);
261 result = caif_connect_client(dev_net(dev), &priv->conn_req,
272 lldev = __dev_get_by_index(dev_net(dev), llifindex);
280 dev->needed_tailroom = tailroom + lldev->needed_tailroom;
281 dev->hard_header_len = headroom + lldev->hard_header_len +
291 mtu = min_t(int, dev->mtu, lldev->mtu - (headroom + tailroom));
293 dev_set_mtu(dev, mtu);
331 caif_disconnect_client(dev_net(dev), &priv->chnl);
338 static int chnl_net_stop(struct net_device *dev)
343 priv = netdev_priv(dev);
345 caif_disconnect_client(dev_net(dev), &priv->chnl);
349 static int chnl_net_init(struct net_device *dev)
353 priv = netdev_priv(dev);
354 strncpy(priv->name, dev->name, sizeof(priv->name));
359 static void chnl_net_uninit(struct net_device *dev)
363 priv = netdev_priv(dev);
375 static void chnl_net_destructor(struct net_device *dev)
377 struct chnl_net *priv = netdev_priv(dev);
381 static void ipcaif_net_setup(struct net_device *dev)
384 dev->netdev_ops = &netdev_ops;
385 dev->needs_free_netdev = true;
386 dev->priv_destructor = chnl_net_destructor;
387 dev->flags |= IFF_NOARP;
388 dev->flags |= IFF_POINTOPOINT;
389 dev->mtu = GPRS_PDP_MTU;
390 dev->tx_queue_len = CAIF_NET_DEFAULT_QUEUE_LEN;
392 priv = netdev_priv(dev);
395 priv->netdev = dev;
407 static int ipcaif_fill_info(struct sk_buff *skb, const struct net_device *dev)
411 priv = netdev_priv(dev);
447 static int ipcaif_newlink(struct net *src_net, struct net_device *dev,
454 caifdev = netdev_priv(dev);
457 ret = register_netdevice(dev);
465 caifdev->conn_req.sockaddr.u.dgm.connection_id = dev->ifindex;
471 static int ipcaif_changelink(struct net_device *dev, struct nlattr *tb[],
477 caifdev = netdev_priv(dev);
479 netdev_state_change(dev);
483 static size_t ipcaif_get_size(const struct net_device *dev)
522 struct chnl_net *dev = NULL;
528 dev = list_entry(list_node, struct chnl_net, list_field);
530 delete_device(dev);