Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
Merge 4538883 on remote branch
Browse files Browse the repository at this point in the history
Change-Id: I6af1ef0b1526d151b13e50c4be758aed0c9252f8
  • Loading branch information
Linux Build Service Account committed Mar 5, 2020
2 parents 775b6bc + 4538883 commit 5efc2e3
Show file tree
Hide file tree
Showing 148 changed files with 9,052 additions and 2,220 deletions.
23 changes: 20 additions & 3 deletions Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ ifeq ($(CONFIG_QCACLD_FEATURE_HW_CAPABILITY), y)
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_hw_capability.o
endif

ifeq ($(CONFIG_FEATURE_WLAN_TIME_SYNC_FTM), y)
HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_ftm_time_sync.o
endif

#Flag to enable SAR Safety Feature
cppflags-$(CONFIG_SAR_SAFETY_FEATURE) += -DSAR_SAFETY_FEATURE

Expand Down Expand Up @@ -779,12 +783,19 @@ endif
######## PACKET CAPTURE ########

PKT_CAPTURE_DIR := components/pkt_capture
PKT_CAPTURE_TARGET_IF_DIR := components/target_if/pkt_capture/
PKT_CAPTURE_INC := -I$(WLAN_ROOT)/$(PKT_CAPTURE_DIR)/core/inc \
-I$(WLAN_ROOT)/$(PKT_CAPTURE_DIR)/dispatcher/inc
-I$(WLAN_ROOT)/$(PKT_CAPTURE_DIR)/dispatcher/inc \
-I$(WLAN_ROOT)/$(PKT_CAPTURE_TARGET_IF_DIR)/inc

ifeq ($(CONFIG_WLAN_FEATURE_PKT_CAPTURE), y)
PKT_CAPTURE_OBJS := $(PKT_CAPTURE_DIR)/core/src/wlan_pkt_capture_main.o \
$(PKT_CAPTURE_DIR)/dispatcher/src/wlan_pkt_capture_ucfg_api.o
$(PKT_CAPTURE_DIR)/core/src/wlan_pkt_capture_mon_thread.o \
$(PKT_CAPTURE_DIR)/dispatcher/src/wlan_pkt_capture_ucfg_api.o \
$(PKT_CAPTURE_DIR)/core/src/wlan_pkt_capture_mgmt_txrx.o \
$(PKT_CAPTURE_DIR)/core/src/wlan_pkt_capture_data_txrx.o \
$(PKT_CAPTURE_DIR)/dispatcher/src/wlan_pkt_capture_ucfg_api.o \
$(PKT_CAPTURE_TARGET_IF_DIR)/src/target_if_pkt_capture.o
endif

########## FTM TIME SYNC ##########
Expand All @@ -795,7 +806,8 @@ FTM_TIME_SYNC_INC := -I$(WLAN_ROOT)/$(FTM_TIME_SYNC_DIR)/core/inc \

ifeq ($(CONFIG_FEATURE_WLAN_TIME_SYNC_FTM), y)
FTM_TIME_SYNC_OBJS := $(FTM_TIME_SYNC_DIR)/core/src/ftm_time_sync_main.o \
$(FTM_TIME_SYNC_DIR)/dispatcher/src/ftm_time_sync_ucfg_api.o
$(FTM_TIME_SYNC_DIR)/dispatcher/src/ftm_time_sync_ucfg_api.o \
$(FTM_TIME_SYNC_DIR)/dispatcher/src/wlan_ftm_time_sync_tgt_api.o
endif

########## CLD TARGET_IF #######
Expand Down Expand Up @@ -838,6 +850,11 @@ CLD_TARGET_IF_INC += -I$(WLAN_ROOT)/$(CLD_TARGET_IF_DIR)/action_oui/inc
CLD_TARGET_IF_OBJ += $(CLD_TARGET_IF_DIR)/action_oui/src/target_if_action_oui.o
endif

ifeq ($(CONFIG_FEATURE_WLAN_TIME_SYNC_FTM), y)
CLD_TARGET_IF_INC += -I$(WLAN_ROOT)/$(CLD_TARGET_IF_DIR)/ftm_time_sync/inc
CLD_TARGET_IF_OBJ += $(CLD_TARGET_IF_DIR)/ftm_time_sync/src/target_if_ftm_time_sync.o
endif

