|
From: Mattias A. <mat...@us...> - 2001-06-29 10:46:30
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.185 1.186=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Added function that searches a data buffer for number of complete packet
events. If only NCP was found, return 1. Otherwize return 0.
The diff of the modified file(s):
--- bluetooth.c 2001/06/19 10:34:34 1.185
+++ bluetooth.c 2001/06/29 10:46:29 1.186
@@ -1743,6 +1743,43 @@
}
}
#endif /* CONFIG_BLUETOOTH_USE_INBUFFER */
+
+
+/*=20
+ * Searches data buffer for number of completed packets (NCP)=20
+ * If only NCP data was found tell serial driver not to=20
+ * schedule a flip of DMA inbuffer.
+ */
+int bt_catch_ncp(u8* data, u32 count)
+{
+ int ncp_len;
+ int index =3D 0;
+
+ /* fixme -- do this for BCSP as well */
+#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP
+ if (bt_use_bcsp(-1))
+ return 0;
+#endif
+
+ /* || uart hdr | event code | par_len | nbr_handles | [data...] || */
+
+ while (((index+2) < count) && (data[index] =3D=3D 0x4) &&=20
+ (data[index+1] =3D=3D 0x13) ) {
+ /* we found a NCP */
+ index +=3D (3 + data[index + 2]); /* event hdr + par len */
+ }
+
+ if (index =3D=3D count) {
+ /* Contains _only_ NCP data, parse it ! */
+ bt_receive_data(data, count);
+ return 1;
+ }
+=09
+ /* Contains more than NCP data, tell serial=20
+ driver to queue it up as usual */
+ return 0;
+}
+
=20
static void
bt_receive_data(u8* data, u32 count)
|