Commit a01f58ca authored by Sanjay Kumar Konduri's avatar Sanjay Kumar Konduri Committed by Kleber Sacilotto de Souza

UBUNTU: SAUCE: Redpine: Add deep sleep enable before connection

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1753438
BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1753439

As in coex mode radio will be shared between BT and WLAN,
we need enable deep sleep before scan. Before scan deep
sleep can be disabled and re-enabed after scan. For any TX
frame before assoc, deep sleep shall be disable.
Signed-off-by: default avatarSanjay Kumar Konduri <sanjay.konduri@redpinesignals.com>
Signed-off-by: default avatarAmitkumar Karwar <amit.karwar@redpinesignals.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarShrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent f5ede563
...@@ -549,7 +549,8 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw, ...@@ -549,7 +549,8 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw,
struct rsi_hw *adapter = hw->priv; struct rsi_hw *adapter = hw->priv;
struct rsi_common *common = adapter->priv; struct rsi_common *common = adapter->priv;
struct ieee80211_hdr *wlh = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *wlh = (struct ieee80211_hdr *)skb->data;
struct ieee80211_vif *vif = adapter->vifs[adapter->sc_nvifs - 1]; struct ieee80211_vif *vif = adapter->vifs[adapter->sc_nvifs - 1];
struct ieee80211_bss_conf *bss = &adapter->vifs[0]->bss_conf;
#ifdef CONFIG_VEN_RSI_WOW #ifdef CONFIG_VEN_RSI_WOW
if (common->wow_flags & RSI_WOW_ENABLED) { if (common->wow_flags & RSI_WOW_ENABLED) {
...@@ -561,6 +562,10 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw, ...@@ -561,6 +562,10 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw,
ieee80211_free_txskb(common->priv->hw, skb); ieee80211_free_txskb(common->priv->hw, skb);
return; return;
} }
if ((!bss->assoc) &&
(adapter->ps_state == PS_ENABLED) &&
(vif->type == NL80211_IFTYPE_STATION))
rsi_disable_ps(adapter);
if ((common->coex_mode == 4) && if ((common->coex_mode == 4) &&
(vif->type == NL80211_IFTYPE_STATION) && (vif->type == NL80211_IFTYPE_STATION) &&
......
...@@ -2068,11 +2068,12 @@ EXPORT_SYMBOL_GPL(rsi_send_rx_filter_frame); ...@@ -2068,11 +2068,12 @@ EXPORT_SYMBOL_GPL(rsi_send_rx_filter_frame);
int rsi_send_ps_request(struct rsi_hw *adapter, bool enable) int rsi_send_ps_request(struct rsi_hw *adapter, bool enable)
{ {
struct rsi_common *common = adapter->priv; struct rsi_common *common = adapter->priv;
struct ieee80211_bss_conf *bss = &adapter->vifs[0]->bss_conf; struct ieee80211_bss_conf *bss;
struct rsi_request_ps *ps = NULL; struct rsi_request_ps *ps = NULL;
struct rsi_ps_info *ps_info = NULL; struct rsi_ps_info *ps_info = NULL;
struct sk_buff *skb = NULL; struct sk_buff *skb = NULL;
int frame_len = sizeof(*ps); int frame_len = sizeof(*ps);
bool assoc;
skb = dev_alloc_skb(frame_len); skb = dev_alloc_skb(frame_len);
if (!skb) if (!skb)
...@@ -2110,7 +2111,16 @@ int rsi_send_ps_request(struct rsi_hw *adapter, bool enable) ...@@ -2110,7 +2111,16 @@ int rsi_send_ps_request(struct rsi_hw *adapter, bool enable)
ps->ps_sleep.sleep_duration = ps->ps_sleep.sleep_duration =
cpu_to_le32(ps_info->deep_sleep_wakeup_period); cpu_to_le32(ps_info->deep_sleep_wakeup_period);
if (bss->assoc) if (adapter->sc_nvifs == 0) {
assoc = false;
} else {
bss = &adapter->vifs[0]->bss_conf;
if (bss->assoc)
assoc = true;
else
assoc = false;
}
if (assoc)
ps->ps_sleep.connected_sleep = CONNECTED_SLEEP; ps->ps_sleep.connected_sleep = CONNECTED_SLEEP;
else else
ps->ps_sleep.connected_sleep = DEEP_SLEEP; ps->ps_sleep.connected_sleep = DEEP_SLEEP;
...@@ -2396,6 +2406,7 @@ void rsi_scan_start(struct work_struct *work) ...@@ -2396,6 +2406,7 @@ void rsi_scan_start(struct work_struct *work)
return; return;
common->scan_in_prog = true; common->scan_in_prog = true;
rsi_disable_ps(common->priv);
for (ii =0; ii < scan_req->n_channels ; ii++) { for (ii =0; ii < scan_req->n_channels ; ii++) {
if (common->iface_down) if (common->iface_down)
...@@ -2458,7 +2469,7 @@ void rsi_scan_start(struct work_struct *work) ...@@ -2458,7 +2469,7 @@ void rsi_scan_start(struct work_struct *work)
del_timer(&common->scan_timer); del_timer(&common->scan_timer);
common->scan_in_prog = false; common->scan_in_prog = false;
rsi_enable_ps(common->priv);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))
info.aborted = false; info.aborted = false;
ieee80211_scan_completed(common->priv->hw, &info); ieee80211_scan_completed(common->priv->hw, &info);
...@@ -2653,6 +2664,7 @@ static int rsi_handle_ta_confirm(struct rsi_common *common, u8 *msg) ...@@ -2653,6 +2664,7 @@ static int rsi_handle_ta_confirm(struct rsi_common *common, u8 *msg)
complete(&common->wlan_init_completion); complete(&common->wlan_init_completion);
common->reinit_hw = false; common->reinit_hw = false;
} else { } else {
rsi_enable_ps(adapter);
return rsi_mac80211_attach(common); return rsi_mac80211_attach(common);
} }
} }
......
...@@ -100,7 +100,7 @@ void rsi_default_ps_params(struct rsi_hw *adapter) ...@@ -100,7 +100,7 @@ void rsi_default_ps_params(struct rsi_hw *adapter)
ps_info->num_bcns_per_lis_int = 0; ps_info->num_bcns_per_lis_int = 0;
ps_info->dtim_interval_duration = 0; ps_info->dtim_interval_duration = 0;
ps_info->num_dtims_per_sleep = 0; ps_info->num_dtims_per_sleep = 0;
ps_info->deep_sleep_wakeup_period = 200; ps_info->deep_sleep_wakeup_period = 0;
} }
EXPORT_SYMBOL_GPL(rsi_default_ps_params); EXPORT_SYMBOL_GPL(rsi_default_ps_params);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment