Skip to content

Commit

Permalink
mt76x0: rename mt76_* functions
Browse files Browse the repository at this point in the history
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: 7b48590 ("mt76x0: core files")
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Stanislaw Gruszka authored and Kalle Valo committed Aug 4, 2018
1 parent 28b9188 commit 909da6e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt76x0/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ mt76x0_rx_skb_from_seg(struct mt76x0_dev *dev, struct mt76x0_rxwi *rxwi,
if (!skb)
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)
goto bad_frame;

Expand Down
14 changes: 7 additions & 7 deletions drivers/net/wireless/mediatek/mt76/mt76x0/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ mt76_mac_fill_tx_status(struct mt76x0_dev *dev, struct ieee80211_tx_info *info,
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)
{
u16 rateval;
Expand Down Expand Up @@ -166,13 +166,13 @@ u16 mt76_mac_tx_rate_val(struct mt76x0_dev *dev,
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)
{
unsigned long 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;
spin_unlock_irqrestore(&dev->mt76.lock, flags);
}
Expand All @@ -198,7 +198,7 @@ struct mt76_tx_status mt76x0_mac_fetch_tx_status(struct mt76x0_dev *dev)
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_sta *sta = NULL;
Expand Down Expand Up @@ -527,7 +527,7 @@ mt76x0_rx_is_our_beacon(struct mt76x0_dev *dev, u8 *data)
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)
{
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
Expand Down Expand Up @@ -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)
{
enum mt76_cipher_type cipher;
Expand Down Expand Up @@ -635,7 +635,7 @@ int mt76_mac_wcid_set_key(struct mt76x0_dev *dev, u8 idx,
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)
{
enum mt76_cipher_type cipher;
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/wireless/mediatek/mt76/mt76x0/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,19 @@ struct mt76_txwi {

#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);
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);
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);

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);
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);
struct mt76_tx_status
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
8 changes: 4 additions & 4 deletions drivers/net/wireless/mediatek/mt76/mt76x0/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,15 @@ mt76x0_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,

if (!msta) {
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)
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)
Expand Down Expand Up @@ -375,7 +375,7 @@ mt76_sta_rate_tbl_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,

rate.idx = rates->rate[0].idx;
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:
rcu_read_unlock();
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ void mt76x0_tx_status(struct mt76x0_dev *dev, struct sk_buff *skb);
void mt76x0_tx_stat(struct work_struct *work);

/* util */
void mt76_remove_hdr_pad(struct sk_buff *skb);
int mt76_insert_hdr_pad(struct sk_buff *skb);
void mt76x0_remove_hdr_pad(struct sk_buff *skb);
int mt76x0_insert_hdr_pad(struct sk_buff *skb);

int mt76x0_dma_init(struct mt76x0_dev *dev);
void mt76x0_dma_cleanup(struct mt76x0_dev *dev);
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static void mt76x0_tx_skb_remove_dma_overhead(struct sk_buff *skb,

skb_pull(skb, sizeof(struct mt76_txwi) + 4);
if (ieee80211_get_hdrlen_from_skb(skb) % 4)
mt76_remove_hdr_pad(skb);
mt76x0_remove_hdr_pad(skb);

skb_trim(skb, pkt_len);
}
Expand Down Expand Up @@ -93,7 +93,7 @@ mt76x0_push_txwi(struct mt76x0_dev *dev, struct sk_buff *skb,
rate_ctl = wcid->tx_rate;
nss = wcid->tx_rate_nss;
} 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);

Expand Down Expand Up @@ -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);
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);
return;
}
Expand Down Expand Up @@ -194,7 +194,7 @@ void mt76x0_tx_stat(struct work_struct *work)
if (!stat.valid)
break;

mt76_send_tx_status(dev, &stat, &update);
mt76x0_send_tx_status(dev, &stat, &update);

cleaned++;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/mediatek/mt76/mt76x0/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

#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);

memmove(skb->data + 2, skb->data, len);
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 ret;
Expand Down

0 comments on commit 909da6e

Please sign in to comment.