diff options
| author | Arik Nemtsov <arik@wizery.com> | 2013-10-02 09:58:09 -0400 |
|---|---|---|
| committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-02-03 15:23:39 -0500 |
| commit | 98ee7783062335984f5979cea6a08e79982a4061 (patch) | |
| tree | eff12a357e6afc9b3d14960038942ea747069ddc /drivers/net/wireless/iwlwifi/iwl-trans.h | |
| parent | b3370d47f02eaeef52557259709589d81fdc573b (diff) | |
iwlwifi: add very first D0i3 support
When the bus is in D0i3, we can't send regular commands to
the firmware. This means that we need to add a state to
remember what is our d0i3 state and make sure that only
d0i3 exit commands can be sent.
Add flags to CMD_ flags and transport status for this
purpose.
Commands with CMD_HIGH_PRIO set are queued at the head of
the command queue, behind other high priority commands.
Commands with CMD_SEND_IN_IDLE set can be sent while the
transport is idle (without taking rpm reference).
Commands with CMD_MAKE_TRANS_IDLE set indicate that command
completion should mark the transport as idle (and release
the bus).
Commands with CMD_WAKE_UP_TRANS set instruct the transport
to exit from idle when this command is completed.
The transport is marked as idle (STATUS_TRANS_IDLE) when
the FW enters D0i3 state. This bit is cleared when it
enters D0 state again.
Process only commands with CMD_SEND_IN_IDLE flag while the
transport is idle. Other enqueued commands will be
processed only later, right after exiting D0i3.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.h')
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 1b2ac31d7445..7b19274b550f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
| @@ -193,12 +193,23 @@ static inline u32 iwl_rx_packet_payload_len(const struct iwl_rx_packet *pkt) | |||
| 193 | * @CMD_ASYNC: Return right away and don't wait for the response | 193 | * @CMD_ASYNC: Return right away and don't wait for the response |
| 194 | * @CMD_WANT_SKB: valid only with CMD_SYNC. The caller needs the buffer of the | 194 | * @CMD_WANT_SKB: valid only with CMD_SYNC. The caller needs the buffer of the |
| 195 | * response. The caller needs to call iwl_free_resp when done. | 195 | * response. The caller needs to call iwl_free_resp when done. |
| 196 | * @CMD_HIGH_PRIO: The command is high priority - it goes to the front of the | ||
| 197 | * command queue, but after other high priority commands. valid only | ||
| 198 | * with CMD_ASYNC. | ||
| 199 | * @CMD_SEND_IN_IDLE: The command should be sent even when the trans is idle. | ||
| 200 | * @CMD_MAKE_TRANS_IDLE: The command response should mark the trans as idle. | ||
| 201 | * @CMD_WAKE_UP_TRANS: The command response should wake up the trans | ||
| 202 | * (i.e. mark it as non-idle). | ||
| 196 | */ | 203 | */ |
| 197 | enum CMD_MODE { | 204 | enum CMD_MODE { |
| 198 | CMD_SYNC = 0, | 205 | CMD_SYNC = 0, |
| 199 | CMD_ASYNC = BIT(0), | 206 | CMD_ASYNC = BIT(0), |
| 200 | CMD_WANT_SKB = BIT(1), | 207 | CMD_WANT_SKB = BIT(1), |
| 201 | CMD_SEND_IN_RFKILL = BIT(2), | 208 | CMD_SEND_IN_RFKILL = BIT(2), |
| 209 | CMD_HIGH_PRIO = BIT(3), | ||
| 210 | CMD_SEND_IN_IDLE = BIT(4), | ||
| 211 | CMD_MAKE_TRANS_IDLE = BIT(5), | ||
| 212 | CMD_WAKE_UP_TRANS = BIT(6), | ||
| 202 | }; | 213 | }; |
| 203 | 214 | ||
| 204 | #define DEF_CMD_PAYLOAD_SIZE 320 | 215 | #define DEF_CMD_PAYLOAD_SIZE 320 |
| @@ -335,6 +346,9 @@ enum iwl_d3_status { | |||
| 335 | * @STATUS_INT_ENABLED: interrupts are enabled | 346 | * @STATUS_INT_ENABLED: interrupts are enabled |
| 336 | * @STATUS_RFKILL: the HW RFkill switch is in KILL position | 347 | * @STATUS_RFKILL: the HW RFkill switch is in KILL position |
| 337 | * @STATUS_FW_ERROR: the fw is in error state | 348 | * @STATUS_FW_ERROR: the fw is in error state |
| 349 | * @STATUS_TRANS_GOING_IDLE: shutting down the trans, only special commands | ||
| 350 | * are sent | ||
| 351 | * @STATUS_TRANS_IDLE: the trans is idle - general commands are not to be sent | ||
| 338 | */ | 352 | */ |
| 339 | enum iwl_trans_status { | 353 | enum iwl_trans_status { |
| 340 | STATUS_SYNC_HCMD_ACTIVE, | 354 | STATUS_SYNC_HCMD_ACTIVE, |
| @@ -343,6 +357,8 @@ enum iwl_trans_status { | |||
| 343 | STATUS_INT_ENABLED, | 357 | STATUS_INT_ENABLED, |
| 344 | STATUS_RFKILL, | 358 | STATUS_RFKILL, |
| 345 | STATUS_FW_ERROR, | 359 | STATUS_FW_ERROR, |
| 360 | STATUS_TRANS_GOING_IDLE, | ||
| 361 | STATUS_TRANS_IDLE, | ||
| 346 | }; | 362 | }; |
| 347 | 363 | ||
| 348 | /** | 364 | /** |
