@@ -188,7 +188,8 @@ int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb)
frame_desc[0] = cpu_to_le16((skb->len - FRAME_DESC_SZ) |
(RSI_WIFI_MGMT_Q << 12));
}
- if ((skb->len - header_size) == 133) {
+ if (((skb->len - header_size) == 133) ||
+ ((skb->len - header_size) == 131)) {
ven_rsi_dbg(INFO_ZONE, "*** Tx EAPOL 4*****\n");
frame_desc[1] |=
cpu_to_le16(RSI_DESC_REQUIRE_CFM_TO_HOST);
@@ -363,6 +363,11 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
if (common->fsm_state != FSM_MAC_INIT_DONE)
return -ENODEV;
+#ifdef CONFIG_RSI_WOW
+ if (common->wow_flags & RSI_WOW_ENABLED)
+ return -ENETDOWN;
+#endif
+
if (scan_req->n_channels == 0)
return -EINVAL;
@@ -404,8 +409,8 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
return 0;
}
-static void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
+void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
{
struct rsi_hw *adapter = hw->priv;
struct rsi_common *common = adapter->priv;
@@ -444,6 +449,7 @@ static void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
common->hw_scan_cancel = false;
mutex_unlock(&common->mutex);
}
+EXPORT_SYMBOL_GPL(rsi_mac80211_hw_scan_cancel);
#endif
/**
@@ -2452,8 +2458,11 @@ static int rsi_mac80211_resume(struct ieee80211_hw *hw)
ven_rsi_dbg(INFO_ZONE, "%s: mac80211 resume\n", __func__);
- if (common->hibernate_resume)
+ if (common->hibernate_resume) {
+ if (common->reinit_hw)
+ wait_for_completion(&common->wlan_init_completion);
return 0;
+ }
#ifdef CONFIG_VEN_RSI_WOW
mutex_lock(&common->mutex);
@@ -415,6 +415,7 @@ struct rsi_hw *ven_rsi_91x_init(void)
common->roc_timer.data = (unsigned long)common;
common->roc_timer.function = (void *)&rsi_roc_timeout;
init_timer(&common->roc_timer);
+ init_completion(&common->wlan_init_completion);
common->init_done = true;
return adapter;
@@ -2343,6 +2343,21 @@ int rsi_send_probe_request(struct rsi_common *common,
}
if (scan_type == 1) {
+ if (len > 120) {
+ u16 t_len = MIN_802_11_HDR_LEN;
+
+ /* Cut some IEs */
+ pos = &skb->data[MIN_802_11_HDR_LEN];
+ while (true) {
+ if ((t_len + pos[1] + 2) > 120) {
+ skb_trim(skb, t_len);
+ len = t_len;
+ break;
+ }
+ t_len += pos[1] + 2;
+ pos += (pos[1] + 2);
+ }
+ }
common->bgscan_probe_req_len = len;
return 0;
}
@@ -2635,7 +2650,14 @@ static int rsi_handle_ta_confirm(struct rsi_common *common, u8 *msg)
common->bb_rf_prog_count--;
if (!common->bb_rf_prog_count) {
common->fsm_state = FSM_MAC_INIT_DONE;
- return rsi_mac80211_attach(common);
+ if (common->reinit_hw) {
+ common->hw_data_qs_blocked = false;
+ ieee80211_wake_queues(adapter->hw);
+ complete(&common->wlan_init_completion);
+ common->reinit_hw = false;
+ } else {
+ return rsi_mac80211_attach(common);
+ }
}
} else {
ven_rsi_dbg(INFO_ZONE,
@@ -1467,9 +1467,6 @@ static int rsi_sdio_reinit_device(struct rsi_hw *adapter)
for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
skb_queue_purge(&adapter->priv->tx_queue[ii]);
- /* Detach MAC */
- ven_rsi_mac80211_detach(adapter);
-
/* Initialize device again */
sdio_claim_host(pfunction);
@@ -1500,7 +1497,14 @@ int rsi_restore(struct device *dev)
adapter->priv->bt_fsm_state = BT_DEVICE_NOT_READY;
adapter->priv->iface_down = true;
+ adapter->sc_nvifs = 0;
+ rsi_mac80211_hw_scan_cancel(adapter->hw, adapter->priv->scan_vif);
+ flush_workqueue(adapter->priv->scan_workqueue);
+ ieee80211_stop_queues(adapter->hw);
+ ieee80211_restart_hw(adapter->hw);
+
/* Initialize device again */
+ adapter->priv->reinit_hw = true;
rsi_sdio_reinit_device(adapter);
#ifdef CONFIG_VEN_RSI_WOW
@@ -115,4 +115,6 @@ struct ieee80211_vif *rsi_get_vif(struct rsi_hw *adapter, u8 *mac);
#ifdef CONFIG_VEN_RSI_WOW
int rsi_config_wowlan(struct rsi_hw *adapter, struct cfg80211_wowlan *wowlan);
#endif
+void rsi_mac80211_hw_scan_cancel(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif);
#endif
@@ -331,6 +331,8 @@ struct rsi_common {
u8 ant_in_use;
bool suspend_in_prog;
bool hibernate_resume;
+ bool reinit_hw;
+ struct completion wlan_init_completion;
#ifdef CONFIG_VEN_RSI_WOW
u8 wow_flags;
#endif