|
From: Mats F. <ma...@us...> - 2001-06-14 10:52:15
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
hci.c 1.158 1.159=20=20=20=20=20=20=20=20=20=20=20
l2cap.c 1.108 1.109=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Clear the HCI inbuffers when l2cap_con =3D=3D NULL
* Handle L2CAP packets < 3 bytes
* Minor debug changes
The diff of the modified file(s):
--- hci.c 2001/06/13 12:00:35 1.158
+++ hci.c 2001/06/14 10:52:14 1.159
@@ -1436,7 +1436,7 @@
case HCI_LP: /* Link policy commands */
switch (ocf) {
case ROLE_DISCOVERY:
- printk(__FUNCTION__ ": ROLE_DISCOVERY: ");
+ D_CMD(__FUNCTION__ ": ROLE_DISCOVERY: ");
if (r_val[0]) {
D_ERR(__FUNCTION__ ": ROLE_DISCOVERY: %s\n",
get_err_msg(r_val[0]));
@@ -1448,7 +1448,7 @@
printk("Connected as Master. \n");
break;
case WRITE_LINK_POLICY_SETTINGS:
- printk(__FUNCTION__ ": WRITE_LINK_POLICY_SETTINGS \n ");
+ D_CMD(__FUNCTION__ ": WRITE_LINK_POLICY_SETTINGS \n ");
if (r_val[0]) {
D_ERR(__FUNCTION__ ": WRITE_LINK_POLICY_SETTINGS: %s\n",
get_err_msg(r_val[0]));
@@ -1575,7 +1575,7 @@
l2cap_receive_data(in_buf->buf, in_buf->count,
in_buf->hci_hdl, &in_buf->l2cap_len);
=20
- } else if (in_buf->count =3D=3D in_buf->l2cap_len) {
+ } else if (in_buf->count >=3D in_buf->l2cap_len) {
l2cap_receive_data(in_buf->buf, in_buf->count,
in_buf->hci_hdl, &in_buf->l2cap_len);
}
@@ -1818,6 +1818,7 @@
hci_ctrl.hci_in_buf[i].count =3D 0;
hci_ctrl.hci_in_buf[i].l2cap_len =3D 0;
hci_ctrl.hci_in_buf[i].empty =3D TRUE;
+ hci_ctrl.hci_in_buf[i].nbr_of_hci_pkt =3D 0;
}
=20=09
for (i =3D 0; i < MAX_NBR_OF_CONNECTIONS; i ++) {
@@ -2291,7 +2292,7 @@
s32
role_discovery(u16 con_hdl)
{
- printk(__FUNCTION__ "\n");
+ D_CMD(__FUNCTION__ "\n");
=20
c_pkt.type =3D CMD_PKT;
c_pkt.opcode =3D hci_put_opcode(ROLE_DISCOVERY, HCI_LP) ;
@@ -2306,7 +2307,7 @@
s32
write_link_policy_settings(u16 con_hdl, u16 settings)
{
- printk(__FUNCTION__ "\n");
+ D_CMD(__FUNCTION__ "\n");
=20
c_pkt.type =3D CMD_PKT;
c_pkt.opcode =3D hci_put_opcode(WRITE_LINK_POLICY_SETTINGS, HCI_LP) ;
@@ -3074,7 +3075,8 @@
=20
if (active >=3D 0 && active < MAX_NBR_OF_CONNECTIONS) {
memcpy(bd, hci_ctrl.con[active].bd, 6);
- print_data("get_remote_bd: \n", bd, 6);=20=20=20=20=20=20=20=20
+ DSYS(__FUNCTION__": %02x:%02x:%02x:%02x:%02x:%02x\n",
+ bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]);
return 0;
} else {
/* No connection yet */
--- l2cap.c 2001/05/21 07:32:50 1.108
+++ l2cap.c 2001/06/14 10:52:14 1.109
@@ -587,6 +587,7 @@
case CIDRCVCONLESS:
if (!l2cap->allow_conless) {
D_WARN("Connection less data not allowed\n");
+ hci_clear_buffer(hci_handle);
return;
}
=20=09=09
@@ -604,8 +605,11 @@
/* Data channel */
con =3D get_lcon(pkt_cid);
=20=20=20=20=20
- if (con =3D=3D NULL)
+ if (con =3D=3D NULL) {
+ D_WARN(__FUNCTION__": No connection object found\n");
+ hci_clear_buffer(hci_handle);
return;
+ }
=20
if (con->current_state =3D=3D OPEN ) {=20=20=20=20=20=20
process_frame(con, pkt->data, pkt_len);
|