STRUCT IWL_OP_MODE_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

struct iwl_op_mode_ops β€” the op_mode specific operations, bestie. like, all the function pointers the op_mode hands out to the world ✨

okay so real quick before we dive in: this page is from the Kernel API Manual, and we're talking about struct iwl_op_mode_ops(9) β€” yes that's the whole vibe, a big ol' struct full of callbacks πŸŽ€


✨ SYNOPSIS ✨

struct iwl_op_mode_ops {
    struct iwl_op_mode *(*start)(struct iwl_trans *trans, const struct iwl_rf_cfg *cfg, const struct iwl_fw *fw, struct dentry *dbgfs_dir);
    void (*stop)(struct iwl_op_mode *op_mode);
    void (*rx)(struct iwl_op_mode *op_mode, struct napi_struct *napi, struct iwl_rx_cmd_buffer *rxb);
    void (*rx_rss)(struct iwl_op_mode *op_mode, struct napi_struct *napi, struct iwl_rx_cmd_buffer *rxb, unsigned int queue);
    void (*queue_full)(struct iwl_op_mode *op_mode, int queue);
    void (*queue_not_full)(struct iwl_op_mode *op_mode, int queue);
    bool (*hw_rf_kill)(struct iwl_op_mode *op_mode, bool state);
    void (*free_skb)(struct iwl_op_mode *op_mode, struct sk_buff *skb);
    void (*nic_error)(struct iwl_op_mode *op_mode, enum iwl_fw_error_type type);
    void (*dump_error)(struct iwl_op_mode *op_mode, struct iwl_fw_error_dump_mode *mode);
    bool (*sw_reset)(struct iwl_op_mode *op_mode, enum iwl_fw_error_type type);
    void (*nic_config)(struct iwl_op_mode *op_mode);
    void (*wimax_active)(struct iwl_op_mode *op_mode);
    void (*time_point)(struct iwl_op_mode *op_mode, enum iwl_fw_ini_time_point tp_id, union iwl_dbg_tlv_tp_data *tp_data);
    void (*device_powered_off)(struct iwl_op_mode *op_mode);
    void (*dump)(struct iwl_op_mode *op_mode);
 };

like, sixteen whole function pointers. we love a full roster πŸ‘‘


πŸ¦‹ Members πŸ¦‹

  • start β€” starts the op_mode, slay. the transport layer is already allocated by the time this runs, so don't you dare do that yourself. May sleep 😴
  • stop β€” stops the op_mode. this one MUST free all the memory allocated β€” all of it, no crumbs left, periodt. May sleep 😴
  • rx β€” the Rx notification to the op_mode. rxb is the Rx buffer itself, and Cmd is the HCMD this Rx responds to. Can't sleep β€” no napping on this one, bestie 🚫😴
  • rx_rss β€” data queue RX notification to the op_mode, for the (data) notifications that come in on the RSS queue(s). the queue parameter tells you which of the RSS queues received this frame, and heads up: it will always be non-zero. This method must not sleep. nope nope nope πŸ’€
  • queue_full β€” notifies that a HW queue is full πŸ“’ Must be atomic and called with BH disabled.
  • queue_not_full β€” notifies that a HW queue is not full any more, phew 🫢 Must be atomic and called with BH disabled.
  • hw_rf_kill β€” notifies of a change in the HW rf kill switch. true means the radio is killed πŸ’€ return true if the device should be stopped by the transport immediately after the call. May sleep. ⚠️ but note β€” this must not return true for newer devices using gen2 PCIe transport, ok? noted.
  • free_skb β€” lets the transport layer free skbs that haven't been reclaimed by the op_mode. this can happen when the driver is freed and there are Tx packets still pending in the transport layer πŸ™ˆ Must be atomic.
  • nic_error β€” error notification. Must be atomic, and the op mode should handle the error (e.g. abort notification waiters) and print the error if applicable. like, do the thing and also tell us about it 😭
  • dump_error β€” NIC error dump collection (can sleep, synchronous) 😴
  • sw_reset β€” (maybe) initiate a software reset, return true if started. maybe she resets, maybe she doesn't πŸ’…
  • nic_config β€” configure NIC, called before firmware is started. May sleep. 😴
  • wimax_active β€” invoked when WiMax becomes active. May sleep. 😴
  • time_point β€” called when the transport layer wants to collect debug data πŸ”
  • device_powered_off β€” called upon resume from hibernation but not only. the Op_mode needs to reset its internal state because the device did not survive the system state transition. the firmware is no longer running, etc... πŸ˜΅β€πŸ’« yeah, it's giving fresh start, no cap.
  • dump β€” the Op_mode needs to collect the firmware dump upon this handler being called πŸ“¦

🌸 Description 🌸

the op_mode exports its ops so that external components can start it and interact with it. the driver layer typically calls the start and stop handlers, and the transport layer calls all the others 🫢

the rule: All the handlers MUST be implemented β€” every single one, bestie β€” except rx_rss, which can be left out iff the opmode will never run on hardware with multi-queue capability. and that's an iff with two f's, so like, actually think about it before you skip it 🧚

⭐ SEE ALSO ⭐

  • Kernel file ./drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h
  • Operational mode - what is it ?(9)
  • Life cycle of the Operational mode(9)
  • enum iwl_fw_error_type(9)
  • enum iwl_fw_error_context(9)
  • struct iwl_fw_error_dump_mode(9)
  • struct iwl_op_mode(9)

okay that's the whole page, you ate that πŸ’– this came from ./drivers/net/wireless/intel/i..., dated October 2026, and yeah β€” struct iwl_op_mode_ops(9) is iconic, no notes πŸ‘‘βœ¨

πŸ“¦ where this page comes from