brcmfmac: add support for new fullmac devices
cover brcmfmac: add support for new fullmac devices
This patch series mainly contains support for new wireless devices. The fix for possible race was created during testing the driver on those devices. Finally, it has a patch that adds functionality to handle nl80211 testmode command when CONFIG_NL80211_TESTMODE Kconfig item is set.
This series applies to the wireless-next tree.
Arend van Spriel (1):
brcmfmac: add callback for nl80211 testmode command
Franky Lin (1):
brcmfmac: add BCM43241 sdio interface driver support
Hante Meuleman (3):
brcmfmac: prevent possible race condition on usb rx control.
brcmfmac: Add 43242 USB support.
brcmfmac: Add 43143 USB support.
.../net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 2 ++ drivers/net/wireless/brcm80211/brcmfmac/dhd.h | 1 + .../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 8 +++++ drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 2 ++ .../net/wireless/brcm80211/brcmfmac/sdio_chip.c | 17 +++++++++++ drivers/net/wireless/brcm80211/brcmfmac/usb.c | 31 ++++++++++++++++++-- .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 25 +++++++++++++++- .../net/wireless/brcm80211/include/brcm_hw_ids.h | 1 + 8 files changed, 84 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 2/5 brcmfmac: add BCM43241 sdio interface driver support
From: Franky Lin <[email protected]>
BCM43241 is an 11abg and 2x2 11n Wifi/BT/FM combo chip that supports 40MHz channel width. This patch intends to enable the driver support for the chip through SDIO bus interface.
--- .../net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 2 ++ drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 2 ++ .../net/wireless/brcm80211/brcmfmac/sdio_chip.c | 17 +++++++++++++++++ .../net/wireless/brcm80211/include/brcm_hw_ids.h | 1 + 4 files changed, 22 insertions(+)
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +2 -0
@@ -42,6 +42,7 @@#define DMA_ALIGN_MASK 0x03 +#define SDIO_DEVICE_ID_BROADCOM_43241 0x4324#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329#define SDIO_DEVICE_ID_BROADCOM_4330 0x4330#define SDIO_DEVICE_ID_BROADCOM_4334 0x4334
@@ -51,6 +52,7 @@/* devices we support, null terminated */ static const struct sdio_device_id brcmf_sdmmc_ids[] = { + {SDIO_DEVICE (SDIO_VENDOR_ID_BROADCOM ,SDIO_DEVICE_ID_BROADCOM_43241 )}, {SDIO_DEVICE (SDIO_VENDOR_ID_BROADCOM ,SDIO_DEVICE_ID_BROADCOM_4329 )}, {SDIO_DEVICE (SDIO_VENDOR_ID_BROADCOM ,SDIO_DEVICE_ID_BROADCOM_4330 )}, {SDIO_DEVICE (SDIO_VENDOR_ID_BROADCOM ,SDIO_DEVICE_ID_BROADCOM_4334 )},
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +2 -0
@@ -3881,6 +3881,8 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus)static bool brcmf_sdbrcm_chipmatch (u16 chipid) { +if (chipid ==BCM43241_CHIP_ID ) +return true;if (chipid ==BCM4329_CHIP_ID )return true;if (chipid ==BCM4330_CHIP_ID )
drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c +17 -0
@@ -377,6 +377,23 @@ static int brcmf_sdio_chip_recognition(struct brcmf_sdio_dev *sdiodev,/* Address of cores for new chips should be added here */ switch (ci->chip) { +case BCM43241_CHIP_ID : + ci->c_inf[0 ].wrapbase =0x18100000 ; + ci->c_inf[0 ].cib =0x2a084411 ; + ci->c_inf[1 ].id =BCMA_CORE_SDIO_DEV ; + ci->c_inf[1 ].base =0x18002000 ; + ci->c_inf[1 ].wrapbase =0x18102000 ; + ci->c_inf[1 ].cib =0x0e004211 ; + ci->c_inf[2 ].id =BCMA_CORE_INTERNAL_MEM ; + ci->c_inf[2 ].base =0x18004000 ; + ci->c_inf[2 ].wrapbase =0x18104000 ; + ci->c_inf[2 ].cib =0x14080401 ; + ci->c_inf[3 ].id =BCMA_CORE_ARM_CM3 ; + ci->c_inf[3 ].base =0x18003000 ; + ci->c_inf[3 ].wrapbase =0x18103000 ; + ci->c_inf[3 ].cib =0x07004211 ; + ci->ramsize =0x90000 ; +break ;case BCM4329_CHIP_ID : ci->c_inf[1 ].id =BCMA_CORE_SDIO_DEV ; ci->c_inf[1 ].base =BCM4329_CORE_BUS_BASE ;
drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +1 -0
@@ -34,6 +34,7 @@#define BCM43235_CHIP_ID 43235#define BCM43236_CHIP_ID 43236#define BCM43238_CHIP_ID 43238 +#define BCM43241_CHIP_ID 0x4324#define BCM4329_CHIP_ID 0x4329#define BCM4330_CHIP_ID 0x4330#define BCM4331_CHIP_ID 0x4331
Signature · 1 line
1.7.9.5
PATCH 4/5 brcmfmac: Add 43143 USB support.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
Added usb device id to list of supported devices. 43143 is a new 802.11n single stream device.
--- drivers/net/wireless/brcm80211/brcmfmac/usb.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/wireless/brcm80211/brcmfmac/usb.c +9 -0
@@ -66,6 +66,7 @@#define BRCMF_USB_CBCTL_READ 1#define BRCMF_USB_MAX_PKT_SIZE 1600 +#define BRCMF_USB_43143_FW_NAME "brcm/brcmfmac43143.bin"#define BRCMF_USB_43236_FW_NAME "brcm/brcmfmac43236b.bin"#define BRCMF_USB_43242_FW_NAME "brcm/brcmfmac43242a.bin"
@@ -1113,6 +1114,8 @@ static int brcmf_usb_dlrun(struct brcmf_usbdev_info *devinfo)static bool brcmf_usb_chip_support (int chipid,int chiprev) {switch (chipid) { +case 43143 : +return true;case 43235 :case 43236 :case 43238 :
@@ -1232,6 +1235,9 @@ static int brcmf_usb_get_fw(struct brcmf_usbdev_info *devinfo)return 0 ;switch (devinfo->bus_pub.devid) { +case 43143 : + fwname =BRCMF_USB_43143_FW_NAME ; +break ;case 43235 :case 43236 :case 43238 :
@@ -1592,11 +1598,13 @@ static int brcmf_usb_resume(struct usb_interface *intf) }#define BRCMF_USB_VENDOR_ID_BROADCOM 0x0a5c +#define BRCMF_USB_DEVICE_ID_43143 0xbd1e#define BRCMF_USB_DEVICE_ID_43236 0xbd17#define BRCMF_USB_DEVICE_ID_43242 0xbd1f#define BRCMF_USB_DEVICE_ID_BCMFW 0x0bdcstatic struct usb_device_id brcmf_usb_devid_table[] = { + {USB_DEVICE (BRCMF_USB_VENDOR_ID_BROADCOM ,BRCMF_USB_DEVICE_ID_43143 ) }, {USB_DEVICE (BRCMF_USB_VENDOR_ID_BROADCOM ,BRCMF_USB_DEVICE_ID_43236 ) }, {USB_DEVICE (BRCMF_USB_VENDOR_ID_BROADCOM ,BRCMF_USB_DEVICE_ID_43242 ) },/* special entry for device with firmware loaded and running */
@@ -1604,6 +1612,7 @@ static struct usb_device_id brcmf_usb_devid_table[] = { { } };MODULE_DEVICE_TABLE (usb, brcmf_usb_devid_table); +MODULE_FIRMWARE (BRCMF_USB_43143_FW_NAME );MODULE_FIRMWARE (BRCMF_USB_43236_FW_NAME );MODULE_FIRMWARE (BRCMF_USB_43242_FW_NAME );
Signature · 1 line
1.7.9.5
PATCH 1/5 brcmfmac: prevent possible race condition on usb rx control.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
brcmf_usb_tx_ctlpkt sends message using brcmf_usb_send_ctl then clears boolean and waits for boolean to be set (by another thread). This can result in situation where flag gets cleared while result was already received. First clearing the flag and then sending the data will prevent this.
--- drivers/net/wireless/brcm80211/brcmfmac/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/brcm80211/brcmfmac/usb.c +1 -1
@@ -366,13 +366,13 @@ static int brcmf_usb_tx_ctlpkt(struct device *dev, u8 *buf, u32 len)if (test_and_set_bit (0 , &devinfo->ctl_op))return -EIO ; + devinfo->ctl_completed = false; err =brcmf_usb_send_ctl (devinfo, buf, len);if (err) {brcmf_dbg (ERROR ,"fail %d bytes: %d\n" , err, len);return err; } - devinfo->ctl_completed = false; timeout =brcmf_usb_ioctl_resp_wait (devinfo, &devinfo->ctl_completed, &pending);clear_bit (0 , &devinfo->ctl_op);
Signature · 1 line
1.7.9.5
PATCH 3/5 brcmfmac: Add 43242 USB support.
In reply to Arend van SprielFrom: Hante Meuleman <[email protected]>
Added usb device id to list of supported devices. 43242 is the new 802.11n 2x2 MIMO device.
--- drivers/net/wireless/brcm80211/brcmfmac/usb.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/net/wireless/brcm80211/brcmfmac/usb.c +19 -1
@@ -67,6 +67,7 @@#define BRCMF_USB_MAX_PKT_SIZE 1600#define BRCMF_USB_43236_FW_NAME "brcm/brcmfmac43236b.bin" +#define BRCMF_USB_43242_FW_NAME "brcm/brcmfmac43242a.bin"enum usbdev_suspend_state {USBOS_SUSPEND_STATE_DEVICE_ACTIVE =0 ,/* Device is busy, won't allow
@@ -1116,6 +1117,8 @@ static bool brcmf_usb_chip_support(int chipid, int chiprev)case 43236 :case 43238 :return (chiprev ==3 ); +case 43242 : +return true;default :break ; }
@@ -1228,7 +1231,19 @@ static int brcmf_usb_get_fw(struct brcmf_usbdev_info *devinfo)if (devinfo->image)return 0 ; - fwname =BRCMF_USB_43236_FW_NAME ; +switch (devinfo->bus_pub.devid) { +case 43235 : +case 43236 : +case 43238 : + fwname =BRCMF_USB_43236_FW_NAME ; +break ; +case 43242 : + fwname =BRCMF_USB_43242_FW_NAME ; +break ; +default : +return -EINVAL ; +break ; + } err =request_firmware (&fw, fwname, devinfo->dev);if (!fw) {
@@ -1578,16 +1593,19 @@ static int brcmf_usb_resume(struct usb_interface *intf)#define BRCMF_USB_VENDOR_ID_BROADCOM 0x0a5c#define BRCMF_USB_DEVICE_ID_43236 0xbd17 +#define BRCMF_USB_DEVICE_ID_43242 0xbd1f#define BRCMF_USB_DEVICE_ID_BCMFW 0x0bdcstatic struct usb_device_id brcmf_usb_devid_table[] = { {USB_DEVICE (BRCMF_USB_VENDOR_ID_BROADCOM ,BRCMF_USB_DEVICE_ID_43236 ) }, + {USB_DEVICE (BRCMF_USB_VENDOR_ID_BROADCOM ,BRCMF_USB_DEVICE_ID_43242 ) },/* special entry for device with firmware loaded and running */ {USB_DEVICE (BRCMF_USB_VENDOR_ID_BROADCOM ,BRCMF_USB_DEVICE_ID_BCMFW ) }, { } };MODULE_DEVICE_TABLE (usb, brcmf_usb_devid_table);MODULE_FIRMWARE (BRCMF_USB_43236_FW_NAME ); +MODULE_FIRMWARE (BRCMF_USB_43242_FW_NAME );/* TODO: suspend and resume entries */ static struct usb_driver brcmf_usbdrvr = {
Signature · 1 line
1.7.9.5
PATCH 5/5 brcmfmac: add callback for nl80211 testmode command
In reply to Arend van SprielThis change adds callback for nl80211 testmode, which can be used for testing and debugging purposes with driver and firmware.
--- drivers/net/wireless/brcm80211/brcmfmac/dhd.h | 1 + .../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 8 +++++++ .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 25 +++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-)
drivers/net/wireless/brcm80211/brcmfmac/dhd.h +1 -0
@@ -638,6 +638,7 @@ extern uint brcmf_c_mkiovar(char *name, char *data, uint datalen,extern int brcmf_netdev_wait_pend8021x (struct net_device *ndev);extern s32 brcmf_exec_dcmd (struct net_device *dev,u32 cmd,void *arg,u32 len); +extern int brcmf_netlink_dcmd (struct net_device *ndev,struct brcmf_dcmd *dcmd);/* Return pointer to interface name */ extern char *brcmf_ifname (struct brcmf_pub *drvr,int idx);
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +8 -0
@@ -775,6 +775,14 @@ done:return err; } +int brcmf_netlink_dcmd (struct net_device *ndev,struct brcmf_dcmd *dcmd) +{ +brcmf_dbg (TRACE ,"enter: cmd %x buf %p len %d\n" , + dcmd->cmd, dcmd->buf, dcmd->len); + +return brcmf_exec_dcmd (ndev, dcmd->cmd, dcmd->buf, dcmd->len); +} +static int brcmf_netdev_stop (struct net_device *ndev) {struct brcmf_if *ifp =netdev_priv (ndev);
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +24 -1
@@ -28,6 +28,7 @@#include <linux/ieee80211.h> #include <linux/uaccess.h> #include <net/cfg80211.h> +#include <net/netlink.h> #include <brcmu_utils.h> #include <defs.h>
@@ -2723,6 +2724,25 @@ brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *ndev) } +#ifdef CONFIG_NL80211_TESTMODE +static int brcmf_cfg80211_testmode (struct wiphy *wiphy,void *data,int len) +{ +struct brcmf_cfg80211_priv *cfg_priv =wiphy_to_cfg (wiphy); +struct net_device *ndev = cfg_priv->wdev->netdev; +struct brcmf_dcmd *dcmd = data; +struct sk_buff *reply; +int ret; + + ret =brcmf_netlink_dcmd (ndev, dcmd); +if (ret ==0 ) { + reply =cfg80211_testmode_alloc_reply_skb (wiphy,sizeof (*dcmd)); +nla_put (reply,NL80211_ATTR_TESTDATA ,sizeof (*dcmd), dcmd); + ret =cfg80211_testmode_reply (reply); + } +return ret; +} +#endif +static struct cfg80211_ops wl_cfg80211_ops = { .change_virtual_intf = brcmf_cfg80211_change_iface, .scan = brcmf_cfg80211_scan,
@@ -2745,7 +2765,10 @@ static struct cfg80211_ops wl_cfg80211_ops = { .resume = brcmf_cfg80211_resume, .set_pmksa = brcmf_cfg80211_set_pmksa, .del_pmksa = brcmf_cfg80211_del_pmksa, - .flush_pmksa = brcmf_cfg80211_flush_pmksa + .flush_pmksa = brcmf_cfg80211_flush_pmksa, +#ifdef CONFIG_NL80211_TESTMODE + .testmode_cmd = brcmf_cfg80211_testmode +#endif };static s32 brcmf_mode_to_nl80211_iftype (s32 mode)
Signature · 1 line
1.7.9.5
Re: [PATCH 4/5] brcmfmac: Add 43143 USB support.
In reply to Arend van SprielQuoted 9 lines · Arend van Spriel
From: Hante Meuleman <[email protected]>
Added usb device id to list of supported devices. 43143 is a new 802.11n single stream device.
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 6 lines
---
+#define
BRCMF_USB_43143_FW_NAME"brcm/brcmfmac43143.bin"
#defineBRCMF_USB_43236_FW_NAME"brcm/brcmfmac43236b.bin"
#defineBRCMF_USB_43242_FW_NAME"brcm/brcmfmac43242a.bin"
Hi,
when do you release the firmware for this devices to the public? I can not find it in linux-firmware or with a quick google search. I haven't found the brcmfmac43242a.bin firmware either.
Hauke
Re: [PATCH 4/5] brcmfmac: Add 43143 USB support.
2012/10/18 Hauke Mehrtens <[email protected]>:
Quoted 17 lines · Arend van Spriel
Quoted 9 lines
From: Hante Meuleman <[email protected]>
Added usb device id to list of supported devices. 43143 is a new 802.11n single stream device.
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 6 lines
---
+#define BRCMF_USB_43143_FW_NAME "brcm/brcmfmac43143.bin" #define BRCMF_USB_43236_FW_NAME "brcm/brcmfmac43236b.bin" #define BRCMF_USB_43242_FW_NAME "brcm/brcmfmac43242a.bin"
Quoted 5 lines
Hi,
when do you release the firmware for this devices to the public? I can not find it in linux-firmware or with a quick google search. I haven't found the brcmfmac43242a.bin firmware either.
Ping? The firmware seems to be still lacking.
Signature · 1 line
Rafał