Skip to content
Permalink
Browse files

Added draft version for new data path.

New data patch is used for 88W8964 firmware 9.x.x.x.

Status:

1. It needs to issue "wifi up" to let AP work.
2. Tested open only with Macbook Air (2x2), Rx iperf test is good,
   but Tx has problem.

Signed-off-by: David Lin <dlin@marvell.com>
  • Loading branch information
yuhhaurlin committed Mar 21, 2017
1 parent 618bbc0 commit ce314329672be1e6e8fbf4147d5505631c307d8d
Showing with 2,481 additions and 313 deletions.
  1. +2 −0 Makefile
  2. +2 −0 Makefile.kernel
  3. +27 −14 core.c
  4. +9 −4 core.h
  5. +3 −1 debugfs.c
  6. +237 −39 hif/fwcmd.c
  7. +15 −4 hif/fwcmd.h
  8. +17 −0 hif/hif-ops.h
  9. +4 −0 hif/hif.h
  10. +62 −5 hif/hostcmd.h
  11. +421 −17 hif/pcie/dev.h
  12. +16 −4 hif/pcie/fwdl.c
  13. +261 −6 hif/pcie/pcie.c
  14. +6 −28 hif/pcie/rx.c
  15. +540 −0 hif/pcie/rx_ndp.c
  16. +26 −0 hif/pcie/rx_ndp.h
  17. +21 −171 hif/pcie/tx.c
  18. +619 −0 hif/pcie/tx_ndp.c
  19. +30 −0 hif/pcie/tx_ndp.h
  20. +68 −17 mac80211.c
  21. +7 −3 sysadpt.h
  22. +88 −0 utils.h
@@ -9,6 +9,8 @@ mwlwifi-objs += hif/pcie/pcie.o
mwlwifi-objs += hif/pcie/fwdl.o
mwlwifi-objs += hif/pcie/tx.o
mwlwifi-objs += hif/pcie/rx.o
mwlwifi-objs += hif/pcie/tx_ndp.o
mwlwifi-objs += hif/pcie/rx_ndp.o

AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld
@@ -9,5 +9,7 @@ mwlwifi-objs += hif/pcie/pcie.o
mwlwifi-objs += hif/pcie/fwdl.o
mwlwifi-objs += hif/pcie/tx.o
mwlwifi-objs += hif/pcie/rx.o
mwlwifi-objs += hif/pcie/tx_ndp.o
mwlwifi-objs += hif/pcie/rx_ndp.o

ccflags-y += -D__CHECK_ENDIAN__
41 core.c
@@ -97,8 +97,8 @@ static const struct ieee80211_rate mwl_rates_50[] = {
};

static const struct ieee80211_iface_limit ap_if_limits[] = {
{ .max = SYSADPT_NUM_OF_AP, .types = BIT(NL80211_IFTYPE_AP) },
{ .max = 1, .types = BIT(NL80211_IFTYPE_STATION) },
{ .max = SYSADPT_NUM_OF_AP, .types = BIT(NL80211_IFTYPE_AP) },
{ .max = SYSADPT_NUM_OF_CLIENT, .types = BIT(NL80211_IFTYPE_STATION) },
};

