ipaq.c 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969
  1. /*
  2. * USB Compaq iPAQ driver
  3. *
  4. * Copyright (C) 2001 - 2002
  5. * Ganesh Varadarajan <ganesh@veritas.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * (12/12/2002) ganesh
  13. * Added support for practically all devices supported by ActiveSync
  14. * on Windows. Thanks to Wes Cilldhaire <billybobjoehenrybob@hotmail.com>.
  15. *
  16. * (26/11/2002) ganesh
  17. * Added insmod options to specify product and vendor id.
  18. * Use modprobe ipaq vendor=0xfoo product=0xbar
  19. *
  20. * (26/7/2002) ganesh
  21. * Fixed up broken error handling in ipaq_open. Retry the "kickstart"
  22. * packet much harder - this drastically reduces connection failures.
  23. *
  24. * (30/4/2002) ganesh
  25. * Added support for the Casio EM500. Completely untested. Thanks
  26. * to info from Nathan <wfilardo@fuse.net>
  27. *
  28. * (19/3/2002) ganesh
  29. * Don't submit urbs while holding spinlocks. Not strictly necessary
  30. * in 2.5.x.
  31. *
  32. * (8/3/2002) ganesh
  33. * The ipaq sometimes emits a '\0' before the CLIENT string. At this
  34. * point of time, the ppp ldisc is not yet attached to the tty, so
  35. * n_tty echoes "^ " to the ipaq, which messes up the chat. In 2.5.6-pre2
  36. * this causes a panic because echo_char() tries to sleep in interrupt
  37. * context.
  38. * The fix is to tell the upper layers that this is a raw device so that
  39. * echoing is suppressed. Thanks to Lyle Lindholm for a detailed bug
  40. * report.
  41. *
  42. * (25/2/2002) ganesh
  43. * Added support for the HP Jornada 548 and 568. Completely untested.
  44. * Thanks to info from Heath Robinson and Arieh Davidoff.
  45. */
  46. #include <linux/config.h>
  47. #include <linux/kernel.h>
  48. #include <linux/errno.h>
  49. #include <linux/init.h>
  50. #include <linux/slab.h>
  51. #include <linux/tty.h>
  52. #include <linux/tty_driver.h>
  53. #include <linux/tty_flip.h>
  54. #include <linux/module.h>
  55. #include <linux/spinlock.h>
  56. #include <asm/uaccess.h>
  57. #include <linux/usb.h>
  58. #include "usb-serial.h"
  59. #include "ipaq.h"
  60. #define KP_RETRIES 100
  61. /*
  62. * Version Information
  63. */
  64. #define DRIVER_VERSION "v0.5"
  65. #define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>"
  66. #define DRIVER_DESC "USB PocketPC PDA driver"
  67. static __u16 product, vendor;
  68. static int debug;
  69. /* Function prototypes for an ipaq */
  70. static int ipaq_open (struct usb_serial_port *port, struct file *filp);
  71. static void ipaq_close (struct usb_serial_port *port, struct file *filp);
  72. static int ipaq_startup (struct usb_serial *serial);
  73. static void ipaq_shutdown (struct usb_serial *serial);
  74. static int ipaq_write(struct usb_serial_port *port, const unsigned char *buf,
  75. int count);
  76. static int ipaq_write_bulk(struct usb_serial_port *port, const unsigned char *buf,
  77. int count);
  78. static void ipaq_write_gather(struct usb_serial_port *port);
  79. static void ipaq_read_bulk_callback (struct urb *urb, struct pt_regs *regs);
  80. static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs);
  81. static int ipaq_write_room(struct usb_serial_port *port);
  82. static int ipaq_chars_in_buffer(struct usb_serial_port *port);
  83. static void ipaq_destroy_lists(struct usb_serial_port *port);
  84. static struct usb_device_id ipaq_id_table [] = {
  85. /* The first entry is a placeholder for the insmod-specified device */
  86. { USB_DEVICE(0x049F, 0x0003) },
  87. { USB_DEVICE(0x0104, 0x00BE) }, /* Socket USB Sync */
  88. { USB_DEVICE(0x03F0, 0x1016) }, /* HP USB Sync */
  89. { USB_DEVICE(0x03F0, 0x1116) }, /* HP USB Sync 1611 */
  90. { USB_DEVICE(0x03F0, 0x1216) }, /* HP USB Sync 1612 */
  91. { USB_DEVICE(0x03F0, 0x2016) }, /* HP USB Sync 1620 */
  92. { USB_DEVICE(0x03F0, 0x2116) }, /* HP USB Sync 1621 */
  93. { USB_DEVICE(0x03F0, 0x2216) }, /* HP USB Sync 1622 */
  94. { USB_DEVICE(0x03F0, 0x3016) }, /* HP USB Sync 1630 */
  95. { USB_DEVICE(0x03F0, 0x3116) }, /* HP USB Sync 1631 */
  96. { USB_DEVICE(0x03F0, 0x3216) }, /* HP USB Sync 1632 */
  97. { USB_DEVICE(0x03F0, 0x4016) }, /* HP USB Sync 1640 */
  98. { USB_DEVICE(0x03F0, 0x4116) }, /* HP USB Sync 1641 */
  99. { USB_DEVICE(0x03F0, 0x4216) }, /* HP USB Sync 1642 */
  100. { USB_DEVICE(0x03F0, 0x5016) }, /* HP USB Sync 1650 */
  101. { USB_DEVICE(0x03F0, 0x5116) }, /* HP USB Sync 1651 */
  102. { USB_DEVICE(0x03F0, 0x5216) }, /* HP USB Sync 1652 */
  103. { USB_DEVICE(0x0409, 0x00D5) }, /* NEC USB Sync */
  104. { USB_DEVICE(0x0409, 0x00D6) }, /* NEC USB Sync */
  105. { USB_DEVICE(0x0409, 0x00D7) }, /* NEC USB Sync */
  106. { USB_DEVICE(0x0409, 0x8024) }, /* NEC USB Sync */
  107. { USB_DEVICE(0x0409, 0x8025) }, /* NEC USB Sync */
  108. { USB_DEVICE(0x043E, 0x9C01) }, /* LGE USB Sync */
  109. { USB_DEVICE(0x045E, 0x00CE) }, /* Microsoft USB Sync */
  110. { USB_DEVICE(0x045E, 0x0400) }, /* Windows Powered Pocket PC 2002 */
  111. { USB_DEVICE(0x045E, 0x0401) }, /* Windows Powered Pocket PC 2002 */
  112. { USB_DEVICE(0x045E, 0x0402) }, /* Windows Powered Pocket PC 2002 */
  113. { USB_DEVICE(0x045E, 0x0403) }, /* Windows Powered Pocket PC 2002 */
  114. { USB_DEVICE(0x045E, 0x0404) }, /* Windows Powered Pocket PC 2002 */
  115. { USB_DEVICE(0x045E, 0x0405) }, /* Windows Powered Pocket PC 2002 */
  116. { USB_DEVICE(0x045E, 0x0406) }, /* Windows Powered Pocket PC 2002 */
  117. { USB_DEVICE(0x045E, 0x0407) }, /* Windows Powered Pocket PC 2002 */
  118. { USB_DEVICE(0x045E, 0x0408) }, /* Windows Powered Pocket PC 2002 */
  119. { USB_DEVICE(0x045E, 0x0409) }, /* Windows Powered Pocket PC 2002 */
  120. { USB_DEVICE(0x045E, 0x040A) }, /* Windows Powered Pocket PC 2002 */
  121. { USB_DEVICE(0x045E, 0x040B) }, /* Windows Powered Pocket PC 2002 */
  122. { USB_DEVICE(0x045E, 0x040C) }, /* Windows Powered Pocket PC 2002 */
  123. { USB_DEVICE(0x045E, 0x040D) }, /* Windows Powered Pocket PC 2002 */
  124. { USB_DEVICE(0x045E, 0x040E) }, /* Windows Powered Pocket PC 2002 */
  125. { USB_DEVICE(0x045E, 0x040F) }, /* Windows Powered Pocket PC 2002 */
  126. { USB_DEVICE(0x045E, 0x0410) }, /* Windows Powered Pocket PC 2002 */
  127. { USB_DEVICE(0x045E, 0x0411) }, /* Windows Powered Pocket PC 2002 */
  128. { USB_DEVICE(0x045E, 0x0412) }, /* Windows Powered Pocket PC 2002 */
  129. { USB_DEVICE(0x045E, 0x0413) }, /* Windows Powered Pocket PC 2002 */
  130. { USB_DEVICE(0x045E, 0x0414) }, /* Windows Powered Pocket PC 2002 */
  131. { USB_DEVICE(0x045E, 0x0415) }, /* Windows Powered Pocket PC 2002 */
  132. { USB_DEVICE(0x045E, 0x0416) }, /* Windows Powered Pocket PC 2002 */
  133. { USB_DEVICE(0x045E, 0x0417) }, /* Windows Powered Pocket PC 2002 */
  134. { USB_DEVICE(0x045E, 0x0432) }, /* Windows Powered Pocket PC 2003 */
  135. { USB_DEVICE(0x045E, 0x0433) }, /* Windows Powered Pocket PC 2003 */
  136. { USB_DEVICE(0x045E, 0x0434) }, /* Windows Powered Pocket PC 2003 */
  137. { USB_DEVICE(0x045E, 0x0435) }, /* Windows Powered Pocket PC 2003 */
  138. { USB_DEVICE(0x045E, 0x0436) }, /* Windows Powered Pocket PC 2003 */
  139. { USB_DEVICE(0x045E, 0x0437) }, /* Windows Powered Pocket PC 2003 */
  140. { USB_DEVICE(0x045E, 0x0438) }, /* Windows Powered Pocket PC 2003 */
  141. { USB_DEVICE(0x045E, 0x0439) }, /* Windows Powered Pocket PC 2003 */
  142. { USB_DEVICE(0x045E, 0x043A) }, /* Windows Powered Pocket PC 2003 */
  143. { USB_DEVICE(0x045E, 0x043B) }, /* Windows Powered Pocket PC 2003 */
  144. { USB_DEVICE(0x045E, 0x043C) }, /* Windows Powered Pocket PC 2003 */
  145. { USB_DEVICE(0x045E, 0x043D) }, /* Windows Powered Pocket PC 2003 */
  146. { USB_DEVICE(0x045E, 0x043E) }, /* Windows Powered Pocket PC 2003 */
  147. { USB_DEVICE(0x045E, 0x043F) }, /* Windows Powered Pocket PC 2003 */
  148. { USB_DEVICE(0x045E, 0x0440) }, /* Windows Powered Pocket PC 2003 */
  149. { USB_DEVICE(0x045E, 0x0441) }, /* Windows Powered Pocket PC 2003 */
  150. { USB_DEVICE(0x045E, 0x0442) }, /* Windows Powered Pocket PC 2003 */
  151. { USB_DEVICE(0x045E, 0x0443) }, /* Windows Powered Pocket PC 2003 */
  152. { USB_DEVICE(0x045E, 0x0444) }, /* Windows Powered Pocket PC 2003 */
  153. { USB_DEVICE(0x045E, 0x0445) }, /* Windows Powered Pocket PC 2003 */
  154. { USB_DEVICE(0x045E, 0x0446) }, /* Windows Powered Pocket PC 2003 */
  155. { USB_DEVICE(0x045E, 0x0447) }, /* Windows Powered Pocket PC 2003 */
  156. { USB_DEVICE(0x045E, 0x0448) }, /* Windows Powered Pocket PC 2003 */
  157. { USB_DEVICE(0x045E, 0x0449) }, /* Windows Powered Pocket PC 2003 */
  158. { USB_DEVICE(0x045E, 0x044A) }, /* Windows Powered Pocket PC 2003 */
  159. { USB_DEVICE(0x045E, 0x044B) }, /* Windows Powered Pocket PC 2003 */
  160. { USB_DEVICE(0x045E, 0x044C) }, /* Windows Powered Pocket PC 2003 */
  161. { USB_DEVICE(0x045E, 0x044D) }, /* Windows Powered Pocket PC 2003 */
  162. { USB_DEVICE(0x045E, 0x044E) }, /* Windows Powered Pocket PC 2003 */
  163. { USB_DEVICE(0x045E, 0x044F) }, /* Windows Powered Pocket PC 2003 */
  164. { USB_DEVICE(0x045E, 0x0450) }, /* Windows Powered Pocket PC 2003 */
  165. { USB_DEVICE(0x045E, 0x0451) }, /* Windows Powered Pocket PC 2003 */
  166. { USB_DEVICE(0x045E, 0x0452) }, /* Windows Powered Pocket PC 2003 */
  167. { USB_DEVICE(0x045E, 0x0453) }, /* Windows Powered Pocket PC 2003 */
  168. { USB_DEVICE(0x045E, 0x0454) }, /* Windows Powered Pocket PC 2003 */
  169. { USB_DEVICE(0x045E, 0x0455) }, /* Windows Powered Pocket PC 2003 */
  170. { USB_DEVICE(0x045E, 0x0456) }, /* Windows Powered Pocket PC 2003 */
  171. { USB_DEVICE(0x045E, 0x0457) }, /* Windows Powered Pocket PC 2003 */
  172. { USB_DEVICE(0x045E, 0x0458) }, /* Windows Powered Pocket PC 2003 */
  173. { USB_DEVICE(0x045E, 0x0459) }, /* Windows Powered Pocket PC 2003 */
  174. { USB_DEVICE(0x045E, 0x045A) }, /* Windows Powered Pocket PC 2003 */
  175. { USB_DEVICE(0x045E, 0x045B) }, /* Windows Powered Pocket PC 2003 */
  176. { USB_DEVICE(0x045E, 0x045C) }, /* Windows Powered Pocket PC 2003 */
  177. { USB_DEVICE(0x045E, 0x045D) }, /* Windows Powered Pocket PC 2003 */
  178. { USB_DEVICE(0x045E, 0x045E) }, /* Windows Powered Pocket PC 2003 */
  179. { USB_DEVICE(0x045E, 0x045F) }, /* Windows Powered Pocket PC 2003 */
  180. { USB_DEVICE(0x045E, 0x0460) }, /* Windows Powered Pocket PC 2003 */
  181. { USB_DEVICE(0x045E, 0x0461) }, /* Windows Powered Pocket PC 2003 */
  182. { USB_DEVICE(0x045E, 0x0462) }, /* Windows Powered Pocket PC 2003 */
  183. { USB_DEVICE(0x045E, 0x0463) }, /* Windows Powered Pocket PC 2003 */
  184. { USB_DEVICE(0x045E, 0x0464) }, /* Windows Powered Pocket PC 2003 */
  185. { USB_DEVICE(0x045E, 0x0465) }, /* Windows Powered Pocket PC 2003 */
  186. { USB_DEVICE(0x045E, 0x0466) }, /* Windows Powered Pocket PC 2003 */
  187. { USB_DEVICE(0x045E, 0x0467) }, /* Windows Powered Pocket PC 2003 */
  188. { USB_DEVICE(0x045E, 0x0468) }, /* Windows Powered Pocket PC 2003 */
  189. { USB_DEVICE(0x045E, 0x0469) }, /* Windows Powered Pocket PC 2003 */
  190. { USB_DEVICE(0x045E, 0x046A) }, /* Windows Powered Pocket PC 2003 */
  191. { USB_DEVICE(0x045E, 0x046B) }, /* Windows Powered Pocket PC 2003 */
  192. { USB_DEVICE(0x045E, 0x046C) }, /* Windows Powered Pocket PC 2003 */
  193. { USB_DEVICE(0x045E, 0x046D) }, /* Windows Powered Pocket PC 2003 */
  194. { USB_DEVICE(0x045E, 0x046E) }, /* Windows Powered Pocket PC 2003 */
  195. { USB_DEVICE(0x045E, 0x046F) }, /* Windows Powered Pocket PC 2003 */
  196. { USB_DEVICE(0x045E, 0x0470) }, /* Windows Powered Pocket PC 2003 */
  197. { USB_DEVICE(0x045E, 0x0471) }, /* Windows Powered Pocket PC 2003 */
  198. { USB_DEVICE(0x045E, 0x0472) }, /* Windows Powered Pocket PC 2003 */
  199. { USB_DEVICE(0x045E, 0x0473) }, /* Windows Powered Pocket PC 2003 */
  200. { USB_DEVICE(0x045E, 0x0474) }, /* Windows Powered Pocket PC 2003 */
  201. { USB_DEVICE(0x045E, 0x0475) }, /* Windows Powered Pocket PC 2003 */
  202. { USB_DEVICE(0x045E, 0x0476) }, /* Windows Powered Pocket PC 2003 */
  203. { USB_DEVICE(0x045E, 0x0477) }, /* Windows Powered Pocket PC 2003 */
  204. { USB_DEVICE(0x045E, 0x0478) }, /* Windows Powered Pocket PC 2003 */
  205. { USB_DEVICE(0x045E, 0x0479) }, /* Windows Powered Pocket PC 2003 */
  206. { USB_DEVICE(0x045E, 0x047A) }, /* Windows Powered Pocket PC 2003 */
  207. { USB_DEVICE(0x045E, 0x047B) }, /* Windows Powered Pocket PC 2003 */
  208. { USB_DEVICE(0x045E, 0x04C8) }, /* Windows Powered Smartphone 2002 */
  209. { USB_DEVICE(0x045E, 0x04C9) }, /* Windows Powered Smartphone 2002 */
  210. { USB_DEVICE(0x045E, 0x04CA) }, /* Windows Powered Smartphone 2002 */
  211. { USB_DEVICE(0x045E, 0x04CB) }, /* Windows Powered Smartphone 2002 */
  212. { USB_DEVICE(0x045E, 0x04CC) }, /* Windows Powered Smartphone 2002 */
  213. { USB_DEVICE(0x045E, 0x04CD) }, /* Windows Powered Smartphone 2002 */
  214. { USB_DEVICE(0x045E, 0x04CE) }, /* Windows Powered Smartphone 2002 */
  215. { USB_DEVICE(0x045E, 0x04D7) }, /* Windows Powered Smartphone 2003 */
  216. { USB_DEVICE(0x045E, 0x04D8) }, /* Windows Powered Smartphone 2003 */
  217. { USB_DEVICE(0x045E, 0x04D9) }, /* Windows Powered Smartphone 2003 */
  218. { USB_DEVICE(0x045E, 0x04DA) }, /* Windows Powered Smartphone 2003 */
  219. { USB_DEVICE(0x045E, 0x04DB) }, /* Windows Powered Smartphone 2003 */
  220. { USB_DEVICE(0x045E, 0x04DC) }, /* Windows Powered Smartphone 2003 */
  221. { USB_DEVICE(0x045E, 0x04DD) }, /* Windows Powered Smartphone 2003 */
  222. { USB_DEVICE(0x045E, 0x04DE) }, /* Windows Powered Smartphone 2003 */
  223. { USB_DEVICE(0x045E, 0x04DF) }, /* Windows Powered Smartphone 2003 */
  224. { USB_DEVICE(0x045E, 0x04E0) }, /* Windows Powered Smartphone 2003 */
  225. { USB_DEVICE(0x045E, 0x04E1) }, /* Windows Powered Smartphone 2003 */
  226. { USB_DEVICE(0x045E, 0x04E2) }, /* Windows Powered Smartphone 2003 */
  227. { USB_DEVICE(0x045E, 0x04E3) }, /* Windows Powered Smartphone 2003 */
  228. { USB_DEVICE(0x045E, 0x04E4) }, /* Windows Powered Smartphone 2003 */
  229. { USB_DEVICE(0x045E, 0x04E5) }, /* Windows Powered Smartphone 2003 */
  230. { USB_DEVICE(0x045E, 0x04E6) }, /* Windows Powered Smartphone 2003 */
  231. { USB_DEVICE(0x045E, 0x04E7) }, /* Windows Powered Smartphone 2003 */
  232. { USB_DEVICE(0x045E, 0x04E8) }, /* Windows Powered Smartphone 2003 */
  233. { USB_DEVICE(0x045E, 0x04E9) }, /* Windows Powered Smartphone 2003 */
  234. { USB_DEVICE(0x045E, 0x04EA) }, /* Windows Powered Smartphone 2003 */
  235. { USB_DEVICE(0x049F, 0x0003) }, /* Compaq iPAQ USB Sync */
  236. { USB_DEVICE(0x049F, 0x0032) }, /* Compaq iPAQ USB Sync */
  237. { USB_DEVICE(0x04A4, 0x0014) }, /* Hitachi USB Sync */
  238. { USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */
  239. { USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */
  240. { USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */
  241. { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */
  242. { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */
  243. { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */
  244. { USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */
  245. { USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */
  246. { USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */
  247. { USB_DEVICE(0x04E8, 0x5F03) }, /* Samsung NEXiO USB Sync */
  248. { USB_DEVICE(0x04E8, 0x5F04) }, /* Samsung NEXiO USB Sync */
  249. { USB_DEVICE(0x04E8, 0x6611) }, /* Samsung MITs USB Sync */
  250. { USB_DEVICE(0x04E8, 0x6613) }, /* Samsung MITs USB Sync */
  251. { USB_DEVICE(0x04E8, 0x6615) }, /* Samsung MITs USB Sync */
  252. { USB_DEVICE(0x04E8, 0x6617) }, /* Samsung MITs USB Sync */
  253. { USB_DEVICE(0x04E8, 0x6619) }, /* Samsung MITs USB Sync */
  254. { USB_DEVICE(0x04E8, 0x661B) }, /* Samsung MITs USB Sync */
  255. { USB_DEVICE(0x04E8, 0x662E) }, /* Samsung MITs USB Sync */
  256. { USB_DEVICE(0x04E8, 0x6630) }, /* Samsung MITs USB Sync */
  257. { USB_DEVICE(0x04E8, 0x6632) }, /* Samsung MITs USB Sync */
  258. { USB_DEVICE(0x04f1, 0x3011) }, /* JVC USB Sync */
  259. { USB_DEVICE(0x04F1, 0x3012) }, /* JVC USB Sync */
  260. { USB_DEVICE(0x0502, 0x1631) }, /* c10 Series */
  261. { USB_DEVICE(0x0502, 0x1632) }, /* c20 Series */
  262. { USB_DEVICE(0x0502, 0x16E1) }, /* Acer n10 Handheld USB Sync */
  263. { USB_DEVICE(0x0502, 0x16E2) }, /* Acer n20 Handheld USB Sync */
  264. { USB_DEVICE(0x0502, 0x16E3) }, /* Acer n30 Handheld USB Sync */
  265. { USB_DEVICE(0x0536, 0x01A0) }, /* HHP PDT */
  266. { USB_DEVICE(0x0543, 0x0ED9) }, /* ViewSonic Color Pocket PC V35 */
  267. { USB_DEVICE(0x0543, 0x1527) }, /* ViewSonic Color Pocket PC V36 */
  268. { USB_DEVICE(0x0543, 0x1529) }, /* ViewSonic Color Pocket PC V37 */
  269. { USB_DEVICE(0x0543, 0x152B) }, /* ViewSonic Color Pocket PC V38 */
  270. { USB_DEVICE(0x0543, 0x152E) }, /* ViewSonic Pocket PC */
  271. { USB_DEVICE(0x0543, 0x1921) }, /* ViewSonic Communicator Pocket PC */
  272. { USB_DEVICE(0x0543, 0x1922) }, /* ViewSonic Smartphone */
  273. { USB_DEVICE(0x0543, 0x1923) }, /* ViewSonic Pocket PC V30 */
  274. { USB_DEVICE(0x05E0, 0x2000) }, /* Symbol USB Sync */
  275. { USB_DEVICE(0x05E0, 0x2001) }, /* Symbol USB Sync 0x2001 */
  276. { USB_DEVICE(0x05E0, 0x2002) }, /* Symbol USB Sync 0x2002 */
  277. { USB_DEVICE(0x05E0, 0x2003) }, /* Symbol USB Sync 0x2003 */
  278. { USB_DEVICE(0x05E0, 0x2004) }, /* Symbol USB Sync 0x2004 */
  279. { USB_DEVICE(0x05E0, 0x2005) }, /* Symbol USB Sync 0x2005 */
  280. { USB_DEVICE(0x05E0, 0x2006) }, /* Symbol USB Sync 0x2006 */
  281. { USB_DEVICE(0x05E0, 0x2007) }, /* Symbol USB Sync 0x2007 */
  282. { USB_DEVICE(0x05E0, 0x2008) }, /* Symbol USB Sync 0x2008 */
  283. { USB_DEVICE(0x05E0, 0x2009) }, /* Symbol USB Sync 0x2009 */
  284. { USB_DEVICE(0x05E0, 0x200A) }, /* Symbol USB Sync 0x200A */
  285. { USB_DEVICE(0x067E, 0x1001) }, /* Intermec Mobile Computer */
  286. { USB_DEVICE(0x07CF, 0x2001) }, /* CASIO USB Sync 2001 */
  287. { USB_DEVICE(0x07CF, 0x2002) }, /* CASIO USB Sync 2002 */
  288. { USB_DEVICE(0x07CF, 0x2003) }, /* CASIO USB Sync 2003 */
  289. { USB_DEVICE(0x0930, 0x0700) }, /* TOSHIBA USB Sync 0700 */
  290. { USB_DEVICE(0x0930, 0x0705) }, /* TOSHIBA Pocket PC e310 */
  291. { USB_DEVICE(0x0930, 0x0706) }, /* TOSHIBA Pocket PC e740 */
  292. { USB_DEVICE(0x0930, 0x0707) }, /* TOSHIBA Pocket PC e330 Series */
  293. { USB_DEVICE(0x0930, 0x0708) }, /* TOSHIBA Pocket PC e350 Series */
  294. { USB_DEVICE(0x0930, 0x0709) }, /* TOSHIBA Pocket PC e750 Series */
  295. { USB_DEVICE(0x0930, 0x070A) }, /* TOSHIBA Pocket PC e400 Series */
  296. { USB_DEVICE(0x0930, 0x070B) }, /* TOSHIBA Pocket PC e800 Series */
  297. { USB_DEVICE(0x094B, 0x0001) }, /* Linkup Systems USB Sync */
  298. { USB_DEVICE(0x0960, 0x0065) }, /* BCOM USB Sync 0065 */
  299. { USB_DEVICE(0x0960, 0x0066) }, /* BCOM USB Sync 0066 */
  300. { USB_DEVICE(0x0960, 0x0067) }, /* BCOM USB Sync 0067 */
  301. { USB_DEVICE(0x0961, 0x0010) }, /* Portatec USB Sync */
  302. { USB_DEVICE(0x099E, 0x0052) }, /* Trimble GeoExplorer */
  303. { USB_DEVICE(0x099E, 0x4000) }, /* TDS Data Collector */
  304. { USB_DEVICE(0x0B05, 0x4200) }, /* ASUS USB Sync */
  305. { USB_DEVICE(0x0B05, 0x4201) }, /* ASUS USB Sync */
  306. { USB_DEVICE(0x0B05, 0x4202) }, /* ASUS USB Sync */
  307. { USB_DEVICE(0x0B05, 0x420F) }, /* ASUS USB Sync */
  308. { USB_DEVICE(0x0B05, 0x9200) }, /* ASUS USB Sync */
  309. { USB_DEVICE(0x0B05, 0x9202) }, /* ASUS USB Sync */
  310. { USB_DEVICE(0x0BB4, 0x00CE) }, /* HTC USB Sync */
  311. { USB_DEVICE(0x0BB4, 0x0A01) }, /* PocketPC USB Sync */
  312. { USB_DEVICE(0x0BB4, 0x0A02) }, /* PocketPC USB Sync */
  313. { USB_DEVICE(0x0BB4, 0x0A03) }, /* PocketPC USB Sync */
  314. { USB_DEVICE(0x0BB4, 0x0A04) }, /* PocketPC USB Sync */
  315. { USB_DEVICE(0x0BB4, 0x0A05) }, /* PocketPC USB Sync */
  316. { USB_DEVICE(0x0BB4, 0x0A06) }, /* PocketPC USB Sync */
  317. { USB_DEVICE(0x0BB4, 0x0A07) }, /* PocketPC USB Sync */
  318. { USB_DEVICE(0x0BB4, 0x0A08) }, /* PocketPC USB Sync */
  319. { USB_DEVICE(0x0BB4, 0x0A09) }, /* PocketPC USB Sync */
  320. { USB_DEVICE(0x0BB4, 0x0A0A) }, /* PocketPC USB Sync */
  321. { USB_DEVICE(0x0BB4, 0x0A0B) }, /* PocketPC USB Sync */
  322. { USB_DEVICE(0x0BB4, 0x0A0C) }, /* PocketPC USB Sync */
  323. { USB_DEVICE(0x0BB4, 0x0A0D) }, /* PocketPC USB Sync */
  324. { USB_DEVICE(0x0BB4, 0x0A0E) }, /* PocketPC USB Sync */
  325. { USB_DEVICE(0x0BB4, 0x0A0F) }, /* PocketPC USB Sync */
  326. { USB_DEVICE(0x0BB4, 0x0A10) }, /* PocketPC USB Sync */
  327. { USB_DEVICE(0x0BB4, 0x0A11) }, /* PocketPC USB Sync */
  328. { USB_DEVICE(0x0BB4, 0x0A12) }, /* PocketPC USB Sync */
  329. { USB_DEVICE(0x0BB4, 0x0A13) }, /* PocketPC USB Sync */
  330. { USB_DEVICE(0x0BB4, 0x0A14) }, /* PocketPC USB Sync */
  331. { USB_DEVICE(0x0BB4, 0x0A15) }, /* PocketPC USB Sync */
  332. { USB_DEVICE(0x0BB4, 0x0A16) }, /* PocketPC USB Sync */
  333. { USB_DEVICE(0x0BB4, 0x0A17) }, /* PocketPC USB Sync */
  334. { USB_DEVICE(0x0BB4, 0x0A18) }, /* PocketPC USB Sync */
  335. { USB_DEVICE(0x0BB4, 0x0A19) }, /* PocketPC USB Sync */
  336. { USB_DEVICE(0x0BB4, 0x0A1A) }, /* PocketPC USB Sync */
  337. { USB_DEVICE(0x0BB4, 0x0A1B) }, /* PocketPC USB Sync */
  338. { USB_DEVICE(0x0BB4, 0x0A1C) }, /* PocketPC USB Sync */
  339. { USB_DEVICE(0x0BB4, 0x0A1D) }, /* PocketPC USB Sync */
  340. { USB_DEVICE(0x0BB4, 0x0A1E) }, /* PocketPC USB Sync */
  341. { USB_DEVICE(0x0BB4, 0x0A1F) }, /* PocketPC USB Sync */
  342. { USB_DEVICE(0x0BB4, 0x0A20) }, /* PocketPC USB Sync */
  343. { USB_DEVICE(0x0BB4, 0x0A21) }, /* PocketPC USB Sync */
  344. { USB_DEVICE(0x0BB4, 0x0A22) }, /* PocketPC USB Sync */
  345. { USB_DEVICE(0x0BB4, 0x0A23) }, /* PocketPC USB Sync */
  346. { USB_DEVICE(0x0BB4, 0x0A24) }, /* PocketPC USB Sync */
  347. { USB_DEVICE(0x0BB4, 0x0A25) }, /* PocketPC USB Sync */
  348. { USB_DEVICE(0x0BB4, 0x0A26) }, /* PocketPC USB Sync */
  349. { USB_DEVICE(0x0BB4, 0x0A27) }, /* PocketPC USB Sync */
  350. { USB_DEVICE(0x0BB4, 0x0A28) }, /* PocketPC USB Sync */
  351. { USB_DEVICE(0x0BB4, 0x0A29) }, /* PocketPC USB Sync */
  352. { USB_DEVICE(0x0BB4, 0x0A2A) }, /* PocketPC USB Sync */
  353. { USB_DEVICE(0x0BB4, 0x0A2B) }, /* PocketPC USB Sync */
  354. { USB_DEVICE(0x0BB4, 0x0A2C) }, /* PocketPC USB Sync */
  355. { USB_DEVICE(0x0BB4, 0x0A2D) }, /* PocketPC USB Sync */
  356. { USB_DEVICE(0x0BB4, 0x0A2E) }, /* PocketPC USB Sync */
  357. { USB_DEVICE(0x0BB4, 0x0A2F) }, /* PocketPC USB Sync */
  358. { USB_DEVICE(0x0BB4, 0x0A30) }, /* PocketPC USB Sync */
  359. { USB_DEVICE(0x0BB4, 0x0A31) }, /* PocketPC USB Sync */
  360. { USB_DEVICE(0x0BB4, 0x0A32) }, /* PocketPC USB Sync */
  361. { USB_DEVICE(0x0BB4, 0x0A33) }, /* PocketPC USB Sync */
  362. { USB_DEVICE(0x0BB4, 0x0A34) }, /* PocketPC USB Sync */
  363. { USB_DEVICE(0x0BB4, 0x0A35) }, /* PocketPC USB Sync */
  364. { USB_DEVICE(0x0BB4, 0x0A36) }, /* PocketPC USB Sync */
  365. { USB_DEVICE(0x0BB4, 0x0A37) }, /* PocketPC USB Sync */
  366. { USB_DEVICE(0x0BB4, 0x0A38) }, /* PocketPC USB Sync */
  367. { USB_DEVICE(0x0BB4, 0x0A39) }, /* PocketPC USB Sync */
  368. { USB_DEVICE(0x0BB4, 0x0A3A) }, /* PocketPC USB Sync */
  369. { USB_DEVICE(0x0BB4, 0x0A3B) }, /* PocketPC USB Sync */
  370. { USB_DEVICE(0x0BB4, 0x0A3C) }, /* PocketPC USB Sync */
  371. { USB_DEVICE(0x0BB4, 0x0A3D) }, /* PocketPC USB Sync */
  372. { USB_DEVICE(0x0BB4, 0x0A3E) }, /* PocketPC USB Sync */
  373. { USB_DEVICE(0x0BB4, 0x0A3F) }, /* PocketPC USB Sync */
  374. { USB_DEVICE(0x0BB4, 0x0A40) }, /* PocketPC USB Sync */
  375. { USB_DEVICE(0x0BB4, 0x0A41) }, /* PocketPC USB Sync */
  376. { USB_DEVICE(0x0BB4, 0x0A42) }, /* PocketPC USB Sync */
  377. { USB_DEVICE(0x0BB4, 0x0A43) }, /* PocketPC USB Sync */
  378. { USB_DEVICE(0x0BB4, 0x0A44) }, /* PocketPC USB Sync */
  379. { USB_DEVICE(0x0BB4, 0x0A45) }, /* PocketPC USB Sync */
  380. { USB_DEVICE(0x0BB4, 0x0A46) }, /* PocketPC USB Sync */
  381. { USB_DEVICE(0x0BB4, 0x0A47) }, /* PocketPC USB Sync */
  382. { USB_DEVICE(0x0BB4, 0x0A48) }, /* PocketPC USB Sync */
  383. { USB_DEVICE(0x0BB4, 0x0A49) }, /* PocketPC USB Sync */
  384. { USB_DEVICE(0x0BB4, 0x0A4A) }, /* PocketPC USB Sync */
  385. { USB_DEVICE(0x0BB4, 0x0A4B) }, /* PocketPC USB Sync */
  386. { USB_DEVICE(0x0BB4, 0x0A4C) }, /* PocketPC USB Sync */
  387. { USB_DEVICE(0x0BB4, 0x0A4D) }, /* PocketPC USB Sync */
  388. { USB_DEVICE(0x0BB4, 0x0A4E) }, /* PocketPC USB Sync */
  389. { USB_DEVICE(0x0BB4, 0x0A4F) }, /* PocketPC USB Sync */
  390. { USB_DEVICE(0x0BB4, 0x0A50) }, /* HTC SmartPhone USB Sync */
  391. { USB_DEVICE(0x0BB4, 0x0A51) }, /* SmartPhone USB Sync */
  392. { USB_DEVICE(0x0BB4, 0x0A52) }, /* SmartPhone USB Sync */
  393. { USB_DEVICE(0x0BB4, 0x0A53) }, /* SmartPhone USB Sync */
  394. { USB_DEVICE(0x0BB4, 0x0A54) }, /* SmartPhone USB Sync */
  395. { USB_DEVICE(0x0BB4, 0x0A55) }, /* SmartPhone USB Sync */
  396. { USB_DEVICE(0x0BB4, 0x0A56) }, /* SmartPhone USB Sync */
  397. { USB_DEVICE(0x0BB4, 0x0A57) }, /* SmartPhone USB Sync */
  398. { USB_DEVICE(0x0BB4, 0x0A58) }, /* SmartPhone USB Sync */
  399. { USB_DEVICE(0x0BB4, 0x0A59) }, /* SmartPhone USB Sync */
  400. { USB_DEVICE(0x0BB4, 0x0A5A) }, /* SmartPhone USB Sync */
  401. { USB_DEVICE(0x0BB4, 0x0A5B) }, /* SmartPhone USB Sync */
  402. { USB_DEVICE(0x0BB4, 0x0A5C) }, /* SmartPhone USB Sync */
  403. { USB_DEVICE(0x0BB4, 0x0A5D) }, /* SmartPhone USB Sync */
  404. { USB_DEVICE(0x0BB4, 0x0A5E) }, /* SmartPhone USB Sync */
  405. { USB_DEVICE(0x0BB4, 0x0A5F) }, /* SmartPhone USB Sync */
  406. { USB_DEVICE(0x0BB4, 0x0A60) }, /* SmartPhone USB Sync */
  407. { USB_DEVICE(0x0BB4, 0x0A61) }, /* SmartPhone USB Sync */
  408. { USB_DEVICE(0x0BB4, 0x0A62) }, /* SmartPhone USB Sync */
  409. { USB_DEVICE(0x0BB4, 0x0A63) }, /* SmartPhone USB Sync */
  410. { USB_DEVICE(0x0BB4, 0x0A64) }, /* SmartPhone USB Sync */
  411. { USB_DEVICE(0x0BB4, 0x0A65) }, /* SmartPhone USB Sync */
  412. { USB_DEVICE(0x0BB4, 0x0A66) }, /* SmartPhone USB Sync */
  413. { USB_DEVICE(0x0BB4, 0x0A67) }, /* SmartPhone USB Sync */
  414. { USB_DEVICE(0x0BB4, 0x0A68) }, /* SmartPhone USB Sync */
  415. { USB_DEVICE(0x0BB4, 0x0A69) }, /* SmartPhone USB Sync */
  416. { USB_DEVICE(0x0BB4, 0x0A6A) }, /* SmartPhone USB Sync */
  417. { USB_DEVICE(0x0BB4, 0x0A6B) }, /* SmartPhone USB Sync */
  418. { USB_DEVICE(0x0BB4, 0x0A6C) }, /* SmartPhone USB Sync */
  419. { USB_DEVICE(0x0BB4, 0x0A6D) }, /* SmartPhone USB Sync */
  420. { USB_DEVICE(0x0BB4, 0x0A6E) }, /* SmartPhone USB Sync */
  421. { USB_DEVICE(0x0BB4, 0x0A6F) }, /* SmartPhone USB Sync */
  422. { USB_DEVICE(0x0BB4, 0x0A70) }, /* SmartPhone USB Sync */
  423. { USB_DEVICE(0x0BB4, 0x0A71) }, /* SmartPhone USB Sync */
  424. { USB_DEVICE(0x0BB4, 0x0A72) }, /* SmartPhone USB Sync */
  425. { USB_DEVICE(0x0BB4, 0x0A73) }, /* SmartPhone USB Sync */
  426. { USB_DEVICE(0x0BB4, 0x0A74) }, /* SmartPhone USB Sync */
  427. { USB_DEVICE(0x0BB4, 0x0A75) }, /* SmartPhone USB Sync */
  428. { USB_DEVICE(0x0BB4, 0x0A76) }, /* SmartPhone USB Sync */
  429. { USB_DEVICE(0x0BB4, 0x0A77) }, /* SmartPhone USB Sync */
  430. { USB_DEVICE(0x0BB4, 0x0A78) }, /* SmartPhone USB Sync */
  431. { USB_DEVICE(0x0BB4, 0x0A79) }, /* SmartPhone USB Sync */
  432. { USB_DEVICE(0x0BB4, 0x0A7A) }, /* SmartPhone USB Sync */
  433. { USB_DEVICE(0x0BB4, 0x0A7B) }, /* SmartPhone USB Sync */
  434. { USB_DEVICE(0x0BB4, 0x0A7C) }, /* SmartPhone USB Sync */
  435. { USB_DEVICE(0x0BB4, 0x0A7D) }, /* SmartPhone USB Sync */
  436. { USB_DEVICE(0x0BB4, 0x0A7E) }, /* SmartPhone USB Sync */
  437. { USB_DEVICE(0x0BB4, 0x0A7F) }, /* SmartPhone USB Sync */
  438. { USB_DEVICE(0x0BB4, 0x0A80) }, /* SmartPhone USB Sync */
  439. { USB_DEVICE(0x0BB4, 0x0A81) }, /* SmartPhone USB Sync */
  440. { USB_DEVICE(0x0BB4, 0x0A82) }, /* SmartPhone USB Sync */
  441. { USB_DEVICE(0x0BB4, 0x0A83) }, /* SmartPhone USB Sync */
  442. { USB_DEVICE(0x0BB4, 0x0A84) }, /* SmartPhone USB Sync */
  443. { USB_DEVICE(0x0BB4, 0x0A85) }, /* SmartPhone USB Sync */
  444. { USB_DEVICE(0x0BB4, 0x0A86) }, /* SmartPhone USB Sync */
  445. { USB_DEVICE(0x0BB4, 0x0A87) }, /* SmartPhone USB Sync */
  446. { USB_DEVICE(0x0BB4, 0x0A88) }, /* SmartPhone USB Sync */
  447. { USB_DEVICE(0x0BB4, 0x0A89) }, /* SmartPhone USB Sync */
  448. { USB_DEVICE(0x0BB4, 0x0A8A) }, /* SmartPhone USB Sync */
  449. { USB_DEVICE(0x0BB4, 0x0A8B) }, /* SmartPhone USB Sync */
  450. { USB_DEVICE(0x0BB4, 0x0A8C) }, /* SmartPhone USB Sync */
  451. { USB_DEVICE(0x0BB4, 0x0A8D) }, /* SmartPhone USB Sync */
  452. { USB_DEVICE(0x0BB4, 0x0A8E) }, /* SmartPhone USB Sync */
  453. { USB_DEVICE(0x0BB4, 0x0A8F) }, /* SmartPhone USB Sync */
  454. { USB_DEVICE(0x0BB4, 0x0A90) }, /* SmartPhone USB Sync */
  455. { USB_DEVICE(0x0BB4, 0x0A91) }, /* SmartPhone USB Sync */
  456. { USB_DEVICE(0x0BB4, 0x0A92) }, /* SmartPhone USB Sync */
  457. { USB_DEVICE(0x0BB4, 0x0A93) }, /* SmartPhone USB Sync */
  458. { USB_DEVICE(0x0BB4, 0x0A94) }, /* SmartPhone USB Sync */
  459. { USB_DEVICE(0x0BB4, 0x0A95) }, /* SmartPhone USB Sync */
  460. { USB_DEVICE(0x0BB4, 0x0A96) }, /* SmartPhone USB Sync */
  461. { USB_DEVICE(0x0BB4, 0x0A97) }, /* SmartPhone USB Sync */
  462. { USB_DEVICE(0x0BB4, 0x0A98) }, /* SmartPhone USB Sync */
  463. { USB_DEVICE(0x0BB4, 0x0A99) }, /* SmartPhone USB Sync */
  464. { USB_DEVICE(0x0BB4, 0x0A9A) }, /* SmartPhone USB Sync */
  465. { USB_DEVICE(0x0BB4, 0x0A9B) }, /* SmartPhone USB Sync */
  466. { USB_DEVICE(0x0BB4, 0x0A9C) }, /* SmartPhone USB Sync */
  467. { USB_DEVICE(0x0BB4, 0x0A9D) }, /* SmartPhone USB Sync */
  468. { USB_DEVICE(0x0BB4, 0x0A9E) }, /* SmartPhone USB Sync */
  469. { USB_DEVICE(0x0BB4, 0x0A9F) }, /* SmartPhone USB Sync */
  470. { USB_DEVICE(0x0BF8, 0x1001) }, /* Fujitsu Siemens Computers USB Sync */
  471. { USB_DEVICE(0x0C44, 0x03A2) }, /* Motorola iDEN Smartphone */
  472. { USB_DEVICE(0x0C8E, 0x6000) }, /* Cesscom Luxian Series */
  473. { USB_DEVICE(0x0CAD, 0x9001) }, /* Motorola PowerPad Pocket PC Device */
  474. { USB_DEVICE(0x0F4E, 0x0200) }, /* Freedom Scientific USB Sync */
  475. { USB_DEVICE(0x0F98, 0x0201) }, /* Cyberbank USB Sync */
  476. { USB_DEVICE(0x0FB8, 0x3001) }, /* Wistron USB Sync */
  477. { USB_DEVICE(0x0FB8, 0x3002) }, /* Wistron USB Sync */
  478. { USB_DEVICE(0x0FB8, 0x3003) }, /* Wistron USB Sync */
  479. { USB_DEVICE(0x0FB8, 0x4001) }, /* Wistron USB Sync */
  480. { USB_DEVICE(0x1066, 0x00CE) }, /* E-TEN USB Sync */
  481. { USB_DEVICE(0x1066, 0x0300) }, /* E-TEN P3XX Pocket PC */
  482. { USB_DEVICE(0x1066, 0x0500) }, /* E-TEN P5XX Pocket PC */
  483. { USB_DEVICE(0x1066, 0x0600) }, /* E-TEN P6XX Pocket PC */
  484. { USB_DEVICE(0x1066, 0x0700) }, /* E-TEN P7XX Pocket PC */
  485. { USB_DEVICE(0x1114, 0x0001) }, /* Psion Teklogix Sync 753x */
  486. { USB_DEVICE(0x1114, 0x0004) }, /* Psion Teklogix Sync netBookPro */
  487. { USB_DEVICE(0x1114, 0x0006) }, /* Psion Teklogix Sync 7525 */
  488. { USB_DEVICE(0x1182, 0x1388) }, /* VES USB Sync */
  489. { USB_DEVICE(0x11D9, 0x1002) }, /* Rugged Pocket PC 2003 */
  490. { USB_DEVICE(0x11D9, 0x1003) }, /* Rugged Pocket PC 2003 */
  491. { USB_DEVICE(0x1231, 0xCE01) }, /* USB Sync 03 */
  492. { USB_DEVICE(0x1231, 0xCE02) }, /* USB Sync 03 */
  493. { USB_DEVICE(0x1690, 0x0601) }, /* Askey USB Sync */
  494. { USB_DEVICE(0x22B8, 0x4204) }, /* Motorola MPx200 Smartphone */
  495. { USB_DEVICE(0x22B8, 0x4214) }, /* Motorola MPc GSM */
  496. { USB_DEVICE(0x22B8, 0x4224) }, /* Motorola MPx220 Smartphone */
  497. { USB_DEVICE(0x22B8, 0x4234) }, /* Motorola MPc CDMA */
  498. { USB_DEVICE(0x22B8, 0x4244) }, /* Motorola MPx100 Smartphone */
  499. { USB_DEVICE(0x3340, 0x011C) }, /* Mio DigiWalker PPC StrongARM */
  500. { USB_DEVICE(0x3340, 0x0326) }, /* Mio DigiWalker 338 */
  501. { USB_DEVICE(0x3340, 0x0426) }, /* Mio DigiWalker 338 */
  502. { USB_DEVICE(0x3340, 0x043A) }, /* Mio DigiWalker USB Sync */
  503. { USB_DEVICE(0x3340, 0x051C) }, /* MiTAC USB Sync 528 */
  504. { USB_DEVICE(0x3340, 0x053A) }, /* Mio DigiWalker SmartPhone USB Sync */
  505. { USB_DEVICE(0x3340, 0x071C) }, /* MiTAC USB Sync */
  506. { USB_DEVICE(0x3340, 0x0B1C) }, /* Generic PPC StrongARM */
  507. { USB_DEVICE(0x3340, 0x0E3A) }, /* Generic PPC USB Sync */
  508. { USB_DEVICE(0x3340, 0x0F1C) }, /* Itautec USB Sync */
  509. { USB_DEVICE(0x3340, 0x0F3A) }, /* Generic SmartPhone USB Sync */
  510. { USB_DEVICE(0x3340, 0x1326) }, /* Itautec USB Sync */
  511. { USB_DEVICE(0x3340, 0x191C) }, /* YAKUMO USB Sync */
  512. { USB_DEVICE(0x3340, 0x2326) }, /* Vobis USB Sync */
  513. { USB_DEVICE(0x3340, 0x3326) }, /* MEDION Winodws Moble USB Sync */
  514. { USB_DEVICE(0x3708, 0x20CE) }, /* Legend USB Sync */
  515. { USB_DEVICE(0x3708, 0x21CE) }, /* Lenovo USB Sync */
  516. { USB_DEVICE(0x4113, 0x0210) }, /* Mobile Media Technology USB Sync */
  517. { USB_DEVICE(0x4113, 0x0211) }, /* Mobile Media Technology USB Sync */
  518. { USB_DEVICE(0x4113, 0x0400) }, /* Mobile Media Technology USB Sync */
  519. { USB_DEVICE(0x4113, 0x0410) }, /* Mobile Media Technology USB Sync */
  520. { USB_DEVICE(0x413C, 0x4001) }, /* Dell Axim USB Sync */
  521. { USB_DEVICE(0x413C, 0x4002) }, /* Dell Axim USB Sync */
  522. { USB_DEVICE(0x413C, 0x4003) }, /* Dell Axim USB Sync */
  523. { USB_DEVICE(0x413C, 0x4004) }, /* Dell Axim USB Sync */
  524. { USB_DEVICE(0x413C, 0x4005) }, /* Dell Axim USB Sync */
  525. { USB_DEVICE(0x413C, 0x4006) }, /* Dell Axim USB Sync */
  526. { USB_DEVICE(0x413C, 0x4007) }, /* Dell Axim USB Sync */
  527. { USB_DEVICE(0x413C, 0x4008) }, /* Dell Axim USB Sync */
  528. { USB_DEVICE(0x413C, 0x4009) }, /* Dell Axim USB Sync */
  529. { USB_DEVICE(0x4505, 0x0010) }, /* Smartphone */
  530. { USB_DEVICE(0x5E04, 0xCE00) }, /* SAGEM Wireless Assistant */
  531. { } /* Terminating entry */
  532. };
  533. MODULE_DEVICE_TABLE (usb, ipaq_id_table);
  534. static struct usb_driver ipaq_driver = {
  535. .name = "ipaq",
  536. .probe = usb_serial_probe,
  537. .disconnect = usb_serial_disconnect,
  538. .id_table = ipaq_id_table,
  539. .no_dynamic_id = 1,
  540. };
  541. /* All of the device info needed for the Compaq iPAQ */
  542. static struct usb_serial_driver ipaq_device = {
  543. .driver = {
  544. .owner = THIS_MODULE,
  545. .name = "ipaq",
  546. },
  547. .description = "PocketPC PDA",
  548. .id_table = ipaq_id_table,
  549. .num_interrupt_in = NUM_DONT_CARE,
  550. .num_bulk_in = 1,
  551. .num_bulk_out = 1,
  552. .num_ports = 1,
  553. .open = ipaq_open,
  554. .close = ipaq_close,
  555. .attach = ipaq_startup,
  556. .shutdown = ipaq_shutdown,
  557. .write = ipaq_write,
  558. .write_room = ipaq_write_room,
  559. .chars_in_buffer = ipaq_chars_in_buffer,
  560. .read_bulk_callback = ipaq_read_bulk_callback,
  561. .write_bulk_callback = ipaq_write_bulk_callback,
  562. };
  563. static spinlock_t write_list_lock;
  564. static int bytes_in;
  565. static int bytes_out;
  566. static int ipaq_open(struct usb_serial_port *port, struct file *filp)
  567. {
  568. struct usb_serial *serial = port->serial;
  569. struct ipaq_private *priv;
  570. struct ipaq_packet *pkt;
  571. int i, result = 0;
  572. int retries = KP_RETRIES;
  573. dbg("%s - port %d", __FUNCTION__, port->number);
  574. bytes_in = 0;
  575. bytes_out = 0;
  576. priv = (struct ipaq_private *)kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
  577. if (priv == NULL) {
  578. err("%s - Out of memory", __FUNCTION__);
  579. return -ENOMEM;
  580. }
  581. usb_set_serial_port_data(port, priv);
  582. priv->active = 0;
  583. priv->queue_len = 0;
  584. priv->free_len = 0;
  585. INIT_LIST_HEAD(&priv->queue);
  586. INIT_LIST_HEAD(&priv->freelist);
  587. for (i = 0; i < URBDATA_QUEUE_MAX / PACKET_SIZE; i++) {
  588. pkt = kmalloc(sizeof(struct ipaq_packet), GFP_KERNEL);
  589. if (pkt == NULL) {
  590. goto enomem;
  591. }
  592. pkt->data = kmalloc(PACKET_SIZE, GFP_KERNEL);
  593. if (pkt->data == NULL) {
  594. kfree(pkt);
  595. goto enomem;
  596. }
  597. pkt->len = 0;
  598. pkt->written = 0;
  599. INIT_LIST_HEAD(&pkt->list);
  600. list_add(&pkt->list, &priv->freelist);
  601. priv->free_len += PACKET_SIZE;
  602. }
  603. /*
  604. * Force low latency on. This will immediately push data to the line
  605. * discipline instead of queueing.
  606. */
  607. port->tty->low_latency = 1;
  608. port->tty->raw = 1;
  609. port->tty->real_raw = 1;
  610. /*
  611. * Lose the small buffers usbserial provides. Make larger ones.
  612. */
  613. kfree(port->bulk_in_buffer);
  614. kfree(port->bulk_out_buffer);
  615. port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
  616. if (port->bulk_in_buffer == NULL) {
  617. goto enomem;
  618. }
  619. port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL);
  620. if (port->bulk_out_buffer == NULL) {
  621. kfree(port->bulk_in_buffer);
  622. goto enomem;
  623. }
  624. port->read_urb->transfer_buffer = port->bulk_in_buffer;
  625. port->write_urb->transfer_buffer = port->bulk_out_buffer;
  626. port->read_urb->transfer_buffer_length = URBDATA_SIZE;
  627. port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE;
  628. /* Start reading from the device */
  629. usb_fill_bulk_urb(port->read_urb, serial->dev,
  630. usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress),
  631. port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
  632. ipaq_read_bulk_callback, port);
  633. result = usb_submit_urb(port->read_urb, GFP_KERNEL);
  634. if (result) {
  635. err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
  636. goto error;
  637. }
  638. /*
  639. * Send out control message observed in win98 sniffs. Not sure what
  640. * it does, but from empirical observations, it seems that the device
  641. * will start the chat sequence once one of these messages gets
  642. * through. Since this has a reasonably high failure rate, we retry
  643. * several times.
  644. */
  645. while (retries--) {
  646. result = usb_control_msg(serial->dev,
  647. usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21,
  648. 0x1, 0, NULL, 0, 100);
  649. if (result == 0) {
  650. return 0;
  651. }
  652. }
  653. err("%s - failed doing control urb, error %d", __FUNCTION__, result);
  654. goto error;
  655. enomem:
  656. result = -ENOMEM;
  657. err("%s - Out of memory", __FUNCTION__);
  658. error:
  659. ipaq_destroy_lists(port);
  660. kfree(priv);
  661. return result;
  662. }
  663. static void ipaq_close(struct usb_serial_port *port, struct file *filp)
  664. {
  665. struct ipaq_private *priv = usb_get_serial_port_data(port);
  666. dbg("%s - port %d", __FUNCTION__, port->number);
  667. /*
  668. * shut down bulk read and write
  669. */
  670. usb_kill_urb(port->write_urb);
  671. usb_kill_urb(port->read_urb);
  672. ipaq_destroy_lists(port);
  673. kfree(priv);
  674. usb_set_serial_port_data(port, NULL);
  675. /* Uncomment the following line if you want to see some statistics in your syslog */
  676. /* info ("Bytes In = %d Bytes Out = %d", bytes_in, bytes_out); */
  677. }
  678. static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs)
  679. {
  680. struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
  681. struct tty_struct *tty;
  682. unsigned char *data = urb->transfer_buffer;
  683. int result;
  684. dbg("%s - port %d", __FUNCTION__, port->number);
  685. if (urb->status) {
  686. dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
  687. return;
  688. }
  689. usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
  690. tty = port->tty;
  691. if (tty && urb->actual_length) {
  692. tty_buffer_request_room(tty, urb->actual_length);
  693. tty_insert_flip_string(tty, data, urb->actual_length);
  694. tty_flip_buffer_push(tty);
  695. bytes_in += urb->actual_length;
  696. }
  697. /* Continue trying to always read */
  698. usb_fill_bulk_urb(port->read_urb, port->serial->dev,
  699. usb_rcvbulkpipe(port->serial->dev, port->bulk_in_endpointAddress),
  700. port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length,
  701. ipaq_read_bulk_callback, port);
  702. result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
  703. if (result)
  704. err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
  705. return;
  706. }
  707. static int ipaq_write(struct usb_serial_port *port, const unsigned char *buf,
  708. int count)
  709. {
  710. const unsigned char *current_position = buf;
  711. int bytes_sent = 0;
  712. int transfer_size;
  713. dbg("%s - port %d", __FUNCTION__, port->number);
  714. while (count > 0) {
  715. transfer_size = min(count, PACKET_SIZE);
  716. if (ipaq_write_bulk(port, current_position, transfer_size)) {
  717. break;
  718. }
  719. current_position += transfer_size;
  720. bytes_sent += transfer_size;
  721. count -= transfer_size;
  722. bytes_out += transfer_size;
  723. }
  724. return bytes_sent;
  725. }
  726. static int ipaq_write_bulk(struct usb_serial_port *port, const unsigned char *buf,
  727. int count)
  728. {
  729. struct ipaq_private *priv = usb_get_serial_port_data(port);
  730. struct ipaq_packet *pkt = NULL;
  731. int result = 0;
  732. unsigned long flags;
  733. if (priv->free_len <= 0) {
  734. dbg("%s - we're stuffed", __FUNCTION__);
  735. return -EAGAIN;
  736. }
  737. spin_lock_irqsave(&write_list_lock, flags);
  738. if (!list_empty(&priv->freelist)) {
  739. pkt = list_entry(priv->freelist.next, struct ipaq_packet, list);
  740. list_del(&pkt->list);
  741. priv->free_len -= PACKET_SIZE;
  742. }
  743. spin_unlock_irqrestore(&write_list_lock, flags);
  744. if (pkt == NULL) {
  745. dbg("%s - we're stuffed", __FUNCTION__);
  746. return -EAGAIN;
  747. }
  748. memcpy(pkt->data, buf, count);
  749. usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, pkt->data);
  750. pkt->len = count;
  751. pkt->written = 0;
  752. spin_lock_irqsave(&write_list_lock, flags);
  753. list_add_tail(&pkt->list, &priv->queue);
  754. priv->queue_len += count;
  755. if (priv->active == 0) {
  756. priv->active = 1;
  757. ipaq_write_gather(port);
  758. spin_unlock_irqrestore(&write_list_lock, flags);
  759. result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
  760. if (result) {
  761. err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
  762. }
  763. } else {
  764. spin_unlock_irqrestore(&write_list_lock, flags);
  765. }
  766. return result;
  767. }
  768. static void ipaq_write_gather(struct usb_serial_port *port)
  769. {
  770. struct ipaq_private *priv = usb_get_serial_port_data(port);
  771. struct usb_serial *serial = port->serial;
  772. int count, room;
  773. struct ipaq_packet *pkt, *tmp;
  774. struct urb *urb = port->write_urb;
  775. room = URBDATA_SIZE;
  776. list_for_each_entry_safe(pkt, tmp, &priv->queue, list) {
  777. count = min(room, (int)(pkt->len - pkt->written));
  778. memcpy(urb->transfer_buffer + (URBDATA_SIZE - room),
  779. pkt->data + pkt->written, count);
  780. room -= count;
  781. pkt->written += count;
  782. priv->queue_len -= count;
  783. if (pkt->written == pkt->len) {
  784. list_move(&pkt->list, &priv->freelist);
  785. priv->free_len += PACKET_SIZE;
  786. }
  787. if (room == 0) {
  788. break;
  789. }
  790. }
  791. count = URBDATA_SIZE - room;
  792. usb_fill_bulk_urb(port->write_urb, serial->dev,
  793. usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress),
  794. port->write_urb->transfer_buffer, count, ipaq_write_bulk_callback,
  795. port);
  796. return;
  797. }
  798. static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs)
  799. {
  800. struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
  801. struct ipaq_private *priv = usb_get_serial_port_data(port);
  802. unsigned long flags;
  803. int result;
  804. dbg("%s - port %d", __FUNCTION__, port->number);
  805. if (urb->status) {
  806. dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
  807. }
  808. spin_lock_irqsave(&write_list_lock, flags);
  809. if (!list_empty(&priv->queue)) {
  810. ipaq_write_gather(port);
  811. spin_unlock_irqrestore(&write_list_lock, flags);
  812. result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
  813. if (result) {
  814. err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
  815. }
  816. } else {
  817. priv->active = 0;
  818. spin_unlock_irqrestore(&write_list_lock, flags);
  819. }
  820. schedule_work(&port->work);
  821. }
  822. static int ipaq_write_room(struct usb_serial_port *port)
  823. {
  824. struct ipaq_private *priv = usb_get_serial_port_data(port);
  825. dbg("%s - freelen %d", __FUNCTION__, priv->free_len);
  826. return priv->free_len;
  827. }
  828. static int ipaq_chars_in_buffer(struct usb_serial_port *port)
  829. {
  830. struct ipaq_private *priv = usb_get_serial_port_data(port);
  831. dbg("%s - queuelen %d", __FUNCTION__, priv->queue_len);
  832. return priv->queue_len;
  833. }
  834. static void ipaq_destroy_lists(struct usb_serial_port *port)
  835. {
  836. struct ipaq_private *priv = usb_get_serial_port_data(port);
  837. struct ipaq_packet *pkt, *tmp;
  838. list_for_each_entry_safe(pkt, tmp, &priv->queue, list) {
  839. kfree(pkt->data);
  840. kfree(pkt);
  841. }
  842. list_for_each_entry_safe(pkt, tmp, &priv->freelist, list) {
  843. kfree(pkt->data);
  844. kfree(pkt);
  845. }
  846. }
  847. static int ipaq_startup(struct usb_serial *serial)
  848. {
  849. dbg("%s", __FUNCTION__);
  850. if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
  851. err("active config #%d != 1 ??",
  852. serial->dev->actconfig->desc.bConfigurationValue);
  853. return -ENODEV;
  854. }
  855. return usb_reset_configuration (serial->dev);
  856. }
  857. static void ipaq_shutdown(struct usb_serial *serial)
  858. {
  859. dbg("%s", __FUNCTION__);
  860. }
  861. static int __init ipaq_init(void)
  862. {
  863. int retval;
  864. spin_lock_init(&write_list_lock);
  865. retval = usb_serial_register(&ipaq_device);
  866. if (retval)
  867. goto failed_usb_serial_register;
  868. info(DRIVER_DESC " " DRIVER_VERSION);
  869. if (vendor) {
  870. ipaq_id_table[0].idVendor = vendor;
  871. ipaq_id_table[0].idProduct = product;
  872. }
  873. retval = usb_register(&ipaq_driver);
  874. if (retval)
  875. goto failed_usb_register;
  876. return 0;
  877. failed_usb_register:
  878. usb_serial_deregister(&ipaq_device);
  879. failed_usb_serial_register:
  880. return retval;
  881. }
  882. static void __exit ipaq_exit(void)
  883. {
  884. usb_deregister(&ipaq_driver);
  885. usb_serial_deregister(&ipaq_device);
  886. }
  887. module_init(ipaq_init);
  888. module_exit(ipaq_exit);
  889. MODULE_AUTHOR( DRIVER_AUTHOR );
  890. MODULE_DESCRIPTION( DRIVER_DESC );
  891. MODULE_LICENSE("GPL");
  892. module_param(debug, bool, S_IRUGO | S_IWUSR);
  893. MODULE_PARM_DESC(debug, "Debug enabled or not");
  894. module_param(vendor, ushort, 0);
  895. MODULE_PARM_DESC(vendor, "User specified USB idVendor");
  896. module_param(product, ushort, 0);
  897. MODULE_PARM_DESC(product, "User specified USB idProduct");