aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-op-mode.h
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-02-16 02:35:19 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-02-27 16:56:46 -0500
commit53476fe11f730e37a6e8f0eabb25d59485e9854b (patch)
treefdf68361c9a85c9e2ec5818aa690da7f0ecabb4c /drivers/net/wireless/iwlwifi/iwl-op-mode.h
parent4d660ce52e27957f7181ef662889eec67686c7b5 (diff)
iwlwifi: document the operational mode
Also add a might_sleep to enforce the context requirements. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-op-mode.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-op-mode.h36
1 files changed, 34 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/iwlwifi/iwl-op-mode.h
index e2a780d12467..d4fc9be2d2f3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-op-mode.h
+++ b/drivers/net/wireless/iwlwifi/iwl-op-mode.h
@@ -70,16 +70,46 @@ struct iwl_device_cmd;
70struct iwl_rx_mem_buffer; 70struct iwl_rx_mem_buffer;
71 71
72/** 72/**
73 * DOC: Operational mode - what is it ?
74 *
75 * The operational mode (a.k.a. op_mode) is the layer that implements
76 * mac80211's handlers. It knows two APIs: mac80211's and the fw's. It uses
77 * the transport API to access the HW. The op_mode doesn't need to know how the
78 * underlying HW works, since the transport layer takes care of that.
79 *
80 * There can be several op_mode: i.e. different fw APIs will require two
81 * different op_modes. This is why the op_mode is virtualized.
82 */
83
84/**
85 * DOC: Life cycle of the Operational mode
86 *
87 * The operational mode has a very simple life cycle.
88 *
89 * 1) The driver layer (iwl-drv.c) chooses the op_mode based on the
90 * capabilities advertized by the fw file (in TLV format).
91 * 2) The driver layer starts the op_mode (ops->start)
92 * 3) The op_mode registers registers mac80211
93 * 4) The op_mode is governed by mac80211
94 * 5) The driver layer stops the op_mode
95 */
96
97/**
73 * struct iwl_op_mode_ops - op_mode specific operations 98 * struct iwl_op_mode_ops - op_mode specific operations
74 * 99 *
100 * The op_mode exports its ops so that external components can start it and
101 * interact with it. The driver layer typically calls the start and stop
102 * handlers, the transport layer calls the others.
103 *
75 * All the handlers MUST be implemented 104 * All the handlers MUST be implemented
76 * 105 *
77 * @start: start the op_mode 106 * @start: start the op_mode. The transport layer is already allocated.
78 * May sleep 107 * May sleep
79 * @stop: stop the op_mode 108 * @stop: stop the op_mode. Must free all the memory allocated.
80 * May sleep 109 * May sleep
81 * @rx: Rx notification to the op_mode. rxb is the Rx buffer itself. Cmd is the 110 * @rx: Rx notification to the op_mode. rxb is the Rx buffer itself. Cmd is the
82 * HCMD the this Rx responds to. 111 * HCMD the this Rx responds to.
112 * Must be atomic.
83 * @queue_full: notifies that a HW queue is full. Ac is the ac of the queue 113 * @queue_full: notifies that a HW queue is full. Ac is the ac of the queue
84 * Must be atomic 114 * Must be atomic
85 * @queue_not_full: notifies that a HW queue is not full any more. 115 * @queue_not_full: notifies that a HW queue is not full any more.
@@ -120,6 +150,8 @@ struct iwl_op_mode {
120 150
121static inline void iwl_op_mode_stop(struct iwl_op_mode *op_mode) 151static inline void iwl_op_mode_stop(struct iwl_op_mode *op_mode)
122{ 152{
153 might_sleep();
154
123 op_mode->ops->stop(op_mode); 155 op_mode->ops->stop(op_mode);
124} 156}
125 157