[PATCH 2/2] bcsp: Change tx window size in configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tristan Lelong <tlelong@xxxxxxxxxxxxxxxxxx>

This patch make the TX window size configurable using the kernel configuration interface.
The default value used is the previous value: 4

Signed-off-by: Tristan Lelong <tristan@xxxxxxxxxx>
---
 drivers/bluetooth/Kconfig    | 7 +++++++
 drivers/bluetooth/hci_bcsp.c | 5 +----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 364f080..9f634cb 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -59,6 +59,13 @@ config BT_HCIUART_BCSP
 
 	  Say Y here to compile support for HCI BCSP protocol.
 
+config BT_HCIUART_BCSP_WINSIZE
+	int "BCSP reliable packet TX window size"
+	default 4
+	depends on BT_HCIUART_BCSP
+	help
+	  Defines the number of packets that can be sent before receiving a ACK.
+
 config BT_HCIUART_ATH3K
 	bool "Atheros AR300x serial support"
 	depends on BT_HCIUART
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c
index 142b42b..bb18f2a 100644
--- a/drivers/bluetooth/hci_bcsp.c
+++ b/drivers/bluetooth/hci_bcsp.c
@@ -59,9 +59,6 @@ static u8 conf_rsp_pkt[4] = { 0xde, 0xad, 0xd0, 0xd0 };
 static u8 sync_pkt[4]     = { 0xda, 0xdc, 0xed, 0xed };
 static u8 sync_rsp_pkt[4] = { 0xac, 0xaf, 0xef, 0xee };
 
-
-#define BCSP_TXWINSIZE	4
-
 #define BCSP_PKT_LEN(data)	((data[1] >> 4) + (data[2]))
 #define BCSP_LE_PKT_LEN	0x04
 
@@ -331,7 +328,7 @@ static struct sk_buff *bcsp_dequeue(struct hci_uart *hu)
 
 	spin_lock_irqsave_nested(&bcsp->unack.lock, flags, SINGLE_DEPTH_NESTING);
 
-	if (bcsp->unack.qlen < BCSP_TXWINSIZE) {
+	if (bcsp->unack.qlen < CONFIG_BT_HCIUART_BCSP_WINSIZE) {
 		skb = skb_dequeue(&bcsp->rel);
 		if (skb != NULL) {
 			struct sk_buff *nskb = bcsp_prepare_pkt(bcsp, skb->data, skb->len,
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux