mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 21:36:52 +00:00
Use shared mt76x02 utility routines for rssi tracking. Moreover remove no longer used con_mon_lock spinlock and following variable: - ap_bssid - bcn_freq_off - bcn_phy_mode - avg_rssi Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
64 lines
1.8 KiB
C
64 lines
1.8 KiB
C
/*
|
|
* Copyright (C) 2014 Felix Fietkau <[email protected]>
|
|
* Copyright (C) 2015 Jakub Kicinski <[email protected]>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2
|
|
* as published by the Free Software Foundation
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#include "mt76x0.h"
|
|
#include "trace.h"
|
|
#include "../mt76x02_util.h"
|
|
#include "../mt76x02_usb.h"
|
|
|
|
void mt76x0_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
|
|
struct sk_buff *skb)
|
|
{
|
|
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
|
struct mt76x0_dev *dev = hw->priv;
|
|
struct ieee80211_vif *vif = info->control.vif;
|
|
struct mt76_wcid *wcid = &dev->mt76.global_wcid;
|
|
|
|
if (control->sta) {
|
|
struct mt76x02_sta *msta;
|
|
|
|
msta = (struct mt76x02_sta *)control->sta->drv_priv;
|
|
wcid = &msta->wcid;
|
|
/* sw encrypted frames */
|
|
if (!info->control.hw_key && wcid->hw_key_idx != 0xff)
|
|
control->sta = NULL;
|
|
}
|
|
|
|
if (vif && !control->sta) {
|
|
struct mt76x02_vif *mvif;
|
|
|
|
mvif = (struct mt76x02_vif *)vif->drv_priv;
|
|
wcid = &mvif->group_wcid;
|
|
}
|
|
|
|
mt76_tx(&dev->mt76, control->sta, wcid, skb);
|
|
}
|
|
EXPORT_SYMBOL_GPL(mt76x0_tx);
|
|
|
|
void mt76x0_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
|
|
struct sk_buff *skb)
|
|
{
|
|
struct mt76x0_dev *dev = container_of(mdev, struct mt76x0_dev, mt76);
|
|
void *rxwi = skb->data;
|
|
|
|
skb_pull(skb, sizeof(struct mt76x02_rxwi));
|
|
if (mt76x0_mac_process_rx(dev, skb, rxwi)) {
|
|
dev_kfree_skb(skb);
|
|
return;
|
|
}
|
|
|
|
mt76_rx(&dev->mt76, q, skb);
|
|
}
|
|
EXPORT_SYMBOL_GPL(mt76x0_queue_rx_skb);
|