Search Linux Wireless

Re: [PATCH 3/3] mac80211: enable IBSS merging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +static inline int ieee80211_get_bitrate(struct wiphy *phy,
> +					enum ieee80211_band band, int rate_idx)
> +{
> +	struct ieee80211_supported_band *sband;
> +	if (band > 0 && band < IEEE80211_NUM_BANDS) {
> +		sband = phy->bands[band];
> +		if (rate_idx > 0 && rate_idx < sband->n_bitrates)
> +			return sband->bitrates[rate_idx].bitrate;
> +	}
> +	return 0;
> +}

You don't need to do this. In the rx info (struct ieee80211_txrx_data
rx) we already have the bitrate info available (rx->u.rx.rate), you
might not have access to it but __ieee80211_rx() refuses packets with an
invalid rate or band. Hence, you can leave out *all* the sanity checks
and just do

phy->bands[band]->bitrates[rate_idx]

which doesn't need an inline function.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux