aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPavan Savoy <pavan_savoy@ti.com>2011-04-08 05:57:42 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-22 20:01:09 -0400
commit764b0c4b3256ad4431cb52eaf99c0abe6df0a085 (patch)
treebf1aabc7468e61a4bfaaa4e178baf2ef31a2b57a /include
parent70a5f52165bd04cf3b33f30d5d234be28dcf29d4 (diff)
drivers:misc:ti-st: handle delayed tty receive
When certain technologies shutdown their interface without waiting for the acknowledgement from the chip. The receive_buf from the TTY would be invoked a while after the relevant technology is unregistered. This patch introduces a new flag "is_registered" which maintains the state of protocols BT, FM or GPS and thereby removes the need to clear the protocol data from ST when protocols gets unregistered. This fixes corner cases when HCI RESET is sent down from bluetooth stack and the receive_buf is called from tty after 250ms before which bluetooth would have unregistered from the system. OR - when FM application decides to close down the device without sending a power-off FM command resulting in some RDS data or interrupt data coming in after the driver is unregistered. Signed-off-by: Pavan Savoy <pavan_savoy@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ti_wilink_st.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h
index 7071ec5d0118..b004e557caa9 100644
--- a/include/linux/ti_wilink_st.h
+++ b/include/linux/ti_wilink_st.h
@@ -140,12 +140,12 @@ extern long st_unregister(struct st_proto_s *);
140 */ 140 */
141struct st_data_s { 141struct st_data_s {
142 unsigned long st_state; 142 unsigned long st_state;
143 struct tty_struct *tty;
144 struct sk_buff *tx_skb; 143 struct sk_buff *tx_skb;
145#define ST_TX_SENDING 1 144#define ST_TX_SENDING 1
146#define ST_TX_WAKEUP 2 145#define ST_TX_WAKEUP 2
147 unsigned long tx_state; 146 unsigned long tx_state;
148 struct st_proto_s *list[ST_MAX_CHANNELS]; 147 struct st_proto_s *list[ST_MAX_CHANNELS];
148 bool is_registered[ST_MAX_CHANNELS];
149 unsigned long rx_state; 149 unsigned long rx_state;
150 unsigned long rx_count; 150 unsigned long rx_count;
151 struct sk_buff *rx_skb; 151 struct sk_buff *rx_skb;
@@ -155,6 +155,7 @@ struct st_data_s {
155 unsigned char protos_registered; 155 unsigned char protos_registered;
156 unsigned long ll_state; 156 unsigned long ll_state;
157 void *kim_data; 157 void *kim_data;
158 struct tty_struct *tty;
158}; 159};
159 160
160/* 161/*