qcacld-3.0: Add public APIs for SON

Add public APIs to support SON Module.

Change-Id: Ia69a9e631f2b9f50f6e8bc6d50a2106f8f1b9efa
CRs-Fixed: 3048867
This commit is contained in:
Rachit Kankane
2021-07-26 12:50:24 +05:30
committed by Madan Koyyalamudi
parent 20b5500518
commit dd0add5b52
3 changed files with 176 additions and 0 deletions

View File

@@ -867,6 +867,20 @@ static enum ieee80211_phymode hdd_son_get_phymode(struct wlan_objmgr_vdev *vdev)
return hdd_phymode_chwidth_freq_to_son_phymode(phymode, chwidth, freq); return hdd_phymode_chwidth_freq_to_son_phymode(phymode, chwidth, freq);
} }
static uint8_t hdd_son_get_rx_nss(struct wlan_objmgr_vdev *vdev)
{
struct hdd_adapter *adapter = wlan_hdd_get_adapter_from_objmgr(vdev);
uint8_t rx_nss = 0;
if (!adapter) {
hdd_err("null adapter");
return 0;
}
hdd_get_rx_nss(adapter, &rx_nss);
return rx_nss;
}
void hdd_son_register_callbacks(struct hdd_context *hdd_ctx) void hdd_son_register_callbacks(struct hdd_context *hdd_ctx)
{ {
struct son_callbacks cb_obj = {0}; struct son_callbacks cb_obj = {0};
@@ -882,6 +896,7 @@ void hdd_son_register_callbacks(struct hdd_context *hdd_ctx)
cb_obj.os_if_get_candidate_freq = hdd_son_get_candidate_freq; cb_obj.os_if_get_candidate_freq = hdd_son_get_candidate_freq;
cb_obj.os_if_set_phymode = hdd_son_set_phymode; cb_obj.os_if_set_phymode = hdd_son_set_phymode;
cb_obj.os_if_get_phymode = hdd_son_get_phymode; cb_obj.os_if_get_phymode = hdd_son_get_phymode;
cb_obj.os_if_get_rx_nss = hdd_son_get_rx_nss;
os_if_son_register_hdd_callbacks(hdd_ctx->psoc, &cb_obj); os_if_son_register_hdd_callbacks(hdd_ctx->psoc, &cb_obj);
} }

View File

@@ -45,6 +45,7 @@
* @os_if_get_candidate_freq: get freq to switch after radar detection * @os_if_get_candidate_freq: get freq to switch after radar detection
* @os_if_set_phymode: set phy mode * @os_if_set_phymode: set phy mode
* @os_if_get_phymode: get phy mode * @os_if_get_phymode: get phy mode
* @os_if_get_rx_nss: Gets number of RX spatial streams
*/ */
struct son_callbacks { struct son_callbacks {
uint32_t (*os_if_is_acs_in_progress)(struct wlan_objmgr_vdev *vdev); uint32_t (*os_if_is_acs_in_progress)(struct wlan_objmgr_vdev *vdev);
@@ -68,6 +69,7 @@ struct son_callbacks {
enum ieee80211_phymode mode); enum ieee80211_phymode mode);
enum ieee80211_phymode (*os_if_get_phymode)( enum ieee80211_phymode (*os_if_get_phymode)(
struct wlan_objmgr_vdev *vdev); struct wlan_objmgr_vdev *vdev);
uint8_t (*os_if_get_rx_nss)(struct wlan_objmgr_vdev *vdev);
}; };
/** /**
@@ -280,4 +282,92 @@ enum ieee80211_phymode os_if_son_get_phymode(struct wlan_objmgr_vdev *vdev);
*/ */
int os_if_son_set_phymode(struct wlan_objmgr_vdev *vdev, int os_if_son_set_phymode(struct wlan_objmgr_vdev *vdev,
enum ieee80211_phymode mode); enum ieee80211_phymode mode);
/**
* os_if_son_pdev_ops() - Handles PDEV specific SON commands
* @pdev: pdev
* @type: SON command to handle
* @data: Input Data
* @ret: Output Data
*
* Return: QDF_SUCCCESS_SUCCESS in case of success
*/
QDF_STATUS os_if_son_pdev_ops(struct wlan_objmgr_pdev *pdev,
enum wlan_mlme_pdev_param type,
void *data, void *ret);
/**
* os_if_son_vdev_ops() - Handles VDEV specific SON commands
* @vdev: vdev
* @type: SON command to handle
* @data: Input Data
* @ret: Output Data
*
* Return: QDF_SUCCCESS_SUCCESS in case of success
*/
QDF_STATUS os_if_son_vdev_ops(struct wlan_objmgr_vdev *pdev,
enum wlan_mlme_vdev_param type,
void *data, void *ret);
/**
* os_if_son_peer_ops() - Handles PEER specific SON commands
* @peer: peer
* @type: SON command to handle
* @data: Input Data
* @ret: Output Data
*
* Return: QDF_SUCCCESS_SUCCESS in case of success
*/
QDF_STATUS os_if_son_peer_ops(struct wlan_objmgr_peer *peer,
enum wlan_mlme_peer_param type,
void *data, void *ret);
/**
* os_if_son_scan_db_iterate() - get country code
* @pdev: pdev
* @handler: scan_iterator
* @arg: argument to be passed to handler
*
* Return: QDF_SUCCCESS_SUCCESS in case of success
*/
QDF_STATUS os_if_son_scan_db_iterate(struct wlan_objmgr_pdev *pdev,
scan_iterator_func handler, void *arg);
/**
* os_if_son_acl_is_probe_wh_set() - Withheld probes for given mac_addr,
* not supported
* @vdev: vdev
* @mac_addr: 6-Byte MAC address
* @probe_rssi: Probe Request RSSI
*
* Return: true / false
*/
bool os_if_son_acl_is_probe_wh_set(struct wlan_objmgr_vdev *vdev,
const uint8_t *mac_addr,
uint8_t probe_rssi);
/**
* os_if_son_get_rx_streams() - Gets number of RX spatial streams
* @vdev: target vdev
*
* Return: number of spatial stream
*/
uint8_t os_if_son_get_rx_streams(struct wlan_objmgr_vdev *vdev);
/**
* os_if_son_cfg80211_reply() - replies to cfg80211
* @sk_buf: sk_buff to uper layer
*
* Return: QDF_STATUS_SUCCESS on success
*/
QDF_STATUS os_if_son_cfg80211_reply(qdf_nbuf_t sk_buf);
/**
* os_if_son_vdev_is_wds() - checks if wds capability is supported or not
* @vdev: Pointer to vdev
*
* Return: true if wds is supported
*/
bool os_if_son_vdev_is_wds(struct wlan_objmgr_vdev *vdev);
#endif #endif

View File

@@ -32,6 +32,7 @@
#include <wlan_vdev_mgr_ucfg_api.h> #include <wlan_vdev_mgr_ucfg_api.h>
#include <wlan_mlme_ucfg_api.h> #include <wlan_mlme_ucfg_api.h>
#include <wlan_reg_services_api.h> #include <wlan_reg_services_api.h>
#include <wlan_scan_ucfg_api.h>
static struct son_callbacks g_son_os_if_cb; static struct son_callbacks g_son_os_if_cb;
@@ -658,3 +659,73 @@ enum ieee80211_phymode os_if_son_get_phymode(struct wlan_objmgr_vdev *vdev)
return phymode; return phymode;
} }
qdf_export_symbol(os_if_son_get_phymode); qdf_export_symbol(os_if_son_get_phymode);
QDF_STATUS os_if_son_pdev_ops(struct wlan_objmgr_pdev *pdev,
enum wlan_mlme_pdev_param type,
void *data, void *ret)
{
return QDF_STATUS_SUCCESS;
}
qdf_export_symbol(os_if_son_pdev_ops);
QDF_STATUS os_if_son_vdev_ops(struct wlan_objmgr_vdev *vdev,
enum wlan_mlme_vdev_param type,
void *data, void *ret)
{
return QDF_STATUS_SUCCESS;
}
qdf_export_symbol(os_if_son_vdev_ops);
QDF_STATUS os_if_son_peer_ops(struct wlan_objmgr_peer *peer,
enum wlan_mlme_peer_param type,
void *data, void *ret)
{
return QDF_STATUS_SUCCESS;
}
qdf_export_symbol(os_if_son_peer_ops);
QDF_STATUS os_if_son_scan_db_iterate(struct wlan_objmgr_pdev *pdev,
scan_iterator_func handler, void *arg)
{
return ucfg_scan_db_iterate(pdev, handler, arg);
}
qdf_export_symbol(os_if_son_scan_db_iterate);
bool os_if_son_acl_is_probe_wh_set(struct wlan_objmgr_vdev *vdev,
const uint8_t *mac_addr,
uint8_t probe_rssi)
{
return false;
}
qdf_export_symbol(os_if_son_acl_is_probe_wh_set);
u_int8_t os_if_son_get_rx_streams(struct wlan_objmgr_vdev *vdev)
{
if (!vdev) {
osif_err("null vdev");
return 0;
}
return g_son_os_if_cb.os_if_get_rx_nss(vdev);
}
qdf_export_symbol(os_if_son_get_rx_streams);
QDF_STATUS os_if_son_cfg80211_reply(qdf_nbuf_t sk_buf)
{
return wlan_cfg80211_qal_devcfg_send_response(sk_buf);
}
qdf_export_symbol(os_if_son_cfg80211_reply);
bool os_if_son_vdev_is_wds(struct wlan_objmgr_vdev *vdev)
{
return true;
}
qdf_export_symbol(os_if_son_vdev_is_wds);