“28f75f4db1e5ea1366375b2a6c40d66659e0e7ec”上不存在“drivers/usb/phy/phy-twl6030-usb.c”
ipaq.c 43.5 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
/*
 * USB Compaq iPAQ driver
 *
 *	Copyright (C) 2001 - 2002
 *	    Ganesh Varadarajan <ganesh@veritas.com>
 *
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation; either version 2 of the License, or
 *	(at your option) any later version.
 *
 * (12/12/2002) ganesh
 * 	Added support for practically all devices supported by ActiveSync
 * 	on Windows. Thanks to Wes Cilldhaire <billybobjoehenrybob@hotmail.com>.
 *
 * (26/11/2002) ganesh
 * 	Added insmod options to specify product and vendor id.
 * 	Use modprobe ipaq vendor=0xfoo product=0xbar
 *
 * (26/7/2002) ganesh
 * 	Fixed up broken error handling in ipaq_open. Retry the "kickstart"
 * 	packet much harder - this drastically reduces connection failures.
 *
 * (30/4/2002) ganesh
 * 	Added support for the Casio EM500. Completely untested. Thanks
 * 	to info from Nathan <wfilardo@fuse.net>
 *
 * (19/3/2002) ganesh
 *	Don't submit urbs while holding spinlocks. Not strictly necessary
 *	in 2.5.x.
 *
 * (8/3/2002) ganesh
 * 	The ipaq sometimes emits a '\0' before the CLIENT string. At this
 * 	point of time, the ppp ldisc is not yet attached to the tty, so
 * 	n_tty echoes "^ " to the ipaq, which messes up the chat. In 2.5.6-pre2
 * 	this causes a panic because echo_char() tries to sleep in interrupt
 * 	context.
 * 	The fix is to tell the upper layers that this is a raw device so that
 * 	echoing is suppressed. Thanks to Lyle Lindholm for a detailed bug
 * 	report.
 *
 * (25/2/2002) ganesh
 * 	Added support for the HP Jornada 548 and 568. Completely untested.
 * 	Thanks to info from Heath Robinson and Arieh Davidoff.
 */

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/spinlock.h>
A
Alan Cox 已提交
56
#include <linux/uaccess.h>
L
Linus Torvalds 已提交
57
#include <linux/usb.h>
58
#include <linux/usb/serial.h>
L
Linus Torvalds 已提交
59 60 61 62 63 64 65 66 67 68 69 70 71 72
#include "ipaq.h"

#define KP_RETRIES	100

/*
 * Version Information
 */

#define DRIVER_VERSION "v0.5"
#define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>"
#define DRIVER_DESC "USB PocketPC PDA driver"

static __u16 product, vendor;
static int debug;
73 74
static int connect_retries = KP_RETRIES;
static int initial_wait;
L
Linus Torvalds 已提交
75 76

/* Function prototypes for an ipaq */
A
Alan Cox 已提交
77 78 79 80
static int  ipaq_open(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp);
static void ipaq_close(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp);
81
static int  ipaq_calc_num_ports(struct usb_serial *serial);
A
Alan Cox 已提交
82 83 84 85
static int  ipaq_startup(struct usb_serial *serial);
static void ipaq_shutdown(struct usb_serial *serial);
static int ipaq_write(struct tty_struct *tty, struct usb_serial_port *port,
			const unsigned char *buf, int count);
A
Alan Cox 已提交
86 87
static int ipaq_write_bulk(struct usb_serial_port *port,
				const unsigned char *buf, int count);
L
Linus Torvalds 已提交
88
static void ipaq_write_gather(struct usb_serial_port *port);
A
Alan Cox 已提交
89
static void ipaq_read_bulk_callback(struct urb *urb);
90
static void ipaq_write_bulk_callback(struct urb *urb);
A
Alan Cox 已提交
91 92
static int ipaq_write_room(struct tty_struct *tty);
static int ipaq_chars_in_buffer(struct tty_struct *tty);
L
Linus Torvalds 已提交
93 94 95 96 97 98
static void ipaq_destroy_lists(struct usb_serial_port *port);


