qcacld-3.0: Disable non-20 mhz 2G world regulatory channels

The minimum bandwidth supported is 5 MHZ. Kernel API
wiphy_apply_custom_regulatory can enable channels 12/13
with BW 5/10 even for reg rule 2402-2472. Circumvent the issue
by doing a check in the driver.

Change-Id: I9ad600eda2e507312a3016aa6d1fe6fdc41724f2
CRs-Fixed: 1079851
diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c
index 4487d5d..2c23746 100644
--- a/core/hdd/src/wlan_hdd_regulatory.c
+++ b/core/hdd/src/wlan_hdd_regulatory.c
@@ -230,6 +230,8 @@
 				     struct wiphy *wiphy)
 {
 	const struct ieee80211_regdomain *reg_rules;
+	int chan_num;
+	struct ieee80211_channel chan;
 
 	if (hdd_is_world_regdomain(reg->reg_domain)) {
 		reg_rules = hdd_get_world_regrules(reg);
@@ -249,6 +251,17 @@
 	wiphy_apply_custom_regulatory(wiphy, reg_rules);
 
 	/*
+	 * disable 2.4 Ghz channels that dont have 20 mhz bw
+	 */
+	for (chan_num = 0;
+	     chan_num < wiphy->bands[IEEE80211_BAND_2GHZ]->n_channels;
+	     chan_num++) {
+		chan = wiphy->bands[IEEE80211_BAND_2GHZ]->channels[chan_num];
+		if (chan.flags & IEEE80211_CHAN_NO_20MHZ)
+			chan.flags |= IEEE80211_CHAN_DISABLED;
+	}
+
+	/*
 	 * restore the driver regulatory flags since
 	 * wiphy_apply_custom_regulatory may have
 	 * changed them