1/* $NetBSD: uipaq.c,v 1.4 2006/11/16 01:33:27 christos Exp $ */
2/* $OpenBSD: uipaq.c,v 1.1 2005/06/17 23:50:33 deraadt Exp $ */
3
4/*
5 * Copyright (c) 2000-2005 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Lennart Augustsson (lennart@augustsson.net) at
10 * Carlstedt Research & Technology.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/*
35 * iPAQ driver
36 *
37 * 19 July 2003: Incorporated changes suggested by Sam Lawrance from
38 * the uppc module
39 *
40 *
41 * Contact isis@cs.umd.edu if you have any questions/comments about this driver
42 */
43
44#include <sys/cdefs.h>
45__FBSDID("$FreeBSD: head/sys/dev/usb/serial/uipaq.c 210469 2010-07-25 15:14:42Z gavin $");
46
47#include <sys/stdint.h>
48#include <sys/stddef.h>
49#include <sys/param.h>
50#include <sys/queue.h>
51#include <sys/types.h>
52#include <sys/systm.h>
53#include <sys/kernel.h>
54#include <sys/bus.h>
55#include <sys/linker_set.h>
56#include <sys/module.h>
57#include <sys/lock.h>
58#include <sys/mutex.h>
59#include <sys/condvar.h>
60#include <sys/sysctl.h>
61#include <sys/sx.h>
62#include <sys/unistd.h>
63#include <sys/callout.h>
64#include <sys/malloc.h>
65#include <sys/priv.h>
66
67#include <dev/usb/usb.h>
68#include <dev/usb/usbdi.h>
69#include <dev/usb/usbdi_util.h>
70#include <dev/usb/usb_cdc.h>
71#include "usbdevs.h"
72
73#define USB_DEBUG_VAR usb_debug
74#include <dev/usb/usb_debug.h>
75#include <dev/usb/usb_process.h>
76
77#include <dev/usb/serial/usb_serial.h>
78
79#define UIPAQ_CONFIG_INDEX 0 /* config number 1 */
80#define UIPAQ_IFACE_INDEX 0
81
82#define UIPAQ_BUF_SIZE 1024
83
84enum {
85 UIPAQ_BULK_DT_WR,
86 UIPAQ_BULK_DT_RD,
87 UIPAQ_N_TRANSFER,
88};
89
90struct uipaq_softc {
91 struct ucom_super_softc sc_super_ucom;
92 struct ucom_softc sc_ucom;
93
94 struct usb_xfer *sc_xfer[UIPAQ_N_TRANSFER];
95 struct usb_device *sc_udev;
96 struct mtx sc_mtx;
97
98 uint16_t sc_line;
99
100 uint8_t sc_lsr; /* local status register */
101 uint8_t sc_msr; /* modem status register */
102};
103
104static device_probe_t uipaq_probe;
105static device_attach_t uipaq_attach;
106static device_detach_t uipaq_detach;
107
108static usb_callback_t uipaq_write_callback;
109static usb_callback_t uipaq_read_callback;
110
111static void uipaq_start_read(struct ucom_softc *);
112static void uipaq_stop_read(struct ucom_softc *);
113static void uipaq_start_write(struct ucom_softc *);
114static void uipaq_stop_write(struct ucom_softc *);
115static void uipaq_cfg_set_dtr(struct ucom_softc *, uint8_t);
116static void uipaq_cfg_set_rts(struct ucom_softc *, uint8_t);
117static void uipaq_cfg_set_break(struct ucom_softc *, uint8_t);
118static void uipaq_poll(struct ucom_softc *ucom);
119
120static const struct usb_config uipaq_config_data[UIPAQ_N_TRANSFER] = {
121
122 [UIPAQ_BULK_DT_WR] = {
123 .type = UE_BULK,
124 .endpoint = UE_ADDR_ANY,
125 .direction = UE_DIR_OUT,
126 .bufsize = UIPAQ_BUF_SIZE,
127 .flags = {.pipe_bof = 1,.force_short_xfer = 1,},
128 .callback = &uipaq_write_callback,
129 },
130
131 [UIPAQ_BULK_DT_RD] = {
132 .type = UE_BULK,
133 .endpoint = UE_ADDR_ANY,
134 .direction = UE_DIR_IN,
135 .bufsize = UIPAQ_BUF_SIZE,
136 .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
137 .callback = &uipaq_read_callback,
138 },
139};
140
141static const struct ucom_callback uipaq_callback = {
142 .ucom_cfg_set_dtr = &uipaq_cfg_set_dtr,
143 .ucom_cfg_set_rts = &uipaq_cfg_set_rts,
144 .ucom_cfg_set_break = &uipaq_cfg_set_break,
145 .ucom_start_read = &uipaq_start_read,
146 .ucom_stop_read = &uipaq_stop_read,
147 .ucom_start_write = &uipaq_start_write,
148 .ucom_stop_write = &uipaq_stop_write,
149 .ucom_poll = &uipaq_poll,
150};
151
152/*
153 * Much of this list is generated from lists of other drivers that
154 * support the same hardware. Numeric values are used where no usbdevs
155 * entries exist.
156 */
157static const struct usb_device_id uipaq_devs[] = {
158 /* Socket USB Sync */
159 {USB_VPI(0x0104, 0x00be, 0)},
160 /* USB Sync 0301 */
161 {USB_VPI(0x04ad, 0x0301, 0)},
162 /* USB Sync 0302 */
163 {USB_VPI(0x04ad, 0x0302, 0)},
164 /* USB Sync 0303 */
165 {USB_VPI(0x04ad, 0x0303, 0)},
166 /* GPS Pocket PC USB Sync */
167 {USB_VPI(0x04ad, 0x0306, 0)},
168 /* HHP PDT */
169 {USB_VPI(0x0536, 0x01a0, 0)},
170 /* Intermec Mobile Computer */
171 {USB_VPI(0x067e, 0x1001, 0)},
172 /* Linkup Systems USB Sync */
173 {USB_VPI(0x094b, 0x0001, 0)},
174 /* BCOM USB Sync 0065 */
175 {USB_VPI(0x0960, 0x0065, 0)},
176 /* BCOM USB Sync 0066 */
177 {USB_VPI(0x0960, 0x0066, 0)},
178 /* BCOM USB Sync 0067 */
179 {USB_VPI(0x0960, 0x0067, 0)},
180 /* Portatec USB Sync */
181 {USB_VPI(0x0961, 0x0010, 0)},
182 /* Trimble GeoExplorer */
183 {USB_VPI(0x099e, 0x0052, 0)},
184 /* TDS Data Collector */
185 {USB_VPI(0x099e, 0x4000, 0)},
186 /* Motorola iDEN Smartphone */
187 {USB_VPI(0x0c44, 0x03a2, 0)},
188 /* Cesscom Luxian Series */
189 {USB_VPI(0x0c8e, 0x6000, 0)},
190 /* Motorola PowerPad Pocket PCDevice */
191 {USB_VPI(0x0cad, 0x9001, 0)},
192 /* Freedom Scientific USB Sync */
193 {USB_VPI(0x0f4e, 0x0200, 0)},
194 /* Cyberbank USB Sync */
195 {USB_VPI(0x0f98, 0x0201, 0)},
196 /* Wistron USB Sync */
197 {USB_VPI(0x0fb8, 0x3001, 0)},
198 /* Wistron USB Sync */
199 {USB_VPI(0x0fb8, 0x3002, 0)},
200 /* Wistron USB Sync */
201 {USB_VPI(0x0fb8, 0x3003, 0)},
202 /* Wistron USB Sync */
203 {USB_VPI(0x0fb8, 0x4001, 0)},
204 /* E-TEN USB Sync */
205 {USB_VPI(0x1066, 0x00ce, 0)},
206 /* E-TEN P3XX Pocket PC */
207 {USB_VPI(0x1066, 0x0300, 0)},
208 /* E-TEN P5XX Pocket PC */
209 {USB_VPI(0x1066, 0x0500, 0)},
210 /* E-TEN P6XX Pocket PC */
211 {USB_VPI(0x1066, 0x0600, 0)},
212 /* E-TEN P7XX Pocket PC */
213 {USB_VPI(0x1066, 0x0700, 0)},
214 /* Psion Teklogix Sync 753x */
215 {USB_VPI(0x1114, 0x0001, 0)},
216 /* Psion Teklogix Sync netBookPro */
217 {USB_VPI(0x1114, 0x0004, 0)},
218 /* Psion Teklogix Sync 7525 */
219 {USB_VPI(0x1114, 0x0006, 0)},
220 /* VES USB Sync */
221 {USB_VPI(0x1182, 0x1388, 0)},
222 /* Rugged Pocket PC 2003 */
223 {USB_VPI(0x11d9, 0x1002, 0)},
224 /* Rugged Pocket PC 2003 */
225 {USB_VPI(0x11d9, 0x1003, 0)},
226 /* USB Sync 03 */
227 {USB_VPI(0x1231, 0xce01, 0)},
228 /* USB Sync 03 */
229 {USB_VPI(0x1231, 0xce02, 0)},
230 /* Mio DigiWalker PPC StrongARM */
231 {USB_VPI(0x3340, 0x011c, 0)},
232 /* Mio DigiWalker 338 */
233 {USB_VPI(0x3340, 0x0326, 0)},
234 /* Mio DigiWalker 338 */
235 {USB_VPI(0x3340, 0x0426, 0)},
236 /* Mio DigiWalker USB Sync */
237 {USB_VPI(0x3340, 0x043a, 0)},
238 /* MiTAC USB Sync 528 */
239 {USB_VPI(0x3340, 0x051c, 0)},
240 /* Mio DigiWalker SmartPhone USB Sync */
241 {USB_VPI(0x3340, 0x053a, 0)},
242 /* MiTAC USB Sync */
243 {USB_VPI(0x3340, 0x071c, 0)},
244 /* Generic PPC StrongARM */
245 {USB_VPI(0x3340, 0x0b1c, 0)},
246 /* Generic PPC USB Sync */
247 {USB_VPI(0x3340, 0x0e3a, 0)},
248 /* Itautec USB Sync */
249 {USB_VPI(0x3340, 0x0f1c, 0)},
250 /* Generic SmartPhone USB Sync */
251 {USB_VPI(0x3340, 0x0f3a, 0)},
252 /* Itautec USB Sync */
253 {USB_VPI(0x3340, 0x1326, 0)},
254 /* YAKUMO USB Sync */
255 {USB_VPI(0x3340, 0x191c, 0)},
256 /* Vobis USB Sync */
257 {USB_VPI(0x3340, 0x2326, 0)},
258 /* MEDION Winodws Moble USB Sync */
259 {USB_VPI(0x3340, 0x3326, 0)},
260 /* Legend USB Sync */
261 {USB_VPI(0x3708, 0x20ce, 0)},
262 /* Lenovo USB Sync */
263 {USB_VPI(0x3708, 0x21ce, 0)},
264 /* Mobile Media Technology USB Sync */
265 {USB_VPI(0x4113, 0x0210, 0)},
266 /* Mobile Media Technology USB Sync */
267 {USB_VPI(0x4113, 0x0211, 0)},
268 /* Mobile Media Technology USB Sync */
269 {USB_VPI(0x4113, 0x0400, 0)},
270 /* Mobile Media Technology USB Sync */
271 {USB_VPI(0x4113, 0x0410, 0)},
272 /* Smartphone */
273 {USB_VPI(0x4505, 0x0010, 0)},
274 /* SAGEM Wireless Assistant */
275 {USB_VPI(0x5e04, 0xce00, 0)},
276 /* c10 Series */
277 {USB_VPI(USB_VENDOR_ACER, 0x1631, 0)},
278 /* c20 Series */
279 {USB_VPI(USB_VENDOR_ACER, 0x1632, 0)},
280 /* Acer n10 Handheld USB Sync */
281 {USB_VPI(USB_VENDOR_ACER, 0x16e1, 0)},
282 /* Acer n20 Handheld USB Sync */
283 {USB_VPI(USB_VENDOR_ACER, 0x16e2, 0)},
284 /* Acer n30 Handheld USB Sync */
285 {USB_VPI(USB_VENDOR_ACER, 0x16e3, 0)},
286 /* ASUS USB Sync */
287 {USB_VPI(USB_VENDOR_ASUS, 0x4200, 0)},
288 /* ASUS USB Sync */
289 {USB_VPI(USB_VENDOR_ASUS, 0x4201, 0)},
290 /* ASUS USB Sync */
291 {USB_VPI(USB_VENDOR_ASUS, 0x4202, 0)},
292 /* ASUS USB Sync */
293 {USB_VPI(USB_VENDOR_ASUS, 0x9200, 0)},
294 /* ASUS USB Sync */
295 {USB_VPI(USB_VENDOR_ASUS, 0x9202, 0)},
296 /**/
297 {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_P535, 0)},
298 /* CASIO USB Sync 2001 */
299 {USB_VPI(USB_VENDOR_CASIO, 0x2001, 0)},
300 /* CASIO USB Sync 2003 */
301 {USB_VPI(USB_VENDOR_CASIO, 0x2003, 0)},
302 /**/
303 {USB_VPI(USB_VENDOR_CASIO, USB_PRODUCT_CASIO_BE300, 0)},
304 /* MyGuide 7000 XL USB Sync */
305 {USB_VPI(USB_VENDOR_COMPAL, 0x0531, 0)},
306 /* Compaq iPAQ USB Sync */
307 {USB_VPI(USB_VENDOR_COMPAQ, 0x0032, 0)},
308 /**/
309 {USB_VPI(USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_IPAQPOCKETPC, 0)},
310 /* Dell Axim USB Sync */
311 {USB_VPI(USB_VENDOR_DELL, 0x4001, 0)},
312 /* Dell Axim USB Sync */
313 {USB_VPI(USB_VENDOR_DELL, 0x4002, 0)},
314 /* Dell Axim USB Sync */
315 {USB_VPI(USB_VENDOR_DELL, 0x4003, 0)},
316 /* Dell Axim USB Sync */
317 {USB_VPI(USB_VENDOR_DELL, 0x4004, 0)},
318 /* Dell Axim USB Sync */
319 {USB_VPI(USB_VENDOR_DELL, 0x4005, 0)},
320 /* Dell Axim USB Sync */
321 {USB_VPI(USB_VENDOR_DELL, 0x4006, 0)},
322 /* Dell Axim USB Sync */
323 {USB_VPI(USB_VENDOR_DELL, 0x4007, 0)},
324 /* Dell Axim USB Sync */
325 {USB_VPI(USB_VENDOR_DELL, 0x4008, 0)},
326 /* Dell Axim USB Sync */
327 {USB_VPI(USB_VENDOR_DELL, 0x4009, 0)},
328 /* Fujitsu Siemens Computers USB Sync */
329 {USB_VPI(USB_VENDOR_FSC, 0x1001, 0)},
330 /* FUJITSU USB Sync */
331 {USB_VPI(USB_VENDOR_FUJITSU, 0x1058, 0)},
332 /* FUJITSU USB Sync */
333 {USB_VPI(USB_VENDOR_FUJITSU, 0x1079, 0)},
334 /* Askey USB Sync */
335 {USB_VPI(USB_VENDOR_GIGASET, 0x0601, 0)},
336 /* Hitachi USB Sync */
337 {USB_VPI(USB_VENDOR_HITACHI, 0x0014, 0)},
338 /* HP USB Sync 1612 */
339 {USB_VPI(USB_VENDOR_HP, 0x1216, 0)},
340 /* HP USB Sync 1620 */
341 {USB_VPI(USB_VENDOR_HP, 0x2016, 0)},
342 /* HP USB Sync 1621 */
343 {USB_VPI(USB_VENDOR_HP, 0x2116, 0)},
344 /* HP USB Sync 1622 */
345 {USB_VPI(USB_VENDOR_HP, 0x2216, 0)},
346 /* HP USB Sync 1630 */
347 {USB_VPI(USB_VENDOR_HP, 0x3016, 0)},
348 /* HP USB Sync 1631 */
349 {USB_VPI(USB_VENDOR_HP, 0x3116, 0)},
350 /* HP USB Sync 1632 */
351 {USB_VPI(USB_VENDOR_HP, 0x3216, 0)},
352 /* HP USB Sync 1640 */
353 {USB_VPI(USB_VENDOR_HP, 0x4016, 0)},
354 /* HP USB Sync 1641 */
355 {USB_VPI(USB_VENDOR_HP, 0x4116, 0)},
356 /* HP USB Sync 1642 */
357 {USB_VPI(USB_VENDOR_HP, 0x4216, 0)},
358 /* HP USB Sync 1650 */
359 {USB_VPI(USB_VENDOR_HP, 0x5016, 0)},
360 /* HP USB Sync 1651 */
361 {USB_VPI(USB_VENDOR_HP, 0x5116, 0)},
362 /* HP USB Sync 1652 */
363 {USB_VPI(USB_VENDOR_HP, 0x5216, 0)},
364 /**/
365 {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_2215, 0)},
366 /**/
367 {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_568J, 0)},
368 /* HTC USB Modem */
369 {USB_VPI(USB_VENDOR_HTC, 0x00cf, 0)},
370 /* PocketPC USB Sync */
371 {USB_VPI(USB_VENDOR_HTC, 0x0a01, 0)},
372 /* PocketPC USB Sync */
373 {USB_VPI(USB_VENDOR_HTC, 0x0a02, 0)},
374 /* PocketPC USB Sync */
375 {USB_VPI(USB_VENDOR_HTC, 0x0a03, 0)},
376 /* PocketPC USB Sync */
377 {USB_VPI(USB_VENDOR_HTC, 0x0a04, 0)},
378 /* PocketPC USB Sync */
379 {USB_VPI(USB_VENDOR_HTC, 0x0a05, 0)},
380 /* PocketPC USB Sync */
381 {USB_VPI(USB_VENDOR_HTC, 0x0a06, 0)},
382 /* PocketPC USB Sync */
383 {USB_VPI(USB_VENDOR_HTC, 0x0a07, 0)},
384 /* PocketPC USB Sync */
385 {USB_VPI(USB_VENDOR_HTC, 0x0a08, 0)},
386 /* PocketPC USB Sync */
387 {USB_VPI(USB_VENDOR_HTC, 0x0a09, 0)},
388 /* PocketPC USB Sync */
389 {USB_VPI(USB_VENDOR_HTC, 0x0a0a, 0)},
390 /* PocketPC USB Sync */
391 {USB_VPI(USB_VENDOR_HTC, 0x0a0b, 0)},
392 /* PocketPC USB Sync */
393 {USB_VPI(USB_VENDOR_HTC, 0x0a0c, 0)},
394 /* PocketPC USB Sync */
395 {USB_VPI(USB_VENDOR_HTC, 0x0a0d, 0)},
396 /* PocketPC USB Sync */
397 {USB_VPI(USB_VENDOR_HTC, 0x0a0e, 0)},
398 /* PocketPC USB Sync */
399 {USB_VPI(USB_VENDOR_HTC, 0x0a0f, 0)},
400 /* PocketPC USB Sync */
401 {USB_VPI(USB_VENDOR_HTC, 0x0a10, 0)},
402 /* PocketPC USB Sync */
403 {USB_VPI(USB_VENDOR_HTC, 0x0a11, 0)},
404 /* PocketPC USB Sync */
405 {USB_VPI(USB_VENDOR_HTC, 0x0a12, 0)},
406 /* PocketPC USB Sync */
407 {USB_VPI(USB_VENDOR_HTC, 0x0a13, 0)},
408 /* PocketPC USB Sync */
409 {USB_VPI(USB_VENDOR_HTC, 0x0a14, 0)},
410 /* PocketPC USB Sync */
411 {USB_VPI(USB_VENDOR_HTC, 0x0a15, 0)},
412 /* PocketPC USB Sync */
413 {USB_VPI(USB_VENDOR_HTC, 0x0a16, 0)},
414 /* PocketPC USB Sync */
415 {USB_VPI(USB_VENDOR_HTC, 0x0a17, 0)},
416 /* PocketPC USB Sync */
417 {USB_VPI(USB_VENDOR_HTC, 0x0a18, 0)},
418 /* PocketPC USB Sync */
419 {USB_VPI(USB_VENDOR_HTC, 0x0a19, 0)},
420 /* PocketPC USB Sync */
421 {USB_VPI(USB_VENDOR_HTC, 0x0a1a, 0)},
422 /* PocketPC USB Sync */
423 {USB_VPI(USB_VENDOR_HTC, 0x0a1b, 0)},
424 /* PocketPC USB Sync */
425 {USB_VPI(USB_VENDOR_HTC, 0x0a1c, 0)},
426 /* PocketPC USB Sync */
427 {USB_VPI(USB_VENDOR_HTC, 0x0a1d, 0)},
428 /* PocketPC USB Sync */
429 {USB_VPI(USB_VENDOR_HTC, 0x0a1e, 0)},
430 /* PocketPC USB Sync */
431 {USB_VPI(USB_VENDOR_HTC, 0x0a1f, 0)},
432 /* PocketPC USB Sync */
433 {USB_VPI(USB_VENDOR_HTC, 0x0a20, 0)},
434 /* PocketPC USB Sync */
435 {USB_VPI(USB_VENDOR_HTC, 0x0a21, 0)},
436 /* PocketPC USB Sync */
437 {USB_VPI(USB_VENDOR_HTC, 0x0a22, 0)},
438 /* PocketPC USB Sync */
439 {USB_VPI(USB_VENDOR_HTC, 0x0a23, 0)},
440 /* PocketPC USB Sync */
441 {USB_VPI(USB_VENDOR_HTC, 0x0a24, 0)},
442 /* PocketPC USB Sync */
443 {USB_VPI(USB_VENDOR_HTC, 0x0a25, 0)},
444 /* PocketPC USB Sync */
445 {USB_VPI(USB_VENDOR_HTC, 0x0a26, 0)},
446 /* PocketPC USB Sync */
447 {USB_VPI(USB_VENDOR_HTC, 0x0a27, 0)},
448 /* PocketPC USB Sync */
449 {USB_VPI(USB_VENDOR_HTC, 0x0a28, 0)},
450 /* PocketPC USB Sync */
451 {USB_VPI(USB_VENDOR_HTC, 0x0a29, 0)},
452 /* PocketPC USB Sync */
453 {USB_VPI(USB_VENDOR_HTC, 0x0a2a, 0)},
454 /* PocketPC USB Sync */
455 {USB_VPI(USB_VENDOR_HTC, 0x0a2b, 0)},
456 /* PocketPC USB Sync */
457 {USB_VPI(USB_VENDOR_HTC, 0x0a2c, 0)},
458 /* PocketPC USB Sync */
459 {USB_VPI(USB_VENDOR_HTC, 0x0a2d, 0)},
460 /* PocketPC USB Sync */
461 {USB_VPI(USB_VENDOR_HTC, 0x0a2e, 0)},
462 /* PocketPC USB Sync */
463 {USB_VPI(USB_VENDOR_HTC, 0x0a2f, 0)},
464 /* PocketPC USB Sync */
465 {USB_VPI(USB_VENDOR_HTC, 0x0a30, 0)},
466 /* PocketPC USB Sync */
467 {USB_VPI(USB_VENDOR_HTC, 0x0a31, 0)},
468 /* PocketPC USB Sync */
469 {USB_VPI(USB_VENDOR_HTC, 0x0a32, 0)},
470 /* PocketPC USB Sync */
471 {USB_VPI(USB_VENDOR_HTC, 0x0a33, 0)},
472 /* PocketPC USB Sync */
473 {USB_VPI(USB_VENDOR_HTC, 0x0a34, 0)},
474 /* PocketPC USB Sync */
475 {USB_VPI(USB_VENDOR_HTC, 0x0a35, 0)},
476 /* PocketPC USB Sync */
477 {USB_VPI(USB_VENDOR_HTC, 0x0a36, 0)},
478 /* PocketPC USB Sync */
479 {USB_VPI(USB_VENDOR_HTC, 0x0a37, 0)},
480 /* PocketPC USB Sync */
481 {USB_VPI(USB_VENDOR_HTC, 0x0a38, 0)},
482 /* PocketPC USB Sync */
483 {USB_VPI(USB_VENDOR_HTC, 0x0a39, 0)},
484 /* PocketPC USB Sync */
485 {USB_VPI(USB_VENDOR_HTC, 0x0a3a, 0)},
486 /* PocketPC USB Sync */
487 {USB_VPI(USB_VENDOR_HTC, 0x0a3b, 0)},
488 /* PocketPC USB Sync */
489 {USB_VPI(USB_VENDOR_HTC, 0x0a3c, 0)},
490 /* PocketPC USB Sync */
491 {USB_VPI(USB_VENDOR_HTC, 0x0a3d, 0)},
492 /* PocketPC USB Sync */
493 {USB_VPI(USB_VENDOR_HTC, 0x0a3e, 0)},
494 /* PocketPC USB Sync */
495 {USB_VPI(USB_VENDOR_HTC, 0x0a3f, 0)},
496 /* PocketPC USB Sync */
497 {USB_VPI(USB_VENDOR_HTC, 0x0a40, 0)},
498 /* PocketPC USB Sync */
499 {USB_VPI(USB_VENDOR_HTC, 0x0a41, 0)},
500 /* PocketPC USB Sync */
501 {USB_VPI(USB_VENDOR_HTC, 0x0a42, 0)},
502 /* PocketPC USB Sync */
503 {USB_VPI(USB_VENDOR_HTC, 0x0a43, 0)},
504 /* PocketPC USB Sync */
505 {USB_VPI(USB_VENDOR_HTC, 0x0a44, 0)},
506 /* PocketPC USB Sync */
507 {USB_VPI(USB_VENDOR_HTC, 0x0a45, 0)},
508 /* PocketPC USB Sync */
509 {USB_VPI(USB_VENDOR_HTC, 0x0a46, 0)},
510 /* PocketPC USB Sync */
511 {USB_VPI(USB_VENDOR_HTC, 0x0a47, 0)},
512 /* PocketPC USB Sync */
513 {USB_VPI(USB_VENDOR_HTC, 0x0a48, 0)},
514 /* PocketPC USB Sync */
515 {USB_VPI(USB_VENDOR_HTC, 0x0a49, 0)},
516 /* PocketPC USB Sync */
517 {USB_VPI(USB_VENDOR_HTC, 0x0a4a, 0)},
518 /* PocketPC USB Sync */
519 {USB_VPI(USB_VENDOR_HTC, 0x0a4b, 0)},
520 /* PocketPC USB Sync */
521 {USB_VPI(USB_VENDOR_HTC, 0x0a4c, 0)},
522 /* PocketPC USB Sync */
523 {USB_VPI(USB_VENDOR_HTC, 0x0a4d, 0)},
524 /* PocketPC USB Sync */
525 {USB_VPI(USB_VENDOR_HTC, 0x0a4e, 0)},
526 /* PocketPC USB Sync */
527 {USB_VPI(USB_VENDOR_HTC, 0x0a4f, 0)},
528 /* HTC SmartPhone USB Sync */
529 {USB_VPI(USB_VENDOR_HTC, 0x0a50, 0)},
530 /* SmartPhone USB Sync */
531 {USB_VPI(USB_VENDOR_HTC, 0x0a52, 0)},
532 /* SmartPhone USB Sync */
533 {USB_VPI(USB_VENDOR_HTC, 0x0a53, 0)},
534 /* SmartPhone USB Sync */
535 {USB_VPI(USB_VENDOR_HTC, 0x0a54, 0)},
536 /* SmartPhone USB Sync */
537 {USB_VPI(USB_VENDOR_HTC, 0x0a55, 0)},
538 /* SmartPhone USB Sync */
539 {USB_VPI(USB_VENDOR_HTC, 0x0a56, 0)},
540 /* SmartPhone USB Sync */
541 {USB_VPI(USB_VENDOR_HTC, 0x0a57, 0)},
542 /* SmartPhone USB Sync */
543 {USB_VPI(USB_VENDOR_HTC, 0x0a58, 0)},
544 /* SmartPhone USB Sync */
545 {USB_VPI(USB_VENDOR_HTC, 0x0a59, 0)},
546 /* SmartPhone USB Sync */
547 {USB_VPI(USB_VENDOR_HTC, 0x0a5a, 0)},
548 /* SmartPhone USB Sync */
549 {USB_VPI(USB_VENDOR_HTC, 0x0a5b, 0)},
550 /* SmartPhone USB Sync */
551 {USB_VPI(USB_VENDOR_HTC, 0x0a5c, 0)},
552 /* SmartPhone USB Sync */
553 {USB_VPI(USB_VENDOR_HTC, 0x0a5d, 0)},
554 /* SmartPhone USB Sync */
555 {USB_VPI(USB_VENDOR_HTC, 0x0a5e, 0)},
556 /* SmartPhone USB Sync */
557 {USB_VPI(USB_VENDOR_HTC, 0x0a5f, 0)},
558 /* SmartPhone USB Sync */
559 {USB_VPI(USB_VENDOR_HTC, 0x0a60, 0)},
560 /* SmartPhone USB Sync */
561 {USB_VPI(USB_VENDOR_HTC, 0x0a61, 0)},
562 /* SmartPhone USB Sync */
563 {USB_VPI(USB_VENDOR_HTC, 0x0a62, 0)},
564 /* SmartPhone USB Sync */
565 {USB_VPI(USB_VENDOR_HTC, 0x0a63, 0)},
566 /* SmartPhone USB Sync */
567 {USB_VPI(USB_VENDOR_HTC, 0x0a64, 0)},
568 /* SmartPhone USB Sync */
569 {USB_VPI(USB_VENDOR_HTC, 0x0a65, 0)},
570 /* SmartPhone USB Sync */
571 {USB_VPI(USB_VENDOR_HTC, 0x0a66, 0)},
572 /* SmartPhone USB Sync */
573 {USB_VPI(USB_VENDOR_HTC, 0x0a67, 0)},
574 /* SmartPhone USB Sync */
575 {USB_VPI(USB_VENDOR_HTC, 0x0a68, 0)},
576 /* SmartPhone USB Sync */
577 {USB_VPI(USB_VENDOR_HTC, 0x0a69, 0)},
578 /* SmartPhone USB Sync */
579 {USB_VPI(USB_VENDOR_HTC, 0x0a6a, 0)},
580 /* SmartPhone USB Sync */
581 {USB_VPI(USB_VENDOR_HTC, 0x0a6b, 0)},
582 /* SmartPhone USB Sync */
583 {USB_VPI(USB_VENDOR_HTC, 0x0a6c, 0)},
584 /* SmartPhone USB Sync */
585 {USB_VPI(USB_VENDOR_HTC, 0x0a6d, 0)},
586 /* SmartPhone USB Sync */
587 {USB_VPI(USB_VENDOR_HTC, 0x0a6e, 0)},
588 /* SmartPhone USB Sync */
589 {USB_VPI(USB_VENDOR_HTC, 0x0a6f, 0)},
590 /* SmartPhone USB Sync */
591 {USB_VPI(USB_VENDOR_HTC, 0x0a70, 0)},
592 /* SmartPhone USB Sync */
593 {USB_VPI(USB_VENDOR_HTC, 0x0a71, 0)},
594 /* SmartPhone USB Sync */
595 {USB_VPI(USB_VENDOR_HTC, 0x0a72, 0)},
596 /* SmartPhone USB Sync */
597 {USB_VPI(USB_VENDOR_HTC, 0x0a73, 0)},
598 /* SmartPhone USB Sync */
599 {USB_VPI(USB_VENDOR_HTC, 0x0a74, 0)},
600 /* SmartPhone USB Sync */
601 {USB_VPI(USB_VENDOR_HTC, 0x0a75, 0)},
602 /* SmartPhone USB Sync */
603 {USB_VPI(USB_VENDOR_HTC, 0x0a76, 0)},
604 /* SmartPhone USB Sync */
605 {USB_VPI(USB_VENDOR_HTC, 0x0a77, 0)},
606 /* SmartPhone USB Sync */
607 {USB_VPI(USB_VENDOR_HTC, 0x0a78, 0)},
608 /* SmartPhone USB Sync */
609 {USB_VPI(USB_VENDOR_HTC, 0x0a79, 0)},
610 /* SmartPhone USB Sync */
611 {USB_VPI(USB_VENDOR_HTC, 0x0a7a, 0)},
612 /* SmartPhone USB Sync */
613 {USB_VPI(USB_VENDOR_HTC, 0x0a7b, 0)},
614 /* SmartPhone USB Sync */
615 {USB_VPI(USB_VENDOR_HTC, 0x0a7c, 0)},
616 /* SmartPhone USB Sync */
617 {USB_VPI(USB_VENDOR_HTC, 0x0a7d, 0)},
618 /* SmartPhone USB Sync */
619 {USB_VPI(USB_VENDOR_HTC, 0x0a7e, 0)},
620 /* SmartPhone USB Sync */
621 {USB_VPI(USB_VENDOR_HTC, 0x0a7f, 0)},
622 /* SmartPhone USB Sync */
623 {USB_VPI(USB_VENDOR_HTC, 0x0a80, 0)},
624 /* SmartPhone USB Sync */
625 {USB_VPI(USB_VENDOR_HTC, 0x0a81, 0)},
626 /* SmartPhone USB Sync */
627 {USB_VPI(USB_VENDOR_HTC, 0x0a82, 0)},
628 /* SmartPhone USB Sync */
629 {USB_VPI(USB_VENDOR_HTC, 0x0a83, 0)},
630 /* SmartPhone USB Sync */
631 {USB_VPI(USB_VENDOR_HTC, 0x0a84, 0)},
632 /* SmartPhone USB Sync */
633 {USB_VPI(USB_VENDOR_HTC, 0x0a85, 0)},
634 /* SmartPhone USB Sync */
635 {USB_VPI(USB_VENDOR_HTC, 0x0a86, 0)},
636 /* SmartPhone USB Sync */
637 {USB_VPI(USB_VENDOR_HTC, 0x0a87, 0)},
638 /* SmartPhone USB Sync */
639 {USB_VPI(USB_VENDOR_HTC, 0x0a88, 0)},
640 /* SmartPhone USB Sync */
641 {USB_VPI(USB_VENDOR_HTC, 0x0a89, 0)},
642 /* SmartPhone USB Sync */
643 {USB_VPI(USB_VENDOR_HTC, 0x0a8a, 0)},
644 /* SmartPhone USB Sync */
645 {USB_VPI(USB_VENDOR_HTC, 0x0a8b, 0)},
646 /* SmartPhone USB Sync */
647 {USB_VPI(USB_VENDOR_HTC, 0x0a8c, 0)},
648 /* SmartPhone USB Sync */
649 {USB_VPI(USB_VENDOR_HTC, 0x0a8d, 0)},
650 /* SmartPhone USB Sync */
651 {USB_VPI(USB_VENDOR_HTC, 0x0a8e, 0)},
652 /* SmartPhone USB Sync */
653 {USB_VPI(USB_VENDOR_HTC, 0x0a8f, 0)},
654 /* SmartPhone USB Sync */
655 {USB_VPI(USB_VENDOR_HTC, 0x0a90, 0)},
656 /* SmartPhone USB Sync */
657 {USB_VPI(USB_VENDOR_HTC, 0x0a91, 0)},
658 /* SmartPhone USB Sync */
659 {USB_VPI(USB_VENDOR_HTC, 0x0a92, 0)},
660 /* SmartPhone USB Sync */
661 {USB_VPI(USB_VENDOR_HTC, 0x0a93, 0)},
662 /* SmartPhone USB Sync */
663 {USB_VPI(USB_VENDOR_HTC, 0x0a94, 0)},
664 /* SmartPhone USB Sync */
665 {USB_VPI(USB_VENDOR_HTC, 0x0a95, 0)},
666 /* SmartPhone USB Sync */
667 {USB_VPI(USB_VENDOR_HTC, 0x0a96, 0)},
668 /* SmartPhone USB Sync */
669 {USB_VPI(USB_VENDOR_HTC, 0x0a97, 0)},
670 /* SmartPhone USB Sync */
671 {USB_VPI(USB_VENDOR_HTC, 0x0a98, 0)},
672 /* SmartPhone USB Sync */
673 {USB_VPI(USB_VENDOR_HTC, 0x0a99, 0)},
674 /* SmartPhone USB Sync */
675 {USB_VPI(USB_VENDOR_HTC, 0x0a9a, 0)},
676 /* SmartPhone USB Sync */
677 {USB_VPI(USB_VENDOR_HTC, 0x0a9b, 0)},
678 /* SmartPhone USB Sync */
679 {USB_VPI(USB_VENDOR_HTC, 0x0a9c, 0)},
680 /* SmartPhone USB Sync */
681 {USB_VPI(USB_VENDOR_HTC, 0x0a9d, 0)},
682 /* SmartPhone USB Sync */
683 {USB_VPI(USB_VENDOR_HTC, 0x0a9e, 0)},
684 /* SmartPhone USB Sync */
685 {USB_VPI(USB_VENDOR_HTC, 0x0a9f, 0)},
686 /**/
687 {USB_VPI(USB_VENDOR_HTC, USB_PRODUCT_HTC_PPC6700MODEM, 0)},
688 /**/
689 {USB_VPI(USB_VENDOR_HTC, USB_PRODUCT_HTC_SMARTPHONE, 0)},
690 /**/
691 {USB_VPI(USB_VENDOR_HTC, USB_PRODUCT_HTC_WINMOBILE, 0)},
692 /* High Tech Computer Wizard Smartphone */
693 {USB_VPI(USB_VENDOR_HTC, USB_PRODUCT_HTC_WIZARD, 0)},
694 /* JVC USB Sync */
695 {USB_VPI(USB_VENDOR_JVC, 0x3011, 0)},
696 /* JVC USB Sync */
697 {USB_VPI(USB_VENDOR_JVC, 0x3012, 0)},
698 /* LGE USB Sync */
699 {USB_VPI(USB_VENDOR_LG, 0x9c01, 0)},
700 /* Microsoft USB Sync */
701 {USB_VPI(USB_VENDOR_MICROSOFT, 0x00ce, 0)},
702 /* Windows Pocket PC 2002 */
703 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0400, 0)},
704 /* Windows Pocket PC 2002 */
705 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0401, 0)},
706 /* Windows Pocket PC 2002 */
707 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0402, 0)},
708 /* Windows Pocket PC 2002 */
709 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0403, 0)},
710 /* Windows Pocket PC 2002 */
711 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0404, 0)},
712 /* Windows Pocket PC 2002 */
713 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0405, 0)},
714 /* Windows Pocket PC 2002 */
715 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0406, 0)},
716 /* Windows Pocket PC 2002 */
717 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0407, 0)},
718 /* Windows Pocket PC 2002 */
719 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0408, 0)},
720 /* Windows Pocket PC 2002 */
721 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0409, 0)},
722 /* Windows Pocket PC 2002 */
723 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040a, 0)},
724 /* Windows Pocket PC 2002 */
725 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040b, 0)},
726 /* Windows Pocket PC 2002 */
727 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040c, 0)},
728 /* Windows Pocket PC 2002 */
729 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040d, 0)},
730 /* Windows Pocket PC 2002 */
731 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040e, 0)},
732 /* Windows Pocket PC 2002 */
733 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040f, 0)},
734 /* Windows Pocket PC 2002 */
735 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0410, 0)},
736 /* Windows Pocket PC 2002 */
737 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0411, 0)},
738 /* Windows Pocket PC 2002 */
739 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0412, 0)},
740 /* Windows Pocket PC 2002 */
741 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0413, 0)},
742 /* Windows Pocket PC 2002 */
743 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0414, 0)},
744 /* Windows Pocket PC 2002 */
745 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0415, 0)},
746 /* Windows Pocket PC 2002 */
747 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0416, 0)},
748 /* Windows Pocket PC 2002 */
749 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0417, 0)},
750 /* Windows Pocket PC 2003 */
751 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0432, 0)},
752 /* Windows Pocket PC 2003 */
753 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0433, 0)},
754 /* Windows Pocket PC 2003 */
755 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0434, 0)},
756 /* Windows Pocket PC 2003 */
757 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0435, 0)},
758 /* Windows Pocket PC 2003 */
759 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0436, 0)},
760 /* Windows Pocket PC 2003 */
761 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0437, 0)},
762 /* Windows Pocket PC 2003 */
763 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0438, 0)},
764 /* Windows Pocket PC 2003 */
765 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0439, 0)},
766 /* Windows Pocket PC 2003 */
767 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043a, 0)},
768 /* Windows Pocket PC 2003 */
769 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043b, 0)},
770 /* Windows Pocket PC 2003 */
771 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043c, 0)},
772 /* Windows Pocket PC 2003 */
773 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043d, 0)},
774 /* Windows Pocket PC 2003 */
775 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043e, 0)},
776 /* Windows Pocket PC 2003 */
777 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043f, 0)},
778 /* Windows Pocket PC 2003 */
779 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0440, 0)},
780 /* Windows Pocket PC 2003 */
781 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0441, 0)},
782 /* Windows Pocket PC 2003 */
783 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0442, 0)},
784 /* Windows Pocket PC 2003 */
785 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0443, 0)},
786 /* Windows Pocket PC 2003 */
787 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0444, 0)},
788 /* Windows Pocket PC 2003 */
789 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0445, 0)},
790 /* Windows Pocket PC 2003 */
791 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0446, 0)},
792 /* Windows Pocket PC 2003 */
793 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0447, 0)},
794 /* Windows Pocket PC 2003 */
795 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0448, 0)},
796 /* Windows Pocket PC 2003 */
797 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0449, 0)},
798 /* Windows Pocket PC 2003 */
799 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044a, 0)},
800 /* Windows Pocket PC 2003 */
801 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044b, 0)},
802 /* Windows Pocket PC 2003 */
803 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044c, 0)},
804 /* Windows Pocket PC 2003 */
805 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044d, 0)},
806 /* Windows Pocket PC 2003 */
807 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044e, 0)},
808 /* Windows Pocket PC 2003 */
809 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044f, 0)},
810 /* Windows Pocket PC 2003 */
811 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0450, 0)},
812 /* Windows Pocket PC 2003 */
813 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0451, 0)},
814 /* Windows Pocket PC 2003 */
815 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0452, 0)},
816 /* Windows Pocket PC 2003 */
817 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0453, 0)},
818 /* Windows Pocket PC 2003 */
819 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0454, 0)},
820 /* Windows Pocket PC 2003 */
821 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0455, 0)},
822 /* Windows Pocket PC 2003 */
823 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0456, 0)},
824 /* Windows Pocket PC 2003 */
825 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0457, 0)},
826 /* Windows Pocket PC 2003 */
827 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0458, 0)},
828 /* Windows Pocket PC 2003 */
829 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0459, 0)},
830 /* Windows Pocket PC 2003 */
831 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045a, 0)},
832 /* Windows Pocket PC 2003 */
833 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045b, 0)},
834 /* Windows Pocket PC 2003 */
835 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045c, 0)},
836 /* Windows Pocket PC 2003 */
837 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045d, 0)},
838 /* Windows Pocket PC 2003 */
839 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045e, 0)},
840 /* Windows Pocket PC 2003 */
841 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045f, 0)},
842 /* Windows Pocket PC 2003 */
843 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0460, 0)},
844 /* Windows Pocket PC 2003 */
845 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0461, 0)},
846 /* Windows Pocket PC 2003 */
847 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0462, 0)},
848 /* Windows Pocket PC 2003 */
849 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0463, 0)},
850 /* Windows Pocket PC 2003 */
851 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0464, 0)},
852 /* Windows Pocket PC 2003 */
853 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0465, 0)},
854 /* Windows Pocket PC 2003 */
855 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0466, 0)},
856 /* Windows Pocket PC 2003 */
857 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0467, 0)},
858 /* Windows Pocket PC 2003 */
859 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0468, 0)},
860 /* Windows Pocket PC 2003 */
861 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0469, 0)},
862 /* Windows Pocket PC 2003 */
863 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046a, 0)},
864 /* Windows Pocket PC 2003 */
865 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046b, 0)},
866 /* Windows Pocket PC 2003 */
867 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046c, 0)},
868 /* Windows Pocket PC 2003 */
869 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046d, 0)},
870 /* Windows Pocket PC 2003 */
871 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046e, 0)},
872 /* Windows Pocket PC 2003 */
873 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046f, 0)},
874 /* Windows Pocket PC 2003 */
875 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0470, 0)},
876 /* Windows Pocket PC 2003 */
877 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0471, 0)},
878 /* Windows Pocket PC 2003 */
879 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0472, 0)},
880 /* Windows Pocket PC 2003 */
881 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0473, 0)},
882 /* Windows Pocket PC 2003 */
883 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0474, 0)},
884 /* Windows Pocket PC 2003 */
885 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0475, 0)},
886 /* Windows Pocket PC 2003 */
887 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0476, 0)},
888 /* Windows Pocket PC 2003 */
889 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0477, 0)},
890 /* Windows Pocket PC 2003 */
891 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0478, 0)},
892 /* Windows Pocket PC 2003 */
893 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0479, 0)},
894 /* Windows Pocket PC 2003 */
895 {USB_VPI(USB_VENDOR_MICROSOFT, 0x047a, 0)},
896 /* Windows Pocket PC 2003 */
897 {USB_VPI(USB_VENDOR_MICROSOFT, 0x047b, 0)},
898 /* Windows Smartphone 2002 */
899 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04c8, 0)},
900 /* Windows Smartphone 2002 */
901 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04c9, 0)},
902 /* Windows Smartphone 2002 */
903 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04ca, 0)},
904 /* Windows Smartphone 2002 */
905 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04cb, 0)},
906 /* Windows Smartphone 2002 */
907 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04cc, 0)},
908 /* Windows Smartphone 2002 */
909 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04cd, 0)},
910 /* Windows Smartphone 2002 */
911 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04ce, 0)},
912 /* Windows Smartphone 2003 */
913 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04d7, 0)},
914 /* Windows Smartphone 2003 */
915 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04d8, 0)},
916 /* Windows Smartphone 2003 */
917 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04d9, 0)},
918 /* Windows Smartphone 2003 */
919 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04da, 0)},
920 /* Windows Smartphone 2003 */
921 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04db, 0)},
922 /* Windows Smartphone 2003 */
923 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04dc, 0)},
924 /* Windows Smartphone 2003 */
925 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04dd, 0)},
926 /* Windows Smartphone 2003 */
927 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04de, 0)},
928 /* Windows Smartphone 2003 */
929 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04df, 0)},
930 /* Windows Smartphone 2003 */
931 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e0, 0)},
932 /* Windows Smartphone 2003 */
933 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e1, 0)},
934 /* Windows Smartphone 2003 */
935 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e2, 0)},
936 /* Windows Smartphone 2003 */
937 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e3, 0)},
938 /* Windows Smartphone 2003 */
939 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e4, 0)},
940 /* Windows Smartphone 2003 */
941 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e5, 0)},
942 /* Windows Smartphone 2003 */
943 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e6, 0)},
944 /* Windows Smartphone 2003 */
945 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e7, 0)},
946 /* Windows Smartphone 2003 */
947 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e8, 0)},
948 /* Windows Smartphone 2003 */
949 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e9, 0)},
950 /* Windows Smartphone 2003 */
951 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04ea, 0)},
952 /* Motorola MPx200 Smartphone */
953 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4204, 0)},
954 /* Motorola MPc GSM */
955 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4214, 0)},
956 /* Motorola MPx220 Smartphone */
957 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4224, 0)},
958 /* Motorola MPc CDMA */
959 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4234, 0)},
960 /* Motorola MPx100 Smartphone */
961 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4244, 0)},
962 /* NEC USB Sync */
963 {USB_VPI(USB_VENDOR_NEC, 0x00d5, 0)},
964 /* NEC USB Sync */
965 {USB_VPI(USB_VENDOR_NEC, 0x00d6, 0)},
966 /* NEC USB Sync */
967 {USB_VPI(USB_VENDOR_NEC, 0x00d7, 0)},
968 /* NEC USB Sync */
969 {USB_VPI(USB_VENDOR_NEC, 0x8024, 0)},
970 /* NEC USB Sync */
971 {USB_VPI(USB_VENDOR_NEC, 0x8025, 0)},
972 /* Panasonic USB Sync */
973 {USB_VPI(USB_VENDOR_PANASONIC, 0x2500, 0)},
974 /* Samsung NEXiO USB Sync */
975 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f00, 0)},
976 /* Samsung NEXiO USB Sync */
977 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f01, 0)},
978 /* Samsung NEXiO USB Sync */
979 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f02, 0)},
980 /* Samsung NEXiO USB Sync */
981 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f03, 0)},
982 /* Samsung NEXiO USB Sync */
983 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f04, 0)},
984 /* Samsung MITs USB Sync */
985 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6611, 0)},
986 /* Samsung MITs USB Sync */
987 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6613, 0)},
988 /* Samsung MITs USB Sync */
989 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6615, 0)},
990 /* Samsung MITs USB Sync */
991 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6617, 0)},
992 /* Samsung MITs USB Sync */
993 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6619, 0)},
994 /* Samsung MITs USB Sync */
995 {USB_VPI(USB_VENDOR_SAMSUNG, 0x661b, 0)},
996 /* Samsung MITs USB Sync */
997 {USB_VPI(USB_VENDOR_SAMSUNG, 0x662e, 0)},
998 /* Samsung MITs USB Sync */
999 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6630, 0)},
1000 /* Samsung MITs USB Sync */
1001 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6632, 0)},
1002 /* SHARP WS003SH USB Modem */
1003 {USB_VPI(USB_VENDOR_SHARP, 0x9102, 0)},
1004 /* SHARP WS004SH USB Modem */
1005 {USB_VPI(USB_VENDOR_SHARP, 0x9121, 0)},
1006 /* SHARP S01SH USB Modem */
1007 {USB_VPI(USB_VENDOR_SHARP, 0x9151, 0)},
1008 /**/
1009 {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WZERO3ES, 0)},
1010 /**/
1011 {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WZERO3ADES, 0)},
1012 /**/
1013 {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WILLCOM03, 0)},
1014 /* Symbol USB Sync */
1015 {USB_VPI(USB_VENDOR_SYMBOL, 0x2000, 0)},
1016 /* Symbol USB Sync 0x2001 */
1017 {USB_VPI(USB_VENDOR_SYMBOL, 0x2001, 0)},
1018 /* Symbol USB Sync 0x2002 */
1019 {USB_VPI(USB_VENDOR_SYMBOL, 0x2002, 0)},
1020 /* Symbol USB Sync 0x2003 */
1021 {USB_VPI(USB_VENDOR_SYMBOL, 0x2003, 0)},
1022 /* Symbol USB Sync 0x2004 */
1023 {USB_VPI(USB_VENDOR_SYMBOL, 0x2004, 0)},
1024 /* Symbol USB Sync 0x2005 */
1025 {USB_VPI(USB_VENDOR_SYMBOL, 0x2005, 0)},
1026 /* Symbol USB Sync 0x2006 */
1027 {USB_VPI(USB_VENDOR_SYMBOL, 0x2006, 0)},
1028 /* Symbol USB Sync 0x2007 */
1029 {USB_VPI(USB_VENDOR_SYMBOL, 0x2007, 0)},
1030 /* Symbol USB Sync 0x2008 */
1031 {USB_VPI(USB_VENDOR_SYMBOL, 0x2008, 0)},
1032 /* Symbol USB Sync 0x2009 */
1033 {USB_VPI(USB_VENDOR_SYMBOL, 0x2009, 0)},
1034 /* Symbol USB Sync 0x200a */
1035 {USB_VPI(USB_VENDOR_SYMBOL, 0x200a, 0)},
1036 /* TOSHIBA USB Sync 0700 */
1037 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0700, 0)},
1038 /* TOSHIBA Pocket PC e310 */
1039 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0705, 0)},
1040 /* TOSHIBA Pocket PC e330 Series */
1041 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0707, 0)},
1042 /* TOSHIBA Pocket PC e350Series */
1043 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0708, 0)},
1044 /* TOSHIBA Pocket PC e750 Series */
1045 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0709, 0)},
1046 /* TOSHIBA Pocket PC e400 Series */
1047 {USB_VPI(USB_VENDOR_TOSHIBA, 0x070a, 0)},
1048 /* TOSHIBA Pocket PC e800 Series */
1049 {USB_VPI(USB_VENDOR_TOSHIBA, 0x070b, 0)},
1050 /* TOSHIBA Pocket PC e740 */
1051 {USB_VPI(USB_VENDOR_TOSHIBA, USB_PRODUCT_TOSHIBA_POCKETPC_E740, 0)},
1052 /* ViewSonic Color Pocket PC V35 */
1053 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x0ed9, 0)},
1054 /* ViewSonic Color Pocket PC V36 */
1055 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1527, 0)},
1056 /* ViewSonic Color Pocket PC V37 */
1057 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1529, 0)},
1058 /* ViewSonic Color Pocket PC V38 */
1059 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x152b, 0)},
1060 /* ViewSonic Pocket PC */
1061 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x152e, 0)},
1062 /* ViewSonic Communicator Pocket PC */
1063 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1921, 0)},
1064 /* ViewSonic Smartphone */
1065 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1922, 0)},
1066 /* ViewSonic Pocket PC V30 */
1067 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1923, 0)},
1068};
1069
1070static device_method_t uipaq_methods[] = {
1071 DEVMETHOD(device_probe, uipaq_probe),
1072 DEVMETHOD(device_attach, uipaq_attach),
1073 DEVMETHOD(device_detach, uipaq_detach),
1074 {0, 0}
1075};
1076
1077static devclass_t uipaq_devclass;
1078
1079static driver_t uipaq_driver = {
1080 .name = "uipaq",
1081 .methods = uipaq_methods,
1082 .size = sizeof(struct uipaq_softc),
1083};
1084
1085DRIVER_MODULE(uipaq, uhub, uipaq_driver, uipaq_devclass, NULL, 0);
1086MODULE_DEPEND(uipaq, ucom, 1, 1, 1);
1087MODULE_DEPEND(uipaq, usb, 1, 1, 1);
1088
1089static int
1090uipaq_probe(device_t dev)
1091{
1092 struct usb_attach_arg *uaa = device_get_ivars(dev);
1093
1094 if (uaa->usb_mode != USB_MODE_HOST) {
1095 return (ENXIO);
1096 }
1097 if (uaa->info.bConfigIndex != UIPAQ_CONFIG_INDEX) {
1098 return (ENXIO);
1099 }
1100 if (uaa->info.bIfaceIndex != UIPAQ_IFACE_INDEX) {
1101 return (ENXIO);
1102 }
1103 if (uaa->info.bInterfaceClass == UICLASS_IAD) {
1104 DPRINTF("IAD detected - not UIPAQ serial device\n");
1105 return (ENXIO);
1106 }
1107 return (usbd_lookup_id_by_uaa(uipaq_devs, sizeof(uipaq_devs), uaa));
1108}
1109
1110static int
1111uipaq_attach(device_t dev)
1112{
1113 struct usb_device_request req;
1114 struct usb_attach_arg *uaa = device_get_ivars(dev);
1115 struct uipaq_softc *sc = device_get_softc(dev);
1116 int error;
1117 uint8_t iface_index;
1118 uint8_t i;
1119
1120 sc->sc_udev = uaa->device;
1121
1122 device_set_usb_desc(dev);
1123 mtx_init(&sc->sc_mtx, "uipaq", NULL, MTX_DEF);
1124
1125 /*
1126 * Send magic bytes, cribbed from Linux ipaq driver that
1127 * claims to have sniffed them from Win98. Wait for driver to
1128 * become ready on device side?
1129 */
1130 req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
1131 req.bRequest = UCDC_SET_CONTROL_LINE_STATE;
1132 USETW(req.wValue, UCDC_LINE_DTR);
1133 USETW(req.wIndex, 0x0);
1134 USETW(req.wLength, 0);
1135 for (i = 0; i != 64; i++) {
1136 error =
1137 usbd_do_request_flags(uaa->device, NULL, &req,
1138 NULL, 0, NULL, 100);
1139 if (error == 0)
1140 break;
1141 usb_pause_mtx(NULL, hz / 10);
1142 }
1143
1144 iface_index = UIPAQ_IFACE_INDEX;
1145 error = usbd_transfer_setup(uaa->device, &iface_index,
1146 sc->sc_xfer, uipaq_config_data,
1147 UIPAQ_N_TRANSFER, sc, &sc->sc_mtx);
1148
1149 if (error) {
1150 goto detach;
1151 }
1152 /* clear stall at first run */
1153 mtx_lock(&sc->sc_mtx);
1154 usbd_xfer_set_stall(sc->sc_xfer[UIPAQ_BULK_DT_WR]);
1155 usbd_xfer_set_stall(sc->sc_xfer[UIPAQ_BULK_DT_RD]);
1156 mtx_unlock(&sc->sc_mtx);
1157
1158 error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc,
1159 &uipaq_callback, &sc->sc_mtx);
1160 if (error) {
1161 goto detach;
1162 }
1163 return (0);
1164
1165detach:
1166 uipaq_detach(dev);
1167 return (ENXIO);
1168}
1169
1170int
1171uipaq_detach(device_t dev)
1172{
1173 struct uipaq_softc *sc = device_get_softc(dev);
1174
1175 ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
1176 usbd_transfer_unsetup(sc->sc_xfer, UIPAQ_N_TRANSFER);
1177 mtx_destroy(&sc->sc_mtx);
1178
1179 return (0);
1180}
1181
1182static void
1183uipaq_start_read(struct ucom_softc *ucom)
1184{
1185 struct uipaq_softc *sc = ucom->sc_parent;
1186
1187 /* start read endpoint */
1188 usbd_transfer_start(sc->sc_xfer[UIPAQ_BULK_DT_RD]);
1189}
1190
1191static void
1192uipaq_stop_read(struct ucom_softc *ucom)
1193{
1194 struct uipaq_softc *sc = ucom->sc_parent;
1195
1196 /* stop read endpoint */
1197 usbd_transfer_stop(sc->sc_xfer[UIPAQ_BULK_DT_RD]);
1198}
1199
1200static void
1201uipaq_start_write(struct ucom_softc *ucom)
1202{
1203 struct uipaq_softc *sc = ucom->sc_parent;
1204
1205 usbd_transfer_start(sc->sc_xfer[UIPAQ_BULK_DT_WR]);
1206}
1207
1208static void
1209uipaq_stop_write(struct ucom_softc *ucom)
1210{
1211 struct uipaq_softc *sc = ucom->sc_parent;
1212
1213 usbd_transfer_stop(sc->sc_xfer[UIPAQ_BULK_DT_WR]);
1214}
1215
1216static void
1217uipaq_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
1218{
1219 struct uipaq_softc *sc = ucom->sc_parent;
1220 struct usb_device_request req;
1221
1222 DPRINTF("onoff=%d\n", onoff);
1223
1224 if (onoff)
1225 sc->sc_line |= UCDC_LINE_DTR;
1226 else
1227 sc->sc_line &= ~UCDC_LINE_DTR;
1228
1229 req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
1230 req.bRequest = UCDC_SET_CONTROL_LINE_STATE;
1231 USETW(req.wValue, sc->sc_line);
1232 req.wIndex[0] = UIPAQ_IFACE_INDEX;
1233 req.wIndex[1] = 0;
1234 USETW(req.wLength, 0);
1235
1236 ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
1237 &req, NULL, 0, 1000);
1238}
1239
1240static void
1241uipaq_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
1242{
1243 struct uipaq_softc *sc = ucom->sc_parent;
1244 struct usb_device_request req;
1245
1246 DPRINTF("onoff=%d\n", onoff);
1247
1248 if (onoff)
1249 sc->sc_line |= UCDC_LINE_RTS;
1250 else
1251 sc->sc_line &= ~UCDC_LINE_RTS;
1252
1253 req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
1254 req.bRequest = UCDC_SET_CONTROL_LINE_STATE;
1255 USETW(req.wValue, sc->sc_line);
1256 req.wIndex[0] = UIPAQ_IFACE_INDEX;
1257 req.wIndex[1] = 0;
1258 USETW(req.wLength, 0);
1259
1260 ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
1261 &req, NULL, 0, 1000);
1262}
1263
1264static void
1265uipaq_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
1266{
1267 struct uipaq_softc *sc = ucom->sc_parent;
1268 struct usb_device_request req;
1269 uint16_t temp;
1270
1271 temp = onoff ? UCDC_BREAK_ON : UCDC_BREAK_OFF;
1272
1273 req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
1274 req.bRequest = UCDC_SEND_BREAK;
1275 USETW(req.wValue, temp);
1276 req.wIndex[0] = UIPAQ_IFACE_INDEX;
1277 req.wIndex[1] = 0;
1278 USETW(req.wLength, 0);
1279
1280 ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
1281 &req, NULL, 0, 1000);
1282}
1283
1284static void
1285uipaq_write_callback(struct usb_xfer *xfer, usb_error_t error)
1286{
1287 struct uipaq_softc *sc = usbd_xfer_softc(xfer);
1288 struct usb_page_cache *pc;
1289 uint32_t actlen;
1290
1291 switch (USB_GET_STATE(xfer)) {
1292 case USB_ST_SETUP:
1293 case USB_ST_TRANSFERRED:
1294tr_setup:
1295 pc = usbd_xfer_get_frame(xfer, 0);
1296 if (ucom_get_data(&sc->sc_ucom, pc, 0,
1297 UIPAQ_BUF_SIZE, &actlen)) {
1298 usbd_xfer_set_frame_len(xfer, 0, actlen);
1299 usbd_transfer_submit(xfer);
1300 }
1301 return;
1302
1303 default: /* Error */
1304 if (error != USB_ERR_CANCELLED) {
1305 /* try to clear stall first */
1306 usbd_xfer_set_stall(xfer);
1307 goto tr_setup;
1308 }
1309 return;
1310 }
1311}
1312
1313static void
1314uipaq_read_callback(struct usb_xfer *xfer, usb_error_t error)
1315{
1316 struct uipaq_softc *sc = usbd_xfer_softc(xfer);
1317 struct usb_page_cache *pc;
1318 int actlen;
1319
1320 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
1321
1322 switch (USB_GET_STATE(xfer)) {
1323 case USB_ST_TRANSFERRED:
1324 pc = usbd_xfer_get_frame(xfer, 0);
1325 ucom_put_data(&sc->sc_ucom, pc, 0, actlen);
1326
1327 case USB_ST_SETUP:
1328tr_setup:
1329 usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
1330 usbd_transfer_submit(xfer);
1331 return;
1332
1333 default: /* Error */
1334 if (error != USB_ERR_CANCELLED) {
1335 /* try to clear stall first */
1336 usbd_xfer_set_stall(xfer);
1337 goto tr_setup;
1338 }
1339 return;
1340 }
1341}
1342
1343static void
1344uipaq_poll(struct ucom_softc *ucom)
1345{
1346 struct uipaq_softc *sc = ucom->sc_parent;
1347 usbd_transfer_poll(sc->sc_xfer, UIPAQ_N_TRANSFER);
1348}
2/* $OpenBSD: uipaq.c,v 1.1 2005/06/17 23:50:33 deraadt Exp $ */
3
4/*
5 * Copyright (c) 2000-2005 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Lennart Augustsson (lennart@augustsson.net) at
10 * Carlstedt Research & Technology.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/*
35 * iPAQ driver
36 *
37 * 19 July 2003: Incorporated changes suggested by Sam Lawrance from
38 * the uppc module
39 *
40 *
41 * Contact isis@cs.umd.edu if you have any questions/comments about this driver
42 */
43
44#include <sys/cdefs.h>
45__FBSDID("$FreeBSD: head/sys/dev/usb/serial/uipaq.c 210469 2010-07-25 15:14:42Z gavin $");
46
47#include <sys/stdint.h>
48#include <sys/stddef.h>
49#include <sys/param.h>
50#include <sys/queue.h>
51#include <sys/types.h>
52#include <sys/systm.h>
53#include <sys/kernel.h>
54#include <sys/bus.h>
55#include <sys/linker_set.h>
56#include <sys/module.h>
57#include <sys/lock.h>
58#include <sys/mutex.h>
59#include <sys/condvar.h>
60#include <sys/sysctl.h>
61#include <sys/sx.h>
62#include <sys/unistd.h>
63#include <sys/callout.h>
64#include <sys/malloc.h>
65#include <sys/priv.h>
66
67#include <dev/usb/usb.h>
68#include <dev/usb/usbdi.h>
69#include <dev/usb/usbdi_util.h>
70#include <dev/usb/usb_cdc.h>
71#include "usbdevs.h"
72
73#define USB_DEBUG_VAR usb_debug
74#include <dev/usb/usb_debug.h>
75#include <dev/usb/usb_process.h>
76
77#include <dev/usb/serial/usb_serial.h>
78
79#define UIPAQ_CONFIG_INDEX 0 /* config number 1 */
80#define UIPAQ_IFACE_INDEX 0
81
82#define UIPAQ_BUF_SIZE 1024
83
84enum {
85 UIPAQ_BULK_DT_WR,
86 UIPAQ_BULK_DT_RD,
87 UIPAQ_N_TRANSFER,
88};
89
90struct uipaq_softc {
91 struct ucom_super_softc sc_super_ucom;
92 struct ucom_softc sc_ucom;
93
94 struct usb_xfer *sc_xfer[UIPAQ_N_TRANSFER];
95 struct usb_device *sc_udev;
96 struct mtx sc_mtx;
97
98 uint16_t sc_line;
99
100 uint8_t sc_lsr; /* local status register */
101 uint8_t sc_msr; /* modem status register */
102};
103
104static device_probe_t uipaq_probe;
105static device_attach_t uipaq_attach;
106static device_detach_t uipaq_detach;
107
108static usb_callback_t uipaq_write_callback;
109static usb_callback_t uipaq_read_callback;
110
111static void uipaq_start_read(struct ucom_softc *);
112static void uipaq_stop_read(struct ucom_softc *);
113static void uipaq_start_write(struct ucom_softc *);
114static void uipaq_stop_write(struct ucom_softc *);
115static void uipaq_cfg_set_dtr(struct ucom_softc *, uint8_t);
116static void uipaq_cfg_set_rts(struct ucom_softc *, uint8_t);
117static void uipaq_cfg_set_break(struct ucom_softc *, uint8_t);
118static void uipaq_poll(struct ucom_softc *ucom);
119
120static const struct usb_config uipaq_config_data[UIPAQ_N_TRANSFER] = {
121
122 [UIPAQ_BULK_DT_WR] = {
123 .type = UE_BULK,
124 .endpoint = UE_ADDR_ANY,
125 .direction = UE_DIR_OUT,
126 .bufsize = UIPAQ_BUF_SIZE,
127 .flags = {.pipe_bof = 1,.force_short_xfer = 1,},
128 .callback = &uipaq_write_callback,
129 },
130
131 [UIPAQ_BULK_DT_RD] = {
132 .type = UE_BULK,
133 .endpoint = UE_ADDR_ANY,
134 .direction = UE_DIR_IN,
135 .bufsize = UIPAQ_BUF_SIZE,
136 .flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
137 .callback = &uipaq_read_callback,
138 },
139};
140
141static const struct ucom_callback uipaq_callback = {
142 .ucom_cfg_set_dtr = &uipaq_cfg_set_dtr,
143 .ucom_cfg_set_rts = &uipaq_cfg_set_rts,
144 .ucom_cfg_set_break = &uipaq_cfg_set_break,
145 .ucom_start_read = &uipaq_start_read,
146 .ucom_stop_read = &uipaq_stop_read,
147 .ucom_start_write = &uipaq_start_write,
148 .ucom_stop_write = &uipaq_stop_write,
149 .ucom_poll = &uipaq_poll,
150};
151
152/*
153 * Much of this list is generated from lists of other drivers that
154 * support the same hardware. Numeric values are used where no usbdevs
155 * entries exist.
156 */
157static const struct usb_device_id uipaq_devs[] = {
158 /* Socket USB Sync */
159 {USB_VPI(0x0104, 0x00be, 0)},
160 /* USB Sync 0301 */
161 {USB_VPI(0x04ad, 0x0301, 0)},
162 /* USB Sync 0302 */
163 {USB_VPI(0x04ad, 0x0302, 0)},
164 /* USB Sync 0303 */
165 {USB_VPI(0x04ad, 0x0303, 0)},
166 /* GPS Pocket PC USB Sync */
167 {USB_VPI(0x04ad, 0x0306, 0)},
168 /* HHP PDT */
169 {USB_VPI(0x0536, 0x01a0, 0)},
170 /* Intermec Mobile Computer */
171 {USB_VPI(0x067e, 0x1001, 0)},
172 /* Linkup Systems USB Sync */
173 {USB_VPI(0x094b, 0x0001, 0)},
174 /* BCOM USB Sync 0065 */
175 {USB_VPI(0x0960, 0x0065, 0)},
176 /* BCOM USB Sync 0066 */
177 {USB_VPI(0x0960, 0x0066, 0)},
178 /* BCOM USB Sync 0067 */
179 {USB_VPI(0x0960, 0x0067, 0)},
180 /* Portatec USB Sync */
181 {USB_VPI(0x0961, 0x0010, 0)},
182 /* Trimble GeoExplorer */
183 {USB_VPI(0x099e, 0x0052, 0)},
184 /* TDS Data Collector */
185 {USB_VPI(0x099e, 0x4000, 0)},
186 /* Motorola iDEN Smartphone */
187 {USB_VPI(0x0c44, 0x03a2, 0)},
188 /* Cesscom Luxian Series */
189 {USB_VPI(0x0c8e, 0x6000, 0)},
190 /* Motorola PowerPad Pocket PCDevice */
191 {USB_VPI(0x0cad, 0x9001, 0)},
192 /* Freedom Scientific USB Sync */
193 {USB_VPI(0x0f4e, 0x0200, 0)},
194 /* Cyberbank USB Sync */
195 {USB_VPI(0x0f98, 0x0201, 0)},
196 /* Wistron USB Sync */
197 {USB_VPI(0x0fb8, 0x3001, 0)},
198 /* Wistron USB Sync */
199 {USB_VPI(0x0fb8, 0x3002, 0)},
200 /* Wistron USB Sync */
201 {USB_VPI(0x0fb8, 0x3003, 0)},
202 /* Wistron USB Sync */
203 {USB_VPI(0x0fb8, 0x4001, 0)},
204 /* E-TEN USB Sync */
205 {USB_VPI(0x1066, 0x00ce, 0)},
206 /* E-TEN P3XX Pocket PC */
207 {USB_VPI(0x1066, 0x0300, 0)},
208 /* E-TEN P5XX Pocket PC */
209 {USB_VPI(0x1066, 0x0500, 0)},
210 /* E-TEN P6XX Pocket PC */
211 {USB_VPI(0x1066, 0x0600, 0)},
212 /* E-TEN P7XX Pocket PC */
213 {USB_VPI(0x1066, 0x0700, 0)},
214 /* Psion Teklogix Sync 753x */
215 {USB_VPI(0x1114, 0x0001, 0)},
216 /* Psion Teklogix Sync netBookPro */
217 {USB_VPI(0x1114, 0x0004, 0)},
218 /* Psion Teklogix Sync 7525 */
219 {USB_VPI(0x1114, 0x0006, 0)},
220 /* VES USB Sync */
221 {USB_VPI(0x1182, 0x1388, 0)},
222 /* Rugged Pocket PC 2003 */
223 {USB_VPI(0x11d9, 0x1002, 0)},
224 /* Rugged Pocket PC 2003 */
225 {USB_VPI(0x11d9, 0x1003, 0)},
226 /* USB Sync 03 */
227 {USB_VPI(0x1231, 0xce01, 0)},
228 /* USB Sync 03 */
229 {USB_VPI(0x1231, 0xce02, 0)},
230 /* Mio DigiWalker PPC StrongARM */
231 {USB_VPI(0x3340, 0x011c, 0)},
232 /* Mio DigiWalker 338 */
233 {USB_VPI(0x3340, 0x0326, 0)},
234 /* Mio DigiWalker 338 */
235 {USB_VPI(0x3340, 0x0426, 0)},
236 /* Mio DigiWalker USB Sync */
237 {USB_VPI(0x3340, 0x043a, 0)},
238 /* MiTAC USB Sync 528 */
239 {USB_VPI(0x3340, 0x051c, 0)},
240 /* Mio DigiWalker SmartPhone USB Sync */
241 {USB_VPI(0x3340, 0x053a, 0)},
242 /* MiTAC USB Sync */
243 {USB_VPI(0x3340, 0x071c, 0)},
244 /* Generic PPC StrongARM */
245 {USB_VPI(0x3340, 0x0b1c, 0)},
246 /* Generic PPC USB Sync */
247 {USB_VPI(0x3340, 0x0e3a, 0)},
248 /* Itautec USB Sync */
249 {USB_VPI(0x3340, 0x0f1c, 0)},
250 /* Generic SmartPhone USB Sync */
251 {USB_VPI(0x3340, 0x0f3a, 0)},
252 /* Itautec USB Sync */
253 {USB_VPI(0x3340, 0x1326, 0)},
254 /* YAKUMO USB Sync */
255 {USB_VPI(0x3340, 0x191c, 0)},
256 /* Vobis USB Sync */
257 {USB_VPI(0x3340, 0x2326, 0)},
258 /* MEDION Winodws Moble USB Sync */
259 {USB_VPI(0x3340, 0x3326, 0)},
260 /* Legend USB Sync */
261 {USB_VPI(0x3708, 0x20ce, 0)},
262 /* Lenovo USB Sync */
263 {USB_VPI(0x3708, 0x21ce, 0)},
264 /* Mobile Media Technology USB Sync */
265 {USB_VPI(0x4113, 0x0210, 0)},
266 /* Mobile Media Technology USB Sync */
267 {USB_VPI(0x4113, 0x0211, 0)},
268 /* Mobile Media Technology USB Sync */
269 {USB_VPI(0x4113, 0x0400, 0)},
270 /* Mobile Media Technology USB Sync */
271 {USB_VPI(0x4113, 0x0410, 0)},
272 /* Smartphone */
273 {USB_VPI(0x4505, 0x0010, 0)},
274 /* SAGEM Wireless Assistant */
275 {USB_VPI(0x5e04, 0xce00, 0)},
276 /* c10 Series */
277 {USB_VPI(USB_VENDOR_ACER, 0x1631, 0)},
278 /* c20 Series */
279 {USB_VPI(USB_VENDOR_ACER, 0x1632, 0)},
280 /* Acer n10 Handheld USB Sync */
281 {USB_VPI(USB_VENDOR_ACER, 0x16e1, 0)},
282 /* Acer n20 Handheld USB Sync */
283 {USB_VPI(USB_VENDOR_ACER, 0x16e2, 0)},
284 /* Acer n30 Handheld USB Sync */
285 {USB_VPI(USB_VENDOR_ACER, 0x16e3, 0)},
286 /* ASUS USB Sync */
287 {USB_VPI(USB_VENDOR_ASUS, 0x4200, 0)},
288 /* ASUS USB Sync */
289 {USB_VPI(USB_VENDOR_ASUS, 0x4201, 0)},
290 /* ASUS USB Sync */
291 {USB_VPI(USB_VENDOR_ASUS, 0x4202, 0)},
292 /* ASUS USB Sync */
293 {USB_VPI(USB_VENDOR_ASUS, 0x9200, 0)},
294 /* ASUS USB Sync */
295 {USB_VPI(USB_VENDOR_ASUS, 0x9202, 0)},
296 /**/
297 {USB_VPI(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_P535, 0)},
298 /* CASIO USB Sync 2001 */
299 {USB_VPI(USB_VENDOR_CASIO, 0x2001, 0)},
300 /* CASIO USB Sync 2003 */
301 {USB_VPI(USB_VENDOR_CASIO, 0x2003, 0)},
302 /**/
303 {USB_VPI(USB_VENDOR_CASIO, USB_PRODUCT_CASIO_BE300, 0)},
304 /* MyGuide 7000 XL USB Sync */
305 {USB_VPI(USB_VENDOR_COMPAL, 0x0531, 0)},
306 /* Compaq iPAQ USB Sync */
307 {USB_VPI(USB_VENDOR_COMPAQ, 0x0032, 0)},
308 /**/
309 {USB_VPI(USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_IPAQPOCKETPC, 0)},
310 /* Dell Axim USB Sync */
311 {USB_VPI(USB_VENDOR_DELL, 0x4001, 0)},
312 /* Dell Axim USB Sync */
313 {USB_VPI(USB_VENDOR_DELL, 0x4002, 0)},
314 /* Dell Axim USB Sync */
315 {USB_VPI(USB_VENDOR_DELL, 0x4003, 0)},
316 /* Dell Axim USB Sync */
317 {USB_VPI(USB_VENDOR_DELL, 0x4004, 0)},
318 /* Dell Axim USB Sync */
319 {USB_VPI(USB_VENDOR_DELL, 0x4005, 0)},
320 /* Dell Axim USB Sync */
321 {USB_VPI(USB_VENDOR_DELL, 0x4006, 0)},
322 /* Dell Axim USB Sync */
323 {USB_VPI(USB_VENDOR_DELL, 0x4007, 0)},
324 /* Dell Axim USB Sync */
325 {USB_VPI(USB_VENDOR_DELL, 0x4008, 0)},
326 /* Dell Axim USB Sync */
327 {USB_VPI(USB_VENDOR_DELL, 0x4009, 0)},
328 /* Fujitsu Siemens Computers USB Sync */
329 {USB_VPI(USB_VENDOR_FSC, 0x1001, 0)},
330 /* FUJITSU USB Sync */
331 {USB_VPI(USB_VENDOR_FUJITSU, 0x1058, 0)},
332 /* FUJITSU USB Sync */
333 {USB_VPI(USB_VENDOR_FUJITSU, 0x1079, 0)},
334 /* Askey USB Sync */
335 {USB_VPI(USB_VENDOR_GIGASET, 0x0601, 0)},
336 /* Hitachi USB Sync */
337 {USB_VPI(USB_VENDOR_HITACHI, 0x0014, 0)},
338 /* HP USB Sync 1612 */
339 {USB_VPI(USB_VENDOR_HP, 0x1216, 0)},
340 /* HP USB Sync 1620 */
341 {USB_VPI(USB_VENDOR_HP, 0x2016, 0)},
342 /* HP USB Sync 1621 */
343 {USB_VPI(USB_VENDOR_HP, 0x2116, 0)},
344 /* HP USB Sync 1622 */
345 {USB_VPI(USB_VENDOR_HP, 0x2216, 0)},
346 /* HP USB Sync 1630 */
347 {USB_VPI(USB_VENDOR_HP, 0x3016, 0)},
348 /* HP USB Sync 1631 */
349 {USB_VPI(USB_VENDOR_HP, 0x3116, 0)},
350 /* HP USB Sync 1632 */
351 {USB_VPI(USB_VENDOR_HP, 0x3216, 0)},
352 /* HP USB Sync 1640 */
353 {USB_VPI(USB_VENDOR_HP, 0x4016, 0)},
354 /* HP USB Sync 1641 */
355 {USB_VPI(USB_VENDOR_HP, 0x4116, 0)},
356 /* HP USB Sync 1642 */
357 {USB_VPI(USB_VENDOR_HP, 0x4216, 0)},
358 /* HP USB Sync 1650 */
359 {USB_VPI(USB_VENDOR_HP, 0x5016, 0)},
360 /* HP USB Sync 1651 */
361 {USB_VPI(USB_VENDOR_HP, 0x5116, 0)},
362 /* HP USB Sync 1652 */
363 {USB_VPI(USB_VENDOR_HP, 0x5216, 0)},
364 /**/
365 {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_2215, 0)},
366 /**/
367 {USB_VPI(USB_VENDOR_HP, USB_PRODUCT_HP_568J, 0)},
368 /* HTC USB Modem */
369 {USB_VPI(USB_VENDOR_HTC, 0x00cf, 0)},
370 /* PocketPC USB Sync */
371 {USB_VPI(USB_VENDOR_HTC, 0x0a01, 0)},
372 /* PocketPC USB Sync */
373 {USB_VPI(USB_VENDOR_HTC, 0x0a02, 0)},
374 /* PocketPC USB Sync */
375 {USB_VPI(USB_VENDOR_HTC, 0x0a03, 0)},
376 /* PocketPC USB Sync */
377 {USB_VPI(USB_VENDOR_HTC, 0x0a04, 0)},
378 /* PocketPC USB Sync */
379 {USB_VPI(USB_VENDOR_HTC, 0x0a05, 0)},
380 /* PocketPC USB Sync */
381 {USB_VPI(USB_VENDOR_HTC, 0x0a06, 0)},
382 /* PocketPC USB Sync */
383 {USB_VPI(USB_VENDOR_HTC, 0x0a07, 0)},
384 /* PocketPC USB Sync */
385 {USB_VPI(USB_VENDOR_HTC, 0x0a08, 0)},
386 /* PocketPC USB Sync */
387 {USB_VPI(USB_VENDOR_HTC, 0x0a09, 0)},
388 /* PocketPC USB Sync */
389 {USB_VPI(USB_VENDOR_HTC, 0x0a0a, 0)},
390 /* PocketPC USB Sync */
391 {USB_VPI(USB_VENDOR_HTC, 0x0a0b, 0)},
392 /* PocketPC USB Sync */
393 {USB_VPI(USB_VENDOR_HTC, 0x0a0c, 0)},
394 /* PocketPC USB Sync */
395 {USB_VPI(USB_VENDOR_HTC, 0x0a0d, 0)},
396 /* PocketPC USB Sync */
397 {USB_VPI(USB_VENDOR_HTC, 0x0a0e, 0)},
398 /* PocketPC USB Sync */
399 {USB_VPI(USB_VENDOR_HTC, 0x0a0f, 0)},
400 /* PocketPC USB Sync */
401 {USB_VPI(USB_VENDOR_HTC, 0x0a10, 0)},
402 /* PocketPC USB Sync */
403 {USB_VPI(USB_VENDOR_HTC, 0x0a11, 0)},
404 /* PocketPC USB Sync */
405 {USB_VPI(USB_VENDOR_HTC, 0x0a12, 0)},
406 /* PocketPC USB Sync */
407 {USB_VPI(USB_VENDOR_HTC, 0x0a13, 0)},
408 /* PocketPC USB Sync */
409 {USB_VPI(USB_VENDOR_HTC, 0x0a14, 0)},
410 /* PocketPC USB Sync */
411 {USB_VPI(USB_VENDOR_HTC, 0x0a15, 0)},
412 /* PocketPC USB Sync */
413 {USB_VPI(USB_VENDOR_HTC, 0x0a16, 0)},
414 /* PocketPC USB Sync */
415 {USB_VPI(USB_VENDOR_HTC, 0x0a17, 0)},
416 /* PocketPC USB Sync */
417 {USB_VPI(USB_VENDOR_HTC, 0x0a18, 0)},
418 /* PocketPC USB Sync */
419 {USB_VPI(USB_VENDOR_HTC, 0x0a19, 0)},
420 /* PocketPC USB Sync */
421 {USB_VPI(USB_VENDOR_HTC, 0x0a1a, 0)},
422 /* PocketPC USB Sync */
423 {USB_VPI(USB_VENDOR_HTC, 0x0a1b, 0)},
424 /* PocketPC USB Sync */
425 {USB_VPI(USB_VENDOR_HTC, 0x0a1c, 0)},
426 /* PocketPC USB Sync */
427 {USB_VPI(USB_VENDOR_HTC, 0x0a1d, 0)},
428 /* PocketPC USB Sync */
429 {USB_VPI(USB_VENDOR_HTC, 0x0a1e, 0)},
430 /* PocketPC USB Sync */
431 {USB_VPI(USB_VENDOR_HTC, 0x0a1f, 0)},
432 /* PocketPC USB Sync */
433 {USB_VPI(USB_VENDOR_HTC, 0x0a20, 0)},
434 /* PocketPC USB Sync */
435 {USB_VPI(USB_VENDOR_HTC, 0x0a21, 0)},
436 /* PocketPC USB Sync */
437 {USB_VPI(USB_VENDOR_HTC, 0x0a22, 0)},
438 /* PocketPC USB Sync */
439 {USB_VPI(USB_VENDOR_HTC, 0x0a23, 0)},
440 /* PocketPC USB Sync */
441 {USB_VPI(USB_VENDOR_HTC, 0x0a24, 0)},
442 /* PocketPC USB Sync */
443 {USB_VPI(USB_VENDOR_HTC, 0x0a25, 0)},
444 /* PocketPC USB Sync */
445 {USB_VPI(USB_VENDOR_HTC, 0x0a26, 0)},
446 /* PocketPC USB Sync */
447 {USB_VPI(USB_VENDOR_HTC, 0x0a27, 0)},
448 /* PocketPC USB Sync */
449 {USB_VPI(USB_VENDOR_HTC, 0x0a28, 0)},
450 /* PocketPC USB Sync */
451 {USB_VPI(USB_VENDOR_HTC, 0x0a29, 0)},
452 /* PocketPC USB Sync */
453 {USB_VPI(USB_VENDOR_HTC, 0x0a2a, 0)},
454 /* PocketPC USB Sync */
455 {USB_VPI(USB_VENDOR_HTC, 0x0a2b, 0)},
456 /* PocketPC USB Sync */
457 {USB_VPI(USB_VENDOR_HTC, 0x0a2c, 0)},
458 /* PocketPC USB Sync */
459 {USB_VPI(USB_VENDOR_HTC, 0x0a2d, 0)},
460 /* PocketPC USB Sync */
461 {USB_VPI(USB_VENDOR_HTC, 0x0a2e, 0)},
462 /* PocketPC USB Sync */
463 {USB_VPI(USB_VENDOR_HTC, 0x0a2f, 0)},
464 /* PocketPC USB Sync */
465 {USB_VPI(USB_VENDOR_HTC, 0x0a30, 0)},
466 /* PocketPC USB Sync */
467 {USB_VPI(USB_VENDOR_HTC, 0x0a31, 0)},
468 /* PocketPC USB Sync */
469 {USB_VPI(USB_VENDOR_HTC, 0x0a32, 0)},
470 /* PocketPC USB Sync */
471 {USB_VPI(USB_VENDOR_HTC, 0x0a33, 0)},
472 /* PocketPC USB Sync */
473 {USB_VPI(USB_VENDOR_HTC, 0x0a34, 0)},
474 /* PocketPC USB Sync */
475 {USB_VPI(USB_VENDOR_HTC, 0x0a35, 0)},
476 /* PocketPC USB Sync */
477 {USB_VPI(USB_VENDOR_HTC, 0x0a36, 0)},
478 /* PocketPC USB Sync */
479 {USB_VPI(USB_VENDOR_HTC, 0x0a37, 0)},
480 /* PocketPC USB Sync */
481 {USB_VPI(USB_VENDOR_HTC, 0x0a38, 0)},
482 /* PocketPC USB Sync */
483 {USB_VPI(USB_VENDOR_HTC, 0x0a39, 0)},
484 /* PocketPC USB Sync */
485 {USB_VPI(USB_VENDOR_HTC, 0x0a3a, 0)},
486 /* PocketPC USB Sync */
487 {USB_VPI(USB_VENDOR_HTC, 0x0a3b, 0)},
488 /* PocketPC USB Sync */
489 {USB_VPI(USB_VENDOR_HTC, 0x0a3c, 0)},
490 /* PocketPC USB Sync */
491 {USB_VPI(USB_VENDOR_HTC, 0x0a3d, 0)},
492 /* PocketPC USB Sync */
493 {USB_VPI(USB_VENDOR_HTC, 0x0a3e, 0)},
494 /* PocketPC USB Sync */
495 {USB_VPI(USB_VENDOR_HTC, 0x0a3f, 0)},
496 /* PocketPC USB Sync */
497 {USB_VPI(USB_VENDOR_HTC, 0x0a40, 0)},
498 /* PocketPC USB Sync */
499 {USB_VPI(USB_VENDOR_HTC, 0x0a41, 0)},
500 /* PocketPC USB Sync */
501 {USB_VPI(USB_VENDOR_HTC, 0x0a42, 0)},
502 /* PocketPC USB Sync */
503 {USB_VPI(USB_VENDOR_HTC, 0x0a43, 0)},
504 /* PocketPC USB Sync */
505 {USB_VPI(USB_VENDOR_HTC, 0x0a44, 0)},
506 /* PocketPC USB Sync */
507 {USB_VPI(USB_VENDOR_HTC, 0x0a45, 0)},
508 /* PocketPC USB Sync */
509 {USB_VPI(USB_VENDOR_HTC, 0x0a46, 0)},
510 /* PocketPC USB Sync */
511 {USB_VPI(USB_VENDOR_HTC, 0x0a47, 0)},
512 /* PocketPC USB Sync */
513 {USB_VPI(USB_VENDOR_HTC, 0x0a48, 0)},
514 /* PocketPC USB Sync */
515 {USB_VPI(USB_VENDOR_HTC, 0x0a49, 0)},
516 /* PocketPC USB Sync */
517 {USB_VPI(USB_VENDOR_HTC, 0x0a4a, 0)},
518 /* PocketPC USB Sync */
519 {USB_VPI(USB_VENDOR_HTC, 0x0a4b, 0)},
520 /* PocketPC USB Sync */
521 {USB_VPI(USB_VENDOR_HTC, 0x0a4c, 0)},
522 /* PocketPC USB Sync */
523 {USB_VPI(USB_VENDOR_HTC, 0x0a4d, 0)},
524 /* PocketPC USB Sync */
525 {USB_VPI(USB_VENDOR_HTC, 0x0a4e, 0)},
526 /* PocketPC USB Sync */
527 {USB_VPI(USB_VENDOR_HTC, 0x0a4f, 0)},
528 /* HTC SmartPhone USB Sync */
529 {USB_VPI(USB_VENDOR_HTC, 0x0a50, 0)},
530 /* SmartPhone USB Sync */
531 {USB_VPI(USB_VENDOR_HTC, 0x0a52, 0)},
532 /* SmartPhone USB Sync */
533 {USB_VPI(USB_VENDOR_HTC, 0x0a53, 0)},
534 /* SmartPhone USB Sync */
535 {USB_VPI(USB_VENDOR_HTC, 0x0a54, 0)},
536 /* SmartPhone USB Sync */
537 {USB_VPI(USB_VENDOR_HTC, 0x0a55, 0)},
538 /* SmartPhone USB Sync */
539 {USB_VPI(USB_VENDOR_HTC, 0x0a56, 0)},
540 /* SmartPhone USB Sync */
541 {USB_VPI(USB_VENDOR_HTC, 0x0a57, 0)},
542 /* SmartPhone USB Sync */
543 {USB_VPI(USB_VENDOR_HTC, 0x0a58, 0)},
544 /* SmartPhone USB Sync */
545 {USB_VPI(USB_VENDOR_HTC, 0x0a59, 0)},
546 /* SmartPhone USB Sync */
547 {USB_VPI(USB_VENDOR_HTC, 0x0a5a, 0)},
548 /* SmartPhone USB Sync */
549 {USB_VPI(USB_VENDOR_HTC, 0x0a5b, 0)},
550 /* SmartPhone USB Sync */
551 {USB_VPI(USB_VENDOR_HTC, 0x0a5c, 0)},
552 /* SmartPhone USB Sync */
553 {USB_VPI(USB_VENDOR_HTC, 0x0a5d, 0)},
554 /* SmartPhone USB Sync */
555 {USB_VPI(USB_VENDOR_HTC, 0x0a5e, 0)},
556 /* SmartPhone USB Sync */
557 {USB_VPI(USB_VENDOR_HTC, 0x0a5f, 0)},
558 /* SmartPhone USB Sync */
559 {USB_VPI(USB_VENDOR_HTC, 0x0a60, 0)},
560 /* SmartPhone USB Sync */
561 {USB_VPI(USB_VENDOR_HTC, 0x0a61, 0)},
562 /* SmartPhone USB Sync */
563 {USB_VPI(USB_VENDOR_HTC, 0x0a62, 0)},
564 /* SmartPhone USB Sync */
565 {USB_VPI(USB_VENDOR_HTC, 0x0a63, 0)},
566 /* SmartPhone USB Sync */
567 {USB_VPI(USB_VENDOR_HTC, 0x0a64, 0)},
568 /* SmartPhone USB Sync */
569 {USB_VPI(USB_VENDOR_HTC, 0x0a65, 0)},
570 /* SmartPhone USB Sync */
571 {USB_VPI(USB_VENDOR_HTC, 0x0a66, 0)},
572 /* SmartPhone USB Sync */
573 {USB_VPI(USB_VENDOR_HTC, 0x0a67, 0)},
574 /* SmartPhone USB Sync */
575 {USB_VPI(USB_VENDOR_HTC, 0x0a68, 0)},
576 /* SmartPhone USB Sync */
577 {USB_VPI(USB_VENDOR_HTC, 0x0a69, 0)},
578 /* SmartPhone USB Sync */
579 {USB_VPI(USB_VENDOR_HTC, 0x0a6a, 0)},
580 /* SmartPhone USB Sync */
581 {USB_VPI(USB_VENDOR_HTC, 0x0a6b, 0)},
582 /* SmartPhone USB Sync */
583 {USB_VPI(USB_VENDOR_HTC, 0x0a6c, 0)},
584 /* SmartPhone USB Sync */
585 {USB_VPI(USB_VENDOR_HTC, 0x0a6d, 0)},
586 /* SmartPhone USB Sync */
587 {USB_VPI(USB_VENDOR_HTC, 0x0a6e, 0)},
588 /* SmartPhone USB Sync */
589 {USB_VPI(USB_VENDOR_HTC, 0x0a6f, 0)},
590 /* SmartPhone USB Sync */
591 {USB_VPI(USB_VENDOR_HTC, 0x0a70, 0)},
592 /* SmartPhone USB Sync */
593 {USB_VPI(USB_VENDOR_HTC, 0x0a71, 0)},
594 /* SmartPhone USB Sync */
595 {USB_VPI(USB_VENDOR_HTC, 0x0a72, 0)},
596 /* SmartPhone USB Sync */
597 {USB_VPI(USB_VENDOR_HTC, 0x0a73, 0)},
598 /* SmartPhone USB Sync */
599 {USB_VPI(USB_VENDOR_HTC, 0x0a74, 0)},
600 /* SmartPhone USB Sync */
601 {USB_VPI(USB_VENDOR_HTC, 0x0a75, 0)},
602 /* SmartPhone USB Sync */
603 {USB_VPI(USB_VENDOR_HTC, 0x0a76, 0)},
604 /* SmartPhone USB Sync */
605 {USB_VPI(USB_VENDOR_HTC, 0x0a77, 0)},
606 /* SmartPhone USB Sync */
607 {USB_VPI(USB_VENDOR_HTC, 0x0a78, 0)},
608 /* SmartPhone USB Sync */
609 {USB_VPI(USB_VENDOR_HTC, 0x0a79, 0)},
610 /* SmartPhone USB Sync */
611 {USB_VPI(USB_VENDOR_HTC, 0x0a7a, 0)},
612 /* SmartPhone USB Sync */
613 {USB_VPI(USB_VENDOR_HTC, 0x0a7b, 0)},
614 /* SmartPhone USB Sync */
615 {USB_VPI(USB_VENDOR_HTC, 0x0a7c, 0)},
616 /* SmartPhone USB Sync */
617 {USB_VPI(USB_VENDOR_HTC, 0x0a7d, 0)},
618 /* SmartPhone USB Sync */
619 {USB_VPI(USB_VENDOR_HTC, 0x0a7e, 0)},
620 /* SmartPhone USB Sync */
621 {USB_VPI(USB_VENDOR_HTC, 0x0a7f, 0)},
622 /* SmartPhone USB Sync */
623 {USB_VPI(USB_VENDOR_HTC, 0x0a80, 0)},
624 /* SmartPhone USB Sync */
625 {USB_VPI(USB_VENDOR_HTC, 0x0a81, 0)},
626 /* SmartPhone USB Sync */
627 {USB_VPI(USB_VENDOR_HTC, 0x0a82, 0)},
628 /* SmartPhone USB Sync */
629 {USB_VPI(USB_VENDOR_HTC, 0x0a83, 0)},
630 /* SmartPhone USB Sync */
631 {USB_VPI(USB_VENDOR_HTC, 0x0a84, 0)},
632 /* SmartPhone USB Sync */
633 {USB_VPI(USB_VENDOR_HTC, 0x0a85, 0)},
634 /* SmartPhone USB Sync */
635 {USB_VPI(USB_VENDOR_HTC, 0x0a86, 0)},
636 /* SmartPhone USB Sync */
637 {USB_VPI(USB_VENDOR_HTC, 0x0a87, 0)},
638 /* SmartPhone USB Sync */
639 {USB_VPI(USB_VENDOR_HTC, 0x0a88, 0)},
640 /* SmartPhone USB Sync */
641 {USB_VPI(USB_VENDOR_HTC, 0x0a89, 0)},
642 /* SmartPhone USB Sync */
643 {USB_VPI(USB_VENDOR_HTC, 0x0a8a, 0)},
644 /* SmartPhone USB Sync */
645 {USB_VPI(USB_VENDOR_HTC, 0x0a8b, 0)},
646 /* SmartPhone USB Sync */
647 {USB_VPI(USB_VENDOR_HTC, 0x0a8c, 0)},
648 /* SmartPhone USB Sync */
649 {USB_VPI(USB_VENDOR_HTC, 0x0a8d, 0)},
650 /* SmartPhone USB Sync */
651 {USB_VPI(USB_VENDOR_HTC, 0x0a8e, 0)},
652 /* SmartPhone USB Sync */
653 {USB_VPI(USB_VENDOR_HTC, 0x0a8f, 0)},
654 /* SmartPhone USB Sync */
655 {USB_VPI(USB_VENDOR_HTC, 0x0a90, 0)},
656 /* SmartPhone USB Sync */
657 {USB_VPI(USB_VENDOR_HTC, 0x0a91, 0)},
658 /* SmartPhone USB Sync */
659 {USB_VPI(USB_VENDOR_HTC, 0x0a92, 0)},
660 /* SmartPhone USB Sync */
661 {USB_VPI(USB_VENDOR_HTC, 0x0a93, 0)},
662 /* SmartPhone USB Sync */
663 {USB_VPI(USB_VENDOR_HTC, 0x0a94, 0)},
664 /* SmartPhone USB Sync */
665 {USB_VPI(USB_VENDOR_HTC, 0x0a95, 0)},
666 /* SmartPhone USB Sync */
667 {USB_VPI(USB_VENDOR_HTC, 0x0a96, 0)},
668 /* SmartPhone USB Sync */
669 {USB_VPI(USB_VENDOR_HTC, 0x0a97, 0)},
670 /* SmartPhone USB Sync */
671 {USB_VPI(USB_VENDOR_HTC, 0x0a98, 0)},
672 /* SmartPhone USB Sync */
673 {USB_VPI(USB_VENDOR_HTC, 0x0a99, 0)},
674 /* SmartPhone USB Sync */
675 {USB_VPI(USB_VENDOR_HTC, 0x0a9a, 0)},
676 /* SmartPhone USB Sync */
677 {USB_VPI(USB_VENDOR_HTC, 0x0a9b, 0)},
678 /* SmartPhone USB Sync */
679 {USB_VPI(USB_VENDOR_HTC, 0x0a9c, 0)},
680 /* SmartPhone USB Sync */
681 {USB_VPI(USB_VENDOR_HTC, 0x0a9d, 0)},
682 /* SmartPhone USB Sync */
683 {USB_VPI(USB_VENDOR_HTC, 0x0a9e, 0)},
684 /* SmartPhone USB Sync */
685 {USB_VPI(USB_VENDOR_HTC, 0x0a9f, 0)},
686 /**/
687 {USB_VPI(USB_VENDOR_HTC, USB_PRODUCT_HTC_PPC6700MODEM, 0)},
688 /**/
689 {USB_VPI(USB_VENDOR_HTC, USB_PRODUCT_HTC_SMARTPHONE, 0)},
690 /**/
691 {USB_VPI(USB_VENDOR_HTC, USB_PRODUCT_HTC_WINMOBILE, 0)},
692 /* High Tech Computer Wizard Smartphone */
693 {USB_VPI(USB_VENDOR_HTC, USB_PRODUCT_HTC_WIZARD, 0)},
694 /* JVC USB Sync */
695 {USB_VPI(USB_VENDOR_JVC, 0x3011, 0)},
696 /* JVC USB Sync */
697 {USB_VPI(USB_VENDOR_JVC, 0x3012, 0)},
698 /* LGE USB Sync */
699 {USB_VPI(USB_VENDOR_LG, 0x9c01, 0)},
700 /* Microsoft USB Sync */
701 {USB_VPI(USB_VENDOR_MICROSOFT, 0x00ce, 0)},
702 /* Windows Pocket PC 2002 */
703 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0400, 0)},
704 /* Windows Pocket PC 2002 */
705 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0401, 0)},
706 /* Windows Pocket PC 2002 */
707 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0402, 0)},
708 /* Windows Pocket PC 2002 */
709 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0403, 0)},
710 /* Windows Pocket PC 2002 */
711 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0404, 0)},
712 /* Windows Pocket PC 2002 */
713 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0405, 0)},
714 /* Windows Pocket PC 2002 */
715 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0406, 0)},
716 /* Windows Pocket PC 2002 */
717 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0407, 0)},
718 /* Windows Pocket PC 2002 */
719 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0408, 0)},
720 /* Windows Pocket PC 2002 */
721 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0409, 0)},
722 /* Windows Pocket PC 2002 */
723 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040a, 0)},
724 /* Windows Pocket PC 2002 */
725 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040b, 0)},
726 /* Windows Pocket PC 2002 */
727 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040c, 0)},
728 /* Windows Pocket PC 2002 */
729 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040d, 0)},
730 /* Windows Pocket PC 2002 */
731 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040e, 0)},
732 /* Windows Pocket PC 2002 */
733 {USB_VPI(USB_VENDOR_MICROSOFT, 0x040f, 0)},
734 /* Windows Pocket PC 2002 */
735 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0410, 0)},
736 /* Windows Pocket PC 2002 */
737 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0411, 0)},
738 /* Windows Pocket PC 2002 */
739 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0412, 0)},
740 /* Windows Pocket PC 2002 */
741 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0413, 0)},
742 /* Windows Pocket PC 2002 */
743 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0414, 0)},
744 /* Windows Pocket PC 2002 */
745 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0415, 0)},
746 /* Windows Pocket PC 2002 */
747 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0416, 0)},
748 /* Windows Pocket PC 2002 */
749 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0417, 0)},
750 /* Windows Pocket PC 2003 */
751 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0432, 0)},
752 /* Windows Pocket PC 2003 */
753 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0433, 0)},
754 /* Windows Pocket PC 2003 */
755 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0434, 0)},
756 /* Windows Pocket PC 2003 */
757 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0435, 0)},
758 /* Windows Pocket PC 2003 */
759 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0436, 0)},
760 /* Windows Pocket PC 2003 */
761 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0437, 0)},
762 /* Windows Pocket PC 2003 */
763 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0438, 0)},
764 /* Windows Pocket PC 2003 */
765 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0439, 0)},
766 /* Windows Pocket PC 2003 */
767 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043a, 0)},
768 /* Windows Pocket PC 2003 */
769 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043b, 0)},
770 /* Windows Pocket PC 2003 */
771 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043c, 0)},
772 /* Windows Pocket PC 2003 */
773 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043d, 0)},
774 /* Windows Pocket PC 2003 */
775 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043e, 0)},
776 /* Windows Pocket PC 2003 */
777 {USB_VPI(USB_VENDOR_MICROSOFT, 0x043f, 0)},
778 /* Windows Pocket PC 2003 */
779 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0440, 0)},
780 /* Windows Pocket PC 2003 */
781 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0441, 0)},
782 /* Windows Pocket PC 2003 */
783 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0442, 0)},
784 /* Windows Pocket PC 2003 */
785 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0443, 0)},
786 /* Windows Pocket PC 2003 */
787 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0444, 0)},
788 /* Windows Pocket PC 2003 */
789 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0445, 0)},
790 /* Windows Pocket PC 2003 */
791 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0446, 0)},
792 /* Windows Pocket PC 2003 */
793 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0447, 0)},
794 /* Windows Pocket PC 2003 */
795 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0448, 0)},
796 /* Windows Pocket PC 2003 */
797 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0449, 0)},
798 /* Windows Pocket PC 2003 */
799 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044a, 0)},
800 /* Windows Pocket PC 2003 */
801 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044b, 0)},
802 /* Windows Pocket PC 2003 */
803 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044c, 0)},
804 /* Windows Pocket PC 2003 */
805 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044d, 0)},
806 /* Windows Pocket PC 2003 */
807 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044e, 0)},
808 /* Windows Pocket PC 2003 */
809 {USB_VPI(USB_VENDOR_MICROSOFT, 0x044f, 0)},
810 /* Windows Pocket PC 2003 */
811 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0450, 0)},
812 /* Windows Pocket PC 2003 */
813 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0451, 0)},
814 /* Windows Pocket PC 2003 */
815 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0452, 0)},
816 /* Windows Pocket PC 2003 */
817 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0453, 0)},
818 /* Windows Pocket PC 2003 */
819 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0454, 0)},
820 /* Windows Pocket PC 2003 */
821 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0455, 0)},
822 /* Windows Pocket PC 2003 */
823 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0456, 0)},
824 /* Windows Pocket PC 2003 */
825 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0457, 0)},
826 /* Windows Pocket PC 2003 */
827 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0458, 0)},
828 /* Windows Pocket PC 2003 */
829 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0459, 0)},
830 /* Windows Pocket PC 2003 */
831 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045a, 0)},
832 /* Windows Pocket PC 2003 */
833 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045b, 0)},
834 /* Windows Pocket PC 2003 */
835 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045c, 0)},
836 /* Windows Pocket PC 2003 */
837 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045d, 0)},
838 /* Windows Pocket PC 2003 */
839 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045e, 0)},
840 /* Windows Pocket PC 2003 */
841 {USB_VPI(USB_VENDOR_MICROSOFT, 0x045f, 0)},
842 /* Windows Pocket PC 2003 */
843 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0460, 0)},
844 /* Windows Pocket PC 2003 */
845 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0461, 0)},
846 /* Windows Pocket PC 2003 */
847 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0462, 0)},
848 /* Windows Pocket PC 2003 */
849 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0463, 0)},
850 /* Windows Pocket PC 2003 */
851 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0464, 0)},
852 /* Windows Pocket PC 2003 */
853 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0465, 0)},
854 /* Windows Pocket PC 2003 */
855 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0466, 0)},
856 /* Windows Pocket PC 2003 */
857 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0467, 0)},
858 /* Windows Pocket PC 2003 */
859 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0468, 0)},
860 /* Windows Pocket PC 2003 */
861 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0469, 0)},
862 /* Windows Pocket PC 2003 */
863 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046a, 0)},
864 /* Windows Pocket PC 2003 */
865 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046b, 0)},
866 /* Windows Pocket PC 2003 */
867 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046c, 0)},
868 /* Windows Pocket PC 2003 */
869 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046d, 0)},
870 /* Windows Pocket PC 2003 */
871 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046e, 0)},
872 /* Windows Pocket PC 2003 */
873 {USB_VPI(USB_VENDOR_MICROSOFT, 0x046f, 0)},
874 /* Windows Pocket PC 2003 */
875 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0470, 0)},
876 /* Windows Pocket PC 2003 */
877 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0471, 0)},
878 /* Windows Pocket PC 2003 */
879 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0472, 0)},
880 /* Windows Pocket PC 2003 */
881 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0473, 0)},
882 /* Windows Pocket PC 2003 */
883 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0474, 0)},
884 /* Windows Pocket PC 2003 */
885 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0475, 0)},
886 /* Windows Pocket PC 2003 */
887 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0476, 0)},
888 /* Windows Pocket PC 2003 */
889 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0477, 0)},
890 /* Windows Pocket PC 2003 */
891 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0478, 0)},
892 /* Windows Pocket PC 2003 */
893 {USB_VPI(USB_VENDOR_MICROSOFT, 0x0479, 0)},
894 /* Windows Pocket PC 2003 */
895 {USB_VPI(USB_VENDOR_MICROSOFT, 0x047a, 0)},
896 /* Windows Pocket PC 2003 */
897 {USB_VPI(USB_VENDOR_MICROSOFT, 0x047b, 0)},
898 /* Windows Smartphone 2002 */
899 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04c8, 0)},
900 /* Windows Smartphone 2002 */
901 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04c9, 0)},
902 /* Windows Smartphone 2002 */
903 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04ca, 0)},
904 /* Windows Smartphone 2002 */
905 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04cb, 0)},
906 /* Windows Smartphone 2002 */
907 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04cc, 0)},
908 /* Windows Smartphone 2002 */
909 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04cd, 0)},
910 /* Windows Smartphone 2002 */
911 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04ce, 0)},
912 /* Windows Smartphone 2003 */
913 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04d7, 0)},
914 /* Windows Smartphone 2003 */
915 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04d8, 0)},
916 /* Windows Smartphone 2003 */
917 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04d9, 0)},
918 /* Windows Smartphone 2003 */
919 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04da, 0)},
920 /* Windows Smartphone 2003 */
921 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04db, 0)},
922 /* Windows Smartphone 2003 */
923 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04dc, 0)},
924 /* Windows Smartphone 2003 */
925 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04dd, 0)},
926 /* Windows Smartphone 2003 */
927 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04de, 0)},
928 /* Windows Smartphone 2003 */
929 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04df, 0)},
930 /* Windows Smartphone 2003 */
931 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e0, 0)},
932 /* Windows Smartphone 2003 */
933 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e1, 0)},
934 /* Windows Smartphone 2003 */
935 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e2, 0)},
936 /* Windows Smartphone 2003 */
937 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e3, 0)},
938 /* Windows Smartphone 2003 */
939 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e4, 0)},
940 /* Windows Smartphone 2003 */
941 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e5, 0)},
942 /* Windows Smartphone 2003 */
943 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e6, 0)},
944 /* Windows Smartphone 2003 */
945 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e7, 0)},
946 /* Windows Smartphone 2003 */
947 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e8, 0)},
948 /* Windows Smartphone 2003 */
949 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04e9, 0)},
950 /* Windows Smartphone 2003 */
951 {USB_VPI(USB_VENDOR_MICROSOFT, 0x04ea, 0)},
952 /* Motorola MPx200 Smartphone */
953 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4204, 0)},
954 /* Motorola MPc GSM */
955 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4214, 0)},
956 /* Motorola MPx220 Smartphone */
957 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4224, 0)},
958 /* Motorola MPc CDMA */
959 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4234, 0)},
960 /* Motorola MPx100 Smartphone */
961 {USB_VPI(USB_VENDOR_MOTOROLA2, 0x4244, 0)},
962 /* NEC USB Sync */
963 {USB_VPI(USB_VENDOR_NEC, 0x00d5, 0)},
964 /* NEC USB Sync */
965 {USB_VPI(USB_VENDOR_NEC, 0x00d6, 0)},
966 /* NEC USB Sync */
967 {USB_VPI(USB_VENDOR_NEC, 0x00d7, 0)},
968 /* NEC USB Sync */
969 {USB_VPI(USB_VENDOR_NEC, 0x8024, 0)},
970 /* NEC USB Sync */
971 {USB_VPI(USB_VENDOR_NEC, 0x8025, 0)},
972 /* Panasonic USB Sync */
973 {USB_VPI(USB_VENDOR_PANASONIC, 0x2500, 0)},
974 /* Samsung NEXiO USB Sync */
975 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f00, 0)},
976 /* Samsung NEXiO USB Sync */
977 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f01, 0)},
978 /* Samsung NEXiO USB Sync */
979 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f02, 0)},
980 /* Samsung NEXiO USB Sync */
981 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f03, 0)},
982 /* Samsung NEXiO USB Sync */
983 {USB_VPI(USB_VENDOR_SAMSUNG, 0x5f04, 0)},
984 /* Samsung MITs USB Sync */
985 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6611, 0)},
986 /* Samsung MITs USB Sync */
987 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6613, 0)},
988 /* Samsung MITs USB Sync */
989 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6615, 0)},
990 /* Samsung MITs USB Sync */
991 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6617, 0)},
992 /* Samsung MITs USB Sync */
993 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6619, 0)},
994 /* Samsung MITs USB Sync */
995 {USB_VPI(USB_VENDOR_SAMSUNG, 0x661b, 0)},
996 /* Samsung MITs USB Sync */
997 {USB_VPI(USB_VENDOR_SAMSUNG, 0x662e, 0)},
998 /* Samsung MITs USB Sync */
999 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6630, 0)},
1000 /* Samsung MITs USB Sync */
1001 {USB_VPI(USB_VENDOR_SAMSUNG, 0x6632, 0)},
1002 /* SHARP WS003SH USB Modem */
1003 {USB_VPI(USB_VENDOR_SHARP, 0x9102, 0)},
1004 /* SHARP WS004SH USB Modem */
1005 {USB_VPI(USB_VENDOR_SHARP, 0x9121, 0)},
1006 /* SHARP S01SH USB Modem */
1007 {USB_VPI(USB_VENDOR_SHARP, 0x9151, 0)},
1008 /**/
1009 {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WZERO3ES, 0)},
1010 /**/
1011 {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WZERO3ADES, 0)},
1012 /**/
1013 {USB_VPI(USB_VENDOR_SHARP, USB_PRODUCT_SHARP_WILLCOM03, 0)},
1014 /* Symbol USB Sync */
1015 {USB_VPI(USB_VENDOR_SYMBOL, 0x2000, 0)},
1016 /* Symbol USB Sync 0x2001 */
1017 {USB_VPI(USB_VENDOR_SYMBOL, 0x2001, 0)},
1018 /* Symbol USB Sync 0x2002 */
1019 {USB_VPI(USB_VENDOR_SYMBOL, 0x2002, 0)},
1020 /* Symbol USB Sync 0x2003 */
1021 {USB_VPI(USB_VENDOR_SYMBOL, 0x2003, 0)},
1022 /* Symbol USB Sync 0x2004 */
1023 {USB_VPI(USB_VENDOR_SYMBOL, 0x2004, 0)},
1024 /* Symbol USB Sync 0x2005 */
1025 {USB_VPI(USB_VENDOR_SYMBOL, 0x2005, 0)},
1026 /* Symbol USB Sync 0x2006 */
1027 {USB_VPI(USB_VENDOR_SYMBOL, 0x2006, 0)},
1028 /* Symbol USB Sync 0x2007 */
1029 {USB_VPI(USB_VENDOR_SYMBOL, 0x2007, 0)},
1030 /* Symbol USB Sync 0x2008 */
1031 {USB_VPI(USB_VENDOR_SYMBOL, 0x2008, 0)},
1032 /* Symbol USB Sync 0x2009 */
1033 {USB_VPI(USB_VENDOR_SYMBOL, 0x2009, 0)},
1034 /* Symbol USB Sync 0x200a */
1035 {USB_VPI(USB_VENDOR_SYMBOL, 0x200a, 0)},
1036 /* TOSHIBA USB Sync 0700 */
1037 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0700, 0)},
1038 /* TOSHIBA Pocket PC e310 */
1039 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0705, 0)},
1040 /* TOSHIBA Pocket PC e330 Series */
1041 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0707, 0)},
1042 /* TOSHIBA Pocket PC e350Series */
1043 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0708, 0)},
1044 /* TOSHIBA Pocket PC e750 Series */
1045 {USB_VPI(USB_VENDOR_TOSHIBA, 0x0709, 0)},
1046 /* TOSHIBA Pocket PC e400 Series */
1047 {USB_VPI(USB_VENDOR_TOSHIBA, 0x070a, 0)},
1048 /* TOSHIBA Pocket PC e800 Series */
1049 {USB_VPI(USB_VENDOR_TOSHIBA, 0x070b, 0)},
1050 /* TOSHIBA Pocket PC e740 */
1051 {USB_VPI(USB_VENDOR_TOSHIBA, USB_PRODUCT_TOSHIBA_POCKETPC_E740, 0)},
1052 /* ViewSonic Color Pocket PC V35 */
1053 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x0ed9, 0)},
1054 /* ViewSonic Color Pocket PC V36 */
1055 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1527, 0)},
1056 /* ViewSonic Color Pocket PC V37 */
1057 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1529, 0)},
1058 /* ViewSonic Color Pocket PC V38 */
1059 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x152b, 0)},
1060 /* ViewSonic Pocket PC */
1061 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x152e, 0)},
1062 /* ViewSonic Communicator Pocket PC */
1063 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1921, 0)},
1064 /* ViewSonic Smartphone */
1065 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1922, 0)},
1066 /* ViewSonic Pocket PC V30 */
1067 {USB_VPI(USB_VENDOR_VIEWSONIC, 0x1923, 0)},
1068};
1069
1070static device_method_t uipaq_methods[] = {
1071 DEVMETHOD(device_probe, uipaq_probe),
1072 DEVMETHOD(device_attach, uipaq_attach),
1073 DEVMETHOD(device_detach, uipaq_detach),
1074 {0, 0}
1075};
1076
1077static devclass_t uipaq_devclass;
1078
1079static driver_t uipaq_driver = {
1080 .name = "uipaq",
1081 .methods = uipaq_methods,
1082 .size = sizeof(struct uipaq_softc),
1083};
1084
1085DRIVER_MODULE(uipaq, uhub, uipaq_driver, uipaq_devclass, NULL, 0);
1086MODULE_DEPEND(uipaq, ucom, 1, 1, 1);
1087MODULE_DEPEND(uipaq, usb, 1, 1, 1);
1088
1089static int
1090uipaq_probe(device_t dev)
1091{
1092 struct usb_attach_arg *uaa = device_get_ivars(dev);
1093
1094 if (uaa->usb_mode != USB_MODE_HOST) {
1095 return (ENXIO);
1096 }
1097 if (uaa->info.bConfigIndex != UIPAQ_CONFIG_INDEX) {
1098 return (ENXIO);
1099 }
1100 if (uaa->info.bIfaceIndex != UIPAQ_IFACE_INDEX) {
1101 return (ENXIO);
1102 }
1103 if (uaa->info.bInterfaceClass == UICLASS_IAD) {
1104 DPRINTF("IAD detected - not UIPAQ serial device\n");
1105 return (ENXIO);
1106 }
1107 return (usbd_lookup_id_by_uaa(uipaq_devs, sizeof(uipaq_devs), uaa));
1108}
1109
1110static int
1111uipaq_attach(device_t dev)
1112{
1113 struct usb_device_request req;
1114 struct usb_attach_arg *uaa = device_get_ivars(dev);
1115 struct uipaq_softc *sc = device_get_softc(dev);
1116 int error;
1117 uint8_t iface_index;
1118 uint8_t i;
1119
1120 sc->sc_udev = uaa->device;
1121
1122 device_set_usb_desc(dev);
1123 mtx_init(&sc->sc_mtx, "uipaq", NULL, MTX_DEF);
1124
1125 /*
1126 * Send magic bytes, cribbed from Linux ipaq driver that
1127 * claims to have sniffed them from Win98. Wait for driver to
1128 * become ready on device side?
1129 */
1130 req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
1131 req.bRequest = UCDC_SET_CONTROL_LINE_STATE;
1132 USETW(req.wValue, UCDC_LINE_DTR);
1133 USETW(req.wIndex, 0x0);
1134 USETW(req.wLength, 0);
1135 for (i = 0; i != 64; i++) {
1136 error =
1137 usbd_do_request_flags(uaa->device, NULL, &req,
1138 NULL, 0, NULL, 100);
1139 if (error == 0)
1140 break;
1141 usb_pause_mtx(NULL, hz / 10);
1142 }
1143
1144 iface_index = UIPAQ_IFACE_INDEX;
1145 error = usbd_transfer_setup(uaa->device, &iface_index,
1146 sc->sc_xfer, uipaq_config_data,
1147 UIPAQ_N_TRANSFER, sc, &sc->sc_mtx);
1148
1149 if (error) {
1150 goto detach;
1151 }
1152 /* clear stall at first run */
1153 mtx_lock(&sc->sc_mtx);
1154 usbd_xfer_set_stall(sc->sc_xfer[UIPAQ_BULK_DT_WR]);
1155 usbd_xfer_set_stall(sc->sc_xfer[UIPAQ_BULK_DT_RD]);
1156 mtx_unlock(&sc->sc_mtx);
1157
1158 error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc,
1159 &uipaq_callback, &sc->sc_mtx);
1160 if (error) {
1161 goto detach;
1162 }
1163 return (0);
1164
1165detach:
1166 uipaq_detach(dev);
1167 return (ENXIO);
1168}
1169
1170int
1171uipaq_detach(device_t dev)
1172{
1173 struct uipaq_softc *sc = device_get_softc(dev);
1174
1175 ucom_detach(&sc->sc_super_ucom, &sc->sc_ucom, 1);
1176 usbd_transfer_unsetup(sc->sc_xfer, UIPAQ_N_TRANSFER);
1177 mtx_destroy(&sc->sc_mtx);
1178
1179 return (0);
1180}
1181
1182static void
1183uipaq_start_read(struct ucom_softc *ucom)
1184{
1185 struct uipaq_softc *sc = ucom->sc_parent;
1186
1187 /* start read endpoint */
1188 usbd_transfer_start(sc->sc_xfer[UIPAQ_BULK_DT_RD]);
1189}
1190
1191static void
1192uipaq_stop_read(struct ucom_softc *ucom)
1193{
1194 struct uipaq_softc *sc = ucom->sc_parent;
1195
1196 /* stop read endpoint */
1197 usbd_transfer_stop(sc->sc_xfer[UIPAQ_BULK_DT_RD]);
1198}
1199
1200static void
1201uipaq_start_write(struct ucom_softc *ucom)
1202{
1203 struct uipaq_softc *sc = ucom->sc_parent;
1204
1205 usbd_transfer_start(sc->sc_xfer[UIPAQ_BULK_DT_WR]);
1206}
1207
1208static void
1209uipaq_stop_write(struct ucom_softc *ucom)
1210{
1211 struct uipaq_softc *sc = ucom->sc_parent;
1212
1213 usbd_transfer_stop(sc->sc_xfer[UIPAQ_BULK_DT_WR]);
1214}
1215
1216static void
1217uipaq_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
1218{
1219 struct uipaq_softc *sc = ucom->sc_parent;
1220 struct usb_device_request req;
1221
1222 DPRINTF("onoff=%d\n", onoff);
1223
1224 if (onoff)
1225 sc->sc_line |= UCDC_LINE_DTR;
1226 else
1227 sc->sc_line &= ~UCDC_LINE_DTR;
1228
1229 req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
1230 req.bRequest = UCDC_SET_CONTROL_LINE_STATE;
1231 USETW(req.wValue, sc->sc_line);
1232 req.wIndex[0] = UIPAQ_IFACE_INDEX;
1233 req.wIndex[1] = 0;
1234 USETW(req.wLength, 0);
1235
1236 ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
1237 &req, NULL, 0, 1000);
1238}
1239
1240static void
1241uipaq_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
1242{
1243 struct uipaq_softc *sc = ucom->sc_parent;
1244 struct usb_device_request req;
1245
1246 DPRINTF("onoff=%d\n", onoff);
1247
1248 if (onoff)
1249 sc->sc_line |= UCDC_LINE_RTS;
1250 else
1251 sc->sc_line &= ~UCDC_LINE_RTS;
1252
1253 req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
1254 req.bRequest = UCDC_SET_CONTROL_LINE_STATE;
1255 USETW(req.wValue, sc->sc_line);
1256 req.wIndex[0] = UIPAQ_IFACE_INDEX;
1257 req.wIndex[1] = 0;
1258 USETW(req.wLength, 0);
1259
1260 ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
1261 &req, NULL, 0, 1000);
1262}
1263
1264static void
1265uipaq_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
1266{
1267 struct uipaq_softc *sc = ucom->sc_parent;
1268 struct usb_device_request req;
1269 uint16_t temp;
1270
1271 temp = onoff ? UCDC_BREAK_ON : UCDC_BREAK_OFF;
1272
1273 req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
1274 req.bRequest = UCDC_SEND_BREAK;
1275 USETW(req.wValue, temp);
1276 req.wIndex[0] = UIPAQ_IFACE_INDEX;
1277 req.wIndex[1] = 0;
1278 USETW(req.wLength, 0);
1279
1280 ucom_cfg_do_request(sc->sc_udev, &sc->sc_ucom,
1281 &req, NULL, 0, 1000);
1282}
1283
1284static void
1285uipaq_write_callback(struct usb_xfer *xfer, usb_error_t error)
1286{
1287 struct uipaq_softc *sc = usbd_xfer_softc(xfer);
1288 struct usb_page_cache *pc;
1289 uint32_t actlen;
1290
1291 switch (USB_GET_STATE(xfer)) {
1292 case USB_ST_SETUP:
1293 case USB_ST_TRANSFERRED:
1294tr_setup:
1295 pc = usbd_xfer_get_frame(xfer, 0);
1296 if (ucom_get_data(&sc->sc_ucom, pc, 0,
1297 UIPAQ_BUF_SIZE, &actlen)) {
1298 usbd_xfer_set_frame_len(xfer, 0, actlen);
1299 usbd_transfer_submit(xfer);
1300 }
1301 return;
1302
1303 default: /* Error */
1304 if (error != USB_ERR_CANCELLED) {
1305 /* try to clear stall first */
1306 usbd_xfer_set_stall(xfer);
1307 goto tr_setup;
1308 }
1309 return;
1310 }
1311}
1312
1313static void
1314uipaq_read_callback(struct usb_xfer *xfer, usb_error_t error)
1315{
1316 struct uipaq_softc *sc = usbd_xfer_softc(xfer);
1317 struct usb_page_cache *pc;
1318 int actlen;
1319
1320 usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL);
1321
1322 switch (USB_GET_STATE(xfer)) {
1323 case USB_ST_TRANSFERRED:
1324 pc = usbd_xfer_get_frame(xfer, 0);
1325 ucom_put_data(&sc->sc_ucom, pc, 0, actlen);
1326
1327 case USB_ST_SETUP:
1328tr_setup:
1329 usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer));
1330 usbd_transfer_submit(xfer);
1331 return;
1332
1333 default: /* Error */
1334 if (error != USB_ERR_CANCELLED) {
1335 /* try to clear stall first */
1336 usbd_xfer_set_stall(xfer);
1337 goto tr_setup;
1338 }
1339 return;
1340 }
1341}
1342
1343static void
1344uipaq_poll(struct ucom_softc *ucom)
1345{
1346 struct uipaq_softc *sc = ucom->sc_parent;
1347 usbd_transfer_poll(sc->sc_xfer, UIPAQ_N_TRANSFER);
1348}