drivers/net/can/usb/etas_es58x/es58x_core.h
Source file repositories/reference/linux-study-clean/drivers/net/can/usb/etas_es58x/es58x_core.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/can/usb/etas_es58x/es58x_core.h- Extension
.h- Size
- 25543 bytes
- Lines
- 751
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/can.hlinux/can/dev.hlinux/netdevice.hlinux/types.hlinux/usb.hnet/devlink.hes581_4.hes58x_fd.h
Detected Declarations
struct es58x_privstruct es58x_parametersstruct es58x_operatorsstruct es58x_sw_versionstruct es58x_hw_revisionstruct es58x_deviceenum es58x_driver_infoenum es58x_echoenum es58x_physical_layerenum es58x_samples_per_bitenum es58x_sync_edgeenum es58x_flagenum es58x_errenum es58x_eventenum es58x_ret_u8enum es58x_ret_u32enum es58x_ret_typefunction es58x_sizeof_es58x_devicefunction __es58x_check_msg_lenfunction es58x_check_msg_lenfunction es58x_check_msg_max_lenfunction es58x_privfunction ES58X_SIZEOF_URB_CMDfunction es58x_get_netdevfunction es58x_get_raw_can_idfunction es58x_get_flags
Annotated Snippet
struct es58x_priv {
struct can_priv can;
struct devlink_port devlink_port;
struct es58x_device *es58x_dev;
struct urb *tx_urb;
u32 tx_tail;
u32 tx_head;
u8 tx_can_msg_cnt;
bool tx_can_msg_is_fd;
u8 err_passive_before_rtx_success;
u8 channel_idx;
};
/**
* struct es58x_parameters - Constant parameters of a given hardware
* variant.
* @bittiming_const: Nominal bittimming constant parameters.
* @data_bittiming_const: Data bittiming constant parameters.
* @tdc_const: Transmission Delay Compensation constant parameters.
* @bitrate_max: Maximum bitrate supported by the device.
* @clock: CAN clock parameters.
* @ctrlmode_supported: List of supported modes. Please refer to
* can/netlink.h file for additional details.
* @tx_start_of_frame: Magic number at the beginning of each TX URB
* command.
* @rx_start_of_frame: Magic number at the beginning of each RX URB
* command.
* @tx_urb_cmd_max_len: Maximum length of a TX URB command.
* @rx_urb_cmd_max_len: Maximum length of a RX URB command.
* @fifo_mask: Bit mask to quickly convert the tx_tail and tx_head
* field of the struct es58x_priv into echo_skb
* indexes. Properties: @fifo_mask = echo_skb_max - 1 where
* echo_skb_max must be a power of two. Also, echo_skb_max must
* not exceed the maximum size of the device internal TX FIFO
* length. This parameter is used to control the network queue
* wake/stop logic.
* @dql_min_limit: Dynamic Queue Limits (DQL) absolute minimum limit
* of bytes allowed to be queued on this network device transmit
* queue. Used by the Byte Queue Limits (BQL) to determine how
* frequently the xmit_more flag will be set to true in
* es58x_start_xmit(). Set this value higher to optimize for
* throughput but be aware that it might have a negative impact
* on the latency! This value can also be set dynamically. Please
* refer to Documentation/ABI/testing/sysfs-class-net-queues for
* more details.
* @tx_bulk_max: Maximum number of TX messages that can be sent in one
* single URB packet.
* @urb_cmd_header_len: Length of the URB command header.
* @rx_urb_max: Number of RX URB to be allocated during device probe.
* @tx_urb_max: Number of TX URB to be allocated during device probe.
*/
struct es58x_parameters {
const struct can_bittiming_const *bittiming_const;
const struct can_bittiming_const *data_bittiming_const;
const struct can_tdc_const *tdc_const;
u32 bitrate_max;
struct can_clock clock;
u32 ctrlmode_supported;
u16 tx_start_of_frame;
u16 rx_start_of_frame;
u16 tx_urb_cmd_max_len;
u16 rx_urb_cmd_max_len;
u16 fifo_mask;
u16 dql_min_limit;
u8 tx_bulk_max;
u8 urb_cmd_header_len;
u8 rx_urb_max;
u8 tx_urb_max;
};
/**
* struct es58x_operators - Function pointers used to encode/decode
* the TX/RX messages.
* @get_msg_len: Get field msg_len of the urb_cmd. The offset of
* msg_len inside urb_cmd depends of the device model.
* @handle_urb_cmd: Decode the URB command received from the device
* and dispatch it to the relevant sub function.
* @fill_urb_header: Fill the header of urb_cmd.
* @tx_can_msg: Encode a TX CAN message and add it to the bulk buffer
* cmd_buf of es58x_dev.
* @enable_channel: Start the CAN channel.
* @disable_channel: Stop the CAN channel.
* @reset_device: Full reset of the device. N.B: this feature is only
* present on the ES581.4. For ES58X FD devices, this field is
* set to NULL.
* @get_timestamp: Request a timestamp from the ES58X device.
Annotation
- Immediate include surface: `linux/can.h`, `linux/can/dev.h`, `linux/netdevice.h`, `linux/types.h`, `linux/usb.h`, `net/devlink.h`, `es581_4.h`, `es58x_fd.h`.
- Detected declarations: `struct es58x_priv`, `struct es58x_parameters`, `struct es58x_operators`, `struct es58x_sw_version`, `struct es58x_hw_revision`, `struct es58x_device`, `enum es58x_driver_info`, `enum es58x_echo`, `enum es58x_physical_layer`, `enum es58x_samples_per_bit`.
- Atlas domain: Driver Families / drivers/net.
- 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.