Lines Matching defs:link
2 * u_ether.c -- Ethernet-over-USB link layer utilities for Gadget stack
36 * This component encapsulates the Ethernet link glue needed to provide
37 * one (!) network link through the USB gadget stack, normally "usb0".
45 * parameters; if no such parameters are provided, random link level
46 * addresses are used. Each end of the link uses one address. The
50 * The driver which assembles each configuration using such a link is
52 * instance of is network link. (The network layer provides ways for
53 * this single "physical" link to be used by multiple virtual links.)
160 /* don't change MTU on "live" link (peer won't know) */
406 static int alloc_requests(struct eth_dev *dev, struct gether *link, unsigned n)
411 status = prealloc(&dev->tx_reqs, link->in_ep, n);
414 status = prealloc(&dev->rx_reqs, link->out_ep, n);
637 struct gether *link;
644 link = dev->port_usb;
645 if (link && link->open)
646 link->open(link);
668 struct gether *link = dev->port_usb;
670 if (link->close)
671 link->close(link);
682 usb_ep_disable(link->in_ep);
683 usb_ep_disable(link->out_ep);
686 usb_ep_enable(link->in_ep, link->in);
687 usb_ep_enable(link->out_ep, link->out);
744 * gether_setup - initialize one ethernet-over-usb link
747 * host side of the link is recorded
750 * This sets up the single network link that may be exported by a
751 * gadget driver using this framework. The link layer addresses are
843 * gether_connect - notify network layer that USB link is active
844 * @link: the USB link, set up with endpoints, descriptors matching
858 struct net_device *gether_connect(struct gether *link)
866 link->in_ep->driver_data = dev;
867 result = usb_ep_enable(link->in_ep, link->in);
870 link->in_ep->name, result);
874 link->out_ep->driver_data = dev;
875 result = usb_ep_enable(link->out_ep, link->out);
878 link->out_ep->name, result);
883 result = alloc_requests(dev, link, qlen(dev->gadget));
886 dev->zlp = link->is_zlp_ok;
889 dev->header_len = link->header_len;
890 dev->unwrap = link->unwrap;
891 dev->wrap = link->wrap;
894 dev->port_usb = link;
895 link->ioport = dev;
897 if (link->open)
898 link->open(link);
900 if (link->close)
901 link->close(link);
911 (void) usb_ep_disable(link->out_ep);
913 (void) usb_ep_disable(link->in_ep);
923 * gether_disconnect - notify network layer that USB link is inactive
924 * @link: the USB link, on which gether_connect() was called
934 void gether_disconnect(struct gether *link)
936 struct eth_dev *dev = link->ioport;
952 usb_ep_disable(link->in_ep);
960 usb_ep_free_request(link->in_ep, req);
964 link->in_ep->driver_data = NULL;
965 link->in = NULL;
967 usb_ep_disable(link->out_ep);
975 usb_ep_free_request(link->out_ep, req);
979 link->out_ep->driver_data = NULL;
980 link->out = NULL;
982 /* finish forgetting about this USB link episode */
989 link->ioport = NULL;