From owner-freebsd-current Tue Jun 11 10:15: 0 2002 Delivered-To: freebsd-current@freebsd.org Received: from web13305.mail.yahoo.com (web13305.mail.yahoo.com [216.136.175.41]) by hub.freebsd.org (Postfix) with SMTP id 2BBD437B40B for ; Tue, 11 Jun 2002 10:14:54 -0700 (PDT) Message-ID: <20020611171448.77703.qmail@web13305.mail.yahoo.com> Received: from [206.220.224.4] by web13305.mail.yahoo.com via HTTP; Tue, 11 Jun 2002 10:14:48 PDT Date: Tue, 11 Jun 2002 10:14:48 -0700 (PDT) From: Maksim Yevmenkin Subject: Re: Device cloning To: Harti Brandt , Terry Lambert Cc: Maksim Yevmenkin , current@FreeBSD.ORG In-Reply-To: <20020611114039.L35453-100000@beagle.fokus.gmd.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hackers, [...] > 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. thanks, max __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message