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: Peter K. <pk...@us...> - 2001-09-13 12:20:53
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btd.c 1.27 1.28=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use ipa_fd to check if an IP assigner is used instead of ipa_available. The diff of the modified file(s): --- btd.c 2001/09/10 09:41:50 1.27 +++ btd.c 2001/09/13 12:20:52 1.28 @@ -168,7 +168,6 @@ static int do_hwinit =3D 1; /* do vendor specific initialization */ static int do_reset =3D 0; /* reset hw using I/O pins */ =20 -static int ipa_available =3D 0; /* is set if IPA was successfully initiali= zed */ static int modem_emul =3D 1; /* default modem emulation is enabled */ static int init_hw_speed =3D 0; /* not set */ =20 @@ -323,7 +322,7 @@ =20 FD_ZERO(&rfd);=20=20 =20 - if (ipa_available) + if (ipa_fd >=3D 0) FD_SET(ipa_fd, &rfd); =20=20=20=20=20 FD_SET(0, &rfd); @@ -371,12 +370,10 @@ { #ifdef USE_IPASSIGN /* Got data on some fd */ - int i, retval; + int retval; =20 - for (i =3D 0; i < result; i++)=20 - { /* IPA response */ - if (FD_ISSET(ipa_fd, &rfd)) + if (ipa_fd >=3D 0 && FD_ISSET(ipa_fd, &rfd)) { msg =3D (struct ipa_msg*) ipa_buf; /* Got response from IPA, if ok then start pppd or modem emul = */ @@ -400,7 +397,6 @@ } }=20=20=20=20=20=20=20=20=20=20=20 } - }=20 #endif } break; @@ -425,7 +421,7 @@ read_remote_bd(bt_cfd, line, PEER(line).remote_bd); printf("Remote bd: %s\n", bd2str(PEER(line).remote_bd)); =20=20=20=20=20=20=20 - if (ipa_available) + if (ipa_fd >=3D 0) {=20=20 D(syslog(LOG_INFO, "Sending IPA request")); =20=20=20=20=20=20=20=20=20 @@ -462,7 +458,7 @@ struct ip_set *ipset =3D PEER(line).ipset; char local_ip[20]; =20=20=20 - if (ipa_available) + if (ipa_fd >=3D 0) show_ipset(ipset, line); =20=20=20 D(syslog(LOG_INFO, __FUNCTION__)); @@ -760,7 +756,7 @@ =20=20=20=20=20 D(syslog(LOG_INFO, "PPP line %d was shutdown", line)); =20=20=20=20=20 - if (ipa_available)=20 + if (ipa_fd >=3D 0) {=20 STATE(line) =3D WAITING_RETURN_PPPCONF; =20=20=20=20=20=20=20 @@ -834,7 +830,6 @@ else=20 {=20=20=20=20=20=20 D(syslog(LOG_INFO, "Found IPA server")); - ipa_available =3D 1; } }=20 #endif |
From: Peter K. <pk...@us...> - 2001-09-12 13:55:37
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.195 1.196=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Make sure the LED timer is started before doing any communication with the Bluetooth module. The diff of the modified file(s): --- bluetooth.c 2001/09/12 12:38:10 1.195 +++ bluetooth.c 2001/09/12 13:55:36 1.196 @@ -2566,6 +2566,15 @@ =20 DSYS("Current HW: %s\n", bt_hw_vendor()); =20 +#ifdef __CRIS__ + /* start led timer */ + bt_set_leds(NO_BLUETOOTH_ACTIVITY); + init_timer(&bt_clear_led_timer); + bt_clear_led_timer.function =3D &bt_clear_led; + bt_clear_led_timer.expires =3D jiffies + HZ/10; + add_timer(&bt_clear_led_timer); +#endif + btmem_init(); =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP @@ -2603,14 +2612,6 @@ bt_reset_linebuf(); #endif =20 -#ifdef __CRIS__ - /* start led timer */ - bt_set_leds(NO_BLUETOOTH_ACTIVITY); - init_timer(&bt_clear_led_timer); - bt_clear_led_timer.function =3D &bt_clear_led; - bt_clear_led_timer.expires =3D jiffies + HZ/10; - add_timer(&bt_clear_led_timer); -#endif return 0; =20 init_failed_exit1:=20 @@ -2621,6 +2622,10 @@ free_page((unsigned long) tmp_bt_buf); tmp_bt_buf =3D NULL; } +#ifdef __CRIS__ + del_timer(&bt_clear_led_timer); + bt_set_leds(NO_BLUETOOTH_ACTIVITY); +#endif return -1; } =20 @@ -3001,9 +3006,7 @@ btmem_shutdown(); =20 #ifdef __CRIS__ - if (bt_stack_initiated) { del_timer(&bt_clear_led_timer); - } bt_set_leds(NO_BLUETOOTH_ACTIVITY); #endif =20 |
From: Peter K. <pk...@us...> - 2001-09-12 12:42:20
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.179 1.180=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Make sure hci_ctrl.nbr_of_connections is 0 when the stack is shutdown. The diff of the modified file(s): --- hci.c 2001/09/12 12:18:34 1.179 +++ hci.c 2001/09/12 12:42:19 1.180 @@ -1938,7 +1938,7 @@ =20=20=20 /* take down any open acl links */ =20 -=09 + hci_ctrl.nbr_of_connections =3D 0; =20 #ifdef USE_NCPTIMER release_ncp_timer(); |
From: Peter K. <pk...@us...> - 2001-09-12 12:38:11
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.194 1.195=20=20=20=20=20=20=20=20=20=20=20 l2cap.c 1.117 1.118=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use hci_ctrl.nbr_of_connections instead of calculating bt_connections for bt_set_leds(). The diff of the modified file(s): --- bluetooth.c 2001/09/10 11:19:57 1.194 +++ bluetooth.c 2001/09/12 12:38:10 1.195 @@ -76,6 +76,7 @@ #include <linux/bluetooth/btcommon.h> #include <linux/bluetooth/btmem.h> #include <linux/bluetooth/hci.h> +#include <linux/bluetooth/hci_internal.h> #include <linux/bluetooth/l2cap.h> #include <linux/bluetooth/rfcomm.h> #include <linux/bluetooth/tcs.h> @@ -251,6 +252,8 @@ =20 /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 +extern hci_controller hci_ctrl; + /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) @@ -2252,14 +2255,10 @@ static void bt_set_leds(int active) { - extern int bt_connections; - int light_leds =3D ((!bt_connections && active =3D=3D BLUETOOTH_ACTIVITY)= || - (bt_connections && active =3D=3D NO_BLUETOOTH_ACTIVITY)); - - if (light_leds) { + if ((!hci_ctrl.nbr_of_connections && active =3D=3D BLUETOOTH_ACTIVITY) || + (hci_ctrl.nbr_of_connections && active =3D=3D NO_BLUETOOTH_ACT= IVITY)) { LED_ACTIVE_SET(bt_dfu_mode(-1) ? LED_ORANGE : LED_GREEN); - } - else { + } else { LED_ACTIVE_SET(LED_OFF); } } --- l2cap.c 2001/09/12 12:12:29 1.117 +++ l2cap.c 2001/09/12 12:38:10 1.118 @@ -247,10 +247,6 @@ =20 /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 -#ifdef __CRIS__ -int bt_connections =3D 0; -#endif - /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 static l2cap_layer l2capmain; /* Main structure */ @@ -275,10 +271,6 @@ init_con_list(); l2cap->cid_count =3D MIN_CID; /* Moved from init_con_list */ =20 -#ifdef __CRIS__ - bt_connections =3D 0; -#endif - /* Set all upper layers to default */ =20 l2cap_protocol_default(&default_protocol); @@ -367,10 +359,6 @@ free_con_list(); remove_all_upper(); =20 -#ifdef __CRIS__ - bt_connections =3D 0; -#endif - /* ALWAYS SUCCESS */ return 0; } @@ -1407,9 +1395,6 @@ con->c_flags &=3D ~FLAG_RETURNNOW; return 0; } -#ifdef __CRIS__ - bt_connections++; -#endif =20=09=09 if (!(con->initiator)) {=09=09 D_STATE("We are server\n"); @@ -1502,13 +1487,6 @@ =20 /* flush old buffers waiting to be sent on this handle */ btmem_flushhandle((u16)con_hdl); - -#ifdef __CRIS__ - if (bt_connections > 0) - bt_connections--; - else - D_ERR(__FUNCTION__ ": bt_connections =3D=3D 0\n"); -#endif =20 return found; } |
From: Peter K. <pk...@us...> - 2001-09-12 12:18:34
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.178 1.179=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Improved load calculation. The diff of the modified file(s): --- hci.c 2001/09/12 12:12:29 1.178 +++ hci.c 2001/09/12 12:18:34 1.179 @@ -2752,14 +2752,11 @@ { static unsigned char load; =20 - /* Makes a rough calculation of the current load */=20 - if ((bt_max_connections =3D=3D hci_ctrl.nbr_of_connections) || - (bt_max_connections =3D=3D 0)) - load =3D 0x07; - else if (bt_max_connections >=3D 4) - load =3D hci_ctrl.nbr_of_connections; + /* Calculate the current load */ + if (!bt_max_connections) + load =3D 7; else - load =3D hci_ctrl.nbr_of_connections*2; + load =3D 7 * hci_ctrl.nbr_of_connections / bt_max_connections; =20 /* Make sure only bit2 to bit0 are used */ load &=3D 0x07; |
From: Peter K. <pk...@us...> - 2001-09-12 12:13:00
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.177 1.178=20=20=20=20=20=20=20=20=20=20=20 l2cap.c 1.116 1.117=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Improved the calculation of the number of active connections. The diff of the modified file(s): --- hci.c 2001/09/10 12:10:56 1.177 +++ hci.c 2001/09/12 12:12:29 1.178 @@ -823,15 +823,16 @@ D_CMD(__FUNCTION__ ": CONNECTION_COMPLETE: %s\n", get_err_msg(buf[0])); =20 - - link_type =3D buf[9]; hci_hdl =3D CHAR2INT12(buf[2], buf[1]); test_hci_hdl =3D hci_hdl; =20 if (link_type =3D=3D ACL_LINK) { + if (lp_connect_cfm(buf + 3, (u32) buf[0], hci_hdl)) { + hci_ctrl.nbr_of_connections++; + hci_update_load_factor(); + } =20 - lp_connect_cfm(buf + 3, (u32) buf[0], hci_hdl); #ifndef HCI_EMULATION if (buf[0]) { /* remove hci handle if connection failed */ @@ -864,8 +865,6 @@ } /* reset variable again */ i_am_initiator =3D 0; - hci_ctrl.nbr_of_connections++; - hci_update_load_factor(); } #endif /* HCI_EMULATION */ =20 @@ -881,6 +880,7 @@ =20=09=09 break; } + case CONNECTION_REQUEST: D_CMD(__FUNCTION__ ": CONNECTION_REQUEST\n"); =20 @@ -898,15 +898,17 @@ release_cmd_timer(); wake_up_interruptible(&hci_wq); =20 - lp_disconnect_ind(CHAR2INT12(buf[2], buf[1])); + if (lp_disconnect_ind(CHAR2INT12(buf[2], buf[1]))) + if (hci_ctrl.nbr_of_connections > 0) { + hci_ctrl.nbr_of_connections--; + hci_update_load_factor(); + } =20 /* FIXME: No more NBR_OF_COMPLETE_PACKETS will arrive for this connection handle, if we only support point-to-point connections we can acl_num by reading the buffersizes again, but this will not work in a multipoint connection. */ =20 - hci_ctrl.nbr_of_connections--; - hci_update_load_factor(); reset_hci_con_bd(CHAR2INT12(buf[2], buf[1])); =20=09=09 if (hci_ctrl.nbr_of_connections <=3D 0) { @@ -1001,12 +1003,11 @@ D_CMD(__FUNCTION__ ": COMMAND_STATUS\n"); =20=09=09 if (buf[0]) {=09=09=09 - - /* fixme -- add parser for command status e.g when trying - to connect an acl link which already is connected, a - command status with "ACL link already exist" is returned=20 - This must be signalled using lp_connect_cfm (neg) - */ + /* fixme -- add parser for command status e.g when + trying to connect an acl link which already is + connected, a command status with "ACL link already + exist" is returned. This must be signalled using + lp_connect_cfm (neg) */ D_ERR(__FUNCTION__ ": COMMAND_STATUS: %s\n", get_err_msg(buf[0])); =20 #ifdef USE_INQTIMER @@ -1018,6 +1019,7 @@ update_nhcp(buf[1]); wake_up_interruptible(&hci_wq); break; + case FLUSH_OCCURRED: D_CMD(__FUNCTION__ ": FLUSH_OCCURRED on hci_hdl %d\n", CHAR2INT12(buf[1],buf[0])); @@ -2795,7 +2797,6 @@ c_pkt.len =3D 3; =20=20=20 return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN= , DEFAULT_TIMEOUT); -=09 } =20 =20 @@ -3340,7 +3341,7 @@ if (cfm) { #ifdef CONFIG_BLUETOOTH_EARLY_MSSWITCH if (force_msswitch) { - DSYS("lp_connect_rsp : early m/s switch\n"); + DSYS(__FUNCTION__ ": Early m/s switch\n"); return accept_connection_request(bd_addr, MS_SWITCH_BECOME_MASTER); } else return accept_connection_request(bd_addr, MS_SWITCH_REMAIN_SLAVE); @@ -3649,7 +3650,11 @@ D_CMD(__FUNCTION__ ": DISCONNECT->disconnection complete\n"); o_len =3D set_discon_cpl_event(out_event, CHAR2INT12(cmd->data[1], cmd-= >data[0]), 0x13); bt_write_lower_driver(o_event, o_len); - lp_disconnect_ind(CHAR2INT12(cmd->data[1],cmd->data[0])); + if (lp_disconnect_ind(CHAR2INT12(cmd->data[1],cmd->data[0]))) + if (hci_ctrl.nbr_of_connections > 0) { + hci_ctrl.nbr_of_connections--; + hci_update_load_factor(); + } break; =20 case ACCEPT_CONNECTION_REQUEST: @@ -3660,7 +3665,10 @@ sleep(1); #endif bt_write_lower_driver(o_event, o_len); - lp_connect_cfm(data + 4, 0, 0); + if (lp_connect_cfm(data + 4, 0, 0)) { + hci_ctrl.nbr_of_connections++; + hci_update_load_factor(); + } break; =20 case REJECT_CONNECTION_REQUEST: --- l2cap.c 2001/09/12 11:45:02 1.116 +++ l2cap.c 2001/09/12 12:12:29 1.117 @@ -1365,7 +1365,7 @@ Confirms the request to establish a baseband connection */ =20=20=20 -void +s32 lp_connect_cfm(u8 *bd_addr, u32 status, u16 con_hdl) { l2cap_con *con; @@ -1388,7 +1388,7 @@ /* search for the corresponding l2cap connection */ if ((con =3D get_con(bd_addr, CLOSED)) =3D=3D NULL) { D_ERR(__FUNCTION__ ": couldn't find l2cap con!\n"); - return; + return 0; } =20 con->c_status =3D status; @@ -1405,7 +1405,7 @@ D_STATE(__FUNCTION__" Return NOW\n"); /* clear flag & set status */ con->c_flags &=3D ~FLAG_RETURNNOW; - return; + return 0; } #ifdef __CRIS__ bt_connections++; @@ -1424,6 +1424,8 @@ =20=09=09=09 l2ca_wakeup(__FUNCTION__, con); } + + return 1; } else { /* neg cfm */ D_STATE(__FUNCTION__ ": (neg) %s\n",get_err_msg(status)); @@ -1433,7 +1435,7 @@ =20=09=09 if (con->c_flags & FLAG_RETURNNOW) { con->c_flags &=3D ~FLAG_RETURNNOW; - return; + return 0; } =20 if (con->initiator) { @@ -1444,14 +1446,17 @@ /* delete connection if non-initiator */ delete_con(con); }=20 + + return 0; } } =20=20 /* Indicates that one of the baseband connections has been shutdown */ -void +s32 lp_disconnect_ind(u32 con_hdl) { l2cap_con *con; + s32 found =3D 0; =20 /* temp link down */ DSYS(__FUNCTION__": Connection handle %d disconnected\n", @@ -1489,6 +1494,8 @@ /* notify upper layers that phys link is down */ get_upper(con->psm)->disc_ind(con); } + + found =3D 1; } =20 D_CON(__FUNCTION__ ": no more l2cap cons on this handle\n"); @@ -1502,6 +1509,8 @@ else D_ERR(__FUNCTION__ ": bt_connections =3D=3D 0\n"); #endif + + return found; } =20 /* FIXME - lp_qos_violation_ind() */ |
From: Peter K. <pk...@us...> - 2001-09-12 12:12:31
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- l2cap.h 1.39 1.40=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Improved the calculation of the number of active connections. The diff of the modified file(s): --- l2cap.h 2001/08/17 09:19:00 1.39 +++ l2cap.h 2001/09/12 12:12:30 1.40 @@ -307,7 +307,7 @@ /****************************/ =20 /* Confirms the request to establish a lower layer (baseband) connection*/ -void lp_connect_cfm(u8 *bd_addr, u32 status, u16 con_hdl); +s32 lp_connect_cfm(u8 *bd_addr, u32 status, u16 con_hdl); =20 /* Indicates the lower protocol has successfully established connection */ void lp_connect_ind(BD_ADDR bd_addr); @@ -316,7 +316,7 @@ void l2cap_create_con(BD_ADDR bd); =20 /* Indicates the baseband has been shutdown */ -void lp_disconnect_ind(u32 con_hdl); +s32 lp_disconnect_ind(u32 con_hdl); =20 /* FIXME - lp_qos_cfm() */ /* FIXME - lp_qos_violation_ind() */ |
From: Peter K. <pk...@us...> - 2001-09-12 11:45:03
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- l2cap.c 1.115 1.116=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Minor clean-up. The diff of the modified file(s): --- l2cap.c 2001/09/11 10:32:28 1.115 +++ l2cap.c 2001/09/12 11:45:02 1.116 @@ -293,9 +293,8 @@ hci_read_local_bd(l2cap->my_bd); =20 /* check result... */ - if ((l2cap->my_bd[0] =3D=3D 0) && (l2cap->my_bd[1] =3D=3D 0) &&=20 - (l2cap->my_bd[2] =3D=3D 0) && (l2cap->my_bd[3] =3D=3D 0) && - (l2cap->my_bd[4] =3D=3D 0) && (l2cap->my_bd[5] =3D=3D 0)) + if (!l2cap->my_bd[0] && !l2cap->my_bd[1] && !l2cap->my_bd[2] && + !l2cap->my_bd[3] && !l2cap->my_bd[4] && !l2cap->my_bd[5]) D_ERR(__FUNCTION__ ": Failed to get local BD addr\n"); else { i =3D l2cap_sprint_bd(bd_name, l2cap->my_bd); @@ -1308,8 +1307,8 @@ PRINTPKT(__FUNCTION__ ": from: ", bd_addr, 6); =20 /* Check BD_ADDR */ - if ((bd_addr[0]=3D=3D0) && (bd_addr[1]=3D=3D0) && (bd_addr[2]=3D= =3D0) && - (bd_addr[3]=3D=3D0) && (bd_addr[4]=3D=3D0) && (bd_addr[5]=3D= =3D0)) { + if (!bd_addr[0] && !bd_addr[1] && !bd_addr[2] && + !bd_addr[3] && !bd_addr[4] && !bd_addr[5]) { D_ERR(__FUNCTION__ ": no BD addr\n"); return; } @@ -1325,10 +1324,8 @@ D_CON(__FUNCTION__ ": Accepting connection\n"); l2cap_create_con(bd_addr); lp_connect_rsp(bd_addr,1); - } - else{ - D_CON(__FUNCTION__ ": Denying connection. Current connections: %d,=20 - max connections: %d\n", hci_ctrl.nbr_of_connections, bt_ma= x_connections); + } else { + D_CON(__FUNCTION__ ": Denying connection. Current connections: %d, max c= onnections: %d\n", hci_ctrl.nbr_of_connections, bt_max_connections); lp_connect_rsp(bd_addr,0); } } @@ -1447,7 +1444,6 @@ /* delete connection if non-initiator */ delete_con(con); }=20 -=09=09 } } =20=20 @@ -1555,8 +1551,7 @@ PRINTPKT(__FUNCTION__ ": sent to bd ",bd, 6); =20 /* Check bd_addr */ - if ((bd[0]=3D=3D0) && (bd[1]=3D=3D0) && (bd[2]=3D=3D0) && (bd[3]=3D=3D0) = && - (bd[4]=3D=3D0) && (bd[5]=3D=3D0)) { + if (!bd[0] && !bd[1] && !bd[2] && !bd[3] && !bd[4] && !bd[5]) { D_ERR(__FUNCTION__ ": No BD-addr\n"); return -EINVAL; } @@ -2895,7 +2890,6 @@ /* wait here until we received a lp_connect_cfm */ l2ca_wait(__FUNCTION__ ": wait baseband", con); =20=09=09 - if (con->c_status =3D=3D RES_SUCCESS) { /* check status */ D_XMIT("Now we got baseband, send echo req !\n"); @@ -2914,6 +2908,7 @@ while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT) { D_XMIT("Sending echo req...\n"); l2cap_echo_req(con, opt_data, len);=09 + /* wait until we received a response or after timeout */ =20 D_XMIT("Waiting for response or timeout\n"); @@ -2955,7 +2950,6 @@ =20 memcpy(con->remote_bd, rev_bd, 6); con->link_up =3D 0; - con->initiator =3D 1; insert_con(con); =20 |
From: Anders J. <and...@us...> - 2001-09-11 10:32:29
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- l2cap.c 1.114 1.115=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Corrected c_status flag in a disconnection response. The diff of the modified file(s): --- l2cap.c 2001/09/11 09:00:28 1.114 +++ l2cap.c 2001/09/11 10:32:28 1.115 @@ -1208,7 +1208,7 @@ return; } =20 - con->c_status =3D conrsp->result;=09 + con->c_status =3D CSTATUS_SUCCESS;=09 =20 #ifdef CONFIG_BLUETOOTH_L2CAP_USE_TIMERS disable_rtx(con); |
From: Anders J. <and...@us...> - 2001-09-11 09:00:30
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- l2cap.c 1.113 1.114=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: *=A0Added retransmission timer on l2ca_disconnect_req. The diff of the modified file(s): --- l2cap.c 2001/08/30 05:37:17 1.113 +++ l2cap.c 2001/09/11 09:00:28 1.114 @@ -1208,6 +1208,8 @@ return; } =20 + con->c_status =3D conrsp->result;=09 + #ifdef CONFIG_BLUETOOTH_L2CAP_USE_TIMERS disable_rtx(con); #endif @@ -1712,22 +1714,23 @@ D_STATE(__FUNCTION__ ": remote cid : %d\n", con->remote_cid); =20 if (con->current_state =3D=3D OPEN || con->current_state =3D=3D CONFIG) { - - result =3D l2cap_disconnect_req(con); - ENTERSTATE(con, W4_L2CAP_DISCONNECT_RSP); PRINTSTATE(con); + do { + result =3D l2cap_disconnect_req(con); + l2ca_wait(__FUNCTION__, con); + PRINTSTATE(con); +=09=09=09 + } while (con->c_status =3D=3D CSTATUS_RTX_TIMEOUT); } else { D_ERR(__FUNCTION__ ": Invalid state!\n"); PRINTSTATE(con); return -1;=20=20=20=20 } =20=09 - /* wait here until we get a confirm */ - l2ca_wait(__FUNCTION__, con); - result =3D con->c_result; =20 + if(con->c_status !=3D CSTATUS_MAX_NO_RTX) { if (con->current_state =3D=3D CLOSED) {=09 /* remove l2cap connection */ delete_con(con); @@ -1735,6 +1738,8 @@ D_ERR("L2CAP Disconnect failed\n"); PRINTSTATE(con); } + } +=09 =20=09 /* fixme -- if we want to keep baseband connection we must=20 leave the l2cap connection which holds the hci handle=20 |
From: Peter K. <pk...@us...> - 2001-09-10 15:32:56
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- rfcomm_sec.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added missing include of bluetooth.h (for user mode). The diff of the modified file(s): --- rfcomm_sec.c 2001/02/27 11:32:19 1.8 +++ rfcomm_sec.c 2001/09/10 15:32:55 1.9 @@ -58,6 +58,7 @@ #include <string.h> #include <sys/time.h> #include <signal.h> +#include "include/bluetooth.h" #include "include/l2cap.h" #include "include/rfcomm.h" #include "include/rfcomm_internal.h" |
From: Anders J. <and...@us...> - 2001-09-10 12:26:02
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bttest.c 1.19 1.20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added test_case_enable_disconnect and test_case_disable_disconnect. The diff of the modified file(s): --- bttest.c 2001/08/22 17:48:12 1.19 +++ bttest.c 2001/09/10 12:26:01 1.20 @@ -290,6 +290,7 @@ int btfd; char dev[20]; sprintf(dev, "/dev/ttyBT%d", line); + btfd =3D open(dev, O_RDWR | O_NOCTTY); =20 if (btfd > 0) @@ -547,6 +548,16 @@ hotlist[i][0], hotlist[i][1], hotlist[i][2], hotlist[i][3], h= otlist[i][4], hotlist[i][5]); } } + else if(strcmp(buf, "test_case_disable_disconnect") =3D=3D 0) + { + printf("Disabling sending of disconnect respons\n"); + bt_testcmd(bt_cfd, buf); + } + else if(strcmp(buf, "test_case_enable_disconnect") =3D=3D 0) + { + printf("Enabling sending of disconnect respons\n"); + bt_testcmd(bt_cfd, buf); + }=20=20=20 else { printf("> error: command not recognized or wrong syntax\n"); |
From: Anders J. <and...@us...> - 2001-09-10 12:24:11
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- test.c 1.26 1.27=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added test case to disable/enable respons of an incoming disconnect reque= st. The diff of the modified file(s): --- test.c 2001/08/27 15:20:41 1.26 +++ test.c 2001/09/10 12:24:10 1.27 @@ -132,6 +132,7 @@ s32 dont_send_config_req =3D 0; s32 use_multiple_conf_params =3D 0; s32 disable_testpsm =3D 0; +s32 dont_send_disconnect_rsp =3D 0; =20 u8 testdata[UPTEST_DATA_LEN]; =20 @@ -387,9 +388,10 @@ { D_STATE("test_disconnect_ind : (%d:%d)\n",=20 con->local_cid, con->remote_cid); - + if(!dont_send_disconnect_rsp) { l2ca_disconnect_rsp(con); } +} =20 void test_disconnect_cfm(l2cap_con *con) { @@ -445,18 +447,7 @@ int testcase, tmp[10], i; unsigned char bd[6], char_buf[4]; char_buf[3] =3D 0; - - if(strncmp(cmd, "t ", 2) =3D=3D 0) { - testcase =3D strtoul(cmd+2, NULL, 0); - - if (testcase > 0) { - process_test_cmd(testcase); - } - else { - printk("test_process_cmd: Couldn't parse testcase\n"); - } - } - else if(!strncmp(cmd, "bb_conn ", 8)) { + if(!strncmp(cmd, "bb_conn ", 8)) { char *p =3D cmd + 8; =20=09=09 for (i =3D 0; i < 6; i++) { @@ -472,6 +463,16 @@ l2cap_create_con(bd); lp_connect_req(bd); } + else if(strncmp(cmd, "t ", 2) =3D=3D 0) { + testcase =3D strtoul(cmd+2, NULL, 0); + + if (testcase > 0) { + process_test_cmd(testcase); + } + else { + printk("test_process_cmd: Couldn't parse testcase\n"); + } + } else if(!strncmp(cmd, "bb_disc ", 8)) { int i =3D strtoul(cmd+8, NULL, 0); lp_disconnect((unsigned short)i); @@ -514,6 +515,10 @@ } else if(!strncmp(cmd, "sdptest ", 8)) { int n =3D strtoul(cmd+8, NULL, 0);=09 do_sdp_test(n); + } else if(!strcmp(cmd, "test_case_disable_disconnect")) { + dont_send_disconnect_rsp =3D 1; + } else if(!strcmp(cmd, "test_case_enable_disconnect")) { + dont_send_disconnect_rsp =3D 0; } else { printk("Unknown test cmd!\n"); } @@ -523,4 +528,4 @@ #endif } =20 -/****************** END OF FILE sdp.c ************************************= ***/ +/****************** END OF FILE test.c ***********************************= ****/ |
From: Peter K. <pk...@us...> - 2001-09-10 12:10:57
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.176 1.177=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Fixed a typo (simultanious -> simultaneous). The diff of the modified file(s): --- hci.c 2001/09/10 11:19:57 1.176 +++ hci.c 2001/09/10 12:10:56 1.177 @@ -2743,7 +2743,7 @@ =20 /* Change the 3-bit load factor (all bits set is max load, all zero is min= load). * Renew load factor if: Any client is connected, disconnected or if the - * maximum amount of simultanious connections is altered.=20 + * maximum number of simultaneous connections is altered.=20 */=20 s32 hci_update_load_factor(void) |
From: Peter K. <pk...@us...> - 2001-09-10 12:01:19
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btconfig.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Cleaned up setting of max number of connections. The diff of the modified file(s): --- btconfig.c 2001/09/10 09:41:50 1.6 +++ btconfig.c 2001/09/10 12:01:18 1.7 @@ -77,8 +77,6 @@ #define HOST_NAME_LENGTH 100 #define DOMAIN_NAME_LENGTH 100 #define BUF_MAXSIZE 300 -#define MIN_CONNECTIONS 0 -#define MAX_CONNECTIONS 7 =20 #define CONF_FILE "/etc/bt.conf" =20 @@ -232,13 +230,9 @@ bt_force_msswitch_as_server(bt_cfd, var_force_ms_switch); =20 /* Configure Max BT connections */ - if (var_max_connections >=3D MIN_CONNECTIONS && var_max_connections <= =3D MAX_CONNECTIONS ) - { - syslog(LOG_INFO, __FUNCTION__": Setting Max BT connections to %d",va= r_max_connections); + if (var_max_connections >=3D 0) bt_set_max_conections(bt_cfd, var_max_connections); - } - else - syslog(LOG_INFO, __FUNCTION__": Max BT connections, %d, out of range= !",var_max_connections); + close(bt_cfd); } =20 @@ -454,7 +448,6 @@ D(syslog(LOG_INFO, __FUNCTION__ ": Force M/S switch: %s", (var_force_ms_switch ? "yes" : "no"))); } -=20=20 else if (!strcasecmp(field, "MaxBTConnections"))=20=20 {=20 var_max_connections =3D atoi(value); |
From: Peter K. <pk...@us...> - 2001-09-10 11:59:55
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.33 1.34=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made bt_set_max_conections() return -1 if it failed. The diff of the modified file(s): --- bt_if.c 2001/09/07 12:53:50 1.33 +++ bt_if.c 2001/09/10 11:59:54 1.34 @@ -621,36 +621,45 @@ =20 int bt_force_msswitch_as_server(int bt_cfd, int enable) { - int ret_val; - syslog(LOG_INFO, __FUNCTION__ ": %d", enable); #ifndef BT_USERSTACK=20 - if ((ret_val =3D ioctl(bt_cfd, BTSETMSSWITCH, &enable)) < 0) + if (ioctl(bt_cfd, BTSETMSSWITCH, &enable) < 0) { - fprintf(stderr, __FUNCTION__ ": %s\n", error_msg(ret_val)); + perror(__FUNCTION__); + return -1; } #else hci_force_msswitch(enable); #endif - return ret_val; + return 0; } =20 int bt_set_max_conections(int bt_cfd, int connections) { - int ret_val; - syslog(LOG_INFO, __FUNCTION__ ": %d", connections); #ifndef BT_USERSTACK=20 - if ((ret_val =3D ioctl(bt_cfd, BTSETMAXCONNECTIONS, &connections)) < 0) + if (ioctl(bt_cfd, BTSETMAXCONNECTIONS, &connections) < 0) { - fprintf(stderr, __FUNCTION__ ": %s\n", error_msg(ret_val)); + perror(__FUNCTION__); + return -1; } + + return 0; #else - printf(__FUNCTION__": not implemented in userstack mode!\n" -#endif + { + int ret_val =3D hci_set_max_connections(connections); + + if (ret_val >=3D 0) + { return ret_val; } =20 + errno =3D -ret_val; + return -1; + } +#endif +} + /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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 functions */ =20 |
From: Peter K. <pk...@us...> - 2001-09-10 11:20:28
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.193 1.194=20=20=20=20=20=20=20=20=20=20=20 hci.c 1.175 1.176=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made hci_set_max_connections() resturn a result. The diff of the modified file(s): --- bluetooth.c 2001/09/10 11:17:11 1.193 +++ bluetooth.c 2001/09/10 11:19:57 1.194 @@ -1079,17 +1079,10 @@ =20 /* Set max number of connections */ case BTSETMAXCONNECTIONS: - { - u8 max_connections; - GET_USER(tmp, (s32*)arg); =20 - max_connections =3D (u8)(tmp & 0xff); - - BT_DRIVER("BTSETMAXCONNECTIONS: %d\n", max_connections); - hci_set_max_connections(max_connections); - return 0; - } + BT_DRIVER("BTSETMAXCONNECTIONS: %d\n", tmp); + return hci_set_max_connections(tmp); =20 case BTSETBCSPMODE: GET_USER(tmp, (s32*)arg); --- hci.c 2001/09/07 12:53:24 1.175 +++ hci.c 2001/09/10 11:19:57 1.176 @@ -2728,12 +2728,16 @@ } =20 =20 -void -hci_set_max_connections(u8 max_connections) +s32 +hci_set_max_connections(s32 max_connections) { - bt_max_connections =3D (int)max_connections; + if (max_connections < 0 || max_connections > 7) + return -EINVAL; +=20=20 + bt_max_connections =3D max_connections; DSYS("Setting max BT connections to %d\n", bt_max_connections); hci_update_load_factor(); + return 0; } =20 =20 |
From: Peter K. <pk...@us...> - 2001-09-10 11:19:58
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.h 1.68 1.69=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made hci_set_max_connections() resturn a result. The diff of the modified file(s): --- hci.h 2001/09/10 10:16:22 1.68 +++ hci.h 2001/09/10 11:19:57 1.69 @@ -100,7 +100,7 @@ void hci_receive_data(u8* data, u32 count); s32 hci_send_data(bt_tx_buf *tx_buf); =20 -void hci_set_max_connections(u8 max_connections); +s32 hci_set_max_connections(s32 max_connections); =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP void hci_receive_event(u8 *data, s32 count); |
From: Peter K. <pk...@us...> - 2001-09-10 11:17:12
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.192 1.193=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Clean-up (basically use of __FUNCTION__ for debug messages, and a rewrite of bt_reset_phys_hw()). The diff of the modified file(s): --- bluetooth.c 2001/09/07 12:53:24 1.192 +++ bluetooth.c 2001/09/10 11:17:11 1.193 @@ -414,7 +414,7 @@ s32 line =3D GET_TTYLINE(tty); s32 ret_val; =20=09 - BT_DRIVER("bt_open on line %d\n", line);=09 + BT_DRIVER(__FUNCTION__ ": Line %d\n", line);=09 =20=09 ret_val =3D bt_register_tty(tty) ; =20 @@ -432,7 +432,7 @@ { s32 line =3D GET_TTYLINE(tty); =20 - BT_DRIVER("bt_close on line %d\n", line); + BT_DRIVER(__FUNCTION__ ": Line %d\n", line); =20 /* FIXME - flush channels etc */ /* close rfcomm channel associated with this tty ?? */ @@ -446,14 +446,14 @@ static void bt_put_char(struct tty_struct *tty, u8 ch) { - BT_DRIVER("bt_put_char %c\n", ch); + BT_DRIVER(__FUNCTION__ ": %c\n", ch); bt_write_top(tty, 0, &ch, 1); } =20 static void bt_flush_chars(struct tty_struct *tty) { - BT_DRIVER("bt_flush_chars\n"); + BT_DRIVER(__FUNCTION__ "\n"); if (sertty !=3D NULL && sertty->driver.flush_chars) sertty->driver.flush_chars(sertty); } @@ -464,7 +464,7 @@ { s32 n =3D buf_write_room(); =20 - BT_DRIVER("bt_write_room : %d\n", n); + BT_DRIVER(__FUNCTION__ ": %d\n", n); return n; } =20 @@ -473,7 +473,7 @@ { u16 n =3D buf_byte_count(GET_TTYLINE(tty)); =20 - BT_DRIVER("bt_chars_in_buffer : %d\n", n); + BT_DRIVER(__FUNCTION__ ": %d\n", n); return n; } =20 @@ -482,7 +482,7 @@ { /* Clearing the buffers here may lead to them being cleared before they are sent when diconnecting a connection */ - BT_DRIVER("bt_flush_buffer, ignored\n"); + BT_DRIVER(__FUNCTION__ ": Ignored\n"); #if 0 bt_tx_buf* tx_buf; while ((tx_buf =3D get_bt_buf())) { @@ -496,7 +496,6 @@ __bt_ioctl(struct tty_struct *tty, struct file * file, u32 cmd, unsigned long arg) { -#define FNC "bt_ioctl: " s32 tmp; u32 utmp; s32 err =3D 0; @@ -533,55 +532,54 @@ =20 /* Copy arguments to kernel space */ =20 - BT_DRIVER(FNC"Copying arguments from user to kernel space\n"); + BT_DRIVER(__FUNCTION__ ": Copying arguments from user to kernel space\n"= ); copy_from_user(&sdpRequest, (s32*)arg, size); =20=09=09 /* Now execute the request */ =20 - BT_DRIVER(FNC"Executing bt_execute_sdp_request\n"); + BT_DRIVER(__FUNCTION__ ": Executing bt_execute_sdp_request\n"); =20 if ((returnValue =3D bt_execute_sdp_request(&sdpRequest)) >=3D 0) { =20 /* Copy the data back to user space and return */ =20 - BT_DRIVER(FNC"Copying data back to user space\n"); + BT_DRIVER(__FUNCTION__ ": Copying data back to user space\n"); copy_to_user((s32*)arg, &sdpRequest, size); } =20 return returnValue; } + #ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER=20=20 case BT_GETCACHEDLINKKEY: { unsigned char link_key_info[6 + 16]; =20 /* Now execute the request */ - BT_DRIVER(FNC"Executing sec_man_get_cached_link_key\n"); + BT_DRIVER(__FUNCTION__ ": Executing sec_man_get_cached_link_key\n"); =20 sec_man_get_cached_link_key(link_key_info); =20 - BT_DRIVER(FNC"Copying data back to user space\n"); + BT_DRIVER(__FUNCTION__ ": Copying data back to user space\n"); copy_to_user((s32*)arg, link_key_info, 6 + 16); =20 return 0; } #endif=20=20=20=20=20=20=20=20 + case BTCONNECT:=20 - { /* argument is an object with all info to start a remote=20 connection */ - copy_from_user(&btcon, (s32*)arg, size); =20 - BT_DRIVER(FNC"BTCONNECT\n"); -=09=09=09=20=20=20=20=20=20=20 + BT_DRIVER(__FUNCTION__ ": BTCONNECT\n"); return bt_connect(btcon.bd, btcon.id); - } =20=09 case BTDISCONNECT: { s32 con_id; - BT_DRIVER(FNC"BTDISCONNECT\n"); + + BT_DRIVER(__FUNCTION__ ": BTDISCONNECT\n"); copy_from_user(&con_id, (s32*)arg, size); return bt_disconnect(con_id); } @@ -589,6 +587,7 @@ case BTWAITFORCONNECTION: { s32 line; + copy_from_user(&line, (s32*)arg, size); =20 /* check if we already have a connection otherwise wait... */ @@ -604,23 +603,21 @@ } =20=09 case BTWAITNEWCONNECTIONS: - { /* wait for any new connections coming in */ BT_DRIVER("Waiting for new connections\n"); interruptible_sleep_on(&bt_ctrl.any_wq); break; - } =20 case BTISLOWERCONNECTED: { s32 line;=09=20=20 + copy_from_user(&line, (s32*)arg, size); return (SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED); } =20=09 case BTINITSTACK: return bt_init_stack(); - break; =20 case BTSHUTDOWN: bt_shutdown(); @@ -632,7 +629,7 @@ s32 line;=09=20=20 u16 i; =20 - BT_DRIVER(FNC"BTREADREMOTEBDADDR\n"); + BT_DRIVER(__FUNCTION__ ": BTREADREMOTEBDADDR\n"); =20 copy_from_user(&line, (s32*)arg, size); =20 @@ -659,7 +656,7 @@ break; =20 case BTFIRMWAREINFO: - BT_DRIVER(FNC"BTFIRMWAREINFO\n"); + BT_DRIVER(__FUNCTION__ ": BTFIRMWAREINFO\n"); copy_to_user((u8*)arg, bt_hw_firmware(), strlen(bt_hw_firmware())+1); break; =20 @@ -672,6 +669,7 @@ case HCITESTCONNECTREQ: { u8 bd[6]; + copy_from_user(bd, (s32*)arg, 6); return hci_test_connect_req(bd); } @@ -698,7 +696,7 @@ u8 lap[3]; int ret; =20=09=09 - BT_DRIVER(FNC"HCINQUIRY\n"); + BT_DRIVER(__FUNCTION__ ": HCINQUIRY\n"); =20=09=09 copy_from_user(in_param, (s32*)arg, 8); =20 @@ -728,7 +726,7 @@ u8 param[size]; s32 result; =20=09=09 - BT_DRIVER(FNC"HCILINKKEYREPLY\n"); + BT_DRIVER(__FUNCTION__ ": HCILINKKEYREPLY\n"); copy_from_user(param, (s32*)arg, size); /* First part of param contains BD address, last part link key, see Bluetooth specification for more info*/ @@ -742,7 +740,7 @@ u8 bd_addr[size]; s32 result; =20=09=09 - BT_DRIVER(FNC"HCILINKKEYNEGATIVEREPLY\n"); + BT_DRIVER(__FUNCTION__ ": HCILINKKEYNEGATIVEREPLY\n"); copy_from_user(bd_addr, (s32*)arg, size); result =3D hci_link_key_request_negative_reply(bd_addr); put_user(result, (s32*)arg); @@ -754,7 +752,7 @@ u8 param[size]; s32 result; =20=09=09 - BT_DRIVER(FNC"HCIPINCODEREPLY\n"); + BT_DRIVER(__FUNCTION__ ": HCIPINCODEREPLY\n"); copy_from_user(param, (s32*)arg, size); /* First part of param contains BD address, second part of the pin code, and the last part och the pin code length */ @@ -768,7 +766,7 @@ u8 bd_addr[size]; s32 result; =20=09=09 - BT_DRIVER(FNC"HCIPINCODENEGATIVEREPLY\n"); + BT_DRIVER(__FUNCTION__ ": HCIPINCODENEGATIVEREPLY\n"); copy_from_user(bd_addr, (s32*)arg, size); result =3D hci_pin_code_request_negative_reply(bd_addr); put_user(result, (s32*)arg); @@ -779,7 +777,7 @@ { u8 bd_addr[size]; =20=09=09 - BT_DRIVER(FNC"HCIAUTHENTICATION_REQUESTED\n"); + BT_DRIVER(__FUNCTION__ ": HCIAUTHENTICATION_REQUESTED\n"); copy_from_user(bd_addr, (s32*)arg, size); hci_authentication_requested_bd(bd_addr); break; @@ -789,7 +787,7 @@ { u8 param[7]; =20=09=09=09=09 - BT_DRIVER(FNC"HCISETCONNECTION_ENCRYPTION\n"); + BT_DRIVER(__FUNCTION__ ": HCISETCONNECTION_ENCRYPTION\n"); copy_from_user(param, (s32*)arg, size); hci_set_connection_encryption_bd(param + 1, *param); break; @@ -799,6 +797,7 @@ case HCISWITCHROLE: { u8 param[size]; + copy_from_user(param, (s32*)arg, size); =20=09=09 hci_switch_role(¶m[0], param[6]); @@ -817,7 +816,8 @@ case HCICREATE_NEW_UNIT_KEY: { s32 result; - BT_DRIVER(FNC"HCICREATE_NEW_UNIT_KEY\n"); + + BT_DRIVER(__FUNCTION__ ": HCICREATE_NEW_UNIT_KEY\n"); result =3D hci_create_new_unit_link_key(); put_user(result, (s32*)arg); break; @@ -828,7 +828,7 @@ s32 result; u8 param[size]; =20 - BT_DRIVER(FNC"HCIREADSTOREDLINKKEY\n"); + BT_DRIVER(__FUNCTION__ ": HCIREADSTOREDLINKKEY\n"); copy_from_user(param, (s32*)arg, size); =20 result =3D hci_read_stored_link_key(param + 1, *param); @@ -841,7 +841,7 @@ s32 result; u8 param[size]; =20=09=09 - BT_DRIVER(FNC"HCIWRITESTOREDLINKKEY\n"); + BT_DRIVER(__FUNCTION__ ": HCIWRITESTOREDLINKKEY\n"); copy_from_user(param, (s32*)arg, size); =20=09=09 result =3D hci_write_stored_link_key(param, param + 6); @@ -854,7 +854,7 @@ s32 result; u8 param[size]; =20 - BT_DRIVER(FNC"HCIDELETESTOREDLINKKEY\n"); + BT_DRIVER(__FUNCTION__ ": HCIDELETESTOREDLINKKEY\n"); copy_from_user(param, (s32*)arg, size); =20 result =3D hci_delete_stored_link_key(param + 1, *param); @@ -867,7 +867,8 @@ /* 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"); + + BT_DRIVER(__FUNCTION__ ": HCISETLOCALNAME\n"); copy_from_user(local_name, (s32*)arg, 248); hci_change_local_name(local_name); break; @@ -888,6 +889,7 @@ case HCIWRITEPAGESCANACTIVITY: { u32 par[2]; + copy_from_user(&par, (s32*)arg, size); BT_DRIVER("Setting write page scan activity : [0x%x,0x%x]\n",=20 par[0], par[1]); @@ -898,7 +900,8 @@ case HCIWRITECLASSOFDEVICE: { u8 class_of_device[3]; - BT_DRIVER(FNC"HCIWRITECLASSOFDEVICE\n"); + + BT_DRIVER(__FUNCTION__ ": HCIWRITECLASSOFDEVICE\n"); copy_from_user(class_of_device, (s32*)arg, size); hci_write_class_of_device(class_of_device); break; @@ -907,7 +910,8 @@ case HCIREAD_AUTHENTICATION_ENABLE: { s32 result =3D hci_read_authentication_enable(); - BT_DRIVER(FNC"HCIREAD_AUTHENTICATION_ENABLE\n"); + + BT_DRIVER(__FUNCTION__ ": HCIREAD_AUTHENTICATION_ENABLE\n"); put_user(result, (s32*)arg); break; } @@ -916,7 +920,8 @@ { u8 enable; s32 result =3D 0; - BT_DRIVER(FNC"HCIWRITE_AUTHENTICATION_ENABLE\n"); + + BT_DRIVER(__FUNCTION__ ": HCIWRITE_AUTHENTICATION_ENABLE\n"); GET_USER(tmp, (s32*)arg); =20 enable =3D (u8)(tmp & 0xff); @@ -928,7 +933,8 @@ case HCIREAD_ENCRYPTION_MODE: { s32 result =3D hci_read_encryption_mode(); - BT_DRIVER(FNC"HCIREAD_ENCRYPTION_MODE\n"); + + BT_DRIVER(__FUNCTION__ ": HCIREAD_ENCRYPTION_MODE\n"); put_user(result, (s32*)arg); break; } @@ -937,7 +943,8 @@ { u8 enable; s32 result =3D 0; - BT_DRIVER(FNC"HCIWRITE_ENCRYPTION_MODE\n"); + + BT_DRIVER(__FUNCTION__ ": HCIWRITE_ENCRYPTION_MODE\n"); GET_USER(tmp, (s32*)arg); =20 enable =3D (u8)(tmp & 0xff); @@ -950,7 +957,8 @@ case HCISET_EVENT_FILTER: { u8 param[size]; - BT_DRIVER(FNC"HCISET_EVENT_FILTER\n"); + + BT_DRIVER(__FUNCTION__ ": HCISET_EVENT_FILTER\n"); copy_from_user(param, (s32*)arg, size); =20=09=09 hci_set_event_filter(param); @@ -960,23 +968,24 @@ /* Informational Parameters */ =20 case HCIREADLOCALBDADDR: - BT_DRIVER(FNC"HCIREADLOCALBDADDR\n"); -=09=09 - hci_read_local_bd(bd_addr); - { BD_ADDR rev_bd; u16 i; + + BT_DRIVER(__FUNCTION__ ": HCIREADLOCALBDADDR\n"); +=09=09 + hci_read_local_bd(bd_addr); + /* return as big endian */ for (i =3D 0; i < 6; i++) { rev_bd[5-i] =3D bd_addr[i]; } copy_to_user((s32*)arg, rev_bd, 6); - } break; + } =20 case HCIREADCOUNTRYCODE: - BT_DRIVER(FNC"HCIREADCOUNTRYCODEn"); + BT_DRIVER(__FUNCTION__ ": HCIREADCOUNTRYCODE\n"); =20=09=09 tmp =3D hci_read_country_code(); put_user(tmp, (s32*) arg); @@ -995,16 +1004,17 @@ 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); + BT_DRIVER(__FUNCTION__ ": Setting baudrate in host controller to %d\n", = tmp); tmp =3D hci_set_baudrate(tmp); return tmp; } =20=09 case HCIWRITEBDADDR: copy_from_user(&bd_addr, (s32*)arg, size); - BT_DRIVER(FNC"Setting BD_ADDR to \n"); + BT_DRIVER(__FUNCTION__ ": Setting BD_ADDR to\n"); print_data("bd :",(u8*)bd_addr,6); hci_set_bd_addr(bd_addr); break; @@ -1048,7 +1058,7 @@ copy_from_user(&bd, (u8*)arg, 6); copy_from_user(&type, (u8*)arg + 6, 2); =20 - BT_DRIVER("l2ca_getinfo : type %d\n", type); + BT_DRIVER("BTGETINFO: Type %d\n", type); =20=09=09 return l2ca_getinfo(bd, type); } @@ -1082,16 +1092,13 @@ } =20 case BTSETBCSPMODE: - { GET_USER(tmp, (s32*)arg); =20 BT_DRIVER("BTSETBCSPMODE: %d\n", tmp); =20=09=09 tmp =3D bt_use_bcsp(tmp); put_user(tmp, (s32*)arg); - return 0; - } =20 #ifdef CONFIG_BLUETOOTH_CSR /* | ps_key (u16) | rw_mode (u16) | len (u16) | params (u16[])| */ @@ -1111,26 +1118,21 @@ =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP case BTINITBCSP: - { BT_DRIVER("BTINITBCSP\n"); if (bcsp_init() < 0) { printk("Sync failed\n"); return -ETIMEDOUT; } return 0; - } =20 case BT_SET_DFU_MODE: - { GET_USER(tmp, (s32*)arg); =20 BT_DRIVER("BT_SET_DFU_MODE: %d\n", tmp); =20 tmp =3D bt_dfu_mode(tmp); put_user(tmp, (s32*)arg); - return 0; - } =20 case BT_SEND_DFU_COMMAND: { @@ -1174,10 +1176,9 @@ =20 default:=09=09 return -ENOIOCTLCMD; - } + return 0; -#undef FNC } =20 static s32 @@ -1186,9 +1187,9 @@ { s32 tmp; =20 -// printk(__FUNCTION__"[%s:%x] lock !\n", current->comm, cmd); +// printk(__FUNCTION__ ": [%s:%x] lock !\n", current->comm, cmd); down(&ioctl_sem); -// printk(__FUNCTION__"[%s:%x] running...\n", current->comm, cmd); +// printk(__FUNCTION__ ": [%s:%x] running...\n", current->comm, cmd); tmp =3D __bt_ioctl(tty, file, cmd, arg); up(&ioctl_sem); return tmp; @@ -1197,43 +1198,43 @@ static void bt_throttle(struct tty_struct * tty) { - BT_DRIVER("bt_throttle (nothing done)\n"); + BT_DRIVER(__FUNCTION__ ": Nothing done\n"); } =20 static void bt_unthrottle(struct tty_struct * tty) { - BT_DRIVER("bt_unthrottle (nothing done)\n"); + BT_DRIVER(__FUNCTION__ ": Nothing done\n"); } =20 =20 static void bt_set_termios(struct tty_struct *tty, struct termios *old_termios) { - BT_DRIVER("bt_set_termios - forwarding to serial driver\n"); + BT_DRIVER(__FUNCTION__ ": Forwarding to serial driver\n"); =20 /* modify serial tty not bt tty */ if (sertty !=3D NULL) sertty->driver.set_termios(sertty, old_termios); else - D_ERR("bt_set_termios : no sertty set !!\n"); + D_ERR(__FUNCTION__ ": No sertty set!!\n"); } =20 static void bt_start(struct tty_struct *tty) { - BT_DRIVER("bt_start (nothing done)\n"); + BT_DRIVER(__FUNCTION__ ": Nothing done\n"); } =20 static void bt_stop(struct tty_struct *tty) { - BT_DRIVER("bt_stop (nothing done)\n"); + BT_DRIVER(__FUNCTION__ ": Nothing done\n"); } =20 void bt_hangup(struct tty_struct *tty) { - BT_DRIVER("bt_hangup on line %d (nothing done) pid %d (%s)\n", + BT_DRIVER(__FUNCTION__ ": Line %d (nothing done) pid %d (%s)\n", GET_TTYLINE(tty), current->pid, current->comm); } =20 @@ -1260,7 +1261,7 @@ #endif { /* should not read data directly over serial tty */ - BT_LDISC("bt_tty_read (disabled)\n"); + BT_LDISC(__FUNCTION__ ": Disabled\n"); return 0; } =20 @@ -1282,7 +1283,7 @@ { /* should simply discard data since ttySx only exists for internal use */ - BT_LDISC("bt_tty_write (%d) done !x\n", count); + BT_LDISC(__FUNCTION__ ": (%d) done!\n", count); =20=20=20 return tty->driver.write(tty, 1/*from user*/, data, count); } @@ -1292,19 +1293,15 @@ bt_tty_ioctl(struct tty_struct *tty, struct file * file, u32 cmd, unsigned long arg) { -#define FNC "bt_tty_ioctl: " - switch (cmd) { - default: /* forward rest to n_tty line discipline, it takes care of termios settings etc, the rest goes to the tty driver=20 (serial driver) */ - BT_LDISC(FNC"forwarding ioctl 0x%x to n_tty line disc\n", cmd); + BT_LDISC(__FUNCTION__ ": Forwarding ioctl 0x%x to n_tty line disc\n", cm= d); return n_tty_ioctl(tty, file, cmd, arg); } return -ENOIOCTLCMD; -#undef FNC } =20 #ifdef __USE_OLD_SYMTAB__ @@ -1315,7 +1312,7 @@ bt_tty_select(struct tty_struct *tty, struct inode *inode, struct file *filp, s32 sel_type, select_table * wait) { - BT_LDISC("bt_tty_select (nothing done!)\n"); + BT_LDISC(__FUNCTION__ ": Nothing done!\n"); return 0; } #else @@ -1326,7 +1323,7 @@ struct file *file, struct poll_table_struct *wait) { - BT_LDISC("bt_tty_poll (nothing done!)\n"); + BT_LDISC(__FUNCTION__ ": Nothing done!\n"); return 0; } #endif @@ -1334,7 +1331,7 @@ static s32 bt_tty_open(struct tty_struct *tty) { - BT_LDISC("bt_tty_open\n"); + BT_LDISC(__FUNCTION__ "\n"); DSYS("Setting BT driver to use serial tty\n"); sertty =3D tty; return 0; @@ -1374,7 +1371,7 @@ static s32 bt_tty_room(struct tty_struct *tty) { - BT_LDISC("bt_tty_room (return 65536 !)\n"); + BT_LDISC(__FUNCTION__ ": Return 65536!\n"); return 65536; /* We can handle an infinite amount of data. :-) */ } =20 @@ -1386,75 +1383,44 @@ static void bt_tty_wakeup(struct tty_struct *tty) { - printk("bt_tty_wakeup : not done\n"); + printk(__FUNCTION__ ": Nothing done\n"); } =20 void bt_reset_phys_hw(void) { -#define FNC __FUNCTION__": "=09 #ifdef __CRIS__ -=09 #ifdef CONFIG_BLUETOOTH_CSR -#define CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH + int do_reset =3D 1; #else -#undef CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH + int do_reset =3D 0; #endif =20 #if defined(CONFIG_BLUETOOTH_RESET_PA7) -#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) - BT_DRIVER(FNC"Resetting hardware (PA7) Active High\n"); - REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 1); - udelay(1000); - REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 0); -#else - BT_DRIVER(FNC"Resetting hardware (PA7) Active Low\n"); - REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 0); + BT_DRIVER(__FUNCTION__ ": Resetting Bluetooth hardware using pin PA7 (Act= ive %s)\n", (do_reset ? "High" : "Low")); + REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, do_reset); udelay(1000); - REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 1); -#endif + REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, !do_reset); #elif defined(CONFIG_BLUETOOTH_RESET_PB5) -#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) - BT_DRIVER(FNC"Resetting hardware (PB5) Active High\n"); - REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 1); - udelay(1000); - REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 0); -#else - BT_DRIVER(FNC"Resetting hardware (PB5) Active Low\n"); - REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 0); + BT_DRIVER(__FUNCTION__ ": Resetting Bluetooth hardware using pin PB5 (Act= ive %s)\n", (do_reset ? "High" : "Low")); + REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, do_reset); udelay(1000); - REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 1); -#endif + REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, !do_reset); #elif defined(CONFIG_BLUETOOTH_RESET_G10) -#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) - BT_DRIVER(FNC"Resetting hardware (G10) Active High\n"); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 1); - udelay(1000); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 0); -#else - BT_DRIVER(FNC"Resetting hardware (G10) Active Low\n "); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 0); + BT_DRIVER(__FUNCTION__ ": Resetting Bluetooth hardware using pin G10 (Act= ive %s)\n", (do_reset ? "High" : "Low")); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, do_reset); udelay(1000); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 1); -#endif + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, !do_reset); #elif defined(CONFIG_BLUETOOTH_RESET_G11) -#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) - BT_DRIVER(FNC"Resetting hardware (G11) Active High\n"); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 1); - udelay(1000); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 0); -#else - BT_DRIVER(FNC"Resetting hardware (G11) Active Low\n "); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 0); + BT_DRIVER(__FUNCTION__ ": Resetting Bluetooth hardware using pin G11 (Act= ive %s)\n", (do_reset ? "High" : "Low")); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, do_reset); udelay(1000); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 1); -#endif + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, !do_reset); #else - D_ERR(FNC"Resetting hardware : No reset pin defined\n"); + D_ERR(__FUNCTION__ ": Resetting Bluetooth hardware: No reset pin defined\= n"); #endif #else - BT_DRIVER(FNC"Do not know how to reset the bluetooth hardware!\n"); -#endif -#undef FNC + BT_DRIVER(__FUNCTION__ ": Do not know how to reset the Bluetooth hardware= !\n"); +#endif /* __CRIS__ */ } =20 /************************/ @@ -1462,8 +1428,7 @@ /************************/ =20 /* - * HCI calls this function to write to lower layer=20 - * driver + * HCI calls this function to write to lower layer driver */ =20 s32 @@ -1480,10 +1445,8 @@ bt_write_lower_driver_real(u8 *data, s32 len) #endif { -#define FNC "bt_write_lower_driver: " - if (len < 0) { /* (!) */ - D_ERR("Can't write neg length...\n"); + D_ERR(__FUNCTION__ ": Can't write negative length...\n"); return 0; } =20=09 @@ -1497,7 +1460,7 @@ s32 sent; =20=09=09 if ((tmp =3D sertty->driver.write_room(sertty)) < len){ - printk("ser tx buffers can't send all, wait (%d/%d)\n", + printk(__FUNCTION__ ": ser tx buffers can't send all, wait (%d/%d)\n", tmp, len); return 0; } else { @@ -1507,7 +1470,7 @@ } =20=09=09 if (sent !=3D len) { - printk(FNC"Only sent %d of total %d\n",=20 + printk(__FUNCTION__ ": Only sent %d of total %d\n",=20 sent, len); /* fixme -- discard packet and add tx error in stat */ } @@ -1515,10 +1478,9 @@ =20 return sent; } else { - D_ERR(FNC"no sertty is set\n"); + D_ERR(__FUNCTION__ ": No sertty is set\n"); } return 0; -#undef FNC } =20 /* @@ -1552,7 +1514,6 @@ bt_write_top(struct tty_struct * tty, s32 from_user, const u8 *buf, s32 count) { -#define FNC "bt_write_top" s32 line =3D GET_TTYLINE(tty); s32 bytes_sent; u32 rfcomm_conid; @@ -1564,13 +1525,13 @@ bt =3D (bt_session *)tty->driver_data; =20=09 if ((bt->rfcomm !=3D NULL) && (bt->rfcomm->magic !=3D RFCOMM_MAGIC)) { - D_ERR(FNC": rfcomm magic failed (0x%x !=3D 0x%x)\n",=20 + D_ERR(__FUNCTION__ ": rfcomm magic failed (0x%x !=3D 0x%x)\n",=20 bt->rfcomm->magic, RFCOMM_MAGIC); return 0; } =20 if (SESSIONSTATE(line) !=3D BT_ACTIVE) { - D_WARN("bt_write_top : line %d is not in active state\n", + D_WARN(__FUNCTION__ ": Line %d is not in active state\n", line); return 0; } @@ -1592,7 +1553,6 @@ bt_stat.bytes_sent +=3D bytes_sent; =20 return bytes_sent; -#undef FNC } =20 /* @@ -1618,11 +1578,11 @@ =20 #ifdef BT_USELINEBUF /* WINDOZE FIX */ - BT_DATA("bt_receive_top : (%d) line %d not active yet..., buffer it !\n"= , len, line); + BT_DATA(__FUNCTION__ ": (%d) line %d not active yet..., buffer it !\n", = len, line); /* FIXME -- only buffer first packet ? */ bt_linebuf_add(line, data, len); #else - BT_DATA("bt_receive_top : (%d) line %d not active yet... silent discard!= \n", len, line); + BT_DATA(__FUNCTION__ ": (%d) line %d not active yet... silent discard!\n= ", len, line); #endif return 0; } @@ -1634,7 +1594,7 @@ if (upper_tty) { upper_tty->ldisc.receive_buf(upper_tty, data, NULL, len);=20=20 } else { -// D_ERR("No upper tty registered !!!\n"); +// D_ERR(__FUNCTION__ ": No upper tty registered !!!\n"); return -1; } return 0; @@ -1644,7 +1604,6 @@ =20 void bt_feedstack(void) { -#define FNC "bt_feedstack: " struct tty_struct *upper_tty =3D NULL; s32 check_line; s32 nbr_checked =3D 0; @@ -1671,7 +1630,7 @@ check_line =3D bt_ctrl.tty_last_unthrottled+1;=09 } =20=09=09 -// BT_DATA("bt_feedstack : start on line %d\n", check_line); +// BT_DATA(__FUNCTION__ ": Start on line %d\n", check_line); =20=09=09 /* skip non-active and control port (last) */ while ((SESSIONSTATE(check_line) !=3D BT_ACTIVE) &&=20 @@ -1686,7 +1645,7 @@ if (nbr_checked > BT_NBR_DATAPORTS) return; =20 -// BT_DATA("bt_feedstack : wakeup line %d !\n", check_line); +// BT_DATA(__FUNCTION__ ": Wakeup line %d !\n", check_line); upper_tty =3D GET_UPPERTTY(check_line); bt_ctrl.tty_last_unthrottled =3D check_line; =20=09=09 @@ -1717,7 +1676,6 @@ // BT_DATA(" |X|<<*** [%d] (n_tty)\n", check_line); wake_up_interruptible(&upper_tty->write_wait); } -#undef FNC } =20 /* Used to wait for dma to finish transmission */ @@ -1751,7 +1709,7 @@ if (hci_data.put >=3D hci_data.get) { /* check for overruns... */ if (hci_data.put + count - BT_INBUFFER_SIZE >=3D hci_data.get) { - D_ERR("bt_handle_indata : buffer overrun!\n"); + D_ERR(__FUNCTION__ ": Buffer overrun!\n"); } else { /* Calculate how much space there is left at the end=20 of the buffer */ @@ -1770,7 +1728,7 @@ /* hci_data.put < hci_data.get */ /* check for overruns ... */ if (hci_data.put + count >=3D hci_data.get) { - D_ERR("bt_handle_indata: buffer overrun!\n"); + D_ERR(__FUNCTION__ ": Buffer overrun!\n"); } else { /* Copy the data to the buffer */ memcpy(hci_data.put, (u8*)data, count); @@ -1878,8 +1836,6 @@ { u8 line;=09=09=09=09 =20 -#define FNC "bt_connect : " -=09 switch (GET_PSM(con_id)) { case RFCOMM_LAYER: { @@ -1892,19 +1848,19 @@ /* check if we already have a connection otherwise wait... */ if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED)|| (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) { - D_WARN("already got connection on line %d\n",=20 + D_WARN(__FUNCTION__ ": Already got connection on line %d\n",=20 GET_RFCOMMLINE(con_id));=20 return -1; }=20 =20 bt_ctrl.session[line].connect_status =3D -1; =20 - BT_DRIVER(FNC"Connecting srv ch %d on line %d\n", + BT_DRIVER(__FUNCTION__ ": Connecting srv ch %d on line %d\n", srv_ch, line); BT_DATADUMP("Remote BD : ", bd_addr, 6); =20 if (rfcomm_connect_req(bd_addr, srv_ch, line) < 0){ - BT_DRIVER("bt_connect failed\n"); + BT_DRIVER(__FUNCTION__ ": Failed\n"); return bt_ctrl.session[line].connect_status; } =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 @@ -1931,14 +1887,14 @@ =20 if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) || (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) { - D_WARN("already got connection on line %d\n", + D_WARN(__FUNCTION__ ": Already got connection on line %d\n", GET_SDPLINE(con_id));=20 return -1; } =20 /* Initiate the connection */ =20 - BT_DRIVER(FNC"Connecting SDP on line %d\n", line); + BT_DRIVER(__FUNCTION__ ": Connecting SDP on line %d\n", line); BT_DATADUMP("Remote BD : ", bd_addr, 6); if ((sdp_connection_id =3D sdp_connect_req(bd_addr, line)) >=3D 0) { =20=09=09=20=20 @@ -1972,7 +1928,7 @@ */ bt_ctrl.session[line].connect_status =3D -ETIMEDOUT; =20 - BT_DRIVER(FNC"sleep on line %d\n", line); + BT_DRIVER(__FUNCTION__ ": Sleep on line %d\n", line); interruptible_sleep_on(&bt_ctrl.connect_wq[line]); =20 /*=20 @@ -1981,7 +1937,7 @@ * Therefore return the sdp_connection_id=20=20=20=20=20=20=20=20=20=20= =20=20 */ =20=09=09=09 - BT_DRIVER(FNC"Wake up - line %d\n", line); + BT_DRIVER(__FUNCTION__ ": Wake up - line %d\n", line); if (bt_ctrl.session[line].connect_status >=3D 0) { return_value =3D sdp_connection_id; } else { @@ -1999,19 +1955,19 @@ case L2CAP_TEST2_LAYER: case L2CAP_TEST3_LAYER: line =3D (con_id & 0x0000ffff); - BT_DRIVER(FNC"Connecting TEST_LAYER (psm %02X) on line %d\n", GET_PSM(co= n_id), line); + BT_DRIVER(__FUNCTION__ ": Connecting TEST_LAYER (psm %02X) on line %d\n"= , GET_PSM(con_id), line); =20 /* Check the line to assure no other connections on it */ =20 if ((SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) || (SESSIONSTATE(line) =3D=3D BT_ACTIVE)) { - D_WARN("already got connection on line %d\n", + 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) { - BT_DRIVER("bt_connect failed\n"); + BT_DRIVER(__FUNCTION__ ": Failed\n"); return bt_ctrl.session[line].connect_status; } =20=20=20=20=20 @@ -2021,11 +1977,11 @@ return tcs_connect_req(bd_addr); =20=09=20=20=20=20 default:=20=20=20=20 - BT_DRIVER(FNC"PSM %d not supported as client\n", GET_PSM(con_id)); + BT_DRIVER(__FUNCTION__ ": PSM %d not supported as client\n", + GET_PSM(con_id)); break; } return -1; -#undef FNC } =20 static s32 bt_execute_sdp_request(bt_sdp_request *sdpRequest) @@ -2037,12 +1993,11 @@ =20 /* SDP connection not active! Don't issue the request */ =20 - BT_DRIVER(__FUNCTION__": line %d does not have an active "\ - "connection!\n", line); + BT_DRIVER(__FUNCTION__ ": Line %d does not have an active connection!\n"= , line); return -ENOTCONN; } =20 - BT_DRIVER("bt_execute_sdp_request: line %d SDP index %d\n", + BT_DRIVER(__FUNCTION__ ": Line %d SDP index %d\n", line, sdpIndex); =20 if (sdpStartRequest(sdpIndex, @@ -2053,7 +2008,7 @@ =20 /* Sleep on this line while the response is going through */ =20 - printk("bt_execute_sdp_request: sleep on line %d\n", line); + printk(__FUNCTION__ ": Sleep on line %d\n", line); interruptible_sleep_on(&bt_ctrl.connect_wq[line]); =20 /* If we're back, there may be data to send back. @@ -2061,8 +2016,7 @@ =20=09 if (bt_ctrl.session[line].sdpRequestResponseData) { =20 - BT_DRIVER(__FUNCTION__": sdpRequestResponseData 0x%x"\ - "- copying\n",=20 + BT_DRIVER(__FUNCTION__ ": sdpRequestResponseData 0x%x - copying\n",=20 (int)bt_ctrl.session[line].sdpRequestResponseData); =20 memcpy(sdpRequest->requestResponse, @@ -2080,10 +2034,10 @@ bt_connect_ind(u32 con_id)=20 { if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER) - BT_DRIVER("bt_connect_ind : RFCOMM dlci : %d\n",=20 + BT_DRIVER(__FUNCTION__ ": RFCOMM dlci : %d\n",=20 GET_RFCOMMDLCI(con_id)); else - BT_DRIVER("bt_connect_ind : psm %d\n", GET_PSM(con_id)); + BT_DRIVER(__FUNCTION__ ": PSM %d\n", GET_PSM(con_id)); } =20 void @@ -2096,19 +2050,18 @@ =20 switch (psm) { case RFCOMM_LAYER: - line =3D GET_RFCOMMLINE(con_id); CHECK_RFCOMM(con_id); =20 if ((line < 0) || (line > BT_NBR_DATAPORTS)) { =20=09=09=20=20 - D_ERR("bt_connect_cfm on invalid line (%d)\n", line); + D_ERR(__FUNCTION__ ": Invalid line (%d)\n", line); return; } =20 bt_ctrl.session[line].connect_status =3D status; =20 - BT_DRIVER("bt_connect_cfm, line %d [%s]\n", + BT_DRIVER(__FUNCTION__ ": Line %d [%s]\n", GET_RFCOMMLINE(con_id), psmname(psm)); =20 release_wq_timer(&bt_timer); @@ -2121,26 +2074,26 @@ =20 /* Check incoming line for validity */ if ((line < 0) || (line > BT_NBR_DATAPORTS)) { - D_ERR("bt_connect_cfm on invalid line (%d)\n", line); + D_ERR(__FUNCTION__ ": Invalid line (%d)\n", line); return; } =20 /* Record the connection status for bt_connect() to process. */ =20 bt_ctrl.session[line].connect_status =3D status; - BT_DRIVER("bt_connect_cfm, line %d [%s]\n", GET_SDPLINE(con_id), psmname= (psm)); - BT_DRIVER("wake up line %d\n", line); + BT_DRIVER(__FUNCTION__ ": Line %d [%s]\n", GET_SDPLINE(con_id), psmname(= psm)); + BT_DRIVER(__FUNCTION__ ": Wake up line %d\n", line); release_wq_timer(&bt_timer); wake_up_interruptible(&bt_ctrl.connect_wq[line]); wake_up_interruptible(&bt_ctrl.any_wq); break; =20=09=09 case TCS_LAYER: - BT_DRIVER("bt_connect_cfm [%s]\n", psmname(psm)); + BT_DRIVER(__FUNCTION__ ": [%s]\n", psmname(psm)); break; =20 default: - D_ERR("bt_connect_cfm : unknown layer %d\n", psm); + D_ERR(__FUNCTION__ ": Unknown layer %d\n", psm); break; } } @@ -2150,7 +2103,7 @@ { /* Check the line for validity */ if (line > BT_NBR_DATAPORTS) { - D_ERR("bt_connect_cfm on invalid line (%d)\n", line); + D_ERR(__FUNCTION__ ": Invalid line (%d)\n", line); return; } =20=09 @@ -2161,8 +2114,7 @@ /* If previous data, deallocate it */ =20 if (bt_ctrl.session[line].sdpRequestResponseData) { - D_WARN(__FUNCTION__": sdpRequestResponseData set - "\ - "deallocate\n"); + D_WARN(__FUNCTION__ ": sdpRequestResponseData set - deallocate\n"); kfree(bt_ctrl.session[line].sdpRequestResponseData); bt_ctrl.session[line].sdpRequestResponseData =3D NULL; bt_ctrl.session[line].sdpRequestResponseDataLength =3D 0; @@ -2237,10 +2189,10 @@ bt_disconnect_ind(u32 con_id)=20 { if (GET_PSM(con_id) =3D=3D RFCOMM_LAYER) - BT_DRIVER("bt_disconnect_ind : RFCOMM dlci : %d\n",=20 + BT_DRIVER(__FUNCTION__ ": RFCOMM dlci: %d\n",=20 GET_RFCOMMDLCI(con_id)); else - BT_DRIVER("bt_disconnect_ind : psm %d\n", GET_PSM(con_id)); + BT_DRIVER(__FUNCTION__ ": PSM %d\n", GET_PSM(con_id)); } =20 void @@ -2248,7 +2200,7 @@ { u32 line =3D GET_RFCOMMLINE(con_id); =20 - BT_DRIVER("bt_disconnect_cfm : psm %d, status %d\n",=20 + BT_DRIVER(__FUNCTION__ ": PSM %d, status %d\n",=20 GET_PSM(con_id), status); =20 bt_ctrl.session[line].disconnect_status =3D status; @@ -2263,7 +2215,7 @@ { struct tty_struct *upper_tty; =20 - BT_DRIVER("bt_hangupline : hanging up line %d\n", line); + BT_DRIVER(__FUNCTION__ ": Hanging up line %d\n", line); =20 /* find corresponding upper tty */ upper_tty =3D GET_UPPERTTY(line); @@ -2271,7 +2223,7 @@ if (upper_tty) tty_hangup(upper_tty); else - D_WARN("bt_hangupline : no upper tty\n"); + D_WARN(__FUNCTION__ ": No upper tty\n"); } =20 #ifdef __CRIS__ @@ -2328,7 +2280,7 @@ #endif =20 /**********************************/ -/* Bluetooth Stack Initialization */ +/* Bluetooth Stack Initialisation */ /**********************************/ =20 #if defined(MODULE) || defined(__KERNEL__) @@ -2345,7 +2297,7 @@ =20 bt_show_version(); =20 - /* Initialize the tty_driver structure */ + /* Initialise the tty_driver structure */ =20=09 memset(&bt_driver, 0, sizeof(bt_driver)); bt_driver.magic =3D BT_TTY_DRIVER_MAGIC; @@ -2390,9 +2342,9 @@ bt_driver.hangup =3D bt_hangup; =20=20=20 if (tty_register_driver(&bt_driver)) - panic("Couldn't register bluetooth driver\n"); + panic("Could not register bluetooth driver\n"); =20 - DSYS("Bluetooth driver registered in %s\n", bt_driver.name); + DSYS("Bluetooth driver registered as %s\n", bt_driver.name); =20 /* * Register the tty discipline @@ -2419,12 +2371,12 @@ if (status =3D=3D 0) { DSYS("Bluetooth line discipline registered.\n"); } else { - printk (KERN_ERR "error registering line discipline: %d\n", + printk (KERN_ERR "Error registering line discipline: %d\n", status); return status; } =20 - /* Initialize the tty_driver structure */ + /* Initialise the tty_driver structure */ bt_ctrl_init(); =20=09 sertty =3D NULL; @@ -2468,7 +2420,7 @@ #endif /* LINUX_VERSION_CODE */ =20 if (procfs_status < 0) { - D_ERR("Couldn't register proc file bt_internal_info %d\n", + D_ERR("Could not register proc file bt_internal_info %d\n", procfs_status); } =20 @@ -2488,7 +2440,7 @@ #endif /* LINUX_VERSION_CODE */ =20 if (procfs_status < 0) { - D_ERR("Couldn't register proc file bt_status %d\n",=20 + D_ERR("Could not register proc file bt_status %d\n",=20 procfs_status); } =20 @@ -2511,7 +2463,7 @@ #endif /* LINUX_VERSION_CODE */ =20 if (procfs_status < 0) { - D_ERR("Couldn't register proc file for tci database %d\n", + D_ERR("Could not register proc file for tci database %d\n", procfs_status); } #endif /* CONFIG_BLUETOOTH_USE_TCI */ @@ -2636,7 +2588,7 @@ if (!bt_dfu_mode(-1)) { /* Always check if hci succeeded */ if (hci_init() < 0){ - D_ERR("HCI failed to initialize\n"); + D_ERR("HCI failed to initialise\n"); goto init_failed_exit1; } =20=09 @@ -2670,10 +2622,8 @@ return 0; =20 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); @@ -2695,19 +2645,19 @@ { /* check if this line was the one previously used */ if ((line !=3D tty_linebuf.line) && (tty_linebuf.line !=3D TTY_NOLINE)) { - D_ERR("Line %d not active and linebuf busy, silent discard...\n", line); + D_ERR(__FUNCTION__ ": Line %d not active and linebuf busy, silent discar= d...\n", line); return; } else if (tty_linebuf.line =3D=3D TTY_NOLINE) tty_linebuf.line =3D line; =20 /* is there room for data ? */ if ((tty_linebuf.cur_len + len) > TTY_LINEBUFLEN) { - D_ERR("Line %d not active and linebuf full, silent discard (consider inc= reasing line buffer [%d])\n", line, TTY_LINEBUFLEN); + D_ERR(__FUNCTION__ ": Line %d not active and linebuf full, silent discar= d (consider increasing line buffer [%d])\n", line, TTY_LINEBUFLEN); return; } =20=09 /* ok, add it ! */ - DSYS("bt_linebuf_add : adding %d bytes\n", len); + DSYS(__FUNCTION__ ": Adding %d bytes\n", len); memcpy(tty_linebuf.data+tty_linebuf.cur_len, data, len); tty_linebuf.cur_len +=3D len; } @@ -2720,14 +2670,14 @@ return; =20 if (upper_tty && tty_linebuf.cur_len > 0) { - DSYS("bt_linebuf_empty : now sending buffered data [%d] to line %d\n", t= ty_linebuf.cur_len, line); + DSYS(__FUNCTION__ ": Now sending buffered data [%d] to line %d\n", tty_l= inebuf.cur_len, line); =20 upper_tty->ldisc.receive_buf(upper_tty, tty_linebuf.data,=20 NULL, tty_linebuf.cur_len);=20=20 =20 bt_reset_linebuf(); } else - DSYS("bt_linebuf_empty : no data sent\n"); + DSYS(__FUNCTION__ ": No data sent\n"); } #endif /* BT_USELINEBUF */ =20 @@ -2735,7 +2685,7 @@ bt_ctrl_init(void) { s32 i; - BT_DRIVER("Initiating bt ctrl struct\n"); + BT_DRIVER("Initialising bt ctrl struct\n"); =20 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) for (i =3D 0; i < BT_NBR_PORTS; i++) { @@ -2825,7 +2775,7 @@ if ((SESSIONSTATE(line) =3D=3D BT_INACTIVE) ||=20 (SESSIONSTATE(line) =3D=3D BT_UPPERCONNECTED)) { /* now register ! */ - DSYS("bt_register_rfcomm : dlci %d on line %d\n", dlci, line); + DSYS(__FUNCTION__ ": dlci %d on line %d\n", dlci, line); =20=09=09 bt_ctrl.session[line].rfcomm =3D rfcomm;=20 bt_ctrl.session[line].dlci =3D dlci; @@ -2839,7 +2789,7 @@ } =20=09 if (!found) - D_WARN("bt_register_rfcomm : line %d busy [%s]\n",=20 + D_WARN(__FUNCTION__ ": Line %d busy [%s]\n",=20 line, statename(SESSIONSTATE(line))); return found; } @@ -2850,26 +2800,26 @@ s32 found =3D 0; =20 if (!bt_stack_initiated) { - D_WARN("bt_register_sdp : Bluetooth stack not initialized\n"); + D_WARN(__FUNCTION__ ": Bluetooth stack not initialised\n"); return -1;=09 } =20 /* Better not have any sdp data pending for this connection */ =20 if (bt_ctrl.session[line].sdpRequestResponseData) { - D_WARN("bt_register_sdp: Pending SDP data for this new connection @ line= %d\n", line); + D_WARN(__FUNCTION__ ": Pending SDP data for this new connection on line = %d\n", line); } =20 if (SESSIONSTATE(line) =3D=3D BT_INACTIVE) { /* now register ! */ - DSYS("bt_register_sdp : line %d\n", line); + DSYS(__FUNCTION__ ": Line %d\n", line); SESSIONSTATE(line) =3D BT_ACTIVE; bt_ctrl.session[line].sdpID =3D sdpID; found =3D 1; } =20 if (!found) - D_WARN("bt_register_sdp : could not find any available lines\n"); + D_WARN(__FUNCTION__ ": Could not find any available lines\n"); =20 return found; } @@ -2877,7 +2827,7 @@ s32 bt_unregister_rfcomm(s32 line) { - BT_DRIVER("bt_unregister_rfcomm : line %d\n", line);=09 + BT_DRIVER(__FUNCTION__ ": Line %d\n", line);=09 =20 if (SESSIONSTATE(line) =3D=3D BT_ACTIVE) { bt_ctrl.session[line].rfcomm =3D 0;=20 @@ -2892,7 +2842,7 @@ } else if (SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) { bt_reset_session(line);=09=09 } else { - D_WARN("bt_unregister_rfcomm : inactive session\n"); + D_WARN(__FUNCTION__ ": Inactive session\n"); return -1; } =20 @@ -2905,10 +2855,10 @@ =20 s32 bt_unregister_sdp(s32 line) { - BT_DRIVER("bt_unregister_sdp : line %d\n", line);=09 + BT_DRIVER(__FUNCTION__ ": Line %d\n", line);=09 =20 if (!bt_stack_initiated) { - D_WARN("bt_unregister_sdp : Bluetooth stack not initialized\n"); + D_WARN(__FUNCTION__ ": Bluetooth stack not initialised\n"); return -1;=09 } =20 @@ -2916,7 +2866,7 @@ response data AND clear length and pointer */ =20 if (bt_ctrl.session[line].sdpRequestResponseData) { - DSYS("bt_unregister_sdp: Free request data 0x%x\n", + DSYS(__FUNCTION__ ": Free request data 0x%x\n", (unsigned int)bt_ctrl.session[line].sdpRequestResponseData); kfree(bt_ctrl.session[line].sdpRequestResponseData); bt_ctrl.session[line].sdpRequestResponseData =3D NULL; @@ -2949,7 +2899,7 @@ } else { /* Data line ! */ if (!bt_stack_initiated) { - D_WARN("bt_register_tty : Bluetooth stack not initiated\n"); + D_WARN(__FUNCTION__ ": Bluetooth stack not initialised\n"); return -EPERM; } } @@ -2973,7 +2923,7 @@ } return 0; } else { - D_WARN("bt_register_tty : line busy !\n"); + D_WARN(__FUNCTION__ ": Line busy !\n"); } return -EBUSY; } @@ -2991,7 +2941,7 @@ /* Check that the pid closing is the one that opened the tty */ if (current->pid !=3D bt_ctrl.session[line].pid) { - BT_DRIVER(__FUNCTION__" invalid pid\n"); + BT_DRIVER(__FUNCTION__ ": Invalid pid\n"); return -1; } =20 @@ -3010,7 +2960,7 @@ NBR_UPPER--; } else { - D_WARN("bt_unregister_tty : tty not prev registered\n"); + D_WARN(__FUNCTION__ ": TTY not previously registered\n"); return -ENODEV; } return 0; /* Until the above is fixed */ @@ -3078,13 +3028,13 @@ { #if BT_PARANOIA_CHECK if (!bt_tty) { - printk("Warning: null tty_driver struct for (%s) in %s\n", + printk("Warning: Null tty_driver struct for (%s) in %s\n", kdevname(device), routine); return -EINVAL; } =20 if (bt_tty->magic !=3D BT_TTY_DRIVER_MAGIC) { - printk("Warning: bad magic number for bluetooth driver struct (%s) in %s= \n", kdevname(device), routine); + printk("Warning: Bad magic number for bluetooth driver struct (%s) in %s= \n", kdevname(device), routine); return -EINVAL; } #endif @@ -3122,7 +3072,7 @@ wq_timer->data =3D (unsigned long)wq; wq_timer->expires =3D jiffies + timeout; add_timer(wq_timer); -// printk("start_wq_timer wq 0x%x : timer 0x%x\n", wq, wq_timer); +// printk(__FUNCTION__ ": wq: 0x%x, timer: 0x%x\n", wq, wq_timer); } =20 =20 @@ -3131,7 +3081,7 @@ release_wq_timer(struct timer_list *wq_timer) { del_timer(wq_timer); -// printk("release_wq_timer timer 0x%x\n", wq_timer); +// printk(__FUNCTION__ ": timer: 0x%x\n", wq_timer); } =20 void @@ -3161,7 +3111,7 @@ save_flags(flags); cli(); if ((error =3D tty_unregister_driver(&bt_driver))) - printk("SERIAL: failed to unregister bluetooth driver (%d)\n", + printk("SERIAL: Failed to unregister bluetooth driver (%d)\n", error); restore_flags(flags); =20 |
From: Peter K. <pk...@us...> - 2001-09-10 10:16:22
|
The following files were modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.h 1.44 1.45=20=20=20=20=20=20=20=20=20=20=20=20 btcommon.h 1.82 1.83=20=20=20=20=20=20=20=20=20=20=20=20 hci.h 1.67 1.68=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added BCSP DFU support. The diff of the modified file(s): --- bluetooth.h 2001/07/31 17:50:55 1.44 +++ bluetooth.h 2001/09/10 10:16:22 1.45 @@ -90,6 +90,7 @@ =20 s32 bt_initiated(void); s32 bt_use_bcsp(s32 new_use_bcsp); +s32 bt_dfu_mode(s32 new_dfu_mode); void bt_connect_cfm(u32 con_id, s32 status); s32 bt_sprint_status(u8 *buf); void bt_send_sdp_data_received(u8 line, u8 *data, int len); --- btcommon.h 2001/08/29 09:34:44 1.82 +++ btcommon.h 2001/09/10 10:16:22 1.83 @@ -209,7 +209,11 @@ =20 #define BTINITBCSP _IO(BT_IOC_MAGIC, 0xf6) =20 -#define BTSETMAXCONNECTIONS _IOW(BT_IOC_MAGIC, 0xf7, u8) +#define BT_SET_DFU_MODE _IOWR(BT_IOC_MAGIC, 0xf7, s32) +#define BT_SEND_DFU_COMMAND _IOWR(BT_IOC_MAGIC, 0xf8, u8[2048]) +#define BT_RETRIEVE_DFU_RESPONSE _IOWR(BT_IOC_MAGIC, 0xf9, u8[2048]) + +#define BTSETMAXCONNECTIONS _IOW(BT_IOC_MAGIC, 0xfa, u8) =20 /* NOTE ! * N_BT should be defined in /include/asm/termios.h=20 --- hci.h 2001/08/17 09:19:00 1.67 +++ hci.h 2001/09/10 10:16:22 1.68 @@ -107,6 +107,16 @@ void hci_receive_acl(u8 *data, s32 count); void hci_receive_hq(u8 *data, u32 count); void hci_receive_bcsp(u8 *data, u32 count); +void hci_receive_dfu(u8 *data, u32 count); + +s32 hci_read_dfu(u8* data, u32 count); + +void hci_init_dfu(void); +void hci_shutdown_dfu(void); +#endif + +#ifdef CONFIG_BLUETOOTH_CSR +s32 csr_pskey(u16 ps_key, u16 rw_mode, u16 *retb, u16 n_pars); #endif =20 s32 lp_connect_req(u8 bd_addr[]); |
From: Peter K. <pk...@us...> - 2001-09-10 09:51:12
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.h 1.23 1.24=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added declaration of bt_set_max_conections(). The diff of the modified file(s): --- bt_if.h 2001/09/07 12:53:50 1.23 +++ bt_if.h 2001/09/10 09:51:11 1.24 @@ -324,6 +324,7 @@ int bt_send(int fd, int len, int repeat); void bt_showstatus(void); int bt_force_msswitch_as_server(int bt_cfd, int enable); +int bt_set_max_conections(int bt_cfd, int connections); =20 /*=20=20 * HCI command functions=20 |
From: Peter K. <pk...@us...> - 2001-09-10 09:41:51
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btconfig.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 btd.c 1.26 1.27=20=20=20=20=20=20=20=20=20=20=20=20 btinit.c 1.14 1.15=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected long_options[] for options that do not take an argument. The diff of the modified file(s): --- btconfig.c 2001/07/10 13:01:35 1.5 +++ btconfig.c 2001/09/10 09:41:50 1.6 @@ -114,7 +114,7 @@ static struct option long_options[] =3D { { "file", 1, NULL, 'f' }, /* config file name */ - { "help", 1, NULL, 'h' }, /* show help */ + { "help", 0, NULL, 'h' }, /* show help */ { "force-msswitch", 1, NULL, 'm' }, /* force m/s switch as server */ { "name", 1, NULL, 'n' }, /* set BT friendly name */ { "wrscan-enable", 1, NULL, 'w' }, /* sets write scan enable */ --- btd.c 2001/09/06 16:16:26 1.26 +++ btd.c 2001/09/10 09:41:50 1.27 @@ -189,7 +189,7 @@ {"physdev", 1, NULL, 'u'}, /* phys device used from stack */ {"modem-emul", 1, NULL, 'm'}, {"local-name", 1, NULL, 'n'}, /* set local bluetooth name */ - {"reset", 1, NULL, 'R'}, /* reset BT HW */ + { "reset", 0, NULL, 'R' }, /* reset BT HW */ {"speed", 1, NULL, 's'}, /* uart speed towards hw */ {0, 0, 0, 0} }; --- btinit.c 2001/09/06 16:16:26 1.14 +++ btinit.c 2001/09/10 09:41:50 1.15 @@ -119,7 +119,7 @@ {"initial-speed", 1, NULL, 'i'}, /* initial uart speed */ {"physdev", 1, NULL, 'u'}, /* phys device used from stack */ {"local-name", 1, NULL, 'n'}, /* set local bluetooth name */ - {"reset", 1, NULL, 'R'}, /* reset BT HW */ + { "reset", 0, NULL, 'R' }, /* reset BT HW */ {"speed", 1, NULL, 's'}, /* uart speed towards hw */ {0, 0, 0, 0} }; |
From: Peter K. <pk...@us...> - 2001-09-07 12:53:50
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.32 1.33=20=20=20=20=20=20=20=20=20=20=20=20 bt_if.h 1.22 1.23=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added BCSP DFU support. The diff of the modified file(s): --- bt_if.c 2001/09/07 12:47:09 1.32 +++ bt_if.c 2001/09/07 12:53:50 1.33 @@ -86,12 +86,15 @@ init_userstack(); #endif =20 + if (!bt_dfu_mode(bt_cfd, -1)) + { /* fixme<3> -- read these parameters from config file ? */ bt_set_classofdevice(bt_cfd, 0x10, 0x3, 0x0, 0x0); =20 #ifndef __CRIS__ set_local_hostname(bt_cfd, "AXIS"); #endif + } =20=20=20 return ret; } @@ -195,6 +198,22 @@ #endif } =20 +int +bt_dfu_mode(int bt_cfd, int enable) +{ +#ifndef BT_USERSTACK + if (ioctl(bt_cfd, BT_SET_DFU_MODE, &enable) < 0) + { + perror(__FUNCTION__); + exit(1); + } + + return enable; +#else + return 0; +#endif +} + void reset_hw(void) { #ifdef __CRIS__ @@ -476,6 +495,59 @@ //hci_send_raw_data(data, 16); #endif return 0; +} + +int +bt_send_dfu_command(int bt_cfd, int len, unsigned char *data) +{ + static unsigned char buf[2048]; + + if (len > sizeof buf - sizeof(int)) + { + errno =3D EINVAL; + return -1; + } + + *(int *)buf =3D len; +=20=20 + memcpy((int *)buf+1, data, len); + +#ifndef BT_USERSTACK=20 + if (ioctl(bt_cfd, BT_SEND_DFU_COMMAND, buf) < 0) + { + perror(__FUNCTION__); + return -1; + } + + return 0; +#else + fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n"); + errno =3D EPERM; + return -1; +#endif +} + +int +bt_retrieve_dfu_response(int bt_cfd, int len, unsigned char *data) +{ + *(int *)data =3D len - sizeof(int); + +#ifndef BT_USERSTACK=20 + if (ioctl(bt_cfd, BT_RETRIEVE_DFU_RESPONSE, data) < 0) + { + perror(__FUNCTION__); + return -1; + } + + len =3D *(int *)data; +=20=20 + memmove(data, (int *)data+1, len); + return len; +#else + fprintf(stderr, __FUNCTION__ ": Not yet implemented...\n"); + errno =3D EPERM; + return -1; +#endif } =20 int bt_ping(int bt_cfd, unsigned char bd[6],=20 --- bt_if.h 2001/09/07 12:47:09 1.22 +++ bt_if.h 2001/09/07 12:53:50 1.23 @@ -260,7 +260,11 @@ =20 #define BTINITBCSP _IO(BT_IOC_MAGIC, 0xf6) =20 -#define BTSETMAXCONNECTIONS _IOW(BT_IOC_MAGIC, 0xf7, unsigned char) +#define BT_SET_DFU_MODE _IOWR(BT_IOC_MAGIC, 0xf7, int) +#define BT_SEND_DFU_COMMAND _IOWR(BT_IOC_MAGIC, 0xf8, unsigned char[2048]) +#define BT_RETRIEVE_DFU_RESPONSE _IOWR(BT_IOC_MAGIC, 0xf9, unsigned char[2= 048]) + +#define BTSETMAXCONNECTIONS _IOW(BT_IOC_MAGIC, 0xfa, unsigned char) /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ /* Structs */ =20 @@ -301,6 +305,7 @@ #endif char* bt_firmware_info(void); int bt_bcsp_mode(int bt_cfd, int enable); +int bt_dfu_mode(int bt_cfd, int enable); void reset_hw(void); int bt_openctrl(void); void set_bt_line_disc(int phys_fd, int bt_disc, char* physdev); @@ -325,6 +330,8 @@ */ =20 int bt_send_raw_hci(int bt_cfd, unsigned char *data, char len); +int bt_send_dfu_command(int bt_cfd, int len, unsigned char *data); +int bt_retrieve_dfu_response(int bt_cfd, int len, unsigned char *data); int bt_ping(int bt_cfd, unsigned char bd[6],=20 unsigned char *data, unsigned short len); int bt_getinfo(int bt_cfd, unsigned char bd[6], unsigned short type); |
From: Peter K. <pk...@us...> - 2001-09-07 12:53:26
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20 bluetooth.c 1.191 1.192=20=20=20=20=20=20=20=20=20=20=20 hci.c 1.174 1.175=20=20=20=20=20=20=20=20=20=20=20 hci_vendor.c 1.51 1.52=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added BCSP DFU support. The diff of the modified file(s): --- bcsp.c 2001/09/06 15:56:56 1.18 +++ bcsp.c 2001/09/07 12:53:24 1.19 @@ -165,7 +165,7 @@ /* notify bt driver that sync failed */ if (!bcsp_sync) { return -1; - } else { + } else if (!bt_dfu_mode(-1)) { csr_waitcmdnum(); /* Wait for command status */ } return 0;=09 @@ -224,6 +224,9 @@ break; case BCSP_ACL_CHN: hci_receive_acl(data, (s32)len); + break; + case BCSP_DFU_CHN: + hci_receive_dfu(data, len); break; default: D_ERR(__FUNCTION__ ": Unknown channel: %d\n", chn); --- bluetooth.c 2001/08/29 09:35:07 1.191 +++ bluetooth.c 2001/09/07 12:53:24 1.192 @@ -503,6 +503,9 @@ s32 size =3D _IOC_SIZE(cmd); bt_connection btcon; u8 bd_addr[6]; +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP + static u8 dfu_data[2044]; +#endif =20 /* The direction is a bitmask, and VERIFY_WRITE catches R/W transfer. The ioctl direction is user-oriented, while verify_area is kernel- @@ -1104,18 +1107,71 @@ copy_to_user((s32*)arg, msg, u16_size*sizeof(u16)); return 0; } +#endif /* CONFIG_BLUETOOTH_CSR */ =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP case BTINITBCSP: { BT_DRIVER("BTINITBCSP\n"); - if (bcsp_init() < 0) + if (bcsp_init() < 0) { printk("Sync failed\n"); + return -ETIMEDOUT; + } return 0; } -#endif -#endif /* CONFIG_BLUETOOTH_CSR */ =20 + case BT_SET_DFU_MODE: + { + GET_USER(tmp, (s32*)arg); + + BT_DRIVER("BT_SET_DFU_MODE: %d\n", tmp); + + tmp =3D bt_dfu_mode(tmp); + put_user(tmp, (s32*)arg); + + return 0; + } + + case BT_SEND_DFU_COMMAND: + { + int ret; + s32 dfu_len; + + if (!bt_use_bcsp(-1)) + return -EPERM; + + GET_USER(dfu_len, (s32*)arg); + if (dfu_len > sizeof dfu_data) + return -EINVAL; + + copy_from_user(dfu_data, (s32*)arg + 1, dfu_len); + + ret =3D bcsp_sequence_send(dfu_data, dfu_len, BCSP_DFU_CHN= ); + if (ret < 0) + return ret; + return 0; + } + + case BT_RETRIEVE_DFU_RESPONSE: + { + s32 dfu_len; + + if (!bt_use_bcsp(-1)) + return -EPERM; + + GET_USER(dfu_len, (s32*)arg); + if (dfu_len > sizeof dfu_data) + return -EINVAL; +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + dfu_len =3D hci_read_dfu((u8*)((s32*)arg + 1), dfu_len); + if (dfu_len < 0) + return dfu_len; + + put_user(dfu_len, (s32*)arg); + return 0; + } +#endif /* CONFIG_BLUETOOTH_SUPPORT_BCSP */ + default:=09=09 return -ENOIOCTLCMD; =20 @@ -1129,6 +1185,7 @@ 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); @@ -2255,7 +2312,7 @@ (bt_connections && active =3D=3D NO_BLUETOOTH_ACTIVITY)); =20 if (light_leds) { - LED_ACTIVE_SET(LED_GREEN); + LED_ACTIVE_SET(bt_dfu_mode(-1) ? LED_ORANGE : LED_GREEN); } else { LED_ACTIVE_SET(LED_OFF); @@ -2520,6 +2577,21 @@ } =20 s32 +bt_dfu_mode(s32 new_dfu_mode) +{=20=20 + static s32 dfu_mode =3D 0; + s32 old =3D dfu_mode; + + if (new_dfu_mode >=3D 0) + { +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP + dfu_mode =3D new_dfu_mode; +#endif + } + return old; +} + +s32 bt_init_stack(void) { unsigned long page;=09 @@ -2561,6 +2633,7 @@ } #endif =20 + if (!bt_dfu_mode(-1)) { /* Always check if hci succeeded */ if (hci_init() < 0){ D_ERR("HCI failed to initialize\n"); @@ -2577,6 +2650,7 @@ tcs_init(); test_init(); #endif + } =20 bt_stack_initiated =3D 1; bt_stat.bytes_received =3D 0; @@ -2587,6 +2661,7 @@ =20 #ifdef __CRIS__ /* start led timer */ + bt_set_leds(NO_BLUETOOTH_ACTIVITY); init_timer(&bt_clear_led_timer); bt_clear_led_timer.function =3D &bt_clear_led; bt_clear_led_timer.expires =3D jiffies + HZ/10; @@ -2948,11 +3023,8 @@ struct bt_session *bt; DSYS("Shutting down bluetooth stack\n"); =20 - if (!bt_stack_initiated) { - D_WARN("Bluetooth stack not initiated\n"); - return; - } - + if (bt_stack_initiated) { + if (!bt_dfu_mode(-1)) { /* disconnect all active connections */ for (i =3D 0; i < BT_NBR_DATAPORTS;i++) { bt =3D &bt_ctrl.session[i]; @@ -2975,23 +3047,30 @@ tcs_shutdown(); l2cap_shutdown(); hci_shutdown(); + } + } =20 + bt_dfu_mode(0); + #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP - if (bt_use_bcsp(-1)) bcsp_shutdown(); #endif =20 btmem_shutdown(); =20 +#ifdef __CRIS__ + if (bt_stack_initiated) { + del_timer(&bt_clear_led_timer); + } + bt_set_leds(NO_BLUETOOTH_ACTIVITY); +#endif + bt_stack_initiated =3D 0; =20=09 if (tmp_bt_buf) { free_page((unsigned long) tmp_bt_buf); tmp_bt_buf =3D NULL; } -#ifdef __CRIS__ - del_timer(&bt_clear_led_timer); -#endif } =20 static inline s32 --- hci.c 2001/08/06 15:52:05 1.174 +++ hci.c 2001/09/07 12:53:24 1.175 @@ -1848,6 +1848,10 @@ #endif /* LINUX_VERSION_CODE */ #endif /* __KERNEL__ */ =20 +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP + hci_init_dfu(); +#endif + DSYS("Initialising HCI inbuffers [%d]\n", HCI_IN_SIZE); =20=09 /* Initiate the hci inbuffers */ @@ -1936,6 +1940,10 @@ =20 #ifdef USE_NCPTIMER release_ncp_timer(); +#endif + +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP + hci_shutdown_dfu(); #endif } =20 --- hci_vendor.c 2001/08/29 10:08:42 1.51 +++ hci_vendor.c 2001/09/07 12:53:24 1.52 @@ -655,7 +655,100 @@ wake_up_interruptible(&hci_wq);=09 } =20 +static struct dfu_response +{ + struct dfu_response *next; + u32 length; + u8 data[0]; +} *dfu_responses =3D NULL; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) +static struct wait_queue *dfu_wq =3D NULL; +#else +static wait_queue_head_t dfu_wq; +#endif /* LINUX_VERSION_CODE */ + +void +hci_init_dfu(void) +{ +#ifdef __KERNEL__ +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0) + init_waitqueue_head(&dfu_wq); +#endif /* LINUX_VERSION_CODE */ +#endif /* __KERNEL__ */ +} + +void +hci_shutdown_dfu(void) +{ + struct dfu_response *response; + + while (dfu_responses) { + cli(); + response =3D dfu_responses; + dfu_responses =3D response->next; + sti(); + + kfree(response); + } +} + +void +hci_receive_dfu(u8 *data, u32 count) +{ + struct dfu_response *response; + + if ((response =3D kmalloc(sizeof(*response) + count, GFP_ATOMIC))) { + response->length =3D count; + memcpy(response->data, data, count); + + cli(); + response->next =3D dfu_responses; + dfu_responses =3D response; + sti(); + + wake_up_interruptible(&dfu_wq); + } +} + s32 +hci_read_dfu(u8* data, u32 count) +{ + struct dfu_response *response; + u32 length; + + if (!dfu_responses) + interruptible_sleep_on(&dfu_wq); + + cli(); + response =3D dfu_responses; + dfu_responses =3D response->next; + sti(); + + if (!response) + return -EINTR; +=20=20=20=20=20=20=20=20 + length =3D response->length; + + if (count < length) { + cli(); + response->next =3D dfu_responses; + dfu_responses =3D response; + sti(); + + printk(__FUNCTION__ ": DFU response was too big!\n"); + + return -E2BIG; + } + + copy_from_user(data, response->data, length); + + kfree(response); + + return (s32)length; +} + +s32 csr_send_general_hq(csr_bccmd *cmd) { csr_msg *msg; @@ -700,7 +793,7 @@ } } =20 -#endif +#endif /* CONFIG_BLUETOOTH_SUPPORT_BCSP */ =20 s32=20 csr_pskey(u16 ps_key, u16 rw_mode, u16 *retb, u16 n_pars) |
From: Peter K. <pk...@us...> - 2001-09-07 12:47:10
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.31 1.32=20=20=20=20=20=20=20=20=20=20=20=20 bt_if.h 1.21 1.22=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Corrected bt_read_country_code(). * Removed a couple of printf()'s. * Fixed a couple of compiler warnings. The diff of the modified file(s): --- bt_if.c 2001/08/29 09:36:45 1.31 +++ bt_if.c 2001/09/07 12:47:09 1.32 @@ -72,7 +72,8 @@ =20 int init_stack(int bt_cfd) { - int ret; + int ret =3D 0; + syslog(LOG_INFO, "Init stack"); =20 #ifndef BT_USERSTACK @@ -199,7 +200,6 @@ #ifdef __CRIS__ int devfd; =20 - printf("Resetting HW board...\n"); if ((devfd =3D bt_openctrl()) >=3D 0) { if (ioctl(devfd, BTRESETPHYSICALHW) < 0) @@ -210,8 +210,6 @@ sleep(2); =20 close(devfd); - - printf("Done.\n"); } else { @@ -248,8 +246,10 @@ { bt_connection con; int result; +#ifdef BT_USERSTACK unsigned short srv_ch; unsigned short line; +#endif =20=20=20 memcpy(con.bd, bd, 6); con.id =3D con_id; @@ -261,17 +261,14 @@ case L2CAP_TEST_LAYER: case L2CAP_TEST2_LAYER: case L2CAP_TEST3_LAYER: - { break; - } =20=20=20=20=20 default: - { printf(__FUNCTION__" : Unknown layer\n"); con.id =3D 0; return -1; - } } + #ifndef BT_USERSTACK if ((result =3D ioctl(bt_fd, BTCONNECT, &con))) printf("Connect failed [%s (%d)]\n", error_msg(result), result); @@ -285,7 +282,7 @@ return -1; } =20=20=20=20=20 - printf("Connecting srv ch %d on line %d\n", srv_ch, line); +// printf("Connecting srv ch %d on line %d\n", srv_ch, line); result =3D bt_connect(bd, con_id);=09=09 } #endif @@ -472,6 +469,7 @@ if (ioctl(bt_cfd, HCISENDRAWDATA, buf) < 0) { perror(__FUNCTION__); + return -1; } #else fprintf(stderr, __FUNCTION__ ": not yet implemented...\n"); @@ -869,7 +867,6 @@ exit(1); } syslog(LOG_INFO, "Registered bluetooth line discipline on %s", physdev); - printf("Registered bluetooth line discipline on %s\n", physdev); #else fprintf(stderr, __FUNCTION__ ": ignored in usermode stack\n"); #endif @@ -958,10 +955,12 @@ #endif } =20 -int bt_read_country_code(int bt_cfd, unsigned char *result) +int bt_read_country_code(int bt_cfd) { + int result; + #ifndef BT_USERSTACK=20=20 - if (ioctl(bt_cfd, HCIREADCOUNTRYCODE, result) < 0) + if (ioctl(bt_cfd, HCIREADCOUNTRYCODE, &result) < 0) { perror(__FUNCTION__); exit(1); --- bt_if.h 2001/08/29 09:36:45 1.21 +++ bt_if.h 2001/09/07 12:47:09 1.22 @@ -259,6 +259,7 @@ #define BT_CSR_PSKEY _IOWR(BT_IOC_MAGIC, 0xf5, unsigned short[CSR_PSKEY_MS= GHDR_SIZE + CSR_PSKEY_MAXPARAMS]) =20 #define BTINITBCSP _IO(BT_IOC_MAGIC, 0xf6) + #define BTSETMAXCONNECTIONS _IOW(BT_IOC_MAGIC, 0xf7, unsigned char) /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ /* Structs */ @@ -345,7 +346,7 @@ unsigned char minor_class,=20 unsigned char format); =20 -int bt_read_country_code(int bt_cfd, unsigned char *result); +int bt_read_country_code(int bt_cfd); =20 void enable_dut(int bt_cfd); =20 |