diff options
author | imp <imp@FreeBSD.org> | 2005-05-16 06:58:43 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-05-16 06:58:43 +0000 |
commit | c2bb227a08da7ac74c03baf7d915258be41c3578 (patch) | |
tree | 4b0ed9c64ac1eb73c4e619076e6d485133933cd1 /sys/dev | |
parent | d2fcbc31f71faa003a4279cafe6ccde46c99ae8e (diff) | |
download | FreeBSD-src-c2bb227a08da7ac74c03baf7d915258be41c3578.zip FreeBSD-src-c2bb227a08da7ac74c03baf7d915258be41c3578.tar.gz |
Add convenience functions to get port and interface.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/usbdi.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index 368014d..902b1bd 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -275,6 +275,21 @@ struct usb_attach_arg { #if defined(__FreeBSD__) int usbd_driver_load(module_t mod, int what, void *arg); + +static inline int +usb_get_port(device_t dev) +{ + struct usb_attach_arg *uap = device_get_ivars(dev); + return (uap->port); +} + +static inline struct usbd_interface * +usb_get_iface(device_t dev) +{ + struct usb_attach_arg *uap = device_get_ivars(dev); + return (uap->iface); +} + #endif /* XXX Perhaps USB should have its own levels? */ |