Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7487316rwi; Mon, 24 Oct 2022 15:37:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VRmtYk7Ph06ZiX9b2oaXt2mOg7yPNupsKgdr98t8nki2FL8y04++IlAEnPc51gaZHQKxe X-Received: by 2002:a17:906:9bd8:b0:78d:85f9:36ae with SMTP id de24-20020a1709069bd800b0078d85f936aemr30123272ejc.342.1666651069370; Mon, 24 Oct 2022 15:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666651069; cv=none; d=google.com; s=arc-20160816; b=c1RyG+l9dESmv4zygwWmQdxRFFAIKPGH5QQv8kl9aN7HHHIKSxCeYdHkUAVZ4Jvc4c OhjaOy2EaZ0lv7TNpoxIApDeysNZN3uEOVWz32vhKReKG+6KInkZRfgmhaF9dYg5Owpr zuqzgr/geAOTw7sJmJ41/KB/bbkhsX8jBDyN/xlX3RXe6tipCBXPJhkv283kuyNYhrlO /ZioBgJlhJaG8nkwUO+MAyx5TbuzswlSDErD5bPoFGKqwggLaPxuYTBo/E+DhRnPSZun DrN8buOWjhsgTvN7OmCNiu52b4ltRf4+ehzhDkrXF+wScpwyPO1LhUUIbencJjMCGH0D PrJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=302KGUriB18bOlCw7uWI8DGaJWWMh7Gj1UrQAJeI57c=; b=QFx/8JB3l6J5a/3ZUenuELYE4AXdZCh6vc7gF35agWynDDY9i7Nj5xtvjBIiseS2Nk 2IBuOKB6vRknARD4TSsia0K0gvmh62fVJOmoZh3C6pJ//P0N9MI1fc7LoyQS7JdXj94f I05QSeCecks206kKeZbEIRL4mtQHTjX2lWfDdU7AQDc2emL05ASqRGXP8T30oZOJN43N wmRhO11JXM0FWk5reru23FPafX/zWBK13kc+QDUZtiWZbi6EJSFkrePaHic8qGKb7jQm 2+qTq2xNPqHDdDF3nwG039YDYVeLc3fTe3OOVfXKazJX670dZUwL8qcChsSiWKwarMm3 7qxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QHNKQvqY; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a170906708900b0078d8614e809si791247ejk.504.2022.10.24.15.37.33; Mon, 24 Oct 2022 15:37:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QHNKQvqY; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231368AbiJXWf4 (ORCPT + 65 others); Mon, 24 Oct 2022 18:35:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231802AbiJXWfW (ORCPT ); Mon, 24 Oct 2022 18:35:22 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8713E9638E for ; Mon, 24 Oct 2022 13:58:31 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id c7-20020a05600c0ac700b003c6cad86f38so10502925wmr.2 for ; Mon, 24 Oct 2022 13:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=302KGUriB18bOlCw7uWI8DGaJWWMh7Gj1UrQAJeI57c=; b=QHNKQvqY1KPdm5w9bCtltSV7u6Rnjw8QsjYHtAv7Xjvzt7uZPMNqR6aknD0LrzdW0Y Uulpzndkxt/H/jl3jLFu8pTnw5SYKVVqsB5r9UlYA2NTxCLX+6m2iKLKQuG8OEJnX5d+ ZLEhKo+u4wXmn/Ke+meeeEEW5s35kEg7FTWgruPs15fGPNkteG5wnxH6zTqN/ReCnRbv 2hqnRGOFW3m4REzSzX7Ks6x010GzKP98DaSxwZldClzaEFV9SU8wprmKkkC3YaFxnpJS KqKTbfBAwwi438uuX0RoqeuFKgl7w2HNwyMToJ8zbvFFjTpi7V7DBlt+2Uydkcpq4SD0 JQXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=302KGUriB18bOlCw7uWI8DGaJWWMh7Gj1UrQAJeI57c=; b=BS+nyv1snNPNjyZSIju4MHmXfFW0q/00HPxbRUfwCiI4Hj8TmndIqxa6O1GZimz69t RVWvPpw2px3yawaJT0cOxmUjFSgoSSof1o1OrBF6CvaFN0dFNZuaUGSXlJFRPMNfTamF 0wK6XByVdOTfx4aRsUsgsSUo5kjm87D8QPMTJGI9TJtoTKLs6WBw7LDrmrCZVxiMMcyz mKFWgNer85s+2I0iMF4g/VGsmtOaIjVozreRBFdv+SaiH8ZBIRVVcmn3UVRqxKPT4Q0j QeS+8oSK+9wKzRSXICfXZHEjpMUXtXK9JV/C6/3YrwXNTMqvszDYyG80yuNyvWvf7EXw Ohyw== X-Gm-Message-State: ACrzQf3wVm5fQ23gPoV4575HvazddyGXTNMVL6vwv40V6+R06eLKLJ4M toFkzi1jRxCn2NBAS4ZG9zh3acAJVS4= X-Received: by 2002:a05:600c:654f:b0:3c3:b5b7:43a9 with SMTP id dn15-20020a05600c654f00b003c3b5b743a9mr45530303wmb.201.1666645014215; Mon, 24 Oct 2022 13:56:54 -0700 (PDT) Received: from [192.168.1.50] ([81.196.40.23]) by smtp.gmail.com with ESMTPSA id g12-20020a05600c4ecc00b003c6f8d30e40sm9859375wmq.31.2022.10.24.13.56.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Oct 2022 13:56:53 -0700 (PDT) Message-ID: <92f365c5-ff7c-33b0-60c9-f2c1492fba0a@gmail.com> Date: Mon, 24 Oct 2022 23:56:52 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: [PATCH v2 3/5] wifi: rtl8xxxu: Recognise all possible chip cuts Content-Language: en-US From: Bitterblue Smith To: "linux-wireless@vger.kernel.org" Cc: Jes Sorensen References: <1edda764-94ca-2123-0ba6-6b04a1b01709@gmail.com> In-Reply-To: <1edda764-94ca-2123-0ba6-6b04a1b01709@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The chip cut, also known as the chip version, is a letter from A (0) to P (15). Recognise them all instead of printing "unknown" when it's greater than E. Signed-off-by: Bitterblue Smith --- v2: - Suggestion from Ping-Ke Shih: - Don't use array of letters. --- .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 7023f6accda7..7c587b5d554e 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -1574,30 +1574,14 @@ rtl8xxxu_set_spec_sifs(struct rtl8xxxu_priv *priv, u16 cck, u16 ofdm) static void rtl8xxxu_print_chipinfo(struct rtl8xxxu_priv *priv) { struct device *dev = &priv->udev->dev; - char *cut; + char cut = '?'; - switch (priv->chip_cut) { - case 0: - cut = "A"; - break; - case 1: - cut = "B"; - break; - case 2: - cut = "C"; - break; - case 3: - cut = "D"; - break; - case 4: - cut = "E"; - break; - default: - cut = "unknown"; - } + /* Currently always true: chip_cut is 4 bits. */ + if (priv->chip_cut <= 15) + cut = 'A' + priv->chip_cut; dev_info(dev, - "RTL%s rev %s (%s) %iT%iR, TX queues %i, WiFi=%i, BT=%i, GPS=%i, HI PA=%i\n", + "RTL%s rev %c (%s) %iT%iR, TX queues %i, WiFi=%i, BT=%i, GPS=%i, HI PA=%i\n", priv->chip_name, cut, priv->chip_vendor, priv->tx_paths, priv->rx_paths, priv->ep_tx_count, priv->has_wifi, priv->has_bluetooth, priv->has_gps, priv->hi_pa); -- 2.38.0