Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | Keyspan USB to Serial Converter driver | |
3 | ||
4 | (C) Copyright (C) 2000-2001 | |
5 | Hugh Blemings <hugh@blemings.org> | |
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 | ||
631dd1a8 | 12 | See http://blemings.org/hugh/keyspan.html for more information. |
1da177e4 LT |
13 | |
14 | Code in this driver inspired by and in a number of places taken | |
15 | from Brian Warner's original Keyspan-PDA driver. | |
16 | ||
17 | This driver has been put together with the support of Innosys, Inc. | |
18 | and Keyspan, Inc the manufacturers of the Keyspan USB-serial products. | |
19 | Thanks Guys :) | |
20 | ||
21 | Thanks to Paulus for miscellaneous tidy ups, some largish chunks | |
22 | of much nicer and/or completely new code and (perhaps most uniquely) | |
23 | having the patience to sit down and explain why and where he'd changed | |
24 | stuff. | |
25 | ||
26 | Tip 'o the hat to IBM (and previously Linuxcare :) for supporting | |
27 | staff in their work on open source projects. | |
28 | ||
29 | See keyspan.c for update history. | |
30 | ||
31 | */ | |
32 | ||
33 | #ifndef __LINUX_USB_SERIAL_KEYSPAN_H | |
34 | #define __LINUX_USB_SERIAL_KEYSPAN_H | |
35 | ||
36 | ||
37 | /* Function prototypes for Keyspan serial converter */ | |
95da310e | 38 | static int keyspan_open (struct tty_struct *tty, |
a509a7e4 | 39 | struct usb_serial_port *port); |
335f8514 AC |
40 | static void keyspan_close (struct usb_serial_port *port); |
41 | static void keyspan_dtr_rts (struct usb_serial_port *port, int on); | |
1da177e4 | 42 | static int keyspan_startup (struct usb_serial *serial); |
f9c99bb8 AS |
43 | static void keyspan_disconnect (struct usb_serial *serial); |
44 | static void keyspan_release (struct usb_serial *serial); | |
95da310e | 45 | static int keyspan_write_room (struct tty_struct *tty); |
1da177e4 | 46 | |
95da310e AC |
47 | static int keyspan_write (struct tty_struct *tty, |
48 | struct usb_serial_port *port, | |
1da177e4 LT |
49 | const unsigned char *buf, |
50 | int count); | |
51 | ||
52 | static void keyspan_send_setup (struct usb_serial_port *port, | |
53 | int reset_port); | |
54 | ||
55 | ||
95da310e AC |
56 | static void keyspan_set_termios (struct tty_struct *tty, |
57 | struct usb_serial_port *port, | |
606d099c | 58 | struct ktermios *old); |
95da310e | 59 | static void keyspan_break_ctl (struct tty_struct *tty, |
1da177e4 | 60 | int break_state); |
60b33c13 | 61 | static int keyspan_tiocmget (struct tty_struct *tty); |
95da310e | 62 | static int keyspan_tiocmset (struct tty_struct *tty, |
20b9d177 | 63 | unsigned int set, |
1da177e4 LT |
64 | unsigned int clear); |
65 | static int keyspan_fake_startup (struct usb_serial *serial); | |
66 | ||
049c6b4e GKH |
67 | static int keyspan_usa19_calc_baud (struct usb_serial_port *port, |
68 | u32 baud_rate, u32 baudclk, | |
1da177e4 LT |
69 | u8 *rate_hi, u8 *rate_low, |
70 | u8 *prescaler, int portnum); | |
71 | ||
049c6b4e GKH |
72 | static int keyspan_usa19w_calc_baud (struct usb_serial_port *port, |
73 | u32 baud_rate, u32 baudclk, | |
1da177e4 LT |
74 | u8 *rate_hi, u8 *rate_low, |
75 | u8 *prescaler, int portnum); | |
76 | ||
049c6b4e GKH |
77 | static int keyspan_usa28_calc_baud (struct usb_serial_port *port, |
78 | u32 baud_rate, u32 baudclk, | |
1da177e4 LT |
79 | u8 *rate_hi, u8 *rate_low, |
80 | u8 *prescaler, int portnum); | |
81 | ||
049c6b4e GKH |
82 | static int keyspan_usa19hs_calc_baud (struct usb_serial_port *port, |
83 | u32 baud_rate, u32 baudclk, | |
1da177e4 LT |
84 | u8 *rate_hi, u8 *rate_low, |
85 | u8 *prescaler, int portnum); | |
86 | ||
87 | static int keyspan_usa28_send_setup (struct usb_serial *serial, | |
88 | struct usb_serial_port *port, | |
89 | int reset_port); | |
90 | static int keyspan_usa26_send_setup (struct usb_serial *serial, | |
91 | struct usb_serial_port *port, | |
92 | int reset_port); | |
93 | static int keyspan_usa49_send_setup (struct usb_serial *serial, | |
94 | struct usb_serial_port *port, | |
95 | int reset_port); | |
96 | ||
97 | static int keyspan_usa90_send_setup (struct usb_serial *serial, | |
98 | struct usb_serial_port *port, | |
99 | int reset_port); | |
100 | ||
0ca1268e LM |
101 | static int keyspan_usa67_send_setup (struct usb_serial *serial, |
102 | struct usb_serial_port *port, | |
103 | int reset_port); | |
104 | ||
1da177e4 LT |
105 | /* Values used for baud rate calculation - device specific */ |
106 | #define KEYSPAN_INVALID_BAUD_RATE (-1) | |
107 | #define KEYSPAN_BAUD_RATE_OK (0) | |
108 | #define KEYSPAN_USA18X_BAUDCLK (12000000L) /* a guess */ | |
109 | #define KEYSPAN_USA19_BAUDCLK (12000000L) | |
110 | #define KEYSPAN_USA19W_BAUDCLK (24000000L) | |
111 | #define KEYSPAN_USA19HS_BAUDCLK (14769231L) | |
112 | #define KEYSPAN_USA28_BAUDCLK (1843200L) | |
113 | #define KEYSPAN_USA28X_BAUDCLK (12000000L) | |
114 | #define KEYSPAN_USA49W_BAUDCLK (48000000L) | |
115 | ||
116 | /* Some constants used to characterise each device. */ | |
117 | #define KEYSPAN_MAX_NUM_PORTS (4) | |
118 | #define KEYSPAN_MAX_FLIPS (2) | |
119 | ||
120 | /* Device info for the Keyspan serial converter, used | |
121 | by the overall usb-serial probe function */ | |
122 | #define KEYSPAN_VENDOR_ID (0x06cd) | |
123 | ||
124 | /* Product IDs for the products supported, pre-renumeration */ | |
125 | #define keyspan_usa18x_pre_product_id 0x0105 | |
126 | #define keyspan_usa19_pre_product_id 0x0103 | |
127 | #define keyspan_usa19qi_pre_product_id 0x010b | |
128 | #define keyspan_mpr_pre_product_id 0x011b | |
129 | #define keyspan_usa19qw_pre_product_id 0x0118 | |
130 | #define keyspan_usa19w_pre_product_id 0x0106 | |
131 | #define keyspan_usa28_pre_product_id 0x0101 | |
132 | #define keyspan_usa28x_pre_product_id 0x0102 | |
133 | #define keyspan_usa28xa_pre_product_id 0x0114 | |
134 | #define keyspan_usa28xb_pre_product_id 0x0113 | |
135 | #define keyspan_usa49w_pre_product_id 0x0109 | |
136 | #define keyspan_usa49wlc_pre_product_id 0x011a | |
137 | ||
138 | /* Product IDs post-renumeration. Note that the 28x and 28xb | |
139 | have the same id's post-renumeration but behave identically | |
188d6360 BC |
140 | so it's not an issue. As such, the 28xb is not listed in any |
141 | of the device tables. */ | |
1da177e4 LT |
142 | #define keyspan_usa18x_product_id 0x0112 |
143 | #define keyspan_usa19_product_id 0x0107 | |
144 | #define keyspan_usa19qi_product_id 0x010c | |
145 | #define keyspan_usa19hs_product_id 0x0121 | |
146 | #define keyspan_mpr_product_id 0x011c | |
147 | #define keyspan_usa19qw_product_id 0x0119 | |
148 | #define keyspan_usa19w_product_id 0x0108 | |
149 | #define keyspan_usa28_product_id 0x010f | |
150 | #define keyspan_usa28x_product_id 0x0110 | |
151 | #define keyspan_usa28xa_product_id 0x0115 | |
0ca1268e LM |
152 | #define keyspan_usa28xb_product_id 0x0110 |
153 | #define keyspan_usa28xg_product_id 0x0135 | |
1da177e4 LT |
154 | #define keyspan_usa49w_product_id 0x010a |
155 | #define keyspan_usa49wlc_product_id 0x012a | |
0ca1268e | 156 | #define keyspan_usa49wg_product_id 0x0131 |
1da177e4 LT |
157 | |
158 | struct keyspan_device_details { | |
159 | /* product ID value */ | |
160 | int product_id; | |
161 | ||
0ca1268e | 162 | enum {msg_usa26, msg_usa28, msg_usa49, msg_usa90, msg_usa67} msg_format; |
1da177e4 LT |
163 | |
164 | /* Number of physical ports */ | |
165 | int num_ports; | |
166 | ||
167 | /* 1 if endpoint flipping used on input, 0 if not */ | |
168 | int indat_endp_flip; | |
169 | ||
170 | /* 1 if endpoint flipping used on output, 0 if not */ | |
171 | int outdat_endp_flip; | |
172 | ||
173 | /* Table mapping input data endpoint IDs to physical | |
174 | port number and flip if used */ | |
175 | int indat_endpoints[KEYSPAN_MAX_NUM_PORTS]; | |
176 | ||
177 | /* Same for output endpoints */ | |
178 | int outdat_endpoints[KEYSPAN_MAX_NUM_PORTS]; | |
179 | ||
180 | /* Input acknowledge endpoints */ | |
181 | int inack_endpoints[KEYSPAN_MAX_NUM_PORTS]; | |
182 | ||
183 | /* Output control endpoints */ | |
184 | int outcont_endpoints[KEYSPAN_MAX_NUM_PORTS]; | |
185 | ||
186 | /* Endpoint used for input status */ | |
187 | int instat_endpoint; | |
188 | ||
0ca1268e LM |
189 | /* Endpoint used for input data 49WG only */ |
190 | int indat_endpoint; | |
191 | ||
1da177e4 LT |
192 | /* Endpoint used for global control functions */ |
193 | int glocont_endpoint; | |
194 | ||
049c6b4e GKH |
195 | int (*calculate_baud_rate) (struct usb_serial_port *port, |
196 | u32 baud_rate, u32 baudclk, | |
197 | u8 *rate_hi, u8 *rate_low, u8 *prescaler, int portnum); | |
1da177e4 LT |
198 | u32 baudclk; |
199 | }; | |
200 | ||
201 | /* Now for each device type we setup the device detail | |
202 | structure with the appropriate information (provided | |
203 | in Keyspan's documentation) */ | |
204 | ||
205 | static const struct keyspan_device_details usa18x_device_details = { | |
206 | .product_id = keyspan_usa18x_product_id, | |
207 | .msg_format = msg_usa26, | |
208 | .num_ports = 1, | |
209 | .indat_endp_flip = 0, | |
210 | .outdat_endp_flip = 1, | |
211 | .indat_endpoints = {0x81}, | |
212 | .outdat_endpoints = {0x01}, | |
213 | .inack_endpoints = {0x85}, | |
214 | .outcont_endpoints = {0x05}, | |
215 | .instat_endpoint = 0x87, | |
0ca1268e | 216 | .indat_endpoint = -1, |
1da177e4 LT |
217 | .glocont_endpoint = 0x07, |
218 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | |
219 | .baudclk = KEYSPAN_USA18X_BAUDCLK, | |
220 | }; | |
221 | ||
222 | static const struct keyspan_device_details usa19_device_details = { | |
223 | .product_id = keyspan_usa19_product_id, | |
224 | .msg_format = msg_usa28, | |
225 | .num_ports = 1, | |
226 | .indat_endp_flip = 1, | |
227 | .outdat_endp_flip = 1, | |
228 | .indat_endpoints = {0x81}, | |
229 | .outdat_endpoints = {0x01}, | |
230 | .inack_endpoints = {0x83}, | |
231 | .outcont_endpoints = {0x03}, | |
232 | .instat_endpoint = 0x84, | |
0ca1268e | 233 | .indat_endpoint = -1, |
1da177e4 LT |
234 | .glocont_endpoint = -1, |
235 | .calculate_baud_rate = keyspan_usa19_calc_baud, | |
236 | .baudclk = KEYSPAN_USA19_BAUDCLK, | |
237 | }; | |
238 | ||
239 | static const struct keyspan_device_details usa19qi_device_details = { | |
240 | .product_id = keyspan_usa19qi_product_id, | |
241 | .msg_format = msg_usa28, | |
242 | .num_ports = 1, | |
243 | .indat_endp_flip = 1, | |
244 | .outdat_endp_flip = 1, | |
245 | .indat_endpoints = {0x81}, | |
246 | .outdat_endpoints = {0x01}, | |
247 | .inack_endpoints = {0x83}, | |
248 | .outcont_endpoints = {0x03}, | |
249 | .instat_endpoint = 0x84, | |
0ca1268e | 250 | .indat_endpoint = -1, |
1da177e4 LT |
251 | .glocont_endpoint = -1, |
252 | .calculate_baud_rate = keyspan_usa28_calc_baud, | |
253 | .baudclk = KEYSPAN_USA19_BAUDCLK, | |
254 | }; | |
255 | ||
256 | static const struct keyspan_device_details mpr_device_details = { | |
257 | .product_id = keyspan_mpr_product_id, | |
258 | .msg_format = msg_usa28, | |
259 | .num_ports = 1, | |
260 | .indat_endp_flip = 1, | |
261 | .outdat_endp_flip = 1, | |
262 | .indat_endpoints = {0x81}, | |
263 | .outdat_endpoints = {0x01}, | |
264 | .inack_endpoints = {0x83}, | |
265 | .outcont_endpoints = {0x03}, | |
266 | .instat_endpoint = 0x84, | |
0ca1268e | 267 | .indat_endpoint = -1, |
1da177e4 LT |
268 | .glocont_endpoint = -1, |
269 | .calculate_baud_rate = keyspan_usa28_calc_baud, | |
270 | .baudclk = KEYSPAN_USA19_BAUDCLK, | |
271 | }; | |
272 | ||
273 | static const struct keyspan_device_details usa19qw_device_details = { | |
274 | .product_id = keyspan_usa19qw_product_id, | |
275 | .msg_format = msg_usa26, | |
276 | .num_ports = 1, | |
277 | .indat_endp_flip = 0, | |
278 | .outdat_endp_flip = 1, | |
279 | .indat_endpoints = {0x81}, | |
280 | .outdat_endpoints = {0x01}, | |
281 | .inack_endpoints = {0x85}, | |
282 | .outcont_endpoints = {0x05}, | |
283 | .instat_endpoint = 0x87, | |
0ca1268e | 284 | .indat_endpoint = -1, |
1da177e4 LT |
285 | .glocont_endpoint = 0x07, |
286 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | |
287 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | |
288 | }; | |
289 | ||
290 | static const struct keyspan_device_details usa19w_device_details = { | |
291 | .product_id = keyspan_usa19w_product_id, | |
292 | .msg_format = msg_usa26, | |
293 | .num_ports = 1, | |
294 | .indat_endp_flip = 0, | |
295 | .outdat_endp_flip = 1, | |
296 | .indat_endpoints = {0x81}, | |
297 | .outdat_endpoints = {0x01}, | |
298 | .inack_endpoints = {0x85}, | |
299 | .outcont_endpoints = {0x05}, | |
300 | .instat_endpoint = 0x87, | |
0ca1268e | 301 | .indat_endpoint = -1, |
1da177e4 LT |
302 | .glocont_endpoint = 0x07, |
303 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | |
304 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | |
305 | }; | |
306 | ||
307 | static const struct keyspan_device_details usa19hs_device_details = { | |
308 | .product_id = keyspan_usa19hs_product_id, | |
309 | .msg_format = msg_usa90, | |
310 | .num_ports = 1, | |
311 | .indat_endp_flip = 0, | |
312 | .outdat_endp_flip = 0, | |
313 | .indat_endpoints = {0x81}, | |
314 | .outdat_endpoints = {0x01}, | |
315 | .inack_endpoints = {-1}, | |
316 | .outcont_endpoints = {0x02}, | |
317 | .instat_endpoint = 0x82, | |
0ca1268e | 318 | .indat_endpoint = -1, |
1da177e4 LT |
319 | .glocont_endpoint = -1, |
320 | .calculate_baud_rate = keyspan_usa19hs_calc_baud, | |
321 | .baudclk = KEYSPAN_USA19HS_BAUDCLK, | |
322 | }; | |
323 | ||
324 | static const struct keyspan_device_details usa28_device_details = { | |
325 | .product_id = keyspan_usa28_product_id, | |
326 | .msg_format = msg_usa28, | |
327 | .num_ports = 2, | |
328 | .indat_endp_flip = 1, | |
329 | .outdat_endp_flip = 1, | |
330 | .indat_endpoints = {0x81, 0x83}, | |
331 | .outdat_endpoints = {0x01, 0x03}, | |
332 | .inack_endpoints = {0x85, 0x86}, | |
333 | .outcont_endpoints = {0x05, 0x06}, | |
334 | .instat_endpoint = 0x87, | |
0ca1268e | 335 | .indat_endpoint = -1, |
1da177e4 LT |
336 | .glocont_endpoint = 0x07, |
337 | .calculate_baud_rate = keyspan_usa28_calc_baud, | |
338 | .baudclk = KEYSPAN_USA28_BAUDCLK, | |
339 | }; | |
340 | ||
341 | static const struct keyspan_device_details usa28x_device_details = { | |
342 | .product_id = keyspan_usa28x_product_id, | |
343 | .msg_format = msg_usa26, | |
344 | .num_ports = 2, | |
345 | .indat_endp_flip = 0, | |
346 | .outdat_endp_flip = 1, | |
347 | .indat_endpoints = {0x81, 0x83}, | |
348 | .outdat_endpoints = {0x01, 0x03}, | |
349 | .inack_endpoints = {0x85, 0x86}, | |
350 | .outcont_endpoints = {0x05, 0x06}, | |
351 | .instat_endpoint = 0x87, | |
0ca1268e | 352 | .indat_endpoint = -1, |
1da177e4 LT |
353 | .glocont_endpoint = 0x07, |
354 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | |
355 | .baudclk = KEYSPAN_USA28X_BAUDCLK, | |
356 | }; | |
357 | ||
358 | static const struct keyspan_device_details usa28xa_device_details = { | |
359 | .product_id = keyspan_usa28xa_product_id, | |
360 | .msg_format = msg_usa26, | |
361 | .num_ports = 2, | |
362 | .indat_endp_flip = 0, | |
363 | .outdat_endp_flip = 1, | |
364 | .indat_endpoints = {0x81, 0x83}, | |
365 | .outdat_endpoints = {0x01, 0x03}, | |
366 | .inack_endpoints = {0x85, 0x86}, | |
367 | .outcont_endpoints = {0x05, 0x06}, | |
368 | .instat_endpoint = 0x87, | |
0ca1268e | 369 | .indat_endpoint = -1, |
1da177e4 LT |
370 | .glocont_endpoint = 0x07, |
371 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | |
372 | .baudclk = KEYSPAN_USA28X_BAUDCLK, | |
373 | }; | |
374 | ||
0ca1268e LM |
375 | static const struct keyspan_device_details usa28xg_device_details = { |
376 | .product_id = keyspan_usa28xg_product_id, | |
377 | .msg_format = msg_usa67, | |
378 | .num_ports = 2, | |
379 | .indat_endp_flip = 0, | |
380 | .outdat_endp_flip = 0, | |
381 | .indat_endpoints = {0x84, 0x88}, | |
382 | .outdat_endpoints = {0x02, 0x06}, | |
383 | .inack_endpoints = {-1, -1}, | |
384 | .outcont_endpoints = {-1, -1}, | |
385 | .instat_endpoint = 0x81, | |
386 | .indat_endpoint = -1, | |
387 | .glocont_endpoint = 0x01, | |
388 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | |
389 | .baudclk = KEYSPAN_USA28X_BAUDCLK, | |
390 | }; | |
1da177e4 LT |
391 | /* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */ |
392 | ||
393 | static const struct keyspan_device_details usa49w_device_details = { | |
394 | .product_id = keyspan_usa49w_product_id, | |
395 | .msg_format = msg_usa49, | |
396 | .num_ports = 4, | |
397 | .indat_endp_flip = 0, | |
398 | .outdat_endp_flip = 0, | |
399 | .indat_endpoints = {0x81, 0x82, 0x83, 0x84}, | |
400 | .outdat_endpoints = {0x01, 0x02, 0x03, 0x04}, | |
401 | .inack_endpoints = {-1, -1, -1, -1}, | |
402 | .outcont_endpoints = {-1, -1, -1, -1}, | |
403 | .instat_endpoint = 0x87, | |
0ca1268e | 404 | .indat_endpoint = -1, |
1da177e4 LT |
405 | .glocont_endpoint = 0x07, |
406 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | |
407 | .baudclk = KEYSPAN_USA49W_BAUDCLK, | |
408 | }; | |
409 | ||
410 | static const struct keyspan_device_details usa49wlc_device_details = { | |
411 | .product_id = keyspan_usa49wlc_product_id, | |
412 | .msg_format = msg_usa49, | |
413 | .num_ports = 4, | |
414 | .indat_endp_flip = 0, | |
415 | .outdat_endp_flip = 0, | |
416 | .indat_endpoints = {0x81, 0x82, 0x83, 0x84}, | |
417 | .outdat_endpoints = {0x01, 0x02, 0x03, 0x04}, | |
418 | .inack_endpoints = {-1, -1, -1, -1}, | |
419 | .outcont_endpoints = {-1, -1, -1, -1}, | |
420 | .instat_endpoint = 0x87, | |
0ca1268e | 421 | .indat_endpoint = -1, |
1da177e4 LT |
422 | .glocont_endpoint = 0x07, |
423 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | |
424 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | |
425 | }; | |
426 | ||
0ca1268e LM |
427 | static const struct keyspan_device_details usa49wg_device_details = { |
428 | .product_id = keyspan_usa49wg_product_id, | |
429 | .msg_format = msg_usa49, | |
430 | .num_ports = 4, | |
431 | .indat_endp_flip = 0, | |
432 | .outdat_endp_flip = 0, | |
433 | .indat_endpoints = {-1, -1, -1, -1}, /* single 'global' data in EP */ | |
434 | .outdat_endpoints = {0x01, 0x02, 0x04, 0x06}, | |
435 | .inack_endpoints = {-1, -1, -1, -1}, | |
436 | .outcont_endpoints = {-1, -1, -1, -1}, | |
437 | .instat_endpoint = 0x81, | |
438 | .indat_endpoint = 0x88, | |
439 | .glocont_endpoint = 0x00, /* uses control EP */ | |
440 | .calculate_baud_rate = keyspan_usa19w_calc_baud, | |
441 | .baudclk = KEYSPAN_USA19W_BAUDCLK, | |
442 | }; | |
443 | ||
1da177e4 LT |
444 | static const struct keyspan_device_details *keyspan_devices[] = { |
445 | &usa18x_device_details, | |
446 | &usa19_device_details, | |
447 | &usa19qi_device_details, | |
448 | &mpr_device_details, | |
449 | &usa19qw_device_details, | |
450 | &usa19w_device_details, | |
451 | &usa19hs_device_details, | |
452 | &usa28_device_details, | |
453 | &usa28x_device_details, | |
454 | &usa28xa_device_details, | |
0ca1268e | 455 | &usa28xg_device_details, |
1da177e4 LT |
456 | /* 28xb not required as it renumerates as a 28x */ |
457 | &usa49w_device_details, | |
458 | &usa49wlc_device_details, | |
0ca1268e | 459 | &usa49wg_device_details, |
1da177e4 LT |
460 | NULL, |
461 | }; | |
462 | ||
7d40d7e8 | 463 | static const struct usb_device_id keyspan_ids_combined[] = { |
1da177e4 LT |
464 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) }, |
465 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) }, | |
466 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) }, | |
467 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) }, | |
468 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) }, | |
469 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) }, | |
470 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) }, | |
471 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) }, | |
472 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) }, | |
473 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_pre_product_id) }, | |
474 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_pre_product_id) }, | |
475 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_pre_product_id) }, | |
476 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) }, | |
477 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) }, | |
478 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) }, | |
479 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) }, | |
480 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) }, | |
481 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) }, | |
482 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) }, | |
483 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, | |
484 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, | |
485 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, | |
0ca1268e | 486 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) }, |
1da177e4 LT |
487 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id)}, |
488 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)}, | |
0ca1268e | 489 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)}, |
1da177e4 LT |
490 | { } /* Terminating entry */ |
491 | }; | |
492 | ||
493 | MODULE_DEVICE_TABLE(usb, keyspan_ids_combined); | |
494 | ||
1da177e4 | 495 | /* usb_device_id table for the pre-firmware download keyspan devices */ |
7d40d7e8 | 496 | static const struct usb_device_id keyspan_pre_ids[] = { |
1da177e4 LT |
497 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) }, |
498 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) }, | |
499 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) }, | |
500 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) }, | |
501 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) }, | |
502 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_pre_product_id) }, | |
503 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) }, | |
504 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) }, | |
505 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) }, | |
506 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_pre_product_id) }, | |
507 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_pre_product_id) }, | |
508 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_pre_product_id) }, | |
509 | { } /* Terminating entry */ | |
510 | }; | |
511 | ||
7d40d7e8 | 512 | static const struct usb_device_id keyspan_1port_ids[] = { |
1da177e4 LT |
513 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) }, |
514 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) }, | |
515 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) }, | |
516 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) }, | |
517 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) }, | |
518 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19hs_product_id) }, | |
519 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_mpr_product_id) }, | |
520 | { } /* Terminating entry */ | |
521 | }; | |
522 | ||
7d40d7e8 | 523 | static const struct usb_device_id keyspan_2port_ids[] = { |
1da177e4 LT |
524 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, |
525 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, | |
526 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, | |
0ca1268e | 527 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) }, |
1da177e4 LT |
528 | { } /* Terminating entry */ |
529 | }; | |
530 | ||
7d40d7e8 | 531 | static const struct usb_device_id keyspan_4port_ids[] = { |
1da177e4 LT |
532 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id) }, |
533 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)}, | |
0ca1268e | 534 | { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)}, |
1da177e4 LT |
535 | { } /* Terminating entry */ |
536 | }; | |
537 | ||
538 | /* Structs for the devices, pre and post renumeration. */ | |
ea65370d | 539 | static struct usb_serial_driver keyspan_pre_device = { |
18fcac35 GKH |
540 | .driver = { |
541 | .owner = THIS_MODULE, | |
269bda1c | 542 | .name = "keyspan_no_firm", |
18fcac35 | 543 | }, |
269bda1c | 544 | .description = "Keyspan - (without firmware)", |
1da177e4 | 545 | .id_table = keyspan_pre_ids, |
1da177e4 LT |
546 | .num_ports = 1, |
547 | .attach = keyspan_fake_startup, | |
548 | }; | |
549 | ||
ea65370d | 550 | static struct usb_serial_driver keyspan_1port_device = { |
18fcac35 GKH |
551 | .driver = { |
552 | .owner = THIS_MODULE, | |
269bda1c | 553 | .name = "keyspan_1", |
18fcac35 | 554 | }, |
269bda1c | 555 | .description = "Keyspan 1 port adapter", |
1da177e4 | 556 | .id_table = keyspan_1port_ids, |
1da177e4 LT |
557 | .num_ports = 1, |
558 | .open = keyspan_open, | |
559 | .close = keyspan_close, | |
335f8514 | 560 | .dtr_rts = keyspan_dtr_rts, |
1da177e4 LT |
561 | .write = keyspan_write, |
562 | .write_room = keyspan_write_room, | |
1da177e4 LT |
563 | .set_termios = keyspan_set_termios, |
564 | .break_ctl = keyspan_break_ctl, | |
565 | .tiocmget = keyspan_tiocmget, | |
566 | .tiocmset = keyspan_tiocmset, | |
567 | .attach = keyspan_startup, | |
f9c99bb8 AS |
568 | .disconnect = keyspan_disconnect, |
569 | .release = keyspan_release, | |
1da177e4 LT |
570 | }; |
571 | ||
ea65370d | 572 | static struct usb_serial_driver keyspan_2port_device = { |
18fcac35 GKH |
573 | .driver = { |
574 | .owner = THIS_MODULE, | |
269bda1c | 575 | .name = "keyspan_2", |
18fcac35 | 576 | }, |
269bda1c | 577 | .description = "Keyspan 2 port adapter", |
1da177e4 | 578 | .id_table = keyspan_2port_ids, |
1da177e4 LT |
579 | .num_ports = 2, |
580 | .open = keyspan_open, | |
581 | .close = keyspan_close, | |
335f8514 | 582 | .dtr_rts = keyspan_dtr_rts, |
1da177e4 LT |
583 | .write = keyspan_write, |
584 | .write_room = keyspan_write_room, | |
1da177e4 LT |
585 | .set_termios = keyspan_set_termios, |
586 | .break_ctl = keyspan_break_ctl, | |
587 | .tiocmget = keyspan_tiocmget, | |
588 | .tiocmset = keyspan_tiocmset, | |
589 | .attach = keyspan_startup, | |
f9c99bb8 AS |
590 | .disconnect = keyspan_disconnect, |
591 | .release = keyspan_release, | |
1da177e4 LT |
592 | }; |
593 | ||
ea65370d | 594 | static struct usb_serial_driver keyspan_4port_device = { |
18fcac35 GKH |
595 | .driver = { |
596 | .owner = THIS_MODULE, | |
269bda1c | 597 | .name = "keyspan_4", |
18fcac35 | 598 | }, |
269bda1c | 599 | .description = "Keyspan 4 port adapter", |
1da177e4 | 600 | .id_table = keyspan_4port_ids, |
1da177e4 LT |
601 | .num_ports = 4, |
602 | .open = keyspan_open, | |
603 | .close = keyspan_close, | |
335f8514 | 604 | .dtr_rts = keyspan_dtr_rts, |
1da177e4 LT |
605 | .write = keyspan_write, |
606 | .write_room = keyspan_write_room, | |
1da177e4 LT |
607 | .set_termios = keyspan_set_termios, |
608 | .break_ctl = keyspan_break_ctl, | |
609 | .tiocmget = keyspan_tiocmget, | |
610 | .tiocmset = keyspan_tiocmset, | |
611 | .attach = keyspan_startup, | |
f9c99bb8 AS |
612 | .disconnect = keyspan_disconnect, |
613 | .release = keyspan_release, | |
1da177e4 LT |
614 | }; |
615 | ||
4d2a7aff AS |
616 | static struct usb_serial_driver * const serial_drivers[] = { |
617 | &keyspan_pre_device, &keyspan_1port_device, | |
618 | &keyspan_2port_device, &keyspan_4port_device, NULL | |
619 | }; | |
620 | ||
1da177e4 | 621 | #endif |