From owner-freebsd-bluetooth@FreeBSD.ORG Tue Mar 7 21:59:27 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 5923B16A420 for ; Tue, 7 Mar 2006 21:59:27 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from ismybrain.com (ismybrain.com [64.246.42.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 025A343D60 for ; Tue, 7 Mar 2006 21:59:26 +0000 (GMT) (envelope-from maksim.yevmenkin@savvis.net) Received: from [10.254.186.111] (localhost.localdomain [127.0.0.1]) by ismybrain.com (8.11.6/8.11.6) with ESMTP id k27LxHM29765; Tue, 7 Mar 2006 16:59:18 -0500 Message-ID: <440E0233.7080703@savvis.net> Date: Tue, 07 Mar 2006 13:59:15 -0800 From: Maksim Yevmenkin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050404) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Iain Hibbert References: <1141762244.118700.5588.nullmailer@galant.ukfsn.org> <440DEE78.5020500@savvis.net> <1141767948.252179.12317.nullmailer@galant.ukfsn.org> In-Reply-To: <1141767948.252179.12317.nullmailer@galant.ukfsn.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit 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: Tue, 07 Mar 2006 21:59:27 -0000 Iain Hibbert wrote: >>of course. i will take patches from anybody (as long as it conforms to >>style(9)) :) why do you even ask? :) > > Hey, maybe you are some kind of dragon? :) > > I just read this document though, and it seems that whitespace changes > alone are not encouraged.. however, I got rid of them already in my > porting, will see what other changes can be fed back.. sounds good > In other news, some of what I said a few weeks ago is changed now, I put > psm and channel into the sockaddr as it does look better than using > setsockopt() for that. However, it still looks slightly different: > > struct sockaddr_bt { > uint8_t bt_len; > sa_family_t bt_family; > bdaddr_t bt_bdaddr; > uint16_t bt_psm; > uint8_t bt_channel; > }; > > ..because I am still using a single sockaddr type for all bluetooth family > sockets. Protocols that dont use fields just ignore them, but if necessary > for compatibility a #define can easily be used. hmm.... i wonder if we can play "union { }" games here. basically, have struct sockaddr_bt { uint8_t bt_len; sa_family_t bt_family; union { uint8_t _placeholder[32]; struct { } _hci; struct { } _l2cap; struct { } _rfcomm; } bt_addr; }; then add appropriate #define's for shortcut access to the union fields. i can then change freebsd code to use single 'struct sockaddr_bt' as well. thanks, max