From owner-freebsd-bluetooth@FreeBSD.ORG Fri Mar 10 08:57:34 2006 Return-Path: X-Original-To: freebsd-bluetooth@freebsd.org Delivered-To: freebsd-bluetooth@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FA2D16A420 for ; Fri, 10 Mar 2006 08:57:34 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: from mail12.svc.cra.dublin.eircom.net (mail12.svc.cra.dublin.eircom.net [159.134.118.28]) by mx1.FreeBSD.org (Postfix) with SMTP id 687D243D45 for ; Fri, 10 Mar 2006 08:57:32 +0000 (GMT) (envelope-from plunky@rya-online.net) Received: (qmail 240 messnum 5765006 invoked from network[83.70.176.191/unknown]); 10 Mar 2006 08:57:30 -0000 Received: from unknown (HELO rya-online.net) (83.70.176.191) by mail12.svc.cra.dublin.eircom.net (qp 240) with SMTP; 10 Mar 2006 08:57:30 -0000 Received: (nullmailer pid 427 invoked by uid 1000); Fri, 10 Mar 2006 08:43:26 -0000 Date: Fri, 10 Mar 2006 08:43:26 +0000 (GMT) To: Maksim Yevmenkin In-Reply-To: <44107C19.6050302@savvis.net> References: <1141762244.118700.5588.nullmailer@galant.ukfsn.org> <440DEE78.5020500@savvis.net> <1141767948.252179.12317.nullmailer@galant.ukfsn.org> <440E0233.7080703@savvis.net> <1141775918.215241.15084.nullmailer@galant.ukfsn.org> <440E2D3F.6040800@savvis.net> <1141807931.899207.8150.nullmailer@galant.ukfsn.org> <44107C19.6050302@savvis.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Message-Id: <1141980206.657073.302.nullmailer@galant.ukfsn.org> From: Iain Hibbert Cc: freebsd-bluetooth@freebsd.org Subject: Re: whitespace X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Mar 2006 08:57:34 -0000 On Thu, 9 Mar 2006, Maksim Yevmenkin wrote: > Iain Hibbert wrote: > well, i still do not understand why you insist on flat sockaddr_bt structure. Well, I still dont understand why it was created differently :) > sockaddr_* structures exist for a reason. we do not lump together, say, > sockaddr_in and sockaddr_ipx. those are different protocols are the fact that > both can be run over ethernet does not require us to lump them. Ok, we dont have sockaddr_ipx and I'm not sure what that is, but if you look at sockaddr_in and sockaddr_in6 they are different for a reason, because the addresses are different. But now, because they are different, they have a different sa_family type (AF_INET and AF_INET6) and when you look at the sockaddr you can tell which it is. It just makes no sense to me to have different structures with the same tag and there be no way to tell the difference. In my stack when you open an RFCOMM socket, it uses the sockaddr to open the L2CAP channel. When incoming connections are detected, the sockaddr is only created once, it just gets passed up. Actually, I can see a partial reason to have the HCI_RAW socket address different, in that bluetooth devices have no address available until they are up and running. I handled the device initiation in kernel and didnt notice that until recently. I am going to see what the netbsd opinion on this is, I can't claim to be an expert in these matters, heh.. > > then it should 'just work' on psm 0x1007, no? > > well, not really, imo. the first element is protocol uuid, not psm. i think, > you would have to add protocol specific parameter to l2cap protocol that tells > which psm to use to get access to the higher level protocol (i.e. rfcomm). in > other words > > Protocol Descriptor List: > L2CAP (0x0100) > Protocol specific parameter #1: u/int16 0x1007 -- l2cap psm for rfcomm > RFCOMM (0x0003) > Protocol specific parameter #1: u/int8/bool 1 -- rfcomm channel > > i have never seen anything like this, and i'm not sure if this will even work > with other stacks. Ah, thanks.. I see what they are saying now. I misinterpreted it because they have used the PSM as UUID. The example actually is: ((L2CAP, PSM=0x1001), (RFCOMM, CN=1), (Obex), (vCal)) ((L2CAP, PSM=0x1002), (RFCOMM, CN=1), (Obex), (Other)) which is as you said, but imho that should just work. Actually, to make that work was quite simple I think all I did in effect was to change the session lookup routine to ignore different psm values, and also set the psm to L2CAP_PSM_RFCOMM if it was unset. iain