2018-02-06 11:12:40 +00:00
|
|
|
From a359b5adc91cb9f2d3cc07705d804ef60bf6e4e3 Mon Sep 17 00:00:00 2001
|
2018-02-02 01:38:28 +00:00
|
|
|
From: Jake Day <jake@ninebysix.com>
|
2018-02-06 11:12:40 +00:00
|
|
|
Date: Fri, 2 Feb 2018 12:57:32 -0500
|
2018-02-02 01:38:28 +00:00
|
|
|
Subject: fixes for marvell mwifiex
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
|
|
|
|
index 042a1d0..fc9041f 100644
|
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
|
|
|
|
@@ -200,8 +200,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
|
|
|
|
|
|
|
|
do {
|
|
|
|
/* Check if AMSDU can accommodate this MSDU */
|
|
|
|
- if ((skb_aggr->len + skb_src->len + LLC_SNAP_LEN) >
|
|
|
|
- adapter->tx_buf_size)
|
|
|
|
+ if (skb_tailroom(skb_aggr) < (skb_src->len + LLC_SNAP_LEN))
|
|
|
|
break;
|
|
|
|
|
|
|
|
skb_src = skb_dequeue(&pra_list->skb_head);
|
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
|
2018-02-06 11:12:40 +00:00
|
|
|
index 6e0d9a9..d008687 100644
|
2018-02-02 01:38:28 +00:00
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
|
|
|
|
@@ -416,6 +416,9 @@ mwifiex_cfg80211_set_power_mgmt(struct wiphy *wiphy,
|
|
|
|
|
|
|
|
ps_mode = enabled;
|
|
|
|
|
|
|
|
+ mwifiex_dbg(priv->adapter, ERROR, "overriding ps_mode to false\n");
|
|
|
|
+ ps_mode = 0;
|
|
|
|
+
|
|
|
|
return mwifiex_drv_set_power(priv, &ps_mode);
|
|
|
|
}
|
|
|
|
|
2018-02-08 12:16:29 +00:00
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
|
|
|
|
index 0edc5d6..c0c9c70 100644
|
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
|
|
|
|
@@ -998,6 +998,7 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
|
|
|
|
if (cmd_node->wait_q_enabled) {
|
|
|
|
adapter->cmd_wait_q.status = -ETIMEDOUT;
|
|
|
|
mwifiex_cancel_pending_ioctl(adapter);
|
|
|
|
+ adapter->cmd_sent = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) {
|
2018-02-02 01:38:28 +00:00
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c
|
2018-02-06 11:12:40 +00:00
|
|
|
index e1aa860..328829b 100644
|
2018-02-02 01:38:28 +00:00
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/init.c
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/init.c
|
2018-02-06 11:12:40 +00:00
|
|
|
@@ -60,7 +60,7 @@ static void wakeup_timer_fn(struct timer_list *t)
|
2018-02-02 01:38:28 +00:00
|
|
|
adapter->hw_status = MWIFIEX_HW_STATUS_RESET;
|
|
|
|
mwifiex_cancel_all_pending_cmd(adapter);
|
|
|
|
|
|
|
|
- if (adapter->if_ops.card_reset && !adapter->hs_activated)
|
|
|
|
+ if (adapter->if_ops.card_reset)
|
|
|
|
adapter->if_ops.card_reset(adapter);
|
|
|
|
}
|
|
|
|
|
2018-02-06 11:12:40 +00:00
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
|
|
|
|
index a96bd7e..79b026f 100644
|
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/main.c
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
|
|
|
|
@@ -163,6 +163,7 @@ void mwifiex_queue_main_work(struct mwifiex_adapter *adapter)
|
|
|
|
spin_lock_irqsave(&adapter->main_proc_lock, flags);
|
|
|
|
if (adapter->mwifiex_processing) {
|
|
|
|
adapter->more_task_flag = true;
|
|
|
|
+ adapter->more_rx_task_flag = true;
|
|
|
|
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
|
|
|
|
} else {
|
|
|
|
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
|
|
|
|
@@ -171,18 +172,20 @@ void mwifiex_queue_main_work(struct mwifiex_adapter *adapter)
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(mwifiex_queue_main_work);
|
|
|
|
|
|
|
|
-static void mwifiex_queue_rx_work(struct mwifiex_adapter *adapter)
|
|
|
|
+void mwifiex_queue_rx_work(struct mwifiex_adapter *adapter)
|
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
spin_lock_irqsave(&adapter->rx_proc_lock, flags);
|
|
|
|
if (adapter->rx_processing) {
|
|
|
|
+ adapter->more_rx_task_flag = true;
|
|
|
|
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
|
|
|
|
} else {
|
|
|
|
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
|
|
|
|
queue_work(adapter->rx_workqueue, &adapter->rx_work);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(mwifiex_queue_rx_work);
|
|
|
|
|
|
|
|
static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
|
|
|
|
{
|
|
|
|
@@ -192,13 +195,14 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
|
|
|
|
|
|
|
|
spin_lock_irqsave(&adapter->rx_proc_lock, flags);
|
|
|
|
if (adapter->rx_processing || adapter->rx_locked) {
|
|
|
|
+ adapter->more_rx_task_flag = true;
|
|
|
|
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
|
|
|
|
goto exit_rx_proc;
|
|
|
|
} else {
|
|
|
|
adapter->rx_processing = true;
|
|
|
|
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
|
|
|
|
}
|
|
|
|
-
|
|
|
|
+rx_process_start:
|
|
|
|
/* Check for Rx data */
|
|
|
|
while ((skb = skb_dequeue(&adapter->rx_data_q))) {
|
|
|
|
atomic_dec(&adapter->rx_pending);
|
|
|
|
@@ -220,6 +224,11 @@ static int mwifiex_process_rx(struct mwifiex_adapter *adapter)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
spin_lock_irqsave(&adapter->rx_proc_lock, flags);
|
|
|
|
+ if (adapter->more_rx_task_flag) {
|
|
|
|
+ adapter->more_rx_task_flag = false;
|
|
|
|
+ spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
|
|
|
|
+ goto rx_process_start;
|
|
|
|
+ }
|
|
|
|
adapter->rx_processing = false;
|
|
|
|
spin_unlock_irqrestore(&adapter->rx_proc_lock, flags);
|
|
|
|
|
|
|
|
@@ -283,10 +292,10 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
|
|
|
|
mwifiex_process_hs_config(adapter);
|
|
|
|
if (adapter->if_ops.process_int_status)
|
|
|
|
adapter->if_ops.process_int_status(adapter);
|
|
|
|
+ if (adapter->rx_work_enabled && adapter->data_received)
|
|
|
|
+ mwifiex_queue_rx_work(adapter);
|
|
|
|
}
|
|
|
|
|
|
|
|
- if (adapter->rx_work_enabled && adapter->data_received)
|
|
|
|
- mwifiex_queue_rx_work(adapter);
|
|
|
|
|
|
|
|
/* Need to wake up the card ? */
|
|
|
|
if ((adapter->ps_state == PS_STATE_SLEEP) &&
|
2018-02-02 01:38:28 +00:00
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wireless/marvell/mwifiex/main.h
|
2018-02-06 11:12:40 +00:00
|
|
|
index 154c079..4205344 100644
|
2018-02-02 01:38:28 +00:00
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/main.h
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
|
2018-02-06 11:12:40 +00:00
|
|
|
@@ -889,6 +889,7 @@ struct mwifiex_adapter {
|
|
|
|
spinlock_t main_proc_lock;
|
|
|
|
u32 mwifiex_processing;
|
|
|
|
u8 more_task_flag;
|
|
|
|
+ u8 more_rx_task_flag;
|
|
|
|
u16 tx_buf_size;
|
|
|
|
u16 curr_tx_buf_size;
|
|
|
|
/* sdio single port rx aggregation capability */
|
|
|
|
@@ -1661,6 +1662,7 @@ void mwifiex_upload_device_dump(struct mwifiex_adapter *adapter, void *drv_info,
|
|
|
|
int drv_info_size);
|
|
|
|
void *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags);
|
|
|
|
void mwifiex_queue_main_work(struct mwifiex_adapter *adapter);
|
|
|
|
+void mwifiex_queue_rx_work(struct mwifiex_adapter *adapter);
|
|
|
|
int mwifiex_get_wakeup_reason(struct mwifiex_private *priv, u16 action,
|
|
|
|
int cmd_type,
|
|
|
|
struct mwifiex_ds_wakeup_reason *wakeup_reason);
|
2018-02-02 01:38:28 +00:00
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
2018-02-06 11:12:40 +00:00
|
|
|
index cd31494..575da92 100644
|
2018-02-02 01:38:28 +00:00
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
|
2018-02-06 11:12:40 +00:00
|
|
|
@@ -1729,6 +1729,16 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
|
2018-02-02 01:38:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rx_len = get_unaligned_le16(skb->data);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (rx_len == 0) {
|
|
|
|
+ mwifiex_dbg(adapter, ERROR,
|
|
|
|
+ "0 byte cmdrsp\n");
|
|
|
|
+ mwifiex_map_pci_memory(adapter, skb, MWIFIEX_UPLD_SIZE,
|
|
|
|
+ PCI_DMA_FROMDEVICE);
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
skb_put(skb, MWIFIEX_UPLD_SIZE - skb->len);
|
|
|
|
skb_trim(skb, rx_len);
|
|
|
|
|
2018-02-06 11:12:40 +00:00
|
|
|
@@ -2781,7 +2791,7 @@ static void mwifiex_pcie_card_reset_work(struct mwifiex_adapter *adapter)
|
|
|
|
{
|
|
|
|
struct pcie_service_card *card = adapter->card;
|
2018-02-02 01:38:28 +00:00
|
|
|
|
2018-02-06 11:12:40 +00:00
|
|
|
- pci_reset_function(card->dev);
|
|
|
|
+ pci_try_reset_function(card->dev);
|
2018-02-02 01:38:28 +00:00
|
|
|
}
|
|
|
|
|
2018-02-06 11:12:40 +00:00
|
|
|
static void mwifiex_pcie_work(struct work_struct *work)
|
2018-02-02 01:38:28 +00:00
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
|
|
|
index fb09014..5b8329e 100644
|
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
|
|
|
@@ -2313,7 +2313,7 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
|
|
|
|
if (ret)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
- if (priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
|
|
|
|
+ if (0 && priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
|
|
|
|
/* Enable IEEE PS by default */
|
|
|
|
priv->adapter->ps_mode = MWIFIEX_802_11_POWER_MODE_PSP;
|
|
|
|
ret = mwifiex_send_cmd(priv,
|
|
|
|
@@ -2336,8 +2336,8 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
- mwifiex_send_cmd(priv, HostCmd_CMD_CHAN_REGION_CFG,
|
|
|
|
- HostCmd_ACT_GEN_GET, 0, NULL, true);
|
|
|
|
+ //mwifiex_send_cmd(priv, HostCmd_CMD_CHAN_REGION_CFG,
|
|
|
|
+ // HostCmd_ACT_GEN_GET, 0, NULL, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* get tx rate */
|
|
|
|
@@ -2369,7 +2369,7 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
|
|
|
|
if (ret)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
- if (!disable_auto_ds && first_sta &&
|
|
|
|
+ if (0 && !disable_auto_ds && first_sta &&
|
|
|
|
priv->bss_type != MWIFIEX_BSS_TYPE_UAP) {
|
|
|
|
/* Enable auto deep sleep */
|
|
|
|
auto_ds.auto_ds = DEEP_SLEEP_ON;
|
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
|
2018-02-06 11:12:40 +00:00
|
|
|
index 1bd4e13..27d2bac 100644
|
2018-02-02 01:38:28 +00:00
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
|
|
|
|
@@ -48,9 +48,14 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv,
|
|
|
|
struct host_cmd_ds_802_11_ps_mode_enh *pm;
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
- mwifiex_dbg(adapter, ERROR,
|
|
|
|
- "CMD_RESP: cmd %#x error, result=%#x\n",
|
|
|
|
- resp->command, resp->result);
|
|
|
|
+ if (resp->command == 271 && resp->result == 2){
|
|
|
|
+ // ignore this command as the firmware does not support it
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ mwifiex_dbg(adapter, ERROR,
|
|
|
|
+ "CMD_RESP: cmd %#x error, result=%#x\n",
|
|
|
|
+ resp->command, resp->result);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (adapter->curr_cmd->wait_q_enabled)
|
|
|
|
adapter->cmd_wait_q.status = -1;
|
2018-02-06 11:12:40 +00:00
|
|
|
diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
|
|
|
|
index 4bc2448..d20fda1 100644
|
|
|
|
--- a/drivers/net/wireless/marvell/mwifiex/usb.c
|
|
|
|
+++ b/drivers/net/wireless/marvell/mwifiex/usb.c
|
|
|
|
@@ -144,6 +144,8 @@ static int mwifiex_usb_recv(struct mwifiex_adapter *adapter,
|
|
|
|
skb_queue_tail(&adapter->rx_data_q, skb);
|
|
|
|
adapter->data_received = true;
|
|
|
|
atomic_inc(&adapter->rx_pending);
|
|
|
|
+ if (adapter->rx_work_enabled)
|
|
|
|
+ mwifiex_queue_rx_work(adapter);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
mwifiex_dbg(adapter, ERROR,
|
2018-02-02 01:38:28 +00:00
|
|
|
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
|
2018-02-06 11:12:40 +00:00
|
|
|
index fdb3646..b44b23b 100644
|
2018-02-02 01:38:28 +00:00
|
|
|
--- a/net/wireless/sme.c
|
|
|
|
+++ b/net/wireless/sme.c
|
|
|
|
@@ -690,6 +690,11 @@ void __cfg80211_connect_result(struct net_device *dev,
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (WARN_ON(!wdev->ssid_len)) {
|
|
|
|
+ cfg80211_put_bss(wdev->wiphy, cr->bss);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
nl80211_send_connect_result(wiphy_to_rdev(wdev->wiphy), dev, cr,
|
|
|
|
GFP_KERNEL);
|
|
|
|
|
2018-02-06 11:12:40 +00:00
|
|
|
@@ -1105,7 +1110,7 @@ int cfg80211_connect(struct cfg80211_registered_device *rdev,
|
2018-02-02 01:38:28 +00:00
|
|
|
/*
|
|
|
|
* If we have an ssid_len, we're trying to connect or are
|
|
|
|
* already connected, so reject a new SSID unless it's the
|
|
|
|
- * same (which is the case for re-association.)
|
|
|
|
+ * same (which is the case for Re-Association.
|
|
|
|
*/
|
|
|
|
if (wdev->ssid_len &&
|
|
|
|
(wdev->ssid_len != connect->ssid_len ||
|
|
|
|
diff --git a/scripts/leaking_addresses.pl b/scripts/leaking_addresses.pl
|
|
|
|
old mode 100755
|
|
|
|
new mode 100644
|