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  */
13 
14 #ifndef __LINUX_USB_SERIAL_IPAQ_H
15 #define __LINUX_USB_SERIAL_IPAQ_H
16 
17 #define ASKEY_VENDOR_ID		0x1690
18 #define ASKEY_PRODUCT_ID	0x0601
19 
20 #define BCOM_VENDOR_ID		0x0960
21 #define BCOM_0065_ID		0x0065
22 #define BCOM_0066_ID		0x0066
23 #define BCOM_0067_ID		0x0067
24 
25 #define CASIO_VENDOR_ID		0x07cf
26 #define CASIO_2001_ID		0x2001
27 #define CASIO_EM500_ID		0x2002
28 
29 #define COMPAQ_VENDOR_ID	0x049f
30 #define COMPAQ_IPAQ_ID		0x0003
31 #define COMPAQ_0032_ID		0x0032
32 
33 #define DELL_VENDOR_ID		0x413c
34 #define DELL_AXIM_ID		0x4001
35 
36 #define FSC_VENDOR_ID		0x0bf8
37 #define FSC_LOOX_ID		0x1001
38 
39 #define HP_VENDOR_ID		0x03f0
40 #define HP_JORNADA_548_ID	0x1016
41 #define HP_JORNADA_568_ID	0x1116
42 #define HP_2016_ID		0x2016
43 #define HP_2116_ID		0x2116
44 #define HP_2216_ID		0x2216
45 #define HP_3016_ID		0x3016
46 #define HP_3116_ID		0x3116
47 #define HP_3216_ID		0x3216
48 #define HP_4016_ID		0x4016
49 #define HP_4116_ID		0x4116
50 #define HP_4216_ID		0x4216
51 #define HP_5016_ID		0x5016
52 #define HP_5116_ID		0x5116
53 #define HP_5216_ID		0x5216
54 
55 #define LINKUP_VENDOR_ID	0x094b
56 #define LINKUP_PRODUCT_ID	0x0001
57 
58 #define MICROSOFT_VENDOR_ID	0x045e
59 #define MICROSOFT_00CE_ID	0x00ce
60 
61 #define PORTATEC_VENDOR_ID	0x0961
62 #define PORTATEC_PRODUCT_ID	0x0010
63 
64 #define ROVER_VENDOR_ID		0x047b
65 #define ROVER_P5_ID		0x3000
66 
67 #define SAGEM_VENDOR_ID		0x5e04
68 #define SAGEM_WIRELESS_ID	0xce00
69 
70 #define SOCKET_VENDOR_ID	0x0104
71 #define SOCKET_PRODUCT_ID	0x00be
72 
73 #define TOSHIBA_VENDOR_ID	0x0930
74 #define TOSHIBA_PRODUCT_ID	0x0700
75 #define TOSHIBA_E310_ID		0x0705
76 #define TOSHIBA_E740_ID		0x0706
77 #define TOSHIBA_E335_ID		0x0707
78 
79 #define HTC_VENDOR_ID		0x0bb4
80 #define HTC_PRODUCT_ID		0x00ce
81 
82 #define NEC_VENDOR_ID		0x0409
83 #define NEC_PRODUCT_ID		0x00d5
84 
85 #define ASUS_VENDOR_ID		0x0b05
86 #define ASUS_A600_PRODUCT_ID	0x4201
87 
88 /*
89  * Since we can't queue our bulk write urbs (don't know why - it just
90  * doesn't work), we can send down only one write urb at a time. The simplistic
91  * approach taken by the generic usbserial driver will work, but it's not good
92  * for performance. Therefore, we buffer upto URBDATA_QUEUE_MAX bytes of write
93  * requests coming from the line discipline. This is done by chaining them
94  * in lists of struct ipaq_packet, each packet holding a maximum of
95  * PACKET_SIZE bytes.
96  *
97  * ipaq_write() can be called from bottom half context; hence we can't
98  * allocate memory for packets there. So we initialize a pool of packets at
99  * the first open and maintain a freelist.
100  *
101  * The value of PACKET_SIZE was empirically determined by
102  * checking the maximum write sizes sent down by the ppp ldisc.
103  * URBDATA_QUEUE_MAX is set to 64K, which is the maximum TCP window size.
104  */
105 
106 struct ipaq_packet {
107 	char			*data;
108 	size_t			len;
109 	size_t			written;
110 	struct list_head	list;
111 };
112 
113 struct ipaq_private {
114 	int			active;
115 	int			queue_len;
116 	int			free_len;
117 	struct list_head	queue;
118 	struct list_head	freelist;
119 };
120 
121 #define URBDATA_SIZE		4096
122 #define URBDATA_QUEUE_MAX	(64 * 1024)
123 #define PACKET_SIZE		256
124 
125 #endif
126