You can subscribe to this list here.
2001 |
Jan
|
Feb
(44) |
Mar
(202) |
Apr
(134) |
May
(89) |
Jun
(94) |
Jul
(58) |
Aug
(58) |
Sep
(56) |
Oct
(75) |
Nov
(26) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(24) |
Feb
(30) |
Mar
(15) |
Apr
(49) |
May
(12) |
Jun
(6) |
Jul
(11) |
Aug
(20) |
Sep
(19) |
Oct
(3) |
Nov
(13) |
Dec
(1) |
2003 |
Jan
(7) |
Feb
(4) |
Mar
(7) |
Apr
(5) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(51) |
Dec
(1) |
2004 |
Jan
(11) |
Feb
(5) |
Mar
|
Apr
(5) |
May
(2) |
Jun
|
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mattias A. <mat...@us...> - 2001-06-06 14:59:35
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_debug.h 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added BCSP_PARSELOWER which parses in/outgoing BCSP headers The diff of the modified file(s): --- bcsp_debug.h 2001/05/18 13:50:33 1.2 +++ bcsp_debug.h 2001/06/06 14:59:35 1.3 @@ -48,7 +48,7 @@ =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 -#define BCSP_SYS_DEBUG 1 +#define BCSP_SYS_DEBUG 0 =20 #ifdef BCSP_SYS_DEBUG=20 #define BCSP_SYS(fmt...) printk("BCSP msg: " fmt) @@ -57,6 +57,8 @@ #endif =20 #define BCSP_DEBUG 0 + +#define BCSP_PARSELOWER 0 /* Parses in/outgoing BCSP headers */ =20 #define SLIP_DEBUG 0 =20 |
From: Mattias A. <mat...@us...> - 2001-06-06 14:59:09
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.h 1.40 1.41=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added bt_reset_phys_hw function The diff of the modified file(s): --- bluetooth.h 2001/05/22 09:45:53 1.40 +++ bluetooth.h 2001/06/06 14:59:08 1.41 @@ -92,6 +92,7 @@ void bt_connect_cfm(u32 con_id, s32 status); s32 bt_sprint_status(u8 *buf); void bt_send_sdp_data_received(u8 line, u8 *data, int len); +void bt_reset_phys_hw(void); =20 /* Handles wakeup of failed blocking function calls */ #ifdef __KERNEL__ |
From: Mattias A. <mat...@us...> - 2001-06-06 14:58:45
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btcommon.h 1.74 1.75=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added ioctls for setting bcsp mode, read/write csr ps key=20 and initializing BCSP The diff of the modified file(s): --- btcommon.h 2001/04/26 13:23:28 1.74 +++ btcommon.h 2001/06/06 14:58:45 1.75 @@ -188,6 +188,15 @@ #define BTTESTCOMMAND _IOW(BT_IOC_MAGIC, 0xf2, u8[261]) #define BTSETMSSWITCH _IOW(BT_IOC_MAGIC, 0xf3, u8) =20 +#define BTSETBCSPMODE _IOW(BT_IOC_MAGIC, 0xf4, u8) + +#define CSR_PSKEY_MSGHDR_SIZE 3 +#define CSR_PSKEY_MAXPARAMS 10 + +#define BT_CSR_PSKEY _IOWR(BT_IOC_MAGIC, 0xf5, u16[CSR_PSKEY_MSGHDR_SIZE = + CSR_PSKEY_MAXPARAMS]) + +#define BTINITBCSP _IO(BT_IOC_MAGIC, 0xf6) + /* | BD(6) | len(2) | data |*/ #define BTPING _IOW(BT_IOC_MAGIC, 0x73, ping_struct) =20 |
From: Mattias A. <mat...@us...> - 2001-06-06 14:58:20
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_internal.h 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added csr_pskey The diff of the modified file(s): --- hci_internal.h 2001/05/17 15:35:42 1.16 +++ hci_internal.h 2001/06/06 14:58:20 1.17 @@ -356,9 +356,12 @@ Called from hci.c. Implemented in hci_vendor.c */ + void process_vendor_return_param(u32 ocf, u8* r_val); void process_vendor_event(u8 *buf, u32 len, u32 event_code); s32 hci_set_buffer_sizes(u16 len, u16 num); +s32 csr_pskey(u16 ps_key, u16 rw_mode, u16 *retb, u16 n_pars); + #endif =20 /****************** END OF FILE hci_internal.h ***************************= ***/ |
From: Mattias A. <mat...@us...> - 2001-06-06 14:57:44
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btmem.c 1.41 1.42=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added default values of bt_buf struct The diff of the modified file(s): --- btmem.c 2001/04/25 16:49:24 1.41 +++ btmem.c 2001/06/06 14:57:44 1.42 @@ -102,7 +102,7 @@ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 -static bt_buf_main bt_buf; +static bt_buf_main bt_buf =3D {NULL, NULL, NULL, NULL, NULL, 0, 0, 0}; =20 /****************** FUNCTION DEFINITION SECTION **************************= ***/ =20 @@ -133,6 +133,7 @@ DSYS("Shutting down BTMEM\n"); /* FIXME - Check that the stack is not in use */ /* Deallocate memory area */ + if (bt_buf.head) kfree(bt_buf.head); bt_buf.head =3D NULL; } |
From: Mattias A. <mat...@us...> - 2001-06-06 14:57:20
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btdebug.c 1.21 1.22=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Corrected format * Added timestamp printing in print_data if enabled The diff of the modified file(s): --- btdebug.c 2001/05/23 15:10:48 1.21 +++ btdebug.c 2001/06/06 14:57:19 1.22 @@ -79,12 +79,12 @@ tv_old.tv_usec; =20=09 if (use_stdout =3D=3D 1) { - printk("[%03d,%08d|%06d] ",=20 + printk("[%03d,%06d<%06d>] ",=20 (int)tv.tv_sec, (int)tv.tv_usec, diff); } else { - len =3D sprintf(buf, "[%03d,%08d|%06d] ",=20 + len =3D sprintf(buf, "[%03d,%06d<%06d>] ",=20 (int)tv.tv_sec, tv.tv_usec, diff); buf[len] =3D 0; } @@ -107,8 +107,13 @@ {=20 s32 t =3D 0; =20 +#if BT_USE_TIMESTAMPS if (message) + printk("\n%s %s (%d):\n", print_time(0), message, len); +#else + if (message) printk("\n%s (%d):\n", message, len); +#endif while (t < len) { printk("0x%02x ", buf[t++]); |
From: Mattias A. <mat...@us...> - 2001-06-06 14:56:41
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- Config.in 1.15 1.16=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added CONFIG_BLUETOOTH_SUPPORT_BCSP which always links bcsp code if set. * CONFIG_BLUETOOTH_USE_BCSP now only enabled BCSP by default=20 if ..SUPPORT_BCSP is set=20 The diff of the modified file(s): --- Config.in 2001/05/17 10:58:03 1.15 +++ Config.in 2001/06/06 14:56:41 1.16 @@ -22,7 +22,11 @@ fi =20 if [ "$CONFIG_BLUETOOTH_CSR" =3D "y" ]; then - bool ' Enable BCSP' CONFIG_BLUETOOTH_USE_BCSP + bool ' Support BCSP' CONFIG_BLUETOOTH_SUPPORT_BCSP + + if [ "$CONFIG_BLUETOOTH_SUPPORT_BCSP" =3D "y" ]; then + bool ' Use BCSP' CONFIG_BLUETOOTH_USE_BCSP + fi fi =20 bool ' Bluetooth proc entries' CONFIG_BLUETOOTH_PROC |
From: Mattias A. <mat...@us...> - 2001-06-06 14:55:54
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_datagram.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added init function to unchoke datastream * Silent discard on CONF messages (used to detect restart option) * Always reply on SYNC * Call bcsp_syncronized only when receiving SYNC_RSP The diff of the modified file(s): --- bcsp_datagram.c 2001/05/30 09:47:00 1.6 +++ bcsp_datagram.c 2001/06/06 14:55:53 1.7 @@ -48,6 +48,7 @@ #include <asm/byteorder.h> #include <asm/unaligned.h> =20 + #include <linux/bluetooth/sysdep-2.1.h> #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> @@ -72,17 +73,33 @@ static s32 send_conf_rsp(void); static s32 send_sync_pkt(u32 type); =20 +static s32 bcsp_datagram_initiated =3D 0; + /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 /****************** FUNCTION DEFINITION SECTION **************************= ***/ =20 +void=20 +bcsp_datagram_init(void) +{ + bcsp_datagram_initiated =3D 1; +} + +void=20 +bcsp_datagram_shutdown(void) +{ + bcsp_datagram_initiated =3D 0; +} + s32 bcsp_datagram_receive(struct bcsp *bcsp) { + if (!bcsp_datagram_initiated) + return; + if (handle_sync_pkt(bcsp)) { - D(__FUNCTION__ ": Sync packet received, sending respose\n"); return 0; } =20 @@ -119,21 +136,25 @@ sync_string =3D le32_to_cpu(get_unaligned((u32 *)bcsp->payload)); =20 switch (sync_string) { + case SYNC:=09 D(__FUNCTION__ ": Found SYNC\n"); + D(__FUNCTION__ ": Send SYNC_RSP\n"); bcsp_send_sync(SYNC_RSP);=09=09 return TRUE; + case SYNC_RSP: D(__FUNCTION__": Found SYNC_RSP\n"); - bcsp_send_sync(CONF); - break; - case CONF: - D(__FUNCTION__ ": Found CONF\n"); - bcsp_send_sync(CONF_RSP); + bcsp_syncronized(); return TRUE; + + case CONF: /* this should always be done */ + D(__FUNCTION__ ": Found CONF, silent discard\n"); + return TRUE; + case CONF_RSP: D(__FUNCTION__": Found CONF_RSP\n"); - break; + return TRUE; default: return FALSE; } @@ -145,8 +166,6 @@ struct bcsp bcsp; u32 payload =3D cpu_to_le32(type); =20=09 - D(__FUNCTION__ "\n"); - bcsp_init_packet(&bcsp); =20=09 bcsp.identifier =3D 1;=20 |
From: Mattias A. <mat...@us...> - 2001-06-06 14:55:19
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_sequence.c 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Fixed bug when calculating winspace=20 * Don't use static variables if BCSP_PARSELOWER is defined * Set rtx timeout to default (250 ms) * Always reset variables in bcsp_sequence_init() * Choke all received data until we are syncronized * Added debug macros aroung some printouts * Don't turn off interrupts more than necessary * Added max number of retransmits (default 20) The diff of the modified file(s): --- bcsp_sequence.c 2001/05/30 09:47:00 1.10 +++ bcsp_sequence.c 2001/06/06 14:55:18 1.11 @@ -62,7 +62,7 @@ #endif =20 #define WINSIZE 4 -#define SEQUENCE_TIMEOUT HZ +#define SEQUENCE_TIMEOUT (HZ/4) /* default 250 ms */ =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ =20 @@ -88,12 +88,20 @@ static struct tq_struct resend_data_task; static struct tq_struct send_ack_task; =20 -static u8 txseq =3D 0; -static u8 txack =3D 0; -static u8 rxack =3D 0; -static u8 expected_rxseq =3D 0; +#if BCSP_PARSELOWER +u8 txseq; +u8 txack; +u8 rxack; +u8 expected_rxseq; +u8 winspace; +#else +static u8 txseq; +static u8 txack; +static u8 rxack; +static u8 expected_rxseq; +static u8 winspace; +#endif =20 -static u8 winspace =3D WINSIZE; =20 static u32 got_packet =3D FALSE; =20 @@ -113,6 +121,12 @@ =20 send_ack_task.routine =3D (void*)send_ack; send_ack_task.data =3D NULL; + + txseq =3D 0; + txack =3D 0; + rxack =3D 0; + expected_rxseq =3D 0; + winspace =3D WINSIZE; } =20 void @@ -124,12 +138,12 @@ s32 bcsp_sequence_receive(struct bcsp *bcsp) { - if (!got_packet) { - got_packet =3D TRUE; - bcsp_syncronized(); + if (!bcsp_issyncronized()){=09 + D(printk("Still not synced\n")); + return 0; } =20 - printk(__FUNCTION__": txack:%d, expected_rxseq:%d, BCSP_GET_SEQ(bcsp):%d\= n", txack, expected_rxseq, BCSP_GET_SEQ(bcsp)); + D(__FUNCTION__": txack:%d, expected_rxseq:%d, BCSP_GET_SEQ(bcsp):%d\n", t= xack, expected_rxseq, BCSP_GET_SEQ(bcsp)); =20=09 if (expected_rxseq =3D=3D BCSP_GET_SEQ(bcsp)) { cli(); @@ -137,10 +151,11 @@ expected_rxseq =3D (expected_rxseq + 1) % 8; sti(); =20 - if ((winspace > 0) && (hci_trig_send())) { - printk("*\n"); + if ((winspace > 0) && (buf_count())) { + /* ack is piggybacked in next tx data packet */ + D("<-data ack\n"); } else { - printk(" -\n"); + D("<-ack\n"); send_ack(); } =20=09=09 @@ -148,10 +163,13 @@ bcsp->identifier); } else { /* out of order rx seq nbr */=20 if ((winspace > 0) && (hci_trig_send())) { - print_data(__FUNCTION__, bcsp->payload, bcsp->payload_length); - printk("**\n"); + print_data(__FUNCTION__, bcsp->payload,=20 + bcsp->payload_length); + printk("seq out-of-order [exp:%d, got:%d]\n",=20 + expected_rxseq, BCSP_GET_SEQ(bcsp)); } else { - printk(" --\n"); + printk("seq out-of-order [exp:%d, got:%d], send ack\n", + expected_rxseq, BCSP_GET_SEQ(bcsp)); send_ack(); } } @@ -164,7 +182,7 @@ { struct bcsp bcsp; =20 - //printk(__FUNCTION__": rxack:%d, txack:%d, txseq:%d, winspace:%d\n", rxa= ck, txack, txseq, winspace); + D(__FUNCTION__": rxack:%d, txack:%d, txseq:%d, winspace:%d\n", rxack, txa= ck, txseq, winspace); =20=09 if (winspace > 0) { bcsp_init_packet(&bcsp); @@ -176,14 +194,15 @@ cli(); BCSP_SET_SEQ(&bcsp, txseq); BCSP_SET_ACK(&bcsp, txack); -=09=09 bcsp.payload =3D data; bcsp.payload_length =3D len; + sti(); =20 memcpy(resend_buffer[txseq].data, data, len); resend_buffer[txseq].len =3D len; resend_buffer[txseq].chn =3D chn; =20=09=09 + cli(); txseq =3D (txseq + 1) % 8; winspace--; sti(); @@ -193,7 +212,9 @@ /* restart timer */ start_resend_timer(); } else { - printk(__FUNCTION__": winspace =3D 0\n"); +#ifdef DBG_BCSPHEADER + printk(__FUNCTION__": win=3D0\n"); +#endif return 0; } =20 @@ -204,8 +225,7 @@ bcsp_signal_rxack(u8 new_ack) { s32 trig_send =3D FALSE; - printk(__FUNCTION__": Got new ack:%d, rxack is:%d, txseq:%d, winspace:%d\= n", new_ack, rxack, txseq, winspace); - + D(__FUNCTION__": Got new ack:%d, rxack is:%d, txseq:%d, winspace:%d\n", n= ew_ack, rxack, txseq, winspace); =20 if (rxack =3D=3D new_ack) { /* Same ack again... */ return; @@ -216,40 +236,45 @@ trig_send =3D TRUE; } =20 - D(__FUNCTION__": winspace before:%d\n", winspace); + D(__FUNCTION__": winspace before:%d [%d, %d]\n",=20 + winspace, rxack, new_ack); if (new_ack > rxack) { winspace +=3D (new_ack - rxack); } else { - winspace +=3D (WINSIZE - (rxack - new_ack) + 1); + winspace +=3D (8 - (rxack - new_ack)); } - D(__FUNCTION__": winspace after:%d\n", winspace); =20=09 + D(__FUNCTION__" win_up:%d\n", winspace); + rxack =3D new_ack; + sti(); =20=09 if (winspace =3D=3D WINSIZE) { release_resend_timer(); } else if (winspace > WINSIZE) { - printk(__FUNCTION__": Something has gone wrong winspace > WINSIZE\n"); + printk(__FUNCTION__": ERROR winspace > WINSIZE [%d]\n",=20 + winspace); release_resend_timer(); - winspace =3D WINSIZE; } =20=09 if (trig_send) { - printk(__FUNCTION__": Trying to trig send\n"); hci_trig_send(); } } =20 +#define BCSP_RTX_MAX 20 void sequence_resend(void) { struct bcsp bcsp; u8 resend_cnt =3D rxack; + u8 rtx_count =3D BCSP_RTX_MAX; +=09 cli(); - while (resend_cnt !=3D txseq) { + while ((resend_cnt !=3D txseq) && (rtx_count--)) { sti(); - printk(__FUNCTION__": Resending with seq_nbr:%d, last ack was %d, cur se= q_nbr:%d\n", resend_cnt, rxack, txseq); + printk(__FUNCTION__" : seq_nbr:%d, last_ack:%d, cur_seq:%d\n\n", resend_= cnt, rxack, txseq); =20 bcsp_init_packet(&bcsp); =20 @@ -268,8 +293,16 @@ resend_cnt =3D (resend_cnt + 1) % 8; } sti(); +=09 + if (rtx_count =3D=3D 0) + { + printk("ERROR : giving up on rtx !\n"); + /* fixme -- signal link down etc. */ + } + else start_resend_timer(); } + =20 void send_ack(void) |
From: Mattias A. <mat...@us...> - 2001-06-06 14:54:35
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.11 1.12=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added syncronizing timeout * Added bcsp_issyncronized which returns whether synced or not * Added init of datagram layer (unchoke) * Added return value in bcsp_init to notify status to caller=20 * Added debug function for parsing incoming/outgoing BCSP headers +=20 showing other useful information * Minor changes & cleanup The diff of the modified file(s): --- bcsp.c 2001/05/30 09:47:00 1.11 +++ bcsp.c 2001/06/06 14:54:34 1.12 @@ -46,11 +46,14 @@ #include <linux/malloc.h> #include <linux/string.h> #include <linux/types.h> +#include <linux/delay.h> #include <asm/byteorder.h> #include <asm/unaligned.h> =20 + #include <linux/bluetooth/sysdep-2.1.h> #include <linux/bluetooth/btcommon.h> +#include <linux/bluetooth/btmem.h> #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> #include <linux/bluetooth/bluetooth.h> @@ -60,10 +63,10 @@ =20 #if BCSP_DEBUG #define D(fmt...) printk("BCSP: "fmt) -#define PRINTPKT(data, len) print_data(NULL, data, len) +#define BCSPDUMP(data, len) print_data(__FUNCTION__, data, len) #else #define D(fmt...) -#define PRINTPKT(data, len) +#define BCSPDUMP(data, len) #endif =20 #define BCSP_BCCMD_CHN 2 @@ -79,10 +82,13 @@ =20 /****************** LOCAL FUNCTION DECLARATION SECTION *******************= ***/ =20 +void bcsp_sync_timeout(unsigned long ptr); + /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 +static struct timer_list bcsp_sync_timer; static struct wait_queue *bcsp_sync_wq =3D NULL; static u32 bcsp_sync =3D FALSE; =20 @@ -111,32 +117,71 @@ * "The UART driver" */ =20 -void +s32 bcsp_init(void) { - BCSP_SYS(__FUNCTION__ ": Initializing BCSP\n"); + DSYS("Initializing BCSP\n"); +=09 + bcsp_datagram_init(); bcsp_sequence_init(); +=09 + /* Start sync status timer */ + +#ifdef __KERNEL__ + init_timer(&bcsp_sync_timer); + bcsp_sync_timer.function =3D bcsp_sync_timeout; + bcsp_sync_timer.data =3D 0; + bcsp_sync_timer.expires =3D jiffies + 5*HZ; + add_timer(&bcsp_sync_timer); +#endif + + /* Start syncing */ bcsp_send_sync(SYNC); + cli(); if (!bcsp_sync) { interruptible_sleep_on(&bcsp_sync_wq); } sti(); + + /* notify bt driver that sync failed */ + if (!bcsp_sync) + return -1; } =20 void bcsp_shutdown(void) { - BCSP_SYS(__FUNCTION__": Shutting down BCSP\n"); + DSYS("Shutting down BCSP\n"); + bcsp_datagram_shutdown(); /* choke datastream */ bcsp_sequence_shutdown(); } =20 void +bcsp_sync_timeout(unsigned long ptr) +{ + D_ERR(__FUNCTION__": sync failed\n"); + wake_up_interruptible(&bcsp_sync_wq); +} + +u32=20 +bcsp_issyncronized(void) +{ + return bcsp_sync; +} + + +void bcsp_syncronized(void) { cli(); bcsp_sync =3D TRUE; sti(); + +#ifdef __KERNEL__ + del_timer(&bcsp_sync_timer); +#endif + BCSP_SYS(__FUNCTION__ ": BCSP initialized and syncronized\n"); wake_up_interruptible(&bcsp_sync_wq); } @@ -158,12 +203,40 @@ hci_receive_acl(data, (s32)len); break; default: - D_ERR(__FUNCTION__ ": Unkown channel: %d\n", chn); + D_ERR(__FUNCTION__ ": Unknown channel: %d\n", chn); break; } return 0; } =20 +#if BCSP_PARSELOWER + +/* + * Used to parse headers of sent/incoming BCSP packets + * Also prints other potentially interesting stats=20 + */ + +void +bcsp_dbg(const u8 *str, u8 flags, u32 tot_len) +{ +#include <linux/bluetooth/hci_internal.h> + extern hci_controller hci_ctrl; + extern u8 winspace; + extern u8 txseq; + extern u8 txack; + extern u8 rxack; + extern u8 expected_rxseq; + + printk("%s | seq:%d | ack:%d | winsize:%d | acl:%d | bufc:%d [%d]\n", + str, (flags&BCSP_FLAG_SEQ),=20 + (flags&BCSP_FLAG_ACK) >> 3,=20 + winspace, hci_ctrl.hc_buf.acl_num, buf_byte_count(), tot_len); + + printk("status: txseq[%d] txack[%d] cur_rxack[%d] exp_rxseq[%d]\n\n",=20 + txseq, txack, rxack, expected_rxseq); +} +#endif + s32 bcsp_receive_lower(u8 *data, u32 len) { @@ -171,13 +244,18 @@ struct bcsp bcsp; =20 D(__FUNCTION__ ": Incoming data:\n"); - PRINTPKT(data, len); + + BCSPDUMP(data, len); =20 while (handled < len) { bcsp_init_packet(&bcsp); - handled +=3D bcsp_slip_receive(&bcsp, data + handled, len - handled); + handled +=3D bcsp_slip_receive(&bcsp, data + handled,=20 + len - handled); D(__FUNCTION__ ": So far handled: %d bytes\n", handled); if (bcsp.packet) { +#if BCSP_PARSELOWER + bcsp_dbg("=3D=3D> ", bcsp.packet[0], bcsp.packet_length); +#endif bcsp_integrity_receive(&bcsp); kfree(bcsp.packet); } @@ -218,8 +296,12 @@ bcsp_write_lower(u8 *data, u32 len) { D(__FUNCTION__ ": Outgoing data:\n"); - PRINTPKT(data, len); =20 + BCSPDUMP(data, len); + +#if BCSP_PARSELOWER + bcsp_dbg("<-- ", data[1], len); +#endif=20 return bt_write_lower_driver_real(data, len); } =20 |
From: Mattias A. <mat...@us...> - 2001-06-06 14:53:42
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.41 1.42=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added ps key define (0x191) * Added return buf for copying read ps vals to usermode * Added csr_pskey used to read/write any ps value * Always use temp baudrate setting (after fixing rtx problems due to=20 uart deep sleep timout) * hw_vendor now uses bt_use_bcsp() instead of defines The diff of the modified file(s): --- hci_vendor.c 2001/05/30 10:34:15 1.41 +++ hci_vendor.c 2001/06/06 14:53:41 1.42 @@ -442,6 +442,7 @@ #define CSR_PS_BDADDR 0x0001 #define CSR_PS_MAX_ACL_PKT_LEN 0x0011 #define CSR_PS_MAX_ACL_PKTS 0x0013 +#define CSR_PS_UART_CONFIG 0x0191 #define CSR_PS_BAUD_RATE 0x0204 =20 #define CSR_UART_RATE_9K6 0x0027 @@ -520,7 +521,12 @@ =20 static s32 csr_send_general_hq(csr_bccmd *cmd); =20 -#ifdef CONFIG_BLUETOOTH_USE_BCSP +#define PSRETBUF_SIZE 10 /* should be enough for what we want to do */ +static u16 ps_retbuf[PSRETBUF_SIZE]; + + +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP + void hci_receive_bcsp(u8 *data, u32 count) { @@ -529,7 +535,6 @@ =20=09 D_REC(__FUNCTION__ "\n"); =20 - /* FIXME -- is there only one cmd buffer available ? */ hci_ctrl.hc_buf.cmd_num =3D 1;=20=20 =20 release_cmd_timer(); @@ -558,6 +563,12 @@ break; =20=09=09=09=09 case CSR_CMD_PS: + printk("ps key[0x%x] ", ps->ps_key); + print_data("", (u8*)ps->ps_val, ps->ps_len*sizeof(u16)); +=09=09=09=09 + /* Now copy this data to return buf */ + memcpy(ps_retbuf, ps->ps_val,=20 + ps->ps_len*sizeof(u16)); break; =20=09=09=09=09 default: @@ -670,8 +681,62 @@ } #endif =20 +s32=20 +csr_pskey(u16 ps_key, u16 rw_mode, u16 *retb, u16 n_pars) +{ + s32 tmp; + csr_msg *msg; + csr_bccmd *cmd; + csr_bccmd_ps *ps; + + printk(__FUNCTION__" : ps 0x%x\n", ps_key);=09 + + /* HCI Manufacturer specific header */ + c_pkt.type =3D CMD_PKT; + c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); + c_pkt.len =3D 1 + 5*sizeof(u16) + 3*sizeof(u16) + n_pars*sizeof(u16); + + msg =3D (csr_msg *)c_pkt.data; + cmd =3D (csr_bccmd *)msg->msg; + ps =3D (csr_bccmd_ps *)cmd->payload; + + /* General msg header */ + msg->p_descr.last =3D 1; /* first and last segment */ + msg->p_descr.first =3D 1; + msg->p_descr.ch_id =3D CSR_CH_ID_BCCMD; + + /* BCCMD type */ + + cmd->type =3D rw_mode; + cmd->len =3D 5 + 3 + n_pars; + cmd->seq =3D csr_count++; + cmd->var_id =3D CSR_CMD_PS; + cmd->status =3D CSR_STATUS_OK; /* always OK in SETREQ */ + + /* Actual PS key request */ + ps->ps_key =3D ps_key; + ps->ps_len =3D n_pars; /* x 16 bits */ + ps->unused =3D 0x0000; + + if (rw_mode =3D=3D CSR_MSGTYPE_GETREQ) + memset(ps->ps_val, 0, n_pars*sizeof(u16)); /* zero params in GETREQ */ + else=20=20 + memcpy(ps->ps_val, retb, n_pars*sizeof(16)); /* copy params in SETREQ */ + + /* Clear return buf */ + memset(ps_retbuf, 0, PSRETBUF_SIZE*2); + + tmp =3D send_cmd_block((u8*) &c_pkt,=20 + c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN); +=09=20 + if (rw_mode =3D=3D CSR_MSGTYPE_GETREQ) + memcpy(retb, ps_retbuf, n_pars*sizeof(u16)); =20 + /* Signal status back in SETREQ ? */ =20 + return tmp; +} + s32=20 hci_set_bd_addr(u8 bd[6]) { @@ -813,8 +878,6 @@ return tmp; } =20 - -#define SET_BAUD_RATE_TEMPORARILY s32 hci_set_baudrate(u32 baudrate) { @@ -859,12 +922,9 @@ /* HCI Manufacturer specific header */ c_pkt.type =3D CMD_PKT; c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); -#ifdef SET_BAUD_RATE_TEMPORARILY c_pkt.len =3D 1 + 5*sizeof(u16) + 4*sizeof(u16); -#else - c_pkt.len =3D 1 + 5*sizeof(u16) + 3*sizeof(u16) + 1*sizeof(u16); -#endif =20 + msg =3D (csr_msg *)c_pkt.data; cmd =3D (csr_bccmd *)msg->msg; ps =3D (csr_bccmd_ps *)cmd->payload; @@ -874,7 +934,6 @@ msg->p_descr.first =3D 1; msg->p_descr.ch_id =3D CSR_CH_ID_BCCMD; =20 -#ifdef SET_BAUD_RATE_TEMPORARILY cmd->type =3D CSR_MSGTYPE_SETREQ; cmd->len =3D 5 + 4; cmd->seq =3D csr_count++; @@ -882,11 +941,16 @@ cmd->status =3D CSR_STATUS_OK; /* always OK in SETREQ */ =20 memset(cmd->payload, 0, 4*sizeof(u16)); -#ifdef CONFIG_BLUETOOTH_USE_BCSP - cmd->payload[0] =3D baud_divider | CSR_UART_EVEN_PARITY | CSR_UART_ONE_ST= OP_BIT; -#else - cmd->payload[0] =3D baud_divider | CSR_UART_NO_PARITY | CSR_UART_ONE_STOP= _BIT; -#endif + + if (bt_use_bcsp(-1)) + { + cmd->payload[0] =3D baud_divider | CSR_UART_EVEN_PARITY |=20 + CSR_UART_ONE_STOP_BIT; + } else { + cmd->payload[0] =3D baud_divider | CSR_UART_NO_PARITY |=20 + CSR_UART_ONE_STOP_BIT; + } + if (hci_ctrl.hc_buf.cmd_num < 1) { DSYS(__FUNCTION__ VENDOR ": sleeping\n"); interruptible_sleep_on(&set_baudrate_wq); @@ -895,23 +959,7 @@ tmp =3D bt_write_lower_driver((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI= _HDR_LEN); =20 hci_ctrl.hc_buf.cmd_num--; -#else - cmd->type =3D CSR_MSGTYPE_SETREQ; - cmd->len =3D 5 + 3 + 1; - cmd->seq =3D csr_count++; - cmd->var_id =3D CSR_CMD_PS; - cmd->status =3D CSR_STATUS_OK; /* always OK in SETREQ */ - - /* Actual PS key request */ - ps->ps_key =3D CSR_PS_BAUD_RATE; - ps->ps_len =3D 1; /* x 16 bits */ - ps->unused =3D 0x0000; - - ps->ps_val[0] =3D baud_divider; =20 - tmp =3D send_cmd_block((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LE= N); -#endif - return tmp; } =20 @@ -957,6 +1005,13 @@ break; =20 case CSR_CMD_PS: + printk("ps key[0x%x] ", ps->ps_key); + print_data("", (u8*)ps->ps_val, ps->ps_len*sizeof(u16)); +=09=09=09=09 + /* Now copy this data to return buf */ +=09=09=09=09 + memcpy(ps_retbuf, ps->ps_val,=20 + ps->ps_len*sizeof(u16)); break; =20 default: @@ -1083,11 +1138,10 @@ char* bt_hw_vendor(void) { -#ifdef CONFIG_BLUETOOTH_USE_BCSP + if (bt_use_bcsp(-1)) return "CSR (BCSP)"; -#else + else return "CSR (H4)"; -#endif } =20 #elif defined(CONFIG_BLUETOOTH_INFINEON_BMI) |
From: Mattias A. <mat...@us...> - 2001-06-06 14:53:12
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.153 1.154=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Always include bcsp code if CONFIG_BLUETOOTH_SUPPORT_BCSP is set * Don't initialize cmd num if using bcsp, is updated after syncronizing * Changed cmd timeout to 2 secs * Minor changes The diff of the modified file(s): --- hci.c 2001/06/05 09:48:16 1.153 +++ hci.c 2001/06/06 14:53:11 1.154 @@ -138,7 +138,7 @@ #endif =20 #define USE_NCPTIMER=20 -#define NCP_TIMEOUT (3*HZ) +#define NCP_TIMEOUT (2*HZ) =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ =20 @@ -585,7 +585,7 @@ } } =20 -#ifdef CONFIG_BLUETOOTH_USE_BCSP +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP void hci_receive_event(u8 *data, s32 count) { @@ -1836,15 +1836,26 @@ init_cmd_buf(); =20 hci_ctrl.nbr_of_connections =3D 0; + +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP + /* After syncing BCSP we receive a command status with cmd num */ + if (!bt_use_bcsp(-1)) hci_ctrl.hc_buf.cmd_num =3D 1; =20 + /* don't touch cmd num when using bcsp, is updated=20 + from command status event after syncronizing */ + +#else + hci_ctrl.hc_buf.cmd_num =3D 1; +#endif + #ifdef __KERNEL__ send_data_task.routine =3D (void*)send_acl_data_task; send_data_task.data =3D NULL; #endif =20 /* always... */ - DSYS(__FUNCTION__", Reading buffer sizes in the module...\n"); + DSYS(__FUNCTION__": Reading buffer sizes in HW module\n"); hci_read_buffer_size(HCI_BLOCK); hci_read_firmware_rev_info();=09 =20 |
From: Mattias A. <mat...@us...> - 2001-06-06 14:52:32
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.177 1.178=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Check for CONFIG_BLUETOOTH_SUPPORT_BCSP instead of ..._USE_BCSP * Extracted reset ioctl code to separate function (bt_reset_phys_hw()) * Added ioctl for setting bcspmode * Removed unused code (forwarding ioctl to serial driver) * Added check in bt_feedstack if we really found an active line * Only init bcsp if enabled and not already syncronizied=20 (from separate ioctl) * Minor changes and cleanup The diff of the modified file(s): --- bluetooth.c 2001/05/30 08:01:13 1.177 +++ bluetooth.c 2001/06/06 14:52:31 1.178 @@ -82,7 +82,7 @@ #include <linux/bluetooth/sdp.h> #include <linux/bluetooth/sec_client.h> #include <linux/bluetooth/bt_errno.h> -#ifdef CONFIG_BLUETOOTH_USE_BCSP +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP #include <linux/bluetooth/bcsp.h> #endif =20 @@ -612,10 +612,6 @@ return (SESSIONSTATE(line) =3D=3D BT_LOWERCONNECTED); } =20=09 - case BTSETSPEED: - BT_DRIVER(FNC"BTSETSPEED not implemented\n"); - break; -=20=20=20=20 case BTINITSTACK: bt_init_stack(); break; @@ -642,68 +638,7 @@ break; =20 case BTRESETPHYSICALHW: -#ifdef __CRIS__ - -#ifdef CONFIG_BLUETOOTH_CSR -#define CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH -#else -#undef CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH -#endif - -#if defined(CONFIG_BLUETOOTH_RESET_PA7) -#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) - BT_DRIVER(FNC"Resetting hardware (PA7) Active High\n"); - REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 1); - udelay(1000); - REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 0); -#else - BT_DRIVER(FNC"Resetting hardware (PA7) Active Low\n"); - REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 0); - udelay(1000); - REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 1); -#endif -#elif defined(CONFIG_BLUETOOTH_RESET_PB5) -#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) - BT_DRIVER(FNC"Resetting hardware (PB5) Active High\n"); - REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 1); - udelay(1000); - REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 0); -#else - BT_DRIVER(FNC"Resetting hardware (PB5) Active Low\n"); - REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 0); - udelay(1000); - REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 1); -#endif -#elif defined(CONFIG_BLUETOOTH_RESET_G10) -#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) - BT_DRIVER(FNC"Resetting hardware (G10) Active High\n"); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 1); - udelay(1000); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 0); -#else - BT_DRIVER(FNC"Resetting hardware (G10) Active Low\n "); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 0); - udelay(1000); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 1); -#endif -#elif defined(CONFIG_BLUETOOTH_RESET_G11) -#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) - BT_DRIVER(FNC"Resetting hardware (G11) Active High\n"); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 1); - udelay(1000); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 0); -#else - BT_DRIVER(FNC"Resetting hardware (G11) Active Low\n "); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 0); - udelay(1000); - REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 1); -#endif -#else - D_ERR(FNC"Resetting hardware : No reset pin defined\n"); -#endif -#else - BT_DRIVER(FNC"Do not know how to reset the bluetooth hardware!\n"); -#endif + bt_reset_phys_hw(); break; =20 case BTISINITIATED: @@ -1102,17 +1037,51 @@ return 0; } =20=09=09 - default:=09=09 -#if 0=09=20=20 - /* forward rest to serial driver ! */=09=09 - BT_DRIVER(FNC"forwarding ioctl 0x%x to serial driver\n", cmd); - if (sertty !=3D NULL) - return sertty->driver.ioctl(sertty, file, cmd, arg); + case BTSETBCSPMODE : + { + u8 enable; =20 - break; -#else - return -ENOIOCTLCMD; + GET_USER(tmp, (s32*)arg); + + enable =3D (u8)(tmp & 0xff); +=09=09 + BT_DRIVER("BTSETBCSPMODE : %d\n", enable); +=09=09 + bt_use_bcsp(enable); +=09=09 + return 0; + } + +#ifdef CONFIG_BLUETOOTH_CSR + + /* | ps_key (u16) | rw_mode (u16) | len (u16) | params (u16[])| */ + + case BT_CSR_PSKEY: + { + u16 u16_size =3D CSR_PSKEY_MSGHDR_SIZE + CSR_PSKEY_MAXPARAMS; + u16 msg[size]; +=09=09 + copy_from_user(msg, (u8*)arg, u16_size*sizeof(u16)); + + csr_pskey(msg[0], msg[1], &msg[3], msg[2]); +=09=09 + copy_to_user((s32*)arg, msg, u16_size*sizeof(u16)); + return 0; + } + + case BTINITBCSP: + { + printk("BTINITBCSP\n"); + if (bcsp_init() < 0) + printk("Sync failed\n"); + return 0; + } + #endif + + default:=09=09 + return -ENOIOCTLCMD; + } return 0; #undef FNC @@ -1316,7 +1285,75 @@ printk("bt_tty_wakeup : not done\n"); } =20 +void bt_reset_phys_hw(void) +{ +#define FNC __FUNCTION__": "=09 +#ifdef __CRIS__ +=09 +#ifdef CONFIG_BLUETOOTH_CSR +#define CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH +#else +#undef CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH +#endif =20 +#if defined(CONFIG_BLUETOOTH_RESET_PA7) +#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) + BT_DRIVER(FNC"Resetting hardware (PA7) Active High\n"); + REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 1); + udelay(1000); + REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 0); +#else + BT_DRIVER(FNC"Resetting hardware (PA7) Active Low\n"); + REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 0); + udelay(1000); + REG_SHADOW_SET(R_PORT_PA_DATA, port_pa_data_shadow, 7, 1); +#endif +#elif defined(CONFIG_BLUETOOTH_RESET_PB5) +#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) + BT_DRIVER(FNC"Resetting hardware (PB5) Active High\n"); + REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 1); + udelay(1000); + REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 0); +#else + BT_DRIVER(FNC"Resetting hardware (PB5) Active Low\n"); + REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 0); + udelay(1000); + REG_SHADOW_SET(R_PORT_PB_DATA, port_pb_data_shadow, 5, 1); +#endif +#elif defined(CONFIG_BLUETOOTH_RESET_G10) +#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) + BT_DRIVER(FNC"Resetting hardware (G10) Active High\n"); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 1); + udelay(1000); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 0); +#else + BT_DRIVER(FNC"Resetting hardware (G10) Active Low\n "); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 0); + udelay(1000); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 10, 1); +#endif +#elif defined(CONFIG_BLUETOOTH_RESET_G11) +#if defined(CONFIG_BLUETOOTH_RESET_ACTIVE_HIGH) + BT_DRIVER(FNC"Resetting hardware (G11) Active High\n"); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 1); + udelay(1000); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 0); +#else + BT_DRIVER(FNC"Resetting hardware (G11) Active Low\n "); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 0); + udelay(1000); + REG_SHADOW_SET(R_PORT_G_DATA, port_g_data_shadow, 11, 1); +#endif +#else + D_ERR(FNC"Resetting hardware : No reset pin defined\n"); +#endif +#else + BT_DRIVER(FNC"Do not know how to reset the bluetooth hardware!\n"); +#endif +#undef FNC +} + + /************************/ /* glue layer functions */ /************************/ @@ -1328,7 +1365,7 @@ =20 s32 bt_write_lower_driver(u8 *data, s32 len) -#ifdef CONFIG_BLUETOOTH_USE_BCSP +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP { if (bt_use_bcsp(-1)) return bcsp_write_top(data, len); @@ -1540,7 +1577,10 @@ check_line =3D 0; } =20 - /* found an active */ + /* check if we really found an active */ + if (nbr_checked > BT_NBR_DATAPORTS) + return; + //BT_DATA("bt_feedstack : wakeup line %d !\n", check_line); upper_tty =3D GET_UPPERTTY(check_line); bt_ctrl.tty_last_unthrottled =3D check_line; @@ -1664,7 +1704,7 @@ static void bt_receive_data(u8* data, u32 count) { -#ifdef CONFIG_BLUETOOTH_USE_BCSP +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP if (bt_use_bcsp(-1)) bcsp_receive_lower(data, count); else @@ -2308,6 +2348,7 @@ s32 bt_use_bcsp(s32 new_use_bcsp) { +/* default val */ #ifdef CONFIG_BLUETOOTH_USE_BCSP static s32 use_bcsp =3D 1; #else @@ -2317,14 +2358,12 @@ =20 if (new_use_bcsp >=3D 0) { -#ifdef CONFIG_BLUETOOTH_USE_BCSP +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP use_bcsp =3D new_use_bcsp; #endif } - return old; } - void bt_init_stack(void) { @@ -2356,7 +2395,10 @@ =20 DSYS("Current HW: %s\n", bt_hw_vendor()); =20 -#ifdef CONFIG_BLUETOOTH_USE_BCSP + btmem_init(); + +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP + if (bt_use_bcsp(-1) && !bcsp_issyncronized()) bcsp_init(); #endif hci_init(); @@ -2369,7 +2411,7 @@ sdp_init(1); /* For now always init as server */ tcs_init(); #endif - btmem_init(); + bt_stack_initiated =3D 1; bt_stat.bytes_received =3D 0; bt_stat.bytes_sent =3D 0; @@ -2755,12 +2797,15 @@ tcs_shutdown(); l2cap_shutdown(); hci_shutdown(); - btmem_shutdown(); - bt_stack_initiated =3D 0; =20 -#ifdef CONFIG_BLUETOOTH_USE_BCSP +#ifdef CONFIG_BLUETOOTH_SUPPORT_BCSP + if (bt_use_bcsp(-1)) bcsp_shutdown(); #endif + + btmem_shutdown(); + + bt_stack_initiated =3D 0; =20=09 if (tmp_bt_buf) { free_page((unsigned long) tmp_bt_buf); |
From: Peter K. <pk...@us...> - 2001-06-05 09:48:16
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.152 1.153=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed a line of unnecessary code. The diff of the modified file(s): --- hci.c 2001/06/05 09:19:34 1.152 +++ hci.c 2001/06/05 09:48:16 1.153 @@ -702,7 +702,7 @@ void update_ncp(u8 nbr_of_hdl, u8 *pkt) { - s32 i, tmp; + s32 i; =20 D_REC(__FUNCTION__", acl_num before : %d\n", hci_ctrl.hc_buf.acl_num); =20=09 @@ -712,7 +712,6 @@ that have been sent */ =20 for (i =3D 0; i < 4 * nbr_of_hdl; i +=3D 4) { - tmp =3D CHAR2INT16(pkt[i+3], pkt[i+2]); hci_ctrl.hc_buf.acl_num +=3D CHAR2INT16(pkt[i+3], pkt[i+2]); } =20=09 |
From: Peter K. <pk...@us...> - 2001-06-05 09:19:35
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.151 1.152=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made hci_trig_send() a no-op in user mode. The diff of the modified file(s): --- hci.c 2001/05/30 10:32:07 1.151 +++ hci.c 2001/06/05 09:19:34 1.152 @@ -681,7 +681,7 @@ s32 hci_trig_send(void) { -=09 +#ifdef __KERNEL__ if (buf_count()) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) queue_task(&send_data_task, &tq_scheduler); @@ -693,6 +693,10 @@ } else { return FALSE; } +#else + /* FIXME? */ + return FALSE; +#endif } =20 void |
From: Peter K. <pk...@us...> - 2001-05-31 12:38:54
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btinit.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use sigsetjmp()/siglongjmp() instead of setjmp()/longjmp() as we need to call siglongjmp() from a signal handler. The diff of the modified file(s): --- btinit.c 2001/05/17 10:36:36 1.8 +++ btinit.c 2001/05/31 12:38:54 1.9 @@ -109,7 +109,7 @@ static int init_hw_speed =3D 0; /* not set */ static int do_hwinit =3D 1; /* do vendor specific initialization */ static int do_reset =3D 0; /* reset hw using I/O pins */ -static jmp_buf jmpbuffer; /* used to jump back in program after doing rese= t */ +static sigjmp_buf jmpbuffer; /* used to jump back in program after doing r= eset */ static int sdpsrv_pid =3D 0; int phys_fd =3D -1; /* physical device e.g ttyS0 */ =20 @@ -188,7 +188,7 @@ } =20 /* Set restart point */ - if (setjmp(jmpbuffer) !=3D 0) + if (sigsetjmp(jmpbuffer, 1) !=3D 0) { syslog(LOG_INFO, "restart...\n\n\n\n"); } @@ -258,7 +258,7 @@ =20=20=20=20=20 btd_cleanup(); =20=20 - longjmp(jmpbuffer, 1); + siglongjmp(jmpbuffer, 1); } if (sig =3D=3D SIGTERM) { |
From: Peter K. <pk...@us...> - 2001-05-31 12:18:39
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btd.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use sigsetjmp()/siglongjmp() instead of setjmp()/longjmp() as we need to call siglongjmp() from a signal handler. The diff of the modified file(s): --- btd.c 2001/05/23 14:03:43 1.16 +++ btd.c 2001/05/31 12:18:38 1.17 @@ -179,7 +179,7 @@ static int sdpsrv_pid =3D 0; static int bt_cfd =3D -1; /* control tty for bt stack */ static int phys_fd =3D -1; /* physical device e.g ttyS0 */ -static jmp_buf jmpbuffer; /* used to jump back in program after doing rese= t */ +static sigjmp_buf jmpbuffer; /* used to jump back in program after doing r= eset */ =20 =20 /* long option list */ @@ -267,7 +267,7 @@ } =20=20=20 /* Set restart point */ - if (setjmp(jmpbuffer) !=3D 0) + if (sigsetjmp(jmpbuffer, 1) !=3D 0) { syslog(LOG_INFO, "restart...\n\n\n\n"); sleep(1); @@ -345,11 +345,14 @@ =20=20=20=20=20=20=20 case -1: {=20=20 + if (errno !=3D EINTR) + { /* Error */ perror("select"); =20 /* FIXME -- e.g if ipa server restarts !!! */ } + } break; =20=20=20=20=20=20=20 default: @@ -363,8 +366,6 @@ /* IPA response */ if (FD_ISSET(ipa_fd, &rfd)) { -=09=20=20=20=20 -=09=20=20=20=20 msg =3D (struct ipa_msg*) ipa_buf; /* Got response from IPA, if ok then start pppd or modem emul = */ ipa_read(ipa_fd, msg); @@ -692,16 +693,16 @@ { /* Shutdown all and restart */ btd_cleanup(); - longjmp(jmpbuffer, 1); + siglongjmp(jmpbuffer, 1); } else if (sig =3D=3D SIGUSR2) /* ? */ {=20=20=20=20 /* Close down phys dev, run hw_upgrade and restart btd */ - btd_cleanup(); +// btd_cleanup(); =20=20 /* FIXME -- execvp(hw_upgrade_prog) */ =20=20=20=20=20 - longjmp(jmpbuffer, 1); +// siglongjmp(jmpbuffer, 1); } else if (sig =3D=3D SIGTERM) /* ? */ {=20 |
From: Peter K. <pk...@us...> - 2001-05-30 18:43:37
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_datagram.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_integrity.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_mux.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_sequence.c 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_slip.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added definition of __NO_VERSION__ to get rid of symbol redefinitions. The diff of the modified file(s): --- bcsp.c 2001/05/25 14:07:56 1.10 +++ bcsp.c 2001/05/30 09:47:00 1.11 @@ -41,6 +41,8 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> #include <linux/string.h> #include <linux/types.h> --- bcsp_datagram.c 2001/05/25 14:09:17 1.5 +++ bcsp_datagram.c 2001/05/30 09:47:00 1.6 @@ -42,6 +42,8 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> #include <asm/byteorder.h> #include <asm/unaligned.h> --- bcsp_integrity.c 2001/05/18 16:03:51 1.5 +++ bcsp_integrity.c 2001/05/30 09:47:00 1.6 @@ -42,6 +42,8 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <asm/byteorder.h> #include <asm/unaligned.h> =20 --- bcsp_mux.c 2001/05/25 14:10:26 1.6 +++ bcsp_mux.c 2001/05/30 09:47:00 1.7 @@ -41,6 +41,8 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> =20 #include <linux/bluetooth/bcsp.h> --- bcsp_sequence.c 2001/05/25 14:12:50 1.9 +++ bcsp_sequence.c 2001/05/30 09:47:00 1.10 @@ -42,12 +42,15 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> #include <linux/types.h> -#include <linux/bluetooth/bcsp.h> #include <linux/interrupt.h> #include <linux/timer.h> + #include <linux/bluetooth/sysdep-2.1.h> +#include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ --- bcsp_slip.c 2001/05/18 16:03:51 1.4 +++ bcsp_slip.c 2001/05/30 09:47:00 1.5 @@ -41,7 +41,10 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> + #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> =20 |
From: Peter K. <pk...@us...> - 2001-05-30 15:27:27
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.40 1.41=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use temporary way of setting speed for CSR. The diff of the modified file(s): --- hci_vendor.c 2001/05/22 09:45:53 1.40 +++ hci_vendor.c 2001/05/30 10:34:15 1.41 @@ -814,7 +814,7 @@ } =20 =20 -//#define SET_BAUD_RATE_TEMPORARILY +#define SET_BAUD_RATE_TEMPORARILY s32 hci_set_baudrate(u32 baudrate) { |
From: Peter K. <pk...@us...> - 2001-05-30 12:39:21
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.150 1.151=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Enable DM1 and DH1 packets too for all but Ericsson. The diff of the modified file(s): --- hci.c 2001/05/28 12:05:43 1.150 +++ hci.c 2001/05/30 10:32:07 1.151 @@ -824,8 +824,13 @@ reset_hci_con_bd(hci_hdl); } else { DSYS(__FUNCTION__", ACL link is up\n"); +#ifdef CONFIG_BLUETOOTH_ERICSSON change_connection_packet_type(hci_hdl,=20 DM3|DH3|DM5|DH5); +#else + change_connection_packet_type(hci_hdl,=20 + DM1|DH1|DM3|DH3|DM5|DH5); +#endif set_hci_con(buf + 3, hci_hdl); remote_name_request(buf + 3); =20 |
From: Peter K. <pk...@us...> - 2001-05-30 08:02:30
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.176 1.177=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: kcomp.h did not appear until linux 2.2.18 The diff of the modified file(s): --- bluetooth.c 2001/05/22 09:45:53 1.176 +++ bluetooth.c 2001/05/30 08:01:13 1.177 @@ -51,7 +51,7 @@ #include <linux/delay.h> #include <linux/timer.h> =20 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) # ifdef MODULE # define module_init(x) int init_module(void) { return x(); } # define module_exit(x) void cleanup_module(void) { x(); } |
From: Mattias A. <mat...@us...> - 2001-05-29 13:14:11
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- rfcomm.c 1.111 1.112=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * always reset rfcomm con when receiving a disconnect ind. * added debug message & minor cleanup The diff of the modified file(s): --- rfcomm.c 2001/05/23 15:17:55 1.111 +++ rfcomm.c 2001/05/29 13:14:11 1.112 @@ -577,6 +577,8 @@ return; } =20 + D_CTRL(__FUNCTION__" line %d\n", line); + rfcomm_con_list[line].magic =3D RFCOMM_MAGIC; rfcomm_con_list[line].line =3D line; rfcomm_con_list[line].credit_flow =3D 0; @@ -1027,9 +1029,10 @@ bt_unregister_rfcomm(rfcomm->line); #endif bt_disconnect_ind(CREATE_RFCOMM_ID(rfcomm->line, 0)); - rfcomm_reset_con(rfcomm->line); } =20=09 + rfcomm_reset_con(rfcomm->line); + /* always try to send back rsp (if link is down con is deleted) */ if (l2ca_disconnect_rsp(l2cap)) { D_ERR(__FUNCTION__" l2ca_disconnect_rsp failed\n"); @@ -2309,6 +2312,8 @@ msc_msg *msc_pkt; u32 rfcomm_frame_size; =20=20=20 + D_CTRL(__FUNCTION__" val:%d, cr:%d, dlci:%d\n", value, cr, dlci); + rfcomm_frame_size =3D sizeof(msc_msg); tx_buf =3D subscribe_bt_buf(sizeof(rfcomm_tx_buf) + rfcomm_frame_size); =20 |
From: Peter K. <pk...@us...> - 2001-05-29 10:04:14
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_if.c 1.15 1.16=20=20=20=20=20=20=20=20=20=20=20=20 bt_if.h 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added a hack to convert from ISO 8859-1 to UTF-8 in bt_set_local_name(). The diff of the modified file(s): --- bt_if.c 2001/05/14 11:47:45 1.15 +++ bt_if.c 2001/05/29 10:04:12 1.16 @@ -858,17 +858,36 @@ =20 } =20 -void bt_set_local_name(int bt_cfd, const char *name) +void bt_set_local_name(int bt_cfd, const unsigned char *name) { - syslog(LOG_INFO, "bt_set_local_name %s", name); + unsigned char buffer[248]; + int i =3D 0; + + syslog(LOG_INFO, __FUNCTION__ ": %s", name); + + /* Hack to convert ISO 8859-1 to UTF-8 */ + for (; *name && i < sizeof buffer - 3; name++) + { + if (*name < 128) + { + buffer[i++] =3D *name; + } + else + { + buffer[i++] =3D 0xC0 | (*name >> 6); + buffer[i++] =3D 0x80 | (*name & 0x3F); + } + } + buffer[i] =3D '\0'; + #ifndef BT_USERSTACK=20=20 - if (ioctl(bt_cfd, HCISETLOCALNAME, name) < 0) + if (ioctl(bt_cfd, HCISETLOCALNAME, buffer) < 0) { perror(__FUNCTION__); exit(1); } #else - hci_change_local_name(name); + hci_change_local_name(buffer); #endif } =20 --- bt_if.h 2001/05/14 11:09:22 1.9 +++ bt_if.h 2001/05/29 10:04:12 1.10 @@ -326,7 +326,7 @@ void set_local_hostname(int bt_cfd, const char *local_name); =20 /* Sets friendly name to name */ -void bt_set_local_name(int bt_cfd, const char *name); +void bt_set_local_name(int bt_cfd, const unsigned char *name); /*=20 * Misc functions=20 */ |
From: Peter K. <pk...@us...> - 2001-05-28 12:05:44
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.c 1.149 1.150=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Reverted unintended changes to link mode policy and allowed packet types in last commit. The diff of the modified file(s): --- hci.c 2001/05/25 14:21:09 1.149 +++ hci.c 2001/05/28 12:05:43 1.150 @@ -824,13 +824,13 @@ reset_hci_con_bd(hci_hdl); } else { DSYS(__FUNCTION__", ACL link is up\n"); - change_connection_packet_type(hci_hdl,DM1|DH1|=20 - DM3|DH3); + change_connection_packet_type(hci_hdl,=20 + DM3|DH3|DM5|DH5); set_hci_con(buf + 3, hci_hdl); remote_name_request(buf + 3); =20 /* enable m/s switch */=20 - write_link_policy_settings(hci_hdl, 0x04); + write_link_policy_settings(hci_hdl, 0x01); =20 /* we demand role switch as server */ if (force_msswitch && !i_am_initiator) { |
From: Mats F. <ma...@us...> - 2001-05-25 14:24:26
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.h 1.57 1.58=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added function hci_trig_send() The diff of the modified file(s): --- hci.h 2001/05/17 15:35:42 1.57 +++ hci.h 2001/05/25 14:24:26 1.58 @@ -89,6 +89,8 @@ =20 /****************** EXPORTED FUNCTION DECLARATION SECTION ****************= ***/ =20 +s32 hci_trig_send(void); + void hci_init(void); void hci_shutdown(void); void hci_clear_buffer(u32 con_hdl); |