Loading Kbuild +7 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,9 @@ ifeq ($(KERNEL_BUILD), 0) #Flag to enable offload packets feature CONFIG_WLAN_OFFLOAD_PACKETS := y #Flag to enable packet capture mode CONFIG_WLAN_FEATURE_PKT_CAPTURE := y #enable TSF get feature CONFIG_WLAN_SYNC_TSF := y #Enable DSRC feature Loading Loading @@ -1316,6 +1319,10 @@ ifeq ($(CONFIG_WLAN_FEATURE_FILS),y) CDEFINES += -DWLAN_FEATURE_FILS_SK endif ifeq ($(CONFIG_WLAN_FEATURE_PKT_CAPTURE),y) CDEFINES += -DWLAN_FEATURE_PKT_CAPTURE endif ifeq ($(CONFIG_CNSS), y) ifeq ($(CONFIG_CNSS_SDIO), y) CDEFINES += -DCONFIG_PLD_SDIO_CNSS Loading core/cds/inc/cds_api.h +22 −1 Original line number Diff line number Diff line /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -582,4 +582,25 @@ QDF_STATUS cds_register_mode_change_cb(send_mode_change_event_cb callback); * Return: QDF_STATUS */ QDF_STATUS cds_deregister_mode_change_cb(void); /** * cds_get_pktcap_mode_enable() - get pktcap mode enable/disable * * Get the pktcap mode enable/disable from ini * * Return: 0 - disable, 1 - enable */ bool cds_get_pktcap_mode_enable(void); /** * cds_get_pktcapture_mode() - get pktcapture mode value * * Get the pktcapture mode value from hdd context * * Return: 0 - disable * 1 - Mgmt packets * 2 - Data packets * 3 - Both Mgmt and Data packets */ uint8_t cds_get_pktcapture_mode(void); #endif /* if !defined __CDS_API_H */ core/cds/inc/cds_sched.h +150 −1 Original line number Diff line number Diff line /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -79,8 +79,19 @@ #define CDS_MAX_OL_RX_PKT 4000 #endif /* ** Maximum number of cds messages to be allocated for ** OL MON thread. */ #define CDS_MAX_OL_MON_PKT 4000 typedef void (*cds_ol_rx_thread_cb)(void *context, void *rxpkt, uint16_t staid); typedef void (*cds_ol_mon_thread_cb)( void *context, void *monpkt, uint8_t vdev_id, uint8_t tid, uint8_t status, bool pkt_format); typedef int (*send_mode_change_event_cb)(void); /* Loading Loading @@ -113,6 +124,31 @@ struct cds_ol_rx_pkt { }; /* ** CDS message wrapper for mon data from TXRX */ struct cds_ol_mon_pkt { struct list_head list; void *context; /* mon skb */ void *monpkt; /* vdev id to which this packet is destined */ uint8_t vdev_id; uint8_t tid; /* Tx packet status */ uint8_t status; /* 0 = 802.3 format , 1 = 802.11 format */ bool pkt_format; /* Call back to further send this packet to txrx layer */ cds_ol_mon_thread_cb callback; }; /* ** CDS Scheduler context ** The scheduler context contains the following: Loading Loading @@ -204,6 +240,46 @@ typedef struct _cds_sched_context { /* high throughput required */ bool high_throughput_required; #endif /* MON thread lock */ spinlock_t ol_mon_thread_lock; /* OL MON thread handle */ struct task_struct *ol_mon_thread; /* Handle of Event for MON thread to signal startup */ struct completion ol_mon_start_event; /* Completion object to suspend OL MON thread */ struct completion ol_suspend_mon_event; /* Completion objext to resume OL MON thread */ struct completion ol_resume_mon_event; /* Completion object for OL MON thread shutdown */ struct completion ol_mon_shutdown; /* Waitq for OL MON thread */ wait_queue_head_t ol_mon_wait_queue; unsigned long ol_mon_event_flag; /* MON buffer queue */ struct list_head ol_mon_thread_queue; /* Spinlock to synchronize between tasklet and thread */ spinlock_t ol_mon_queue_lock; /* MON queue length */ unsigned int ol_mon_queue_len; /* Lock to synchronize free buffer queue access */ spinlock_t cds_ol_mon_pkt_freeq_lock; /* Free message queue for OL MON processing */ struct list_head cds_ol_mon_pkt_freeq; /* MON thread affinity cpu */ unsigned long mon_thread_cpu; } cds_sched_context, *p_cds_sched_context; /** Loading Loading @@ -529,6 +605,79 @@ static inline int cds_sched_handle_throughput_req( #endif /** * cds_drop_monpkt() - API to drop pending mon packets * @pschedcontext: Pointer to the global CDS Sched Context * * This api drops all the pending packets in the queue. * * Return: none */ void cds_drop_monpkt(p_cds_sched_context pschedcontext); /** * cds_indicate_monpkt() - API to Indicate rx data packet * @pschedcontext: pointer to CDS Sched Context * @pkt: CDS OL MON pkt pointer containing to mon data message buffer * * Return: none */ void cds_indicate_monpkt(p_cds_sched_context pschedcontext, struct cds_ol_mon_pkt *pkt); /** * cds_wakeup_mon_thread() - wakeup mon thread * @Arg: Pointer to the global CDS Sched Context * * This api wake up cds_ol_mon_thread() to process pkt * * Return: none */ void cds_wakeup_mon_thread(p_cds_sched_context pschedcontext); /** * cds_close_mon_thread() - close the Tlshim MON thread * @p_cds_context: Pointer to the global CDS Context * * This api closes the Tlshim MON thread: * * Return: qdf status */ QDF_STATUS cds_close_mon_thread(void *p_cds_context); /** * cds_alloc_ol_mon_pkt() - API to return next available cds message * @pSchedContext: Pointer to the global CDS Sched Context * * This api returns next available cds message buffer used for mon data * processing * * Return: Pointer to cds message buffer */ struct cds_ol_mon_pkt *cds_alloc_ol_mon_pkt(p_cds_sched_context pschedcontext); /** * cds_free_ol_mon_pkt() - api to release cds message to the freeq * This api returns the cds message used for mon data to the free queue * @pSchedContext: Pointer to the global CDS Sched Context * @pkt: CDS message buffer to be returned to free queue. * * Return: none */ void cds_free_ol_mon_pkt(p_cds_sched_context pschedcontext, struct cds_ol_mon_pkt *pkt); /** * cds_free_ol_mon_pkt_freeq() - free cds buffer free queue * @pSchedContext - pointer to the global CDS Sched Context * * This API does mem free of the buffers available in free cds buffer * queue which is used for mon Data processing. * * Return: none */ void cds_free_ol_mon_pkt_freeq(p_cds_sched_context pschedcontext); /*--------------------------------------------------------------------------- \brief cds_sched_open() - initialize the CDS Scheduler Loading core/cds/src/cds_api.c +35 −1 Original line number Diff line number Diff line /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -966,6 +966,14 @@ QDF_STATUS cds_post_disable(void) return QDF_STATUS_E_INVAL; } if (cds_get_pktcap_mode_enable()) { qdf_status = cds_close_mon_thread(gp_cds_context); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { cds_err("Failed to close MON thread!"); return QDF_STATUS_E_INVAL; } } ol_txrx_pdev_pre_detach(txrx_pdev, 1); return QDF_STATUS_SUCCESS; Loading Loading @@ -3055,3 +3063,29 @@ QDF_STATUS cds_deregister_mode_change_cb(void) return QDF_STATUS_SUCCESS; } bool cds_get_pktcap_mode_enable(void) { hdd_context_t *hdd_ctx; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { cds_err("HDD context is NULL"); return false; } return hdd_ctx->config->pktcap_mode_enable; } uint8_t cds_get_pktcapture_mode(void) { hdd_context_t *hdd_ctx; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { cds_err("HDD context is NULL"); return 0; } return hdd_ctx->pktcapture_mode; } core/cds/src/cds_concurrency.c +15 −0 Original line number Diff line number Diff line Loading @@ -5936,6 +5936,13 @@ static QDF_STATUS cds_pcl_modification_for_p2p_go( cds_err("failed to get enabled channel modified pcl for GO"); return status; } status = cds_modify_sap_pcl_based_on_srd( pcl_channels, pcl_weight, len); if (QDF_IS_STATUS_ERROR(status)) { cds_err("failed to get srd modified pcl for SAP"); return status; } cds_debug("enabled channel modified pcl len:%d", *len); for (i = 0; i < *len; i++) cds_debug("chan:%d weight:%d", Loading Loading @@ -6140,6 +6147,14 @@ QDF_STATUS cds_get_pcl(enum cds_con_mode mode, pcl_channels[i], pcl_weight[i]); } status = cds_mode_specific_modification_on_pcl(pcl_channels, pcl_weight, len, mode); if (QDF_IS_STATUS_ERROR(status)) { cds_err("failed to get modified pcl for mode %d", mode); return status; } return QDF_STATUS_SUCCESS; } Loading Loading
Kbuild +7 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,9 @@ ifeq ($(KERNEL_BUILD), 0) #Flag to enable offload packets feature CONFIG_WLAN_OFFLOAD_PACKETS := y #Flag to enable packet capture mode CONFIG_WLAN_FEATURE_PKT_CAPTURE := y #enable TSF get feature CONFIG_WLAN_SYNC_TSF := y #Enable DSRC feature Loading Loading @@ -1316,6 +1319,10 @@ ifeq ($(CONFIG_WLAN_FEATURE_FILS),y) CDEFINES += -DWLAN_FEATURE_FILS_SK endif ifeq ($(CONFIG_WLAN_FEATURE_PKT_CAPTURE),y) CDEFINES += -DWLAN_FEATURE_PKT_CAPTURE endif ifeq ($(CONFIG_CNSS), y) ifeq ($(CONFIG_CNSS_SDIO), y) CDEFINES += -DCONFIG_PLD_SDIO_CNSS Loading
core/cds/inc/cds_api.h +22 −1 Original line number Diff line number Diff line /* * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -582,4 +582,25 @@ QDF_STATUS cds_register_mode_change_cb(send_mode_change_event_cb callback); * Return: QDF_STATUS */ QDF_STATUS cds_deregister_mode_change_cb(void); /** * cds_get_pktcap_mode_enable() - get pktcap mode enable/disable * * Get the pktcap mode enable/disable from ini * * Return: 0 - disable, 1 - enable */ bool cds_get_pktcap_mode_enable(void); /** * cds_get_pktcapture_mode() - get pktcapture mode value * * Get the pktcapture mode value from hdd context * * Return: 0 - disable * 1 - Mgmt packets * 2 - Data packets * 3 - Both Mgmt and Data packets */ uint8_t cds_get_pktcapture_mode(void); #endif /* if !defined __CDS_API_H */
core/cds/inc/cds_sched.h +150 −1 Original line number Diff line number Diff line /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -79,8 +79,19 @@ #define CDS_MAX_OL_RX_PKT 4000 #endif /* ** Maximum number of cds messages to be allocated for ** OL MON thread. */ #define CDS_MAX_OL_MON_PKT 4000 typedef void (*cds_ol_rx_thread_cb)(void *context, void *rxpkt, uint16_t staid); typedef void (*cds_ol_mon_thread_cb)( void *context, void *monpkt, uint8_t vdev_id, uint8_t tid, uint8_t status, bool pkt_format); typedef int (*send_mode_change_event_cb)(void); /* Loading Loading @@ -113,6 +124,31 @@ struct cds_ol_rx_pkt { }; /* ** CDS message wrapper for mon data from TXRX */ struct cds_ol_mon_pkt { struct list_head list; void *context; /* mon skb */ void *monpkt; /* vdev id to which this packet is destined */ uint8_t vdev_id; uint8_t tid; /* Tx packet status */ uint8_t status; /* 0 = 802.3 format , 1 = 802.11 format */ bool pkt_format; /* Call back to further send this packet to txrx layer */ cds_ol_mon_thread_cb callback; }; /* ** CDS Scheduler context ** The scheduler context contains the following: Loading Loading @@ -204,6 +240,46 @@ typedef struct _cds_sched_context { /* high throughput required */ bool high_throughput_required; #endif /* MON thread lock */ spinlock_t ol_mon_thread_lock; /* OL MON thread handle */ struct task_struct *ol_mon_thread; /* Handle of Event for MON thread to signal startup */ struct completion ol_mon_start_event; /* Completion object to suspend OL MON thread */ struct completion ol_suspend_mon_event; /* Completion objext to resume OL MON thread */ struct completion ol_resume_mon_event; /* Completion object for OL MON thread shutdown */ struct completion ol_mon_shutdown; /* Waitq for OL MON thread */ wait_queue_head_t ol_mon_wait_queue; unsigned long ol_mon_event_flag; /* MON buffer queue */ struct list_head ol_mon_thread_queue; /* Spinlock to synchronize between tasklet and thread */ spinlock_t ol_mon_queue_lock; /* MON queue length */ unsigned int ol_mon_queue_len; /* Lock to synchronize free buffer queue access */ spinlock_t cds_ol_mon_pkt_freeq_lock; /* Free message queue for OL MON processing */ struct list_head cds_ol_mon_pkt_freeq; /* MON thread affinity cpu */ unsigned long mon_thread_cpu; } cds_sched_context, *p_cds_sched_context; /** Loading Loading @@ -529,6 +605,79 @@ static inline int cds_sched_handle_throughput_req( #endif /** * cds_drop_monpkt() - API to drop pending mon packets * @pschedcontext: Pointer to the global CDS Sched Context * * This api drops all the pending packets in the queue. * * Return: none */ void cds_drop_monpkt(p_cds_sched_context pschedcontext); /** * cds_indicate_monpkt() - API to Indicate rx data packet * @pschedcontext: pointer to CDS Sched Context * @pkt: CDS OL MON pkt pointer containing to mon data message buffer * * Return: none */ void cds_indicate_monpkt(p_cds_sched_context pschedcontext, struct cds_ol_mon_pkt *pkt); /** * cds_wakeup_mon_thread() - wakeup mon thread * @Arg: Pointer to the global CDS Sched Context * * This api wake up cds_ol_mon_thread() to process pkt * * Return: none */ void cds_wakeup_mon_thread(p_cds_sched_context pschedcontext); /** * cds_close_mon_thread() - close the Tlshim MON thread * @p_cds_context: Pointer to the global CDS Context * * This api closes the Tlshim MON thread: * * Return: qdf status */ QDF_STATUS cds_close_mon_thread(void *p_cds_context); /** * cds_alloc_ol_mon_pkt() - API to return next available cds message * @pSchedContext: Pointer to the global CDS Sched Context * * This api returns next available cds message buffer used for mon data * processing * * Return: Pointer to cds message buffer */ struct cds_ol_mon_pkt *cds_alloc_ol_mon_pkt(p_cds_sched_context pschedcontext); /** * cds_free_ol_mon_pkt() - api to release cds message to the freeq * This api returns the cds message used for mon data to the free queue * @pSchedContext: Pointer to the global CDS Sched Context * @pkt: CDS message buffer to be returned to free queue. * * Return: none */ void cds_free_ol_mon_pkt(p_cds_sched_context pschedcontext, struct cds_ol_mon_pkt *pkt); /** * cds_free_ol_mon_pkt_freeq() - free cds buffer free queue * @pSchedContext - pointer to the global CDS Sched Context * * This API does mem free of the buffers available in free cds buffer * queue which is used for mon Data processing. * * Return: none */ void cds_free_ol_mon_pkt_freeq(p_cds_sched_context pschedcontext); /*--------------------------------------------------------------------------- \brief cds_sched_open() - initialize the CDS Scheduler Loading
core/cds/src/cds_api.c +35 −1 Original line number Diff line number Diff line /* * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the Loading Loading @@ -966,6 +966,14 @@ QDF_STATUS cds_post_disable(void) return QDF_STATUS_E_INVAL; } if (cds_get_pktcap_mode_enable()) { qdf_status = cds_close_mon_thread(gp_cds_context); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { cds_err("Failed to close MON thread!"); return QDF_STATUS_E_INVAL; } } ol_txrx_pdev_pre_detach(txrx_pdev, 1); return QDF_STATUS_SUCCESS; Loading Loading @@ -3055,3 +3063,29 @@ QDF_STATUS cds_deregister_mode_change_cb(void) return QDF_STATUS_SUCCESS; } bool cds_get_pktcap_mode_enable(void) { hdd_context_t *hdd_ctx; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { cds_err("HDD context is NULL"); return false; } return hdd_ctx->config->pktcap_mode_enable; } uint8_t cds_get_pktcapture_mode(void) { hdd_context_t *hdd_ctx; hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); if (!hdd_ctx) { cds_err("HDD context is NULL"); return 0; } return hdd_ctx->pktcapture_mode; }
core/cds/src/cds_concurrency.c +15 −0 Original line number Diff line number Diff line Loading @@ -5936,6 +5936,13 @@ static QDF_STATUS cds_pcl_modification_for_p2p_go( cds_err("failed to get enabled channel modified pcl for GO"); return status; } status = cds_modify_sap_pcl_based_on_srd( pcl_channels, pcl_weight, len); if (QDF_IS_STATUS_ERROR(status)) { cds_err("failed to get srd modified pcl for SAP"); return status; } cds_debug("enabled channel modified pcl len:%d", *len); for (i = 0; i < *len; i++) cds_debug("chan:%d weight:%d", Loading Loading @@ -6140,6 +6147,14 @@ QDF_STATUS cds_get_pcl(enum cds_con_mode mode, pcl_channels[i], pcl_weight[i]); } status = cds_mode_specific_modification_on_pcl(pcl_channels, pcl_weight, len, mode); if (QDF_IS_STATUS_ERROR(status)) { cds_err("failed to get modified pcl for mode %d", mode); return status; } return QDF_STATUS_SUCCESS; } Loading