linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btusb: Raw mode and ACL/SCO data
@ 2010-04-07 12:53 Kim B. Heino
  2010-04-08  4:08 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Kim B. Heino @ 2010-04-07 12:53 UTC (permalink / raw)
  To: linux-bluetooth, marcel, linux-kernel

This patch allows sending ACL/SCO packets if device is in RAW mode.
Previously only command packets were allowed.

Signed-off-by: Kim B. Heino <Kim.Heino@bluegiga.com>


diff -ur orig/drivers/bluetooth/btusb.c linux-2.6.33.2/drivers/bluetooth/btusb.c
--- orig/drivers/bluetooth/btusb.c	2010-04-02 02:02:33.000000000 +0300
+++ linux-2.6.33.2/drivers/bluetooth/btusb.c	2010-04-07 15:17:55.696672710 +0300
@@ -663,7 +663,9 @@
 		break;
 
 	case HCI_ACLDATA_PKT:
-		if (!data->bulk_tx_ep || hdev->conn_hash.acl_num < 1)
+		if (!data->bulk_tx_ep ||
+		    (!test_bit(HCI_RAW, &hdev->flags) &&
+		     hdev->conn_hash.acl_num < 1))
 			return -ENODEV;
 
 		urb = usb_alloc_urb(0, GFP_ATOMIC);
@@ -680,7 +682,9 @@
 		break;
 
 	case HCI_SCODATA_PKT:
-		if (!data->isoc_tx_ep || hdev->conn_hash.sco_num < 1)
+		if (!data->isoc_tx_ep ||
+		    (!test_bit(HCI_RAW, &hdev->flags) &&
+		     hdev->conn_hash.sco_num < 1))
 			return -ENODEV;
 
 		urb = usb_alloc_urb(BTUSB_MAX_ISOC_FRAMES, GFP_ATOMIC);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] btusb: Raw mode and ACL/SCO data
  2010-04-07 12:53 [PATCH] btusb: Raw mode and ACL/SCO data Kim B. Heino
@ 2010-04-08  4:08 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2010-04-08  4:08 UTC (permalink / raw)
  To: Kim B. Heino; +Cc: linux-bluetooth, linux-kernel

Hi Kim,

> This patch allows sending ACL/SCO packets if device is in RAW mode.
> Previously only command packets were allowed.

so do I really wanna know why such a change is required?

> diff -ur orig/drivers/bluetooth/btusb.c linux-2.6.33.2/drivers/bluetooth/btusb.c
> --- orig/drivers/bluetooth/btusb.c	2010-04-02 02:02:33.000000000 +0300
> +++ linux-2.6.33.2/drivers/bluetooth/btusb.c	2010-04-07 15:17:55.696672710 +0300
> @@ -663,7 +663,9 @@
>  		break;
>  
>  	case HCI_ACLDATA_PKT:
> -		if (!data->bulk_tx_ep || hdev->conn_hash.acl_num < 1)
> +		if (!data->bulk_tx_ep ||
> +		    (!test_bit(HCI_RAW, &hdev->flags) &&
> +		     hdev->conn_hash.acl_num < 1))
>  			return -ENODEV;

Actually this one is wrong. The conn_hash.acl_num check just has to go
away. We always start the bulk URBs anyway since otherwise a lot of
devices break. We had to figure this out the hard way. Some device
manufactures have endpoints that rely on each other and do their flow
control based on submitted URBs.

So no need to do another HCI_RAW test here.
 
>  		urb = usb_alloc_urb(0, GFP_ATOMIC);
> @@ -680,7 +682,9 @@
>  		break;
>  
>  	case HCI_SCODATA_PKT:
> -		if (!data->isoc_tx_ep || hdev->conn_hash.sco_num < 1)
> +		if (!data->isoc_tx_ep ||
> +		    (!test_bit(HCI_RAW, &hdev->flags) &&
> +		     hdev->conn_hash.sco_num < 1))
>  			return -ENODEV;
>  
>  		urb = usb_alloc_urb(BTUSB_MAX_ISOC_FRAMES, GFP_ATOMIC);

And my assumption is that you only tested ACL data since this clearly
doesn't do anything useful. The isoc URBs and incoming data are not
magically started only because you pass this checkpoint.

No SCO links and no isoc URBs in the system. Period. If you wanna
disable the kernel Bluetooth stack, then you don't get SCO support over
USB.

Regards

Marcel



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-08  4:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 12:53 [PATCH] btusb: Raw mode and ACL/SCO data Kim B. Heino
2010-04-08  4:08 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).