static struct usb_device_id ipaq_id_table [] = {
	/* The first entry is a placeholder for the insmod-specified device */
	{ USB_DEVICE(0x049F, 0x0003) },
99
	{ USB_DEVICE(0x0104, 0x00BE) }, /* Socket USB Sync */
L
Linus Torvalds 已提交
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
	{ USB_DEVICE(0x03F0, 0x1016) }, /* HP USB Sync */
	{ USB_DEVICE(0x03F0, 0x1116) }, /* HP USB Sync 1611 */
	{ USB_DEVICE(0x03F0, 0x1216) }, /* HP USB Sync 1612 */
	{ USB_DEVICE(0x03F0, 0x2016) }, /* HP USB Sync 1620 */
	{ USB_DEVICE(0x03F0, 0x2116) }, /* HP USB Sync 1621 */
	{ USB_DEVICE(0x03F0, 0x2216) }, /* HP USB Sync 1622 */
	{ USB_DEVICE(0x03F0, 0x3016) }, /* HP USB Sync 1630 */
	{ USB_DEVICE(0x03F0, 0x3116) }, /* HP USB Sync 1631 */
	{ USB_DEVICE(0x03F0, 0x3216) }, /* HP USB Sync 1632 */
	{ USB_DEVICE(0x03F0, 0x4016) }, /* HP USB Sync 1640 */
	{ USB_DEVICE(0x03F0, 0x4116) }, /* HP USB Sync 1641 */
	{ USB_DEVICE(0x03F0, 0x4216) }, /* HP USB Sync 1642 */
	{ USB_DEVICE(0x03F0, 0x5016) }, /* HP USB Sync 1650 */
	{ USB_DEVICE(0x03F0, 0x5116) }, /* HP USB Sync 1651 */
	{ USB_DEVICE(0x03F0, 0x5216) }, /* HP USB Sync 1652 */
115 116 117 118 119 120 121
	{ USB_DEVICE(0x0409, 0x00D5) }, /* NEC USB Sync */
	{ USB_DEVICE(0x0409, 0x00D6) }, /* NEC USB Sync */
	{ USB_DEVICE(0x0409, 0x00D7) }, /* NEC USB Sync */
	{ USB_DEVICE(0x0409, 0x8024) }, /* NEC USB Sync */
	{ USB_DEVICE(0x0409, 0x8025) }, /* NEC USB Sync */
	{ USB_DEVICE(0x043E, 0x9C01) }, /* LGE USB Sync */
	{ USB_DEVICE(0x045E, 0x00CE) }, /* Microsoft USB Sync */
L
Linus Torvalds 已提交
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
	{ USB_DEVICE(0x045E, 0x0400) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0401) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0402) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0403) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0404) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0405) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0406) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0407) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0408) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0409) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x040A) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x040B) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x040C) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x040D) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x040E) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x040F) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0410) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0411) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0412) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0413) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0414) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0415) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0416) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0417) }, /* Windows Powered Pocket PC 2002 */
	{ USB_DEVICE(0x045E, 0x0432) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0433) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0434) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0435) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0436) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0437) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0438) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0439) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x043A) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x043B) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x043C) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x043D) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x043E) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x043F) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0440) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0441) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0442) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0443) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0444) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0445) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0446) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0447) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0448) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0449) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x044A) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x044B) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x044C) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x044D) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x044E) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x044F) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0450) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0451) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0452) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0453) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0454) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0455) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0456) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0457) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0458) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0459) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x045A) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x045B) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x045C) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x045D) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x045E) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x045F) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0460) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0461) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0462) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0463) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0464) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0465) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0466) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0467) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0468) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0469) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x046A) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x046B) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x046C) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x046D) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x046E) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x046F) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0470) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0471) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0472) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0473) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0474) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0475) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0476) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0477) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0478) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x0479) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x047A) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x047B) }, /* Windows Powered Pocket PC 2003 */
	{ USB_DEVICE(0x045E, 0x04C8) }, /* Windows Powered Smartphone 2002 */
	{ USB_DEVICE(0x045E, 0x04C9) }, /* Windows Powered Smartphone 2002 */
	{ USB_DEVICE(0x045E, 0x04CA) }, /* Windows Powered Smartphone 2002 */
	{ USB_DEVICE(0x045E, 0x04CB) }, /* Windows Powered Smartphone 2002 */
	{ USB_DEVICE(0x045E, 0x04CC) }, /* Windows Powered Smartphone 2002 */
	{ USB_DEVICE(0x045E, 0x04CD) }, /* Windows Powered Smartphone 2002 */
	{ USB_DEVICE(0x045E, 0x04CE) }, /* Windows Powered Smartphone 2002 */
	{ USB_DEVICE(0x045E, 0x04D7) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04D8) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04D9) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04DA) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04DB) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04DC) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04DD) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04DE) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04DF) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E0) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E1) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E2) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E3) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E4) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E5) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E6) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E7) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E8) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04E9) }, /* Windows Powered Smartphone 2003 */
	{ USB_DEVICE(0x045E, 0x04EA) }, /* Windows Powered Smartphone 2003 */
