From owner-svn-src-head@freebsd.org Wed Jul 27 20:46:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C812BA6835; Wed, 27 Jul 2016 20:46:53 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E95581293; Wed, 27 Jul 2016 20:46:52 +0000 (UTC) (envelope-from ivadasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6RKkqSw093828; Wed, 27 Jul 2016 20:46:52 GMT (envelope-from ivadasz@FreeBSD.org) Received: (from ivadasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6RKkqPJ093825; Wed, 27 Jul 2016 20:46:52 GMT (envelope-from ivadasz@FreeBSD.org) Message-Id: <201607272046.u6RKkqPJ093825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ivadasz set sender to ivadasz@FreeBSD.org using -f From: =?UTF-8?Q?Imre_Vad=c3=a1sz?= Date: Wed, 27 Jul 2016 20:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303416 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2016 20:46:53 -0000 Author: ivadasz Date: Wed Jul 27 20:46:51 2016 New Revision: 303416 URL: https://svnweb.freebsd.org/changeset/base/303416 Log: [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 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmreg.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Wed Jul 27 20:45:00 2016 (r303415) +++ head/sys/dev/iwm/if_iwm.c Wed Jul 27 20:46:51 2016 (r303416) @@ -3360,12 +3360,15 @@ iwm_tx(struct iwm_softc *sc, struct mbuf 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) { Modified: head/sys/dev/iwm/if_iwmreg.h ============================================================================== --- head/sys/dev/iwm/if_iwmreg.h Wed Jul 27 20:45:00 2016 (r303415) +++ head/sys/dev/iwm/if_iwmreg.h Wed Jul 27 20:46:51 2016 (r303416) @@ -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 */