Skip to content

Commit f7abc06

Browse files
groeckdavem330
authored andcommitted
usbnet: ipheth: Simplify device detection
All Apple products use the same protocol for tethering over USB. To simplify the code and make it future proof, use USB_VENDOR_AND_INTERFACE_INFO() instead of USB_DEVICE_AND_INTERFACE_INFO() to automatically detect and support all existing and future Apple products using the same interface. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e55449e commit f7abc06

File tree

1 file changed

+3
-55
lines changed

1 file changed

+3
-55
lines changed

drivers/net/usb/ipheth.c

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,6 @@
5454
#include <linux/workqueue.h>
5555

5656
#define USB_VENDOR_APPLE 0x05ac
57-
#define USB_PRODUCT_IPHONE 0x1290
58-
#define USB_PRODUCT_IPHONE_3G 0x1292
59-
#define USB_PRODUCT_IPHONE_3GS 0x1294
60-
#define USB_PRODUCT_IPHONE_4 0x1297
61-
#define USB_PRODUCT_IPAD 0x129a
62-
#define USB_PRODUCT_IPAD_2 0x12a2
63-
#define USB_PRODUCT_IPAD_3 0x12a6
64-
#define USB_PRODUCT_IPAD_MINI 0x12ab
65-
#define USB_PRODUCT_IPHONE_4_VZW 0x129c
66-
#define USB_PRODUCT_IPHONE_4S 0x12a0
67-
#define USB_PRODUCT_IPHONE_5 0x12a8
6857

6958
#define IPHETH_USBINTF_CLASS 255
7059
#define IPHETH_USBINTF_SUBCLASS 253
@@ -88,50 +77,9 @@
8877
#define IPHETH_CARRIER_ON 0x04
8978

9079
static const struct usb_device_id ipheth_table[] = {
91-
{ USB_DEVICE_AND_INTERFACE_INFO(
92-
USB_VENDOR_APPLE, USB_PRODUCT_IPHONE,
93-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
94-
IPHETH_USBINTF_PROTO) },
95-
{ USB_DEVICE_AND_INTERFACE_INFO(
96-
USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_3G,
97-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
98-
IPHETH_USBINTF_PROTO) },
99-
{ USB_DEVICE_AND_INTERFACE_INFO(
100-
USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_3GS,
101-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
102-
IPHETH_USBINTF_PROTO) },
103-
{ USB_DEVICE_AND_INTERFACE_INFO(
104-
USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4,
105-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
106-
IPHETH_USBINTF_PROTO) },
107-
{ USB_DEVICE_AND_INTERFACE_INFO(
108-
USB_VENDOR_APPLE, USB_PRODUCT_IPAD,
109-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
110-
IPHETH_USBINTF_PROTO) },
111-
{ USB_DEVICE_AND_INTERFACE_INFO(
112-
USB_VENDOR_APPLE, USB_PRODUCT_IPAD_2,
113-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
114-
IPHETH_USBINTF_PROTO) },
115-
{ USB_DEVICE_AND_INTERFACE_INFO(
116-
USB_VENDOR_APPLE, USB_PRODUCT_IPAD_3,
117-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
118-
IPHETH_USBINTF_PROTO) },
119-
{ USB_DEVICE_AND_INTERFACE_INFO(
120-
USB_VENDOR_APPLE, USB_PRODUCT_IPAD_MINI,
121-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
122-
IPHETH_USBINTF_PROTO) },
123-
{ USB_DEVICE_AND_INTERFACE_INFO(
124-
USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
125-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
126-
IPHETH_USBINTF_PROTO) },
127-
{ USB_DEVICE_AND_INTERFACE_INFO(
128-
USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S,
129-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
130-
IPHETH_USBINTF_PROTO) },
131-
{ USB_DEVICE_AND_INTERFACE_INFO(
132-
USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_5,
133-
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
134-
IPHETH_USBINTF_PROTO) },
80+
{ USB_VENDOR_AND_INTERFACE_INFO(USB_VENDOR_APPLE, IPHETH_USBINTF_CLASS,
81+
IPHETH_USBINTF_SUBCLASS,
82+
IPHETH_USBINTF_PROTO) },
13583
{ }
13684
};
13785
MODULE_DEVICE_TABLE(usb, ipheth_table);

0 commit comments

Comments
 (0)