247 248 249 250 251 252
	{ USB_DEVICE(0x049F, 0x0003) }, /* Compaq iPAQ USB Sync */
	{ USB_DEVICE(0x049F, 0x0032) }, /* Compaq iPAQ USB Sync */
	{ USB_DEVICE(0x04A4, 0x0014) }, /* Hitachi USB Sync */
	{ USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */
	{ USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */
	{ USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */
253 254
	{ USB_DEVICE(0x04AD, 0x0306) }, /* GPS Pocket PC USB Sync */
	{ USB_DEVICE(0x04B7, 0x0531) }, /* MyGuide 7000 XL USB Sync */
255 256 257
	{ USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */
	{ USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */
	{ USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */
258
	{ USB_DEVICE(0x04DD, 0x9102) }, /* SHARP WS003SH USB Modem */
259 260
	{ USB_DEVICE(0x04DD, 0x9121) }, /* SHARP WS004SH USB Modem */
	{ USB_DEVICE(0x04DD, 0x9123) }, /* SHARP WS007SH USB Modem */
261
	{ USB_DEVICE(0x04DD, 0x9151) }, /* SHARP S01SH USB Modem */
262
	{ USB_DEVICE(0x04DD, 0x91AC) }, /* SHARP WS011SH USB Modem */
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
	{ USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */
	{ USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */
	{ USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */
	{ USB_DEVICE(0x04E8, 0x5F03) }, /* Samsung NEXiO USB Sync */
	{ USB_DEVICE(0x04E8, 0x5F04) }, /* Samsung NEXiO USB Sync */
	{ USB_DEVICE(0x04E8, 0x6611) }, /* Samsung MITs USB Sync */
	{ USB_DEVICE(0x04E8, 0x6613) }, /* Samsung MITs USB Sync */
	{ USB_DEVICE(0x04E8, 0x6615) }, /* Samsung MITs USB Sync */
	{ USB_DEVICE(0x04E8, 0x6617) }, /* Samsung MITs USB Sync */
	{ USB_DEVICE(0x04E8, 0x6619) }, /* Samsung MITs USB Sync */
	{ USB_DEVICE(0x04E8, 0x661B) }, /* Samsung MITs USB Sync */
	{ USB_DEVICE(0x04E8, 0x662E) }, /* Samsung MITs USB Sync */
	{ USB_DEVICE(0x04E8, 0x6630) }, /* Samsung MITs USB Sync */
	{ USB_DEVICE(0x04E8, 0x6632) }, /* Samsung MITs USB Sync */
	{ USB_DEVICE(0x04f1, 0x3011) }, /* JVC USB Sync */
	{ USB_DEVICE(0x04F1, 0x3012) }, /* JVC USB Sync */
	{ USB_DEVICE(0x0502, 0x1631) }, /* c10 Series */
	{ USB_DEVICE(0x0502, 0x1632) }, /* c20 Series */
	{ USB_DEVICE(0x0502, 0x16E1) }, /* Acer n10 Handheld USB Sync */
	{ USB_DEVICE(0x0502, 0x16E2) }, /* Acer n20 Handheld USB Sync */
	{ USB_DEVICE(0x0502, 0x16E3) }, /* Acer n30 Handheld USB Sync */
	{ USB_DEVICE(0x0536, 0x01A0) }, /* HHP PDT */
	{ USB_DEVICE(0x0543, 0x0ED9) }, /* ViewSonic Color Pocket PC V35 */
	{ USB_DEVICE(0x0543, 0x1527) }, /* ViewSonic Color Pocket PC V36 */
	{ USB_DEVICE(0x0543, 0x1529) }, /* ViewSonic Color Pocket PC V37 */
	{ USB_DEVICE(0x0543, 0x152B) }, /* ViewSonic Color Pocket PC V38 */
	{ USB_DEVICE(0x0543, 0x152E) }, /* ViewSonic Pocket PC */
	{ USB_DEVICE(0x0543, 0x1921) }, /* ViewSonic Communicator Pocket PC */
	{ USB_DEVICE(0x0543, 0x1922) }, /* ViewSonic Smartphone */
	{ USB_DEVICE(0x0543, 0x1923) }, /* ViewSonic Pocket PC V30 */
	{ USB_DEVICE(0x05E0, 0x2000) }, /* Symbol USB Sync */
	{ USB_DEVICE(0x05E0, 0x2001) }, /* Symbol USB Sync 0x2001 */
	{ USB_DEVICE(0x05E0, 0x2002) }, /* Symbol USB Sync 0x2002 */
	{ USB_DEVICE(0x05E0, 0x2003) }, /* Symbol USB Sync 0x2003 */
	{ USB_DEVICE(0x05E0, 0x2004) }, /* Symbol USB Sync 0x2004 */
	{ USB_DEVICE(0x05E0, 0x2005) }, /* Symbol USB Sync 0x2005 */
	{ USB_DEVICE(0x05E0, 0x2006) }, /* Symbol USB Sync 0x2006 */
	{ USB_DEVICE(0x05E0, 0x2007) }, /* Symbol USB Sync 0x2007 */
	{ USB_DEVICE(0x05E0, 0x2008) }, /* Symbol USB Sync 0x2008 */
	{ USB_DEVICE(0x05E0, 0x2009) }, /* Symbol USB Sync 0x2009 */
	{ USB_DEVICE(0x05E0, 0x200A) }, /* Symbol USB Sync 0x200A */
	{ USB_DEVICE(0x067E, 0x1001) }, /* Intermec Mobile Computer */
	{ USB_DEVICE(0x07CF, 0x2001) }, /* CASIO USB Sync 2001 */
	{ USB_DEVICE(0x07CF, 0x2002) }, /* CASIO USB Sync 2002 */
	{ USB_DEVICE(0x07CF, 0x2003) }, /* CASIO USB Sync 2003 */
L
Linus Torvalds 已提交
308 309
	{ USB_DEVICE(0x0930, 0x0700) }, /* TOSHIBA USB Sync 0700 */
	{ USB_DEVICE(0x0930, 0x0705) }, /* TOSHIBA Pocket PC e310 */
310
	{ USB_DEVICE(0x0930, 0x0706) }, /* TOSHIBA Pocket PC e740 */
L
Linus Torvalds 已提交
311
	{ USB_DEVICE(0x0930, 0x0707) }, /* TOSHIBA Pocket PC e330 Series */
312
	{ USB_DEVICE(0x0930, 0x0708) }, /* TOSHIBA Pocket PC e350 Series */
L
Linus Torvalds 已提交
313 314 315
	{ USB_DEVICE(0x0930, 0x0709) }, /* TOSHIBA Pocket PC e750 Series */
	{ USB_DEVICE(0x0930, 0x070A) }, /* TOSHIBA Pocket PC e400 Series */
	{ USB_DEVICE(0x0930, 0x070B) }, /* TOSHIBA Pocket PC e800 Series */
316 317 318 319 320 321 322 323 324 325 326 327 328
	{ USB_DEVICE(0x094B, 0x0001) }, /* Linkup Systems USB Sync */
	{ USB_DEVICE(0x0960, 0x0065) }, /* BCOM USB Sync 0065 */
	{ USB_DEVICE(0x0960, 0x0066) }, /* BCOM USB Sync 0066 */
	{ USB_DEVICE(0x0960, 0x0067) }, /* BCOM USB Sync 0067 */
	{ USB_DEVICE(0x0961, 0x0010) }, /* Portatec USB Sync */
	{ USB_DEVICE(0x099E, 0x0052) }, /* Trimble GeoExplorer */
	{ USB_DEVICE(0x099E, 0x4000) }, /* TDS Data Collector */
	{ USB_DEVICE(0x0B05, 0x4200) }, /* ASUS USB Sync */
	{ USB_DEVICE(0x0B05, 0x4201) }, /* ASUS USB Sync */
	{ USB_DEVICE(0x0B05, 0x4202) }, /* ASUS USB Sync */
	{ USB_DEVICE(0x0B05, 0x420F) }, /* ASUS USB Sync */
	{ USB_DEVICE(0x0B05, 0x9200) }, /* ASUS USB Sync */
	{ USB_DEVICE(0x0B05, 0x9202) }, /* ASUS USB Sync */
L
Linus Torvalds 已提交
329
	{ USB_DEVICE(0x0BB4, 0x00CE) }, /* HTC USB Sync */
330
	{ USB_DEVICE(0x0BB4, 0x00CF) }, /* HTC USB Modem */
L
Linus Torvalds 已提交
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
	{ USB_DEVICE(0x0BB4, 0x0A01) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A02) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A03) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A04) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A05) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A06) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A07) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A08) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A09) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A0A) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A0B) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A0C) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A0D) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A0E) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A0F) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A10) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A11) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A12) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A13) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A14) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A15) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A16) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A17) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A18) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A19) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A1A) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A1B) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A1C) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A1D) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A1E) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A1F) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A20) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A21) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A22) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A23) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A24) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A25) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A26) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A27) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A28) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A29) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A2A) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A2B) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A2C) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A2D) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A2E) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A2F) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A30) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A31) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A32) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A33) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A34) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A35) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A36) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A37) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A38) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A39) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A3A) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A3B) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A3C) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A3D) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A3E) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A3F) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A40) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A41) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A42) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A43) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A44) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A45) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A46) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A47) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A48) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A49) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A4A) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A4B) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A4C) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A4D) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A4E) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A4F) }, /* PocketPC USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A50) }, /* HTC SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A51) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A52) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A53) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A54) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A55) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A56) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A57) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A58) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A59) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A5A) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A5B) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A5C) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A5D) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A5E) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A5F) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A60) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A61) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A62) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A63) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A64) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A65) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A66) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A67) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A68) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A69) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A6A) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A6B) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A6C) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A6D) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A6E) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A6F) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A70) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A71) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A72) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A73) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A74) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A75) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A76) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A77) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A78) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A79) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A7A) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A7B) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A7C) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A7D) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A7E) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A7F) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A80) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A81) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A82) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A83) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A84) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A85) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A86) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A87) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A88) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A89) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A8A) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A8B) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A8C) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A8D) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A8E) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A8F) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A90) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A91) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A92) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A93) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A94) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A95) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A96) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A97) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A98) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A99) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A9A) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A9B) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A9C) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A9D) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A9E) }, /* SmartPhone USB Sync */
	{ USB_DEVICE(0x0BB4, 0x0A9F) }, /* SmartPhone USB Sync */
