Re: [PATCH 07/15] Bluetooth: Merge device class into the EIR data in mgmt_ev_device_found

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

 



Hi Lizardo,

On Wed, Jan 18, 2012, Anderson Lizardo wrote:
> Hi Johan,
> 
> On Wed, Jan 18, 2012 at 2:51 PM, Johan Hedberg <johan.hedberg@xxxxxxxxx> 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.

Johan
--
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