STRUCT IWL_OP_MODE_OPS(9)
π 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.rxbis 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). thequeueparameter 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.truemeans the radio is killed π returntrueif the device should be stopped by the transport immediately after the call. May sleep. β οΈ but note β this must not returntruefor 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, returntrueif 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
- 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