summaryrefslogtreecommitdiff
path: root/CORE/SAP/src/sapModule.c
diff options
context:
space:
mode:
authorRyan Hsu <ryanhsu@qca.qualcomm.com>2014-07-17 20:02:53 -0700
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-07-22 22:01:34 -0700
commite975841fa034511657eaeb1229d1efb082072687 (patch)
tree1e98fe03b4e5aef3a8fa4fabc3dde16932da5af7 /CORE/SAP/src/sapModule.c
parent7174c1c1475264b0613a603da7082911bca86f8b (diff)
qcacld: sap: dfs nol and channel bonding
While starting BSS, if the primary channel is NOL, set all secondary channels to NOL and randomly pick the new channel candidate. Also fix the incorrect radar_found_timestamp, which is now using vos_get_monotonic_boottime() and it is in the unit of microseconds. Change-Id: Ic9a1e6d3a6f0b4f22f1158bd0f5474aa22e6faab CRs-fixed: 695429
Diffstat (limited to 'CORE/SAP/src/sapModule.c')
-rw-r--r--CORE/SAP/src/sapModule.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c
index 1333f11918b1..14af1d03c609 100644
--- a/CORE/SAP/src/sapModule.c
+++ b/CORE/SAP/src/sapModule.c
@@ -3245,8 +3245,10 @@ WLANSAP_Get_DfsNol(v_PVOID_t pSapCtx)
ptSapContext sapContext = (ptSapContext)pSapCtx;
v_PVOID_t hHal = NULL;
tpAniSirGlobal pMac = NULL;
- unsigned long current_time, elapsed_time, found_time, left_time;
+ v_U64_t current_time, found_time, elapsed_time;
+ unsigned long left_time;
tSapDfsNolInfo *dfs_nol = NULL;
+ v_BOOL_t bAvailable = FALSE;
if (NULL == sapContext)
{
@@ -3282,13 +3284,20 @@ WLANSAP_Get_DfsNol(v_PVOID_t pSapCtx)
if (!dfs_nol[i].dfs_channel_number)
continue;
- current_time = vos_timer_get_system_time();
+ current_time = vos_get_monotonic_boottime();
found_time = dfs_nol[i].radar_found_timestamp;
elapsed_time = abs(current_time - found_time);
- /* check if it is out of non occupancy period */
- if (elapsed_time >= SAP_DFS_NON_OCCUPANCY_PERIOD)
+ /* check if channel is available
+ * if either channel is usable or available, or timer expired 30mins
+ */
+ bAvailable =
+ ((dfs_nol[i].radar_status_flag == eSAP_DFS_CHANNEL_AVAILABLE) ||
+ (dfs_nol[i].radar_status_flag == eSAP_DFS_CHANNEL_USABLE) ||
+ (elapsed_time >= SAP_DFS_NON_OCCUPANCY_PERIOD));
+
+ if (bAvailable)
{
dfs_nol[i].radar_status_flag = eSAP_DFS_CHANNEL_AVAILABLE;
dfs_nol[i].radar_found_timestamp = 0;
@@ -3301,10 +3310,10 @@ WLANSAP_Get_DfsNol(v_PVOID_t pSapCtx)
/* the time left in min */
left_time = SAP_DFS_NON_OCCUPANCY_PERIOD - elapsed_time;
- left_time = left_time / (60 * 1000);
+ left_time = left_time / (60 * 1000 * 1000);
VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR,
- "%s: Channel[%d] is UNAVAILABLE [%ld min left]",
+ "%s: Channel[%d] is UNAVAILABLE [%lu min left]",
__func__,
dfs_nol[i].dfs_channel_number,
left_time);
@@ -3429,5 +3438,9 @@ WLANSAP_Set_DfsNol(v_PVOID_t pSapCtx, eSapDfsNolType conf)
__func__, conf);
}
+ /* set DFS-NOL back to keep it update-to-date in CNSS */
+ sapSignalHDDevent(sapContext, NULL, eSAP_DFS_NOL_SET,
+ (v_PVOID_t) eSAP_STATUS_SUCCESS);
+
return VOS_STATUS_SUCCESS;
}