From: Mattias ?g. <mat...@us...> - 2001-03-02 14:28:15
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: added baudrate setting call for CSR removed unused code minor changes The diff of the modified file(s): --- bt_vendor.c 2001/03/02 10:59:57 1.1 +++ bt_vendor.c 2001/03/02 14:29:32 1.2 @@ -321,6 +321,7 @@ /* Set the phys device to CSR default, 115200 */=20 void init_phys(int fd) { + syslog(LOG_INFO, "Setting default baud 115200"); fd_setup(fd, 115200, USE_FLOW_CTRL); } =20 @@ -349,6 +350,17 @@ perror("HCIWRITESCANENABLE"); exit(1); } + + sleep(1); + + syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20 + + bt_set_baudrate(bt_cfd, spd); +=20=20 + /* Now set phys device speed to whatever HW was set to use */ + fd_setup(phys_fd, spd, USE_FLOW_CTRL); + tcflush(phys_fd, TCIOFLUSH); + #else printf("Setting write_scan_enable in CSR module!\n"); hci_write_scan_enable(PAGE_SCAN_ENABLE|INQUIRY_SCAN_ENABLE); @@ -367,14 +379,6 @@ =20 } =20=20 -void -reset_hw(void) -{ - printf("ERROR! Do not know how to reset hardware.\n"); -} - - - #elif HW_USED(HW_GENERIC) /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* Generic specific commands */ @@ -404,13 +408,6 @@ #endif } =20 -void -reset_hw(void) -{ - printf("ERROR! Do not know how to reset hardware.\n"); -} - - #elif HW_USED(HW_NOINIT) /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* HW No init commands */ @@ -427,12 +424,6 @@ printf("No hw init done\n"); } =20 -void -reset_hw(void) -{ - printf("ERROR! No hardware.\n"); -} - #else /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* Default */ @@ -448,11 +439,6 @@ printf("ERROR: init_hw() not implemented!\n"); } =20 -void -reset_hw(void) -{ - printf("ERROR: reset_hw() not implemented!\n"); -} =20 #endif /* HW_USED() */ =20 |
From: Peter K. <pk...@us...> - 2001-03-10 12:45:18
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: No need to include the readline files here. The diff of the modified file(s): --- bt_vendor.c 2001/03/02 14:29:32 1.2 +++ bt_vendor.c 2001/03/10 12:47:09 1.3 @@ -66,9 +66,6 @@ #include <sys/un.h> #include <arpa/inet.h> =20 -#include <readline/readline.h> -#include <readline/history.h> - #include "bt_misc.h" #include "bt_vendor.h" #include "bt_conf.h" |
From: Mattias A. <mat...@us...> - 2001-03-21 18:27:24
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: minor change The diff of the modified file(s): --- bt_vendor.c 2001/03/10 12:47:09 1.3 +++ bt_vendor.c 2001/03/21 18:27:23 1.4 @@ -318,7 +318,7 @@ /* Set the phys device to CSR default, 115200 */=20 void init_phys(int fd) { - syslog(LOG_INFO, "Setting default baud 115200"); + syslog(LOG_INFO, "Setting default speed 115200"); fd_setup(fd, 115200, USE_FLOW_CTRL); } =20 @@ -365,15 +365,6 @@ hci_write_pagescan_activity(0x50, 0x20); /* more reliable connection pro= cess */ sleep(1); /* wait for HW */ #endif - -#if 0 - /* fixme -- don't know how to change baudrate yet !*/=20 - /* Now set phys device speed to whatever HW was set to use */ - fd_setup(phys_fd, spd, USE_FLOW_CTRL);=20=20 - - tcflush(phys_fd, TCIOFLUSH); -#endif - } =20 #elif HW_USED(HW_GENERIC) |
From: Mattias A. <mat...@us...> - 2001-03-30 12:44:13
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: updated according to changes replace redundant code with functions fixed communication with usermode stack minor changes & cleanup The diff of the modified file(s): --- bt_vendor.c 2001/03/21 18:27:23 1.4 +++ bt_vendor.c 2001/03/30 12:44:11 1.5 @@ -68,7 +68,6 @@ =20 #include "bt_misc.h" #include "bt_vendor.h" -#include "bt_conf.h" #include "bt_if.h" =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ @@ -86,7 +85,7 @@ void init_hw(int bt_cfd, int phys_fd, int spd) { - bt_set_writescanenable(bt_cfd, 0 /* not used */); + bt_write_scan_enable(bt_cfd, 0 /* not used */); =20 sleep(1); =20 @@ -148,25 +147,14 @@ printf("Poll_Period : 0x%x\n", ecs_test_msg[11]); printf("Test_Packet_Type : 0x%x\n", ecs_test_msg[12]); printf("Length_Of_Test_Data : 0x%x\n", tmp[8]); - -#ifndef BT_USERSTACK - test_msg[0] =3D 16; - memcpy(test_msg + 1, ecs_test_msg, 16); =20 - if (ioctl(bt_cfd, HCISENDRAWDATA, test_msg) < 0) - { - perror("ecs_testctrl"); - } -#else - hci_send_raw_data(test_msg, 16); -#endif + bt_send_raw_data(test_msg, 16); } =20 void ericsson_enter_test_mode(int bt_cfd, int* tmp) { unsigned char ecs_test_msg[7]; - unsigned char test_msg[16]; =20=20=20=20=20 ecs_test_msg[0] =3D CMD_PKT; ecs_test_msg[1] =3D OPCODE_LSB(ERICSSON_ENTER_TEST_MODE, MANUFACTURER_= SPEC); @@ -177,17 +165,7 @@ =20=20=20=20=20 printf("*** Sending enter test mode (handle : 0x%x)***\n", tmp[0]); =20 - test_msg[0] =3D 7; - memcpy(test_msg + 1, ecs_test_msg, 7); -=20=20=20=20 -#ifndef BT_USERSTACK - if (ioctl(bt_cfd, HCISENDRAWDATA, test_msg) < 0) - { - perror("ecs_entertest"); - } -#else - hci_send_raw_data(test_msg, 7); -#endif + bt_send_raw_data(ecs_test_msg, 7); } =20 void @@ -216,7 +194,6 @@ printf("Returned handle : %d\n", hdl); } =20 - void ericsson_tx_test(int bt_cfd, int* tmp) { @@ -224,7 +201,6 @@ unsigned char test_msg[17]; int i; =20 -=20=20 ecs_test_msg[0] =3D CMD_PKT; ecs_test_msg[1] =3D OPCODE_LSB(ERICSSON_TX_TEST, MANUFACTURER_SPEC); ecs_test_msg[2] =3D OPCODE_MSB(ERICSSON_TX_TEST, MANUFACTURER_SPEC); @@ -254,23 +230,15 @@ printf("Test_Packet_Type : 0x%x\n", ecs_test_msg[13]); printf("Length_Of_Test_Data : 0x%x\n", tmp[10]); =20=20=20 -#ifndef BT_USERSTACK - - test_msg[0] =3D 17; - memcpy(test_msg + 1, ecs_test_msg, 17); + bt_send_raw_data(bt_cfd, test_msg, 17); =20=20=20 - if (ioctl(bt_cfd, HCISENDRAWDATA, test_msg) < 0) - { - perror("ecs_txtest"); - } -#else - hci_send_raw_data(test_msg, 17); -#endif printf("TX test starting.\n"); } -#endif =20 +#endif /* ECS_TEST_FUNCTIONS */ + #elif HW_USED(HW_DIGIANSWER) + /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* Digianswer specific commands */ /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ @@ -284,19 +252,8 @@ init_hw(int bt_cfd, int phys_fd, int spd) { printf("Setting baudrate in Digianswer PC card\n"); -#ifndef BT_USERSTACK - if (ioctl(bt_cfd, HCISETBAUDRATE, &spd) < 0) - { - perror("HCISETBAUDRATE"); - exit(1); - } -#else - hci_set_baudrate(spd); -#if DIGI_DONGLE_SUPPORT - hci_set_baudrate(115200); -#endif =20 -#endif + bt_set_baudrate(spd); =20=20=20 if (spd > 115200) { @@ -322,49 +279,32 @@ fd_setup(fd, 115200, USE_FLOW_CTRL); } =20 +/* fixme -- remove hardcoded values */ void init_hw(int bt_cfd, int phys_fd, int spd) {=20=20 -#ifndef BT_USERSTACK unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); - unsigned int tmp[2]; - tmp[0]=3D0x50; - tmp[1]=3D0x20; =20=20=20 - sleep(1); printf("Setting write_scan_enable in CSR module!\n"); =20=20=20 - if (ioctl(bt_cfd, HCIWRITESCANENABLE, &wrscan) < 0) - {=20 - perror("HCIWRITESCANENABLE"); - exit(1); - } + bt_write_scan_enable(bt_cfd, wrscan); =20=20=20 /* improves reliability when doing a connect */ printf("Setting write_pagescan_activity in CSR module!\n"); - if (ioctl(bt_cfd, HCIWRITEPAGESCANACTIVITY, &tmp) < 0) - {=20 - perror("HCIWRITESCANENABLE"); - exit(1); - } =20 + bt_write_pagescan_activity(bt_cfd, 0x50, 0x20); + sleep(1); =20 syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20 =20 bt_set_baudrate(bt_cfd, spd); =20=20=20 + syslog(LOG_INFO, "Baudrate set\n"); +=20=20 /* Now set phys device speed to whatever HW was set to use */ fd_setup(phys_fd, spd, USE_FLOW_CTRL); tcflush(phys_fd, TCIOFLUSH); - -#else - printf("Setting write_scan_enable in CSR module!\n"); - hci_write_scan_enable(PAGE_SCAN_ENABLE|INQUIRY_SCAN_ENABLE); - printf("Setting write_pagescan_activity in CSR module!\n"); - hci_write_pagescan_activity(0x50, 0x20); /* more reliable connection pro= cess */ - sleep(1); /* wait for HW */ -#endif } =20 #elif HW_USED(HW_GENERIC) @@ -382,18 +322,10 @@ { #ifndef BT_USERSTACK unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); - sleep(1); + printf("Setting write_scan_enable in USB module!\n"); =20=20=20 - if (ioctl(bt_cfd, HCIWRITESCANENABLE, &wrscan) < 0) - {=20 - perror("HCIWRITESCANENABLE"); - exit(1); - } -#else - hci_write_scan_enable(PAGE_SCAN_ENABLE|INQUIRY_SCAN_ENABLE); - sleep(1); /* wait for HW */ -#endif + bt_write_scan_enable(bt_cfd, wrscan); } =20 #elif HW_USED(HW_NOINIT) @@ -429,6 +361,11 @@ =20 =20 #endif /* HW_USED() */ + + + + +#endif /* TEST */ =20 /*********************************************************************/ =20 |
From: Peter K. <pk...@us...> - 2001-04-04 12:39:18
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected #endif's. The diff of the modified file(s): --- bt_vendor.c 2001/03/30 12:44:11 1.5 +++ bt_vendor.c 2001/04/04 12:39:17 1.6 @@ -186,7 +186,6 @@ { perror("test con req"); } -=20=20 #else hdl =3D hci_test_connect_req(btcon.bd); #endif @@ -264,7 +263,6 @@ fd_setup(phys_fd, spd, USE_FLOW_CTRL);=20=20 =20 tcflush(phys_fd, TCIOFLUSH); - } =20 #elif HW_USED(HW_CSR) @@ -326,6 +324,7 @@ printf("Setting write_scan_enable in USB module!\n"); =20=20=20 bt_write_scan_enable(bt_cfd, wrscan); +#endif } =20 #elif HW_USED(HW_NOINIT) @@ -359,15 +358,6 @@ printf("ERROR: init_hw() not implemented!\n"); } =20 - #endif /* HW_USED() */ =20 - - - -#endif /* TEST */ - /*********************************************************************/ - - - |
From: Mattias A. <mat...@us...> - 2001-04-17 12:26:06
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added set event filter for all HW The diff of the modified file(s): --- bt_vendor.c 2001/04/04 12:39:17 1.6 +++ bt_vendor.c 2001/04/17 12:25:50 1.7 @@ -85,12 +85,12 @@ void init_hw(int bt_cfd, int phys_fd, int spd) { - bt_write_scan_enable(bt_cfd, 0 /* not used */); + bt_write_scan_enable(bt_cfd, 0 /* inpars not used */); =20 sleep(1); =20 /* set_event_filter must be called for m/s switch on IrmaC! */ - bt_set_event_filter(bt_cfd, 0 /* not used */); + bt_set_event_filter(bt_cfd, 0 /* inpars not used */); =20 sleep(1); // wait for HW... =20 @@ -259,6 +259,8 @@ printf("WARNING : Does this HW really support speeds > 115200 ?\n"); } =20=20=20 + bt_set_event_filter(bt_cfd, 0 /* inpars not used */); + /* Now set phys device speed to whatever HW was set to use */ fd_setup(phys_fd, spd, USE_FLOW_CTRL);=20=20 =20 @@ -294,6 +296,8 @@ =20 sleep(1); =20 + bt_set_event_filter(bt_cfd, 0 /* inpars not used */); + syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20 =20 bt_set_baudrate(bt_cfd, spd); @@ -318,13 +322,13 @@ void init_hw(int bt_cfd, int phys_fd, int spd) { -#ifndef BT_USERSTACK unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 printf("Setting write_scan_enable in USB module!\n"); =20=20=20 bt_write_scan_enable(bt_cfd, wrscan); -#endif + bt_set_event_filter(bt_cfd, 0 /* inpars not used */); + } =20 #elif HW_USED(HW_NOINIT) |
From: Peter K. <pk...@us...> - 2001-04-17 17:35:07
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Changed bt_send_raw_data() to bt_send_raw_hci(). * Removed a lot of unnecessary includes. The diff of the modified file(s): --- bt_vendor.c 2001/04/17 12:25:50 1.7 +++ bt_vendor.c 2001/04/17 17:35:03 1.8 @@ -40,31 +40,11 @@ * */ =20=20 -#include <sys/time.h> -#include <sys/types.h> -#include <sys/ioctl.h> -#include <sys/wait.h> -#include <fcntl.h> -#include <time.h> #include <stdio.h> -#include <fcntl.h> #include <unistd.h> #include <termios.h> -#include <stdlib.h> -#include <string.h> #include <syslog.h> -#include <errno.h> -#include <stdarg.h> -#include <signal.h> -#include <getopt.h> - -/* The following includes are required to be able to determine the local - * address by examining eth0 */ -#include <sys/socket.h> -#include <net/if.h> -#include <netinet/in.h> -#include <sys/un.h> -#include <arpa/inet.h> +#include <sys/ioctl.h> =20 #include "bt_misc.h" #include "bt_vendor.h" @@ -148,7 +128,7 @@ printf("Test_Packet_Type : 0x%x\n", ecs_test_msg[12]); printf("Length_Of_Test_Data : 0x%x\n", tmp[8]); =20 - bt_send_raw_data(test_msg, 16); + bt_send_raw_hci(bt_cfd, test_msg, 16); } =20 void @@ -165,7 +145,7 @@ =20 printf("*** Sending enter test mode (handle : 0x%x)***\n", tmp[0]); =20 - bt_send_raw_data(ecs_test_msg, 7); + bt_send_raw_hci(bt_cfd, ecs_test_msg, 7); } =20 void @@ -229,7 +209,7 @@ printf("Test_Packet_Type : 0x%x\n", ecs_test_msg[13]); printf("Length_Of_Test_Data : 0x%x\n", tmp[10]); =20=20=20 - bt_send_raw_data(bt_cfd, test_msg, 17); + bt_send_raw_hci(bt_cfd, test_msg, 17); =20 printf("TX test starting.\n"); } |
From: Mattias A. <mat...@us...> - 2001-04-25 18:01:59
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * readded 10 ms sleep after setting baud rate for ericsson * fixed using the inpar when setting write scan enable * added bt_write_pagescan_activity for CSR HW (using default values) * minor changes The diff of the modified file(s): --- bt_vendor.c 2001/04/20 16:11:35 1.9 +++ bt_vendor.c 2001/04/25 18:01:57 1.10 @@ -192,7 +192,9 @@ void ericsson_init_hw(int bt_cfd, int phys_fd, int spd) { - bt_write_scan_enable(bt_cfd, 0 /* inpars not used */); + unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); + + bt_write_scan_enable(bt_cfd, wrscan); =20 sleep(1); =20 @@ -201,8 +203,9 @@ =20 sleep(1); // wait for HW... =20 - printf("Setting baudrate in Ericsson module!\n");=20=20 + syslog(LOG_INFO, "Setting baudrate in Ericsson module!\n");=20=20 bt_set_baudrate(bt_cfd, spd); + usleep(10000); =20=20=20 /* Now set phys device speed to whatever HW was set to use */ fd_setup(phys_fd, spd, USE_FLOW_CTRL); @@ -300,6 +303,14 @@ printf("Setting write_scan_enable in USB module!\n"); =20 bt_write_scan_enable(bt_cfd, wrscan); +=20=20 + /* improves reliability when doing a connect */ + printf("Setting write_pagescan_activity in CSR module!\n"); + + bt_write_pagescan_activity(bt_cfd, 0x8000, 0x12); + + sleep(1); + bt_set_event_filter(bt_cfd, 0 /* inpars not used */); } =20 |
From: Mattias A. <mat...@us...> - 2001-04-26 10:51:29
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * now use inparam in bt_set_event_filter * fixed default values when setting page scan activity * added include to string.h * use syslog for debug The diff of the modified file(s): --- bt_vendor.c 2001/04/25 18:01:57 1.10 +++ bt_vendor.c 2001/04/26 10:51:28 1.11 @@ -45,6 +45,7 @@ #include <termios.h> #include <syslog.h> #include <sys/ioctl.h> +#include <string.h> =20 #include "bt_misc.h" #include "bt_vendor.h" @@ -192,6 +193,8 @@ void ericsson_init_hw(int bt_cfd, int phys_fd, int spd) { + /* Connection setup, all devices, no auto accept */ + unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 bt_write_scan_enable(bt_cfd, wrscan); @@ -199,7 +202,7 @@ sleep(1); =20 /* set_event_filter must be called for m/s switch on IrmaC! */ - bt_set_event_filter(bt_cfd, 0 /* inpars not used */); + bt_set_event_filter(bt_cfd, filter); =20 sleep(1); // wait for HW... =20 @@ -228,20 +231,22 @@ void csr_init_hw(int bt_cfd, int phys_fd, int spd) { + /* Connection setup, all devices, no auto accept */ + unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 - printf("Setting write_scan_enable in CSR module!\n"); + syslog(LOG_INFO, "Setting write_scan_enable in CSR module!\n"); =20 bt_write_scan_enable(bt_cfd, wrscan); =20=20=20 /* improves reliability when doing a connect */ - printf("Setting write_pagescan_activity in CSR module!\n"); + syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module!\n"); =20 - bt_write_pagescan_activity(bt_cfd, 0x50, 0x20); + bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 sleep(1); =20 - bt_set_event_filter(bt_cfd, 0 /* inpars not used */); + bt_set_event_filter(bt_cfd, filter); =20 syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20 =20 @@ -268,7 +273,10 @@ void digianswer_init_hw(int bt_cfd, int phys_fd, int spd) { - printf("Setting baudrate in Digianswer PC card\n"); + /* Connection setup, all devices, no auto accept */ + unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; + + syslog(LOG_INFO, "Setting baudrate in Digianswer PC card\n"); =20 bt_set_baudrate(bt_cfd, spd); =20=20=20 @@ -277,7 +285,7 @@ printf("WARNING : Does this HW really support speeds > 115200 ?\n"); } =20=20=20 - bt_set_event_filter(bt_cfd, 0 /* inpars not used */); + bt_set_event_filter(bt_cfd, filter); =20 /* Now set phys device speed to whatever HW was set to use */ fd_setup(phys_fd, spd, USE_FLOW_CTRL);=20=20 @@ -298,20 +306,22 @@ void usb_init_hw(int bt_cfd, int phys_fd, int spd) { + /* Connection setup, all devices, no auto accept */ + unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 - printf("Setting write_scan_enable in USB module!\n"); + syslog(LOG_INFO, "Setting write_scan_enable in USB module!\n"); =20 bt_write_scan_enable(bt_cfd, wrscan); =20=20=20 /* improves reliability when doing a connect */ - printf("Setting write_pagescan_activity in CSR module!\n"); + syslog(LOG_INFO, "Setting write_pagescan_activity in USB module!\n"); =20 - bt_write_pagescan_activity(bt_cfd, 0x8000, 0x12); + bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 sleep(1); =20 - bt_set_event_filter(bt_cfd, 0 /* inpars not used */); + bt_set_event_filter(bt_cfd, filter); } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ @@ -327,12 +337,14 @@ void generic_init_hw(int bt_cfd, int phys_fd, int spd) { + /* Connection setup, all devices, no auto accept */ + unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 - printf("Setting write_scan_enable in generic module!\n"); + syslog(LOG_INFO, "Setting write_scan_enable in generic module!\n"); =20=20=20 bt_write_scan_enable(bt_cfd, wrscan); - bt_set_event_filter(bt_cfd, 0 /* inpars not used */); + bt_set_event_filter(bt_cfd, filter); } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ |
From: Peter K. <pk...@us...> - 2001-04-27 16:49:38
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.11 1.12=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added support for Infineon BlueMoon I hardware (as best as I could without having any hardware to test with). The diff of the modified file(s): --- bt_vendor.c 2001/04/26 10:51:28 1.11 +++ bt_vendor.c 2001/04/27 16:49:38 1.12 @@ -52,22 +52,25 @@ #include "bt_if.h" =20 #define HW_NOT_PROBED -1 -#define HW_ERICSSON 0 -#define HW_CSR 1 -#define HW_DIGIANSWER 2 -#define HW_USB 3 -#define HW_GENERIC 4 -#define HW_NO_INIT 5 -#define HW_UNKNOWN 6 +#define HW_CSR 0 +#define HW_DIGIANSWER 1 +#define HW_ERICSSON 2 +#define HW_INFINEON 3 +#define HW_USB 4 +#define HW_GENERIC 5 +#define HW_NO_INIT 6 +#define HW_UNKNOWN 7 =20 static int hw_vendor(void); =20 -static void ericsson_init_phys(int fd); -static void ericsson_init_hw(int bt_cfd, int phys_fd, int spd); static void csr_init_phys(int fd); static void csr_init_hw(int bt_cfd, int phys_fd, int spd); static void digianswer_init_phys(int fd); static void digianswer_init_hw(int bt_cfd, int phys_fd, int spd); +static void ericsson_init_phys(int fd); +static void ericsson_init_hw(int bt_cfd, int phys_fd, int spd); +static void infineon_init_phys(int fd); +static void infineon_init_hw(int bt_cfd, int phys_fd, int spd); static void usb_init_phys(int fd); static void usb_init_hw(int bt_cfd, int phys_fd, int spd); static void generic_init_phys(int fd); @@ -82,10 +85,6 @@ { switch (hw_vendor()) { - case HW_ERICSSON: - ericsson_init_phys(fd); - break; - case HW_CSR: csr_init_phys(fd); break; @@ -94,6 +93,14 @@ digianswer_init_phys(fd); break; =20 + case HW_ERICSSON: + ericsson_init_phys(fd); + break; + + case HW_INFINEON: + infineon_init_phys(fd); + break; + case HW_USB: usb_init_phys(fd); break; @@ -118,10 +125,6 @@ { switch (hw_vendor()) { - case HW_ERICSSON: - ericsson_init_hw(bt_cfd, phys_fd, spd); - break; - case HW_CSR: csr_init_hw(bt_cfd, phys_fd, spd); break; @@ -130,6 +133,14 @@ digianswer_init_hw(bt_cfd, phys_fd, spd); break; =20 + case HW_ERICSSON: + ericsson_init_hw(bt_cfd, phys_fd, spd); + break; + + case HW_INFINEON: + infineon_init_hw(bt_cfd, phys_fd, spd); + break; + case HW_USB: usb_init_hw(bt_cfd, phys_fd, spd); break; @@ -160,12 +171,14 @@ =20 if (!vendor) hw_vendor =3D HW_UNKNOWN; - else if (!strcmp(vendor, "Ericsson")) - hw_vendor =3D HW_ERICSSON; else if (!strcmp(vendor, "CSR")) hw_vendor =3D HW_CSR; else if (!strcmp(vendor, "Digianswer")) hw_vendor =3D HW_DIGIANSWER; + else if (!strcmp(vendor, "Ericsson")) + hw_vendor =3D HW_ERICSSON; + else if (!strcmp(vendor, "Infineon")) + hw_vendor =3D HW_INFINEON; else if (!strcmp(vendor, "USB")) hw_vendor =3D HW_USB; else if (!strcmp(vendor, "Generic")) @@ -180,42 +193,6 @@ } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ -/* Ericsson specific commands */ -/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ - -/* Set the phys device to Ericsson default speed, 57600 */ -void -ericsson_init_phys(int fd) -{ - fd_setup(fd, 57600, USE_FLOW_CTRL); -} - -void -ericsson_init_hw(int bt_cfd, int phys_fd, int spd) -{ - /* Connection setup, all devices, no auto accept */ - unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; - unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); - - bt_write_scan_enable(bt_cfd, wrscan); - - sleep(1); - - /* set_event_filter must be called for m/s switch on IrmaC! */ - bt_set_event_filter(bt_cfd, filter); - - sleep(1); // wait for HW... - - syslog(LOG_INFO, "Setting baudrate in Ericsson module!\n");=20=20 - bt_set_baudrate(bt_cfd, spd); - usleep(10000); - - /* Now set phys device speed to whatever HW was set to use */ - fd_setup(phys_fd, spd, USE_FLOW_CTRL); - tcflush(phys_fd, TCIOFLUSH); -} - -/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* CSR specific commands */ /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ =20 @@ -289,7 +266,69 @@ =20 /* Now set phys device speed to whatever HW was set to use */ fd_setup(phys_fd, spd, USE_FLOW_CTRL);=20=20 + tcflush(phys_fd, TCIOFLUSH); +} + +/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ +/* Ericsson specific commands */ +/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ + +/* Set the phys device to Ericsson default speed, 57600 */ +void +ericsson_init_phys(int fd) +{ + fd_setup(fd, 57600, USE_FLOW_CTRL); +} + +void +ericsson_init_hw(int bt_cfd, int phys_fd, int spd) +{ + /* Connection setup, all devices, no auto accept */ + unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; + unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); + + bt_write_scan_enable(bt_cfd, wrscan); + + sleep(1); + + /* set_event_filter must be called for m/s switch on IrmaC! */ + bt_set_event_filter(bt_cfd, filter); + + sleep(1); // wait for HW... + + syslog(LOG_INFO, "Setting baudrate in Ericsson module!\n");=20=20 + bt_set_baudrate(bt_cfd, spd); + usleep(10000); + + /* Now set phys device speed to whatever HW was set to use */ + fd_setup(phys_fd, spd, USE_FLOW_CTRL); + tcflush(phys_fd, TCIOFLUSH); +} =20 +/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ +/* Infineon specific commands */ +/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ + +void infineon_init_phys(int fd) +{ + fd_setup(fd, 115200, USE_FLOW_CTRL); +} + +void +infineon_init_hw(int bt_cfd, int phys_fd, int spd) +{ + unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); +=20=20 + sleep(1); + syslog(LOG_INFO, "Setting write_scan_enable in Infineon module!\n"); + bt_write_scan_enable(bt_cfd, wrscan); + + sleep(1); // wait for HW...=20 + syslog(LOG_INFO, "Setting baudrate in Infineon module!\n");=20=20 + bt_set_baudrate(bt_cfd, spd); +=20=20 + /* Now set phys device speed to whatever HW was set to use */ + fd_setup(phys_fd, spd, USE_FLOW_CTRL); tcflush(phys_fd, TCIOFLUSH); } =20 |
From: Peter K. <pk...@us...> - 2001-05-08 16:06:13
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Changed order of commands in csr_init_hw() to change the hardware speed in time for the answer to the change of baud rate command. The diff of the modified file(s): --- bt_vendor.c 2001/04/27 16:49:38 1.12 +++ bt_vendor.c 2001/05/08 16:06:13 1.13 @@ -229,11 +229,11 @@ =20 bt_set_baudrate(bt_cfd, spd); =20 - syslog(LOG_INFO, "Baudrate set\n"); -=20=20 /* Now set phys device speed to whatever HW was set to use */ fd_setup(phys_fd, spd, USE_FLOW_CTRL); tcflush(phys_fd, TCIOFLUSH); + + syslog(LOG_INFO, "Baudrate set\n"); } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ |
From: Mats F. <ma...@us...> - 2001-05-17 10:31:16
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.13 1.14=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added check for BCSP The diff of the modified file(s): --- bt_vendor.c 2001/05/08 16:06:13 1.13 +++ bt_vendor.c 2001/05/17 10:31:15 1.14 @@ -51,18 +51,6 @@ #include "bt_vendor.h" #include "bt_if.h" =20 -#define HW_NOT_PROBED -1 -#define HW_CSR 0 -#define HW_DIGIANSWER 1 -#define HW_ERICSSON 2 -#define HW_INFINEON 3 -#define HW_USB 4 -#define HW_GENERIC 5 -#define HW_NO_INIT 6 -#define HW_UNKNOWN 7 - -static int hw_vendor(void); - static void csr_init_phys(int fd); static void csr_init_hw(int bt_cfd, int phys_fd, int spd); static void digianswer_init_phys(int fd); @@ -85,7 +73,8 @@ { switch (hw_vendor()) { - case HW_CSR: + case HW_CSR_H4: + case HW_CSR_BCSP: csr_init_phys(fd); break; =20 @@ -125,7 +114,8 @@ { switch (hw_vendor()) { - case HW_CSR: + case HW_CSR_H4: + case HW_CSR_BCSP: csr_init_hw(bt_cfd, phys_fd, spd); break; =20 @@ -171,8 +161,10 @@ =20 if (!vendor) hw_vendor =3D HW_UNKNOWN; - else if (!strcmp(vendor, "CSR")) - hw_vendor =3D HW_CSR; + else if (!strcmp(vendor, "CSR_H4")) + hw_vendor =3D HW_CSR_H4; + else if (!strcmp(vendor, "CSR_BCSP")) + hw_vendor =3D HW_CSR_BCSP; else if (!strcmp(vendor, "Digianswer")) hw_vendor =3D HW_DIGIANSWER; else if (!strcmp(vendor, "Ericsson")) @@ -201,7 +193,10 @@ csr_init_phys(int fd) { syslog(LOG_INFO, "Setting default speed 115200"); - fd_setup(fd, 115200, USE_FLOW_CTRL); + if (hw_vendor() =3D=3D HW_CSR_H4)=20 + fd_setup(fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP); + else + fd_setup(fd, 115200, USE_FLOW_CTRL, USE_BCSP); } =20 /* fixme -- remove hardcoded values */ @@ -227,10 +222,16 @@ =20 syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20 =20 + sleep(1); +=20=20 bt_set_baudrate(bt_cfd, spd); =20 /* Now set phys device speed to whatever HW was set to use */ - fd_setup(phys_fd, spd, USE_FLOW_CTRL); + if (hw_vendor() =3D=3D HW_CSR_H4)=20 + fd_setup(phys_fd, spd, USE_FLOW_CTRL, DONT_USE_BCSP); + else + fd_setup(phys_fd, spd, USE_FLOW_CTRL, USE_BCSP); +=20=20=20=20=20=20 tcflush(phys_fd, TCIOFLUSH); =20 syslog(LOG_INFO, "Baudrate set\n"); @@ -244,7 +245,7 @@ void digianswer_init_phys(int fd) { - fd_setup(fd, 9600, USE_FLOW_CTRL); + fd_setup(fd, 9600, USE_FLOW_CTRL, DONT_USE_BCSP); } =20 void @@ -265,7 +266,7 @@ bt_set_event_filter(bt_cfd, filter); =20 /* Now set phys device speed to whatever HW was set to use */ - fd_setup(phys_fd, spd, USE_FLOW_CTRL);=20=20 + fd_setup(phys_fd, spd, USE_FLOW_CTRL, DONT_USE_BCSP);=20=20 tcflush(phys_fd, TCIOFLUSH); } =20 @@ -277,7 +278,7 @@ void ericsson_init_phys(int fd) { - fd_setup(fd, 57600, USE_FLOW_CTRL); + fd_setup(fd, 57600, USE_FLOW_CTRL, DONT_USE_BCSP); } =20 void @@ -301,7 +302,7 @@ usleep(10000); =20 /* Now set phys device speed to whatever HW was set to use */ - fd_setup(phys_fd, spd, USE_FLOW_CTRL); + fd_setup(phys_fd, spd, USE_FLOW_CTRL, DONT_USE_BCSP); tcflush(phys_fd, TCIOFLUSH); } =20 @@ -311,7 +312,7 @@ =20 void infineon_init_phys(int fd) { - fd_setup(fd, 115200, USE_FLOW_CTRL); + fd_setup(fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP); } =20 void @@ -328,7 +329,7 @@ bt_set_baudrate(bt_cfd, spd); =20=20=20 /* Now set phys device speed to whatever HW was set to use */ - fd_setup(phys_fd, spd, USE_FLOW_CTRL); + fd_setup(phys_fd, spd, USE_FLOW_CTRL, DONT_USE_BCSP); tcflush(phys_fd, TCIOFLUSH); } =20 @@ -339,7 +340,7 @@ void usb_init_phys(int fd) { - fd_setup(fd, 115200, USE_FLOW_CTRL); + fd_setup(fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP); } =20 void @@ -370,7 +371,7 @@ void generic_init_phys(int fd) { - fd_setup(fd, 115200, USE_FLOW_CTRL); + fd_setup(fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP); } =20 void |
From: Peter K. <pk...@us...> - 2001-05-17 14:53:54
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.14 1.15=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Changed the vendor names for CSR. The diff of the modified file(s): --- bt_vendor.c 2001/05/17 10:31:15 1.14 +++ bt_vendor.c 2001/05/17 14:53:54 1.15 @@ -161,9 +161,9 @@ =20 if (!vendor) hw_vendor =3D HW_UNKNOWN; - else if (!strcmp(vendor, "CSR_H4")) + else if (!strcmp(vendor, "CSR (H4)")) hw_vendor =3D HW_CSR_H4; - else if (!strcmp(vendor, "CSR_BCSP")) + else if (!strcmp(vendor, "CSR (BCSP)")) hw_vendor =3D HW_CSR_BCSP; else if (!strcmp(vendor, "Digianswer")) hw_vendor =3D HW_DIGIANSWER; |
From: Mattias A. <mat...@us...> - 2001-06-06 15:02:55
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.15 1.16=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added some ps key defines * Added csr_bcspmode() to enable/disable bcsp mode in kernel * Added csr_pskey() used to read/write any PS key in HW * Added csr_change_if() which switches host interface in CSR HW (BCSP<->H4) * Added check in init_hw for CSR HW whether init went ok, if not=20 we try changing interface and retry by restarting btd. * Always make sure that deep sleep timer is disabled in HW when=20 using BCSP The diff of the modified file(s): --- bt_vendor.c 2001/05/17 14:53:54 1.15 +++ bt_vendor.c 2001/06/06 15:02:54 1.16 @@ -45,7 +45,10 @@ #include <termios.h> #include <syslog.h> #include <sys/ioctl.h> +#include <sys/types.h> +#include <signal.h> #include <string.h> +#include <stdlib.h> =20 #include "bt_misc.h" #include "bt_vendor.h" @@ -188,6 +191,13 @@ /* CSR specific commands */ /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ =20 +#define PSKEY_HOSTIO_UART_PS_BLOCK 0x0191 +#define PSKEY_HOST_INTERFACE 0x01f9 +#define PSKEY_UART_SLEEP_TIMEOUT 0x0222 +#define CSR_PSKEY_GETREQ 0x0 +#define CSR_PSKEY_SETREQ 0x2 + + /* Set the phys device to CSR default, 115200 */=20 void csr_init_phys(int fd) @@ -199,6 +209,189 @@ fd_setup(fd, 115200, USE_FLOW_CTRL, USE_BCSP); } =20 +void +csr_bcspmode(int bt_cfd, int enable) +{ + if (ioctl(bt_cfd, BTSETBCSPMODE, &enable) < 0) + { + perror(__FUNCTION__); + exit(1); + } +} + + +/* + * Read/Write any PS key in CSR module=20 + * ps_vals holds return values / set params depending on=20 + * type of operation + */ + +void csr_pskey(int bt_cfd, unsigned short ps_key, unsigned short rw_mode,= =20 + unsigned short *ps_vals, unsigned short n_pars) +{ + unsigned short msg[CSR_PSKEY_MAXPARAMS + CSR_PSKEY_MSGHDR_SIZE]; + + syslog(LOG_INFO ,": ps_key 0x%x rw_mode : %d\n", ps_key, rw_mode); + + msg[0] =3D ps_key; + msg[1] =3D rw_mode; + msg[2] =3D n_pars; + + if (n_pars > CSR_PSKEY_MAXPARAMS) + { + syslog(LOG_INFO, "error : max nbr pskey params is %d [%d]\n",=20 + CSR_PSKEY_MAXPARAMS, n_pars); + return; + } +=20=20 + if (rw_mode =3D=3D CSR_PSKEY_GETREQ) + memset(&msg[CSR_PSKEY_MSGHDR_SIZE], 0, n_pars*2); /* GETREQ */ + else + memcpy(&msg[CSR_PSKEY_MSGHDR_SIZE], ps_vals, n_pars*2);=20=20=20=20 +=20=20 + if (ioctl(bt_cfd, BT_CSR_PSKEY, msg) < 0) + { + perror(__FUNCTION__); + exit(1); + } + + /* Copy back return params if READ (skip message header) */ + if (rw_mode =3D=3D CSR_PSKEY_GETREQ) + memcpy(ps_vals, &msg[CSR_PSKEY_MSGHDR_SIZE], n_pars*2); +} + +/*=20 + * Switches host interface in CSR HW (H4<->BCSP)=20 + */ + +void csr_change_if(int bt_cfd, int phys_fd, int spd) +{ + static int did_restart =3D 0; /* only try once */ + unsigned short ps_parbuf[10]; +=20=20 + if (did_restart) + return; + + shutdown_stack(bt_cfd); + sleep(1); +=20=20 + if (hw_vendor() =3D=3D HW_CSR_H4) + { + syslog(LOG_INFO, "Changing CSR host IF BCSP -> H4"); +=20=20=20=20 + /* Temporarily set stack to use BCSP framing */ + csr_bcspmode(bt_cfd, 1); +=20=20=20=20 + /* Setup serial port for BCSP (default baudrate) */ + fd_setup(phys_fd, 115200, USE_FLOW_CTRL, USE_BCSP); + reset_hw(); + + if (ioctl(bt_cfd, BTINITBCSP) < 0) + { + perror(__FUNCTION__); + exit(1); + } +=20=20=20=20 + sleep(1); + + /* Make sure that deep sleep timer is disabled to=20 + prevent problems when setting new ps keys */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_GETREQ, ps_parbuf, 1); +=20=20=20=20 + if (ps_parbuf[0] !=3D 0) + { + syslog(LOG_INFO, "Disabling deep sleep timer"); + ps_parbuf[0] =3D 0; /* disable deep sleep timer */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 1); + reset_hw(); + + if (ioctl(bt_cfd, BTINITBCSP) < 0) + { + perror(__FUNCTION__); + exit(1); + } + sleep(1); + } +=20=20=20=20 + /* Read params for ps key PSKEY_HOSTIO_UART_PS_BLOCK */ + csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 + CSR_PSKEY_GETREQ, ps_parbuf, 10); + + if (ps_parbuf[1] =3D=3D 6) /* BCSP */ + { + /* Set UART to no parity, non-bcsp, flow control on */ + ps_parbuf[1] =3D 0x00a8; + csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 10); + + sleep(1); +=20 + /* Set ps key PSKEY_HOST_INTERFACE */ + ps_parbuf[0] =3D 0x0003; /* H4 */ + csr_pskey(bt_cfd, PSKEY_HOST_INTERFACE,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 1); + sleep(1); + } + else + { + syslog(LOG_ERR, __FUNCTION__": PS key parameter unknown [%d]", ps_pa= rbuf[1]); + }=20=20=20 +=20=20=20=20 + /* Set back stack to use H4 framing */ + csr_bcspmode(bt_cfd, 0); + } + else + { + syslog(LOG_INFO, "Changing CSR host IF BCSP -> H4"); + + /* Set stack to use H4 temporarily */=20=20=20=20=20=20=20=20 + csr_bcspmode(bt_cfd, 0); +=20=20=20=20 + /* Setup serial port for H4 (default baudrate) */ + fd_setup(phys_fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP); + + reset_hw();=20=20=20=20 + sleep(1); + + /* Initialize stack */ + init_stack(bt_cfd, spd); + + /* Read params for ps key PSKEY_HOSTIO_UART_PS_BLOCK */ + csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 + CSR_PSKEY_GETREQ, ps_parbuf, 10); + + if (ps_parbuf[1] =3D=3D 0xa8) /* non-BCSP */ + { + /* Enable parity bit, disable flow */ + ps_parbuf[1] =3D 0x6; + csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 10); + sleep(1); +=20=20=20=20=20 + /* Set ps key PSKEY_HOST_INTERFACE */ + ps_parbuf[0] =3D 0x1; /* BCSP */ + csr_pskey(bt_cfd, PSKEY_HOST_INTERFACE,=20 + CSR_PSKEY_SETREQ, ps_parbuf, 1); + + /* Should not be needed if hw_vendor is changed in kernel ....*/ +=20=20=20=20=20=20 + /* Set back stack to use BCSP framing */ + csr_bcspmode(bt_cfd, 1); + }=20 + else + { + syslog(LOG_ERR, __FUNCTION__": PS key parameter unknown [%d]", ps_pa= rbuf[1]); + } + } + + did_restart =3D 1; /* Only try once */ + + /* Restart btd */ + kill(getpid(), 10); +} + /* fixme -- remove hardcoded values */ void csr_init_hw(int bt_cfd, int phys_fd, int spd) @@ -206,7 +399,40 @@ /* Connection setup, all devices, no auto accept */ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); + unsigned char bd[6]; +=20=20 + /* Now test whether stack initialized ok + Try reading local BD address */ =20 + read_local_bd(bt_cfd, bd); +=20=20 + if ((bd[0] =3D=3D 0) && (bd[1] =3D=3D 0) &&=20 + (bd[2] =3D=3D 0) && (bd[3] =3D=3D 0) && + (bd[4] =3D=3D 0) && (bd[5] =3D=3D 0)) + { + syslog(LOG_INFO, "Stack failed to initialize, try changing interface"); + csr_change_if(bt_cfd, phys_fd, spd); + } + + if (hw_vendor() =3D=3D HW_CSR_BCSP) + { + unsigned short ps_parbuf; + /* Make sure uart deep sleep is disabled when using BCSP */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_GETREQ, &ps_parbuf, 1); +=20=20=20=20 + if (ps_parbuf !=3D 0) + { + syslog(LOG_INFO, "Disabling deep sleep timer"); + ps_parbuf =3D 0; /* disable deep sleep timer */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_SETREQ, &ps_parbuf, 1); +=20=20=20=20=20=20 + /* Restart btd */ + kill(getpid(), 10); + } + } +=20=20 syslog(LOG_INFO, "Setting write_scan_enable in CSR module!\n"); =20 bt_write_scan_enable(bt_cfd, wrscan); @@ -216,8 +442,6 @@ =20 bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 - sleep(1); - bt_set_event_filter(bt_cfd, filter); =20 syslog(LOG_INFO, "Setting baudrate in CSR module!\n");=20=20 |
From: Peter K. <pk...@us...> - 2001-06-08 15:53:48
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected a log message. The diff of the modified file(s): --- bt_vendor.c 2001/06/08 09:55:47 1.17 +++ bt_vendor.c 2001/06/08 15:53:18 1.18 @@ -279,7 +279,7 @@ =20=20=20 if (hw_vendor() =3D=3D HW_CSR_H4) { - syslog(LOG_INFO, "Changing CSR host IF: BCSP -> H4"); + syslog(LOG_INFO, "Changing CSR host IF: H4 -> BCSP"); =20=20=20=20=20 /* Temporarily set stack to use BCSP framing */ csr_bcspmode(bt_cfd, 1); |
From: Mattias A. <mat...@us...> - 2001-06-13 12:23:54
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * added init_failed() which is run whenever init_stack fails. The behaviour is vendor dependent e.g for CSR we try changing IF (H4<->BCSP) * extracted some code to separate function (csr_disable_deep_sleep()) * moved change IF check from csr_init_hw to init_failed * changed some debug The diff of the modified file(s): --- bt_vendor.c 2001/06/08 15:53:18 1.18 +++ bt_vendor.c 2001/06/13 12:23:54 1.19 @@ -155,6 +155,52 @@ } } =20 + +/*=20 + * This function tries to recover stack if init failed=20 + * For now all other vendors but CSR is left to restart=20 + * btd but later on auto_probe on baudrate could be done. + */ + +void +init_failed(int bt_cfd, int phys_fd, int spd) +{ + + static int did_restart =3D 0; /* only try once */=20=20 +=20 + if (did_restart) + { + syslog(LOG_INFO, "Init failed after second try, giving up..."); + exit(1); + } + + sleep(1); + + switch (hw_vendor()) + { + case HW_CSR_H4: + case HW_CSR_BCSP: +=20=20=20=20 + /* Try changing interface BCSP<->H4 */ + csr_change_if(bt_cfd, phys_fd, spd);=20=20=20=20 + did_restart =3D 1; + + /* Restart btd */ + kill(getpid(), 10);=20 + break; +=20=20=20=20 + default: + /* Restart btd */ + syslog(LOG_INFO, "Init failed, lets try restarting btd"); + did_restart =3D 1; + + /* Restart btd */ + kill(getpid(), 10);=20=20=20 + break; + } +} + + int hw_vendor(void) { @@ -262,20 +308,34 @@ memcpy(ps_vals, &msg[CSR_PSKEY_MSGHDR_SIZE], n_pars*2); } =20 + +int csr_disable_deep_sleep(int bt_cfd) +{ + unsigned short ps_parbuf; + + /* Make sure uart deep sleep is disabled when using BCSP */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_GETREQ, &ps_parbuf, 1); +=20=20 + if (ps_parbuf !=3D 0) + { + syslog(LOG_INFO, "Disabling deep sleep timer"); + ps_parbuf =3D 0; /* disable deep sleep timer */ + csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 + CSR_PSKEY_SETREQ, &ps_parbuf, 1);=20=20=20=20 + return 1; + } + return 0; +} + /*=20 * Switches host interface in CSR HW (H4<->BCSP)=20 */ =20 void csr_change_if(int bt_cfd, int phys_fd, int spd) { - static int did_restart =3D 0; /* only try once */ - unsigned short ps_parbuf[10]; -=20=20 - if (did_restart) - return; =20 - shutdown_stack(bt_cfd); - sleep(1); + unsigned short ps_parbuf[10]; =20=20=20 if (hw_vendor() =3D=3D HW_CSR_H4) { @@ -298,17 +358,10 @@ =20 /* Make sure that deep sleep timer is disabled to=20 prevent problems when setting new ps keys */ - csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 - CSR_PSKEY_GETREQ, ps_parbuf, 1); =20=20=20=20=20 - if (ps_parbuf[0] !=3D 0) + if (csr_disable_deep_sleep(bt_cfd)) { - syslog(LOG_INFO, "Disabling deep sleep timer"); - ps_parbuf[0] =3D 0; /* disable deep sleep timer */ - csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 - CSR_PSKEY_SETREQ, ps_parbuf, 1); reset_hw(); - if (ioctl(bt_cfd, BTINITBCSP) < 0) { perror(__FUNCTION__); @@ -355,11 +408,18 @@ fd_setup(phys_fd, 115200, USE_FLOW_CTRL, DONT_USE_BCSP); =20 reset_hw();=20=20=20=20 + sleep(1); =20 /* Initialize stack */ init_stack(bt_cfd, spd); =20 + if (csr_disable_deep_sleep(bt_cfd)) + { + reset_hw(); + init_stack(bt_cfd, spd); /* reinitialize */ + } + /* Read params for ps key PSKEY_HOSTIO_UART_PS_BLOCK */ csr_pskey(bt_cfd, PSKEY_HOSTIO_UART_PS_BLOCK,=20 CSR_PSKEY_GETREQ, ps_parbuf, 10); @@ -387,11 +447,6 @@ syslog(LOG_ERR, __FUNCTION__ ": Unknown PS key parameter: %d", ps_pa= rbuf[1]); } } - - did_restart =3D 1; /* Only try once */ - - /* Restart btd */ - kill(getpid(), 10); } =20 /* fixme -- remove hardcoded values */ @@ -401,55 +456,25 @@ /* Connection setup, all devices, no auto accept */ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); - unsigned char bd[6]; -=20=20 - /* Now test whether stack initialized ok - Try reading local BD address */ - - read_local_bd(bt_cfd, bd); -=20=20 - if ((bd[0] =3D=3D 0) && (bd[1] =3D=3D 0) &&=20 - (bd[2] =3D=3D 0) && (bd[3] =3D=3D 0) && - (bd[4] =3D=3D 0) && (bd[5] =3D=3D 0)) - { - syslog(LOG_INFO, "Stack failed to initialize, try changing interface"); - csr_change_if(bt_cfd, phys_fd, spd); - } - - if (hw_vendor() =3D=3D HW_CSR_BCSP) - { - unsigned short ps_parbuf; - /* Make sure uart deep sleep is disabled when using BCSP */ - csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 - CSR_PSKEY_GETREQ, &ps_parbuf, 1); =20=20=20=20=20 - if (ps_parbuf !=3D 0) - { - syslog(LOG_INFO, "Disabling deep sleep timer"); - ps_parbuf =3D 0; /* disable deep sleep timer */ - csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 - CSR_PSKEY_SETREQ, &ps_parbuf, 1); -=20=20=20=20=20=20 - /* Restart btd */ - kill(getpid(), 10); - } - } + if ((hw_vendor() =3D=3D HW_CSR_BCSP) && (csr_disable_deep_sleep(bt_cfd))) + kill(getpid(), 10); /* Restart btd (and HW) to activate changes */ =20 - D(syslog(LOG_INFO, "Setting write_scan_enable in CSR module!")); + D(syslog(LOG_INFO, "Setting write_scan_enable in CSR module")); =20 bt_write_scan_enable(bt_cfd, wrscan); =20=20=20 /* improves reliability when doing a connect */ - D(syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module!")); + D(syslog(LOG_INFO, "Setting write_pagescan_activity in CSR module")); =20 bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 bt_set_event_filter(bt_cfd, filter); =20 - D(syslog(LOG_INFO, "Setting baudrate in CSR module!")); - sleep(1); =20=20=20 + D(syslog(LOG_INFO, "Setting baudrate in CSR module [%d baud]", spd)); + bt_set_baudrate(bt_cfd, spd); =20 /* Now set phys device speed to whatever HW was set to use */ @@ -523,7 +548,7 @@ =20 sleep(1); // wait for HW... =20 - D(syslog(LOG_INFO, "Setting baudrate in Ericsson module!")); + D(syslog(LOG_INFO, "Setting baudrate in Ericsson module")); bt_set_baudrate(bt_cfd, spd); usleep(10000); =20 @@ -547,11 +572,11 @@ unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20=20=20 sleep(1); - D(syslog(LOG_INFO, "Setting write_scan_enable in Infineon module!")); + D(syslog(LOG_INFO, "Setting write_scan_enable in Infineon module")); bt_write_scan_enable(bt_cfd, wrscan); =20 sleep(1); // wait for HW...=20 - D(syslog(LOG_INFO, "Setting baudrate in Infineon module!")); + D(syslog(LOG_INFO, "Setting baudrate in Infineon module")); bt_set_baudrate(bt_cfd, spd); =20=20=20 /* Now set phys device speed to whatever HW was set to use */ @@ -576,12 +601,12 @@ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 - D(syslog(LOG_INFO, "Setting write_scan_enable in USB module!")); + D(syslog(LOG_INFO, "Setting write_scan_enable in USB module")); =20 bt_write_scan_enable(bt_cfd, wrscan); =20=20=20 /* improves reliability when doing a connect */ - D(syslog(LOG_INFO, "Setting write_pagescan_activity in USB module!")); + D(syslog(LOG_INFO, "Setting write_pagescan_activity in USB module")); =20 bt_write_pagescan_activity(bt_cfd, 0x0800, 0x12); =20 @@ -607,7 +632,7 @@ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20 - D(syslog(LOG_INFO, "Setting write_scan_enable in generic module!")); + D(syslog(LOG_INFO, "Setting write_scan_enable in generic module")); =20=20=20 bt_write_scan_enable(bt_cfd, wrscan); bt_set_event_filter(bt_cfd, filter); |
From: Mattias A. <mat...@us...> - 2001-06-13 12:34:55
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.19 1.20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * replaced hardcoded val with define (SIGUSR1) The diff of the modified file(s): --- bt_vendor.c 2001/06/13 12:23:54 1.19 +++ bt_vendor.c 2001/06/13 12:34:55 1.20 @@ -186,7 +186,7 @@ did_restart =3D 1; =20 /* Restart btd */ - kill(getpid(), 10);=20 + kill(getpid(), SIGUSR1);=20 break; =20=20=20=20=20 default: @@ -195,7 +195,7 @@ did_restart =3D 1; =20 /* Restart btd */ - kill(getpid(), 10);=20=20=20 + kill(getpid(), SIGUSR1);=20=20=20 break; } } @@ -458,7 +458,7 @@ unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); =20=20=20 if ((hw_vendor() =3D=3D HW_CSR_BCSP) && (csr_disable_deep_sleep(bt_cfd))) - kill(getpid(), 10); /* Restart btd (and HW) to activate changes */ + kill(getpid(), SIGUSR1); /* Restart btd (and HW) to activate change= s */ =20=20=20=20=20=20=20 D(syslog(LOG_INFO, "Setting write_scan_enable in CSR module")); =20 |
From: Peter K. <pk...@us...> - 2001-06-19 11:21:00
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Only try to set the speed if the CSR firmware is new enough (temporarily setting the speed does not work correctly in 9.x). The diff of the modified file(s): --- bt_vendor.c 2001/06/13 12:34:55 1.20 +++ bt_vendor.c 2001/06/19 11:20:59 1.21 @@ -456,6 +456,8 @@ /* Connection setup, all devices, no auto accept */ unsigned char filter[3] =3D { 0x02, 0x00, 0x01 }; unsigned int wrscan =3D (PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); + int firmware =3D -1; + char* buf; =20=20=20 if ((hw_vendor() =3D=3D HW_CSR_BCSP) && (csr_disable_deep_sleep(bt_cfd))) kill(getpid(), SIGUSR1); /* Restart btd (and HW) to activate change= s */ @@ -473,6 +475,15 @@ =20 sleep(1);=20=20 =20 + if ((buf =3D bt_firmware_info())) + { + sscanf(buf, " Firmware version: %d", &firmware); + } + + /* Only try to set the speed if the CSR firmware is new enough + (temporarily setting the speed does not work correctly in 9.x) */ + if (firmware >=3D 90) + { D(syslog(LOG_INFO, "Setting baudrate in CSR module [%d baud]", spd)); =20 bt_set_baudrate(bt_cfd, spd); @@ -486,6 +497,11 @@ tcflush(phys_fd, TCIOFLUSH); =20 D(syslog(LOG_INFO, "Baudrate set")); + } + else + { + syslog(LOG_INFO, "Did not set baudrate in CSR module as its firmware i= s too old (%d)", firmware); + } } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ |
From: Peter K. <pk...@us...> - 2001-08-29 08:51:47
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.22 1.23=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Only set the speed in the *_init_hw() functions if it is greater than 0. The diff of the modified file(s): --- bt_vendor.c 2001/08/29 08:39:09 1.22 +++ bt_vendor.c 2001/08/29 08:51:47 1.23 @@ -480,6 +480,8 @@ sscanf(buf, " Firmware version: %d", &firmware); } =20 + if (spd > 0) + { /* Only try to set the speed if the CSR firmware is new enough (temporarily setting the speed does not work correctly in 9.x) */ if (firmware >=3D 90) @@ -503,6 +505,7 @@ syslog(LOG_INFO, "Did not set baudrate in CSR module as its firmware i= s too old (%d)", firmware); } } +} =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* Digianswer specific commands */ @@ -523,6 +526,10 @@ =20 D(syslog(LOG_INFO, "Setting baudrate in Digianswer PC card")); =20 + bt_set_event_filter(bt_cfd, filter); + + if (spd > 0) + { bt_set_baudrate(bt_cfd, spd); =20=20=20 if (spd > 115200) @@ -530,12 +537,11 @@ printf("WARNING : Does this HW really support speeds > 115200 ?\n"); } =20=20=20 - bt_set_event_filter(bt_cfd, filter); - /* Now set phys device speed to whatever HW was set to use */ fd_setup(phys_fd, spd, USE_FLOW_CTRL, DONT_USE_BCSP);=20=20 tcflush(phys_fd, TCIOFLUSH); } +} =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* Ericsson specific commands */ @@ -564,6 +570,8 @@ =20 sleep(1); // wait for HW... =20 + if (spd > 0) + { D(syslog(LOG_INFO, "Setting baudrate in Ericsson module")); bt_set_baudrate(bt_cfd, spd); usleep(10000); @@ -572,6 +580,7 @@ fd_setup(phys_fd, spd, USE_FLOW_CTRL, DONT_USE_BCSP); tcflush(phys_fd, TCIOFLUSH); } +} =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ /* Infineon specific commands */ @@ -592,12 +601,16 @@ bt_write_scan_enable(bt_cfd, wrscan); =20 sleep(1); // wait for HW...=20 + + if (spd > 0) + { D(syslog(LOG_INFO, "Setting baudrate in Infineon module")); bt_set_baudrate(bt_cfd, spd); =20=20=20 /* Now set phys device speed to whatever HW was set to use */ fd_setup(phys_fd, spd, USE_FLOW_CTRL, DONT_USE_BCSP); tcflush(phys_fd, TCIOFLUSH); + } } =20 /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/ |
From: Peter K. <pk...@us...> - 2001-09-06 16:02:37
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.c 1.26 1.27=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Shutdown the stack at the end of csr_h4_to_bcsp() and csr_bcsp_to_h4(). The diff of the modified file(s): --- bt_vendor.c 2001/08/29 10:02:05 1.26 +++ bt_vendor.c 2001/09/06 16:02:37 1.27 @@ -387,6 +387,8 @@ =20 /* Set back stack to use H4 framing */ bt_bcsp_mode(bt_cfd, 0); + + shutdown_stack(bt_cfd); } =20 void csr_h4_to_bcsp(int bt_cfd, int phys_fd) @@ -430,16 +432,16 @@ ps_parbuf[0] =3D 0x1; /* BCSP */ csr_pskey(bt_cfd, PSKEY_HOST_INTERFACE,=20 CSR_PSKEY_SETREQ, ps_parbuf, 1); - - /* Should not be needed if hw_vendor is changed in kernel ....*/ - - /* Set back stack to use BCSP framing */ - bt_bcsp_mode(bt_cfd, 1); } else { syslog(LOG_ERR, __FUNCTION__ ": Unknown PS key parameter: %d", ps_parb= uf[1]); } + + /* Set back stack to use BCSP framing */ + bt_bcsp_mode(bt_cfd, 1); + + shutdown_stack(bt_cfd); } =20 =20 |
From: Alain P. <apa...@us...> - 2002-05-16 15:12:45
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bt_vendor.c 1.33 1.34=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added prototype to avoid implicit declarations. The diff of the modified file(s): --- bt_vendor.c 10 May 2002 12:29:00 -0000 1.33 +++ bt_vendor.c 16 May 2002 15:12:45 -0000 1.34 @@ -66,6 +66,8 @@ static void ericsson_init_hw(int bt_cfd, int phys_fd, const char *speedstr= ); static void infineon_init_phys(int fd, int flow_control); static void infineon_init_hw(int bt_cfd, int phys_fd, const char *speedstr= ); +static void texasinstruments_init_phys(int fd, int flow_control); +static void texasinstruments_init_hw(int bt_cfd, int phys_fd, const char *= speedstr); static void usb_init_phys(int fd, int flow_control); static void usb_init_hw(int bt_cfd, int phys_fd, const char *speedstr); static void generic_init_phys(int fd, int flow_control); |
From: Alain P. <apa...@us...> - 2002-07-22 17:23:57
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bt_vendor.c 1.35 1.36=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Setting speed for the CSR is not big-endian compatible. If you use this fun= ction on a big-endian platform, it will crash. I tried to correct this, but it do= esn't work for the moment. So I added a define to avoid this temporary. The diff of the modified file(s): --- bt_vendor.c 3 Jun 2002 10:07:28 -0000 1.35 +++ bt_vendor.c 22 Jul 2002 17:23:56 -0000 1.36 @@ -339,6 +339,7 @@ return 0; } =20 + /*=20 * Switches host interface in CSR HW (H4<->BCSP)=20 */ @@ -516,6 +517,7 @@ =20 if (speedstr) { +#ifndef CONFIG_BLUETOOTH_SD_SPECIFIC /* PAL - The setting of the speed doe= sn't work in big-endian */ /* Only try to set the speed if the CSR firmware is new enough (temporarily setting the speed does not work correctly in 9.x) */ if (firmware >=3D 90) @@ -534,6 +536,7 @@ { syslog(LOG_INFO, "Did not set baudrate in CSR module as its firmware= is too old (%d)", firmware); } +#endif /* CONFIG_BLUETOOTH_SD_SPECIFIC */ } } =20 |
From: Alain P. <apa...@us...> - 2002-07-22 19:05:38
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bt_vendor.c 1.36 1.37=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Remove the PS keys, because if they are set, the platform will crash when we will try to make a connection. The diff of the modified file(s): --- bt_vendor.c 22 Jul 2002 17:23:56 -0000 1.36 +++ bt_vendor.c 22 Jul 2002 19:05:25 -0000 1.37 @@ -290,6 +290,8 @@ { unsigned short msg[CSR_PSKEY_MAXPARAMS + CSR_PSKEY_MSGHDR_SIZE]; =20 +#ifndef CONFIG_BLUETOOTH_SD_SPECIFIC + syslog(LOG_INFO, __FUNCTION__": ps_key 0x%x rw_mode : %d", ps_key, rw_mo= de); =20 msg[0] =3D ps_key; @@ -317,6 +319,8 @@ /* Copy back return params if READ (skip message header) */ if (rw_mode =3D=3D CSR_PSKEY_GETREQ) memcpy(ps_vals, &msg[CSR_PSKEY_MSGHDR_SIZE], n_pars*2); + +#endif /* CONFIG_BLUETOOTH_SD_SPECIFIC */ } =20 =20 |
From: Alain P. <apa...@us...> - 2002-07-31 09:50:43
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bt_vendor.c 1.37 1.38=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Just added a define for our specific-bigendian problems The diff of the modified file(s): --- bt_vendor.c 22 Jul 2002 19:05:25 -0000 1.37 +++ bt_vendor.c 31 Jul 2002 09:50:42 -0000 1.38 @@ -328,6 +328,7 @@ { unsigned short ps_parbuf; =20 +#ifndef CONFIG_BLUETOOTH_SD_SPECIFIC /* Make sure uart deep sleep is disabled when using BCSP */ csr_pskey(bt_cfd, PSKEY_UART_SLEEP_TIMEOUT,=20 CSR_PSKEY_GETREQ, &ps_parbuf, 1); @@ -340,6 +341,7 @@ CSR_PSKEY_SETREQ, &ps_parbuf, 1);=20=20=20=20 return 1; } +#endif /* CONFIG_BLUETOOTH_SD_SPECIFIC */ return 0; } =20 |
From: Alain P. <apa...@us...> - 2002-08-02 08:56:54
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bt_vendor.c 1.38 1.39=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added a simple way to include config.h if you use configure when compiling OpenBT. The diff of the modified file(s): --- bt_vendor.c 31 Jul 2002 09:50:42 -0000 1.38 +++ bt_vendor.c 2 Aug 2002 08:56:52 -0000 1.39 @@ -56,6 +56,13 @@ #include "bt_vendor.h" #include "bt_if.h" =20 +/* If you use configure scripts, just define ENABLE_CONFIGURE_INCLUDES */ +/* to include the generated .h file */ + +#ifdef ENABLE_CONFIGURE_INCLUDES +#include <config.h> +#endif + #define D(x) //x =20 static void csr_init_phys(int fd, int flow_control); @@ -291,7 +298,6 @@ unsigned short msg[CSR_PSKEY_MAXPARAMS + CSR_PSKEY_MSGHDR_SIZE]; =20 #ifndef CONFIG_BLUETOOTH_SD_SPECIFIC - syslog(LOG_INFO, __FUNCTION__": ps_key 0x%x rw_mode : %d", ps_key, rw_mo= de); =20 msg[0] =3D ps_key; |