aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-10-28 13:20:40 -0400
committerMarcel Holtmann <marcel@holtmann.org>2005-10-28 13:20:40 -0400
commit20dd6f59d6ea5fe47397c5254606c76b1d047727 (patch)
treeffc9b0a7f3d582120c997ec4277f561f9d8c6f87 /drivers
parent408c1ce2716c7a004851c93f9f9dcf3d763bc240 (diff)
[Bluetooth] Remove TXCRC compile option for BCSP driver
The TXCRC compile option is not really useful and thus change it into a module parameter. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bluetooth/Kconfig8
-rw-r--r--drivers/bluetooth/hci_bcsp.c42
-rw-r--r--drivers/bluetooth/hci_bcsp.h1
-rw-r--r--drivers/bluetooth/hci_ldisc.c2
4 files changed, 25 insertions, 28 deletions
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 543f93e0f23f..b9fbe6e7f9ae 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -55,14 +55,6 @@ config BT_HCIUART_BCSP
55 55
56 Say Y here to compile support for HCI BCSP protocol. 56 Say Y here to compile support for HCI BCSP protocol.
57 57
58config BT_HCIUART_BCSP_TXCRC
59 bool "Transmit CRC with every BCSP packet"
60 depends on BT_HCIUART_BCSP
61 help
62 If you say Y here, a 16-bit CRC checksum will be transmitted along with
63 every BCSP (BlueCore Serial Protocol) packet sent to the Bluetooth chip.
64 This increases reliability, but slightly reduces efficiency.
65
66config BT_HCIBCM203X 58config BT_HCIBCM203X
67 tristate "HCI BCM203x USB driver" 59 tristate "HCI BCM203x USB driver"
68 depends on USB 60 depends on USB
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 0ee324e1265d..91bd293d7a0a 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -28,7 +28,7 @@
28 * $Id: hci_bcsp.c,v 1.2 2002/09/26 05:05:14 maxk Exp $ 28 * $Id: hci_bcsp.c,v 1.2 2002/09/26 05:05:14 maxk Exp $
29 */ 29 */
30 30
31#define VERSION "0.2" 31#define VERSION "0.3"
32 32
33#include <linux/config.h> 33#include <linux/config.h>
34#include <linux/module.h> 34#include <linux/module.h>
@@ -60,6 +60,7 @@
60#define BT_DBG( A... ) 60#define BT_DBG( A... )
61#endif 61#endif
62 62
63static int txcrc = 1;
63static int hciextn = 1; 64static int hciextn = 1;
64 65
65/* ---- BCSP CRC calculation ---- */ 66/* ---- BCSP CRC calculation ---- */
@@ -173,11 +174,8 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
173{ 174{
174 struct sk_buff *nskb; 175 struct sk_buff *nskb;
175 u8 hdr[4], chan; 176 u8 hdr[4], chan;
176 int rel, i;
177
178#ifdef CONFIG_BT_HCIUART_BCSP_TXCRC
179 u16 BCSP_CRC_INIT(bcsp_txmsg_crc); 177 u16 BCSP_CRC_INIT(bcsp_txmsg_crc);
180#endif 178 int rel, i;
181 179
182 switch (pkt_type) { 180 switch (pkt_type) {
183 case HCI_ACLDATA_PKT: 181 case HCI_ACLDATA_PKT:
@@ -240,9 +238,9 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
240 BT_DBG("Sending packet with seqno %u", bcsp->msgq_txseq); 238 BT_DBG("Sending packet with seqno %u", bcsp->msgq_txseq);
241 bcsp->msgq_txseq = ++(bcsp->msgq_txseq) & 0x07; 239 bcsp->msgq_txseq = ++(bcsp->msgq_txseq) & 0x07;
242 } 240 }
243#ifdef CONFIG_BT_HCIUART_BCSP_TXCRC 241
244 hdr[0] |= 0x40; 242 if (bcsp->use_crc)
245#endif 243 hdr[0] |= 0x40;
246 244
247 hdr[1] = ((len << 4) & 0xff) | chan; 245 hdr[1] = ((len << 4) & 0xff) | chan;
248 hdr[2] = len >> 4; 246 hdr[2] = len >> 4;
@@ -251,25 +249,25 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
251 /* Put BCSP header */ 249 /* Put BCSP header */
252 for (i = 0; i < 4; i++) { 250 for (i = 0; i < 4; i++) {
253 bcsp_slip_one_byte(nskb, hdr[i]); 251 bcsp_slip_one_byte(nskb, hdr[i]);
254#ifdef CONFIG_BT_HCIUART_BCSP_TXCRC 252
255 bcsp_crc_update(&bcsp_txmsg_crc, hdr[i]); 253 if (bcsp->use_crc)
256#endif 254 bcsp_crc_update(&bcsp_txmsg_crc, hdr[i]);
257 } 255 }
258 256
259 /* Put payload */ 257 /* Put payload */
260 for (i = 0; i < len; i++) { 258 for (i = 0; i < len; i++) {
261 bcsp_slip_one_byte(nskb, data[i]); 259 bcsp_slip_one_byte(nskb, data[i]);
262#ifdef CONFIG_BT_HCIUART_BCSP_TXCRC 260
263 bcsp_crc_update(&bcsp_txmsg_crc, data[i]); 261 if (bcsp->use_crc)
264#endif 262 bcsp_crc_update(&bcsp_txmsg_crc, data[i]);
265 } 263 }
266 264
267#ifdef CONFIG_BT_HCIUART_BCSP_TXCRC
268 /* Put CRC */ 265 /* Put CRC */
269 bcsp_txmsg_crc = bcsp_crc_reverse(bcsp_txmsg_crc); 266 if (bcsp->use_crc) {
270 bcsp_slip_one_byte(nskb, (u8) ((bcsp_txmsg_crc >> 8) & 0x00ff)); 267 bcsp_txmsg_crc = bcsp_crc_reverse(bcsp_txmsg_crc);
271 bcsp_slip_one_byte(nskb, (u8) (bcsp_txmsg_crc & 0x00ff)); 268 bcsp_slip_one_byte(nskb, (u8) ((bcsp_txmsg_crc >> 8) & 0x00ff));
272#endif 269 bcsp_slip_one_byte(nskb, (u8) (bcsp_txmsg_crc & 0x00ff));
270 }
273 271
274 bcsp_slip_msgdelim(nskb); 272 bcsp_slip_msgdelim(nskb);
275 return nskb; 273 return nskb;
@@ -698,6 +696,9 @@ static int bcsp_open(struct hci_uart *hu)
698 696
699 bcsp->rx_state = BCSP_W4_PKT_DELIMITER; 697 bcsp->rx_state = BCSP_W4_PKT_DELIMITER;
700 698
699 if (txcrc)
700 bcsp->use_crc = 1;
701
701 return 0; 702 return 0;
702} 703}
703 704
@@ -743,5 +744,8 @@ int bcsp_deinit(void)
743 return hci_uart_unregister_proto(&bcsp); 744 return hci_uart_unregister_proto(&bcsp);
744} 745}
745 746
747module_param(txcrc, bool, 0644);
748MODULE_PARM_DESC(txcrc, "Transmit CRC with every BCSP packet");
749
746module_param(hciextn, bool, 0644); 750module_param(hciextn, bool, 0644);
747MODULE_PARM_DESC(hciextn, "Convert HCI Extensions into BCSP packets"); 751MODULE_PARM_DESC(hciextn, "Convert HCI Extensions into BCSP packets");
diff --git a/drivers/bluetooth/hci_bcsp.h b/drivers/bluetooth/hci_bcsp.h
index a2b3bb92274b..01bbc664db74 100644
--- a/drivers/bluetooth/hci_bcsp.h
+++ b/drivers/bluetooth/hci_bcsp.h
@@ -60,6 +60,7 @@ struct bcsp_struct {
60 BCSP_ESCSTATE_ESC 60 BCSP_ESCSTATE_ESC
61 } rx_esc_state; 61 } rx_esc_state;
62 62
63 u8 use_crc;
63 u16 message_crc; 64 u16 message_crc;
64 u8 txack_req; /* Do we need to send ack's to the peer? */ 65 u8 txack_req; /* Do we need to send ack's to the peer? */
65 66
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index aed80cc22890..8c9317bcd53c 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -27,7 +27,7 @@
27 * 27 *
28 * $Id: hci_ldisc.c,v 1.5 2002/10/02 18:37:20 maxk Exp $ 28 * $Id: hci_ldisc.c,v 1.5 2002/10/02 18:37:20 maxk Exp $
29 */ 29 */
30#define VERSION "2.1" 30#define VERSION "2.2"
31 31
32#include <linux/config.h> 32#include <linux/config.h>
33#include <linux/module.h> 33#include <linux/module.h>