brcmfmac: new device support and cleanup
cover brcmfmac: new device support and cleanup
Here a smallish series which hopefully can make it in 4.4 release. The highlights are:
* support bcm4359 which can operate in two bands concurrently.
* disable runtime pm for USB avoiding issues.
* use generic pm callback in PCIe driver.
* support wowlan wake indication reporting.
The series is intended for v4.4 and applies to the master branch of the wireless-drivers-next repository.
Hante Meuleman (9):
brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.
brcmfmac: Simplify and fix usage of brcmf_ifname.
brcmfmac: Remove unnecessary check from start_xmit.
brcmfmac: Remove unncessary variable irq_requested.
brcmfmac: Disable runtime pm for USB.
brcmfmac: Add RSDB support.
brcmfmac: Use consistent naming for bsscfgidx.
brcmfmac: Use new methods for pcie Power Management.
brcmfmac: Add wowl wake indication report.
drivers/net/wireless/brcm80211/brcmfmac/bcdc.c | 10 +- drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 87 +++++++++++++++-- drivers/net/wireless/brcm80211/brcmfmac/chip.c | 1 + drivers/net/wireless/brcm80211/brcmfmac/core.c | 105 +++++++++------------ drivers/net/wireless/brcm80211/brcmfmac/core.h | 8 +- drivers/net/wireless/brcm80211/brcmfmac/debug.c | 2 +- drivers/net/wireless/brcm80211/brcmfmac/feature.c | 1 + drivers/net/wireless/brcm80211/brcmfmac/feature.h | 5 +- drivers/net/wireless/brcm80211/brcmfmac/fweh.c | 8 +- drivers/net/wireless/brcm80211/brcmfmac/fweh.h | 2 +- drivers/net/wireless/brcm80211/brcmfmac/fwil.c | 28 +++--- .../net/wireless/brcm80211/brcmfmac/fwil_types.h | 14 ++- drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 4 +- drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 6 +- drivers/net/wireless/brcm80211/brcmfmac/pcie.c | 104 +++++++++----------- drivers/net/wireless/brcm80211/brcmfmac/usb.c | 1 - .../net/wireless/brcm80211/include/brcm_hw_ids.h | 2 + 17 files changed, 225 insertions(+), 163 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/9 brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.
From: Hante Meuleman <[email protected]>
--- drivers/net/wireless/brcm80211/brcmfmac/chip.c | 1 + drivers/net/wireless/brcm80211/brcmfmac/pcie.c | 9 +++++++++ drivers/net/wireless/brcm80211/include/brcm_hw_ids.h | 2 ++ 3 files changed, 12 insertions(+)
drivers/net/wireless/brcm80211/brcmfmac/chip.c +1 -0
@@ -681,6 +681,7 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)case BRCM_CC_43569_CHIP_ID :case BRCM_CC_43570_CHIP_ID :case BRCM_CC_4358_CHIP_ID : +case BRCM_CC_4359_CHIP_ID :case BRCM_CC_43602_CHIP_ID :case BRCM_CC_4371_CHIP_ID :return 0x180000 ;
drivers/net/wireless/brcm80211/brcmfmac/pcie.c +9 -0
@@ -55,6 +55,8 @@ enum brcmf_pcie_state {#define BRCMF_PCIE_43570_NVRAM_NAME "brcm/brcmfmac43570-pcie.txt"#define BRCMF_PCIE_4358_FW_NAME "brcm/brcmfmac4358-pcie.bin"#define BRCMF_PCIE_4358_NVRAM_NAME "brcm/brcmfmac4358-pcie.txt" +#define BRCMF_PCIE_4359_FW_NAME "brcm/brcmfmac4359-pcie.bin" +#define BRCMF_PCIE_4359_NVRAM_NAME "brcm/brcmfmac4359-pcie.txt"#define BRCMF_PCIE_4365_FW_NAME "brcm/brcmfmac4365b-pcie.bin"#define BRCMF_PCIE_4365_NVRAM_NAME "brcm/brcmfmac4365b-pcie.txt"#define BRCMF_PCIE_4366_FW_NAME "brcm/brcmfmac4366b-pcie.bin"
@@ -210,6 +212,8 @@ MODULE_FIRMWARE(BRCMF_PCIE_43570_FW_NAME);MODULE_FIRMWARE (BRCMF_PCIE_43570_NVRAM_NAME );MODULE_FIRMWARE (BRCMF_PCIE_4358_FW_NAME );MODULE_FIRMWARE (BRCMF_PCIE_4358_NVRAM_NAME ); +MODULE_FIRMWARE (BRCMF_PCIE_4359_FW_NAME ); +MODULE_FIRMWARE (BRCMF_PCIE_4359_NVRAM_NAME );MODULE_FIRMWARE (BRCMF_PCIE_4365_FW_NAME );MODULE_FIRMWARE (BRCMF_PCIE_4365_NVRAM_NAME );MODULE_FIRMWARE (BRCMF_PCIE_4366_FW_NAME );
@@ -1517,6 +1521,10 @@ static int brcmf_pcie_get_fwnames(struct brcmf_pciedev_info *devinfo) fw_name =BRCMF_PCIE_4358_FW_NAME ; nvram_name =BRCMF_PCIE_4358_NVRAM_NAME ;break ; +case BRCM_CC_4359_CHIP_ID : + fw_name =BRCMF_PCIE_4359_FW_NAME ; + nvram_name =BRCMF_PCIE_4359_NVRAM_NAME ; +break ;case BRCM_CC_4365_CHIP_ID : fw_name =BRCMF_PCIE_4365_FW_NAME ; nvram_name =BRCMF_PCIE_4365_NVRAM_NAME ;
@@ -2058,6 +2066,7 @@ static struct pci_device_id brcmf_pcie_devid_table[] = {BRCMF_PCIE_DEVICE (BRCM_PCIE_43567_DEVICE_ID ),BRCMF_PCIE_DEVICE (BRCM_PCIE_43570_DEVICE_ID ),BRCMF_PCIE_DEVICE (BRCM_PCIE_4358_DEVICE_ID ), +BRCMF_PCIE_DEVICE (BRCM_PCIE_4359_DEVICE_ID ),BRCMF_PCIE_DEVICE (BRCM_PCIE_43602_DEVICE_ID ),BRCMF_PCIE_DEVICE (BRCM_PCIE_43602_2G_DEVICE_ID ), BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_5G_DEVICE_ID),
drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +2 -0
@@ -47,6 +47,7 @@#define BRCM_CC_43569_CHIP_ID 43569#define BRCM_CC_43570_CHIP_ID 43570#define BRCM_CC_4358_CHIP_ID 0x4358 +#define BRCM_CC_4359_CHIP_ID 0x4359#define BRCM_CC_43602_CHIP_ID 43602#define BRCM_CC_4365_CHIP_ID 0x4365#define BRCM_CC_4366_CHIP_ID 0x4366
@@ -66,6 +67,7 @@#define BRCM_PCIE_43567_DEVICE_ID 0x43d3#define BRCM_PCIE_43570_DEVICE_ID 0x43d9#define BRCM_PCIE_4358_DEVICE_ID 0x43e9 +#define BRCM_PCIE_4359_DEVICE_ID 0x43ef#define BRCM_PCIE_43602_DEVICE_ID 0x43ba#define BRCM_PCIE_43602_2G_DEVICE_ID 0x43bb#define BRCM_PCIE_43602_5G_DEVICE_ID 0x43bc
Signature · 1 line
1.9.1
Re: [1/9] brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.
Quoted 7 lines
From: Hante Meuleman <[email protected]>
Reviewed-by Arend Van Spriel <[email protected]>Reviewed-by Pieter-Paul Giesberts <[email protected]>Signed-off-by Hante Meuleman <[email protected]>Signed-off-by Arend van Spriel <[email protected]>
Thanks, 9 patches applied to wireless-drivers-next.git:
2aff030355b5 brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device. c9c0043894cf brcmfmac: Simplify and fix usage of brcmf_ifname. 31fa86cb342b brcmfmac: Remove unnecessary check from start_xmit. da402c56bc91 brcmfmac: Remove unncessary variable irq_requested. dc1a272ec440 brcmfmac: Disable runtime pm for USB. 8abffd8173a1 brcmfmac: Add RSDB support.37a869ec8593 brcmfmac: Use consistent naming for bsscfgidx. c2a43a6ba5e5 brcmfmac: Use new methods for pcie Power Management. aeb64225aa8e brcmfmac: Add wowl wake indication report.
Kalle Valo
Re: [1/9] brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.
Quoted 10 lines · Kalle Valo
Quoted 7 lines
From: Hante Meuleman <[email protected]>
Reviewed-by Arend Van Spriel <[email protected]>Reviewed-by Pieter-Paul Giesberts <[email protected]>Signed-off-by Hante Meuleman <[email protected]>Signed-off-by Arend van Spriel <[email protected]>Thanks, 9 patches applied to wireless-drivers-next.git:
Quoted 8 lines
2aff030355b5brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.c9c0043894cfbrcmfmac: Simplify and fix usage ofbrcmf_ifname.31fa86cb342bbrcmfmac: Remove unnecessary check fromstart_xmit.da402c56bc91brcmfmac: Remove unncessary variableirq_requested.dc1a272ec440brcmfmac: Disable runtime pm for USB.8abffd8173a1brcmfmac: Add RSDB support.37a869ec8593brcmfmac: Use consistent naming for bsscfgidx.c2a43a6ba5e5brcmfmac: Use new methods for pcie Power Management.
Hi Kalle,
Actually, the patch above should have been submitted to wireless-drivers as it solves a suspend/hibernate issue with 4350 device which we added in 4.4. How should I handle that? This is what I was thinking:
1. submit revert for wireless-drivers-next.
2. submit patch of c2a43a6ba5e5 for wireless-drivers.
Regards,
Arend
Quoted 4 lines
aeb64225aa8ebrcmfmac: Add wowl wake indication report.Kalle Valo
Re: [1/9] brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.
Quoted 3 lines · Arend van Spriel
Actually, the patch above should have been submitted to wireless-drivers as it solves a suspend/hibernate issue with 4350 device which we added in 4.4.
Just to avoid any confusion you are meaning this commit:
c2a43a6ba5e5 brcmfmac: Use new methods for pcie Power Management.
Quoted 4 lines
How should I handle that? This is what I was thinking:
1. submit revert for wireless-drivers-next.
2. submit patch ofc2a43a6ba5e5for wireless-drivers.
That's just messy and would prefer to avoid that. I think the best would be that you send the patch to 4.4-stable queue once the commit goes to Linus' tree during the next merge window. That way you get the fix to first 4.4.x stable releases. But not sure if it's eligible for a stable fix.
BTW, I recommend sending patches to -rc release separately from the rest and marking them with intended the release number like "[PATCH 4.4]". That way it's clear for me to which tree you would like me to apply the patch.
Signature · 1 line
Kalle Valo
Re: [1/9] brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.
Quoted 21 lines · Kalle Valo
Quoted 3 lines · Arend van Spriel
Actually, the patch above should have been submitted to wireless-drivers as it solves a suspend/hibernate issue with 4350 device which we added in 4.4.
Just to avoid any confusion you are meaning this commit:
c2a43a6ba5e5brcmfmac: Use new methods for pcie Power Management.Quoted 4 lines
How should I handle that? This is what I was thinking:
1. submit revert for wireless-drivers-next.
2. submit patch ofc2a43a6ba5e5for wireless-drivers.That's just messy and would prefer to avoid that. I think the best would be that you send the patch to 4.4-stable queue once the commit goes to Linus' tree during the next merge window. That way you get the fix to first 4.4.x stable releases. But not sure if it's eligible for a stable fix.
Quoted 4 lines
BTW, I recommend sending patches to -rc release separately from the rest and marking them with intended the release number like "[PATCH 4.4]". That way it's clear for me to which tree you would like me to apply the patch.
We do that but not very often so probably did not happen in your maintainer period (yet).
Regards,
Arend
PATCH 2/9 brcmfmac: Simplify and fix usage of brcmf_ifname.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
brcmf_ifname is a debug function to return a name related to an ifp, but is using a rather complex implementation. It was also used wrongly from bcdc as it did not use the bsscfgidx as it was supposed to, but bssidx. This patch fixes that bug and simplifies brcmf_ifname.
--- drivers/net/wireless/brcm80211/brcmfmac/bcdc.c | 10 ++++++---- drivers/net/wireless/brcm80211/brcmfmac/core.c | 19 ++++++------------- drivers/net/wireless/brcm80211/brcmfmac/core.h | 2 +- 3 files changed, 13 insertions(+), 18 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/bcdc.c +6 -4
@@ -187,7 +187,8 @@ retry: goto retry;if (id != bcdc->reqid) {brcmf_err ("%s: unexpected request id %d (expected %d)\n" , -brcmf_ifname (drvr, ifidx), id, bcdc->reqid); +brcmf_ifname (brcmf_get_ifp (drvr, ifidx)), id, + bcdc->reqid); ret = -EINVAL ; goto done; }
@@ -234,7 +235,8 @@ brcmf_proto_bcdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,if (id != bcdc->reqid) {brcmf_err ("%s: unexpected request id %d (expected %d)\n" , -brcmf_ifname (drvr, ifidx), id, bcdc->reqid); +brcmf_ifname (brcmf_get_ifp (drvr, ifidx)), id, + bcdc->reqid); ret = -EINVAL ; goto done; }
@@ -298,13 +300,13 @@ brcmf_proto_bcdc_hdrpull(struct brcmf_pub *drvr, bool do_fws,if (((h->flags &BCDC_FLAG_VER_MASK ) >>BCDC_FLAG_VER_SHIFT ) !=BCDC_PROTO_VER ) {brcmf_err ("%s: non-BCDC packet received, flags 0x%x\n" , -brcmf_ifname (drvr, tmp_if->ifidx), h->flags); +brcmf_ifname (tmp_if), h->flags);return -EBADE ; }if (h->flags &BCDC_FLAG_SUM_GOOD ) {brcmf_dbg (BCDC ,"%s: BDC rcv, good checksum, flags 0x%x\n" , -brcmf_ifname (drvr, tmp_if->ifidx), h->flags); +brcmf_ifname (tmp_if), h->flags); pktbuf->ip_summed =CHECKSUM_UNNECESSARY ; }
drivers/net/wireless/brcm80211/brcmfmac/core.c +6 -13
@@ -66,20 +66,13 @@ static int brcmf_p2p_enable;module_param_named (p2pon, brcmf_p2p_enable, int,0 );MODULE_PARM_DESC (p2pon,"enable legacy p2p management functionality" ); -char *brcmf_ifname (struct brcmf_pub *drvr,int ifidx) +char *brcmf_ifname (struct brcmf_if *ifp) { -if (ifidx <0 || ifidx >=BRCMF_MAX_IFS ) { -brcmf_err ("ifidx %d out of range\n" , ifidx); -return "<if_bad>" ; - } - -if (drvr->iflist[ifidx] ==NULL ) { -brcmf_err ("null i/f %d\n" , ifidx); +if (!ifp)return "<if_null>" ; - } -if (drvr->iflist[ifidx]->ndev) -return drvr->iflist[ifidx]->ndev->name; +if (ifp->ndev) +return ifp->ndev->name;return "<if_none>" ; }
@@ -237,14 +230,14 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb,struct sk_buff *skb2;brcmf_dbg (INFO ,"%s: insufficient headroom\n" , -brcmf_ifname (drvr, ifp->bssidx)); +brcmf_ifname (ifp)); drvr->bus_if->tx_realloc++; skb2 =skb_realloc_headroom (skb, drvr->hdrlen);dev_kfree_skb (skb); skb = skb2;if (skb ==NULL ) {brcmf_err ("%s: skb_realloc_headroom failed\n" , -brcmf_ifname (drvr, ifp->bssidx)); +brcmf_ifname (ifp)); ret = -ENOMEM ; goto done; }
drivers/net/wireless/brcm80211/brcmfmac/core.h +1 -1
@@ -205,7 +205,7 @@ struct brcmf_skb_reorder_data {int brcmf_netdev_wait_pend8021x (struct brcmf_if *ifp);/* Return pointer to interface name */ -char *brcmf_ifname (struct brcmf_pub *drvr,int idx); +char *brcmf_ifname (struct brcmf_if *ifp);struct brcmf_if *brcmf_get_ifp (struct brcmf_pub *drvr,int ifidx);int brcmf_net_attach (struct brcmf_if *ifp,bool rtnl_locked); struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
Signature · 1 line
1.9.1
PATCH 3/9 brcmfmac: Remove unnecessary check from start_xmit.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
The brcmf_netdev_start_xmit checks if the ndev is still valid by checking if it still exists in database. This check is not needed and therefor removed.
--- drivers/net/wireless/brcm80211/brcmfmac/core.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/core.c +0 -8
@@ -217,14 +217,6 @@ static netdev_tx_t brcmf_netdev_start_xmit(struct sk_buff *skb, goto done; } -if (!drvr->iflist[ifp->bssidx]) { -brcmf_err ("bad ifidx %d\n" , ifp->bssidx); -netif_stop_queue (ndev); -dev_kfree_skb (skb); - ret = -ENODEV ; - goto done; - } -/* Make sure there's enough room for any header */ if (skb_headroom (skb) < drvr->hdrlen) {struct sk_buff *skb2;
Signature · 1 line
1.9.1
PATCH 4/9 brcmfmac: Remove unncessary variable irq_requested.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
The variable irq_requested is unneeded as the functionality it is providing, is also provided by the variable irq_allocated.
--- drivers/net/wireless/brcm80211/brcmfmac/pcie.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/pcie.c +0 -6
@@ -257,7 +257,6 @@ struct brcmf_pcie_core_info {struct brcmf_pciedev_info {enum brcmf_pcie_state state;bool in_irq; -bool irq_requested;struct pci_dev *pdev;char fw_name[BRCMF_FW_PATH_LEN +BRCMF_FW_NAME_LEN ];char nvram_name[BRCMF_FW_PATH_LEN +BRCMF_FW_NAME_LEN ];
@@ -889,7 +888,6 @@ static int brcmf_pcie_request_irq(struct brcmf_pciedev_info *devinfo)brcmf_dbg (PCIE ,"Enter\n" );/* is it a v1 or v2 implementation */ - devinfo->irq_requested = false;pci_enable_msi (pdev);if (devinfo->generic_corerev ==BRCMF_PCIE_GENREV1 ) { if (request_threaded_irq(pdev->irq,
@@ -912,7 +910,6 @@ static int brcmf_pcie_request_irq(struct brcmf_pciedev_info *devinfo)return -EIO ; } } - devinfo->irq_requested = true; devinfo->irq_allocated = true;return 0 ; }
@@ -930,9 +927,6 @@ static void brcmf_pcie_release_irq(struct brcmf_pciedev_info *devinfo) pdev = devinfo->pdev;brcmf_pcie_intr_disable (devinfo); -if (!devinfo->irq_requested) -return ; - devinfo->irq_requested = false;free_irq (pdev->irq, devinfo);pci_disable_msi (pdev);
Signature · 1 line
1.9.1
PATCH 5/9 brcmfmac: Disable runtime pm for USB.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
Currently runtime pm is enabled for USB, but it is not properly supported by driver. This patch disables the runtime PM support completely for USB, as it currently can result in problems on some systems.
--- drivers/net/wireless/brcm80211/brcmfmac/usb.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/brcm80211/brcmfmac/usb.c +0 -1
@@ -1504,7 +1504,6 @@ static struct usb_driver brcmf_usbdrvr = { .suspend = brcmf_usb_suspend, .resume = brcmf_usb_resume, .reset_resume = brcmf_usb_reset_resume, - .supports_autosuspend = 1, .disable_hub_initiated_lpm = 1, };
Signature · 1 line
1.9.1
PATCH 6/9 brcmfmac: Add RSDB support.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
RSDB works almost autonomously in firmware except for AP config. When device supports RSDB then the interface should not be brought down when configuring it, otherwise the link (if configured) on the other interface will be lost.
--- drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 4 +++- drivers/net/wireless/brcm80211/brcmfmac/feature.c | 1 + drivers/net/wireless/brcm80211/brcmfmac/feature.h | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +3 -1
@@ -4183,7 +4183,9 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, } } -if (dev_role ==NL80211_IFTYPE_AP ) { +if ((dev_role ==NL80211_IFTYPE_AP ) && + ((ifp->ifidx ==0 ) || + !brcmf_feat_is_enabled (ifp,BRCMF_FEAT_RSDB ))) { err =brcmf_fil_cmd_int_set (ifp,BRCMF_C_DOWN ,1 );if (err <0 ) {brcmf_err ("BRCMF_C_DOWN error %d\n" , err);
drivers/net/wireless/brcm80211/brcmfmac/feature.c +1 -0
@@ -137,6 +137,7 @@ void brcmf_feat_attach(struct brcmf_pub *drvr)if (drvr->bus_if->chip !=BRCM_CC_43362_CHIP_ID )brcmf_feat_iovar_int_set (ifp,BRCMF_FEAT_MBSS ,"mbss" ,0 );brcmf_feat_iovar_int_get (ifp,BRCMF_FEAT_P2P ,"p2p" ); +brcmf_feat_iovar_int_get (ifp,BRCMF_FEAT_RSDB ,"rsdb_mode" );if (brcmf_feature_disable) { brcmf_dbg(INFO, "Features: 0x%02x, disable: 0x%02x\n",
drivers/net/wireless/brcm80211/brcmfmac/feature.h +4 -1
@@ -24,13 +24,16 @@* PNO: preferred network offload. * WOWL: Wake-On-WLAN. * P2P: peer-to-peer +* RSDB: Real Simultaneous Dual Band */ #define BRCMF_FEAT_LIST \ BRCMF_FEAT_DEF(MBSS) \ BRCMF_FEAT_DEF(MCHAN) \ BRCMF_FEAT_DEF(PNO) \ BRCMF_FEAT_DEF(WOWL) \ - BRCMF_FEAT_DEF(P2P) + BRCMF_FEAT_DEF(P2P) \ + BRCMF_FEAT_DEF(RSDB) +/* * Quirks: *
Signature · 1 line
1.9.1
Re: [PATCH 6/9] brcmfmac: Add RSDB support.
Quoted 11 lines · Arend van Spriel
From: Hante Meuleman <[email protected]>
RSDB works almost autonomously in firmware except for AP config. When device supports RSDB then the interface should not be brought down when configuring it, otherwise the link (if configured) on the other interface will be lost.
Reviewed-by Arend Van Spriel <[email protected]>Reviewed-by Pieter-Paul Giesberts <[email protected]>Signed-off-by Hante Meuleman <[email protected]>Signed-off-by Arend van Spriel <[email protected]>
I have never heard of acronym RSDB before and after some googling I think it might mean Real Simultaneous Dual Band. But please try to avoid using acronyms and clearly spell it out in the commit log what the feature is about.
If you send me suggestions what to add I can edit the commit log before I apply this patch.
Signature · 1 line
Kalle Valo
Re: [PATCH 6/9] brcmfmac: Add RSDB support.
Quoted 14 lines · Kalle Valo
Quoted 11 lines · Arend van Spriel
From: Hante Meuleman <[email protected]>
RSDB works almost autonomously in firmware except for AP config. When device supports RSDB then the interface should not be brought down when configuring it, otherwise the link (if configured) on the other interface will be lost.
Reviewed-by Arend Van Spriel <[email protected]>Reviewed-by Pieter-Paul Giesberts <[email protected]>Signed-off-by Hante Meuleman <[email protected]>Signed-off-by Arend van Spriel <[email protected]>
Quoted 4 lines
I have never heard of acronym RSDB before and after some googling I think it might mean Real Simultaneous Dual Band. But please try to avoid using acronyms and clearly spell it out in the commit log what the feature is about.
Google is correct and the acronym is cooked up by Broadcom ;-) In the cover letter I mentioned:
* support bcm4359 which can operate in two bands concurrently.
which is a device with two 802.11 cores and hence supports RSDB.
Quoted 2 lines
If you send me suggestions what to add I can edit the commit log before I apply this patch.
If needed I can resubmit the patch. This would be the proposed commit log:
Broadcom devices with a single 802.11 core can work on two band
concurrently using VSDB feature, ie. Virtual Simultaneous Dual-Band.
For devices that are fitted with two 802.11 cores and RF paths the
driver should support a firmware feature called RSDB, which stands
for Real Simultaneous Dual-Band. RSDB works almost autonomously in firmware except for AP config. When the device supports RSDB then the interface should not be brought down when configuring it,
otherwise the link (if configured) on the other interface will be
lost.
Hope this helps and let me know if other actions are required from us.
Regards,
Arend
Re: [PATCH 6/9] brcmfmac: Add RSDB support.
Quoted 20 lines · Arend van Spriel
Quoted 14 lines · Kalle Valo
Quoted 11 lines · Arend van Spriel
From: Hante Meuleman <[email protected]>
RSDB works almost autonomously in firmware except for AP config. When device supports RSDB then the interface should not be brought down when configuring it, otherwise the link (if configured) on the other interface will be lost.
Reviewed-by Arend Van Spriel <[email protected]>Reviewed-by Pieter-Paul Giesberts <[email protected]>Signed-off-by Hante Meuleman <[email protected]>Signed-off-by Arend van Spriel <[email protected]>Quoted 4 lines
I have never heard of acronym RSDB before and after some googling I think it might mean Real Simultaneous Dual Band. But please try to avoid using acronyms and clearly spell it out in the commit log what the feature is about.
Quoted 6 lines
Google is correct and the acronym is cooked up by Broadcom ;-) In the cover letter I mentioned:
* support bcm4359 which can operate in two bands concurrently.
which is a device with two 802.11 cores and hence supports RSDB.
Yeah, but the problem is that the cover letter contents are not stored to git. Johannes once suggested that maybe I should do the same as Dave does, he adds an extra merge with the cover letter (see below). Hmm..
commit e18f6ac30d31433d8cd9ccf693d3cdd5d2e66ef9
Merge: e407f39afdc0 c02b05011fad
Author: David S. Miller <[email protected]>
Date: Tue Oct 27 20:27:45 2015 -0700
Merge branch 'mlx4-fixes'
Or Gerlitz says:
====================
Mellanox mlx4 driver fixes for 4.3-rc7
Jack's fix is for a regression introduced in 4.3-rc1
Carol's fix addresses an issue which exists for while and turns to beat us hard on PPC, please queue for -stable.
====================
Quoted 15 lines
Quoted 2 lines
If you send me suggestions what to add I can edit the commit log before I apply this patch.
If needed I can resubmit the patch. This would be the proposed commit log:
Broadcom devices with a single 802.11 core can work on two band concurrently using VSDB feature, ie. Virtual Simultaneous Dual-Band. For devices that are fitted with two 802.11 cores and RF paths the driver should support a firmware feature called RSDB, which stands for Real Simultaneous Dual-Band. RSDB works almost autonomously in firmware except for AP config. When the device supports RSDB then the interface should not be brought down when configuring it, otherwise the link (if configured) on the other interface will be lost.
Quoted 1 line
Hope this helps and let me know if other actions are required from us.
Thanks, this is perfect. I'll update the commit log once I open wireless-drivers-next and apply this patch.
Signature · 1 line
Kalle Valo
PATCH 7/9 brcmfmac: Use consistent naming for bsscfgidx.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
The variable bsscfgidx is used in different places with different names, e.g. bsscfg, bssidx, bsscfg_idx. This patch cleans this up by using bsscfgidx everywhere.
--- drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 16 +++-- drivers/net/wireless/brcm80211/brcmfmac/core.c | 78 +++++++++++----------- drivers/net/wireless/brcm80211/brcmfmac/core.h | 6 +- drivers/net/wireless/brcm80211/brcmfmac/debug.c | 2 +- drivers/net/wireless/brcm80211/brcmfmac/fweh.c | 8 +-- drivers/net/wireless/brcm80211/brcmfmac/fweh.h | 2 +- drivers/net/wireless/brcm80211/brcmfmac/fwil.c | 28 ++++---- .../net/wireless/brcm80211/brcmfmac/fwil_types.h | 2 +- drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | 4 +- drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 6 +- 10 files changed, 78 insertions(+), 74 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +9 -7
@@ -776,7 +776,8 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,s32 ap =0 ;s32 err =0 ; -brcmf_dbg (TRACE ,"Enter, idx=%d, type=%d\n" , ifp->bssidx, type); +brcmf_dbg (TRACE ,"Enter, bsscfgidx=%d, type=%d\n" , ifp->bsscfgidx, + type);/* WAR: There are a number of p2p interface related problems which * need to be handled initially (before doing the validate).
@@ -2921,7 +2922,7 @@ brcmf_cfg80211_escan_handler(struct brcmf_if *ifp, status = e->status;if (!test_bit (BRCMF_SCAN_STATUS_BUSY , &cfg->scan_status)) { -brcmf_err ("scan not ready, bssidx=%d\n" , ifp->bssidx); +brcmf_err ("scan not ready, bsscfgidx=%d\n" , ifp->bsscfgidx);return -EPERM ; }
@@ -3877,7 +3878,8 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag, ifp = vif->ifp; saved_ie = &vif->saved_ie; -brcmf_dbg (TRACE ,"bssidx %d, pktflag : 0x%02X\n" , ifp->bssidx, pktflag); +brcmf_dbg (TRACE ,"bsscfgidx %d, pktflag : 0x%02X\n" , ifp->bsscfgidx, + pktflag); iovar_ie_buf =kzalloc (WL_EXTRA_BUF_MAX ,GFP_KERNEL );if (!iovar_ie_buf)return -ENOMEM ;
@@ -4241,7 +4243,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev,brcmf_err ("setting ssid failed %d\n" , err); goto exit; } - bss_enable.bsscfg_idx =cpu_to_le32 (ifp->bssidx); + bss_enable.bsscfgidx =cpu_to_le32 (ifp->bsscfgidx); bss_enable.enable =cpu_to_le32 (1 ); err =brcmf_fil_iovar_data_set (ifp,"bss" , &bss_enable,sizeof (bss_enable));
@@ -4308,7 +4310,7 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)if (err <0 )brcmf_err ("BRCMF_C_UP error %d\n" , err); }else { - bss_enable.bsscfg_idx =cpu_to_le32 (ifp->bssidx); + bss_enable.bsscfgidx =cpu_to_le32 (ifp->bsscfgidx); bss_enable.enable =cpu_to_le32 (0 ); err =brcmf_fil_iovar_data_set (ifp,"bss" , &bss_enable,sizeof (bss_enable));
@@ -5094,9 +5096,9 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;struct brcmf_cfg80211_vif *vif; -brcmf_dbg (TRACE ,"Enter: action %u flags %u ifidx %u bsscfg %u\n" , +brcmf_dbg (TRACE ,"Enter: action %u flags %u ifidx %u bsscfgidx %u\n" , ifevent->action, ifevent->flags, ifevent->ifidx, - ifevent->bssidx); + ifevent->bsscfgidx);mutex_lock (&event->vif_event_lock); event->action = ifevent->action;
drivers/net/wireless/brcm80211/brcmfmac/core.c +40 -38
220 lines not on this page · raw message
drivers/net/wireless/brcm80211/brcmfmac/core.h +3 -3
@@ -174,7 +174,7 @@ enum brcmf_netif_stop_reason {* @multicast_work: worker object for multicast provisioning. * @fws_desc: interface specific firmware-signalling descriptor. * @ifidx: interface index in device firmware. -* @bssidx: index of bss associated with this interface. +* @bsscfgidx: index of bss associated with this interface. * @mac_addr: assigned mac address. * @netif_stop: bitmap indicates reason why netif queues are stopped. * @netif_stop_lock: spinlock for update netif_stop from multiple sources.
@@ -190,7 +190,7 @@ struct brcmf_if {struct work_struct multicast_work;struct brcmf_fws_mac_descriptor *fws_desc;int ifidx; -s32 bssidx; +s32 bsscfgidx;u8 mac_addr[ETH_ALEN ];u8 netif_stop;spinlock_t netif_stop_lock;
@@ -208,7 +208,7 @@ int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp);char *brcmf_ifname (struct brcmf_if *ifp);struct brcmf_if *brcmf_get_ifp (struct brcmf_pub *drvr,int ifidx);int brcmf_net_attach (struct brcmf_if *ifp,bool rtnl_locked); -struct brcmf_if *brcmf_add_if (struct brcmf_pub *drvr,s32 bssidx,s32 ifidx, +struct brcmf_if *brcmf_add_if (struct brcmf_pub *drvr,s32 bsscfgidx,s32 ifidx,bool is_p2pdev,char *name,u8 *mac_addr);void brcmf_remove_interface (struct brcmf_if *ifp);int brcmf_get_next_free_bsscfgidx (struct brcmf_pub *drvr);
drivers/net/wireless/brcm80211/brcmfmac/debug.c +1 -1
@@ -49,7 +49,7 @@ static int brcmf_debug_psm_watchdog_notify(struct brcmf_if *ifp,const struct brcmf_event_msg *evtmsg, void *data) { - brcmf_dbg(TRACE, "enter: idx=%d\n", ifp->bssidx); + brcmf_dbg(TRACE, "enter: bsscfgidx=%d\n", ifp->bsscfgidx);return brcmf_debug_create_memdump (ifp->drvr->bus_if, data, evtmsg->datalen);
drivers/net/wireless/brcm80211/brcmfmac/fweh.c +4 -4
@@ -182,8 +182,8 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,bool is_p2pdev;int err =0 ; -brcmf_dbg (EVENT ,"action: %u idx: %u bsscfg: %u flags: %u role: %u\n" , - ifevent->action, ifevent->ifidx, ifevent->bssidx, +brcmf_dbg (EVENT ,"action: %u ifidx: %u bsscfgidx: %u flags: %u role: %u\n" , + ifevent->action, ifevent->ifidx, ifevent->bsscfgidx, ifevent->flags, ifevent->role);/* The P2P Device interface event must not be ignored contrary to what
@@ -204,12 +204,12 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,return ; } - ifp = drvr->iflist[ifevent->bssidx]; + ifp = drvr->iflist[ifevent->bsscfgidx];if (ifevent->action ==BRCMF_E_IF_ADD ) {brcmf_dbg (EVENT ,"adding %s (%pM)\n" , emsg->ifname, emsg->addr); - ifp =brcmf_add_if (drvr, ifevent->bssidx, ifevent->ifidx, + ifp =brcmf_add_if (drvr, ifevent->bsscfgidx, ifevent->ifidx, is_p2pdev, emsg->ifname, emsg->addr);if (IS_ERR (ifp))return ;
drivers/net/wireless/brcm80211/brcmfmac/fweh.h +1 -1
@@ -219,7 +219,7 @@ struct brcmf_if_event {u8 ifidx;u8 action;u8 flags; -u8 bssidx; +u8 bsscfgidx;u8 role; };
drivers/net/wireless/brcm80211/brcmfmac/fwil.c +14 -14
@@ -293,22 +293,22 @@ brcmf_fil_iovar_int_get(struct brcmf_if *ifp, char *name, u32 *data) }static u32 -brcmf_create_bsscfg (s32 bssidx,char *name,char *data,u32 datalen,char *buf, -u32 buflen) +brcmf_create_bsscfg (s32 bsscfgidx,char *name,char *data,u32 datalen, +char *buf,u32 buflen) {const s8 *prefix ="bsscfg:" ;s8 *p;u32 prefixlen;u32 namelen;u32 iolen; -__le32 bssidx_le; +__le32 bsscfgidx_le; -if (bssidx ==0 ) +if (bsscfgidx ==0 )return brcmf_create_iovar (name, data, datalen, buf, buflen); prefixlen =strlen (prefix); namelen =strlen (name) +1 ;/* lengh of iovar name + null */ - iolen = prefixlen + namelen +sizeof (bssidx_le) + datalen; + iolen = prefixlen + namelen +sizeof (bsscfgidx_le) + datalen;if (buflen < iolen) {brcmf_err ("buffer is too short\n" );
@@ -326,9 +326,9 @@ brcmf_create_bsscfg(s32 bssidx, char *name, char *data, u32 datalen, char *buf, p += namelen;/* bss config index as first data */ - bssidx_le =cpu_to_le32 (bssidx); -memcpy (p, &bssidx_le,sizeof (bssidx_le)); - p +=sizeof (bssidx_le); + bsscfgidx_le =cpu_to_le32 (bsscfgidx); +memcpy (p, &bsscfgidx_le,sizeof (bsscfgidx_le)); + p +=sizeof (bsscfgidx_le);/* parameter buffer follows */ if (datalen)
@@ -347,12 +347,12 @@ brcmf_fil_bsscfg_data_set(struct brcmf_if *ifp, char *name,mutex_lock (&drvr->proto_block); -brcmf_dbg (FIL ,"ifidx=%d, bssidx=%d, name=%s, len=%d\n" , ifp->ifidx, - ifp->bssidx, name, len); +brcmf_dbg (FIL ,"ifidx=%d, bsscfgidx=%d, name=%s, len=%d\n" , ifp->ifidx, + ifp->bsscfgidx, name, len);brcmf_dbg_hex_dump (BRCMF_FIL_ON (), data,min_t (uint, len,MAX_HEX_DUMP_LEN ),"data\n" ); - buflen =brcmf_create_bsscfg (ifp->bssidx, name, data, len, + buflen =brcmf_create_bsscfg (ifp->bsscfgidx, name, data, len, drvr->proto_buf,sizeof (drvr->proto_buf));if (buflen) { err = brcmf_fil_cmd_data(ifp, BRCMF_C_SET_VAR, drvr->proto_buf,
@@ -376,7 +376,7 @@ brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name,mutex_lock (&drvr->proto_block); - buflen =brcmf_create_bsscfg (ifp->bssidx, name, data, len, + buflen =brcmf_create_bsscfg (ifp->bsscfgidx, name, data, len, drvr->proto_buf,sizeof (drvr->proto_buf));if (buflen) { err = brcmf_fil_cmd_data(ifp, BRCMF_C_GET_VAR, drvr->proto_buf,
@@ -387,8 +387,8 @@ brcmf_fil_bsscfg_data_get(struct brcmf_if *ifp, char *name, err = -EPERM ;brcmf_err ("Creating bsscfg failed\n" ); } -brcmf_dbg (FIL ,"ifidx=%d, bssidx=%d, name=%s, len=%d\n" , ifp->ifidx, - ifp->bssidx, name, len); +brcmf_dbg (FIL ,"ifidx=%d, bsscfgidx=%d, name=%s, len=%d\n" , ifp->ifidx, + ifp->bsscfgidx, name, len);brcmf_dbg_hex_dump (BRCMF_FIL_ON (), data,min_t (uint, len,MAX_HEX_DUMP_LEN ),"data\n" );
drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +1 -1
@@ -170,7 +170,7 @@ struct brcmf_fil_af_params_le { };struct brcmf_fil_bss_enable_le { -__le32 bsscfg_idx; +__le32 bsscfgidx;__le32 enable; };
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +2 -2
@@ -719,7 +719,7 @@ static void brcmf_fws_macdesc_init(struct brcmf_fws_mac_descriptor *desc, desc->state =BRCMF_FWS_STATE_OPEN ; desc->requested_credit =0 ; desc->requested_packet =0 ; -/* depending on use may need ifp->bssidx instead */ +/* depending on use may need ifp->bsscfgidx instead */ desc->interface_id = ifidx; desc->ac_bitmap =0xff ;/* update this when handling APSD */ if (addr)
@@ -1938,7 +1938,7 @@ void brcmf_fws_reset_interface(struct brcmf_if *ifp) {struct brcmf_fws_mac_descriptor *entry = ifp->fws_desc; -brcmf_dbg (TRACE ,"enter: idx=%d\n" , ifp->bssidx); +brcmf_dbg (TRACE ,"enter: bsscfgidx=%d\n" , ifp->bsscfgidx);if (!entry)return ;
drivers/net/wireless/brcm80211/brcmfmac/p2p.c +3 -3
@@ -2067,7 +2067,7 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p,struct brcmf_if *p2p_ifp;struct brcmf_if *pri_ifp;int err; -u32 bssidx; +u32 bsscfgidx;if (p2p->bss_idx[P2PAPI_BSSCFG_DEVICE ].vif)return ERR_PTR (-ENOSPC );
@@ -2113,13 +2113,13 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p,memcpy (&p2p_vif->wdev.address, p2p->dev_addr,sizeof (p2p->dev_addr));/* verify bsscfg index for P2P discovery */ - err =brcmf_fil_iovar_int_get (pri_ifp,"p2p_dev" , &bssidx); + err =brcmf_fil_iovar_int_get (pri_ifp,"p2p_dev" , &bsscfgidx);if (err <0 ) {brcmf_err ("retrieving discover bsscfg index failed\n" ); goto fail; } -WARN_ON (p2p_ifp->bssidx != bssidx); +WARN_ON (p2p_ifp->bsscfgidx != bsscfgidx);init_completion (&p2p->send_af_done);INIT_WORK (&p2p->afx_hdl.afx_work, brcmf_p2p_afx_handler);
Signature · 1 line
1.9.1
PATCH 8/9 brcmfmac: Use new methods for pcie Power Management.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
Currently the legacy methods suspend and resume are used for pcie devices. This is not the preferable method and is also causing issues with some setups when doing hibernate. Changing this to use the new PM methods.
--- drivers/net/wireless/brcm80211/brcmfmac/pcie.c | 89 +++++++++++--------------- 1 file changed, 37 insertions(+), 52 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/pcie.c +37 -52
@@ -1388,10 +1388,6 @@ static void brcmf_pcie_wowl_config(struct device *dev, bool enabled)brcmf_dbg (PCIE ,"Configuring WOWL, enabled=%d\n" , enabled); devinfo->wowl_enabled = enabled; -if (enabled) -device_set_wakeup_enable (&devinfo->pdev->dev, true); -else -device_set_wakeup_enable (&devinfo->pdev->dev, false); }
@@ -1961,15 +1957,14 @@ brcmf_pcie_remove(struct pci_dev *pdev)#ifdef CONFIG_PM -static int brcmf_pcie_suspend (struct pci_dev *pdev,pm_message_t state) +static int brcmf_pcie_pm_enter_D3 (struct device *dev) {struct brcmf_pciedev_info *devinfo;struct brcmf_bus *bus; -int err; -brcmf_dbg (PCIE ,"Enter, state=%d, pdev=%p\n" , state.event, pdev); +brcmf_err ("Enter\n" ); - bus =dev_get_drvdata (&pdev->dev); + bus =dev_get_drvdata (dev); devinfo = bus->bus_priv.pcie->devinfo;brcmf_bus_change_state (bus,BRCMF_BUS_DOWN );
@@ -1984,62 +1979,45 @@ static int brcmf_pcie_suspend(struct pci_dev *pdev, pm_message_t state)brcmf_err ("Timeout on response for entering D3 substate\n" );return -EIO ; } -brcmf_pcie_send_mb_data (devinfo,BRCMF_H2D_HOST_D0_INFORM_IN_USE ); - err =pci_save_state (pdev); -if (err) -brcmf_err ("pci_save_state failed, err=%d\n" , err); -if ((err) || (!devinfo->wowl_enabled)) { -brcmf_chip_detach (devinfo->ci); - devinfo->ci =NULL ; -brcmf_pcie_remove (pdev); -return 0 ; - } + devinfo->state =BRCMFMAC_PCIE_STATE_DOWN ; -return pci_prepare_to_sleep (pdev); +return 0 ; } -static int brcmf_pcie_resume (struct pci_dev *pdev) + +static int brcmf_pcie_pm_leave_D3 (struct device *dev) {struct brcmf_pciedev_info *devinfo;struct brcmf_bus *bus; +struct pci_dev *pdev;int err; - bus =dev_get_drvdata (&pdev->dev); -brcmf_dbg (PCIE ,"Enter, pdev=%p, bus=%p\n" , pdev, bus); +brcmf_err ("Enter\n" ); - err =pci_set_power_state (pdev,PCI_D0 ); -if (err) { -brcmf_err ("pci_set_power_state failed, err=%d\n" , err); - goto cleanup; - } -pci_restore_state (pdev); -pci_enable_wake (pdev, PCI_D3hot, false); -pci_enable_wake (pdev, PCI_D3cold, false); + bus =dev_get_drvdata (dev); + devinfo = bus->bus_priv.pcie->devinfo; +brcmf_dbg (PCIE ,"Enter, dev=%p, bus=%p\n" , dev, bus);/* Check if device is still up and running, if so we are ready */ -if (bus) { - devinfo = bus->bus_priv.pcie->devinfo; -if (brcmf_pcie_read_reg32 (devinfo, -BRCMF_PCIE_PCIE2REG_INTMASK ) !=0 ) { -if (brcmf_pcie_send_mb_data (devinfo, -BRCMF_H2D_HOST_D0_INFORM )) - goto cleanup; -brcmf_dbg (PCIE ,"Hot resume, continue....\n" ); -brcmf_pcie_select_core (devinfo,BCMA_CORE_PCIE2 ); -brcmf_bus_change_state (bus,BRCMF_BUS_UP ); -brcmf_pcie_intr_enable (devinfo); -return 0 ; - } +if (brcmf_pcie_read_reg32 (devinfo,BRCMF_PCIE_PCIE2REG_INTMASK ) !=0 ) { +brcmf_dbg (PCIE ,"Try to wakeup device....\n" ); +if (brcmf_pcie_send_mb_data (devinfo,BRCMF_H2D_HOST_D0_INFORM )) + goto cleanup; +brcmf_dbg (PCIE ,"Hot resume, continue....\n" ); + devinfo->state =BRCMFMAC_PCIE_STATE_UP ; +brcmf_pcie_select_core (devinfo,BCMA_CORE_PCIE2 ); +brcmf_bus_change_state (bus,BRCMF_BUS_UP ); +brcmf_pcie_intr_enable (devinfo); +return 0 ; } cleanup: -if (bus) { - devinfo = bus->bus_priv.pcie->devinfo; -brcmf_chip_detach (devinfo->ci); - devinfo->ci =NULL ; -brcmf_pcie_remove (pdev); - } +brcmf_chip_detach (devinfo->ci); + devinfo->ci =NULL ; + pdev = devinfo->pdev; +brcmf_pcie_remove (pdev); + err =brcmf_pcie_probe (pdev,NULL );if (err)brcmf_err ("probe after resume failed, err=%d\n" , err);
@@ -2048,6 +2026,14 @@ cleanup: } +static const struct dev_pm_ops brcmf_pciedrvr_pm = { + .suspend = brcmf_pcie_pm_enter_D3, + .resume = brcmf_pcie_pm_leave_D3, + .freeze = brcmf_pcie_pm_enter_D3, + .restore = brcmf_pcie_pm_leave_D3, +}; + +#endif /* CONFIG_PM */
@@ -2086,9 +2072,8 @@ static struct pci_driver brcmf_pciedrvr = { .probe = brcmf_pcie_probe, .remove = brcmf_pcie_remove, #ifdef CONFIG_PM - .suspend = brcmf_pcie_suspend, - .resume = brcmf_pcie_resume -#endif /* CONFIG_PM */ + .driver.pm = &brcmf_pciedrvr_pm, +#endif };
Signature · 1 line
1.9.1
PATCH 9/9 brcmfmac: Add wowl wake indication report.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
On wakeup of the system (resume) a wowl wakeup indication report can be sent to cfg80211. This patch adds support for this. The report specifies if the device was responsible for the wakeup and if so, will specify the exact reason.
--- drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 67 +++++++++++++++++++++- .../net/wireless/brcm80211/brcmfmac/fwil_types.h | 12 ++++ 2 files changed, 77 insertions(+), 2 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +65 -2
@@ -3062,6 +3062,67 @@ static s32 brcmf_config_wowl_pattern(struct brcmf_if *ifp, u8 cmd[4],return ret; } +#ifdef CONFIG_PM + +static void brcmf_report_wowl_wakeind (struct wiphy *wiphy,struct brcmf_if *ifp) +{ +struct brcmf_wowl_wakeind_le wake_ind_le; +struct cfg80211_wowlan_wakeup wakeup_data; +struct cfg80211_wowlan_wakeup *wakeup; +u32 wakeind; +s32 err; + + err =brcmf_fil_iovar_data_get (ifp,"wowl_wakeind" , &wake_ind_le, +sizeof (wake_ind_le)); +if (!err) { +brcmf_err ("Get wowl_wakeind failed, err = %d\n" , err); +return ; + } + + wakeind =le32_to_cpu (wake_ind_le.ucode_wakeind); +if (wakeind & (BRCMF_WOWL_MAGIC |BRCMF_WOWL_DIS |BRCMF_WOWL_BCN | +BRCMF_WOWL_RETR |BRCMF_WOWL_NET )) { + wakeup = &wakeup_data; +memset (&wakeup_data,0 ,sizeof (wakeup_data)); + wakeup_data.pattern_idx =-1 ; + +if (wakeind &BRCMF_WOWL_MAGIC ) { +brcmf_dbg (INFO ,"WOWL Wake indicator: BRCMF_WOWL_MAGIC\n" ); + wakeup_data.magic_pkt = true; + } +if (wakeind &BRCMF_WOWL_DIS ) { +brcmf_dbg (INFO ,"WOWL Wake indicator: BRCMF_WOWL_DIS\n" ); + wakeup_data.disconnect = true; + } +if (wakeind &BRCMF_WOWL_BCN ) { +brcmf_dbg (INFO ,"WOWL Wake indicator: BRCMF_WOWL_BCN\n" ); + wakeup_data.disconnect = true; + } +if (wakeind &BRCMF_WOWL_RETR ) { +brcmf_dbg (INFO ,"WOWL Wake indicator: BRCMF_WOWL_RETR\n" ); + wakeup_data.disconnect = true; + } +if (wakeind &BRCMF_WOWL_NET ) { +brcmf_dbg (INFO ,"WOWL Wake indicator: BRCMF_WOWL_NET\n" ); +/* For now always map to pattern 0, no API to get +* correct information available at the moment. +*/ + wakeup_data.pattern_idx =0 ; + } + }else { + wakeup =NULL ; + } +cfg80211_report_wowlan_wakeup (&ifp->vif->wdev, wakeup,GFP_KERNEL ); +} + +#else + +static void brcmf_report_wowl_wakeind (struct wiphy *wiphy,struct brcmf_if *ifp) +{ +} + +#endif /* CONFIG_PM */ +static s32 brcmf_cfg80211_resume (struct wiphy *wiphy) {struct brcmf_cfg80211_info *cfg =wiphy_to_cfg (wiphy);
@@ -3071,11 +3132,12 @@ static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)brcmf_dbg (TRACE ,"Enter\n" );if (cfg->wowl_enabled) { +brcmf_report_wowl_wakeind (wiphy, ifp); +brcmf_fil_iovar_int_set (ifp,"wowl_clear" ,0 ); +brcmf_config_wowl_pattern (ifp,"clr" ,NULL ,0 ,NULL ,0 );brcmf_configure_arp_offload (ifp, true);brcmf_fil_cmd_int_set (ifp,BRCMF_C_SET_PM , cfg->pre_wowl_pmmode); -brcmf_fil_iovar_int_set (ifp,"wowl_clear" ,0 ); -brcmf_config_wowl_pattern (ifp,"clr" ,NULL ,0 ,NULL ,0 ); cfg->wowl_enabled = false; }return 0 ;
@@ -3109,6 +3171,7 @@ static void brcmf_configure_wowl(struct brcmf_cfg80211_info *cfg, wowl->patterns[i].pkt_offset); } } +brcmf_fil_iovar_data_set (ifp,"wowl_wakeind" ,"clear" ,strlen ("clear" ));brcmf_fil_iovar_int_set (ifp,"wowl" , wowl_config);brcmf_fil_iovar_int_set (ifp,"wowl_activate" ,1 );brcmf_bus_wowl_config (cfg->pub->bus_if, true);
drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +12 -0
@@ -634,4 +634,16 @@ struct brcmf_assoclist_le { u8 mac[BRCMF_MAX_ASSOCLIST][ETH_ALEN]; }; +/** +* struct brcmf_wowl_wakeind_le - Wakeup indicators +* Note: note both fields contain same information. +* +* @pci_wakeind: Whether PCI PMECSR PMEStatus bit was set. +* @ucode_wakeind: What wakeup-event indication was set by ucode +*/ +struct brcmf_wowl_wakeind_le { +__le32 pci_wakeind; +__le32 ucode_wakeind; +}; +#endif /* FWIL_TYPES_H_ */
Signature · 1 line
1.9.1
Quoted 11 lines · Arend van Spriel
Here a smallish series which hopefully can make it in 4.4 release. The highlights are:
* support bcm4359 which can operate in two bands concurrently.
* disable runtime pm for USB avoiding issues.
* use generic pm callback in PCIe driver.
* support wowlan wake indication reporting.The series is intended for v4.4 and applies to the master branch of the wireless-drivers-next repository.
Quoted 10 lines
Hante Meuleman (9):
brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.
brcmfmac: Simplify and fix usage ofbrcmf_ifname.
brcmfmac: Remove unnecessary check fromstart_xmit.
brcmfmac: Remove unncessary variableirq_requested.
brcmfmac: Disable runtime pm for USB.
brcmfmac: Add RSDB support.
brcmfmac: Use consistent naming for bsscfgidx.
brcmfmac: Use new methods for pcie Power Management.
brcmfmac: Add wowl wake indication report.
I just tagged a pull request to Dave which I hope to be the last one. Unless Linus delays the release I doubt these make it to 4.4, sorry.
Signature · 1 line
Kalle Valo
Quoted 24 lines · Kalle Valo
Quoted 11 lines · Arend van Spriel
Here a smallish series which hopefully can make it in 4.4 release. The highlights are:
* support bcm4359 which can operate in two bands concurrently.
* disable runtime pm for USB avoiding issues.
* use generic pm callback in PCIe driver.
* support wowlan wake indication reporting.The series is intended for v4.4 and applies to the master branch of the wireless-drivers-next repository.
Quoted 10 lines
Hante Meuleman (9):
brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.
brcmfmac: Simplify and fix usage ofbrcmf_ifname.
brcmfmac: Remove unnecessary check fromstart_xmit.
brcmfmac: Remove unncessary variableirq_requested.
brcmfmac: Disable runtime pm for USB.
brcmfmac: Add RSDB support.
brcmfmac: Use consistent naming for bsscfgidx.
brcmfmac: Use new methods for pcie Power Management.
brcmfmac: Add wowl wake indication report.
Quoted 2 lines
I just tagged a pull request to Dave which I hope to be the last one. Unless Linus delays the release I doubt these make it to 4.4, sorry.
I was afraid of that. Not a big deal. Seem to have a nose for late submissions ;-p
Regards,
Arend