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-13 15:53:39
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.196 1.197=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made the BT_SET_DFU_MODE ioctl available even if BCSP is not supported. The diff of the modified file(s): --- bluetooth.c 2001/09/12 13:55:36 1.196 +++ bluetooth.c 2001/09/13 15:53:38 1.197 @@ -1096,6 +1096,15 @@ put_user(tmp, (s32*)arg); return 0; =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; + #ifdef CONFIG_BLUETOOTH_CSR /* | ps_key (u16) | rw_mode (u16) | len (u16) | params (u16[])| */ case BT_CSR_PSKEY: @@ -1119,15 +1128,6 @@ printk("Sync failed\n"); return -ETIMEDOUT; } - return 0; - - 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; =20 case BT_SEND_DFU_COMMAND: |
From: Peter K. <pk...@us...> - 2001-09-20 10:11:10
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.197 1.198=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Do not check the pid when unregistering ttyBTC. The diff of the modified file(s): --- bluetooth.c 2001/09/13 15:53:38 1.197 +++ bluetooth.c 2001/09/20 10:11:08 1.198 @@ -2933,11 +2933,8 @@ if (line =3D=3D BT_NBR_PORTS-BT_NBR_CTRLPORTS) { if (--NBR_CTRL_FDS !=3D 0) return 0; /* still more open fd:s on ttyBTC */ - } - - /* Check that the pid closing is the one that opened the tty */ - if (current->pid !=3D bt_ctrl.session[line].pid) - { + } else if (current->pid !=3D bt_ctrl.session[line].pid) { + /* The pid closing the tty is not the one that opened it */ BT_DRIVER(__FUNCTION__ ": Invalid pid\n"); return -1; } |
From: Peter K. <pk...@us...> - 2001-10-02 11:58:52
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.198 1.199=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use available defines in bt_catch_ncp(). The diff of the modified file(s): --- bluetooth.c 2001/09/20 10:11:08 1.198 +++ bluetooth.c 2001/10/02 11:58:50 1.199 @@ -1793,8 +1793,9 @@ =20 /* || uart hdr | event code | par_len | nbr_handles | [data...] || */ =20 - while (((index+2) < count) && (data[index] =3D=3D 0x4) &&=20 - (data[index+1] =3D=3D 0x13) ) { + while (index+2 < count && + data[index] =3D=3D EVENT_PKT &&=20 + data[index+1] =3D=3D NBR_OF_COMPLETED_PACKETS) { /* we found a NCP */ index +=3D (3 + data[index + 2]); /* event hdr + par len */ } |
From: Peter K. <pk...@us...> - 2001-10-02 13:45:20
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.199 1.200=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Call update_ncp() directly from bt_catch_ncp() instead of calling bt_receive_data() since it calls hci_receive_data() which is a state machine, and we do not want to mess up its state... The diff of the modified file(s): --- bluetooth.c 2001/10/02 11:58:50 1.199 +++ bluetooth.c 2001/10/02 13:44:49 1.200 @@ -1802,7 +1802,16 @@ =20 if (index =3D=3D count) { /* Contains _only_ NCP data, parse it ! */ - bt_receive_data(data, count); + + /* The easy way would be to call bt_receive_data(data, count), + but since it calls hci_receive_data() which is a state + machine, we might mess up its state... */ + index =3D 0; + while (index+2 < count) { + update_ncp(data[index+3], data+index+4); + index +=3D (3 + data[index + 2]); + } + return 1; } =20=09 |
From: Peter K. <pk...@us...> - 2001-10-16 14:38:18
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.204 1.205=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Make sure KERNEL_VERSION() is defined before using it (thanks to Alain Paschoud for spotting this). The diff of the modified file(s): --- bluetooth.c 2001/10/12 12:03:22 1.204 +++ bluetooth.c 2001/10/16 11:10:14 1.205 @@ -51,6 +51,11 @@ #include <linux/delay.h> #include <linux/timer.h> =20 +/* Make sure KERNEL_VERSION() is defined */ +#ifndef KERNEL_VERSION +#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) # ifdef MODULE # define module_init(x) int init_module(void) { return x(); } |
From: Peter K. <pk...@us...> - 2001-10-16 14:45:21
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.205 1.206=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: If theline argument to the BTISLOWERCONNECTED ioctl is negative, it checks the status for the current tty. The diff of the modified file(s): --- bluetooth.c 2001/10/16 11:10:14 1.205 +++ bluetooth.c 2001/10/16 14:44:56 1.206 @@ -621,7 +621,8 @@ s32 line;=09=20=20 =20 copy_from_user(&line, (s32*)arg, size); - return (SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED); + return (line >=3D 0 && SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) || + (line < 0 && SESSIONSTATE(GET_TTYLINE(tty)) =3D=3D BT_LOWERCONNEC= TED); } =20=09 case BTINITSTACK: |
From: Anders J. <and...@us...> - 2001-10-16 16:12:14
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.206 1.207=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * BTISLOWERCONNECTED changed back to only allow a specified line. The diff of the modified file(s): --- bluetooth.c 2001/10/16 14:44:56 1.206 +++ bluetooth.c 2001/10/16 16:12:14 1.207 @@ -621,8 +621,7 @@ s32 line;=09=20=20 =20 copy_from_user(&line, (s32*)arg, size); - return (line >=3D 0 && SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED) || - (line < 0 && SESSIONSTATE(GET_TTYLINE(tty)) =3D=3D BT_LOWERCONNEC= TED); + return SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED; } =20=09 case BTINITSTACK: |
From: Peter K. <pk...@us...> - 2001-10-22 12:49:21
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.207 1.208=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Make sure bcsp_shutdown() is called if bcsp_init() fails. The diff of the modified file(s): --- bluetooth.c 2001/10/16 16:12:14 1.207 +++ bluetooth.c 2001/10/22 12:49:20 1.208 @@ -1131,6 +1131,7 @@ BT_DRIVER("BTINITBCSP\n"); if (bcsp_init() < 0) { printk("Sync failed\n"); + bcsp_shutdown(); return -ETIMEDOUT; } return 0; @@ -2564,7 +2565,6 @@ #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP if (bt_use_bcsp(-1) && !bcsp_issyncronized()) {=20=20 if (bcsp_init() < 0) { - bcsp_shutdown(); goto init_failed_exit0; } } @@ -2600,10 +2600,10 @@ =20 init_failed_exit1:=20 hci_shutdown(); +init_failed_exit0: #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP bcsp_shutdown(); #endif -init_failed_exit0: btmem_shutdown(); if (tmp_bt_buf) { free_page((unsigned long) tmp_bt_buf); |
From: Peter K. <pk...@us...> - 2001-11-08 14:27:02
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.209 1.210=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added names for the Bluetooth driver and line discipline (supported in Linux 2.2 and 2.4). The diff of the modified file(s): --- bluetooth.c 2001/10/30 15:04:52 1.209 +++ bluetooth.c 2001/11/08 14:27:01 1.210 @@ -2275,6 +2275,9 @@ =20 memset(&bt_driver, 0, sizeof(bt_driver)); bt_driver.magic =3D BT_TTY_DRIVER_MAGIC; +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,2,0) + bt_driver.driver_name =3D "bluetooth"; +#endif bt_driver.name =3D "ttyBT"; bt_driver.major =3D BT_TTY_MAJOR; bt_driver.minor_start =3D 0; @@ -2327,6 +2330,9 @@ =20=09 memset(&bt_ldisc, 0, sizeof(bt_ldisc)); bt_ldisc.magic =3D TTY_LDISC_MAGIC; +#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,2,0) + bt_ldisc.name =3D "n_bt"; +#endif bt_ldisc.open =3D bt_tty_open; bt_ldisc.close =3D bt_tty_close; bt_ldisc.read =3D bt_tty_read; @@ -2337,8 +2343,8 @@ #else bt_ldisc.poll =3D bt_tty_poll; #endif - bt_ldisc.receive_room =3D bt_tty_room; bt_ldisc.receive_buf =3D bt_receive_lower_stack; + bt_ldisc.receive_room =3D bt_tty_room; bt_ldisc.write_wakeup =3D bt_tty_wakeup; =20=09 status =3D tty_register_ldisc(N_BT, &bt_ldisc); |
From: Anders J. <and...@us...> - 2001-11-13 10:45:31
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.210 1.211=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * test_process_cmd now returns a correct value. The diff of the modified file(s): --- bluetooth.c 2001/11/08 14:27:01 1.210 +++ bluetooth.c 2001/11/13 10:45:31 1.211 @@ -689,8 +689,7 @@ =20 copy_from_user(cmd, (u8*)arg, 260); =20=09=09 - test_process_cmd(cmd+1, cmd[0]); - return 0; + return test_process_cmd(cmd+1, cmd[0]); } =20 /* Ioctls executing HCI commands */ |
From: Anders J. <and...@us...> - 2001-11-15 15:01:57
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.212 1.213=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added bt_handle_hw_error. The diff of the modified file(s): --- bluetooth.c 2001/11/15 11:18:00 1.212 +++ bluetooth.c 2001/11/15 15:01:57 1.213 @@ -258,6 +258,7 @@ /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 extern hci_controller hci_ctrl; +static u8 btdm_pid =3D 0; =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 @@ -1335,6 +1336,8 @@ BT_LDISC(__FUNCTION__ "\n"); DSYS("Setting BT driver to use serial tty\n"); sertty =3D tty; + DSYS("Setting btdm_pid (%d)\n", current->pid); + btdm_pid =3D current->pid; return 0; } =20 @@ -2524,6 +2527,25 @@ } return old; } + +void +bt_handle_hw_error(u8 error) +{ + printk(__FUNCTION__ ": Received error with code 0x%02X ", error); + switch(error) { + case 0xfe: + printk(", resetting module\n"); + if(btdm_pid) { + kill_proc(btdm_pid, SIGUSR1, 1); + } else { + printk(__FUNCTION__ ": No btdm PID found, ignoring\n"); + }=09 + break; + default: + printk(", ignoring\n"); + } +} + =20 s32 bt_init_stack(void) |
From: Fredrik S. <fre...@us...> - 2001-12-04 12:27:03
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.214 1.215=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added ioctl handling for BNEP, init of BNEP. The diff of the modified file(s): --- bluetooth.c 2001/11/22 14:02:41 1.214 +++ bluetooth.c 2001/12/04 12:27:02 1.215 @@ -255,6 +255,14 @@ void bt_linebuf_send(s32 line); #endif =20 +#ifdef CONFIG_BLUETOOTH_PAN +void bnep_init(void); +u32 bnep_connect_req(u8 *bd_addr); +u32 bnep_test(u8 *p); +u32 bnep_set_multicast_filter(u8 *filter); +u32 bnep_set_protocol_filter(u16 *filter); +#endif + /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 extern hci_controller hci_ctrl; @@ -1174,6 +1182,41 @@ } #endif /* CONFIG_BLUETOOTH_SUPPORT_BCSP */ =20 +#ifdef CONFIG_BLUETOOTH_PAN + case BNEPCONNECT: + { + copy_from_user(&bd_addr, (s32*)arg, size); + BT_DRIVER("BNEP connection to %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + bd_addr[0],bd_addr[1],bd_addr[2],bd_addr[3],bd_addr[4],bd_addr[5]); + return bnep_connect_req(bd_addr); + } + +#ifdef CONFIG_BLUETOOTH_UNPLUG_TEST + case BNEPTEST: + { + s8 temp[5]; + copy_from_user(&temp, (s32*)arg, size); + printk("BNEP TEST %i\n", temp[0]);=20=20=20 + return bnep_test(&temp[0]); + } + + case BNEPADDPROTOCOLFILTER: + { + u16 temp[2]; + copy_from_user(&temp, (s32*)arg, size); + return bnep_set_protocol_filter(&temp[0]); + } + + case BNEPADDMULTICASTFILTER: + { + u8 temp[12]; + copy_from_user(&temp, (s32*)arg, size); + return bnep_set_multicast_filter(&temp[0]); + } +#endif /* CONFIG_BLUETOOTH_UNPLUG_TEST */ + +#endif /* CONFIG_BLUETOOTH_PAN */ + default:=09=09 return -ENOIOCTLCMD; } @@ -2608,6 +2651,9 @@ rfcomm_init(); sdp_init(1); /* For now always init as server */ tcs_init(); +#ifdef CONFIG_BLUETOOTH_PAN + bnep_init(); +#endif test_init(); #endif } |
From: Peter K. <pk...@us...> - 2001-12-07 17:45:08
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.215 1.216=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Do not disable page scanning when shutting down the stack if it has been started in DFU mode. The diff of the modified file(s): --- bluetooth.c 2001/12/04 12:27:02 1.215 +++ bluetooth.c 2001/12/07 17:45:06 1.216 @@ -3022,14 +3022,16 @@ { s32 i; struct bt_session *bt; - DSYS("Shutting down bluetooth stack\n"); =20 - /* Disable page scan as we don't want any new connections now */ - DSYS("Disabling page scan\n"); + DSYS("Shutting down bluetooth stack\n"); =20 - hci_write_scan_enable(0x00); if (bt_stack_initiated) { if (!bt_dfu_mode(-1)) { + /* Disable page scan as we don't want any new + connections now */ + DSYS("Disabling page scan\n"); + hci_write_scan_enable(0x00); + /* disconnect all active connections */ for (i =3D 0; i < BT_NBR_DATAPORTS;i++) { bt =3D &bt_ctrl.session[i]; |
From: Anders J. <and...@us...> - 2002-01-06 19:49:42
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.216 1.217=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Made GETINFO work. The diff of the modified file(s): --- bluetooth.c 2001/12/07 17:45:06 1.216 +++ bluetooth.c 2002/01/06 19:49:40 1.217 @@ -50,7 +50,6 @@ #include <linux/sched.h> #include <linux/delay.h> #include <linux/timer.h> - /* Make sure KERNEL_VERSION() is defined */ #ifndef KERNEL_VERSION #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) @@ -1066,11 +1065,13 @@ case BTGETINFO: { u8 bd[6]; - u16 type; + u8 tmp[2]; + u16 type =3D 0; =20 /* first byte contains length of whole hci message */ copy_from_user(&bd, (u8*)arg, 6); - copy_from_user(&type, (u8*)arg + 6, 2); + copy_from_user(&tmp, (u8*)arg + 6, 2); + type =3D ((tmp[0] << 8) & 0xff00) | (tmp[1] & 0xff); =20 BT_DRIVER("BTGETINFO: Type %d\n", type); =20 |
From: Anders J. <and...@us...> - 2002-01-15 11:01:57
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.217 1.218=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Don't use the len variable in the BNEPTEST ioctl. The diff of the modified file(s): --- bluetooth.c 2002/01/06 19:49:40 1.217 +++ bluetooth.c 2002/01/15 11:01:56 1.218 @@ -1196,7 +1196,7 @@ case BNEPTEST: { s8 temp[5]; - copy_from_user(&temp, (s32*)arg, size); + copy_from_user(&temp, (s32*)arg, 5); printk("BNEP TEST %i\n", temp[0]);=20=20=20 return bnep_test(&temp[0]); } |
From: Anders J. <and...@us...> - 2002-01-24 12:43:37
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.218 1.219=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Handle btmem init failure. The diff of the modified file(s): --- bluetooth.c 2002/01/15 11:01:56 1.218 +++ bluetooth.c 2002/01/24 12:43:36 1.219 @@ -1195,8 +1195,8 @@ #ifdef CONFIG_BLUETOOTH_UNPLUG_TEST case BNEPTEST: { - s8 temp[5]; - copy_from_user(&temp, (s32*)arg, 5); + s8 temp[2]; + copy_from_user(&temp, (s32*)arg, 2); printk("BNEP TEST %i\n", temp[0]);=20=20=20 return bnep_test(&temp[0]); } @@ -2627,7 +2627,15 @@ add_timer(&bt_clear_led_timer); #endif =20 - btmem_init(); + if(btmem_init() =3D=3D -1) { + D_ERR("BTMEM init failed"); +#ifdef __CRIS__ + del_timer(&bt_clear_led_timer); + bt_set_leds(NO_BLUETOOTH_ACTIVITY); +#endif + return -1; + } +=09 =20 #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP if (bt_use_bcsp(-1) && !bcsp_issyncronized()) {=20=20 |
From: Willy S. <sag...@us...> - 2002-04-08 16:45:40
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bluetooth.c 1.225 1.226=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added READCLOCKOFFSET HCIPARKMODE HCISNIFFMODE WRITELINKPOLICY HCIHOLDMODE = HCIREADNUMBROADCASTRETRANS HCIREADTRANSMITTPOWERLEVEL HCIREADRSSI HCIWRITEP= AGETO The diff of the modified file(s): --- bluetooth.c 8 Mar 2002 09:41:42 -0000 1.225 +++ bluetooth.c 8 Apr 2002 09:15:21 -0000 1.226 @@ -46,7 +46,8 @@ #include <linux/termios.h> #include <linux/tty.h> #include <linux/module.h> -#include <linux/malloc.h> +//#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/sched.h> #include <linux/delay.h> #include <linux/timer.h> @@ -535,6 +536,7 @@ } }=09 =20 +=09 switch (cmd) { case BT_SDP_REQUEST: { @@ -802,6 +804,31 @@ hci_set_connection_encryption_bd(param + 1, *param); break; } + + case HCIREADCLOCKOFFSET: + { + /* Return parameters (4 bytes): + * | 2 bytes CLOCK OFFSET | 1 byte tmp | 2 bytes unused | + * if tmp < 0 then not valid CLOCK OFFSET=20 + * else valid CLOCK OFFSET + */ + u32 con_hdl; + s32 result; + u8 param[2]; + + BT_DRIVER(__FUNCTION__ ": HCIREADCLOCKOFFSET\n");=09 + + copy_from_user(param, (u8*)arg, 2); + con_hdl =3D (0x0ff¶m[1]) + (0x0ff&(param[0]<<8)); + + result =3D hci_read_clock_offset(con_hdl); + put_user(result, (s32*)arg); + break; + + } + + + /* Link Policy Commands */ =20=09 case HCISWITCHROLE: @@ -814,6 +841,106 @@ break; } =20 + case HCIPARKMODE: + { + /* Packet format received (6 bytes) params =3D + * | 2 bytes Con Hdl | 2 bytes Beacon Max Int | 2 bytes Beacon Min Int | + */ + s32 result; + u8 param[6]; + u16 con_hdl; + u16 Beacon_Max_Int, Beacon_Min_Int; + + BT_DRIVER(__FUNCTION__ ": HCI_PARK_MODE\n"); + copy_from_user(param, (u8*)arg, 6); + con_hdl =3D (0x0ff¶m[1]) + (0x0ff00&(param[0]<<8)); + Beacon_Max_Int =3D (0x0ff¶m[3]) + (0x0ff00&(param[2]<<8));=09=09 + Beacon_Min_Int =3D (0x0ff¶m[5]) + (0x0ff00&(param[4]<<8)); +=09=09 + result =3D hci_park_mode(con_hdl, Beacon_Max_Int, Beacon_Min_Int); + put_user(result, (s32*)arg); + break; + } + + + case HCISNIFFMODE: + { + /* Packet format received (10 bytes) params =3D + * | 2 bytes Con Hdl | 2 bytes Sniff Max Int | 2 bytes Sniff Min Int | + * 2 bytes Sniff_Attempt | 2 bytes Sniff_Timeout=20 + */ + s32 result; + u8 param[10]; + u16 con_hdl; + u16 Sniff_Max_Int, Sniff_Min_Int, Sniff_Attempt, Sniff_Timeout; + + BT_DRIVER(__FUNCTION__ ": HCI_PARK_MODE\n"); + copy_from_user(param, (u8*)arg, 10); + con_hdl =3D (0x0ff¶m[1]) + (0x0ff00&(param[0]<<8)); + Sniff_Max_Int =3D (0x0ff¶m[3]) + (0x0ff00&(param[2]<<8));=09=09 + Sniff_Min_Int =3D (0x0ff¶m[5]) + (0x0ff00&(param[4]<<8)); + Sniff_Attempt =3D (0x0ff¶m[7]) + (0x0ff00&(param[6]<<8)); + Sniff_Timeout =3D (0x0ff¶m[9]) + (0x0ff00&(param[8]<<8)); +=09=09 + result =3D hci_sniff_mode(con_hdl, Sniff_Max_Int, Sniff_Min_Int, Sniff_A= ttempt, Sniff_Timeout); + put_user(result, (s32*)arg); + break; + } + + case HCIEXITPARKMODE: + {=09 + s32 result; + u16 con_hdl; +=20=20 + BT_DRIVER(__FUNCTION__ ": HCI_EXIT_PARK_MODE\n"); + GET_USER(con_hdl,(u16*)arg); +=20=20=20=20=20=20=20=20=20=20=20=20=20 + result =3D hci_exit_park_mode(con_hdl); + put_user(result, (s32*)arg); + break; + } + + case HCIWRITELINKPOLICYSETTINGS: + { + /* Packet format received (4 bytes) params =3D + * | 2 bytes Con Hdl | 2 bytes Link Policy Settings + */ + s32 result; + u16 con_hdl; + u16 link_policy_settings; + u8 param[4]; + + copy_from_user(param, (u8*)arg, 4); + con_hdl =3D (0x0ff¶m[1]) + (0x0ff00&(param[0]<<8)); + link_policy_settings =3D (0x0ff¶m[3]) + (0x0ff00&(param[2]= <<8));=09 + + result =3D hci_write_link_policy_settings(con_hdl, link_po= licy_settings); + put_user(result, (s32*)arg); + break; + } + + case HCIHOLDMODE: + { + /* Packet format received (6 bytes) params =3D + * | 2 bytes Con Hdl | 2 bytes Hold Mode Max Interval | 2 bytes = Hold Mode Max Interval | 2 bytes Hold Mode Min Interval + */ + s32 result; + u16 con_hdl; + u16 hold_mode_max_interval; + u16 hold_mode_min_interval; + u8 param[6]; + + copy_from_user(param, (u8*)arg, 4); + con_hdl =3D (0x0ff¶m[1]) + (0x0ff00&(param[0]<<8)); + hold_mode_max_interval =3D (0x0ff¶m[3]) + (0x0ff00&(par= am[2]<<8));=09 + hold_mode_min_interval =3D (0x0ff¶m[5]) + (0x0ff00&(par= am[4]<<8)); + + result =3D hci_hold_mode(con_hdl, hold_mode_max_interval, h= old_mode_min_interval);=09 + + put_user(result, (s32*)arg); + break;=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + } + /* Host Controller & Baseband Commands */ =20 case HCIRESET: @@ -972,11 +1099,89 @@ =20 /* The size of the filter is in the first two bytes */ filter_size =3D ((param[0] << 8) & 0xff00) | param [1]; - hci_set_event_filter(¶m[2], filter_size); break; }=09 =20=09=09 + case HCIREADNUMBROADCASTRETRANSMISSIONS: + { + u8 num_broadcast_retran[2]; + s32 result; +=20 + BT_DRIVER(__FUNCTION__ ": HCIREADNUMBROACASTRETRANSMISSIONS\n"); + result =3D hci_read_num_broadcast_restransmissions(); + num_broadcast_retran[0] =3D (u8)(0x0ff&result); + num_broadcast_retran[1] =3D (u8)(0x0ff&(result>>8)); + copy_to_user((u8*)arg, num_broadcast_retran, 2); + break; + } + + case HCIWRITENUMBROADCASTRETRANSMISSIONS: + { + u8 status; + u8 num_broadcast_retran; + u32 result; + + BT_DRIVER(__FUNCTION__ ": HCIREADNUMBROACASTRETRANSMISSIONS\n"); + GET_USER(num_broadcast_retran, (u8*)arg); + result =3D hci_write_num_broadcast_restransmissions(num_broadcast_retran= ); + status =3D (u8)(0x0ff&result); + put_user(status, (u8*)arg); + break; + } + case HCIREADTRANSMITPOWERLEVEL: + { + /* Packet received format: + * | 2 bytes Connection Handle | 1 bite Type | + * Packet transmitted format: + * | 1 byte status | 1 byte Transmit Power Level | 1 byte unused | + */ + u8 param[3]; + u32 con_hdl; + u8 type; + s32 result; +=09=09 + BT_DRIVER(__FUNCTION__ ": HCIREADTRANSMITPOWERLEVEL\n"); + copy_from_user(param, (u8*)arg, 3); + con_hdl =3D (0x0ff¶m[1]) + (0x0ff&(param[0]<<8)); + type =3D param[2]; + result =3D hci_read_power_transmit_level(con_hdl, type); + param[0] =3D (0x0ff&result); + param[1] =3D 0x0ff&(result>>8); + copy_to_user((u8*)arg, param, 3); + break; + } + + + case HCIWRITELINKSUPERVISIONTO: + { + /* The vector param[2] is: + * param[0] =3D Connection Handle + * param[1] =3D Link Supervision Timeout + */ + u32 param[2]; + s32 result; + + BT_DRIVER(__FUNCTION__ ": HCIWRITELINKSUPERVISIONTO\n"); + copy_from_user(param, (u32*)arg, 8); + result =3D hci_write_link_supervision_to(param[0], param[1],1); + param[0] =3D result; + put_user(param[0], (u32*)arg); + break; + } +=20=09=09 + case HCIWRITEPAGETO: + { + u32 page_to; + s32 result; + + BT_DRIVER(__FUNCTION__ ": HCIWRITEPAGETO\n"); + GET_USER(page_to, (u32*)arg); + result =3D hci_write_page_to(page_to); + put_user(result, (s32*)arg); + break; + } + /* Informational Parameters */ =20 case HCIREADLOCALBDADDR: @@ -996,6 +1201,30 @@ break; } =20 + /* Status Parameters */ + case HCIREADRSSI: + { + /* Return parameters (4 bytes): + * | 1 byte RSSI | 1 byte tmp | 2 bytes unused | + * if tmp < 0 then not valid RSSI=20 + * else valid RSSI + */ + u32 con_hdl; + u8 param[2]; + + BT_DRIVER(__FUNCTION__ ": HCIREADRSSI\n"); +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 + copy_from_user(param, (u8*)arg, 2); + con_hdl =3D (0x0ff¶m[1]) + (0x0ff&(param[0]<<8)); + + GET_USER(con_hdl, (u32*)arg); + tmp =3D hci_read_rssi(con_hdl); + put_user(tmp, (s32*)arg); +=09=09=20=20 + break; + } +=20 + case HCIREADCOUNTRYCODE: BT_DRIVER(__FUNCTION__ ": HCIREADCOUNTRYCODE\n"); =20=09=09 @@ -1192,10 +1421,29 @@ #ifdef CONFIG_BLUETOOTH_PAN case BNEPCONNECT: { + s32 tmp; + u8 result[4]; + copy_from_user(&bd_addr, (s32*)arg, size); BT_DRIVER("BNEP connection to %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", bd_addr[0],bd_addr[1],bd_addr[2],bd_addr[3],bd_addr[4],bd_addr[5]); - return bnep_connect_req(bd_addr); + tmp =3D bnep_connect_req(bd_addr); + + result[0] =3D (tmp>>8)&0x0ff; // conn hdl + result[1] =3D (tmp>>16)&0x0ff; // conn hdl + result[2] =3D (tmp>>24)&0x0ff; // BNEP interface number + + copy_to_user((s32*)arg, (u8*)result, 4); + return 0x0ff&tmp; + } + + case BNEPDISCONNECT: + { + copy_from_user(&bd_addr, (s32*)arg, size); + BT_DRIVER("BNEP DISconnection from %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", + bd_addr[0],bd_addr[1],bd_addr[2],bd_addr[3],bd_addr[4],bd_addr[5]); +=20 + return bnep_disconnect_req(bd_addr); } =20 #ifdef CONFIG_BLUETOOTH_UNPLUG_TEST @@ -2494,6 +2742,7 @@ procfs_status =3D proc_register_dynamic(&proc_root, &bt_proc_doit); #endif /* LINUX_VERSION_CODE */ =20 + if (procfs_status < 0) { D_ERR("Could not register proc file bt_status %d\n",=20 procfs_status); @@ -2505,6 +2754,14 @@ D_ERR("Could not register proc file bnep_status %d\n", procfs_status); } +#ifdef BNEP_PROC + procfs_status =3D bnep_create_proc_file(); + if (procfs_status < 0) { + D_ERR("Could not register proc file bnep_proc %d\n", + procfs_status); + } + +#endif #endif /* CONFIG_BLUETOOTH_PAN */ =20 #endif /* CONFIG_BLUETOOTH_PROC */ |
From: Willy S. <sag...@us...> - 2002-04-10 18:40:51
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bluetooth.c 1.226 1.227=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): --- bluetooth.c 8 Apr 2002 09:15:21 -0000 1.226 +++ bluetooth.c 10 Apr 2002 11:34:55 -0000 1.227 @@ -46,8 +46,11 @@ #include <linux/termios.h> #include <linux/tty.h> #include <linux/module.h> -//#include <linux/malloc.h> +#if LINUX_VERSION_CODE >=3D 0x20200 #include <linux/slab.h> +#else +#include <linux/malloc.h> +#endif #include <linux/sched.h> #include <linux/delay.h> #include <linux/timer.h> |
From: Alain P. <apa...@us...> - 2002-05-16 15:05:53
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bluetooth.c 1.227 1.228=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Adde DevFS compatibility. To use DevFS, you'll have to create a symbolic li= nk from ttyBTC to ttyBT7. The diff of the modified file(s): --- bluetooth.c 10 Apr 2002 11:34:55 -0000 1.227 +++ bluetooth.c 16 May 2002 15:05:52 -0000 1.228 @@ -2604,7 +2604,11 @@ #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,2,0) bt_driver.driver_name =3D "bluetooth"; #endif +#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS)) + bt_driver.name =3D "ttyBT%d"; +#else bt_driver.name =3D "ttyBT"; +#endif bt_driver.major =3D BT_TTY_MAJOR; bt_driver.minor_start =3D 0; bt_driver.num =3D BT_NBR_PORTS; |
From: Peter K. <pk...@us...> - 2002-08-01 16:13:20
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bluetooth.c 1.229 1.230=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Fixed two compiler warnings. The diff of the modified file(s): --- bluetooth.c 31 Jul 2002 08:21:16 -0000 1.229 +++ bluetooth.c 1 Aug 2002 16:13:17 -0000 1.230 @@ -208,7 +208,9 @@ static s32 bt_ctrl_init(void); static s32 bt_connect(u8 *bd_addr, u32 con_id); static s32 bt_disconnect(u32 con_id); +#if BT_DRIVER_DEBUG static const u8* psmname(u16 psm); +#endif static void wq_timeout(unsigned long ptr); static s32 bt_execute_sdp_request(bt_sdp_request *sdpRequest); =20 @@ -445,7 +447,9 @@ static s32 bt_open(struct tty_struct *tty, struct file * filp) { +#if BT_DRIVER_DEBUG s32 line =3D GET_TTYLINE(tty); +#endif s32 ret_val; =20=09 BT_DRIVER(__FUNCTION__ ": Line %d\n", line);=09 @@ -492,7 +496,6 @@ sertty->driver.flush_chars(sertty); } =20 - static s32=20 bt_write_room(struct tty_struct *tty) { @@ -558,7 +561,6 @@ } } =20=09 -=09 switch (cmd) { case BT_SDP_REQUEST: { @@ -2464,7 +2466,6 @@ return -MSGCODE(MSG_BT_INTERFACE, BT_NOTCONNECTED); } =20=09 - switch(GET_PSM(con_id)) { case RFCOMM_LAYER: @@ -2864,7 +2865,7 @@ static void bt_show_version(void) { - printk("Bluetooth Driver v1.3, Copyright (c) 2000, 2001 Axis Communicatio= ns AB\n"); + printk("Bluetooth Driver v1.3, Copyright (c) 2000, 2001, 2002 Axis Commun= ications AB\n"); } =20 s32 @@ -2932,7 +2933,6 @@ unsigned long page; s32 retval =3D 0; =20=09 - /* shutdown if already initiated */ if (bt_stack_initiated) bt_shutdown(); @@ -2977,7 +2977,6 @@ return retval; } =20=09 - #ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP if (bt_use_bcsp(-1) && !bcsp_issyncronized()) {=20=20 if (bcsp_init() < 0) { @@ -3452,6 +3451,7 @@ return 0; } =20 +#if BT_DRIVER_DEBUG static const u8* psmname(u16 psm) { @@ -3467,10 +3467,11 @@ return "UNKNOWN"; } } +#endif =20 -/* FIXME: Make a general sleepfunction a la L2ca_wait and let the this fun= ction handle all - sleeping. Add a waitqueue object to the timer and let timerdata=3Dbt_ti= mer_obj to set - inuse=3D0 if we timeout */ +/* FIXME: Make a general sleep function a la L2ca_wait and let the this + function handle all sleeping. Add a waitqueue object to the timer and l= et + timerdata=3Dbt_timer_obj to set inuse=3D0 if we timeout */ =20 #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0) void |
From: Anders J. <and...@us...> - 2002-08-06 17:52:45
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bluetooth.c 1.231 1.232=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added BTDISCONNECT_BB to disconnect the BB based on the BD-address. The diff of the modified file(s): --- bluetooth.c 5 Aug 2002 15:38:11 -0000 1.231 +++ bluetooth.c 6 Aug 2002 17:52:14 -0000 1.232 @@ -86,6 +86,7 @@ #include <linux/bluetooth/hci.h> #include <linux/bluetooth/hci_internal.h> #include <linux/bluetooth/l2cap.h> +#include <linux/bluetooth/l2cap_con.h> #include <linux/bluetooth/rfcomm.h> #include <linux/bluetooth/tcs.h> #include <linux/bluetooth/sdp.h> @@ -620,6 +621,29 @@ BT_DRIVER(__FUNCTION__ ": BTDISCONNECT\n"); copy_from_user(&con_id, (s32*)arg, size); return bt_disconnect(con_id); + } + + case BTDISCONNECT_BB: + { + /* Disconnect the BB connection (Consafe)=20 + The bd_addr is reversed=20 + */ + u8 bd_addr[6]; + l2cap_con *con_str; + + copy_from_user(bd_addr, (s32*)arg, 6); +=09=09 + BT_DRIVER(__FUNCTION__ ": BTDISCONNECT_BT %02x:%02x:%02x:%02x:%02x:%02x:= \n",=20 + bd_addr[0], bd_addr[1], bd_addr[2], + bd_addr[3], bd_addr[4], bd_addr[5]); +=09=09 + if ((con_str =3D get_con(bd_addr, ANY_STATE))=3D=3D NULL)=20 + { + D_ERR(__FUNCTION__ ": couldn't find l2cap con!\n"); + return -MSGCODE(MSG_BT_INTERFACE, BT_NOTCONNECTED); + } +=09=09 + return lp_disconnect(con_str->hci_hdl); } =20 case BTWAITFORCONNECTION: |
From: Alain P. <apa...@us...> - 2002-08-12 12:52:41
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bluetooth.c 1.232 1.233=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added license definition to avoid warning when inserting module in 2.4 kern= els. The diff of the modified file(s): --- bluetooth.c 6 Aug 2002 17:52:14 -0000 1.232 +++ bluetooth.c 12 Aug 2002 12:52:39 -0000 1.233 @@ -441,6 +441,12 @@ =20 */ =20 +/* Added GPL license to avoid warning messages at every insmod */ +#ifdef __KERNEL__ + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 9) + MODULE_LICENSE("GPL"); + #endif +#endif =20 /***********************************/ /* STACK TOP (TTY DRIVER FUNCTIONS)*/ |
From: Anders J. <and...@us...> - 2003-11-05 21:27:46
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bluetooth.c 1.241 1.242=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added BT_DISCONNECT_ALL IOCTL to disconnect all connections. The diff of the modified file(s): --- bluetooth.c 2003/11/05 17:03:14 1.241 +++ bluetooth.c 2003/11/05 19:03:12 1.242 @@ -651,6 +651,20 @@ __bt_ioctl(struct tty_struct *tty, struc return lp_disconnect(con_str->hci_hdl, 1); } =20 + case BTDISCONNECT_ALL: + { +=09=09 + /* Disconnect all connections */ + s32 i; + for (i =3D 0 ; i < MAX_NBR_OF_CONNECTIONS ; i ++) { + if (hci_ctrl.con[i].state !=3D NOT_CONNECTED) { + lp_disconnect(hci_ctrl.con[i].con_hdl, 1); + } + } + return 0; + } +=09 + case BTWAITFORCONNECTION: { s32 line; |
From: Anders J. <and...@us...> - 2003-11-17 14:57:36
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bluetooth.c 1.244 1.245=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added IOCTL to enable/disable on-board LED, only for CRIS. The diff of the modified file(s): --- bluetooth.c 2003/11/12 10:15:05 1.244 +++ bluetooth.c 2003/11/17 14:56:55 1.245 @@ -185,7 +185,7 @@ typedef struct bt_inbuffer =20 #define NO_BLUETOOTH_ACTIVITY 0 #define BLUETOOTH_ACTIVITY 1 - +static int ledenable =3D 1; static struct timer_list bt_clear_led_timer; static int bt_led_next_time; static int bt_led_active; @@ -1661,6 +1661,28 @@ hci_inq_exit0: break; }=20=20=20 =20 + case BTLEDSTATUS: + {=20=20=20 +#ifdef __CRIS__ + u8 enable; + u8 writeparam; + GET_USER(tmp, (s32*)arg); + writeparam =3D (u8)(tmp & 0xf0); + enable =3D (u8)(tmp & 0x0f); + if(writeparam) { + ledenable =3D enable; + if(!ledenable) + { + LED_ACTIVE_SET(LED_OFF); + } + } else { + tmp =3D ledenable; + put_user(tmp, (s32*)arg); + } +#endif + return 0;=09 + } +=09 default: return -ENOIOCTLCMD; } @@ -2708,6 +2730,7 @@ bt_hangupline(s32 line) static void bt_clear_led(unsigned long dummy) { +=09 if (bt_led_active && jiffies > bt_led_next_time) { bt_set_leds(NO_BLUETOOTH_ACTIVITY); =20 @@ -2735,11 +2758,13 @@ bt_flash_led(void) static void bt_set_leds(int active) { + if(ledenable) {=09 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 { LED_ACTIVE_SET(LED_OFF); + } } } =20 |