############## UMAC P2P ###########
P2P_DIR := umac/p2p
P2P_CORE_DIR := $(P2P_DIR)/core
Expand Down
114 changes: 105 additions & 9 deletions components/ftm_time_sync/core/inc/ftm_time_sync_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define _FTM_TIME_SYNC_MAIN_H_

#include <qdf_types.h>
#include <qdf_defer.h>
#include "ftm_time_sync_priv.h"
#include "ftm_time_sync_objmgr.h"

Expand All @@ -50,28 +51,123 @@
#define FTM_TIME_SYNC_EXIT() ftm_time_sync_debug("exit")

/**
* ftm_time_sync_vdev_create_notification(): Handler for vdev create notify.
* ftm_time_sync_vdev_create_notification() - Handler for vdev create notify.
* @vdev: vdev which is going to be created by objmgr
* @arg: argument for notification handler.
* @arg: argument for notification handler
*
* Allocate and attach vdev private object.
*
* Return: QDF_STATUS status in case of success else return error.
* Return: QDF_STATUS
*/
QDF_STATUS ftm_timesync_vdev_create_notification(struct wlan_objmgr_vdev *vdev,
void *arg);
QDF_STATUS ftm_time_sync_vdev_create_notification(struct wlan_objmgr_vdev *vdev,
void *arg);

/**
* ftm_time_sync_vdev_destroy_notification(): Handler for vdev destroy notify.
* ftm_time_sync_vdev_destroy_notification() - Handler for vdev destroy notify.
* @vdev: vdev which is going to be destroyed by objmgr
* @arg: argument for notification handler.
* @arg: argument for notification handler
*
* Deallocate and detach vdev private object.
*
* Return QDF_STATUS status in case of success else return error
* Return QDF_STATUS
*/
QDF_STATUS
ftm_timesync_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev,
ftm_time_sync_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev,
void *arg);

/**
* ftm_time_sync_psoc_create_notification() - Handler for psoc create notify.
* @psoc: psoc which is going to be created by objmgr
* @arg: argument for notification handler
*
* Allocate and attach psoc private object.
*
* Return: QDF_STATUS
*/
QDF_STATUS
ftm_time_sync_psoc_create_notification(struct wlan_objmgr_psoc *psoc,
void *arg);

/**
* ftm_time_sync_psoc_destroy_notification() - Handler for psoc destroy notify.
* @psoc: psoc which is going to be destroyed by objmgr
* @arg: argument for notification handler
*
* Deallocate and detach psoc private object.
*
* Return: QDF_STATUS
*/
QDF_STATUS
ftm_time_sync_psoc_destroy_notification(struct wlan_objmgr_psoc *psoc,
void *arg);

QDF_STATUS ftm_time_sync_psoc_config(struct wlan_objmgr_psoc *psoc,
struct ftm_time_sync_cfg *cfg);
/**
* ftm_time_sync_is_enable() - Function to advertise feature is enabled or not
* @psoc: psoc context
*
* This function advertises whether the feature is enabled or not.
*
* Return: true if enable, false if disable
*/
bool ftm_time_sync_is_enable(struct wlan_objmgr_psoc *psoc);

/**
* ftm_time_sync_set_enable() - Handler to enable the feature
* @psoc: psoc context
* @value: value to be set
*
* This function is used to enable the ftm time sync feature.
* The feature is enabled iff both ini and wmi service is advertised by
* firmware.
*
* Return: None
*/
void ftm_time_sync_set_enable(struct wlan_objmgr_psoc *psoc, bool value);

/**
* ftm_time_sync_get_mode() - API to get the ftm time sync mode
* @psoc: psoc context
*
* Return: enum ftm_time_sync_mode
*/
enum ftm_time_sync_mode ftm_time_sync_get_mode(struct wlan_objmgr_psoc *psoc);

/**
* ftm_time_sync_get_role() - API to get the ftm time sync role
* @psoc: psoc context
*
* Return: enum ftm_time_sync_role
*/
enum ftm_time_sync_role ftm_time_sync_get_role(struct wlan_objmgr_psoc *psoc);

/**
* ftm_time_sync_send_trigger() - Handler for sending trigger cmd to FW
* @vdev: vdev for which FTM time_sync trigger cmd to be send
*
* This function sends the ftm trigger cmd to target.
*
* Return: QDF_STATUS
*/
QDF_STATUS ftm_time_sync_send_trigger(struct wlan_objmgr_vdev *vdev);

