10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
14 /** A USB network device */
15 struct usbnet_device {
17 struct usb_function *func;
19 /** Communications interface */
23 /** Alternate setting for data interface */
24 unsigned int alternate;
26 /** Interrupt endpoint */
27 struct usb_endpoint intr;
28 /** Bulk IN endpoint */
29 struct usb_endpoint in;
30 /** Bulk OUT endpoint */
31 struct usb_endpoint out;
35 * Initialise USB network device
37 * @v usbnet USB network device
38 * @v func USB function
39 * @v intr Interrupt endpoint operations
40 * @v in Bulk IN endpoint operations
41 * @v out Bulk OUT endpoint operations
43 static inline __attribute__ (( always_inline )) void
44 usbnet_init ( struct usbnet_device *usbnet, struct usb_function *func,
45 struct usb_endpoint_driver_operations *intr,
46 struct usb_endpoint_driver_operations *in,
47 struct usb_endpoint_driver_operations *out ) {
48 struct usb_device *usb = func->usb;
51 usb_endpoint_init ( &usbnet->intr, usb, intr );
52 usb_endpoint_init ( &usbnet->in, usb, in );
53 usb_endpoint_init ( &usbnet->out, usb, out );
56 extern int usbnet_open ( struct usbnet_device *usbnet );
57 extern void usbnet_close ( struct usbnet_device *usbnet );
58 extern int usbnet_refill ( struct usbnet_device *usbnet );
59 extern int usbnet_describe ( struct usbnet_device *usbnet,
60 struct usb_configuration_descriptor *config );
62 #endif /* _IPXE_USBNET_H */