From owner-p4-projects@FreeBSD.ORG Mon Jan 21 15:07:54 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 02A0016A419; Mon, 21 Jan 2008 15:07:54 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9853216A417 for ; Mon, 21 Jan 2008 15:07:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 84A8913C442 for ; Mon, 21 Jan 2008 15:07:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by elvis.mu.org (Postfix) with ESMTP id 243901A4D7C; Mon, 21 Jan 2008 07:04:10 -0800 (PST) From: John Baldwin To: Sepherosa Ziehau Date: Mon, 21 Jan 2008 09:25:16 -0500 User-Agent: KMail/1.9.7 References: <200801200422.m0K4MIA2037981@repoman.freebsd.org> In-Reply-To: <200801200422.m0K4MIA2037981@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801210927.07081.jhb@freebsd.org> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 133706 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2008 15:07:54 -0000 On Saturday 19 January 2008 11:22:18 pm Sepherosa Ziehau wrote: > http://perforce.freebsd.org/chv.cgi?CH=133706 > > Change 133706 by sephe@sephe_zealot:sam_wifi on 2008/01/20 04:21:47 > > Unbreak RELENG_7 ABI compat: > - Use {isr,isi}_ie_off as structure version > - Embed new capinfo immediately before {isr,isi}_ie_off > > Pointed out by: sam > > ==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.h#47 (text+ko) ==== > > @@ -358,8 +358,8 @@ > uint16_t isi_txseqs[IEEE80211_TID_SIZE];/* tx seq #/TID */ > uint16_t isi_rxseqs[IEEE80211_TID_SIZE];/* rx seq#/TID */ > uint16_t isi_inact; /* inactivity timer */ > - uint16_t isi_capinfo2; /* capabilities */ > /* XXX frag state? */ > + /* 2 bytes capinfo in host byte order */ > /* variable length IE data */ > }; > > @@ -538,7 +538,7 @@ > uint8_t isr_nrates; > uint8_t isr_rates[IEEE80211_RATE_MAXSIZE]; > uint8_t isr_ssid_len; /* SSID length */ > - uint16_t isr_capinfo2; /* capabilities */ > + /* 2 bytes capinfo in host byte order */ > /* variable length SSID followed by IE data */ > }; Normally this would be done by doing something like this: struct foo_v1 { /* old fields */ }; struct foo { /* old fields, but call isr_capinfo isr_capold (or possibly remove it in this case) */ uint16_t isr_capinfo; }; void handle_foo(...) { if (arg->offset == sizeof(struct foo_v1)) { /* convert foo_v1 to a foo or vice versa */ } } Having a comment to indicate a magic field is going to be prone to breakage in the future. -- John Baldwin