490
	{ USB_DEVICE(0x0BB4, 0x0BCE) }, /* "High Tech Computer Corp" */
L
Linus Torvalds 已提交
491
	{ USB_DEVICE(0x0BF8, 0x1001) }, /* Fujitsu Siemens Computers USB Sync */
492
	{ USB_DEVICE(0x0C44, 0x03A2) }, /* Motorola iDEN Smartphone */
L
Linus Torvalds 已提交
493
	{ USB_DEVICE(0x0C8E, 0x6000) }, /* Cesscom Luxian Series */
494
	{ USB_DEVICE(0x0CAD, 0x9001) }, /* Motorola PowerPad Pocket PC Device */
495 496 497 498 499 500 501
	{ USB_DEVICE(0x0F4E, 0x0200) }, /* Freedom Scientific USB Sync */
	{ USB_DEVICE(0x0F98, 0x0201) }, /* Cyberbank USB Sync */
	{ USB_DEVICE(0x0FB8, 0x3001) }, /* Wistron USB Sync */
	{ USB_DEVICE(0x0FB8, 0x3002) }, /* Wistron USB Sync */
	{ USB_DEVICE(0x0FB8, 0x3003) }, /* Wistron USB Sync */
	{ USB_DEVICE(0x0FB8, 0x4001) }, /* Wistron USB Sync */
	{ USB_DEVICE(0x1066, 0x00CE) }, /* E-TEN USB Sync */
L
Linus Torvalds 已提交
502 503 504 505
	{ USB_DEVICE(0x1066, 0x0300) }, /* E-TEN P3XX Pocket PC */
	{ USB_DEVICE(0x1066, 0x0500) }, /* E-TEN P5XX Pocket PC */
	{ USB_DEVICE(0x1066, 0x0600) }, /* E-TEN P6XX Pocket PC */
	{ USB_DEVICE(0x1066, 0x0700) }, /* E-TEN P7XX Pocket PC */
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520
	{ USB_DEVICE(0x1114, 0x0001) }, /* Psion Teklogix Sync 753x */
	{ USB_DEVICE(0x1114, 0x0004) }, /* Psion Teklogix Sync netBookPro */
	{ USB_DEVICE(0x1114, 0x0006) }, /* Psion Teklogix Sync 7525 */
	{ USB_DEVICE(0x1182, 0x1388) }, /* VES USB Sync */
	{ USB_DEVICE(0x11D9, 0x1002) }, /* Rugged Pocket PC 2003 */
	{ USB_DEVICE(0x11D9, 0x1003) }, /* Rugged Pocket PC 2003 */
	{ USB_DEVICE(0x1231, 0xCE01) }, /* USB Sync 03 */
	{ USB_DEVICE(0x1231, 0xCE02) }, /* USB Sync 03 */
	{ USB_DEVICE(0x1690, 0x0601) }, /* Askey USB Sync */
	{ USB_DEVICE(0x22B8, 0x4204) }, /* Motorola MPx200 Smartphone */
	{ USB_DEVICE(0x22B8, 0x4214) }, /* Motorola MPc GSM */
	{ USB_DEVICE(0x22B8, 0x4224) }, /* Motorola MPx220 Smartphone */
	{ USB_DEVICE(0x22B8, 0x4234) }, /* Motorola MPc CDMA */
	{ USB_DEVICE(0x22B8, 0x4244) }, /* Motorola MPx100 Smartphone */
	{ USB_DEVICE(0x3340, 0x011C) }, /* Mio DigiWalker PPC StrongARM */
L
Linus Torvalds 已提交
521 522 523 524
	{ USB_DEVICE(0x3340, 0x0326) }, /* Mio DigiWalker 338 */
	{ USB_DEVICE(0x3340, 0x0426) }, /* Mio DigiWalker 338 */
	{ USB_DEVICE(0x3340, 0x043A) }, /* Mio DigiWalker USB Sync */
	{ USB_DEVICE(0x3340, 0x051C) }, /* MiTAC USB Sync 528 */
