> +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
signature.asc
Description: This is a digitally signed message part
_______________________________________________ ath5k-devel mailing list [email protected] https://lists.ath5k.org/mailman/listinfo/ath5k-devel
