qcacmn: TDLS component: south interface
Add lmac_if layer changes for TDLS Change-Id: Ic842857ce7ebc83d2a22a8a8e23c60df1c3dbfc8 CRs-Fixed: 2011330
This commit is contained in:

کامیت شده توسط
Sandeep Puligilla

والد
ab9f0d1b3f
کامیت
9dd3c3e9cb
@@ -46,6 +46,10 @@ struct oem_data_rsp;
|
||||
struct scheduler_msg;
|
||||
#endif
|
||||
|
||||
#ifdef CONVERGED_TDLS_ENABLE
|
||||
#include "wlan_tdls_public_structs.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* struct wlan_lmac_if_mgmt_txrx_tx_ops - structure of tx function
|
||||
* pointers for mgmt txrx component
|
||||
@@ -350,6 +354,52 @@ struct wlan_lmac_if_wifi_pos_tx_ops {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONVERGED_TDLS_ENABLE
|
||||
/* fwd declarations for tdls tx ops */
|
||||
struct tdls_info;
|
||||
struct tdls_peer_update_state;
|
||||
struct tdls_channel_switch_params;
|
||||
struct sta_uapsd_trig_params;
|
||||
/**
|
||||
* struct wlan_lmac_if_tdls_tx_ops - south bound tx function pointers for tdls
|
||||
* @update_fw_state: function to update tdls firmware state
|
||||
* @update_peer_state: function to update tdls peer state
|
||||
* @set_offchan_mode: function to set tdls offchannel mode
|
||||
* @tdls_reg_ev_handler: function to register for tdls events
|
||||
* @tdls_unreg_ev_handler: function to unregister for tdls events
|
||||
* @tdls_set_uapsd: function to set upasdt trigger command
|
||||
*
|
||||
* tdls module uses these functions to avail ol/da lmac services
|
||||
*/
|
||||
struct wlan_lmac_if_tdls_tx_ops {
|
||||
QDF_STATUS(*update_fw_state)(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_info *req);
|
||||
QDF_STATUS(*update_peer_state)(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_peer_update_state *param);
|
||||
QDF_STATUS(*set_offchan_mode)(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_channel_switch_params *param);
|
||||
QDF_STATUS(*tdls_reg_ev_handler)(struct wlan_objmgr_psoc *psoc,
|
||||
void *arg);
|
||||
QDF_STATUS(*tdls_unreg_ev_handler) (struct wlan_objmgr_psoc *psoc,
|
||||
void *arg);
|
||||
QDF_STATUS(*tdls_set_uapsd)(struct wlan_objmgr_psoc *psoc,
|
||||
struct sta_uapsd_trig_params *params);
|
||||
};
|
||||
|
||||
/* fwd declarations for tdls rx ops */
|
||||
struct tdls_event_info;
|
||||
/**
|
||||
* struct wlan_lmac_if_tdls_rx_ops - south bound rx function pointers for tdls
|
||||
* @tdls_ev_handler: function to handler tdls event
|
||||
*
|
||||
* lmac modules uses this API to post scan events to tdls module
|
||||
*/
|
||||
struct wlan_lmac_if_tdls_rx_ops {
|
||||
QDF_STATUS(*tdls_ev_handler)(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_event_info *info);
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
|
||||
/**
|
||||
* struct wlan_lmac_if_nan_tx_ops - structure of firwware tx function
|
||||
@@ -490,6 +540,10 @@ struct wlan_lmac_if_tx_ops {
|
||||
#endif
|
||||
struct wlan_lmac_if_reg_tx_ops reg_ops;
|
||||
struct wlan_lmac_if_dfs_tx_ops dfs_tx_ops;
|
||||
|
||||
#ifdef CONVERGED_TDLS_ENABLE
|
||||
struct wlan_lmac_if_tdls_tx_ops tdls_tx_ops;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -797,6 +851,9 @@ struct wlan_lmac_if_rx_ops {
|
||||
#endif
|
||||
struct wlan_lmac_if_reg_rx_ops reg_rx_ops;
|
||||
struct wlan_lmac_if_dfs_rx_ops dfs_rx_ops;
|
||||
#ifdef CONVERGED_TDLS_ENABLE
|
||||
struct wlan_lmac_if_tdls_rx_ops tdls_rx_ops;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* Function pointer to call legacy tx_ops registration in OL/WMA.
|
||||
|
@@ -35,6 +35,9 @@
|
||||
#ifdef CONVERGED_P2P_ENABLE
|
||||
#include "wlan_p2p_tgt_api.h"
|
||||
#endif
|
||||
#ifdef CONVERGED_TDLS_ENABLE
|
||||
#include "wlan_tdls_tgt_api.h"
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_CONV_CRYPTO_SUPPORTED
|
||||
#include "wlan_crypto_global_api.h"
|
||||
@@ -199,6 +202,22 @@ wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONVERGED_TDLS_ENABLE
|
||||
static QDF_STATUS
|
||||
wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
{
|
||||
rx_ops->tdls_rx_ops.tdls_ev_handler = tgt_tdls_event_handler;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#else
|
||||
static QDF_STATUS
|
||||
wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register
|
||||
* @rx_ops: Pointer to rx_ops structure to be populated
|
||||
@@ -244,6 +263,9 @@ wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
/* wifi_pos rx ops */
|
||||
wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops);
|
||||
|
||||
/* tdls rx ops */
|
||||
wlan_lmac_if_umac_tdls_rx_ops_register(rx_ops);
|
||||
|
||||
wlan_lmac_if_register_nan_rx_ops(rx_ops);
|
||||
|
||||
rx_ops->reg_rx_ops.master_list_handler =
|
||||
|
@@ -981,7 +981,7 @@ error:
|
||||
}
|
||||
|
||||
/**
|
||||
* tdls_process_add_peer_rsp() - handle response for add TDLS peer
|
||||
* tdls_add_peer_rsp() - handle response for add TDLS peer
|
||||
* @rsp: TDLS add peer response
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success; other values if failed
|
||||
|
@@ -718,6 +718,62 @@ struct tdls_channel_switch_params {
|
||||
uint8_t is_responder;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum uapsd_access_cat - U-APSD Access Categories
|
||||
* @UAPSD_AC_BE: best effort
|
||||
* @UAPSD_AC_BK: back ground
|
||||
* @UAPSD_AC_VI: video
|
||||
* @UAPSD_AC_VO: voice
|
||||
*/
|
||||
enum uapsd_access_cat {
|
||||
UAPSD_AC_BE,
|
||||
UAPSD_AC_BK,
|
||||
UAPSD_AC_VI,
|
||||
UAPSD_AC_VO
|
||||
};
|
||||
|
||||
/**
|
||||
* enum tspec_dir_type - TSPEC Direction type
|
||||
* @TX_DIR: uplink
|
||||
* @RX_DIR: downlink
|
||||
* @BI_DIR: bidirectional
|
||||
*/
|
||||
enum tspec_dir_type {
|
||||
TX_DIR = 0,
|
||||
RX_DIR = 1,
|
||||
BI_DIR = 2,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sta_uapsd_params - uapsd auto trig params
|
||||
* @wmm_ac: WMM access category from 0 to 3
|
||||
* @user_priority: User priority to use in trigger frames
|
||||
* @service_interval: service interval
|
||||
* @suspend_interval: suspend interval
|
||||
* @delay_interval: delay interval
|
||||
*/
|
||||
struct sta_uapsd_params {
|
||||
uint32_t wmm_ac;
|
||||
uint32_t user_priority;
|
||||
uint32_t service_interval;
|
||||
uint32_t suspend_interval;
|
||||
uint32_t delay_interval;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sta_uapsd_trig_params - uapsd trigger parameter
|
||||
* @vdevid: vdev id
|
||||
* @peer_addr: peer address
|
||||
* @auto_triggerparam: trigger parameters
|
||||
* @num_ac: no of access category
|
||||
*/
|
||||
struct sta_uapsd_trig_params {
|
||||
uint32_t vdevid;
|
||||
uint8_t peer_addr[QDF_MAC_ADDR_SIZE];
|
||||
struct sta_uapsd_params *auto_triggerparam;
|
||||
uint32_t num_ac;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct tdls_event_info - firmware tdls event
|
||||
* @vdev_id: vdev id
|
||||
|
@@ -21,3 +21,94 @@
|
||||
*
|
||||
* TDLS south bound interface declaration
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_TDLS_TGT_API_H_
|
||||
#define _WLAN_TDLS_TGT_API_H_
|
||||
#include <wlan_tdls_public_structs.h>
|
||||
#include "../../core/src/wlan_tdls_main.h"
|
||||
|
||||
/**
|
||||
* tgt_tdls_set_fw_state() - invoke lmac tdls update fw
|
||||
* @psoc: soc object
|
||||
* @tdls_param: update tdls state parameters
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_tdls_set_fw_state(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_info *tdls_param);
|
||||
|
||||
/**
|
||||
* tgt_tdls_set_peer_state() - invoke lmac tdls update peer state
|
||||
* @psoc: soc object
|
||||
* @peer_param: update tdls peer parameters
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_tdls_set_peer_state(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_peer_update_state *peer_param);
|
||||
|
||||
/**
|
||||
* tgt_tdls_set_offchan_mode() - invoke lmac tdls set off-channel mode
|
||||
* @psoc: soc object
|
||||
* @param: set tdls off channel parameters
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_tdls_set_offchan_mode(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_channel_switch_params *param);
|
||||
|
||||
/**
|
||||
* tgt_tdls_set_uapsd()- invoke lamc tdls set uapsd function
|
||||
* @psoc: soc object
|
||||
* @params: uapsd parameters
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_tdls_set_uapsd(struct wlan_objmgr_psoc *psoc,
|
||||
struct sta_uapsd_trig_params *params);
|
||||
|
||||
/**
|
||||
* tgt_tdls_del_peer_rsp() - handle TDLS del peer response
|
||||
* @pmsg: sheduler msg
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_tdls_del_peer_rsp(struct scheduler_msg *pmsg);
|
||||
|
||||
/**
|
||||
* tgt_tdls_add_peer_rsp() - handle TDLS add peer response
|
||||
* @pmsg: sheduler msg
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_tdls_add_peer_rsp(struct scheduler_msg *pmsg);
|
||||
|
||||
/**
|
||||
* tgt_tdls_register_ev_handler() - invoke lmac register tdls event handler
|
||||
* @psoc: soc object
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code.
|
||||
*/
|
||||
QDF_STATUS tgt_tdls_register_ev_handler(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_tdls_unregister_ev_handler() - invoke lmac unregister tdls event handler
|
||||
* @psoc: soc object
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success or error code.
|
||||
*/
|
||||
QDF_STATUS tgt_tdls_unregister_ev_handler(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* tgt_tdls_event_handler() - The callback registered to WMI for tdls events
|
||||
* @psoc: psoc object
|
||||
* @info: tdls event info
|
||||
*
|
||||
* The callback is registered by tgt as tdls rx ops handler.
|
||||
*
|
||||
* Return: 0 for success or err code.
|
||||
*/
|
||||
QDF_STATUS
|
||||
tgt_tdls_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_event_info *info);
|
||||
#endif
|
||||
|
@@ -21,3 +21,165 @@
|
||||
*
|
||||
* TDLS south bound interface definitions
|
||||
*/
|
||||
|
||||
#include "qdf_status.h"
|
||||
#include <wlan_tdls_tgt_api.h>
|
||||
#include "../../core/src/wlan_tdls_main.h"
|
||||
#include "../../core/src/wlan_tdls_cmds_process.h"
|
||||
|
||||
static inline struct wlan_lmac_if_tdls_tx_ops *
|
||||
wlan_psoc_get_tdls_txops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return &psoc->soc_cb.tx_ops.tdls_tx_ops;
|
||||
}
|
||||
|
||||
static inline struct wlan_lmac_if_tdls_rx_ops *
|
||||
wlan_psoc_get_tdls_rxops(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return &psoc->soc_cb.rx_ops.tdls_rx_ops;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_tdls_set_fw_state(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_info *tdls_param)
|
||||
{
|
||||
struct wlan_lmac_if_tdls_tx_ops *tdls_ops = NULL;
|
||||
|
||||
tdls_ops = wlan_psoc_get_tdls_txops(psoc);
|
||||
if (tdls_ops && tdls_ops->update_fw_state)
|
||||
return tdls_ops->update_fw_state(psoc, tdls_param);
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_tdls_set_peer_state(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_peer_update_state *peer_param)
|
||||
{
|
||||
struct wlan_lmac_if_tdls_tx_ops *tdls_ops = NULL;
|
||||
|
||||
tdls_ops = wlan_psoc_get_tdls_txops(psoc);
|
||||
if (tdls_ops && tdls_ops->update_peer_state)
|
||||
return tdls_ops->update_peer_state(psoc, peer_param);
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_tdls_set_offchan_mode(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_channel_switch_params *param)
|
||||
{
|
||||
struct wlan_lmac_if_tdls_tx_ops *tdls_ops = NULL;
|
||||
|
||||
tdls_ops = wlan_psoc_get_tdls_txops(psoc);
|
||||
if (tdls_ops && tdls_ops->set_offchan_mode)
|
||||
return tdls_ops->set_offchan_mode(psoc, param);
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_tdls_set_uapsd(struct wlan_objmgr_psoc *psoc,
|
||||
struct sta_uapsd_trig_params *params)
|
||||
{
|
||||
struct wlan_lmac_if_tdls_tx_ops *tdls_ops = NULL;
|
||||
|
||||
tdls_ops = wlan_psoc_get_tdls_txops(psoc);
|
||||
if (tdls_ops && tdls_ops->tdls_set_uapsd)
|
||||
return tdls_ops->tdls_set_uapsd(psoc, params);
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_tdls_add_peer_rsp(struct scheduler_msg *pmsg)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
if (!pmsg || !pmsg->bodyptr) {
|
||||
tdls_err("msg: 0x%p", pmsg);
|
||||
QDF_ASSERT(0);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
status = tdls_process_add_peer_rsp(pmsg->bodyptr);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_tdls_del_peer_rsp(struct scheduler_msg *pmsg)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
if (!pmsg || !pmsg->bodyptr) {
|
||||
tdls_err("msg: 0x%p", pmsg);
|
||||
QDF_ASSERT(0);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
status = tdls_process_del_peer_rsp(pmsg->bodyptr);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_tdls_register_ev_handler(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_tdls_tx_ops *tdls_ops = NULL;
|
||||
|
||||
tdls_ops = wlan_psoc_get_tdls_txops(psoc);
|
||||
if (tdls_ops && tdls_ops->tdls_reg_ev_handler)
|
||||
return tdls_ops->tdls_reg_ev_handler(psoc, NULL);
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_tdls_unregister_ev_handler(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_lmac_if_tdls_tx_ops *tdls_ops = NULL;
|
||||
|
||||
tdls_ops = wlan_psoc_get_tdls_txops(psoc);
|
||||
if (tdls_ops->tdls_unreg_ev_handler)
|
||||
return tdls_ops->tdls_unreg_ev_handler(psoc, NULL);
|
||||
else
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
tgt_tdls_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
struct tdls_event_info *info)
|
||||
{
|
||||
struct scheduler_msg msg = {0,};
|
||||
struct tdls_event_notify *notify;
|
||||
uint8_t vdev_id;
|
||||
QDF_STATUS status;
|
||||
|
||||
if (!psoc || !info) {
|
||||
tdls_err("psoc: 0x%p, info: 0x%p", psoc, info);
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
tdls_debug("vdev: %d, type: %d, reason: %d" QDF_MAC_ADDRESS_STR,
|
||||
info->vdev_id, info->message_type, info->peer_reason,
|
||||
QDF_MAC_ADDR_ARRAY(info->peermac.bytes));
|
||||
notify = qdf_mem_malloc(sizeof(*notify));
|
||||
if (!notify) {
|
||||
tdls_err("mem allocate fail");
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
}
|
||||
|
||||
vdev_id = info->vdev_id;
|
||||
notify->vdev =
|
||||
wlan_objmgr_get_vdev_by_id_from_psoc(psoc,
|
||||
vdev_id, WLAN_TDLS_SB_ID);
|
||||
if (!notify->vdev) {
|
||||
tdls_err("null vdev, vdev_id: %d, psoc: 0x%p", vdev_id, psoc);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
qdf_mem_copy(¬ify->event, info, sizeof(*info));
|
||||
|
||||
msg.bodyptr = notify;
|
||||
msg.callback = tdls_process_evt;
|
||||
|
||||
status = scheduler_post_msg(QDF_MODULE_ID_TARGET_IF, &msg);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
tdls_err("can't post msg to handle tdls event");
|
||||
wlan_objmgr_vdev_release_ref(notify->vdev, WLAN_TDLS_SB_ID);
|
||||
qdf_mem_free(notify);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
مرجع در شماره جدید
Block a user