qcacmn: Add the event handler for WMI_REG_CHAN_LIST_CC_EVENTID

Add event handler for WMI_REG_CHAN_LIST_CC_EVENTID.This handler
would be called from psoc_open object manager framework
initialization.

Change-Id: Icfd52fdb7056fdb77afdbd1be576d160719b7285
CRs-Fixed: 2002892
This commit is contained in:
Amar Singhal
2017-02-10 15:24:40 -08:00
committad av Sandeep Puligilla
förälder a6f2836edb
incheckning e407974144
10 ändrade filer med 342 tillägg och 25 borttagningar

Visa fil

@@ -27,6 +27,7 @@
#ifdef WLAN_ATF_ENABLE
#include "wlan_atf_utils_defs.h"
#endif
#include <reg_services_public_struct.h>
#ifdef WLAN_CONV_CRYPTO_SUPPORTED
#include "wlan_crypto_global_def.h"
@@ -345,6 +346,19 @@ struct wlan_lmac_if_nan_tx_ops {
};
#endif
/**
* struct wlan_lmac_reg_if_tx_ops - structure of tx function
* pointers for regulatory component
* @register_master_handler: pointer to register event handler
* @unregister_master_handler: pointer to unregister event handler
*/
struct wlan_lmac_if_reg_tx_ops {
QDF_STATUS (*register_master_handler)(struct wlan_objmgr_psoc *psoc,
void *arg);
QDF_STATUS (*unregister_master_handler)(struct wlan_objmgr_psoc *psoc,
void *arg);
};
/**
* struct wlan_lmac_if_tx_ops - south bound tx function pointers
* @mgmt_txrx_tx_ops: mgmt txrx tx ops
@@ -369,18 +383,22 @@ struct wlan_lmac_if_tx_ops {
#ifdef CONVERGED_P2P_ENABLE
struct wlan_lmac_if_p2p_tx_ops p2p;
#endif
#ifdef WLAN_ATF_ENABLE
struct wlan_lmac_if_atf_tx_ops atf_tx_ops;
#endif
#ifdef WLAN_CONV_CRYPTO_SUPPORTED
struct wlan_lmac_if_crypto_tx_ops crypto_tx_ops;
#endif
#ifdef WIFI_POS_CONVERGED
struct wlan_lmac_if_wifi_pos_tx_ops wifi_pos_tx_ops;
#endif
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
struct wlan_lmac_if_nan_tx_ops nan_tx_ops;
#endif
struct wlan_lmac_if_reg_tx_ops reg_ops;
};
/**
@@ -432,6 +450,10 @@ struct wlan_lmac_if_pmo_rx_ops {
struct pmo_lphb_rsp *rsp_param);
};
#endif
struct wlan_lmac_if_reg_rx_ops {
QDF_STATUS (*master_list_handler)(struct cur_regulatory_info
*reg_info);
};
#ifdef CONVERGED_P2P_ENABLE
@@ -593,6 +615,7 @@ struct wlan_lmac_if_rx_ops {
#ifdef CONVERGED_P2P_ENABLE
struct wlan_lmac_if_p2p_rx_ops p2p;
#endif
#ifdef WLAN_ATF_ENABLE
struct wlan_lmac_if_atf_rx_ops atf_rx_ops;
#endif
@@ -605,6 +628,7 @@ struct wlan_lmac_if_rx_ops {
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
struct wlan_lmac_if_nan_rx_ops nan_rx_ops;
#endif
struct wlan_lmac_if_reg_rx_ops reg_rx_ops;
};
/* Function pointer to call legacy tx_ops registration in OL/WMA.

Visa fil

@@ -31,6 +31,7 @@
#ifdef WLAN_FEATURE_NAN_CONVERGENCE
#include "target_if_nan.h"
#endif /* WLAN_FEATURE_NAN_CONVERGENCE */
#include "wlan_reg_tgt_api.h"
#ifdef WLAN_CONV_CRYPTO_SUPPORTED
#include "wlan_crypto_global_api.h"
@@ -171,8 +172,10 @@ wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
tgt_mgmt_txrx_get_peer_from_desc_id;
mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id =
tgt_mgmt_txrx_get_vdev_id_from_desc_id;
/* scan rx ops */
rx_ops->scan.scan_ev_handler = tgt_scan_event_handler;
wlan_lmac_if_atf_rx_ops_register(rx_ops);
wlan_lmac_if_crypto_rx_ops_register(rx_ops);
@@ -181,6 +184,9 @@ wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
wlan_lmac_if_register_nan_rx_ops(rx_ops);
rx_ops->reg_rx_ops.master_list_handler =
tgt_reg_process_master_chan_list;
return QDF_STATUS_SUCCESS;
}

