Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-devel] [PATCH] /include/net/bluetooth/hci.h : modify ACL_PTYPE_MASK
@ 2005-04-04 14:27 zze-COLBUS Emmanuel RD-MAPS-GRE
  2005-04-07 10:27 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: zze-COLBUS Emmanuel RD-MAPS-GRE @ 2005-04-04 14:27 UTC (permalink / raw)
  To: bluez-devel

Hello,

I've noticed that ACL_PTYPE_MASK is defined as the binary negation of
SCO_PTYPE_MASK in /include/net/bluetooth/hci.h .

Although this happens to be not wrong currently, because none of the
values (0x0020, 0x0040, 0x0080) used by HV1, HV2 and HV3 have a meaning
for ACL packets, there is AFAIK no norm stating that this won't change
(these values are just marked as "Reserved for future use" in the
Bluetooth Specification version 2.0).

Furthermore, value 0x0001 is marked as "Reserved for future use" for
both ACL and SCO packets. Therefore, by forbidding their use for SCO
packets, and defining the ACL mask as the SCO mask's negation, we are
allowing it's use for ACL packets, which could have unspecified results
on any hardware using a future Bluetooth Specification version.

I suggest the following patch : 


--- old/include/net/bluetooth/hci.h       2005-03-26 04:28:36.000000000
+0100
+++ new/include/net/bluetooth/hci.h      2005-04-04 16:08:24.372117996
+0200
@@ -124,7 +124,8 @@
 #define HCI_HV3                0x0080

 #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3)
-#define ACL_PTYPE_MASK (~SCO_PTYPE_MASK)
+#define ACL_PTYPE_MASK (HCI_DM1 | HCI_DM3 | HCI_DM5 \
+		| HCI_DH1 | HCI_DH3 | HCI_DH5)

 /* ACL flags */
 #define ACL_CONT               0x01


Note that this patch has the side effect of blocking any flag that is
not defined in hci.h for ACL packets (like 0x0002 : "2-DH1 may not be
used"), but I assume that using such a flag somewhere would just be a
bug.

Regards,

Emmanuel

--
Emmanuel Colbus
Club GNU/Linux
ENSIMAG - Departement telecoms

M. Emmanuel COLBUS intervenant à France Télécoms dans le cadre d'un
stage de fin d'études sous la responsabilité de M. Tahar Jarboui.



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

end of thread, other threads:[~2005-04-07 10:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-04 14:27 [Bluez-devel] [PATCH] /include/net/bluetooth/hci.h : modify ACL_PTYPE_MASK zze-COLBUS Emmanuel RD-MAPS-GRE
2005-04-07 10:27 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox