Re: [PATCH 09/10] rsi: tx improvements

2018-03-15 Thread Amitkumar Karwar
On Tue, Mar 13, 2018 at 8:59 PM, Kalle Valo  wrote:
> Amitkumar Karwar  writes:
>
>> From: Prameela Rani Garnepudi 
>>
>> Changes done to improve TX path:
>> 1. Max number of frames to aggregate is increased to 8
>> 2. Bootup parameters updated.
>> 3. registering 5g band is done only when device supports
>> 4. Vif is properly taken to enable power save.
>> 5. When coex mode exist, power save on by default is set
>
> If you have a list of changes in the commit log to me that's a strong
> indication that you need to split the patches.
>
> Also I don't see any answers to question "Why?".

Sure. I will split into multiple incremental patches and submit with
proper commit log.

Regards,
Amitkumar


Re: [PATCH 09/10] rsi: tx improvements

2018-03-13 Thread Kalle Valo
Amitkumar Karwar  writes:

> From: Prameela Rani Garnepudi 
>
> Changes done to improve TX path:
> 1. Max number of frames to aggregate is increased to 8
> 2. Bootup parameters updated.
> 3. registering 5g band is done only when device supports
> 4. Vif is properly taken to enable power save.
> 5. When coex mode exist, power save on by default is set

If you have a list of changes in the commit log to me that's a strong
indication that you need to split the patches.

Also I don't see any answers to question "Why?".

-- 
Kalle Valo


[PATCH 09/10] rsi: tx improvements

2018-03-05 Thread Amitkumar Karwar
From: Prameela Rani Garnepudi 

Changes done to improve TX path:
1. Max number of frames to aggregate is increased to 8
2. Bootup parameters updated.
3. registering 5g band is done only when device supports
4. Vif is properly taken to enable power save.
5. When coex mode exist, power save on by default is set

Signed-off-by: Prameela Rani Garnepudi 
---
 drivers/net/wireless/rsi/rsi_91x_core.c |  4 +++-
 drivers/net/wireless/rsi/rsi_91x_mac80211.c | 36 +
 drivers/net/wireless/rsi/rsi_boot_params.h  |  3 ++-
 drivers/net/wireless/rsi/rsi_mgmt.h |  2 ++
 4 files changed, 33 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_core.c 
b/drivers/net/wireless/rsi/rsi_91x_core.c
index 3ca468b9..1f1b972 100644
--- a/drivers/net/wireless/rsi/rsi_91x_core.c
+++ b/drivers/net/wireless/rsi/rsi_91x_core.c
@@ -432,7 +432,9 @@ void rsi_core_xmit(struct rsi_common *common, struct 
sk_buff *skb)
}
} else {
if (ieee80211_is_data_qos(wh->frame_control)) {
-   tid = (skb->data[24] & IEEE80211_QOS_TID);
+   u8 *qos = ieee80211_get_qos_ctl(wh);
+
+   tid = *qos & IEEE80211_QOS_CTL_TID_MASK;
skb->priority = TID_TO_WME_AC(tid);
} else {
tid = IEEE80211_NONQOS_TID;
diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c 
b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index 63d43fc..70b2d61 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -240,6 +240,9 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw 
*hw,
 
rsi_dbg(INFO_ZONE, "* Hardware scan start *\n");
 
+   if (common->iface_down)
+   return -ENETDOWN;
+
if (common->fsm_state != FSM_MAC_INIT_DONE)
return -ENODEV;
 
@@ -697,7 +700,7 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
 
/* Power save parameters */
if (changed & IEEE80211_CONF_CHANGE_PS) {
-   struct ieee80211_vif *vif;
+   struct ieee80211_vif *vif, *sta_vif = NULL;
unsigned long flags;
int i, set_ps = 1;
 
@@ -711,13 +714,20 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
set_ps = 0;
break;
}
+   if (vif->type == NL80211_IFTYPE_STATION ||
+   vif->type == NL80211_IFTYPE_P2P_CLIENT) {
+   if (!sta_vif)
+   sta_vif = vif;
+   else if (vif->bss_conf.assoc)
+   sta_vif = vif;
+   }
}
-   if (set_ps) {
+   if (set_ps && sta_vif) {
spin_lock_irqsave(>ps_lock, flags);
if (conf->flags & IEEE80211_CONF_PS)
-   rsi_enable_ps(adapter, vif);
+   rsi_enable_ps(adapter, sta_vif);
else
-   rsi_disable_ps(adapter, vif);
+   rsi_disable_ps(adapter, sta_vif);
spin_unlock_irqrestore(>ps_lock, flags);
}
}
@@ -2051,9 +2061,16 @@ int rsi_mac80211_attach(struct rsi_common *common)
hw->uapsd_queues = RSI_IEEE80211_UAPSD_QUEUES;
hw->uapsd_max_sp_len = IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL;
 
-   hw->max_tx_aggregation_subframes = 6;
+   hw->max_tx_aggregation_subframes = RSI_MAX_TX_AGGR_FRMS;
+   hw->max_rx_aggregation_subframes = RSI_MAX_RX_AGGR_FRMS;
rsi_register_rates_channels(adapter, NL80211_BAND_2GHZ);
-   rsi_register_rates_channels(adapter, NL80211_BAND_5GHZ);
+   wiphy->bands[NL80211_BAND_2GHZ] =
+   >sbands[NL80211_BAND_2GHZ];
+   if (common->num_supp_bands > 1) {
+   rsi_register_rates_channels(adapter, NL80211_BAND_5GHZ);
+   wiphy->bands[NL80211_BAND_5GHZ] =
+   >sbands[NL80211_BAND_5GHZ];
+   }
hw->rate_control_algorithm = "AARF";
 
SET_IEEE80211_PERM_ADDR(hw, common->mac_addr);
@@ -2074,10 +2091,6 @@ int rsi_mac80211_attach(struct rsi_common *common)
 
wiphy->available_antennas_rx = 1;
wiphy->available_antennas_tx = 1;
-   wiphy->bands[NL80211_BAND_2GHZ] =
-   >sbands[NL80211_BAND_2GHZ];
-   wiphy->bands[NL80211_BAND_5GHZ] =
-   >sbands[NL80211_BAND_5GHZ];
 
/* AP Parameters */
wiphy->max_ap_assoc_sta = rsi_max_ap_stas[common->oper_mode - 1];
@@ -2106,6 +2119,9 @@ int rsi_mac80211_attach(struct rsi_common *common)
wiphy->iface_combinations = rsi_iface_combinations;