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: Mats F. <ma...@us...> - 2001-05-18 13:50:07
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.38 1.39=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Don't disable parity for BCSP * Corrected length of set baudrate command The diff of the modified file(s): --- hci_vendor.c 2001/05/18 07:13:37 1.38 +++ hci_vendor.c 2001/05/18 13:50:07 1.39 @@ -55,6 +55,7 @@ #include <linux/bluetooth/btmem.h> #include <linux/delay.h> #include <linux/interrupt.h> + #else /* user mode */ #include <stdlib.h> #include <string.h> @@ -863,7 +864,7 @@ 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) + 6*sizeof(u16); + 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 @@ -879,18 +880,22 @@ =20 #ifdef SET_BAUD_RATE_TEMPORARILY cmd->type =3D CSR_MSGTYPE_SETREQ; - cmd->len =3D 5 + 6; + cmd->len =3D 5 + 4; cmd->seq =3D csr_count++; cmd->var_id =3D CSR_CMD_CONFIG_UART; cmd->status =3D CSR_STATUS_OK; /* always OK in SETREQ */ =20 - memset(cmd->payload, 0, 6*sizeof(u16)); + 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 (hci_ctrl.hc_buf.cmd_num < 1) { DSYS(__FUNCTION__ VENDOR ": sleeping\n"); interruptible_sleep_on(&set_baudrate_wq); } + tmp =3D bt_write_lower_driver((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI= _HDR_LEN); =20=20=20 hci_ctrl.hc_buf.cmd_num--; |
From: Peter K. <pk...@us...> - 2001-05-18 13:48:48
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_sequence.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_slip.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Minor clean-up. The diff of the modified file(s): --- bcsp_sequence.c 2001/05/18 09:14:20 1.5 +++ bcsp_sequence.c 2001/05/18 13:48:46 1.6 @@ -126,14 +126,12 @@ } =20=09 if (expected_rxseq =3D=3D BCSP_GET_SEQ(bcsp)) { -=09=09 cli(); txack =3D (BCSP_GET_SEQ(bcsp) + 1) % 8; expected_rxseq =3D (expected_rxseq + 1) % 8; sti(); =20 bcsp_receive_top(bcsp->payload, bcsp->payload_length, bcsp->identifier); -=09=09 } =20 /* FIXME: Do we need a task_queue for sending the ack packets ? */ @@ -216,7 +214,6 @@ D(__FUNCTION__": winspace after:%d\n", winspace); } =20 -=09 rxack =3D new_ack; =20 if (winspace =3D=3D WINSIZE) { @@ -231,7 +228,6 @@ u8 resend_cnt =3D rxack; =20=09 while (resend_cnt !=3D txseq) { -=09 printk(__FUNCTION__": Resending with seq_nbr:%d, last ack was %d, cur se= q_nbr:%d\n", resend_cnt, rxack, txseq); =20=09=09 init_bcsp_packet(&bcsp); --- bcsp_slip.c 2001/05/17 15:25:15 1.2 +++ bcsp_slip.c 2001/05/18 13:48:46 1.3 @@ -1,9 +1,9 @@ /* * bcsp_slip -- Implementation of the SLIP layer in the BCSP protocol stack * - * Copyright (C) 2000, 2001 Axis Communications AB + * Copyright (C) 2001 Axis Communications AB * - * Author: Peter Kjellerstedt <Pet...@ax...> + * Author: Peter Kjellerstedt <pet...@ax...> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -55,7 +55,6 @@ #define PRINTPKT(data, len) #endif =20 - /****************** TYPE DEFINITION SECTION ******************************= ***/ =20 /****************** LOCAL FUNCTION DECLARATION SECTION *******************= ***/ @@ -69,7 +68,6 @@ static void slip_send_add_byte(struct bcsp* bcsp, u8 data) { - switch (data) { case 0xC0: bcsp->packet[bcsp->packet_length++] =3D 0xDB; |
From: Mats F. <ma...@us...> - 2001-05-18 09:14:51
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_sequence.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20 bluetooth.c 1.174 1.175=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added shutdown function for BCSP The diff of the modified file(s): --- bcsp.c 2001/05/17 15:37:03 1.4 +++ bcsp.c 2001/05/18 09:14:20 1.5 @@ -112,7 +112,7 @@ void bcsp_init(void) { - printk(__FUNCTION__ ": Initializing BCSP\n"); + BCSP_SYS(__FUNCTION__ ": Initializing BCSP\n"); sequence_init(); send_sync(); cli(); @@ -123,12 +123,19 @@ } =20 void +bcsp_shutdown(void) +{ + BCSP_SYS(__FUNCTION__": Shuting down BCSP\n"); + sequence_shutdown(); +} + +void bcsp_syncronized(void) { cli(); bcsp_sync =3D TRUE; sti(); - printk(__FUNCTION__ ": BCSP initialized and syncronized\n"); + BCSP_SYS(__FUNCTION__ ": BCSP initialized and syncronized\n"); wake_up_interruptible(&bcsp_sync_wq); } =20 --- bcsp_sequence.c 2001/05/18 07:05:03 1.4 +++ bcsp_sequence.c 2001/05/18 09:14:20 1.5 @@ -101,13 +101,20 @@ =20 /****************** FUNCTION DEFINITION SECTION **************************= ***/ =20 -void sequence_init(void) +void +sequence_init(void) { resend_data_task.routine =3D (void*)sequence_resend; resend_data_task.data =3D NULL; =20 send_ack_task.routine =3D (void*)send_ack; send_ack_task.data =3D NULL; +} + +void +sequence_shutdown(void) +{ + release_resend_timer(); } =20 s32 --- bluetooth.c 2001/05/15 14:44:50 1.174 +++ bluetooth.c 2001/05/18 09:14:20 1.175 @@ -2715,6 +2715,10 @@ btmem_shutdown(); bt_stack_initiated =3D 0; =20 +#ifdef CONFIG_BLUETOOTH_USE_BCSP + bcsp_shutdown(); +#endif +=09 if (tmp_bt_buf) { free_page((unsigned long) tmp_bt_buf); tmp_bt_buf =3D NULL; |
From: Mats F. <ma...@us...> - 2001-05-18 09:14:22
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.h 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added shutdown function for BCSP The diff of the modified file(s): --- bcsp.h 2001/05/17 15:59:46 1.3 +++ bcsp.h 2001/05/18 09:14:21 1.4 @@ -106,6 +106,7 @@ /************************* functions in bcsp.c ***************************= ***/ =20 void bcsp_init(void); +void bcsp_shutdown(void); void bcsp_syncronized(void); s32 bcsp_write_top(u8 *data, u32 len); s32 bcsp_write_lower(u8 *data, u32 len); @@ -133,6 +134,7 @@ /************************* functions in sequence.c ***********************= ***/ =20 void sequence_init(void); +void sequence_shutdown(void); s32 sequence_receive(struct bcsp *bcsp); s32 sequence_send(u8 *data, u32 len, u8 chn); void signal_rxack(u8 ack); |
From: Mats F. <ma...@us...> - 2001-05-18 07:13:37
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.37 1.38=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use bt_write_lower_driver instead of bcsp_write_top The diff of the modified file(s): --- hci_vendor.c 2001/05/18 07:02:38 1.37 +++ hci_vendor.c 2001/05/18 07:13:37 1.38 @@ -669,7 +669,7 @@ =20 print_data(__FUNCTION__, (u8*)&c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_L= EN); =20=09 - return bcsp_write_top((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN= ); + return bt_write_lower_driver((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_= HDR_LEN); } #endif =20 |
From: Mats F. <ma...@us...> - 2001-05-18 07:05:04
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_sequence.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Rewrote the resend procedures The diff of the modified file(s): --- bcsp_sequence.c 2001/05/17 15:55:00 1.3 +++ bcsp_sequence.c 2001/05/18 07:05:03 1.4 @@ -47,6 +47,7 @@ #include <linux/bluetooth/bcsp.h> #include <linux/interrupt.h> #include <linux/bluetooth/sysdep-2.1.h> +#include <linux/bluetooth/bcsp_debug.h> =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 @@ -56,6 +57,9 @@ #define D(fmt...) #endif =20 +#define WINSIZE 7 +#define SEQUENCE_TIMEOUT HZ + /****************** TYPE DEFINITION SECTION ******************************= ***/ =20 typedef struct resend_buf { @@ -68,20 +72,31 @@ /****************** LOCAL FUNCTION DECLARATION SECTION *******************= ***/ =20 static void sequence_resend(void); +static void send_ack(void); =20 +static void start_resend_timer(void); +static void release_resend_timer(void); + /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 static struct tq_struct resend_data_task; +static struct tq_struct send_ack_task; =20 -static u8 seq_nbr =3D 0; -static u8 ack_nbr =3D 0; +static u8 txseq =3D 0; +static u8 txack =3D 0; +static u8 rxack =3D 0; +static u8 expected_rxseq =3D 0; =20 -static u8 remote_ack_nbr =3D 0; +static u8 winspace =3D WINSIZE; =20 static u32 got_packet =3D FALSE; =20 +static struct timer_list resend_timer; + +static u8 resend_timer_active =3D FALSE; + static struct resend_buf resend_buffer[8]; =20 /****************** FUNCTION DEFINITION SECTION **************************= ***/ @@ -90,6 +105,9 @@ { resend_data_task.routine =3D (void*)sequence_resend; resend_data_task.data =3D NULL; + + send_ack_task.routine =3D (void*)send_ack; + send_ack_task.data =3D NULL; } =20 s32 @@ -100,12 +118,28 @@ bcsp_syncronized(); } =20=09 - ack_nbr =3D BCSP_GET_SEQ(bcsp) + 1; - /* Do we realy need to do this ? */ - //remote_ack_nbr =3D BCSP_GET_ACK(bcsp); - send_txack(ack_nbr); + if (expected_rxseq =3D=3D BCSP_GET_SEQ(bcsp)) { =20 + cli(); + txack =3D (BCSP_GET_SEQ(bcsp) + 1) % 8; + expected_rxseq =3D (expected_rxseq + 1) % 8; + sti(); + bcsp_receive_top(bcsp->payload, bcsp->payload_length, bcsp->identifier); +=09=09 + } + +/* FIXME: Do we need a task_queue for sending the ack packets ? */ +#if 0 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) + queue_task(&send_ack_task, &tq_immediate); +#else + queue_task(&send_ack_task, &tq_immediate); + mark_bh(IMMEDIATE_BH); +#endif +#endif=09=09 + send_ack(); +=09 return 0; } =20 @@ -115,73 +149,128 @@ { struct bcsp bcsp; =20=09 + if (winspace > 0) { init_bcsp_packet(&bcsp); =20=09 bcsp.identifier =3D chn; =20 BCSP_SET_PROTOCOL_TYPE(&bcsp, BCSP_RELIABLE); =20=09 - BCSP_SET_SEQ(&bcsp, seq_nbr); + BCSP_SET_SEQ(&bcsp, txseq); =20 - BCSP_SET_ACK(&bcsp, ack_nbr); + BCSP_SET_ACK(&bcsp, txack); =20=09 bcsp.payload =3D data; bcsp.payload_length =3D len; =20 - memcpy(resend_buffer[seq_nbr].data, data, len); - resend_buffer[seq_nbr].len =3D len; - resend_buffer[seq_nbr].chn =3D chn; + memcpy(resend_buffer[txseq].data, data, len); + resend_buffer[txseq].len =3D len; + resend_buffer[txseq].chn =3D chn; =20 - seq_nbr =3D (seq_nbr + 1) % 8; + txseq =3D (txseq + 1) % 8; + winspace--; + + D(__FUNCTION__": winspace:%d, txreq:%d\n", winspace, txseq); +=09=09 + if (resend_timer_active) { + release_resend_timer(); + } + start_resend_timer(); + } else { + printk(__FUNCTION__": winspace =3D 0\n"); + return 0; + } =20=09=09 return mux_send(&bcsp); } =20 void -signal_rxack(u8 ack) +signal_rxack(u8 new_ack) { - static u8 last_ack =3D 0; =20 - remote_ack_nbr =3D ack; + D(__FUNCTION__": Got rxack:%d\n", new_ack); =20=09 - if (last_ack =3D=3D ack) { - printk(__FUNCTION__ ": Got incorrect ack:%d, seq_nbr:%d\n", ack, seq_nbr= ); + if ((rxack =3D=3D new_ack) && !(rxack =3D=3D txseq)) { + printk(__FUNCTION__": Got incorrect new_ack:%d, seq_nbr:%d\n", new_ack,= txseq); +=09=09 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) queue_task(&resend_data_task, &tq_scheduler); #else queue_task(&resend_data_task, &tq_immediate); mark_bh(IMMEDIATE_BH); #endif + } else if (rxack < new_ack) { + D(__FUNCTION__": winspace before:%d\n", winspace); + winspace +=3D new_ack - rxack; + D(__FUNCTION__": winspace after:%d\n", winspace); } else { - D(__FUNCTION__ ": Got rx ack:%d\n", ack); + D(__FUNCTION__": winspace before:%d\n", winspace); + winspace +=3D (WINSIZE - rxack) + new_ack + 1; + D(__FUNCTION__": winspace after:%d\n", winspace); } - last_ack =3D ack; + +=09 + rxack =3D new_ack; + + if (winspace =3D=3D WINSIZE) { + release_resend_timer(); } +} =20 -void sequence_resend(void) +void +sequence_resend(void) { struct bcsp bcsp; + u8 resend_cnt =3D rxack; =20 - while (remote_ack_nbr !=3D seq_nbr) { + while (resend_cnt !=3D txseq) { =20=09 - printk(__FUNCTION__ ": Resending seq_nbr:%d, last sent was %d\n", remote= _ack_nbr, seq_nbr); + printk(__FUNCTION__": Resending with seq_nbr:%d, last ack was %d, cur se= q_nbr:%d\n", resend_cnt, rxack, txseq); =20=09=09 init_bcsp_packet(&bcsp); =20=09=09 - bcsp.identifier =3D resend_buffer[remote_ack_nbr].chn; + bcsp.identifier =3D resend_buffer[resend_cnt].chn; =20=09=09 BCSP_SET_PROTOCOL_TYPE(&bcsp, BCSP_RELIABLE); =20=09=09 - BCSP_SET_SEQ(&bcsp, remote_ack_nbr); + BCSP_SET_SEQ(&bcsp, resend_cnt); =20=09=09 - BCSP_SET_ACK(&bcsp, ack_nbr); + BCSP_SET_ACK(&bcsp, txack); =20=09=09 - bcsp.payload =3D resend_buffer[remote_ack_nbr].data; - bcsp.payload_length =3D resend_buffer[remote_ack_nbr].len; + bcsp.payload =3D resend_buffer[resend_cnt].data; + bcsp.payload_length =3D resend_buffer[resend_cnt].len; =20=09=09 mux_send(&bcsp); - remote_ack_nbr =3D (remote_ack_nbr + 1) % 8; + resend_cnt =3D (resend_cnt + 1) % 8; + } + + start_resend_timer(); +} + +void +send_ack(void) +{ + send_txack(txack); +} + +void +start_resend_timer(void) +{ + init_timer(&resend_timer); + resend_timer.function =3D (void*)sequence_resend; + resend_timer.data =3D 0; + resend_timer.expires =3D jiffies + SEQUENCE_TIMEOUT; + + resend_timer_active =3D TRUE; +=09 + add_timer(&resend_timer); } + +void +release_resend_timer(void) +{ + resend_timer_active =3D FALSE; + del_timer(&resend_timer); } =20 /****************** END OF FILE sequence.c *******************************= ***/ |
From: Mats F. <ma...@us...> - 2001-05-18 07:02:40
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.36 1.37=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Send back a GETRESP if we receive a HQ SETREQ The diff of the modified file(s): --- hci_vendor.c 2001/05/17 15:04:38 1.36 +++ hci_vendor.c 2001/05/18 07:02:38 1.37 @@ -521,6 +521,8 @@ =20 static u16 csr_count =3D 0; =20 +static s32 csr_send_general_hq(csr_bccmd *cmd); + #ifdef CONFIG_BLUETOOTH_USE_BCSP void hci_receive_bcsp(u8 *data, u32 count) @@ -565,10 +567,11 @@ break; } } else { - DSYS(__FUNCTION__", Not a GETRESP msg\n"); + DSYS(__FUNCTION__": Not a GETRESP msg\n"); + print_data(__FUNCTION__, data, count); } } else { - D_ERR(__FUNCTION__", BCSP status error 0x%x\n", cmd->status); + D_ERR(__FUNCTION__": BCSP status error 0x%x\n", cmd->status); print_data(__FUNCTION__, data, count); } =20 @@ -622,17 +625,55 @@ D_ERR("Unknown varid [0x%x]!\n", cmd->var_id); break; } + } else if (cmd->type =3D=3D CSR_MSGTYPE_SETREQ) { + DSYS(__FUNCTION__": Received a SETREQ, sending back GETRESP\n"); + print_data(__FUNCTION__, data, count); + cmd->type =3D CSR_MSGTYPE_GETRESP; + cmd->seq =3D csr_count++; +=09 + csr_send_general_hq(cmd); +=09=09=09 + } else if (cmd->type =3D=3D CSR_MSGTYPE_GETREQ) { + DSYS(__FUNCTION__": Received a GETREQ\n"); + print_data(__FUNCTION__, data, count); } else { - DSYS(__FUNCTION__", Not a GETRESP msg\n"); + DSYS(__FUNCTION__": Unknown message type\n"); + print_data(__FUNCTION__, data, count); } } else { - D_ERR(__FUNCTION__", HQ status error 0x%x\n", cmd->status); + D_ERR(__FUNCTION__": HQ status error 0x%x\n", cmd->status); print_data(__FUNCTION__, data, count); } =20=09 wake_up_interruptible(&hci_wq);=09 } + +s32 +csr_send_general_hq(csr_bccmd *cmd) +{ + csr_msg *msg; + + /* HCI Manufacturer specific header */ + c_pkt.type =3D CMD_PKT; + c_pkt.opcode =3D hci_put_opcode(0x00, 0x3f); + c_pkt.len =3D 1 + cmd->len * 2; +=09 + msg =3D (csr_msg *)c_pkt.data; +=09 + /* 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_HQ; + + memcpy(msg->msg, cmd, cmd->len * 2); + + print_data(__FUNCTION__, (u8*)&c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_L= EN); +=09 + return bcsp_write_top((u8*) &c_pkt, c_pkt.len + CMD_HDR_LEN + HCI_HDR_LEN= ); +} #endif + + =20 s32=20 hci_set_bd_addr(u8 bd[6]) |
From: Peter K. <pk...@us...> - 2001-05-17 17:47:53
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_integrity.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Use cpu_to_be16() to convert to big endian. The diff of the modified file(s): --- bcsp_integrity.c 2001/05/17 15:25:15 1.2 +++ bcsp_integrity.c 2001/05/17 17:47:53 1.3 @@ -42,7 +42,8 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 -#include <stdio.h> +#include <asm/byteorder.h> +#include <linux/bluetooth/sysdep-2.1.h> =20 #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> @@ -77,7 +78,7 @@ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 -const u16 crc_table[] =3D { +static const u16 crc_table[] =3D { 0x0000, 0x1081, 0x2102, 0x3183, 0x4204, 0x5285, 0x6306, 0x7387, 0x8408, 0x9489, 0xa50a, 0xb58b, @@ -210,12 +211,14 @@ =20 /*********************** Code for the CRC calculation ********************= ***/ =20 -void init_crc(u16 *crc) +void +init_crc(u16 *crc) { *crc =3D 0xffff ;=20 } =20 -void update_crc(u16 *crc, u16 databyte) +void +update_crc(u16 *crc, u16 databyte) { u16 reg =3D *crc; reg =3D (reg >>4) ^ crc_table[(reg ^databyte) &0xf] ; @@ -223,7 +226,8 @@ *crc =3D reg; } =20 -u16 rev16(u16 src) +u16 +rev16(u16 src) { u16 dest =3D 0; s32 b; @@ -237,17 +241,10 @@ return dest ; } =20 - -u16 get_big_endian_crc(u16 crc) +u16 +get_big_endian_crc(u16 crc) { - u16 bigend ; - u8* bp ; - u16 ret =3D rev16(crc) ; -=09 - bp =3D (u8*) &bigend ; - bp[0] =3D (ret >>8) & 0xff ; - bp[1] =3D ret & 0xff ; - return bigend ; + return cpu_to_be16(rev16(crc)); } =20 /****************** END OF FILE integrity.c ******************************= ***/ |
From: Peter K. <pk...@us...> - 2001-05-17 15:59:47
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.h 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added send_txack() and signal_rxack(). The diff of the modified file(s): --- bcsp.h 2001/05/17 15:44:27 1.2 +++ bcsp.h 2001/05/17 15:59:46 1.3 @@ -128,12 +128,14 @@ s32 mux_send(struct bcsp *bcsp); s32 mux_receive(struct bcsp *bcsp); s32 mux_send(struct bcsp *bcsp); +s32 send_txack(u8 txack); =20 /************************* functions in sequence.c ***********************= ***/ =20 void sequence_init(void); s32 sequence_receive(struct bcsp *bcsp); s32 sequence_send(u8 *data, u32 len, u8 chn); +void signal_rxack(u8 ack); =20 /************************* functions in datagram.c ***********************= ****/ =20 |
From: Peter K. <pk...@us...> - 2001-05-17 15:55:00
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp_mux.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_sequence.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed unused variables. The diff of the modified file(s): --- bcsp_mux.c 2001/05/17 15:25:15 1.2 +++ bcsp_mux.c 2001/05/17 15:55:00 1.3 @@ -67,8 +67,7 @@ s32 mux_receive(struct bcsp *bcsp) { - - /* If we received an ack packet, we discards the packet, sice the ack + /* If we received an ack packet, we discard the packet, sice the ack has already been handled by signal_rxack */ if (bcsp->identifier =3D=3D 0) { D(__FUNCTION__ ": Received ack, returning\n"); @@ -99,7 +98,6 @@ s32 send_txack(u8 txack) { struct bcsp bcsp; - s32 tmp; =20 D(__FUNCTION__ ": txack: 0x%x\n", txack); =20 --- bcsp_sequence.c 2001/05/17 15:25:15 1.2 +++ bcsp_sequence.c 2001/05/17 15:55:00 1.3 @@ -141,7 +141,6 @@ signal_rxack(u8 ack) { static u8 last_ack =3D 0; - u8 stop =3D FALSE; =20 remote_ack_nbr =3D ack; =20=09 |
From: Peter K. <pk...@us...> - 2001-05-17 15:44:27
|
The following file was modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.h 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Removed unused code. The diff of the modified file(s): --- bcsp.h 2001/05/15 14:37:52 1.1 +++ bcsp.h 2001/05/17 15:44:27 1.2 @@ -1,6 +1,5 @@ /* - * bcsp.h -- Define of macros and functions used in the BCSP - * protocol stack + * bcsp.h -- Define of macros and functions used in the BCSP protocol stack * * Copyright (C) 2001 Axis Communications AB * @@ -87,14 +86,6 @@ #define BCSP_GET_IDENTIFIER(bcsp) ((bcsp)->packet[1] & 0x0f)=20 #define BCSP_GET_PAYLOAD_LENGTH(bcsp) (((bcsp)->packet[2] << 4) | (((bcsp)= ->packet[1] >> 4) & 0xff)) #define BCSP_GET_CHECKSUM(bcsp) ((bcsp)->packet[3]) - - -#if 0 -#define CHAR2INT16(c1,c0) ((((c1) & 0xff) << 8) + ((c0) & 0xff)) -#define CHAR2INT32(c3,c2,c1,c0) ((((c3) & 0xff) << 24) + \ - (((c2) & 0xff) << 16) + \ - (((c1) & 0xff) << 8) + ((c0) &0xff)) -#endif =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ =20 |
From: Peter K. <pk...@us...> - 2001-05-17 15:37:03
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Made bcsp_write_top() return a value. * Optimized init_bcsp_packet(). The diff of the modified file(s): --- bcsp.c 2001/05/17 15:25:15 1.3 +++ bcsp.c 2001/05/17 15:37:03 1.4 @@ -51,6 +51,8 @@ #include <linux/malloc.h> #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> +#include <linux/bluetooth/bluetooth.h> +#include <linux/bluetooth/hci.h> =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 @@ -163,7 +165,7 @@ PRINTPKT(data, len); =20 while (handled < len) { - memset(&bcsp, 0, sizeof(bcsp)); + init_bcsp_packet(&bcsp); handled +=3D slip_receive(&bcsp, data + handled, len - handled); D(__FUNCTION__ ": So far handled: %d bytes\n", handled); if (bcsp.packet) { @@ -178,26 +180,29 @@ bcsp_write_top(u8 *data, u32 len) { u16 opcode; + s32 ret =3D -EINVAL; =20=09 switch (data[0]) { case CMD_PKT: opcode =3D CHAR2INT16(data[2], data[1]); if (hci_get_ocf(opcode) =3D=3D BCSP_OCF) { - sequence_send(data + 5, len - 5, data[4] & 0x3f); + ret =3D sequence_send(data + 5, len - 5, data[4] & 0x3f); } else { - sequence_send(data + 1, len - 1, BCSP_CMD_CHN); + ret =3D sequence_send(data + 1, len - 1, BCSP_CMD_CHN); } break; case ACL_PKT: - sequence_send(data + 1, len - 1, BCSP_ACL_CHN); + ret =3D sequence_send(data + 1, len - 1, BCSP_ACL_CHN); break; case SCO_PKT: - sequence_send(data + 1, len - 1, BCSP_SCO_CHN); + ret =3D sequence_send(data + 1, len - 1, BCSP_SCO_CHN); break; default: D_ERR(__FUNCTION__ ": Unknown packet type: 0x%x\n", data[0]); break; } + + return ret; } =20 s32 @@ -209,14 +214,7 @@ void init_bcsp_packet(struct bcsp *bcsp) { - bcsp->flags =3D 0; - bcsp->identifier =3D 0; - bcsp->payload_length =3D 0; - bcsp->checksum =3D 0; - bcsp->payload =3D NULL; - bcsp->crc =3D 0; - bcsp->packet =3D NULL; - bcsp->packet_length =3D 0; + memset(bcsp, 0, sizeof *bcsp); }; =20 /****************** END OF FILE bcsp.c ***********************************= ***/ |
From: Peter K. <pk...@us...> - 2001-05-17 15:35:43
|
The following files were modified in linux/include/linux/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci.h 1.56 1.57=20=20=20=20=20=20=20=20=20=20=20=20 hci_internal.h 1.15 1.16=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Moved declaration of hci_receive_hq() and hci_receive_bcsp() to hci.h from hci_internal.h The diff of the modified file(s): --- hci.h 2001/05/15 15:08:00 1.56 +++ hci.h 2001/05/17 15:35:42 1.57 @@ -98,6 +98,8 @@ #ifdef CONFIG_BLUETOOTH_USE_BCSP void hci_receive_event(u8 *data, s32 count); void hci_receive_acl(u8 *data, s32 count); +void hci_receive_hq(u8 *data, u32 count); +void hci_receive_bcsp(u8 *data, u32 count); #endif =20 s32 lp_connect_req(u8 bd_addr[]); --- hci_internal.h 2001/05/15 15:21:16 1.15 +++ hci_internal.h 2001/05/17 15:35:42 1.16 @@ -352,11 +352,6 @@ s32 send_cmd(u8 *cmd, u8 len); s32 send_cmd_block(u8 *cmd, u8 len); =20 -#ifdef CONFIG_BLUETOOTH_USE_BCSP -void hci_receive_hq(u8 *data, u32 count); -void hci_receive_bcsp(u8 *data, u32 count); -#endif - /* Called from hci.c. Implemented in hci_vendor.c @@ -365,4 +360,5 @@ void process_vendor_event(u8 *buf, u32 len, u32 event_code); s32 hci_set_buffer_sizes(u16 len, u16 num); #endif + /****************** END OF FILE hci_internal.h ***************************= ***/ |
From: Peter K. <pk...@us...> - 2001-05-17 15:25:17
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_datagram.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_integrity.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_mux.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_sequence.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_slip.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Cleaned up debug messages. The diff of the modified file(s): --- bcsp.c 2001/05/15 15:28:46 1.2 +++ bcsp.c 2001/05/17 15:25:15 1.3 @@ -56,10 +56,10 @@ =20 #if BCSP_DEBUG #define D(fmt...) printk("BCSP: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) +#define PRINTPKT(data, len) print_data(NULL, data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) +#define PRINTPKT(data, len) #endif =20 #define BCSP_BCCMD_CHN 2 @@ -110,7 +110,7 @@ void bcsp_init(void) { - printk(__FUNCTION__", Initializing BCSP\n"); + printk(__FUNCTION__ ": Initializing BCSP\n"); sequence_init(); send_sync(); cli(); @@ -126,7 +126,7 @@ cli(); bcsp_sync =3D TRUE; sti(); - printk(__FUNCTION__", BCSP initialized and syncronized\n"); + printk(__FUNCTION__ ": BCSP initialized and syncronized\n"); wake_up_interruptible(&bcsp_sync_wq); } =20 @@ -147,7 +147,7 @@ hci_receive_acl(data, (s32)len); break; default: - D_ERR(__FUNCTION__", Unkown channel: %d\n", chn); + D_ERR(__FUNCTION__ ": Unkown channel: %d\n", chn); break; } return 0; @@ -159,13 +159,13 @@ s32 handled =3D 0; struct bcsp bcsp; =20 - D(__FUNCTION__", Incomming data:\n"); - PRINT_PKT(data, len); + D(__FUNCTION__ ": Incomming data:\n"); + PRINTPKT(data, len); =20 while (handled < len) { memset(&bcsp, 0, sizeof(bcsp)); handled +=3D slip_receive(&bcsp, data + handled, len - handled); - D(__FUNCTION__", so far handled:%d bytes\n", handled); + D(__FUNCTION__ ": So far handled: %d bytes\n", handled); if (bcsp.packet) { integrity_receive(&bcsp); kfree(bcsp.packet); @@ -195,16 +195,16 @@ sequence_send(data + 1, len - 1, BCSP_SCO_CHN); break; default: - D_ERR(__FUNCTION__", Unknown packet type: 0x%x\n", data[0]); + D_ERR(__FUNCTION__ ": Unknown packet type: 0x%x\n", data[0]); break; } } + s32 bcsp_write_lower(u8 *data, u32 len) { return bt_write_lower_driver(data, len); } - =20 void init_bcsp_packet(struct bcsp *bcsp) --- bcsp_datagram.c 2001/05/15 14:36:51 1.1 +++ bcsp_datagram.c 2001/05/17 15:25:15 1.2 @@ -57,10 +57,10 @@ =20 #if DATAGRAM_DEBUG #define D(fmt...) printk("DATAGRAM: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) +#define PRINTPKT(data, len) print_data(NULL, data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) +#define PRINTPKT(data, len) #endif =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ @@ -80,24 +80,21 @@ s32 datagram_receive(struct bcsp *bcsp) { -=09 if (handle_sync_pkt(bcsp)) { - D(__FUNCTION__", Sync packet received, sending respose\n"); + D(__FUNCTION__ ": Sync packet received, sending respose\n"); return 0; } =20 - D(__FUNCTION__", Datagram packet received\n"); - PRINT_PKT(bcsp->payload, bcsp->payload_length); + D(__FUNCTION__ ": Datagram packet received\n"); + PRINTPKT(bcsp->payload, bcsp->payload_length); =20=09 return 0; } =20 - s32 datagram_send(u8 *data, u32 len, u8 chn) { struct bcsp bcsp; - s32 tmp; =20=09 init_bcsp_packet(&bcsp); =20 @@ -109,7 +106,6 @@ return mux_send(&bcsp); } =20 - s32 handle_sync_pkt(struct bcsp *bcsp) { @@ -120,11 +116,11 @@ bcsp->payload[1],bcsp->payload[0]); =20 if (sync_string =3D=3D SYNC) { - D(__FUNCTION__", Found SYNC\n"); + D(__FUNCTION__ ": Found SYNC\n"); send_sync_rsp();=09=09 return TRUE; } else if (sync_string =3D=3D CONF) { - D(__FUNCTION__", Found CONF\n"); + D(__FUNCTION__ ": Found CONF\n"); send_conf_rsp(); return TRUE; } else { @@ -140,7 +136,7 @@ u32 sync =3D SYNC; s32 tmp; =20=09 - D(__FUNCTION__",%d \n", sizeof(struct bcsp)); + D(__FUNCTION__ "\n"); =20 init_bcsp_packet(&bcsp); =20=09 @@ -152,7 +148,7 @@ } memcpy(bcsp.payload, &sync, bcsp.payload_length); =20 - PRINT_PKT(bcsp.payload, bcsp.payload_length); + PRINTPKT(bcsp.payload, bcsp.payload_length); =20 tmp =3D mux_send(&bcsp); kfree(bcsp.payload); @@ -166,7 +162,7 @@ s32 tmp; u32 sync_rsp =3D SYNC_RSP; =20 - D(__FUNCTION__",%d \n", sizeof(struct bcsp)); + D(__FUNCTION__ "\n"); =20 init_bcsp_packet(&bcsp); =20 @@ -178,14 +174,13 @@ } memcpy(bcsp.payload, &sync_rsp, bcsp.payload_length); =20 - PRINT_PKT(bcsp.payload, bcsp.payload_length); + PRINTPKT(bcsp.payload, bcsp.payload_length); =20 tmp =3D mux_send(&bcsp); kfree(bcsp.payload); return tmp; } =20 - s32 send_conf_rsp(void) { @@ -193,7 +188,7 @@ s32 tmp; u32 conf_rsp =3D CONF_RSP; =20=09 - D(__FUNCTION__",\n"); + D(__FUNCTION__ "\n"); =20 init_bcsp_packet(&bcsp); =20=09 @@ -209,6 +204,5 @@ kfree(bcsp.payload); return tmp; } - =20 /****************** END OF FILE sequence.c *******************************= ***/ --- bcsp_integrity.c 2001/05/15 14:36:51 1.1 +++ bcsp_integrity.c 2001/05/17 15:25:15 1.2 @@ -52,10 +52,10 @@ =20 #if INTERGRITY_DEBUG #define D(fmt...) printk("INTEGRITY: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) +#define PRINTPKT(data, len) print_data(NULL, data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) +#define PRINTPKT(data, len) #endif =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ @@ -95,12 +95,12 @@ bcsp->checksum =3D BCSP_GET_CHECKSUM(bcsp); =20 if (!verify_checksum(bcsp->packet, bcsp->checksum)) { - BCSP_SYS(__FUNCTION__", Incorrect checksum, discarding data\n"); + BCSP_SYS(__FUNCTION__ ": Incorrect checksum, discarding data\n"); return -ERR_CHECKSUM; } =20 if (!verify_length(bcsp)) { - BCSP_SYS(__FUNCTION__", Incorrect length, discarding data\n"); + BCSP_SYS(__FUNCTION__ ": Incorrect length, discarding data\n"); return -ERR_PAYLOAD_LENGTH; } =20=09 @@ -109,13 +109,13 @@ bcsp->packet[bcsp->packet_length - 2]); =20=09=09 if (!verify_crc(bcsp)) { - BCSP_SYS(__FUNCTION__", Incorrect CRC, discarding data\n"); + BCSP_SYS(__FUNCTION__ ": Incorrect CRC, discarding data\n"); } } =20 D("Found the payload\n"); bcsp->payload =3D bcsp->packet + 4; - PRINT_PKT(bcsp->payload, bcsp->payload_length); + PRINTPKT(bcsp->payload, bcsp->payload_length); =20=09 return mux_receive(bcsp); } @@ -142,8 +142,8 @@ if ((u8)(~hdr_sum) =3D=3D checksum) { return TRUE; } else { - D(__FUNCTION__", hdr_sum : 0x%x\n", ~hdr_sum); - D(__FUNCTION__", checksum : 0x%x\n", checksum); + D(__FUNCTION__ ": hdr_sum: 0x%x\n", ~hdr_sum); + D(__FUNCTION__ ": checksum: 0x%x\n", checksum); return FALSE; } } @@ -165,12 +165,12 @@ { =20 if (BCSP_GET_CRC_PRESENT(bcsp)) { - D(__FUNCTION__", CRC is present\n"); - D(__FUNCTION__", payload length field: %d bytes, actual length: %d bytes= \n", bcsp->payload_length, bcsp->packet_length - BCSP_HDR_SIZE - BCSP_CRC_S= IZE);=20 + D(__FUNCTION__ ": CRC is present\n"); + D(__FUNCTION__ ": Payload length field: %d bytes, actual length: %d byte= s\n", bcsp->payload_length, bcsp->packet_length - BCSP_HDR_SIZE - BCSP_CRC_= SIZE);=20 return (bcsp->payload_length =3D=3D (bcsp->packet_length - BCSP_HDR_SIZE= - BCSP_CRC_SIZE)); } else { - D(__FUNCTION__", CRC is not present\n"); - D(__FUNCTION__", payload length field says %d bytes, actual length is %d= bytes\n", bcsp->payload_length, bcsp->packet_length - BCSP_HDR_SIZE); + D(__FUNCTION__ ": CRC is not present\n"); + D(__FUNCTION__ ": Payload length field says %d bytes, actual length is %= d bytes\n", bcsp->payload_length, bcsp->packet_length - BCSP_HDR_SIZE); return (bcsp->payload_length =3D=3D (bcsp->packet_length - BCSP_HDR_SIZE= )); } } @@ -202,7 +202,7 @@ update_crc(&crc, bcsp->packet[i]); } =20 - D(__FUNCTION__", CRC value is 0x%04x\n", crc); + D(__FUNCTION__ ": CRC value is 0x%04x\n", crc); =20 return crc; } --- bcsp_mux.c 2001/05/15 14:36:51 1.1 +++ bcsp_mux.c 2001/05/17 15:25:15 1.2 @@ -50,10 +50,8 @@ =20 #if MUX_DEBUG #define D(fmt...) printk("MUX: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) #endif =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ @@ -73,20 +71,20 @@ /* If we received an ack packet, we discards the packet, sice the ack has already been handled by signal_rxack */ if (bcsp->identifier =3D=3D 0) { - D(__FUNCTION__", received ack, returning\n"); + D(__FUNCTION__ ": Received ack, returning\n"); signal_rxack(BCSP_GET_ACK(bcsp)); return 0; } =20=09 if (BCSP_GET_PROTOCOL_TYPE(bcsp) =3D=3D BCSP_RELIABLE) { - D(__FUNCTION__", Sending to sequencing layer\n"); + D(__FUNCTION__ ": Sending to sequencing layer\n"); return sequence_receive(bcsp); } else if (BCSP_GET_PROTOCOL_TYPE(bcsp) =3D=3D BCSP_UNRELIABLE) { - D(__FUNCTION__", Sending to datagram layer\n"); + D(__FUNCTION__ ": Sending to datagram layer\n"); return datagram_receive(bcsp); } else { /* This shouldn't be possible */ - BCSP_SYS(__FUNCTION__", Packet is neither Reliable nor unreliable \n"); + BCSP_SYS(__FUNCTION__ ": Packet is neither reliable nor unreliable\n"); } return 0; } @@ -94,7 +92,7 @@ s32 mux_send(struct bcsp *bcsp) { - D(__FUNCTION__",\n"); + D(__FUNCTION__ "\n"); return integrity_send(bcsp); } =20 @@ -103,7 +101,7 @@ struct bcsp bcsp; s32 tmp; =20 - D(__FUNCTION__", txack: 0x%x\n", txack); + D(__FUNCTION__ ": txack: 0x%x\n", txack); =20 init_bcsp_packet(&bcsp); =20=09 --- bcsp_sequence.c 2001/05/15 14:36:51 1.1 +++ bcsp_sequence.c 2001/05/17 15:25:15 1.2 @@ -52,10 +52,8 @@ =20 #if SEQUENCE_DEBUG #define D(fmt...) printk("SEQUENCE: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) #endif =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ @@ -148,7 +146,7 @@ remote_ack_nbr =3D ack; =20=09 if (last_ack =3D=3D ack) { - printk(__FUNCTION__", Got incorrect ack:%d, seq_nbr:%d\n", ack, seq_nbr); + printk(__FUNCTION__ ": Got incorrect ack:%d, seq_nbr:%d\n", ack, seq_nbr= ); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) queue_task(&resend_data_task, &tq_scheduler); #else @@ -156,7 +154,7 @@ mark_bh(IMMEDIATE_BH); #endif } else { - D(__FUNCTION__", Got rx ack:%d\n", ack); + D(__FUNCTION__ ": Got rx ack:%d\n", ack); } last_ack =3D ack; } @@ -167,7 +165,7 @@ =20 while (remote_ack_nbr !=3D seq_nbr) { =20=09 - printk(__FUNCTION__", resending seq_nbr:%d, last sent was %d\n", remote_= ack_nbr, seq_nbr); + printk(__FUNCTION__ ": Resending seq_nbr:%d, last sent was %d\n", remote= _ack_nbr, seq_nbr); =20=09=09 init_bcsp_packet(&bcsp); =20=09=09 --- bcsp_slip.c 2001/05/15 14:36:51 1.1 +++ bcsp_slip.c 2001/05/17 15:25:15 1.2 @@ -49,10 +49,10 @@ =20 #if SLIP_DEBUG #define D(fmt...) printk("SLIP: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) +#define PRINTPKT(data, len) print_data(NULL, data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) +#define PRINTPKT(data, len) #endif =20 =20 @@ -92,8 +92,8 @@ { s32 i; =20 - D(__FUNCTION__",\n"); - PRINT_PKT(bcsp->payload, bcsp->payload_length); + D(__FUNCTION__ "\n"); + PRINTPKT(bcsp->payload, bcsp->payload_length); =20 if (!(bcsp->packet =3D kmalloc(2 * (4 + bcsp->payload_length) + 2, GFP_AT= OMIC))) { return -ENOMEM; @@ -136,7 +136,7 @@ static s32 skipping =3D TRUE; s32 i =3D 0; =20 - D(__FUNCTION__", \n"); + D(__FUNCTION__ "\n"); =20=09 if (skipping) { while (i < len) { |
From: Peter K. <pk...@us...> - 2001-05-17 15:16:56
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- btdebug.c 1.19 1.20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Handle message =3D=3D NULL in print_data(). The diff of the modified file(s): --- btdebug.c 2001/04/12 15:14:06 1.19 +++ btdebug.c 2001/05/17 15:16:55 1.20 @@ -72,6 +72,7 @@ { s32 len, diff; struct timeval tv;=20=20 + do_gettimeofday(&tv); =20=09 diff =3D ((tv.tv_sec - tv_old.tv_sec)*1000000 + tv.tv_usec) -=20 @@ -95,10 +96,13 @@ print_data(const u8 *message, u8 *buf, s32 len) {=20 s32 t; - printk("\n%s (%d)", message, len); + + if (message) + printk("\n%s (%d)\n", message, len); + printk(" "); for (t=3D0;t<len;t++)=20 { - if((t%16)=3D=3D0) + if (!((t+1) % 16)) printk("\n "); printk("0x%02x ", buf[t]); } @@ -117,11 +121,14 @@ print_data(const u8 *message, u8 *buf, s32 len) {=20 s32 t; - printf("\n%s (%d)", message, len); + + if (message) + printf("\n%s (%d)\n", message, len); + printf(" "); for (t=3D0;t<len;t++)=20 { - if((t%16)=3D=3D0) - printk("\n "); + if(!((t+1) % 16)) + printf("\n "); printf("0x%02x ", buf[t]); } printf("\n"); |
From: Peter K. <pk...@us...> - 2001-05-17 15:04:40
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.35 1.36=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Turn bt_write_lower_driver() into bcsp_write_top() when BCSP is enabled. The diff of the modified file(s): --- hci_vendor.c 2001/05/17 14:53:15 1.35 +++ hci_vendor.c 2001/05/17 15:04:38 1.36 @@ -85,6 +85,10 @@ =20 #define BT_HW_INFO_MAX 255 =20 +#ifdef CONFIG_BLUETOOTH_USE_BCSP +#define bt_write_lower_driver(data, len) bcsp_write_top(data, len) +#endif + /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 /* These are declared in hci.c */ |
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: Peter K. <pk...@us...> - 2001-05-17 14:53:17
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- hci_vendor.c 1.34 1.35=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Differ the vendor name for CSR depending on whether BCSP is used or not. The diff of the modified file(s): --- hci_vendor.c 2001/05/15 15:19:58 1.34 +++ hci_vendor.c 2001/05/17 14:53:15 1.35 @@ -1037,7 +1037,11 @@ char* bt_hw_vendor(void) { - return "CSR"; +#ifdef CONFIG_BLUETOOTH_USE_BCSP + return "CSR (BCSP)"; +#else + return "CSR (H4)"; +#endif } =20 #elif defined(CONFIG_BLUETOOTH_INFINEON_BMI) |
From: Peter K. <pk...@us...> - 2001-05-17 11:15:04
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- Makefile 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Compile the BCSP files too when required. The diff of the modified file(s): --- Makefile 2001/03/30 09:47:15 1.20 +++ Makefile 2001/05/17 11:15:04 1.21 @@ -2,14 +2,13 @@ # Makefile for the Bluetooth device driver. # =20 -# This would have worked had it not been for test.c which is not to be -# included by default -#OBJS =3D $(patsubst %.c, %.o, $(wildcard *.c)) - OBJS =3D bluetooth.o bt_proc.o btdebug.o btmem.o hci.o hci_vendor.o \ l2cap.o l2cap_con.o l2cap_sec.o rfcomm.o rfcomm_sec.o \ sec_client.o sdp.o tcs.o test.o =20 +BOBJS =3D bcsp.o bcsp_datagram.o bcsp_integrity.o bcsp_mux.o \ + bcsp_sequence.o bcsp_slip.o + ifeq ($(TOPDIR)/Rules.make,$(wildcard $(TOPDIR)/Rules.make)) =20 #--------------------------------------------------------------------- @@ -21,9 +20,13 @@ =20 # For 2.4.x obj-$(CONFIG_BLUETOOTH) +=3D $(OBJS) +obj-$(CONFIG_BLUETOOTH_USE_BCSP) +=3D $(BOBJS) =20 # For 2.0.x and 2.2.x O_OBJS =3D $(OBJS) +ifdef CONFIG_BLUETOOTH_USE_BCSP +O_OBJS +=3D $(BOBJS) +endif M_OBJS =3D $(O_TARGET) =20 include $(TOPDIR)/Rules.make @@ -49,7 +52,7 @@ =20 all: $(O_TARGET) =20 -$(O_TARGET): $(OBJS) +$(O_TARGET): $(OBJS) $(BOBJS) $(LD) -r -o $@ $^ =20 install: all |
From: Peter K. <pk...@us...> - 2001-05-17 10:58:04
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- Config.in 1.14 1.15=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Only allow BCSP when using CSR's hardware. The diff of the modified file(s): --- Config.in 2001/05/15 14:41:16 1.14 +++ Config.in 2001/05/17 10:58:03 1.15 @@ -21,6 +21,10 @@ bool ' Block when setting baudrate' CONFIG_BLUETOOTH_SET_BAUDRATE_BLO= CKING fi =20 + if [ "$CONFIG_BLUETOOTH_CSR" =3D "y" ]; then + bool ' Enable BCSP' CONFIG_BLUETOOTH_USE_BCSP + fi + bool ' Bluetooth proc entries' CONFIG_BLUETOOTH_PROC bool ' Input buffering' CONFIG_BLUETOOTH_USE_INBUFFER bool ' Use Security Manager' CONFIG_BLUETOOTH_USE_SECURITY_MANAGER @@ -28,7 +32,6 @@ bool ' Allow connectionless L2CAP' CONFIG_BLUETOOTH_L2CAP_CONNECTIONLESS bool ' Enable TCI' CONFIG_BLUETOOTH_USE_TCI bool ' Enable M/S Switch' CONFIG_BLUETOOTH_ENABLE_MSSWITCH - bool ' Enable BCSP ' CONFIG_BLUETOOTH_USE_BCSP =20 if [ "$CONFIG_BLUETOOTH_ENABLE_MSSWITCH" =3D "y" ]; then # CSR can't do scatternet yet, so we need to do M/S switch=20 @@ -44,7 +47,6 @@ Port_PB_Bit_5 CONFIG_BLUETOOTH_RESET_PB5 \ Port_G_Bit_10 CONFIG_BLUETOOTH_RESET_G10 \ Port_G_Bit_11 CONFIG_BLUETOOTH_RESET_G11" None - fi =20 endmenu |
From: Mats F. <ma...@us...> - 2001-05-17 10:36:37
|
The following files were modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- btinit.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20 modememul.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Replaced static value with define The diff of the modified file(s): --- btinit.c 2001/05/17 10:23:01 1.7 +++ btinit.c 2001/05/17 10:36:36 1.8 @@ -208,7 +208,7 @@ /* Set default speed */ =20 if (init_hw_speed !=3D 0) - fd_setup(phys_fd, init_hw_speed, 1, hw_vendor() =3D=3D HW_CSR_BCSP); + fd_setup(phys_fd, init_hw_speed, USE_FLOW_CTRL, hw_vendor() =3D=3D HW_= CSR_BCSP); else init_phys(phys_fd); =20 --- modememul.c 2001/05/17 10:24:04 1.6 +++ modememul.c 2001/05/17 10:36:36 1.7 @@ -125,7 +125,7 @@ } =20 /* not necessary for BT devices... */ - fd_setup(btfd, speed, USE_NO_FLOW, 0); + fd_setup(btfd, speed, USE_NO_FLOW, DONT_USE_BCSP); =20 syslog(LOG_INFO, "done."); done =3D modem_emulator(btfd); |
From: Mats F. <ma...@us...> - 2001-05-17 10:32:32
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_misc.h 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added define for using BCSP or not The diff of the modified file(s): --- bt_misc.h 2001/05/17 10:22:04 1.6 +++ bt_misc.h 2001/05/17 10:32:32 1.7 @@ -45,6 +45,9 @@ #define USE_NO_FLOW 0=20 #define USE_FLOW_CTRL 1 =20 +#define USE_BCSP 1 +#define DONT_USE_BCSP 0 + #define CLIENT 0 #define SERVER 1 =20 |
From: Mats F. <ma...@us...> - 2001-05-17 10:31:50
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- bt_vendor.h 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Moved defines for HW The diff of the modified file(s): --- bt_vendor.h 2001/04/20 16:11:35 1.2 +++ bt_vendor.h 2001/05/17 10:31:49 1.3 @@ -50,11 +50,24 @@ =20 #define MANUFACTURER_SPEC 0x3f =20 +#define HW_NOT_PROBED -1 +#define HW_CSR_H4 0 +#define HW_CSR_BCSP 1 +#define HW_DIGIANSWER 2 +#define HW_ERICSSON 3 +#define HW_INFINEON 4 +#define HW_USB 5 +#define HW_GENERIC 6 +#define HW_NO_INIT 7 +#define HW_UNKNOWN 8 + /*=20 * Vendor specific functions=20 */ =20 void init_hw(int bt_cfd, int phys_fd, int spd); void init_phys(int fd); + +int hw_vendor(void); =20 #endif /* __BT_VENDOR_H__*/ |
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: Mats F. <ma...@us...> - 2001-05-17 10:24:04
|
The following file was modified in apps/bluetooth/experimental: Name Old version New version Comment ---- ----------- ----------- ------- modememul.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Changed function call to fd_setup(), according to changes for BCSP The diff of the modified file(s): --- modememul.c 2001/05/14 11:29:36 1.5 +++ modememul.c 2001/05/17 10:24:04 1.6 @@ -125,7 +125,7 @@ } =20 /* not necessary for BT devices... */ - fd_setup(btfd, speed, USE_NO_FLOW); + fd_setup(btfd, speed, USE_NO_FLOW, 0); =20 syslog(LOG_INFO, "done."); done =3D modem_emulator(btfd); |