version 1.126.2.6, 2014/12/06 08:39:57 |
version 1.126.2.7, 2015/03/19 17:26:43 |
Line 63 int uhubdebug = 0; |
|
Line 63 int uhubdebug = 0; |
|
|
|
struct uhub_softc { |
struct uhub_softc { |
device_t sc_dev; /* base device */ |
device_t sc_dev; /* base device */ |
usbd_device_handle sc_hub; /* USB device */ |
struct usbd_device * sc_hub; /* USB device */ |
int sc_proto; /* device protocol */ |
int sc_proto; /* device protocol */ |
usbd_pipe_handle sc_ipipe; /* interrupt pipe */ |
struct usbd_pipe * sc_ipipe; /* interrupt pipe */ |
|
|
/* XXX second buffer needed because we can't suspend pipes yet */ |
/* XXX second buffer needed because we can't suspend pipes yet */ |
uint8_t *sc_statusbuf; |
uint8_t *sc_statusbuf; |
Line 83 struct uhub_softc { |
|
Line 83 struct uhub_softc { |
|
#define PORTSTAT_ISSET(sc, port) \ |
#define PORTSTAT_ISSET(sc, port) \ |
((sc)->sc_status[(port) / 8] & (1 << ((port) % 8))) |
((sc)->sc_status[(port) / 8] & (1 << ((port) % 8))) |
|
|
Static usbd_status uhub_explore(usbd_device_handle); |
Static usbd_status uhub_explore(struct usbd_device *); |
Static void uhub_intr(usbd_xfer_handle, usbd_private_handle, usbd_status); |
Static void uhub_intr(struct usbd_xfer *, void *, usbd_status); |
|
|
|
|
/* |
/* |
Line 138 uhub_attach(device_t parent, device_t se |
|
Line 138 uhub_attach(device_t parent, device_t se |
|
{ |
{ |
struct uhub_softc *sc = device_private(self); |
struct uhub_softc *sc = device_private(self); |
struct usb_attach_arg *uaa = aux; |
struct usb_attach_arg *uaa = aux; |
usbd_device_handle dev = uaa->device; |
struct usbd_device *dev = uaa->device; |
char *devinfop; |
char *devinfop; |
usbd_status err; |
usbd_status err; |
struct usbd_hub *hub = NULL; |
struct usbd_hub *hub = NULL; |
usb_device_request_t req; |
usb_device_request_t req; |
usb_hub_descriptor_t hubdesc; |
usb_hub_descriptor_t hubdesc; |
int p, port, nports, nremov, pwrdly; |
int p, port, nports, nremov, pwrdly; |
usbd_interface_handle iface; |
struct usbd_interface *iface; |
usb_endpoint_descriptor_t *ed; |
usb_endpoint_descriptor_t *ed; |
#if 0 /* notyet */ |
#if 0 /* notyet */ |
struct usbd_tt *tts = NULL; |
struct usbd_tt *tts = NULL; |
Line 367 uhub_attach(device_t parent, device_t se |
|
Line 367 uhub_attach(device_t parent, device_t se |
|
} |
} |
|
|
usbd_status |
usbd_status |
uhub_explore(usbd_device_handle dev) |
uhub_explore(struct usbd_device *dev) |
{ |
{ |
usb_hub_descriptor_t *hd = &dev->ud_hub->uh_hubdesc; |
usb_hub_descriptor_t *hd = &dev->ud_hub->uh_hubdesc; |
struct uhub_softc *sc = dev->ud_hub->uh_hubsoftc; |
struct uhub_softc *sc = dev->ud_hub->uh_hubsoftc; |
Line 649 uhub_rescan(device_t self, const char *i |
|
Line 649 uhub_rescan(device_t self, const char *i |
|
{ |
{ |
struct uhub_softc *sc = device_private(self); |
struct uhub_softc *sc = device_private(self); |
struct usbd_hub *hub = sc->sc_hub->ud_hub; |
struct usbd_hub *hub = sc->sc_hub->ud_hub; |
usbd_device_handle dev; |
struct usbd_device *dev; |
int port; |
int port; |
|
|
for (port = 0; port < hub->uh_hubdesc.bNbrPorts; port++) { |
for (port = 0; port < hub->uh_hubdesc.bNbrPorts; port++) { |
|
|
uhub_childdet(device_t self, device_t child) |
uhub_childdet(device_t self, device_t child) |
{ |
{ |
struct uhub_softc *sc = device_private(self); |
struct uhub_softc *sc = device_private(self); |
usbd_device_handle devhub = sc->sc_hub; |
struct usbd_device *devhub = sc->sc_hub; |
usbd_device_handle dev; |
struct usbd_device *dev; |
int nports; |
int nports; |
int port; |
int port; |
int i; |
int i; |
Line 704 uhub_childdet(device_t self, device_t ch |
|
Line 704 uhub_childdet(device_t self, device_t ch |
|
* to be explored again. |
* to be explored again. |
*/ |
*/ |
void |
void |
uhub_intr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status) |
uhub_intr(struct usbd_xfer *xfer, void *addr, usbd_status status) |
{ |
{ |
struct uhub_softc *sc = addr; |
struct uhub_softc *sc = addr; |
|
|