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: 13877806 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 A6589383A5 for ; Sun, 17 Nov 2024 08:32:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832343; cv=none; b=RVJ6aQ7Wm8uWZK38l7LD/VWaprtfGc/Xdsm73c7IzICPUCM6XbqboKBSuZIZnssV94tCiCIlYUwN/NMLh4LL/RFt3SbbAWiaGTLivzphfIOauUKj8nzzZ1IAxUhxUkYthZKGvVGoTYThU7B3q6i/ZzqVK6Zo6MOUWRUqs91G+xw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832343; c=relaxed/simple; bh=bEdtzbEoybZw2elzR+5shN7afieydr1cqVkaEADVKqI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uNs0E0I7i72MYma+NBZrSQauKyVVi9vNQCBVwlr3VwitxU+8XJ68p6Cz9hUFUsFAC2y5p3h+ox1IHQ2k2yOcqIo/3JyqIvx1xOsfNUi1mgTWRFES9wkR9JbxxKl1IvI/E+DvkS/MCSxrx8SNGR4BiQjKti2y5ifBE+sigbrKadY= 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.54 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-f54.google.com with SMTP id ffacd0b85a97d-37d4c482844so2183475f8f.0 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=LHOKBMeab67nAC0r1ud2oduCqZGJFhsjTZjnNrT441dQRBcFShc591xalK+dJXtxTy 0mHvabZ1h9FDMpGpJHxEiZS7iI76hjS6pdb9AinQTudzurN+ZS2fhJib6rvzCkO57z4W ZlT1BaXdSWSFZ03o7bBxxOgnb9oG2uDy5COI5mLktX7Y0pwAU0kFnr+zK9d3zg5CyJhS FeVU/rNKcWFIIhTMYOv2tGU7sewKL84VJhgo9l7wKqMpVBbypB7f06edfbzJx1JRNUvP usFtaV6xaE5mWDSt5aOQSLnSWjncreHtN22gi/wq7z/xd1EC451gQJmleTDHx57wNa93 mhBQ== X-Forwarded-Encrypted: i=1; AJvYcCVp8ynS58cGqbaib0Ya5erBAFffi1+UK3dTD5DEP3+JWJRVLUTwW1YhDK7Coi7yg5nygYhq3B8L8PM=@vger.kernel.org X-Gm-Message-State: AOJu0YyfYkDjioA0KstcS39dNZq2AuxjkImv3rAhrJqeAyvobJC7IvuZ 4g+dTjwV6g5PB1yPXXDQG49vCuXyIaB4W0d6oRXBTAR0LzUt+0rjZKJ4EjTQMQk= 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: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 13877807 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.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 E0C0B126C01 for ; Sun, 17 Nov 2024 08:32:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832345; cv=none; b=bwzRYWoYuWxCEwc/zRHqcZsPPnwg/PoQazKPBtLD+gvisQs4aXDd6FDrBFJwy6gIYI5ZRDTwYbyo72WqjAdQ6+8CqunM8SXZ0taLLNjz5k32nXapOhds1DmZslZsOmn+hqhrVNznMCsoBdhtfgZRm6EJAkKLimWLLteprD3ilHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832345; c=relaxed/simple; bh=eU5NyTFEX/54/n12G9K/uPw2uOx1/C9JJOPt0bYsQiY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BtHAh8GdqFmdlyYgjA0AbbtDANzDGyKD7RRCpKkTMTv9xqXgEWQ12cxdQN1Tu97yY39Gl+lpkabYMBnZZMDKBL5biQnIagsSLggqzra2llVlic5NQ58H0AJ/9YsXQp8eaLqU4lfRBwRpqmiTaZO900xrBHr+980NlekjeWARqxo= 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.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="V598YzfH" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43161e7bb25so26378695e9.2 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=OnQpdR2y4WI2DeSxBbnwCfThMZdXco7mvvrX6gkWriYXVHi+a+htSwB+6YA+293ER3 vyDTQJupmoEairn9kpBP8n9jazbb9abJW1ttx8m5v0xQmzmbMNEiZlWvnwDT438aJnxY OjZxvAL2IMYolmSjWAqnlRqoFMJv0jAvhiHX5uqwe5lAc3u4Y61vK6Ra0By5FvEPH4Dr lUyqHs6chktonyVyFxv3Szg8HgDvOGg2GKQdz0mjujodLlopWhPL02ZfONU//JObDYmB wiY/gx1X52voPIMHu4jzjvRO9/AIC/BC1kaTi9uUhPcXlG058b4zGUCm2iRUFtVQoCwL vqjA== X-Forwarded-Encrypted: i=1; AJvYcCVZhufCefLPqNH+C8iaXqxwtPifgDOm0dxFuWbGtceg/XTU1EIKttxll+KVTIOc0O4r9kkviS+CfGw=@vger.kernel.org X-Gm-Message-State: AOJu0YzLImXSPAnGQBP0i97i+2dy5SXGb5rgB1IWYO7/sZZm9xPSmkQJ RMIW6Gl/wsEzKd8FZTpM7SNnn18Ei3Nr6XujR/v+IXzjkgAK7s2wiT8jgurEpdw= 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: linux-usb@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: 13877808 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 507E0154C00 for ; Sun, 17 Nov 2024 08:32:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832350; cv=none; b=Pe523ZaZhfMza4gXRnuczUCpsEMBUggloGmn7HzixuSvxFcxHtIVXKRKXSDNwVrYGf47xmlXU0e3rh6FxoxPrHi1SYFcslqEurGNOte9Y6iDjqQqVgMlkKO4bv+JAW6OYzUnM0HFSFrVtFDp2Aa8b/9bKd+jHn1I0a2b38P09o4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832350; c=relaxed/simple; bh=bctWgxAXidA+mT+mxTODN07yskzEsrZh07njUIX3POo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=heMqHtfz7TKqMO80ZtJIyeiwywRuAqis0AdCv2HirvdJMn9rVVNsip25pdeDdwu+ceG4cuC11gjHD3GPhsOb8JVU0Fh9l7oSTaDH+yut1IaoVNlmHU2mPjoYLO8CVi7Fn8mmDbLaaXqkQfhRZziObNJDOK+ngaG+WK2fK5yVMQc= 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.52 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-f52.google.com with SMTP id ffacd0b85a97d-38242abf421so193213f8f.2 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=KDy6dgLfKrd85QUZdR8Jv5I+W3zv5xHKimjYiI94/6yAJldZh6xGz3fVy23cf5YPLM ezh1JJxO7rF58X100qf1Ao42eIxANroDIS2ozhoelffn/6svIlytFclxlC3/Ar+fRWiG w8hswSbPqrMkELCOfCgo5XJkNabWZOseGcusuIlBYslsCmghBINeDPZtuIvXi4a4uWgQ ufZD4xmU0s35YqUnwNclUuYnmwIJQW84Pjx9BE4DTf2lCD/fNEvgU26FB+n1tie+/dIk dsD7UmKIf7L0P+lZJeVxurgpn7BBV8WP/I8RoBq03bOiZB3SsLrrAc7uSYwlbHE+Hbtl 0zbg== X-Forwarded-Encrypted: i=1; AJvYcCVotyNj58yboPyKYVIdr00zo7dhJOEqffk9+Uj1TF0SssJ4jinagtaYmBjJdNCOfqC/T/qro+gVHLM=@vger.kernel.org X-Gm-Message-State: AOJu0YxQkDZTZLonfS+Po/93QEnLAvAa9aaEBzefvyGurDv7+/Y7v9KI PIvrLpEm6yrA8ZFnp8wXVcfaCvB8wP6afAo2IDfbRSDJip7EEgTz5P2qYfm5MjQ= 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: linux-usb@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: 13877809 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 548E617BB21 for ; Sun, 17 Nov 2024 08:32:30 +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=1731832352; cv=none; b=AS0GXQ9dTal4zxG1U3sfDIICWWjH9LzX21ASnfz+ZB/Dk0DR2w2ePsis7asHr2p68HeorUm884JRfBqk5f2bKZSvvcok4yzgkrdhUITnokjcHFxwjZRHwQiMJaXq+y4ucJ1gLqfg3ZudHCyz925LYjbogfm3S61jDO5hJveBW1U= 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.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="b1BfGZmD" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-3824038142aso388467f8f.2 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=pIfTB1jhMfeUo3lGvKu1HJ7GyVhyG5nvG13WR4TpVn9zUZEAFa2H6nABDQd/yc7REz MWLnXUZ11i29c3AsjEUljER1dOfeuWF6E58eTxO5IyQEDJC3TMhynm0e3ecMGyj52xcu 2S8UWThCgee2ox0TnJDi0/M1nuAilDfeMComUdtTZYshNa2pIsCGgHO46bNyssNWy7AL h6c2gjL4C+csfIXmN+iV6WJanwzpiDMP/fsSahb1Ten20edv4UCytZ9w/BRI3OkRnSaw HtvEIsBjI0YiHEpFGbAy2gagRfkC5PwX7fUfWP6RXkeZZe2AwdixsDimjCuzGFHWjsYF 3Afg== X-Forwarded-Encrypted: i=1; AJvYcCUNJ9Bp8K1FnR1TPEht5+cIIeX4niolw+T1iTDlyKkn7rhuULV+oMh9eng5dcZ+Y8XB1Zgg0ZQ26AA=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6qcSJgpG4sRC8oKjahKuEHJduPy8PXPF4igVnBp84el5ikLzH ghpEIl2pmDwKwV6qt3lD2z7rnPS7SalLIj94H8rI8ePxZvscr764v+Jtp8apQwCL+hrAM4mrd39 T21E/eA== 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: linux-usb@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: 13877810 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) (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 71BF218DF62 for ; Sun, 17 Nov 2024 08:32:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.67 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832356; cv=none; b=iG8hOk3rvArh9+1oquPPhSvLw6UEVa09POnkhP4JLpTkpBtglJPKYuHSpXgmGBaM8mwpHh4wDROvh4CKHl7LE7ZKGBM4VWdYTb1srxdjWh63/YxaQNdeowGbrcXtEUgF/3g2r6LD/4EqG4ItmPe2st9jn31y/iEeQbhCCtVRDW4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731832356; c=relaxed/simple; bh=dyNI/yaxOyFxwYyVMFZqRo27ArIvOxCuFzInU9ylG7k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AwXM2Sw1IqdKCRz43OzJJMoP1HrwbWKXTqDaPesJtoIL1HN3tjfH7QLrkNzQUyO7jVRFddO90EZNTWAA8/O3Ar7lhlq9FC1boA1lJ+ZUQjlzgNXHYA09c414Ib6XD37BzOVu3RFLBxaV5XsTfqOWcCVHHGmgnobvaz7MMBTXGxA= 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.67 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-f67.google.com with SMTP id ffacd0b85a97d-3821df9779eso701363f8f.2 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=pQlmz652AbZBBUTdjve1pgBptU/1Lyp/we9hlaRugXXm6wji1+aPTepOQpkfVV2lIl JSk6ZCftKsbnxdax7gvp5E9oWT/MBKX2fdEXFC3FHEPq+p995M9aurpVOXZvF35CENbP YyLaTcKrDdtTqhbXOmrpFE6+M9eMuu7uUVH1afiTgpl2MdjpHeNT4Wj4VhY+zwal7JRg hW/umaOerCAVuOFIIvzbE4pBt5KZ5v6mbZWAkDBtvRQ2SVSaUTsIJy3ZNF5RcWUV/dm+ DHzBN3w4yfFaB1fqvx9d5jm9+AZXx1JbYP0oL04oE6yz7+J3I/YkBEGubrnmzHUOuu7f Dlqw== X-Forwarded-Encrypted: i=1; AJvYcCUYk5rM6JRzvb5sWbazZ6NjsjRVBSMnEbQY/fxXaktKNxF2PXMiOUvCq6CFBtAcWo/NGNjnbKV+nDE=@vger.kernel.org X-Gm-Message-State: AOJu0YzFnYnM4PaoAyxOkfMqMfP8uI7Zrc+8Mb5xdwpgYEYe3WdHGcZO 3JE00px//DpwB9IxrLhy12tvG9P4GgmqLFmagxA2R8LMhQNkDWyZ7YgKx27ApPY= 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: linux-usb@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);