示例#1
0
/*
 * For Decrypt or Demic errors, we only mark packet status here and always push
 * up the frame up to let mac80211 handle the actual error case, be it no
 * decryption key or real decryption error. This let us keep statistics there.
 */
int ath9k_cmn_rx_skb_preprocess(struct ath_common *common,
                                struct ieee80211_hw *hw,
                                struct sk_buff *skb,
                                struct ath_rx_status *rx_stats,
                                struct ieee80211_rx_status *rx_status,
                                bool *decrypt_error)
{
    struct ath_hw *ah = common->ah;

    memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
    if (!ath9k_rx_accept(common, skb, rx_status, rx_stats, decrypt_error))
        return -EINVAL;

    ath9k_process_rssi(common, hw, skb, rx_stats);

    rx_status->rate_idx = ath9k_process_rate(common, hw,
                          rx_stats, rx_status, skb);
    rx_status->mactime = ath9k_hw_extend_tsf(ah, rx_stats->rs_tstamp);
    rx_status->band = hw->conf.channel->band;
    rx_status->freq = hw->conf.channel->center_freq;
    rx_status->noise = common->ani.noise_floor;
    rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
    rx_status->antenna = rx_stats->rs_antenna;
    rx_status->flag |= RX_FLAG_TSFT;

    return 0;
}
int ath9k_cmn_rx_skb_preprocess(struct ath_common *common,
				struct ieee80211_hw *hw,
				struct sk_buff *skb,
				struct ath_rx_status *rx_stats,
				struct ieee80211_rx_status *rx_status,
				bool *decrypt_error)
{
	struct ath_hw *ah = common->ah;

	memset(rx_status, 0, sizeof(struct ieee80211_rx_status));

	/*
	 * everything but the rate is checked here, the rate check is done
	 * separately to avoid doing two lookups for a rate for each frame.
	 */
	if (!ath9k_rx_accept(common, skb, rx_status, rx_stats, decrypt_error))
		return -EINVAL;

	ath9k_process_rssi(common, hw, skb, rx_stats);

	if (ath9k_process_rate(common, hw, rx_stats, rx_status, skb))
		return -EINVAL;

	rx_status->mactime = ath9k_hw_extend_tsf(ah, rx_stats->rs_tstamp);
	rx_status->band = hw->conf.channel->band;
	rx_status->freq = hw->conf.channel->center_freq;
	rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
	rx_status->antenna = rx_stats->rs_antenna;
	rx_status->flag |= RX_FLAG_TSFT;

	return 0;
}