Date: Tue, 11 Jun 2002 19:17:35 +0200 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Maksim Yevmenkin <m_evmenkin@yahoo.com> Cc: Harti Brandt <brandt@fokus.gmd.de>, Terry Lambert <tlambert2@mindspring.com>, current@FreeBSD.ORG Subject: Re: Device cloning Message-ID: <52544.1023815855@critter.freebsd.dk> In-Reply-To: Your message of "Tue, 11 Jun 2002 10:14:48 PDT." <20020611171448.77703.qmail@web13305.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20020611171448.77703.qmail@web13305.mail.yahoo.com>, Maksim Yevmenk in writes: >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 :) That's called a "protocol family" in BSD and you access it using sockets. Based on what little I know about "Blåtand" it will be much easier to work with as a socket than as a /dev/bla entry. >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, This is exactly the kind of semantics sockets offer you. >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. Well, many TCP clients don't care about the name, so they ask for INADDR_ANY and get whatever the kernel feels like giving them, you could do the same and have the kernel hand out random numbers. In fact, you don't actually have to call bind(2) at all, you can just call socket(2) and run with the result... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52544.1023815855>