You can subscribe to this list here.
2001 |
Jan
|
Feb
(44) |
Mar
(202) |
Apr
(134) |
May
(89) |
Jun
(94) |
Jul
(58) |
Aug
(58) |
Sep
(56) |
Oct
(75) |
Nov
(26) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(24) |
Feb
(30) |
Mar
(15) |
Apr
(49) |
May
(12) |
Jun
(6) |
Jul
(11) |
Aug
(20) |
Sep
(19) |
Oct
(3) |
Nov
(13) |
Dec
(1) |
2003 |
Jan
(7) |
Feb
(4) |
Mar
(7) |
Apr
(5) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(51) |
Dec
(1) |
2004 |
Jan
(11) |
Feb
(5) |
Mar
|
Apr
(5) |
May
(2) |
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
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); |
From: Mats F. <ma...@us...> - 2001-06-14 10:46:29
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- rfcomm.h 1.37 1.38=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added function to check whether the flow is stopped or not The diff of the modified file(s): --- rfcomm.h 2001/04/25 17:44:53 1.37 +++ rfcomm.h 2001/06/14 10:46:28 1.38 @@ -220,5 +220,6 @@ s32 rfcomm_crap_msg(rfcomm_con *rfcomm); s32 rfcomm_send_credits(rfcomm_con *rfcomm, u8 dlci, u8 credits); s32 valid_dlci(u8 dlci); +s32 rfcomm_flow_stop(u8 line, u8 dlci); #endif /****************** END OF FILE rfcomm.h *********************************= ***/ |
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 { |
From: Mats F. <ma...@us...> - 2001-06-14 10:34:53
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- sdp.c 1.76 1.77=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Pass the L2CAP MTU to the SDP server The diff of the modified file(s): --- sdp.c 2001/06/13 11:52:25 1.76 +++ sdp.c 2001/06/14 10:34:53 1.77 @@ -290,8 +290,9 @@ #endif /* __KERNEL__ */ =20 typedef struct data_struct { - u32 sdp_con_id; - s32 len; + u16 l2cap_mtu; + u16 sdp_con_id; + u16 len; u8 data[0]; } data_struct; =20 @@ -836,6 +837,7 @@ { db_hdl =3D (data_struct*)database_query.query; =20 + db_hdl->l2cap_mtu =3D l2cap->remote_mtu; db_hdl->sdp_con_id =3D sdp->id; db_hdl->len =3D len; memcpy(db_hdl->data, data, len); |
From: Mats F. <ma...@us...> - 2001-06-14 10:30:44
|
The following files were modified in apps/bluetooth/sdp_server: Name Old version New version Comment ---- ----------- ----------- ------- sdp_parser.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20 sdp_parser.h 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 sdp_server.c 1.27 1.28=20=20=20=20=20=20=20=20=20=20=20=20 sdp_server.h 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: *Corrected bug when searching for multiple UUIDs in Service Search and Serv= ice Attribute Search *Now we should be able to split up responses larger than the L2CAP MTU in s= maller packets The diff of the modified file(s): --- sdp_parser.c 2001/04/17 12:43:39 1.18 +++ sdp_parser.c 2001/06/14 10:30:42 1.19 @@ -127,12 +127,12 @@ /****************** LOCAL FUNCTION DECLARATION SECTION *******************= ***/ =20 void sdp_parse_data(unsigned char* data, unsigned int len); -void process_service_search_req(int sdp_con_id, unsigned char *data, - unsigned short len, unsigned int trans_id); -void process_service_attr_req(int sdp_con_id, unsigned char *data, - unsigned short len, int trans_id); -void process_service_search_attr_req(int sdp_con_id, unsigned char *data, - unsigned short len, int trans_id); +void process_service_search_req(database_query_struct *db, unsigned char *= data, + unsigned short len); +void process_service_attr_req(database_query_struct *db, unsigned char *da= ta, + unsigned short len); +void process_service_search_attr_req(database_query_struct *db, + unsigned char *data, unsigned short len); =20 void process_service_search_rsp(int sdp_con_id, unsigned char *data); void process_service_attr_rsp(int sdp_con_id, unsigned char *data); @@ -156,25 +156,25 @@ void=20 sdp_parse_data(unsigned char* data, unsigned int len) { + database_query_struct db; unsigned char id; - unsigned short trans_id; unsigned short par_len; unsigned int pkt_len; - int sdp_con_id; data_struct *db_hdl; =20 D_REC("%d bytes",len); PRINT_DATA(__FUNCTION__, data, len); =20 db_hdl =3D (data_struct*)data; - data +=3D sizeof *db_hdl; - len -=3D sizeof *db_hdl; + data +=3D sizeof(*db_hdl); + len -=3D sizeof(*db_hdl); =20 - sdp_con_id =3D db_hdl->sdp_con_id; + db.sdp_con_id =3D db_hdl->sdp_con_id; + db.l2cap_mtu =3D db_hdl->l2cap_mtu; pkt_len =3D db_hdl->len; =20 id =3D data[SDP_HDR_TYPE]; - trans_id =3D CHAR2INT16(data[SDP_HDR_TRANS_ID_MS], data[SDP_HDR_TRANS_ID= _LS]); + db.trans_id =3D CHAR2INT16(data[SDP_HDR_TRANS_ID_MS], data[SDP_HDR_TRANS= _ID_LS]); par_len =3D CHAR2INT16(data[SDP_HDR_LENGTH_MS], data[SDP_HDR_LENGTH_LS]); data +=3D SDP_HDR_SIZE; =20 @@ -182,7 +182,7 @@ { D_XMIT("Packet length (%d) does not match received data length (%d)", len - SDP_HDR_SIZE, par_len); - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_PDU_SIZE); + send_error_rsp(&db, SDP_INVALID_PDU_SIZE); return; } =20 @@ -220,44 +220,44 @@ =20 case SDP_SERVICESEARCH_REQ: D_REC("SDP_SERVICESEARCH_REQ %d bytes", par_len); - process_service_search_req(sdp_con_id, data, par_len, trans_id); + process_service_search_req(&db, data, par_len); break; =20=20=20=20=20 case SDP_SERVICESEARCH_RSP: D_REC("SDP_SERVICESEARCH_RSP"); - process_service_search_rsp(sdp_con_id, data); + process_service_search_rsp(db.sdp_con_id, data); break; =20=20=20=20=20 case SDP_SERVICEATTR_REQ: D_REC("SDP_SERVICEATTR_REQ"); - process_service_attr_req(sdp_con_id, data, par_len, trans_id); + process_service_attr_req(&db, data, par_len); break; =20=20=20=20=20 case SDP_SERVICEATTR_RSP: D_REC("SDP_SERVICEATTR_RSP"); - process_service_attr_rsp(sdp_con_id, data); + process_service_attr_rsp(db.sdp_con_id, data); break; =20=20=20=20=20 case SDP_SERVICESEARCHATTR_REQ: D_REC("SDP_SERVICESEARCHATTR_REQ"); - process_service_search_attr_req(sdp_con_id, data, par_len, trans_id); + process_service_search_attr_req(&db, data, par_len); break; =20=20=20=20=20 case SDP_SERVICESEARCHATTR_RSP: D_REC("SDP_SERVICESEARCHATTR_RSP"); - process_service_search_attr_rsp(sdp_con_id, data); + process_service_search_attr_rsp(db.sdp_con_id, data); break; =20=20=20=20=20 default: D_REC("ERROR Invalid pdu type"); /* Send an error response with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(&db, SDP_INVALID_REQUEST_SYNTAX); break; } } =20 void -process_service_search_req(int sdp_con_id, unsigned char *data, unsigned s= hort len, unsigned int trans_id) +process_service_search_req(database_query_struct *db, unsigned char *data,= unsigned short len) { unsigned int service_search_uuid[12]; int service_search_uuid_cnt; @@ -272,7 +272,7 @@ { D_REC("Incorrect packet: Data Element Sequence expected"); /* Send an error msg with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); return; } =20 @@ -284,7 +284,7 @@ { D_REC("Incorrect packet: Incorrect length field or whole packet was no= t received"); /* Send an error msg with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); return; } =20 @@ -296,7 +296,7 @@ { D_REC("More than 12 UUID in one request"); /* Send an error msg with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); break; } =20 @@ -333,7 +333,7 @@ { D_REC("Unknown UUID size 0x%02x", data[cur_pos]); /* Send an error msg with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); return; } } @@ -349,13 +349,13 @@ { D_ERR("Packet length (%d) shorter than actual packet length (%d)", len= , cur_pos); =20 - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_PDU_SIZE); + send_error_rsp(db, SDP_INVALID_PDU_SIZE); return; } else if (len > cur_pos) { D_ERR("Packet length (%d) longer than actual packet length (%d)", len,= cur_pos); - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_PDU_SIZE); + send_error_rsp(db, SDP_INVALID_PDU_SIZE); return; } =20=20=20 @@ -364,21 +364,19 @@ cur_pos +=3D data[cur_pos]; =20=20=20=20=20 D_MISC("Sending continuationstate packet"); - send_cont_state_search_rsp(cont_state_len, data + cur_pos, max_rec_cnt, - sdp_con_id, trans_id); + send_cont_state_search_rsp(cont_state_len, data + cur_pos, max_rec_cnt= ,db); } else { service_search_struct db_hdl; =20 - db_hdl.db.sdp_con_id =3D sdp_con_id; - db_hdl.db.trans_id =3D trans_id; - db_hdl.db.pkt_type =3D SDP_SERVICESEARCH_REQ; + db->pkt_type =3D SDP_SERVICESEARCH_REQ; + memcpy(&db_hdl.db, db, sizeof(database_query_struct)); =20 db_hdl.max_rec_cnt =3D max_rec_cnt; db_hdl.service_class_cnt =3D service_search_uuid_cnt; memcpy(db_hdl.service_class_list, service_search_uuid, - service_search_uuid_cnt * sizeof *service_search_uuid); + service_search_uuid_cnt * sizeof(*service_search_uuid)); =20 /* Here we ask the database for the requested attributes */ handle_query(&db_hdl.db); @@ -386,7 +384,7 @@ } =20 void=20 -process_service_attr_req(int sdp_con_id, unsigned char *data, unsigned sho= rt len, int trans_id) +process_service_attr_req(database_query_struct *db, unsigned char *data, u= nsigned short len) { service_attr_struct *db_hdl; =20 @@ -418,7 +416,7 @@ { D_REC("Incorrect packet: Data Element Sequence expected"); /* Send an error msg with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); return; } =20 @@ -430,7 +428,7 @@ { D_REC("Incorrect packet: Incorrect length field or whole packet was no= t received"); /* Send an error msg with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); return; } =20 @@ -472,13 +470,13 @@ if (len < cur_pos) { D_ERR("Packet length (%d) shorter than actual packet length (%d)", len= , cur_pos); - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_PDU_SIZE); + send_error_rsp(db, SDP_INVALID_PDU_SIZE); return; } else if (len > cur_pos) { D_ERR("Packet length (%d) longer than actual packet length (%d)", len,= cur_pos); - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_PDU_SIZE); + send_error_rsp(db, SDP_INVALID_PDU_SIZE); return; } =20=20=20 @@ -486,7 +484,7 @@ { D_MISC("Sending continuationstate packet"); send_cont_state_attr_rsp(cont_state_len, data + cur_pos, max_attr_cnt, - sdp_con_id, trans_id); + db); } else { @@ -494,15 +492,15 @@ =20 if (!(db_hdl =3D malloc(len))) { D_ERR("malloc failed to allocate %d bytes!", len); - send_error_rsp(sdp_con_id, trans_id, SDP_INSUFFICIENT_RESOURCE= S); + send_error_rsp(db, SDP_INSUFFICIENT_RESOURCES); return; } =20 D_MEM("---> malloc%d %d bytes at 0x%08x", malloc_dbg++, len, (int)db_h= dl); =20=20=20=20=20 - db_hdl->db.sdp_con_id =3D sdp_con_id; - db_hdl->db.trans_id =3D trans_id; - db_hdl->db.pkt_type =3D SDP_SERVICEATTR_REQ; +=20=20=20=20 + db->pkt_type =3D SDP_SERVICEATTR_REQ; + memcpy(&db_hdl->db, db, sizeof(database_query_struct));=20=20=20=20 =20=20=20=20=20 db_hdl->max_attr_byte_cnt =3D max_attr_cnt; db_hdl->rec_hdl =3D rec_hdl; @@ -519,7 +517,7 @@ } =20 void=20 -process_service_search_attr_req(int sdp_con_id, unsigned char *data, unsig= ned short len,int trans_id) +process_service_search_attr_req(database_query_struct *db, unsigned char *= data, unsigned short len) { service_search_attr_struct *db_hdl; unsigned int service_search_uuid[12]; @@ -537,7 +535,7 @@ { D_REC("Incorrect packet: Data Element Sequence expected"); /* Send an error msg with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); return; } =20 @@ -549,7 +547,7 @@ { D_REC("Incorrect packet: Incorrect length field or whole packet was no= t received"); /* Send an error msg with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); return; } =20=20=20 @@ -595,7 +593,7 @@ else { D_REC("Unknown UUID size 0x%02x", data[cur_pos]); - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); return; } } @@ -609,7 +607,7 @@ { D_REC("Incorrect packet: Data Element Sequence expected"); /* Send an error msg with error code Invalid request syntax */ - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_REQUEST_SYNTAX); + send_error_rsp(db, SDP_INVALID_REQUEST_SYNTAX); return; } =20 @@ -658,13 +656,13 @@ if (len < cur_pos) { D_ERR("Packet length (%d) shorter than actual packet length (%d)", len= , cur_pos); - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_PDU_SIZE); + send_error_rsp(db, SDP_INVALID_PDU_SIZE); return; } else if (len > cur_pos) { D_ERR("Packet length (%d) longer than actual packet length 8%d)", len,= cur_pos); - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_PDU_SIZE); + send_error_rsp(db, SDP_INVALID_PDU_SIZE); return; } =20=20=20 @@ -672,7 +670,7 @@ { D_MISC("Sending continuationstate packet"); send_cont_state_attr_rsp(cont_state_len, data + cur_pos, max_attr_cnt, - sdp_con_id, trans_id); + db); } else { @@ -680,15 +678,14 @@ =20 if (!(db_hdl =3D malloc(tmp_len))) { D_ERR("malloc failed to allocate %d bytes!", tmp_len); - send_error_rsp(sdp_con_id, trans_id, SDP_INSUFFICIENT_RESOURCE= S); + send_error_rsp(db, SDP_INSUFFICIENT_RESOURCES); return; } =20 D_MEM("---> malloc%d %d bytes at 0x%08x", malloc_dbg++, tmp_len, (int)= db_hdl); =20=20=20=20=20 - db_hdl->db.sdp_con_id =3D sdp_con_id; - db_hdl->db.trans_id =3D trans_id; - db_hdl->db.pkt_type =3D SDP_SERVICESEARCHATTR_REQ; + db->pkt_type =3D SDP_SERVICESEARCHATTR_REQ; + memcpy(&db_hdl->db, db, sizeof(database_query_struct)); =20=20=20=20=20 db_hdl->max_attr_byte_cnt =3D max_attr_cnt; db_hdl->service_class_cnt =3D service_search_uuid_cnt; @@ -720,7 +717,7 @@ } =20 void -send_error_rsp(int sdp_con_id, unsigned short trans_id, unsigned short err= _code) +send_error_rsp(database_query_struct *db, unsigned short err_code) { unsigned char sdp_data[7]; unsigned short pdu_len; @@ -731,15 +728,15 @@ pdu_len =3D 2; =20=20=20 sdp_data[0] =3D SDP_ERROR_RSP; - sdp_data[1] =3D (trans_id >> 8) & 0xff; - sdp_data[2] =3D trans_id & 0xff; + sdp_data[1] =3D (db->trans_id >> 8) & 0xff; + sdp_data[2] =3D db->trans_id & 0xff; sdp_data[3] =3D (pdu_len >> 8) & 0xff; sdp_data[4] =3D pdu_len & 0xff; =20 sdp_data[5] =3D (err_code >> 8) & 0xff; sdp_data[6] =3D err_code & 0xff; =20 - write2stack(sdp_con_id, sdp_data, 7); + write2stack(db->sdp_con_id, sdp_data, 7); } =20 /* "Support" functions used by the other functions in this file */ --- sdp_parser.h 2001/03/23 16:19:36 1.5 +++ sdp_parser.h 2001/06/14 10:30:42 1.6 @@ -53,6 +53,13 @@ #define SDP_PROC_FILE "/tmp/sdp_sock" #endif =20 +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b)) =20 @@ -80,15 +87,15 @@ /****************** TYPE DEFINITION SECTION ******************************= ***/ =20 typedef struct data_struct { - unsigned int sdp_con_id; - int len; + unsigned short l2cap_mtu; + unsigned short sdp_con_id; + unsigned short len; + unsigned char data[0]; } data_struct; =20 /****************** EXPORTED FUNCTION DECLARATION SECTION ****************= ***/ =20 void write2stack(int sdp_con_id, char *data, int len); -void send_error_rsp(int sdp_con_id, unsigned short trans_id, - unsigned short err_code); =20 #endif /****************** END OF FILE sdp_parser.h *****************************= ***/ --- sdp_server.c 2001/04/17 12:43:39 1.27 +++ sdp_server.c 2001/06/14 10:30:42 1.28 @@ -124,6 +124,10 @@ void set_sdp_hdr(unsigned char *hdr, unsigned char pkt_type, unsigned short trans_id, unsigned short len); =20 +unsigned int* remove_dublicated_rec_hdl(unsigned int *rec_hdl_list_in, + unsigned int cnt_in); +unsigned int* get_all_rec_hdl(unsigned int *service_class_list, + unsigned int service_class_cnt); unsigned int get_record_handle(unsigned short service_class, int fd); =20 char* get_attribute_range(int fd, unsigned int record_handle, @@ -396,6 +400,87 @@ hdr[SDP_HDR_LENGTH_LS] =3D SHORT2CHAR_LS(len); } =20 +unsigned int* +remove_dublicated_rec_hdl(unsigned int *rec_hdl_list_in, unsigned int cnt_= in)=20=20 +{ + static unsigned int rec_hdl_list_out[128]; + unsigned int i, j, cnt_out =3D 0; + unsigned int existing =3D FALSE; +=20=20=20=20 + for (i =3D 0; i < cnt_in; i++) + { + for (j =3D 0; j < cnt_out; j++) + { + if (rec_hdl_list_in[i] =3D=3D rec_hdl_list_out[j]) + { + existing =3D TRUE; + } + } +=20=20=20=20=20=20 + if(!existing) + { + rec_hdl_list_out[cnt_out] =3D rec_hdl_list_in[i]; + D_RHDL(__FUNCTION__": Found record_handle 0x%08x", rec_hdl_list_out[cnt_o= ut]); + cnt_out++; + existing =3D FALSE; + } + } + + rec_hdl_list_out[cnt_out] =3D NO_REC_HDL; + + return rec_hdl_list_out; +} + +unsigned int* +get_all_rec_hdl(unsigned int *service_class_list, unsigned int service_cla= ss_cnt) +{ + unsigned int rec_hdl_list[64]; + unsigned int *tmp_hdl_list; + unsigned int rec_hdl_cnt =3D 0; + int i, j; +=20=20 + D_RHDL(__FUNCTION__": service_class_cnt:%d", service_class_cnt); + + for (i =3D 0; i < service_class_cnt; i++) + { + D_RHDL(__FUNCTION__": Service Class:0x%08x", service_class_list[i]); + if ((rec_hdl_list[rec_hdl_cnt] =3D get_record_handle(service_class_lis= t[i], xml_fd)) !=3D NO_REC_HDL) + { + D_REC("Got Record handle1: 0x%08x", rec_hdl_list[rec_hdl_cnt]); + rec_hdl_cnt++; + } +=20=20=20=20=20=20=20=20 + tmp_hdl_list =3D get_more_rec_hdl(service_class_list[i], xml_fd); + + if (is_err()) + { + D_MEM("<--- free%d 0x%8p", --malloc_dbg, tmp_hdl_list); + free(tmp_hdl_list); + return NULL; + } + + if (tmp_hdl_list) + { + j =3D 0; + while (tmp_hdl_list[j] !=3D NO_REC_HDL) + { + rec_hdl_list[rec_hdl_cnt] =3D tmp_hdl_list[j]; + D_REC("Got Record handle2: 0x%08x", rec_hdl_list[rec_hdl_cnt]); + rec_hdl_cnt++; + j++; + } +=20=20=20=20=20=20 + D_MEM("<--- free%d 0x%8p", --malloc_dbg, tmp_hdl_list); + free(tmp_hdl_list); + } +=20=20=20=20 + } +=20=20 + tmp_hdl_list =3D remove_dublicated_rec_hdl(rec_hdl_list, rec_hdl_cnt); +=20 + return tmp_hdl_list; +} + unsigned int get_record_handle(unsigned short service_class, int fd) { @@ -451,9 +536,9 @@ { S_FNC("Found Record Handle %s", attr[1]); s_hdl->tmp_hdl =3D strtoul(attr[1], NULL, 16); - S_FNC("Found Record Handle 0x%08x", s_hdl->tmp_hdl); + S_FNC("Found Record Handle converted to int 0x%08x", s_hdl->tmp_hdl); } - if ((s_hdl->tmp_hdl) && (strcmp(el, s_hdl->uuid) =3D=3D 0)) + if ((s_hdl->tmp_hdl !=3D NO_REC_HDL) && (strcmp(el, s_hdl->uuid) =3D=3D = 0)) { if ((s_hdl->hdl_list_len > 0) && (s_hdl->tmp_hdl =3D=3D s_hdl->hdl_list[s_hdl->hdl_list_len - 1])) @@ -473,8 +558,8 @@ if (s_hdl->hdl_list_len >=3D s_hdl->hdl_list_max) { s_hdl->hdl_list_max +=3D 16; - tmp =3D realloc(s_hdl->hdl_list, s_hdl->hdl_list_max * sizeof *s_h= dl->hdl_list); - D_MEM("---> realloc%d %ld bytes at 0x%8p", malloc_dbg++, s_hdl->hd= l_list_max * sizeof *s_hdl->hdl_list, tmp); + tmp =3D realloc(s_hdl->hdl_list, s_hdl->hdl_list_max * sizeof(*s_h= dl->hdl_list)); + D_MEM("---> realloc%d %ld bytes at 0x%8p", malloc_dbg++, s_hdl->hd= l_list_max * sizeof(*s_hdl->hdl_list), tmp); if (!tmp) { set_err(SDP_INSUFFICIENT_RESOURCES); @@ -485,7 +570,8 @@ s_hdl->hdl_list =3D tmp; } =20=20=20=20=20 - s_hdl->hdl_list[s_hdl->hdl_list_len++] =3D s_hdl->tmp_hdl; + s_hdl->hdl_list[s_hdl->hdl_list_len] =3D s_hdl->tmp_hdl; + s_hdl->hdl_list_len++; } } } @@ -525,8 +611,8 @@ =20 s_hdl.hdl_list_len =3D 0; s_hdl.hdl_list_max =3D 16; - s_hdl.hdl_list =3D malloc(s_hdl.hdl_list_max * sizeof *s_hdl.hdl_list); - D_MEM("---> malloc%d %ld bytes at 0x%8p", malloc_dbg++, s_hdl.hdl_list_m= ax * sizeof *s_hdl.hdl_list, s_hdl.hdl_list); + s_hdl.hdl_list =3D malloc(s_hdl.hdl_list_max * sizeof(*s_hdl.hdl_list)); + D_MEM("---> malloc%d %ld bytes at 0x%8p", malloc_dbg++, s_hdl.hdl_list_m= ax * sizeof(*s_hdl.hdl_list), s_hdl.hdl_list); if (!s_hdl.hdl_list) { set_err(SDP_INSUFFICIENT_RESOURCES); @@ -557,8 +643,8 @@ { s_hdl.hdl_list_max++; =20 - tmp =3D realloc(s_hdl.hdl_list, s_hdl.hdl_list_max * sizeof *s_hdl.hdl= _list); - D_MEM("---> realloc%d %ld bytes at 0x%8p", malloc_dbg++, s_hdl.hdl_lis= t_max * sizeof *s_hdl.hdl_list, tmp); + tmp =3D realloc(s_hdl.hdl_list, s_hdl.hdl_list_max * sizeof(*s_hdl.hdl= _list)); + D_MEM("---> realloc%d %ld bytes at 0x%8p", malloc_dbg++, s_hdl.hdl_lis= t_max * sizeof(*s_hdl.hdl_list), tmp); if (!tmp) { set_err(SDP_INSUFFICIENT_RESOURCES); @@ -570,7 +656,7 @@ s_hdl.hdl_list =3D tmp; } =20 - s_hdl.hdl_list[s_hdl.hdl_list_len++] =3D NO_REC_HDL; + s_hdl.hdl_list[s_hdl.hdl_list_len] =3D NO_REC_HDL; =20 return s_hdl.hdl_list; } @@ -1239,46 +1325,30 @@ /* FIXME: Add features to handle continuation states and multiple service classes */ =20 + void=20 handle_service_search_req(service_search_struct *db_hdl) { unsigned char rsp_pkt[256]; int rsp_pkt_len; - unsigned int rec_hdl, rec_hdl_cnt =3D 0; unsigned int *rec_hdl_list; + unsigned int rec_hdl_cnt =3D 0; + unsigned int max_rec_cnt; int i; -=20=20 - rec_hdl =3D get_record_handle(db_hdl->service_class_list[0], xml_fd); - - D_REC("Got Record handle: 0x%08x", rec_hdl); =20 - if (rec_hdl !=3D NO_REC_HDL) - { - rec_hdl_cnt++; - } - - rec_hdl_list =3D get_more_rec_hdl(db_hdl->service_class_list[0], xml_fd); + rec_hdl_list =3D get_all_rec_hdl(db_hdl->service_class_list, db_hdl->ser= vice_class_cnt); =20 if (is_err()) { - D_MEM("<--- free%d 0x%8p", --malloc_dbg, rec_hdl_list); - free(rec_hdl_list); - send_error_rsp(db_hdl->db.sdp_con_id, db_hdl->db.trans_id, get_err()); - return; + send_error_rsp(&db_hdl->db, get_err()); } =20=20=20 if (rec_hdl_list) { - for (i =3D 0; rec_hdl_list[i] !=3D NO_REC_HDL; i++) - { - D_REC("Got Record handle: 0x%08x", rec_hdl_list[i]); - if (rec_hdl =3D=3D rec_hdl_list[i]) + while (rec_hdl_list[rec_hdl_cnt] !=3D NO_REC_HDL) { - rec_hdl_cnt--; - rec_hdl =3D NO_REC_HDL; - } + rec_hdl_cnt++; } - rec_hdl_cnt +=3D i; } =20=20=20=20=20 rsp_pkt_len =3D SDP_HDR_SIZE;=20=20 @@ -1291,35 +1361,31 @@ rsp_pkt[rsp_pkt_len++] =3D SHORT2CHAR_MS(rec_hdl_cnt); rsp_pkt[rsp_pkt_len++] =3D SHORT2CHAR_LS(rec_hdl_cnt); =20=20=20 - if (rec_hdl !=3D NO_REC_HDL) - { - rsp_pkt[rsp_pkt_len++] =3D (rec_hdl >> 24) & 0xff; - rsp_pkt[rsp_pkt_len++] =3D (rec_hdl >> 16) & 0xff; - rsp_pkt[rsp_pkt_len++] =3D (rec_hdl >> 8) & 0xff; - rsp_pkt[rsp_pkt_len++] =3D rec_hdl & 0xff; - } - if (rec_hdl_list) { - for (i =3D 0; rec_hdl_list[i] !=3D NO_REC_HDL; i++) + for (i =3D 0; i < rec_hdl_cnt; i++) { rsp_pkt[rsp_pkt_len++] =3D (rec_hdl_list[i] >> 24) & 0xff; rsp_pkt[rsp_pkt_len++] =3D (rec_hdl_list[i] >> 16) & 0xff; rsp_pkt[rsp_pkt_len++] =3D (rec_hdl_list[i] >> 8) & 0xff; rsp_pkt[rsp_pkt_len++] =3D rec_hdl_list[i] & 0xff; } - D_MEM("<--- free%d 0x%8p", --malloc_dbg, rec_hdl_list); - free(rec_hdl_list); } =20=20=20 set_sdp_hdr(rsp_pkt, SDP_SERVICESEARCH_RSP, db_hdl->db.trans_id, rsp_pkt_len - SDP_HDR_SIZE); =20 - rsp_pkt_len =3D set_cont_state_search(rsp_pkt, rsp_pkt_len, db_hdl->max_= rec_cnt); + max_rec_cnt =3D MIN(db_hdl->max_rec_cnt, db_hdl->db.l2cap_mtu - 11); + /* 11 comes from SDP_HDR_SIZE + tot+cur-rec cnt fiel + 2 bytes for cont + state */ =20 + D_REC("l2cap_mtu:%d, mrc:%d, db->mrc:%d\n", db_hdl->db.l2cap_mtu, max_re= c_cnt, db_hdl->max_rec_cnt); +=20=20 + rsp_pkt_len =3D set_cont_state_search(rsp_pkt, rsp_pkt_len, max_rec_cnt); + if (is_err()) { - send_error_rsp(db_hdl->db.sdp_con_id, db_hdl->db.trans_id, get_err()); + send_error_rsp(&db_hdl->db, get_err()); return; } =20=20=20 @@ -1332,6 +1398,7 @@ unsigned char rsp_pkt[256]; int rsp_pkt_len, i, des_len_pos; unsigned char *tmp_ptr; + unsigned int max_attr_byte_cnt; =20=20=20=20=20 /* Skip the sdp header and the attribute byte count field */ rsp_pkt_len =3D SDP_HDR_SIZE + 2; @@ -1361,7 +1428,7 @@ } else if (is_err()) { - send_error_rsp(db_hdl->db.sdp_con_id, db_hdl->db.trans_id, get_err()= ); + send_error_rsp(&db_hdl->db, get_err()); return; } } @@ -1378,11 +1445,16 @@ set_sdp_hdr(rsp_pkt, SDP_SERVICEATTR_RSP, db_hdl->db.trans_id, rsp_pkt_len - SDP_HDR_SIZE); =20 - rsp_pkt_len =3D set_cont_state_attr(rsp_pkt, rsp_pkt_len,db_hdl->max_att= r_byte_cnt); + max_attr_byte_cnt =3D MIN(db_hdl->max_attr_byte_cnt, db_hdl->db.l2cap_mt= u - 9); + /* 9 comes from SDP_HDR_SIZE + attr byte nt field + 2 bytes for cont sta= te */ + + D_REC("l2cap_mtu:%d, mabc:%d, db->mabc:%d\n", db_hdl->db.l2cap_mtu, max_= attr_byte_cnt, db_hdl->max_attr_byte_cnt); +=20=20=20 + rsp_pkt_len =3D set_cont_state_attr(rsp_pkt, rsp_pkt_len, max_attr_byte_= cnt); =20 if (is_err()) { - send_error_rsp(db_hdl->db.sdp_con_id, db_hdl->db.trans_id, get_err()); + send_error_rsp(&db_hdl->db, get_err()); return; } =20=20=20 @@ -1393,42 +1465,31 @@ handle_service_search_attr_req(service_search_attr_struct *db_hdl) { unsigned char *tmp_ptr; - unsigned int rec_hdl; unsigned int *rec_hdl_list; unsigned int rec_hdl_cnt; unsigned char rsp_pkt[1024]; + unsigned int max_attr_byte_cnt; int rsp_pkt_len =3D 0, tmp_len, des_len_pos, i, j =3D 0; - - rec_hdl =3D get_record_handle(db_hdl->service_class_list[0], xml_fd); - - D_REC("Got Record handle: 0x%08x", rec_hdl); =20=20=20 - rec_hdl_list =3D get_more_rec_hdl(db_hdl->service_class_list[0], xml_fd); + rec_hdl_list =3D get_all_rec_hdl(db_hdl->service_class_list, db_hdl->ser= vice_class_cnt); =20=20=20 if (is_err()) { + if (rec_hdl_list) + { D_MEM("<--- free%d 0x%8p", --malloc_dbg, rec_hdl_list); free(rec_hdl_list); - send_error_rsp(db_hdl->db.sdp_con_id, db_hdl->db.trans_id, get_err()); + } + send_error_rsp(&db_hdl->db, get_err()); return; } =20=20=20 - rec_hdl_cnt =3D 0; if (rec_hdl_list) - { - for (i =3D 0; rec_hdl_list[i] !=3D NO_REC_HDL; i++) - { - if (rec_hdl_list[i] !=3D rec_hdl) { - D_REC("Got Record handle list %d: 0x%08x", i, rec_hdl_list[i]); - j++; - } - else + while (rec_hdl_list[rec_hdl_cnt] !=3D NO_REC_HDL) { - D_REC("Dupplicated record handle %d: 0x%08x", i, rec_hdl_list[i]); - } + rec_hdl_cnt++; } - rec_hdl_cnt +=3D j; } =20=20=20 /* Skip the sdp header and the attribute byte count field */ @@ -1438,14 +1499,6 @@ des_len_pos =3D rsp_pkt_len; rsp_pkt_len +=3D 2; =20 - if (!rec_hdl_cnt) { - D_MEM("<--- free%d 0x%8p", --malloc_dbg, rec_hdl_list); - free(rec_hdl_list); - - rec_hdl_cnt =3D 1; - rec_hdl_list =3D &rec_hdl; - } - for (j =3D 0; j < rec_hdl_cnt; j++) { tmp_len =3D 2; @@ -1472,12 +1525,12 @@ } else if (is_err()) { - if (rec_hdl_list !=3D &rec_hdl) + if (rec_hdl_list) { D_MEM("<--- free%d 0x%8p", --malloc_dbg, rec_hdl_list); free(rec_hdl_list); } - send_error_rsp(db_hdl->db.sdp_con_id, db_hdl->db.trans_id, get_err= ()); + send_error_rsp(&db_hdl->db, get_err()); return; } } @@ -1488,7 +1541,7 @@ rsp_pkt_len +=3D tmp_len; } } - if (rec_hdl_list !=3D &rec_hdl) + if (rec_hdl_list) { D_MEM("<--- free%d 0x%8p", --malloc_dbg, rec_hdl_list); free(rec_hdl_list); @@ -1508,11 +1561,16 @@ set_sdp_hdr(rsp_pkt, SDP_SERVICESEARCHATTR_RSP, db_hdl->db.trans_id, rsp_pkt_len - SDP_HDR_SIZE); =20=20=20 - rsp_pkt_len =3D set_cont_state_attr(rsp_pkt, rsp_pkt_len,db_hdl->max_att= r_byte_cnt); + max_attr_byte_cnt =3D MIN(db_hdl->max_attr_byte_cnt, db_hdl->db.l2cap_mt= u - 9); + /* 9 comes from SDP_HDR_SIZE + attr byte nt field + 2 bytes for cont sta= te */ =20=20=20 + D_REC("l2cap_mtu:%d, mabc:%d, db->mabc:%d\n", db_hdl->db.l2cap_mtu, max_= attr_byte_cnt, db_hdl->max_attr_byte_cnt); +=20=20 + rsp_pkt_len =3D set_cont_state_attr(rsp_pkt, rsp_pkt_len, max_attr_byte_= cnt); +=20=20 if (is_err()) { - send_error_rsp(db_hdl->db.sdp_con_id, db_hdl->db.trans_id, get_err()); + send_error_rsp(&db_hdl->db, get_err()); return; } =20=20=20 @@ -1641,13 +1699,13 @@ =20 void send_cont_state_search_rsp(int len, unsigned char *info, int max_rec_cnt, - int sdp_con_id, int trans_id) + database_query_struct *db) { unsigned char *send_buf; int send_len; =20=20=20 if (!cont_state_buf) { - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_CONTINUATION_STATE); + send_error_rsp(db, SDP_INVALID_CONTINUATION_STATE); } else if ((max_rec_cnt * 4) >=3D cont_state_buf->len) { @@ -1659,11 +1717,11 @@ D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, send_len, send_= buf); if (!send_buf) { - send_error_rsp(sdp_con_id, trans_id, SDP_INSUFFICIENT_RESOURCES); + send_error_rsp(db, SDP_INSUFFICIENT_RESOURCES); return; } =20 - set_sdp_hdr(send_buf, cont_state_buf->pdu, trans_id, send_len - SDP_HD= R_SIZE); + set_sdp_hdr(send_buf, cont_state_buf->pdu, db->trans_id, send_len - SD= P_HDR_SIZE); =20 /* Set the attribute byte count field */ send_buf[SDP_HDR_SIZE] =3D SHORT2CHAR_MS(cont_state_buf->len / 4); @@ -1678,7 +1736,7 @@ send_buf[send_len - 1] =3D 0; =20 /* Send the whole buffer */ - write2stack(sdp_con_id, send_buf, send_len); + write2stack(db->sdp_con_id, send_buf, send_len); =20 D_MEM("<--- free%d 0x%8p", --malloc_dbg, send_buf); free(send_buf); @@ -1693,19 +1751,19 @@ =20 /* FIXME: Have to implement this too... */ =20 - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_SDP_VERSION); + send_error_rsp(db, SDP_INVALID_SDP_VERSION); } } =20 void send_cont_state_attr_rsp(int len, unsigned char *info, int max_attr_cnt, - int sdp_con_id, int trans_id) + database_query_struct *db) { unsigned char *send_buf; int send_len; =20=20=20 if (!cont_state_buf) { - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_CONTINUATION_STATE); + send_error_rsp(db, SDP_INVALID_CONTINUATION_STATE); } else if (max_attr_cnt >=3D cont_state_buf->len) { @@ -1717,11 +1775,11 @@ D_MEM("---> malloc%d %d bytes at 0x%8p", malloc_dbg++, send_len, send_= buf); if (!send_buf) { - send_error_rsp(sdp_con_id, trans_id, SDP_INSUFFICIENT_RESOURCES); + send_error_rsp(db, SDP_INSUFFICIENT_RESOURCES); return; } =20 - set_sdp_hdr(send_buf, cont_state_buf->pdu, trans_id, send_len - SDP_HD= R_SIZE); + set_sdp_hdr(send_buf, cont_state_buf->pdu, db->trans_id, send_len - SD= P_HDR_SIZE); =20 /* Set the attribute byte count field */ send_buf[SDP_HDR_SIZE] =3D SHORT2CHAR_MS(cont_state_buf->len); @@ -1732,7 +1790,7 @@ send_buf[send_len - 1] =3D 0; =20 /* Send the whole buffer */ - write2stack(sdp_con_id, send_buf, send_len); + write2stack(db->sdp_con_id, send_buf, send_len); =20 D_MEM("<--- free%d 0x%8p", --malloc_dbg, send_buf); free(send_buf); @@ -1747,6 +1805,6 @@ =20 /* FIXME: Have to implement this too... */ =20 - send_error_rsp(sdp_con_id, trans_id, SDP_INVALID_SDP_VERSION); + send_error_rsp(db, SDP_INVALID_SDP_VERSION); } } --- sdp_server.h 2001/03/26 15:52:26 1.10 +++ sdp_server.h 2001/06/14 10:30:42 1.11 @@ -116,9 +116,10 @@ =20 typedef struct database_query_struct { - unsigned int sdp_con_id; - unsigned int trans_id; - unsigned int pkt_type; + unsigned short l2cap_mtu;=20 + unsigned short sdp_con_id; + unsigned short trans_id; + unsigned short pkt_type; } database_query_struct; =20 typedef struct service_search_struct @@ -160,11 +161,15 @@ void handle_query(database_query_struct *db_hdl); void init_sdp_server(int fd); void print_data(const char *message, const unsigned char *buf, int len); -void send_cont_state_attr_rsp(int len, unsigned char *info, int max_attr_c= nt, - int sdp_con_id, int trans_id); -void send_cont_state_search_rsp(int len, unsigned char *info, int max_rec_= cnt, - int sdp_con_id, int trans_id); +void +send_cont_state_search_rsp(int len, unsigned char *info, int max_rec_cnt, + database_query_struct *db); +void +send_cont_state_attr_rsp(int len, unsigned char *info, int max_attr_cnt, + database_query_struct *db); unsigned int *get_more_rec_hdl(unsigned short servive_class, int fd); +void send_error_rsp(database_query_struct *db, unsigned short err_code); + =20 #endif /****************** END OF FILE sdp_server.h *****************************= ***/ |
From: Mattias A. <mat...@us...> - 2001-06-13 13:16:05
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.180 1.181=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * removed unecessary variable * changed some debug The diff of the modified file(s): --- bluetooth.c 2001/06/13 12:10:44 1.180 +++ bluetooth.c 2001/06/13 12:45:14 1.181 @@ -595,7 +595,7 @@ /* check if we already have a connection otherwise wait... */ if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED)|| (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) { - printk("Already got connection on line %d\n", line);=20 + BT_DRIVER("Already got connection on line %d\n", line);=20 return 0; } BT_DRIVER("Waiting on line %d\n", line); @@ -1635,8 +1635,7 @@ /* Used to wait for dma to finish transmission */ void bt_wait_tx(s32 trim_delay) { - s32 cnt; - while ((cnt =3D sertty->driver.chars_in_buffer(sertty)) > 0) + while (sertty->driver.chars_in_buffer(sertty) > 0) udelay(100); udelay(trim_delay); } |
From: Mattias A. <mat...@us...> - 2001-06-13 12:41:04
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.179 1.180=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added/Modified some debug * added fail checks for bcsp init and hci init * added semaphore protection around bt_ioctl * added bt_wait_tx() which waits for serial dma to finish tx=20 (used in non blocking set baudrate commands) * use return value in bt_init_stack to signal failed init to usermode The diff of the modified file(s): --- bluetooth.c 2001/06/07 06:49:09 1.179 +++ bluetooth.c 2001/06/13 12:10:44 1.180 @@ -190,7 +190,7 @@ static void bt_receive_data(u8* data, u32 count); =20 static void bt_show_version(void); -static void bt_init_stack(void); +static s32 bt_init_stack(void); static s32 bt_ctrl_init(void); static s32 bt_connect(u8 *bd_addr, u32 con_id); static s32 bt_disconnect(u32 con_id); @@ -252,6 +252,12 @@ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) +static struct semaphore ioctl_sem =3D MUTEX; +#else +static struct semaphore ioctl_sem; +#endif /* LINUX_VERSION_CODE */ + static struct bt_ctrl_struct bt_ctrl; =20 /* some defines for easier reading */ @@ -489,8 +495,9 @@ #endif } =20 + static s32 -bt_ioctl(struct tty_struct *tty, struct file * file, +__bt_ioctl(struct tty_struct *tty, struct file * file, u32 cmd, unsigned long arg) { #define FNC "bt_ioctl: " @@ -613,7 +620,7 @@ } =20=09 case BTINITSTACK: - bt_init_stack(); + return bt_init_stack(); break; =20 case BTSHUTDOWN: @@ -623,7 +630,8 @@ case BTREADREMOTEBDADDR: BT_DRIVER(FNC"BTREADREMOTEBDADDR\n"); =20 - /* FIXME -- add parameter do get remote bd from any connected device */ + /* FIXME -- add parameter do get remote bd from any + connected device */ get_remote_bd(bd_addr); =20 { @@ -802,6 +810,7 @@ case HCICREATE_NEW_UNIT_KEY: { s32 result; + BT_DRIVER(FNC"HCICREATE_NEW_UNIT_KEY\n"); result =3D hci_create_new_unit_link_key(); put_user(result, (s32*)arg); break; @@ -851,7 +860,7 @@ /* FIXME: If we send the length of the string too, we don't have to copy all the 248 byte... */ u8 local_name[248]; - + BT_DRIVER(FNC"HCISETLOCALNAME\n"); copy_from_user(local_name, (s32*)arg, 248); hci_change_local_name(local_name); break; @@ -859,14 +868,13 @@ =20 case HCIREADSCANENABLE: BT_DRIVER("Reading scan enable\n"); - tmp =3D hci_read_scan_enable(); put_user(tmp, (s32*)arg); break; =20=09 case HCIWRITESCANENABLE: GET_USER(tmp, (s32*)arg); - BT_DRIVER("setting write scan enable : [0x%x]\n", tmp); + BT_DRIVER("Setting write scan enable : [0x%x]\n", tmp); hci_write_scan_enable(tmp); break; =20=09=09 @@ -874,7 +882,7 @@ { u32 par[2]; copy_from_user(&par, (s32*)arg, size); - BT_DRIVER("setting write page scan activity : [0x%x,0x%x]\n",=20 + BT_DRIVER("Setting write page scan activity : [0x%x,0x%x]\n",=20 par[0], par[1]); hci_write_pagescan_activity(par[0], par[1]); break; @@ -883,6 +891,7 @@ case HCIWRITECLASSOFDEVICE: { u8 class_of_device[3]; + BT_DRIVER(FNC"HCIWRITECLASSOFDEVICE\n"); copy_from_user(class_of_device, (s32*)arg, size); hci_write_class_of_device(class_of_device); break; @@ -891,6 +900,7 @@ case HCIREAD_AUTHENTICATION_ENABLE: { s32 result =3D hci_read_authentication_enable(); + BT_DRIVER(FNC"HCIREAD_AUTHENTICATION_ENABLE\n"); put_user(result, (s32*)arg); break; } @@ -899,7 +909,7 @@ { u8 enable; s32 result =3D 0; - + BT_DRIVER(FNC"HCIWRITE_AUTHENTICATION_ENABLE\n"); GET_USER(tmp, (s32*)arg); =20 enable =3D (u8)(tmp & 0xff); @@ -911,6 +921,7 @@ case HCIREAD_ENCRYPTION_MODE: { s32 result =3D hci_read_encryption_mode(); + BT_DRIVER(FNC"HCIREAD_ENCRYPTION_MODE\n"); put_user(result, (s32*)arg); break; } @@ -919,7 +930,7 @@ { u8 enable; s32 result =3D 0; -=09=09 + BT_DRIVER(FNC"HCIWRITE_ENCRYPTION_MODE\n"); GET_USER(tmp, (s32*)arg); =20 enable =3D (u8)(tmp & 0xff); @@ -932,6 +943,7 @@ case HCISET_EVENT_FILTER: { u8 param[size]; + BT_DRIVER(FNC"HCISET_EVENT_FILTER\n"); copy_from_user(param, (s32*)arg, size); =20=09=09 hci_set_event_filter(param); @@ -967,23 +979,27 @@ /* ioctls vendor specific HCI commands */ =20=09=09 case HCISETBAUDRATE: + {=09 + s32 tmp; /* Set baudrate in hardware */=20 GET_USER(tmp, (s32*)arg); BT_DRIVER(FNC"Setting baudrate in host controller to %d\n", tmp); -=09=09 - return hci_set_baudrate(tmp); + tmp =3D hci_set_baudrate(tmp); + return tmp; + } =20 case HCIWRITEBDADDR: copy_from_user(&bd_addr, (s32*)arg, size); - BT_DRIVER(FNC"setting BD_ADDR to \n"); + BT_DRIVER(FNC"Setting BD_ADDR to \n"); print_data("bd :",(u8*)bd_addr,6); hci_set_bd_addr(bd_addr); break;=20=20 =20=20=20=20=20=20 + /* | len (1) | hci header (4) | data (max 256)| */ case HCISENDRAWDATA: { u8 len; - u8 data[261]; /* | len (1) | hci header (4) | data (max 256)| */ + u8 data[261]; =20 /* first byte contains length of whole hci message */ copy_from_user(&len, (u8*)arg, 1); @@ -1053,16 +1069,14 @@ } =20 #ifdef CONFIG_BLUETOOTH_CSR - /* | ps_key (u16) | rw_mode (u16) | len (u16) | params (u16[])| */ - case BT_CSR_PSKEY: { u16 u16_size =3D CSR_PSKEY_MSGHDR_SIZE + CSR_PSKEY_MAXPARAMS; u16 msg[size]; =20=09=09 copy_from_user(msg, (u8*)arg, u16_size*sizeof(u16)); - + BT_DRIVER("BT_CSR_PSKEY [ps:%d type:%d]\n", msg[0], msg[1]); csr_pskey(msg[0], msg[1], &msg[3], msg[2]); =20=09=09 copy_to_user((s32*)arg, msg, u16_size*sizeof(u16)); @@ -1072,14 +1086,13 @@ #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP case BTINITBCSP: { - printk("BTINITBCSP\n"); + BT_DRIVER("BTINITBCSP\n"); if (bcsp_init() < 0) printk("Sync failed\n"); return 0; } #endif - -#endif +#endif /* CONFIG_BLUETOOTH_CSR */ =20 default:=09=09 return -ENOIOCTLCMD; @@ -1089,6 +1102,19 @@ #undef FNC } =20 +static s32 +bt_ioctl(struct tty_struct *tty, struct file * file, + u32 cmd, unsigned long arg) +{ + s32 tmp; + //printk(__FUNCTION__"[%s:%x] lock !\n", current->comm, cmd); + down(&ioctl_sem); + //printk(__FUNCTION__"[%s:%x] running...\n", current->comm, cmd); + tmp =3D __bt_ioctl(tty, file, cmd, arg); + up(&ioctl_sem); + return tmp; +} + static void bt_throttle(struct tty_struct * tty) { @@ -1188,9 +1214,6 @@ u32 cmd, unsigned long arg) { #define FNC "bt_tty_ioctl: " - BT_LDISC("bt_tty_ioctl cmd 0x%x\n", cmd); -=20=20 - /* FIXME - paranoia check */ =20=20=20 switch (cmd) { =20 @@ -1355,7 +1378,6 @@ #undef FNC } =20 - /************************/ /* glue layer functions */ /************************/ @@ -1610,6 +1632,15 @@ #undef FNC } =20 +/* Used to wait for dma to finish transmission */ +void bt_wait_tx(s32 trim_delay) +{ + s32 cnt; + while ((cnt =3D sertty->driver.chars_in_buffer(sertty)) > 0) + udelay(100); + udelay(trim_delay); +} + #ifdef CONFIG_BLUETOOTH_USE_INBUFFER static void bt_handle_indata(const __u8 *data, s32 count) { @@ -2332,6 +2363,12 @@ hci_data.get =3D hci_data.head;; #endif =20 +#ifdef __KERNEL__ +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0) + sema_init(&ioctl_sem, 1); +#endif /* LINUX_VERSION_CODE */ +#endif /* __KERNEL__ */ + return 0; /*success*/ } =20 @@ -2366,7 +2403,8 @@ } return old; } -void + +s32 bt_init_stack(void) { unsigned long page;=09 @@ -2400,10 +2438,20 @@ btmem_init(); =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP - if (bt_use_bcsp(-1) && !bcsp_issyncronized()) - bcsp_init(); + if (bt_use_bcsp(-1) && !bcsp_issyncronized()) {=20=20 + if (bcsp_init() < 0){ + bcsp_shutdown(); + goto init_failed_exit0; + } + } #endif - hci_init(); + + /* Always check if hci succeeded */ + if (hci_init() < 0){ + D_ERR("HCI failed to initialize\n"); + goto init_failed_exit1; + } +=09 l2cap_init(); =20 #ifdef CONFIG_BLUETOOTH_USE_TCI @@ -2428,6 +2476,19 @@ bt_clear_led_timer.expires =3D jiffies + HZ/10; add_timer(&bt_clear_led_timer); #endif + return 0; + + init_failed_exit1:=20 + printk("init_failed_exit1\n"); + hci_shutdown(); + init_failed_exit0: + printk("init_failed_exit0\n"); + btmem_shutdown(); + if (tmp_bt_buf) { + free_page((unsigned long) tmp_bt_buf); + tmp_bt_buf =3D NULL; + } + return -1; } =20 #ifdef BT_USELINEBUF @@ -2691,8 +2752,8 @@ if (line =3D=3D BT_NBR_PORTS-BT_NBR_CTRLPORTS) { NBR_CTRL_FDS++; =20=09=09 - DSYS("Now %d open fd:s for ttyBTC\n",=20 - NBR_CTRL_FDS); + BT_DRIVER("Now %d open fd:s for ttyBTC [%s]\n",=20 + NBR_CTRL_FDS, current->comm); if (NBR_CTRL_FDS > 1) return 0; /* already registered state */ } else { |
From: Mattias A. <mat...@us...> - 2001-06-13 12:39:23
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.h 1.41 1.42=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added bt_wait_tx The diff of the modified file(s): --- bluetooth.h 2001/06/06 14:59:08 1.41 +++ bluetooth.h 2001/06/13 12:13:50 1.42 @@ -78,6 +78,7 @@ void bt_shutdown(void); void bt_hangupline(s32 line); void bt_feedstack(void); +void bt_wait_tx(s32 trim_delay); =20 void bt_connect_ind(u32 con_id); void bt_disconnect_ind(u32 con_id); |
From: Mattias A. <mat...@us...> - 2001-06-13 12:38:13
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btinit.c 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added call to init_failed if init stack failed... * minor changes The diff of the modified file(s): --- btinit.c 2001/06/08 09:56:37 1.10 +++ btinit.c 2001/06/13 12:17:34 1.11 @@ -204,6 +204,7 @@ } =20 /* Sets initial HW baudrate */ + if (init_hw_speed !=3D 0) fd_setup(phys_fd, init_hw_speed, USE_FLOW_CTRL, hw_vendor() =3D=3D HW_= CSR_BCSP); else @@ -220,7 +221,8 @@ if (do_reset) reset_hw(); =20 - init_stack(bt_cfd, atoi(speedstr)); + if (init_stack(bt_cfd, atoi(speedstr)) < 0) + init_failed(bt_cfd, phys_fd, atoi(speedstr)); =20 if (do_hwinit) init_hw(bt_cfd, phys_fd, atoi(speedstr)); @@ -288,7 +290,6 @@ =20 printf("Shutting down Bluetooth stack\n"); shutdown_stack(bt_cfd); - printf("Bluetooth stack shut down\n"); =20 if (bt_cfd !=3D -1) { |
From: Mattias A. <mat...@us...> - 2001-06-13 12:38:11
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btd.c 1.19 1.20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added call to init_failed if init_stack failed... The diff of the modified file(s): --- btd.c 2001/06/08 09:55:47 1.19 +++ btd.c 2001/06/13 12:18:00 1.20 @@ -300,7 +300,8 @@ if (do_reset) reset_hw(); =20 - init_stack(bt_cfd, atoi(speedstr)); + if (init_stack(bt_cfd, atoi(speedstr)) < 0) + init_failed(bt_cfd, phys_fd, atoi(speedstr)); =20 if (do_hwinit) init_hw(bt_cfd, phys_fd, atoi(speedstr)); |
From: Mattias A. <mat...@us...> - 2001-06-13 12:38:08
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.13 1.14=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * modified debug * added wait for command status after syncing bcsp The diff of the modified file(s): --- bcsp.c 2001/06/06 16:29:23 1.13 +++ bcsp.c 2001/06/13 12:11:53 1.14 @@ -83,6 +83,7 @@ /****************** LOCAL FUNCTION DECLARATION SECTION *******************= ***/ =20 void bcsp_sync_timeout(unsigned long ptr); +extern void csr_waitcmdnum(void); =20 /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 @@ -145,9 +146,13 @@ sti(); =20 /* notify bt driver that sync failed */ - if (!bcsp_sync) + if (!bcsp_sync) { return -1; + } else { + csr_waitcmdnum(); /* Wait for command status */ } + return 0;=09 +} =20 void bcsp_shutdown(void) @@ -183,7 +188,7 @@ del_timer(&bcsp_sync_timer); #endif =20 - BCSP_SYS(__FUNCTION__ ": BCSP initialized and syncronized\n"); + DSYS("BCSP initialized and syncronized\n"); wake_up_interruptible(&bcsp_sync_wq); } =20 |
From: Mattias A. <mat...@us...> - 2001-06-13 12:38:03
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.h 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added csr_change_if() and init_failed The diff of the modified file(s): --- bt_vendor.h 2001/05/17 10:31:49 1.3 +++ bt_vendor.h 2001/06/13 12:19:15 1.4 @@ -67,7 +67,9 @@ =20 void init_hw(int bt_cfd, int phys_fd, int spd); void init_phys(int fd); +void init_failed(int bt_cfd, int phys_fd, int spd); =20 int hw_vendor(void); +void csr_change_if(int bt_cfd, int phys_fd, int spd); =20 #endif /* __BT_VENDOR_H__*/ |
From: Mattias A. <mat...@us...> - 2001-06-13 12:37:53
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_debug.h 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * minor change The diff of the modified file(s): --- bcsp_debug.h 2001/06/06 14:59:35 1.3 +++ bcsp_debug.h 2001/06/13 12:14:44 1.4 @@ -51,7 +51,7 @@ #define BCSP_SYS_DEBUG 0 =20 #ifdef BCSP_SYS_DEBUG=20 -#define BCSP_SYS(fmt...) printk("BCSP msg: " fmt) +#define BCSP_SYS(fmt...) printk("BCSP: " fmt) #else #define BCSP_SYS(fmt...) #endif |
From: Mattias A. <mat...@us...> - 2001-06-13 12:37:29
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.h 1.58 1.59=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added return val in hci_init The diff of the modified file(s): --- hci.h 2001/05/25 14:24:26 1.58 +++ hci.h 2001/06/13 12:13:20 1.59 @@ -91,7 +91,7 @@ =20 s32 hci_trig_send(void); =20 -void hci_init(void); +s32 hci_init(void); void hci_shutdown(void); void hci_clear_buffer(u32 con_hdl); void hci_receive_data(u8* data, u32 count); |
From: Mattias A. <mat...@us...> - 2001-06-13 12:34:55
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.19 1.20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * replaced hardcoded val with define (SIGUSR1) The diff of the modified file(s): --- bt_vendor.c 2001/06/13 12:23:54 1.19 +++ bt_vendor.c 2001/06/13 12:34:55 1.20 @@ -186,7 +186,7 @@ did_restart =3D 1; =20 /* Restart btd */ - kill(getpid(), 10);=20 + kill(getpid(), SIGUSR1);=20 break; =20=20=20=20=20 default: @@ -195,7 +195,7 @@ did_restart =3D 1; =20 /* Restart btd */ - kill(getpid(), 10);=20=20=20 + kill(getpid(), SIGUSR1);=20=20=20 break; } } @@ -458,7 +458,7 @@ unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20=20=20 if ((hw_vendor() =3D=3D HW_CSR_BCSP) && (csr_disable_deep_sleep(bt_cfd))) - kill(getpid(), 10); /* Restart btd (and HW) to activate changes */ + kill(getpid(), SIGUSR1); /* Restart btd (and HW) to activate change= s */ =20=20=20=20=20=20=20 D(syslog(LOG_INFO, "Setting write_scan_enable in CSR module")); =20 |
From: Mattias A. <mat...@us...> - 2001-06-13 12:26:05
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added return value in init_stack() The diff of the modified file(s): --- bt_if.c 2001/06/11 10:53:32 1.18 +++ bt_if.c 2001/06/13 12:26:05 1.19 @@ -70,19 +70,21 @@ /* Functions common for kernel and usermode stack */ /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ =20 -void init_stack(int bt_cfd, int spd) +int init_stack(int bt_cfd, int spd) { + int ret; syslog(LOG_INFO, "Init stack"); =20 #ifdef BT_USERSTACK init_userstack(); #else /* Kernel mode stack */ =20=20=20 - if (ioctl(bt_cfd, BTINITSTACK) < 0) + if((ret =3D ioctl(bt_cfd, BTINITSTACK)) < 0) { - perror(__FUNCTION__); - exit(1); + shutdown_stack(bt_cfd); + return ret; } +=20=20 #endif =20 /* fixme<3> -- read these parameters from config file ? */ @@ -91,6 +93,8 @@ #ifndef __CRIS__ set_local_hostname(bt_cfd, "AXIS"); #endif +=20=20 + return ret; } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ |
From: Mattias A. <mat...@us...> - 2001-06-13 12:25:03
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.h 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added return val in init_stack * minor change The diff of the modified file(s): --- bt_if.h 2001/06/08 09:38:39 1.12 +++ bt_if.h 2001/06/13 12:25:02 1.13 @@ -147,7 +147,8 @@ #define BTREADREMOTEBDADDR _IOR(BT_IOC_MAGIC, 0x07, unsigned char[6]) #define BTRESETPHYSICALHW _IO(BT_IOC_MAGIC, 0x08) #define BTISINITIATED _IOR(BT_IOC_MAGIC, 0x09, int) -#define BTHWVENDOR _IOR(BT_IOC_MAGIC, 0x0A, char[20]) +#define BTHWVENDOR _IOR(BT_IOC_MAGIC, 0x0a, char[20]) + #define BT_GETCACHEDLINKKEY _IOWR(BT_IOC_MAGIC, 0x0e, unsigned char[22]) /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ /* Ioctls for executing HCI commands */ @@ -279,7 +280,7 @@ * Init/shutdown and control of stack=20 */ =20 -void init_stack(int bt_cfd, int spd); +int init_stack(int bt_cfd, int spd); int bt_isinitiated(int bt_cfd); void shutdown_stack(int bt_cfd); #ifndef BT_USERSTACK |
From: Mattias A. <mat...@us...> - 2001-06-13 12:23:54
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added init_failed() which is run whenever init_stack fails. The behaviour is vendor dependent e.g for CSR we try changing IF (H4<->BCSP) * extracted some code to separate function (csr_disable_deep_sleep()) * moved change IF check from csr_init_hw to init_failed * changed some debug The diff of the modified file(s): --- bt_vendor.c 2001/06/08 15:53:18 1.18 +++ bt_vendor.c 2001/06/13 12:23:54 1.19 @@ -155,6 +155,52 @@ } } =20 + +/*=20 + * This function tries to recover stack if init failed=20 + * For now all other vendors but CSR is left to restart=20 + * btd but later on auto_probe on baudrate could be done. + */ + +void +init_failed(int bt_cfd, int phys_fd, int spd) +{ + + static int did_restart =3D 0; /* only try once */=20=20 +=20 + if (did_restart) + { + syslog(LOG_INFO, "Init failed after second try, giving up..."); + exit(1); + } + + sleep(1); + + switch (hw_vendor()) + { + case HW_CSR_H4: + case HW_CSR_BCSP: +=20=20=20=20 + /* Try changing interface BCSP<->H4 */ + csr_change_if(bt_cfd, phys_fd, spd);=20=20=20=20 + did_restart =3D 1; + + /* Restart btd */ + kill(getpid(), 10);=20 + break; +=20=20=20=20 + default: + /* Restart btd */ + syslog(LOG_INFO, "Init failed, lets try restarting btd"); + did_restart =3D 1; + + /* Restart btd */ + kill(getpid(), 10);=20=20=20 + break; + } +} + + int hw_vendor(void) { @@ -262,20 +308,34 @@ memcpy(ps_vals, &msg[CSR_PSKEY_MSGHDR_SIZE], n_pars*2); } =20 + +int csr_disable_deep_sleep(int bt_cfd) +{ + unsigned short ps_parbuf; + + /* Make sure uart deep sleep is disabled when using BCSP */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_GETREQ, &ps_parbuf, 1); +=20=20 + if (ps_parbuf !=3D 0) + { + syslog(LOG_INFO, "Disabling deep sleep timer"); + ps_parbuf =3D 0; /* disable deep sleep timer */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_SETREQ, &ps_parbuf, 1);=20=20=20=20 + return 1; + } + return 0; +} + /*=20 * Switches host interface in CSR HW (H4<->BCSP)=20 */ =20 void csr_change_if(int bt_cfd, int phys_fd, int spd) { - static int did_restart =3D 0; /* only try once */ - unsigned short ps_parbuf[10]; -=20=20 - if (did_restart) - return; =20 - shutdown_stack(bt_cfd); - sleep(1); + unsigned short ps_parbuf[10]; =20=20=20 if (hw_vendor() =3D=3D HW_CSR_H4) { @@ -298,17 +358,10 @@ =20 /* Make sure that deep sleep timer is disabled to=20 prevent problems when setting new ps keys */ - csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 - CSR_PSKEY_GETREQ, ps_parbuf, 1); =20=20=20=20=20 - if (ps_parbuf[0] !=3D 0) + if (csr_disable_deep_sleep(bt_cfd)) { - syslog(LOG_INFO, "Disabling deep sleep timer"); - ps_parbuf[0] =3D 0; /* disable deep sleep timer */ - csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 - CSR_PSKEY_SETREQ, ps_parbuf, 1); reset_hw(); - if (ioctl(bt_cfd, BTINITBCSP) < 0) { perror(__FUNCTION__); @@ -355,11 +408,18 @@ fd_setup(phys_fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP); =20 reset_hw();=20=20=20=20 + sleep(1); =20 /* Initialize stack */ init_stack(bt_cfd, spd); =20 + if (csr_disable_deep_sleep(bt_cfd)) + { + reset_hw(); + init_stack(bt_cfd, spd); /* reinitialize */ + } + /* Read params for ps key PSKEY_HOSTIO_UART_PS_BLOCK */ csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 CSR_PSKEY_GETREQ, ps_parbuf, 10); @@ -387,11 +447,6 @@ syslog(LOG_ERR, __FUNCTION__ ": Unknown PS key parameter: %d", ps_pa= rbuf[1]); } } - - did_restart =3D 1; /* Only try once */ - - /* Restart btd */ - kill(getpid(), 10); } =20 /* fixme -- remove hardcoded values */ @@ -401,55 +456,25 @@ /* Connection setup, all devices, no auto accept */ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); - unsigned char bd[6]; -=20=20 - /* Now test whether stack initialized ok - Try reading local BD address */ - - read_local_bd(bt_cfd, bd); -=20=20 - if ((bd[0] =3D=3D 0) && (bd[1] =3D=3D 0) &&=20 - (bd[2] =3D=3D 0) && (bd[3] =3D=3D 0) && - (bd[4] =3D=3D 0) && (bd[5] =3D=3D 0)) - { - syslog(LOG_INFO, "Stack failed to initialize, try changing interface"); - csr_change_if(bt_cfd, phys_fd, spd); - } - - if (hw_vendor() =3D=3D HW_CSR_BCSP) - { - unsigned short ps_parbuf; - /* Make sure uart deep sleep is disabled when using BCSP */ - csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 - CSR_PSKEY_GETREQ, &ps_parbuf, 1); =20=20=20=20=20 - if (ps_parbuf !=3D 0) - { - syslog(LOG_INFO, "Disabling deep sleep timer"); - ps_parbuf =3D 0; /* disable deep sleep timer */ - csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 - CSR_PSKEY_SETREQ, &ps_parbuf, 1); -=20=20=20=20=20=20 - /* Restart btd */ - kill(getpid(), 10); - } - } + if ((hw_vendor() =3D=3D HW_CSR_BCSP) && (csr_disable_deep_sleep(bt_cfd))) + kill(getpid(), 10); /* Restart btd (and HW) to activate changes */ =20 - D(syslog(LOG_INFO, "Setting write_scan_enable in CSR module!")); + D(syslog(LOG_INFO, "Setting write_scan_enable in CSR module")); =20 bt_write_scan_enable(bt_cfd, wrscan); =20=20=20 /* improves reliability when doing a connect */ - D(syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module!")); + D(syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module")); =20 bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 bt_set_event_filter(bt_cfd, filter); =20 - D(syslog(LOG_INFO, "Setting baudrate in CSR module!")); - sleep(1); =20=20=20 + D(syslog(LOG_INFO, "Setting baudrate in CSR module [%d baud]", spd)); + bt_set_baudrate(bt_cfd, spd); =20 /* Now set phys device speed to whatever HW was set to use */ @@ -523,7 +548,7 @@ =20 sleep(1); // wait for HW... =20 - D(syslog(LOG_INFO, "Setting baudrate in Ericsson module!")); + D(syslog(LOG_INFO, "Setting baudrate in Ericsson module")); bt_set_baudrate(bt_cfd, spd); usleep(10000); =20 @@ -547,11 +572,11 @@ unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20=20=20 sleep(1); - D(syslog(LOG_INFO, "Setting write_scan_enable in Infineon module!")); + D(syslog(LOG_INFO, "Setting write_scan_enable in Infineon module")); bt_write_scan_enable(bt_cfd, wrscan); =20 sleep(1); // wait for HW...=20 - D(syslog(LOG_INFO, "Setting baudrate in Infineon module!")); + D(syslog(LOG_INFO, "Setting baudrate in Infineon module")); bt_set_baudrate(bt_cfd, spd); =20=20=20 /* Now set phys device speed to whatever HW was set to use */ @@ -576,12 +601,12 @@ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 - D(syslog(LOG_INFO, "Setting write_scan_enable in USB module!")); + D(syslog(LOG_INFO, "Setting write_scan_enable in USB module")); =20 bt_write_scan_enable(bt_cfd, wrscan); =20=20=20 /* improves reliability when doing a connect */ - D(syslog(LOG_INFO, "Setting write_pagescan_activity in USB module!")); + D(syslog(LOG_INFO, "Setting write_pagescan_activity in USB module")); =20 bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 @@ -607,7 +632,7 @@ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 - D(syslog(LOG_INFO, "Setting write_scan_enable in generic module!")); + D(syslog(LOG_INFO, "Setting write_scan_enable in generic module")); =20=20=20 bt_write_scan_enable(bt_cfd, wrscan); bt_set_event_filter(bt_cfd, filter); |
From: Mattias A. <mat...@us...> - 2001-06-13 12:00:36
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.157 1.158=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * changed some debug * added return val in hci_init to signal failure. * added check in hci_init to see whether hci initialized ok * set cmd timeout to 2 secs instead of 3 The diff of the modified file(s): --- hci.c 2001/06/08 12:01:26 1.157 +++ hci.c 2001/06/13 12:00:35 1.158 @@ -970,7 +970,6 @@ performing the task for this command */ =20=09=09 case COMMAND_STATUS: -=09=09 D_CMD(__FUNCTION__ ": COMMAND_STATUS\n"); =20=09=09 if (buf[0]) {=09=09=09 @@ -1764,7 +1763,7 @@ return &hci_ctrl.hci_in_buf[i]; } =20 -/* Finds an free in buffer*/ +/* Finds a free inbuffer */ =20 hci_in_buffer*=20 get_free_inbuffer(void) @@ -1787,12 +1786,12 @@ return &hci_ctrl.hci_in_buf[i]; } =20 -void=20 +s32 hci_init(void) { u32 i; =20 - DSYS(__FUNCTION__ ": Initialising HCI\n"); + DSYS("Initialising HCI\n"); =20 #ifdef HCI_EMULATION DSYS("*** HCI emulator on ***\n"); @@ -1811,7 +1810,7 @@ #endif /* LINUX_VERSION_CODE */ #endif /* __KERNEL__ */ =20 - DSYS(__FUNCTION__ ": Initialising HCI inbuffers [%d]\n", HCI_IN_SIZE); + DSYS("Initialising HCI inbuffers [%d]\n", HCI_IN_SIZE); =20=09 /* Initiate the hci inbuffers */ for (i =3D 0; i < NBR_OF_HCI_INBUFFERS; i++) { @@ -1839,13 +1838,11 @@ hci_ctrl.nbr_of_connections =3D 0; =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP -=09 - /* If we use bcsp cmd_num will be set from command status event after + /* If we use bcsp cmd_num is set from command status event after syncronizing bcsp */ if (!bt_use_bcsp(-1)) { hci_ctrl.hc_buf.cmd_num =3D 1; } - #else hci_ctrl.hc_buf.cmd_num =3D 1; #endif @@ -1855,16 +1852,17 @@ send_data_task.data =3D NULL; #endif =20 - /* always... */ - DSYS(__FUNCTION__ ": Reading buffer sizes in HW module\n"); + DSYS("Reading buffer sizes in HW module\n"); hci_read_buffer_size(HCI_BLOCK); + + DSYS("Reading firmware info in HW module\n"); hci_read_firmware_rev_info();=09 =20 #ifdef HOST_FLOW_CTRL - DSYS(__FUNCTION__ ": Host flow control enabled\n"); + DSYS("Host flow control enabled\n"); hci_set_host_controller_flow_control(TRUE); #else - DSYS(__FUNCTION__ ": Host flow control not enabled\n"); + DSYS("Host flow control not enabled\n"); #endif hci_host_buffer_size(HCI_ACL_LEN,HCI_SCO_LEN,HCI_ACL_NUM,HCI_SCO_NUM); =20 @@ -1881,6 +1879,12 @@ =20 hci_force_msswitch(0); #endif + + /* Check that hci initialized properly */ + if (hci_ctrl.hc_buf.acl_num =3D=3D 0) + return -1;=09=20=20 +=09 + return 0; } =20 void=20 @@ -3743,7 +3747,6 @@ send_cmd(u8 *cmd, u8 len) { s32 tmp; -=09 tmp =3D insert_cmd(cmd, len); if (tmp < 0) { return tmp; @@ -3878,7 +3881,7 @@ init_timer(&hci_cmd_timer); hci_cmd_timer.function =3D cmd_timeout; hci_cmd_timer.data =3D 0; - hci_cmd_timer.expires =3D jiffies + 3*HZ; + hci_cmd_timer.expires =3D jiffies + 2*HZ; add_timer(&hci_cmd_timer); #endif } @@ -3955,7 +3958,6 @@ send_cmd_block(u8 *cmd, u8 len) { u32 tmp; - #ifdef __KERNEL__ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) struct wait_queue wait =3D { current, NULL}; @@ -3972,6 +3974,7 @@ hci_cmd_pending =3D 1; =20=20=20 start_cmd_timer(); +=09 tmp =3D send_cmd(cmd, len); =20=20=20 #ifdef __KERNEL__ |
From: Mattias A. <mat...@us...> - 2001-06-13 11:55:17
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.44 1.45=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added csr_waitcmdnum. After syncronizing BCSP it waits until a command=20 status with cmd_num is received. * Hide some printouts regarding ps key settings in debug macros The diff of the modified file(s): --- hci_vendor.c 2001/06/08 12:39:42 1.44 +++ hci_vendor.c 2001/06/13 11:55:16 1.45 @@ -563,8 +563,10 @@ break; =20=09=09=09=09 case CSR_CMD_PS: - printk(__FUNCTION__": ps key[0x%x] ", ps->ps_key); - print_data("", (u8*)ps->ps_val, ps->ps_len*sizeof(u16)); + D_CMD(__FUNCTION__": ps key[0x%x]\n",=20 + ps->ps_key); + PRINTPKT("", (u8*)ps->ps_val,=20 + ps->ps_len*sizeof(u16)); =20=09=09=09=09 /* Now copy this data to return buf */ memcpy(ps_retbuf, ps->ps_val,=20 @@ -680,6 +682,23 @@ } #endif =20 +/* When using BCSP this function is used to wait for the + COMMAND_STATUS which contains cmd_num */ + +void csr_waitcmdnum(void) +{ + D_CMD(__FUNCTION__"\n"); + hci_ctrl.hc_buf.cmd_num =3D 0; + /* wait for command status */ + while (hci_ctrl.hc_buf.cmd_num =3D=3D 0) + { + current->timeout =3D HZ/100; + current->state =3D TASK_INTERRUPTIBLE; + schedule(); + current->timeout =3D 0; + } +} + s32=20 csr_pskey(u16 ps_key, u16 rw_mode, u16 *retb, u16 n_pars) { @@ -688,8 +707,8 @@ csr_bccmd *cmd; csr_bccmd_ps *ps; =20 - printk(__FUNCTION__" : ps_key 0x%x [%d]\n", ps_key, rw_mode);=09 - print_data("pars : ", (u8*)retb, n_pars*sizeof(u16)); + D_CMD(__FUNCTION__" : ps_key 0x%x [%d]\n", ps_key, rw_mode);=09 + PRINTPKT("pars : ", (u8*)retb, n_pars*sizeof(u16)); =20 /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; @@ -836,7 +855,7 @@ csr_msg *msg; csr_bccmd *cmd; =20 - D_CMD(__FUNCTION__ VENDOR "\n"); + D_CMD(__FUNCTION__ VENDOR " BuildID/ChipVer/ChipRev\n"); =20=09 /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; @@ -955,8 +974,11 @@ interruptible_sleep_on(&set_baudrate_wq); } =20 - tmp =3D bt_write_lower_driver((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI= _HDR_LEN); + tmp =3D bt_write_lower_driver((u8*) &c_pkt,=20 + c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); =20 + bt_wait_tx(2000); /* wait until DMA empty + 2 ms */ + hci_ctrl.hc_buf.cmd_num--; =20 return tmp; @@ -1004,8 +1026,10 @@ break; =20 case CSR_CMD_PS: - printk(__FUNCTION__": ps key[0x%x] ", ps->ps_key); - print_data("", (u8*)ps->ps_val, ps->ps_len*sizeof(u16)); + D_CMD(__FUNCTION__": ps key[0x%x]\n",=20 + ps->ps_key); + PRINTPKT("", (u8*)ps->ps_val,=20 + ps->ps_len*sizeof(u16)); =20=09=09=09=09 /* Now copy this data to return buf */ =20=09=09=09=09 @@ -1104,8 +1128,6 @@ break; =20 case CSR_CMD_PS: - if (cmd->len > 2*5) - printk("ps: key 0x%x, len %d\n", ps->ps_key, ps->ps_len); break; =20 default: |
From: Mattias A. <mat...@us...> - 2001-06-13 11:52:26
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- sdp.c 1.75 1.76=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: minor debug change The diff of the modified file(s): --- sdp.c 2001/05/02 15:38:54 1.75 +++ sdp.c 2001/06/13 11:52:25 1.76 @@ -387,13 +387,13 @@ } =20 if (srv) { - DSYS(__FUNCTION__ ", Init sdp as server\n"); + DSYS("Init SDP as server\n"); role =3D 1; #ifndef __KERNEL__ sdp_sock =3D open_socket(SDP_SRV_SOCK); #endif } else { - DSYS(__FUNCTION__ ", Init sdp as client\n"); + DSYS("Init SDP as client\n"); role =3D 0; } } |
From: Mats F. <ma...@us...> - 2001-06-12 08:58:47
|
The following file was modified in apps/bluetooth/userstack: Name Old version New version Comment ---- ----------- ----------- ------- unplug_test.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed test The diff of the modified file(s): --- unplug_test.c 2001/06/11 06:55:22 1.16 +++ unplug_test.c 2001/06/12 08:58:45 1.17 @@ -72,14 +72,10 @@ s32 test_role; =20 =20 -unsigned char sdp_data_52111[] =3D {0x06, 0x00, 0x08, 0x00, 0x0d, - 0x35, 0x03, 0x19, 0x11, 0x02, 0x00, 0x64, - 0x35, 0x03, 0x09, 0x00, 0x04, 0x00}; -#if 0 unsigned char sdp_data_52111[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, 0x35, 0x03, 0x19, 0x00, 0x01, 0x00, 0xff, 0x00}; -#endif + unsigned char sdp_data_52113_1[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, 0x35, 0x03, 0x19, 0x00, 0x01, 0x00, 0x01, 0x00}; |
From: Mattias A. <mat...@us...> - 2001-06-11 10:53:34
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added debug The diff of the modified file(s): --- bt_if.c 2001/06/08 09:55:47 1.17 +++ bt_if.c 2001/06/11 10:53:32 1.18 @@ -686,6 +686,10 @@ { /* improves reliability when doing a connect */ =20 + syslog(LOG_INFO, "Setting write_pagescan_activity: int:0x%x wind:0x%x",= =20 + interval, wind); + + #ifdef BT_USERSTACK hci_write_pagescan_activity(interval, wind); #else |
From: Mats F. <ma...@us...> - 2001-06-11 06:55:24
|
The following file was modified in apps/bluetooth/userstack: Name Old version New version Comment ---- ----------- ----------- ------- unplug_test.c 1.15 1.16=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected spelling The diff of the modified file(s): --- unplug_test.c 2001/06/08 14:01:27 1.15 +++ unplug_test.c 2001/06/11 06:55:22 1.16 @@ -859,7 +859,7 @@ =20 void spp_test_53511(void) { - /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have= to verify so both sides have sent a MSC command with flow on */ =20 /* Send data from the BAp with the rf_send command */ @@ -869,7 +869,7 @@ =20 void spp_test_53611(void) { - /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have= to verify so both sides have sent a MSC command with flow on */ =20=20=20 /* Then send data from the BAP with the rf_send command */ @@ -877,7 +877,7 @@ =20 void spp_test_53711(void) { - /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have= to verify so both sides have sent a MSC command with flow on */ =20 unsigned char data[] =3D {0,1,2,3,4,5,6,7,9}; @@ -888,7 +888,7 @@ =20 void spp_test_53811(void) { - /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have= to verify so both sides have sent a MSC command with flow on */ =20 static int t =3D 0; @@ -909,7 +909,7 @@ =20 void spp_test_53911(void) { - /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have= to verify so both sides have sent a MSC command with flow on */ =20 rfcomm_rls_msg(&rfcomm_con_list[0], MCC_CMD, 2, 0x05); @@ -917,7 +917,7 @@ =20 void spp_test_531011(void) { - /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have= to verify so both sides have sent a MSC command with flow on */ =20 static int t =3D 0; @@ -935,7 +935,7 @@ =20 void spp_test_531111(void) { - /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have= to verify so both sides have sent a MSC command with flow on */ =20 rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 0); @@ -943,7 +943,7 @@ =20 void spp_test_531112(void) { - /* Do test 52211 befor to establish RFCOMM, DLCI 1 and 2. You also have = to + /* Do test 52211 before to establish RFCOMM, DLCI 1 and 2. You also have= to verify so both sides have sent a MSC command with flow on */ =20 rfcomm_rpn_msg(&rfcomm_con_list[0], MCC_CMD, 4, 1); @@ -951,7 +951,7 @@ =20 void spp_test_55111(void) { - /* Establish a L2CAP chennle on PSM 1 (SDP) before doing this test */ + /* Establish a L2CAP channel on PSM 1 (SDP) before doing this test */ =20 unsigned char sdp_query[] =3D {0x02, 0x77, 0x77, 0x00, 0x08, 0x35, 0x03, 0x19, 0x00, 0x03, 0x00, 0xff, 0x00}; @@ -961,7 +961,7 @@ =20 void spp_test_55112(void) { - /* Establish a L2CAP chennle on PSM 1 (SDP) before doing this test */ + /* Establish a L2CAP channel on PSM 1 (SDP) before doing this test */ =20 unsigned char sdp_query[] =3D {0x04, 0x88, 0x88, 0x00, 0x12, 0x01, 0x00, 0xff, 0xff, 0x00, 0xff, 0x35, 0x09, @@ -974,7 +974,7 @@ =20 void spp_test_55113(void) { - /* Establish a L2CAP chennle on PSM 1 (SDP) before doing this test */ + /* Establish a L2CAP channel on PSM 1 (SDP) before doing this test */ =20 unsigned char sdp_query[] =3D {0x06, 0x88, 0x88, 0x00, 0x13, 0x35, 0x03, 0x19, 0x12, 0x34, 0x00, 0xff, 0x35, |
From: Peter K. <pk...@us...> - 2001-06-08 15:53:48
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected a log message. The diff of the modified file(s): --- bt_vendor.c 2001/06/08 09:55:47 1.17 +++ bt_vendor.c 2001/06/08 15:53:18 1.18 @@ -279,7 +279,7 @@ =20=20=20 if (hw_vendor() =3D=3D HW_CSR_H4) { - syslog(LOG_INFO, "Changing CSR host IF: BCSP -> H4"); + syslog(LOG_INFO, "Changing CSR host IF: H4 -> BCSP"); =20=20=20=20=20 /* Temporarily set stack to use BCSP framing */ csr_bcspmode(bt_cfd, 1); |