From: Pavan Savoy <pavan_savoy@ti.com>
TI shared transport driver had to specifically know the
protocol headers for each type of data it can receive to
properly re-assemble data if its fragmented during UART
transaction or fragment if the data is an assembly of
different protocol data.
Now the individual protocol drivers provide enough header
information for shared transport driver to do this in a
generic way applicable for all protocols.
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
drivers/misc/ti-st/st_core.c | 355 +++++++++++++-----------------------------
drivers/misc/ti-st/st_kim.c | 56 ++++----
include/linux/ti_wilink_st.h | 40 ++++--
3 files changed, 167 insertions(+), 284 deletions(-)
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index f9aad06..84d73c5 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -25,10 +25,9 @@
#include <linux/init.h>
#include <linux/tty.h>
-/* understand BT, FM and GPS for now */
-#include <net/bluetooth/bluetooth.h>
-#include <net/bluetooth/hci_core.h>
-#include <net/bluetooth/hci.h>
+#include <linux/seq_file.h>
+#include <linux/skbuff.h>
+
#include <linux/ti_wilink_st.h>
/* function pointer pointing to either,
@@ -38,21 +37,20 @@
void (*st_recv) (void*, const unsigned char*, long);
/********************************************************************/
-#if 0
-/* internal misc functions */
-bool is_protocol_list_empty(void)
+static void add_channel_to_table(struct st_data_s *st_gdata,
+ struct st_proto_s *new_proto)
{
- unsigned char i = 0;
- pr_debug(" %s ", __func__);
- for (i = 0; i < ST_MAX; i++) {
- if (st_gdata->list[i] != NULL)
- return ST_NOTEMPTY;
- /* not empty */
- }
- /* list empty */
- return ST_EMPTY;
+ pr_info("%s: id %d\n", __func__, new_proto->chnl_id);
+ /* list now has the channel id as index itself */
+ st_gdata->list[new_proto->chnl_id] = new_proto;
+}
+
+static void remove_channel_from_table(struct ...