525 526 527 528 529 530 531
	{ USB_DEVICE(0x3340, 0x053A) }, /* Mio DigiWalker SmartPhone USB Sync */
	{ USB_DEVICE(0x3340, 0x071C) }, /* MiTAC USB Sync */
	{ USB_DEVICE(0x3340, 0x0B1C) }, /* Generic PPC StrongARM */
	{ USB_DEVICE(0x3340, 0x0E3A) }, /* Generic PPC USB Sync */
	{ USB_DEVICE(0x3340, 0x0F1C) }, /* Itautec USB Sync */
	{ USB_DEVICE(0x3340, 0x0F3A) }, /* Generic SmartPhone USB Sync */
	{ USB_DEVICE(0x3340, 0x1326) }, /* Itautec USB Sync */
L
Linus Torvalds 已提交
532
	{ USB_DEVICE(0x3340, 0x191C) }, /* YAKUMO USB Sync */
533 534 535 536
	{ USB_DEVICE(0x3340, 0x2326) }, /* Vobis USB Sync */
	{ USB_DEVICE(0x3340, 0x3326) }, /* MEDION Winodws Moble USB Sync */
	{ USB_DEVICE(0x3708, 0x20CE) }, /* Legend USB Sync */
	{ USB_DEVICE(0x3708, 0x21CE) }, /* Lenovo USB Sync */
L
Linus Torvalds 已提交
537 538 539 540
	{ USB_DEVICE(0x4113, 0x0210) }, /* Mobile Media Technology USB Sync */
	{ USB_DEVICE(0x4113, 0x0211) }, /* Mobile Media Technology USB Sync */
	{ USB_DEVICE(0x4113, 0x0400) }, /* Mobile Media Technology USB Sync */
	{ USB_DEVICE(0x4113, 0x0410) }, /* Mobile Media Technology USB Sync */
541 542 543 544 545 546 547 548 549
	{ USB_DEVICE(0x413C, 0x4001) }, /* Dell Axim USB Sync */
	{ USB_DEVICE(0x413C, 0x4002) }, /* Dell Axim USB Sync */
	{ USB_DEVICE(0x413C, 0x4003) }, /* Dell Axim USB Sync */
	{ USB_DEVICE(0x413C, 0x4004) }, /* Dell Axim USB Sync */
	{ USB_DEVICE(0x413C, 0x4005) }, /* Dell Axim USB Sync */
	{ USB_DEVICE(0x413C, 0x4006) }, /* Dell Axim USB Sync */
	{ USB_DEVICE(0x413C, 0x4007) }, /* Dell Axim USB Sync */
	{ USB_DEVICE(0x413C, 0x4008) }, /* Dell Axim USB Sync */
	{ USB_DEVICE(0x413C, 0x4009) }, /* Dell Axim USB Sync */
L
Linus Torvalds 已提交
550
	{ USB_DEVICE(0x4505, 0x0010) }, /* Smartphone */
551
	{ USB_DEVICE(0x5E04, 0xCE00) }, /* SAGEM Wireless Assistant */
552
	{ USB_DEVICE(0x0BB4, 0x00CF) }, /* HTC smartphone modems */
L
Linus Torvalds 已提交
553 554 555
	{ }                             /* Terminating entry */
};

A
Alan Cox 已提交
556
MODULE_DEVICE_TABLE(usb, ipaq_id_table);
L
Linus Torvalds 已提交
557 558 559 560 561 562

static struct usb_driver ipaq_driver = {
	.name =		"ipaq",
	.probe =	usb_serial_probe,
	.disconnect =	usb_serial_disconnect,
	.id_table =	ipaq_id_table,
563
	.no_dynamic_id = 	1,
L
Linus Torvalds 已提交
564 565 566 567
};


/* All of the device info needed for the Compaq iPAQ */
568
static struct usb_serial_driver ipaq_device = {
569 570
	.driver = {
		.owner =	THIS_MODULE,
571
		.name =		"ipaq",
572
	},
573
	.description =		"PocketPC PDA",
574
	.usb_driver = 		&ipaq_driver,
L
Linus Torvalds 已提交
575 576 577 578
	.id_table =		ipaq_id_table,
	.open =			ipaq_open,
	.close =		ipaq_close,
	.attach =		ipaq_startup,
579
	.calc_num_ports =	ipaq_calc_num_ports,
L
Linus Torvalds 已提交
580 581 582 583 584 585 586 587 588 589 590 591
	.shutdown =		ipaq_shutdown,
	.write =		ipaq_write,
	.write_room =		ipaq_write_room,
	.chars_in_buffer =	ipaq_chars_in_buffer,
	.read_bulk_callback =	ipaq_read_bulk_callback,
	.write_bulk_callback =	ipaq_write_bulk_callback,
};

static spinlock_t	write_list_lock;
static int		bytes_in;
static int		bytes_out;