static const struct ieee80211_iface_combination ap_if_comb = {
@@ -410,7 +410,8 @@ static void mwl_set_ht_caps(struct mwl_priv *priv,
hw = priv->hw;

band->ht_cap.ht_supported = 1;

if (priv->chip_type == MWL8964)
band->ht_cap.cap |= IEEE80211_HT_CAP_MAX_AMSDU;
band->ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
band->ht_cap.cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
band->ht_cap.cap |= IEEE80211_HT_CAP_SM_PS;
@@ -439,7 +440,12 @@ static void mwl_set_vht_caps(struct mwl_priv *priv,

band->vht_cap.vht_supported = 1;

band->vht_cap.cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895;
if (priv->chip_type == MWL8964) {
band->vht_cap.cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454;
band->vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_160;
band->vht_cap.cap |= IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
} else
band->vht_cap.cap |= IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895;
band->vht_cap.cap |= IEEE80211_VHT_CAP_RXLDPC;
band->vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_80;
band->vht_cap.cap |= IEEE80211_VHT_CAP_RXSTBC_1;
@@ -449,11 +455,6 @@ static void mwl_set_vht_caps(struct mwl_priv *priv,
band->vht_cap.cap |= IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN;
band->vht_cap.cap |= IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN;

if (priv->chip_type == MWL8964) {
band->vht_cap.cap |= IEEE80211_VHT_CAP_SHORT_GI_160;
band->vht_cap.cap |= IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ;
}

if (priv->antenna_rx == ANTENNA_RX_2)
band->vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(0xfffa);
else
@@ -578,10 +579,10 @@ static void mwl_watchdog_ba_events(struct work_struct *work)

/* the bitmap is the hw queue number. Map it to the ampdu queue. */
if (bitmap != INVALID_WATCHDOG) {
if (bitmap == SYSADPT_TX_AMPDU_QUEUES)
if (bitmap == priv->ampdu_num)
stream_index = 0;
else if (bitmap > SYSADPT_TX_AMPDU_QUEUES)
stream_index = bitmap - SYSADPT_TX_AMPDU_QUEUES;
else if (bitmap > priv->ampdu_num)
stream_index = bitmap - priv->ampdu_num;
else
stream_index = bitmap + 3; /** queue 0 is stream 3*/

@@ -594,7 +595,7 @@ static void mwl_watchdog_ba_events(struct work_struct *work)
streams->tid);
} else {
for (stream_index = 0;
stream_index < SYSADPT_TX_AMPDU_QUEUES;
stream_index < priv->ampdu_num;
stream_index++) {
streams = &priv->ampdu[stream_index];

@@ -788,7 +789,7 @@ struct ieee80211_hw *mwl_alloc_hw(int bus_type,

hw = ieee80211_alloc_hw(priv_size, &mwl_mac80211_ops);
if (!hw) {
pr_err("ieee80211 alloc failed\n");
pr_err("ieee80211 alloc hw failed\n");
return NULL;
}

@@ -804,6 +805,15 @@ struct ieee80211_hw *mwl_alloc_hw(int bus_type,
priv->hif.bus = bus_type;
priv->hif.ops = ops;
priv->hif.priv = (char *)priv + ALIGN(sizeof(*priv), NETDEV_ALIGN);
priv->ampdu_num = mwl_hif_get_ampdu_num(hw);

priv->ampdu =
kzalloc(priv->ampdu_num * sizeof(*priv->ampdu), GFP_KERNEL);
if (!priv->ampdu) {
ieee80211_free_hw(hw);
pr_err("alloc ampdu stream failed\n");
return NULL;
}

SET_IEEE80211_DEV(hw, dev);

@@ -812,6 +822,9 @@ struct ieee80211_hw *mwl_alloc_hw(int bus_type,

void mwl_free_hw(struct ieee80211_hw *hw)
{
struct mwl_priv *priv = hw->priv;

kfree(priv->ampdu);
ieee80211_free_hw(hw);
}

13 core.h
@@ -42,8 +42,9 @@
/* vif and station */
#define NUM_WEP_KEYS 4
#define MWL_MAX_TID 8
#define MWL_AMSDU_SIZE_4K 0
#define MWL_AMSDU_SIZE_8K 1
#define MWL_AMSDU_SIZE_4K 1
#define MWL_AMSDU_SIZE_8K 2
#define MWL_AMSDU_SIZE_11K 3

/* power init */
#define MWL_POWER_INIT_1 1
@@ -67,7 +68,7 @@ enum {
};

enum {
AMPDU_NO_STREAM,
AMPDU_NO_STREAM = 0,
AMPDU_STREAM_NEW,
AMPDU_STREAM_IN_PROGRESS,
AMPDU_STREAM_ACTIVE,
@@ -184,9 +185,10 @@ struct mwl_priv {

/* ampdu stream information */
/* for ampdu stream */
int ampdu_num;
struct {
spinlock_t stream_lock; /* for BA stream */
struct mwl_ampdu_stream ampdu[SYSADPT_TX_AMPDU_QUEUES];
struct mwl_ampdu_stream *ampdu;
} ____cacheline_aligned_in_smp;
struct work_struct watchdog_ba_handle;

@@ -242,6 +244,7 @@ struct beacon_info {

struct mwl_vif {
struct list_head list;
enum nl80211_iftype type;
int macid; /* Firmware macid for this vif. */
u16 seqno; /* Non AMPDU sequence number assigned by driver. */
struct { /* Saved WEP keys */
@@ -279,6 +282,8 @@ struct mwl_amsdu_ctrl {

struct mwl_sta {
struct list_head list;
struct mwl_vif *mwl_vif;
bool wds;
bool is_mesh_node;
bool is_ampdu_allowed;
struct mwl_tx_info tx_stats[MWL_MAX_TID];
@@ -304,8 +304,10 @@ static ssize_t mwl_debugfs_ampdu_read(struct file *file, char __user *ubuf,

len += scnprintf(p + len, size - len, "\n");
spin_lock_bh(&priv->stream_lock);
for (i = 0; i < SYSADPT_TX_AMPDU_QUEUES; i++) {
for (i = 0; i < priv->ampdu_num; i++) {
stream = &priv->ampdu[i];
if (!stream->state)
continue;
len += scnprintf(p + len, size - len, "stream: %d\n", i);
len += scnprintf(p + len, size - len, "idx: %u\n", stream->idx);
len += scnprintf(p + len, size - len,

0 comments on commit ce31432

Please sign in to comment.
You can’t perform that action at this time.