/*
* 函 数 名 : hmac_dfs_off_chan_cac_opern_ch_dwell_timeout
* 功能描述 : 无
* 1.日 期 : 2014年10月29日
* 修改内容 : 新生成函数
*/
OAL_STATIC uint32_t hmac_dfs_off_chan_cac_opern_ch_dwell_timeout(void *p_arg)
{
hmac_vap_stru *pst_hmac_vap = NULL;
hmac_band_stru *pst_band = NULL;
hcc_timer_register_param hcc_timer_param = {0};
pst_hmac_vap = (hmac_vap_stru *)p_arg;
if (pst_hmac_vap == NULL) {
OAM_WARNING_LOG0(0, OAM_SF_DFS, "{hmac_dfs_off_chan_cac_opern_ch_dwell_timeout::p_arg is null.}");
return OAL_ERR_CODE_PTR_NULL;
}
pst_band = pst_hmac_vap->pst_band;
if (OAL_IS_NULL_PTR1(pst_band)) {
OAM_WARNING_LOG0(0, OAM_SF_DFS, "{hmac_dfs_off_chan_cac_opern_ch_dwell_timeout::pst_band is null.}");
return OAL_ERR_CODE_PTR_NULL;
}
/* 当前信道为offchan 标志 */
pst_band->st_feature.st_dfs.uc_offchan_flag = (BIT0 | BIT1);
#ifdef _PRE_WLAN_FEATURE_OFFCHAN_CAC
uint32_t ret;
/* 切换到Off-channel CAC检测信道 */
ret = hmac_scan_switch_channel_off(&pst_hmac_vap->st_vap_base_info);
if (ret != OAL_SUCC) {
OAM_WARNING_LOG1(0, OAM_SF_DFS,
"{hmac_dfs_off_chan_cac_opern_ch_dwell_timeout::channel_off failed[%d].}", ret);
}
#endif
/* 将当前off-channel cac信道信息赋值给VAP */
/* 启动Off-channel信道上检测时长定时器 */
hcc_timer_param_init(&hcc_timer_param, pst_hmac_vap, OAL_FALSE, OAM_MODULE_ID_HMAC, hcc_msg_get_handle_core());
hcc_timer_register_start(&pst_band->st_feature.st_dfs.st_dfs_chan_dwell_timer,
hmac_dfs_off_chan_cac_off_ch_dwell_timeout,
pst_band->st_feature.st_dfs_info.us_dfs_off_chan_cac_off_chan_dwell_time,
&hcc_timer_param);
return OAL_SUCC;
}
/*
* 函 数 名 : hmac_dfs_off_chan_cac_off_ch_dwell_timeout
* 功能描述 : 无
* 1.日 期 : 2014年10月29日
* 修改内容 : 新生成函数
*/
OAL_STATIC uint32_t hmac_dfs_off_chan_cac_off_ch_dwell_timeout(void *p_arg)
{
hmac_vap_stru *pst_hmac_vap = NULL;
hmac_band_stru *pst_band = NULL;
#ifdef _PRE_WLAN_FEATURE_OFFCHAN_CAC
uint32_t ret;
#endif
hcc_timer_register_param hcc_timer_param = {0};
pst_hmac_vap = (hmac_vap_stru *)p_arg;
if (pst_hmac_vap == NULL) {
OAM_WARNING_LOG0(0, OAM_SF_DFS, "{hmac_dfs_off_chan_cac_off_ch_dwell_timeout::p_arg is null.}");
return OAL_ERR_CODE_PTR_NULL;
}
pst_band = pst_hmac_vap->pst_band;
if (OAL_IS_NULL_PTR1(pst_band)) {
OAM_WARNING_LOG0(0, OAM_SF_DFS, "{hmac_dfs_off_chan_cac_off_ch_dwell_timeout::pst_band is null.}");
return OAL_ERR_CODE_PTR_NULL;
}
/* 当前信道为homechan标志 */
pst_band->st_feature.st_dfs.uc_offchan_flag = BIT1;
#ifdef _PRE_WLAN_FEATURE_OFFCHAN_CAC
/* 切换回工作信道 */
ret = hmac_scan_switch_channel_back(&(pst_hmac_vap->st_vap_base_info));
if (ret != OAL_SUCC) {
OAM_WARNING_LOG1(0, OAM_SF_DFS,
"{hmac_dfs_off_chan_cac_off_ch_dwell_timeout::scan_switch_channel_back failed[%d].}", ret);
}
#endif
/* 启动在工作信道上的工作时长定时器 */
hcc_timer_param_init(&hcc_timer_param, pst_hmac_vap, OAL_FALSE, OAM_MODULE_ID_HMAC, hcc_msg_get_handle_core());
hcc_timer_register_start(&pst_band->st_feature.st_dfs.st_dfs_chan_dwell_timer,
hmac_dfs_off_chan_cac_opern_ch_dwell_timeout,
pst_band->st_feature.st_dfs_info.us_dfs_off_chan_cac_opern_chan_dwell_time,
&hcc_timer_param);
return OAL_SUCC;
}