* [PATCH V3 0/6] brcmfmac: nvram loading and code rework
@ 2015-08-20 20:06 Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 1/6] brcmfmac: correct interface combination info Arend van Spriel
` (7 more replies)
0 siblings, 8 replies; 15+ messages in thread
From: Arend van Spriel @ 2015-08-20 20:06 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend van Spriel
This series comprises of following changes:
- support NVRAM loading for bcm47xx platform.
- revise announced interface combinations and validate against it.
- new debugfs entry for msgbuf protocol layer used with PCIe devices.
- PCIe fix for handling queue overflow.
- support more firmware events (for bcm4339 firmware).
The series is intended for v4.3 kernel and applies to the master branch
of the wireless-drivers-next repository. Removed patch from this series
that reportedly has issue on OpenWrt platform.
Arend van Spriel (3):
brcmfmac: correct interface combination info
brcmfmac: make use of cfg80211_check_combinations()
brcmfmac: bump highest event number for 4339 firmware
Franky Lin (2):
brcmfmac: add debugfs entry for msgbuf statistics
brcmfmac: block the correct flowring when backup queue overflow
Hante Meuleman (1):
brcmfmac: Add support for host platform NVRAM loading.
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 195 ++++++++++++++++-----
drivers/net/wireless/brcm80211/brcmfmac/firmware.c | 39 +++--
drivers/net/wireless/brcm80211/brcmfmac/flowring.c | 10 +-
drivers/net/wireless/brcm80211/brcmfmac/fweh.h | 10 +-
drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c | 56 ++++++
5 files changed, 247 insertions(+), 63 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH V3 1/6] brcmfmac: correct interface combination info
2015-08-20 20:06 [PATCH V3 0/6] brcmfmac: nvram loading and code rework Arend van Spriel
@ 2015-08-20 20:06 ` Arend van Spriel
2015-08-25 12:33 ` [V3,1/6] " Kalle Valo
2015-08-20 20:06 ` [PATCH V3 2/6] brcmfmac: add debugfs entry for msgbuf statistics Arend van Spriel
` (6 subsequent siblings)
7 siblings, 1 reply; 15+ messages in thread
From: Arend van Spriel @ 2015-08-20 20:06 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend van Spriel
The interface combination provided by brcmfmac did not truly reflect
the combinations supported by driver and/or firmware.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Pontus Fuchs <pontusf@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 151 +++++++++++++++------
1 file changed, 112 insertions(+), 39 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
index ffe5260..17cf1bc 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
@@ -5695,63 +5695,132 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
}
};
+/**
+ * brcmf_setup_ifmodes() - determine interface modes and combinations.
+ *
+ * @wiphy: wiphy object.
+ * @ifp: interface object needed for feat module api.
+ *
+ * The interface modes and combinations are determined dynamically here
+ * based on firmware functionality.
+ *
+ * no p2p and no mbss:
+ *
+ * #STA <= 1, #AP <= 1, channels = 1, 2 total
+ *
+ * no p2p and mbss:
+ *
+ * #STA <= 1, #AP <= 1, channels = 1, 2 total
+ * #AP <= 4, matching BI, channels = 1, 4 total
+ *
+ * p2p, no mchan, and mbss:
+ *
+ * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 1, 3 total
+ * #STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total
+ * #AP <= 4, matching BI, channels = 1, 4 total
+ *
+ * p2p, mchan, and mbss:
+ *
+ * #STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 2, 3 total
+ * #STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total
+ * #AP <= 4, matching BI, channels = 1, 4 total
+ */
static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
{
struct ieee80211_iface_combination *combo = NULL;
- struct ieee80211_iface_limit *limits = NULL;
- int i = 0, max_iface_cnt;
+ struct ieee80211_iface_limit *c0_limits = NULL;
+ struct ieee80211_iface_limit *p2p_limits = NULL;
+ struct ieee80211_iface_limit *mbss_limits = NULL;
+ bool mbss, p2p;
+ int i, c, n_combos;
+
+ mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS);
+ p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P);
- combo = kzalloc(sizeof(*combo), GFP_KERNEL);
+ n_combos = 1 + !!p2p + !!mbss;
+ combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL);
if (!combo)
goto err;
- limits = kzalloc(sizeof(*limits) * 4, GFP_KERNEL);
- if (!limits)
+ c0_limits = kcalloc(p2p ? 3 : 2, sizeof(*c0_limits), GFP_KERNEL);
+ if (!c0_limits)
goto err;
+ if (p2p) {
+ p2p_limits = kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL);
+ if (!p2p_limits)
+ goto err;
+ }
+
+ if (mbss) {
+ mbss_limits = kcalloc(1, sizeof(*mbss_limits), GFP_KERNEL);
+ if (!mbss_limits)
+ goto err;
+ }
+
wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_AP);
- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN))
- combo->num_different_channels = 2;
- else
- combo->num_different_channels = 1;
-
- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) {
- limits[i].max = 1;
- limits[i++].types = BIT(NL80211_IFTYPE_STATION);
- limits[i].max = 4;
- limits[i++].types = BIT(NL80211_IFTYPE_AP);
- max_iface_cnt = 5;
- } else {
- limits[i].max = 2;
- limits[i++].types = BIT(NL80211_IFTYPE_STATION) |
- BIT(NL80211_IFTYPE_AP);
- max_iface_cnt = 2;
- }
-
- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P)) {
+ c = 0;
+ i = 0;
+ combo[c].num_different_channels = 1;
+ c0_limits[i].max = 1;
+ c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
+ if (p2p) {
+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN))
+ combo[c].num_different_channels = 2;
wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) |
BIT(NL80211_IFTYPE_P2P_GO) |
BIT(NL80211_IFTYPE_P2P_DEVICE);
- limits[i].max = 1;
- limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
- BIT(NL80211_IFTYPE_P2P_GO);
- limits[i].max = 1;
- limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE);
- max_iface_cnt += 2;
- }
- combo->max_interfaces = max_iface_cnt;
- combo->limits = limits;
- combo->n_limits = i;
-
+ c0_limits[i].max = 1;
+ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE);
+ c0_limits[i].max = 1;
+ c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
+ BIT(NL80211_IFTYPE_P2P_GO);
+ } else {
+ c0_limits[i].max = 1;
+ c0_limits[i++].types = BIT(NL80211_IFTYPE_AP);
+ }
+ combo[c].max_interfaces = i;
+ combo[c].n_limits = i;
+ combo[c].limits = c0_limits;
+
+ if (p2p) {
+ c++;
+ i = 0;
+ combo[c].num_different_channels = 1;
+ p2p_limits[i].max = 1;
+ p2p_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
+ p2p_limits[i].max = 1;
+ p2p_limits[i++].types = BIT(NL80211_IFTYPE_AP);
+ p2p_limits[i].max = 1;
+ p2p_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT);
+ p2p_limits[i].max = 1;
+ p2p_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE);
+ combo[c].max_interfaces = i;
+ combo[c].n_limits = i;
+ combo[c].limits = p2p_limits;
+ }
+
+ if (mbss) {
+ c++;
+ combo[c].beacon_int_infra_match = true;
+ combo[c].num_different_channels = 1;
+ mbss_limits[0].max = 4;
+ mbss_limits[0].types = BIT(NL80211_IFTYPE_AP);
+ combo[c].max_interfaces = 4;
+ combo[c].n_limits = 1;
+ combo[c].limits = mbss_limits;
+ }
+ wiphy->n_iface_combinations = n_combos;
wiphy->iface_combinations = combo;
- wiphy->n_iface_combinations = 1;
return 0;
err:
- kfree(limits);
+ kfree(c0_limits);
+ kfree(p2p_limits);
+ kfree(mbss_limits);
kfree(combo);
return -ENOMEM;
}
@@ -6073,11 +6142,15 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy,
static void brcmf_free_wiphy(struct wiphy *wiphy)
{
+ int i;
+
if (!wiphy)
return;
- if (wiphy->iface_combinations)
- kfree(wiphy->iface_combinations->limits);
+ if (wiphy->iface_combinations) {
+ for (i = 0; i < wiphy->n_iface_combinations; i++)
+ kfree(wiphy->iface_combinations[i].limits);
+ }
kfree(wiphy->iface_combinations);
if (wiphy->bands[IEEE80211_BAND_2GHZ]) {
kfree(wiphy->bands[IEEE80211_BAND_2GHZ]->channels);
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V3 2/6] brcmfmac: add debugfs entry for msgbuf statistics
2015-08-20 20:06 [PATCH V3 0/6] brcmfmac: nvram loading and code rework Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 1/6] brcmfmac: correct interface combination info Arend van Spriel
@ 2015-08-20 20:06 ` Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 3/6] brcmfmac: make use of cfg80211_check_combinations() Arend van Spriel
` (5 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Arend van Spriel @ 2015-08-20 20:06 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Franky Lin, Arend van Spriel
From: Franky Lin <frankyl@broadcom.com>
Expose ring buffer read/write pointers and other useful statistics
through debugfs.
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c | 56 ++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c
index 898c380..7b2136c 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/msgbuf.c
@@ -1360,6 +1360,60 @@ void brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u8 flowid)
}
}
+#ifdef DEBUG
+static int brcmf_msgbuf_stats_read(struct seq_file *seq, void *data)
+{
+ struct brcmf_bus *bus_if = dev_get_drvdata(seq->private);
+ struct brcmf_pub *drvr = bus_if->drvr;
+ struct brcmf_msgbuf *msgbuf = (struct brcmf_msgbuf *)drvr->proto->pd;
+ struct brcmf_commonring *commonring;
+ u16 i;
+ struct brcmf_flowring_ring *ring;
+ struct brcmf_flowring_hash *hash;
+
+ commonring = msgbuf->commonrings[BRCMF_H2D_MSGRING_CONTROL_SUBMIT];
+ seq_printf(seq, "h2d_ctl_submit: rp %4u, wp %4u, depth %4u\n",
+ commonring->r_ptr, commonring->w_ptr, commonring->depth);
+ commonring = msgbuf->commonrings[BRCMF_H2D_MSGRING_RXPOST_SUBMIT];
+ seq_printf(seq, "h2d_rx_submit: rp %4u, wp %4u, depth %4u\n",
+ commonring->r_ptr, commonring->w_ptr, commonring->depth);
+ commonring = msgbuf->commonrings[BRCMF_D2H_MSGRING_CONTROL_COMPLETE];
+ seq_printf(seq, "d2h_ctl_cmplt: rp %4u, wp %4u, depth %4u\n",
+ commonring->r_ptr, commonring->w_ptr, commonring->depth);
+ commonring = msgbuf->commonrings[BRCMF_D2H_MSGRING_TX_COMPLETE];
+ seq_printf(seq, "d2h_tx_cmplt: rp %4u, wp %4u, depth %4u\n",
+ commonring->r_ptr, commonring->w_ptr, commonring->depth);
+ commonring = msgbuf->commonrings[BRCMF_D2H_MSGRING_RX_COMPLETE];
+ seq_printf(seq, "d2h_rx_cmplt: rp %4u, wp %4u, depth %4u\n",
+ commonring->r_ptr, commonring->w_ptr, commonring->depth);
+
+ seq_printf(seq, "\nh2d_flowrings: depth %u\n",
+ BRCMF_H2D_TXFLOWRING_MAX_ITEM);
+ seq_puts(seq, "Active flowrings:\n");
+ hash = msgbuf->flow->hash;
+ for (i = 0; i < msgbuf->flow->nrofrings; i++) {
+ if (!msgbuf->flow->rings[i])
+ continue;
+ ring = msgbuf->flow->rings[i];
+ if (ring->status != RING_OPEN)
+ continue;
+ commonring = msgbuf->flowrings[i];
+ hash = &msgbuf->flow->hash[ring->hash_id];
+ seq_printf(seq, "id %3u: rp %4u, wp %4u, qlen %4u, blocked %u\n"
+ " ifidx %u, fifo %u, da %pM\n",
+ i, commonring->r_ptr, commonring->w_ptr,
+ skb_queue_len(&ring->skblist), ring->blocked,
+ hash->ifidx, hash->fifo, hash->mac);
+ }
+
+ return 0;
+}
+#else
+static int brcmf_msgbuf_stats_read(struct seq_file *seq, void *data)
+{
+ return 0;
+}
+#endif
int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr)
{
@@ -1460,6 +1514,8 @@ int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr)
spin_lock_init(&msgbuf->flowring_work_lock);
INIT_LIST_HEAD(&msgbuf->work_queue);
+ brcmf_debugfs_add_entry(drvr, "msgbuf_stats", brcmf_msgbuf_stats_read);
+
return 0;
fail:
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V3 3/6] brcmfmac: make use of cfg80211_check_combinations()
2015-08-20 20:06 [PATCH V3 0/6] brcmfmac: nvram loading and code rework Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 1/6] brcmfmac: correct interface combination info Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 2/6] brcmfmac: add debugfs entry for msgbuf statistics Arend van Spriel
@ 2015-08-20 20:06 ` Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 4/6] brcmfmac: block the correct flowring when backup queue overflow Arend van Spriel
` (4 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Arend van Spriel @ 2015-08-20 20:06 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend van Spriel
Use cfg80211_check_combinations() so we can bail out early when an
interface add or change results in an invalid combination.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 44 +++++++++++++++++++++-
1 file changed, 42 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
index 17cf1bc..9c7c061 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
@@ -469,6 +469,36 @@ brcmf_find_wpsie(const u8 *parse, u32 len)
return NULL;
}
+static int brcmf_vif_change_validate(struct brcmf_cfg80211_info *cfg,
+ struct brcmf_cfg80211_vif *vif,
+ enum nl80211_iftype new_type)
+{
+ int iftype_num[NUM_NL80211_IFTYPES];
+ struct brcmf_cfg80211_vif *pos;
+
+ memset(&iftype_num[0], 0, sizeof(iftype_num));
+ list_for_each_entry(pos, &cfg->vif_list, list)
+ if (pos == vif)
+ iftype_num[new_type]++;
+ else
+ iftype_num[pos->wdev.iftype]++;
+
+ return cfg80211_check_combinations(cfg->wiphy, 1, 0, iftype_num);
+}
+
+static int brcmf_vif_add_validate(struct brcmf_cfg80211_info *cfg,
+ enum nl80211_iftype new_type)
+{
+ int iftype_num[NUM_NL80211_IFTYPES];
+ struct brcmf_cfg80211_vif *pos;
+
+ memset(&iftype_num[0], 0, sizeof(iftype_num));
+ list_for_each_entry(pos, &cfg->vif_list, list)
+ iftype_num[pos->wdev.iftype]++;
+
+ iftype_num[new_type]++;
+ return cfg80211_check_combinations(cfg->wiphy, 1, 0, iftype_num);
+}
static void convert_key_from_CPU(struct brcmf_wsec_key *key,
struct brcmf_wsec_key_le *key_le)
@@ -663,8 +693,14 @@ static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
struct vif_params *params)
{
struct wireless_dev *wdev;
+ int err;
brcmf_dbg(TRACE, "enter: %s type %d\n", name, type);
+ err = brcmf_vif_add_validate(wiphy_to_cfg(wiphy), type);
+ if (err) {
+ brcmf_err("iface validation failed: err=%d\n", err);
+ return ERR_PTR(err);
+ }
switch (type) {
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_STATION:
@@ -823,8 +859,12 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
s32 ap = 0;
s32 err = 0;
- brcmf_dbg(TRACE, "Enter, ndev=%p, type=%d\n", ndev, type);
-
+ brcmf_dbg(TRACE, "Enter, idx=%d, type=%d\n", ifp->bssidx, type);
+ err = brcmf_vif_change_validate(wiphy_to_cfg(wiphy), vif, type);
+ if (err) {
+ brcmf_err("iface validation failed: err=%d\n", err);
+ return err;
+ }
switch (type) {
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_WDS:
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V3 4/6] brcmfmac: block the correct flowring when backup queue overflow
2015-08-20 20:06 [PATCH V3 0/6] brcmfmac: nvram loading and code rework Arend van Spriel
` (2 preceding siblings ...)
2015-08-20 20:06 ` [PATCH V3 3/6] brcmfmac: make use of cfg80211_check_combinations() Arend van Spriel
@ 2015-08-20 20:06 ` Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 5/6] brcmfmac: bump highest event number for 4339 firmware Arend van Spriel
` (3 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Arend van Spriel @ 2015-08-20 20:06 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Franky Lin, Arend van Spriel
From: Franky Lin <frankyl@broadcom.com>
brcmf_flowring_block blocks the last active flowring under the same
interface instead of the one provided by caller. This could lead to a
dead lock of netif stop if there are more than one flowring under the
interface and the traffic is high enough so brcmf_flowring_enqueue can
not unblock the ring right away.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmfmac/flowring.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c
index 5944063..8d1ab4a 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/flowring.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/flowring.c
@@ -194,11 +194,15 @@ static void brcmf_flowring_block(struct brcmf_flowring *flow, u8 flowid,
spin_lock_irqsave(&flow->block_lock, flags);
ring = flow->rings[flowid];
+ if (ring->blocked == blocked) {
+ spin_unlock_irqrestore(&flow->block_lock, flags);
+ return;
+ }
ifidx = brcmf_flowring_ifidx_get(flow, flowid);
currently_blocked = false;
for (i = 0; i < flow->nrofrings; i++) {
- if (flow->rings[i]) {
+ if ((flow->rings[i]) && (i != flowid)) {
ring = flow->rings[i];
if ((ring->status == RING_OPEN) &&
(brcmf_flowring_ifidx_get(flow, i) == ifidx)) {
@@ -209,8 +213,8 @@ static void brcmf_flowring_block(struct brcmf_flowring *flow, u8 flowid,
}
}
}
- ring->blocked = blocked;
- if (currently_blocked == blocked) {
+ flow->rings[flowid]->blocked = blocked;
+ if (currently_blocked) {
spin_unlock_irqrestore(&flow->block_lock, flags);
return;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V3 5/6] brcmfmac: bump highest event number for 4339 firmware
2015-08-20 20:06 [PATCH V3 0/6] brcmfmac: nvram loading and code rework Arend van Spriel
` (3 preceding siblings ...)
2015-08-20 20:06 ` [PATCH V3 4/6] brcmfmac: block the correct flowring when backup queue overflow Arend van Spriel
@ 2015-08-20 20:06 ` Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 6/6] brcmfmac: Add support for host platform NVRAM loading Arend van Spriel
` (2 subsequent siblings)
7 siblings, 0 replies; 15+ messages in thread
From: Arend van Spriel @ 2015-08-20 20:06 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Arend van Spriel
The event mask length is determined by the highest event number
that is specified in the driver. When this length is shorter than
firmware expects setting event mask will fail and device becomes
pretty useless. This issue was reported with bcm4339 firmware that
was recently released.
Reported-by: Pontus Fuchs <pontusf@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Pontus Fuchs <pontusf@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
drivers/net/wireless/brcm80211/brcmfmac/fweh.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
index cbf033f..1326898 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h
@@ -85,7 +85,6 @@ struct brcmf_event;
BRCMF_ENUM_DEF(IF, 54) \
BRCMF_ENUM_DEF(P2P_DISC_LISTEN_COMPLETE, 55) \
BRCMF_ENUM_DEF(RSSI, 56) \
- BRCMF_ENUM_DEF(PFN_SCAN_COMPLETE, 57) \
BRCMF_ENUM_DEF(EXTLOG_MSG, 58) \
BRCMF_ENUM_DEF(ACTION_FRAME, 59) \
BRCMF_ENUM_DEF(ACTION_FRAME_COMPLETE, 60) \
@@ -103,8 +102,7 @@ struct brcmf_event;
BRCMF_ENUM_DEF(FIFO_CREDIT_MAP, 74) \
BRCMF_ENUM_DEF(ACTION_FRAME_RX, 75) \
BRCMF_ENUM_DEF(TDLS_PEER_EVENT, 92) \
- BRCMF_ENUM_DEF(BCMC_CREDIT_SUPPORT, 127) \
- BRCMF_ENUM_DEF(PSTA_PRIMARY_INTF_IND, 128)
+ BRCMF_ENUM_DEF(BCMC_CREDIT_SUPPORT, 127)
#define BRCMF_ENUM_DEF(id, val) \
BRCMF_E_##id = (val),
@@ -112,7 +110,11 @@ struct brcmf_event;
/* firmware event codes sent by the dongle */
enum brcmf_fweh_event_code {
BRCMF_FWEH_EVENT_ENUM_DEFLIST
- BRCMF_E_LAST
+ /* this determines event mask length which must match
+ * minimum length check in device firmware so it is
+ * hard-coded here.
+ */
+ BRCMF_E_LAST = 139
};
#undef BRCMF_ENUM_DEF
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH V3 6/6] brcmfmac: Add support for host platform NVRAM loading.
2015-08-20 20:06 [PATCH V3 0/6] brcmfmac: nvram loading and code rework Arend van Spriel
` (4 preceding siblings ...)
2015-08-20 20:06 ` [PATCH V3 5/6] brcmfmac: bump highest event number for 4339 firmware Arend van Spriel
@ 2015-08-20 20:06 ` Arend van Spriel
2015-08-20 21:20 ` [PATCH V3 0/6] brcmfmac: nvram loading and code rework Rafał Miłecki
2015-08-25 16:09 ` Rafał Miłecki
7 siblings, 0 replies; 15+ messages in thread
From: Arend van Spriel @ 2015-08-20 20:06 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, Hante Meuleman, Arend van Spriel
From: Hante Meuleman <meuleman@broadcom.com>
Host platforms such as routers supported by OpenWRT can
support NVRAM reading directly from internal NVRAM store.
With this patch the nvram load routines will fall back to
this method when there is no nvram file and support is
available in the kernel.
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
V2:
- addressed comments from Rafał.
V3:
- remove redundant braces.
- move bcm47xx_release_contents() call.
---
drivers/net/wireless/brcm80211/brcmfmac/firmware.c | 39 +++++++++++++---------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c
index 743f16b..971920f 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c
@@ -19,6 +19,7 @@
#include <linux/device.h>
#include <linux/firmware.h>
#include <linux/module.h>
+#include <linux/bcm47xx_nvram.h>
#include "debug.h"
#include "firmware.h"
@@ -426,18 +427,32 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
struct brcmf_fw *fwctx = ctx;
u32 nvram_length = 0;
void *nvram = NULL;
+ u8 *data = NULL;
+ size_t data_len;
+ bool raw_nvram;
brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(fwctx->dev));
- if (!fw && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL))
- goto fail;
+ if (fw && fw->data) {
+ data = (u8 *)fw->data;
+ data_len = fw->size;
+ raw_nvram = false;
+ } else {
+ data = bcm47xx_nvram_get_contents(&data_len);
+ if (!data && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL))
+ goto fail;
+ raw_nvram = true;
+ }
- if (fw) {
- nvram = brcmf_fw_nvram_strip(fw->data, fw->size, &nvram_length,
+ if (data)
+ nvram = brcmf_fw_nvram_strip(data, data_len, &nvram_length,
fwctx->domain_nr, fwctx->bus_nr);
+
+ if (raw_nvram)
+ bcm47xx_nvram_release_contents(data);
+ if (fw)
release_firmware(fw);
- if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL))
- goto fail;
- }
+ if (!nvram && !(fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL))
+ goto fail;
fwctx->done(fwctx->dev, fwctx->code, nvram, nvram_length);
kfree(fwctx);
@@ -473,15 +488,9 @@ static void brcmf_fw_request_code_done(const struct firmware *fw, void *ctx)
if (!ret)
return;
- /* when nvram is optional call .done() callback here */
- if (fwctx->flags & BRCMF_FW_REQ_NV_OPTIONAL) {
- fwctx->done(fwctx->dev, fw, NULL, 0);
- kfree(fwctx);
- return;
- }
+ brcmf_fw_request_nvram_done(NULL, fwctx);
+ return;
- /* failed nvram request */
- release_firmware(fw);
fail:
brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev));
device_release_driver(fwctx->dev);
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH V3 0/6] brcmfmac: nvram loading and code rework
2015-08-20 20:06 [PATCH V3 0/6] brcmfmac: nvram loading and code rework Arend van Spriel
` (5 preceding siblings ...)
2015-08-20 20:06 ` [PATCH V3 6/6] brcmfmac: Add support for host platform NVRAM loading Arend van Spriel
@ 2015-08-20 21:20 ` Rafał Miłecki
2015-08-20 21:23 ` Arend van Spriel
2015-08-25 16:09 ` Rafał Miłecki
7 siblings, 1 reply; 15+ messages in thread
From: Rafał Miłecki @ 2015-08-20 21:20 UTC (permalink / raw)
To: Arend van Spriel; +Cc: Kalle Valo, linux-wireless
On 20 August 2015 at 22:06, Arend van Spriel <arend@broadcom.com> wrote:
> This series comprises of following changes:
> - support NVRAM loading for bcm47xx platform.
> - revise announced interface combinations and validate against it.
> - new debugfs entry for msgbuf protocol layer used with PCIe devices.
> - PCIe fix for handling queue overflow.
> - support more firmware events (for bcm4339 firmware).
>
> The series is intended for v4.3 kernel and applies to the master branch
> of the wireless-drivers-next repository. Removed patch from this series
> that reportedly has issue on OpenWrt platform.
Tested-by: Rafał Miłecki <zajec5@gmail.com>
No regression with this version, getting platform NVRAM works.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V3 0/6] brcmfmac: nvram loading and code rework
2015-08-20 21:20 ` [PATCH V3 0/6] brcmfmac: nvram loading and code rework Rafał Miłecki
@ 2015-08-20 21:23 ` Arend van Spriel
2015-08-20 21:26 ` Rafał Miłecki
2015-08-25 12:36 ` Kalle Valo
0 siblings, 2 replies; 15+ messages in thread
From: Arend van Spriel @ 2015-08-20 21:23 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: Kalle Valo, linux-wireless
On 08/20/2015 11:20 PM, Rafał Miłecki wrote:
> On 20 August 2015 at 22:06, Arend van Spriel <arend@broadcom.com> wrote:
>> This series comprises of following changes:
>> - support NVRAM loading for bcm47xx platform.
>> - revise announced interface combinations and validate against it.
>> - new debugfs entry for msgbuf protocol layer used with PCIe devices.
>> - PCIe fix for handling queue overflow.
>> - support more firmware events (for bcm4339 firmware).
>>
>> The series is intended for v4.3 kernel and applies to the master branch
>> of the wireless-drivers-next repository. Removed patch from this series
>> that reportedly has issue on OpenWrt platform.
>
> Tested-by: Rafał Miłecki <zajec5@gmail.com>
>
> No regression with this version, getting platform NVRAM works.
Thanks, Rafał
Kalle,
Will you add the "Tested-by:" or should I?
Regards,
Arend
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V3 0/6] brcmfmac: nvram loading and code rework
2015-08-20 21:23 ` Arend van Spriel
@ 2015-08-20 21:26 ` Rafał Miłecki
2015-08-25 12:36 ` Kalle Valo
1 sibling, 0 replies; 15+ messages in thread
From: Rafał Miłecki @ 2015-08-20 21:26 UTC (permalink / raw)
To: Arend van Spriel; +Cc: Kalle Valo, linux-wireless
On 20 August 2015 at 23:23, Arend van Spriel <arend@broadcom.com> wrote:
> On 08/20/2015 11:20 PM, Rafał Miłecki wrote:
>>
>> On 20 August 2015 at 22:06, Arend van Spriel <arend@broadcom.com> wrote:
>>>
>>> This series comprises of following changes:
>>> - support NVRAM loading for bcm47xx platform.
>>> - revise announced interface combinations and validate against it.
>>> - new debugfs entry for msgbuf protocol layer used with PCIe devices.
>>> - PCIe fix for handling queue overflow.
>>> - support more firmware events (for bcm4339 firmware).
>>>
>>> The series is intended for v4.3 kernel and applies to the master branch
>>> of the wireless-drivers-next repository. Removed patch from this series
>>> that reportedly has issue on OpenWrt platform.
>>
>>
>> Tested-by: Rafał Miłecki <zajec5@gmail.com>
>>
>> No regression with this version, getting platform NVRAM works.
>
>
> Thanks, Rafał
Thanks for your work! :)
> Kalle,
>
> Will you add the "Tested-by:" or should I?
If you won't, I won't mind. I know patchwork still doesn't like my name ;)
One note: this patchset should be applied after:
[PATCH] brcmfmac: check all combinations when setting wiphy's addresses
Otherwise /sys/class/ieee80211/phy0/addresses may start reporting only
2 MACs (despite BCM43602 hardware & firmware supporting 4 AP
interfaces).
--
Rafał
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [V3,1/6] brcmfmac: correct interface combination info
2015-08-20 20:06 ` [PATCH V3 1/6] brcmfmac: correct interface combination info Arend van Spriel
@ 2015-08-25 12:33 ` Kalle Valo
0 siblings, 0 replies; 15+ messages in thread
From: Kalle Valo @ 2015-08-25 12:33 UTC (permalink / raw)
To: Arend van Spriel; +Cc: linux-wireless, Arend van Spriel
> The interface combination provided by brcmfmac did not truly reflect
> the combinations supported by driver and/or firmware.
>
> Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
> Reviewed-by: Pontus Fuchs <pontusf@broadcom.com>
> Signed-off-by: Arend van Spriel <arend@broadcom.com>
Thanks, 6 patches applied to wireless-drivers-next.git:
0882dda3bcbb brcmfmac: correct interface combination info
2bb66a8183d6 brcmfmac: add debugfs entry for msgbuf statistics
39504a2d21ad brcmfmac: make use of cfg80211_check_combinations()
b02bf1932a48 brcmfmac: block the correct flowring when backup queue overflow
fc7c3ad5251c brcmfmac: bump highest event number for 4339 firmware
4e70f2144db0 brcmfmac: Add support for host platform NVRAM loading.
Kalle Valo
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V3 0/6] brcmfmac: nvram loading and code rework
2015-08-20 21:23 ` Arend van Spriel
2015-08-20 21:26 ` Rafał Miłecki
@ 2015-08-25 12:36 ` Kalle Valo
1 sibling, 0 replies; 15+ messages in thread
From: Kalle Valo @ 2015-08-25 12:36 UTC (permalink / raw)
To: Arend van Spriel; +Cc: Rafał Miłecki, linux-wireless
Arend van Spriel <arend@broadcom.com> writes:
> On 08/20/2015 11:20 PM, Rafał Miłecki wrote:
>> On 20 August 2015 at 22:06, Arend van Spriel <arend@broadcom.com> wrote:
>>> This series comprises of following changes:
>>> - support NVRAM loading for bcm47xx platform.
>>> - revise announced interface combinations and validate against it.
>>> - new debugfs entry for msgbuf protocol layer used with PCIe devices.
>>> - PCIe fix for handling queue overflow.
>>> - support more firmware events (for bcm4339 firmware).
>>>
>>> The series is intended for v4.3 kernel and applies to the master branch
>>> of the wireless-drivers-next repository. Removed patch from this series
>>> that reportedly has issue on OpenWrt platform.
>>
>> Tested-by: Rafał Miłecki <zajec5@gmail.com>
>>
>> No regression with this version, getting platform NVRAM works.
>
> Thanks, Rafał
>
> Kalle,
>
> Will you add the "Tested-by:" or should I?
To save time I normally try avoid adding those myself, but what one can
do is to reply to the patch (not to the cover letter) with the
"Tested-by" line. Patchwork should when automatically add that when I
apply the patch.
At least Acked-by works like this, I would assume it's the same with
Tested-by as well. Does anyone know?
--
Kalle Valo
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V3 0/6] brcmfmac: nvram loading and code rework
2015-08-20 20:06 [PATCH V3 0/6] brcmfmac: nvram loading and code rework Arend van Spriel
` (6 preceding siblings ...)
2015-08-20 21:20 ` [PATCH V3 0/6] brcmfmac: nvram loading and code rework Rafał Miłecki
@ 2015-08-25 16:09 ` Rafał Miłecki
2015-08-25 16:42 ` Arend van Spriel
7 siblings, 1 reply; 15+ messages in thread
From: Rafał Miłecki @ 2015-08-25 16:09 UTC (permalink / raw)
To: Arend van Spriel; +Cc: Kalle Valo, linux-wireless
On 20 August 2015 at 22:06, Arend van Spriel <arend@broadcom.com> wrote:
> This series comprises of following changes:
> - support NVRAM loading for bcm47xx platform.
> - revise announced interface combinations and validate against it.
> - new debugfs entry for msgbuf protocol layer used with PCIe devices.
> - PCIe fix for handling queue overflow.
> - support more firmware events (for bcm4339 firmware).
>
> The series is intended for v4.3 kernel and applies to the master branch
> of the wireless-drivers-next repository. Removed patch from this series
> that reportedly has issue on OpenWrt platform.
I believe that V3 also got following patch dropped:
brcmfmac: consolidate ifp lookup in driver core
https://patchwork.kernel.org/patch/6767991/
As we tracked regressing patch to be "brcmfmac: Increase nr of
supported flowrings.", I believe you can safely re-submit above (ifp
lookup) one. I tested it on top of wireless-drivers-next brcmfmac and
it works fine (no regressions).
Thanks for your work!
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V3 0/6] brcmfmac: nvram loading and code rework
2015-08-25 16:09 ` Rafał Miłecki
@ 2015-08-25 16:42 ` Arend van Spriel
2015-08-25 16:53 ` Kalle Valo
0 siblings, 1 reply; 15+ messages in thread
From: Arend van Spriel @ 2015-08-25 16:42 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: Kalle Valo, linux-wireless
On 08/25/2015 06:09 PM, Rafał Miłecki wrote:
> On 20 August 2015 at 22:06, Arend van Spriel <arend@broadcom.com> wrote:
>> This series comprises of following changes:
>> - support NVRAM loading for bcm47xx platform.
>> - revise announced interface combinations and validate against it.
>> - new debugfs entry for msgbuf protocol layer used with PCIe devices.
>> - PCIe fix for handling queue overflow.
>> - support more firmware events (for bcm4339 firmware).
>>
>> The series is intended for v4.3 kernel and applies to the master branch
>> of the wireless-drivers-next repository. Removed patch from this series
>> that reportedly has issue on OpenWrt platform.
>
> I believe that V3 also got following patch dropped:
> brcmfmac: consolidate ifp lookup in driver core
> https://patchwork.kernel.org/patch/6767991/
>
> As we tracked regressing patch to be "brcmfmac: Increase nr of
> supported flowrings.", I believe you can safely re-submit above (ifp
> lookup) one. I tested it on top of wireless-drivers-next brcmfmac and
> it works fine (no regressions).
That patch was already dropped from V2 (if my memory is right). Let's
not confuse our maintainer. I will resubmit that patch. Hopefully it
will make it in 4.3. What is the deadline, Kalle.
Regards,
Arend
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH V3 0/6] brcmfmac: nvram loading and code rework
2015-08-25 16:42 ` Arend van Spriel
@ 2015-08-25 16:53 ` Kalle Valo
0 siblings, 0 replies; 15+ messages in thread
From: Kalle Valo @ 2015-08-25 16:53 UTC (permalink / raw)
To: Arend van Spriel; +Cc: Rafał Miłecki, linux-wireless
Arend van Spriel <arend@broadcom.com> writes:
> On 08/25/2015 06:09 PM, Rafał Miłecki wrote:
>> On 20 August 2015 at 22:06, Arend van Spriel <arend@broadcom.com> wrote:
>>> This series comprises of following changes:
>>> - support NVRAM loading for bcm47xx platform.
>>> - revise announced interface combinations and validate against it.
>>> - new debugfs entry for msgbuf protocol layer used with PCIe devices.
>>> - PCIe fix for handling queue overflow.
>>> - support more firmware events (for bcm4339 firmware).
>>>
>>> The series is intended for v4.3 kernel and applies to the master branch
>>> of the wireless-drivers-next repository. Removed patch from this series
>>> that reportedly has issue on OpenWrt platform.
>>
>> I believe that V3 also got following patch dropped:
>> brcmfmac: consolidate ifp lookup in driver core
>> https://patchwork.kernel.org/patch/6767991/
>>
>> As we tracked regressing patch to be "brcmfmac: Increase nr of
>> supported flowrings.", I believe you can safely re-submit above (ifp
>> lookup) one. I tested it on top of wireless-drivers-next brcmfmac and
>> it works fine (no regressions).
>
> That patch was already dropped from V2 (if my memory is right). Let's
> not confuse our maintainer. I will resubmit that patch. Hopefully it
> will make it in 4.3. What is the deadline, Kalle.
Now :) And even when I can't promise anything...
--
Kalle Valo
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2015-08-25 16:53 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 20:06 [PATCH V3 0/6] brcmfmac: nvram loading and code rework Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 1/6] brcmfmac: correct interface combination info Arend van Spriel
2015-08-25 12:33 ` [V3,1/6] " Kalle Valo
2015-08-20 20:06 ` [PATCH V3 2/6] brcmfmac: add debugfs entry for msgbuf statistics Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 3/6] brcmfmac: make use of cfg80211_check_combinations() Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 4/6] brcmfmac: block the correct flowring when backup queue overflow Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 5/6] brcmfmac: bump highest event number for 4339 firmware Arend van Spriel
2015-08-20 20:06 ` [PATCH V3 6/6] brcmfmac: Add support for host platform NVRAM loading Arend van Spriel
2015-08-20 21:20 ` [PATCH V3 0/6] brcmfmac: nvram loading and code rework Rafał Miłecki
2015-08-20 21:23 ` Arend van Spriel
2015-08-20 21:26 ` Rafał Miłecki
2015-08-25 12:36 ` Kalle Valo
2015-08-25 16:09 ` Rafał Miłecki
2015-08-25 16:42 ` Arend van Spriel
2015-08-25 16:53 ` Kalle Valo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.