/**
* ftm_time_sync_stop() - Handler for stopping the FTM time sync
* @vdev: vdev for which FTM time_sync feature to be stopped
*
* This function stops the ftm time sync functionality.
*
* Return: QDF_STATUS
*/
QDF_STATUS ftm_time_sync_stop(struct wlan_objmgr_vdev *vdev);

/**
* ftm_time_sync_show() - Handler to print the offset derived
* @vdev: vdev for which offset is to be shown
* @buf: buffer in which the values to be printed
*
* Return: the number of bytes written in buf
*/
ssize_t ftm_time_sync_show(struct wlan_objmgr_vdev *vdev, char *buf);
#endif /* end of _FTM_TIME_SYNC_MAIN_H_ */
70 changes: 59 additions & 11 deletions components/ftm_time_sync/core/inc/ftm_time_sync_objmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,46 @@
#include "wlan_objmgr_global_obj.h"

/**
* ftm_timesync_vdev_get_ref() - Wrapper to increment ftm_timesync ref count
* ftm_time_sync_vdev_get_ref() - Wrapper to increment ftm_time_sync ref count
* @vdev: vdev object
*
* Wrapper for ftm_timesync to increment ref count after checking valid
* Wrapper for ftm_time_sync to increment ref count after checking valid
* object state.
*
* Return: SUCCESS/FAILURE
*/
static inline
QDF_STATUS ftm_timesync_vdev_get_ref(struct wlan_objmgr_vdev *vdev)
QDF_STATUS ftm_time_sync_vdev_get_ref(struct wlan_objmgr_vdev *vdev)
{
return wlan_objmgr_vdev_try_get_ref(vdev, FTM_TIME_SYNC_ID);
}

/**
* ftm_timesync_vdev_put_ref() - Wrapper to decrement ftm_timesync ref count
* ftm_time_sync_vdev_put_ref() - Wrapper to decrement ftm_time_sync ref count
* @vdev: vdev object
*
* Wrapper for ftm_timesync to decrement ref count of vdev.
* Wrapper for ftm_time_sync to decrement ref count of vdev.
*
* Return: SUCCESS/FAILURE
*/
static inline
void ftm_timesync_vdev_put_ref(struct wlan_objmgr_vdev *vdev)
void ftm_time_sync_vdev_put_ref(struct wlan_objmgr_vdev *vdev)
{
return wlan_objmgr_vdev_release_ref(vdev, FTM_TIME_SYNC_ID);
}

/**
* ftm_timesync_vdev_get_priv(): Wrapper to retrieve vdev priv obj
* ftm_time_sync_vdev_get_priv() - Wrapper to retrieve vdev priv obj
* @vdev: vdev pointer
*
* Wrapper for ftm_timesync to get vdev private object pointer.
* Wrapper for ftm_time_sync to get vdev private object pointer.
*
* Return: Private object of vdev
*/
static inline struct ftm_timesync_vdev_priv *
ftm_timesync_vdev_get_priv(struct wlan_objmgr_vdev *vdev)
static inline struct ftm_time_sync_vdev_priv *
ftm_time_sync_vdev_get_priv(struct wlan_objmgr_vdev *vdev)
{
struct ftm_timesync_vdev_priv *vdev_priv;
struct ftm_time_sync_vdev_priv *vdev_priv;

vdev_priv = wlan_objmgr_vdev_get_comp_private_obj(
vdev, WLAN_UMAC_COMP_FTM_TIME_SYNC);
Expand All @@ -75,4 +75,52 @@ ftm_timesync_vdev_get_priv(struct wlan_objmgr_vdev *vdev)
return vdev_priv;
}

/**
* ftm_time_sync_psoc_get_ref() - Wrapper to increment ftm_time sync ref count
* @psoc: psoc object
*
* Wrapper for ftm time sync to increment ref count after checking valid
* object state.
*
* Return: QDF_STATUS
*/
static inline
QDF_STATUS ftm_time_sync_psoc_get_ref(struct wlan_objmgr_psoc *psoc)
{
return wlan_objmgr_psoc_try_get_ref(psoc, FTM_TIME_SYNC_ID);
}

