From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, fangxiaozhi <huananhu@huawei.com>
Subject: [ 13/16] USB: storage: Define a new macro for USB storage match rules
Date: Thu, 7 Feb 2013 16:58:12 -0800 [thread overview]
Message-ID: <20130208004629.472786346@linuxfoundation.org> (raw)
In-Reply-To: <20130208004627.112511141@linuxfoundation.org>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: fangxiaozhi <huananhu@huawei.com>
commit 07c7be3d87e5cdaf5f94c271c516456364ef286c upstream.
1. Define a new macro for USB storage match rules:
matching with Vendor ID and interface descriptors.
Signed-off-by: fangxiaozhi <huananhu@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/storage/usb.c | 12 ++++++++++++
drivers/usb/storage/usual-tables.c | 15 +++++++++++++++
2 files changed, 27 insertions(+)
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -120,6 +120,17 @@ MODULE_PARM_DESC(quirks, "supplemental l
.useTransport = use_transport, \
}
+#define UNUSUAL_VENDOR_INTF(idVendor, cl, sc, pr, \
+ vendor_name, product_name, use_protocol, use_transport, \
+ init_function, Flags) \
+{ \
+ .vendorName = vendor_name, \
+ .productName = product_name, \
+ .useProtocol = use_protocol, \
+ .useTransport = use_transport, \
+ .initFunction = init_function, \
+}
+
static struct us_unusual_dev us_unusual_dev_list[] = {
# include "unusual_devs.h"
{ } /* Terminating entry */
@@ -128,6 +139,7 @@ static struct us_unusual_dev us_unusual_
#undef UNUSUAL_DEV
#undef COMPLIANT_DEV
#undef USUAL_DEV
+#undef UNUSUAL_VENDOR_INTF
#ifdef CONFIG_PM /* Minimal support for suspend and resume */
--- a/drivers/usb/storage/usual-tables.c
+++ b/drivers/usb/storage/usual-tables.c
@@ -46,6 +46,20 @@
{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \
.driver_info = ((useType)<<24) }
+/* Define the device is matched with Vendor ID and interface descriptors */
+#define UNUSUAL_VENDOR_INTF(id_vendor, cl, sc, pr, \
+ vendorName, productName, useProtocol, useTransport, \
+ initFunction, flags) \
+{ \
+ .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
+ | USB_DEVICE_ID_MATCH_VENDOR, \
+ .idVendor = (id_vendor), \
+ .bInterfaceClass = (cl), \
+ .bInterfaceSubClass = (sc), \
+ .bInterfaceProtocol = (pr), \
+ .driver_info = (flags) \
+}
+
struct usb_device_id usb_storage_usb_ids[] = {
# include "unusual_devs.h"
{ } /* Terminating entry */
@@ -57,6 +71,7 @@ MODULE_DEVICE_TABLE(usb, usb_storage_usb
#undef UNUSUAL_DEV
#undef COMPLIANT_DEV
#undef USUAL_DEV
+#undef UNUSUAL_VENDOR_INTF
/*
next prev parent reply other threads:[~2013-02-08 0:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-08 0:57 [ 00/16] 3.0.63-stable review Greg Kroah-Hartman
2013-02-08 0:58 ` [ 01/16] drm/radeon/evergreen+: wait for the MC to settle after MC blackout Greg Kroah-Hartman
2013-02-08 0:58 ` [ 02/16] drm/radeon: add quirk for RV100 board Greg Kroah-Hartman
2013-02-08 0:58 ` [ 03/16] drm/radeon: Calling object_unrefer() when creating fb failure Greg Kroah-Hartman
2013-02-08 0:58 ` [ 04/16] x86-64: Replace left over sti/cli in ia32 audit exit code Greg Kroah-Hartman
2013-02-08 0:58 ` [ 05/16] nilfs2: fix fix very long mount time issue Greg Kroah-Hartman
2013-02-08 0:58 ` [ 06/16] drivers/rtc/rtc-isl1208.c: call rtc_update_irq() from the alarm irq handler Greg Kroah-Hartman
2013-02-08 0:58 ` [ 07/16] USB: ftdi_sio: add Zolix FTDI PID Greg Kroah-Hartman
2013-02-08 0:58 ` [ 08/16] USB: ftdi_sio: add PID/VID entries for ELV WS 300 PC II Greg Kroah-Hartman
2013-02-08 0:58 ` [ 09/16] USB: option: add support for Telit LE920 Greg Kroah-Hartman
2013-02-08 0:58 ` [ 10/16] USB: option: add Changhong CH690 Greg Kroah-Hartman
2013-02-08 0:58 ` [ 11/16] USB: qcserial: add Telit Gobi QDL device Greg Kroah-Hartman
2013-02-08 0:58 ` [ 12/16] USB: EHCI: fix bug in scheduling periodic split transfers Greg Kroah-Hartman
2013-02-08 0:58 ` Greg Kroah-Hartman [this message]
2013-02-08 0:58 ` [ 14/16] USB: storage: optimize to match the Huawei USB storage devices and support new switch command Greg Kroah-Hartman
2013-02-08 0:58 ` [ 15/16] xhci: Fix isoc TD encoding Greg Kroah-Hartman
2013-02-08 0:58 ` [ 16/16] USB: XHCI: fix memory leak of URB-private data Greg Kroah-Hartman
2013-02-08 20:28 ` [ 00/16] 3.0.63-stable review Shuah Khan
2013-02-09 12:09 ` Satoru Takeuchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130208004629.472786346@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=huananhu@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).