aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ipaq.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/usb/serial/ipaq.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/usb/serial/ipaq.h')
-rw-r--r--drivers/usb/serial/ipaq.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/drivers/usb/serial/ipaq.h b/drivers/usb/serial/ipaq.h
new file mode 100644
index 000000000000..2b9035918b85
--- /dev/null
+++ b/drivers/usb/serial/ipaq.h
@@ -0,0 +1,54 @@
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/*
18 * Since we can't queue our bulk write urbs (don't know why - it just
19 * doesn't work), we can send down only one write urb at a time. The simplistic
20 * approach taken by the generic usbserial driver will work, but it's not good
21 * for performance. Therefore, we buffer upto URBDATA_QUEUE_MAX bytes of write
22 * requests coming from the line discipline. This is done by chaining them
23 * in lists of struct ipaq_packet, each packet holding a maximum of
24 * PACKET_SIZE bytes.
25 *
26 * ipaq_write() can be called from bottom half context; hence we can't
27 * allocate memory for packets there. So we initialize a pool of packets at
28 * the first open and maintain a freelist.
29 *
30 * The value of PACKET_SIZE was empirically determined by
31 * checking the maximum write sizes sent down by the ppp ldisc.
32 * URBDATA_QUEUE_MAX is set to 64K, which is the maximum TCP window size.
33 */
34
35struct ipaq_packet {
36 char *data;
37 size_t len;
38 size_t written;
39 struct list_head list;
40};
41
42struct ipaq_private {
43 int active;
44 int queue_len;
45 int free_len;
46 struct list_head queue;
47 struct list_head freelist;
48};
49
50#define URBDATA_SIZE 4096
51#define URBDATA_QUEUE_MAX (64 * 1024)
52#define PACKET_SIZE 256
53
54#endif