Skip to content

Commit aa70b4f

Browse files
Arend van Spriellinvjw
authored andcommitted
brcmfmac: moving some functions around
Just reordering the functions in preparation of subsequent changes. Signed-off-by: Arend van Spriel <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent c08437b commit aa70b4f

File tree

1 file changed

+144
-144
lines changed

1 file changed

+144
-144
lines changed

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c

Lines changed: 144 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -4278,126 +4278,6 @@ static struct cfg80211_ops wl_cfg80211_ops = {
42784278
.tdls_oper = brcmf_cfg80211_tdls_oper,
42794279
};
42804280

4281-
static void brcmf_wiphy_pno_params(struct wiphy *wiphy)
4282-
{
4283-
/* scheduled scan settings */
4284-
wiphy->max_sched_scan_ssids = BRCMF_PNO_MAX_PFN_COUNT;
4285-
wiphy->max_match_sets = BRCMF_PNO_MAX_PFN_COUNT;
4286-
wiphy->max_sched_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX;
4287-
wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
4288-
}
4289-
4290-
static const struct ieee80211_iface_limit brcmf_iface_limits[] = {
4291-
{
4292-
.max = 2,
4293-
.types = BIT(NL80211_IFTYPE_STATION) |
4294-
BIT(NL80211_IFTYPE_ADHOC) |
4295-
BIT(NL80211_IFTYPE_AP)
4296-
},
4297-
{
4298-
.max = 1,
4299-
.types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
4300-
BIT(NL80211_IFTYPE_P2P_GO)
4301-
},
4302-
{
4303-
.max = 1,
4304-
.types = BIT(NL80211_IFTYPE_P2P_DEVICE)
4305-
}
4306-
};
4307-
static struct ieee80211_iface_combination brcmf_iface_combos[] = {
4308-
{
4309-
.max_interfaces = BRCMF_IFACE_MAX_CNT,
4310-
.num_different_channels = 1,
4311-
.n_limits = ARRAY_SIZE(brcmf_iface_limits),
4312-
.limits = brcmf_iface_limits
4313-
}
4314-
};
4315-
4316-
static const struct ieee80211_txrx_stypes
4317-
brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
4318-
[NL80211_IFTYPE_STATION] = {
4319-
.tx = 0xffff,
4320-
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
4321-
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
4322-
},
4323-
[NL80211_IFTYPE_P2P_CLIENT] = {
4324-
.tx = 0xffff,
4325-
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
4326-
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
4327-
},
4328-
[NL80211_IFTYPE_P2P_GO] = {
4329-
.tx = 0xffff,
4330-
.rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
4331-
BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
4332-
BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
4333-
BIT(IEEE80211_STYPE_DISASSOC >> 4) |
4334-
BIT(IEEE80211_STYPE_AUTH >> 4) |
4335-
BIT(IEEE80211_STYPE_DEAUTH >> 4) |
4336-
BIT(IEEE80211_STYPE_ACTION >> 4)
4337-
},
4338-
[NL80211_IFTYPE_P2P_DEVICE] = {
4339-
.tx = 0xffff,
4340-
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
4341-
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
4342-
}
4343-
};
4344-
4345-
static
4346-
struct wiphy *brcmf_setup_wiphy(struct brcmf_if *ifp, struct device *phydev)
4347-
{
4348-
struct wiphy *wiphy;
4349-
s32 err = 0;
4350-
4351-
wiphy = wiphy_new(&wl_cfg80211_ops, sizeof(struct brcmf_cfg80211_info));
4352-
if (!wiphy) {
4353-
brcmf_err("Could not allocate wiphy device\n");
4354-
return ERR_PTR(-ENOMEM);
4355-
}
4356-
set_wiphy_dev(wiphy, phydev);
4357-
wiphy->max_scan_ssids = WL_NUM_SCAN_MAX;
4358-
wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX;
4359-
wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
4360-
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
4361-
BIT(NL80211_IFTYPE_ADHOC) |
4362-
BIT(NL80211_IFTYPE_AP) |
4363-
BIT(NL80211_IFTYPE_P2P_CLIENT) |
4364-
BIT(NL80211_IFTYPE_P2P_GO) |
4365-
BIT(NL80211_IFTYPE_P2P_DEVICE);
4366-
/* need VSDB firmware feature for concurrent channels */
4367-
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN))
4368-
brcmf_iface_combos[0].num_different_channels = 2;
4369-
wiphy->iface_combinations = brcmf_iface_combos;
4370-
wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos);
4371-
wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
4372-
wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
4373-
wiphy->cipher_suites = __wl_cipher_suites;
4374-
wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites);
4375-
wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT |
4376-
WIPHY_FLAG_OFFCHAN_TX |
4377-
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
4378-
WIPHY_FLAG_SUPPORTS_TDLS;
4379-
if (!brcmf_roamoff)
4380-
wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM;
4381-
wiphy->mgmt_stypes = brcmf_txrx_stypes;
4382-
wiphy->max_remain_on_channel_duration = 5000;
4383-
brcmf_wiphy_pno_params(wiphy);
4384-
brcmf_dbg(INFO, "Registering custom regulatory\n");
4385-
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
4386-
wiphy_apply_custom_regulatory(wiphy, &brcmf_regdom);
4387-
4388-
/* vendor commands/events support */
4389-
wiphy->vendor_commands = brcmf_vendor_cmds;
4390-
wiphy->n_vendor_commands = BRCMF_VNDR_CMDS_LAST - 1;
4391-
4392-
err = wiphy_register(wiphy);
4393-
if (err < 0) {
4394-
brcmf_err("Could not register wiphy device (%d)\n", err);
4395-
wiphy_free(wiphy);
4396-
return ERR_PTR(err);
4397-
}
4398-
return wiphy;
4399-
}
4400-
44014281
struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
44024282
enum nl80211_iftype type,
44034283
bool pm_block)
@@ -4941,30 +4821,6 @@ static void init_vif_event(struct brcmf_cfg80211_vif_event *event)
49414821
mutex_init(&event->vif_event_lock);
49424822
}
49434823

