STRUCT KVASER_USB_DEV_OPS(9)
β¨ struct kvaser_usb_dev_ops β the device-specific function era π
okay so bestie, this is from the Kernel API Manual (section 9, for the girlies keeping track) and it's literally the blueprint for how your Kvaser USB CAN device does its little tasks. it's giving "contract between the driver and the hardware" and we're obsessed. π
πΈ SYNOPSIS πΈ
no cap, here's the whole struct in all its glory β every single pointer, character for character, because we do not play about accuracy:
struct kvaser_usb_dev_ops {
int (*dev_set_mode)(struct net_device *netdev, enum can_mode mode);
int (*dev_set_bittiming)(const struct net_device *netdev, const
struct kvaser_usb_busparams *busparams);
int (*dev_get_busparams)(struct kvaser_usb_net_priv *priv);
int (*dev_set_data_bittiming)(const struct net_device *netdev, const
struct kvaser_usb_busparams *busparams);
int (*dev_get_data_busparams)(struct kvaser_usb_net_priv *priv);
int (*dev_get_berr_counter)(const struct net_device *netdev, struct
can_berr_counter *bec);
int (*dev_setup_endpoints)(struct kvaser_usb *dev);
int (*dev_init_card)(struct kvaser_usb *dev);
int (*dev_init_channel)(struct kvaser_usb_net_priv *priv);
void (*dev_remove_channel)(struct kvaser_usb_net_priv *priv);
int (*dev_get_software_info)(struct kvaser_usb *dev);
int (*dev_get_software_details)(struct kvaser_usb *dev);
int (*dev_get_card_info)(struct kvaser_usb *dev);
int (*dev_get_capabilities)(struct kvaser_usb *dev);
int (*dev_set_led)(struct kvaser_usb_net_priv *priv, enum
kvaser_usb_led_state state, u16 duration_ms);
int (*dev_set_opt_mode)(const struct kvaser_usb_net_priv *priv);
int (*dev_start_chip)(struct kvaser_usb_net_priv *priv);
int (*dev_stop_chip)(struct kvaser_usb_net_priv *priv);
int (*dev_reset_chip)(struct kvaser_usb *dev, int channel);
int (*dev_flush_queue)(struct kvaser_usb_net_priv *priv);
void (*dev_read_bulk_callback)(struct kvaser_usb *dev, void *buf,
int len);
void *(*dev_frame_to_cmd)(const struct kvaser_usb_net_priv *priv,
const struct sk_buff *skb, int *cmd_len, u16 transid);
};
π Members β the whole squad, introduced one by one π
each of these is a function pointer that a specific device family gets to fill in with its own vibe, bestie. main character energy for every one of them:
dev_set_modeβ okay so this one is literally used forcan.do_set_mode. it sets the CAN mode, periodt.dev_set_bittimingβ used forcan.do_set_bittiming. it's the arbitration bittiming setter, no cap.dev_get_busparamsβ this is the readback for arbitration busparams. it's giving "let me double check that."dev_set_data_bittimingβ used forcan.fd.do_set_data_bittiming. CAN FD data phase timing, slay.dev_get_data_busparamsβ readback for data busparams. yes bestie, the data phase gets its own readback. iconic.dev_get_berr_counterβ used forcan.do_get_berr_counter, aka the bus error counter fetch. it's literally keeping receipts of the errors.dev_setup_endpointsβ sets up USB in and out endpoints. the plumbing, the setup, the whole backstage pass. π₯dev_init_cardβ initialize card. that's it, that's the vibe.dev_init_channelβ initialize channel. every channel deserves its moment.dev_remove_channelβ uninitialize channel. breaking up but making it clean. πdev_get_software_infoβ get software info. the gossip about the firmware, fr fr.dev_get_software_detailsβ get software details. the extended gossip, the director's cut.dev_get_card_infoβ get card info. who is she? what's her deal? this tells you.dev_get_capabilitiesβ discover device capabilities. the vibe check that reveals what your hardware can actually do. πdev_set_ledβ turn on/off device LED. yes bestie, we get to control the little light. π‘dev_set_opt_modeβ setctrlmod. the mode-setting icon.dev_start_chipβ start the CAN controller. wake up queen. βdev_stop_chipβ stop the CAN controller. rest era.dev_reset_chipβ reset the CAN controller. clean slate, new chapter, we love a fresh start. πdev_flush_queueβ flush outstanding CAN messages. purging the queue so nothing lingers, highkey satisfying.dev_read_bulk_callbackβ handle incoming commands. the listener, the receiver, the one who answers the phone.dev_frame_to_cmdβ translatestruct can_frameinto device command. the translator bestie who speaks both languages fluently. π¦
π SEE ALSO π
literally just go look at the kernel file, bestie, it's all there:
./drivers/net/can/usb/kvaser_usb/kvaser_usb.h
okay that's the whole page! π«Ά this was brought to you by the driver source over at ./drivers/net/can/usb/kvaser_usb, dated October 2026, and the page itself is struct kvaser_usb_dev_ops(9). stay iconic, stay well-documented, and remember: the struct knows all. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms