PERFORCE change 133706 for review

John Baldwin jhb at freebsd.org
Mon Jan 21 07:07:54 PST 2008


On Saturday 19 January 2008 11:22:18 pm Sepherosa Ziehau wrote:
> http://perforce.freebsd.org/chv.cgi?CH=133706
> 
> Change 133706 by sephe at 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


More information about the p4-projects mailing list