|
From: Mats F. <ma...@us...> - 2001-06-14 10:45:25
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
rfcomm.c 1.112 1.113=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Improved the flow control, especially the credit based
The diff of the modified file(s):
--- rfcomm.c 2001/05/29 13:14:11 1.112
+++ rfcomm.c 2001/06/14 10:45:24 1.113
@@ -98,6 +98,7 @@
#define RF_DATA(str, data, len)
#endif
=20
+#define FNC __FUNCTION__": "
=20
/****************** CONSTANT AND MACRO SECTION ***************************=
***/
=20
@@ -131,7 +132,8 @@
=20
#define RFCOMM_MAX_HDR_SIZE 5
=20
-#define NBROFCREDITS 6
+#define MAX_CREDITS 6
+#define MIN_CREDITS 3
=20
#define DEF_RFCOMM_MTU 127
=20
@@ -573,11 +575,11 @@
/* check if valid line number */
if (line >=3D BT_NBR_DATAPORTS)
{
- D_ERR("rfcomm_reset_con : invalid line!\n");
+ D_ERR(FNC"invalid line!\n");
return;
}
=20
- D_CTRL(__FUNCTION__" line %d\n", line);
+ D_CTRL(FNC"line %d\n", line);
=20
rfcomm_con_list[line].magic =3D RFCOMM_MAGIC;
rfcomm_con_list[line].line =3D line;
@@ -652,7 +654,7 @@
s32
rfcomm_set_mtu(rfcomm_con *rfcomm, u8 dlci, u32 new_mtu)
{
- DSYS("rfcomm_set_mtu %d\n", new_mtu);
+ DSYS(FNC"MTU set to:%d\n", new_mtu);
if (rfcomm->dlci[dlci].state =3D=3D DISCONNECTED) {
rfcomm->dlci[dlci].mtu =3D new_mtu;
return 0;
@@ -692,7 +694,7 @@
for (i =3D 0; i < BT_NBR_DATAPORTS; i++) {
rfcomm_con *rfcomm =3D get_rfcomm_con(i);
if (get_connected_dlci(rfcomm) !=3D -1) {
- DSYS("Now disconnecting rfcomm line %d\n", i);
+ DSYS(FNC"Now disconnecting rfcomm line %d\n", i);
rfcomm_disconnect_req(i);
}=09=09
}
@@ -709,7 +711,6 @@
s32=20
rfcomm_connect_req(u8* bd_addr, u8 server_chn, u8 line)
{
-#define FNC "rfcomm_connect_req: "
rfcomm_con *rfcomm;
u8 tmp_dlci;
=20=20=20
@@ -717,7 +718,7 @@
server_chn, line);
=20
if (!(rfcomm =3D get_rfcomm_con(line))) {
- D_ERR(FNC"ERROR: %d is an invalid line\n", line);
+ D_ERR(FNC"%d is an invalid line\n", line);
return 0;
}
=20
@@ -745,7 +746,7 @@
} else if (rfcomm->dlci[0].state !=3D CONNECTED) {
=20
/* we have an l2cap channel (server ch) */
- D_CTRL("we already have an l2cap channel)\n");
+ D_CTRL(FNC"we already have an l2cap channel)\n");
=20=09=09
if (rfcomm->dlci[0].state !=3D DISCONNECTED) {
D_ERR(FNC"DLCI:0 neither CONNECTED nor DISCONNECTED\n");
@@ -757,10 +758,10 @@
}
} else if (rfcomm->dlci[tmp_dlci].state !=3D DISCONNECTED) {
=20
- D_ERR(FNC"ERROR trying to connect a non DISCONNECTED server channel (%d)=
\n",server_chn);
+ D_ERR(FNC"trying to connect a non DISCONNECTED server channel (%d)\n",se=
rver_chn);
return 0;
} else {
- D_CTRL("We are negotiating rfcomm (pn msg)\n");
+ D_CTRL(FNC"We are negotiating rfcomm (pn msg)\n");
rfcomm->dlci[tmp_dlci].state =3D NEGOTIATING;
/* must fit i l2cap mtu */
D_CTRL(FNC"negotiate mtu : %d bytes\n",
@@ -771,7 +772,7 @@
=20
/* ? never used ? */
return line;
-#undef FNC
+
}
=20
s32
@@ -865,7 +866,6 @@
void=20
rfcomm_connect_cfm(l2cap_con *l2cap, s32 status)
{
-#define FNC "rfcomm_connect_cfm: "
s32 i =3D 0;
s32 stop =3D FALSE;
=20
@@ -909,7 +909,7 @@
} else {
D_ERR(FNC"couldn't find the correct rfcomm_con object\n");
}
-#undef FNC
+
}
=20
=20
@@ -921,7 +921,6 @@
void=20
rfcomm_config_ind(l2cap_con* l2cap)
{
-#define FNC "rfcomm_config_ind: "
=20
/*=20
FIXME
@@ -962,7 +961,7 @@
DSYS(FNC"already ready with config req\n");
=20
}=20
-#undef FNC
+
}
=20
/* The lower protocol layer, L2CAP, indicates that the configuration
@@ -971,7 +970,6 @@
void=20
rfcomm_config_cfm(l2cap_con *l2cap, s32 status)
{
-#define FNC "rfcomm_config_cfm: "
rfcomm_con *rfcomm;
rfcomm =3D (rfcomm_con *) l2cap->upper_con;
=20
@@ -1005,7 +1003,7 @@
}
}
=20=20=20=20=20=20=20=20=20
-#undef FNC
+
}
=20
/* The lower protocol layer, L2CAP, indicates that the lower layer=20
@@ -1015,7 +1013,7 @@
{
rfcomm_con *rfcomm;
=20
- D_CTRL(__FUNCTION__" remote cid %d\n", l2cap->remote_cid);
+ DSYS(FNC"remote cid %d\n", l2cap->remote_cid);
=20
rfcomm =3D ((rfcomm_con*) l2cap->upper_con);
=20
@@ -1024,7 +1022,7 @@
=20
if (!l2cap->link_up)
{
- DSYS("Baseband is down, reset this RFCOMM session\n");
+ DSYS(FNC"Baseband is down, reset this RFCOMM session\n");
#ifdef __KERNEL__
bt_unregister_rfcomm(rfcomm->line);
#endif
@@ -1035,7 +1033,7 @@
=20
/* always try to send back rsp (if link is down con is deleted) */
if (l2ca_disconnect_rsp(l2cap)) {
- D_ERR(__FUNCTION__" l2ca_disconnect_rsp failed\n");
+ D_ERR(FNC" l2ca_disconnect_rsp failed\n");
return;
}
}
@@ -1044,7 +1042,6 @@
void=20
rfcomm_disconnect_cfm(l2cap_con *l2cap)
{
-#define FNC "rfcomm_disconnect_cfm: "
=20
rfcomm_con *rfcomm;
=20=20=20
@@ -1066,7 +1063,7 @@
#endif=09
rfcomm_reset_con(rfcomm->line);
=20=09
-#undef FNC
+
}
=20
/* This function should be called from the L2CAP layer data should pos32 at
@@ -1076,7 +1073,6 @@
void=20
rfcomm_receive_data(l2cap_con *l2cap, u8 *data, u32 len)
{
-#define FNC "rfcomm_receive_data: "
rfcomm_con *rfcomm;
short_frame *short_pkt;=20
long_frame *long_pkt;
@@ -1084,7 +1080,7 @@
u32 uih_len;
u8 tmp_dlci;
=20
- RF_DATA("rfcomm_receive_data:",data,len);
+ 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);
@@ -1140,15 +1136,6 @@
/* wake up any blocking connect/waits */=20
bt_connect_cfm(CREATE_RFCOMM_ID(rfcomm->line, tmp_dlci), 0 /* status ok=
*/ );
=20
-#if 0
- /* fixme --=A0should we negotiate frame size as server ? */=09=09
- printk("rfcomm (S) trying to negotiate mtu (%d)...=
\n",
- l2cap->remote_mtu-5);
- send_pn_msg(rfcomm, 7, (l2cap->remote_mtu-5), 0, 0,
- tmp_dlci, TRUE);
- rfcon->dlci[tmp_dlci].state =3D NEGOTIATING;
-#endif
-
D_CTRL(FNC"sending back UA - other channel\n");
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
send_ua(rfcomm, tmp_dlci);
@@ -1206,7 +1193,7 @@
#ifdef __KERNEL__=09=09=09
release_wq_timer(&rfcomm_timer);
#endif
- printk("RFCOMM disconnected ctrl ch (local)\n");
+ printk(FNC"RFCOMM disconnected ctrl ch (local)\n");
rfcomm->dlci[0].state =3D DISCONNECTED;
=20=09=09=09=09
/* this will take down l2cap aswell */
@@ -1222,7 +1209,7 @@
} else if (rfcomm->dlci[tmp_dlci].state =3D=3D DISCONNECTED) {
rfcomm->dlci[tmp_dlci].state =3D CONNECTED;
} else {
- D_ERR(FNC" Something wrong receiving UA packet\n");
+ D_WARN(FNC" Something wrong receiving UA packet\n");
}=20=20=20=20
break;
=20=20=20=20=20
@@ -1278,7 +1265,7 @@
D_REC(FNC"long packet length %d\n",
uih_len);
if (uih_len > (len - 5)) {
- D_ERR(__FUNCTION__", 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=
len - 5\n");
uih_len =3D len - 5;
}
=20=09=09=09
@@ -1287,7 +1274,7 @@
uih_len =3D short_pkt->h.length.len;
uih_data_start =3D short_pkt->data;
if (uih_len > (len - 4)) {
- D_ERR(__FUNCTION__", Long packet length doesn't match, setting length =
to l2cap len - 4\n");
+ D_WARN(FNC", Short packet length doesn't match, setting length to l2ca=
p len - 4\n");
uih_len =3D len - 4;
}
}
@@ -1296,9 +1283,15 @@
D_REC(FNC" %d more credits on dlci:%d...\n",=20
*uih_data_start, tmp_dlci);
=20
- rfcomm->dlci[tmp_dlci].local_credits +=3D=20
- uih_data_start[0];
+ rfcomm->dlci[tmp_dlci].local_credits +=3D uih_data_start[0];
+#ifdef __KERNEL__
+ bt_feedstack();
+#endif
+ D_REC(FNC"Local_credits:%d\n", rfcomm->dlci[tmp_dlci].local_credits);=
=20
uih_data_start++;
+ if (short_pkt->h.length.len =3D=3D 0) {
+ break;
+ }
=20
/* feed uih data to tty if any */
=20
@@ -1318,15 +1311,14 @@
=20
if (rfcomm->credit_flow) {
rfcomm->dlci[tmp_dlci].remote_credits--;
- if (rfcomm->dlci[tmp_dlci].remote_credits <=3D 1) {
+ D_CTRL(FNC": Remote credits: %d\n",rfcomm->dlci[tmp_dlci].remote_credi=
ts);
+ if (rfcomm->dlci[tmp_dlci].remote_credits < MIN_CREDITS) {
/* FIXME -- possible race ? */
=20=09=09=09=09=09
- /* FIXME -- send credits piggybacked */
+ rfcomm_send_credits(rfcomm, tmp_dlci, MAX_CREDITS - rfcomm->dlci[tmp_=
dlci].remote_credits);
+ rfcomm->dlci[tmp_dlci].remote_credits =3D MAX_CREDITS;
+ D_SND(FNC"Remote credits: %d\n",rfcomm->dlci[tmp_dlci].remote_credits=
);
=20
- rfcomm_send_credits(rfcomm, tmp_dlci,=20
- NBROFCREDITS -1);
- rfcomm->dlci[tmp_dlci].remote_credits+=3D
- NBROFCREDITS - 1;=20
}
}=09=09=09
bt_receive_top(con_id, uih_data_start, uih_len);
@@ -1337,7 +1329,7 @@
D_REC(FNC"illegal packet\n");
break;
}
-#undef FNC
+
}
=20
=20
@@ -1348,7 +1340,6 @@
s32=20
rfcomm_send_data(u32 con_id, u8 *data, u32 count)
{
-#define FNC "rfcomm_send_data: "
u32 c;
u32 total =3D 0;
u8 line;
@@ -1373,23 +1364,21 @@
D_ERR(FNC"ERROR magic test failed\n");
return -1;
} else if(rfcomm->dlci[0].state =3D=3D FLOW_STOPPED) {
- DSYS(FNC"Flow stopped on all channels, returning zero\n");
+ D_SND(FNC"Flow stopped on all channels, returning zero\n");
/* FIXME: We need to buffer the incoming data here... */
return 0;
} else if (rfcomm->dlci[dlci].state =3D=3D FLOW_STOPPED) {
- DSYS(FNC"Flow stopped, returning zero\n");
+ D_SND(FNC"Flow stopped, returning zero\n");
/* FIXME: We need to buffer the incoming data here... */
return 0;
}
/* Check whether there are any data channels connected */
- else if (rfcomm->dlci[dlci].state =3D=3D CONNECTED)
- {
- D_SND(FNC"trying to send %d bytes\n", count);
- while (count)
+ else if (rfcomm->dlci[dlci].state =3D=3D CONNECTED) {
=20
- {=09
+ D_SND(FNC"trying to send %d bytes\n", count);
+ while (count) {=09
if (rfcomm->credit_flow &&(rfcomm->dlci[dlci].local_credits <=3D 0)) {
- DSYS(FNC"Flow stopped, no credits returning zero\n");
+ D_SND(FNC"Flow stopped, no credits returning %d\n", total);
return total;
}
=20=09=09=09
@@ -1412,7 +1401,7 @@
} else {
if (rfcomm->credit_flow) {
rfcomm->dlci[dlci].local_credits--;
- D_CTRL(FNC"%d credits left\n", rfcomm->dlci[dlci].local_credits);
+ D_SND(FNC"Local credits:%d\n", rfcomm->dlci[dlci].local_credits);
}
=20
total +=3D c;
@@ -1422,9 +1411,7 @@
}
D_SND(FNC"sent %d bytes\n", total);
return total;
- }
- else
- {
+ } else {
D_ERR(FNC"DLCI %d not connected\n", dlci);
#ifdef __KERNEL__
/* FIXME - should we return an _error_ if rfcomm isn't up=20
@@ -1435,8 +1422,22 @@
return -1;
#endif
}
-#undef FNC
+
+}
+
+s32
+rfcomm_flow_stop(u8 line, u8 dlci)
+{
+ if (rfcomm_con_list[line].credit_flow &&(rfcomm_con_list[line].dlci[dlci]=
.local_credits <=3D 0)) {
+ return TRUE;
+ } else if (rfcomm_con_list[line].dlci[dlci].state =3D=3D FLOW_STOPPED) {
+ return TRUE;
+ } else if (rfcomm_con_list[line].dlci[0].state =3D=3D FLOW_STOPPED) {
+ return TRUE;
+ } else {
+ return FALSE;
}
+}
=20
void=20
rfcomm_send_testdata(u32 count, u8 line)
@@ -1459,7 +1460,6 @@
void=20
process_mcc(u8* data, u32 len, rfcomm_con *rfcomm, s32 longpkt)
{
-#define FNC "process_mcc: "
mcc_short_frame *mcc_short_pkt;
=20=20=20=20=20
D_CTRL("process_mcc\n");
@@ -1588,7 +1588,8 @@
swap_pn_msg(pn_pkt);
D_CTRL(FNC"Received DLC parameter negotiation, PN\n");
if (longpkt) {
- /* UNPLUGGED Ericsson using 2 bytes length field */
+ /* If a long length field is used, then move the
+ payload pointer one byte ahead */
data++;
pn_pkt =3D (pn_msg*) data;
}=20=20
@@ -1607,12 +1608,14 @@
credit =3D pn_pkt->credit_flow;
nbrof_credits =3D pn_pkt->credits;=09=09=09
if (credit) {
- printk(FNC"Using credit flow control, initiating credits are %d on dlc=
i %d\n", nbrof_credits, tmp_dlci);
- rfcomm->credit_flow =3D 1;
+ D_CTRL(FNC"Using credit flow control, initiating credits are %d on dlc=
i %d\n", nbrof_credits, tmp_dlci);
+ rfcomm->credit_flow =3D TRUE;
rfcomm->dlci[tmp_dlci].local_credits =3D nbrof_credits;
- rfcomm->dlci[tmp_dlci].remote_credits =3D NBROFCREDITS;
+ D_CTRL(FNC"Local credits:%d\n", rfcomm->dlci[tmp_dlci].local_credits);=
=20
+ rfcomm->dlci[tmp_dlci].remote_credits =3D MAX_CREDITS;
+ D_CTRL(FNC"Remote credits: %d\n",rfcomm->dlci[tmp_dlci].remote_credits=
);
send_pn_msg(rfcomm, pn_pkt->prior, frame_size
- , credit ^ 1, NBROFCREDITS,=20
+ , credit ^ 1, MAX_CREDITS,=20
tmp_dlci, MCC_RSP);
} else {
send_pn_msg(rfcomm, pn_pkt->prior, frame_size
@@ -1625,9 +1628,9 @@
u8 tmp_dlci;
tmp_dlci =3D pn_pkt->dlci;
D_CTRL(FNC"received PN response with:\n");
- D_CTRL("Frame size:%d\n",pn_pkt->frame_size);
- D_CTRL("credit_flow:%d\n", pn_pkt->credit_flow);
- D_CTRL("credits:%d\n", pn_pkt->credits);
+ D_CTRL(FNC"Frame size:%d\n",pn_pkt->frame_size);
+ D_CTRL(FNC"credit_flow:%d\n", pn_pkt->credit_flow);
+ D_CTRL(FNC"credits:%d\n", pn_pkt->credits);
=20=09=09=09
rfcomm->dlci[tmp_dlci].mtu =3D pn_pkt->frame_size;
=20=09=09=09
@@ -1635,6 +1638,7 @@
printk(FNC" Credit flow control used\n");
rfcomm->credit_flow =3D TRUE;
rfcomm->dlci[tmp_dlci].local_credits =3D pn_pkt->credits;
+ D_CTRL(FNC"Local credits:%d\n", rfcomm->dlci[tmp_dlci].local_credits);=
=20
}
=20
D_CTRL(FNC"process_mcc : mtu set on dlci:%d to %d\n",=20
@@ -1659,7 +1663,7 @@
=20=20=20=20=20
break;
}
-#undef FNC
+
}
=20
=20
@@ -1833,12 +1837,13 @@
{
bt_tx_buf *tx_buf;
u32 rfcomm_frame_size;
+ u8 send_credit =3D 0;
=20=09=09
- D_CTRL("send_uih: Creating UIH packet with %d bytes data to DLCI %d\n",
+ D_CTRL(FNC"Creating UIH packet with %d bytes data to DLCI %d\n",
len, dlci);
=20
if (!rfcomm->l2cap->link_up) {
- D_ERR("[RFCOMM]send_uih : could not send data, baseband down\n");
+ D_ERR(FNC"could not send data, baseband down\n");
#ifdef __KERNEL__
return 0;
#else
@@ -1846,11 +1851,15 @@
#endif
}
=20=09
+ if (rfcomm->credit_flow &&(rfcomm->dlci[dlci].remote_credits < MAX_CREDIT=
S)) {
+ D_SND(FNC"Sending more credits to remote port\n");
+ send_credit =3D 1;
+ }
=20=09=09
if (len > SHORT_PAYLOAD_SIZE) {
long_frame *l_pkt;
=20=20=20=20=20
- rfcomm_frame_size =3D sizeof(long_frame) + len + FCS_SIZE;
+ rfcomm_frame_size =3D sizeof(long_frame) + len + FCS_SIZE + send_credit;
=20
/* Check for space in buffer, don't forget the size of the
L2CAP and HCI headers */
@@ -1862,20 +1871,29 @@
tx_buf =3D subscribe_bt_buf(sizeof(rfcomm_tx_buf)
+ rfcomm_frame_size);=20=20=20=20
if (!tx_buf) {
- D_ERR("send_uih: didn't get a valid tx_buf\n");
+ D_ERR(FNC"didn't get a valid tx_buf\n");
return -1;
}
tx_buf->cur_len =3D rfcomm_frame_size;
=20=20=20=20=20
l_pkt =3D (long_frame*) (tx_buf->data + sizeof(rfcomm_tx_buf));
set_uih_hdr((void*) l_pkt, dlci, len, rfcomm->initiator);
+ if (send_credit) {
+ l_pkt->h.control =3D SET_PF(UIH);
+ l_pkt->data[0] =3D (MAX_CREDITS -
+ rfcomm->dlci[dlci].remote_credits);
+ rfcomm->dlci[dlci].remote_credits =3D MAX_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] =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;
=20
- rfcomm_frame_size =3D sizeof(short_frame) + len + FCS_SIZE;
+ rfcomm_frame_size =3D sizeof(short_frame) + len + FCS_SIZE + send_credit;
/* Check for space in buffer, don't forget the size of the
L2CAP and HCI headers */
if (buf_write_room() < (rfcomm_frame_size
@@ -1885,7 +1903,7 @@
tx_buf =3D subscribe_bt_buf(sizeof(rfcomm_tx_buf)
+ rfcomm_frame_size);
if (!tx_buf) {
- D_ERR("send_uih: didn't get a valid tx_buf\n");
+ D_ERR(FNC"didn't get a valid tx_buf\n");
return -1;
}
tx_buf->cur_len =3D rfcomm_frame_size;
@@ -1893,8 +1911,17 @@
s_pkt =3D (short_frame*) (tx_buf->data + sizeof(rfcomm_tx_buf));
/* Always one */
set_uih_hdr((void*) s_pkt, dlci, len, rfcomm->initiator);
+ if (send_credit) {
+ s_pkt->h.control =3D SET_PF(UIH);
+ s_pkt->data[0] =3D (MAX_CREDITS -
+ rfcomm->dlci[dlci].remote_credits);
+ rfcomm->dlci[dlci].remote_credits =3D MAX_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] =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 ?
@@ -1910,7 +1937,7 @@
short_frame *uih_pkt;
u32 rfcomm_frame_size;
=20=20=20
- D_CTRL(__FUNCTION__" give %d credits to dlci %d\n", credits, dlci);
+ D_CTRL(FNC"give %d credits to dlci %d\n", credits, dlci);
=20
rfcomm_frame_size =3D (sizeof(short_frame) + 1 + FCS_SIZE);
tx_buf =3D subscribe_bt_buf(sizeof(rfcomm_tx_buf) + rfcomm_frame_size);
@@ -2312,13 +2339,13 @@
msc_msg *msc_pkt;
u32 rfcomm_frame_size;
=20=20=20
- D_CTRL(__FUNCTION__" val:%d, cr:%d, dlci:%d\n", value, cr, dlci);
+ D_CTRL(FNC"val:%d, cr:%d, dlci:%d\n", value, cr, dlci);
=20
rfcomm_frame_size =3D sizeof(msc_msg);
tx_buf =3D subscribe_bt_buf(sizeof(rfcomm_tx_buf) + rfcomm_frame_size);
=20
if (!tx_buf) {
- D_ERR("rfcomm_msc_msg : didn't get a valid tx_buf\n");
+ D_ERR(FNC"didn't get a valid tx_buf\n");
return -1;
}
=20
@@ -2370,7 +2397,7 @@
{
s32 i =3D 0;
=20
- D_CTRL("get_new_rfcomm_con: rfcomm_con -> ttyBT%d\n",i);
+ D_CTRL(FNC"rfcomm_con -> ttyBT%d\n",i);
=20
for (i =3D 0 ; i < BT_NBR_DATAPORTS ; i ++)
{
@@ -2424,17 +2451,17 @@
{
u8 fcs =3D 0xff;
=20
- RF_DATA("crc_check:", data, length);
+ RF_DATA(FNC, data, length);
while (length--) {
fcs =3D crctable[fcs ^ *data++];
}
fcs =3D crctable[fcs ^ check_sum];
- D_REC("fcs : %d\n", fcs);
+ D_REC(FNC"fcs : %d\n", fcs);
if (fcs =3D=3D (uint) 0xcf) /* CRC_VALID) */ {
- D_REC("crc_check: CRC check OK\n");
+ D_REC(FNC"CRC check OK\n");
return 0;
} else {
- D_ERR("crc_check: CRC check failed\n");
+ D_WARN(FNC"CRC check failed, data will be discarded\n");
return -1;
}
}
@@ -2454,7 +2481,7 @@
return 0xff-fcs;
}
=20
-/* Calulates a reversed CRC table for the FCS check */
+/* Calculates a reversed CRC table for the FCS check */
=20
void
create_crctable(u8 table[])
@@ -2537,7 +2564,7 @@
tx_buf =3D subscribe_bt_buf(sizeof(rfcomm_tx_buf) + rfcomm_frame_size);
=20
if (!tx_buf) {
- D_ERR("rfcomm_test_415: didn't get a valid tx_buf\n");
+ D_ERR(FNC"didn't get a valid tx_buf\n");
return -1;
}
=20
@@ -2566,7 +2593,7 @@
rfcomm_pn_msg(rfcomm_con *rfcomm, u8 dlci, u8 credits, u32 frame_size)
{
if (credits) {
- printk("rfcomm_pn_msg: using %d credits\n", credits);
+ printk(FNC"using %d credits\n", credits);
return send_pn_msg(rfcomm, 0, frame_size, 0xf, credits, dlci,
TRUE);
} else {
|