d->d_data_dur = data_dur + IEEE80211_DUR_DS_SIFS + 2 * (IEEE80211_DUR_DS_SHORT_PREAMBLE + IEEE80211_DUR_DS_FAST_PLCPHDR) + ack;
ieee80211_compute_duration1(int len, uint32_t flags, int rate,    struct ieee80211_duration *d){	int ack, bitlen, cts, data_dur, remainder;	/* RTS reserves medium for SIFS | CTS | SIFS | (DATA) | SIFS | ACK	 * DATA reserves medium for SIFS | ACK	 */	bitlen = len * 8;#if 0	/* RTS is always sent at 1 Mb/s.  (XXX Really?) */	d->d_rts_plcp_len = sizeof(struct ieee80211_frame_rts) * 8;#endif	d->d_plcp_svc = 0;	switch (rate) {	case 2:		/* 1 Mb/s */	case 4:		/* 2 Mb/s */		data_dur = (bitlen * 2) / rate;		/* 1 - 2 Mb/s WLAN: send ACK/CTS at 1 Mb/s */		cts = IEEE80211_DUR_DS_SLOW_CTS;		ack = IEEE80211_DUR_DS_SLOW_ACK;		break;	case 44:	/* 22  Mb/s */		d->d_plcp_svc = IEEE80211_PLCP_SERVICE_PBCC;		/*FALLTHROUGH*/	case 11:	/* 5.5 Mb/s */	case 22:	/* 11  Mb/s */		remainder = (bitlen * 2) % rate;		if (remainder != 0)			data_dur = (bitlen * 2) / rate + 1;		else			data_dur = (bitlen * 2) / rate;		if (rate == 22 && remainder <= 6)			d->d_plcp_svc |= IEEE80211_PLCP_SERVICE_LENEXT;		/* 5.5 - 11 Mb/s WLAN: send ACK/CTS at 2 Mb/s */		cts = IEEE80211_DUR_DS_FAST_CTS;		ack = IEEE80211_DUR_DS_FAST_ACK;		break;	default:		/* TBD */		return -1;	}	d->d_rts_dur = data_dur + 3 * (IEEE80211_DUR_DS_SIFS +	    IEEE80211_DUR_DS_SHORT_PREAMBLE +	    IEEE80211_DUR_DS_FAST_PLCPHDR) + cts + ack;	d->d_data_dur = data_dur + IEEE80211_DUR_DS_SIFS +	    2 * (IEEE80211_DUR_DS_SHORT_PREAMBLE +	         IEEE80211_DUR_DS_FAST_PLCPHDR) + ack;	d->d_plcp_len = data_dur;	if ((flags & IEEE80211_F_SHPREAMBLE) != 0)		return 0;	d->d_rts_dur += 3 * (IEEE80211_DUR_DS_LONG_PREAMBLE -			     IEEE80211_DUR_DS_SHORT_PREAMBLE) +			3 * (IEEE80211_DUR_DS_SLOW_PLCPHDR -			     IEEE80211_DUR_DS_FAST_PLCPHDR);	d->d_data_dur += 2 * (IEEE80211_DUR_DS_LONG_PREAMBLE -			      IEEE80211_DUR_DS_SHORT_PREAMBLE) +			 2 * (IEEE80211_DUR_DS_SLOW_PLCPHDR -			      IEEE80211_DUR_DS_FAST_PLCPHDR);	return 0;}