qcacld-3.0: Fix compilation issue no member named ‘center_freq_seg2_idx’

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
This commit is contained in:
Dustin Brown 2017-08-10 15:44:50 -07:00 • committed by Anjaneedevi Kapparapu
commit 8aef46daf6

View file

@ -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;
}