|
From: Peter K. <pk...@us...> - 2001-07-31 18:47:42
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
bluetooth.c 1.188 1.189=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Fixed a couple of compiler warnings.
* Corrected indentation.
The diff of the modified file(s):
--- bluetooth.c 2001/07/30 10:15:51 1.188
+++ bluetooth.c 2001/07/31 18:47:41 1.189
@@ -82,6 +82,7 @@
#include <linux/bluetooth/sdp.h>
#include <linux/bluetooth/sec_client.h>
#include <linux/bluetooth/bt_errno.h>
+#include <linux/bluetooth/test.h>
#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP
#include <linux/bluetooth/bcsp.h>
#endif
@@ -675,7 +676,6 @@
/* First byte is length */=20
case BTTESTCOMMAND:
{
- extern void test_process_cmd(unsigned char *cmd, s32 size);
u8 cmd[261];
=20
copy_from_user(cmd, (u8*)arg, 260);
@@ -1546,7 +1546,7 @@
struct tty_struct *upper_tty;
u32 line;
=20
- line =3D (con_id >> 8) & 0xff;
+ line =3D GET_RFCOMMLINE(con_id);
=20=09
/* get upper tty and call its ldisc->receive_buf */
=20
@@ -1769,7 +1769,6 @@
*/
int bt_catch_ncp(u8* data, u32 count)
{
- int ncp_len;
int index =3D 0;
=20
/* fixme -- do this for BCSP as well */
@@ -1939,36 +1938,28 @@
case L2CAP_TEST_LAYER:
case L2CAP_TEST2_LAYER:
case L2CAP_TEST3_LAYER:
- {
line =3D (con_id & 0x0000ffff);
BT_DRIVER(FNC"Connecting TEST_LAYER (psm %02X) on line %d\n", GET_PSM(c=
on_id), line);
=20
/* Check the line to assure no other connections on it */
=20
if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) ||
- (SESSIONSTATE(line) =3D=3D BT_ACTIVE))=20
- {
+ (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) {
D_WARN("already got connection on line %d\n",
line);=20
return -1;
}
=20=09=20=20
- if(test_connect_psmreq(bd_addr, GET_PSM(con_id)) < 0)
- {
+ if(test_connect_psmreq(bd_addr, GET_PSM(con_id)) < 0) {
BT_DRIVER("bt_connect failed\n");
return bt_ctrl.session[line].connect_status;
}
=20=20=20=20=20
return bt_ctrl.session[line].connect_status;
- }
- break;
+
case TCS_LAYER:
- {
return tcs_connect_req(bd_addr);
- }
- break;
=20=09=20=20
-=09=20=20=20=20
default:=20=20=20=20
BT_DRIVER(FNC"PSM %d not supported as client\n", GET_PSM(con_id));
break;
@@ -2127,13 +2118,13 @@
bt_disconnect(u32 con_id)
{
int line;
+
switch(GET_PSM(con_id))
{
case RFCOMM_LAYER:
- {
line =3D GET_RFCOMMLINE(con_id);
- BT_DRIVER("bt_disconnect : Disconnecting line %d (ONLY RFCOMM)\n",=20
- GET_RFCOMMLINE(con_id));
+ BT_DRIVER(__FUNCTION__ ": Disconnecting line %d (ONLY RFCOMM)\n",=20
+ line);
=20
CHECK_RFCOMM(con_id);
=20=09=20=20=20=20
@@ -2141,57 +2132,42 @@
=20=09=20=20=20=20
/* check if we have a connection */
if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) ||=20
- (SESSIONSTATE(line) =3D=3D BT_ACTIVE))
- {=20=20=20=20=20=20=20=20=20=20
- if (rfcomm_disconnect_req(GET_RFCOMMLINE(con_id)) < 0)=20
- {
- BT_DRIVER("bt_disconnect failed\n");
+ (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) {
+ if (rfcomm_disconnect_req(line) < 0) {
+ BT_DRIVER(__FUNCTION__ ": Failed\n");
return bt_ctrl.session[line].disconnect_status;
}
=20
/* fixme -- remove timers, useless when rfcomm blocks ? */
=20=20=20=20=20=20=20=20=20=20=20
/* Sleep if not yet disconnected */
- if (bt_ctrl.session[line].disconnect_status =3D=3D -1)=20
- {
+ if (bt_ctrl.session[line].disconnect_status =3D=3D -1) {
/* use connect wq for dusconnect aswell */
start_wq_timer(&bt_timer, BT_CON_TIMEOUT,=20
&bt_ctrl.connect_wq[line]);
interruptible_sleep_on(&bt_ctrl.connect_wq[line]);
}
- }
- else
- {
- bt_ctrl.session[line].disconnect_status =3D MSGCODE(MSG_BT_INTERFAC=
E,=20
- BT_NOTCONNECTED);
+ } else {
+ bt_ctrl.session[line].disconnect_status =3D
+ MSGCODE(MSG_BT_INTERFACE, BT_NOTCONNECTED);
}
return bt_ctrl.session[line].disconnect_status;
- break;
- }
=20=09=20=20
case L2CAP_TEST_LAYER:
- {
- extern l2cap_con *testcon;
test_disconnect_req(testcon); /* extern l2cap_con set in test.c */
return bt_ctrl.session[line].disconnect_status;
- break;
- }
+
case L2CAP_TEST2_LAYER:
- {
- extern l2cap_con *testcon2;
test_disconnect_req(testcon2);
return bt_ctrl.session[line].disconnect_status;
- break;
- }
+
case L2CAP_TEST3_LAYER:
- {
- extern l2cap_con *testcon3;
test_disconnect_req(testcon3);
return bt_ctrl.session[line].disconnect_status;
- break;
- }
+
default:
- BT_DRIVER("bt_disconnect: Can't disconnect this layer (PSM %x)\n", GE=
T_PSM(con_id));
+ BT_DRIVER(__FUNCTION__ ": Can't disconnect this layer (PSM %x)\n", GET_P=
SM(con_id));
+ return -EINVAL;
}
}
=20
|