Date: Mon, 21 Jan 2008 09:25:16 -0500 From: John Baldwin <jhb@freebsd.org> To: Sepherosa Ziehau <sephe@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 133706 for review Message-ID: <200801210927.07081.jhb@freebsd.org> In-Reply-To: <200801200422.m0K4MIA2037981@repoman.freebsd.org> References: <200801200422.m0K4MIA2037981@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801210927.07081.jhb>