diff options
author | Pavan Savoy <pavan_savoy@ti.com> | 2011-02-04 03:23:09 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-04 15:41:20 -0500 |
commit | 5c88b02196a99332dacf305c8757674dd7a303ff (patch) | |
tree | 1bb1bce0b89867f6bdedd67c4f32623234fa3a2b /include/linux/ti_wilink_st.h | |
parent | 6d6a49e9c9dddff61649249c2b0d5d462fa1a692 (diff) |
drivers:misc: ti-st: register with channel IDs
The architecture of shared transport had begun with individual
protocols like bluetooth, fm and gps telling the shared transport
what sort of protocol they are and then expecting the ST driver
to parse the incoming data from chip and forward data only
relevant to the protocol drivers.
This change would mean each protocol drivers would also send
information to ST driver as to how to intrepret their protocol
data coming out of the chip.
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/ti_wilink_st.h')
-rw-r--r-- | include/linux/ti_wilink_st.h | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h index 4c7be2263011..1674ca7ab86d 100644 --- a/include/linux/ti_wilink_st.h +++ b/include/linux/ti_wilink_st.h | |||
@@ -42,7 +42,7 @@ enum proto_type { | |||
42 | ST_BT, | 42 | ST_BT, |
43 | ST_FM, | 43 | ST_FM, |
44 | ST_GPS, | 44 | ST_GPS, |
45 | ST_MAX, | 45 | ST_MAX_CHANNELS = 16, |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /** | 48 | /** |
@@ -62,6 +62,17 @@ enum proto_type { | |||
62 | * @priv_data: privdate data holder for the protocol drivers, sent | 62 | * @priv_data: privdate data holder for the protocol drivers, sent |
63 | * from the protocol drivers during registration, and sent back on | 63 | * from the protocol drivers during registration, and sent back on |
64 | * reg_complete_cb and recv. | 64 | * reg_complete_cb and recv. |
65 | * @chnl_id: channel id the protocol driver is interested in, the channel | ||
66 | * id is nothing but the 1st byte of the packet in UART frame. | ||
67 | * @max_frame_size: size of the largest frame the protocol can receive. | ||
68 | * @hdr_len: length of the header structure of the protocol. | ||
69 | * @offset_len_in_hdr: this provides the offset of the length field in the | ||
70 | * header structure of the protocol header, to assist ST to know | ||
71 | * how much to receive, if the data is split across UART frames. | ||
72 | * @len_size: whether the length field inside the header is 2 bytes | ||
73 | * or 1 byte. | ||
74 | * @reserve: the number of bytes ST needs to reserve in the skb being | ||
75 | * prepared for the protocol driver. | ||
65 | */ | 76 | */ |
66 | struct st_proto_s { | 77 | struct st_proto_s { |
67 | enum proto_type type; | 78 | enum proto_type type; |
@@ -70,10 +81,17 @@ struct st_proto_s { | |||
70 | void (*reg_complete_cb) (void *, char data); | 81 | void (*reg_complete_cb) (void *, char data); |
71 | long (*write) (struct sk_buff *skb); | 82 | long (*write) (struct sk_buff *skb); |
72 | void *priv_data; | 83 | void *priv_data; |
84 | |||
85 | unsigned char chnl_id; | ||
86 | unsigned short max_frame_size; | ||
87 | unsigned char hdr_len; | ||
88 | unsigned char offset_len_in_hdr; | ||
89 | unsigned char len_size; | ||
90 | unsigned char reserve; | ||
73 | }; | 91 | }; |
74 | 92 | ||
75 | extern long st_register(struct st_proto_s *); | 93 | extern long st_register(struct st_proto_s *); |
76 | extern long st_unregister(enum proto_type); | 94 | extern long st_unregister(struct st_proto_s *); |
77 | 95 | ||
78 | 96 | ||
79 | /* | 97 | /* |
@@ -114,6 +132,7 @@ extern long st_unregister(enum proto_type); | |||
114 | * @rx_skb: the skb where all data for a protocol gets accumulated, | 132 | * @rx_skb: the skb where all data for a protocol gets accumulated, |
115 | * since tty might not call receive when a complete event packet | 133 | * since tty might not call receive when a complete event packet |
116 | * is received, the states, count and the skb needs to be maintained. | 134 | * is received, the states, count and the skb needs to be maintained. |
135 | * @rx_chnl: the channel ID for which the data is getting accumalated for. | ||
117 | * @txq: the list of skbs which needs to be sent onto the TTY. | 136 | * @txq: the list of skbs which needs to be sent onto the TTY. |
118 | * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued | 137 | * @tx_waitq: if the chip is not in AWAKE state, the skbs needs to be queued |
119 | * up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs | 138 | * up in here, PM(WAKEUP_IND) data needs to be sent and then the skbs |
@@ -135,10 +154,11 @@ struct st_data_s { | |||
135 | #define ST_TX_SENDING 1 | 154 | #define ST_TX_SENDING 1 |
136 | #define ST_TX_WAKEUP 2 | 155 | #define ST_TX_WAKEUP 2 |
137 | unsigned long tx_state; | 156 | unsigned long tx_state; |
138 | struct st_proto_s *list[ST_MAX]; | 157 | struct st_proto_s *list[ST_MAX_CHANNELS]; |
139 | unsigned long rx_state; | 158 | unsigned long rx_state; |
140 | unsigned long rx_count; | 159 | unsigned long rx_count; |
141 | struct sk_buff *rx_skb; | 160 | struct sk_buff *rx_skb; |
161 | unsigned char rx_chnl; | ||
142 | struct sk_buff_head txq, tx_waitq; | 162 | struct sk_buff_head txq, tx_waitq; |
143 | spinlock_t lock; | 163 | spinlock_t lock; |
144 | unsigned char protos_registered; | 164 | unsigned char protos_registered; |
@@ -243,12 +263,12 @@ struct kim_data_s { | |||
243 | struct completion kim_rcvd, ldisc_installed; | 263 | struct completion kim_rcvd, ldisc_installed; |
244 | char resp_buffer[30]; | 264 | char resp_buffer[30]; |
245 | const struct firmware *fw_entry; | 265 | const struct firmware *fw_entry; |
246 | long gpios[ST_MAX]; | 266 | long gpios[ST_MAX_CHANNELS]; |
247 | unsigned long rx_state; | 267 | unsigned long rx_state; |
248 | unsigned long rx_count; | 268 | unsigned long rx_count; |
249 | struct sk_buff *rx_skb; | 269 | struct sk_buff *rx_skb; |
250 | struct rfkill *rfkill[ST_MAX]; | 270 | struct rfkill *rfkill[ST_MAX_CHANNELS]; |
251 | enum proto_type rf_protos[ST_MAX]; | 271 | enum proto_type rf_protos[ST_MAX_CHANNELS]; |
252 | struct st_data_s *core_data; | 272 | struct st_data_s *core_data; |
253 | struct chip_version version; | 273 | struct chip_version version; |
254 | }; | 274 | }; |
@@ -338,12 +358,8 @@ struct hci_command { | |||
338 | 358 | ||
339 | /* ST LL receiver states */ | 359 | /* ST LL receiver states */ |
340 | #define ST_W4_PACKET_TYPE 0 | 360 | #define ST_W4_PACKET_TYPE 0 |
341 | #define ST_BT_W4_EVENT_HDR 1 | 361 | #define ST_W4_HEADER 1 |
342 | #define ST_BT_W4_ACL_HDR 2 | 362 | #define ST_W4_DATA 2 |
343 | #define ST_BT_W4_SCO_HDR 3 | ||
344 | #define ST_BT_W4_DATA 4 | ||
345 | #define ST_FM_W4_EVENT_HDR 5 | ||
346 | #define ST_GPS_W4_EVENT_HDR 6 | ||
347 | 363 | ||
348 | /* ST LL state machines */ | 364 | /* ST LL state machines */ |
349 | #define ST_LL_ASLEEP 0 | 365 | #define ST_LL_ASLEEP 0 |