blob: a2b3bb92274bf5e52bc81692cfd82426e1bd508a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 BlueCore Serial Protocol (BCSP) for Linux Bluetooth stack (BlueZ).
3 Copyright 2002 by Fabrizio Gennari <fabrizio.gennari@philips.com>
4
5 Based on
6 hci_h4.c by Maxim Krasnyansky <maxk@qualcomm.com>
7 ABCSP by Carl Orsborn <cjo@csr.com>
8
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;
12
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.
21
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.
25*/
26
27/*
28 * $Id: hci_bcsp.h,v 1.2 2002/09/26 05:05:14 maxk Exp $
29 */
30
31#ifndef __HCI_BCSP_H__
32#define __HCI_BCSP_H__
33
34#define BCSP_TXWINSIZE 4
35
36#define BCSP_ACK_PKT 0x05
37#define BCSP_LE_PKT 0x06
38
39struct 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 */
43
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;
49
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;
57
58 enum {
59 BCSP_ESCSTATE_NOESC,
60 BCSP_ESCSTATE_ESC
61 } rx_esc_state;
62
63 u16 message_crc;
64 u8 txack_req; /* Do we need to send ack's to the peer? */
65
66 /* Reliable packet sequence number - used to assign seq to each rel pkt. */
67 u8 msgq_txseq;
68};
69
70#endif /* __HCI_BCSP_H__ */