Skip to content

Commit

Permalink
brcmfmac: Add multi channel support for P2P.
Browse files Browse the repository at this point in the history
Multi channel support was disabled. This patch will enable it and
configure the P2P GO on the correct frequency when multi channel
is used.

Reviewed-by: Arend Van Spriel <[email protected]>
Signed-off-by: Hante Meuleman <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
Hante Meuleman authored and linvjw committed May 28, 2013
1 parent cbb371d commit 1c9d30c
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -3671,11 +3671,29 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif,
return err;
}

static s32
brcmf_cfg80211_set_channel(struct brcmf_cfg80211_info *cfg,
struct brcmf_if *ifp,
struct ieee80211_channel *channel)
{
u16 chanspec;
s32 err;

brcmf_dbg(TRACE, "band=%d, center_freq=%d\n", channel->band,
channel->center_freq);

chanspec = channel_to_chanspec(&cfg->d11inf, channel);
err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec);

return err;
}

static s32
brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_ap_settings *settings)
{
s32 ie_offset;
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct brcmf_if *ifp = netdev_priv(ndev);
struct brcmf_tlv *ssid_ie;
struct brcmf_ssid_le ssid_le;
Expand Down Expand Up @@ -3746,6 +3764,12 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,

brcmf_config_ap_mgmt_ie(ifp->vif, &settings->beacon);

err = brcmf_cfg80211_set_channel(cfg, ifp, settings->chandef.chan);
if (err < 0) {
brcmf_err("Set Channel failed, %d\n", err);
goto exit;
}

if (settings->beacon_interval) {
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD,
settings->beacon_interval);
Expand Down Expand Up @@ -4184,7 +4208,7 @@ static const struct ieee80211_iface_limit brcmf_iface_limits[] = {
static const struct ieee80211_iface_combination brcmf_iface_combos[] = {
{
.max_interfaces = BRCMF_IFACE_MAX_CNT,
.num_different_channels = 1, /* no multi-channel for now */
.num_different_channels = 2,
.n_limits = ARRAY_SIZE(brcmf_iface_limits),
.limits = brcmf_iface_limits
}
Expand Down

0 comments on commit 1c9d30c

Please sign in to comment.