OSDN Git Service

qcacld: nuke rx_wakelock code entirely
authorPark Ju Hyung <qkrwngud825@gmail.com>
Thu, 7 Mar 2019 02:11:33 +0000 (11:11 +0900)
committer0ranko0P <ranko0p@outlook.com>
Sat, 7 Dec 2019 12:40:06 +0000 (20:40 +0800)
We're not allowing this to be configurable on this kernel.

Nuke this entirely to reduce resource usage.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
drivers/staging/qcacld-3.0/core/hdd/inc/wlan_hdd_cfg.h
drivers/staging/qcacld-3.0/core/hdd/inc/wlan_hdd_main.h
drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_cfg.c
drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_main.c
drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_softap_tx_rx.c
drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_tx_rx.c

index 09b887c..6be259a 100644 (file)
@@ -10833,12 +10833,6 @@ enum restart_beaconing_on_ch_avoid_rule {
 #define CFG_CRASH_FW_TIMEOUT_ENABLE     (1)
 #define CFG_CRASH_FW_TIMEOUT_DEFAULT    (1)
 
-/* Hold wakelock for unicast RX packets for the specified duration  */
-#define CFG_RX_WAKELOCK_TIMEOUT_NAME     "rx_wakelock_timeout"
-#define CFG_RX_WAKELOCK_TIMEOUT_DEFAULT  (50)
-#define CFG_RX_WAKELOCK_TIMEOUT_MIN      (0)
-#define CFG_RX_WAKELOCK_TIMEOUT_MAX      (100)
-
 /*
  * <ini>
  * enable_5g_band_pref - Enable preference for 5G from INI.
@@ -16295,7 +16289,6 @@ struct hdd_config {
        /* beacon count before channel switch */
        uint8_t sap_chanswitch_beacon_cnt;
        uint8_t sap_chanswitch_mode;
-       uint32_t rx_wakelock_timeout;
 #ifdef WLAN_FEATURE_WOW_PULSE
        bool wow_pulse_support;
        uint8_t wow_pulse_pin;
index 373bdd1..efe5845 100644 (file)
@@ -2026,7 +2026,6 @@ struct hdd_context_s {
        /** P2P Device MAC Address for the adapter  */
        struct qdf_mac_addr p2pDeviceAddress;
 
-       qdf_wake_lock_t rx_wake_lock;
        qdf_wake_lock_t sap_wake_lock;
 
 #ifdef FEATURE_WLAN_TDLS
index 2f32051..66ad5cc 100644 (file)
@@ -4541,12 +4541,6 @@ struct reg_table_entry g_registry_table[] = {
                CFG_CRASH_FW_TIMEOUT_DEFAULT,
                CFG_CRASH_FW_TIMEOUT_DISABLE,
                CFG_CRASH_FW_TIMEOUT_ENABLE),
-       REG_VARIABLE(CFG_RX_WAKELOCK_TIMEOUT_NAME, WLAN_PARAM_Integer,
-               struct hdd_config, rx_wakelock_timeout,
-               VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
-               CFG_RX_WAKELOCK_TIMEOUT_DEFAULT,
-               CFG_RX_WAKELOCK_TIMEOUT_MIN,
-               CFG_RX_WAKELOCK_TIMEOUT_MAX),
 
        REG_VARIABLE(CFG_SAP_CH_SWITCH_BEACON_CNT, WLAN_PARAM_Integer,
                     struct hdd_config, sap_chanswitch_beacon_cnt,
index 70ba5cd..4bb447d 100644 (file)
@@ -6643,32 +6643,6 @@ out:
 }
 
 /**
- * hdd_rx_wake_lock_destroy() - Destroy RX wakelock
- * @hdd_ctx:   HDD context.
- *
- * Destroy RX wakelock.
- *
- * Return: None.
- */
-static void hdd_rx_wake_lock_destroy(hdd_context_t *hdd_ctx)
-{
-       qdf_wake_lock_destroy(&hdd_ctx->rx_wake_lock);
-}
-
-/**
- * hdd_rx_wake_lock_create() - Create RX wakelock
- * @hdd_ctx:   HDD context.
- *
- * Create RX wakelock.
- *
- * Return: None.
- */
-static void hdd_rx_wake_lock_create(hdd_context_t *hdd_ctx)
-{
-       qdf_wake_lock_create(&hdd_ctx->rx_wake_lock, "qcom_rx_wakelock");
-}
-
-/**
  * hdd_roc_context_init() - Init ROC context
  * @hdd_ctx:   HDD context.
  *
@@ -6722,8 +6696,6 @@ static int hdd_context_deinit(hdd_context_t *hdd_ctx)
 
        hdd_sap_context_destroy(hdd_ctx);
 
-       hdd_rx_wake_lock_destroy(hdd_ctx);
-
        hdd_tdls_context_destroy(hdd_ctx);
 
        hdd_scan_context_destroy(hdd_ctx);
@@ -8827,8 +8799,6 @@ static int hdd_context_init(hdd_context_t *hdd_ctx)
 
        hdd_tdls_context_init(hdd_ctx, false);
 
-       hdd_rx_wake_lock_create(hdd_ctx);
-
        ret = hdd_sap_context_init(hdd_ctx);
        if (ret)
                goto scan_destroy;
@@ -8859,7 +8829,6 @@ sap_destroy:
 
 scan_destroy:
        hdd_scan_context_destroy(hdd_ctx);
-       hdd_rx_wake_lock_destroy(hdd_ctx);
        hdd_tdls_context_destroy(hdd_ctx);
 
 list_destroy:
index c66a8ab..1635ba0 100644 (file)
@@ -922,18 +922,6 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
 
        skb->protocol = eth_type_trans(skb, skb->dev);
 
-       /* hold configurable wakelock for unicast traffic */
-       if (pHddCtx->config->rx_wakelock_timeout &&
-           skb->pkt_type != PACKET_BROADCAST &&
-           skb->pkt_type != PACKET_MULTICAST) {
-               cds_host_diag_log_work(&pHddCtx->rx_wake_lock,
-                                      pHddCtx->config->rx_wakelock_timeout,
-                                      WIFI_POWER_EVENT_WAKELOCK_HOLD_RX);
-               qdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock,
-                                             pHddCtx->config->
-                                                     rx_wakelock_timeout);
-       }
-
        /* Remove SKB from internal tracking table before submitting
         * it to stack
         */
index d5658b2..2c3ab46 100644 (file)
@@ -1487,66 +1487,6 @@ static bool hdd_is_duplicate_ip_arp(struct sk_buff *skb)
        return false;
 }
 
