Skip to content

Commit

Permalink
qcacld: nuke rx_wakelock code entirely
Browse files Browse the repository at this point in the history
We're not allowing this to be configurable on this kernel.

Nuke this entirely to reduce resource usage.

Signed-off-by: Park Ju Hyung <[email protected]>
Signed-off-by: Ratoriku <[email protected]>
  • Loading branch information
arter97 authored and Nanhumly committed Aug 23, 2023
1 parent c78dd3c commit 29733c7
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 130 deletions.
7 changes: 0 additions & 7 deletions drivers/staging/qcacld-3.0/core/hdd/inc/wlan_hdd_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -16366,7 +16360,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;
Expand Down
1 change: 0 additions & 1 deletion drivers/staging/qcacld-3.0/core/hdd/inc/wlan_hdd_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,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
Expand Down
4 changes: 0 additions & 4 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -4541,10 +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,
0, 0, 0),

REG_VARIABLE(CFG_SAP_CH_SWITCH_BEACON_CNT, WLAN_PARAM_Integer,
struct hdd_config, sap_chanswitch_beacon_cnt,
Expand Down
31 changes: 0 additions & 31 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6722,32 +6722,6 @@ static int hdd_init_netlink_services(hdd_context_t *hdd_ctx)
return ret;
}

/**
* 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.
Expand Down Expand Up @@ -6802,8 +6776,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);
Expand Down Expand Up @@ -8911,8 +8883,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;
Expand Down Expand Up @@ -8943,7 +8913,6 @@ static int hdd_context_init(hdd_context_t *hdd_ctx)

scan_destroy:
hdd_scan_context_destroy(hdd_ctx);
hdd_rx_wake_lock_destroy(hdd_ctx);
hdd_tdls_context_destroy(hdd_ctx);

list_destroy:
Expand Down
12 changes: 0 additions & 12 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_softap_tx_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,18 +929,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
*/
Expand Down
75 changes: 0 additions & 75 deletions drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_tx_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,66 +1489,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,
Expand Down Expand Up @@ -1911,7 +1851,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;
Expand Down Expand Up @@ -2008,20 +1947,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
*/
Expand Down

0 comments on commit 29733c7

Please sign in to comment.