A
Alan Cox 已提交
592 593
static int ipaq_open(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp)
L
Linus Torvalds 已提交
594 595 596 597 598
{
	struct usb_serial	*serial = port->serial;
	struct ipaq_private	*priv;
	struct ipaq_packet	*pkt;
	int			i, result = 0;
599
	int			retries = connect_retries;
L
Linus Torvalds 已提交
600

601
	dbg("%s - port %d", __func__, port->number);
L
Linus Torvalds 已提交
602 603 604

	bytes_in = 0;
	bytes_out = 0;
605
	priv = kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
L
Linus Torvalds 已提交
606
	if (priv == NULL) {
607
		dev_err(&port->dev, "%s - Out of memory\n", __func__);
L
Linus Torvalds 已提交
608 609 610 611 612 613 614 615 616 617 618
		return -ENOMEM;
	}
	usb_set_serial_port_data(port, priv);
	priv->active = 0;
	priv->queue_len = 0;
	priv->free_len = 0;
	INIT_LIST_HEAD(&priv->queue);
	INIT_LIST_HEAD(&priv->freelist);

	for (i = 0; i < URBDATA_QUEUE_MAX / PACKET_SIZE; i++) {
		pkt = kmalloc(sizeof(struct ipaq_packet), GFP_KERNEL);
A
Alan Cox 已提交
619
		if (pkt == NULL)
L
Linus Torvalds 已提交
620
			goto enomem;
A
Alan Cox 已提交
621

L
Linus Torvalds 已提交
622 623 624 625 626 627 628 629 630 631 632 633
		pkt->data = kmalloc(PACKET_SIZE, GFP_KERNEL);
		if (pkt->data == NULL) {
			kfree(pkt);
			goto enomem;
		}
		pkt->len = 0;
		pkt->written = 0;
		INIT_LIST_HEAD(&pkt->list);
		list_add(&pkt->list, &priv->freelist);
		priv->free_len += PACKET_SIZE;
	}

A
Alan Cox 已提交
634 635 636 637 638
	if (tty) {
		/* FIXME: These two are bogus */
		tty->raw = 1;
		tty->real_raw = 1;
	}
L
Linus Torvalds 已提交
639 640 641 642 643
	/*
	 * Lose the small buffers usbserial provides. Make larger ones.
	 */

	kfree(port->bulk_in_buffer);
644 645 646 647
	kfree(port->bulk_out_buffer);
	/* make sure the generic serial code knows */
	port->bulk_out_buffer = NULL;

L
Linus Torvalds 已提交
648
	port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
649
	if (port->bulk_in_buffer == NULL)
L
Linus Torvalds 已提交
650
		goto enomem;
651

L
Linus Torvalds 已提交
652 653
	port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
	if (port->bulk_out_buffer == NULL) {
654
		/* the buffer is useless, free it */
L
Linus Torvalds 已提交
655
		kfree(port->bulk_in_buffer);
656
		port->bulk_in_buffer = NULL;
L
Linus Torvalds 已提交
657 658 659 660 661
		goto enomem;
	}
	port->read_urb->transfer_buffer = port->bulk_in_buffer;
	port->write_urb->transfer_buffer = port->bulk_out_buffer;
	port->read_urb->transfer_buffer_length = URBDATA_SIZE;
A
Alan Cox 已提交
662 663 664
	port->bulk_out_size = port->write_urb->transfer_buffer_length
							= URBDATA_SIZE;

665
	msleep(1000*initial_wait);
L
Linus Torvalds 已提交
666 667 668 669 670 671 672 673 674 675 676 677 678

	/*
	 * Send out control message observed in win98 sniffs. Not sure what
	 * it does, but from empirical observations, it seems that the device
	 * will start the chat sequence once one of these messages gets
	 * through. Since this has a reasonably high failure rate, we retry
	 * several times.
	 */

	while (retries--) {
		result = usb_control_msg(serial->dev,
				usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21,
				0x1, 0, NULL, 0, 100);
679 680 681
		if (!result)
			break;

682
		msleep(1000);
L
Linus Torvalds 已提交
683
	}
684 685

	if (!retries && result) {
686
		dev_err(&port->dev, "%s - failed doing control urb, error %d\n",			__func__, result);
687 688 689 690 691
		goto error;
	}

	/* Start reading from the device */
	usb_fill_bulk_urb(port->read_urb, serial->dev,
A
Alan Cox 已提交
692 693 694 695
		usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
		port->read_urb->transfer_buffer,
		port->read_urb->transfer_buffer_length,
		ipaq_read_bulk_callback, port);
696 697 698

	result = usb_submit_urb(port->read_urb, GFP_KERNEL);
	if (result) {
699 700 701
		dev_err(&port->dev,
			"%s - failed submitting read urb, error %d\n",
			__func__, result);
702 703 704 705
		goto error;
	}

	return 0;
L
Linus Torvalds 已提交
706 707 708

enomem:
	result = -ENOMEM;
709
	dev_err(&port->dev, "%s - Out of memory\n", __func__);
L
Linus Torvalds 已提交
710 711 712 713 714 715 716
error:
	ipaq_destroy_lists(port);
	kfree(priv);
	return result;
}


A
Alan Cox 已提交
717 718
static void ipaq_close(struct tty_struct *tty,
			struct usb_serial_port *port, struct file *filp)
L
Linus Torvalds 已提交
719 720 721
{
	struct ipaq_private	*priv = usb_get_serial_port_data(port);

722
	dbg("%s - port %d", __func__, port->number);
A
Alan Cox 已提交
723

L
Linus Torvalds 已提交
724 725 726 727 728 729 730 731 732
	/*
	 * shut down bulk read and write
	 */
	usb_kill_urb(port->write_urb);
	usb_kill_urb(port->read_urb);
	ipaq_destroy_lists(port);
	kfree(priv);
	usb_set_serial_port_data(port, NULL);

A
Alan Cox 已提交
733 734
	/* Uncomment the following line if you want to see some statistics
	 * in your syslog */
L
Linus Torvalds 已提交
735 736 737
	/* info ("Bytes In = %d  Bytes Out = %d", bytes_in, bytes_out); */
}

738
static void ipaq_read_bulk_callback(struct urb *urb)
L
Linus Torvalds 已提交
739
{
740
	struct usb_serial_port	*port = urb->context;
L
Linus Torvalds 已提交
741 742
	struct tty_struct	*tty;
	unsigned char		*data = urb->transfer_buffer;
743
	int			result;
744
	int status = urb->status;
L
Linus Torvalds 已提交
745

746
	dbg("%s - port %d", __func__, port->number);
L
Linus Torvalds 已提交
747

748 749
	if (status) {
		dbg("%s - nonzero read bulk status received: %d",
750
		    __func__, status);
L
Linus Torvalds 已提交
751 752 753
		return;
	}

A
Alan Cox 已提交
754 755
	usb_serial_debug_data(debug, &port->dev, __func__,
						urb->actual_length, data);
L
Linus Torvalds 已提交
756

A
Alan Cox 已提交
757
	tty = tty_port_tty_get(&port->port);
L
Linus Torvalds 已提交
758
	if (tty && urb->actual_length) {
759 760
		tty_buffer_request_room(tty, urb->actual_length);
		tty_insert_flip_string(tty, data, urb->actual_length);
L
Linus Torvalds 已提交
761 762 763
		tty_flip_buffer_push(tty);
		bytes_in += urb->actual_length;
	}
A
Alan Cox 已提交
764
	tty_kref_put(tty);
L
Linus Torvalds 已提交
765 766

	/* Continue trying to always read  */
A
Alan Cox 已提交
767 768 769 770 771
	usb_fill_bulk_urb(port->read_urb, port->serial->dev,
	    usb_rcvbulkpipe(port->serial->dev, port->bulk_in_endpointAddress),
	    port->read_urb->transfer_buffer,
	    port->read_urb->transfer_buffer_length,
	    ipaq_read_bulk_callback, port);
L
Linus Torvalds 已提交
772 773
	result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
	if (result)
774 775 776
		dev_err(&port->dev,
			"%s - failed resubmitting read urb, error %d\n",
			__func__, result);
L
Linus Torvalds 已提交
777 778 779
	return;
}

