From owner-freebsd-current Tue Jun 11 10:19:19 2002 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by hub.freebsd.org (Postfix) with ESMTP id D2C4F37B40B for ; Tue, 11 Jun 2002 10:19:11 -0700 (PDT) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.3/8.12.2) with ESMTP id g5BHHZV7052546; Tue, 11 Jun 2002 19:17:35 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Maksim Yevmenkin Cc: Harti Brandt , Terry Lambert , current@FreeBSD.ORG Subject: Re: Device cloning In-Reply-To: Your message of "Tue, 11 Jun 2002 10:14:48 PDT." <20020611171448.77703.qmail@web13305.mail.yahoo.com> Date: Tue, 11 Jun 2002 19:17:35 +0200 Message-ID: <52544.1023815855@critter.freebsd.dk> From: Poul-Henning Kamp 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 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