4944-
static int brcmf_enable_bw40_2g(struct brcmf_if *ifp)
4945-
{
4946-
struct brcmf_fil_bwcap_le band_bwcap;
4947-
u32 val;
4948-
int err;
4949-
4950-
/* verify support for bw_cap command */
4951-
val = WLC_BAND_5G;
4952-
err = brcmf_fil_iovar_int_get(ifp, "bw_cap", &val);
4953-
4954-
if (!err) {
4955-
/* only set 2G bandwidth using bw_cap command */
4956-
band_bwcap.band = cpu_to_le32(WLC_BAND_2G);
4957-
band_bwcap.bw_cap = cpu_to_le32(WLC_BW_CAP_40MHZ);
4958-
err = brcmf_fil_iovar_data_set(ifp, "bw_cap", &band_bwcap,
4959-
sizeof(band_bwcap));
4960-
} else {
4961-
brcmf_dbg(INFO, "fallback to mimo_bw_cap\n");
4962-
val = WLC_N_BW_40ALL;
4963-
err = brcmf_fil_iovar_int_set(ifp, "mimo_bw_cap", val);
4964-
}
4965-
return err;
4966-
}
4967-
49684824
static s32
49694825
brcmf_dongle_roam(struct brcmf_if *ifp, u32 bcn_timeout)
49704826
{
@@ -5194,6 +5050,30 @@ static s32 brcmf_construct_reginfo(struct brcmf_cfg80211_info *cfg,
51945050
return err;
51955051
}
51965052

5053+
static int brcmf_enable_bw40_2g(struct brcmf_if *ifp)
5054+
{
5055+
struct brcmf_fil_bwcap_le band_bwcap;
5056+
u32 val;
5057+
int err;
5058+
5059+
/* verify support for bw_cap command */
5060+
val = WLC_BAND_5G;
5061+
err = brcmf_fil_iovar_int_get(ifp, "bw_cap", &val);
5062+
5063+
if (!err) {
5064+
/* only set 2G bandwidth using bw_cap command */
5065+
band_bwcap.band = cpu_to_le32(WLC_BAND_2G);
5066+
band_bwcap.bw_cap = cpu_to_le32(WLC_BW_CAP_40MHZ);
5067+
err = brcmf_fil_iovar_data_set(ifp, "bw_cap", &band_bwcap,
5068+
sizeof(band_bwcap));
5069+
} else {
5070+
brcmf_dbg(INFO, "fallback to mimo_bw_cap\n");
5071+
val = WLC_N_BW_40ALL;
5072+
err = brcmf_fil_iovar_int_set(ifp, "mimo_bw_cap", val);
5073+
}
5074+
return err;
5075+
}
5076+
51975077
static void brcmf_get_bwcap(struct brcmf_if *ifp, u32 bw_cap[])
51985078
{
51995079
u32 band, mimo_bwcap;
@@ -5377,6 +5257,126 @@ static s32 brcmf_update_wiphybands(struct brcmf_cfg80211_info *cfg)
53775257
return err;
53785258
}
53795259

5260+
static const struct ieee80211_iface_limit brcmf_iface_limits[] = {
5261+
{
5262+
.max = 2,
5263+
.types = BIT(NL80211_IFTYPE_STATION) |
5264+
BIT(NL80211_IFTYPE_ADHOC) |
5265+
BIT(NL80211_IFTYPE_AP)
5266+
},
5267+
{
5268+
.max = 1,
5269+
.types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
5270+
BIT(NL80211_IFTYPE_P2P_GO)
5271+
},
5272+
{
5273+
.max = 1,
5274+
.types = BIT(NL80211_IFTYPE_P2P_DEVICE)
5275+
}
5276+
};
5277+
static struct ieee80211_iface_combination brcmf_iface_combos[] = {
5278+
{
5279+
.max_interfaces = BRCMF_IFACE_MAX_CNT,
5280+
.num_different_channels = 1,
5281+
.n_limits = ARRAY_SIZE(brcmf_iface_limits),
5282+
.limits = brcmf_iface_limits
5283+
}
5284+
};
5285+
5286+
static const struct ieee80211_txrx_stypes
5287+
brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
5288+
[NL80211_IFTYPE_STATION] = {
5289+
.tx = 0xffff,
5290+
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
5291+
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
5292+
},
5293+
[NL80211_IFTYPE_P2P_CLIENT] = {
5294+
.tx = 0xffff,
5295+
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
5296+
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
5297+
},
5298+
[NL80211_IFTYPE_P2P_GO] = {
5299+
.tx = 0xffff,
5300+
.rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
5301+
BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
5302+
BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
5303+
BIT(IEEE80211_STYPE_DISASSOC >> 4) |
5304+
BIT(IEEE80211_STYPE_AUTH >> 4) |
5305+
BIT(IEEE80211_STYPE_DEAUTH >> 4) |
5306+
BIT(IEEE80211_STYPE_ACTION >> 4)
5307+
},
5308+
[NL80211_IFTYPE_P2P_DEVICE] = {
5309+
.tx = 0xffff,
5310+
.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
5311+
BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
5312+
}
5313+
};
5314+
5315+
static void brcmf_wiphy_pno_params(struct wiphy *wiphy)
5316+
{
5317+
/* scheduled scan settings */
5318+
wiphy->max_sched_scan_ssids = BRCMF_PNO_MAX_PFN_COUNT;
5319+
wiphy->max_match_sets = BRCMF_PNO_MAX_PFN_COUNT;
5320+
wiphy->max_sched_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX;
5321+
wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
5322+
}
5323+
5324+
static struct wiphy *brcmf_setup_wiphy(struct brcmf_if *ifp,
5325+
struct device *phydev)
5326+
{
5327+
struct wiphy *wiphy;
5328+
s32 err = 0;
5329+
5330+
wiphy = wiphy_new(&wl_cfg80211_ops, sizeof(struct brcmf_cfg80211_info));
5331+
if (!wiphy) {
5332+
brcmf_err("Could not allocate wiphy device\n");
5333+
return ERR_PTR(-ENOMEM);
5334+
}
5335+
set_wiphy_dev(wiphy, phydev);
5336+
wiphy->max_scan_ssids = WL_NUM_SCAN_MAX;
5337+
wiphy->max_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX;
5338+
wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
5339+
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
5340+
BIT(NL80211_IFTYPE_ADHOC) |
5341+
BIT(NL80211_IFTYPE_AP) |
5342+
BIT(NL80211_IFTYPE_P2P_CLIENT) |
5343+
BIT(NL80211_IFTYPE_P2P_GO) |
5344+
BIT(NL80211_IFTYPE_P2P_DEVICE);
5345+
/* need VSDB firmware feature for concurrent channels */
5346+
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN))
5347+
brcmf_iface_combos[0].num_different_channels = 2;
5348+
wiphy->iface_combinations = brcmf_iface_combos;
5349+
wiphy->n_iface_combinations = ARRAY_SIZE(brcmf_iface_combos);
5350+
wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
5351+
wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
5352+
wiphy->cipher_suites = __wl_cipher_suites;
5353+
wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites);
5354+
wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT |
5355+
WIPHY_FLAG_OFFCHAN_TX |
5356+
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
5357+
WIPHY_FLAG_SUPPORTS_TDLS;
5358+
if (!brcmf_roamoff)
5359+
wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM;
5360+
wiphy->mgmt_stypes = brcmf_txrx_stypes;
5361+
wiphy->max_remain_on_channel_duration = 5000;
5362+
brcmf_wiphy_pno_params(wiphy);
5363+
brcmf_dbg(INFO, "Registering custom regulatory\n");
5364+
wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
5365+
wiphy_apply_custom_regulatory(wiphy, &brcmf_regdom);
5366+
5367+
/* vendor commands/events support */
5368+
wiphy->vendor_commands = brcmf_vendor_cmds;
5369+
wiphy->n_vendor_commands = BRCMF_VNDR_CMDS_LAST - 1;
5370+
5371+
err = wiphy_register(wiphy);
5372+
if (err < 0) {
5373+
brcmf_err("Could not register wiphy device (%d)\n", err);
5374+
wiphy_free(wiphy);
5375+
return ERR_PTR(err);
5376+
}
5377+
return wiphy;
5378+
}
5379+
53805380

53815381
static s32 brcmf_dongle_probecap(struct brcmf_cfg80211_info *cfg)
53825382
{

0 commit comments

Comments
 (0)