qcacmn: Support custom scan filter and candidate list sort
Add APIs to support customer scan filter and candidate list sorting based on user perference Change-Id: I9b5d46c7851a0afd4513f50c50c43baf26c29d0c CRs-Fixed: 2896741
This commit is contained in:
@@ -735,7 +735,12 @@ static inline void cm_update_advance_filter(struct wlan_objmgr_pdev *pdev,
|
||||
struct cnx_mgr *cm_ctx,
|
||||
struct scan_filter *filter,
|
||||
struct cm_connect_req *cm_req)
|
||||
{ }
|
||||
{
|
||||
struct wlan_objmgr_vdev *vdev = cm_ctx->vdev;
|
||||
|
||||
if (cm_ctx->cm_candidate_advance_filter)
|
||||
cm_ctx->cm_candidate_advance_filter(vdev, filter);
|
||||
}
|
||||
|
||||
static void cm_update_security_filter(struct scan_filter *filter,
|
||||
struct wlan_cm_connect_req *req)
|
||||
@@ -913,7 +918,7 @@ static QDF_STATUS cm_connect_get_candidates(struct wlan_objmgr_pdev *pdev,
|
||||
|
||||
op_mode = wlan_vdev_mlme_get_opmode(cm_ctx->vdev);
|
||||
if (num_bss && op_mode == QDF_STA_MODE)
|
||||
cm_calculate_scores(pdev, filter, candidate_list);
|
||||
cm_calculate_scores(cm_ctx, pdev, filter, candidate_list);
|
||||
qdf_mem_free(filter);
|
||||
|
||||
if (!candidate_list || !qdf_list_size(candidate_list)) {
|
||||
|
@@ -196,7 +196,7 @@ static QDF_STATUS cm_roam_get_candidates(struct wlan_objmgr_pdev *pdev,
|
||||
|
||||
op_mode = wlan_vdev_mlme_get_opmode(cm_ctx->vdev);
|
||||
if (num_bss && op_mode == QDF_STA_MODE)
|
||||
cm_calculate_scores(pdev, filter, candidate_list);
|
||||
cm_calculate_scores(cm_ctx, pdev, filter, candidate_list);
|
||||
|
||||
qdf_mem_free(filter);
|
||||
|
||||
|
@@ -278,6 +278,12 @@ struct cnx_mgr {
|
||||
#ifdef SM_ENG_HIST_ENABLE
|
||||
struct cm_req_history req_history;
|
||||
#endif
|
||||
#ifndef CONN_MGR_ADV_FEATURE
|
||||
void (*cm_candidate_advance_filter)(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_filter *filter);
|
||||
void (*cm_candidate_list_custom_sort)(struct wlan_objmgr_vdev *vdev,
|
||||
qdf_list_t *list);
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -961,13 +961,15 @@ cm_update_scan_mlme_on_disconnect(struct wlan_objmgr_vdev *vdev,
|
||||
/**
|
||||
* cm_calculate_scores() - Score the candidates obtained from scan
|
||||
* manager after filtering
|
||||
* @cm_ctx: Connection manager context
|
||||
* @pdev: Object manager pdev
|
||||
* @filter: Scan filter params
|
||||
* @list: List of candidates to be scored
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void cm_calculate_scores(struct wlan_objmgr_pdev *pdev,
|
||||
void cm_calculate_scores(struct cnx_mgr *cm_ctx,
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
struct scan_filter *filter, qdf_list_t *list);
|
||||
|
||||
/**
|
||||
@@ -1063,4 +1065,33 @@ static inline void cm_req_history_print(struct cnx_mgr *cm_ctx)
|
||||
*/
|
||||
QDF_STATUS cm_activate_cmd_req_flush_cb(struct scheduler_msg *msg);
|
||||
#endif
|
||||
|
||||
#ifndef CONN_MGR_ADV_FEATURE
|
||||
/**
|
||||
* cm_set_candidate_advance_filter_cb() - Set CM candidate advance
|
||||
* filter cb
|
||||
* @vdev: Objmgr vdev
|
||||
* @filter_fun: CM candidate advance filter cb
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void cm_set_candidate_advance_filter_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*filter_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_filter *filter));
|
||||
|
||||
/**
|
||||
* cm_set_candidate_custom_sort_cb() - Set CM candidate custom sort cb
|
||||
* @vdev: Objmgr vdev
|
||||
* @sort_fun: CM candidate custom sort cb
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
void cm_set_candidate_custom_sort_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*sort_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
qdf_list_t *list));
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __WLAN_CM_MAIN_API_H__ */
|
||||
|
@@ -1300,7 +1300,8 @@ cm_get_pcl_chan_weigtage_for_sta(struct wlan_objmgr_pdev *pdev,
|
||||
}
|
||||
}
|
||||
|
||||
void cm_calculate_scores(struct wlan_objmgr_pdev *pdev,
|
||||
void cm_calculate_scores(struct cnx_mgr *cm_ctx,
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
struct scan_filter *filter, qdf_list_t *list)
|
||||
{
|
||||
struct pcl_freq_weight_list *pcl_lst = NULL;
|
||||
@@ -1319,10 +1320,17 @@ void cm_calculate_scores(struct wlan_objmgr_pdev *pdev,
|
||||
}
|
||||
#else
|
||||
inline
|
||||
void cm_calculate_scores(struct wlan_objmgr_pdev *pdev,
|
||||
void cm_calculate_scores(struct cnx_mgr *cm_ctx,
|
||||
struct wlan_objmgr_pdev *pdev,
|
||||
struct scan_filter *filter, qdf_list_t *list)
|
||||
{
|
||||
wlan_cm_calculate_bss_score(pdev, NULL, list, &filter->bssid_hint);
|
||||
|
||||
/*
|
||||
* Custom sorting if enabled
|
||||
*/
|
||||
if (cm_ctx && cm_ctx->cm_candidate_list_custom_sort)
|
||||
cm_ctx->cm_candidate_list_custom_sort(cm_ctx->vdev, list);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1433,3 +1441,33 @@ void cm_req_history_print(struct cnx_mgr *cm_ctx)
|
||||
qdf_spin_unlock_bh(&history->cm_req_hist_lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONN_MGR_ADV_FEATURE
|
||||
void cm_set_candidate_advance_filter_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*filter_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_filter *filter))
|
||||
{
|
||||
struct cnx_mgr *cm_ctx;
|
||||
|
||||
cm_ctx = cm_get_cm_ctx(vdev);
|
||||
if (!cm_ctx)
|
||||
return;
|
||||
|
||||
cm_ctx->cm_candidate_advance_filter = filter_fun;
|
||||
}
|
||||
|
||||
void cm_set_candidate_custom_sort_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*sort_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
qdf_list_t *list))
|
||||
{
|
||||
struct cnx_mgr *cm_ctx;
|
||||
|
||||
cm_ctx = cm_get_cm_ctx(vdev);
|
||||
if (!cm_ctx)
|
||||
return;
|
||||
|
||||
cm_ctx->cm_candidate_list_custom_sort = sort_fun;
|
||||
}
|
||||
#endif
|
||||
|
@@ -399,6 +399,49 @@ static inline void wlan_cm_req_history_print(struct wlan_objmgr_vdev *vdev)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#ifdef CONN_MGR_ADV_FEATURE
|
||||
/**
|
||||
* wlan_cm_set_candidate_advance_filter_cb() - Set CM candidate advance
|
||||
* filter cb
|
||||
* @vdev: Objmgr vdev
|
||||
* @filter_fun: CM candidate advance filter cb
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline
|
||||
void wlan_cm_set_candidate_advance_filter_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*filter_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_filter *filter));
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_cm_set_candidate_custom_sort_cb() - Set CM candidate custom sort cb
|
||||
* @vdev: Objmgr vdev
|
||||
* @sort_fun: CM candidate custom sort cb
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline
|
||||
void wlan_cm_set_candidate_custom_sort_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*sort_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
qdf_list_t *list))
|
||||
{
|
||||
}
|
||||
#else
|
||||
void wlan_cm_set_candidate_advance_filter_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*filter_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_filter *filter));
|
||||
|
||||
void wlan_cm_set_candidate_custom_sort_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*sort_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
qdf_list_t *list));
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifdef WLAN_POLICY_MGR_ENABLE
|
||||
|
@@ -313,3 +313,22 @@ void wlan_cm_req_history_print(struct wlan_objmgr_vdev *vdev)
|
||||
cm_req_history_print(cm_ctx);
|
||||
}
|
||||
#endif /* SM_ENG_HIST_ENABLE */
|
||||
|
||||
#ifndef CONN_MGR_ADV_FEATURE
|
||||
void wlan_cm_set_candidate_advance_filter_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*filter_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
struct scan_filter *filter))
|
||||
{
|
||||
cm_set_candidate_advance_filter_cb(vdev, filter_fun);
|
||||
}
|
||||
|
||||
void wlan_cm_set_candidate_custom_sort_cb(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
void (*sort_fun)(struct wlan_objmgr_vdev *vdev,
|
||||
qdf_list_t *list))
|
||||
{
|
||||
cm_set_candidate_custom_sort_cb(vdev, sort_fun);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user