aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ti-st/st.h
blob: e8fc97e32c940402e68420c0463dbae428d50b70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 *  Shared Transport Header file
 *	To be included by the protocol stack drivers for
 *	Texas Instruments BT,FM and GPS combo chip drivers
 *
 *  Copyright (C) 2009 Texas Instruments
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#ifndef ST_H
#define ST_H

#include <linux/skbuff.h>
/*
 * st.h
 */

/* TODO:
 * Move the following to tty.h upon acceptance
 */
#define N_TI_WL	20	/* Ldisc for TI's WL BT, FM, GPS combo chips */

/* some gpios have active high, others like fm have
 * active low
 */
enum kim_gpio_state {
	KIM_GPIO_INACTIVE,
	KIM_GPIO_ACTIVE,
};
/*
 * the list of protocols on chip
 */
enum proto_type {
	ST_BT,
	ST_FM,
	ST_GPS,
	ST_MAX,
};

enum {
	ST_ERR_FAILURE = -1,	/* check struct */
	ST_SUCCESS,
	ST_ERR_PENDING = -5,	/* to call reg_complete_cb */
	ST_ERR_ALREADY,		/* already registered */
	ST_ERR_INPROGRESS,
	ST_ERR_NOPROTO,		/* protocol not supported */
};

/* per protocol structure
 * for BT/FM and GPS
 */
struct st_proto_s {
	enum proto_type type;
/*
 * to be called by ST when data arrives
 */
	long (*recv) (struct sk_buff *);
/*
 * for future use, logic now to be in ST
 */
	unsigned char (*match_packet) (const unsigned char *data);
/*
 * subsequent registration return PENDING,
 * signalled complete by this callback function
 */
	void (*reg_complete_cb) (char data);
/*
 * write function, sent in as NULL and to be returned to
 * protocol drivers
 */
	long (*write) (struct sk_buff *skb);
};

extern long st_register(struct st_proto_s *new_proto);
extern long st_unregister(enum proto_type type);

#endif /* ST_H */