From: Peter Dons Tychsen <donpedro@tdcadsl.dk>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: HCI_MAX_DEV is a bit too small.
Date: Sun, 21 Mar 2010 23:26:25 +0100 [thread overview]
Message-ID: <1269210385.19939.15.camel@donpedro> (raw)
In-Reply-To: <1268619078.6278.10.camel@donpedro>
Hello again,
> > So I could be convinced to add new functions to read/write the limit
> > from within an application itself. So that it can be changed without
> > re-compiling the library. Feel free to propose a patch.
> I will see what i can do. What is needed is probably a
> hci_set_max_devices() call. Then hcitool could call that with the number
> of devices needed.
After some time looking at it more closely, i can see that the real
problem is not in hcilib, but in the stack itself. The real problem is
that there is no way of getting the actual number of devices with
reading out all of them... and thereby allocating space for MAX devices
(which could be endless). Chicken and Egg situation. What is really
needed is an ioctl to get the current count. This could be done by:
a) A new IOCTL called HCIGETDEVCOUNT that returns the device count.
or
b) Modifying HCIGETDEVLIST to return the device count (dev_num) if the
input count (dev_num) is zero (without actually returning the devices).
This would be backward compatible, as zero is not a valid input today.
Is any of this acceptable? Please advise what solutions could be
acceptable.
This would allow for hci_for_each_dev (and in turn the stack via IOCTL)
to use less resources, and to support more devices. This could deprecate
the need for MAX_HCI_DEV altogether, as it is not used anywhere else in
the lib. There is of-course allot of other software using that constant,
but maybe removing it over time would be good. It gives the user of the
lib a false idea of a non-existing limitation.
Thanks,
/Pedro
prev parent reply other threads:[~2010-03-21 22:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-14 23:20 HCI_MAX_DEV is a bit too small Peter Dons Tychsen
2010-03-14 23:34 ` Marcel Holtmann
2010-03-15 2:11 ` Peter Dons Tychsen
2010-03-15 8:34 ` Iain Hibbert
2010-03-21 22:26 ` Peter Dons Tychsen [this message]
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=1269210385.19939.15.camel@donpedro \
--to=donpedro@tdcadsl.dk \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox