mirror of https://gitee.com/openkylin/linux.git
staging: rtl8821ae: regd.c: Remove version specific code
The code should be for the current kernel version. Remove conditional version based code. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
756a748106
commit
b9ddcee903
|
@ -158,11 +158,6 @@ static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy,
|
|||
const struct ieee80211_reg_rule *reg_rule;
|
||||
struct ieee80211_channel *ch;
|
||||
unsigned int i;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0))
|
||||
u32 bandwidth = 0;
|
||||
int r;
|
||||
#endif
|
||||
|
||||
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
|
||||
|
||||
if (!wiphy->bands[band])
|
||||
|
@ -176,16 +171,9 @@ static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy,
|
|||
(ch->flags & IEEE80211_CHAN_RADAR))
|
||||
continue;
|
||||
if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) {
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
|
||||
reg_rule = freq_reg_info(wiphy, ch->center_freq);
|
||||
if (IS_ERR(reg_rule))
|
||||
continue;
|
||||
#else
|
||||
r = freq_reg_info(wiphy, ch->center_freq,
|
||||
bandwidth, ®_rule);
|
||||
if (r)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/*
|
||||
*If 11d had a rule for this channel ensure
|
||||
|
@ -219,10 +207,6 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
|
|||
struct ieee80211_supported_band *sband;
|
||||
struct ieee80211_channel *ch;
|
||||
const struct ieee80211_reg_rule *reg_rule;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0))
|
||||
u32 bandwidth = 0;
|
||||
int r;
|
||||
#endif
|
||||
|
||||
if (!wiphy->bands[IEEE80211_BAND_2GHZ])
|
||||
return;
|
||||
|
@ -250,26 +234,16 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
|
|||
*/
|
||||
|
||||
ch = &sband->channels[11]; /* CH 12 */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
|
||||
reg_rule = freq_reg_info(wiphy, ch->center_freq);
|
||||
if (!IS_ERR(reg_rule)) {
|
||||
#else
|
||||
r = freq_reg_info(wiphy, ch->center_freq, bandwidth, ®_rule);
|
||||
if (!r) {
|
||||
#endif
|
||||
if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
|
||||
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
|
||||
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
}
|
||||
|
||||
ch = &sband->channels[12]; /* CH 13 */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
|
||||
reg_rule = freq_reg_info(wiphy, ch->center_freq);
|
||||
if (!IS_ERR(reg_rule)) {
|
||||
#else
|
||||
r = freq_reg_info(wiphy, ch->center_freq, bandwidth, ®_rule);
|
||||
if (!r) {
|
||||
#endif
|
||||
if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN))
|
||||
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
|
||||
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
|
@ -389,19 +363,11 @@ static const struct ieee80211_regdomain *_rtl_regdomain_select(
|
|||
}
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
|
||||
static int _rtl_regd_init_wiphy(struct rtl_regulatory *reg,
|
||||
struct wiphy *wiphy,
|
||||
void (*reg_notifier) (struct wiphy * wiphy,
|
||||
struct regulatory_request *
|
||||
request))
|
||||
#else
|
||||
static int _rtl_regd_init_wiphy(struct rtl_regulatory *reg,
|
||||
struct wiphy *wiphy,
|
||||
int (*reg_notifier) (struct wiphy * wiphy,
|
||||
struct regulatory_request *
|
||||
request))
|
||||
#endif
|
||||
{
|
||||
const struct ieee80211_regdomain *regd;
|
||||
|
||||
|
@ -429,15 +395,9 @@ static struct country_code_to_enum_rd *_rtl_regd_find_country(u16 countrycode)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
|
||||
int rtl_regd_init(struct ieee80211_hw *hw,
|
||||
void (*reg_notifier) (struct wiphy *wiphy,
|
||||
struct regulatory_request *request))
|
||||
#else
|
||||
int rtl_regd_init(struct ieee80211_hw *hw,
|
||||
int (*reg_notifier) (struct wiphy *wiphy,
|
||||
struct regulatory_request *request))
|
||||
#endif
|
||||
{
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct wiphy *wiphy = hw->wiphy;
|
||||
|
@ -480,7 +440,6 @@ int rtl_regd_init(struct ieee80211_hw *hw,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
|
||||
void rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
||||
{
|
||||
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
|
||||
|
@ -490,14 +449,3 @@ void rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
|||
|
||||
_rtl_reg_notifier_apply(wiphy, request, &rtlpriv->regd);
|
||||
}
|
||||
#else
|
||||
int rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
||||
{
|
||||
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
|
||||
RT_TRACE(COMP_REGD, DBG_LOUD, ("\n"));
|
||||
|
||||
return _rtl_reg_notifier_apply(wiphy, request, &rtlpriv->regd);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue