ipaq.c 43 KB

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