Visa fil

@@ -543,6 +543,7 @@ void reg_set_channel_params(struct wlan_objmgr_psoc *psoc,
break;
}
}
if (CH_WIDTH_160MHZ == ch_params->ch_width) {
ch_params->center_freq_seg1 = ch_params->center_freq_seg0;
chan_state = reg_get_5g_bonded_channel(psoc, ch,
@@ -552,9 +553,10 @@ void reg_set_channel_params(struct wlan_objmgr_psoc *psoc,
(bonded_chan_ptr->start_ch +
bonded_chan_ptr->end_ch)/2;
}
reg_info("ch %d ch_wd %d freq0 %d freq1 %d", ch,
ch_params->ch_width, ch_params->center_freq_seg0,
ch_params->center_freq_seg1);
reg_debug("ch %d ch_wd %d freq0 %d freq1 %d", ch,
ch_params->ch_width, ch_params->center_freq_seg0,
ch_params->center_freq_seg1);
}
/**
@@ -588,7 +590,7 @@ bool reg_is_dfs_ch(struct wlan_objmgr_psoc *psoc, uint8_t ch)
static void reg_fill_channel_info(enum channel_enum chan_enum,
struct regulatory_rule *reg_rule,
struct cur_reg_rule *reg_rule,
struct regulatory_channel *master_list,
uint16_t min_bw)
{
@@ -632,13 +634,13 @@ static void reg_fill_channel_info(enum channel_enum chan_enum,
static void populate_band_channels(enum channel_enum start_chan,
enum channel_enum end_chan,
struct regulatory_rule *rule_start_ptr,
struct cur_reg_rule *rule_start_ptr,
uint32_t num_reg_rules,
uint16_t min_bw,
struct regulatory_channel *mas_chan_list)
{
struct regulatory_rule *found_rule_ptr;
struct regulatory_rule *cur_rule_ptr;
struct cur_reg_rule *found_rule_ptr;
struct cur_reg_rule *cur_rule_ptr;
struct regulatory_channel;
enum channel_enum chan_enum;
uint32_t rule_num, bw;
@@ -674,7 +676,7 @@ static void populate_band_channels(enum channel_enum start_chan,
}
static void update_max_bw_per_rule(uint32_t num_reg_rules,
struct regulatory_rule *reg_rule_start,
struct cur_reg_rule *reg_rule_start,
uint16_t max_bw)
{
uint32_t count;
@@ -685,7 +687,7 @@ static void update_max_bw_per_rule(uint32_t num_reg_rules,
}
static void do_auto_bw_correction(uint32_t num_reg_rules,
struct regulatory_rule *reg_rule_ptr,
struct cur_reg_rule *reg_rule_ptr,
uint16_t max_bw)
{
uint32_t count;
@@ -710,7 +712,7 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
{
struct wlan_regulatory_psoc_priv_obj *soc_reg;
uint32_t num_2g_reg_rules, num_5g_reg_rules;
struct regulatory_rule *reg_rule_2g, *reg_rule_5g;
struct cur_reg_rule *reg_rule_2g, *reg_rule_5g;
uint16_t min_bw_2g, max_bw_2g, min_bw_5g, max_bw_5g;
struct regulatory_channel *mas_chan_list, *cur_chan_list;
@@ -765,10 +767,6 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
qdf_mem_copy((void *)cur_chan_list, (void *)mas_chan_list,
NUM_CHANNELS * sizeof(struct regulatory_channel));
qdf_mem_free(regulat_info->reg_rules_2g_ptr);
qdf_mem_free(regulat_info->reg_rules_5g_ptr);
qdf_mem_free(regulat_info);
return QDF_STATUS_SUCCESS;
}
@@ -818,7 +816,8 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
status = wlan_objmgr_psoc_component_obj_attach(psoc,
WLAN_UMAC_COMP_REGULATORY, soc_reg_obj,
QDF_STATUS_SUCCESS);
reg_info("reg psoc obj created with status %d", status);
reg_debug("reg psoc obj created with status %d", status);
return status;
}
@@ -840,6 +839,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_destroyed_notification(
struct wlan_regulatory_psoc_priv_obj *soc_reg =
wlan_objmgr_psoc_get_comp_private_obj(psoc,
WLAN_UMAC_COMP_REGULATORY);
if (NULL == soc_reg) {
reg_err("reg psoc private obj is NULL");
return QDF_STATUS_E_FAULT;
@@ -852,7 +852,9 @@ QDF_STATUS wlan_regulatory_psoc_obj_destroyed_notification(
soc_reg);
if (status != QDF_STATUS_SUCCESS)
reg_err("soc_reg private obj detach failed");
reg_info("reg psoc obj deleted with status %d", status);
reg_debug("reg psoc obj deleted with status %d", status);
qdf_mem_free(soc_reg);
return status;

Visa fil

@@ -59,6 +59,7 @@ typedef enum {
REGDOMAIN_COUNT
} v_REGDOMAIN_t;
/**
* enum phy_ch_width - channel width
* @CH_WIDTH_20MHZ: 20 mhz width
@@ -83,7 +84,6 @@ enum phy_ch_width {
CH_WIDTH_MAX
};
/**
* struct ch_params
* @ch_width: channel width
@@ -126,7 +126,6 @@ struct channel_power {
uint32_t tx_power;
};
/**
* enum channel_enum - channel enumeration
* @CHAN_ENUM_1: channel number 1
@@ -323,7 +322,6 @@ enum ht_sec_ch_offset {
};
extern const struct chan_map channel_map[NUM_CHANNELS];
QDF_STATUS reg_get_channel_list_with_power(struct wlan_objmgr_psoc *psoc,
@@ -353,9 +351,14 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
struct wlan_objmgr_psoc *psoc,
void *arg_list);
QDF_STATUS wlan_regulatory_psoc_obj_destroyed_notification(
struct wlan_objmgr_psoc *psoc,
void *arg_list);
static inline struct wlan_lmac_if_reg_tx_ops *
get_reg_psoc_tx_ops(struct wlan_objmgr_psoc *psoc)
{
return &((psoc->soc_cb.tx_ops.reg_ops));
}
#endif

Visa fil

@@ -26,11 +26,29 @@
#include "../../core/src/reg_db.h"
/**
* struct cur_reg_rule
* @start_freq: start frequency
* @end_freq: end frequency
* @max_bw: maximum bandwidth
* @reg_power: regulatory power
* @ant_gain: antenna gain
* @flags: regulatory flags
*/
struct cur_reg_rule {
uint16_t start_freq;
uint16_t end_freq;
uint16_t max_bw;
uint8_t reg_power;
uint8_t ant_gain;
uint16_t flags;
};
/**
* struct cur_regulatory_info
* @psoc: psoc ptr
* @alpha2: country alpha2
* @dfs_region: dfs region
* @dfs_reg: dfs region
* @phybitmap: phy bit map
* @min_bw_2g: minimum 2G bw
* @max_bw_2g: maximum 2G bw
@@ -52,8 +70,8 @@ struct cur_regulatory_info {
uint32_t max_bw_5g;
uint32_t num_2g_reg_rules;
uint32_t num_5g_reg_rules;
struct regulatory_rule *reg_rules_2g_ptr;
struct regulatory_rule *reg_rules_5g_ptr;
struct cur_reg_rule *reg_rules_2g_ptr;
struct cur_reg_rule *reg_rules_5g_ptr;
};
/**

Visa fil

@@ -121,4 +121,19 @@ QDF_STATUS wlan_regulatory_init(void);
*/
QDF_STATUS wlan_regulatory_deinit(void);
/**
* regulatory_psoc_open() - open regulatory component
*
* Return: Success or Failure
*/
QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc);
/**
* regulatory_psoc_close() - close regulatory component
*
* Return: Success or Failure
*/
QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc);
#endif

Visa fil

@@ -184,7 +184,7 @@ QDF_STATUS wlan_regulatory_init(void)
return status;
}
reg_info("regulatory handlers registered with obj mgr");
reg_debug("regulatory handlers registered with obj mgr");
return QDF_STATUS_SUCCESS;
}
@@ -214,9 +214,32 @@ QDF_STATUS wlan_regulatory_deinit(void)
status);
return status;
}
reg_alert("deregistered callbacks with obj mgr successfully");
reg_debug("deregistered callbacks with obj mgr successfully");
return QDF_STATUS_SUCCESS;
}
QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc)
{
struct wlan_lmac_if_reg_tx_ops *tx_ops;
tx_ops = get_reg_psoc_tx_ops(psoc);
tx_ops->register_master_handler(psoc, NULL);
return QDF_STATUS_SUCCESS;
};
QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc)
{
struct wlan_lmac_if_reg_tx_ops *tx_ops;
tx_ops = get_reg_psoc_tx_ops(psoc);
tx_ops->unregister_master_handler(psoc, NULL);
return QDF_STATUS_SUCCESS;
};