diff options
author | Imre Vadász <ivadasz@FreeBSD.org> | 2016-07-27 20:46:51 +0000 |
---|---|---|
committer | Imre Vadász <ivadasz@FreeBSD.org> | 2016-07-27 20:46:51 +0000 |
commit | 2b8cf46a6890818a45edd2a752c5cec0c637144e (patch) | |
tree | dd188517a515c4f7ec695ccb9ce398ed83b185a6 | |
parent | ce8596418142bafd9558e820c07d49ae36e65c59 (diff) | |
download | src-2b8cf46a6890818a45edd2a752c5cec0c637144e.tar.gz src-2b8cf46a6890818a45edd2a752c5cec0c637144e.zip |
[iwm] Set different pm_timeout for action frames.
When building a Tx Command for management frames, we are lacking
a check for action frames, for which we should set a different
pm_timeout. This cause the fw to stay awake for 100TU after each
such frame is transmitted, resulting an excessive power consumption.
Taken-From: Linux iwlwifi (git b084a35663c3f1f7)
Approved by: adrian (mentor)
Obtained from: Linux git b084a35663c3f1f7de1c45c4ae3006864c940fe7
Obtained from: DragonFlyBSD git ba00f0e3ae873d6f0d5743e22c3ebc49c44dfdac
Differential Revision: https://reviews.freebsd.org/D7324
Notes
Notes:
svn path=/head/; revision=303416
-rw-r--r-- | sys/dev/iwm/if_iwm.c | 13 | ||||
-rw-r--r-- | sys/dev/iwm/if_iwmreg.h | 12 |
2 files changed, 20 insertions, 5 deletions
diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 60a03a8769e7..efe9050d7844 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -3360,12 +3360,15 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ieee80211_node *ni, int ac) uint8_t subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; if (subtype == IEEE80211_FC0_SUBTYPE_ASSOC_REQ || - subtype == IEEE80211_FC0_SUBTYPE_REASSOC_REQ) - tx->pm_frame_timeout = htole16(3); - else - tx->pm_frame_timeout = htole16(2); + subtype == IEEE80211_FC0_SUBTYPE_REASSOC_REQ) { + tx->pm_frame_timeout = htole16(IWM_PM_FRAME_ASSOC); + } else if (subtype == IEEE80211_FC0_SUBTYPE_ACTION) { + tx->pm_frame_timeout = htole16(IWM_PM_FRAME_NONE); + } else { + tx->pm_frame_timeout = htole16(IWM_PM_FRAME_MGMT); + } } else { - tx->pm_frame_timeout = htole16(0); + tx->pm_frame_timeout = htole16(IWM_PM_FRAME_NONE); } if (hdrlen & 3) { diff --git a/sys/dev/iwm/if_iwmreg.h b/sys/dev/iwm/if_iwmreg.h index f6af4e614386..e68f4d48ac3f 100644 --- a/sys/dev/iwm/if_iwmreg.h +++ b/sys/dev/iwm/if_iwmreg.h @@ -4244,6 +4244,18 @@ enum iwm_tx_flags { IWM_TX_CMD_FLG_HCCA_CHUNK = (1 << 31) }; /* IWM_TX_FLAGS_BITS_API_S_VER_1 */ +/** + * enum iwm_tx_pm_timeouts - pm timeout values in TX command + * @IWM_PM_FRAME_NONE: no need to suspend sleep mode + * @IWM_PM_FRAME_MGMT: fw suspend sleep mode for 100TU + * @IWM_PM_FRAME_ASSOC: fw suspend sleep mode for 10sec + */ +enum iwm_tx_pm_timeouts { + IWM_PM_FRAME_NONE = 0, + IWM_PM_FRAME_MGMT = 2, + IWM_PM_FRAME_ASSOC = 3, +}; + /* * TX command security control */ |