From: Johan Hedberg <johan.hedberg@gmail.com>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 07/15] Bluetooth: Merge device class into the EIR data in mgmt_ev_device_found
Date: Wed, 18 Jan 2012 22:58:47 +0200 [thread overview]
Message-ID: <20120118205847.GA29068@fusion.localdomain> (raw)
In-Reply-To: <CAJdJm_P5Q6sEk_f93YyxPv8UoHX1m3L5MWaP6upyKzFvsUR40w@mail.gmail.com>
Hi Lizardo,
On Wed, Jan 18, 2012, Anderson Lizardo wrote:
> >> On Wed, Jan 18, 2012 at 2:51 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> >> > +static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data,
> >> > + u16 data_len)
> >> > +{
> >> > + eir[eir_len++] = sizeof(type) + data_len;
> >>
> >> Isn't it better to have data_len as u8? It is impossible for a EIR or
> >> AD entry to have more than 255 octets (given the length field is one
> >> octet).
> >
> > Since we've taken up the habit of appending items to the data (such as
> > the device class) before passing it on to user space we thought it'd be
> > more future proof to use two octets. The mgmt messages use two octets as
> > well. I was also initially of the opinion that one should be enough but
> > Marcel convinced me that two is better since we're living very close to
> > the limit and would have to break the API if at any point in the future
> > we suddenly need more space.
>
> While for mgmt it is ok to use two octets (I was aware of this
> rationale), I was referring more specifically to the snippet above,
> where you copy a u16 value to a u8 eir[] entry.
>
> While you can append many EIR fields (and thus have a local EIR blob
> with total size greater than you would normally send over the air),
> each EIR field you append is still limited to 255 bytes as per spec.
> This means it is okay on the function above to "eir_len" be u16, but I
> think "data_len" is not.
Yes, you're completely right (and I should have paid more attention to
what exactly you were referring to). I'll fix it.
Johan
next prev parent reply other threads:[~2012-01-18 20:58 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-18 18:51 [PATCH 0/15] Bluetooth: Update to latest mgmt API Johan Hedberg
2012-01-18 18:51 ` [PATCH 01/15] Bluetooth: Fix clearing persistent flags Johan Hedberg
2012-01-18 19:02 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 02/15] Bluetooth: Rename mgmt connected events to match user space Johan Hedberg
2012-01-18 19:03 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 03/15] Bluetooth: Add eir_len parameter to mgmt_ev_device_found Johan Hedberg
2012-01-18 19:04 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 04/15] Bluetooth: Rename eir_has_complete_name to eir_has_data_type Johan Hedberg
2012-01-18 19:05 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 05/15] Bluetooth: Add missing EIR defines to hci.h Johan Hedberg
2012-01-18 19:05 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 06/15] Bluetooth: Move eir_has_data_field to hci_core.h Johan Hedberg
2012-01-18 19:06 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 07/15] Bluetooth: Merge device class into the EIR data in mgmt_ev_device_found Johan Hedberg
2012-01-18 19:08 ` Marcel Holtmann
2012-01-18 19:18 ` Anderson Lizardo
2012-01-18 20:29 ` Johan Hedberg
2012-01-18 20:40 ` Anderson Lizardo
2012-01-18 20:58 ` Johan Hedberg [this message]
2012-01-19 9:26 ` Andrei Emeltchenko
2012-01-18 18:51 ` [PATCH 08/15] Bluetooth: Rename conn->pend to conn->flags Johan Hedberg
2012-01-18 19:12 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 09/15] Bluetooth: Merge boolean members of struct hci_conn into flags Johan Hedberg
2012-01-18 19:12 ` Marcel Holtmann
2012-01-18 19:25 ` Johan Hedberg
2012-01-18 19:31 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 10/15] Bluetooth: Add a convenience function to check for SSP enabled Johan Hedberg
2012-01-18 19:14 ` Marcel Holtmann
2012-01-19 9:30 ` Andrei Emeltchenko
2012-01-19 9:39 ` Johan Hedberg
2012-01-18 18:51 ` [PATCH 11/15] Bluetooth: Convert hdev->ssp_mode to a flag Johan Hedberg
2012-01-18 19:14 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 12/15] Bluetooth: Convert hdev->out to a bool type Johan Hedberg
2012-01-18 19:15 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 13/15] Bluetooth: Update device_connected and device_found events to latest API Johan Hedberg
2012-01-18 19:17 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 14/15] Bluetooth: Rename hdev->flags to hdev->compat_flags Johan Hedberg
2012-01-18 19:18 ` Marcel Holtmann
2012-01-18 18:51 ` [PATCH 15/15] Bluetooth: Rename hdev->dev_flags to hdev-flags Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120118205847.GA29068@fusion.localdomain \
--to=johan.hedberg@gmail.com \
--cc=anderson.lizardo@openbossa.org \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.