if (dhd && dhd->pub.up) {
memcpy(&dhd->pub.dhd_cspec, cspec, sizeof(wl_country_t));
#ifdef WL_CFG80211
- wl_update_wiphybands(NULL);
+ wl_update_wiphybands(NULL, cspec->ccode);
+#endif
+ }
+}
+
+void dhd_bus_band_set(struct net_device *dev, uint band)
+{
+ dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
+
+ if (dhd && dhd->pub.up) {
+#ifdef WL_CFG80211
+ wl_update_wiphybands(NULL, NULL);
#endif
}
}
return err;
}
-s32 wl_update_wiphybands(struct wl_priv *wl)
+s32 wl_update_wiphybands(struct wl_priv *wl, char *country_code)
{
struct wiphy *wiphy;
struct net_device *dev;
int nmode = 0;
int bw_cap = 0;
int index = 0;
+ struct regulatory_request *new_request;
bool rollback_lock = false;
WL_DBG(("Entry"));
}
wiphy_apply_custom_regulatory(wiphy, &brcm_regdom);
+
+ if (country_code != NULL) {
+ WL_DBG(("country_code[0]=%c, country_code[1]=%c\n", country_code[0], country_code[1]));
+ /* Allocate a requlatory request to update cfg80211 for the supported channels */
+ new_request = kzalloc(sizeof(struct regulatory_request),
+ GFP_KERNEL);
+ if (!new_request) {
+ WL_ERR(("error Memory alloc for requlatory request failed\n"));
+ err = -ENOMEM;
+ } else {
+ new_request->alpha2[0] = country_code[0];
+ new_request->alpha2[1] = country_code[1];
+ WL_DBG(("Send an event to cfg80211 to update supplicant to take the new channel list"));
+ nl80211_send_reg_change_event(new_request);
+ kfree(new_request);
+ }
+ }
+
end_bands:
if (rollback_lock)
mutex_unlock(&wl->usr_sync);
if (unlikely(err && err != -EINPROGRESS)) {
WL_ERR(("wl_config_ifmode failed\n"));
}
- err = wl_update_wiphybands(wl);
+ err = wl_update_wiphybands(wl, NULL);
if (unlikely(err)) {
WL_ERR(("wl_update_wiphybands failed\n"));
}
extern s32 wl_mode_to_nl80211_iftype(s32 mode);
int wl_cfg80211_do_driver_init(struct net_device *net);
void wl_cfg80211_enable_trace(int level);
-extern s32 wl_update_wiphybands(struct wl_priv *wl);
+extern s32 wl_update_wiphybands(struct wl_priv *wl, char *country_code);
extern s32 wl_cfg80211_if_is_group_owner(void);
+extern void nl80211_send_reg_change_event(struct regulatory_request *request);
#endif /* _wl_cfg80211_h_ */
if ((band == WLC_BAND_AUTO) || (band == WLC_BAND_5G) || (band == WLC_BAND_2G)) {
error = wldev_ioctl(dev, WLC_SET_BAND, &band, sizeof(band), 1);
+ if (!error)
+ dhd_bus_band_set(dev, band);
}
return error;
}
extern void get_customized_country_code(char *country_iso_code, wl_country_t *cspec);
extern void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec);
+extern void dhd_bus_band_set(struct net_device *dev, uint band);
extern int wldev_set_country(struct net_device *dev, char *country_code);
extern int net_os_wake_lock(struct net_device *dev);
extern int net_os_wake_unlock(struct net_device *dev);