drivers/net/can/usb/kvaser_usb/kvaser_usb.h
Source file repositories/reference/linux-study-clean/drivers/net/can/usb/kvaser_usb/kvaser_usb.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/can/usb/kvaser_usb/kvaser_usb.h- Extension
.h- Size
- 8817 bytes
- Lines
- 273
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/completion.hlinux/ktime.hlinux/math64.hlinux/spinlock.hlinux/types.hlinux/usb.hnet/devlink.hlinux/can.hlinux/can/dev.h
Detected Declarations
struct kvaser_usb_dev_cfgstruct kvaser_usb_dev_card_data_hydrastruct kvaser_usb_dev_card_datastruct kvaser_usb_tx_urb_contextstruct kvaser_usb_fw_versionstruct kvaser_usb_busparamsstruct kvaser_usbstruct kvaser_usb_net_privstruct kvaser_usb_dev_opsstruct kvaser_usb_driver_infostruct kvaser_usb_dev_cfgenum kvaser_usb_leaf_familyenum kvaser_usb_led_statefunction kvaser_usb_ticks_to_ktimefunction kvaser_usb_timestamp48_to_ktimefunction kvaser_usb_timestamp64_to_ktime
Annotated Snippet
struct kvaser_usb_dev_card_data_hydra {
u8 channel_to_he[KVASER_USB_MAX_NET_DEVICES];
u8 sysdbg_he;
spinlock_t transid_lock; /* lock for transid */
u16 transid;
/* lock for usb_rx_leftover and usb_rx_leftover_len */
spinlock_t usb_rx_leftover_lock;
u8 usb_rx_leftover[KVASER_USB_HYDRA_MAX_CMD_LEN];
u8 usb_rx_leftover_len;
};
struct kvaser_usb_dev_card_data {
u32 ctrlmode_supported;
u32 capabilities;
struct kvaser_usb_dev_card_data_hydra hydra;
u32 usbcan_timestamp_msb;
};
/* Context for an outstanding, not yet ACKed, transmission */
struct kvaser_usb_tx_urb_context {
struct kvaser_usb_net_priv *priv;
u32 echo_index;
};
struct kvaser_usb_fw_version {
u8 major;
u8 minor;
u16 build;
};
struct kvaser_usb_busparams {
__le32 bitrate;
u8 tseg1;
u8 tseg2;
u8 sjw;
u8 nsamples;
} __packed;
struct kvaser_usb {
struct usb_device *udev;
struct usb_interface *intf;
struct kvaser_usb_net_priv *nets[KVASER_USB_MAX_NET_DEVICES];
const struct kvaser_usb_driver_info *driver_info;
const struct kvaser_usb_dev_cfg *cfg;
struct usb_endpoint_descriptor *bulk_in, *bulk_out;
struct usb_anchor rx_submitted;
u32 ean[2];
u32 serial_number;
struct kvaser_usb_fw_version fw_version;
u8 hw_revision;
unsigned int nchannels;
/* @max_tx_urbs: Firmware-reported maximum number of outstanding,
* not yet ACKed, transmissions on this device. This value is
* also used as a sentinel for marking free tx contexts.
*/
unsigned int max_tx_urbs;
struct kvaser_usb_dev_card_data card_data;
bool rxinitdone;
void *rxbuf[KVASER_USB_MAX_RX_URBS];
dma_addr_t rxbuf_dma[KVASER_USB_MAX_RX_URBS];
};
struct kvaser_usb_net_priv {
struct can_priv can;
struct devlink_port devlink_port;
struct can_berr_counter bec;
/* subdriver-specific data */
void *sub_priv;
struct kvaser_usb *dev;
struct net_device *netdev;
int channel;
struct completion start_comp, stop_comp, flush_comp,
get_busparams_comp;
struct usb_anchor tx_submitted;
struct kvaser_usb_busparams busparams_nominal, busparams_data;
spinlock_t tx_contexts_lock; /* lock for active_tx_contexts */
int active_tx_contexts;
struct kvaser_usb_tx_urb_context tx_contexts[];
};
/**
* struct kvaser_usb_dev_ops - Device specific functions
* @dev_set_mode: used for can.do_set_mode
Annotation
- Immediate include surface: `linux/completion.h`, `linux/ktime.h`, `linux/math64.h`, `linux/spinlock.h`, `linux/types.h`, `linux/usb.h`, `net/devlink.h`, `linux/can.h`.
- Detected declarations: `struct kvaser_usb_dev_cfg`, `struct kvaser_usb_dev_card_data_hydra`, `struct kvaser_usb_dev_card_data`, `struct kvaser_usb_tx_urb_context`, `struct kvaser_usb_fw_version`, `struct kvaser_usb_busparams`, `struct kvaser_usb`, `struct kvaser_usb_net_priv`, `struct kvaser_usb_dev_ops`, `struct kvaser_usb_driver_info`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.