iPXE
|
USB hub driver. More...
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <assert.h>
#include <byteswap.h>
#include <ipxe/usb.h>
#include "usbhub.h"
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | hub_refill (struct usb_hub_device *hubdev) |
Refill interrupt ring. More... | |
static void | hub_complete (struct usb_endpoint *ep, struct io_buffer *iobuf, int rc) |
Complete interrupt transfer. More... | |
static int | hub_open (struct usb_hub *hub) |
Open hub. More... | |
static void | hub_close (struct usb_hub *hub) |
Close hub. More... | |
static int | hub_enable (struct usb_hub *hub, struct usb_port *port) |
Enable port. More... | |
static int | hub_disable (struct usb_hub *hub, struct usb_port *port) |
Disable port. More... | |
static int | hub_clear_changes (struct usb_hub_device *hubdev, unsigned int port, uint16_t changed) |
Clear port status change bits. More... | |
static int | hub_speed (struct usb_hub *hub, struct usb_port *port) |
Update port speed. More... | |
static int | hub_clear_tt (struct usb_hub *hub, struct usb_port *port, struct usb_endpoint *ep) |
Clear transaction translator buffer. More... | |
static int | hub_probe (struct usb_function *func, struct usb_configuration_descriptor *config) |
Probe USB hub. More... | |
static void | hub_remove (struct usb_function *func) |
Remove USB hub. More... | |
Variables | |
static struct process_descriptor | hub_refill_desc |
Refill process descriptor. More... | |
static struct usb_endpoint_driver_operations | usb_hub_intr_operations |
Interrupt endpoint operations. More... | |
static struct usb_hub_driver_operations | hub_operations |
USB hub operations. More... | |
static struct usb_device_id | hub_ids [] |
USB hub device IDs. More... | |
struct usb_driver usb_hub_driver | __usb_driver |
USB hub driver. More... | |
USB hub driver.
Definition in file usbhub.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Refill interrupt ring.
hubdev | Hub device |
Definition at line 46 of file usbhub.c.
References DBGC, usb_hub_device::intr, usb_hub_device::name, process_del(), rc, usb_hub_device::refill, strerror(), and usb_refill().
Referenced by hub_open().
|
static |
Complete interrupt transfer.
ep | USB endpoint |
iobuf | I/O buffer |
rc | Completion status code |
Definition at line 72 of file usbhub.c.
References bits, container_of, data, io_buffer::data, DBGC, DBGC2, DBGC_HDA, done, usb_hub_device::hub, intr, usb_hub_device::intr, iob_len(), usb_hub_device::name, usb_endpoint::open, usb_hub::ports, process_add(), rc, usb_hub_device::refill, strerror(), usb_port_changed(), and usb_recycle().
|
static |
Open hub.
hub | USB hub |
rc | Return status code |
Definition at line 132 of file usbhub.c.
References DBGC, usb_hub_device::flags, usb_hub_device::hub, hub_refill(), usb_hub_device::intr, mdelay(), usb_hub_device::name, usb_hub::ports, process_add(), rc, usb_hub_device::refill, strerror(), usb_hub_device::usb, usb_endpoint_close(), usb_endpoint_open(), usb_hub_get_drvdata(), USB_HUB_PORT_POWER, usb_hub_set_port_feature(), USB_HUB_SLOW_START, and USB_HUB_SLOW_START_DELAY_MS.
|
static |
Close hub.
hub | USB hub |
Definition at line 179 of file usbhub.c.
References usb_hub_device::hub, usb_hub_device::intr, process_del(), usb_hub_device::refill, usb_endpoint_close(), and usb_hub_get_drvdata().
Enable port.
hub | USB hub |
port | USB port |
rc | Return status code |
Definition at line 196 of file usbhub.c.
References usb_hub_port_status::current, DBGC, ETIMEDOUT, usb_hub_device::hub, le16_to_cpu, mdelay(), usb_hub_device::name, port, usb_hub::protocol, rc, status, strerror(), usb_hub_device::usb, USB_HUB_ENABLE_MAX_WAIT_MS, usb_hub_get_drvdata(), usb_hub_get_port_status(), USB_HUB_PORT_ENABLE, USB_HUB_PORT_RESET, usb_hub_set_port_feature(), and USB_PROTO_3_0.
Disable port.
hub | USB hub |
port | USB port |
rc | Return status code |
Definition at line 244 of file usbhub.c.
References DBGC, usb_hub_device::hub, usb_hub_device::name, port, usb_hub::protocol, rc, strerror(), usb_hub_device::usb, usb_hub_clear_port_feature(), usb_hub_get_drvdata(), USB_HUB_PORT_ENABLE, and USB_PROTO_3_0.
|
static |
Clear port status change bits.
hubdev | USB hub device |
port | Port number |
changed | Port status change bits |
rc | Return status code |
Definition at line 270 of file usbhub.c.
References bit, DBGC, feature, usb_hub_device::features, usb_hub_device::name, port, rc, strerror(), usb_hub_device::usb, USB_HUB_C_FEATURE, and usb_hub_clear_port_feature().
Referenced by hub_speed().
Update port speed.
hub | USB hub |
port | USB port |
rc | Return status code |
Definition at line 309 of file usbhub.c.
References usb_hub_port_status::changed, usb_hub_port_status::current, DBGC, DBGC2, usb_hub_device::hub, hub_clear_changes(), le16_to_cpu, usb_hub_device::name, port, usb_hub::protocol, rc, status, strerror(), usb_hub_device::usb, usb_hub_get_drvdata(), usb_hub_get_port_status(), USB_HUB_PORT_CONNECTION, USB_HUB_PORT_HIGH_SPEED, USB_HUB_PORT_LOW_SPEED, USB_PROTO_3_0, USB_SPEED_FULL, USB_SPEED_HIGH, USB_SPEED_LOW, USB_SPEED_NONE, and USB_SPEED_SUPER.
|
static |
Clear transaction translator buffer.
hub | USB hub |
port | USB port |
ep | USB endpoint |
rc | Return status code |
Definition at line 362 of file usbhub.c.
References usb_endpoint::address, usb_device::address, usb_endpoint::attributes, DBGC, usb_device::ep, usb_hub_device::hub, usb_hub_device::name, port, rc, strerror(), usb_hub_device::usb, usb_endpoint::usb, usb_hub_clear_tt_buffer(), usb_hub_get_drvdata(), and USB_HUB_TT_SINGLE.
|
static |
Probe USB hub.
func | USB function |
config | Configuration descriptor |
rc | Return status code |
Definition at line 400 of file usbhub.c.
References alloc_usb_hub(), bus, usb_hub::bus, DBGC, desc, usb_device_id::driver_data, EINVAL, usb_hub_descriptor::enhanced, ENOMEM, usb_hub_device::features, usb_hub_device::flags, free, free_usb_hub(), usb_hub_device::hub, usb_port::hub, hub_operations, hub_refill_desc, usb_function::id, usb_interface_descriptor::interface, usb_hub_device::intr, usb_hub_device::name, usb_function::name, NULL, usb_device::port, process_init_stopped(), usb_port::protocol, rc, usb_hub_device::refill, register_usb_hub(), strerror(), unregister_usb_hub(), usb_hub_device::usb, usb_function::usb, usb_depth(), usb_endpoint_described(), usb_endpoint_init(), usb_func_set_drvdata(), USB_HUB_FEATURES, USB_HUB_FEATURES_ENHANCED, usb_hub_get_descriptor(), USB_HUB_INTR_FILL, usb_hub_intr_operations, usb_hub_set_drvdata(), usb_hub_set_hub_depth(), USB_INTERRUPT_IN, USB_PROTO_3_0, usb_refill_init(), and zalloc().
|
static |
Remove USB hub.
func | USB function |
rc | Return status code |
Definition at line 502 of file usbhub.c.
References assert(), usb_port::disconnected, free, free_usb_hub(), usb_hub_device::hub, usb_port::hub, port, usb_device::port, usb_hub::ports, process_running(), usb_hub_device::refill, unregister_usb_hub(), usb_hub_device::usb, usb_port::usb, usb_func_get_drvdata(), usb_port(), and USB_SPEED_NONE.
|
static |
Refill process descriptor.
Definition at line 62 of file usbhub.c.
Referenced by hub_probe().
|
static |
Interrupt endpoint operations.
Definition at line 122 of file usbhub.c.
Referenced by hub_probe().
|
static |
USB hub operations.
Definition at line 384 of file usbhub.c.
Referenced by hub_probe().
|
static |
USB hub device IDs.
struct usb_driver usb_hub_driver __usb_driver |
USB hub driver.