From patchwork Tue Dec 5 21:02:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 174192 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3704960vqy; Tue, 5 Dec 2023 13:02:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEuAiz6kawdrsRPffUJLzj6+2PBaxkoJooOWYkHggyNIU/3e5NnV5IBgFgK7ztmJhvgiZxh X-Received: by 2002:a05:6a20:8f15:b0:18c:a983:a5f6 with SMTP id b21-20020a056a208f1500b0018ca983a5f6mr3798331pzk.23.1701810176228; Tue, 05 Dec 2023 13:02:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701810176; cv=none; d=google.com; s=arc-20160816; b=ea0iat1cwkqyqlwH9echaGNnIvprXdjl6rzXZJUe7Cc4DfOEVivDoH6vGbZBrqFW4l JmlQ0mwea3GcdO5f/m9K4DhGUTyo4v2H1cCa/HpVQl3P1VbhA+R7T4OGgQ5gCdd8Jx3+ PQ/J986lzGLpjpMU31e17QEss1XCemh0jXmzDYJ9Btn+dY0cU8t7W9xDTnRgyjyZ0ksX BchChfeVZvc56PutnPrUo2tZ28pVPXFcSE0v4r9p+wmOENSOjDafjubFDMri1R6dcvDI qkjPr8r1Ctnxv4a1uzinoTZDDymKM9Mx/y6gdrja7AWd1p87MyHeOs+cmFqoMuYj3WV6 695w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=x74SPMcY0OIkNHNYKVP8zxIa11SKy/rAVbNbtzbNtj4=; fh=VglJ5Gv1xOHZrymHLdUtJVgS4xAeKIR1Vk0gGFskmiU=; b=rlTVtfl0JpFpht6791rJZ6IqeM9BCwjkI9r7Z/GmCIJykdyzJ7GOhh2EDjIBywJK4Q TrOUiJX/fZKjkFfjjXVQwnCEWvdEbYm7X8XLGy+00pdtqo0G9iEc9n4a3NqQixZMAGPD GqDKmEOtrHS78t7WEudndSWiuFwBL7zefyTEbCt0cwTeJKLe5WC8Yz2feiNPU176Own6 a5ZvQXD0uwA6da5hXPS0nrM8vCjsmdcdbCnhNp1DWTltKQSKkH83RsTitUw++DFWSiCn aZhyqJRYpWb5w2B+vF4LrEH1tLcXudUPcdjB4ZoSd7OHF+CIpiS2Zk4E4451eXkygwIq w8BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YSYmIgJQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t26-20020a65609a000000b005c65e63ae63si6313008pgu.14.2023.12.05.13.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 13:02:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YSYmIgJQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0AF62801C91D; Tue, 5 Dec 2023 13:02:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345870AbjLEVCm (ORCPT + 99 others); Tue, 5 Dec 2023 16:02:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjLEVCl (ORCPT ); Tue, 5 Dec 2023 16:02:41 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E68B188; Tue, 5 Dec 2023 13:02:47 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-54c79968ffbso4491534a12.3; Tue, 05 Dec 2023 13:02:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701810166; x=1702414966; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=x74SPMcY0OIkNHNYKVP8zxIa11SKy/rAVbNbtzbNtj4=; b=YSYmIgJQFm8WVfJNnAu/BP/5dxy3jM1T5ZNttRmYT71/aIP4z/4zHWILfCe2PMfIGU Z+xO3JeEBnHUSxa4kTFLPjcvcOnGlwseETZ6W+B1Jn6vfgwZUfbtV6ipOycJGccSZcHY R2Q0/60YA8xx8d2uZ2dKaF0l0X3wKM6uq48GDjpLWslVCXRnoRmFTxCvPnCmY55j2CIZ mWEMtaSROUpEEI3Bvhvt80TPDBrMJ764TSErtPfk2x/DxyQS6KoUCeXaDSpCkcrlSvJa 9jLPPCh4/0HweJS4mn8esaniMY/OzfDABmekF8E/4jTBt2AcR5gTVkIBCfgeQw2ErCuY 38gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701810166; x=1702414966; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x74SPMcY0OIkNHNYKVP8zxIa11SKy/rAVbNbtzbNtj4=; b=eS0TDeQIA/UT5QoTkT2Y/ZSX4OPqhnKlfxGuY40MvGXQU/y4srEZv5lRiThAAkWoo8 ynbFo5njPvnYe6yVf6HAci+PM/LbSWDyWdgdxtGutnev/x/p+ia2fGn1Vv/6mwk/f03L 0TslqqLjEATD1jQjTTqmgpr4ByF+2yot8ouXJfaS9XGjEiqoJYtMGEINa3n3ImzrNXr5 oMokcbk3K1YnNj+jdLpoCMvvPfIwYhqQ0rhwPuabzqVoa8DuYijv/J973gmC4DPvzNtb aaX/XgH/35PDIc6dVdsMgpH9gO8lkRaFfrIobuC9WwPwiGjSijUU7Kwj18IXXZxYKEMx wnUw== X-Gm-Message-State: AOJu0Ywv715e/2bLn8WLHoUmkpazFxwWSNXyaVL+mkOEmQZKJ7Oa05l5 UjoA5WMQW8zTHj+YjxiqiQ== X-Received: by 2002:aa7:dad5:0:b0:54c:c1e4:3d3 with SMTP id x21-20020aa7dad5000000b0054cc1e403d3mr2465047eds.33.1701810165848; Tue, 05 Dec 2023 13:02:45 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:d9b0:71c0:990:192e]) by smtp.gmail.com with ESMTPSA id i21-20020a50fc15000000b0054ca3df2257sm1552836edr.36.2023.12.05.13.02.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 13:02:45 -0800 (PST) From: Alex Bee To: Amitkumar Karwar , Ganapathi Bhat , Kalle Valo Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH] wifi: mwifiex: Restore USB8897 chipset support Date: Tue, 5 Dec 2023 22:02:37 +0100 Message-ID: <20231205210237.209332-1-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 05 Dec 2023 13:02:51 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784477307549793466 X-GMAIL-MSGID: 1784477307549793466 This patch restores USB8897 support which was removed with Commit 60a188a2715f ("mwifiex: remove USB8897 chipset support") There are quite some devices which use this chipset with USB interface. The firmware still exits in linux upstream firmware repo and this simple patch is all what is required to support it in upstream linux (again). Signed-off-by: Alex Bee --- Recently I upstreamed support for Geniatec XPI-3128 SBC which actually has one any of those boards soldered to the onboard USB Host controller. Geniatech has some boards [0], [1], [2] (maybe more) which have this variant soldered the same way. (optional) I've also read that "Xbox Wireless adapter for Windows" uses this chipset (unverified). I've also CC'ed Ganapathi Bhat who last updated the firmware for SDIO and PCIe variant of this chipset: It would be great if the firmware for USB variant could get an update too, as the one which we currently have is quite old - version 15.68.4.p103, while other have some 16.* firmware. [0] https://www.geniatech.com/product/xpi-3288/ [1] https://www.geniatech.com/product/xpi-imx8mm/ [2] https://www.geniatech.com/product/xpi-s905x/ drivers/net/wireless/marvell/mwifiex/Kconfig | 4 ++-- drivers/net/wireless/marvell/mwifiex/usb.c | 14 ++++++++++++++ drivers/net/wireless/marvell/mwifiex/usb.h | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/Kconfig b/drivers/net/wireless/marvell/mwifiex/Kconfig index b182f7155d66..277b75eaf91e 100644 --- a/drivers/net/wireless/marvell/mwifiex/Kconfig +++ b/drivers/net/wireless/marvell/mwifiex/Kconfig @@ -35,12 +35,12 @@ config MWIFIEX_PCIE mwifiex_pcie. config MWIFIEX_USB - tristate "Marvell WiFi-Ex Driver for USB8766/8797/8997" + tristate "Marvell WiFi-Ex Driver for USB8766/8797/8897/8997" depends on MWIFIEX && USB select FW_LOADER help This adds support for wireless adapters based on Marvell - 8797/8997 chipset with USB interface. + 8797/8897/8997 chipset with USB interface. If you choose to build it as a module, it will be called mwifiex_usb. diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c index d3ab9572e711..061be9c2ed2f 100644 --- a/drivers/net/wireless/marvell/mwifiex/usb.c +++ b/drivers/net/wireless/marvell/mwifiex/usb.c @@ -28,6 +28,11 @@ static const struct usb_device_id mwifiex_usb_table[] = { {USB_DEVICE_AND_INTERFACE_INFO(USB8XXX_VID, USB8801_PID_2, USB_CLASS_VENDOR_SPEC, USB_SUBCLASS_VENDOR_SPEC, 0xff)}, + /* 8897 */ + {USB_DEVICE(USB8XXX_VID, USB8897_PID_1)}, + {USB_DEVICE_AND_INTERFACE_INFO(USB8XXX_VID, USB8897_PID_2, + USB_CLASS_VENDOR_SPEC, + USB_SUBCLASS_VENDOR_SPEC, 0xff)}, /* 8997 */ {USB_DEVICE(USB8XXX_VID, USB8997_PID_1)}, {USB_DEVICE_AND_INTERFACE_INFO(USB8XXX_VID, USB8997_PID_2, @@ -409,12 +414,14 @@ static int mwifiex_usb_probe(struct usb_interface *intf, case USB8766_PID_1: case USB8797_PID_1: case USB8801_PID_1: + case USB8897_PID_1: case USB8997_PID_1: card->usb_boot_state = USB8XXX_FW_DNLD; break; case USB8766_PID_2: case USB8797_PID_2: case USB8801_PID_2: + case USB8897_PID_2: case USB8997_PID_2: card->usb_boot_state = USB8XXX_FW_READY; break; @@ -1318,6 +1325,12 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) strcpy(adapter->fw_name, USB8997_DEFAULT_FW_NAME); adapter->ext_scan = true; break; + case USB8897_PID_1: + case USB8897_PID_2: + adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K; + strcpy(adapter->fw_name, USB8897_DEFAULT_FW_NAME); + adapter->ext_scan = true; + break; case USB8766_PID_1: case USB8766_PID_2: adapter->tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K; @@ -1615,4 +1628,5 @@ MODULE_LICENSE("GPL v2"); MODULE_FIRMWARE(USB8766_DEFAULT_FW_NAME); MODULE_FIRMWARE(USB8797_DEFAULT_FW_NAME); MODULE_FIRMWARE(USB8801_DEFAULT_FW_NAME); +MODULE_FIRMWARE(USB8897_DEFAULT_FW_NAME); MODULE_FIRMWARE(USB8997_DEFAULT_FW_NAME); diff --git a/drivers/net/wireless/marvell/mwifiex/usb.h b/drivers/net/wireless/marvell/mwifiex/usb.h index 7e920b51994c..b7dba256e9f8 100644 --- a/drivers/net/wireless/marvell/mwifiex/usb.h +++ b/drivers/net/wireless/marvell/mwifiex/usb.h @@ -19,6 +19,8 @@ #define USB8797_PID_2 0x2044 #define USB8801_PID_1 0x2049 #define USB8801_PID_2 0x204a +#define USB8897_PID_1 0x2045 +#define USB8897_PID_2 0x2046 #define USB8997_PID_1 0x2052 #define USB8997_PID_2 0x204e @@ -35,6 +37,7 @@ #define USB8766_DEFAULT_FW_NAME "mrvl/usb8766_uapsta.bin" #define USB8797_DEFAULT_FW_NAME "mrvl/usb8797_uapsta.bin" #define USB8801_DEFAULT_FW_NAME "mrvl/usb8801_uapsta.bin" +#define USB8897_DEFAULT_FW_NAME "mrvl/usb8897_uapsta.bin" #define USB8997_DEFAULT_FW_NAME "mrvl/usbusb8997_combo_v4.bin" #define FW_DNLD_TX_BUF_SIZE 620