From: Anders J. <and...@us...> - 2001-11-15 15:00:37
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.188 1.189=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added call to bt_handle_hw_error when we receive an hwerror. The diff of the modified file(s): --- hci.c 2001/10/22 12:51:44 1.188 +++ hci.c 2001/11/15 15:00:36 1.189 @@ -857,7 +857,6 @@ =20 /* enable m/s switch */=20 write_link_policy_settings(hci_hdl, 0x01); - /* we demand role switch as server */ if (force_msswitch && !i_am_initiator) { /* FIXME -- check return code */ @@ -1031,6 +1030,7 @@ case HARDWARE_ERROR: D_ERR(__FUNCTION__ ": A hardware error with error code 0x%02X occurred.\= n", buf[0]); D_ERR(__FUNCTION__ ": Please refer to your Bluetooth module's manual.\n"= ); + bt_handle_hw_error(buf[0]); break; =20 case ROLE_CHANGED: @@ -2331,7 +2331,7 @@ s32 hci_switch_role(u8 *bd, u8 role) { - DSYS(__FUNCTION__ ": role %d\n", role); + D_CMD(__FUNCTION__ ": role %d\n", role); =20 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(SWITCH_ROLE, HCI_LP); |
From: Peter K. <pk...@us...> - 2001-12-06 11:21:21
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.189 1.190=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected copy-paste error. The diff of the modified file(s): --- hci.c 2001/11/15 15:00:36 1.189 +++ hci.c 2001/12/06 11:21:21 1.190 @@ -1402,9 +1402,9 @@ break; =20=09=09=09 case WRITE_ENCRYPTION_MODE: - D_CMD(__FUNCTION__ ": WRITE_AUTHENTICATION_ENABLE\n"); + D_CMD(__FUNCTION__ ": WRITE_ENCRYPTION_MODE\n"); if(r_val[0]) { - D_ERR(__FUNCTION__ ": WRITE_AUTHENTICATION_ENABLE: %s\n", + D_ERR(__FUNCTION__ ": WRITE_ENCRYPTION_MODE: %s\n", get_err_msg(r_val[0])); result_param =3D -r_val[0]; } |
From: Fredrik S. <fre...@us...> - 2002-02-13 10:04:55
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.192 1.193=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Change default link supervision timeout from 20 sec to 5 sec. The diff of the modified file(s): --- hci.c 12 Feb 2002 11:02:21 -0000 1.192 +++ hci.c 13 Feb 2002 10:04:54 -0000 1.193 @@ -883,6 +883,10 @@ } /* reset variable again */ i_am_initiator =3D 0; + + /* Change link supervision timeout. */ + hci_write_link_supervision_to( + hci_hdl, DEFAULT_LINK_SUPERVISION_TIMEOUT, 0); } #endif /* HCI_EMULATION */ =20 @@ -2956,7 +2960,7 @@ } =20 s32=20 -hci_write_link_supervision_to(u32 hdl, u32 link_to) +hci_write_link_supervision_to(u32 hdl, u32 link_to, s32 block) { D_CMD(__FUNCTION__ "\n"); c_pkt.type =3D CMD_PKT; @@ -2967,10 +2971,10 @@ c_pkt.data[3] =3D (link_to >> 8) & 0xff; c_pkt.len =3D 4; =20=20=20 - print_data("write_link_to:",(u8*)&c_pkt, - c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); - + if (block) return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN= , DEFAULT_TIMEOUT); + else + return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); } =20 /* Defines of Informational Parameters function */ |
From: Fredrik S. <fre...@us...> - 2002-03-14 14:25:06
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.195 1.196=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Remove btmem buffers occupied by HCI handles that disconnects ungracefully. The diff of the modified file(s): --- hci.c 7 Mar 2002 21:32:29 -0000 1.195 +++ hci.c 14 Mar 2002 14:25:03 -0000 1.196 @@ -948,6 +948,10 @@ hci_ctrl.acl_buf_count[hci_hdl], hci_hdl); hci_ctrl.hc_buf.acl_num +=3D hci_ctrl.acl_buf_count[hci_hdl]; hci_ctrl.acl_buf_count[hci_hdl] =3D 0; + + /* get_bt_buf removes flushed buffers if located in=20 + queue head */ + get_bt_buf(); } =20 /* FIXME: No more NBR_OF_COMPLETE_PACKETS will arrive for this |
From: Fredrik S. <fre...@us...> - 2002-03-15 14:45:36
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.196 1.197=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Fixed problem with send task stopping to send data after a client has disco= nnected ungracefully. The diff of the modified file(s): --- hci.c 14 Mar 2002 14:25:03 -0000 1.196 +++ hci.c 15 Mar 2002 14:45:34 -0000 1.197 @@ -949,9 +949,18 @@ hci_ctrl.hc_buf.acl_num +=3D hci_ctrl.acl_buf_count[hci_hdl]; hci_ctrl.acl_buf_count[hci_hdl] =3D 0; =20 - /* get_bt_buf removes flushed buffers if located in=20 - queue head */ - get_bt_buf(); +#ifdef __KERNEL__ + /* Trigger the send task to start sending data. */ + if (buf_count()) {=09=20=20=20=20=20 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) + queue_task(&send_data_task, &tq_scheduler); +#else + queue_task(&send_data_task, &tq_immediate); + mark_bh(IMMEDIATE_BH); +#endif + } +#endif + } =20 /* FIXME: No more NBR_OF_COMPLETE_PACKETS will arrive for this |
From: Willy S. <sag...@us...> - 2002-04-08 16:44:09
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.197 1.198=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added sniff, park and readnumbroadcast The diff of the modified file(s): --- hci.c 15 Mar 2002 14:45:34 -0000 1.197 +++ hci.c 8 Apr 2002 09:58:37 -0000 1.198 @@ -47,7 +47,7 @@ #ifdef __KERNEL__ #include <linux/config.h> #include <linux/bluetooth/sysdep-2.1.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/timer.h> #include <linux/bluetooth/hci.h> #include <linux/bluetooth/hci_internal.h> @@ -195,7 +195,6 @@ =20 /* Link Policy Commands */ static s32 role_discovery(u16 con_hdl); -static s32 write_link_policy_settings(u16 con_hdl, u16 settings); =20 /* Host Controller and Baseband Commands */ static s32 write_inquiryscan_activity(u32 interval, u32 wind); @@ -300,22 +299,25 @@ static u8 hci_inq_aborted =3D 0; =20 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) -struct wait_queue *hci_wq =3D NULL; struct wait_queue *inq_wq =3D NULL; struct wait_queue *set_baudrate_wq =3D NULL; struct wait_queue *test_wq =3D NULL; struct wait_queue *get_name_wq =3D NULL; +struct wait_queue *read_clk_wq =3D NULL; +struct wait_queue *hci_wq =3D NULL; #else wait_queue_head_t hci_wq; wait_queue_head_t inq_wq; wait_queue_head_t set_baudrate_wq; wait_queue_head_t test_wq; wait_queue_head_t get_name_wq; +wait_queue_head_t read_clk_wq; #endif /* LINUX_VERSION_CODE */ =20 static s32 test_wq_active =3D 0; =20 static s32 result_param; +static u32 result_param_offset; =20 static struct inquiry_results *inq_res =3D NULL; =20 @@ -888,7 +890,7 @@ remote_name_request(buf + 3, 0); =20 /* enable m/s switch */=20 - write_link_policy_settings(hci_hdl, 0x01); + hci_write_link_policy_settings(hci_hdl, 0x01); /* we demand role switch as server */ if (force_msswitch && !i_am_initiator) { /* FIXME -- check return code */ @@ -948,7 +950,6 @@ hci_ctrl.acl_buf_count[hci_hdl], hci_hdl); hci_ctrl.hc_buf.acl_num +=3D hci_ctrl.acl_buf_count[hci_hdl]; hci_ctrl.acl_buf_count[hci_hdl] =3D 0; - #ifdef __KERNEL__ /* Trigger the send task to start sending data. */ if (buf_count()) {=09=20=20=20=20=20 @@ -1180,6 +1181,20 @@ =20 case READ_CLOCK_OFFSET_COMPLETE: D_CMD(__FUNCTION__ ": READ_CLOCK_OFFSET_COMPLETE\n"); + + if (buf[0]) {=20 + D_ERR(__FUNCTION__ ": Read clock offset failed due to %s\n", + get_err_msg(buf[0])); + result_param_offset =3D 0x0ff<<16; //Insert -1 in the third byte, erro= r to read clk offset + } else { + result_param_offset =3D (0x0ff&buf[3]) + (0x0ff00&(buf[4]<<8)); + DSYS(__FUNCTION__ ": Read clock offset result_param_offset =3D 0x%X\n"= ,=20 + result_param_offset); + } + +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0) + wake_up_interruptible(&read_clk_wq); +#endif /* LINUX_VERSION_CODE */ break; =20 case CONNECTION_PACKET_TYPE_CHANGED: @@ -1202,6 +1217,7 @@ process_vendor_event(buf, len, event_code); break; =20 +=09 default: DSYS(__FUNCTION__ ": UNKNOWN EVENT CODE 0x%x\n", event_code); break; @@ -1247,7 +1263,6 @@ D_CMD(__FUNCTION__ ": LINK_KEY_REQUEST_REPLY Success\n"); result_param =3D 0; } -=09=09=09 wake_up_interruptible(&hci_wq); break; =20=09=09 @@ -1263,7 +1278,6 @@ D_CMD(__FUNCTION__ ": LINK_KEY_REQUEST_NEGATIVE_REPLY Success\n"); result_param =3D 0; } -=09=09=09 wake_up_interruptible(&hci_wq); break; =20=09=09 @@ -1279,7 +1293,6 @@ D_CMD(__FUNCTION__ ": PIN_CODE_REQUEST_REPLY Success\n"); result_param =3D 0; } - wake_up_interruptible(&hci_wq); break; =20 @@ -1296,8 +1309,8 @@ D_CMD(__FUNCTION__ ": PIN_CODE_REQUEST_NEGATIVE_REPLY Success\n"); result_param =3D 0; } - wake_up_interruptible(&hci_wq); +=20 break;=09 =20 default: @@ -1373,6 +1386,7 @@ break; } else { DSYS("READ_TRANSMIT_POWER_LEVEL: handle %d, %d dBm\n", hci_handle(&r_v= al[1]), r_val[3]); + result_param =3D 0x0ff&r_val[3]; } break; =20 @@ -1514,15 +1528,35 @@ break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case SET_EVENT_FILTER: +=20 D_CMD(__FUNCTION__ ": SET_EVENT_FILTER\n"); break; =20=20=20=20=20=20=20=20=20=20=20=20=20 + case READ_NUM_BROADCAST_RETRANSMISSIONS: + D_CMD(__FUNCTION__ ": READ_NUM_BROADCAST_RETRANSMISSIONS = \n"); +=09=09=20=20=20=20=20=20=20=20 + if (r_val[0]) { + D_ERR(__FUNCTION__ ": READ_NUM_BROADCAST_RETRANSMISSIONS: %s\n", + get_err_msg(r_val[0])); + } else { + result_param =3D r_val[1]; + D_CMD(__FUNCTION__ ": READ_NUM_BROADCAST_RETRANSMISSIONS: num_b= roadcast_retran =3D 0x%X\n", + result_param); + } + break; + + case WRITE_NUM_BROADCAST_RETRANSMISSIONS: + D_CMD(__FUNCTION__ ": WRITE_NUM_BROADCAST_RETRANSMISSIONS \n "); + break; + + default: D_CMD(__FUNCTION__ ": HCI_HC, ocf %d not recognised!\n", ocf); break; } /* FIX ME : Wake up from the correct queue */ wake_up_interruptible(&hci_wq); +=20 break; =20 case HCI_LP: /* Link policy commands */ @@ -1602,6 +1636,7 @@ #endif #endif wake_up_interruptible(&hci_wq); +=20 break; =20=20=20=20=20=20=20=20=20=20=20=20=20 case READ_BD_ADDR: @@ -1622,6 +1657,31 @@ wake_up_interruptible(&hci_wq); break; =20=20=20=20=20=20=20=20=20=20=20 + case HCI_SP:=09 + release_cmd_timer(); + switch (ocf) {=20=20 + case READ_RSSI: + D_CMD(__FUNCTION__ ": READ_RSSI\n"); + if (r_val[0]) { + D_ERR(__FUNCTION__ ": READ_RSSI: %s\n", + get_err_msg(r_val[0])); + result_param =3D 256; + break; + } else { + result_param =3D r_val[3]; + D_CMD(__FUNCTION__ ": READ_RSSI : con_hdl=3D0x%X%X, RSSI_value=3D0x%X\= n", + r_val[1], r_val[2], result_param); + } + break; + default: + D_ERR(__FUNCTION__ ": HCI_SP, ocf %d not recognised!\n", ocf); + break; + } + wake_up_interruptible(&hci_wq); +=20 + break; + + case HCI_TC: /* Test Commands */ release_cmd_timer(); =20 @@ -1892,6 +1952,7 @@ init_waitqueue_head(&set_baudrate_wq); init_waitqueue_head(&test_wq); init_waitqueue_head(&get_name_wq); + init_waitqueue_head(&read_clk_wq); sema_init(&hci_cmd_semaphore, 1); sema_init(&hci_inq_semaphore, 1); #endif /* LINUX_VERSION_CODE */ @@ -1905,6 +1966,32 @@ } =20 s32 +hci_read_num_broadcast_restransmissions(void) +{ + s32 tmp; + + c_pkt.type =3D CMD_PKT; + c_pkt.opcode =3D hci_put_opcode(READ_NUM_BROADCAST_RETRANSMISSIONS, HCI_H= C);; + c_pkt.len =3D 0; +=20=20 + tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N, DEFAULT_TIMEOUT); +=09 + return tmp < 0 ? (-1)<<8 : result_param|(1<<8); +} + +s32 +hci_write_num_broadcast_restransmissions(u8 num_broadcast_retran) +{ + + c_pkt.type =3D CMD_PKT; + c_pkt.opcode =3D hci_put_opcode(WRITE_NUM_BROADCAST_RETRANSMISSIONS, HCI_= HC);; + c_pkt.len =3D 1; + c_pkt.data[0] =3D num_broadcast_retran; + + return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); +} + +s32 hci_init(void) { u32 i; @@ -2426,7 +2513,7 @@ } =20 s32 -write_link_policy_settings(u16 con_hdl, u16 settings) +hci_write_link_policy_settings(u16 con_hdl, u16 settings) { D_CMD(__FUNCTION__ "\n"); =20 @@ -2855,6 +2942,7 @@ c_pkt.opcode =3D hci_put_opcode(SET_EVENT_FILTER, HCI_HC); memcpy(c_pkt.data, data, len); c_pkt.len =3D len; + return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN= , DEFAULT_TIMEOUT); } =20 @@ -2900,15 +2988,18 @@ s32 hci_read_power_transmit_level(u32 con_hdl, unsigned char type) { + s32 tmp; + D_CMD(__FUNCTION__ "\n"); c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(READ_TRANSMIT_POWER_LEVEL, HCI_LP); + c_pkt.opcode =3D hci_put_opcode(READ_TRANSMIT_POWER_LEVEL, HCI_HC); c_pkt.len =3D 3; c_pkt.data[0] =3D con_hdl & 0xff; c_pkt.data[1] =3D (con_hdl >> 8) & 0xff; c_pkt.data[2] =3D type; =20=09 - return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N); + tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI= _HDR_LEN, DEFAULT_TIMEOUT); + return tmp<0 ? 2<<8 : result_param|(1<<8); } =20 /* The hci_host_buffer_size function is used by the Host to notify the Host @@ -3000,6 +3091,8 @@ 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); + + } =20 /* Defines of Informational Parameters function */ @@ -3116,13 +3209,14 @@ return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); } =20 + s32 -hci_sniff_mode(u16 hci_hdl, u16 max_int, u16 min_int, u16 attempt, u16 tim= eout) +hci_park_mode(u16 hci_hdl, u16 max_int, u16 min_int) {=20=20 D_CMD(__FUNCTION__ ": for connnection handle 0x%x\n", hci_hdl); =20 c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(SNIFF_MODE, HCI_LP); + c_pkt.opcode =3D hci_put_opcode(PARK_MODE, HCI_LP); =20=09 c_pkt.data[0] =3D hci_hdl & 0xff; c_pkt.data[1] =3D (hci_hdl >> 8) & 0xff; @@ -3130,46 +3224,45 @@ c_pkt.data[3] =3D (max_int >> 8) & 0xff; c_pkt.data[4] =3D min_int & 0xff; c_pkt.data[5] =3D (min_int >> 8) & 0xff; - c_pkt.data[6] =3D attempt & 0xff; - c_pkt.data[7] =3D (attempt >> 8) & 0xff; - c_pkt.data[8] =3D timeout & 0xff; - c_pkt.data[9] =3D (timeout >> 8) & 0xff; -=09 - c_pkt.len =3D 10; + c_pkt.len =3D 6; =20 return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); } =20 s32 -hci_exit_sniff_mode(u16 hci_hdl) +hci_sniff_mode(u16 hci_hdl, u16 max_int, u16 min_int, u16 attempt, u16 tim= eout) {=20 D_CMD(__FUNCTION__ ": for connnection handle 0x%x\n", hci_hdl); =20 c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(EXIT_SNIFF_MODE, HCI_LP); + c_pkt.opcode =3D hci_put_opcode(SNIFF_MODE, HCI_LP); =20=09 c_pkt.data[0] =3D hci_hdl & 0xff; c_pkt.data[1] =3D (hci_hdl >> 8) & 0xff; - c_pkt.len =3D 2; + c_pkt.data[2] =3D max_int & 0xff; + c_pkt.data[3] =3D (max_int >> 8) & 0xff; + c_pkt.data[4] =3D min_int & 0xff; + c_pkt.data[5] =3D (min_int >> 8) & 0xff; + c_pkt.data[6] =3D attempt & 0xff; + c_pkt.data[7] =3D (attempt >> 8) & 0xff; + c_pkt.data[8] =3D timeout & 0xff; + c_pkt.data[9] =3D (timeout >> 8) & 0xff; + c_pkt.len =3D 10; =20 return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); } =20 s32 -hci_park_mode(u16 hci_hdl, u16 max_int, u16 min_int) +hci_exit_sniff_mode(u16 hci_hdl) {=20=20 D_CMD(__FUNCTION__ ": for connnection handle 0x%x\n", hci_hdl); =20 c_pkt.type =3D CMD_PKT; - c_pkt.opcode =3D hci_put_opcode(PARK_MODE, HCI_LP); + c_pkt.opcode =3D hci_put_opcode(EXIT_SNIFF_MODE, HCI_LP); =20=09 c_pkt.data[0] =3D hci_hdl & 0xff; c_pkt.data[1] =3D (hci_hdl >> 8) & 0xff; - c_pkt.data[2] =3D max_int & 0xff; - c_pkt.data[3] =3D (max_int >> 8) & 0xff; - c_pkt.data[4] =3D min_int & 0xff; - c_pkt.data[5] =3D (min_int >> 8) & 0xff; - c_pkt.len =3D 6; + c_pkt.len =3D 2; =20 return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); } @@ -3340,22 +3433,29 @@ =20 s32 hci_read_clock_offset(u32 hdl) { + s32 tmp; + c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(READ_CLOCK_OFFSET, HCI_LC); c_pkt.data[0] =3D (hdl & 0xff); c_pkt.data[1] =3D ((hdl >> 8) & 0xff); c_pkt.len =3D 2; - return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N); + tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI= _HDR_LEN, DEFAULT_TIMEOUT*HZ);=20 + return tmp < 0 ? 2<<16 : result_param_offset|(1<<16); } =20 s32 hci_read_rssi(u32 hdl) { + s32 tmp; + c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(READ_RSSI, HCI_SP); c_pkt.data[0] =3D (hdl & 0xff); c_pkt.data[1] =3D ((hdl >> 8) & 0xff); c_pkt.len =3D 2; - return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N); + tmp =3D send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_L= EN); +=20=20=20=20=20=20=20=20 + return (tmp<0)|(result_param=3D=3D256) ? 2<<8 : result_param|(1<<8= ); } =20 /* Sends a connect request to the BT unit with the address bd_addr */ @@ -4091,7 +4191,9 @@ =20=09 printk(__FUNCTION__ ": Timeout when waiting for command response\n"); hci_cmd_pending =3D 0; +=20 wake_up_interruptible(&hci_wq); +=20 } #endif =20 @@ -4149,25 +4251,18 @@ #else DECLARE_WAITQUEUE(wait, current); #endif - down(&hci_cmd_semaphore); -=20 add_wait_queue(&hci_wq, &wait); current->state =3D TASK_INTERRUPTIBLE; - #endif hci_cmd_pending =3D 1; -=20=20 start_cmd_timer(max_time); -=09 tmp =3D send_cmd(cmd, len); =20 #ifdef __KERNEL__ while (hci_cmd_pending) schedule(); - remove_wait_queue(&hci_wq, &wait); - up(&hci_cmd_semaphore); #else while (hci_cmd_pending)=09=09 |
From: Willy S. <sag...@us...> - 2002-04-10 18:40:09
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.198 1.199=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added linux version ifdef for malloc.h/slab.h The diff of the modified file(s): --- hci.c 8 Apr 2002 09:58:37 -0000 1.198 +++ hci.c 10 Apr 2002 11:37:50 -0000 1.199 @@ -47,7 +47,11 @@ #ifdef __KERNEL__ #include <linux/config.h> #include <linux/bluetooth/sysdep-2.1.h> +#if LINUX_VERSION_CODE >=3D 0x20200 #include <linux/slab.h> +#else +#include <linux/malloc.h> +#endif #include <linux/timer.h> #include <linux/bluetooth/hci.h> #include <linux/bluetooth/hci_internal.h> |
From: Alain P. <apa...@us...> - 2002-04-25 15:08:50
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.199 1.200=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added an include mandatory to compile on our platform The diff of the modified file(s): --- hci.c 10 Apr 2002 11:37:50 -0000 1.199 +++ hci.c 25 Apr 2002 15:08:49 -0000 1.200 @@ -74,6 +74,7 @@ #include <errno.h> =20 #include <asm/unaligned.h> +#include <asm/param.h> =20 #include "include/bluetooth.h" #include "include/hci.h" |
From: Alain P. <apa...@us...> - 2002-08-26 15:12:50
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.201 1.202=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added example how to allow the module to be in sniff and hold mode. Added error handling for Mode change event. The diff of the modified file(s): --- hci.c 15 May 2002 13:29:41 -0000 1.201 +++ hci.c 26 Aug 2002 15:12:48 -0000 1.202 @@ -907,6 +907,10 @@ =20 /* enable m/s switch */=20 hci_write_link_policy_settings(hci_hdl, 0x01); + /* Uncomment next line (and comment previous) to enable */ + /* sniff and hold mode in your module */ + // hci_write_link_policy_settings(hci_hdl, 0x07); + /* we demand role switch as server */ if (force_msswitch && !i_am_initiator) { /* FIXME -- check return code */ @@ -1141,8 +1145,15 @@ break; =20 case MODE_CHANGE: + if (buf[0]) {=20 + D_ERR(__FUNCTION__ ": Mode changed failed due to %s\n", + get_err_msg(buf[0])); + } + else { D_CMD(__FUNCTION__ ": MODE_CHANGE on hci_hdl %d\n", hci_handle(&buf[1])); + printk("Mode : 0x%02x ", buf[3]); + } break; =20 case RETURN_LINK_KEYS: |
From: Anders J. <and...@us...> - 2002-10-17 14:30:03
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.202 1.203=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Set length in the command packet in hci_host_buffer.=20 The diff of the modified file(s): --- hci.c 26 Aug 2002 15:12:48 -0000 1.202 +++ hci.c 17 Oct 2002 14:29:58 -0000 1.203 @@ -3055,6 +3055,7 @@ c_pkt.data[c++] =3D (acl_num >> 8) & 0xff; c_pkt.data[c++] =3D sco_num & 0xff; c_pkt.data[c++] =3D (sco_num >> 8) & 0xff; + c_pkt.len =3D c; =20 return send_cmd_block((u8*) &c_pkt, c + CMD_HDR_LEN + HCI_HDR_LEN, DEFAUL= T_TIMEOUT); #else |
From: Peter K. <pk...@us...> - 2002-11-15 12:09:03
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.203 1.204=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Clean up. The diff of the modified file(s): --- hci.c 17 Oct 2002 14:29:58 -0000 1.203 +++ hci.c 15 Nov 2002 12:08:54 -0000 1.204 @@ -2,7 +2,7 @@ * hci.c -- Implementation of Bluetooth Host Controller Interface=20 * (UART transport layer) * - * Copyright (C) 2000, 2001 Axis Communications AB + * Copyright (C) 2000, 2001, 2002 Axis Communications AB * * Author: Mats Friden <mat...@ax...> * @@ -264,7 +264,6 @@ sizes and connections */ hci_controller hci_ctrl =3D {{0, 0, 0, 0, 0}}; =20=09=09=09=20 - #ifdef __KERNEL__ #ifdef USE_NCPTIMER static struct timer_list hci_ncp_timer; @@ -364,7 +363,6 @@ u8 *buf; /* Temporary pointer to the incoming data */ u32 tmp_data_len; =20 -=20 PRINTPKT(__FUNCTION__ ": ", data, count); =20=20=20 tmp_data_len =3D count; @@ -377,7 +375,6 @@ D_INDATA(__FUNCTION__ ": hci-%d\n", tmp_data_len); while (count > 0) { switch (state) { -=09=09=09 /* The first byte will tell us whether it is an event or a data packet */ case WAIT_FOR_PACKET_TYPE: @@ -388,7 +385,6 @@ case ACL_PKT: state =3D WAIT_FOR_ACL_HDR; break; case SCO_PKT: state =3D WAIT_FOR_SCO_HDR; break; default: -=09=09=09=20=20 /* Call vendor specific function if needed */ #ifdef CONFIG_BLUETOOTH_TEXASINSTRUMENTS=09=09=09=20=20 if (hci_receive_data_texas_specific(buf, count) =3D=3D 0) { @@ -1004,7 +1000,6 @@ #ifdef CONFIG_BLUETOOTH_USE_SECURITY_MANAGER if (buf[0]) { D_ERR(__FUNCTION__ ": AUTHENTICATION_COMPLETE: %s\n", get_err_msg(buf[0= ])); -=09=09=09 } =20=09=09 sec_man_event(HCI, get_bd(hci_handle(&buf[1])), AUTHENTICATION_COMPLETE,= buf, 1); @@ -1023,7 +1018,6 @@ } else { set_hci_con_name(buf + 1, buf + 7); } -=09=09=09 } /* Store the name in a global variable to send back to userland */ memcpy(name_request_response + 1, buf + 7, BT_NAME_LENGTH); @@ -1128,7 +1122,6 @@ get_err_msg(buf[0])); =20=09=09=09 /* fixme -- Notify l2cap that this BD will go down */ -=09=09=09 } else if (buf[7]) { DSYS(__FUNCTION__ ": Current master is 0x%04x%08x\n",=20 le16_to_cpuu(&buf[5]), le32_to_cpuu(&buf[1])); @@ -1362,7 +1355,6 @@ } break; =20=09=09=09 -=09=09=09 case READ_STORED_LINK_KEY: DSYS(__FUNCTION__ ": READ_STORED_LINK_KEY\n"); if (r_val[0]) { @@ -1405,7 +1397,6 @@ break;=09 =20=20=20=20=20=20=20=20=20=20=20=20=20 case READ_TRANSMIT_POWER_LEVEL:=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 -=09=09=20=20 printk(__FUNCTION__ ": READ_TRANSMIT_POWER_LEVEL\n"); if (r_val[0]) { D_ERR(__FUNCTION__ ": READ_TRANSMIT_POWER_LEVEL: %s\n", @@ -1536,7 +1527,6 @@ =20=09=09=09 break; =20 -=20=20=20=20=20=20=20=20=20=20=20=20 case READ_LINK_SUPERVISION_TIMEOUT: D_CMD(__FUNCTION__ ": Link supervision timeout is: %d\n", le16_to_cpuu(&buf[3])); @@ -1630,7 +1620,6 @@ } break; =20=09=09=09 - case READ_LOCAL_VERSION_INFORMATION: D_CMD(__FUNCTION__ ": READ_LOCAL_VERSION_INFORMATION\n"); if (r_val[0]) { @@ -1849,8 +1838,6 @@ hci_ctrl.local_bd[1], hci_ctrl.local_bd[0]); } =20=09=09=20=20=20=20=20=20=20 -=09=09=20=20=20=20=20=20=20 - s32 hci_sprint_remote_info(u8 *buf) { s32 pos =3D 0; @@ -2398,8 +2385,6 @@ packet types. */ =20 - - s32 change_connection_packet_type(u32 hci_hdl, u32 pkt_type) { @@ -2487,7 +2472,6 @@ } else { return hci_set_connection_encryption((u16)tmp, enable); } -=09 } =20 s32 @@ -2562,8 +2546,8 @@ s32 c =3D 0, retval =3D 0; s32 zero =3D 0; =20=09=09 - D_CMD(__FUNCTION__ ": for bd address 0x%02x:%02x:%02x:%02x:%02x:%02x\n" - , bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]); + D_CMD(__FUNCTION__ ": for bd address 0x%02x:%02x:%02x:%02x:%02x:%02x\n", + bd[5], bd[4], bd[3], bd[2], bd[1], bd[0]); =20=09 c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(REMOTE_NAME_REQUEST, HCI_LC); @@ -2598,7 +2582,6 @@ }=09 } =20 - s32=20 hci_flush(u32 hdl) { @@ -2697,7 +2680,6 @@ }=09 } =20 - s32 hci_change_local_name(u8 *new_name) { @@ -2712,7 +2694,6 @@ return send_cmd_block((u8*) &c_pkt , c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N, DEFAULT_TIMEOUT); } =20 - s32 hci_read_scan_enable(void) { @@ -3081,7 +3062,6 @@ c_pkt.data[4] =3D ((nbr_of_packets >> 8) & 0xff); c_pkt.len =3D 5; =20 -=09 /*FIXME -- Risk for race against sending acl packets ? */ tmp =3D bt_write_lower_driver((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI= _HDR_LEN); return tmp; @@ -3119,8 +3099,6 @@ return send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_H= DR_LEN, DEFAULT_TIMEOUT); else return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_= HDR_LEN); - - } =20 /* Defines of Informational Parameters function */ @@ -3140,9 +3118,8 @@ c_pkt.opcode =3D hci_put_opcode(READ_BUFFER_SIZE, HCI_IP); c_pkt.len =3D 0; =20 - if (block) { + if (block) 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); } @@ -3448,6 +3425,7 @@ c_pkt.len =3D 2; c_pkt.data[0] =3D co_ac_to & 0xff; c_pkt.data[1] =3D (co_ac_to >> 8) & 0xff; + return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N); } =20 @@ -3456,6 +3434,7 @@ c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(INQUIRY_CANCEL, HCI_LC); c_pkt.len =3D 0; + return send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N); } =20 @@ -3468,7 +3447,9 @@ c_pkt.data[0] =3D (hdl & 0xff); c_pkt.data[1] =3D ((hdl >> 8) & 0xff); c_pkt.len =3D 2; + tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI= _HDR_LEN, DEFAULT_TIMEOUT*HZ);=20 + return tmp < 0 ? 2<<16 : result_param_offset|(1<<16); } =20 @@ -3481,6 +3462,7 @@ c_pkt.data[0] =3D (hdl & 0xff); c_pkt.data[1] =3D ((hdl >> 8) & 0xff); c_pkt.len =3D 2; + tmp =3D send_cmd((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_L= EN); =20=20=20=20=20=20=20=20=20 return (tmp<0)|(result_param=3D=3D256) ? 2<<8 : result_param|(1<<8= ); @@ -3512,6 +3494,7 @@ lp_connect_rsp(u8 bd_addr[], u32 cfm) {=20 D_CMD(__FUNCTION__ ": Status: %d\n", cfm); + if (cfm) { #ifdef CONFIG_BLUETOOTH_EARLY_MSSWITCH if (force_msswitch) { @@ -3523,8 +3506,6 @@ #else return accept_connection_request(bd_addr, MS_SWITCH_REMAIN_SLAVE); #endif - - } else { return reject_connection_request(bd_addr, 0x0d); /* FIXME: 0x0d =3D due to limited resourses store this @@ -3611,7 +3592,6 @@ break; } =20 -=09=09=09 D_QUEUE("<--%d (%d)\n", buf_byte_count(-1),=20 hci_ctrl.hc_buf.acl_num); =20=09=09 @@ -4221,7 +4201,6 @@ hci_cmd_pending =3D 0; =20=20 wake_up_interruptible(&hci_wq); -=20 } #endif =20 |
From: Peter K. <pk...@us...> - 2002-11-15 12:13:38
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.204 1.205=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made send_acl_packet() return an error on failure, and handle it in send_acl_data_task(). It is probably not the correct solution, but it should hopefully not oops any longer. The diff of the modified file(s): --- hci.c 15 Nov 2002 12:08:54 -0000 1.204 +++ hci.c 15 Nov 2002 12:13:29 -0000 1.205 @@ -3577,12 +3577,12 @@ while ((hci_ctrl.hc_buf.acl_num > 0) && bytes2send ) { sti(); =20 - /* FIXME -- what if send_acl_packet fails ??? - Then acl_num will decrease anyway ... */ - sent_bytes =3D send_acl_packet(tx_buf); =20 - if (sent_bytes !=3D 0) { + if (sent_bytes < 0) { + /* FIXME: Is this correct? Probably not... */ + bytes2send =3D 0; + } else if (sent_bytes > 0) { bytes2send -=3D sent_bytes; cli(); hci_ctrl.acl_buf_count[tx_buf->hci_hdl]++; @@ -3635,7 +3635,8 @@ if ((cur_data < tx_buf->data) || (cur_data > (tx_buf->data+tx_buf->subscr_len))) { - D_ERR("send_acl_packet : Corrupting btmem buffers !!!\n"); + D_ERR(__FUNCTION__ ": Buffer corrupted (deleted?)!\n"); + return -EFAULT; } =20 /* Fills in the HCI header in the packet */ |
From: Anders J. <and...@us...> - 2003-12-02 11:58:28
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.214 1.215=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Changed some debug printing. The diff of the modified file(s): --- hci.c 2003/11/18 18:03:33 1.214 +++ hci.c 2003/12/02 11:58:27 1.215 @@ -1414,7 +1414,7 @@ process_return_param(u8 *buf) break; =20 case READ_TRANSMIT_POWER_LEVEL: - printk(__FUNCTION__ ": READ_TRANSMIT_POWER_LEVEL\n"); + D_CMD(__FUNCTION__ ": READ_TRANSMIT_POWER_LEVEL\n"); if (r_val[0]) { D_ERR(__FUNCTION__ ": READ_TRANSMIT_POWER_LEVEL: %s\n", get_err_msg(r_val[0])); @@ -1459,7 +1459,6 @@ process_return_param(u8 *buf) } else { result_param =3D r_val[1]; } - printk("READ_SCAN_ENABLE %d\n", result_param); break; =20 case WRITE_SCAN_ENABLE: |
From: Anders J. <and...@us...> - 2004-04-14 17:40:56
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- hci.c 1.215 1.216=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Don't do M/S switch when initiating a baseband connection. The diff of the modified file(s): --- hci.c 2003/12/02 11:58:27 1.215 +++ hci.c 2004/04/14 17:40:38 1.216 @@ -3618,13 +3618,8 @@ lp_connect_req(u8 bd_addr[]) =20 i_am_initiator =3D 1; =20 -#ifdef CONFIG_BLUETOOTH_ENABLE_MSSWITCH - return create_connection(bd_addr, 0xcc18, 0x00, 0x00, - 0x00, ALLOW_ROLE_SWITCH); -#else return create_connection(bd_addr, 0xcc18, 0x00, 0x00, 0x00, DONT_ALLOW_ROLE_SWITCH); -#endif } =20 /* A response from L2CAP to a previous lp_connect_ind */ |