-/**
- * hdd_is_arp_local() - check if local or non local arp
- * @skb: pointer to sk_buff
- *
- * Return: true if local arp or false otherwise.
- */
-static bool hdd_is_arp_local(struct sk_buff *skb)
-{
-       struct arphdr *arp;
-       struct in_ifaddr **ifap = NULL;
-       struct in_ifaddr *ifa = NULL;
-       struct in_device *in_dev;
-       unsigned char *arp_ptr;
-       __be32 tip;
-
-       arp = (struct arphdr *)skb->data;
-       if (arp->ar_op == htons(ARPOP_REQUEST)) {
-               in_dev = __in_dev_get_rtnl(skb->dev);
-               if (in_dev) {
-                       for (ifap = &in_dev->ifa_list; (ifa = *ifap) != NULL;
-                               ifap = &ifa->ifa_next) {
-                               if (!strcmp(skb->dev->name, ifa->ifa_label))
-                                       break;
-                       }
-               }
-
-               if (ifa && ifa->ifa_local) {
-                       arp_ptr = (unsigned char *)(arp + 1);
-                       arp_ptr += (skb->dev->addr_len + 4 +
-                                       skb->dev->addr_len);
-                       memcpy(&tip, arp_ptr, 4);
-                       hdd_debug("ARP packet: local IP: %x dest IP: %x",
-                               ifa->ifa_local, tip);
-                       if (ifa->ifa_local == tip)
-                               return true;
-               }
-       }
-
-       return false;
-}
-
-/**
- * hdd_is_rx_wake_lock_needed() - check if wake lock is needed
- * @skb: pointer to sk_buff
- *
- * RX wake lock is needed for:
- * 1) Unicast data packet OR
- * 2) Local ARP data packet
- *
- * Return: true if wake lock is needed or false otherwise.
- */
-static bool hdd_is_rx_wake_lock_needed(struct sk_buff *skb)
-{
-       if ((skb->pkt_type != PACKET_BROADCAST &&
-            skb->pkt_type != PACKET_MULTICAST) || hdd_is_arp_local(skb))
-               return true;
-
-       return false;
-}
-
 #ifdef WLAN_FEATURE_TSF_PLUS
 static inline void hdd_tsf_timestamp_rx(hdd_context_t *hdd_ctx,
                                        qdf_nbuf_t netbuf,
@@ -1909,7 +1849,6 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
        struct sk_buff *skb = NULL;
        hdd_station_ctx_t *pHddStaCtx = NULL;
        unsigned int cpu_index;
-       bool wake_lock = false;
        bool is_arp = false;
        bool track_arp = false;
        uint8_t pkt_type = 0;
@@ -2006,20 +1945,6 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf)
                return QDF_STATUS_SUCCESS;
        }
 
-       /* hold configurable wakelock for unicast traffic */
-       if (pHddCtx->config->rx_wakelock_timeout &&
-           pHddStaCtx->conn_info.uIsAuthenticated)
-               wake_lock = hdd_is_rx_wake_lock_needed(skb);
-
-       if (wake_lock) {
-               cds_host_diag_log_work(&pHddCtx->rx_wake_lock,
-                                      pHddCtx->config->rx_wakelock_timeout,
-                                      WIFI_POWER_EVENT_WAKELOCK_HOLD_RX);
-               qdf_wake_lock_timeout_acquire(&pHddCtx->rx_wake_lock,
-                                             pHddCtx->config->
-                                                     rx_wakelock_timeout);
-       }
-
        /* Remove SKB from internal tracking table before submitting
         * it to stack
         */