Skip to content

Commit

Permalink
Added draft version for new data path.
Browse files Browse the repository at this point in the history
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 ce31432
Show file tree
Hide file tree
Showing 22 changed files with 2,481 additions and 313 deletions.
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Makefile.kernel
Expand Up @@ -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 changes: 27 additions & 14 deletions core.c
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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*/

Expand All @@ -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];

Expand Down Expand Up @@ -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;
}

Expand All @@ -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);

Expand All @@ -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);
}

Expand Down
13 changes: 9 additions & 4 deletions core.h
Expand Up @@ -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
Expand All @@ -67,7 +68,7 @@ enum {
};

enum {
AMPDU_NO_STREAM,
AMPDU_NO_STREAM = 0,
AMPDU_STREAM_NEW,
AMPDU_STREAM_IN_PROGRESS,
AMPDU_STREAM_ACTIVE,
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 3 additions & 1 deletion debugfs.c
Expand Up @@ -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,
Expand Down

0 comments on commit ce31432

Please sign in to comment.