diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index b2ba1ae089f0..681769102467 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -754,6 +754,22 @@ static void hdd_copy_ht_operation(hdd_station_ctx_t *hdd_sta_ctx, roam_ht_ops->basicMCSSet[i]; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) +static void hdd_copy_vht_center_freq(struct ieee80211_vht_operation *ieee_ops, + tDot11fIEVHTOperation *roam_ops) +{ + ieee_ops->center_freq_seg0_idx = roam_ops->chanCenterFreqSeg1; + ieee_ops->center_freq_seg1_idx = roam_ops->chanCenterFreqSeg2; +} +#else +static void hdd_copy_vht_center_freq(struct ieee80211_vht_operation *ieee_ops, + tDot11fIEVHTOperation *roam_ops) +{ + ieee_ops->center_freq_seg1_idx = roam_ops->chanCenterFreqSeg1; + ieee_ops->center_freq_seg2_idx = roam_ops->chanCenterFreqSeg2; +} +#endif /* KERNEL_VERSION(4, 12, 0) */ + /** * hdd_copy_vht_operation()- copy VHT operations element from roam info to * hdd station context. @@ -772,8 +788,7 @@ static void hdd_copy_vht_operation(hdd_station_ctx_t *hdd_sta_ctx, qdf_mem_zero(hdd_vht_ops, sizeof(struct ieee80211_vht_operation)); hdd_vht_ops->chan_width = roam_vht_ops->chanWidth; - hdd_vht_ops->center_freq_seg1_idx = roam_vht_ops->chanCenterFreqSeg1; - hdd_vht_ops->center_freq_seg2_idx = roam_vht_ops->chanCenterFreqSeg2; + hdd_copy_vht_center_freq(hdd_vht_ops, roam_vht_ops); hdd_vht_ops->basic_mcs_set = roam_vht_ops->basicMCSSet; }