From: Mats F. <ma...@us...> - 2001-05-15 15:28:46
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Fixed initialization of the packet_length, in init_bcsp_packet()=20 The diff of the modified file(s): --- bcsp.c 2001/05/15 14:36:51 1.1 +++ bcsp.c 2001/05/15 15:28:46 1.2 @@ -216,7 +216,7 @@ bcsp->payload =3D NULL; bcsp->crc =3D 0; bcsp->packet =3D NULL; - bcsp->packet_length =3D NULL; + bcsp->packet_length =3D 0; }; =20 /****************** END OF FILE bcsp.c ***********************************= ***/ |
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: Mats F. <ma...@us...> - 2001-05-18 13:56:16
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: corrected spelling The diff of the modified file(s): --- bcsp.c 2001/05/18 09:14:20 1.5 +++ bcsp.c 2001/05/18 13:56:14 1.6 @@ -168,7 +168,7 @@ s32 handled =3D 0; struct bcsp bcsp; =20 - D(__FUNCTION__ ": Incomming data:\n"); + D(__FUNCTION__ ": Incoming data:\n"); PRINTPKT(data, len); =20 while (handled < len) { |
From: Peter K. <pk...@us...> - 2001-05-18 15:38:02
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Use get_unaligned() instead of CHAR2INT16(). * Print the outgoing packet when debug is enabled. The diff of the modified file(s): --- bcsp.c 2001/05/18 13:56:14 1.6 +++ bcsp.c 2001/05/18 15:38:01 1.7 @@ -1,6 +1,5 @@ /* - * bcsp.c -- Implementation of glue layer functions to the BCSP - * protocol stack + * bcsp.c -- Implementation of glue layer functions for the BCSP protocol = stack * * Copyright (C) 2001 Axis Communications AB * @@ -42,13 +41,14 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#include <linux/malloc.h> #include <linux/string.h> #include <linux/types.h> +#include <asm/byteorder.h> +#include <asm/unaligned.h> =20 -#include <linux/bluetooth/hci.h> #include <linux/bluetooth/sysdep-2.1.h> #include <linux/bluetooth/btcommon.h> -#include <linux/malloc.h> #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> #include <linux/bluetooth/bluetooth.h> @@ -191,7 +191,7 @@ =20=09 switch (data[0]) { case CMD_PKT: - opcode =3D CHAR2INT16(data[2], data[1]); + opcode =3D le16_to_cpu(get_unaligned((u16 *)&data[1])); if (hci_get_ocf(opcode) =3D=3D BCSP_OCF) { ret =3D sequence_send(data + 5, len - 5, data[4] & 0x3f); } else { @@ -215,6 +215,9 @@ s32 bcsp_write_lower(u8 *data, u32 len) { + D(__FUNCTION__ ": Outgoing data:\n"); + PRINTPKT(data, len); + return bt_write_lower_driver(data, len); } =20 |
From: Mats F. <ma...@us...> - 2001-05-25 14:07:58
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Corrected spelling * Use one function for all sync-msg The diff of the modified file(s): --- bcsp.c 2001/05/22 09:45:53 1.9 +++ bcsp.c 2001/05/25 14:07:56 1.10 @@ -114,7 +114,7 @@ { BCSP_SYS(__FUNCTION__ ": Initializing BCSP\n"); bcsp_sequence_init(); - bcsp_send_sync(); + bcsp_send_sync(SYNC); cli(); if (!bcsp_sync) { interruptible_sleep_on(&bcsp_sync_wq); @@ -125,7 +125,7 @@ void bcsp_shutdown(void) { - BCSP_SYS(__FUNCTION__": Shuting down BCSP\n"); + BCSP_SYS(__FUNCTION__": Shutting down BCSP\n"); bcsp_sequence_shutdown(); } =20 |
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 16:29:24
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.12 1.13=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Set bcsp_sync to false in bcsp_shutdown The diff of the modified file(s): --- bcsp.c 2001/06/06 14:54:34 1.12 +++ bcsp.c 2001/06/06 16:29:23 1.13 @@ -155,6 +155,7 @@ DSYS("Shutting down BCSP\n"); bcsp_datagram_shutdown(); /* choke datastream */ bcsp_sequence_shutdown(); + bcsp_sync =3D FALSE; } =20 void=20 |
From: Mattias A. <mat...@us...> - 2001-06-13 12:38:08
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.13 1.14=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * modified debug * added wait for command status after syncing bcsp The diff of the modified file(s): --- bcsp.c 2001/06/06 16:29:23 1.13 +++ bcsp.c 2001/06/13 12:11:53 1.14 @@ -83,6 +83,7 @@ /****************** LOCAL FUNCTION DECLARATION SECTION *******************= ***/ =20 void bcsp_sync_timeout(unsigned long ptr); +extern void csr_waitcmdnum(void); =20 /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 @@ -145,9 +146,13 @@ sti(); =20 /* notify bt driver that sync failed */ - if (!bcsp_sync) + if (!bcsp_sync) { return -1; + } else { + csr_waitcmdnum(); /* Wait for command status */ } + return 0;=09 +} =20 void bcsp_shutdown(void) @@ -183,7 +188,7 @@ del_timer(&bcsp_sync_timer); #endif =20 - BCSP_SYS(__FUNCTION__ ": BCSP initialized and syncronized\n"); + DSYS("BCSP initialized and syncronized\n"); wake_up_interruptible(&bcsp_sync_wq); } =20 |
From: Mats F. <ma...@us...> - 2001-07-06 06:48:56
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.15 1.16=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected call to buf_byte_cnt() The diff of the modified file(s): --- bcsp.c 2001/06/20 13:46:07 1.15 +++ bcsp.c 2001/07/06 06:48:54 1.16 @@ -244,7 +244,7 @@ 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); + winspace, hci_ctrl.hc_buf.acl_num, buf_byte_count(-1), tot_len); =20 printk("status: txseq[%d] txack[%d] cur_rxack[%d] exp_rxseq[%d]\n\n",=20 txseq, txack, rxack, expected_rxseq); |
From: Peter K. <pk...@us...> - 2001-09-06 15:57:26
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Moved BCSP channel definitions to bcsp.h * Corrected spelling of BCSP_EVT_CHN. The diff of the modified file(s): --- bcsp.c 2001/08/16 13:01:22 1.17 +++ bcsp.c 2001/09/06 15:56:56 1.18 @@ -83,13 +83,6 @@ #define BCSPDUMP(data, len) #endif =20 -#define BCSP_BCCMD_CHN 2 -#define BCSP_HQ_CHN 3 -#define BCSP_CMD_CHN 5 -#define BCSP_EVT_CNH 5 -#define BCSP_ACL_CHN 6 -#define BCSP_SCO_CHN 7 - #define BCSP_OCF 0 =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ @@ -226,7 +219,7 @@ case BCSP_HQ_CHN: hci_receive_hq(data, len); break; - case BCSP_EVT_CNH: + case BCSP_EVT_CHN: hci_receive_event(data, (s32)len); break; case BCSP_ACL_CHN: |
From: Willy S. <sag...@us...> - 2002-04-11 08:32:11
|
The following file was modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bcsp.c 1.22 1.23=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added linux version ifdef for malloc.h/slab.h The diff of the modified file(s): --- bcsp.c 22 Oct 2001 12:51:44 -0000 1.22 +++ bcsp.c 11 Apr 2002 08:32:09 -0000 1.23 @@ -44,7 +44,11 @@ #define __NO_VERSION__ /* don't define kernel_version in module.h */ =20 #ifdef __KERNEL__ +#if LINUX_VERSION_CODE >=3D 0x20200 +#include <linux/slab.h> +#else #include <linux/malloc.h> +#endif #include <linux/string.h> #include <linux/types.h> #include <linux/delay.h> |