|
From: Peter K. <pk...@us...> - 2001-10-23 09:21:00
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
hci_vendor.c 1.59 1.60=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Let csr_waitcmdnum() timeout after five seconds to not hang
there indefinitely if no COMMAND_STATUS event is received.
The diff of the modified file(s):
--- hci_vendor.c 2001/10/16 11:13:09 1.59
+++ hci_vendor.c 2001/10/23 09:20:59 1.60
@@ -796,10 +796,12 @@
=20
void csr_waitcmdnum(void)
{
+ int count =3D 5 * HZ;
+=20=20
D_CMD(__FUNCTION__"\n");
hci_ctrl.hc_buf.cmd_num =3D 0;
/* wait for command status */
- while (hci_ctrl.hc_buf.cmd_num =3D=3D 0)
+ while (hci_ctrl.hc_buf.cmd_num =3D=3D 0 && --count)
{
current->state =3D TASK_INTERRUPTIBLE;
#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,2,0)
@@ -809,6 +811,11 @@
schedule();
current->timeout =3D 0;
#endif
+ }
+
+ if (!count) {
+ D_WARN(__FUNCTION__ ": Did not receive COMMAND_STATUS within five second=
s!\n");
+ hci_ctrl.hc_buf.cmd_num =3D 1;
}
}
=20
|