brcmfmac: Add multi channel support for P2P.

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 <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Hante Meuleman 2013-05-27 21:09:58 +02:00 committed by John W. Linville
parent cbb371da23
commit 1c9d30cfac
1 changed files with 25 additions and 1 deletions

View File

@ -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;
@ -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);
@ -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
}