STRUCT KVASER_USB_DEV_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 for can.do_set_mode. it sets the CAN mode, periodt.
  • dev_set_bittiming β€” used for can.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 for can.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 for can.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 β€” set ctrlmod. 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 β€” translate struct can_frame into 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