parent
513de712f9
commit
72b5d58a2a
@ -0,0 +1,59 @@ |
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
|
||||
@@ -554,6 +554,12 @@ brcms_ops_bss_info_changed(struct ieee80
|
||||
/* Beaconing should be enabled/disabled (beaconing modes) */
|
||||
brcms_err(core, "%s: Beacon enabled: %s\n", __func__,
|
||||
info->enable_beacon ? "true" : "false");
|
||||
+ if (info->enable_beacon &&
|
||||
+ hw->wiphy->flags & WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD) {
|
||||
+ brcms_c_enable_probe_resp(wl->wlc, true);
|
||||
+ } else {
|
||||
+ brcms_c_enable_probe_resp(wl->wlc, false);
|
||||
+ }
|
||||
}
|
||||
|
||||
if (changed & BSS_CHANGED_CQM) {
|
||||
@@ -1048,7 +1054,12 @@ static int ieee_hw_init(struct ieee80211
|
||||
hw->channel_change_time = 7 * 1000;
|
||||
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
|
||||
|
||||
- hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
|
||||
+ /*
|
||||
+ * deactivate sending probe responses by ucude, because this will
|
||||
+ * cause problems when WPS is used.
|
||||
+ *
|
||||
+ * hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
|
||||
+ */
|
||||
|
||||
hw->rate_control_algorithm = "minstrel_ht";
|
||||
|
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
@@ -7484,6 +7484,17 @@ void brcms_c_set_new_probe_resp(struct b
|
||||
brcms_c_update_probe_resp(wlc, false);
|
||||
}
|
||||
|
||||
+void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable)
|
||||
+{
|
||||
+ /*
|
||||
+ * prevent ucode from sending probe responses by setting the timeout
|
||||
+ * to 1, it can not send it in that time frame.
|
||||
+ */
|
||||
+ wlc->prb_resp_timeout = enable ? BRCMS_PRB_RESP_TIMEOUT : 1;
|
||||
+ brcms_b_write_shm(wlc->hw, M_PRS_MAXTIME, wlc->prb_resp_timeout);
|
||||
+ /* TODO: if (enable) => also deactivate receiving of probe request */
|
||||
+}
|
||||
+
|
||||
/* Write ssid into shared memory */
|
||||
static void
|
||||
brcms_c_shm_ssid_upd(struct brcms_c_info *wlc, struct brcms_bss_cfg *cfg)
|
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/pub.h
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
|
||||
@@ -338,6 +338,7 @@ extern void brcms_c_set_new_beacon(struc
|
||||
u16 dtim_period);
|
||||
extern void brcms_c_set_new_probe_resp(struct brcms_c_info *wlc,
|
||||
struct sk_buff *probe_resp);
|
||||
+extern void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable);
|
||||
extern void brcms_c_set_ssid(struct brcms_c_info *wlc, u8 *ssid,
|
||||
size_t ssid_len);
|
||||
|
@ -0,0 +1,74 @@ |
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
|
||||
@@ -359,11 +359,12 @@ brcms_ops_add_interface(struct ieee80211
|
||||
{
|
||||
struct brcms_info *wl = hw->priv;
|
||||
|
||||
- /* Just STA and AP for now */
|
||||
+ /* Just STA, AP and ADHOC for now */
|
||||
if (vif->type != NL80211_IFTYPE_STATION &&
|
||||
- vif->type != NL80211_IFTYPE_AP) {
|
||||
+ vif->type != NL80211_IFTYPE_AP &&
|
||||
+ vif->type != NL80211_IFTYPE_ADHOC) {
|
||||
brcms_err(wl->wlc->hw->d11core,
|
||||
- "%s: Attempt to add type %d, only STA and AP for now\n",
|
||||
+ "%s: Attempt to add type %d, only STA, AP and AdHoc for now\n",
|
||||
__func__, vif->type);
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
@@ -376,6 +377,8 @@ brcms_ops_add_interface(struct ieee80211
|
||||
else if (vif->type == NL80211_IFTYPE_AP)
|
||||
brcms_c_start_ap(wl->wlc, vif->addr, vif->bss_conf.bssid,
|
||||
vif->bss_conf.ssid, vif->bss_conf.ssid_len);
|
||||
+ else if (vif->type == NL80211_IFTYPE_ADHOC)
|
||||
+ brcms_c_start_adhoc(wl->wlc, vif->addr);
|
||||
spin_unlock_bh(&wl->lock);
|
||||
|
||||
return 0;
|
||||
@@ -1057,7 +1060,8 @@ static int ieee_hw_init(struct ieee80211
|
||||
/* channel change time is dependent on chip and band */
|
||||
hw->channel_change_time = 7 * 1000;
|
||||
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
|
||||
- BIT(NL80211_IFTYPE_AP);
|
||||
+ BIT(NL80211_IFTYPE_AP) |
|
||||
+ BIT(NL80211_IFTYPE_ADHOC);
|
||||
|
||||
/*
|
||||
* deactivate sending probe responses by ucude, because this will
|
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
|
||||
@@ -2188,6 +2188,14 @@ void brcms_c_start_ap(struct brcms_c_inf
|
||||
brcms_b_mctrl(wlc->hw, MCTL_AP | MCTL_INFRA, MCTL_AP | MCTL_INFRA);
|
||||
}
|
||||
|
||||
+void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr)
|
||||
+{
|
||||
+ memcpy(wlc->pub->cur_etheraddr, addr, sizeof(wlc->pub->cur_etheraddr));
|
||||
+ wlc->bsscfg->type = BRCMS_TYPE_ADHOC;
|
||||
+
|
||||
+ brcms_b_mctrl(wlc->hw, MCTL_AP | MCTL_INFRA, 0);
|
||||
+}
|
||||
+
|
||||
/* Initialize GPIOs that are controlled by D11 core */
|
||||
static void brcms_c_gpio_init(struct brcms_c_info *wlc)
|
||||
{
|
||||
@@ -3079,6 +3087,9 @@ static bool brcms_c_ps_allowed(struct br
|
||||
if (wlc->bsscfg->type == BRCMS_TYPE_AP)
|
||||
return false;
|
||||
|
||||
+ if (wlc->bsscfg->type == BRCMS_TYPE_ADHOC)
|
||||
+ return false;
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/brcm80211/brcmsmac/pub.h
|
||||
+++ b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
|
||||
@@ -334,6 +334,7 @@ extern bool brcms_c_tx_flush_completed(s
|
||||
extern void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
|
||||
extern void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr,
|
||||
const u8 *bssid, u8 *ssid, size_t ssid_len);
|
||||
+extern void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr);
|
||||
extern void brcms_c_update_beacon(struct brcms_c_info *wlc);
|
||||
extern void brcms_c_set_new_beacon(struct brcms_c_info *wlc,
|
||||
struct sk_buff *beacon, u16 tim_offset,
|
Loading…
Reference in new issue