Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1189439ybt; Thu, 18 Jun 2020 02:45:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcxrcsgngyzPKOeJCFybcIYcvjUsy8Zlpwa5vSifPUQXOYyfFjEsgHsuxYK1cvrRzuhMMh X-Received: by 2002:a17:906:1c49:: with SMTP id l9mr3010211ejg.296.1592473522506; Thu, 18 Jun 2020 02:45:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592473522; cv=none; d=google.com; s=arc-20160816; b=F+8hhJBrUg+ig+v38wA4SHRsJO+LqgS18j44mKWH6Bwmo0dwgZbFdvcIbemKMUss6l Yb87oe6nHgyk0RyUdIFfDh6vy057QhtUuxH+hpT7kvf48xLobFnu5uLv/VRr+Nw5y3qV Qf9H+gQw74bE1gPz4AyJw0KCcPHykQd2XPmyL2AGdFKI7B5QXgPE/YEs4CSD9zEytO+D Nz2vRdONucy9D9dKiiCXprVFWf0ZA9vU3e/LJCRO8HlLSXzitpmDiULxaZI+ne5jktur 0qet412JjVCckGMZZ3SGFsc0MYvqdVquLSaaof5sBIM1kovBJtBH9ZUD43NyfM7cmkqY sCPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=afoskrrqSTPTGM3zSSVHzFjs6xb9l1V+kcafJs+N4qI=; b=M22Tl6xfv/g4RLHZYa5o0zyncRXvLq4oo2t/RBfClAOQwgp7s6k+4q2gFGf1aNA5P2 zxjE5ZpLMq/D2cS19Qilpm543nda2TiksSTwlOjUc69mcu8ZitVq3vAXyiu+mLfsD2vb Gcj7hT0Ob8qdM+j1v/vYzhlAhJ9sFAD67857sFTAr6X//q6u5ZS+7M1zjf5Vu5wB6f8y 07PcmuJ+51cuKotHG2121q4k0ZDHzm/QrIst2uygZ5MsJ2zdwfW3yA9gI5ekW8yCSnia DJIGUH/YqiuyrXRoEdlWNWgDmMexMQBiZtzqBSJDqUto9HZdEYPVVb6obm0fchhei/Mg XgCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S+rW7gFj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 30si1683196edr.182.2020.06.18.02.44.59; Thu, 18 Jun 2020 02:45:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S+rW7gFj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729230AbgFRJnM (ORCPT + 99 others); Thu, 18 Jun 2020 05:43:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:43514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728568AbgFRJnK (ORCPT ); Thu, 18 Jun 2020 05:43:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AC0DA21548; Thu, 18 Jun 2020 09:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592473389; bh=i9JeJIALNjzTrIEVjDmpg7b8gg3dE54NRITDfTxUC7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S+rW7gFjAnZDhzVV5EeTL2h4bim5p831/I8lqdr9sK4UzwRsUSd31pNW0raTblHH5 EJemjIGPptDv5Tn8O/arGpXtKtO1g7GiYFaprYbxJuFRJ4FzLi1jCHEbejwGRyuxXv 2R0SbLO+ivz1L0sRe1p/nhAjmK7FmL1ON+8D1PTE= From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Johan Hovold , Alan Stern , Richard Dodd , Hans de Goede , Jonathan Cox , Bastien Nocera , =?UTF-8?q?Thi=C3=A9baud=20Weksteen?= , Nishad Kamdar Subject: [PATCH 1/8] USB: rename USB quirk to USB_QUIRK_ENDPOINT_IGNORE Date: Thu, 18 Jun 2020 11:42:53 +0200 Message-Id: <20200618094300.1887727-2-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200618094300.1887727-1-gregkh@linuxfoundation.org> References: <20200618094300.1887727-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The USB core has a quirk flag to ignore specific endpoints, so rename it to be more obvious what this quirk does. Cc: Johan Hovold Cc: Alan Stern Cc: Richard Dodd Cc: Hans de Goede Cc: Jonathan Cox Cc: Bastien Nocera Cc: "ThiƩbaud Weksteen" Cc: Nishad Kamdar Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/config.c | 8 ++++---- drivers/usb/core/quirks.c | 18 +++++++++--------- drivers/usb/core/usb.h | 2 +- include/linux/usb/quirks.h | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index b7918f695434..37442f423a41 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -298,10 +298,10 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, goto skip_to_next_endpoint_or_interface_descriptor; } - /* Ignore blacklisted endpoints */ - if (udev->quirks & USB_QUIRK_ENDPOINT_BLACKLIST) { - if (usb_endpoint_is_blacklisted(udev, ifp, d)) { - dev_warn(ddev, "config %d interface %d altsetting %d has a blacklisted endpoint with address 0x%X, skipping\n", + /* Ignore some endpoints */ + if (udev->quirks & USB_QUIRK_ENDPOINT_IGNORE) { + if (usb_endpoint_is_ignored(udev, ifp, d)) { + dev_warn(ddev, "config %d interface %d altsetting %d has an ignored endpoint with address 0x%X, skipping\n", cfgno, inum, asnum, d->bEndpointAddress); goto skip_to_next_endpoint_or_interface_descriptor; diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 3e8efe759c3e..20dccf34182d 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c @@ -359,7 +359,7 @@ static const struct usb_device_id usb_quirk_list[] = { /* Sound Devices USBPre2 */ { USB_DEVICE(0x0926, 0x0202), .driver_info = - USB_QUIRK_ENDPOINT_BLACKLIST }, + USB_QUIRK_ENDPOINT_IGNORE }, /* Keytouch QWERTY Panel keyboard */ { USB_DEVICE(0x0926, 0x3333), .driver_info = @@ -493,24 +493,24 @@ static const struct usb_device_id usb_amd_resume_quirk_list[] = { }; /* - * Entries for blacklisted endpoints that should be ignored when parsing - * configuration descriptors. + * Entries for endpoints that should be ignored when parsing configuration + * descriptors. * - * Matched for devices with USB_QUIRK_ENDPOINT_BLACKLIST. + * Matched for devices with USB_QUIRK_ENDPOINT_IGNORE. */ -static const struct usb_device_id usb_endpoint_blacklist[] = { +static const struct usb_device_id usb_endpoint_ignore[] = { { USB_DEVICE_INTERFACE_NUMBER(0x0926, 0x0202, 1), .driver_info = 0x85 }, { } }; -bool usb_endpoint_is_blacklisted(struct usb_device *udev, - struct usb_host_interface *intf, - struct usb_endpoint_descriptor *epd) +bool usb_endpoint_is_ignored(struct usb_device *udev, + struct usb_host_interface *intf, + struct usb_endpoint_descriptor *epd) { const struct usb_device_id *id; unsigned int address; - for (id = usb_endpoint_blacklist; id->match_flags; ++id) { + for (id = usb_endpoint_ignore; id->match_flags; ++id) { if (!usb_match_device(udev, id)) continue; diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index 19e4c550bc73..98e7d1ee63dc 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -37,7 +37,7 @@ extern void usb_authorize_interface(struct usb_interface *); extern void usb_detect_quirks(struct usb_device *udev); extern void usb_detect_interface_quirks(struct usb_device *udev); extern void usb_release_quirk_list(void); -extern bool usb_endpoint_is_blacklisted(struct usb_device *udev, +extern bool usb_endpoint_is_ignored(struct usb_device *udev, struct usb_host_interface *intf, struct usb_endpoint_descriptor *epd); extern int usb_remove_device(struct usb_device *udev); diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 22c1f579afe3..5e4c497f54d6 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h @@ -69,7 +69,7 @@ /* Hub needs extra delay after resetting its port. */ #define USB_QUIRK_HUB_SLOW_RESET BIT(14) -/* device has blacklisted endpoints */ -#define USB_QUIRK_ENDPOINT_BLACKLIST BIT(15) +/* device has endpoints that should be ignored */ +#define USB_QUIRK_ENDPOINT_IGNORE BIT(15) #endif /* __LINUX_USB_QUIRKS_H */ -- 2.27.0