From 2a9711aa84396f4f73632d2916d897eda9ea258b Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 10 Aug 2017 15:44:50 -0700 Subject: =?UTF-8?q?qcacld-3.0:=20Fix=20compilation=20issue=20no=20member?= =?UTF-8?q?=20named=20=E2=80=98center=5Ffreq=5Fseg2=5Fidx=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linux kernel 4.12 renamed center_freq_seg2idx to center_freq_seg1idx and center_freq_seg1idx to center_freq_seg0idx. Add conditional compilation to access the correct fields based on the kernel version. Change-Id: Id8c20f9e47eecdbdf121c88cb5e017f662e2e15e CRs-Fixed: 2091058 --- core/hdd/src/wlan_hdd_assoc.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 15e1ed5a8237..3fa377dea1dd 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -744,6 +744,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. @@ -762,8 +778,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; } -- cgit v1.2.3