|
From: Mats F. <ma...@us...> - 2001-05-18 07:02:40
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
hci_vendor.c 1.36 1.37=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Send back a GETRESP if we receive a HQ SETREQ
The diff of the modified file(s):
--- hci_vendor.c 2001/05/17 15:04:38 1.36
+++ hci_vendor.c 2001/05/18 07:02:38 1.37
@@ -521,6 +521,8 @@
=20
static u16 csr_count =3D 0;
=20
+static s32 csr_send_general_hq(csr_bccmd *cmd);
+
#ifdef CONFIG_BLUETOOTH_USE_BCSP
void
hci_receive_bcsp(u8 *data, u32 count)
@@ -565,10 +567,11 @@
break;
}
} else {
- DSYS(__FUNCTION__", Not a GETRESP msg\n");
+ DSYS(__FUNCTION__": Not a GETRESP msg\n");
+ print_data(__FUNCTION__, data, count);
}
} else {
- D_ERR(__FUNCTION__", BCSP status error 0x%x\n", cmd->status);
+ D_ERR(__FUNCTION__": BCSP status error 0x%x\n", cmd->status);
print_data(__FUNCTION__, data, count);
}
=20
@@ -622,17 +625,55 @@
D_ERR("Unknown varid [0x%x]!\n", cmd->var_id);
break;
}
+ } else if (cmd->type =3D=3D CSR_MSGTYPE_SETREQ) {
+ DSYS(__FUNCTION__": Received a SETREQ, sending back GETRESP\n");
+ print_data(__FUNCTION__, data, count);
+ cmd->type =3D CSR_MSGTYPE_GETRESP;
+ cmd->seq =3D csr_count++;
+=09
+ csr_send_general_hq(cmd);
+=09=09=09
+ } else if (cmd->type =3D=3D CSR_MSGTYPE_GETREQ) {
+ DSYS(__FUNCTION__": Received a GETREQ\n");
+ print_data(__FUNCTION__, data, count);
} else {
- DSYS(__FUNCTION__", Not a GETRESP msg\n");
+ DSYS(__FUNCTION__": Unknown message type\n");
+ print_data(__FUNCTION__, data, count);
}
} else {
- D_ERR(__FUNCTION__", HQ status error 0x%x\n", cmd->status);
+ D_ERR(__FUNCTION__": HQ status error 0x%x\n", cmd->status);
print_data(__FUNCTION__, data, count);
}
=20=09
wake_up_interruptible(&hci_wq);=09
}
+
+s32
+csr_send_general_hq(csr_bccmd *cmd)
+{
+ csr_msg *msg;
+
+ /* HCI Manufacturer specific header */
+ c_pkt.type =3D CMD_PKT;
+ c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f);
+ c_pkt.len =3D 1 + cmd->len * 2;
+=09
+ msg =3D (csr_msg *)c_pkt.data;
+=09
+ /* General msg header */
+ msg->p_descr.last =3D 1; /* first and last segment */
+ msg->p_descr.first =3D 1;
+ msg->p_descr.ch_id =3D CSR_CH_ID_HQ;
+
+ memcpy(msg->msg, cmd, cmd->len * 2);
+
+ print_data(__FUNCTION__, (u8*)&c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_L=
EN);
+=09
+ return bcsp_write_top((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN=
);
+}
#endif
+
+
=20
s32=20
hci_set_bd_addr(u8 bd[6])
|