[NETPOLL]: deadlock bugfix
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / bluetooth / hci_bcsp.h
bloba2b3bb92274bf5e52bc81692cfd82426e1bd508a
1 /*
2 BlueCore Serial Protocol (BCSP) for Linux Bluetooth stack (BlueZ).
3 Copyright 2002 by Fabrizio Gennari <fabrizio.gennari@philips.com>
5 Based on
6 hci_h4.c by Maxim Krasnyansky <maxk@qualcomm.com>
7 ABCSP by Carl Orsborn <cjo@csr.com>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 2 as
11 published by the Free Software Foundation;
13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
16 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
17 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
18 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
23 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
24 SOFTWARE IS DISCLAIMED.
27 /*
28 * $Id: hci_bcsp.h,v 1.2 2002/09/26 05:05:14 maxk Exp $
31 #ifndef __HCI_BCSP_H__
32 #define __HCI_BCSP_H__
34 #define BCSP_TXWINSIZE 4
36 #define BCSP_ACK_PKT 0x05
37 #define BCSP_LE_PKT 0x06
39 struct bcsp_struct {
40 struct sk_buff_head unack; /* Unack'ed packets queue */
41 struct sk_buff_head rel; /* Reliable packets queue */
42 struct sk_buff_head unrel; /* Unreliable packets queue */
44 unsigned long rx_count;
45 struct sk_buff *rx_skb;
46 u8 rxseq_txack; /* rxseq == txack. */
47 u8 rxack; /* Last packet sent by us that the peer ack'ed */
48 struct timer_list tbcsp;
50 enum {
51 BCSP_W4_PKT_DELIMITER,
52 BCSP_W4_PKT_START,
53 BCSP_W4_BCSP_HDR,
54 BCSP_W4_DATA,
55 BCSP_W4_CRC
56 } rx_state;
58 enum {
59 BCSP_ESCSTATE_NOESC,
60 BCSP_ESCSTATE_ESC
61 } rx_esc_state;
63 u16 message_crc;
64 u8 txack_req; /* Do we need to send ack's to the peer? */
66 /* Reliable packet sequence number - used to assign seq to each rel pkt. */
67 u8 msgq_txseq;
70 #endif /* __HCI_BCSP_H__ */