|
From: Anders J. <and...@us...> - 2003-01-13 19:49:10
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
bluetooth.c 1.235 1.236=20=20=20=20=20=20=20=20=20=20=20=20=20
hci.c 1.206 1.207=20=20=20=20=20=20=20=20=20=20=20=20=20
l2cap.c 1.134 1.135=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Added support to get class of device.
The diff of the modified file(s):
--- bluetooth.c 19 Nov 2002 14:13:10 -0000 1.235
+++ bluetooth.c 13 Jan 2003 19:48:26 -0000 1.236
@@ -709,6 +709,21 @@
return err;
}
=20
+ case BTREADREMOTECLASSOFDEV:
+ {
+ BD_ADDR rev_bd;
+ l2cap_con *con;
+ BT_DRIVER(__FUNCTION__ ": BTREADREMOTECLASSOFDEV\n");
+ copy_from_user(&rev_bd, (s32*)arg, 6);
+ if((con =3D get_con(rev_bd, ANY_STATE))) {
+ copy_to_user((s32*)arg, con->remote_class_of_dev, 3);
+ } else {
+ return -1;
+ }
+ return 0;
+ }
+=09
+
case BTREADREMOTENAME:
{
u8 remote_name[BT_NAME_LENGTH];
--- hci.c 19 Nov 2002 14:13:10 -0000 1.206
+++ hci.c 13 Jan 2003 19:48:30 -0000 1.207
@@ -940,7 +940,7 @@
D_CMD(__FUNCTION__ ": CONNECTION_REQUEST\n");
=20
if (buf[9] =3D=3D ACL_LINK) {
- lp_connect_ind(buf); /* BD_ADDRESS */
+ lp_connect_ind(buf, buf + 6); /* BD_ADDRESS, Class of device */
} else {
printk(__FUNCTION__ ": CONNECTION_REQUEST for SCO LINK");
accept_connection_request(buf, 0x01); /* role ignored for SCO */
@@ -3496,11 +3496,13 @@
s32
lp_connect_req(u8 bd_addr[])
{
+ u8 class_of_dev[3] =3D { 0, 0, 0 };
PRINTPKT(__FUNCTION__ ": bd address is: ", bd_addr, 6);
- /* FIXME, store the inparameters in the ctrl-block instead */
+ /* FIXME, store the inparameters in the ctrl-block instead and make
+ class of device dynamic */
=20
if (!get_con(bd_addr, ANY_STATE))
- l2cap_create_con(bd_addr);
+ l2cap_create_con(bd_addr, class_of_dev);
=20
i_am_initiator =3D 1;
=20
--- l2cap.c 27 Sep 2002 12:54:11 -0000 1.134
+++ l2cap.c 13 Jan 2003 19:48:32 -0000 1.135
@@ -1283,7 +1283,7 @@
=20
/* Indicates the lower protocol has successfully established connection */
void=20
-lp_connect_ind(BD_ADDR bd_addr)
+lp_connect_ind(BD_ADDR bd_addr, CLASS_OF_DEVICE remote_class)
{
PRINTPKT(__FUNCTION__ ": from: ", bd_addr, 6);
=20
@@ -1304,7 +1304,7 @@
=20
if (hci_ctrl.nbr_of_connections < bt_max_connections) {
D_CON(__FUNCTION__ ": Accepting connection\n");
- l2cap_create_con(bd_addr);
+ l2cap_create_con(bd_addr, remote_class);
lp_connect_rsp(bd_addr, 1);
} else {
D_CON(__FUNCTION__ ": Denying connection. Current connections: %d, max c=
onnections: %d\n", hci_ctrl.nbr_of_connections, bt_max_connections);
@@ -1314,7 +1314,7 @@
=20=09
/* is called when we accept a _new_ baseband connection */
void=20
-l2cap_create_con(BD_ADDR bd)
+l2cap_create_con(BD_ADDR bd, CLASS_OF_DEVICE remote_class)
{
l2cap_con *con;
D_RCV(__FUNCTION__ "\n");=09
@@ -1335,6 +1335,7 @@
=20=20=20=20=20=20=20=20=20
con->link_up =3D TRUE;
memcpy(con->remote_bd, bd, 6);
+ memcpy(con->remote_class_of_dev, remote_class, 3);
=20
/* have not received l2cap connection req yet */
ENTERSTATE(con, CLOSED);=20
|