> TL>I don't think the original poster wanted cloning for support on
> TL>physical devices for which there was a 1:1 relationship anyway
> TL>(8^)), but there *are* cases where it could be useful.
> TL>
> TL>Actually, I think the original poster never really disclosed *what*
> TL>they wanted to use the feature for...
> That's true...
> From reading the original post I was under the impression that this is
> again a 'hey, I write a device driver and I need to track the number of
> opens and to tack a context onto each open' that periodically comes up.
> If I'm wrong, well, sorry then...

I'm sorry people :) I should have been more specific. Here is
what i meant. I'm working on Bluetooth stack for FreeBSD. Everything
is implemented in Netgraph. The real device driver nodes are connected
to HCI layer. You can talk to any Bluetooth device via HCI layer. It
does not really matter what kind of device you have, PC-CARD, serial
or USB dongle. They all MUST talk via HCI. So HCI is not really a
device driver, and, IMO, it is not a pseudo device driver. It sort
of looks like /dev/tcp :)

Currently there is a single "control" hook for every HCI node. Control
application connects to the hook and sends HCI commands and receives
HCI events. It does work, but once the hook is connected, nobody else
can connect to the same hook. That is a limitation, IMO. It would 
really be nice to have several control applications. For example,

- HCI dump  (a-la tcpdump)
- HCI link key/PIN manager (security)
My choices were:

1) Create /dev/hci[0-9]+ for every HCI node and implement cloning

   pid 1 -> /dev/hci0          -+-> hci0 node -> device driver node
   pid 2 -> /dev/hci0(clone 0) -+

   This will not work work.

2) Raw HCI sockets

   The problem here is how to identify device, i.e. what to put
   into sockaddr? Netgraph node name? May be not a good choice,
   because it can be changed at any time. Device BD_ADDR? Does not
   work also, because in order to get BD_ADDR you must send HCI
   command to the device.
3) Multiple "control/raw" Netgraph hooks

   I like it best for now. Each hook will have a filter and
   every message/data will be delivered to each hook if it has 
   not been filtered.

Anyway, i got answers i wanted. Thanks everyone.


Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to