2 * Shared Transport Core header file
4 * Copyright (C) 2009 Texas Instruments
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <linux/skbuff.h>
27 /* states of protocol list */
34 #define ST_INITIALIZING 1
35 #define ST_REG_IN_PROGRESS 2
36 #define ST_REG_PENDING 3
37 #define ST_WAITING_FOR_RESP 4
40 * local data required for ST/KIM/ST-HCI-LL
43 unsigned long st_state
;
45 * an instance of tty_struct & ldisc ops to move around
47 struct tty_struct
*tty
;
48 struct tty_ldisc_ops
*ldisc_ops
;
51 * if the skb is already dequeued and the tty failed to write the same
52 * maintain the skb to write in the next transaction
54 struct sk_buff
*tx_skb
;
55 #define ST_TX_SENDING 1
56 #define ST_TX_WAKEUP 2
57 unsigned long tx_state
;
59 * list of protocol registered
61 struct st_proto_s
*list
[ST_MAX
];
65 unsigned long rx_state
;
66 unsigned long rx_count
;
67 struct sk_buff
*rx_skb
;
68 struct sk_buff_head txq
, tx_waitq
;
69 spinlock_t lock
; /* ST LL state lock */
70 unsigned char protos_registered
;
71 unsigned long ll_state
; /* ST LL power state */
74 /* point this to tty->driver->write or tty->ops->write
75 * depending upon the kernel version
77 int st_int_write(struct st_data_s
*, const unsigned char*, int);
78 /* internal write function, passed onto protocol drivers
79 * via the write function ptr of protocol struct
81 long st_write(struct sk_buff
*);
82 /* function to be called from ST-LL
84 void st_ll_send_frame(enum proto_type
, struct sk_buff
*);
85 /* internal wake up function */
86 void st_tx_wakeup(struct st_data_s
*st_data
);
88 int st_core_init(struct st_data_s
**);
89 void st_core_exit(struct st_data_s
*);
90 void st_kim_ref(struct st_data_s
**);
94 int gps_chrdrv_stub_write(const unsigned char*, int);
95 void gps_chrdrv_stub_init(void);