Return-path: Received: from main.gmane.org ([80.91.229.2]:34896 "EHLO ciao.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502AbXLISfG (ORCPT ); Sun, 9 Dec 2007 13:35:06 -0500 Received: from public by ciao.gmane.org with local (Exim 4.43) id 1J1QzJ-000738-8W for linux-wireless@vger.kernel.org; Sun, 09 Dec 2007 18:34:49 +0000 Message-ID: <475C3538.1070501@gmail.com> (sfid-20071209_183512_285697_129CC7E7) Date: Sun, 09 Dec 2007 18:34:32 +0000 MIME-Version: 1.0 To: Dan Williams CC: David Miller , public-linville-2XuSBdqkA4R54TAoqtyWWQ@ciao.gmane.org, public-linux-wireless-u79uwXL29TY76Z2rM5mHXA@ciao.gmane.org, public-jt-sDzT885Ts8HQT0dZR+AlfA@ciao.gmane.org Subject: Re: [PATCH] introduce WEXT scan capabilities References: <1197073366.4563.15.camel@localhost.localdomain> <20071207.181221.09900510.davem@davemloft.net> <1197221467.9149.31.camel@localhost.localdomain> In-Reply-To: <1197221467.9149.31.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1 From: Dave Sender: linux-wireless-owner@vger.kernel.org List-ID: Dan Williams wrote: > On Fri, 2007-12-07 at 18:12 -0800, David Miller wrote: >> From: Dan Williams >> Date: Fri, 07 Dec 2007 19:22:46 -0500 >> >>> @@ -1040,6 +1049,16 @@ struct iw_range >>> * because each entry contain its channel index */ >>> >>> __u32 enc_capa; /* IW_ENC_CAPA_* bit field */ >>> + >>> + /* Do *NOT* use those fields, they are just used as padding to get >>> + * proper alignement with user space */ >>> + __s32 reserved1; >>> + __s32 reserved2; >>> + __u16 reserved3; >>> + __s32 reserved4; >>> + __u32 reserved5; >>> + >>> + __u32 scan_capa; /* IW_SCAN_CAPA_* bit field */ >>> }; >>> >>> /* >> Major NACK. These datastructure usages are complete wrong, and >> we have to stop spreading this problem instead of continuing on >> with it as if it's OK. > > There's not too much we can do here. We need a better way to support > driver/card capabilities in WEXT right _now_, in parallel with > cfg80211/nl80211. The other alternative here is to have a 64-bit > generic capabilities field-to-end-all-fields and add more bitfield > position constants to that without extending the structure any more. > > Is there a better way you'd propose to do this _in_WEXT_? Since iw_range is not packed, there are a few locations where there is some padding. You could quite easily shoehorn an 8 bit bitmask into the existing structure without impacting backward compatibility (unless userspace is using the padding for something). For example: --- a/include/linux/wireless.h +++ b/include/linux/wireless.h @@ -1035,6 +1035,7 @@ struct iw_range /* Frequency */ __u16 num_channels; /* Number of channels [0; num - 1] */ __u8 num_frequency; /* Number of entry in the list */ + __u8 scan_capa; /* scan capabilities */ struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */ /* Note : this frequency list doesn't need to fit channel numbers, * because each entry contain its channel index */ Other candidate blocks are Old Frequency, Rates, Encoder stuff, Transmit power. Dave. > I don't really forsee any more extending of this structure, since I > think scan capabilities are the last thing we really need to know about.