From: Peter K. <pk...@us...> - 2001-05-22 09:46:24
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20 bluetooth.c 1.175 1.176=20=20=20=20=20=20=20=20=20=20=20 hci.c 1.147 1.148=20=20=20=20=20=20=20=20=20=20=20 hci_vendor.c 1.39 1.40=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: BCSP can now be turned on/off in run-time if it is enabled. The diff of the modified file(s): --- bcsp.c 2001/05/18 16:03:51 1.8 +++ bcsp.c 2001/05/22 09:45:53 1.9 @@ -218,7 +218,7 @@ D(__FUNCTION__ ": Outgoing data:\n"); PRINTPKT(data, len); =20 - return bt_write_lower_driver(data, len); + return bt_write_lower_driver_real(data, len); } =20 void --- bluetooth.c 2001/05/18 09:14:20 1.175 +++ bluetooth.c 2001/05/22 09:45:53 1.176 @@ -82,6 +82,9 @@ #include <linux/bluetooth/sdp.h> #include <linux/bluetooth/sec_client.h> #include <linux/bluetooth/bt_errno.h> +#ifdef CONFIG_BLUETOOTH_USE_BCSP +#include <linux/bluetooth/bcsp.h> +#endif =20 #ifdef CONFIG_BLUETOOTH_USE_TCI #include <linux/bluetooth/tci.h> @@ -91,10 +94,6 @@ #include <linux/bluetooth/bt_proc.h> #endif =20 -#ifdef CONFIG_BLUETOOTH_USE_BCSP -#define hci_receive_data(data, len) bcsp_receive_lower(data, len) -#endif - #ifdef __CRIS__ #include <asm/io.h> #endif @@ -188,6 +187,8 @@ static void bt_handle_indata(const __u8 *data, s32 count); #endif =20 +static void bt_receive_data(u8* data, u32 count); + static void bt_show_version(void); static void bt_init_stack(void); static s32 bt_ctrl_init(void); @@ -1327,6 +1328,17 @@ =20 s32 bt_write_lower_driver(u8 *data, s32 len) +#ifdef CONFIG_BLUETOOTH_USE_BCSP +{ + if (bt_use_bcsp(-1)) + return bcsp_write_top(data, len); + else + return bt_write_lower_driver_real(data, len); +} + +s32 +bt_write_lower_driver_real(u8 *data, s32 len) +#endif { #define FNC "bt_write_lower_driver: " =20 @@ -1388,7 +1400,7 @@ bt_handle_indata(data, count); #else /* process data right away */ - hci_receive_data((u8*)data, count); + bt_receive_data((u8*)data, count); #endif /* CONFIG_BLUETOOTH_USE_INBUFFER */ } =20 @@ -1632,8 +1644,8 @@ hci_data.get =3D hci_data.put; sti(); =20 - hci_receive_data(getTemp, size_end); - hci_receive_data(hci_data.head, size_start); + bt_receive_data(getTemp, size_end); + bt_receive_data(hci_data.head, size_start); } else { /* no wrapped buffer */ @@ -1644,11 +1656,22 @@ hci_data.get =3D hci_data.put; sti(); =20 - hci_receive_data(getTemp, size_end); + bt_receive_data(getTemp, size_end); } } #endif /* CONFIG_BLUETOOTH_USE_INBUFFER */ =20 +static void +bt_receive_data(u8* data, u32 count) +{ +#ifdef CONFIG_BLUETOOTH_USE_BCSP + if (bt_use_bcsp(-1)) + bcsp_receive_lower(data, count); + else +#endif + hci_receive_data(data, count); +} + /* Opens a connection to the selected PSM, layer specific is the same as t= he * lowest part on the connection ID, in RFCOMM this is line | dlci, each o= ne * is 8-bits=20 @@ -2277,13 +2300,33 @@ } =20 s32 -bt_initiated() +bt_initiated(void) { return bt_stack_initiated; } =20 +s32 +bt_use_bcsp(s32 new_use_bcsp) +{ +#ifdef CONFIG_BLUETOOTH_USE_BCSP + static s32 use_bcsp =3D 1; +#else + static s32 use_bcsp =3D 0; +#endif + s32 old =3D use_bcsp; + + if (new_use_bcsp >=3D 0) + { +#ifdef CONFIG_BLUETOOTH_USE_BCSP + use_bcsp =3D new_use_bcsp; +#endif + } + + return old; +} + void -bt_init_stack() +bt_init_stack(void) { unsigned long page; =20=09 @@ -2393,7 +2436,7 @@ #endif /* BT_USELINEBUF */ =20 s32 -bt_ctrl_init() +bt_ctrl_init(void) { s32 i; BT_DRIVER("Initiating bt ctrl struct\n"); @@ -2598,7 +2641,7 @@ { s32 line =3D GET_TTYLINE(tty); =20=20 - BT_DRIVER("Registering tty on line %d\n", line); + BT_DRIVER("Registering tty on line %d (%s)\n", line, current->comm); =20=09 /* Allow multiple open for ttyBTC */ if (line =3D=3D BT_NBR_PORTS-BT_NBR_CTRLPORTS) { --- hci.c 2001/05/15 15:00:55 1.147 +++ hci.c 2001/05/22 09:45:53 1.148 @@ -140,10 +140,6 @@ #define USE_NCPTIMER=20 #define NCP_TIMEOUT (3*HZ) =20 -#ifdef CONFIG_BLUETOOTH_USE_BCSP -#define bt_write_lower_driver(data, len) bcsp_write_top(data, len) -#endif - /****************** TYPE DEFINITION SECTION ******************************= ***/ =20 /* cmd_t and cmd_buf are structures used to handle the queue of commands --- hci_vendor.c 2001/05/18 13:50:07 1.39 +++ hci_vendor.c 2001/05/22 09:45:53 1.40 @@ -86,10 +86,6 @@ =20 #define BT_HW_INFO_MAX 255 =20 -#ifdef CONFIG_BLUETOOTH_USE_BCSP -#define bt_write_lower_driver(data, len) bcsp_write_top(data, len) -#endif - /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 /* These are declared in hci.c */ |