/**
* ftm_time_sync_psoc_put_ref() - Wrapper to decrement ftm time sync ref count
* @psoc: psoc object
*
* Wrapper for ftm time sync to decrement ref count of psoc.
*
* Return: None
*/
static inline
void ftm_time_sync_psoc_put_ref(struct wlan_objmgr_psoc *psoc)
{
wlan_objmgr_psoc_release_ref(psoc, FTM_TIME_SYNC_ID);
}

/**
* ftm_time_sync_psoc_get_priv() - Wrapper to retrieve psoc priv obj
* @psoc: psoc pointer
*
* Wrapper for ftm time sync to get psoc private object pointer.
*
* Return: ftm time sync psoc private object
*/
static inline struct ftm_time_sync_psoc_priv *
ftm_time_sync_psoc_get_priv(struct wlan_objmgr_psoc *psoc)
{
struct ftm_time_sync_psoc_priv *psoc_priv;

psoc_priv = wlan_objmgr_psoc_get_comp_private_obj(
psoc, WLAN_UMAC_COMP_FTM_TIME_SYNC);
QDF_BUG(psoc_priv);

return psoc_priv;
}
#endif /* _FTM_TIME_SYNC_OBJMGR_H */
43 changes: 35 additions & 8 deletions components/ftm_time_sync/core/inc/ftm_time_sync_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

/**
* DOC: Declare private API which shall be used internally only
* in ftm_timesync component. This file shall include prototypes of
* ftm_timesync parsing and send logic.
* in ftm_time_sync component. This file shall include prototypes of
* ftm_time_sync parsing and send logic.
*
* Note: This API should be never accessed out of ftm_timesync component.
* Note: This API should be never accessed out of ftm_time_sync component.
*/

#ifndef _FTM_TIME_SYNC_PRIV_STRUCT_H_
Expand All @@ -28,6 +28,7 @@
#include <qdf_list.h>
#include <qdf_types.h>
#include "ftm_time_sync_objmgr.h"
#include "wlan_ftm_time_sync_public_struct.h"

#define WLAN_FTM_TIME_SYNC_PAIR_MAX 32

Expand All @@ -42,26 +43,52 @@ struct wlan_time_sync_pair {
};

/**
* struct ftm_timesync_vdev_priv - Private object to be stored in vdev
* struct ftm_time_sync_vdev_priv - Private object to be stored in vdev
* @qtime_ref: qtime ref
* @mac_ref: mac time ref
* @time_pair: array of master/slave qtime pair
*/

struct ftm_timesync_priv {
struct ftm_time_sync_priv {
uint64_t qtime_ref;
uint64_t mac_ref;
struct wlan_time_sync_pair time_pair[WLAN_FTM_TIME_SYNC_PAIR_MAX];
};

/**
* struct ftm_timesync_vdev_priv - Private object to be stored in vdev
* struct ftm_time_sync_psoc_priv - Private object to be stored in psoc
* @psoc: pointer to psoc object
* @cfg_param: INI config param for ftm time sync
*/
struct ftm_time_sync_psoc_priv {
struct wlan_objmgr_psoc *psoc;
struct ftm_time_sync_cfg cfg_param;
};

/**
* struct ftm_time_sync_vdev_priv - Private object to be stored in vdev
* @vdev: pointer to vdev object
* @ftm_ts_priv: time sync private struct
* @rx_ops: rx operations for ftm time sync
* @tx_ops: tx operations for ftm time sync
* @ftm_time_sync_mutex: mutex to access ftm time sync priv members
* @ftm_time_sync_work: work to capture audio qtime and send it to FW
* @time_sync_interval: interval between two qtime capture
* @num_qtime_pair: number of qmaster and qslave pair derived
* @num_reads: number of times the qtime to be captured
* @valid: send qtime to FW only if this is true
*/
struct ftm_timesync_vdev_priv {
struct ftm_time_sync_vdev_priv {
struct wlan_objmgr_vdev *vdev;
struct ftm_timesync_priv ftm_ts_priv;
struct ftm_time_sync_priv ftm_ts_priv;
struct wlan_ftm_time_sync_rx_ops rx_ops;
struct wlan_ftm_time_sync_tx_ops tx_ops;
qdf_mutex_t ftm_time_sync_mutex;
qdf_delayed_work_t ftm_time_sync_work;
uint32_t time_sync_interval;
int num_qtime_pair;
int num_reads;
bool valid;
};

#endif /* End of _FTM_TIME_SYNC_PRIV_STRUCT_H_ */

0 comments on commit 5efc2e3

Please sign in to comment.