• Home
  • Raw
  • Download

Lines Matching refs:fp

202 	struct f_phonet *fp = ep->driver_data;  in pn_tx_complete()  local
203 struct net_device *dev = fp->dev; in pn_tx_complete()
227 struct f_phonet *fp; in pn_net_xmit() local
235 fp = port->usb; in pn_net_xmit()
236 if (unlikely(!fp)) /* race with carrier loss */ in pn_net_xmit()
239 req = fp->in_req; in pn_net_xmit()
246 if (unlikely(usb_ep_queue(fp->in_ep, req, GFP_ATOMIC))) in pn_net_xmit()
292 pn_rx_submit(struct f_phonet *fp, struct usb_request *req, gfp_t gfp_flags) in pn_rx_submit() argument
305 err = usb_ep_queue(fp->out_ep, req, gfp_flags); in pn_rx_submit()
313 struct f_phonet *fp = ep->driver_data; in pn_rx_complete() local
314 struct net_device *dev = fp->dev; in pn_rx_complete()
322 spin_lock_irqsave(&fp->rx.lock, flags); in pn_rx_complete()
323 skb = fp->rx.skb; in pn_rx_complete()
325 skb = fp->rx.skb = netdev_alloc_skb(dev, 12); in pn_rx_complete()
327 fp->rx.skb = NULL; in pn_rx_complete()
328 spin_unlock_irqrestore(&fp->rx.lock, flags); in pn_rx_complete()
372 pn_rx_submit(fp, req, GFP_ATOMIC); in pn_rx_complete()
379 struct f_phonet *fp = func_to_pn(f); in __pn_reset() local
380 struct net_device *dev = fp->dev; in __pn_reset()
386 usb_ep_disable(fp->out_ep); in __pn_reset()
387 usb_ep_disable(fp->in_ep); in __pn_reset()
388 if (fp->rx.skb) { in __pn_reset()
389 dev_kfree_skb_irq(fp->rx.skb); in __pn_reset()
390 fp->rx.skb = NULL; in __pn_reset()
396 struct f_phonet *fp = func_to_pn(f); in pn_set_alt() local
397 struct usb_gadget *gadget = fp->function.config->cdev->gadget; in pn_set_alt()
404 struct net_device *dev = fp->dev; in pn_set_alt()
413 if (fp->in_ep->enabled) in pn_set_alt()
419 if (config_ep_by_speed(gadget, f, fp->in_ep) || in pn_set_alt()
420 config_ep_by_speed(gadget, f, fp->out_ep)) { in pn_set_alt()
421 fp->in_ep->desc = NULL; in pn_set_alt()
422 fp->out_ep->desc = NULL; in pn_set_alt()
426 usb_ep_enable(fp->out_ep); in pn_set_alt()
427 usb_ep_enable(fp->in_ep); in pn_set_alt()
429 port->usb = fp; in pn_set_alt()
430 fp->out_ep->driver_data = fp; in pn_set_alt()
431 fp->in_ep->driver_data = fp; in pn_set_alt()
435 pn_rx_submit(fp, fp->out_reqv[i], GFP_ATOMIC); in pn_set_alt()
446 struct f_phonet *fp = func_to_pn(f); in pn_get_alt() local
452 struct phonet_port *port = netdev_priv(fp->dev); in pn_get_alt()
466 struct f_phonet *fp = func_to_pn(f); in pn_disconnect() local
467 struct phonet_port *port = netdev_priv(fp->dev); in pn_disconnect()
482 struct f_phonet *fp = func_to_pn(f); in pn_bind() local
524 fp->out_ep = ep; in pn_bind()
529 fp->in_ep = ep; in pn_bind()
545 req = usb_ep_alloc_request(fp->out_ep, GFP_KERNEL); in pn_bind()
550 fp->out_reqv[i] = req; in pn_bind()
554 fp->in_req = usb_ep_alloc_request(fp->in_ep, GFP_KERNEL); in pn_bind()
555 if (!fp->in_req) in pn_bind()
560 fp->out_ep->name, fp->in_ep->name); in pn_bind()
564 for (i = 0; i < phonet_rxq_size && fp->out_reqv[i]; i++) in pn_bind()
565 usb_ep_free_request(fp->out_ep, fp->out_reqv[i]); in pn_bind()
651 struct f_phonet *fp = func_to_pn(f); in pn_unbind() local
655 if (fp->in_req) in pn_unbind()
656 usb_ep_free_request(fp->in_ep, fp->in_req); in pn_unbind()
658 if (fp->out_reqv[i]) in pn_unbind()
659 usb_ep_free_request(fp->out_ep, fp->out_reqv[i]); in pn_unbind()
666 struct f_phonet *fp; in phonet_alloc() local
670 size = sizeof(*fp) + (phonet_rxq_size * sizeof(struct usb_request *)); in phonet_alloc()
671 fp = kzalloc(size, GFP_KERNEL); in phonet_alloc()
672 if (!fp) in phonet_alloc()
677 fp->dev = opts->net; in phonet_alloc()
678 fp->function.name = "phonet"; in phonet_alloc()
679 fp->function.bind = pn_bind; in phonet_alloc()
680 fp->function.unbind = pn_unbind; in phonet_alloc()
681 fp->function.set_alt = pn_set_alt; in phonet_alloc()
682 fp->function.get_alt = pn_get_alt; in phonet_alloc()
683 fp->function.disable = pn_disconnect; in phonet_alloc()
684 fp->function.free_func = phonet_free; in phonet_alloc()
685 spin_lock_init(&fp->rx.lock); in phonet_alloc()
687 return &fp->function; in phonet_alloc()