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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2C03C433FE for ; Wed, 3 Nov 2021 13:38:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E073861051 for ; Wed, 3 Nov 2021 13:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231961AbhKCNkq (ORCPT ); Wed, 3 Nov 2021 09:40:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbhKCNkk (ORCPT ); Wed, 3 Nov 2021 09:40:40 -0400 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050::465:201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93408C061714; Wed, 3 Nov 2021 06:38:03 -0700 (PDT) Received: from smtp102.mailbox.org (smtp102.mailbox.org [80.241.60.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Hkns40jk3zQjdM; Wed, 3 Nov 2021 14:38:00 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Message-ID: Date: Wed, 3 Nov 2021 14:37:53 +0100 MIME-Version: 1.0 Subject: Re: [PATCH] mwifiex: Add quirk to disable deep sleep with certain hardware revision Content-Language: en-US From: =?UTF-8?Q?Jonas_Dre=c3=9fler?= To: Brian Norris Cc: Amitkumar Karwar , Ganapathi Bhat , Xinming Hu , Kalle Valo , "David S. Miller" , Jakub Kicinski , Tsuchiya Yuto , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Maximilian Luz , Andy Shevchenko , Bjorn Helgaas , =?UTF-8?Q?Pali_Roh=c3=a1r?= References: <20211028073729.24408-1-verdre@v0yd.nl> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D3831329 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/3/21 13:25, Jonas Dreßler wrote: > >> >>> --- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c >>> +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c >>> @@ -708,6 +708,22 @@ static int mwifiex_ret_ver_ext(struct mwifiex_private *priv, >>>   { >>>          struct host_cmd_ds_version_ext *ver_ext = &resp->params.verext; >>> >>> +       if (test_and_clear_bit(MWIFIEX_IS_REQUESTING_FW_VEREXT, &priv->adapter->work_flags)) { >>> +               if (strncmp(ver_ext->version_str, "ChipRev:20, BB:9b(10.00), RF:40(21)", 128) == 0) { >> >> Rather than memorize the 128-size array here, maybe use >> sizeof(ver_ext->version_str) ? > > Sounds like a good idea, yeah. Nevermind, the reason I did this was for consistency in the function, right underneath in the same function it also assumes a fixed size of 128 characters, so I'd rather use the same length. > memcpy(version_ext->version_str, ver_ext->version_str, > sizeof(char) * 128); > memcpy(priv->version_str, ver_ext->version_str, 128); Might be a good idea to #define it as MWIFIEX_VERSION_STR_LENGTH in fw.h though...