Commit b74f98b8 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Felix Fietkau

mt76: mt76x02: minor mt76x02_mac_set_beacon optimization

We do not call mt76x02_mac_set_beacon() with NULL skb any longer and
we do not need to return error value.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent c708bfa3
...@@ -51,21 +51,15 @@ mt76x02_write_beacon(struct mt76x02_dev *dev, int offset, struct sk_buff *skb) ...@@ -51,21 +51,15 @@ mt76x02_write_beacon(struct mt76x02_dev *dev, int offset, struct sk_buff *skb)
return 0; return 0;
} }
int mt76x02_mac_set_beacon(struct mt76x02_dev *dev, void mt76x02_mac_set_beacon(struct mt76x02_dev *dev,
struct sk_buff *skb) struct sk_buff *skb)
{ {
int bcn_len = dev->beacon_ops->slot_size; int bcn_len = dev->beacon_ops->slot_size;
int bcn_addr = MT_BEACON_BASE + (bcn_len * dev->beacon_data_count); int bcn_addr = MT_BEACON_BASE + (bcn_len * dev->beacon_data_count);
int ret = 0;
if (skb) {
ret = mt76x02_write_beacon(dev, bcn_addr, skb);
if (!ret)
dev->beacon_data_count++;
}
if (!mt76x02_write_beacon(dev, bcn_addr, skb))
dev->beacon_data_count++;
dev_kfree_skb(skb); dev_kfree_skb(skb);
return ret;
} }
EXPORT_SYMBOL_GPL(mt76x02_mac_set_beacon); EXPORT_SYMBOL_GPL(mt76x02_mac_set_beacon);
......
...@@ -201,7 +201,7 @@ void mt76x02_mac_work(struct work_struct *work); ...@@ -201,7 +201,7 @@ void mt76x02_mac_work(struct work_struct *work);
void mt76x02_mac_cc_reset(struct mt76x02_dev *dev); void mt76x02_mac_cc_reset(struct mt76x02_dev *dev);
void mt76x02_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr); void mt76x02_mac_set_bssid(struct mt76x02_dev *dev, u8 idx, const u8 *addr);
int mt76x02_mac_set_beacon(struct mt76x02_dev *dev, struct sk_buff *skb); void mt76x02_mac_set_beacon(struct mt76x02_dev *dev, struct sk_buff *skb);
void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev, void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev,
struct ieee80211_vif *vif, bool enable); struct ieee80211_vif *vif, bool enable);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment