From patchwork Sun Nov 17 08:31:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Shapovalov X-Patchwork-Id: 13877801 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 990941E526 for ; Sun, 17 Nov 2024 08:32:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832342; cv=none; b=twh6tbbGeIsVs46e9V2kyBEMZRHyS6Wa2P7fsu3i2zvgdAjnd0xPMoLjoePSISMuIfUmQO6TUShFHE8VyaExmr8Fex/pJEpZJXg4RaF2GNjJDZ91/YUAryU6VeQQw4FuFEuTSXyez3YYdKtvxU7g01i8QQGxG+6EkmNDv5Lwtqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832342; c=relaxed/simple; bh=bEdtzbEoybZw2elzR+5shN7afieydr1cqVkaEADVKqI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qUNcID1YoSlDKjR6e3DZSlcVttD/aMfBJeHBgP0LXcXJhBWCISGS2zSxl3pmTu97U0p9zUfWswSIsGp1CUp/7EWmpe3qf1GPLWabH65sWFHp3cgCZyKLxzthpL5hj1IkHJ6MxfjnuqdqtbQJ0MuUVCaUHL8KbOpIZjm9/NVStWA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name; spf=pass smtp.mailfrom=intelfx.name; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b=J31Kg2or; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intelfx.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b="J31Kg2or" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-37d4b0943c7so2085364f8f.1 for ; Sun, 17 Nov 2024 00:32:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intelfx.name; s=google; t=1731832339; x=1732437139; 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=3xqOFH63hSrxX1dILSqXuu7UlXARoGwwkDBC60Jsfjg=; b=J31Kg2orYVJNBZ8e//Rq0DHyUvW1m3mjPr7srLgL4qpNSRf/8F26rS2jqyShispcup 2L/ucFbYK2ZJzkex6KlLKEiRt2KnpGnVoOa5j7Y+rKCOlvyflFMBmbt+pKJ+O+esqhgw uNybT4QMOdJ7qAis19yDhea5hzon2FnuZkq0c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731832339; x=1732437139; 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=3xqOFH63hSrxX1dILSqXuu7UlXARoGwwkDBC60Jsfjg=; b=ZcPw/Xi5p4i1nHLGy6LMf+3XDL5E/nxpVdQ3Ur7gM2Y+sGX0/j+gJwGpzZ4qzJJZTs IQZ07GtbZMdi5fsCYaPb2jmksGxP5JDbNEnFI2oNovagly6I/q/PetvWFkEBJ9GOuC94 WKx11gbjboMTm0+Z+EZiAt0jhcSVCTVHcBEK1ykNpMoQ3zj6CG86TmDWxorS5yyp4GhC hjM3cIf3Rvqghi/fTyIHeHDMNFGhPRbnOYoxEIjUIErFbfwMKJ66rmjgjDvYOBxZ3TTT J4iGjqHQUUVUdTc+9xTKCyydX9nyg6GNpzZRg/A0weBwkOkark0qYVKXEKyAsnlD/9bd 9nIQ== X-Forwarded-Encrypted: i=1; AJvYcCUgG6Msule1RjSxeUj7m0/JLBzw9BXBDGU5ydO4kInJkrJMVI/rZs7DTzCF2V/y5eLDhJwE9qM=@vger.kernel.org X-Gm-Message-State: AOJu0YzgGzuH8PbLlk94+GA8b1Bs5c3znS4G4JYlFQKgApnk4au/GTTw 7YIdn63XTUUyGRC9L79GFJ97YfXGIZ94aYwFFzNn9TYw3XL+RBCgrQVY+r2PbrE= X-Google-Smtp-Source: AGHT+IFqkInzKSrfWZDyAqHcKfytVQVzvBRf/xa6VaY1oFjx31mr3qwfdW5qrpoRUwLDctZQXKIcMQ== X-Received: by 2002:a5d:5887:0:b0:382:42c3:83cc with SMTP id ffacd0b85a97d-38242c38557mr659457f8f.45.1731832338731; Sun, 17 Nov 2024 00:32:18 -0800 (PST) Received: from able.tailbefcf.ts.net (94-43-143-139.dsl.utg.ge. [94.43.143.139]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae1685csm9466919f8f.83.2024.11.17.00.32.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2024 00:32:18 -0800 (PST) From: Ivan Shapovalov To: linux-kernel@vger.kernel.org Cc: Ivan Shapovalov , =?utf-8?q?Bj=C3=B8rn_Mork?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Johan Hovold , Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 1/5] net: usb: qmi_wwan: add IDs for EM7565 (9X50) in "MBIM USBIF" config Date: Sun, 17 Nov 2024 12:31:11 +0400 Message-ID: <20241117083204.57738-1-intelfx@intelfx.name> X-Mailer: git-send-email 2.47.0.5.gd823fa0eac Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org This change was discovered and tested using author's own EM7565 device. This "MBIM USBIF" configuration corresponds to the `AT!USBCOMP=1,1,xxx` on-device USB composition setting. When activated, the VID:PID resets to 1199:90b1 ("application" mode) + 1199:90b0 ("boot" mode, i.e. QDL). The "MBIM USBIF" label comes from on-device help: ---8<--- AT!USBCOMP=? !USBCOMP: AT!USBCOMP=,, - configuration index to which the composition applies, should be 1 - 1:MBIM USBIF, 2:PCIE USBIF, 3:Legacy-Generic, 4:RNDIS - DIAG - 0x00000001, NMEA - 0x00000004, MODEM - 0x00000008, RMNET0 - 0x00000100, MBIM - 0x00001000, e.g. 10D - diag, nmea, modem, rmnet interfaces enabled 1009 - diag, modem, mbim interfaces enabled The default configuration is: at!usbcomp=1,3,10F OK ---8<--- Signed-off-by: Ivan Shapovalov --- drivers/net/usb/qmi_wwan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 0c011d8f5d4d..9a33393d4ce2 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c @@ -1349,6 +1349,7 @@ static const struct usb_device_id products[] = { {QMI_QUIRK_SET_DTR(0x1199, 0x907b, 8)}, /* Sierra Wireless EM74xx */ {QMI_QUIRK_SET_DTR(0x1199, 0x907b, 10)},/* Sierra Wireless EM74xx */ {QMI_QUIRK_SET_DTR(0x1199, 0x9091, 8)}, /* Sierra Wireless EM7565 */ + {QMI_QUIRK_SET_DTR(0x1199, 0x90b1, 8)}, /* Sierra Wireless EM7565 "MBIM USB-IF" */ {QMI_QUIRK_SET_DTR(0x1199, 0xc081, 8)}, /* Sierra Wireless EM7590 */ {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */ {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */ From patchwork Sun Nov 17 08:31:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Shapovalov X-Patchwork-Id: 13877802 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E704E12C499 for ; Sun, 17 Nov 2024 08:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832346; cv=none; b=hzqcb0UcdWr2CMXFOHW5wM1XmkKucnHPBfFyU8q9ZmsAA/vtg+LKoY7/xcloooQ/piR9ZsxdXsnVvnfc8aOWtkakT/DT5iFRiHfr3+19s2MF+Yck6tzDy2IhEw5dM9RIqWwbdeFvSojaML4xzzxQ2Qs8CsKTfFjZg5Cj80Zn/so= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832346; c=relaxed/simple; bh=eU5NyTFEX/54/n12G9K/uPw2uOx1/C9JJOPt0bYsQiY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kJfwZ8GYCqQOZJpYBYIcm6HIJx7nRmrIrHwjSYdqkJABXfnmiqt3GxSN5ix+u2OljNbZczGS4DUCTJPXCONc5hnSyY4FdBOAxLb8Ei/wJtSqaHzhDKTTwr/eUdwIAj/EUdUkgwfEBcq3ayK+2C6pcz107vzSFZ0EJen+IFd7H1k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name; spf=pass smtp.mailfrom=intelfx.name; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b=V598YzfH; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intelfx.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b="V598YzfH" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-43169902057so26483955e9.0 for ; Sun, 17 Nov 2024 00:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intelfx.name; s=google; t=1731832342; x=1732437142; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LFOA/yNMB3vCwH1wnNsMgep9hJHa+oh6MsEyHh9pwYw=; b=V598YzfHGLFg4CmJUHOCk8H4xYIOW5IAjPqGlgWf5NyzELZPzrhR6OaZcU4Ws/5n7O DqYhtkxaHhfmc6mogy7t/W8iorhlT9+csdf/2tOPLK9kxSMPefE7YNesnT+UMnoj4ITJ BWAXgmJvLP1GkANDU1oX7i8zwHu6omsRYApwA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731832342; x=1732437142; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LFOA/yNMB3vCwH1wnNsMgep9hJHa+oh6MsEyHh9pwYw=; b=d5yQ4D2x+NVZIRMhnFKgEMAzDsS+HRL1TCA8mryLSRnlGiD6Ps/vwjCiBkFwYqPN/K yZjxFie1XirSbD9ZrPpezy4NEjFp7lGtCqud2GY5PQshXupUupFTcWgwQ8TrK4Y7BJmw +adnuAaqBYKm4Cgp/K54D8wIxKKQD2LgLgxa/0xObH1c00MvsdIG6jtr6q2kNXcxNrGx b4wYI/oklSyKDpiab/u+y2Ba+LPotPYnvUOi3aHmcH0g149wQOTsZfqdAdZDOPr9Ea2N lt7x5X0lMglHkmgFMYWTMuQlcaeBJFCm//0oCk5C2D/LKydp4E66JHQj+IOj5leiAD5b dNRg== X-Forwarded-Encrypted: i=1; AJvYcCVxIiefETER7nnI+4H8njNtdhX4AzwbneVucMT0NHpEPj+igi5BPDWIZeYevhXFY7kOCkUGphc=@vger.kernel.org X-Gm-Message-State: AOJu0YzUq11C2wME7RjBIfZyQSiqn0l5LrDi6mhxHIKUH6ljehShDs0p xYsmEAJH4oqobOZdTC8prTnvM8l6U53uaqiN14EAKa5O3KCA+bGNZ4SIFhc1wx1VKNuSpqZjlBo ByBtqZg== X-Google-Smtp-Source: AGHT+IHDnj1MMhfE18u/+gecgHN/Su5hE0ego5ddaxfSYgYFHEtmLtoDQ1h+sTFoZudsRUpAWcd0PQ== X-Received: by 2002:a5d:6c69:0:b0:37c:d12c:17e5 with SMTP id ffacd0b85a97d-38225a05af2mr5179598f8f.23.1731832342260; Sun, 17 Nov 2024 00:32:22 -0800 (PST) Received: from able.tailbefcf.ts.net (94-43-143-139.dsl.utg.ge. [94.43.143.139]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae1685csm9466919f8f.83.2024.11.17.00.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2024 00:32:21 -0800 (PST) From: Ivan Shapovalov To: linux-kernel@vger.kernel.org Cc: Ivan Shapovalov , =?utf-8?q?Bj=C3=B8rn_Mork?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Johan Hovold , Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 2/5] USB: serial: qcserial: add EM7565 (9X50) IDs and configurations Date: Sun, 17 Nov 2024 12:31:12 +0400 Message-ID: <20241117083204.57738-2-intelfx@intelfx.name> X-Mailer: git-send-email 2.47.0.5.gd823fa0eac In-Reply-To: <20241117083204.57738-1-intelfx@intelfx.name> References: <20241117083204.57738-1-intelfx@intelfx.name> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is a port of the corresponding change from the qcserial.c driver distributed as part of the 9X50 SDK, tested and augmented via investigation of author's own EM7565 device. The "MBIM USBIF" configurations correspond to the `AT!USBCOMP=1,1,xxx` on-device USB composition setting. When activated, the VID:PID resets to 1199:90b1 ("application" mode) + 1199:90b0 ("boot" mode, i.e. QDL). The "PCIE USBIF" configurations correspond to the `AT!USBCOMP=1,2,xxx` on-device USB composition setting. Similarly, when activated, VID:PID resets to 1199:90c3 ("application" mode) + 1199:90c2 ("boot" mode). The existing 1199:9091 and 1199:9090 VID:PID pairs correspond to the "Legacy/Generic" configuration, activated by the `AT!USBCOMP=1,3,xxx` on-device USB composition setting. The supported interfaces and their numbers in both these configurations were confirmed by manual testing. Additional available interfaces (not claimed by the qcserial driver, such as ADB) found by investigation were documented in the comments for posterity. The "MBIM USBIF" and "PCIE USBIF" labels come from on-device help: ---8<--- AT!USBCOMP=? !USBCOMP: AT!USBCOMP=,, - configuration index to which the composition applies, should be 1 - 1:MBIM USBIF, 2:PCIE USBIF, 3:Legacy-Generic, 4:RNDIS - DIAG - 0x00000001, NMEA - 0x00000004, MODEM - 0x00000008, RMNET0 - 0x00000100, MBIM - 0x00001000, e.g. 10D - diag, nmea, modem, rmnet interfaces enabled 1009 - diag, modem, mbim interfaces enabled The default configuration is: at!usbcomp=1,3,10F OK ---8<--- Additionally, a fourth PID pair (1199:90c1, 1199:90c0) has been extracted from on-device help: ---8<--- AT!USBPID=? APP BOOT 9091, 9090 90B1, 90B0 90C1, 90C0 OK ---8<--- It is not clear which configuration it corresponds to, but it is included in the patch for completeness. Signed-off-by: Ivan Shapovalov --- drivers/usb/serial/qcserial.c | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 13c664317a05..c7167242e235 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c @@ -26,12 +26,18 @@ enum qcserial_layouts { QCSERIAL_G1K = 1, /* Gobi 1000 */ QCSERIAL_SWI = 2, /* Sierra Wireless */ QCSERIAL_HWI = 3, /* Huawei */ + QCSERIAL_SWI_9X50_MBIM = 4, /* Sierra Wireless 9x50 "MBIM USBIF" */ + QCSERIAL_SWI_9X50_PCIE = 5, /* Sierra Wireless 9x50 "PCIE USBIF" */ }; #define DEVICE_G1K(v, p) \ USB_DEVICE(v, p), .driver_info = QCSERIAL_G1K #define DEVICE_SWI(v, p) \ USB_DEVICE(v, p), .driver_info = QCSERIAL_SWI +#define DEVICE_SWI_9X50_PCIE(v, p) \ + USB_DEVICE(v, p), .driver_info = QCSERIAL_SWI_9X50_PCIE +#define DEVICE_SWI_9X50_MBIM(v, p) \ + USB_DEVICE(v, p), .driver_info = QCSERIAL_SWI_9X50_MBIM #define DEVICE_HWI(v, p) \ USB_DEVICE(v, p), .driver_info = QCSERIAL_HWI @@ -165,6 +171,12 @@ static const struct usb_device_id id_table[] = { {DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */ {DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */ {DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */ + {DEVICE_SWI(0x1199, 0x90B0)}, /* Sierra Wireless EM7565 QDL */ + {DEVICE_SWI_9X50_MBIM(0x1199, 0x90B1)}, /* Sierra Wireless EM7565 "MBIM USBIF" */ + {DEVICE_SWI(0x1199, 0x90c0)}, /* Sierra Wireless EM7565 QDL */ + {DEVICE_SWI_9X50_PCIE(0x1199, 0x90c1)}, /* Sierra Wireless EM7565 (unknown configuration, found in on-device AT command help) */ + {DEVICE_SWI(0x1199, 0x90c2)}, /* Sierra Wireless EM7565 QDL */ + {DEVICE_SWI_9X50_PCIE(0x1199, 0x90c3)}, /* Sierra Wireless EM7565 "PCIE USBIF" */ {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */ {DEVICE_SWI(0x1199, 0x90e4)}, /* Sierra Wireless EM86xx QDL*/ {DEVICE_SWI(0x1199, 0x90e5)}, /* Sierra Wireless EM86xx */ @@ -345,9 +357,11 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) /* * Sierra Wireless layout: * 0: DM/DIAG (use libqcdm from ModemManager for communication) + * 1: ADB * 2: NMEA * 3: AT-capable modem port * 8: QMI/net + * 12, 13: MBIM */ switch (ifnum) { case 0: @@ -403,6 +417,65 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) intf->desc.bInterfaceProtocol); } break; + case QCSERIAL_SWI_9X50_MBIM: + /* + * Sierra Wireless 9X50 "MBIM USBIF" layout: + * 0, 1: MBIM + * 2: AT-capable modem port + * 3: NMEA + * 4: DM + * 7: ADB + */ + switch (ifnum) { + case 2: + dev_dbg(dev, "Modem port found\n"); + sendsetup = true; + break; + case 3: + dev_dbg(dev, "NMEA GPS interface found\n"); + sendsetup = true; + break; + case 4: + dev_dbg(dev, "DM/DIAG interface found\n"); + break; + default: + /* don't claim any unsupported interface */ + altsetting = -1; + break; + } + break; + case QCSERIAL_SWI_9X50_PCIE: + /* + * Sierra Wireless 9X50 "PCIE USBIF" layout: + * 0: AT-capable modem port + * 1: NMEA + * 2: DM + * 5: ADB + * No other interfaces possible, presumably this configuration + * means that data exchange is happening via PCIe (but we are + * not making this an error). + */ + switch (ifnum) { + case 0: + dev_dbg(dev, "Modem port found\n"); + sendsetup = true; + break; + case 1: + dev_dbg(dev, "NMEA GPS interface found\n"); + sendsetup = true; + break; + case 2: + dev_dbg(dev, "DM/DIAG interface found\n"); + break; + default: + dev_err(dev, + "unexpected interface for PCIE-USBIF layout type: %u\n", + (unsigned)ifnum); + /* don't claim any unsupported interface */ + altsetting = -1; + break; + } + break; default: dev_err(dev, "unsupported device layout type: %lu\n", id->driver_info); From patchwork Sun Nov 17 08:31:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Shapovalov X-Patchwork-Id: 13877803 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 523731494DB for ; Sun, 17 Nov 2024 08:32:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832349; cv=none; b=bnx3Z8dZpp12UHbwuV/39EflYT30jdJ9RkO+MIsQp0CIdYNKsfoGTwl9i4OOcBBKuMBJUmLw9gLY4OCJ+mHdyKsMXhBhkLgqP79gMezSa0IsvUqXGoid10JmaacXWTGKuvVcEjB9FEBuF3ixnpUdDBqXSNpZKAC+bgh2mhfID5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832349; c=relaxed/simple; bh=bctWgxAXidA+mT+mxTODN07yskzEsrZh07njUIX3POo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jXRWkVIkTMOzVOJXKfvExOvVC4H2VRMHPgm5OcK6IIKQr9s3sS0JGnkmcgt62Yqe9rc4y2Sp3JPc54LFXGpQ+GYA7aR14Abxp6Lu1SJ64DqT7gBble1jEU8uUHs0vcBWra32GDfF5paUEO+UefyjIrayajUJKFxArRUQyRTQq7k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name; spf=pass smtp.mailfrom=intelfx.name; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b=V6bsp8Ob; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intelfx.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b="V6bsp8Ob" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-382296631f1so1333174f8f.3 for ; Sun, 17 Nov 2024 00:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intelfx.name; s=google; t=1731832345; x=1732437145; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wK4WZjisXiLa4RGvV3QpavT3gWK1y9Oz1eyCL48Z860=; b=V6bsp8Ob/fQPreLTvKOnUZKk6skJcHrJ2GqdmiQcbnzH4+xbD6s2S+hW9TdU7Ibq4S shPDQS1HZLSmuOvvcr8UNUOf05LAKtY+1p+Fn5ZG8SHUso+x6xVcEvaWdNTz77Coodsb xEtEr6WC3RMwUdkGe8lfir2e80o+LxHoEFHuM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731832345; x=1732437145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wK4WZjisXiLa4RGvV3QpavT3gWK1y9Oz1eyCL48Z860=; b=QOQCUrG6Am0Ul1IKTKapE10rAl2q+p6mroYLHC0w5o6JgUnjX82ZSH/YrA6bYDfvso ifB9iKYNWZWXT4ipObGyOMXACOL/Qwk+nKVI5oh0rC6OPvF8siG5TXNYklwGriGtFbbB D+DxpBp/ZZecAotvcnjJBUdNYWJv6cgy/fl9FsXYN2Lu8LCeQRobc9P9l/j8iRdIEjrj qJjjl8tE98tsgn3ioE0kaHSeZNLT5aXRZuryOGRaPrvxXb/CRHbGtBK640w02u/5cQpT idaTf5xuVxQKGH7GXX4EGX84/F6JjHBRwObYZLZiB6LqXEkAfreczOJT2wIOli9+3nrZ kEEg== X-Forwarded-Encrypted: i=1; AJvYcCWDQE7o7mUrao9z10Se2fqJhC4RmMZel6E4N1H35N8e07TV/dukfDyzTD/qsBmOLNts7VkU34Q=@vger.kernel.org X-Gm-Message-State: AOJu0YxMMyrRpagjFJmG0COVrbhv4+ZhPp8qyoi/LJV59NcjOVOGJ1x/ L/iqWVkKAem0qid+VnTzpN2TSt00uoeeZcPOfv9GGyGlL8o3j0OHLYB1YiGxSE0= X-Google-Smtp-Source: AGHT+IFCKRSWGFYQbti82L7zlgY59h7hQq8RHOb43YX795Ddzzq+WFz4YJqy/z4OU4bhQAmCe1QkKw== X-Received: by 2002:a05:6000:714:b0:37d:5405:817b with SMTP id ffacd0b85a97d-3822590b819mr7612385f8f.7.1731832345156; Sun, 17 Nov 2024 00:32:25 -0800 (PST) Received: from able.tailbefcf.ts.net (94-43-143-139.dsl.utg.ge. [94.43.143.139]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae1685csm9466919f8f.83.2024.11.17.00.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2024 00:32:24 -0800 (PST) From: Ivan Shapovalov To: linux-kernel@vger.kernel.org Cc: Ivan Shapovalov , =?utf-8?q?Bj=C3=B8rn_Mork?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Johan Hovold , Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 3/5] USB: serial: qcserial: add EM9xxx (SDX55) IDs and configurations Date: Sun, 17 Nov 2024 12:31:13 +0400 Message-ID: <20241117083204.57738-3-intelfx@intelfx.name> X-Mailer: git-send-email 2.47.0.5.gd823fa0eac In-Reply-To: <20241117083204.57738-1-intelfx@intelfx.name> References: <20241117083204.57738-1-intelfx@intelfx.name> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is a port of the corresponding change from the qcserial.c driver distributed as part of the 9X50 SDK. It was not tested by the author. Signed-off-by: Ivan Shapovalov --- drivers/usb/serial/qcserial.c | 55 ++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index c7167242e235..f1b0ef9935bb 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c @@ -28,6 +28,8 @@ enum qcserial_layouts { QCSERIAL_HWI = 3, /* Huawei */ QCSERIAL_SWI_9X50_MBIM = 4, /* Sierra Wireless 9x50 "MBIM USBIF" */ QCSERIAL_SWI_9X50_PCIE = 5, /* Sierra Wireless 9x50 "PCIE USBIF" */ + QCSERIAL_SWI_SDX55 = 6, /* Sierra Wireless SDX55 */ + QCSERIAL_SWI_SDX55_RMNET = 7, /* Sierra Wireless SDX55 */ }; #define DEVICE_G1K(v, p) \ @@ -38,6 +40,10 @@ enum qcserial_layouts { USB_DEVICE(v, p), .driver_info = QCSERIAL_SWI_9X50_PCIE #define DEVICE_SWI_9X50_MBIM(v, p) \ USB_DEVICE(v, p), .driver_info = QCSERIAL_SWI_9X50_MBIM +#define DEVICE_SWI_SDX55(v, p) \ + USB_DEVICE(v, p), .driver_info = QCSERIAL_SWI_SDX55 +#define DEVICE_SWI_SDX55_RMNET(v, p) \ + USB_DEVICE(v, p), .driver_info = QCSERIAL_SWI_SDX55_RMNET #define DEVICE_HWI(v, p) \ USB_DEVICE(v, p), .driver_info = QCSERIAL_HWI @@ -177,11 +183,18 @@ static const struct usb_device_id id_table[] = { {DEVICE_SWI_9X50_PCIE(0x1199, 0x90c1)}, /* Sierra Wireless EM7565 (unknown configuration, found in on-device AT command help) */ {DEVICE_SWI(0x1199, 0x90c2)}, /* Sierra Wireless EM7565 QDL */ {DEVICE_SWI_9X50_PCIE(0x1199, 0x90c3)}, /* Sierra Wireless EM7565 "PCIE USBIF" */ - {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */ {DEVICE_SWI(0x1199, 0x90e4)}, /* Sierra Wireless EM86xx QDL*/ {DEVICE_SWI(0x1199, 0x90e5)}, /* Sierra Wireless EM86xx */ {DEVICE_SWI(0x1199, 0xc080)}, /* Sierra Wireless EM7590 QDL */ {DEVICE_SWI(0x1199, 0xc081)}, /* Sierra Wireless EM7590 */ + {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9190 QDL */ + {DEVICE_SWI_SDX55(0x1199, 0x90d3)}, /* Sierra Wireless EM9190 */ + {DEVICE_SWI(0x1199, 0x90d8)}, /* Sierra Wireless EM9190 QDL */ + {DEVICE_SWI_SDX55_RMNET(0x1199, 0x90d9)}, /* Sierra Wireless EM9190 */ + {DEVICE_SWI(0x1199, 0x90e0)}, /* Sierra Wireless EM929x QDL */ + {DEVICE_SWI_SDX55(0x1199, 0x90e1)}, /* Sierra Wireless EM929x */ + {DEVICE_SWI(0x1199, 0x90e2)}, /* Sierra Wireless EM929x QDL */ + {DEVICE_SWI_SDX55(0x1199, 0x90e3)}, /* Sierra Wireless EM929x */ {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ @@ -476,6 +489,46 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) break; } break; + case QCSERIAL_SWI_SDX55: + /* + * Sierra Wireless SDX55 layout: + * 3: AT-capable modem port + * 4: DM + */ + switch (ifnum) { + case 3: + dev_dbg(dev, "Modem port found\n"); + sendsetup = true; + break; + case 4: + dev_dbg(dev, "DM/DIAG interface found\n"); + break; + default: + /* don't claim any unsupported interface */ + altsetting = -1; + break; + } + break; + case QCSERIAL_SWI_SDX55_RMNET: + /* + * Sierra Wireless SDX55 layout: + * 1: AT-capable modem port + * 2: DM + */ + switch (ifnum) { + case 1: + dev_dbg(dev, "Modem port found\n"); + sendsetup = true; + break; + case 2: + dev_dbg(dev, "DM/DIAG interface found\n"); + break; + default: + /* don't claim any unsupported interface */ + altsetting = -1; + break; + } + break; default: dev_err(dev, "unsupported device layout type: %lu\n", id->driver_info); From patchwork Sun Nov 17 08:31:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Shapovalov X-Patchwork-Id: 13877804 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5493F17BB32 for ; Sun, 17 Nov 2024 08:32:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832352; cv=none; b=LrtazCVNOC5hvadnalcD34TqYx3h44HGJgotcFa8BHRJPncA99FOfS+NDA5Fxudx9iUpghDqFoZHCQFcSrNpnSWiR3Qk8wPvTzNhb0uu4K01Q8l+bEgB+8RZYa0B3UfiR/kqwIqxKUBZaQM7g6q/YPcgYaxkOdyaa9K0fS1xImk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832352; c=relaxed/simple; bh=pXHzeI/Gx2PAexegf0r4gW2+PvbHef/a8bLDzBEMcUQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rvarjBL7JdMi/ILm9O28BxQjYyiQaKDLAPJ8RAcqN8IvqBbY8MnnTVxE490nl0WO+sZ0U54fjRkwr2ySoWsorgT9cL3S/PT4g7qAUU9nTWToo0y/uFS8NXCZ6XeN72Xb0sR9KtzNRS/wPzmh5aqOU/CfCJLWYe0C8+kCHueVGAc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name; spf=pass smtp.mailfrom=intelfx.name; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b=b1BfGZmD; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intelfx.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b="b1BfGZmD" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-38230ed9baeso1003732f8f.1 for ; Sun, 17 Nov 2024 00:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intelfx.name; s=google; t=1731832349; x=1732437149; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1Q0LK28/34rKJsS2lihgn4HkLUleE9PLjRqMKlX+v/M=; b=b1BfGZmDod6e095bPWQ9M3zTw/NUjvdCLJsyqYrF04QvaqBd/j0qAyY5Nt8yERbOgz DhVtgRDjOsd6I/GUycGA6TEAC1W9QCV17ZJ+ZJcibsQhV6xRjtL0v74FhT4iFJ63ddEf SCFHB8z/K/MMHnvYJtm7P4a/4bVQiqU05OGv0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731832349; x=1732437149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Q0LK28/34rKJsS2lihgn4HkLUleE9PLjRqMKlX+v/M=; b=gxdi4JjsfV6jdko5X+V/WgZKSOOKHOMn+LSWq62NxBGvyd4hAxG71EywtqEhjScQhI uilx5/H7J79xGmefmBaTkA+jwMrRCiqYNxH2c5EdM48GzyUU/Bnyo/+aiM26P1haXZfB aqEKpuJxb3Xm5x75LCGCWg56Ctw0oMhY9Toxk1I4JRMrDVpMulzMw4g2UbijAu7Mwq+3 DtUjM1EpNq4AL/Fz1nK7Fs0wDoS09cPuCCOWjIrbOb6dTnBfK3m47P9d4GYQOFJ4iUCJ nBjRGThztxQrTbmRftq/OGU6DI1OTgRU9dGJWjbknRZi9DVR6Mabn8s61bweIWwdthQH Wjzg== X-Forwarded-Encrypted: i=1; AJvYcCWeQ7r9h2kbWMQviRF0h8j6NvucR1ZxvdJaDRxp2MS1LpYHrPkphW/bDHLL06YipLiOt+lcT2Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yxw/y3fXZIO9mekoJLiprf3kuxXMoKMk6gqReXwaUcUzcgSheBH hs97IEdfi5OnAZr9vXoSnI6xDFVJf71tVwThsyeCJW/6+NQTL8xX4vkQt+qHE8I= X-Google-Smtp-Source: AGHT+IHM7o1qWLNYc3YaZlzqXtUAiKZiG8gYjY+V6LbMmsOL1mbBrL4607YU4H//0FQWLlmfScB+nQ== X-Received: by 2002:a5d:6c6b:0:b0:382:6f2:df7a with SMTP id ffacd0b85a97d-38225a33468mr7001293f8f.34.1731832348703; Sun, 17 Nov 2024 00:32:28 -0800 (PST) Received: from able.tailbefcf.ts.net (94-43-143-139.dsl.utg.ge. [94.43.143.139]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae1685csm9466919f8f.83.2024.11.17.00.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2024 00:32:28 -0800 (PST) From: Ivan Shapovalov To: linux-kernel@vger.kernel.org Cc: Ivan Shapovalov , =?utf-8?q?Bj=C3=B8rn_Mork?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Johan Hovold , Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 4/5] USB: serial: qcserial: disable autosuspend for QDL configurations Date: Sun, 17 Nov 2024 12:31:14 +0400 Message-ID: <20241117083204.57738-4-intelfx@intelfx.name> X-Mailer: git-send-email 2.47.0.5.gd823fa0eac In-Reply-To: <20241117083204.57738-1-intelfx@intelfx.name> References: <20241117083204.57738-1-intelfx@intelfx.name> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is a port of the corresponding change from the qcserial.c driver distributed as part of the 9X50 SDK, tested using author's own EM7565 device. Signed-off-by: Ivan Shapovalov --- drivers/usb/serial/qcserial.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index f1b0ef9935bb..b2ae0b16bc2b 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c @@ -257,6 +257,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) { struct usb_host_interface *intf = serial->interface->cur_altsetting; struct device *dev = &serial->dev->dev; + struct usb_device *usb_dev = serial->dev; int retval = -ENODEV; __u8 nintf; __u8 ifnum; @@ -289,6 +290,9 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) retval = 0; /* Success */ else altsetting = 1; + + /* disable USB SS for QDL */ + usb_disable_autosuspend(usb_dev); } goto done; From patchwork Sun Nov 17 08:31:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Shapovalov X-Patchwork-Id: 13877805 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1693018D63A for ; Sun, 17 Nov 2024 08:32:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.66 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832355; cv=none; b=fsXk6aDqjr0756n1TD8SpEX2MGX9g/O7oDHFSMswIBb0SaFJHCcpBej8xpBx5eqcsFRtqYXtBDrgPizY9aCZYmjxsuxyD+92UgW0vLolQLPom2VDDKa4cA9PBkDh7sRpvbqi121cpGSdlrblzM2JauvxA6t9NNEMekd+z/lvFdE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832355; c=relaxed/simple; bh=dyNI/yaxOyFxwYyVMFZqRo27ArIvOxCuFzInU9ylG7k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hl3JV7YZHy4GAOQ5WajdXzrIxtqu637+HSEjwrvlN3VlaFFFGUwCOSLMdR3ztDOA/tmxz2yQmeNiFI/P42otPF3fXDAuf2xv+9ZiedqVTT5N8+k1CWKwl9X2DnG48VUny0SBJnOCDOhGt/lvGgCOGOXVaIJmmVpaZfV6oD1H2tY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name; spf=pass smtp.mailfrom=intelfx.name; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b=a79QmQYM; arc=none smtp.client-ip=209.85.221.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=intelfx.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intelfx.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=intelfx.name header.i=@intelfx.name header.b="a79QmQYM" Received: by mail-wr1-f66.google.com with SMTP id ffacd0b85a97d-382378f359dso633992f8f.1 for ; Sun, 17 Nov 2024 00:32:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intelfx.name; s=google; t=1731832352; x=1732437152; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xom3uBb5b9/sYwGOmidk6WilUn/pK9olyKnKJBxv3Jg=; b=a79QmQYMfHZ6nx6XBt4pmHPa94SR115ZRmIDk3alW3qihd3zAkqgXBU2Aw6SyIwA8z m61pOrouoBkC0DsWpNGn2HHJsy/DarzlJ7+7x8uSv2Teiu+hDeamfqXI/LsXaixOTwkg PC23/IboCrl1WlrUFKgKnKePwHH+qWjjN5PtA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731832352; x=1732437152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xom3uBb5b9/sYwGOmidk6WilUn/pK9olyKnKJBxv3Jg=; b=oH38IGiEWN354WNBcsoWxf14mudeLkSJR5YhBVQXzdDJ23srZbrDSMSnuwQxFYNvOi LR2N3D8n/9d3GDNClY5RcXIt20KdMfcUslXO5/v+TJdO09MPKaW1TZ3pRBf8pIl6YLbK OPwPxbq3teGyNhMjUa2zcIFAEy6ElwwsEe0qHRwVGlVk8MZmOrTDQBiIURhGqQxMIdc6 +jPE2EmH/2c4LUCTIyzTlRmWsDI8d3HUczVtPGsIwU2u0sI1yucrxwTnL01tOlnmM5MT YPh3PMqe2Bv6022K13VRIFmLVA7SyzUxkSd9pBc22M3ISrJpMb3nMuzQMrnp0lUT9Ze9 qeVA== X-Forwarded-Encrypted: i=1; AJvYcCUv0MkzyvGrXZjkydJFwGCC90uivLu1QP0dwW/2oRyuY1qEn1b0W0n0AHcBV5vLgh+siTwHo2c=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7mVtu0TRtuk2jyEuMcBvHwKIBwznfMf9grTg1OF86U7ROqgkX H2LAzJiAEfhP0fZ59aW9Fxvy4s5BoyCWZIeMYTKj3Dl2TJVkMZBOJP01pZZAjKU= X-Google-Smtp-Source: AGHT+IGntOurmOmmYz21EdJYG0aSCDtMfDVxiahWE3w+UBoOUvKoLdFK/jvUS9+ZXwLjtqUEaZQKxw== X-Received: by 2002:a5d:5987:0:b0:381:eb8a:7ddd with SMTP id ffacd0b85a97d-38225a67e3amr5585197f8f.15.1731832352508; Sun, 17 Nov 2024 00:32:32 -0800 (PST) Received: from able.tailbefcf.ts.net (94-43-143-139.dsl.utg.ge. [94.43.143.139]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3821ae1685csm9466919f8f.83.2024.11.17.00.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2024 00:32:32 -0800 (PST) From: Ivan Shapovalov To: linux-kernel@vger.kernel.org Cc: Ivan Shapovalov , =?utf-8?q?Bj=C3=B8rn_Mork?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Johan Hovold , Greg Kroah-Hartman , netdev@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 5/5] USB: serial: qcserial: enable ZLP for non-QDL interfaces Date: Sun, 17 Nov 2024 12:31:15 +0400 Message-ID: <20241117083204.57738-5-intelfx@intelfx.name> X-Mailer: git-send-email 2.47.0.5.gd823fa0eac In-Reply-To: <20241117083204.57738-1-intelfx@intelfx.name> References: <20241117083204.57738-1-intelfx@intelfx.name> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This is a port of the corresponding change from the qcserial.c driver distributed as part of the 9X50 SDK, tested using author's own EM7565 device. The SDK qcserial.c driver enables ZLP unconditionally, however this was found to break QDL mode (as exercised by the qmi-firmware-update tool from libqmi[1], as well as the SDK-provided firmware update utility). Thus, ZLP is limited to non-QDL interfaces. [1]: https://www.freedesktop.org/wiki/Software/libqmi/ Signed-off-by: Ivan Shapovalov --- drivers/usb/serial/qcserial.c | 36 ++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index b2ae0b16bc2b..d51d022d76b1 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c @@ -32,6 +32,11 @@ enum qcserial_layouts { QCSERIAL_SWI_SDX55_RMNET = 7, /* Sierra Wireless SDX55 */ }; +enum qcserial_flags { + QC_SENDSETUP = (1 << 0), + QC_ZLP = (1 << 1), +}; + #define DEVICE_G1K(v, p) \ USB_DEVICE(v, p), .driver_info = QCSERIAL_G1K #define DEVICE_SWI(v, p) \ @@ -262,7 +267,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) __u8 nintf; __u8 ifnum; int altsetting = -1; - bool sendsetup = false; + unsigned long flags = 0; /* we only support vendor specific functions */ if (intf->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC) @@ -301,6 +306,9 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) /* default to enabling interface */ altsetting = 0; + /* default to enabling ZLP */ + flags |= QC_ZLP; + /* * Composite mode; don't bind to the QMI/net interface as that * gets handled by other drivers. @@ -386,11 +394,11 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) break; case 2: dev_dbg(dev, "NMEA GPS interface found\n"); - sendsetup = true; + flags |= QC_SENDSETUP; break; case 3: dev_dbg(dev, "Modem port found\n"); - sendsetup = true; + flags |= QC_SENDSETUP; break; default: /* don't claim any unsupported interface */ @@ -446,11 +454,11 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) switch (ifnum) { case 2: dev_dbg(dev, "Modem port found\n"); - sendsetup = true; + flags |= QC_SENDSETUP; break; case 3: dev_dbg(dev, "NMEA GPS interface found\n"); - sendsetup = true; + flags |= QC_SENDSETUP; break; case 4: dev_dbg(dev, "DM/DIAG interface found\n"); @@ -475,11 +483,11 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) switch (ifnum) { case 0: dev_dbg(dev, "Modem port found\n"); - sendsetup = true; + flags |= QC_SENDSETUP; break; case 1: dev_dbg(dev, "NMEA GPS interface found\n"); - sendsetup = true; + flags |= QC_SENDSETUP; break; case 2: dev_dbg(dev, "DM/DIAG interface found\n"); @@ -502,7 +510,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) switch (ifnum) { case 3: dev_dbg(dev, "Modem port found\n"); - sendsetup = true; + flags |= QC_SENDSETUP; break; case 4: dev_dbg(dev, "DM/DIAG interface found\n"); @@ -522,7 +530,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) switch (ifnum) { case 1: dev_dbg(dev, "Modem port found\n"); - sendsetup = true; + flags |= QC_SENDSETUP; break; case 2: dev_dbg(dev, "DM/DIAG interface found\n"); @@ -551,7 +559,7 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) } if (!retval) - usb_set_serial_data(serial, (void *)(unsigned long)sendsetup); + usb_set_serial_data(serial, (void *)flags); return retval; } @@ -559,15 +567,17 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) static int qc_attach(struct usb_serial *serial) { struct usb_wwan_intf_private *data; - bool sendsetup; + unsigned long flags = 0; data = kzalloc(sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - sendsetup = !!(unsigned long)(usb_get_serial_data(serial)); - if (sendsetup) + flags = (unsigned long)(usb_get_serial_data(serial)); + if (flags & QC_SENDSETUP) data->use_send_setup = 1; + if (flags & QC_ZLP) + data->use_zlp = 1; spin_lock_init(&data->susp_lock);