File: /usr/src/linux/include/net/bluetooth/hci_uart.h

1     /* 
2        BlueZ - Bluetooth protocol stack for Linux
3        Copyright (C) 2000-2001 Qualcomm Incorporated
4     
5        Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.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 version 2 as
9        published by the Free Software Foundation;
10     
11        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
12        OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14        IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15        CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
16        WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
17        ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
18        OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19     
20        ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
21        COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
22        SOFTWARE IS DISCLAIMED.
23     */
24     
25     /*
26      * $Id: hci_uart.h,v 1.2 2001/06/02 01:40:08 maxk Exp $
27      */
28     
29     #ifndef N_HCI
30     #define N_HCI	15
31     #endif
32     
33     #ifdef __KERNEL__
34     
35     #define tty2n_hci(tty)  ((struct n_hci *)((tty)->disc_data))
36     #define n_hci2tty(n_hci) ((n_hci)->tty)
37     
38     struct n_hci {
39     	struct tty_struct *tty;
40     	struct hci_dev hdev;
41     
42     	struct sk_buff_head txq;
43     	unsigned long tx_state;
44     
45     	spinlock_t rx_lock;
46     	unsigned long rx_state;
47     	unsigned long rx_count;
48     	struct sk_buff *rx_skb;
49     };
50     
51     /* Transmit states  */
52     #define TRANS_SENDING		1
53     #define TRANS_WAKEUP		2
54     
55     /* Receiver States */
56     #define WAIT_PACKET_TYPE	0
57     #define WAIT_EVENT_HDR	 	1
58     #define WAIT_ACL_HDR		2
59     #define WAIT_SCO_HDR		3
60     #define WAIT_DATA	        4
61     
62     #endif /* __KERNEL__ */
63