|
From: Mattias A. <mat...@us...> - 2001-06-13 11:55:17
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
hci_vendor.c 1.44 1.45=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Added csr_waitcmdnum. After syncronizing BCSP it waits until a command=20
status with cmd_num is received.
* Hide some printouts regarding ps key settings in debug macros
The diff of the modified file(s):
--- hci_vendor.c 2001/06/08 12:39:42 1.44
+++ hci_vendor.c 2001/06/13 11:55:16 1.45
@@ -563,8 +563,10 @@
break;
=20=09=09=09=09
case CSR_CMD_PS:
- printk(__FUNCTION__": ps key[0x%x] ", ps->ps_key);
- print_data("", (u8*)ps->ps_val, ps->ps_len*sizeof(u16));
+ D_CMD(__FUNCTION__": ps key[0x%x]\n",=20
+ ps->ps_key);
+ PRINTPKT("", (u8*)ps->ps_val,=20
+ ps->ps_len*sizeof(u16));
=20=09=09=09=09
/* Now copy this data to return buf */
memcpy(ps_retbuf, ps->ps_val,=20
@@ -680,6 +682,23 @@
}
#endif
=20
+/* When using BCSP this function is used to wait for the
+ COMMAND_STATUS which contains cmd_num */
+
+void csr_waitcmdnum(void)
+{
+ 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)
+ {
+ current->timeout =3D HZ/100;
+ current->state =3D TASK_INTERRUPTIBLE;
+ schedule();
+ current->timeout =3D 0;
+ }
+}
+
s32=20
csr_pskey(u16 ps_key, u16 rw_mode, u16 *retb, u16 n_pars)
{
@@ -688,8 +707,8 @@
csr_bccmd *cmd;
csr_bccmd_ps *ps;
=20
- printk(__FUNCTION__" : ps_key 0x%x [%d]\n", ps_key, rw_mode);=09
- print_data("pars : ", (u8*)retb, n_pars*sizeof(u16));
+ D_CMD(__FUNCTION__" : ps_key 0x%x [%d]\n", ps_key, rw_mode);=09
+ PRINTPKT("pars : ", (u8*)retb, n_pars*sizeof(u16));
=20
/* HCI Manufacturer specific header */
c_pkt.type =3D CMD_PKT;
@@ -836,7 +855,7 @@
csr_msg *msg;
csr_bccmd *cmd;
=20
- D_CMD(__FUNCTION__ VENDOR "\n");
+ D_CMD(__FUNCTION__ VENDOR " BuildID/ChipVer/ChipRev\n");
=20=09
/* HCI Manufacturer specific header */
c_pkt.type =3D CMD_PKT;
@@ -955,8 +974,11 @@
interruptible_sleep_on(&set_baudrate_wq);
}
=20
- tmp =3D bt_write_lower_driver((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI=
_HDR_LEN);
+ tmp =3D bt_write_lower_driver((u8*) &c_pkt,=20
+ c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN);
=20
+ bt_wait_tx(2000); /* wait until DMA empty + 2 ms */
+
hci_ctrl.hc_buf.cmd_num--;
=20
return tmp;
@@ -1004,8 +1026,10 @@
break;
=20
case CSR_CMD_PS:
- printk(__FUNCTION__": ps key[0x%x] ", ps->ps_key);
- print_data("", (u8*)ps->ps_val, ps->ps_len*sizeof(u16));
+ D_CMD(__FUNCTION__": ps key[0x%x]\n",=20
+ ps->ps_key);
+ PRINTPKT("", (u8*)ps->ps_val,=20
+ ps->ps_len*sizeof(u16));
=20=09=09=09=09
/* Now copy this data to return buf */
=20=09=09=09=09
@@ -1104,8 +1128,6 @@
break;
=20
case CSR_CMD_PS:
- if (cmd->len > 2*5)
- printk("ps: key 0x%x, len %d\n", ps->ps_key, ps->ps_len);
break;
=20
default:
|