diff -ru bluetooth/apps/btd.c bluetooth-csr/apps/btd.c --- bluetooth/apps/btd.c Mon Aug 14 15:03:31 2000 +++ bluetooth-csr/apps/btd.c Tue Oct 31 09:59:53 2000 @@ -197,6 +197,7 @@ #define UNKNOWN_HW 0 #define DIGIDONGLE 1 #define ERICSSON_MODULE 2 +#define CSR 3 #define PPPDCMD "pppd" @@ -231,6 +232,7 @@ static int phys_fd; static int bt_fd; +int role = DEFAULT_ROLE; #ifdef RESTART_ENABLED jmp_buf jmpbuffer; @@ -290,7 +292,6 @@ { int pid; int enter_cmd_mode = 0; - int role = DEFAULT_ROLE; int opt; int do_reset = 0; int spd; @@ -1134,6 +1135,13 @@ fd_setup(fd, 9600, USE_FLOW_CTRL); hw_init = DIGIDONGLE; } + else if (strncmp(hw, "csr", 3) == 0) + { + printf("Initializing CSR HW\n"); + /* Setup HW default serial port speed */ + fd_setup(fd, 115200, USE_FLOW_CTRL); + hw_init = CSR; + } else { /* No HW initialization */ @@ -1214,7 +1222,18 @@ printf("Setting baudrate in digi dongle\n"); set_digi_baudrate(spd); break; - + + case CSR: + if (role == SERVER) + { + printf("Setting write_scan_enable in CSR module!\n"); + write_scan_enable(PAGE_SCAN_ENABLE | INQUIRY_SCAN_ENABLE); + + printf("Setting write_pagescan_activity in CSR module!\n"); + write_pagescan_activity(0x50, 0x20); + } + break; + default: printf("No hw init done\n"); break; @@ -1270,7 +1289,26 @@ exit(1); } break; - + + case CSR: + if (role == SERVER) + { + printf("Setting write_scan_enable in CSR module!\n"); + if (ioctl(bt_fd, BTWRITESCANENABLE) < 0) + { + perror("BTWRITESCANENABLE"); + exit(1); + } + + printf("Setting write_pagescan_activityin CSR module!\n"); + if (ioctl(bt_fd, BTWRITEPAGESCANACTIVITY) < 0) + { + perror("BTWRITEPAGESCANACTIVITY"); + exit(1); + } + } + break; + default: printf("No hw init done\n"); break; diff -ru bluetooth/apps/btd.h bluetooth-csr/apps/btd.h --- bluetooth/apps/btd.h Mon Aug 14 15:03:31 2000 +++ bluetooth-csr/apps/btd.h Tue Oct 31 10:00:42 2000 @@ -45,6 +45,7 @@ #define BTSETERICSSONBAUDRATE _IOW(BT_IOC_MAGIC, 0x20, int) #define BTSETDIGIBAUDRATE _IOW(BT_IOC_MAGIC, 0x21, int) #define BTWRITEERICSSONBDADDR _IOW(BT_IOC_MAGIC, 0x22, unsigned char[6]) +#define BTWRITEPAGESCANACTIVITY _IO(BT_IOC_MAGIC, 0x12) /* other ioctls used for testing */ #define BTSENDTESTDATA _IOW(BT_IOC_MAGIC, 0xf0, int[2]) diff -ru bluetooth/include/linux/bluetooth/btcommon.h bluetooth-csr/include/linux/bluetooth/btcommon.h --- bluetooth/include/linux/bluetooth/btcommon.h Mon Aug 14 15:03:31 2000 +++ bluetooth-csr/include/linux/bluetooth/btcommon.h Tue Oct 31 10:01:29 2000 @@ -91,7 +91,7 @@ #define BTSETERICSSONBAUDRATE _IOW(BT_IOC_MAGIC, 0x20, s32) #define BTSETDIGIBAUDRATE _IOW(BT_IOC_MAGIC, 0x21, s32) #define BTWRITEERICSSONBDADDR _IOW(BT_IOC_MAGIC, 0x22, u8[6]) - +#define BTWRITEPAGESCANACTIVITY _IO(BT_IOC_MAGIC, 0x12) /* other ioctls used for testing */ #define BTSENDTESTDATA _IOW(BT_IOC_MAGIC, 0xf0, s32[2]) diff -ru bluetooth/include/linux/bluetooth/hci.h bluetooth-csr/include/linux/bluetooth/hci.h --- bluetooth/include/linux/bluetooth/hci.h Mon Aug 14 15:03:31 2000 +++ bluetooth-csr/include/linux/bluetooth/hci.h Tue Oct 31 10:02:27 2000 @@ -60,8 +60,7 @@ s32 write_scan_enable(u32 enable); s32 hci_inquiry(u8 lap[], u8 inq_len, u8 num_resp); s32 hci_add_sco_link(u32 hci_hdl); - - +s32 write_pagescan_activity(u32 interval, u32 wind); #endif /****************** END OF FILE hci.h ***************************************/ diff -ru bluetooth/src/bluetooth.c bluetooth-csr/src/bluetooth.c --- bluetooth/src/bluetooth.c Mon Aug 14 15:03:31 2000 +++ bluetooth-csr/src/bluetooth.c Tue Oct 31 10:04:15 2000 @@ -521,6 +521,12 @@ write_scan_enable(PAGE_SCAN_ENABLE|INQUIRY_SCAN_ENABLE); break; + case BTWRITEPAGESCANACTIVITY: + BT_DRIVER("setting pagescan activity\n"); + /* fixme - add option to use different setup */ + write_pagescan_activity(0x50, 0x20); + break; + case BTSETERICSSONBAUDRATE: /* Set baudrate in hardware */ diff -ru bluetooth/src/hci.c bluetooth-csr/src/hci.c --- bluetooth/src/hci.c Mon Aug 14 15:03:31 2000 +++ bluetooth-csr/src/hci.c Tue Oct 31 10:06:35 2000 @@ -370,7 +370,7 @@ static s32 read_buffer_size(void); static s32 read_stored_link_key(u8 *bd, u8 flag); static s32 read_ericsson_rev_info(void); -static s32 write_pagescan_activity(u32 interval, u32 wind); +//static s32 write_pagescan_activity(u32 interval, u32 wind); static s32 write_inquiryscan_activity(u32 interval, u32 wind); static s32 send_negotiation_pkt(void); @@ -1399,7 +1399,7 @@ hci_ctrl.nbr_of_connections = 0; hci_ctrl.hc_buf.cmd_num = 1; - hci_reset(); + //hci_reset(); Due to CSR Firmware bug read_buffer_size(); #ifndef HCI_EMULATION @@ -1407,7 +1407,7 @@ start_cmd_timer(); interruptible_sleep_on(&hci_wq); - read_ericsson_rev_info(); + //read_ericsson_rev_info(); // read_stored_link_key(NULL,1); #endif