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: Anders J. <and...@us...> - 2001-10-10 14:58:19
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.202 1.203=20=20=20=20=20=20=20=20=20=20=20 l2cap.c 1.120 1.121=20=20=20=20=20=20=20=20=20=20=20 rfcomm.c 1.122 1.123=20=20=20=20=20=20=20=20=20=20=20 test.c 1.28 1.29=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added usable errorvalues instead of just returning -1. * GET_RFCOMMLINE and GET_SDPLINE -> GET_LINE, code cleanup. The diff of the modified file(s): --- bluetooth.c 2001/10/05 12:25:46 1.202 +++ bluetooth.c 2001/10/10 14:58:18 1.203 @@ -1562,7 +1562,7 @@ struct tty_struct *upper_tty; u32 line; =20 - line =3D GET_RFCOMMLINE(con_id); + line =3D GET_LINE(con_id); =20=09 /* get upper tty and call its ldisc->receive_buf */ =20 @@ -1840,7 +1840,16 @@ s32 bt_connect(u8 *bd_addr, u32 con_id) { - u8 line;=09=09=09=09 + u8 line =3D GET_LINE(con_id);=09=09=09=09 + s32 retval =3D 0; + + /* Check if we already got a connection on the line */ + if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED)|| + (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) { + D_WARN(__FUNCTION__ ": Already got connection on line %d\n",=20 + line);=20 + return -MSGCODE(MSG_BT_INTERFACE, BT_LINE_BUSY); + } =20 switch (GET_PSM(con_id)) { case RFCOMM_LAYER: @@ -1849,16 +1858,7 @@ =20 CHECK_RFCOMM(con_id); srv_ch =3D GET_RFCOMMSRVCH(con_id); - line =3D GET_RFCOMMLINE(con_id); =20=09=09 - /* check if we already have a connection otherwise wait... */ - if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED)|| - (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) { - D_WARN(__FUNCTION__ ": Already got connection on line %d\n",=20 - GET_RFCOMMLINE(con_id));=20 - return -1; - }=20 - bt_ctrl.session[line].connect_status =3D -1; =20 BT_DRIVER(__FUNCTION__ ": Connecting srv ch %d on line %d\n", @@ -1885,19 +1885,6 @@ int sdp_connection_id =3D -1; int return_value; =20 - /* Get the line to use for SDP communication */ - - line =3D GET_SDPLINE(con_id); - - /* Check the line to assure no other connections on it */ - - if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) || - (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) { - D_WARN(__FUNCTION__ ": Already got connection on line %d\n", - GET_SDPLINE(con_id));=20 - return -1; - } - /* Initiate the connection */ =20 BT_DRIVER(__FUNCTION__ ": Connecting SDP on line %d\n", line); @@ -1960,24 +1947,14 @@ case L2CAP_TEST_LAYER: case L2CAP_TEST2_LAYER: case L2CAP_TEST3_LAYER: - line =3D (con_id & 0x0000ffff); BT_DRIVER(__FUNCTION__ ": Connecting TEST_LAYER (psm %02X) on line %d\n"= , GET_PSM(con_id), line); - - /* Check the line to assure no other connections on it */ - - if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) || - (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) { - D_WARN(__FUNCTION__ ": Already got connection on line %d\n", - line);=20 - return -1; - } =20 - if(test_connect_psmreq(bd_addr, GET_PSM(con_id)) < 0) { + if((retval =3D test_connect_psmreq(bd_addr, GET_PSM(con_id))) < 0) { BT_DRIVER(__FUNCTION__ ": Failed\n"); - return bt_ctrl.session[line].connect_status; + return retval; } =20=20=20=20=20 - return bt_ctrl.session[line].connect_status; + return retval; =20 case TCS_LAYER: return tcs_connect_req(bd_addr); @@ -1992,7 +1969,7 @@ =20 static s32 bt_execute_sdp_request(bt_sdp_request *sdpRequest) { - int line =3D GET_SDPLINE(sdpRequest->conID); + int line =3D GET_LINE(sdpRequest->conID); int sdpIndex =3D GET_SDPINDEX(sdpRequest->conID); =20 if (SESSIONSTATE(line) !=3D BT_ACTIVE) { @@ -2050,25 +2027,21 @@ bt_connect_cfm(u32 con_id, s32 status) { u16 psm; - s32 line; -=09 + s32 line =3D GET_LINE(con_id); psm =3D GET_PSM(con_id); =20 - switch (psm) { - case RFCOMM_LAYER: - line =3D GET_RFCOMMLINE(con_id); - CHECK_RFCOMM(con_id); - if ((line < 0) || (line > BT_NBR_DATAPORTS)) { -=09=09=20=20 D_ERR(__FUNCTION__ ": Invalid line (%d)\n", line); return; } =20 + switch (psm) { + case RFCOMM_LAYER: + CHECK_RFCOMM(con_id); bt_ctrl.session[line].connect_status =3D status; =20 BT_DRIVER(__FUNCTION__ ": Line %d [%s]\n", - GET_RFCOMMLINE(con_id), psmname(psm)); + line, psmname(psm)); =20 release_wq_timer(&bt_timer); wake_up_interruptible(&bt_ctrl.connect_wq[line]); @@ -2076,18 +2049,9 @@ break; =20=09 case SDP_LAYER: - line =3D GET_SDPLINE(con_id); - - /* Check incoming line for validity */ - if ((line < 0) || (line > BT_NBR_DATAPORTS)) { - D_ERR(__FUNCTION__ ": Invalid line (%d)\n", line); - return; - } - /* Record the connection status for bt_connect() to process. */ - bt_ctrl.session[line].connect_status =3D status; - BT_DRIVER(__FUNCTION__ ": Line %d [%s]\n", GET_SDPLINE(con_id), psmname(= psm)); + BT_DRIVER(__FUNCTION__ ": Line %d [%s]\n", line, psmname(psm)); BT_DRIVER(__FUNCTION__ ": Wake up line %d\n", line); release_wq_timer(&bt_timer); wake_up_interruptible(&bt_ctrl.connect_wq[line]); @@ -2135,12 +2099,19 @@ static s32=20 bt_disconnect(u32 con_id) { - int line; + int line =3D GET_LINE(con_id); + s32 retval =3D 0; =20 + if ((SESSIONSTATE(line) !=3D BT_LOWERCONNECTED) &&=20 + (SESSIONSTATE(line) !=3D BT_ACTIVE)) { + D_ERR(__FUNCTION__ ": Line not connected\n"); + return -MSGCODE(MSG_BT_INTERFACE, BT_NOTCONNECTED); + } +=09 + switch(GET_PSM(con_id)) { case RFCOMM_LAYER: - line =3D GET_RFCOMMLINE(con_id); BT_DRIVER(__FUNCTION__ ": Disconnecting line %d (ONLY RFCOMM)\n",=20 line); =20 @@ -2148,45 +2119,39 @@ =20 bt_ctrl.session[line].disconnect_status =3D -1; =20 - /* check if we have a connection */ - if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) ||=20 - (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) { - if (rfcomm_disconnect_req(line) < 0) { + if ((retval =3D rfcomm_disconnect_req(line)) < 0) { BT_DRIVER(__FUNCTION__ ": Failed\n"); - return bt_ctrl.session[line].disconnect_status; + return retval; } =20 /* fixme -- remove timers, useless when rfcomm blocks ? */ =20 /* Sleep if not yet disconnected */ if (bt_ctrl.session[line].disconnect_status =3D=3D -1) { - /* use connect wq for dusconnect aswell */ start_wq_timer(&bt_timer, BT_CON_TIMEOUT,=20 &bt_ctrl.connect_wq[line]); interruptible_sleep_on(&bt_ctrl.connect_wq[line]); } - } else { - bt_ctrl.session[line].disconnect_status =3D - MSGCODE(MSG_BT_INTERFACE, BT_NOTCONNECTED); - } +=09=09 return bt_ctrl.session[line].disconnect_status; =20=09=20=20 case L2CAP_TEST_LAYER: - test_disconnect_req(testcon); /* extern l2cap_con set in test.c */ + retval =3D test_disconnect_req(testcon); /* extern l2cap_con set in test= .c */ return bt_ctrl.session[line].disconnect_status; =20 case L2CAP_TEST2_LAYER: - test_disconnect_req(testcon2); + retval =3D test_disconnect_req(testcon2); return bt_ctrl.session[line].disconnect_status; =20 case L2CAP_TEST3_LAYER: - test_disconnect_req(testcon3); + retval =3D test_disconnect_req(testcon3); return bt_ctrl.session[line].disconnect_status; =20 default: BT_DRIVER(__FUNCTION__ ": Can't disconnect this layer (PSM %x)\n", GET_P= SM(con_id)); return -EINVAL; } + return retval; } =20 /* This function is currently not used in OpenBT for any useful stuff, @@ -2204,7 +2169,7 @@ void bt_disconnect_cfm(u32 con_id, s32 status)=20 { - u32 line =3D GET_RFCOMMLINE(con_id); + u32 line =3D GET_LINE(con_id); =20 BT_DRIVER(__FUNCTION__ ": PSM %d, status %d\n",=20 GET_PSM(con_id), status); --- l2cap.c 2001/10/03 12:12:35 1.120 +++ l2cap.c 2001/10/10 14:58:18 1.121 @@ -1385,6 +1385,7 @@ } =20 con->c_status =3D status; + con->c_result =3D status; =20=09 if (status =3D=3D 0) { /* pos cfm */ @@ -1536,7 +1537,7 @@ { l2cap_con *con; l2cap_con *tmpcon; - s32 i; + s32 i, retval =3D 0; u8 rev_bd[6]; =20 D_RCV(__FUNCTION__ "\n"); @@ -1601,24 +1602,22 @@ con->link_up =3D 1; ENTERSTATE(con, W4_L2CAP_CONNECT_RSP); PRINTSTATE(con); - - l2cap_connect_req(con, psm); - - l2ca_wait(__FUNCTION__ ": wait rsp", con); - - /* fixme -- use con->c_status */ - return 0; } else { D_STATE(__FUNCTION__ ": create new baseband link\n"); - lp_connect_req(con->remote_bd);=20=20 + retval =3D lp_connect_req(con->remote_bd); + if(retval < 0) { + D_ERR(__FUNCTION__ ": failed (status %d)\n", retval); + return retval; + } =20 /* wait here until we received a lp_connect_cfm */ l2ca_wait(__FUNCTION__ ": wait baseband", con); =20=09=09 if (con->c_status !=3D RES_SUCCESS) { - D_ERR(__FUNCTION__ ": failed !\n"); + D_ERR(__FUNCTION__ ": lp_connect_req failed, no connection (status %d)\= n", con->c_status); + retval =3D -MSGCODE(MSG_LAYER_HCI, con->c_status); delete_con(con); - return -1; + return retval; } }=09 =20 @@ -1628,13 +1627,18 @@ /* Leave loop when either status failed or success */ while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT) { /* baseband is up, now initiate send connect req */ - l2cap_connect_req(con, con->psm); - + retval =3D l2cap_connect_req(con, con->psm); + if(retval < 0) { + D_ERR(__FUNCTION__ ": failed (status %d)\n", retval); + } /* wait until we received a response or after timeout */ l2ca_wait(__FUNCTION__ ": wait rsp", con); } =20 - return con->c_result; + if (con->c_status =3D=3D CSTATUS_MAX_NO_RTX && !retval) { + retval =3D -MSGCODE(MSG_LAYER_L2CAP, L2CAP_RTX_TIMEOUT); + } + return retval; } =20 /* params determines how we would like to receive data */ @@ -1662,7 +1666,7 @@ =20 } else if (con->current_state =3D=3D CLOSED) { l2ca_config_cfm(con, CONF_REJ); - return -1; + return -MSGCODE(MSG_LAYER_L2CAP, L2CAP_NO_CONNECTION); } else if (con->current_state =3D=3D OPEN) { DSYS("l2ca_config_req: state OPEN, reconfiguration !\n"); =20 @@ -1683,14 +1687,14 @@ } else { D_ERR(__FUNCTION__ ": invalid state\n"); PRINTSTATE(con); - return -1; + return -MSGCODE(MSG_LAYER_L2CAP, L2CAP_INVALID_STATE); } } =20 s32=20 l2ca_disconnect_req(l2cap_con *con) { - s32 result =3D -1; + s32 retval =3D 0; u16 tmp_hdl =3D con->hci_hdl; =20 if (PARANOIA_CHECKCON(con)) { @@ -1704,7 +1708,14 @@ ENTERSTATE(con, W4_L2CAP_DISCONNECT_RSP); PRINTSTATE(con); do { - result =3D l2cap_disconnect_req(con); + retval =3D l2cap_disconnect_req(con); + if(retval < 0) { + /* This will result in a timeout and we need to try again + as the error is a result of insufficent space in our + memorypool and we try again after a timeout */ + D_ERR(__FUNCTION__ ": Failed (status %d)\n", retval); + } +=09=09=09 l2ca_wait(__FUNCTION__, con); PRINTSTATE(con); =20=09=09=09 @@ -1712,18 +1723,18 @@ } else { D_ERR(__FUNCTION__ ": Invalid state!\n"); PRINTSTATE(con); - return -1;=20=20=20=20 + return -MSGCODE(MSG_LAYER_L2CAP, L2CAP_INVALID_STATE);=20=20=20=20 } =20 - result =3D con->c_result; -=09 if(con->c_status !=3D CSTATUS_MAX_NO_RTX) { if (con->current_state =3D=3D CLOSED) {=09 /* remove l2cap connection */ delete_con(con); } else { - D_ERR("L2CAP Disconnect failed\n"); + /* FIXME: If we reach here, should we delete the connection? */ + D_ERR(__FUNCTION__ ": Failed (Connection not closed)"); PRINTSTATE(con); + retval =3D -MSGCODE(MSG_LAYER_L2CAP, L2CAP_FAILED); } } =20=09 @@ -1738,7 +1749,7 @@ lp_disconnect(tmp_hdl); } =20 - return result; + return retval; } =20 =20 @@ -2060,8 +2071,8 @@ con->remote_cid); =20=09 if (con->current_state !=3D W4_L2CAP_CONNECT_RSP) { - D_ERR(__FUNCTION__ ": Invalid state !!!\n"); - return -1; + D_ERR(__FUNCTION__ ": Invalid state\n"); + return -MSGCODE(MSG_LAYER_L2CAP, L2CAP_INVALID_STATE); } =20 payload_len =3D SIGCMD_HDRSIZE + CON_REQSIZE; /*2 x 4*/ @@ -2085,7 +2096,8 @@ =20 /* Don't increment ID if retransmission */ if (con->timer.rtx_no =3D=3D 0) - cmd->id =3D set_id(con); /* Sets sig_id_sent in l2cap_con = */ + cmd->id =3D set_id(con); /* S +ets sig_id_sent in l2cap_con */ else DSYS("RTX, use same ID\n"); =20 @@ -2722,7 +2734,7 @@ psm2str(con->psm)); D_ERR(__FUNCTION__ ": Flushing this buffer\n"); tx->flushed =3D 1; - return -1; + return -MSGCODE(MSG_LAYER_L2CAP, L2CAP_EXCEED_REMOTE_MTU); } =20 /* Only send on an OPEN channel */ @@ -2730,7 +2742,7 @@ D_ERR(__FUNCTION__ ": not in open state\n"); D_ERR(__FUNCTION__ ": Flushing this buffer\n"); tx->flushed =3D 1; - return -1; + return -MSGCODE(MSG_LAYER_L2CAP, L2CAP_INVALID_STATE); } =20 l2cap_buf =3D (l2cap_tx_buf *)(tx->data); @@ -2846,7 +2858,7 @@ s32 l2ca_ping(BD_ADDR bd, u8 *opt_data, u16 len) { l2cap_con *con; - s32 i ; + s32 i, retval =3D 0; u8 rev_bd[6]; =20 D_XMIT("Sending ping\n"); @@ -2877,7 +2889,11 @@ lp_connect_cfm arrives */ con->c_flags |=3D FLAG_RETURNNOW; =20 - lp_connect_req(con->remote_bd); + retval =3D lp_connect_req(con->remote_bd); + if(retval < 0) { + D_ERR(__FUNCTION__ ": lp_connect_req failed (status %d)\n", retval); + return retval; + } =20 /* wait here until we received a lp_connect_cfm */ l2ca_wait(__FUNCTION__ ": wait baseband", con); @@ -2886,9 +2902,10 @@ /* check status */ D_XMIT("Now we got baseband, send echo req !\n"); } else { - D_ERR(__FUNCTION__ ": Ping failed !\n"); + D_ERR(__FUNCTION__ ": lp_connect_req failed, no connection (status %d)\= n", con->c_status); + retval =3D -MSGCODE(MSG_LAYER_HCI, con->c_status); delete_con(con); - return -1; + return retval; } } =20 @@ -2910,10 +2927,10 @@ =20 if (con->c_status =3D=3D CSTATUS_MAX_NO_RTX) { /* max number reached, try to disconnect */ - l2ca_disconnect_req(con); + retval =3D l2ca_disconnect_req(con); } =20 - return con->c_result; + return retval; } =20 s32 l2ca_getinfo(BD_ADDR bd, u16 infotype) @@ -2921,6 +2938,7 @@ l2cap_con *con; s32 i ; u8 rev_bd[6]; + s32 retval =3D 0; =20=09 D_XMIT("Sending GetInfo : type 0x%x\n", infotype); =20 @@ -2949,7 +2967,12 @@ lp_connect_cfm arrives */ con->c_flags |=3D FLAG_RETURNNOW; =20 - lp_connect_req(con->remote_bd); + retval =3D lp_connect_req(con->remote_bd); + if(retval < 0) { + D_ERR(__FUNCTION__, ": lp_connect_req failed (status %d)\n", retval); + delete_con(con); + return retval; + } =20 /* wait here until we received a lp_connect_cfm */ l2ca_wait(__FUNCTION__ ": wait baseband", con); @@ -2958,10 +2981,9 @@ /* check status */ D_XMIT("Now we got baseband, send info req !\n"); } else { - D_ERR(__FUNCTION__": GetInfo failed ! [cstatus %d]\n",=20 - con->c_status); + D_ERR(__FUNCTION__ ": lp_connect_req failed, no connection (status %d)\= n", con->c_status); delete_con(con); - return -1; + return -MSGCODE(MSG_LAYER_HCI, con->c_status); } } =20 @@ -2972,13 +2994,21 @@ /* leave loop when either status failed or success */ while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT) { D_XMIT("Sending info req...\n"); - l2cap_info_req(con, infotype);=09 + retval =3D l2cap_info_req(con, infotype); + if(retval < 0) { + D_ERR(__FUNCTION__ ": l2cap_info_req failed (status %d)\n", retval); + /* Timeout and then try again */ + } =20 /* wait until we received a response or after timeout */ l2ca_wait(__FUNCTION__ ": wait echo resp", con); } =20 - return con->c_result; + if (con->c_status =3D=3D CSTATUS_MAX_NO_RTX && !retval) { + retval =3D -MSGCODE(MSG_LAYER_L2CAP, L2CAP_RTX_TIMEOUT); + } + + return retval; } =20 /*******************************************************************/ --- rfcomm.c 2001/10/05 12:06:43 1.122 +++ rfcomm.c 2001/10/10 14:58:18 1.123 @@ -1325,7 +1325,7 @@ u8 dlci; rfcomm_con *rfcomm; =20 - line =3D GET_RFCOMMLINE(con_id); + line =3D GET_LINE(con_id); dlci =3D GET_RFCOMMDLCI(con_id); =20=09 if (dlci =3D=3D 0) { --- test.c 2001/09/28 14:35:38 1.28 +++ test.c 2001/10/10 14:58:18 1.29 @@ -184,12 +184,7 @@ test_connect_psmreq(BD_ADDR bd, u16 psm) { D_STATE("test_connect_req on psm 0x%x\n", psm); - - if (l2ca_connect_req(bd, psm)) { - D_ERR(" tcs_connect_req: l2ca_connect_req failed\n"); - return -1;=20 - } - return 0; + return l2ca_connect_req(bd, psm); } =20 static void |
From: Anders J. <and...@us...> - 2001-10-10 14:56:01
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_errno.h 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 bt_if.c 1.36 1.37=20=20=20=20=20=20=20=20=20=20=20=20 bt_if.h 1.26 1.27=20=20=20=20=20=20=20=20=20=20=20=20 bttest.c 1.21 1.22=20=20=20=20=20=20=20=20=20=20=20=20 bttest.h 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Changed to use the new errorcodes from stack.=20 * Changed so that we doesn't return just a -1 on error. The diff of the modified file(s): --- bt_errno.h 2001/04/17 14:18:26 1.1 +++ bt_errno.h 2001/10/10 14:56:00 1.2 @@ -45,19 +45,21 @@ =20 /* Unique status codes 32 bits : | layer 16 bits | code 16 bits | */ #define MSGCODE(layer, msgcode) ((((layer)<<16)&0xffff0000) | ((msgcode)&0= xffff)) +#define MSG_GET_LAYER(msg) ((msg >> 16) & 0x0000ffff) +#define MSG_GET_CODE(msg) (msg & 0x0000ffff) =20 /* Layer ID */ -#define MSG_LAYER_HCI 0 -#define MSG_LAYER_L2CAP 1 -#define MSG_LAYER_RFCOMM 2 +#define MSG_LAYER_HCI 1 +#define MSG_LAYER_L2CAP 2 +#define MSG_LAYER_RFCOMM 3 #define MSG_LAYER_SDP 4 -#define MSG_LAYER_TCS 8 -#define MSG_BT_INTERFACE 16 +#define MSG_LAYER_TCS 5 +#define MSG_BT_INTERFACE 6 =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=3D=3D=3D=3D=3D=3D*/ /* HCI */ =20 -/* fixme */ +/* Uses errorcodes as specified in the BT specification */ =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=3D=3D=3D=3D=3D=3D*/ /* L2CAP */ @@ -73,6 +75,10 @@ /* General l2cap return codes */ #define L2CAP_FAILED 0xf0 #define L2CAP_CON_UNRESPONSIVE 0xf1 +#define L2CAP_INVALID_STATE 0xf2 +#define L2CAP_NO_CONNECTION 0xf3 +#define L2CAP_EXCEED_REMOTE_MTU 0xf4 +#define L2CAP_RTX_TIMEOUT 0xf5 =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=3D=3D=3D=3D=3D=3D*/ /* RFCOMM */ @@ -95,3 +101,4 @@ #define BT_NOTCONNECTED 0x1 #define BT_ALREADYCONNECTED 0x2 #define BT_TIMEOUT 0x3 +#define BT_LINE_BUSY 0x4 --- bt_if.c 2001/10/04 13:22:15 1.36 +++ bt_if.c 2001/10/10 14:56:00 1.37 @@ -287,7 +287,7 @@ =20 #ifndef BT_USERSTACK if ((result =3D ioctl(bt_fd, BTCONNECT, &con))) - printf("Connect failed [%s (%d)]\n", error_msg(result), result); + printf("Connect failed [%s (%d)]\n", error_msg(result), MSG_GET_CODE(-= result)); else printf("Connected.\n");=20 #else @@ -312,7 +312,7 @@ =20=20=20 #ifndef BT_USERSTACK=20=20 if ((ret_val =3D ioctl(bt_fd, BTDISCONNECT, &con_id))) - printf("Disconnect failed, %s [%d]\n", error_msg(ret_val), ret_val); + printf("Disconnect failed [%s (%d)]\n", error_msg(ret_val), MSG_GET_CO= DE(-ret_val)); else printf("Disconnected.\n"); #else @@ -561,7 +561,7 @@ #ifndef BT_USERSTACK=20 if ((ret_val =3D ioctl(bt_cfd, BTPING, &ping)) < 0) { - printf("Error : %s\n", error_msg(ret_val)); + printf("Error : [%s (%d)]\n", error_msg(ret_val), MSG_GET_CODE(-ret_va= l)); } else printf("Success!\n"); @@ -584,7 +584,7 @@ #ifndef BT_USERSTACK=20 if ((ret_val =3D ioctl(bt_cfd, BTGETINFO, &msg)) < 0) { - printf("Error : %s\n", error_msg(ret_val)); + printf("Error : [%s (%d)]\n", error_msg(ret_val), MSG_GET_CODE(-ret_va= l)); } else printf("Success!\n"); @@ -608,8 +608,10 @@ #ifndef BT_USERSTACK=20 if ((ret_val =3D ioctl(bt_cfd, BTTESTCOMMAND, tmp)) < 0) { - printf("Error : %s\n", error_msg(ret_val)); + printf("Error : [%s (%d)]\n", error_msg(ret_val), MSG_GET_CODE(-ret_va= l)); } + else + printf("Success!\n"); #else test_process_cmd(&tmp[1], tmp[0]); #endif @@ -1056,99 +1058,101 @@ /* See bt_errno.h for error codes */ const char *error_msg(int err) { - int layer =3D (err >> 16) & 0xffff; - int code =3D err & 0xffff; + int layer, code, msg; + msg =3D -err; + layer =3D MSG_GET_LAYER(msg); + code =3D MSG_GET_CODE(msg); =20 switch (layer) { case MSG_LAYER_HCI: - { - - /* fixme -- add these as defines in bt_errno.h */ switch(code) {=20=20=20=20=20=20=20 - case 0x03:=20=20=20=20=20=20=20=20 - return "HCI - Hardware Failure"; - case 0x04:=20=20=20=20=20=20=20=20 - return "HCI - Page Timeout"; - case 0x05:=20=20=20=20=20=20=20=20 - return "HCI - Authentications Failure"; - case 0x06:=20=20=20=20=20=20=20=20 - return "HCI - Key missing"; - case 0x09:=20=20=20=20=20=20=20=20 - return "HCI - Max number of connections"; - case 0x0b:=20=20=20=20=20=20=20=20 - return "HCI - ACL connection already exists"; - case 0x0c:=20=20=20=20=20=20=20=20 - return "HCI - Command disallowed"; - case 0x10:=20=20=20=20=20=20=20=20 - return "HCI - Host Timeout"; - - default : - return "HCI - Unknown reason"; - break; - } + case 0x00: return "HCI: Success!"; + case 0x01: return "HCI: Unknown HCI Command"; + case 0x02: return "HCI: No Connection"; + case 0x03: return "HCI: Hardware Failure"; + case 0x04: return "HCI: Page Timeout"; + case 0x05: return "HCI: Authentication Failure"; + case 0x06: return "HCI: Key Missing"; + case 0x07: return "HCI: Memory Full"; + case 0x08: return "HCI: Connection Timeout"; + case 0x09: return "HCI: Max Number Of Connections"; + case 0x0A: return "HCI: Max Number Of SCO Connections To A Device"; + case 0x0B: return "HCI: ACL connection already exists"; + case 0x0C: return "HCI: Command Disallowed"; + case 0x0D: return "HCI: Host Rejected due to limited resources"; + case 0x0E: return "HCI: Host Rejected due to security reasons"; + case 0x0F: return "HCI: Host Rejected due to remote device is only a = personal device"; + case 0x10: return "HCI: Host Timeout"; + case 0x11: return "HCI: Unsupported Feature or Parameter Value"; + case 0x12: return "HCI: Invalid HCI Command Parameters"; + case 0x13: return "HCI: Other End Terminated Connection: User Ended C= onnection"; + case 0x14: return "HCI: Other End Terminated Connection: Low Resource= s"; + case 0x15: return "HCI: Other End Terminated Connection: About to Pow= er Off"; + case 0x16: return "HCI: Connection Terminated by Local Host"; + case 0x17: return "HCI: Repeated Attempts"; + case 0x18: return "HCI: Pairing Not Allowed"; + case 0x19: return "HCI: Unknown LMP PDU"; + case 0x1A: return "HCI: Unsupported Remote Feature"; + case 0x1B: return "HCI: SCO Offset Rejected"; + case 0x1C: return "HCI: SCO Interval Rejected"; + case 0x1D: return "HCI: SCO Air Mode Rejected"; + case 0x1E: return "HCI: Invalid LMP Parameters"; + case 0x1F: return "HCI: Unspecified Error"; + case 0x20: return "HCI: Unsupported LMP Parameter Value"; + case 0x21: return "HCI: Role Change Not Allowed"; + case 0x22: return "HCI: LMP Response Timeout"; + case 0x23: return "HCI: LMP Error Transaction Collision"; + case 0x24: return "HCI: LMP PDU Not Allowed"; + case 0x25: return "HCI: Encryption Mode Not Acceptable"; + case 0x26: return "HCI: Unit Key Used"; + case 0x27: return "HCI: QOS is Not Supported"; + case 0x28: return "HCI: Instant Passed"; + case 0x29: return "HCI: Pairing with Unit Key Not Supported"; + default: return "HCI: No debug msg defined"; } - break; - case MSG_LAYER_L2CAP: - { switch(code) {=20 - case L2CAP_PSMNEG: - return "L2CAP - PSM not valid"; - case L2CAP_SECNEG: - return "L2CAP - Security block"; - case L2CAP_NOSRC: - return "L2CAP - Remote side has no resources";=09 - case L2CAP_CON_UNRESPONSIVE: - return "L2CAP - Unresponsive link"; - - default: - return "L2CAP - unknown reason"; - } + case L2CAP_SUCCESS: return "L2CAP: Success"; + case L2CAP_CON_PENDING: return "L2CAP: Connection Pending"; + case L2CAP_PSMNEG: return "L2CAP: Connection Refused, PSM Not Accepte= d"; + case L2CAP_SECNEG: return "L2CAP: Connection Refused, Authentication = Failed"; + case L2CAP_NOSRC: return "L2CAP: Connection Refused, No Resources"; + case L2CAP_FAILED: return "L2CAP: General Error"; + case L2CAP_CON_UNRESPONSIVE: return "L2CAP: No Reply From Remote"; + case L2CAP_INVALID_STATE: return "L2CAP: Invalid State"; + case L2CAP_NO_CONNECTION: return "L2CAP: No Connection"; + case L2CAP_EXCEED_REMOTE_MTU: return "L2CAP: Trying to send a frame m= ore than remote MTU"; + case L2CAP_RTX_TIMEOUT: return "L2CAP: Timeout Waiting For Remote To = Reply"; + default: return "L2CAP: No debug msg defined"; } - break; -=20=20=20=20 case MSG_LAYER_RFCOMM: + switch(code) { - /* fixme */ - return "RFCOMM - unknown reason"; + default: return "RFCOMM: No debug msg defined"; } - break; - case MSG_LAYER_SDP: + switch(code) { - /* fixme */ - return "SDP - unknown reason"; + default: return "SDP: No debug msg defined"; } - break; -=20=20=20=20 case MSG_LAYER_TCS: + switch(code) { - /* fixme */ - return "TCS - unknown reason"; + default: return "TCS: No debug msg defined"; } - break; -=20=20=20=20 case MSG_BT_INTERFACE: - { switch(code) {=20 - case BT_NOTCONNECTED: - return "BT_INTERFACE - Not connected"; - case BT_ALREADYCONNECTED: - return "BT_INTERFACE - Already connected"; - case BT_TIMEOUT: - return "BT_INTERFACE - Timeout"; - default: - return "BT_INTERFACE - unknown reason"; - } + case BT_NOTCONNECTED: return "BT_INTERFACE: Line Not Connected"; + case BT_ALREADYCONNECTED: return "BT_INTERFACE: Line Already Connecte= d"; + case BT_TIMEOUT: return "BT_INTERFACE: Timeout When Processing Comman= d"; + case BT_LINE_BUSY: return "BT_INTERFACE: Line Busy"; + default: return "BT_INTERFACE: No debug msg defined"; } - break; - - default: - return "General failure"; + default: return "General Failure"; } } =20 @@ -1428,7 +1432,7 @@ =20 if (status) { /* fixme -- only works for rfcomm now */ - line =3D GET_RFCOMMLINE(con_id); + line =3D GET_LINE(con_id); =20 if ((line < 0) || (line > BT_NBR_DATAPORTS)) { =20 --- bt_if.h 2001/10/05 11:57:42 1.26 +++ bt_if.h 2001/10/10 14:56:00 1.27 @@ -93,27 +93,6 @@ =20 #define SDPSRV_CONF "/etc/sdp.xml" =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=3D=3D */ -/* Return code defines (see bt_errno.h in kernel)*/ - -/* unique message status codes 32 bits : | layer 16 bits | code 16 bits | = */ - -#define MSG_LAYER_HCI 0 -#define MSG_LAYER_L2CAP 1 -#define MSG_LAYER_RFCOMM 2 -#define MSG_LAYER_SDP 4 -#define MSG_LAYER_TCS 8 - -#define L2CAP_SUCCESS 0x0 -#define L2CAP_CON_PENDING 0x1 - -/* Result in responses in L2CAP */ -#define L2CAP_PSMNEG 0x02 -#define L2CAP_SECNEG 0x03 -#define L2CAP_NOSRC 0x04 - -#define L2CAP_FAILED 0xf0 -#define L2CAP_CON_UNRESPONSIVE 0xf1 =20 #ifndef BT_USERSTACK =20 --- bttest.c 2001/10/03 17:48:31 1.21 +++ bttest.c 2001/10/10 14:56:00 1.22 @@ -70,7 +70,7 @@ #include "bt_misc.h" #include "bt_conf.h" #include "bt_vendor.h" - +#include "bt_errno.h" /* =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 */ =20 #define BTD_HISTORY_FILE "/tmp/btd_history" @@ -240,6 +240,7 @@ process_cmd(char *buf, int bt_cfd) { unsigned int i, con_id, tmp[10], repeat, line =3D 0, profile, srv_ch; + int retval =3D 0; unsigned char bd[6]; =20 if (!strncmp(buf, "quit", 4)) @@ -263,7 +264,7 @@ srv_ch =3D (unsigned short)(tmp[6]); con_id =3D CREATE_RFCOMM_ID(line, srv_ch<<1); =20=20=20=20=20 - bt_connect(bt_cfd, bd, con_id); + retval =3D bt_connect(bt_cfd, bd, con_id); } else if (sscanf(buf, "bt_wrscan %d", &tmp[0]) =3D=3D 1) { @@ -274,7 +275,7 @@ { unsigned int con_id; con_id =3D CREATE_RFCOMM_ID(line, 0 /* fixme -- don't care */); - bt_disconnect(bt_cfd, con_id); + retval =3D bt_disconnect(bt_cfd, con_id); } else if (sscanf(buf, "rf_wait %d", &line) =3D=3D 1) { @@ -387,7 +388,7 @@ /* fill it with something */ memset(buf, 'A', count); =20 - bt_ping(bt_cfd, bd, (unsigned char*)&buf , (unsigned short)count);=20= =20 + retval =3D bt_ping(bt_cfd, bd, (unsigned char*)&buf , (unsigned short)= count);=20=20 } else if (sscanf(buf, "getinfo %x:%x:%x:%x:%x:%x %d", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5],=20 @@ -407,7 +408,7 @@ #ifdef CONFIG_BLUETOOTH_UNPLUG_TEST else if (strncmp(buf, "upt", 3) =3D=3D 0) { - bt_testcmd(bt_cfd, buf+4); + retval =3D bt_testcmd(bt_cfd, buf+4); } #endif else if (sscanf(buf, "getinfo %x:%x:%x:%x:%x:%x %x", @@ -436,7 +437,7 @@ bd[0], bd[1], bd[2], bd[3], bd[4], bd[5]); =20 - bt_connect(bt_cfd, bd, (TCS_LAYER << 16) & 0xffff000); + retval =3D bt_connect(bt_cfd, bd, (TCS_LAYER << 16) & 0xffff000); } =20 /* FIXME so that we can specify which line to connect */ @@ -454,7 +455,7 @@ bd[3], bd[4], bd[5]); =20=20=20=20=20 printf("RFCOMM server channel is %d\n", srv_ch); - bt_connect(bt_cfd, bd, CREATE_RFCOMM_ID(0, srv_ch << 1)); + retval =3D bt_connect(bt_cfd, bd, CREATE_RFCOMM_ID(0, srv_ch << 1)); } else if(sscanf(buf, "sdp_conn %x:%x:%x:%x:%x:%x", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]) =3D=3D 6) @@ -468,7 +469,7 @@ bd[0], bd[1], bd[2], bd[3], bd[4], bd[5]); =20 - bt_connect(bt_cfd, bd, (SDP_LAYER << 16) & 0xFFFF0000); + retval =3D bt_connect(bt_cfd, bd, (SDP_LAYER << 16) & 0xFFFF0000); } else if(sscanf(buf, "test_conn %x:%x:%x:%x:%x:%x %x %d", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5], &tmp[6], &tmp[7])= =3D=3D 8) @@ -481,32 +482,32 @@ printf("Connecting test layer (psm 0x%x, line %d) to bd : %02X:%02X:%0= 2X:%02X:%02X:%02X\n",=20 tmp[6], tmp[7], bd[0], bd[1], bd[2], bd[3], bd[4], bd[5]); =20 - bt_connect(bt_cfd, bd, ((tmp[6] << 16) & 0xffff0000) | tmp[7]); + retval =3D bt_connect(bt_cfd, bd, ((tmp[6] << 16) & 0xffff0000) | tmp[= 7]); } else if (sscanf(buf, "test_case_reject %x:%x:%x:%x:%x:%x", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]) = =3D=3D 6) { - bt_testcmd(bt_cfd, buf); + retval =3D bt_testcmd(bt_cfd, buf); } else if (sscanf(buf, "test_disc %x", &tmp[0]) =3D=3D 1) { printf("Disconnecting layer (PSM: %x)\n", tmp[0]); - bt_disconnect(bt_cfd, (tmp[0] << 16) & 0xffff0000); + retval =3D bt_disconnect(bt_cfd, (tmp[0] << 16) & 0xffff0000); } else if(sscanf(buf, "bb_conn %x:%x:%x:%x:%x:%x", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]) =3D=3D 6) { - bt_testcmd(bt_cfd, buf); + retval =3D bt_testcmd(bt_cfd, buf); } else if(sscanf(buf, "bb_disc %d", &i) =3D=3D 1) { printf("Disconnecting hci handle %d\n", i); - bt_testcmd(bt_cfd, buf); + retval =3D bt_testcmd(bt_cfd, buf); } else if(sscanf(buf, "lcid_disconnect %d", &i) =3D=3D 1) { printf("Disconnecting lcid %d", i); - bt_testcmd(bt_cfd, buf); + retval =3D bt_testcmd(bt_cfd, buf); } else if(sscanf(buf, "hotlist_set %d %x:%x:%x:%x:%x:%x",=20 &tmp[6], &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tm= p[5])) @@ -562,7 +563,9 @@ { printf("> error: command not recognized or wrong syntax\n"); show_menu(); + return 0; } +=20=20=20=20=20=20 return 0; } =20 @@ -601,6 +604,8 @@ return line; } #endif /* !HAVE_READLINE */ + + =20 /* bttest.c */ /* =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 */ --- bttest.h 2001/03/02 10:59:57 1.1 +++ bttest.h 2001/10/10 14:56:00 1.2 @@ -45,6 +45,5 @@ #define START_PPP 1 #define QUIT_BTD 2 int process_cmd(char *buf, int bt_cfd); - #endif /* __BT_TEST_H__*/ =20 |
From: Anders J. <and...@us...> - 2001-10-10 14:53:02
|
The following file was modified in apps/bluetooth/btd: Name Old version New version Comment ---- ----------- ----------- ------- btd.c 1.103 1.104=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * GET_RFCOMMLINE -> GET_LINE The diff of the modified file(s): --- btd.c 2001/08/17 16:23:21 1.103 +++ btd.c 2001/10/10 14:53:01 1.104 @@ -2374,7 +2374,7 @@ { int n; =20 - BT_DATA(" |X|--> %3d [%d]\n", len, GET_RFCOMMLINE(con_id)); + BT_DATA(" |X|--> %3d [%d]\n", len, GET_LINE(con_id)); =20 if (modem_emulation && !modem_connected) { @@ -2411,7 +2411,7 @@ =20 if (status) { /* fixme -- only works for rfcomm now */ - line =3D GET_RFCOMMLINE(con_id); + line =3D GET_LINE(con_id); =20 if ((line < 0) || (line > BT_NBR_DATAPORTS)) { printf("bt_connect_cfm on invalid line (%d)\n", line); @@ -2875,7 +2875,7 @@ =20=20=20=20=20 CHECK_RFCOMM(con_id); srv_ch =3D GET_RFCOMMSRVCH(con_id); - line =3D GET_RFCOMMLINE(con_id); + line =3D GET_LINE(con_id); =20=20 if (line !=3D 0) { @@ -2903,7 +2903,7 @@ u8 line;=09=09=09=09 =20=20=20 CHECK_RFCOMM(con_id); - line =3D GET_RFCOMMLINE(con_id); + line =3D GET_LINE(con_id); =20=20=20 if (line !=3D 0) { @@ -2911,7 +2911,7 @@ return; } =20=20=20 - rfcomm_disconnect_req(GET_RFCOMMLINE(con_id)); + rfcomm_disconnect_req(GET_LINE(con_id)); #endif printf("Disconnected!\n"); } |
From: Peter K. <pk...@us...> - 2001-10-10 13:16:42
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.185 1.186=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Do not check for DFU mode in user stack. The diff of the modified file(s): --- hci.c 2001/10/05 12:25:46 1.185 +++ hci.c 2001/10/10 13:16:41 1.186 @@ -1897,10 +1897,10 @@ #ifdef __KERNEL__ send_data_task.routine =3D (void *)send_acl_data_task; send_data_task.data =3D NULL; -#endif =20 if (bt_dfu_mode(-1)) return 0; +#endif =20=20=20=20=20=20=20=20=20 DSYS("Reading buffer sizes in HW module\n"); hci_read_buffer_size(HCI_BLOCK); |
From: Peter K. <pk...@us...> - 2001-10-05 14:14:17
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btd.c 1.29 1.30=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Do not select() on stdin. The diff of the modified file(s): --- btd.c 2001/10/03 17:47:47 1.29 +++ btd.c 2001/10/05 14:14:16 1.30 @@ -317,7 +317,6 @@ =20=20=20 while (1) { - int i, waiting_iparsp =3D 0; tv.tv_sec =3D 0; tv.tv_usec =3D 500000; =20 @@ -326,17 +325,14 @@ if (ipa_fd >=3D 0) FD_SET(ipa_fd, &rfd); =20=20=20=20=20 - FD_SET(0, &rfd); - result =3D select(FD_SETSIZE, &rfd, NULL, NULL, &tv); switch (result) { case 0: { - /* Timeout, check for new rfcomm cons */ - +#ifdef USE_IPASSIGN /* Check for outstanding IPA requests */ - i =3D 0; + int i =3D 0, waiting_iparsp =3D 0; while (i < BT_NBR_DATAPORTS) { if ((STATE(i) =3D=3D WAITING_PPPCONF) || @@ -350,20 +346,21 @@ =20=20=20=20=20=20=20=20=20 if (waiting_iparsp) break; +#endif +=20=20=20=20=20=20=20=20 + /* Timeout, check for new rfcomm cons */ =20=20=20=20=20=20=20=20=20 discover_connections(bt_cfd); } break; =20=20=20=20=20=20=20 case -1: - { if (errno !=3D EINTR) { /* Error */ perror("select"); =20 /* FIXME -- e.g if ipa server restarts !!! */ - } } break; =20=20=20=20=20=20=20 |
From: Peter K. <pk...@us...> - 2001-10-05 12:25:47
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.201 1.202=20=20=20=20=20=20=20=20=20=20=20 hci.c 1.184 1.185=20=20=20=20=20=20=20=20=20=20=20 hci_vendor.c 1.57 1.58=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected indentation. |
From: Peter K. <pk...@us...> - 2001-10-05 12:07:13
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.200 1.201=20=20=20=20=20=20=20=20=20=20=20 hci.c 1.183 1.184=20=20=20=20=20=20=20=20=20=20=20 hci_vendor.c 1.56 1.57=20=20=20=20=20=20=20=20=20=20=20=20 rfcomm.c 1.121 1.122=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Some initialization needs to be done at module start time, not when the stack is initialized. * Initialize (part of) hci even when in DFU mode. The diff of the modified file(s): --- bluetooth.c 2001/10/02 13:44:49 1.200 +++ bluetooth.c 2001/10/05 12:06:43 1.201 @@ -2495,6 +2495,9 @@ #endif /* LINUX_VERSION_CODE */ #endif /* __KERNEL__ */ =20 + hci_module_init(); + rfcomm_module_init(); +=20=20=20=20=20=20=20=20 return 0; /*success*/ } =20 @@ -2596,13 +2599,13 @@ } #endif =20 - if (!bt_dfu_mode(-1)) { /* Always check if hci succeeded */ if (hci_init() < 0){ D_ERR("HCI failed to initialise\n"); goto init_failed_exit1; } =20=09 + if (!bt_dfu_mode(-1)) { l2cap_init(); =20 #ifdef CONFIG_BLUETOOTH_USE_TCI @@ -2626,6 +2629,9 @@ =20 init_failed_exit1:=20 hci_shutdown(); +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP + bcsp_shutdown(); +#endif init_failed_exit0: btmem_shutdown(); if (tmp_bt_buf) { @@ -3000,8 +3006,9 @@ sdp_shutdown(); tcs_shutdown(); l2cap_shutdown(); - hci_shutdown(); } + + hci_shutdown(); } =20 bt_dfu_mode(0); --- hci.c 2001/10/02 13:40:56 1.183 +++ hci.c 2001/10/05 12:06:43 1.184 @@ -1824,18 +1824,8 @@ } =20 s32 -hci_init(void) +hci_module_init(void) { - u32 i; - - DSYS("Initialising HCI\n"); - -#ifdef HCI_EMULATION - DSYS("*** HCI emulator on ***\n"); -#else - DSYS("HCI emulator off\n"); -#endif -=09 #ifdef __KERNEL__ #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0) init_waitqueue_head(&hci_wq); @@ -1848,7 +1838,23 @@ #endif /* __KERNEL__ */ =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP - hci_init_dfu(); + hci_dfu_module_init(); +#endif + + return 0; +} + +s32 +hci_init(void) +{ + u32 i; + + DSYS("Initialising HCI\n"); + +#ifdef HCI_EMULATION + DSYS("*** HCI emulator on ***\n"); +#else + DSYS("HCI emulator off\n"); #endif =20 DSYS("Initialising HCI inbuffers [%d]\n", HCI_IN_SIZE); @@ -1867,9 +1873,8 @@ hci_ctrl.con[i].con_hdl =3D -1; } =20 -/* Here we set the buffer sizes to zero, just to avoid that they should get - undefined values if the initiating read buffersize fails */ - + /* Here we set the buffer sizes to zero, just to avoid that they + get undefined values if we fail to read the buffer sizes below = */ hci_ctrl.hc_buf.acl_len =3D 0; hci_ctrl.hc_buf.sco_len =3D 0; hci_ctrl.hc_buf.acl_num =3D 0; @@ -1894,6 +1899,9 @@ send_data_task.data =3D NULL; #endif =20 + if (bt_dfu_mode(-1)) + return 0; +=20=20=20=20=20=20=20=20 DSYS("Reading buffer sizes in HW module\n"); hci_read_buffer_size(HCI_BLOCK); =20 @@ -1932,7 +1940,6 @@ void=20 hci_shutdown(void) { -=20=20 /* take down any open acl links */ =20 hci_ctrl.nbr_of_connections =3D 0; @@ -3969,6 +3976,7 @@ release_ncp_timer(void) { #ifdef __KERNEL__ + if (hci_ncp_timer.function) del_timer(&hci_ncp_timer); #endif } --- hci_vendor.c 2001/10/03 17:19:10 1.56 +++ hci_vendor.c 2001/10/05 12:06:43 1.57 @@ -671,7 +671,7 @@ #endif /* LINUX_VERSION_CODE */ =20 void -hci_init_dfu(void) +hci_dfu_module_init(void) { #ifdef __KERNEL__ #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0) @@ -693,6 +693,8 @@ =20 kfree(response); } + + wake_up_interruptible(&dfu_wq); } =20 void --- rfcomm.c 2001/10/04 14:52:59 1.121 +++ rfcomm.c 2001/10/05 12:06:43 1.122 @@ -544,17 +544,23 @@ rfcomm_con_list[line].l2cap =3D NULL; } =20 -void=20 -rfcomm_init(void) +s32 +rfcomm_module_init(void) { - s32 i; - protocol_layer this_layer; - #ifdef __KERNEL__ #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0) init_waitqueue_head(&rfcomm_disconnect_wq); #endif /* LINUX_VERSION_CODE */ #endif /* __KERNEL__ */ + + return 0; +} + +void +rfcomm_init(void) +{ + s32 i; + protocol_layer this_layer; =20 DSYS("Initialising RFCOMM\n"); create_crctable(crctable); |
From: Peter K. <pk...@us...> - 2001-10-05 12:06:43
|
The following files were modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.h 1.71 1.72=20=20=20=20=20=20=20=20=20=20=20=20 rfcomm.h 1.39 1.40=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Some initialization needs to be done at module start time, not when the stack is initialized. * Initialize (part of) hci even when in DFU mode. The diff of the modified file(s): --- hci.h 2001/10/02 13:44:49 1.71 +++ hci.h 2001/10/05 12:06:43 1.72 @@ -95,6 +95,7 @@ =20 s32 hci_trig_send(void); s32 hci_acl_num_cnt(void); +s32 hci_module_init(void); s32 hci_init(void); void hci_shutdown(void); void hci_clear_buffer(u32 con_hdl); @@ -112,7 +113,7 @@ =20 s32 hci_read_dfu(u8* data, u32 count); =20 -void hci_init_dfu(void); +void hci_dfu_module_init(void); void hci_shutdown_dfu(void); #endif =20 --- rfcomm.h 2001/07/31 17:18:44 1.39 +++ rfcomm.h 2001/10/05 12:06:43 1.40 @@ -189,6 +189,7 @@ =20 /****************** EXPORTED FUNCTION DECLARATION SECTION ****************= ***/ =20 +s32 rfcomm_module_init(void); void rfcomm_init(void); void rfcomm_close(void); s32 rfcomm_connect_req(u8* bd_addr, u8 server_chan, u8 line); |
From: Peter K. <pk...@us...> - 2001-10-05 11:57:43
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.h 1.25 1.26=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Increased CSR_PSKEY_MAXPARAMS to 40. The diff of the modified file(s): --- bt_if.h 2001/10/03 17:43:11 1.25 +++ bt_if.h 2001/10/05 11:57:42 1.26 @@ -251,7 +251,7 @@ #define BTSETBCSPMODE _IOWR(BT_IOC_MAGIC, 0xf4, int) =20 #define CSR_PSKEY_MSGHDR_SIZE 3 -#define CSR_PSKEY_MAXPARAMS 10 +#define CSR_PSKEY_MAXPARAMS 40 =20 /*=20 * | ps_key (u16) | rw_mode (u16) | len (u16) | params (u16[])|=20 |
From: Peter K. <pk...@us...> - 2001-10-05 11:54:26
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btcommon.h 1.85 1.86=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Increased CSR_PSKEY_MAXPARAMS to 40. The diff of the modified file(s): --- btcommon.h 2001/09/21 12:51:06 1.85 +++ btcommon.h 2001/10/05 11:54:24 1.86 @@ -204,7 +204,7 @@ =20 =20 #define CSR_PSKEY_MSGHDR_SIZE 3 -#define CSR_PSKEY_MAXPARAMS 10 +#define CSR_PSKEY_MAXPARAMS 40 =20 #define BT_CSR_PSKEY _IOWR(BT_IOC_MAGIC, 0xf5, u16[CSR_PSKEY_MSGHDR_SIZE += CSR_PSKEY_MAXPARAMS]) =20 |
From: Peter K. <pk...@us...> - 2001-10-04 15:10:40
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_misc.c 1.19 1.20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Fail again if a divisor is specified, but TIOCGSERIAL does not work. The diff of the modified file(s): --- bt_misc.c 2001/10/04 15:03:19 1.19 +++ bt_misc.c 2001/10/04 15:10:40 1.20 @@ -350,7 +350,11 @@ if (divisorp) { divisor =3D atol(divisorp+1); + if (!divisor) /* Just to be safe */ + { + divisor =3D 1; } + } =20 if (tcgetattr(fd, &t) < 0) {=20=20 @@ -375,6 +379,11 @@ serial.flags &=3D ~ASYNC_SPD_CUST; } } + else if (divisor) + { + perror("Error getting serial_struct with TIOCGSERIAL"); + exit(1); + } =20=20=20=20=20 cfmakeraw(&t); =20=09 @@ -419,7 +428,7 @@ if (divisorp) { divisor =3D atol(divisorp+1); - if (divisor =3D=3D 0) /* Just to be safe */ + if (!divisor) /* Just to be safe */ { divisor =3D 1; } |
From: Peter K. <pk...@us...> - 2001-10-04 15:03:20
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_misc.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed unnecessary return. The diff of the modified file(s): --- bt_misc.c 2001/10/04 13:09:46 1.18 +++ bt_misc.c 2001/10/04 15:03:19 1.19 @@ -407,8 +407,6 @@ { perror("Error setting serial_struct with TIOCSSERIAL"); } - - return; } =20 unsigned long |
From: Peter K. <pk...@us...> - 2001-10-04 14:53:00
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- rfcomm.c 1.120 1.121=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Do not dereference rfcomm in rfcomm_disconnect_ind() if it is NULL. The diff of the modified file(s): --- rfcomm.c 2001/09/28 14:54:15 1.120 +++ rfcomm.c 2001/10/04 14:52:59 1.121 @@ -972,13 +972,11 @@ =20 DSYS(FNC"remote cid %d\n", l2cap->remote_cid); =20 - rfcomm =3D ((rfcomm_con*) l2cap->upper_con); - + if ((rfcomm =3D (rfcomm_con*)l2cap->upper_con)) { /* This l2cap connection is going down, remove all rfcomm cons=20 and notify upper tty */ =20 - if (!l2cap->link_up) - { + if (!l2cap->link_up) { DSYS(FNC"Baseband is down, reset this RFCOMM session\n"); #ifdef __KERNEL__ bt_unregister_rfcomm(rfcomm->line); @@ -987,6 +985,7 @@ } =20 rfcomm_reset_con(rfcomm->line); + } =20 /* always try to send back rsp (if link is down con is deleted) */ if (l2ca_disconnect_rsp(l2cap)) { |
From: Peter K. <pk...@us...> - 2001-10-04 13:22:16
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.35 1.36=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: No need to shutdown the stack in init_stack() if it fails, since it is already shutdown. The diff of the modified file(s): --- bt_if.c 2001/10/03 17:34:17 1.35 +++ bt_if.c 2001/10/04 13:22:15 1.36 @@ -72,15 +72,12 @@ =20 int init_stack(int bt_cfd) { - int ret =3D 0; - syslog(LOG_INFO, "Init stack"); =20 #ifndef BT_USERSTACK - if ((ret =3D ioctl(bt_cfd, BTINITSTACK)) < 0) + if (ioctl(bt_cfd, BTINITSTACK) < 0) { - shutdown_stack(bt_cfd); - return ret; + return -1; } #else init_userstack(); @@ -96,7 +93,7 @@ #endif } =20=20=20 - return ret; + return 0; } =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 */ @@ -727,7 +724,7 @@ int result; unsigned long spd =3D speedstrtoli(speedstr); =20 - syslog(LOG_INFO, __FUNCTION__ ": %d baud", spd); + syslog(LOG_INFO, __FUNCTION__ ": %lu baud", spd); #ifdef BT_USERSTACK tcflush(phys_fd, TCIOFLUSH); result =3D hci_set_baudrate(spd); |
From: Peter K. <pk...@us...> - 2001-10-04 13:09:47
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_misc.c 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Do not fail if TIOCGSERIAL ioctl does not work. The diff of the modified file(s): --- bt_misc.c 2001/10/04 10:04:07 1.17 +++ bt_misc.c 2001/10/04 13:09:46 1.18 @@ -334,6 +334,7 @@ unsigned long baudbase =3D atol(speedstr); unsigned long speed =3D baudbase; struct serial_struct serial; + int got_serial =3D 0; =20 if (fd < 0) { @@ -357,11 +358,9 @@ exit(1); } =20 - if (ioctl(fd, TIOCGSERIAL, &serial)) + if (ioctl(fd, TIOCGSERIAL, &serial) >=3D 0) { - perror("Error getting serial_struct with TIOCGSERIAL"); - exit(1); - } + got_serial =3D 1; =20=20=20=20=20 if (divisor) { @@ -375,6 +374,7 @@ /* Remove special baudrate */=20 serial.flags &=3D ~ASYNC_SPD_CUST; } + } =20=20=20=20=20 cfmakeraw(&t); =20=09 @@ -403,7 +403,7 @@ exit(1); } =20 - if (ioctl(fd, TIOCSSERIAL, &serial)) + if (got_serial && ioctl(fd, TIOCSSERIAL, &serial) < 0) { perror("Error setting serial_struct with TIOCSSERIAL"); } |
From: Peter K. <pk...@us...> - 2001-10-04 10:04:08
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_misc.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Minor clean-up. The diff of the modified file(s): --- bt_misc.c 2001/10/03 17:45:11 1.16 +++ bt_misc.c 2001/10/04 10:04:07 1.17 @@ -340,6 +340,7 @@ perror("fd_setup"); exit(1); } + /* speedstr is either "baudrate" or "baud_base/divisor", * if there is a '/' we should use serial_struct and set=20 * baud_base and custom_divisor etc. @@ -347,14 +348,15 @@ divisorp =3D strchr(speedstr, '/'); if (divisorp) { - divisorp++; - divisor =3D atol(divisorp); + divisor =3D atol(divisorp+1); } + if (tcgetattr(fd, &t) < 0) {=20=20 perror("tcgetattr"); exit(1); } + if (ioctl(fd, TIOCGSERIAL, &serial)) { perror("Error getting serial_struct with TIOCGSERIAL"); @@ -400,27 +402,31 @@ perror("fd_setup : tcsetattr"); exit(1); } + if (ioctl(fd, TIOCSSERIAL, &serial)) { perror("Error setting serial_struct with TIOCSSERIAL"); } + return; } =20 -unsigned long speedstrtoli(const char *speedstr) +unsigned long +speedstrtoli(const char *speedstr) { unsigned long baudbase =3D atol(speedstr); unsigned char *divisorp =3D strchr(speedstr, '/'); unsigned long divisor =3D 1; + if (divisorp) { - divisorp++; - divisor =3D atol(divisorp); + divisor =3D atol(divisorp+1); if (divisor =3D=3D 0) /* Just to be safe */ { divisor =3D 1; } } + return baudbase/divisor; } =20 |
From: Peter K. <pk...@us...> - 2001-10-03 17:19:11
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.55 1.56=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use copy_to_user() instead of copy_from_user() to copy data to user mode... The diff of the modified file(s): --- hci_vendor.c 2001/10/02 11:00:25 1.55 +++ hci_vendor.c 2001/10/03 17:19:10 1.56 @@ -743,7 +743,7 @@ return -E2BIG; } =20 - copy_from_user(data, response->data, length); + copy_to_user(data, response->data, length); =20 kfree(response); =20 |
From: Anders J. <and...@us...> - 2001-10-03 12:12:37
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- l2cap.c 1.119 1.120=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Corrected error in l2cap_config_rsp which wrote data at the wrong address. The diff of the modified file(s): --- l2cap.c 2001/09/21 12:51:06 1.119 +++ l2cap.c 2001/10/03 12:12:35 1.120 @@ -778,6 +778,7 @@ CONF_FAILURE) < 0) { D_ERR(__FUNCTION__ ": Couldn't send conf rsp\n"); } +=09=09=09=09 return; } =20=09=09=09 @@ -2614,14 +2615,14 @@ =20 /* Include unaccepted options if any */ if (opt_len) { - opt =3D (struct l2cap_option*)(rsp + CONF_RSPSIZE); + opt =3D (struct l2cap_option*)((u8*)rsp + CONF_RSPSIZE); =20 if (out_mtu !=3D 0) { DSYS("Sending out_mtu %d\n", out_mtu); opt->type =3D OPT_MTU; opt->len =3D 2; - *(opt->option_data) =3D (u8)(out_mtu & 0x00ff); - *(opt->option_data+1) =3D (u8)(out_mtu >> 8) & 0x00ff; + opt->option_data[0] =3D (u8)(out_mtu & 0x00ff); + opt->option_data[1] =3D (u8)(out_mtu >> 8) & 0x00ff; =20=09 /* forward pointer for other options */ opt =3D (struct l2cap_option*)((char *)opt + 4); @@ -2632,9 +2633,9 @@ print_flow(in_flow); opt->type =3D OPT_QOS; opt->len =3D sizeof *in_flow; - memcpy((char*)opt+2, in_flow, sizeof *in_flow); + memcpy((char*)opt->option_data, in_flow, sizeof *in_flow); } - print_data("options: ", (u8*)rsp, opt_len + CONF_RSPSIZE); + print_data("options: ", (u8*)rsp + CONF_RSPSIZE, opt_len); } =20=09 cmd->code =3D SIG_CONFRSP; |
From: Peter K. <pk...@us...> - 2001-10-02 13:45:20
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.199 1.200=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Call update_ncp() directly from bt_catch_ncp() instead of calling bt_receive_data() since it calls hci_receive_data() which is a state machine, and we do not want to mess up its state... The diff of the modified file(s): --- bluetooth.c 2001/10/02 11:58:50 1.199 +++ bluetooth.c 2001/10/02 13:44:49 1.200 @@ -1802,7 +1802,16 @@ =20 if (index =3D=3D count) { /* Contains _only_ NCP data, parse it ! */ - bt_receive_data(data, count); + + /* The easy way would be to call bt_receive_data(data, count), + but since it calls hci_receive_data() which is a state + machine, we might mess up its state... */ + index =3D 0; + while (index+2 < count) { + update_ncp(data[index+3], data+index+4); + index +=3D (3 + data[index + 2]); + } + return 1; } =20=09 |
From: Peter K. <pk...@us...> - 2001-10-02 13:44:50
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.h 1.70 1.71=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Call update_ncp() directly from bt_catch_ncp() instead of calling bt_receive_data() since it calls hci_receive_data() which is a state machine, and we do not want to mess up its state... The diff of the modified file(s): --- hci.h 2001/09/18 10:48:22 1.70 +++ hci.h 2001/10/02 13:44:49 1.71 @@ -189,6 +189,8 @@ /* FIXME -- add parameter to choose from different devices */ s32 get_remote_bd(int line, u8 *bd); =20 +void update_ncp(u8 nbr_of_hdl, u8 *pkt); + /* Testing commands */ s32 hci_enable_dut(void); s32 hci_test_connect_req(u8 *bd); |
From: Peter K. <pk...@us...> - 2001-10-02 13:40:58
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.182 1.183=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Disable interrupts while update_ncp() is updating the counters. The diff of the modified file(s): --- hci.c 2001/10/02 11:00:25 1.182 +++ hci.c 2001/10/02 13:40:56 1.183 @@ -716,7 +716,13 @@ update_ncp(u8 nbr_of_hdl, u8 *pkt) { s32 i; +#ifdef __KERNEL__ + unsigned long flags; =20 + save_flags(flags); + cli(); +#endif + D_REC(__FUNCTION__ ": acl_num before: %d\n", hci_ctrl.hc_buf.acl_num); =20=09 /* FIXME */ @@ -744,12 +750,15 @@ queue_task(&send_data_task, &tq_immediate); mark_bh(IMMEDIATE_BH); #endif - } + #ifdef USE_NCPTIMER hw.acl_num_count +=3D hci_ctrl.hc_buf.acl_num; #endif + bt_feedstack(); + + restore_flags(flags); #else if (buf_count()) send_acl_data_task(); @@ -1048,11 +1057,9 @@ break; =20 case NBR_OF_COMPLETED_PACKETS:=20 - D_CMD(__FUNCTION__ ": NUMBER_OF_COMPLETED_PACKETS\n"); =20 update_ncp(buf[0], buf + 1); - break; =20 case MODE_CHANGE: |
From: Peter K. <pk...@us...> - 2001-10-02 11:58:52
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.198 1.199=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use available defines in bt_catch_ncp(). The diff of the modified file(s): --- bluetooth.c 2001/09/20 10:11:08 1.198 +++ bluetooth.c 2001/10/02 11:58:50 1.199 @@ -1793,8 +1793,9 @@ =20 /* || uart hdr | event code | par_len | nbr_handles | [data...] || */ =20 - while (((index+2) < count) && (data[index] =3D=3D 0x4) &&=20 - (data[index+1] =3D=3D 0x13) ) { + while (index+2 < count && + data[index] =3D=3D EVENT_PKT &&=20 + data[index+1] =3D=3D NBR_OF_COMPLETED_PACKETS) { /* we found a NCP */ index +=3D (3 + data[index + 2]); /* event hdr + par len */ } |
From: Peter K. <pk...@us...> - 2001-10-02 11:00:59
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.181 1.182=20=20=20=20=20=20=20=20=20=20=20 hci_vendor.c 1.54 1.55=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed an unused hack to change the buffer sizes in a CSR module. The diff of the modified file(s): --- hci.c 2001/09/21 12:51:06 1.181 +++ hci.c 2001/10/02 11:00:25 1.182 @@ -2948,20 +2948,7 @@ c_pkt.len =3D 0; =20 if (block) { - int ret =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_H= DR_LEN, DEFAULT_TIMEOUT); -#if 0 - if (ret >=3D 0 && - hci_ctrl.hc_buf.acl_len =3D=3D 256 && - hci_ctrl.hc_buf.acl_num =3D=3D 4 && - hci_set_buffer_sizes(hci_ctrl.hc_buf.acl_len / 2, - hci_ctrl.hc_buf.acl_num * 2) >=3D= 0) { - c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(READ_BUFFER_SIZE, = HCI_IP); - c_pkt.len =3D 0; - ret =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + C= MD_HDR_LEN + HCI_HDR_LEN, DEFAULT_TIMEOUT); - } -#endif - return ret; + return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N, DEFAULT_TIMEOUT); } else return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); --- hci_vendor.c 2001/09/18 12:22:00 1.54 +++ hci_vendor.c 2001/10/02 11:00:25 1.55 @@ -897,55 +897,6 @@ return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN= , DEFAULT_TIMEOUT); } =20 -s32=20 -hci_set_buffer_sizes(u16 len, u16 num) -{ - csr_msg *msg; - csr_bccmd *cmd; - csr_bccmd_ps *ps; - int ret; - - D_CMD(__FUNCTION__ VENDOR "\n"); - - /* HCI Manufacturer specific header */ - c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(0x00, MANUFACTURER_SPEC); - c_pkt.len =3D 1 + 5*sizeof(u16) + 3*sizeof(u16) + 1*sizeof(u16); - - msg =3D (csr_msg *)c_pkt.data; - cmd =3D (csr_bccmd *)msg->msg; - ps =3D (csr_bccmd_ps *)cmd->payload; - - /* General msg header */ - CSR_SET_LAST(msg, 1); /* first and last segment */ - CSR_SET_FIRST(msg, 1); - CSR_SET_CH_ID(msg, CSR_CH_ID_BCCMD); - - /* BCCMD type */ - cmd->type =3D CSR_MSGTYPE_SETREQ; - cmd->len =3D 5 + 3 + 1; - cmd->seq =3D csr_count++; - cmd->var_id =3D CSR_CMD_PS; - cmd->status =3D CSR_STATUS_OK; /* always OK in SETREQ */ - - /* Actual PS key request */ - ps->ps_key =3D CSR_PS_MAX_ACL_PKTS; - ps->ps_len =3D 1; /* x 16 bits */ - ps->unused =3D 0x0000; - - ps->ps_val[0] =3D num; - - ret =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N, DEFAULT_TIMEOUT); - if (ret < 0) - return ret; -=09 - cmd->seq =3D csr_count++; - ps->ps_key =3D CSR_PS_MAX_ACL_PKT_LEN; - ps->ps_val[0] =3D len; - - return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN= , DEFAULT_TIMEOUT); -} - s32 hci_read_firmware_rev_info(void) { |
From: Peter K. <pk...@us...> - 2001-10-02 11:00:26
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_internal.h 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed an unused hack to change the buffer sizes in a CSR module. The diff of the modified file(s): --- hci_internal.h 2001/07/05 10:54:34 1.20 +++ hci_internal.h 2001/10/02 11:00:25 1.21 @@ -357,7 +357,6 @@ =20 void process_vendor_return_param(u32 ocf, u8* r_val); void process_vendor_event(u8 *buf, u32 len, u32 event_code); -s32 hci_set_buffer_sizes(u16 len, u16 num); s32 csr_pskey(u16 ps_key, u16 rw_mode, u16 *retb, u16 n_pars); =20 #endif |
From: Anders J. <and...@us...> - 2001-09-28 14:54:16
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- rfcomm.c 1.119 1.120=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Corrected initial credits sent. * Improved creditcalculation. The diff of the modified file(s): --- rfcomm.c 2001/09/18 12:59:47 1.119 +++ rfcomm.c 2001/09/28 14:54:15 1.120 @@ -1284,13 +1284,13 @@ u32 con_id =3D CREATE_RFCOMM_ID(rfcomm->line, tmp_dlci); =20 if (rfcomm->credit_flow) { - rfcomm->dlci[tmp_dlci].remote_credits--; + --rfcomm->dlci[tmp_dlci].remote_credits; 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 ? */ + u8 newcredits =3D MAX_CREDITS - rfcomm->dlci[tmp_dlci].remote_credits; + rfcomm_send_credits(rfcomm, tmp_dlci, newcredits); + rfcomm->dlci[tmp_dlci].remote_credits +=3D newcredits; =20=09=09=09=09=09 - 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=09=09=09=09=09 } @@ -1374,7 +1374,7 @@ return total; } else { if (rfcomm->credit_flow) { - rfcomm->dlci[dlci].local_credits--; + --rfcomm->dlci[dlci].local_credits; D_SND(FNC"Local credits:%d\n", rfcomm->dlci[dlci].local_credits); } =20 @@ -1590,7 +1590,7 @@ rfcomm->dlci[tmp_dlci].remote_credits =3D START_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, MAX_CREDITS,=20 + credit ^ 1, START_CREDITS,=20 tmp_dlci, MCC_RSP); } else { send_pn_msg(rfcomm, pn_pkt->prior, frame_size, @@ -1827,7 +1827,7 @@ #endif } =20 - if (rfcomm->credit_flow &&(rfcomm->dlci[dlci].remote_credits < MAX_CREDIT= S)) { + if (rfcomm->credit_flow &&(rfcomm->dlci[dlci].remote_credits < MIN_CREDIT= S)) { D_SND(FNC"Sending more credits to remote port\n"); send_credit =3D 1; } @@ -1855,10 +1855,10 @@ 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) { + u8 newcredits =3D MAX_CREDITS - rfcomm->dlci[dlci].remote_credits; 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; + l_pkt->data[0] =3D (newcredits); + rfcomm->dlci[dlci].remote_credits +=3D newcredits; D_SND(FNC": Remote credits: %d\n",rfcomm->dlci[dlci].remote_credits); memcpy(l_pkt->data + 1, data, len); } else { @@ -1888,10 +1888,11 @@ /* Always one */ set_uih_hdr((void*) s_pkt, dlci, len, rfcomm->initiator); if (send_credit) { + u8 newcredits =3D MAX_CREDITS - rfcomm->dlci[dlci].remote_credits; +=09=09=09 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; + s_pkt->data[0] =3D (newcredits); + rfcomm->dlci[dlci].remote_credits +=3D newcredits; D_SND(FNC": Remote credits: %d\n",rfcomm->dlci[dlci].remote_credits); memcpy(s_pkt->data + 1, data, len); } else { |