|
@@ -983,7 +983,7 @@ const char *hdd_reason_type_to_string(enum netif_reason_type reason)
|
|
|
CASE_RETURN_STRING(WLAN_PEER_UNAUTHORISED);
|
|
|
CASE_RETURN_STRING(WLAN_THERMAL_MITIGATION);
|
|
|
default:
|
|
|
- return "Unknown";
|
|
|
+ return "Invalid";
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1010,7 +1010,7 @@ const char *hdd_action_type_to_string(enum netif_action_type action)
|
|
|
CASE_RETURN_STRING(WLAN_NETIF_CARRIER_ON);
|
|
|
CASE_RETURN_STRING(WLAN_NETIF_CARRIER_OFF);
|
|
|
default:
|
|
|
- return "Unknown";
|
|
|
+ return "Invalid";
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1063,6 +1063,34 @@ void wlan_hdd_update_txq_timestamp(struct net_device *dev)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * wlan_hdd_update_unpause_time() - update unpause time
|
|
|
+ * @adapter: adapter handle
|
|
|
+ *
|
|
|
+ * Return: none
|
|
|
+ */
|
|
|
+static void wlan_hdd_update_unpause_time(hdd_adapter_t *adapter)
|
|
|
+{
|
|
|
+ qdf_time_t curr_time = qdf_system_ticks();
|
|
|
+
|
|
|
+ adapter->total_unpause_time += curr_time - adapter->last_time;
|
|
|
+ adapter->last_time = curr_time;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_hdd_update_pause_time() - update pause time
|
|
|
+ * @adapter: adapter handle
|
|
|
+ *
|
|
|
+ * Return: none
|
|
|
+ */
|
|
|
+static void wlan_hdd_update_pause_time(hdd_adapter_t *adapter)
|
|
|
+{
|
|
|
+ qdf_time_t curr_time = qdf_system_ticks();
|
|
|
+
|
|
|
+ adapter->total_pause_time += curr_time - adapter->last_time;
|
|
|
+ adapter->last_time = curr_time;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* wlan_hdd_netif_queue_control() - Use for netif_queue related actions
|
|
|
* @adapter: adapter handle
|
|
@@ -1100,6 +1128,7 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter,
|
|
|
if (!adapter->pause_map) {
|
|
|
netif_tx_stop_all_queues(adapter->dev);
|
|
|
wlan_hdd_update_txq_timestamp(adapter->dev);
|
|
|
+ wlan_hdd_update_unpause_time(adapter);
|
|
|
}
|
|
|
adapter->pause_map |= (1 << reason);
|
|
|
spin_unlock_bh(&adapter->pause_map_lock);
|
|
@@ -1108,16 +1137,20 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter,
|
|
|
case WLAN_START_ALL_NETIF_QUEUE:
|
|
|
spin_lock_bh(&adapter->pause_map_lock);
|
|
|
adapter->pause_map &= ~(1 << reason);
|
|
|
- if (!adapter->pause_map)
|
|
|
+ if (!adapter->pause_map) {
|
|
|
netif_tx_start_all_queues(adapter->dev);
|
|
|
+ wlan_hdd_update_pause_time(adapter);
|
|
|
+ }
|
|
|
spin_unlock_bh(&adapter->pause_map_lock);
|
|
|
break;
|
|
|
|
|
|
case WLAN_WAKE_ALL_NETIF_QUEUE:
|
|
|
spin_lock_bh(&adapter->pause_map_lock);
|
|
|
adapter->pause_map &= ~(1 << reason);
|
|
|
- if (!adapter->pause_map)
|
|
|
+ if (!adapter->pause_map) {
|
|
|
netif_tx_wake_all_queues(adapter->dev);
|
|
|
+ wlan_hdd_update_pause_time(adapter);
|
|
|
+ }
|
|
|
spin_unlock_bh(&adapter->pause_map_lock);
|
|
|
break;
|
|
|
|
|
@@ -1126,6 +1159,7 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter,
|
|
|
if (!adapter->pause_map) {
|
|
|
netif_tx_stop_all_queues(adapter->dev);
|
|
|
wlan_hdd_update_txq_timestamp(adapter->dev);
|
|
|
+ wlan_hdd_update_unpause_time(adapter);
|
|
|
}
|
|
|
adapter->pause_map |= (1 << reason);
|
|
|
netif_carrier_off(adapter->dev);
|
|
@@ -1136,8 +1170,10 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter,
|
|
|
spin_lock_bh(&adapter->pause_map_lock);
|
|
|
netif_carrier_on(adapter->dev);
|
|
|
adapter->pause_map &= ~(1 << reason);
|
|
|
- if (!adapter->pause_map)
|
|
|
+ if (!adapter->pause_map) {
|
|
|
netif_tx_start_all_queues(adapter->dev);
|
|
|
+ wlan_hdd_update_pause_time(adapter);
|
|
|
+ }
|
|
|
spin_unlock_bh(&adapter->pause_map_lock);
|
|
|
break;
|
|
|
|
|
@@ -1146,6 +1182,7 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter,
|
|
|
if (!adapter->pause_map) {
|
|
|
netif_tx_disable(adapter->dev);
|
|
|
wlan_hdd_update_txq_timestamp(adapter->dev);
|
|
|
+ wlan_hdd_update_unpause_time(adapter);
|
|
|
}
|
|
|
adapter->pause_map |= (1 << reason);
|
|
|
spin_unlock_bh(&adapter->pause_map_lock);
|
|
@@ -1156,6 +1193,7 @@ void wlan_hdd_netif_queue_control(hdd_adapter_t *adapter,
|
|
|
if (!adapter->pause_map) {
|
|
|
netif_tx_disable(adapter->dev);
|
|
|
wlan_hdd_update_txq_timestamp(adapter->dev);
|
|
|
+ wlan_hdd_update_unpause_time(adapter);
|
|
|
}
|
|
|
adapter->pause_map |= (1 << reason);
|
|
|
netif_carrier_off(adapter->dev);
|