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()
295 pn_rx_submit(struct f_phonet *fp, struct usb_request *req, gfp_t gfp_flags) in pn_rx_submit() argument
308 err = usb_ep_queue(fp->out_ep, req, gfp_flags); in pn_rx_submit()
316 struct f_phonet *fp = ep->driver_data; in pn_rx_complete() local
317 struct net_device *dev = fp->dev; in pn_rx_complete()
325 spin_lock_irqsave(&fp->rx.lock, flags); in pn_rx_complete()
326 skb = fp->rx.skb; in pn_rx_complete()
328 skb = fp->rx.skb = netdev_alloc_skb(dev, 12); in pn_rx_complete()
330 fp->rx.skb = NULL; in pn_rx_complete()
331 spin_unlock_irqrestore(&fp->rx.lock, flags); in pn_rx_complete()
375 pn_rx_submit(fp, req, GFP_ATOMIC); in pn_rx_complete()
382 struct f_phonet *fp = func_to_pn(f); in __pn_reset() local
383 struct net_device *dev = fp->dev; in __pn_reset()
389 usb_ep_disable(fp->out_ep); in __pn_reset()
390 usb_ep_disable(fp->in_ep); in __pn_reset()
391 if (fp->rx.skb) { in __pn_reset()
392 dev_kfree_skb_irq(fp->rx.skb); in __pn_reset()
393 fp->rx.skb = NULL; in __pn_reset()
399 struct f_phonet *fp = func_to_pn(f); in pn_set_alt() local
400 struct usb_gadget *gadget = fp->function.config->cdev->gadget; in pn_set_alt()
407 struct net_device *dev = fp->dev; in pn_set_alt()
416 if (fp->in_ep->enabled) in pn_set_alt()
422 if (config_ep_by_speed(gadget, f, fp->in_ep) || in pn_set_alt()
423 config_ep_by_speed(gadget, f, fp->out_ep)) { in pn_set_alt()
424 fp->in_ep->desc = NULL; in pn_set_alt()
425 fp->out_ep->desc = NULL; in pn_set_alt()
429 usb_ep_enable(fp->out_ep); in pn_set_alt()
430 usb_ep_enable(fp->in_ep); in pn_set_alt()
432 port->usb = fp; in pn_set_alt()
433 fp->out_ep->driver_data = fp; in pn_set_alt()
434 fp->in_ep->driver_data = fp; in pn_set_alt()
438 pn_rx_submit(fp, fp->out_reqv[i], GFP_ATOMIC); in pn_set_alt()
449 struct f_phonet *fp = func_to_pn(f); in pn_get_alt() local
455 struct phonet_port *port = netdev_priv(fp->dev); in pn_get_alt()
469 struct f_phonet *fp = func_to_pn(f); in pn_disconnect() local
470 struct phonet_port *port = netdev_priv(fp->dev); in pn_disconnect()
485 struct f_phonet *fp = func_to_pn(f); in pn_bind() local
527 fp->out_ep = ep; in pn_bind()
532 fp->in_ep = ep; in pn_bind()
548 req = usb_ep_alloc_request(fp->out_ep, GFP_KERNEL); in pn_bind()
553 fp->out_reqv[i] = req; in pn_bind()
557 fp->in_req = usb_ep_alloc_request(fp->in_ep, GFP_KERNEL); in pn_bind()
558 if (!fp->in_req) in pn_bind()
563 fp->out_ep->name, fp->in_ep->name); in pn_bind()
567 for (i = 0; i < phonet_rxq_size && fp->out_reqv[i]; i++) in pn_bind()
568 usb_ep_free_request(fp->out_ep, fp->out_reqv[i]); in pn_bind()
654 struct f_phonet *fp = func_to_pn(f); in pn_unbind() local
658 if (fp->in_req) in pn_unbind()
659 usb_ep_free_request(fp->in_ep, fp->in_req); in pn_unbind()
661 if (fp->out_reqv[i]) in pn_unbind()
662 usb_ep_free_request(fp->out_ep, fp->out_reqv[i]); in pn_unbind()
669 struct f_phonet *fp; in phonet_alloc() local
672 fp = kzalloc(struct_size(fp, out_reqv, phonet_rxq_size), GFP_KERNEL); in phonet_alloc()
673 if (!fp) in phonet_alloc()
678 fp->dev = opts->net; in phonet_alloc()
679 fp->function.name = "phonet"; in phonet_alloc()
680 fp->function.bind = pn_bind; in phonet_alloc()
681 fp->function.unbind = pn_unbind; in phonet_alloc()
682 fp->function.set_alt = pn_set_alt; in phonet_alloc()
683 fp->function.get_alt = pn_get_alt; in phonet_alloc()
684 fp->function.disable = pn_disconnect; in phonet_alloc()
685 fp->function.free_func = phonet_free; in phonet_alloc()
686 spin_lock_init(&fp->rx.lock); in phonet_alloc()
688 return &fp->function; in phonet_alloc()