52 DBGC ( hubdev,
"HUB %s could not refill interrupt: %s\n",
88 DBGC ( hubdev,
"HUB %s interrupt failed: %s\n",
95 for ( i = 1 ; i <= hub->
ports ; i++ ) {
99 DBGC ( hubdev,
"HUB %s underlength interrupt:\n",
106 if (
data[ i / 8 ] & ( 1 << ( i % 8 ) ) ) {
107 DBGC2 ( hubdev,
"HUB %s port %d status changed\n",
140 for ( i = 1 ; i <= hub->
ports ; i++ ) {
144 DBGC ( hubdev,
"HUB %s port %d could not apply power: "
152 DBGC ( hubdev,
"HUB %s could not register interrupt: %s\n",
209 DBGC ( hubdev,
"HUB %s port %d could not initiate reset: %s\n",
220 DBGC ( hubdev,
"HUB %s port %d could not get status: "
221 "%s\n", hubdev->
name,
port->address,
233 DBGC ( hubdev,
"HUB %s port %d timed out waiting for enable\n",
255 DBGC ( hubdev,
"HUB %s port %d could not disable: %s\n",
282 if ( ! ( changed & ( 1 <<
bit ) ) )
293 DBGC ( hubdev,
"HUB %s port %d could not clear feature "
321 DBGC ( hubdev,
"HUB %s port %d could not get status: %s\n",
327 DBGC2 ( hubdev,
"HUB %s port %d status is %04x:%04x\n",
376 DBGC ( hubdev,
"HUB %s port %d could not clear TT buffer: %s\n",
414 hubdev =
zalloc (
sizeof ( *hubdev ) );
432 DBGC ( hubdev,
"HUB %s has no interface descriptor\n",
441 DBGC ( hubdev,
"HUB %s could not describe interrupt endpoint: "
442 "%s\n", hubdev->name, strerror ( rc ) );
450 DBGC ( hubdev,
"HUB %s could not set hub depth to %d: "
452 goto err_set_hub_depth;
458 DBGC ( hubdev,
"HUB %s could not get hub descriptor: %s\n",
460 goto err_hub_descriptor;
462 ports =
desc.basic.ports;
463 DBGC ( hubdev,
"HUB %s has %d ports at depth %d%s\n", hubdev->
name,
464 ports, depth, ( enhanced ?
" (enhanced)" :
"" ) );
468 if ( ! hubdev->
hub ) {
476 DBGC ( hubdev,
"HUB %s could not register: %s\n",
478 goto err_register_hub;
512 for ( i = 1 ; i <=
hub->
ports ; i++ ) {
514 port->disconnected = 1;
532 USB_ID ( 0x0624, 0x0248,
"avocent-hub",
"Avocent USB hub",
534 USB_ID ( 0xffff, 0xffff,
"hub",
"USB hub", 0 ),
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
static volatile void * bits
#define assert(condition)
Assert a condition at run-time.
struct bofm_section_header done
uint8_t data[48]
Additional event data.
struct ena_llq_option desc
Descriptor counts.
uint8_t intr
Interrupts enabled.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EINVAL
Invalid argument.
#define ETIMEDOUT
Connection timed out.
#define ENOMEM
Not enough space.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define le16_to_cpu(value)
static unsigned int unsigned int bit
Universal Serial Bus (USB)
static void usb_recycle(struct usb_endpoint *ep, struct io_buffer *iobuf)
Recycle I/O buffer.
static void * usb_hub_get_drvdata(struct usb_hub *hub)
Get USB hub driver private data.
static void usb_endpoint_init(struct usb_endpoint *ep, struct usb_device *usb, struct usb_endpoint_driver_operations *driver)
Initialise USB endpoint.
#define __usb_driver
Declare a USB driver.
static struct usb_port * usb_port(struct usb_hub *hub, unsigned int address)
Get USB port.
static void usb_refill_init(struct usb_endpoint *ep, size_t reserve, size_t len, unsigned int max)
Initialise USB endpoint refill.
#define USB_ANY_ID
Match-anything ID.
#define USB_CLASS_ID(base, subclass, protocol)
Construct USB class ID.
#define USB_ID(_vendor, _product, _name, _description, _data)
static void usb_func_set_drvdata(struct usb_function *func, void *priv)
Set USB function driver private data.
@ USB_SPEED_LOW
Low speed (1.5Mbps)
@ USB_SPEED_FULL
Full speed (12Mbps)
@ USB_SPEED_HIGH
High speed (480Mbps)
@ USB_SPEED_NONE
Not connected.
@ USB_SPEED_SUPER
Super speed (5Gbps)
#define USB_CLASS_HUB
Class code for USB hubs.
@ USB_SCORE_NORMAL
Normal driver.
static void usb_hub_set_drvdata(struct usb_hub *hub, void *priv)
Set USB hub driver private data.
static void * usb_func_get_drvdata(struct usb_function *func)
Get USB function driver private data.
static unsigned int usb_depth(struct usb_device *usb)
Get USB depth.
#define USB_INTERRUPT_IN
Interrupt IN endpoint (internal) type.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
void * zalloc(size_t size)
Allocate cleared memory.
void process_del(struct process *process)
Remove process from process list.
void process_add(struct process *process)
Add process to process list.
static int process_running(struct process *process)
Check if process is running.
static void process_init_stopped(struct process *process, struct process_descriptor *desc, struct refcnt *refcnt)
Initialise process without adding to process list.
#define PROC_DESC(object_type, process, _step)
Define a process descriptor.
static void(* free)(struct refcnt *refcnt))
#define container_of(ptr, type, field)
Get containing structure.
char * strerror(int errno)
Retrieve string representation of error number.
void * data
Start of data.
A USB configuration descriptor.
unsigned long driver_data
Arbitrary driver data.
struct usb_port * port
USB port.
unsigned int address
Device address, if assigned.
struct usb_endpoint * ep[32]
Endpoint list.
USB endpoint driver operations.
struct usb_device * usb
USB device.
unsigned int attributes
Attributes.
int open
Endpoint is open.
unsigned int address
Endpoint address.
struct usb_device * usb
USB device.
struct usb_device_id * id
Driver device ID.
struct usb_endpoint intr
Interrupt endpoint.
struct process refill
Interrupt endpoint refill process.
struct usb_hub * hub
USB hub.
struct usb_device * usb
USB device.
unsigned int features
Features.
USB hub driver operations.
uint16_t current
Current status.
uint16_t changed
Changed status.
unsigned int protocol
Hub protocol.
struct usb_bus * bus
USB bus.
unsigned int ports
Number of ports.
A USB interface descriptor.
struct usb_hub * hub
USB hub.
unsigned int protocol
Port protocol.
struct usb_device * usb
Currently attached device (if in use)
int disconnected
Port disconnection has been detected.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
struct usb_hub_descriptor_enhanced enhanced
Enhanced hub descriptor.
int usb_endpoint_open(struct usb_endpoint *ep)
Open USB endpoint.
void usb_endpoint_close(struct usb_endpoint *ep)
Close USB endpoint.
int usb_endpoint_described(struct usb_endpoint *ep, struct usb_configuration_descriptor *config, struct usb_interface_descriptor *interface, unsigned int type, unsigned int index)
Describe USB endpoint from device configuration.
void free_usb_hub(struct usb_hub *hub)
Free USB hub.
void usb_port_changed(struct usb_port *port)
Report port status change.
struct usb_hub * alloc_usb_hub(struct usb_bus *bus, struct usb_device *usb, unsigned int ports, struct usb_hub_driver_operations *driver)
Allocate USB hub.
int usb_refill(struct usb_endpoint *ep)
Refill endpoint.
void unregister_usb_hub(struct usb_hub *hub)
Unregister USB hub.
int register_usb_hub(struct usb_hub *hub)
Register USB hub.
static int hub_clear_changes(struct usb_hub_device *hubdev, unsigned int port, uint16_t changed)
Clear port status change bits.
static struct usb_hub_driver_operations hub_operations
USB hub operations.
static struct process_descriptor hub_refill_desc
Refill process descriptor.
static struct usb_device_id hub_ids[]
USB hub device IDs.
static int hub_probe(struct usb_function *func, struct usb_configuration_descriptor *config)
Probe USB hub.
static void hub_complete(struct usb_endpoint *ep, struct io_buffer *iobuf, int rc)
Complete interrupt transfer.
static int hub_speed(struct usb_hub *hub, struct usb_port *port)
Update port speed.
static void hub_refill(struct usb_hub_device *hubdev)
Refill interrupt ring.
static void hub_close(struct usb_hub *hub)
Close hub.
static int hub_open(struct usb_hub *hub)
Open hub.
static int hub_enable(struct usb_hub *hub, struct usb_port *port)
Enable port.
static void hub_remove(struct usb_function *func)
Remove USB hub.
static int hub_disable(struct usb_hub *hub, struct usb_port *port)
Disable port.
static struct usb_endpoint_driver_operations usb_hub_intr_operations
Interrupt endpoint operations.
static int hub_clear_tt(struct usb_hub *hub, struct usb_port *port, struct usb_endpoint *ep)
Clear transaction translator buffer.
#define USB_HUB_C_FEATURE(bit)
Calculate feature from change bit number.
#define USB_HUB_PORT_RESET
Port reset feature.
#define USB_HUB_INTR_FILL
Interrupt ring fill level.
#define USB_HUB_TT_SINGLE
Transaction translator port value for single-TT hubs.
#define USB_HUB_ENABLE_MAX_WAIT_MS
Maximum time to wait for port to become enabled.
#define USB_HUB_PORT_HIGH_SPEED
High-speed device attached.
static int usb_hub_set_hub_depth(struct usb_device *usb, unsigned int depth)
Set hub depth.
#define USB_HUB_PORT_LOW_SPEED
Low-speed device attached.
static int usb_hub_set_port_feature(struct usb_device *usb, unsigned int port, unsigned int feature, unsigned int index)
Set port feature.
static int usb_hub_clear_port_feature(struct usb_device *usb, unsigned int port, unsigned int feature, unsigned int index)
Clear port feature.
#define USB_HUB_PORT_CONNECTION
Current connect status feature.
#define USB_HUB_PORT_POWER
Port power feature.
static int usb_hub_get_port_status(struct usb_device *usb, unsigned int port, struct usb_hub_port_status *status)
Get port status.
static int usb_hub_get_descriptor(struct usb_device *usb, int enhanced, union usb_hub_descriptor *data)
Get hub descriptor.
#define USB_HUB_SLOW_START_DELAY_MS
Additional setting delay for out-of-spec hubs.
#define USB_HUB_SLOW_START
Hub requires additional settling delay.
#define USB_HUB_FEATURES_ENHANCED
USB features for enhanced hubs.
static int usb_hub_clear_tt_buffer(struct usb_device *usb, unsigned int device, unsigned int endpoint, unsigned int attributes, unsigned int tt_port)
Clear transaction translator buffer.
#define USB_HUB_FEATURES
USB features.
#define USB_HUB_PORT_ENABLE
Port enabled/disabled feature.