A
Alan Cox 已提交
780 781
static int ipaq_write(struct tty_struct *tty, struct usb_serial_port *port,
			const unsigned char *buf, int count)
L
Linus Torvalds 已提交
782 783 784 785 786
{
	const unsigned char	*current_position = buf;
	int			bytes_sent = 0;
	int			transfer_size;

787
	dbg("%s - port %d", __func__, port->number);
L
Linus Torvalds 已提交
788 789 790

	while (count > 0) {
		transfer_size = min(count, PACKET_SIZE);
A
Alan Cox 已提交
791
		if (ipaq_write_bulk(port, current_position, transfer_size))
L
Linus Torvalds 已提交
792 793 794 795 796 797 798 799
			break;
		current_position += transfer_size;
		bytes_sent += transfer_size;
		count -= transfer_size;
		bytes_out += transfer_size;
	}

	return bytes_sent;
A
Alan Cox 已提交
800
}
L
Linus Torvalds 已提交
801

A
Alan Cox 已提交
802 803
static int ipaq_write_bulk(struct usb_serial_port *port,
					const unsigned char *buf, int count)
L
Linus Torvalds 已提交
804 805 806 807 808 809 810
{
	struct ipaq_private	*priv = usb_get_serial_port_data(port);
	struct ipaq_packet	*pkt = NULL;
	int			result = 0;
	unsigned long		flags;

	if (priv->free_len <= 0) {
811
		dbg("%s - we're stuffed", __func__);
L
Linus Torvalds 已提交
812 813 814 815 816 817 818 819 820 821 822
		return -EAGAIN;
	}

	spin_lock_irqsave(&write_list_lock, flags);
	if (!list_empty(&priv->freelist)) {
		pkt = list_entry(priv->freelist.next, struct ipaq_packet, list);
		list_del(&pkt->list);
		priv->free_len -= PACKET_SIZE;
	}
	spin_unlock_irqrestore(&write_list_lock, flags);
	if (pkt == NULL) {
823
		dbg("%s - we're stuffed", __func__);
L
Linus Torvalds 已提交
824 825 826 827
		return -EAGAIN;
	}

	memcpy(pkt->data, buf, count);
828
	usb_serial_debug_data(debug, &port->dev, __func__, count, pkt->data);
L
Linus Torvalds 已提交
829 830 831 832 833 834 835 836 837 838 839

	pkt->len = count;
	pkt->written = 0;
	spin_lock_irqsave(&write_list_lock, flags);
	list_add_tail(&pkt->list, &priv->queue);
	priv->queue_len += count;
	if (priv->active == 0) {
		priv->active = 1;
		ipaq_write_gather(port);
		spin_unlock_irqrestore(&write_list_lock, flags);
		result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
A
Alan Cox 已提交
840
		if (result)
841 842
			dev_err(&port->dev,
				"%s - failed submitting write urb, error %d\n",
A
Alan Cox 已提交
843
				__func__, result);
L
Linus Torvalds 已提交
844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869
	} else {
		spin_unlock_irqrestore(&write_list_lock, flags);
	}
	return result;
}

static void ipaq_write_gather(struct usb_serial_port *port)
{
	struct ipaq_private	*priv = usb_get_serial_port_data(port);
	struct usb_serial	*serial = port->serial;
	int			count, room;
	struct ipaq_packet	*pkt, *tmp;
	struct urb		*urb = port->write_urb;

	room = URBDATA_SIZE;
	list_for_each_entry_safe(pkt, tmp, &priv->queue, list) {
		count = min(room, (int)(pkt->len - pkt->written));
		memcpy(urb->transfer_buffer + (URBDATA_SIZE - room),
		       pkt->data + pkt->written, count);
		room -= count;
		pkt->written += count;
		priv->queue_len -= count;
		if (pkt->written == pkt->len) {
			list_move(&pkt->list, &priv->freelist);
			priv->free_len += PACKET_SIZE;
		}
A
Alan Cox 已提交
870
		if (room == 0)
L
Linus Torvalds 已提交
871 872 873 874
			break;
	}

	count = URBDATA_SIZE - room;
A
Alan Cox 已提交
875 876 877 878
	usb_fill_bulk_urb(port->write_urb, serial->dev,
		usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress),
		port->write_urb->transfer_buffer, count,
		ipaq_write_bulk_callback, port);
L
Linus Torvalds 已提交
879 880 881
	return;
}

882
static void ipaq_write_bulk_callback(struct urb *urb)
L
Linus Torvalds 已提交
883
{
884
	struct usb_serial_port	*port = urb->context;
L
Linus Torvalds 已提交
885 886 887
	struct ipaq_private	*priv = usb_get_serial_port_data(port);
	unsigned long		flags;
	int			result;
888
	int status = urb->status;
L
Linus Torvalds 已提交
889

890
	dbg("%s - port %d", __func__, port->number);
891 892 893

	if (status) {
		dbg("%s - nonzero write bulk status received: %d",
894
		    __func__, status);
895
		return;
L
Linus Torvalds 已提交
896 897 898 899 900 901 902
	}

	spin_lock_irqsave(&write_list_lock, flags);
	if (!list_empty(&priv->queue)) {
		ipaq_write_gather(port);
		spin_unlock_irqrestore(&write_list_lock, flags);
		result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
A
Alan Cox 已提交
903
		if (result)
904 905 906
			dev_err(&port->dev,
				"%s - failed submitting write urb, error %d\n",
				__func__, result);
L
Linus Torvalds 已提交
907 908 909 910 911
	} else {
		priv->active = 0;
		spin_unlock_irqrestore(&write_list_lock, flags);
	}

912
	usb_serial_port_softint(port);
L
Linus Torvalds 已提交
913 914
}

