move header pad insert/remove functions and utility header to a new core module

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2015-12-06 17:01:42 +01:00
parent a0ee20716f
commit 1212107d7b
7 changed files with 15 additions and 10 deletions
+5 -2
View File
@@ -1,10 +1,13 @@
EXTRA_CFLAGS += -Werror
obj-m := mt76x2e.o
obj-m := mt76.o mt76x2e.o
mt76-y := \
util.o
mt76x2e-y := \
mt76x2_pci.o mt76x2_dma.o \
mt76x2_main.o mt76x2_init.o mt76x2_debugfs.o mt76x2_tx.o mt76x2_util.o \
mt76x2_main.o mt76x2_init.o mt76x2_debugfs.o mt76x2_tx.o \
mt76x2_core.o mt76x2_mac.o mt76x2_eeprom.o mt76x2_mcu.o mt76x2_phy.o \
mt76x2_trace.o
+1 -1
View File
@@ -45,7 +45,7 @@
#define MT_CALIBRATE_INTERVAL HZ
#include "mt76x2_regs.h"
#include "mt76x2_util.h"
#include "util.h"
#include "mt76x2_mac.h"
struct mt76x2_queue_entry {
+1 -1
View File
@@ -239,7 +239,7 @@ mt76x2_dma_tx_queue_skb(struct mt76x2_dev *dev, struct mt76x2_queue *q,
dma_sync_single_for_device(dev->dev, t->dma_addr, sizeof(t->txwi),
DMA_TO_DEVICE);
ret = mt76x2_insert_hdr_pad(skb);
ret = mt76_insert_hdr_pad(skb);
if (ret)
goto put_txwi;
+1 -1
View File
@@ -224,7 +224,7 @@ int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb, void *rxi
int len;
if (rxwi->rxinfo & cpu_to_le32(MT_RXINFO_L2PAD))
mt76x2_remove_hdr_pad(skb);
mt76_remove_hdr_pad(skb);
if (rxwi->rxinfo & cpu_to_le32(MT_RXINFO_DECRYPT)) {
status->flag |= RX_FLAG_DECRYPTED;
-2
View File
@@ -181,8 +181,6 @@ void mt76x2_mac_wcid_set_rate(struct mt76x2_dev *dev, struct mt76x2_wcid *wcid,
int mt76x2_mac_shared_key_setup(struct mt76x2_dev *dev, u8 vif_idx, u8 key_idx,
struct ieee80211_key_conf *key);
int mt76x2_insert_hdr_pad(struct sk_buff *skb);
void mt76x2_remove_hdr_pad(struct sk_buff *skb);
int mt76x2_mac_skb_tx_overhead(struct mt76x2_dev *dev, struct sk_buff *skb);
int mt76x2_mac_set_beacon(struct mt76x2_dev *dev, u8 vif_idx, struct sk_buff *skb);
+4 -3
View File
@@ -13,14 +13,15 @@
#include "mt76x2.h"
void mt76x2_remove_hdr_pad(struct sk_buff *skb)
void mt76_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);
}
EXPORT_SYMBOL_GPL(mt76_remove_hdr_pad);
int mt76x2_insert_hdr_pad(struct sk_buff *skb)
int mt76_insert_hdr_pad(struct sk_buff *skb)
{
int len = ieee80211_get_hdrlen_from_skb(skb);
int ret;
@@ -39,4 +40,4 @@ int mt76x2_insert_hdr_pad(struct sk_buff *skb)
skb->data[len + 1] = 0;
return 0;
}
EXPORT_SYMBOL_GPL(mt76_insert_hdr_pad);
+3
View File
@@ -72,4 +72,7 @@
#define MT76_INCR(_var, _size) \
_var = (((_var) + 1) % _size)
int mt76_insert_hdr_pad(struct sk_buff *skb);
void mt76_remove_hdr_pad(struct sk_buff *skb);
#endif