iPXE
|
USB RNDIS driver. More...
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <byteswap.h>
#include <ipxe/profile.h>
#include <ipxe/usb.h>
#include <ipxe/usbnet.h>
#include <ipxe/rndis.h>
#include "acm.h"
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | acm_intr_complete (struct usb_endpoint *ep, struct io_buffer *iobuf, int rc) |
Complete interrupt transfer. More... | |
static void | acm_in_complete (struct usb_endpoint *ep, struct io_buffer *iobuf, int rc) |
Complete bulk IN transfer. More... | |
static int | acm_out_transmit (struct acm_device *acm, struct io_buffer *iobuf) |
Transmit packet. More... | |
static void | acm_out_complete (struct usb_endpoint *ep, struct io_buffer *iobuf, int rc) |
Complete bulk OUT transfer. More... | |
static int | acm_control_transmit (struct acm_device *acm, struct io_buffer *iobuf) |
Send control packet. More... | |
static int | acm_control_receive (struct acm_device *acm) |
Receive control packet. More... | |
static int | acm_open (struct rndis_device *rndis) |
Open RNDIS device. More... | |
static void | acm_close (struct rndis_device *rndis) |
Close RNDIS device. More... | |
static int | acm_transmit (struct rndis_device *rndis, struct io_buffer *iobuf) |
Transmit packet. More... | |
static void | acm_poll (struct rndis_device *rndis) |
Poll for completed and received packets. More... | |
static int | acm_probe (struct usb_function *func, struct usb_configuration_descriptor *config) |
Probe device. More... | |
static void | acm_remove (struct usb_function *func) |
Remove device. More... | |
Variables | |
static struct profiler acm_intr_profiler | __profiler |
Interrupt completion profiler. More... | |
static struct usb_endpoint_driver_operations | acm_intr_operations |
Interrupt endpoint operations. More... | |
static struct usb_endpoint_driver_operations | acm_in_operations |
Bulk IN endpoint operations. More... | |
static struct usb_endpoint_driver_operations | acm_out_operations |
Bulk OUT endpoint operations. More... | |
static struct rndis_operations | acm_operations |
USB RNDIS operations. More... | |
static struct usb_device_id | cdc_acm_ids [] |
USB CDC-ACM device IDs. More... | |
struct usb_driver cdc_acm_driver | __usb_driver |
USB CDC-ACM driver. More... | |
static struct usb_device_id | rf_rndis_ids [] |
USB RF-RNDIS device IDs. More... | |
USB RNDIS driver.
Definition in file acm.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Complete interrupt transfer.
ep | USB endpoint |
iobuf | I/O buffer |
rc | Completion status code |
Definition at line 68 of file acm.c.
References CDC_RESPONSE_AVAILABLE, container_of, cpu_to_le16, io_buffer::data, DBGC, DBGC_HDA, EINVAL, ENOTSUP, error, free_iob(), usbnet_device::intr, iob_disown, iob_len(), message, usb_endpoint::open, profile_start(), profile_stop(), rc, acm_device::responded, acm_device::rndis, rndis_rx_err(), strerror(), and acm_device::usbnet.
|
static |
Complete bulk IN transfer.
ep | USB endpoint |
iobuf | I/O buffer |
rc | Completion status code |
Definition at line 146 of file acm.c.
References container_of, DBGC, error, free_iob(), usbnet_device::in, iob_disown, usb_endpoint::open, profile_start(), profile_stop(), rc, acm_device::rndis, rndis_rx(), rndis_rx_err(), strerror(), and acm_device::usbnet.
|
static |
Transmit packet.
acm | USB RNDIS device |
iobuf | I/O buffer |
rc | Return status code |
Definition at line 190 of file acm.c.
References usbnet_device::out, profile_start(), profile_stop(), rc, usb_stream(), and acm_device::usbnet.
Referenced by acm_transmit().
|
static |
Complete bulk OUT transfer.
ep | USB endpoint |
iobuf | I/O buffer |
rc | Completion status code |
Definition at line 212 of file acm.c.
References container_of, usbnet_device::out, rc, acm_device::rndis, rndis_tx_complete_err(), and acm_device::usbnet.
|
static |
Send control packet.
acm | USB RNDIS device |
iobuf | I/O buffer |
rc | Return status code |
Definition at line 241 of file acm.c.
References cdc_send_encapsulated_command(), usbnet_device::comms, io_buffer::data, DBGC, iob_len(), rc, acm_device::rndis, rndis_tx_complete(), strerror(), acm_device::usb, and acm_device::usbnet.
Referenced by acm_transmit().
|
static |
Receive control packet.
acm | USB RNDIS device |
rc | Return status code |
Definition at line 268 of file acm.c.
References ACM_RESPONSE_MTU, alloc_iob(), cdc_get_encapsulated_response(), usbnet_device::comms, io_buffer::data, DBGC, DBGC_HDA, ENOMEM, EPROTO, free_iob(), header, iob_disown, iob_put, le32_to_cpu, len, mtu, rc, acm_device::rndis, rndis_rx(), strerror(), acm_device::usb, and acm_device::usbnet.
Referenced by acm_poll().
|
static |
Open RNDIS device.
rndis | RNDIS device |
rc | Return status code |
Definition at line 328 of file acm.c.
References rndis_device::priv, rc, acm_device::rndis, acm_device::usbnet, usbnet_close(), and usbnet_open().
|
static |
Close RNDIS device.
rndis | RNDIS device |
Definition at line 348 of file acm.c.
References rndis_device::priv, acm_device::rndis, acm_device::usbnet, and usbnet_close().
|
static |
Transmit packet.
rndis | RNDIS device |
iobuf | I/O buffer |
rc | Return status code |
Definition at line 362 of file acm.c.
References acm_control_transmit(), acm_out_transmit(), assert(), cpu_to_le32, io_buffer::data, header, iob_len(), le32_to_cpu, rndis_device::priv, acm_device::rndis, and RNDIS_PACKET_MSG.
|
static |
Poll for completed and received packets.
rndis | RNDIS device |
Definition at line 384 of file acm.c.
References acm_control_receive(), acm_device::bus, NULL, rndis_device::priv, rc, acm_device::responded, acm_device::rndis, rndis_rx_err(), usb_poll(), acm_device::usbnet, and usbnet_refill().
|
static |
Probe device.
func | USB function |
config | Configuration descriptor |
rc | Return status code |
Definition at line 429 of file acm.c.
References ACM_IN_MAX_FILL, ACM_IN_MTU, acm_in_operations, ACM_INTR_MAX_FILL, acm_intr_operations, acm_operations, acm_out_operations, alloc_rndis(), acm_device::bus, usb_hub::bus, DBGC, net_device::dev, usb_function::dev, ENOMEM, free_rndis(), usb_port::hub, usbnet_device::in, usbnet_device::intr, rndis_device::netdev, usb_device::port, rndis_device::priv, rc, register_rndis(), acm_device::rndis, rndis_init(), strerror(), unregister_rndis(), acm_device::usb, usb_function::usb, usb_func_set_drvdata(), usb_refill_init(), acm_device::usbnet, usbnet_describe(), and usbnet_init().
|
static |
Remove device.
func | USB function |
Definition at line 480 of file acm.c.
References free_rndis(), acm_device::rndis, unregister_rndis(), and usb_func_get_drvdata().
|
static |
|
static |
Interrupt endpoint operations.
Definition at line 128 of file acm.c.
Referenced by acm_probe().
|
static |
Bulk IN endpoint operations.
Definition at line 179 of file acm.c.
Referenced by acm_probe().
|
static |
Bulk OUT endpoint operations.
Definition at line 223 of file acm.c.
Referenced by acm_probe().
|
static |
USB RNDIS operations.
Definition at line 408 of file acm.c.
Referenced by acm_probe().
|
static |
USB CDC-ACM device IDs.
struct usb_driver rf_rndis_driver __usb_driver |
USB CDC-ACM driver.
USB RF-RNDIS driver.
|
static |
USB RF-RNDIS device IDs.