From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EEB4C433B4 for ; Wed, 5 May 2021 14:27:45 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FA8A613BE for ; Wed, 5 May 2021 14:27:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FA8A613BE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=ath11k-bounces+ath11k=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:Cc:To:From :Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UgoUOyWVfAUaDVE7y+ss6lbJNcO908peO2aROThTsVg=; b=emXpD74Yd1lnzA2jHXG5E+bG6 7/6hecNWu7d1e5xXfwTWkG+o0TjWnKgJv/FutjVsfrVq5riqefmxksoMQTJiBD9aZ9WqOM2sW04wJ kHMFPbe0KCaQxHa0N51oImvfP8wPV/E0/TXRBb4Z7wrFn11jDQMckpDApdRfcx9jeVkutm3Xtbs7p i/mvbeSBcFRsJyLr2oGtYNB6NLhB7EdxAI44DVrfBUl0/SAvz7ScV+T17Hswu3pSYSrobQrXIICjo vo1yiqguJA4DxNqR29EUrNK4ZkAFsEtSB9nIyE69NB6f1jol5J7k0tY2geK+rV5r6nTYCzfDnQ8L5 dOv0Lbuhg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1leIV0-001QfQ-HI; Wed, 05 May 2021 14:27:38 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leIUy-001Qdv-Lf for ath11k@desiato.infradead.org; Wed, 05 May 2021 14:27:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Message-ID:References:In-Reply-To: Subject:Cc:To:From:Date:Content-Transfer-Encoding:Content-Type:MIME-Version: Sender:Reply-To:Content-ID:Content-Description; bh=10W8JpKllbkaXdTAT7CM0Hm+0iZGJXV5CAgR1GWuops=; b=OgoE+zva0jXqiZjN4fsLCDaTwA sLBCX8604n9GYi05oX6HJVb+rhN4m+LOWipMGEyRqOMNPXst0z7HH8YKNKIxVxVzCS5iRrTeUQrmA /mmTgrDvk1jS/iuvU/FxKoLI3b/b+XENNdR+e8qPD/8srFPjFgMt0GYpGOTDgyf446a7eWkFDbk1p LcSDePDkDc1d8LN3zycQjai5bNwF9GQHq2pwDtAHbDiulcTg31eeIVRQr7X0WaB2y4CUL8RNkjxJC G6skpW9A3P741tt5yXtNjmLNfwHN6MPSQbKQPPVfB+AKWD9CpJNf1o+CwSejNrG/k2akjF9TSSF/1 xh5sKE/A==; Received: from m43-7.mailgun.net ([69.72.43.7]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1leIUv-004pEe-Sh for ath11k@lists.infradead.org; Wed, 05 May 2021 14:27:35 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1620224853; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=10W8JpKllbkaXdTAT7CM0Hm+0iZGJXV5CAgR1GWuops=; b=xcsxHGK2kgtPqmg/LPoNfNmP/SZDhwqhJrpVdPks4MoX9Jo02eaeZ3HWGxK3xVK16/ISnSi0 STt5ro0B/gzWLVMsvsKcpAK+4Y9PY05NTmN5jOgVMy1vTr3pqyTRN/rdkxztp9Bwm2z15Gqj HiTLwVMNWbdVWDdTWHcbejiJISE= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyJmOGQ2ZiIsICJhdGgxMWtAbGlzdHMuaW5mcmFkZWFkLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-west-2.postgun.com with SMTP id 6092ab54f34440a9d4ccbfe1 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 05 May 2021 14:27:32 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0CD86C4338A; Wed, 5 May 2021 14:27:32 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jjohnson) by smtp.codeaurora.org (Postfix) with ESMTPSA id A67F6C433F1; Wed, 5 May 2021 14:27:31 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 05 May 2021 07:27:31 -0700 From: jjohnson@codeaurora.org To: Maharaja Kennadyrajan Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, ath11k Subject: Re: [PATCH v2 1/3] nl80211: Add support for beacon tx mode In-Reply-To: References: <1619696874-30072-1-git-send-email-mkenna@codeaurora.org> <1619696874-30072-2-git-send-email-mkenna@codeaurora.org> <445ba573b519b9434d0e009eb9ff6f45@codeaurora.org> Message-ID: X-Sender: jjohnson@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210505_072734_055668_4FCF39C3 X-CRM114-Status: GOOD ( 17.06 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "ath11k" Errors-To: ath11k-bounces+ath11k=archiver.kernel.org@lists.infradead.org On 2021-05-05 00:18, Maharaja Kennadyrajan wrote: > On 2021-05-03 22:54, jjohnson@codeaurora.org wrote: >> On 2021-04-29 04:47, Maharaja Kennadyrajan wrote: >> [..snip..] >>> +/** >>> + * enum nl80211_beacon_tx_mode - Beacon Tx Mode enum. >>> + * Used to configure beacon staggered mode or beacon burst >>> mode. >>> + */ >>> +enum nl80211_beacon_tx_mode { >>> + NL80211_BEACON_STAGGERED_MODE = 1, >>> + NL80211_BEACON_BURST_MODE = 2, >>> +}; >>> + >> [..snip..] >>> @@ -5330,6 +5331,10 @@ static int nl80211_start_ap(struct sk_buff >>> *skb, >>> struct genl_info *info) >>> params.dtim_period = >>> nla_get_u32(info->attrs[NL80211_ATTR_DTIM_PERIOD]); >>> >>> + if (info->attrs[NL80211_ATTR_BEACON_TX_MODE]) >>> + params.beacon_tx_mode = >>> + >>> nla_get_u32(info->attrs[NL80211_ATTR_BEACON_TX_MODE]); >>> + >> >> Note that in the case where NL80211_ATTR_BEACON_TX_MODE is not >> specified that >> beacon_tx_mode will be zero, which is not a valid >> nl80211_beacon_tx_mode enumeration. >> >> Should you renumber the nl80211_beacon_tx_mode enumerations so that >> the default >> mode has a value of 0? Or add NL80211_BEACON_DEFAULT_MODE = 0 and >> allow the driver >> to select a default mode? > > [Maha]: Yes, it will select the default mode as STAGGERED mode when the > user set > beacon_tx_mode as 0 in the hostapd conf file. > Also, it will select the default mode as STAGGERED mode when the user > didn't add > beacon_tx_mode config in the hostapd conf file. > This is how it is handled here already. Regardless of how it is handled, I still assert that there is a coding/logic error here since in the case the attribute is not present you send an invalid enumeration (0) to the driver. I'm suggesting to fix that logic/coding error either by renumbering the existing enumerations or by adding a new enumeration so that 0 is a valid enumeration. -- ath11k mailing list ath11k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath11k