From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Valo Date: Thu, 9 May 2013 11:47:10 +0300 Subject: [ath9k-devel] [PATCH 3/3] ath10k: enable STA UAPSD support In-Reply-To: <518B595F.4070908@tieto.com> (Michal Kazior's message of "Thu, 9 May 2013 10:07:59 +0200") References: <1367999363-20424-1-git-send-email-janusz.dziedzic@tieto.com> <1367999363-20424-4-git-send-email-janusz.dziedzic@tieto.com> <8738twy647.fsf@kamboji.qca.qualcomm.com> <3078A9B976EF864C8DDD0C499FFD07913139B7B8C3@EXMB01.eu.tieto.com> <518B595F.4070908@tieto.com> Message-ID: <87a9o4wne9.fsf@kamboji.qca.qualcomm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org Michal Kazior writes: >> Not really. This is because we have to set/clean this flags for every ACs. >> So, this is just to prevent code duplication. >> >> case IEEE80211_AC_VO: >> if (enable) >> ... >> else >> .... >> break; >> case IEEE80211_AC_VI: >> if (enable) >> .... >> else >> .... >> break; >> ..... >> >> I can remove this macro and create inline function instead. > > Hmm, but since this is per-ac can't we do the following? > > switch (ac) { > case IEEE80211_AC_VO: > val = WMI_STA_PS_UAPSD_AC3_DELIVERY_EN | > WMI_STA_PS_UAPSD_AC3_TRIGGER_EN; > break; > // .. > } > > if (enable) > arvif->u.sta.uapsd |= val; > else > arvif->u.sta.uapsd &= ~val; > > > No macros and no code duplication. Yes, much better. I hate macros :) -- Kalle Valo