mt76x0: rename mt76_* functions

mt76_* functions conflicts with mt7601u driver what prevents to build
those drivers in the kernel or use both drivers modules at once.

Patch fixes build errors like this:
ld: drivers/net/wireless/mediatek/mt76/mt76x0/mac.o:(.opd+0x30): multiple definition of `mt76_mac_tx_rate_val'; drivers/net/wireless/mediatek/mt7601u/mac.o:(.opd+0x30): first defined here

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 7b4859026c ("mt76x0: core files")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
Stanislaw Gruszka 2018-08-03 13:44:39 +02:00 committed by Kalle Valo
parent 28b9188483
commit 909da6e4b5
7 changed files with 26 additions and 26 deletions

View File

@ -44,7 +44,7 @@ mt76x0_rx_skb_from_seg(struct mt76x0_dev *dev, struct mt76x0_rxwi *rxwi,
if (!skb) if (!skb)
return NULL; return NULL;
true_len = mt76_mac_process_rx(dev, skb, data, rxwi); true_len = mt76x0_mac_process_rx(dev, skb, data, rxwi);
if (!true_len || true_len > seg_len) if (!true_len || true_len > seg_len)
goto bad_frame; goto bad_frame;

View File

@ -116,7 +116,7 @@ mt76_mac_fill_tx_status(struct mt76x0_dev *dev, struct ieee80211_tx_info *info,
info->flags |= IEEE80211_TX_STAT_ACK; info->flags |= IEEE80211_TX_STAT_ACK;
} }
u16 mt76_mac_tx_rate_val(struct mt76x0_dev *dev, u16 mt76x0_mac_tx_rate_val(struct mt76x0_dev *dev,
const struct ieee80211_tx_rate *rate, u8 *nss_val) const struct ieee80211_tx_rate *rate, u8 *nss_val)
{ {
u16 rateval; u16 rateval;
@ -166,13 +166,13 @@ u16 mt76_mac_tx_rate_val(struct mt76x0_dev *dev,
return cpu_to_le16(rateval); return cpu_to_le16(rateval);
} }
void mt76_mac_wcid_set_rate(struct mt76x0_dev *dev, struct mt76_wcid *wcid, void mt76x0_mac_wcid_set_rate(struct mt76x0_dev *dev, struct mt76_wcid *wcid,
const struct ieee80211_tx_rate *rate) const struct ieee80211_tx_rate *rate)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&dev->mt76.lock, flags); spin_lock_irqsave(&dev->mt76.lock, flags);
wcid->tx_rate = mt76_mac_tx_rate_val(dev, rate, &wcid->tx_rate_nss); wcid->tx_rate = mt76x0_mac_tx_rate_val(dev, rate, &wcid->tx_rate_nss);
wcid->tx_rate_set = true; wcid->tx_rate_set = true;
spin_unlock_irqrestore(&dev->mt76.lock, flags); spin_unlock_irqrestore(&dev->mt76.lock, flags);
} }
@ -198,7 +198,7 @@ struct mt76_tx_status mt76x0_mac_fetch_tx_status(struct mt76x0_dev *dev)
return stat; return stat;
} }
void mt76_send_tx_status(struct mt76x0_dev *dev, struct mt76_tx_status *stat, u8 *update) void mt76x0_send_tx_status(struct mt76x0_dev *dev, struct mt76_tx_status *stat, u8 *update)
{ {
struct ieee80211_tx_info info = {}; struct ieee80211_tx_info info = {};
struct ieee80211_sta *sta = NULL; struct ieee80211_sta *sta = NULL;
@ -527,7 +527,7 @@ mt76x0_rx_is_our_beacon(struct mt76x0_dev *dev, u8 *data)
ether_addr_equal(hdr->addr2, dev->ap_bssid); ether_addr_equal(hdr->addr2, dev->ap_bssid);
} }
u32 mt76_mac_process_rx(struct mt76x0_dev *dev, struct sk_buff *skb, u32 mt76x0_mac_process_rx(struct mt76x0_dev *dev, struct sk_buff *skb,
u8 *data, void *rxi) u8 *data, void *rxi)
{ {
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
@ -594,7 +594,7 @@ mt76_mac_get_key_info(struct ieee80211_key_conf *key, u8 *key_data)
} }
} }
int mt76_mac_wcid_set_key(struct mt76x0_dev *dev, u8 idx, int mt76x0_mac_wcid_set_key(struct mt76x0_dev *dev, u8 idx,
struct ieee80211_key_conf *key) struct ieee80211_key_conf *key)
{ {
enum mt76_cipher_type cipher; enum mt76_cipher_type cipher;
@ -635,7 +635,7 @@ int mt76_mac_wcid_set_key(struct mt76x0_dev *dev, u8 idx,
return 0; return 0;
} }
int mt76_mac_shared_key_setup(struct mt76x0_dev *dev, u8 vif_idx, u8 key_idx, int mt76x0_mac_shared_key_setup(struct mt76x0_dev *dev, u8 vif_idx, u8 key_idx,
struct ieee80211_key_conf *key) struct ieee80211_key_conf *key)
{ {
enum mt76_cipher_type cipher; enum mt76_cipher_type cipher;

View File

@ -136,19 +136,19 @@ struct mt76_txwi {
#define MT_TXWI_PKTID_PROBE BIT(7) #define MT_TXWI_PKTID_PROBE BIT(7)
u32 mt76_mac_process_rx(struct mt76x0_dev *dev, struct sk_buff *skb, u32 mt76x0_mac_process_rx(struct mt76x0_dev *dev, struct sk_buff *skb,
u8 *data, void *rxi); u8 *data, void *rxi);
int mt76_mac_wcid_set_key(struct mt76x0_dev *dev, u8 idx, int mt76x0_mac_wcid_set_key(struct mt76x0_dev *dev, u8 idx,
struct ieee80211_key_conf *key); struct ieee80211_key_conf *key);
void mt76_mac_wcid_set_rate(struct mt76x0_dev *dev, struct mt76_wcid *wcid, void mt76x0_mac_wcid_set_rate(struct mt76x0_dev *dev, struct mt76_wcid *wcid,
const struct ieee80211_tx_rate *rate); const struct ieee80211_tx_rate *rate);
int mt76_mac_shared_key_setup(struct mt76x0_dev *dev, u8 vif_idx, u8 key_idx, int mt76x0_mac_shared_key_setup(struct mt76x0_dev *dev, u8 vif_idx, u8 key_idx,
struct ieee80211_key_conf *key); struct ieee80211_key_conf *key);
u16 mt76_mac_tx_rate_val(struct mt76x0_dev *dev, u16 mt76x0_mac_tx_rate_val(struct mt76x0_dev *dev,
const struct ieee80211_tx_rate *rate, u8 *nss_val); const struct ieee80211_tx_rate *rate, u8 *nss_val);
struct mt76_tx_status struct mt76_tx_status
mt76x0_mac_fetch_tx_status(struct mt76x0_dev *dev); mt76x0_mac_fetch_tx_status(struct mt76x0_dev *dev);
void mt76_send_tx_status(struct mt76x0_dev *dev, struct mt76_tx_status *stat, u8 *update); void mt76x0_send_tx_status(struct mt76x0_dev *dev, struct mt76_tx_status *stat, u8 *update);
#endif #endif

View File

@ -300,15 +300,15 @@ mt76x0_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
if (!msta) { if (!msta) {
if (key || wcid->hw_key_idx == idx) { if (key || wcid->hw_key_idx == idx) {
ret = mt76_mac_wcid_set_key(dev, wcid->idx, key); ret = mt76x0_mac_wcid_set_key(dev, wcid->idx, key);
if (ret) if (ret)
return ret; return ret;
} }
return mt76_mac_shared_key_setup(dev, mvif->idx, idx, key); return mt76x0_mac_shared_key_setup(dev, mvif->idx, idx, key);
} }
return mt76_mac_wcid_set_key(dev, msta->wcid.idx, key); return mt76x0_mac_wcid_set_key(dev, msta->wcid.idx, key);
} }
static int mt76x0_set_rts_threshold(struct ieee80211_hw *hw, u32 value) static int mt76x0_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
@ -375,7 +375,7 @@ mt76_sta_rate_tbl_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
rate.idx = rates->rate[0].idx; rate.idx = rates->rate[0].idx;
rate.flags = rates->rate[0].flags; rate.flags = rates->rate[0].flags;
mt76_mac_wcid_set_rate(dev, &msta->wcid, &rate); mt76x0_mac_wcid_set_rate(dev, &msta->wcid, &rate);
out: out:
rcu_read_unlock(); rcu_read_unlock();

View File

@ -324,8 +324,8 @@ void mt76x0_tx_status(struct mt76x0_dev *dev, struct sk_buff *skb);
void mt76x0_tx_stat(struct work_struct *work); void mt76x0_tx_stat(struct work_struct *work);
/* util */ /* util */
void mt76_remove_hdr_pad(struct sk_buff *skb); void mt76x0_remove_hdr_pad(struct sk_buff *skb);
int mt76_insert_hdr_pad(struct sk_buff *skb); int mt76x0_insert_hdr_pad(struct sk_buff *skb);
int mt76x0_dma_init(struct mt76x0_dev *dev); int mt76x0_dma_init(struct mt76x0_dev *dev);
void mt76x0_dma_cleanup(struct mt76x0_dev *dev); void mt76x0_dma_cleanup(struct mt76x0_dev *dev);

View File

@ -35,7 +35,7 @@ static void mt76x0_tx_skb_remove_dma_overhead(struct sk_buff *skb,
skb_pull(skb, sizeof(struct mt76_txwi) + 4); skb_pull(skb, sizeof(struct mt76_txwi) + 4);
if (ieee80211_get_hdrlen_from_skb(skb) % 4) if (ieee80211_get_hdrlen_from_skb(skb) % 4)
mt76_remove_hdr_pad(skb); mt76x0_remove_hdr_pad(skb);
skb_trim(skb, pkt_len); skb_trim(skb, pkt_len);
} }
@ -93,7 +93,7 @@ mt76x0_push_txwi(struct mt76x0_dev *dev, struct sk_buff *skb,
rate_ctl = wcid->tx_rate; rate_ctl = wcid->tx_rate;
nss = wcid->tx_rate_nss; nss = wcid->tx_rate_nss;
} else { } else {
rate_ctl = mt76_mac_tx_rate_val(dev, rate, &nss); rate_ctl = mt76x0_mac_tx_rate_val(dev, rate, &nss);
} }
spin_unlock_irqrestore(&dev->mt76.lock, flags); spin_unlock_irqrestore(&dev->mt76.lock, flags);
@ -158,7 +158,7 @@ void mt76x0_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
BUILD_BUG_ON(ARRAY_SIZE(info->status.status_driver_data) < 1); BUILD_BUG_ON(ARRAY_SIZE(info->status.status_driver_data) < 1);
info->status.status_driver_data[0] = (void *)(unsigned long)pkt_len; info->status.status_driver_data[0] = (void *)(unsigned long)pkt_len;
if (mt76x0_skb_rooms(dev, skb) || mt76_insert_hdr_pad(skb)) { if (mt76x0_skb_rooms(dev, skb) || mt76x0_insert_hdr_pad(skb)) {
ieee80211_free_txskb(dev->mt76.hw, skb); ieee80211_free_txskb(dev->mt76.hw, skb);
return; return;
} }
@ -194,7 +194,7 @@ void mt76x0_tx_stat(struct work_struct *work)
if (!stat.valid) if (!stat.valid)
break; break;
mt76_send_tx_status(dev, &stat, &update); mt76x0_send_tx_status(dev, &stat, &update);
cleaned++; cleaned++;
} }

View File

@ -13,7 +13,7 @@
#include "mt76x0.h" #include "mt76x0.h"
void mt76_remove_hdr_pad(struct sk_buff *skb) void mt76x0_remove_hdr_pad(struct sk_buff *skb)
{ {
int len = ieee80211_get_hdrlen_from_skb(skb); int len = ieee80211_get_hdrlen_from_skb(skb);
@ -21,7 +21,7 @@ void mt76_remove_hdr_pad(struct sk_buff *skb)
skb_pull(skb, 2); skb_pull(skb, 2);
} }
int mt76_insert_hdr_pad(struct sk_buff *skb) int mt76x0_insert_hdr_pad(struct sk_buff *skb)
{ {
int len = ieee80211_get_hdrlen_from_skb(skb); int len = ieee80211_get_hdrlen_from_skb(skb);
int ret; int ret;