]>
Commit | Line | Data |
---|---|---|
69f6e06d PS |
1 | /* |
2 | * Shared Transport Header file | |
3 | * To be included by the protocol stack drivers for | |
4 | * Texas Instruments BT,FM and GPS combo chip drivers | |
5 | * | |
6 | * Copyright (C) 2009 Texas Instruments | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License version 2 as | |
10 | * published by the Free Software Foundation. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program; if not, write to the Free Software | |
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
20 | * | |
21 | */ | |
22 | ||
23 | #ifndef ST_H | |
24 | #define ST_H | |
25 | ||
26 | #include <linux/skbuff.h> | |
69f6e06d PS |
27 | |
28 | /* TODO: | |
29 | * Move the following to tty.h upon acceptance | |
30 | */ | |
31 | #define N_TI_WL 20 /* Ldisc for TI's WL BT, FM, GPS combo chips */ | |
32 | ||
36b5aee4 PS |
33 | /** |
34 | * enum kim_gpio_state - Few protocols such as FM have ACTIVE LOW | |
35 | * gpio states for their chip/core enable gpios | |
69f6e06d PS |
36 | */ |
37 | enum kim_gpio_state { | |
38 | KIM_GPIO_INACTIVE, | |
39 | KIM_GPIO_ACTIVE, | |
40 | }; | |
36b5aee4 PS |
41 | |
42 | /** | |
43 | * enum proto-type - The protocol on WiLink chips which share a | |
44 | * common physical interface like UART. | |
69f6e06d PS |
45 | */ |
46 | enum proto_type { | |
47 | ST_BT, | |
48 | ST_FM, | |
49 | ST_GPS, | |
50 | ST_MAX, | |
51 | }; | |
52 | ||
36b5aee4 PS |
53 | /** |
54 | * struct st_proto_s - Per Protocol structure from BT/FM/GPS to ST | |
55 | * @type: type of the protocol being registered among the | |
56 | * available proto_type(BT, FM, GPS the protocol which share TTY). | |
57 | * @recv: the receiver callback pointing to a function in the | |
58 | * protocol drivers called by the ST driver upon receiving | |
59 | * relevant data. | |
60 | * @match_packet: reserved for future use, to make ST more generic | |
61 | * @reg_complete_cb: callback handler pointing to a function in protocol | |
62 | * handler called by ST when the pending registrations are complete. | |
63 | * The registrations are marked pending, in situations when fw | |
64 | * download is in progress. | |
65 | * @write: pointer to function in ST provided to protocol drivers from ST, | |
66 | * to be made use when protocol drivers have data to send to TTY. | |
bb8f3c06 PS |
67 | * @priv_data: privdate data holder for the protocol drivers, sent |
68 | * from the protocol drivers during registration, and sent back on | |
69 | * reg_complete_cb and recv. | |
69f6e06d PS |
70 | */ |
71 | struct st_proto_s { | |
72 | enum proto_type type; | |
bb8f3c06 | 73 | long (*recv) (void *, struct sk_buff *); |
69f6e06d | 74 | unsigned char (*match_packet) (const unsigned char *data); |
bb8f3c06 | 75 | void (*reg_complete_cb) (void *, char data); |
69f6e06d | 76 | long (*write) (struct sk_buff *skb); |
bb8f3c06 | 77 | void *priv_data; |
69f6e06d PS |
78 | }; |
79 | ||
38d9df49 PS |
80 | extern long st_register(struct st_proto_s *); |
81 | extern long st_unregister(enum proto_type); | |
69f6e06d PS |
82 | |
83 | #endif /* ST_H */ |