From patchwork Wed Jul 1 10:16:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 6702641 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D1AE8C05AC for ; Wed, 1 Jul 2015 10:17:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 085CD206C3 for ; Wed, 1 Jul 2015 10:17:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 293B8206BC for ; Wed, 1 Jul 2015 10:17:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZAF57-0003m5-Ak; Wed, 01 Jul 2015 10:17:29 +0000 Received: from sabertooth02.qualcomm.com ([65.197.215.38]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZAF55-0003YV-D3 for ath10k@lists.infradead.org; Wed, 01 Jul 2015 10:17:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1435745847; x=1467281847; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=r3p7tYdvWS4HSx7bO4hSR2ggngbV2+/3BhwVhFJouqA=; b=Php4H6vHeCnGMfqY9H00g968HiKsjYRd0qz9xgz3bEsYTqUmdCjkeUDd XaXvl5XfrWNAgR3uYUFDVEjeFib8gjMGOnksK6dsolBcaa4sK6TvLLwQ1 +0QBKuh96cWc35qfjzjBnOJq86Zj+mh+3SS2h5BStpy6VZMCHXXSs62b1 4=; X-IronPort-AV: E=McAfee;i="5700,7163,7848"; a="92890292" Received: from ironmsg04-l.qualcomm.com ([172.30.48.19]) by sabertooth02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Jul 2015 03:17:03 -0700 X-IronPort-AV: E=Sophos;i="5.15,384,1432623600"; d="scan'208";a="924475535" Received: from nasanexm01g.na.qualcomm.com ([10.85.0.33]) by Ironmsg04-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 01 Jul 2015 03:17:03 -0700 Received: from potku.adurom.net (10.80.80.8) by NASANEXM01G.na.qualcomm.com (10.85.0.33) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Wed, 1 Jul 2015 03:17:01 -0700 From: Kalle Valo To: Raja Mani Subject: Re: [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap References: <1434984747-24294-1-git-send-email-rmani@qti.qualcomm.com> <1434984747-24294-2-git-send-email-rmani@qti.qualcomm.com> Date: Wed, 1 Jul 2015 13:16:55 +0300 In-Reply-To: <1434984747-24294-2-git-send-email-rmani@qti.qualcomm.com> (Raja Mani's message of "Mon, 22 Jun 2015 20:22:20 +0530") Message-ID: <87h9poxjvs.fsf@kamboji.qca.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) To NASANEXM01G.na.qualcomm.com (10.85.0.33) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150701_031727_546343_FC566034 X-CRM114-Status: GOOD ( 17.10 ) X-Spam-Score: -7.6 (-------) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Raja Mani writes: > Due to 512 client support in 10.4 firmware, size of tim ie is going > to be slightly higher than non 10.4 firmware. So, size of tim_bitmap > what is carried in swba event from 10.4 firmware is bit higher. > > The only bottle neck to reuse existing swba handler > ath10k_wmi_event_host_swba() for 10.4 is that code designed to deal > with fixed size tim bitmap(ie, tim_info[].tim_bitmap in wmi_swba_ev_arg). > This patch removes such size limitation and makes it more suitable > to handle swba event which has different size tim bitmap. > > All existing swba event parsing functions are changed to adapt this > change. Actual support to handle 10.4 swba event is added in next patch. > Only preparation is made in this patch. > > Signed-off-by: Raja Mani [...] > --- a/drivers/net/wireless/ath/ath10k/wmi.c > +++ b/drivers/net/wireless/ath/ath10k/wmi.c > @@ -2874,33 +2874,38 @@ exit: > static void ath10k_wmi_update_tim(struct ath10k *ar, > struct ath10k_vif *arvif, > struct sk_buff *bcn, > - const struct wmi_tim_info *tim_info) > + const struct wmi_tim_info_arg *tim_info) > { > struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)bcn->data; > struct ieee80211_tim_ie *tim; > u8 *ies, *ie; > u8 ie_len, pvm_len; > __le32 t; > - u32 v; > + u32 v, tim_len; > + > + /* When FW reports 0 in tim_len, ensure atleast first byte > + * in tim_bitmap is considered for pvm calculation. > + */ > + tim_len = tim_info->tim_len ? __le32_to_cpu(tim_info->tim_len) : 1; > > /* if next SWBA has no tim_changed the tim_bitmap is garbage. > * we must copy the bitmap upon change and reuse it later */ > if (__le32_to_cpu(tim_info->tim_changed)) { > int i; > > - BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) != > - sizeof(tim_info->tim_bitmap)); > + WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len); I'm worried that this WARN_ON() spams too much so I changed it to: --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -2893,7 +2893,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar, if (__le32_to_cpu(tim_info->tim_changed)) { int i; - WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len); + WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len); for (i = 0; i < tim_len; i++) { t = tim_info->tim_bitmap[i / 4];