A
Alan Cox 已提交
915
static int ipaq_write_room(struct tty_struct *tty)
L
Linus Torvalds 已提交
916
{
A
Alan Cox 已提交
917
	struct usb_serial_port *port = tty->driver_data;
L
Linus Torvalds 已提交
918 919
	struct ipaq_private	*priv = usb_get_serial_port_data(port);

920
	dbg("%s - freelen %d", __func__, priv->free_len);
L
Linus Torvalds 已提交
921 922 923
	return priv->free_len;
}

A
Alan Cox 已提交
924
static int ipaq_chars_in_buffer(struct tty_struct *tty)
L
Linus Torvalds 已提交
925
{
A
Alan Cox 已提交
926
	struct usb_serial_port *port = tty->driver_data;
L
Linus Torvalds 已提交
927 928
	struct ipaq_private	*priv = usb_get_serial_port_data(port);

929
	dbg("%s - queuelen %d", __func__, priv->queue_len);
L
Linus Torvalds 已提交
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948
	return priv->queue_len;
}

static void ipaq_destroy_lists(struct usb_serial_port *port)
{
	struct ipaq_private	*priv = usb_get_serial_port_data(port);
	struct ipaq_packet	*pkt, *tmp;

	list_for_each_entry_safe(pkt, tmp, &priv->queue, list) {
		kfree(pkt->data);
		kfree(pkt);
	}
	list_for_each_entry_safe(pkt, tmp, &priv->freelist, list) {
		kfree(pkt->data);
		kfree(pkt);
	}
}


949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974
static int ipaq_calc_num_ports(struct usb_serial *serial)
{
	/*
	 * some devices have 3 endpoints, the 3rd of which
	 * must be ignored as it would make the core
	 * create a second port which oopses when used
	 */
	int ipaq_num_ports = 1;

	dbg("%s - numberofendpoints: %d", __FUNCTION__,
		(int)serial->interface->cur_altsetting->desc.bNumEndpoints);

	/*
	 * a few devices have 4 endpoints, seemingly Yakuma devices,
	 * and we need the second pair, so let them have 2 ports
	 *
	 * TODO: can we drop port 1 ?
	 */
	if (serial->interface->cur_altsetting->desc.bNumEndpoints > 3) {
		ipaq_num_ports = 2;
	}

	return ipaq_num_ports;
}


L
Linus Torvalds 已提交
975 976
static int ipaq_startup(struct usb_serial *serial)
{
977
	dbg("%s", __func__);
L
Linus Torvalds 已提交
978
	if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
979 980 981 982 983
		/*
		 * FIXME: HP iPaq rx3715, possibly others, have 1 config that
		 * is labeled as 2
		 */

984
		dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
L
Linus Torvalds 已提交
985 986 987
			serial->dev->actconfig->desc.bConfigurationValue);
		return -ENODEV;
	}
988 989 990 991

	dbg("%s - iPAQ module configured for %d ports",
		__FUNCTION__, serial->num_ports);

A
Alan Cox 已提交
992
	return usb_reset_configuration(serial->dev);
L
Linus Torvalds 已提交
993 994 995 996
}

static void ipaq_shutdown(struct usb_serial *serial)
{
997
	dbg("%s", __func__);
L
Linus Torvalds 已提交
998 999 1000 1001 1002 1003 1004
}

static int __init ipaq_init(void)
{
	int retval;
	spin_lock_init(&write_list_lock);
	retval = usb_serial_register(&ipaq_device);
A
Alan Cox 已提交
1005
	if (retval)
L
Linus Torvalds 已提交
1006 1007 1008 1009 1010 1011 1012 1013
		goto failed_usb_serial_register;
	if (vendor) {
		ipaq_id_table[0].idVendor = vendor;
		ipaq_id_table[0].idProduct = product;
	}
	retval = usb_register(&ipaq_driver);
	if (retval)
		goto failed_usb_register;
A
Alan Cox 已提交
1014

1015 1016
	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
	       DRIVER_DESC "\n");
L
Linus Torvalds 已提交
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034
	return 0;
failed_usb_register:
	usb_serial_deregister(&ipaq_device);
failed_usb_serial_register:
	return retval;
}


static void __exit ipaq_exit(void)
{
	usb_deregister(&ipaq_driver);
	usb_serial_deregister(&ipaq_device);
}


module_init(ipaq_init);
module_exit(ipaq_exit);

A
Alan Cox 已提交
1035 1036
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
L
Linus Torvalds 已提交
1037 1038 1039 1040 1041 1042 1043 1044 1045 1046
MODULE_LICENSE("GPL");

module_param(debug, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "Debug enabled or not");

module_param(vendor, ushort, 0);
MODULE_PARM_DESC(vendor, "User specified USB idVendor");

module_param(product, ushort, 0);
MODULE_PARM_DESC(product, "User specified USB idProduct");
1047 1048

module_param(connect_retries, int, S_IRUGO|S_IWUSR);
A
Alan Cox 已提交
1049 1050
MODULE_PARM_DESC(connect_retries,
		"Maximum number of connect retries (one second each)");
1051 1052

module_param(initial_wait, int, S_IRUGO|S_IWUSR);
A
Alan Cox 已提交
1053 1054
MODULE_PARM_DESC(initial_wait,
		"Time to wait before attempting a connection (in seconds)");
新手
引导
客服 返回
顶部