Skip to content
Permalink
Browse files

Added code to support WDS client for 88W8964.

Signed-off-by: David Lin <dlin@marvell.com>
  • Loading branch information
yuhhaurlin committed Dec 1, 2017
1 parent 05b3e03 commit af210f0ef79d5c416dd455747a16d76bec5912ba
Showing with 42 additions and 10 deletions.
  1. +2 −0 hif/fwcmd.h
  2. +29 −6 hif/pcie/rx_ndp.c
  3. +11 −4 mac80211.c
@@ -48,6 +48,8 @@
#define CAC_START 1
#define MONITOR_START 3

#define WDS_MODE 4

enum {
WL_ANTENNATYPE_RX = 1,
WL_ANTENNATYPE_TX = 2,
@@ -255,13 +255,36 @@ static inline void pcie_rx_process_fast_data(struct mwl_priv *priv,
ether_addr_copy(hdr.addr3, skb->data);
hdrlen = 24;
break;
case NL80211_IFTYPE_AP_VLAN:
if (!sta_info->wds)
goto drop_packet;
fc |= (cpu_to_le16(IEEE80211_FCTL_TODS) |
cpu_to_le16(IEEE80211_FCTL_FROMDS));
/* RA TA DA SA */
ether_addr_copy(hdr.addr1, mwl_vif->bssid);
ether_addr_copy(hdr.addr2, sta->addr);
ether_addr_copy(hdr.addr3, skb->data);
ether_addr_copy(hdr.addr4, skb->data + ETH_ALEN);
hdrlen = 30;
break;
case NL80211_IFTYPE_STATION:
fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS);
/* DA BSSID SA */
ether_addr_copy(hdr.addr1, skb->data);
ether_addr_copy(hdr.addr2, mwl_vif->bssid);
ether_addr_copy(hdr.addr3, skb->data + ETH_ALEN);
hdrlen = 24;
if (sta_info->wds) {
fc |= (cpu_to_le16(IEEE80211_FCTL_TODS) |
cpu_to_le16(IEEE80211_FCTL_FROMDS));
/* RA TA DA SA */
ether_addr_copy(hdr.addr1, mwl_vif->sta_mac);
ether_addr_copy(hdr.addr2, mwl_vif->bssid);
ether_addr_copy(hdr.addr3, skb->data);
ether_addr_copy(hdr.addr4, skb->data + ETH_ALEN);
hdrlen = 30;
} else {
fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS);
/* DA BSSID SA */
ether_addr_copy(hdr.addr1, skb->data);
ether_addr_copy(hdr.addr2, mwl_vif->bssid);
ether_addr_copy(hdr.addr3, skb->data + ETH_ALEN);
hdrlen = 24;
}
break;
default:
goto drop_packet;
@@ -447,6 +447,8 @@ static int mwl_mac80211_sta_add(struct ieee80211_hw *hw,
struct mwl_priv *priv = hw->priv;
u16 stnid, sta_stnid;
struct mwl_vif *mwl_vif;
struct wireless_dev *wdev = ieee80211_vif_to_wdev(vif);
bool use_4addr = wdev->use_4addr;
struct mwl_sta *sta_info;
struct ieee80211_key_conf *key;
int rc;
@@ -494,12 +496,17 @@ static int mwl_mac80211_sta_add(struct ieee80211_hw *hw,
if (vif->type == NL80211_IFTYPE_STATION)
mwl_fwcmd_set_new_stn_del(hw, vif, sta->addr);

if (priv->chip_type == MWL8964)
rc = mwl_fwcmd_set_new_stn_add_sc4(hw, vif, sta, 0);
else
if (priv->chip_type == MWL8964) {
if (use_4addr) {
sta_info->wds = true;
rc = mwl_fwcmd_set_new_stn_add_sc4(hw, vif, sta,
WDS_MODE);
} else
rc = mwl_fwcmd_set_new_stn_add_sc4(hw, vif, sta, 0);
} else
rc = mwl_fwcmd_set_new_stn_add(hw, vif, sta);

if (vif->type == NL80211_IFTYPE_STATION)
if ((vif->type == NL80211_IFTYPE_STATION) && !use_4addr)
mwl_hif_set_sta_id(hw, sta, true, true);
else
mwl_hif_set_sta_id(hw, sta, false, true);

0 comments on commit af210f0

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