Lines Matching refs:lapbeth
72 struct lapbethdev *lapbeth; in lapbeth_get_x25_dev() local
74 list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node, lockdep_rtnl_is_held()) { in lapbeth_get_x25_dev()
75 if (lapbeth->ethdev == dev) in lapbeth_get_x25_dev()
76 return lapbeth; in lapbeth_get_x25_dev()
90 struct lapbethdev *lapbeth = container_of(napi, struct lapbethdev, in lapbeth_napi_poll() local
96 skb = skb_dequeue(&lapbeth->rx_queue); in lapbeth_napi_poll()
114 struct lapbethdev *lapbeth; in lapbeth_rcv() local
127 lapbeth = lapbeth_get_x25_dev(dev); in lapbeth_rcv()
128 if (!lapbeth) in lapbeth_rcv()
130 spin_lock_bh(&lapbeth->up_lock); in lapbeth_rcv()
131 if (!lapbeth->up) in lapbeth_rcv()
141 err = lapb_data_received(lapbeth->axdev, skb); in lapbeth_rcv()
147 spin_unlock_bh(&lapbeth->up_lock); in lapbeth_rcv()
162 struct lapbethdev *lapbeth = netdev_priv(dev); in lapbeth_data_indication() local
177 skb_queue_tail(&lapbeth->rx_queue, skb); in lapbeth_data_indication()
178 napi_schedule(&lapbeth->napi); in lapbeth_data_indication()
187 struct lapbethdev *lapbeth = netdev_priv(dev); in lapbeth_xmit() local
190 spin_lock_bh(&lapbeth->up_lock); in lapbeth_xmit()
191 if (!lapbeth->up) in lapbeth_xmit()
229 spin_unlock_bh(&lapbeth->up_lock); in lapbeth_xmit()
238 struct lapbethdev *lapbeth = netdev_priv(ndev); in lapbeth_data_transmit() local
251 skb->dev = dev = lapbeth->ethdev; in lapbeth_data_transmit()
264 struct lapbethdev *lapbeth = netdev_priv(dev); in lapbeth_connected() local
276 skb_queue_tail(&lapbeth->rx_queue, skb); in lapbeth_connected()
277 napi_schedule(&lapbeth->napi); in lapbeth_connected()
282 struct lapbethdev *lapbeth = netdev_priv(dev); in lapbeth_disconnected() local
294 skb_queue_tail(&lapbeth->rx_queue, skb); in lapbeth_disconnected()
295 napi_schedule(&lapbeth->napi); in lapbeth_disconnected()
321 struct lapbethdev *lapbeth = netdev_priv(dev); in lapbeth_open() local
324 napi_enable(&lapbeth->napi); in lapbeth_open()
328 napi_disable(&lapbeth->napi); in lapbeth_open()
333 spin_lock_bh(&lapbeth->up_lock); in lapbeth_open()
334 lapbeth->up = true; in lapbeth_open()
335 spin_unlock_bh(&lapbeth->up_lock); in lapbeth_open()
342 struct lapbethdev *lapbeth = netdev_priv(dev); in lapbeth_close() local
345 spin_lock_bh(&lapbeth->up_lock); in lapbeth_close()
346 lapbeth->up = false; in lapbeth_close()
347 spin_unlock_bh(&lapbeth->up_lock); in lapbeth_close()
353 napi_disable(&lapbeth->napi); in lapbeth_close()
382 struct lapbethdev *lapbeth; in lapbeth_new_device() local
390 ndev = alloc_netdev(sizeof(*lapbeth), "lapb%d", NET_NAME_UNKNOWN, in lapbeth_new_device()
405 lapbeth = netdev_priv(ndev); in lapbeth_new_device()
406 lapbeth->axdev = ndev; in lapbeth_new_device()
409 lapbeth->ethdev = dev; in lapbeth_new_device()
411 lapbeth->up = false; in lapbeth_new_device()
412 spin_lock_init(&lapbeth->up_lock); in lapbeth_new_device()
414 skb_queue_head_init(&lapbeth->rx_queue); in lapbeth_new_device()
415 netif_napi_add_weight(ndev, &lapbeth->napi, lapbeth_napi_poll, 16); in lapbeth_new_device()
421 list_add_rcu(&lapbeth->node, &lapbeth_devices); in lapbeth_new_device()
433 static void lapbeth_free_device(struct lapbethdev *lapbeth) in lapbeth_free_device() argument
435 dev_put(lapbeth->ethdev); in lapbeth_free_device()
436 list_del_rcu(&lapbeth->node); in lapbeth_free_device()
437 unregister_netdevice(lapbeth->axdev); in lapbeth_free_device()
447 struct lapbethdev *lapbeth; in lapbeth_device_event() local
464 lapbeth = lapbeth_get_x25_dev(dev); in lapbeth_device_event()
465 if (lapbeth) in lapbeth_device_event()
466 dev_close(lapbeth->axdev); in lapbeth_device_event()
470 lapbeth = lapbeth_get_x25_dev(dev); in lapbeth_device_event()
471 if (lapbeth) in lapbeth_device_event()
472 lapbeth_free_device(lapbeth); in lapbeth_device_event()
507 struct lapbethdev *lapbeth; in lapbeth_cleanup_driver() local
515 lapbeth = list_entry(entry, struct lapbethdev, node); in lapbeth_cleanup_driver()
517 dev_put(lapbeth->ethdev); in lapbeth_cleanup_driver()
518 unregister_netdevice(lapbeth->axdev); in lapbeth_cleanup_driver()