drivers/usb/serial/io_ti.c
Source file repositories/reference/linux-study-clean/drivers/usb/serial/io_ti.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/serial/io_ti.c- Extension
.c- Size
- 76558 bytes
- Lines
- 2772
- Domain
- Driver Families
- Bucket
- drivers/usb
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/jiffies.hlinux/errno.hlinux/slab.hlinux/tty.hlinux/tty_driver.hlinux/tty_flip.hlinux/module.hlinux/spinlock.hlinux/mutex.hlinux/serial.hlinux/swab.hlinux/kfifo.hlinux/ioctl.hlinux/firmware.hlinux/uaccess.hlinux/usb.hlinux/usb/serial.hio_16654.hio_usbvend.hio_ti.h
Detected Declarations
struct product_infostruct edgeport_fw_hdrstruct edgeport_portstruct edgeport_serialfunction ti_vread_syncfunction ti_vsend_syncfunction read_port_cmdfunction send_port_cmdfunction purge_portfunction read_download_memfunction read_ramfunction read_boot_memfunction write_boot_memfunction write_i2c_memfunction tx_activefunction choose_configfunction read_romfunction write_romfunction get_descriptor_addrfunction valid_csumfunction check_i2c_imagefunction get_manuf_infofunction build_i2c_fw_hdrfunction i2c_type_bootmodefunction bulk_xferfunction download_codefunction config_boot_devfunction ti_cpu_revfunction check_fw_sanityfunction download_fwfunction do_download_modefunction do_boot_modefunction ti_do_configfunction restore_mcrfunction map_line_statusfunction handle_new_msrfunction handle_new_lsrfunction edge_interrupt_callbackfunction edge_bulk_in_callbackfunction edge_tty_recvfunction edge_bulk_out_callbackfunction edge_openfunction edge_closefunction edge_writefunction edge_sendfunction edge_write_roomfunction edge_chars_in_bufferfunction edge_tx_empty
Annotated Snippet
struct product_info {
int TiMode; /* Current TI Mode */
u8 hardware_type; /* Type of hardware */
} __packed;
/*
* Edgeport firmware header
*
* "build_number" has been set to 0 in all three of the images I have
* seen, and Digi Tech Support suggests that it is safe to ignore it.
*
* "length" is the number of bytes of actual data following the header.
*
* "checksum" is the low order byte resulting from adding the values of
* all the data bytes.
*/
struct edgeport_fw_hdr {
u8 major_version;
u8 minor_version;
__le16 build_number;
__le16 length;
u8 checksum;
} __packed;
struct edgeport_port {
u16 uart_base;
u16 dma_address;
u8 shadow_msr;
u8 shadow_mcr;
u8 shadow_lsr;
u8 lsr_mask;
u32 ump_read_timeout; /*
* Number of milliseconds the UMP will
* wait without data before completing
* a read short
*/
int baud_rate;
int close_pending;
int lsr_event;
struct edgeport_serial *edge_serial;
struct usb_serial_port *port;
u8 bUartMode; /* Port type, 0: RS232, etc. */
spinlock_t ep_lock;
int ep_read_urb_state;
int ep_write_urb_in_use;
};
struct edgeport_serial {
struct product_info product_info;
u8 TI_I2C_Type; /* Type of I2C in UMP */
u8 TiReadI2C; /*
* Set to TRUE if we have read the
* I2c in Boot Mode
*/
struct mutex es_lock;
int num_ports_open;
struct usb_serial *serial;
struct delayed_work heartbeat_work;
int fw_version;
bool use_heartbeat;
};
/* Devices that this driver supports */
static const struct usb_device_id edgeport_1port_id_table[] = {
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_1) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_TI3410_EDGEPORT_1) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_TI3410_EDGEPORT_1I) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_PROXIMITY) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_MOTION) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_MOISTURE) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_TEMPERATURE) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_HUMIDITY) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_POWER) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_LIGHT) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_RADIATION) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_DISTANCE) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_ACCELERATION) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_WP_PROX_DIST) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_PLUS_PWR_HP4CD) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_PLUS_PWR_PCI) },
{ }
};
static const struct usb_device_id edgeport_2port_id_table[] = {
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_2) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_2C) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_2I) },
{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_421) },
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/jiffies.h`, `linux/errno.h`, `linux/slab.h`, `linux/tty.h`, `linux/tty_driver.h`, `linux/tty_flip.h`, `linux/module.h`.
- Detected declarations: `struct product_info`, `struct edgeport_fw_hdr`, `struct edgeport_port`, `struct edgeport_serial`, `function ti_vread_sync`, `function ti_vsend_sync`, `function read_port_cmd`, `function send_port_cmd`, `function purge_port`, `function read_download_mem`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.