|
From: Peter K. <pk...@us...> - 2001-10-05 12:07:13
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.200 1.201=20=20=20=20=20=20=20=20=20=20=20
hci.c 1.183 1.184=20=20=20=20=20=20=20=20=20=20=20
hci_vendor.c 1.56 1.57=20=20=20=20=20=20=20=20=20=20=20=20
rfcomm.c 1.121 1.122=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Some initialization needs to be done at module start time, not
when the stack is initialized.
* Initialize (part of) hci even when in DFU mode.
The diff of the modified file(s):
--- bluetooth.c 2001/10/02 13:44:49 1.200
+++ bluetooth.c 2001/10/05 12:06:43 1.201
@@ -2495,6 +2495,9 @@
#endif /* LINUX_VERSION_CODE */
#endif /* __KERNEL__ */
=20
+ hci_module_init();
+ rfcomm_module_init();
+=20=20=20=20=20=20=20=20
return 0; /*success*/
}
=20
@@ -2596,13 +2599,13 @@
}
#endif
=20
- if (!bt_dfu_mode(-1)) {
/* Always check if hci succeeded */
if (hci_init() < 0){
D_ERR("HCI failed to initialise\n");
goto init_failed_exit1;
}
=20=09
+ if (!bt_dfu_mode(-1)) {
l2cap_init();
=20
#ifdef CONFIG_BLUETOOTH_USE_TCI
@@ -2626,6 +2629,9 @@
=20
init_failed_exit1:=20
hci_shutdown();
+#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP
+ bcsp_shutdown();
+#endif
init_failed_exit0:
btmem_shutdown();
if (tmp_bt_buf) {
@@ -3000,8 +3006,9 @@
sdp_shutdown();
tcs_shutdown();
l2cap_shutdown();
- hci_shutdown();
}
+
+ hci_shutdown();
}
=20
bt_dfu_mode(0);
--- hci.c 2001/10/02 13:40:56 1.183
+++ hci.c 2001/10/05 12:06:43 1.184
@@ -1824,18 +1824,8 @@
}
=20
s32
-hci_init(void)
+hci_module_init(void)
{
- u32 i;
-
- DSYS("Initialising HCI\n");
-
-#ifdef HCI_EMULATION
- DSYS("*** HCI emulator on ***\n");
-#else
- DSYS("HCI emulator off\n");
-#endif
-=09
#ifdef __KERNEL__
#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0)
init_waitqueue_head(&hci_wq);
@@ -1848,7 +1838,23 @@
#endif /* __KERNEL__ */
=20
#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP
- hci_init_dfu();
+ hci_dfu_module_init();
+#endif
+
+ return 0;
+}
+
+s32
+hci_init(void)
+{
+ u32 i;
+
+ DSYS("Initialising HCI\n");
+
+#ifdef HCI_EMULATION
+ DSYS("*** HCI emulator on ***\n");
+#else
+ DSYS("HCI emulator off\n");
#endif
=20
DSYS("Initialising HCI inbuffers [%d]\n", HCI_IN_SIZE);
@@ -1867,9 +1873,8 @@
hci_ctrl.con[i].con_hdl =3D -1;
}
=20
-/* Here we set the buffer sizes to zero, just to avoid that they should get
- undefined values if the initiating read buffersize fails */
-
+ /* Here we set the buffer sizes to zero, just to avoid that they
+ get undefined values if we fail to read the buffer sizes below =
*/
hci_ctrl.hc_buf.acl_len =3D 0;
hci_ctrl.hc_buf.sco_len =3D 0;
hci_ctrl.hc_buf.acl_num =3D 0;
@@ -1894,6 +1899,9 @@
send_data_task.data =3D NULL;
#endif
=20
+ if (bt_dfu_mode(-1))
+ return 0;
+=20=20=20=20=20=20=20=20
DSYS("Reading buffer sizes in HW module\n");
hci_read_buffer_size(HCI_BLOCK);
=20
@@ -1932,7 +1940,6 @@
void=20
hci_shutdown(void)
{
-=20=20
/* take down any open acl links */
=20
hci_ctrl.nbr_of_connections =3D 0;
@@ -3969,6 +3976,7 @@
release_ncp_timer(void)
{
#ifdef __KERNEL__
+ if (hci_ncp_timer.function)
del_timer(&hci_ncp_timer);
#endif
}
--- hci_vendor.c 2001/10/03 17:19:10 1.56
+++ hci_vendor.c 2001/10/05 12:06:43 1.57
@@ -671,7 +671,7 @@
#endif /* LINUX_VERSION_CODE */
=20
void
-hci_init_dfu(void)
+hci_dfu_module_init(void)
{
#ifdef __KERNEL__
#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0)
@@ -693,6 +693,8 @@
=20
kfree(response);
}
+
+ wake_up_interruptible(&dfu_wq);
}
=20
void
--- rfcomm.c 2001/10/04 14:52:59 1.121
+++ rfcomm.c 2001/10/05 12:06:43 1.122
@@ -544,17 +544,23 @@
rfcomm_con_list[line].l2cap =3D NULL;
}
=20
-void=20
-rfcomm_init(void)
+s32
+rfcomm_module_init(void)
{
- s32 i;
- protocol_layer this_layer;
-
#ifdef __KERNEL__
#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0)
init_waitqueue_head(&rfcomm_disconnect_wq);
#endif /* LINUX_VERSION_CODE */
#endif /* __KERNEL__ */
+
+ return 0;
+}
+
+void
+rfcomm_init(void)
+{
+ s32 i;
+ protocol_layer this_layer;
=20
DSYS("Initialising RFCOMM\n");
create_crctable(crctable);
|