Lines Matching refs:pnd

50 	struct usbpn_dev *pnd = netdev_priv(dev);  in usbpn_xmit()  local
61 usb_fill_bulk_urb(req, pnd->usb, pnd->tx_pipe, skb->data, skb->len, in usbpn_xmit()
70 spin_lock_irqsave(&pnd->tx_lock, flags); in usbpn_xmit()
71 pnd->tx_queue++; in usbpn_xmit()
72 if (pnd->tx_queue >= dev->tx_queue_len) in usbpn_xmit()
74 spin_unlock_irqrestore(&pnd->tx_lock, flags); in usbpn_xmit()
87 struct usbpn_dev *pnd = netdev_priv(dev); in tx_complete() local
107 spin_lock_irqsave(&pnd->tx_lock, flags); in tx_complete()
108 pnd->tx_queue--; in tx_complete()
110 spin_unlock_irqrestore(&pnd->tx_lock, flags); in tx_complete()
116 static int rx_submit(struct usbpn_dev *pnd, struct urb *req, gfp_t gfp_flags) in rx_submit() argument
118 struct net_device *dev = pnd->dev; in rx_submit()
126 usb_fill_bulk_urb(req, pnd->usb, pnd->rx_pipe, page_address(page), in rx_submit()
140 struct usbpn_dev *pnd = netdev_priv(dev); in rx_complete() local
148 spin_lock_irqsave(&pnd->rx_lock, flags); in rx_complete()
149 skb = pnd->rx_skb; in rx_complete()
151 skb = pnd->rx_skb = netdev_alloc_skb(dev, 12); in rx_complete()
167 pnd->rx_skb = NULL; /* Last fragment */ in rx_complete()
170 spin_unlock_irqrestore(&pnd->rx_lock, flags); in rx_complete()
204 rx_submit(pnd, req, GFP_ATOMIC); in rx_complete()
211 struct usbpn_dev *pnd = netdev_priv(dev); in usbpn_open() local
214 unsigned num = pnd->data_intf->cur_altsetting->desc.bInterfaceNumber; in usbpn_open()
216 err = usb_set_interface(pnd->usb, num, pnd->active_setting); in usbpn_open()
223 if (!req || rx_submit(pnd, req, GFP_KERNEL)) { in usbpn_open()
228 pnd->urbs[i] = req; in usbpn_open()
237 struct usbpn_dev *pnd = netdev_priv(dev); in usbpn_close() local
239 unsigned num = pnd->data_intf->cur_altsetting->desc.bInterfaceNumber; in usbpn_close()
244 struct urb *req = pnd->urbs[i]; in usbpn_close()
250 pnd->urbs[i] = NULL; in usbpn_close()
253 return usb_set_interface(pnd->usb, num, !pnd->active_setting); in usbpn_close()
323 struct usbpn_dev *pnd; in usbpn_probe() local
354 dev = alloc_netdev(struct_size(pnd, urbs, rxq_size), ifname, in usbpn_probe()
359 pnd = netdev_priv(dev); in usbpn_probe()
362 pnd->dev = dev; in usbpn_probe()
363 pnd->usb = usbdev; in usbpn_probe()
364 pnd->intf = intf; in usbpn_probe()
365 pnd->data_intf = data_intf; in usbpn_probe()
366 spin_lock_init(&pnd->tx_lock); in usbpn_probe()
367 spin_lock_init(&pnd->rx_lock); in usbpn_probe()
370 pnd->rx_pipe = usb_rcvbulkpipe(usbdev, in usbpn_probe()
372 pnd->tx_pipe = usb_sndbulkpipe(usbdev, in usbpn_probe()
375 pnd->rx_pipe = usb_rcvbulkpipe(usbdev, in usbpn_probe()
377 pnd->tx_pipe = usb_sndbulkpipe(usbdev, in usbpn_probe()
380 pnd->active_setting = data_desc - data_intf->altsetting; in usbpn_probe()
382 err = usb_driver_claim_interface(&usbpn_driver, data_intf, pnd); in usbpn_probe()
388 !pnd->active_setting); in usbpn_probe()
389 usb_set_intfdata(intf, pnd); in usbpn_probe()
394 pnd->disconnected = 1; in usbpn_probe()
410 struct usbpn_dev *pnd = usb_get_intfdata(intf); in usbpn_disconnect() local
412 if (pnd->disconnected) in usbpn_disconnect()
415 pnd->disconnected = 1; in usbpn_disconnect()
417 (pnd->intf == intf) ? pnd->data_intf : pnd->intf); in usbpn_disconnect()
418 unregister_netdev(pnd->dev); in usbpn_disconnect()