|
From: Peter K. <pk...@us...> - 2002-09-27 12:54:43
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Tag Comment
---- ----------- ----------- --- -------
l2cap.c 1.133 1.134=20=20=20=20=20=20=20=20=20=20=20=20=20
l2cap_con.c 1.14 1.15=20=20=20=20=20=20=20=20=20=20=20=20=20=20
rfcomm.c 1.136 1.137=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Made the user stack compile again (I am pretty sure it does not
work, but at least it compiles).
The diff of the modified file(s):
--- l2cap.c 11 Apr 2002 10:17:38 -0000 1.133
+++ l2cap.c 27 Sep 2002 12:54:11 -0000 1.134
@@ -3116,7 +3116,7 @@
add_timer(&con->timers.ertx.timer);
#else
/* fixme */
- con->timer.ertx_inuse =3D 1;
+ con->timers.ertx.inuse =3D 1;
#endif
}
=20
--- l2cap_con.c 1 Aug 2002 16:19:28 -0000 1.14
+++ l2cap_con.c 27 Sep 2002 12:54:11 -0000 1.15
@@ -445,11 +445,15 @@
this connection */
if(con->timers.rtx.inuse) {
wake_up_interruptible(&con->wq);
+#ifdef __KERNEL__
del_timer(&con->timers.rtx.timer);
+#endif
}
if(con->timers.ertx.inuse) {
wake_up_interruptible(&con->wq);
+#ifdef __KERNEL__
del_timer(&con->timers.ertx.timer);
+#endif
}
=20
if (con_list.count =3D=3D 1) {
--- rfcomm.c 9 Aug 2002 09:03:36 -0000 1.136
+++ rfcomm.c 27 Sep 2002 12:54:11 -0000 1.137
@@ -526,9 +526,7 @@
/* One RFCOMM connection for each ttyBTx */
rfcomm_con rfcomm_con_list[BT_NBR_DATAPORTS];
=20
-#ifdef __KERNEL__
static struct bt_timer_obj rfcomm_timer;
-#endif
=20
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
struct wait_queue *rfcomm_disconnect_wq;
@@ -675,8 +673,10 @@
=20=20=20
DSYS("Shutting down RFCOMM\n");
=20
+#ifdef __KERNEL__
/* Make sure we don't have any outstanding timers */
release_wq_timer(&rfcomm_timer);
+#endif
=20
/* First try disconnecting */
for (i =3D 0; i < BT_NBR_DATAPORTS; i++) {
@@ -723,7 +723,6 @@
tmp_dlci =3D (server_chn << 1) | (~rfcomm->initiator & 0x1);
=20=09
if (!(rfcomm->l2cap)) {
-
rfcomm->dlci[0].state =3D CONNECTING;=20=20=20=20
=20
/* we don't have a l2cap connection yet */
@@ -732,12 +731,10 @@
return retval;
}
} else if (!((rfcomm->l2cap)->current_state =3D=3D OPEN)) {
-=09=09
D_ERR(FNC"L2CAP_CON exists but is not in OPEN state (yet?)\n");
/* FIXME: Should we really return no error here? */
return 0;
} else if (rfcomm->dlci[0].state !=3D CONNECTED) {
-
/* we have an l2cap channel (server ch) */
D_CTRL(FNC"we already have an l2cap channel)\n");
=20
@@ -751,7 +748,6 @@
return send_sabm(rfcomm, 0);
}
} else if (rfcomm->dlci[tmp_dlci].state !=3D DISCONNECTED) {
-
D_ERR(FNC"trying to connect a non DISCONNECTED server channel (%d)\n",se=
rver_chn);
return -MSGCODE(MSG_LAYER_RFCOMM, RFCOMM_SRVCHN_CONNECTED);
} else {
@@ -805,7 +801,9 @@
/* FIXME -- check that we haven't already received=20
disconnect 'acknowledge' */=09
interruptible_sleep_on(&rfcomm_disconnect_wq);
+#ifdef __KERNEL__
release_wq_timer(&rfcomm_timer);
+#endif
=20
/* Check that rfcomm session really disconnected */
/* FIXME -- add timer obj with status in rfcomm obj */
@@ -831,7 +829,6 @@
return 0;
}
=20=09
-
/* The lower protocol layer, L2CAP, indicates that a new connection has be=
en
established at a lower layer. RFCOMM should ask the control block wheth=
er
to accept or reject the connection and then reply to L2CAP with
@@ -849,7 +846,6 @@
=20
return;
} else {
-=20=20=20=20=20=20=20=20=20=20
if (l2ca_connect_rsp(l2cap, RES_SUCCESS, STAT_NOINFO)) {
D_ERR("rfcomm_connect_ind: l2ca_connect_rsp failed\n");
return;
@@ -913,7 +909,6 @@
} else {
D_ERR(FNC"couldn't find the correct rfcomm_con object\n");
}
-
}
=20
=20
@@ -975,8 +970,8 @@
else if (!rfcomm->initiator &&=20
((l2cap->remote_mtu-5) < DEF_RFCOMM_MTU) )
{
-=09=09=09
s32 j;
+
DSYS(FNC"Setting RFCOMM frame size to %d\n",=20
l2cap->remote_mtu-5);
=20=09=09=09
@@ -985,7 +980,7 @@
}
}
} else {
- DSYS(FNC": configuration not done yet\n");
+ DSYS(FNC"configuration not done yet\n");
}
}
=20
@@ -1024,7 +1019,6 @@
void=20
rfcomm_disconnect_cfm(l2cap_con *l2cap)
{
-
rfcomm_con *rfcomm;
=20=20=20
D_CTRL(FNC"disconnected\n");
@@ -1044,8 +1038,6 @@
l2cap->c_result);
#endif=09
rfcomm_reset_con(rfcomm->line);
-=09
-
}
=20
/* This function should be called from the L2CAP layer data should pos32 at
@@ -1064,8 +1056,7 @@
=20
RF_DATA(FNC"rfcomm_receive_data:",data,len);
=20=09
- D_REC(FNC"%d bytes, our cid is %d\n",len,=20
- l2cap->remote_cid);
+ D_REC(FNC"%d bytes, our cid is %d\n", len, l2cap->remote_cid);
short_pkt =3D (short_frame*) data;
=20
tmp_dlci =3D (((short_pkt->h.addr.server_chn & 0x1f) << 1) |
@@ -1110,7 +1101,6 @@
tmp_dlci, rfcomm);
=20
/* fixme -- check result and send neg response if not allowed */
-=09=09=09
#else
bt_connect_ind(CREATE_RFCOMM_ID(rfcomm->line, tmp_dlci));
rfcomm->dlci[tmp_dlci].state =3D CONNECTED;
@@ -1126,7 +1116,6 @@
send_ua(rfcomm, tmp_dlci);
#endif /* CONFIG_BLUETOOTH_USE_SECURITY_MANAGER */
} else {
-
D_CTRL(FNC"no server on channel %d, sending DM\n",
tmp_dlci);
=20=20=20=20=20=20=20
@@ -1177,7 +1166,6 @@
rfcomm->dlci[tmp_dlci].initiator =3D TRUE;
=20
} else if (rfcomm->dlci[tmp_dlci].state =3D=3D DISCONNECTING) {
-=09=09=20=20
if (tmp_dlci =3D=3D 0) {
/* Control channel */
#ifdef __KERNEL__
@@ -1198,9 +1186,11 @@
new_con_srv_channel =3D tmp_dlci >> 1;
new_con_line =3D rfcomm->line;
new_con_connected =3D 0; // Disconnection
+#ifdef __KERNEL__
/* Wake up if someone reads the proc file */
wake_up_interruptible(&channel_con_wq);=09=09
#endif=09
+#endif
=20
if (tmp >=3D 0) {
rfcomm->dlci[tmp].state =3D DISCONNECTING;
@@ -1208,7 +1198,6 @@
} else {
D_ERR("Could not find connected DLCI\n");
}
-=09=09=09=09
}
} else if (rfcomm->dlci[tmp_dlci].state =3D=3D DISCONNECTED) {
rfcomm->dlci[tmp_dlci].state =3D CONNECTED;
@@ -1249,9 +1238,11 @@
new_con_srv_channel =3D tmp_dlci >> 1;
new_con_line =3D rfcomm->line;
new_con_connected =3D 0; // Disconnection
+#ifdef __KERNEL__
/* Wake up if someone reads the proc file */
wake_up_interruptible(&channel_con_wq);=09=09
#endif
+#endif
=20
send_ua(rfcomm, 0);
} else {
@@ -1291,16 +1282,15 @@
D_REC(FNC"long packet length %d\n",
uih_len);
if (uih_len > (len - 5)) {
- D_WARN(FNC", Long packet length doesn't match, setting length to l2cap=
len - 5\n");
+ D_WARN(FNC"Long packet length doesn't match, setting length to l2cap l=
en - 5\n");
uih_len =3D len - 5;
}
-=09=09=09
} else {
D_REC(FNC"Short UIH pkt received\n");
uih_len =3D short_pkt->h.length.len;
uih_data_start =3D short_pkt->data;
if (uih_len > (len - 4)) {
- D_WARN(FNC", Short packet length doesn't match, setting length to l2ca=
p len - 4\n");
+ D_WARN(FNC"Short packet length doesn't match, setting length to l2cap =
len - 4\n");
uih_len =3D len - 4;
}
}
@@ -1320,7 +1310,6 @@
}
=20=09=09=09
/* feed uih data to tty if any */
-
}
=20
if (crc_check(data, SHORT_CRC_CHECK,
@@ -1340,7 +1329,7 @@
--rfcomm->dlci[tmp_dlci].remote_credits;
}
=20=09=09=09=09
- D_CTRL(FNC": Remote credits: %d\n",rfcomm->dlci[tmp_dlci].remote_credi=
ts);
+ D_CTRL(FNC"Remote credits: %d\n",rfcomm->dlci[tmp_dlci].remote_credits=
);
/* Send new credits in packet only if we totally run out of them. When=
we send
data to the other side we usually send credits needed together with=
the data
(piggy-backed) */
@@ -1349,7 +1338,6 @@
rfcomm->dlci[tmp_dlci].remote_credits +=3D newcredits;
rfcomm_send_credits(rfcomm, tmp_dlci, newcredits);
D_SND(FNC"Remote credits: %d\n",rfcomm->dlci[tmp_dlci].remote_credits=
);
-=09=09=09=09=09
}
}=09=09=09
bt_receive_top(con_id, uih_data_start, uih_len);
@@ -1921,12 +1909,13 @@
if (send_credit) {
l_pkt->h.control =3D SET_PF(UIH);
l_pkt->data[0] =3D (newcredits);
- D_SND(FNC": Remote credits: %d\n",rfcomm->dlci[dlci].remote_credits);
+ D_SND(FNC"Remote credits: %d\n", rfcomm->dlci[dlci].remote_credits);
memcpy(l_pkt->data + 1, data, len);
} else {
memcpy(l_pkt->data, data, len);
}
- l_pkt->data[len + send_credit] =3D crc_calc((u8*) l_pkt, SHORT_CRC_CHECK=
);
+ l_pkt->data[len + send_credit] =3D
+ crc_calc((u8*) l_pkt, SHORT_CRC_CHECK);
swap_long_frame(l_pkt);
} else {
short_frame *s_pkt;
@@ -1952,12 +1941,13 @@
if (send_credit) {
s_pkt->h.control =3D SET_PF(UIH);
s_pkt->data[0] =3D (newcredits);
- D_SND(FNC": Remote credits: %d\n",rfcomm->dlci[dlci].remote_credits);
+ D_SND(FNC"Remote credits: %d\n",rfcomm->dlci[dlci].remote_credits);
memcpy(s_pkt->data + 1, data, len);
} else {
memcpy(s_pkt->data, data, len);
}
- s_pkt->data[len + send_credit] =3D crc_calc((u8*) s_pkt, SHORT_CRC_CHECK=
);
+ s_pkt->data[len + send_credit] =3D
+ crc_calc((u8*) s_pkt, SHORT_CRC_CHECK);
}
=20
/* FIXME - How should we propagate result up to higher layers ?
@@ -2028,8 +2018,8 @@
=20=20=20=20=20
set_uih_hdr((short_frame*) uih_pkt, CTRL_CHAN, len +=20
sizeof(mcc_long_frame), rfcomm->initiator);
- uih_pkt->data[uih_pkt->h.length.bits.len] =3D crc_calc((u8*) uih_pkt,=20
- SHORT_CRC_CHECK);
+ uih_pkt->data[uih_pkt->h.length.bits.len] =3D
+ crc_calc((u8*) uih_pkt, SHORT_CRC_CHECK);
mcc_pkt =3D (mcc_long_frame*) uih_pkt->data;
=20
/* Always one in the TEST messages */
@@ -2062,8 +2052,8 @@
=20=20=20=20=20
set_uih_hdr((short_frame*) uih_pkt, CTRL_CHAN, len +
sizeof(mcc_short_frame), rfcomm->initiator);
- uih_pkt->data[uih_pkt->h.length.bits.len] =3D crc_calc((u8*) uih_pkt,=20
- SHORT_CRC_CHECK);
+ uih_pkt->data[uih_pkt->h.length.bits.len] =3D
+ crc_calc((u8*) uih_pkt, SHORT_CRC_CHECK);
mcc_pkt =3D (mcc_short_frame*) uih_pkt->data;
=20
/* Always one in the TEST messages */
@@ -2095,8 +2085,8 @@
=20=20=20=20=20
set_uih_hdr((void*) uih_pkt, CTRL_CHAN, len
+ sizeof(mcc_short_frame), rfcomm->initiator);
- uih_pkt->data[uih_pkt->h.length.len] =3D crc_calc((u8*) uih_pkt,=20
- SHORT_CRC_CHECK);
+ uih_pkt->data[uih_pkt->h.length.len] =3D
+ crc_calc((u8*) uih_pkt, SHORT_CRC_CHECK);
mcc_pkt =3D (mcc_short_frame*) uih_pkt->data;
=20=20=20=20=20
/* Always one in the TEST messages */
@@ -2136,8 +2126,8 @@
uih_pkt =3D (short_frame*) (tx_buf->data + sizeof(rfcomm_tx_buf));
set_uih_hdr(uih_pkt, CTRL_CHAN, sizeof(mcc_short_frame),
rfcomm->initiator);
- uih_pkt->data[sizeof(mcc_short_frame)] =3D crc_calc((u8*) uih_pkt,=20
- SHORT_CRC_CHECK);
+ uih_pkt->data[sizeof(mcc_short_frame)] =3D
+ crc_calc((u8*) uih_pkt, SHORT_CRC_CHECK);
mcc_pkt =3D (mcc_short_frame*) (uih_pkt->data);
=20=20=20
mcc_pkt->h.type.ea =3D EA;
@@ -2173,8 +2163,8 @@
uih_pkt =3D (short_frame*) (tx_buf->data + sizeof(rfcomm_tx_buf));
set_uih_hdr(uih_pkt, CTRL_CHAN, sizeof(mcc_short_frame),
rfcomm->initiator);
- uih_pkt->data[sizeof(mcc_short_frame)] =3D crc_calc((u8*) uih_pkt,=20
- SHORT_CRC_CHECK);
+ uih_pkt->data[sizeof(mcc_short_frame)] =3D
+ crc_calc((u8*) uih_pkt, SHORT_CRC_CHECK);
mcc_pkt =3D (mcc_short_frame*) (uih_pkt->data);
=20
mcc_pkt->h.type.ea =3D 1;
@@ -2575,7 +2565,6 @@
=20=09=09
for (j =3D 0; j < 62; j++){=09
if (rfcomm_con_list[i].dlci[j].state !=3D DISCONNECTED){
-=09=09=09=09
len+=3Dsprintf(buf+len, "line[%d] mtu[%d] ",
rfcomm_con_list[i].line,=20
rfcomm_con_list[i].dlci[j].mtu);
@@ -2592,6 +2581,7 @@
}
}
}
+
return len;
}
=20
@@ -2599,8 +2589,10 @@
s32 rfcomm_sprint_status(u8 *buf)
{
s32 len=3D0;
+
len+=3Dsprintf(buf+len, "\n[RFCOMM]\n\n");
len+=3Drfcomm_sprint_con(buf+len);
+
return len;
}
=20
@@ -2632,7 +2624,6 @@
data[5] =3D 0x70;
=20
return l2cap_send_data(tx_buf, rfcomm->l2cap);
-=20=20
}
=20
s32
@@ -2651,7 +2642,6 @@
} else {
return send_pn_msg(rfcomm, 0, frame_size, 0, 0, dlci, TRUE);
}
-=09
}
=20
s32
|