Return-Path: MIME-Version: 1.0 In-Reply-To: <1266427894.8849.66.camel@localhost.localdomain> References: <1265918068-14721-1-git-send-email-npelly@google.com> <35c90d961002111159h6727bc2cw28b55ce6e919fb4f@mail.gmail.com> <35c90d961002151315i5fc0f5b9y36aaba4415987a2f@mail.gmail.com> <4B7BB746.1040806@nokia.com> <35c90d961002170849m1d13743fg725a87594d63b80c@mail.gmail.com> <1266427894.8849.66.camel@localhost.localdomain> From: Nick Pelly Date: Thu, 18 Feb 2010 15:47:58 -0800 Message-ID: <35c90d961002181547x1ea26ba7je4eee29ef29e6fd2@mail.gmail.com> Subject: Re: [PATCH] Bluetooth: Allow SCO/eSCO packet type selection for outgoing SCO connections. To: Marcel Holtmann Cc: Ville Tervo , linux-bluetooth@vger.kernel.org Content-Type: multipart/mixed; boundary=001636b1471c185057047fe89a1a List-ID: --001636b1471c185057047fe89a1a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Feb 17, 2010 at 9:31 AM, Marcel Holtmann wrot= e: > Hi Nick, > >> >> As a first step, can we get consensus on the userspace API: >> >> >> >> --- a/include/net/bluetooth/hci.h >> >> +++ b/include/net/bluetooth/hci.h >> >> @@ -139,8 +139,11 @@ enum { >> >> +#define ALL_SCO_PKTS =A0 (SCO_ESCO_MASK | EDR_ESCO_MASK) >> >> +#define ALL_ESCO_PKTS =A0(SCO_ESCO_MASK | ESCO_EV3 | ESCO_EV4 | ESCO= _EV5) >> >> >> >> --- a/include/net/bluetooth/sco.h >> >> +++ b/include/net/bluetooth/sco.h >> >> @@ -37,6 +37,7 @@ >> >> struct sockaddr_sco { >> >> =A0 =A0 =A0 sa_family_t =A0 =A0 sco_family; >> >> =A0 =A0 =A0 bdaddr_t =A0 =A0 =A0 =A0sco_bdaddr; >> >> + =A0 =A0 =A0 __u16 =A0 =A0 =A0 =A0 =A0 sco_pkt_type; >> >> }; >> >> >> >> This will at least unblock my work. >> > >> > Would it be better to add new sockopt for sco socket? >> >> What advantage does that have? >> >> Putting it in struct sockaddr_sco seems to make more sense since >> packet types can only be selected during SCO connection establishment. >> They can't be changed once the socket is connected. > > in theory you can change the allowed packet types for ACL, SCO and eSCO > after the connection is active. However the usefulness here is fairly > limited. In case of ACL it is purely academical and most link manager > will just ignore you. Mainly because the host stack can't really make a > good decision here anyway. > > Personally I think it is a total brain dead concept to give this into > the control of the host stack anyway. For eSCO packet types this make a > bit more sense since you might wanna control the bandwidth. However > changing them later is just pointless. And I don't recall of any profile > actually mentioning about it. I think they had a great idea behind eSCO > support, but since it is impossible to get the negotiation parts right, > everybody sticks with simple eSCO channels and doesn't bother to change > them. > > And even if we would be going for a setsockopt(), that would be blocking > and then again pretty much pointless API. The sockaddr is most logical > thing that fits into what we wanna achieve. Disallow/allow certain > packet types and essentially force SCO over eSCO. Ok seems like there is agreement on using struct sockaddr_sco for sco_pkt_t= ype. A more controversial question is whether to follow the SIG convention of reversing the logic on the EDR bits in the packet type mask (1 means do *not* use this packet for the EDR bits), or to use consistent logic for each bit (1 always means *allow* this packet type) for packet selection in scokaddr_sco.sco_pkt_type. The original patch I posted followed the SIG convention. However after more thinking I am leaning towards using consistent logic for each bit. 1 will always mean 'allow this packet'. My rationale is that the most common use for sco_pkt_type will be to request only SCO packet types allowed. If however the SIG adds more reverse logic packet types, and we follow the SIG convention, then old userspace code that just requested the SCO packet types will now end up with the new packet types as well. So I think it is best to avoid this situation and for 1 to always mean 'allow this packet' in sockaddr_sco.sco_pkt_type. Attached is a new patch with the consistent bit logic. Comments? Cheers, Nick --001636b1471c185057047fe89a1a Content-Type: application/octet-stream; name="0001-Bluetooth-Allow-SCO-eSCO-packet-type-selection-for-o.patch" Content-Disposition: attachment; filename="0001-Bluetooth-Allow-SCO-eSCO-packet-type-selection-for-o.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g5u69sst1 RnJvbSA2ZWZhOTdiMzE2Y2YzZjg4OTdhNjRhNzM5ZWEyMjE4NzlkYzEzNGRkIE1vbiBTZXAg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