2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

Code clean up for fullmac.

Arend van Spriel (1):
staging: brcm80211: remove unconditional code blocks from brcmfmac

Franky Lin (6):
staging: brcm80211: remove event handler thread from fullmac
staging: brcm80211: remove fullmac module_param brcmf_dongle_memsize
staging: brcm80211: remove fullmac module_param
brcmf_sdiod_drive_strength
staging: brcm80211: remove fullmac module_param for watchdog
staging: brcm80211: remove fullmac module_param brcmf_idletime
staging: brcm80211: remove global variables for data frame boundary

Roland Vossen (13):
staging: brcm80211: sparse endianness warnings on dongle events
staging: brcm80211: various fulmac sparse endianness fixes
staging: brcm80211: sparse endianness warnings for struct
brcmf_proto_cdc_ioctl
staging: brcm80211: sparse endianness warnings for struct
sdpcm_shared
staging: brcm80211: more fullmac sparse endianness scan related
changes
staging: brcm80211: removed two fullmac sparse spinlock warnings
staging: brcm80211: added endianness check flag to fullmac Makefile
staging: brcm80211: removed likely/unlikely calls
staging: brcm80211: removed log after kzalloc()/kmalloc() failure
staging: brcm80211: clarified fullmac io and event codes
staging: brcm80211: consistent naming of struct net_device *ndev
staging: brcm80211: simplified internal ioctl function once more
staging: brcm80211: reduced checkpatch warnings to zero

drivers/staging/brcm80211/brcmfmac/Makefile | 1 +
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 2 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 33 +-
drivers/staging/brcm80211/brcmfmac/dhd.h | 51 +-
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 13 +-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 47 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 189 +++---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 309 +++++-----
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 430 +++++++-------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 678 +++++++++------------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 11 +-
drivers/staging/brcm80211/brcmsmac/aiutils.c | 14 +-
drivers/staging/brcm80211/brcmsmac/ampdu.c | 8 +-
drivers/staging/brcm80211/brcmsmac/antsel.c | 5 +-
drivers/staging/brcm80211/brcmsmac/channel.c | 5 +-
drivers/staging/brcm80211/brcmsmac/dma.c | 16 +-
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 11 +-
drivers/staging/brcm80211/brcmsmac/main.c | 3 +-
drivers/staging/brcm80211/brcmsmac/nicpci.c | 6 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.c | 7 +-
drivers/staging/brcm80211/brcmsmac/srom.c | 3 +-
21 files changed, 865 insertions(+), 977 deletions(-)




2011-09-19 21:26:26

by Franky Lin

[permalink] [raw]
Subject: [PATCH 04/20] staging: brcm80211: sparse endianness warnings for struct sdpcm_shared

From: Roland Vossen <[email protected]>

Structure that is received from dongle has been annotated.

Reported-by: Johannes Berg <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 31 +++++++++++++++++-------
1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 57001d4..9d4850d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -530,6 +530,17 @@ struct sdpcm_shared {
u8 tag[32];
};

+struct sdpcm_shared_le {
+ __le32 flags;
+ __le32 trap_addr;
+ __le32 assert_exp_addr;
+ __le32 assert_file_addr;
+ __le32 assert_line;
+ __le32 console_addr; /* Address of struct rte_console */
+ __le32 msgtrace_addr;
+ u8 tag[32];
+};
+

/* misc chip info needed by some of the routines */
struct chip_info {
@@ -2919,6 +2930,7 @@ brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
u32 addr;
__le32 addr_le;
int rv;
+ struct sdpcm_shared_le sh_le;

/* Read last word in memory to determine address of
sdpcm_shared structure */
@@ -2942,19 +2954,20 @@ brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
}

/* Read rte_shared structure */
- rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *) sh,
- sizeof(struct sdpcm_shared));
+ rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *) &sh_le,
+ sizeof(struct sdpcm_shared_le));
if (rv < 0)
return rv;

/* Endianness */
- sh->flags = le32_to_cpu(sh->flags);
- sh->trap_addr = le32_to_cpu(sh->trap_addr);
- sh->assert_exp_addr = le32_to_cpu(sh->assert_exp_addr);
- sh->assert_file_addr = le32_to_cpu(sh->assert_file_addr);
- sh->assert_line = le32_to_cpu(sh->assert_line);
- sh->console_addr = le32_to_cpu(sh->console_addr);
- sh->msgtrace_addr = le32_to_cpu(sh->msgtrace_addr);
+ sh->flags = le32_to_cpu(sh_le.flags);
+ sh->trap_addr = le32_to_cpu(sh_le.trap_addr);
+ sh->assert_exp_addr = le32_to_cpu(sh_le.assert_exp_addr);
+ sh->assert_file_addr = le32_to_cpu(sh_le.assert_file_addr);
+ sh->assert_line = le32_to_cpu(sh_le.assert_line);
+ sh->console_addr = le32_to_cpu(sh_le.console_addr);
+ sh->msgtrace_addr = le32_to_cpu(sh_le.msgtrace_addr);
+ memcpy(sh->tag, sh_le.tag, sizeof(sh->tag));

if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
brcmf_dbg(ERROR, "sdpcm_shared version %d in brcmf is different than sdpcm_shared version %d in dongle\n",
--
1.7.1



2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 15/20] staging: brcm80211: removed likely/unlikely calls

From: Roland Vossen <[email protected]>

There was no performance rationale to use these guys.

Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 4 +-
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 211 +++++++++++-----------
drivers/staging/brcm80211/brcmsmac/ampdu.c | 2 +-
3 files changed, 107 insertions(+), 110 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index e1d7456..cc8564a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -944,7 +944,7 @@ static int brcmf_netdev_open(struct net_device *net)
/* Allow transmit calls */
netif_start_queue(net);
drvr_priv->pub.up = 1;
- if (unlikely(brcmf_cfg80211_up(drvr_priv->pub.config))) {
+ if (brcmf_cfg80211_up(drvr_priv->pub.config)) {
brcmf_dbg(ERROR, "failed to bring up cfg80211\n");
return -1;
}
@@ -1054,7 +1054,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
brcmf_cfg80211_attach(net,
brcmf_bus_get_device(bus),
&drvr_priv->pub);
- if (unlikely(drvr_priv->pub.config == NULL)) {
+ if (drvr_priv->pub.config == NULL) {
brcmf_dbg(ERROR, "wl_cfg80211_attach failed\n");
goto fail;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 0bda00c..6acaaae 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -337,7 +337,7 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
}

err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_SET_INFRA, &infra);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_INFRA error (%d)\n", err);
err = -EAGAIN;
} else {
@@ -367,7 +367,7 @@ static s32 brcmf_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
BUG_ON(!len);

err = brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, buf, len);
- if (unlikely(err))
+ if (err)
WL_ERR("error (%d)\n", err);

return err;
@@ -389,7 +389,7 @@ brcmf_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
sizeof(var.buf));
BUG_ON(!len);
err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, &var, len);
- if (unlikely(err))
+ if (err)
WL_ERR("error (%d)\n", err);

*retval = le32_to_cpu(var.val);
@@ -404,7 +404,7 @@ static void brcmf_set_mpc(struct net_device *ndev, int mpc)

if (test_bit(WL_STATUS_READY, &cfg_priv->status)) {
err = brcmf_dev_intvar_set(ndev, "mpc", mpc);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("fail to set mpc\n");
return;
}
@@ -463,7 +463,7 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
if (ssid && ssid->SSID_len)
params_size += sizeof(struct brcmf_ssid);
params = kzalloc(params_size, GFP_KERNEL);
- if (unlikely(!params))
+ if (!params)
return -ENOMEM;
BUG_ON(params_size >= BRCMF_C_IOCTL_SMLEN);

@@ -475,7 +475,7 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,

err = brcmf_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
iscan->ioctl_buf, BRCMF_C_IOCTL_SMLEN);
- if (unlikely(err)) {
+ if (err) {
if (err == -EBUSY)
WL_INFO("system busy : iscan canceled\n");
else
@@ -502,7 +502,7 @@ static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv)
passive_scan = cfg_priv->active_scan ? 0 : 1;
err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("error (%d)\n", err);
return err;
}
@@ -533,11 +533,11 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
s32 err = 0;
u32 SSID_len;

- if (unlikely(test_bit(WL_STATUS_SCANNING, &cfg_priv->status))) {
+ if (test_bit(WL_STATUS_SCANNING, &cfg_priv->status)) {
WL_ERR("Scanning already : status (%lu)\n", cfg_priv->status);
return -EAGAIN;
}
- if (unlikely(test_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status))) {
+ if (test_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status)) {
WL_ERR("Scanning being aborted : status (%lu)\n",
cfg_priv->status);
return -EAGAIN;
@@ -565,7 +565,7 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
set_bit(WL_STATUS_SCANNING, &cfg_priv->status);
if (iscan_req) {
err = brcmf_do_iscan(cfg_priv);
- if (likely(!err))
+ if (!err)
return err;
else
goto scan_out;
@@ -586,7 +586,7 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
passive_scan = cfg_priv->active_scan ? 0 : 1;
err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
goto scan_out;
}
@@ -625,7 +625,7 @@ brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
return -EIO;

err = __brcmf_cfg80211_scan(wiphy, ndev, request, NULL);
- if (unlikely(err))
+ if (err)
WL_ERR("scan error (%d)\n", err);

WL_TRACE("Exit\n");
@@ -637,7 +637,7 @@ static s32 brcmf_set_rts(struct net_device *dev, u32 rts_threshold)
s32 err = 0;

err = brcmf_dev_intvar_set(dev, "rtsthresh", rts_threshold);
- if (unlikely(err))
+ if (err)
WL_ERR("Error (%d)\n", err);

return err;
@@ -648,7 +648,7 @@ static s32 brcmf_set_frag(struct net_device *dev, u32 frag_threshold)
s32 err = 0;

err = brcmf_dev_intvar_set(dev, "fragthresh", frag_threshold);
- if (unlikely(err))
+ if (err)
WL_ERR("Error (%d)\n", err);

return err;
@@ -660,7 +660,7 @@ static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l)
u32 cmd = (l ? BRCM_SET_LRL : BRCM_SET_SRL);

err = brcmf_dev_ioctl_u32(dev, cmd, &retry);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("cmd (%d) , error (%d)\n", cmd, err);
return err;
}
@@ -809,7 +809,7 @@ static void brcmf_link_down(struct brcmf_cfg80211_priv *cfg_priv)
dev = cfg_to_ndev(cfg_priv);
WL_INFO("Call WLC_DISASSOC to stop excess roaming\n ");
err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
- if (unlikely(err))
+ if (err)
WL_ERR("WLC_DISASSOC failed (%d)\n", err);
cfg_priv->link_up = false;
}
@@ -883,7 +883,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
wsec |= WEP_ENABLED;

err = brcmf_dev_intvar_set(dev, "wsec", wsec);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("wsec failed (%d)\n", err);
goto done;
}
@@ -895,7 +895,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
bcnprd = 100;

err = brcmf_dev_ioctl_u32(dev, BRCM_SET_BCNPRD, &bcnprd);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_BCNPRD failed (%d)\n", err);
goto done;
}
@@ -940,7 +940,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
target_channel = cfg_priv->channel;
err = brcmf_dev_ioctl_u32(dev, BRCM_SET_CHANNEL,
&target_channel);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_CHANNEL failed (%d)\n", err);
goto done;
}
@@ -952,7 +952,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,

err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
&join_params, join_params_size);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_SSID failed (%d)\n", err);
goto done;
}
@@ -997,7 +997,7 @@ static s32 brcmf_set_wpa_version(struct net_device *dev,
val = WPA_AUTH_DISABLED;
WL_CONN("setting wpa_auth to 0x%0x\n", val);
err = brcmf_dev_intvar_set(dev, "wpa_auth", val);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("set wpa_auth failed (%d)\n", err);
return err;
}
@@ -1036,7 +1036,7 @@ brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
}

err = brcmf_dev_intvar_set(dev, "auth", val);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("set auth failed (%d)\n", err);
return err;
}
@@ -1100,7 +1100,7 @@ brcmf_set_set_cipher(struct net_device *dev,

WL_CONN("pval (%d) gval (%d)\n", pval, gval);
err = brcmf_dev_intvar_set(dev, "wsec", pval | gval);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("error (%d)\n", err);
return err;
}
@@ -1122,7 +1122,7 @@ brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)

if (sme->crypto.n_akm_suites) {
err = brcmf_dev_intvar_get(dev, "wpa_auth", &val);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("could not get wpa_auth (%d)\n", err);
return err;
}
@@ -1156,7 +1156,7 @@ brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)

WL_CONN("setting wpa_auth to %d\n", val);
err = brcmf_dev_intvar_set(dev, "wpa_auth", val);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("could not set wpa_auth (%d)\n", err);
return err;
}
@@ -1190,7 +1190,7 @@ brcmf_set_set_sharedkey(struct net_device *dev,
memset(&key, 0, sizeof(key));
key.len = (u32) sme->key_len;
key.index = (u32) sme->key_idx;
- if (unlikely(key.len > sizeof(key.data))) {
+ if (key.len > sizeof(key.data)) {
WL_ERR("Too long key length (%u)\n", key.len);
return -EINVAL;
}
@@ -1220,7 +1220,7 @@ brcmf_set_set_sharedkey(struct net_device *dev,
WL_CONN("set auth_type to shared key\n");
val = 1; /* shared key */
err = brcmf_dev_intvar_set(dev, "auth", val);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("set auth failed (%d)\n", err);
return err;
}
@@ -1246,7 +1246,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
if (!check_sys_up(wiphy))
return -EIO;

- if (unlikely(!sme->ssid)) {
+ if (!sme->ssid) {
WL_ERR("Invalid ssid\n");
return -EOPNOTSUPP;
}
@@ -1340,7 +1340,7 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
scbval.val = cpu_to_le32(reason_code);
err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
sizeof(struct brcmf_scb_val_le));
- if (unlikely(err))
+ if (err)
WL_ERR("error (%d)\n", err);

cfg_priv->link_up = false;
@@ -1385,7 +1385,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
/* Make sure radio is off or on as far as software is concerned */
disable = WL_RADIO_SW_DISABLE << 16;
err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_SET_RADIO, &disable);
- if (unlikely(err))
+ if (err)
WL_ERR("WLC_SET_RADIO error (%d)\n", err);

if (dbm > 0xffff)
@@ -1394,7 +1394,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
txpwrmw = (u16) dbm;
err = brcmf_dev_intvar_set(ndev, "qtxpower",
(s32) (brcmu_mw_to_qdbm(txpwrmw)));
- if (unlikely(err))
+ if (err)
WL_ERR("qtxpower error (%d)\n", err);
cfg_priv->conf->tx_power = dbm;

@@ -1416,7 +1416,7 @@ static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
return -EIO;

err = brcmf_dev_intvar_get(ndev, "qtxpower", &txpwrdbm);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("error (%d)\n", err);
goto done;
}
@@ -1443,7 +1443,7 @@ brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
return -EIO;

err = brcmf_dev_ioctl_u32(dev, BRCMF_C_GET_WSEC, &wsec);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_GET_WSEC error (%d)\n", err);
goto done;
}
@@ -1452,7 +1452,7 @@ brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
/* Just select a new current key */
index = key_idx;
err = brcmf_dev_ioctl_u32(dev, BRCMF_C_SET_KEY_PRIMARY, &index);
- if (unlikely(err))
+ if (err)
WL_ERR("error (%d)\n", err);
}
done:
@@ -1538,7 +1538,7 @@ brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
brcmf_netdev_wait_pend8021x(dev);
err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key_le,
sizeof(key_le));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_KEY error (%d)\n", err);
return err;
}
@@ -1571,7 +1571,7 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
key.len = (u32) params->key_len;
key.index = (u32) key_idx;

- if (unlikely(key.len > sizeof(key.data))) {
+ if (key.len > sizeof(key.data)) {
WL_ERR("Too long key length (%u)\n", key.len);
err = -EINVAL;
goto done;
@@ -1615,21 +1615,21 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,

val = WEP_ENABLED;
err = brcmf_dev_intvar_get(dev, "wsec", &wsec);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("get wsec error (%d)\n", err);
goto done;
}
wsec &= ~(WEP_ENABLED);
wsec |= val;
err = brcmf_dev_intvar_set(dev, "wsec", wsec);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("set wsec error (%d)\n", err);
goto done;
}

val = 1; /* assume shared key. otherwise 0 */
err = brcmf_dev_ioctl_u32(dev, BRCMF_C_SET_AUTH, &val);
- if (unlikely(err))
+ if (err)
WL_ERR("WLC_SET_AUTH error (%d)\n", err);
done:
WL_TRACE("Exit\n");
@@ -1672,7 +1672,7 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,

val = 0;
err = brcmf_dev_intvar_get(dev, "wsec", &wsec);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("get wsec error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
err = -EAGAIN;
@@ -1681,7 +1681,7 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
wsec &= ~(WEP_ENABLED);
wsec |= val;
err = brcmf_dev_intvar_set(dev, "wsec", wsec);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("set wsec error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
err = -EAGAIN;
@@ -1690,7 +1690,7 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,

val = 0; /* assume open key. otherwise 1 */
err = brcmf_dev_ioctl_u32(dev, BRCMF_C_SET_AUTH, &val);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_AUTH error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
err = -EAGAIN;
@@ -1719,7 +1719,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
memset(&params, 0, sizeof(params));

err = brcmf_dev_ioctl_u32(dev, BRCMF_C_GET_WSEC, &wsec);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_GET_WSEC error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
err = -EAGAIN;
@@ -1780,8 +1780,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
if (!check_sys_up(wiphy))
return -EIO;

- if (unlikely
- (memcmp(mac, bssid, ETH_ALEN))) {
+ if (memcmp(mac, bssid, ETH_ALEN)) {
WL_ERR("Wrong Mac address cfg_mac-%X:%X:%X:%X:%X:%X"
"wl_bssid-%X:%X:%X:%X:%X:%X\n",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
@@ -1805,7 +1804,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
scb_val.val = cpu_to_le32(0);
err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
sizeof(struct brcmf_scb_val_le));
- if (unlikely(err))
+ if (err)
WL_ERR("Could not get rssi (%d)\n", err);

rssi = le32_to_cpu(scb_val.val);
@@ -1848,7 +1847,7 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
WL_INFO("power save %s\n", (pm ? "enabled" : "disabled"));

err = brcmf_dev_ioctl_u32(dev, BRCMF_C_SET_PM, &pm);
- if (unlikely(err)) {
+ if (err) {
if (err == -ENODEV)
WL_ERR("net_device is not ready yet\n");
else
@@ -1880,7 +1879,7 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
/* Get current rateset */
err = brcmf_dev_ioctl(dev, BRCM_GET_CURR_RATESET, &rateset_le,
sizeof(rateset_le));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("could not get current rateset (%d)\n", err);
goto done;
}
@@ -1908,7 +1907,7 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
*/
err_bg = brcmf_dev_intvar_set(dev, "bg_rate", rate);
err_a = brcmf_dev_intvar_set(dev, "a_rate", rate);
- if (unlikely(err_bg && err_a)) {
+ if (err_bg && err_a) {
WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a);
err = err_bg | err_a;
}
@@ -1935,7 +1934,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
size_t notify_ielen;
s32 notify_signal;

- if (unlikely(le32_to_cpu(bi->length) > WL_BSS_INFO_MAX)) {
+ if (le32_to_cpu(bi->length) > WL_BSS_INFO_MAX) {
WL_ERR("Bss info is larger than buffer. Discarding\n");
return 0;
}
@@ -1971,7 +1970,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
notify_timestamp, notify_capability, notify_interval, notify_ie,
notify_ielen, notify_signal, GFP_KERNEL);

- if (unlikely(!bss)) {
+ if (!bss) {
WL_ERR("cfg80211_inform_bss_frame error\n");
return -EINVAL;
}
@@ -1987,7 +1986,7 @@ static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv)
int i;

bss_list = cfg_priv->bss_list;
- if (unlikely(bss_list->version != BRCMF_BSS_INFO_VERSION)) {
+ if (bss_list->version != BRCMF_BSS_INFO_VERSION) {
WL_ERR("Version %d != WL_BSS_INFO_VERSION\n",
bss_list->version);
return -EOPNOTSUPP;
@@ -1996,7 +1995,7 @@ static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv)
for (i = 0; i < bss_list->count && i < WL_AP_MAX; i++) {
bi = next_bss(bss_list, bi);
err = brcmf_inform_single_bss(cfg_priv, bi);
- if (unlikely(err))
+ if (err)
break;
}
return err;
@@ -2032,7 +2031,7 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
*(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX);

err = brcmf_dev_ioctl(dev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_GET_BSS_INFO failed: %d\n", err);
goto CleanUp;
}
@@ -2101,14 +2100,14 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)
*(__le32 *)cfg_priv->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCMF_C_GET_BSS_INFO,
cfg_priv->extra_buf, WL_EXTRA_BUF_MAX);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("Could not get bss info %d\n", err);
goto update_bss_info_out;
}

bi = (struct brcmf_bss_info *)(cfg_priv->extra_buf + 4);
err = brcmf_inform_single_bss(cfg_priv, bi);
- if (unlikely(err))
+ if (err)
goto update_bss_info_out;

ie = ((u8 *)bi) + le16_to_cpu(bi->ie_offset);
@@ -2127,7 +2126,7 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)
u32 var;
err = brcmf_dev_intvar_get(cfg_to_ndev(cfg_priv),
"dtim_assoc", &var);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("wl dtim_assoc failed (%d)\n", err);
goto update_bss_info_out;
}
@@ -2169,12 +2168,11 @@ static void brcmf_notify_iscan_complete(struct brcmf_cfg80211_iscan_ctrl *iscan,
struct brcmf_cfg80211_priv *cfg_priv = iscan_to_cfg(iscan);
struct net_device *ndev = cfg_to_ndev(cfg_priv);

- if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
- &cfg_priv->status))) {
+ if (!test_and_clear_bit(WL_STATUS_SCANNING, &cfg_priv->status)) {
WL_ERR("Scan complete while device not scanning\n");
return;
}
- if (likely(cfg_priv->scan_request)) {
+ if (cfg_priv->scan_request) {
WL_SCAN("ISCAN Completed scan: %s\n",
aborted ? "Aborted" : "Done");
cfg80211_scan_done(cfg_priv->scan_request, aborted);
@@ -2186,7 +2184,7 @@ static void brcmf_notify_iscan_complete(struct brcmf_cfg80211_iscan_ctrl *iscan,

static s32 brcmf_wakeup_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan)
{
- if (likely(iscan->state != WL_ISCAN_STATE_IDLE)) {
+ if (iscan->state != WL_ISCAN_STATE_IDLE) {
WL_SCAN("wake up iscan\n");
schedule_work(&iscan->work);
return 0;
@@ -2218,7 +2216,7 @@ brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan, u32 *status,
err = brcmf_dev_iovar_getbuf(iscan->dev, "iscanresults", &list,
BRCMF_ISCAN_RESULTS_FIXED_SIZE, iscan->scan_buf,
WL_ISCAN_BUF_MAX);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("error (%d)\n", err);
return err;
}
@@ -2481,7 +2479,7 @@ brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
BUG_ON(!len);
err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)cfg_priv->ioctl_buf,
WL_IOCTL_LEN_MAX);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("error (%d)\n", err);
return err;
}
@@ -2504,7 +2502,7 @@ brcmf_update_pmklist(struct net_device *dev,
WL_CONN("%02x\n", pmk_list->pmkids.pmkid[i].PMKID[j]);
}

- if (likely(!err))
+ if (!err)
brcmf_dev_bufvar_set(dev, "pmkid_info", (char *)pmk_list,
sizeof(*pmk_list));

@@ -2662,14 +2660,14 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
s32 err = 0;

wdev = kzalloc(sizeof(*wdev), GFP_KERNEL);
- if (unlikely(!wdev)) {
+ if (!wdev) {
WL_ERR("Could not allocate wireless device\n");
return ERR_PTR(-ENOMEM);
}
wdev->wiphy =
wiphy_new(&wl_cfg80211_ops,
sizeof(struct brcmf_cfg80211_priv) + sizeof_iface);
- if (unlikely(!wdev->wiphy)) {
+ if (!wdev->wiphy) {
WL_ERR("Couldn not allocate wiphy device\n");
err = -ENOMEM;
goto wiphy_new_out;
@@ -2695,7 +2693,7 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
* by default
*/
err = wiphy_register(wdev->wiphy);
- if (unlikely(err < 0)) {
+ if (err < 0) {
WL_ERR("Couldn not register wiphy device (%d)\n", err);
goto wiphy_register_out;
}
@@ -2714,7 +2712,7 @@ static void brcmf_free_wdev(struct brcmf_cfg80211_priv *cfg_priv)
{
struct wireless_dev *wdev = cfg_priv->wdev;

- if (unlikely(!wdev)) {
+ if (!wdev) {
WL_ERR("wdev is invalid\n");
return;
}
@@ -2798,7 +2796,7 @@ static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)

err = brcmf_dev_bufvar_get(ndev, "assoc_info", cfg_priv->extra_buf,
WL_ASSOC_INFO_MAX);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("could not get assoc info (%d)\n", err);
return err;
}
@@ -2809,7 +2807,7 @@ static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
err = brcmf_dev_bufvar_get(ndev, "assoc_req_ies",
cfg_priv->extra_buf,
WL_ASSOC_INFO_MAX);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("could not get assoc req (%d)\n", err);
return err;
}
@@ -2825,7 +2823,7 @@ static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
err = brcmf_dev_bufvar_get(ndev, "assoc_resp_ies",
cfg_priv->extra_buf,
WL_ASSOC_INFO_MAX);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("could not get assoc resp (%d)\n", err);
return err;
}
@@ -3028,8 +3026,7 @@ brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,
return brcmf_wakeup_iscan(cfg_to_iscan(cfg_priv));
}

- if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
- &cfg_priv->status))) {
+ if (!test_and_clear_bit(WL_STATUS_SCANNING, &cfg_priv->status)) {
WL_ERR("Scan complete while device not scanning\n");
scan_abort = true;
err = -EINVAL;
@@ -3038,13 +3035,13 @@ brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,

err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel_inform_le,
sizeof(channel_inform_le));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("scan busy (%d)\n", err);
scan_abort = true;
goto scan_done_out;
}
scan_channel = le32_to_cpu(channel_inform_le.scan_channel);
- if (unlikely(scan_channel))
+ if (scan_channel)
WL_CONN("channel_inform.scan_channel (%d)\n", scan_channel);
cfg_priv->bss_list = cfg_priv->scan_results;
bss_list_le = (struct brcmf_scan_results_le *) cfg_priv->bss_list;
@@ -3053,7 +3050,7 @@ brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,
bss_list_le->buflen = cpu_to_le32(len);
err = brcmf_dev_ioctl(ndev, BRCMF_C_SCAN_RESULTS,
cfg_priv->scan_results, len);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("%s Scan_results error (%d)\n", ndev->name, err);
err = -EINVAL;
scan_abort = true;
@@ -3127,48 +3124,48 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
{
cfg_priv->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
- if (unlikely(!cfg_priv->scan_results)) {
+ if (!cfg_priv->scan_results) {
WL_ERR("Scan results alloc failed\n");
goto init_priv_mem_out;
}
cfg_priv->conf = kzalloc(sizeof(*cfg_priv->conf), GFP_KERNEL);
- if (unlikely(!cfg_priv->conf)) {
+ if (!cfg_priv->conf) {
WL_ERR("wl_conf alloc failed\n");
goto init_priv_mem_out;
}
cfg_priv->profile = kzalloc(sizeof(*cfg_priv->profile), GFP_KERNEL);
- if (unlikely(!cfg_priv->profile)) {
+ if (!cfg_priv->profile) {
WL_ERR("wl_profile alloc failed\n");
goto init_priv_mem_out;
}
cfg_priv->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
- if (unlikely(!cfg_priv->bss_info)) {
+ if (!cfg_priv->bss_info) {
WL_ERR("Bss information alloc failed\n");
goto init_priv_mem_out;
}
cfg_priv->scan_req_int = kzalloc(sizeof(*cfg_priv->scan_req_int),
GFP_KERNEL);
- if (unlikely(!cfg_priv->scan_req_int)) {
+ if (!cfg_priv->scan_req_int) {
WL_ERR("Scan req alloc failed\n");
goto init_priv_mem_out;
}
cfg_priv->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL);
- if (unlikely(!cfg_priv->ioctl_buf)) {
+ if (!cfg_priv->ioctl_buf) {
WL_ERR("Ioctl buf alloc failed\n");
goto init_priv_mem_out;
}
cfg_priv->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
- if (unlikely(!cfg_priv->extra_buf)) {
+ if (!cfg_priv->extra_buf) {
WL_ERR("Extra buf alloc failed\n");
goto init_priv_mem_out;
}
cfg_priv->iscan = kzalloc(sizeof(*cfg_priv->iscan), GFP_KERNEL);
- if (unlikely(!cfg_priv->iscan)) {
+ if (!cfg_priv->iscan) {
WL_ERR("Iscan buf alloc failed\n");
goto init_priv_mem_out;
}
cfg_priv->pmk_list = kzalloc(sizeof(*cfg_priv->pmk_list), GFP_KERNEL);
- if (unlikely(!cfg_priv->pmk_list)) {
+ if (!cfg_priv->pmk_list) {
WL_ERR("pmk list alloc failed\n");
goto init_priv_mem_out;
}
@@ -3191,7 +3188,7 @@ static struct brcmf_cfg80211_event_q *brcmf_deq_event(
struct brcmf_cfg80211_event_q *e = NULL;

spin_lock_irq(&cfg_priv->evt_q_lock);
- if (likely(!list_empty(&cfg_priv->evt_q_list))) {
+ if (!list_empty(&cfg_priv->evt_q_list)) {
e = list_first_entry(&cfg_priv->evt_q_list,
struct brcmf_cfg80211_event_q, evt_q_list);
list_del(&e->evt_q_list);
@@ -3213,7 +3210,7 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
s32 err = 0;

e = kzalloc(sizeof(struct brcmf_cfg80211_event_q), GFP_KERNEL);
- if (unlikely(!e)) {
+ if (!e) {
WL_ERR("event alloc failed\n");
return -ENOMEM;
}
@@ -3296,13 +3293,13 @@ static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
cfg_priv->dongle_up = false; /* dongle is not up yet */
brcmf_init_eq(cfg_priv);
err = brcmf_init_priv_mem(cfg_priv);
- if (unlikely(err))
+ if (err)
return err;
INIT_WORK(&cfg_priv->event_work, brcmf_cfg80211_event_handler);
brcmf_init_eloop_handler(&cfg_priv->el);
mutex_init(&cfg_priv->usr_sync);
err = brcmf_init_iscan(cfg_priv);
- if (unlikely(err))
+ if (err)
return err;
brcmf_init_conf(cfg_priv->conf);
brcmf_init_prof(cfg_priv->profile);
@@ -3331,12 +3328,12 @@ struct brcmf_cfg80211_dev *brcmf_cfg80211_attach(struct net_device *ndev,
struct brcmf_cfg80211_dev *cfg_dev;
s32 err = 0;

- if (unlikely(!ndev)) {
+ if (!ndev) {
WL_ERR("ndev is invalid\n");
return NULL;
}
cfg_dev = kzalloc(sizeof(struct brcmf_cfg80211_dev), GFP_KERNEL);
- if (unlikely(!cfg_dev)) {
+ if (!cfg_dev) {
WL_ERR("wl_cfg80211_dev is invalid\n");
return NULL;
}
@@ -3357,7 +3354,7 @@ struct brcmf_cfg80211_dev *brcmf_cfg80211_attach(struct net_device *ndev,
SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
wdev->netdev = ndev;
err = wl_init_priv(cfg_priv);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("Failed to init iwm_priv (%d)\n", err);
goto cfg80211_attach_out;
}
@@ -3390,7 +3387,7 @@ brcmf_cfg80211_event(struct net_device *ndev,
u32 event_type = be32_to_cpu(e->event_type);
struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);

- if (likely(!brcmf_enq_event(cfg_priv, event_type, e)))
+ if (!brcmf_enq_event(cfg_priv, event_type, e))
schedule_work(&cfg_priv->event_work);
}

@@ -3418,7 +3415,7 @@ static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype)
return err;
}
err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_SET_INFRA, &infra);
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_INFRA error (%d)\n", err);
return err;
}
@@ -3439,7 +3436,7 @@ static s32 brcmf_dongle_eventmsg(struct net_device *ndev)
brcmu_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("Get event_msgs error (%d)\n", err);
goto dongle_eventmsg_out;
}
@@ -3468,7 +3465,7 @@ static s32 brcmf_dongle_eventmsg(struct net_device *ndev)
brcmu_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("Set event_msgs error (%d)\n", err);
goto dongle_eventmsg_out;
}
@@ -3495,7 +3492,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
sizeof(bcn_timeout), iovbuf, sizeof(iovbuf));
err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("bcn_timeout error (%d)\n", err);
goto dongle_rom_out;
}
@@ -3509,7 +3506,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
brcmu_mkiovar("roam_off", (char *)&roamvar,
sizeof(roamvar), iovbuf, sizeof(iovbuf));
err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("roam_off error (%d)\n", err);
goto dongle_rom_out;
}
@@ -3518,7 +3515,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
roamtrigger[1] = BRCM_BAND_ALL;
err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_ROAM_TRIGGER,
(void *)roamtrigger, sizeof(roamtrigger));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_ROAM_TRIGGER error (%d)\n", err);
goto dongle_rom_out;
}
@@ -3527,7 +3524,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
roam_delta[1] = BRCM_BAND_ALL;
err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_ROAM_DELTA,
(void *)roam_delta, sizeof(roam_delta));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("WLC_SET_ROAM_DELTA error (%d)\n", err);
goto dongle_rom_out;
}
@@ -3584,7 +3581,7 @@ static s32 wl_update_wiphybands(struct brcmf_cfg80211_priv *cfg_priv)

err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCM_GET_PHYLIST,
&phy_list, sizeof(phy_list));
- if (unlikely(err)) {
+ if (err) {
WL_ERR("error (%d)\n", err);
return err;
}
@@ -3624,7 +3621,7 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_priv *cfg_priv,
WL_SCAN_UNASSOC_TIME, WL_SCAN_PASSIVE_TIME);

err = brcmf_dongle_eventmsg(ndev);
- if (unlikely(err))
+ if (err)
goto default_conf_out;

power_mode = cfg_priv->pwr_save ? PM_FAST : PM_OFF;
@@ -3636,13 +3633,13 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_priv *cfg_priv,

err = brcmf_dongle_roam(ndev, (cfg_priv->roam_on ? 0 : 1),
WL_BEACON_TIMEOUT);
- if (unlikely(err))
+ if (err)
goto default_conf_out;
err = brcmf_dongle_mode(ndev, wdev->iftype);
- if (unlikely(err && err != -EINPROGRESS))
+ if (err && err != -EINPROGRESS)
goto default_conf_out;
err = brcmf_dongle_probecap(cfg_priv);
- if (unlikely(err))
+ if (err)
goto default_conf_out;

/* -EINPROGRESS: Call commit handler */
@@ -3700,7 +3697,7 @@ static s32 __brcmf_cfg80211_up(struct brcmf_cfg80211_priv *cfg_priv)
brcmf_debugfs_add_netdev_params(cfg_priv);

err = brcmf_config_dongle(cfg_priv, false);
- if (unlikely(err))
+ if (err)
return err;

brcmf_invoke_iscan(cfg_priv);
@@ -3778,7 +3775,7 @@ static __used s32 brcmf_add_ie(struct brcmf_cfg80211_priv *cfg_priv,
struct brcmf_cfg80211_ie *ie = &cfg_priv->ie;
s32 err = 0;

- if (unlikely(ie->offset + l + 2 > WL_TLV_INFO_MAX)) {
+ if (ie->offset + l + 2 > WL_TLV_INFO_MAX) {
WL_ERR("ei crosses buffer boundary\n");
return -ENOSPC;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.c b/drivers/staging/brcm80211/brcmsmac/ampdu.c
index 47dc27a..d221a3a 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.c
@@ -1132,7 +1132,7 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
s2 = R_REG(&wlc->regs->frmtxstatus2);
}

- if (likely(scb)) {
+ if (scb) {
scb_ampdu = &scb->scb_ampdu;
ini = &scb_ampdu->ini[p->priority];
brcms_c_ampdu_dotxstatus_complete(ampdu, scb, p, txs, s1, s2);
--
1.7.1



2011-09-20 13:04:20

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Mon, Sep 19, 2011 at 02:25:48PM -0700, Franky Lin wrote:
> Code clean up for fullmac.

Ok, this is the 7th patch series since the last round of "how do we get
our driver into mainline" happened.

And while code is great and nice, I still haven't seen any real answers
to all of the questions that were asked of the Broadcom driver team
during that review by the linux-wireless developers about how things
will be handled properly due to the overlap in functionality with the
existing "real" driver in the tree.

So, can you please start answering these questions? I'm loath to keep
accepting patches until that all gets straightened out as it potentially
wastes my, and your, time by doing so.

In other words, I'm not going to apply any more patches until this gets
resolved. Consider this patchset dropped from my to-apply queue for now
because of that.

thanks,

greg k-h

2011-09-20 13:50:55

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/20 Johannes Berg <[email protected]>:
> I'm actually surprised that b43
> works as well as it does (which, tbh, isn't very well at all, at least
> for me with some 11n PHY).

Have you reported that to b43/me? What issue is that? Please report in
separated thread with some description&logs.

--
Rafał

2011-09-20 14:04:16

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Tue, Sep 20, 2011 at 09:22:03AM -0400, John W. Linville wrote:
> On Tue, Sep 20, 2011 at 06:03:38AM -0700, Greg KH wrote:
> > On Mon, Sep 19, 2011 at 02:25:48PM -0700, Franky Lin wrote:
> > > Code clean up for fullmac.
> >
> > Ok, this is the 7th patch series since the last round of "how do we get
> > our driver into mainline" happened.
> >
> > And while code is great and nice, I still haven't seen any real answers
> > to all of the questions that were asked of the Broadcom driver team
> > during that review by the linux-wireless developers about how things
> > will be handled properly due to the overlap in functionality with the
> > existing "real" driver in the tree.
> >
> > So, can you please start answering these questions? I'm loath to keep
> > accepting patches until that all gets straightened out as it potentially
> > wastes my, and your, time by doing so.
> >
> > In other words, I'm not going to apply any more patches until this gets
> > resolved. Consider this patchset dropped from my to-apply queue for now
> > because of that.
>
> I think most of the outstanding series from Broadcom are
> (almost?) exclusively for their fullmac driver, which has not overlap
> with b43. We should be moving forward toward getting the fullmac
> driver into wireless-next.

Ok, that's great, but again, no one from Broadcom has said what their
plans are, only sent lots of patches, which while wonderful, has caused
some confusion on my and other parts.

greg k-h

2011-09-20 13:30:35

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Tue, Sep 20, 2011 at 06:03:38AM -0700, Greg KH wrote:
> On Mon, Sep 19, 2011 at 02:25:48PM -0700, Franky Lin wrote:
> > Code clean up for fullmac.
>
> Ok, this is the 7th patch series since the last round of "how do we get
> our driver into mainline" happened.
>
> And while code is great and nice, I still haven't seen any real answers
> to all of the questions that were asked of the Broadcom driver team
> during that review by the linux-wireless developers about how things
> will be handled properly due to the overlap in functionality with the
> existing "real" driver in the tree.
>
> So, can you please start answering these questions? I'm loath to keep
> accepting patches until that all gets straightened out as it potentially
> wastes my, and your, time by doing so.
>
> In other words, I'm not going to apply any more patches until this gets
> resolved. Consider this patchset dropped from my to-apply queue for now
> because of that.

I think most of the outstanding series from Broadcom are
(almost?) exclusively for their fullmac driver, which has not overlap
with b43. We should be moving forward toward getting the fullmac
driver into wireless-next.

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2011-09-22 18:38:06

by Arend van Spriel

[permalink] [raw]
Subject: RE: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

> From: [email protected] [mailto:linux-wireless-
> [email protected]] On Behalf Of Christoph Hellwig
> Sent: donderdag 22 september 2011 16:31
> To: Brett Rudley
> Cc: Rafa?? Mi??ecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin;
> [email protected]; [email protected]; linux-
> [email protected]
> Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for
> mainline patch #2
>
> On Wed, Sep 21, 2011 at 03:12:02PM -0700, Brett Rudley wrote:
> > > > Our original plan was to remain a separate driver from b43. We
> were
> > > aware of it and all the good work that had been done to create it
> and we
> > > had no intention of interfering with it. ??At that point there had
> not
> > > been very much recent movement in b43 and it did not support any of
> our
> > > AXI based chips. ??We figured that ssb vs AXI was a good dividing
> line and
> > > there would be no conflict, and there wasn't initially.
> > >
> > > The first obvious problem is that there are SSB and BCMA (aka AXI)
> > > cards using N-PHY. That resulted in PHY code duplication between
> b43
> > > and brcmsmac. And since we already supported N-PHY in b43, adding
> bcma
> > > support automatically gave us BCM43224 and BCM43225 support. That
> of
> > > course means duplicated supported for the same hardware.
> >
> > Agree, when you created bcma, it did duplicate HW support already in
> brcmsmac. Why didn't you address that then?
>
> Because doing inside a driver is wrong. bcma is a separate bus layer
> and really must stay outside the driver. It can very reasonably argued
> that the same is true for the PHY support.

I am not disputing that the bcma bus driver was a good move, but there are
numerous chip devices out there with an internal bus of some sore and not
having a separate bus driver.

Regarding PHY support compared to a system bus on a chip is comparing
apples with pears. However, as said earlier we are not opposed to the
idea.

> Given the arguments from Johannes and other I think the only reasonable
> outcome here is to make sure the broadcom drivers share
>
> a) the bcma bus support (already done), and
> b) the phy layer
>
> and just make them the driver for the newer MAC revisions.

A BCMA bus driver and PHY layer does not give a wireless driver. Am I
missing something?

> (and stop those fight already, shh..)

I thought this was just an open and lively discussion ;-)

Gr. AvS


2011-09-22 13:39:51

by Arend van Spriel

[permalink] [raw]
Subject: RE: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

PiBGcm9tOiBKb25hcyBHb3Jza2kgW21haWx0bzpqb25hcy5nb3Jza2lAZ21haWwuY29tXQ0KPiBT
ZW50OiBkb25kZXJkYWcgMjIgc2VwdGVtYmVyIDIwMTEgMTI6MDgNCj4gVG86IEFyZW5kIFZhbiBT
cHJpZWwNCj4gQ2M6IE1pY2hhZWwgQsO8c2NoOyBCcmV0dCBSdWRsZXk7IFJhZmHFgiBNacWCZWNr
aTsgR3JlZyBLSDsgSm9obiBXLg0KPiBMaW52aWxsZTsgRnJhbmt5IChaaGVuaHVpKSBMaW47IGdy
ZWdraEBzdXNlLmRlOw0KPiBkZXZlbEBsaW51eGRyaXZlcnByb2plY3Qub3JnOyBsaW51eC13aXJl
bGVzc0B2Z2VyLmtlcm5lbC5vcmcNCj4gU3ViamVjdDogUmU6IFtQQVRDSCAwMC8yMF0gc3RhZ2lu
ZzogYnJjbTgwMjExOiA3dGggcmVhY3Rpb24gZm9yDQo+IG1haW5saW5lIHBhdGNoICMyDQo+IA0K
PiAyMDExLzkvMjIgQXJlbmQgVmFuIFNwcmllbCA8YXJlbmRAYnJvYWRjb20uY29tPjoNCj4gPj4g
RnJvbTogbGludXgtd2lyZWxlc3Mtb3duZXJAdmdlci5rZXJuZWwub3JnIFttYWlsdG86bGludXgt
d2lyZWxlc3MtDQo+ID4+IG93bmVyQHZnZXIua2VybmVsLm9yZ10gT24gQmVoYWxmIE9mIE1pY2hh
ZWwgQsO8c2NoDQo+ID4+IFNlbnQ6IGRvbmRlcmRhZyAyMiBzZXB0ZW1iZXIgMjAxMSAxOjI5DQo+
ID4+IFRvOiBCcmV0dCBSdWRsZXkNCj4gPj4gQ2M6IFJhZmHFgiBNacWCZWNraTsgR3JlZyBLSDsg
Sm9obiBXLiBMaW52aWxsZTsgRnJhbmt5IChaaGVuaHVpKSBMaW47DQo+ID4+IGdyZWdraEBzdXNl
LmRlOyBkZXZlbEBsaW51eGRyaXZlcnByb2plY3Qub3JnOyBsaW51eC0NCj4gPj4gd2lyZWxlc3NA
dmdlci5rZXJuZWwub3JnDQo+ID4+IFN1YmplY3Q6IFJlOiBbUEFUQ0ggMDAvMjBdIHN0YWdpbmc6
IGJyY204MDIxMTogN3RoIHJlYWN0aW9uIGZvcg0KPiA+PiBtYWlubGluZSBwYXRjaCAjMg0KPiA+
Pg0KPiA+PiBPbiBXZWQsIDIxIFNlcCAyMDExIDE2OjE1OjEwIC0wNzAwDQo+ID4+ICJCcmV0dCBS
dWRsZXkiIDxicnVkbGV5QGJyb2FkY29tLmNvbT4gd3JvdGU6DQo+ID4+DQo+ID4+ID4gV2UgZGlk
IGhvd2V2ZXIgaW5pdGlhbGx5IHByb3Bvc2UgKGFuZCBpbXBsZW1lbnQpIGEgZGl2aWRpbmcgbGlu
ZQ0KPiBvZg0KPiA+PiBzc2IgY2hpcHMgZm9yIGI0MyBhbmQgQVhJIGJhc2VkIGNoaXBzIGZvciBi
cmNtc21hYyBidXQgYjQzIHRlYW0NCj4gY2hvc2UNCj4gPj4gdG8gaWdub3JlL3JlamVjdCB0aGF0
Lg0KPiA+Pg0KPiA+PiBXZWxsLCB3aGF0IGFib3V0IGVtYmVkZGVkLCBmb3IgaW5zdGFuY2U/DQo+
ID4NCj4gPiBUaGUgYnJjbXNtYWMgZHJpdmVyIGhhcyBiZWVuIHRlc3RlZCBvbiBhIE1JUFMgcGxh
dGZvcm0gYnkgSm9uYXMNCj4gR29yc2tpDQo+ID4gYWx0aG91Z2ggb25seSBpbiBTVEEgbW9kZSAo
b24gYSBiY202M3h4KS4gTm90IGhhdmluZyBBUCBtb2RlIGhhcyBiZWVuDQo+ID4gZXhwbGFpbmVk
IGluIG90aGVyIGVtYWlscy4NCj4gDQo+IFRoaXMganVzdCBoYXBwZW5lZCB0byBiZSBhIE1JUFMs
IGJ1dCBhcGFydCBmcm9tIHRoYXQgaXQgd2FzIHN0aWxsIGENCj4gbW9zdGx5IHN0YW5kYXJkIGZh
cmUgUENJZSBjb25uZWN0ZWQgQkNNNDMxMywgbm8gbm90aGluZyByZWFsbHkNCj4gZW1iZWRkZWQu
IFdoYXQgTWljaGFlbCAoYW5kIEhhdWtlLCBhbmQgUmFmYWwpIGlzIHRhbGtpbmcgYWJvdXQgYXJl
DQo+IEJDTTQ3eHggU29DIHdoZXJlIEFNQkEvQVhJIGlzIHRoZSBTeXN0ZW0gQnVzLCBhbmQgdGhl
cmUgaXMgbm8gUENJKGUpDQo+IGF0IGFsbCAoZXhjZXB0IG1heWJlIGZvciBjb25uZWN0aW5nIGEg
L3NlY29uZC8gd2lmaSkuDQo+IA0KPiBUaGlzIHdhcyBvbmUgb2YgdGhlIG1haW4gbW90aXZhdGlv
bnMgb2YgdGhlIGJjbWEgZHJpdmVyLg0KDQpZZXMuIFRoYXQgaXMgY29ycmVjdC4gVGhleSBjb3Vs
ZCBvcHQgZm9yIGJyY21zbWFjK2JjbWEgZm9yIHRoYXQgb25jZQ0KdGhhdCBpcyBhZGRlZC4NCg0K
PiBSZWdhcmRzLA0KPiBKb25hcw0KPiANCj4gUC5TOiBXaGljaCByZW1pbmRzIG1lLCBkbyB5b3Ug
cGxhbiB0byAobm90KSBzdXBwb3J0IHRoZSBpbnRlZ3JhdGVkDQo+IHdpZmkgaW4gdGhlIEJDTTYz
NjI/IFRoaXMgb25lIHNlZW1zIHRvIGJlIG5laXRoZXIgYmNtYSBub3Igc3NiLCBidXQNCj4gaXQn
cyBkZWZpbml0ZWx5IEJyb2FkY29tIDspIChIYXZlbid0IGdvdHRlbiBteSBoYW5kcyB5ZXQgb24g
YSBkZXZpY2UNCj4gdGhvdWdoKS4NCg0KVGhlcmUgaXMgbm8gcGxhbiBvbiByZWNvcmQgZm9yIHRo
YXQuIEkgaGFkIGEgcXVpY2sgbG9vayBhbmQgaXQgaW5kZWVkDQppcyBhbm90aGVyIGZsYXZvciBv
ZiBzeXN0ZW0gYnVzLiBJIGRpZCBub3QgZmlndXJlIG91dCB5ZXQgaG93IHRvIGJ1aWxkDQphIHJv
dXRlciBpbWFnZSBhbmQgd2hpY2ggc291cmNlIGZpbGVzIHByb3ZpZGUgYnVzIGFjY2VzcyBmb3Ig
aXQuIEkgZG8NCm5vdCBoYXZlIGFjY2VzcyB0byBEU0wgc3R1ZmYgb3ZlciBoZXJlLg0KDQpHci4g
QXZTDQo=


2011-09-21 18:33:35

by Brett Rudley

[permalink] [raw]
Subject: RE: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

> On Tue, Sep 20, 2011 at 09:22:03AM -0400, John W. Linville wrote:
> > On Tue, Sep 20, 2011 at 06:03:38AM -0700, Greg KH wrote:
> > > On Mon, Sep 19, 2011 at 02:25:48PM -0700, Franky Lin wrote:
> > > > Code clean up for fullmac.
> > >
> > > Ok, this is the 7th patch series since the last round of "how do we
> get
> > > our driver into mainline" happened.
> > >
> > > And while code is great and nice, I still haven't seen any real
> answers
> > > to all of the questions that were asked of the Broadcom driver team
> > > during that review by the linux-wireless developers about how things
> > > will be handled properly due to the overlap in functionality with the
> > > existing "real" driver in the tree.
> > >
> > > So, can you please start answering these questions? I'm loath to
> keep
> > > accepting patches until that all gets straightened out as it
> potentially
> > > wastes my, and your, time by doing so.
> > >
> > > In other words, I'm not going to apply any more patches until this
> gets
> > > resolved. Consider this patchset dropped from my to-apply queue for
> now
> > > because of that.
> >
> > I think most of the outstanding series from Broadcom are
> > (almost?) exclusively for their fullmac driver, which has not overlap
> > with b43. We should be moving forward toward getting the fullmac
> > driver into wireless-next.
>
> Ok, that's great, but again, no one from Broadcom has said what their
> plans are, only sent lots of patches, which while wonderful, has caused
> some confusion on my and other parts.
>
> greg k-h

Our original plan was to remain a separate driver from b43. We were aware of it and all the good work that had been done to create it and we had no intention of interfering with it. At that point there had not been very much recent movement in b43 and it did not support any of our AXI based chips. We figured that ssb vs AXI was a good dividing line and there would be no conflict, and there wasn't initially.

Internally, prior to releasing to staging tree, development had gone quickly and it didn't take long at all to get the driver up and running. We did not anticipate that things would go somewhat slower in the staging tree and a year (and hundreds of patches) later we are still there. During that year b43 got some limited support for the same new chips brcmsmac already had, into its driver. So now, here we are... both drivers supporting the new chips and b43 also supporting the old.

We have seen the requests for us to add AXI based chipset support into b43. I don't think that will happen in a substantial way:
- Our driver is already stable and performance is better than b43 in terms of AXI chips. B43 seems quite raw: its full of TODO and FIXME notes and performance is 1/10th of brcmsmac on our testing. Spending another round of time and effort on b43 to get it to the place where smac already is, seems redundant and unattractive.

- Much of brcmsmac code comes from our internal source which has whole organizations charged with testing it for compliance, compatibility, performance, etc. We understand that that is of no direct consequence but since brcmsmac code is a direct descendent of that code, much of that background still applies. Switching to b43 would mean throwing all that infrastructure and testing away and going with a driver that has none of that (that I know of).

- Most of the recent b43 additions support comes from a single person doing reverse engineering. brcmsmac has a few software people working on it directly and hundreds of people working on it indirectly (through the internal version) including engineers working on firmware, RTL, testing, etc.

- B43 team has made the case several times that it has more features than brcmsmac. A reminder: We were specifically asked NOT to add features while in staging tree and we have held back on features to honor that request. AP, IBSS, 40 Mhz, using bcma, hw crypto and others, are all features we have been waiting to do. We also have a backlog of several new chips we want to add. And of course, we will would be adding future chips and features as they come out.

We invested a year trying to be good Linux citizens, laying out our initial plans, following the rules, working transparently, folding in feedback, submitting hundreds of patches in plain sight of everyone and now folks are asking about our plan. Our plan is get the brcmsmac and brcmfmac into mainline and keep following that up with new features, new chips and continuing support.

Other than barely supporting one of our chips first in mainline, I would really like to understand what are the benefits and justifications of using b43 over brcmsmac for AXI based chips in the long run. Can someone explain them?


Brett



2011-09-20 13:38:32

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Tue, Sep 20, 2011 at 03:21:14PM +0200, Johannes Berg wrote:

> Now, don't get me wrong -- I don't think the duplication is a good
> thing. A lot of the PHY code could be shared. However, I think it will
> probably not be possible for much longer to share the higher level MAC
> code that programs the SHM etc.

It would be nice to see some of this. I don't think anything is
stopping either Broadcom _or_ the b43 team from posting such patches.

> So I don't claim to know what the solution is, but I think simply
> rejecting the Broadcom effort like most people seem to imply is a good
> solution at all. It will leave all of us in a bad spot by creating a
> driver that has to support too many different devices.

I'm inclined to agree. Despite recent heroic efforts, b43 remains
behind in it's support for current features of Broadcom hardware.
As developers find other gainful interests, that gap is sure to widen
-- it certainly was quite wide just a few months ago.

As Johannes implies, it seems likely that newer Broadcom hardware will
need to be supported by a different/new driver anyway. Is there
some reason why that new driver needs to have a b43 pedigree?
If we want/expect Broadcom to support that new driver, is it so
unreasonable to allow them to start from the codebase they prefer?
I don't think it is.

Broadcom has come a long way in the wireless arena. I think we would
be better served by bringing them into the fold than by continuing
to demand what they don't feel able to provide.

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2011-09-22 09:08:12

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/22 Arend Van Spriel <[email protected]>:
>> From: [email protected] [mailto:linux-wireless-
>> [email protected]] On Behalf Of Hauke Mehrtens
>> Sent: donderdag 22 september 2011 8:47
>> To: Brett Rudley
>> Cc: Rafał Miłecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin;
>> [email protected]; [email protected]; linux-
>> [email protected]
>> Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for
>> mainline patch #2
>>
>> On 09/22/2011 12:12 AM, Brett Rudley wrote:
>> >>> Our original plan was to remain a separate driver from b43. We were
>> >> aware of it and all the good work that had been done to create it
>> and we
>> >> had no intention of interfering with it.  At that point there had
>> not
>> >> been very much recent movement in b43 and it did not support any of
>> our
>> >> AXI based chips.  We figured that ssb vs AXI was a good dividing
>> line and
>> >> there would be no conflict, and there wasn't initially.
>> >>
>> >> The first obvious problem is that there are SSB and BCMA (aka AXI)
>> >> cards using N-PHY. That resulted in PHY code duplication between b43
>> >> and brcmsmac. And since we already supported N-PHY in b43, adding
>> bcma
>> >> support automatically gave us BCM43224 and BCM43225 support. That of
>> >> course means duplicated supported for the same hardware.
>> >
>> > Agree, when you created bcma, it did duplicate HW support already in
>> brcmsmac.  Why didn't you address that then?
>>
>> bcma is not only used to support the bus on a pci based wireless cards
>> it now also contains support for SoCs like the BCM4718. There it
>> provides a common interface to the hardware for the wireless so that
>> there were no changes in b43 needed to get the wireless core running on
>> this SoC. It also provides some parts needed to get the SoC boot in
>> Linux and so on, some parts are related to the MIPS CPU and not related
>> to the wireless core, so it makes sense to put that into an own module.
>>
>> Hauke
>
> You are right. BCMA in itself only duplicates part of what is in brcmsmac
> and its existence provides good functional separation. That is why we fully
> intend to have brcmsmac use bcma. Brett meant that the duplication started
> when b43 was getting patches for bcma support.
>
> Rafał indicated that b43 team was working on n-phy support when we released
> the brcm80211 driver (aka brcmsmac). No one indicated this before so I can
> only assume that b43 decided to move on building bcma and have no interest
> in brcmsmac moving in the linux tree.

It's not really about seeing interest in that. I just don't see
advantages for us from this.

If we assume we will have the same level support in both drivers soon,
then what are the differences? brcmsmac seems to be preferred only
because Broadcom guys like it.

--
Rafał

2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 11/20] staging: brcm80211: remove fullmac module_param brcmf_idletime

Use constant for idle time setting.

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 1 +
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 5 +----
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 1e18ad0..7ca9172 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -808,5 +808,6 @@ extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg,
#define BRCMF_IDLE_IMMEDIATE (-1)
#define BRCMF_IDLE_ACTIVE 0 /* Do not request any SD clock change
when idle */
+#define BRCMF_IDLE_INTERVAL 1

#endif /* _BRCMF_H_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 4033e73..57049ec 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -747,9 +747,6 @@ module_param(brcmf_txbound, uint, 0);
module_param(brcmf_rxbound, uint, 0);
static uint brcmf_txminmax;

-int brcmf_idletime = 1;
-module_param(brcmf_idletime, int, 0);
-
#define SDIO_DRIVE_STRENGTH 6 /* in milliamps */

/* Use polling */
@@ -4650,7 +4647,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus)

/* ...and initialize clock/power states */
bus->clkstate = CLK_SDONLY;
- bus->idletime = (s32) brcmf_idletime;
+ bus->idletime = BRCMF_IDLE_INTERVAL;
bus->idleclock = BRCMF_IDLE_ACTIVE;

/* Query the F2 block size, set roundup accordingly */
--
1.7.1



2011-09-21 13:55:13

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

W dniu 21 września 2011 15:52 użytkownik Rafał Miłecki
<[email protected]> napisał:
> W dniu 21 września 2011 15:40 użytkownik John W. Linville
> <[email protected]> napisał:
>> On Tue, Sep 20, 2011 at 10:56:49PM +0200, Rafał Miłecki wrote:
>>> 2011/9/20 Johannes Berg <[email protected]>:
>>> > On Tue, 2011-09-20 at 06:03 -0700, Greg KH wrote:
>>> >
>>> >> And while code is great and nice, I still haven't seen any real answers
>>> >> to all of the questions that were asked of the Broadcom driver team
>>> >> during that review by the linux-wireless developers about how things
>>> >> will be handled properly due to the overlap in functionality with the
>>> >> existing "real" driver in the tree.
>>> >
>>> > Let's qualify this to "some developers".
>>> >
>>> > One thing I'd like to point out is that the Broadcom's firmware API has
>>> > always undergone changes over time. I'm actually surprised that b43
>>> > works as well as it does (which, tbh, isn't very well at all, at least
>>> > for me with some 11n PHY). I also don't think that Broadcom are going to
>>> > maintain compatibility and/or maintain new firmware features for old
>>> > devices, that just doesn't make any sense.
>>>
>>> Actually, when we got some single response from Broadcom about their
>>> relation to b43, they haven't mentioned support for old HW is any
>>> problem at all. They just pointed we don't support calibration for
>>> N-PHY and we don't support 802.11n feature for a better performance.
>>>
>>> I feel we're creating some problems ourself. Just some guessing that
>>> support for older HW can be real problem for future development... not
>>> confirmed by anyone at all.
>>
>> Their new firmware doesn't run on the older hardware, no?
>
> AFAIK it does (unless you mean hardware covered by b43legacy).
>
> If you take a look at 666.2 firmware, it's still available for core 5
> (and 9, 13, etc.)

The reason I've added support for new firmware without dropping
support for older, was users experience. I didn't want to leave anyone
with b43 not working after kernel update (without firmware update).

--
Rafał

2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 17/20] staging: brcm80211: clarified fullmac io and event codes

From: Roland Vossen <[email protected]>

Added comments to make code more readable.

Reported-by: Johannes Berg <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 4 ++++
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 5 +++++
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 2 ++
3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 7ca9172..7ab45d9 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -27,6 +27,9 @@
#define BRCMF_C_IOCTL_MEDLEN 1536 /* "med" ioctl buffer required */
#define BRCMF_C_IOCTL_MAXLEN 8192

+/*******************************************************************************
+ * IO codes that are interpreted by dongle firmware
+ ******************************************************************************/
#define BRCMF_C_UP 2
#define BRCMF_C_SET_PROMISC 10
#define BRCMF_C_GET_RATE 12
@@ -171,6 +174,7 @@ struct dngl_stats {
unsigned long multicast; /* multicast packets received */
};

+/* event codes sent by the dongle to this driver */
#define BRCMF_E_SET_SSID 0
#define BRCMF_E_JOIN 1
#define BRCMF_E_START 2
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 91b4d3c..4c171a3 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -14,6 +14,11 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

+/*******************************************************************************
+ * Communicates with the dongle by using Broadcom specific ioctl codes.
+ * For certain ioctl codes, the dongle interprets string data from the host.
+ ******************************************************************************/
+
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/sched.h>
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index d0ae2b6..45c9e78 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -14,6 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

+/* Toplevel file. Relies on dhd_linux.c to send ioctls to the dongle. */
+
#include <linux/kernel.h>
#include <linux/if_arp.h>
#include <linux/sched.h>
--
1.7.1



2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 06/20] staging: brcm80211: remove unconditional code blocks from brcmfmac

From: Arend van Spriel <[email protected]>

Using a block statement to scope function variables is not
common in linux kernel development. Browsed through the brcmfmac
to remove those.

Reported-by: Johannes Berg <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 132 +++++++++++-----------
1 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index c9bf92a..0c41c1c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -198,6 +198,11 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
BRCMF_E_PFN_SCAN_COMPLETE, "SCAN_COMPLETE"}
};
uint event_type, flags, auth_type, datalen;
+ static u32 seqnum_prev;
+ struct msgtrace_hdr hdr;
+ u32 nblost;
+ char *s, *p;
+
event_type = be32_to_cpu(event->event_type);
flags = be16_to_cpu(event->flags);
status = be32_to_cpu(event->status);
@@ -348,55 +353,52 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
break;

case BRCMF_E_TRACE:
- {
- static u32 seqnum_prev;
- struct msgtrace_hdr hdr;
- u32 nblost;
- char *s, *p;
-
- buf = (unsigned char *) event_data;
- memcpy(&hdr, buf, sizeof(struct msgtrace_hdr));
-
- if (hdr.version != MSGTRACE_VERSION) {
- brcmf_dbg(ERROR, "MACEVENT: %s [unsupported version --> brcmf version:%d dongle version:%d]\n",
- event_name,
- MSGTRACE_VERSION, hdr.version);
- /* Reset datalen to avoid display below */
- datalen = 0;
- break;
- }
-
- /* There are 2 bytes available at the end of data */
- *(buf + sizeof(struct msgtrace_hdr)
- + be16_to_cpu(hdr.len)) = '\0';
-
- if (be32_to_cpu(hdr.discarded_bytes)
- || be32_to_cpu(hdr.discarded_printf))
- brcmf_dbg(ERROR, "WLC_E_TRACE: [Discarded traces in dongle --> discarded_bytes %d discarded_printf %d]\n",
- be32_to_cpu(hdr.discarded_bytes),
- be32_to_cpu(hdr.discarded_printf));
-
- nblost = be32_to_cpu(hdr.seqnum) - seqnum_prev - 1;
- if (nblost > 0)
- brcmf_dbg(ERROR, "WLC_E_TRACE: [Event lost --> seqnum %d nblost %d\n",
- be32_to_cpu(hdr.seqnum), nblost);
- seqnum_prev = be32_to_cpu(hdr.seqnum);
-
- /* Display the trace buffer. Advance from \n to \n to
- * avoid display big
- * printf (issue with Linux printk )
- */
- p = (char *)&buf[sizeof(struct msgtrace_hdr)];
- while ((s = strstr(p, "\n")) != NULL) {
- *s = '\0';
- printk(KERN_DEBUG"%s\n", p);
- p = s + 1;
- }
- printk(KERN_DEBUG "%s\n", p);
+ buf = (unsigned char *) event_data;
+ memcpy(&hdr, buf, sizeof(struct msgtrace_hdr));

+ if (hdr.version != MSGTRACE_VERSION) {
+ brcmf_dbg(ERROR,
+ "MACEVENT: %s [unsupported version --> brcmf"
+ " version:%d dongle version:%d]\n",
+ event_name, MSGTRACE_VERSION, hdr.version);
/* Reset datalen to avoid display below */
datalen = 0;
+ break;
+ }
+
+ /* There are 2 bytes available at the end of data */
+ *(buf + sizeof(struct msgtrace_hdr)
+ + be16_to_cpu(hdr.len)) = '\0';
+
+ if (be32_to_cpu(hdr.discarded_bytes)
+ || be32_to_cpu(hdr.discarded_printf))
+ brcmf_dbg(ERROR,
+ "WLC_E_TRACE: [Discarded traces in dongle -->"
+ " discarded_bytes %d discarded_printf %d]\n",
+ be32_to_cpu(hdr.discarded_bytes),
+ be32_to_cpu(hdr.discarded_printf));
+
+ nblost = be32_to_cpu(hdr.seqnum) - seqnum_prev - 1;
+ if (nblost > 0)
+ brcmf_dbg(ERROR, "WLC_E_TRACE: [Event lost --> seqnum "
+ " %d nblost %d\n", be32_to_cpu(hdr.seqnum),
+ nblost);
+ seqnum_prev = be32_to_cpu(hdr.seqnum);
+
+ /* Display the trace buffer. Advance from \n to \n to
+ * avoid display big
+ * printf (issue with Linux printk )
+ */
+ p = (char *)&buf[sizeof(struct msgtrace_hdr)];
+ while ((s = strstr(p, "\n")) != NULL) {
+ *s = '\0';
+ printk(KERN_DEBUG"%s\n", p);
+ p = s + 1;
}
+ printk(KERN_DEBUG "%s\n", p);
+
+ /* Reset datalen to avoid display below */
+ datalen = 0;
break;

case BRCMF_E_RSSI:
@@ -405,8 +407,9 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
break;

default:
- brcmf_dbg(EVENT, "MACEVENT: %s %d, MAC %s, status %d, reason %d, auth %d\n",
- event_name, event_type, eabuf,
+ brcmf_dbg(EVENT,
+ "MACEVENT: %s %d, MAC %s, status %d, reason %d, "
+ "auth %d\n", event_name, event_type, eabuf,
(int)status, (int)reason, (int)auth_type);
break;
}
@@ -428,6 +431,7 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
{
/* check whether packet is a BRCM event pkt */
struct brcmf_event *pvt_data = (struct brcmf_event *) pktdata;
+ struct brcmf_if_event *ifevent;
char *event_data;
u32 type, status;
u16 flags;
@@ -459,26 +463,22 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,

switch (type) {
case BRCMF_E_IF:
- {
- struct brcmf_if_event *ifevent =
- (struct brcmf_if_event *) event_data;
- brcmf_dbg(TRACE, "if event\n");
-
- if (ifevent->ifidx > 0 &&
- ifevent->ifidx < BRCMF_MAX_IFS) {
- if (ifevent->action == BRCMF_E_IF_ADD)
- brcmf_add_if(drvr_priv, ifevent->ifidx,
- NULL, event->ifname,
- pvt_data->eth.h_dest,
- ifevent->flags,
- ifevent->bssidx);
- else
- brcmf_del_if(drvr_priv, ifevent->ifidx);
- } else {
- brcmf_dbg(ERROR, "Invalid ifidx %d for %s\n",
- ifevent->ifidx, event->ifname);
- }
+ ifevent = (struct brcmf_if_event *) event_data;
+ brcmf_dbg(TRACE, "if event\n");
+
+ if (ifevent->ifidx > 0 && ifevent->ifidx < BRCMF_MAX_IFS) {
+ if (ifevent->action == BRCMF_E_IF_ADD)
+ brcmf_add_if(drvr_priv, ifevent->ifidx, NULL,
+ event->ifname,
+ pvt_data->eth.h_dest,
+ ifevent->flags, ifevent->bssidx);
+ else
+ brcmf_del_if(drvr_priv, ifevent->ifidx);
+ } else {
+ brcmf_dbg(ERROR, "Invalid ifidx %d for %s\n",
+ ifevent->ifidx, event->ifname);
}
+
/* send up the if event: btamp user needs it */
*ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
break;
--
1.7.1



2011-09-20 00:04:21

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero

On Mon, 2011-09-19 at 14:26 -0700, Franky Lin wrote:
> Both community and Broadcom patches introduced checkpatch warnings.
> ---
> diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
> index 1cbdb80..bff5066 100644
> --- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
> +++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
> @@ -96,7 +96,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
> (sdiodev->func[2]);
> if (err_ret)
> brcmf_dbg(ERROR,
> - "enable F2 failed:%d\n",
> + "enable F2 "
> + "failed:%d\n",

Just about all of this patch is not good.

Splitting format strings is poor style, makes
error messages difficult to find via grep and
is error prone.

You should update your checkpatch version.
Current checkpatch doesn't warn about this.

It'd be better if you could find some way
to reduce the 6 tab indentation rather than
split 20 char format strings into pieces.

> @@ -105,7 +106,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
> - "Disable F2 failed:%d\n",
> + "Disable F2 "
> + "failed:%d\n",

etc.



2011-09-19 21:26:33

by Franky Lin

[permalink] [raw]
Subject: [PATCH 10/20] staging: brcm80211: remove fullmac module_param for watchdog

Use constant to replace global variable used for watchdog polling

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 6 ++--
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 45 +++++++++---------------
3 files changed, 21 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index d9d1592..5906337 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -375,7 +375,7 @@ void brcmf_sdio_unregister(void)
void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev, bool enable)
{
if (enable)
- brcmf_sdbrcm_wd_timer(sdiodev->bus, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(sdiodev->bus, BRCMF_WD_POLL_MS);
else
brcmf_sdbrcm_wd_timer(sdiodev->bus, 0);
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index d02cb10..104c0e7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -20,6 +20,9 @@
/* Packet alignment for most efficient SDIO (can change based on platform) */
#define BRCMF_SDALIGN (1 << 6)

+/* watchdog polling interval in ms */
+#define BRCMF_WD_POLL_MS 10
+
/*
* Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
*/
@@ -28,9 +31,6 @@
extern uint brcmf_txbound;
extern uint brcmf_rxbound;

-/* Watchdog timer interval */
-extern uint brcmf_watchdog_ms;
-
/* Indicate (dis)interest in finding dongles. */
extern int brcmf_bus_register(void);
extern void brcmf_bus_unregister(void);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 53de5a7..4033e73 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -612,6 +612,7 @@ struct brcmf_bus {
uint pollcnt; /* Count of active polls */

#ifdef BCMDBG
+ uint console_interval;
struct brcmf_console console; /* Console output polling support */
uint console_addr; /* Console address from shared struct */
#endif /* BCMDBG */
@@ -735,20 +736,10 @@ static int tx_packets[NUMPRIO];
int brcmf_watchdog_prio = 97;
module_param(brcmf_watchdog_prio, int, 0);

-/* Watchdog interval */
-uint brcmf_watchdog_ms = 10;
-module_param(brcmf_watchdog_ms, uint, 0);
-
/* DPC thread priority, -1 to use tasklet */
int brcmf_dpc_prio = 98;
module_param(brcmf_dpc_prio, int, 0);

-#ifdef BCMDBG
-/* Console poll interval */
-uint brcmf_console_ms;
-module_param(brcmf_console_ms, uint, 0);
-#endif /* BCMDBG */
-
/* Tx/Rx bounds */
uint brcmf_txbound;
uint brcmf_rxbound;
@@ -1023,7 +1014,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
/* Early exit if we're already there */
if (bus->clkstate == target) {
if (target == CLK_AVAIL) {
- brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
bus->activity = true;
}
return 0;
@@ -1036,7 +1027,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
brcmf_sdbrcm_sdclk(bus, true);
/* Now request HT Avail on the backplane */
brcmf_sdbrcm_htclk(bus, true, pendok);
- brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
bus->activity = true;
break;

@@ -1049,7 +1040,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
else
brcmf_dbg(ERROR, "request for %d -> %d\n",
bus->clkstate, target);
- brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
break;

case CLK_NONE:
@@ -4038,7 +4029,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)

/* Start the watchdog timer */
bus->drvr->tickcnt = 0;
- brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);

if (enforce_mutex)
brcmf_sdbrcm_sdlock(bus);
@@ -4207,15 +4198,15 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
}
#ifdef BCMDBG
/* Poll for console output periodically */
- if (drvr->busstate == BRCMF_BUS_DATA && brcmf_console_ms != 0) {
- bus->console.count += brcmf_watchdog_ms;
- if (bus->console.count >= brcmf_console_ms) {
- bus->console.count -= brcmf_console_ms;
+ if (drvr->busstate == BRCMF_BUS_DATA && bus->console_interval != 0) {
+ bus->console.count += BRCMF_WD_POLL_MS;
+ if (bus->console.count >= bus->console_interval) {
+ bus->console.count -= bus->console_interval;
/* Make sure backplane clock is on */
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
if (brcmf_sdbrcm_readconsole(bus) < 0)
- brcmf_console_ms = 0; /* On error,
- stop trying */
+ /* stop on error */
+ bus->console_interval = 0;
}
}
#endif /* BCMDBG */
@@ -4226,7 +4217,7 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
bus->idlecount = 0;
if (bus->activity) {
bus->activity = false;
- brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
} else {
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
}
@@ -4723,7 +4714,7 @@ brcmf_sdbrcm_watchdog(unsigned long data)

/* Reschedule the watchdog */
if (bus->wd_timer_valid)
- mod_timer(&bus->timer, jiffies + brcmf_watchdog_ms * HZ / 1000);
+ mod_timer(&bus->timer, jiffies + BRCMF_WD_POLL_MS * HZ / 1000);
}

static void
@@ -5017,7 +5008,7 @@ int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
brcmf_dbg(ERROR, "Set DEVRESET=false invoked when device is on\n");
bcmerror = -EIO;
}
- brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
}
return bcmerror;
}
@@ -5038,9 +5029,7 @@ brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick)
}

if (wdtick) {
- brcmf_watchdog_ms = (uint) wdtick;
-
- if (bus->save_ms != brcmf_watchdog_ms) {
+ if (bus->save_ms != BRCMF_WD_POLL_MS) {
if (bus->wd_timer_valid == true)
/* Stop timer and restart at new value */
del_timer_sync(&bus->timer);
@@ -5049,13 +5038,13 @@ brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick)
dynamically changed or in the first instance
*/
bus->timer.expires =
- jiffies + brcmf_watchdog_ms * HZ / 1000;
+ jiffies + BRCMF_WD_POLL_MS * HZ / 1000;
add_timer(&bus->timer);

} else {
/* Re arm the timer, at last watchdog period */
mod_timer(&bus->timer,
- jiffies + brcmf_watchdog_ms * HZ / 1000);
+ jiffies + BRCMF_WD_POLL_MS * HZ / 1000);
}

bus->wd_timer_valid = true;
--
1.7.1



2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 09/20] staging: brcm80211: remove fullmac module_param brcmf_sdiod_drive_strength

Replaced the global variable with constant

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 7090a36..53de5a7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -759,9 +759,7 @@ static uint brcmf_txminmax;
int brcmf_idletime = 1;
module_param(brcmf_idletime, int, 0);

-/* SDIO Drive Strength (in milliamps) */
-uint brcmf_sdiod_drive_strength = 6;
-module_param(brcmf_sdiod_drive_strength, uint, 0);
+#define SDIO_DRIVE_STRENGTH 6 /* in milliamps */

/* Use polling */
uint brcmf_poll;
@@ -4607,7 +4605,7 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, u32 regsva)
goto fail;
}

- brcmf_sdbrcm_sdiod_drive_strength_init(bus, brcmf_sdiod_drive_strength);
+ brcmf_sdbrcm_sdiod_drive_strength_init(bus, SDIO_DRIVE_STRENGTH);

/* Get info on the ARM and SOCRAM cores... */
brcmf_sdcard_reg_read(bus->sdiodev,
--
1.7.1



2011-09-22 02:08:12

by Brett Rudley

[permalink] [raw]
Subject: RE: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

>
> > We did however initially propose (and implement) a dividing line of ssb
> chips for b43 and AXI based chips for brcmsmac but b43 team chose to
> ignore/reject that.
>
> Well, what about embedded, for instance?

I was referring to smac. There isn't any controversy over fmac AFAIK.

Brett


2011-09-21 13:45:39

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Tue, Sep 20, 2011 at 10:56:49PM +0200, Rafał Miłecki wrote:
> 2011/9/20 Johannes Berg <[email protected]>:
> > On Tue, 2011-09-20 at 06:03 -0700, Greg KH wrote:
> >
> >> And while code is great and nice, I still haven't seen any real answers
> >> to all of the questions that were asked of the Broadcom driver team
> >> during that review by the linux-wireless developers about how things
> >> will be handled properly due to the overlap in functionality with the
> >> existing "real" driver in the tree.
> >
> > Let's qualify this to "some developers".
> >
> > One thing I'd like to point out is that the Broadcom's firmware API has
> > always undergone changes over time. I'm actually surprised that b43
> > works as well as it does (which, tbh, isn't very well at all, at least
> > for me with some 11n PHY). I also don't think that Broadcom are going to
> > maintain compatibility and/or maintain new firmware features for old
> > devices, that just doesn't make any sense.
>
> Actually, when we got some single response from Broadcom about their
> relation to b43, they haven't mentioned support for old HW is any
> problem at all. They just pointed we don't support calibration for
> N-PHY and we don't support 802.11n feature for a better performance.
>
> I feel we're creating some problems ourself. Just some guessing that
> support for older HW can be real problem for future development... not
> confirmed by anyone at all.

Their new firmware doesn't run on the older hardware, no?

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2011-09-20 13:45:20

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/20 John W. Linville <[email protected]>:
> On Tue, Sep 20, 2011 at 03:21:14PM +0200, Johannes Berg wrote:
>
>> Now, don't get me wrong -- I don't think the duplication is a good
>> thing. A lot of the PHY code could be shared. However, I think it will
>> probably not be possible for much longer to share the higher level MAC
>> code that programs the SHM etc.
>
> It would be nice to see some of this.  I don't think anything is
> stopping either Broadcom _or_ the b43 team from posting such patches.
>
>> So I don't claim to know what the solution is, but I think simply
>> rejecting the Broadcom effort like most people seem to imply is a good
>> solution at all. It will leave all of us in a bad spot by creating a
>> driver that has to support too many different devices.
>
> I'm inclined to agree.  Despite recent heroic efforts, b43 remains
> behind in it's support for current features of Broadcom hardware.
> As developers find other gainful interests, that gap is sure to widen
> -- it certainly was quite wide just a few months ago.

And brcmsmac stays behind b43 if you count feature different than
performance. Monitor, RFKILL, Ad-hoc, AP, hw crypt, supported PHYs,
etc.

And what if Broadcom decides to abound their brcm80211 project?

I vote for working together, I can not see a better solution.


> As Johannes implies, it seems likely that newer Broadcom hardware will
> need to be supported by a different/new driver anyway.  Is there
> some reason why that new driver needs to have a b43 pedigree?
> If we want/expect Broadcom to support that new driver, is it so
> unreasonable to allow them to start from the codebase they prefer?
> I don't think it is.

We still don't have any clue, when is that going to happen.


> Broadcom has come a long way in the wireless arena.  I think we would
> be better served by bringing them into the fold than by continuing
> to demand what they don't feel able to provide.

That's why I asked so many times already to discuss future with them.

--
Rafał

2011-09-22 10:30:37

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Thu, 22 Sep 2011 11:44:35 +0200
Johannes Berg <[email protected]> wrote:

> I agree that would be nice. However, I don't think that it should be
> required for brcmsmac to get into mainline, nor do I think that there
> should be a big rearchitecture for this. In fact, brcmsmac has a PHY
> abstraction layer that looks perfectly usable to me. b43 has one too,
> but it's nowhere near as fleshed out for all corner cases afaict.
>
> Really the more important issue is support though. Rafal by himself
> cannot possibly provide the level of support we're hoping to see from
> Broadcom who I expect will eventually ship this driver to their
> customers and support it, just like they do now with the driver it is
> derived from.
>
> Overall, the way I see it this really is a no-brainer. I really don't
> see why we're even discussing this so much.
> brcmsmac should be accepted into mainline as soon as possible (and I
> think all the recent patchsets go a long way). After that, the Broadcom
> team can easily port it to bcma, I expect that would happen within a few
> weeks. Adding features to it should be fairly simple too, and go much
> faster than adding any features to b43. (*)

I fully agree with all of that.

It is time to merge the stuff into mainline. There really is no other option.

> b43 is really my child too. I spent a very long time on the reverse
> engineering. But let's let it "die" peacefully.

We all put a lot of effort into b43, but that does not imply that we have
to beat the dead horse.

b43 has to become a second b43legacy. Which means it must go into maintenance-only mode.
Features should probably be removed, too. But that has to be done after
mainlining of brcmsmac.

Completely dropping either of b43 or brcmsmac is not an option. So, Rafal, you can still
continue to work on b43. There are _lots_ of bugs and issues to fix/improve.
If you need/want some older b43 devices, I can certainly donate some of mine to you. (I have
at least piece one of any flavor of supported 802.11g devices in stock).

--
Greetings, Michael.

2011-09-22 10:39:09

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Thu, 22 Sep 2011 11:08:11 +0200
Rafał Miłecki <[email protected]> wrote:

> If we assume we will have the same level support in both drivers soon,
> then what are the differences? brcmsmac seems to be preferred only
> because Broadcom guys like it.

Guys, can we _please_ get back to a technical discussion?

--
Greetings, Michael.

2011-09-21 14:39:51

by Larry Finger

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On 09/21/2011 08:55 AM, Rafał Miłecki wrote:
> W dniu 21 września 2011 15:52 użytkownik Rafał Miłecki
> <[email protected]> napisał:
>> W dniu 21 września 2011 15:40 użytkownik John W. Linville
>> <[email protected]> napisał:
>>>
>>> Their new firmware doesn't run on the older hardware, no?
>>
>> AFAIK it does (unless you mean hardware covered by b43legacy).
>>
>> If you take a look at 666.2 firmware, it's still available for core 5
>> (and 9, 13, etc.)
>
> The reason I've added support for new firmware without dropping
> support for older, was users experience. I didn't want to leave anyone
> with b43 not working after kernel update (without firmware update).

That is the correct thing to do. As I see it, this firmware change is a lot less
intrusive than the changes that led to the b43/b43legacy split, where keeping
the old version working took a lot of bookkeeping.

Perhaps in 2 or 3 years, we might want to deprecate the older firmware and force
users to go to the newest style, but there is no rush.

Larry



2011-09-22 14:31:19

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Wed, Sep 21, 2011 at 03:12:02PM -0700, Brett Rudley wrote:
> > > Our original plan was to remain a separate driver from b43. We were
> > aware of it and all the good work that had been done to create it and we
> > had no intention of interfering with it. ??At that point there had not
> > been very much recent movement in b43 and it did not support any of our
> > AXI based chips. ??We figured that ssb vs AXI was a good dividing line and
> > there would be no conflict, and there wasn't initially.
> >
> > The first obvious problem is that there are SSB and BCMA (aka AXI)
> > cards using N-PHY. That resulted in PHY code duplication between b43
> > and brcmsmac. And since we already supported N-PHY in b43, adding bcma
> > support automatically gave us BCM43224 and BCM43225 support. That of
> > course means duplicated supported for the same hardware.
>
> Agree, when you created bcma, it did duplicate HW support already in brcmsmac. Why didn't you address that then?

Because doing inside a driver is wrong. bcma is a separate bus layer
and really must stay outside the driver. It can very reasonably argued
that the same is true for the PHY support.

Given the arguments from Johannes and other I think the only reasonable
outcome here is to make sure the broadcom drivers share

a) the bcma bus support (already done), and
b) the phy layer

and just make them the driver for the newer MAC revisions.

(and stop those fight already, shh..)


2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 05/20] staging: brcm80211: more fullmac sparse endianness scan related changes

From: Roland Vossen <[email protected]>

Annotated endianness on structures send/received to/from dongle.

Reported-by: Johannes Berg <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 25 +++++++--
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 64 +++++++++++-----------
2 files changed, 52 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index c368f71..1e18ad0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -469,6 +469,13 @@ struct brcmf_scan_results {
struct brcmf_bss_info bss_info[1];
};

+struct brcmf_scan_results_le {
+ __le32 buflen;
+ __le32 version;
+ __le32 count;
+ struct brcmf_bss_info bss_info[1];
+};
+
/* used for association with a specific BSSID and chanspec list */
struct brcmf_assoc_params_le {
/* 00:00:00:00:00:00: broadcast scan */
@@ -492,8 +499,14 @@ struct brcmf_join_params {

/* incremental scan results struct */
struct brcmf_iscan_results {
- u32 status;
- struct brcmf_scan_results results;
+ union {
+ u32 status;
+ __le32 status_le;
+ };
+ union {
+ struct brcmf_scan_results results;
+ struct brcmf_scan_results_le results_le;
+ };
};

/* size of brcmf_iscan_results not including variable length array */
@@ -549,10 +562,10 @@ struct brcmf_scb_val_le {
};

/* channel encoding */
-struct brcmf_channel_info {
- int hw_channel;
- int target_channel;
- int scan_channel;
+struct brcmf_channel_info_le {
+ __le32 hw_channel;
+ __le32 target_channel;
+ __le32 scan_channel;
};

/* Linux network driver ioctl encoding */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index b4befec..5e86e21 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -2201,18 +2201,20 @@ brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan, u32 *status,
{
struct brcmf_iscan_results list;
struct brcmf_scan_results *results;
+ struct brcmf_scan_results_le *results_le;
struct brcmf_iscan_results *list_buf;
s32 err = 0;

memset(iscan->scan_buf, 0, WL_ISCAN_BUF_MAX);
list_buf = (struct brcmf_iscan_results *)iscan->scan_buf;
results = &list_buf->results;
+ results_le = &list_buf->results_le;
results->buflen = BRCMF_ISCAN_RESULTS_FIXED_SIZE;
results->version = 0;
results->count = 0;

memset(&list, 0, sizeof(list));
- list.results.buflen = cpu_to_le32(WL_ISCAN_BUF_MAX);
+ list.results_le.buflen = cpu_to_le32(WL_ISCAN_BUF_MAX);
err = brcmf_dev_iovar_getbuf(iscan->dev, "iscanresults", &list,
BRCMF_ISCAN_RESULTS_FIXED_SIZE, iscan->scan_buf,
WL_ISCAN_BUF_MAX);
@@ -2220,12 +2222,12 @@ brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan, u32 *status,
WL_ERR("error (%d)\n", err);
return err;
}
- results->buflen = le32_to_cpu(results->buflen);
- results->version = le32_to_cpu(results->version);
- results->count = le32_to_cpu(results->count);
- WL_SCAN("results->count = %d\n", results->count);
- WL_SCAN("results->buflen = %d\n", results->buflen);
- *status = le32_to_cpu(list_buf->status);
+ results->buflen = le32_to_cpu(results_le->buflen);
+ results->version = le32_to_cpu(results_le->version);
+ results->count = le32_to_cpu(results_le->count);
+ WL_SCAN("results->count = %d\n", results_le->count);
+ WL_SCAN("results->buflen = %d\n", results_le->buflen);
+ *status = le32_to_cpu(list_buf->status_le);
WL_SCAN("status = %d\n", *status);
*bss_list = results;

@@ -2848,11 +2850,12 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_priv *cfg_priv,
{
struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg_priv);
struct wiphy *wiphy = cfg_to_wiphy(cfg_priv);
- struct brcmf_channel_info channel;
+ struct brcmf_channel_info_le channel_le;
struct ieee80211_channel *notify_channel;
struct ieee80211_supported_band *band;
u32 freq;
s32 err = 0;
+ u32 target_channel;

WL_TRACE("Enter\n");

@@ -2860,18 +2863,18 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_priv *cfg_priv,
brcmf_update_prof(cfg_priv, NULL, &e->addr, WL_PROF_BSSID);
brcmf_update_bss_info(cfg_priv);

- brcmf_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel, sizeof(channel));
+ brcmf_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel_le,
+ sizeof(channel_le));

- channel.target_channel = le32_to_cpu(channel.target_channel);
- WL_CONN("Roamed to channel %d\n", channel.target_channel);
+ target_channel = le32_to_cpu(channel_le.target_channel);
+ WL_CONN("Roamed to channel %d\n", target_channel);

- if (channel.target_channel <= CH_MAX_2G_CHANNEL)
+ if (target_channel <= CH_MAX_2G_CHANNEL)
band = wiphy->bands[IEEE80211_BAND_2GHZ];
else
band = wiphy->bands[IEEE80211_BAND_5GHZ];

- freq = ieee80211_channel_to_frequency(channel.target_channel,
- band->band);
+ freq = ieee80211_channel_to_frequency(target_channel, band->band);
notify_channel = ieee80211_get_channel(wiphy, freq);

cfg80211_roamed(ndev, notify_channel,
@@ -3011,11 +3014,12 @@ brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,
struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
- struct brcmf_channel_info channel_inform;
- struct brcmf_scan_results *bss_list;
+ struct brcmf_channel_info_le channel_inform_le;
+ struct brcmf_scan_results_le *bss_list_le;
u32 len = WL_SCAN_BUF_MAX;
s32 err = 0;
bool scan_abort = false;
+ u32 scan_channel;

WL_TRACE("Enter\n");

@@ -3032,34 +3036,32 @@ brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,
goto scan_done_out;
}

- err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel_inform,
- sizeof(channel_inform));
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel_inform_le,
+ sizeof(channel_inform_le));
if (unlikely(err)) {
WL_ERR("scan busy (%d)\n", err);
scan_abort = true;
goto scan_done_out;
}
- channel_inform.scan_channel = le32_to_cpu(channel_inform.scan_channel);
- if (unlikely(channel_inform.scan_channel)) {
-
- WL_CONN("channel_inform.scan_channel (%d)\n",
- channel_inform.scan_channel);
- }
+ scan_channel = le32_to_cpu(channel_inform_le.scan_channel);
+ if (unlikely(scan_channel))
+ WL_CONN("channel_inform.scan_channel (%d)\n", scan_channel);
cfg_priv->bss_list = cfg_priv->scan_results;
- bss_list = cfg_priv->bss_list;
- memset(bss_list, 0, len);
- bss_list->buflen = cpu_to_le32(len);
+ bss_list_le = (struct brcmf_scan_results_le *) cfg_priv->bss_list;

- err = brcmf_dev_ioctl(ndev, BRCMF_C_SCAN_RESULTS, bss_list, len);
+ memset(cfg_priv->scan_results, 0, len);
+ bss_list_le->buflen = cpu_to_le32(len);
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SCAN_RESULTS,
+ cfg_priv->scan_results, len);
if (unlikely(err)) {
WL_ERR("%s Scan_results error (%d)\n", ndev->name, err);
err = -EINVAL;
scan_abort = true;
goto scan_done_out;
}
- bss_list->buflen = le32_to_cpu(bss_list->buflen);
- bss_list->version = le32_to_cpu(bss_list->version);
- bss_list->count = le32_to_cpu(bss_list->count);
+ cfg_priv->scan_results->buflen = le32_to_cpu(bss_list_le->buflen);
+ cfg_priv->scan_results->version = le32_to_cpu(bss_list_le->version);
+ cfg_priv->scan_results->count = le32_to_cpu(bss_list_le->count);

err = brcmf_inform_bss(cfg_priv);
if (err) {
--
1.7.1



2011-09-20 20:57:15

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/20 Johannes Berg <[email protected]>:
> On Tue, 2011-09-20 at 06:03 -0700, Greg KH wrote:
>
>> And while code is great and nice, I still haven't seen any real answers
>> to all of the questions that were asked of the Broadcom driver team
>> during that review by the linux-wireless developers about how things
>> will be handled properly due to the overlap in functionality with the
>> existing "real" driver in the tree.
>
> Let's qualify this to "some developers".
>
> One thing I'd like to point out is that the Broadcom's firmware API has
> always undergone changes over time. I'm actually surprised that b43
> works as well as it does (which, tbh, isn't very well at all, at least
> for me with some 11n PHY). I also don't think that Broadcom are going to
> maintain compatibility and/or maintain new firmware features for old
> devices, that just doesn't make any sense.

Actually, when we got some single response from Broadcom about their
relation to b43, they haven't mentioned support for old HW is any
problem at all. They just pointed we don't support calibration for
N-PHY and we don't support 802.11n feature for a better performance.

I feel we're creating some problems ourself. Just some guessing that
support for older HW can be real problem for future development... not
confirmed by anyone at all.

--
Rafał

2011-09-20 01:13:04

by Franky Lin

[permalink] [raw]
Subject: Re: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero

On 09/19/2011 05:59 PM, Joe Perches wrote:
> On Mon, 2011-09-19 at 17:04 -0700, Joe Perches wrote:
>> It'd be better if you could find some way
>> to reduce the 6 tab indentation rather than
>> split 20 char format strings into pieces.
>
> Perhaps something like this:
>
> drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 112 ++++++++++-----------
> 1 files changed, 54 insertions(+), 58 deletions(-)

Indeed we have too many levels of indentations in some functions of
fullmac. Will clean that up.

Thanks,
Franky


2011-09-21 20:01:49

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/21 Brett Rudley <[email protected]>:
>> On Tue, Sep 20, 2011 at 09:22:03AM -0400, John W. Linville wrote:
>> > On Tue, Sep 20, 2011 at 06:03:38AM -0700, Greg KH wrote:
>> > > On Mon, Sep 19, 2011 at 02:25:48PM -0700, Franky Lin wrote:
>> > > > Code clean up for fullmac.
>> > >
>> > > Ok, this is the 7th patch series since the last round of "how do we
>> get
>> > > our driver into mainline" happened.
>> > >
>> > > And while code is great and nice, I still haven't seen any real
>> answers
>> > > to all of the questions that were asked of the Broadcom driver team
>> > > during that review by the linux-wireless developers about how things
>> > > will be handled properly due to the overlap in functionality with the
>> > > existing "real" driver in the tree.
>> > >
>> > > So, can you please start answering these questions?  I'm loath to
>> keep
>> > > accepting patches until that all gets straightened out as it
>> potentially
>> > > wastes my, and your, time by doing so.
>> > >
>> > > In other words, I'm not going to apply any more patches until this
>> gets
>> > > resolved.  Consider this patchset dropped from my to-apply queue for
>> now
>> > > because of that.
>> >
>> > I think most of the outstanding series from Broadcom are
>> > (almost?) exclusively for their fullmac driver, which has not overlap
>> > with b43.  We should be moving forward toward getting the fullmac
>> > driver into wireless-next.
>>
>> Ok, that's great, but again, no one from Broadcom has said what their
>> plans are, only sent lots of patches, which while wonderful, has caused
>> some confusion on my and other parts.
>>
>> greg k-h
>
> Our original plan was to remain a separate driver from b43. We were aware of it and all the good work that had been done to create it and we had no intention of interfering with it.  At that point there had not been very much recent movement in b43 and it did not support any of our AXI based chips.  We figured that ssb vs AXI was a good dividing line and there would be no conflict, and there wasn't initially.

The first obvious problem is that there are SSB and BCMA (aka AXI)
cards using N-PHY. That resulted in PHY code duplication between b43
and brcmsmac. And since we already supported N-PHY in b43, adding bcma
support automatically gave us BCM43224 and BCM43225 support. That of
course means duplicated supported for the same hardware.


> Internally, prior to releasing to staging tree, development had gone quickly and it didn't take long at all to get the driver up and running.  We did not anticipate that things would go somewhat slower in the staging tree and a year (and hundreds of patches) later we are still there.  During that year b43 got some limited support for the same new chips brcmsmac already had, into its driver.  So now, here we are... both drivers supporting the new chips and b43 also supporting the old.
>
> We have seen the requests for us to add AXI based chipset support into b43.  I don't think that will happen in a substantial way:
> - Our driver is already stable and performance is better than b43 in terms of AXI chips.  B43 seems quite raw: its full of TODO and FIXME notes and performance is 1/10th of brcmsmac on our testing. Spending another round of time and effort on b43 to get it to the place where smac already is, seems redundant and unattractive.

Well, I guess you were comparing brcmsmac working in 802.11n mode vs.
b43 workin in 802.11g mode? When I was comparing both drivers in
802.11g mode, they were similar in performance. Please see my tests at
http://zajec.net/ . If that's true, we can also say b43 is ∞ faster
than brcmsmac... if you compare AP or monitor mode.


> - Much of brcmsmac code comes from our internal source which has whole organizations charged with testing it for compliance, compatibility, performance, etc. We understand that that is of no direct consequence but since brcmsmac code is a direct descendent of that code, much of that background still applies. Switching to b43 would mean throwing all that infrastructure and testing away and going with a driver that has none of that (that I know of).

Yes, I'm aware you may be not so comfortable with differences between
internal driver and b43.
However you're already at the place, when you can not just copy&paste
code from your internal driver to brcmsmac. You have to adopt in
anyway. Are there really so many differences if you look at b43? DMA
is something you probably don't need to touch. PHY code should be
portable to b43 in the same way it is to brcmsmac. The biggest problem
is to touch some general things, not PHY-directly-related. And even in
that code we share a lot of code. Our code is based on RE of your
driver. It has to be similar.


> - Most of the recent b43 additions support comes from a single person doing reverse engineering. brcmsmac has a few software people working on it directly and hundreds of people working on it indirectly (through the internal version) including engineers working on firmware, RTL, testing, etc.

You're doing much harder job and obviously you need much more people.
I just implement the driver, without testing hardware for various
possible configurations, etc. That's the only explanation how we've
achieved such a good state. We copied init/config values from your
driver, didn't invent them ourself.


> - B43 team has made the case several times that it has more features than brcmsmac.  A reminder: We were specifically asked NOT to add features while in staging tree and we have held back on features to honor that request.  AP, IBSS, 40 Mhz, using bcma, hw crypto and others, are all features we have been waiting to do.   We also have a backlog of several new chips we want to add.  And of course, we will would be adding future chips and features as they come out.

Well, you spent a lot of time on cleaning brcmsmac, I spent a lot of
time on adding support for new hardware. I believe now we both are at
similar stage from reaching fully functional, feature-full driver. 1:1
for both of us ;)


> We invested a year trying to be good Linux citizens, laying out our initial plans, following the rules, working transparently, folding in feedback, submitting hundreds of patches in plain sight of everyone and now folks are asking about our plan.  Our plan is get the brcmsmac and brcmfmac into mainline and keep following that up with new features, new chips and continuing support.

Well, you were submitting patches, but you weren't discussing anything
with us. That's really important in being a good citizens.
How many times have I asked about the firmware? How many times about
access to the hardware? How many times about the future? Really, I was
trying hard to cooperate, you just were ignoring all of that :|
We've now finally made you respond to the questions about the future,
but you still ignore my fw questions and hw requests.
This of course resulted in the complex situation we have now.


> Other than barely supporting one of our chips first in mainline, I would really like to understand what are the benefits and justifications of using b43 over brcmsmac for AXI based chips in the long run.  Can someone explain them?

What I don't like about brcmsmac?
1) Not modularized, bcma support built in and duplicated with bcma module
2) Poor quality code
3) Duplication of a lot of code with bcma&b43. Not just PHY code, but
also more general functions, DMA support, MAC, etc.


I don't know what more I can propose now.

We can of course continue our work without differences. I'll add
support for more cards and make it stable, meanwhile you will finally
clean your driver. What then? We will have 2 driver supporting same
hardware with comparable quality. Having 2 mainline drivers for the
same hw is not really a good option. Will we keep brcmsmac in staging
just to receive new PHY support from you and keep copying it to b43?
Doesn't sound to optimistic. How else do you see the future?

--
Rafał

2011-09-20 00:59:33

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero

On Mon, 2011-09-19 at 17:04 -0700, Joe Perches wrote:
> It'd be better if you could find some way
> to reduce the 6 tab indentation rather than
> split 20 char format strings into pieces.

Perhaps something like this:

drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 112 ++++++++++-----------
1 files changed, 54 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index a15765b..ccba1ce 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -240,6 +240,53 @@ brcmf_sdioh_cis_read(struct brcmf_sdio_dev *sdiodev, uint func,
return 0;
}

+static void
+brcmf_sdioh_request_byte_func0(struct brcmf_sdio_dev *sdiodev, uint rw,
+ uint func, uint regaddr, u8 *byte, int *err_ret)
+{
+ /* Can only directly write to some F0 registers.
+ * Handle F2 enable as a special case.
+ */
+ if (regaddr == SDIO_CCCR_IOEx) {
+ if (sdiodev->func[2]) {
+ sdio_claim_host(sdiodev->func[2]);
+ if (*byte & SDIO_FUNC_ENABLE_2) {
+ /* Enable Function 2 */
+ *err_ret = sdio_enable_func(sdiodev->func[2]);
+ if (*err_ret)
+ brcmf_dbg(ERROR,
+ "enable F2 failed:%d\n",
+ *err_ret);
+ } else {
+ /* Disable Function 2 */
+ *err_ret = sdio_disable_func(sdiodev->func[2]);
+ if (*err_ret)
+ brcmf_dbg(ERROR,
+ "Disable F2 failed:%d\n",
+ *err_ret);
+ }
+ sdio_release_host(sdiodev->func[2]);
+ }
+ } else if (regaddr == SDIO_CCCR_ABORT) {
+ /* to allow abort command through F1 */
+ sdio_claim_host(sdiodev->func[func]);
+ /*
+ * this sdio_f0_writeb() can be replaced with another api
+ * depending upon MMC driver change.
+ * As of this time, this is temporary one
+ */
+ sdio_writeb(sdiodev->func[func], *byte, regaddr, err_ret);
+ sdio_release_host(sdiodev->func[func]);
+ } else if (regaddr < 0xF0) {
+ brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr);
+ } else {
+ /* Claim host controller, perform F0 write, and release */
+ sdio_claim_host(sdiodev->func[func]);
+ sdio_f0_writeb(sdiodev->func[func], *byte, regaddr, err_ret);
+ sdio_release_host(sdiodev->func[func]);
+ }
+}
+
extern int
brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
uint regaddr, u8 *byte)
@@ -252,58 +299,9 @@ brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
BRCMF_PM_RESUME_RETURN_ERROR(-EIO, sdiodev);
if (rw) { /* CMD52 Write */
if (func == 0) {
- /* Can only directly write to some F0 registers.
- * Handle F2 enable
- * as a special case.
- */
- if (regaddr == SDIO_CCCR_IOEx) {
- if (sdiodev->func[2]) {
- sdio_claim_host(sdiodev->func[2]);
- if (*byte & SDIO_FUNC_ENABLE_2) {
- /* Enable Function 2 */
- err_ret =
- sdio_enable_func
- (sdiodev->func[2]);
- if (err_ret)
- brcmf_dbg(ERROR,
- "enable F2 failed:%d\n",
- err_ret);
- } else {
- /* Disable Function 2 */
- err_ret =
- sdio_disable_func
- (sdiodev->func[2]);
- if (err_ret)
- brcmf_dbg(ERROR,
- "Disable F2 failed:%d\n",
- err_ret);
- }
- sdio_release_host(sdiodev->func[2]);
- }
- }
- /* to allow abort command through F1 */
- else if (regaddr == SDIO_CCCR_ABORT) {
- sdio_claim_host(sdiodev->func[func]);
- /*
- * this sdio_f0_writeb() can be replaced
- * with another api
- * depending upon MMC driver change.
- * As of this time, this is temporaray one
- */
- sdio_writeb(sdiodev->func[func], *byte,
- regaddr, &err_ret);
- sdio_release_host(sdiodev->func[func]);
- } else if (regaddr < 0xF0) {
- brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n",
- regaddr);
- } else {
- /* Claim host controller, perform F0 write,
- and release */
- sdio_claim_host(sdiodev->func[func]);
- sdio_f0_writeb(sdiodev->func[func], *byte,
- regaddr, &err_ret);
- sdio_release_host(sdiodev->func[func]);
- }
+ brcmf_sdioh_request_byte_func0(sdiodev, rw, func,
+ regaddr, byte,
+ &err_ret);
} else {
/* Claim host controller, perform Fn write,
and release */
@@ -317,13 +315,11 @@ brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
sdio_claim_host(sdiodev->func[func]);

if (func == 0) {
- *byte =
- sdio_f0_readb(sdiodev->func[func], regaddr,
- &err_ret);
+ *byte = sdio_f0_readb(sdiodev->func[func], regaddr,
+ &err_ret);
} else {
- *byte =
- sdio_readb(sdiodev->func[func], regaddr,
- &err_ret);
+ *byte = sdio_readb(sdiodev->func[func], regaddr,
+ &err_ret);
}

sdio_release_host(sdiodev->func[func]);



2011-09-21 23:15:16

by Brett Rudley

[permalink] [raw]
Subject: RE: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

> You guys obviously don't want to support legacy hardware. So there is
> absolutely
> no way to drop b43 in favor of brcmsmac. That is _impossible_.
> And I do agree that it would be completely insane for you guys to support
> the legacy
> b43 802.11g code.
>
> The other way around, dropping brcmsmac in favor of b43 would be insanely
> stupid, too.
> It would basically be dropping broadcom-linux-wlan support. Nobody wants
> that.

Agree and we are not proposing that.

We did however initially propose (and implement) a dividing line of ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose to ignore/reject that. I haven't heard any counter-proposal from b43. We would love to hear one.

> I do, however, think that a separate broadcom-supported PHY module should
> be created,
> that is used by both brcmsmac and b43.

I'm not totally opposed to that idea but it does not solve the primary issue of conflicting b43 and brcmsmac modules.

Brett


2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 19/20] staging: brcm80211: simplified internal ioctl function once more

From: Roland Vossen <[email protected]>

Code cleanup. Merged two functions.

Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 3 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 40 ++++++++++++---------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 16 ---------
3 files changed, 24 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index a16f731..514f779 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -724,8 +724,7 @@ extern struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus,
extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);

-extern int brcmf_netdev_ioctl_priv(struct net_device *ndev,
- struct brcmf_ioctl *ioc);
+extern s32 brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len);

/* Indication from bus module regarding removal/absence of dongle */
extern void brcmf_detach(struct brcmf_pub *drvr);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 827022e..3ae0d43 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -849,30 +849,36 @@ static int brcmf_netdev_ioctl_entry(struct net_device *ndev, struct ifreq *ifr,
return -EOPNOTSUPP;
}

-/* called only from within this driver */
-int brcmf_netdev_ioctl_priv(struct net_device *ndev, struct brcmf_ioctl *ioc)
+/* called only from within this driver. Sends an ioctl to the dongle. */
+s32 brcmf_dev_ioctl(struct net_device *ndev, u32 cmd, void *arg, u32 len)
{
- int bcmerror = 0;
+ struct brcmf_ioctl ioc;
+ s32 err = 0;
int buflen = 0;
bool is_set_key_cmd;
struct brcmf_info *drvr_priv = *(struct brcmf_info **)
- netdev_priv(ndev);
+ netdev_priv(ndev);
int ifidx;

+ memset(&ioc, 0, sizeof(ioc));
+ ioc.cmd = cmd;
+ ioc.buf = arg;
+ ioc.len = len;
+
ifidx = brcmf_net2idx(drvr_priv, ndev);

- if (ioc->buf != NULL)
- buflen = min_t(uint, ioc->len, BRCMF_IOCTL_MAXLEN);
+ if (ioc.buf != NULL)
+ buflen = min_t(uint, ioc.len, BRCMF_IOCTL_MAXLEN);

/* send to dongle (must be up, and wl) */
if ((drvr_priv->pub.busstate != BRCMF_BUS_DATA)) {
brcmf_dbg(ERROR, "DONGLE_DOWN\n");
- bcmerror = -EIO;
+ err = -EIO;
goto done;
}

if (!drvr_priv->pub.iswl) {
- bcmerror = -EIO;
+ err = -EIO;
goto done;
}

@@ -880,21 +886,21 @@ int brcmf_netdev_ioctl_priv(struct net_device *ndev, struct brcmf_ioctl *ioc)
* Intercept BRCMF_C_SET_KEY IOCTL - serialize M4 send and
* set key IOCTL to prevent M4 encryption.
*/
- is_set_key_cmd = ((ioc->cmd == BRCMF_C_SET_KEY) ||
- ((ioc->cmd == BRCMF_C_SET_VAR) &&
- !(strncmp("wsec_key", ioc->buf, 9))) ||
- ((ioc->cmd == BRCMF_C_SET_VAR) &&
- !(strncmp("bsscfg:wsec_key", ioc->buf, 15))));
+ is_set_key_cmd = ((ioc.cmd == BRCMF_C_SET_KEY) ||
+ ((ioc.cmd == BRCMF_C_SET_VAR) &&
+ !(strncmp("wsec_key", ioc.buf, 9))) ||
+ ((ioc.cmd == BRCMF_C_SET_VAR) &&
+ !(strncmp("bsscfg:wsec_key", ioc.buf, 15))));
if (is_set_key_cmd)
brcmf_netdev_wait_pend8021x(ndev);

- bcmerror = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, ioc, buflen);
+ err = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, buflen);

done:
- if (bcmerror > 0)
- bcmerror = 0;
+ if (err > 0)
+ err = 0;

- return bcmerror;
+ return err;
}

static int brcmf_netdev_stop(struct net_device *ndev)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index b707bc0..b956c90 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -249,22 +249,6 @@ static const u32 __wl_cipher_suites[] = {
WLAN_CIPHER_SUITE_AES_CMAC,
};

-static s32
-brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
-{
- struct brcmf_ioctl ioc;
- s32 err = 0;
-
- memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = cmd;
- ioc.buf = arg;
- ioc.len = len;
-
- err = brcmf_netdev_ioctl_priv(dev, &ioc);
-
- return err;
-}
-
/* function for reading/writing a single u32 from/to the dongle */
static int
brcmf_dev_ioctl_u32(struct net_device *ndev, u32 cmd, u32 *par)
--
1.7.1



2011-09-22 08:53:21

by Arend van Spriel

[permalink] [raw]
Subject: RE: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

> From: [email protected] [mailto:linux-wireless-
> [email protected]] On Behalf Of Michael B?sch
> Sent: donderdag 22 september 2011 1:29
> To: Brett Rudley
> Cc: Rafa? Mi?ecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin;
> [email protected]; [email protected]; linux-
> [email protected]
> Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for
> mainline patch #2
>
> On Wed, 21 Sep 2011 16:15:10 -0700
> "Brett Rudley" <[email protected]> wrote:
>
> > We did however initially propose (and implement) a dividing line of
> ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose
> to ignore/reject that.
>
> Well, what about embedded, for instance?

The brcmsmac driver has been tested on a MIPS platform by Jonas Gorski
although only in STA mode (on a bcm63xx). Not having AP mode has been
explained in other emails.

Also we fully intend to transition to BCMA but that would also be new
feature added. Having AP mode and BCMA would enable you guys for using
it in the embedded targets, right?

> > I'm not totally opposed to that idea but it does not solve the
> primary issue of conflicting b43 and brcmsmac modules.
>
> I'm not convinced that this is an issue at all and I'm not convinced
> that it has to be resolved.
> At least not now.
>

It never hurts to look ahead. Both drivers have their use in the linux
tree and we should align which driver is doing what. Apparently we should
have yelled really hard when b43 was adding bcma support, because then
it snatched the chipsets we support as well. You learn your lessons the
hard way in Linux land, or so it seems ;-)

Gr. AvS


2011-09-22 06:47:10

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On 09/22/2011 12:12 AM, Brett Rudley wrote:
>>> Our original plan was to remain a separate driver from b43. We were
>> aware of it and all the good work that had been done to create it and we
>> had no intention of interfering with it. At that point there had not
>> been very much recent movement in b43 and it did not support any of our
>> AXI based chips. We figured that ssb vs AXI was a good dividing line and
>> there would be no conflict, and there wasn't initially.
>>
>> The first obvious problem is that there are SSB and BCMA (aka AXI)
>> cards using N-PHY. That resulted in PHY code duplication between b43
>> and brcmsmac. And since we already supported N-PHY in b43, adding bcma
>> support automatically gave us BCM43224 and BCM43225 support. That of
>> course means duplicated supported for the same hardware.
>
> Agree, when you created bcma, it did duplicate HW support already in brcmsmac. Why didn't you address that then?

bcma is not only used to support the bus on a pci based wireless cards
it now also contains support for SoCs like the BCM4718. There it
provides a common interface to the hardware for the wireless so that
there were no changes in b43 needed to get the wireless core running on
this SoC. It also provides some parts needed to get the SoC boot in
Linux and so on, some parts are related to the MIPS CPU and not related
to the wireless core, so it makes sense to put that into an own module.

Hauke

2011-09-22 08:57:03

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

W dniu 22 września 2011 10:53 użytkownik Arend Van Spriel
<[email protected]> napisał:
>> From: [email protected] [mailto:linux-wireless-
>> [email protected]] On Behalf Of Michael Büsch
>> Sent: donderdag 22 september 2011 1:29
>> To: Brett Rudley
>> Cc: Rafał Miłecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin;
>> [email protected]; [email protected]; linux-
>> [email protected]
>> Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for
>> mainline patch #2
>>
>> On Wed, 21 Sep 2011 16:15:10 -0700
>> "Brett Rudley" <[email protected]> wrote:
>>
>> > We did however initially propose (and implement) a dividing line of
>> ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose
>> to ignore/reject that.
>>
>> Well, what about embedded, for instance?
>
> The brcmsmac driver has been tested on a MIPS platform by Jonas Gorski
> although only in STA mode (on a bcm63xx). Not having AP mode has been
> explained in other emails.
>
> Also we fully intend to transition to BCMA but that would also be new
> feature added. Having AP mode and BCMA would enable you guys for using
> it in the embedded targets, right?
>
>> > I'm not totally opposed to that idea but it does not solve the
>> primary issue of conflicting b43 and brcmsmac modules.
>>
>> I'm not convinced that this is an issue at all and I'm not convinced
>> that it has to be resolved.
>> At least not now.
>>
>
> It never hurts to look ahead. Both drivers have their use in the linux
> tree and we should align which driver is doing what. Apparently we should
> have yelled really hard when b43 was adding bcma support, because then
> it snatched the chipsets we support as well. You learn your lessons the
> hard way in Linux land, or so it seems ;-)

And I should have notice you add code for N-PHY with your initial
brcm80211 commit ;) There's always something that you won't notice at
the correct time.

--
Rafał

2011-09-22 09:12:42

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/22 Arend Van Spriel <[email protected]>:
>> From: Rafał Miłecki [mailto:[email protected]]
>> Sent: donderdag 22 september 2011 10:57
>> To: Arend Van Spriel
>> Cc: Michael Büsch; Brett Rudley; Greg KH; John W. Linville; Franky
>> (Zhenhui) Lin; [email protected]; [email protected]; linux-
>> [email protected]; [email protected]
>> Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for
>> mainline patch #2
>>
>> W dniu 22 września 2011 10:53 użytkownik Arend Van Spriel
>> <[email protected]> napisał:
>> >> From: [email protected] [mailto:linux-wireless-
>> >> [email protected]] On Behalf Of Michael Büsch
>> >> Sent: donderdag 22 september 2011 1:29
>> >> To: Brett Rudley
>> >> Cc: Rafał Miłecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin;
>> >> [email protected]; [email protected]; linux-
>> >> [email protected]
>> >> Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for
>> >> mainline patch #2
>> >>
>> >> On Wed, 21 Sep 2011 16:15:10 -0700
>> >> "Brett Rudley" <[email protected]> wrote:
>> >>
>> >> > We did however initially propose (and implement) a dividing line
>> of
>> >> ssb chips for b43 and AXI based chips for brcmsmac but b43 team
>> chose
>> >> to ignore/reject that.
>> >>
>> >> Well, what about embedded, for instance?
>> >
>> > The brcmsmac driver has been tested on a MIPS platform by Jonas
>> Gorski
>> > although only in STA mode (on a bcm63xx). Not having AP mode has been
>> > explained in other emails.
>> >
>> > Also we fully intend to transition to BCMA but that would also be new
>> > feature added. Having AP mode and BCMA would enable you guys for
>> using
>> > it in the embedded targets, right?
>> >
>> >> > I'm not totally opposed to that idea but it does not solve the
>> >> primary issue of conflicting b43 and brcmsmac modules.
>> >>
>> >> I'm not convinced that this is an issue at all and I'm not convinced
>> >> that it has to be resolved.
>> >> At least not now.
>> >>
>> >
>> > It never hurts to look ahead. Both drivers have their use in the
>> linux
>> > tree and we should align which driver is doing what. Apparently we
>> should
>> > have yelled really hard when b43 was adding bcma support, because
>> then
>> > it snatched the chipsets we support as well. You learn your lessons
>> the
>> > hard way in Linux land, or so it seems ;-)
>>
>> And I should have notice you add code for N-PHY with your initial
>> brcm80211 commit ;) There's always something that you won't notice at
>> the correct time.
>>
>> --
>> Rafał
>
> Were you unaware of the chipsets that brcmsmac was supporting? When you
> Were working on N-PHY it was to enable certain chipsets, right? Was that
> in ssb context?

I was aware of supported chipsets (by their names), but I got no idea
that they (BCM43224 and BCM43225) are N-PHY based ones. I though that
that are some totally new PHYs (like SSLPN/HT/LCN/LCNXN/etc.).

--
Rafał

2011-09-22 09:45:02

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Thu, 2011-09-22 at 00:35 +0200, Michael Büsch wrote:

> And for that single reason I do not see either b43 or brcmsmac being dropped
> in favor of the other one any time soon.
>
> You guys obviously don't want to support legacy hardware. So there is absolutely
> no way to drop b43 in favor of brcmsmac. That is _impossible_.
> And I do agree that it would be completely insane for you guys to support the legacy
> b43 802.11g code.
>
> The other way around, dropping brcmsmac in favor of b43 would be insanely stupid, too.
> It would basically be dropping broadcom-linux-wlan support. Nobody wants that.

All good points. The most rational I've seen in all of this discussion
really.

> I do, however, think that a separate broadcom-supported PHY module should be created,
> that is used by both brcmsmac and b43.

I agree that would be nice. However, I don't think that it should be
required for brcmsmac to get into mainline, nor do I think that there
should be a big rearchitecture for this. In fact, brcmsmac has a PHY
abstraction layer that looks perfectly usable to me. b43 has one too,
but it's nowhere near as fleshed out for all corner cases afaict.

Really the more important issue is support though. Rafal by himself
cannot possibly provide the level of support we're hoping to see from
Broadcom who I expect will eventually ship this driver to their
customers and support it, just like they do now with the driver it is
derived from.

Overall, the way I see it this really is a no-brainer. I really don't
see why we're even discussing this so much.
brcmsmac should be accepted into mainline as soon as possible (and I
think all the recent patchsets go a long way). After that, the Broadcom
team can easily port it to bcma, I expect that would happen within a few
weeks. Adding features to it should be fairly simple too, and go much
faster than adding any features to b43. (*)


b43 is really my child too. I spent a very long time on the reverse
engineering. But let's let it "die" peacefully. It has no reason to be
competing with a Broadcom-supported driver that supports the same chips.

johannes


(*) Rafal: Also, get a grip. Your much touted "monitor mode" is probably
a 50-100 line patch to brcmsmac. You're making yourself look extremely
childish by talking about it all the time as if it was the best thing
since sliced bread.



2011-09-20 01:04:29

by Franky Lin

[permalink] [raw]
Subject: Re: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero

On 09/19/2011 05:04 PM, Joe Perches wrote:
> Splitting format strings is poor style, makes
> error messages difficult to find via grep and
> is error prone.
>
> You should update your checkpatch version.
> Current checkpatch doesn't warn about this.

Thank you for pointing this out.

> It'd be better if you could find some way
> to reduce the 6 tab indentation rather than
> split 20 char format strings into pieces.

Greg, could you please drop this one? We will take care of the
indentation issue in future patches.

Thanks,
Franky


2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 13/20] staging: brcm80211: removed two fullmac sparse spinlock warnings

From: Roland Vossen <[email protected]>

By deleting three redundant functions. The spinlock was related to
event queue operation. Event queue data members were also renamed
to make their function more clear.

Reported-by: Johannes Berg <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 49 ++++++++--------------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 6 +-
2 files changed, 20 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 2dd28a2..0bda00c 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -3181,21 +3181,6 @@ init_priv_mem_out:
return -ENOMEM;
}

-static void brcmf_lock_eq(struct brcmf_cfg80211_priv *cfg_priv)
-{
- spin_lock_irq(&cfg_priv->eq_lock);
-}
-
-static void brcmf_unlock_eq(struct brcmf_cfg80211_priv *cfg_priv)
-{
- spin_unlock_irq(&cfg_priv->eq_lock);
-}
-
-static void brcmf_init_eq_lock(struct brcmf_cfg80211_priv *cfg_priv)
-{
- spin_lock_init(&cfg_priv->eq_lock);
-}
-
/*
* retrieve first queued event from head
*/
@@ -3205,13 +3190,13 @@ static struct brcmf_cfg80211_event_q *brcmf_deq_event(
{
struct brcmf_cfg80211_event_q *e = NULL;

- brcmf_lock_eq(cfg_priv);
- if (likely(!list_empty(&cfg_priv->eq_list))) {
- e = list_first_entry(&cfg_priv->eq_list,
- struct brcmf_cfg80211_event_q, eq_list);
- list_del(&e->eq_list);
+ spin_lock_irq(&cfg_priv->evt_q_lock);
+ if (likely(!list_empty(&cfg_priv->evt_q_list))) {
+ e = list_first_entry(&cfg_priv->evt_q_list,
+ struct brcmf_cfg80211_event_q, evt_q_list);
+ list_del(&e->evt_q_list);
}
- brcmf_unlock_eq(cfg_priv);
+ spin_unlock_irq(&cfg_priv->evt_q_lock);

return e;
}
@@ -3236,9 +3221,9 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
e->etype = event;
memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));

- brcmf_lock_eq(cfg_priv);
- list_add_tail(&e->eq_list, &cfg_priv->eq_list);
- brcmf_unlock_eq(cfg_priv);
+ spin_lock_irq(&cfg_priv->evt_q_lock);
+ list_add_tail(&e->evt_q_list, &cfg_priv->evt_q_list);
+ spin_unlock_irq(&cfg_priv->evt_q_lock);

return err;
}
@@ -3276,22 +3261,22 @@ static void brcmf_cfg80211_event_handler(struct work_struct *work)

static void brcmf_init_eq(struct brcmf_cfg80211_priv *cfg_priv)
{
- brcmf_init_eq_lock(cfg_priv);
- INIT_LIST_HEAD(&cfg_priv->eq_list);
+ spin_lock_init(&cfg_priv->evt_q_lock);
+ INIT_LIST_HEAD(&cfg_priv->evt_q_list);
}

static void brcmf_flush_eq(struct brcmf_cfg80211_priv *cfg_priv)
{
struct brcmf_cfg80211_event_q *e;

- brcmf_lock_eq(cfg_priv);
- while (!list_empty(&cfg_priv->eq_list)) {
- e = list_first_entry(&cfg_priv->eq_list,
- struct brcmf_cfg80211_event_q, eq_list);
- list_del(&e->eq_list);
+ spin_lock_irq(&cfg_priv->evt_q_lock);
+ while (!list_empty(&cfg_priv->evt_q_list)) {
+ e = list_first_entry(&cfg_priv->evt_q_list,
+ struct brcmf_cfg80211_event_q, evt_q_list);
+ list_del(&e->evt_q_list);
kfree(e);
}
- brcmf_unlock_eq(cfg_priv);
+ spin_unlock_irq(&cfg_priv->evt_q_lock);
}

static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 79806c0..14a32e1 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -199,7 +199,7 @@ struct brcmf_cfg80211_ie {

/* event queue for cfg80211 main event */
struct brcmf_cfg80211_event_q {
- struct list_head eq_list;
+ struct list_head evt_q_list;
u32 etype;
struct brcmf_event_msg emsg;
s8 edata[1];
@@ -282,8 +282,8 @@ struct brcmf_cfg80211_priv {
struct cfg80211_scan_request *scan_request; /* scan request
object */
struct brcmf_cfg80211_event_loop el; /* main event loop */
- struct list_head eq_list; /* used for event queue */
- spinlock_t eq_lock; /* for event queue synchronization */
+ struct list_head evt_q_list; /* used for event queue */
+ spinlock_t evt_q_lock; /* for event queue synchronization */
struct mutex usr_sync; /* maily for dongle up/down synchronization */
struct brcmf_scan_results *bss_list; /* bss_list holding scanned
ap information */
--
1.7.1



2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 18/20] staging: brcm80211: consistent naming of struct net_device *ndev

From: Roland Vossen <[email protected]>

Code cleanup. Various names (ndev, net, dev) were used for the
same structure. Settled for 'ndev'.

Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 6 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 214 +++++++++++----------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 219 +++++++++++-----------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 2 +-
4 files changed, 225 insertions(+), 216 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 7ab45d9..a16f731 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -722,9 +722,9 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
extern struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus,
uint bus_hdrlen);
extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
-extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
+extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);

-extern int brcmf_netdev_ioctl_priv(struct net_device *net,
+extern int brcmf_netdev_ioctl_priv(struct net_device *ndev,
struct brcmf_ioctl *ioc);

/* Indication from bus module regarding removal/absence of dongle */
@@ -766,7 +766,7 @@ extern int brcmf_c_host_event(struct brcmf_info *drvr_priv, int *idx,
extern void brcmf_c_init(void);

extern int brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx,
- struct net_device *net, char *name, u8 *mac_addr,
+ struct net_device *ndev, char *name, u8 *mac_addr,
u32 flags, u8 bssidx);
extern void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx);

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 659a9c2..827022e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -53,7 +53,7 @@ MODULE_LICENSE("Dual BSD/GPL");
struct brcmf_if {
struct brcmf_info *info; /* back pointer to brcmf_info */
/* OS/stack specifics */
- struct net_device *net;
+ struct net_device *ndev;
struct net_device_stats stats;
int idx; /* iface idx in dongle */
int state; /* interface state */
@@ -83,12 +83,12 @@ struct brcmf_info {
module_param(brcmf_msg_level, int, 0);


-static int brcmf_net2idx(struct brcmf_info *drvr_priv, struct net_device *net)
+static int brcmf_net2idx(struct brcmf_info *drvr_priv, struct net_device *ndev)
{
int i = 0;

while (i < BRCMF_MAX_IFS) {
- if (drvr_priv->iflist[i] && (drvr_priv->iflist[i]->net == net))
+ if (drvr_priv->iflist[i] && drvr_priv->iflist[i]->ndev == ndev)
return i;
i++;
}
@@ -127,15 +127,15 @@ char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx)
return "<if_null>";
}

- if (drvr_priv->iflist[ifidx]->net)
- return drvr_priv->iflist[ifidx]->net->name;
+ if (drvr_priv->iflist[ifidx]->ndev)
+ return drvr_priv->iflist[ifidx]->ndev->name;

return "<if_none>";
}

static void _brcmf_set_multicast_list(struct work_struct *work)
{
- struct net_device *dev;
+ struct net_device *ndev;
struct netdev_hw_addr *ha;
u32 allmulti, cnt;
__le32 cnt_le;
@@ -149,11 +149,11 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
struct brcmf_info *drvr_priv = container_of(work, struct brcmf_info,
multicast_work);

- dev = drvr_priv->iflist[0]->net;
- cnt = netdev_mc_count(dev);
+ ndev = drvr_priv->iflist[0]->ndev;
+ cnt = netdev_mc_count(ndev);

/* Determine initial value of allmulti flag */
- allmulti = (dev->flags & IFF_ALLMULTI) ? true : false;
+ allmulti = (ndev->flags & IFF_ALLMULTI) ? true : false;

/* Send down the multicast list first. */

@@ -169,7 +169,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
memcpy(bufp, &cnt_le, sizeof(cnt));
bufp += sizeof(cnt_le);

- netdev_for_each_mc_addr(ha, dev) {
+ netdev_for_each_mc_addr(ha, ndev) {
if (!cnt)
break;
memcpy(bufp, ha->addr, ETH_ALEN);
@@ -232,7 +232,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
/* Finally, pick up the PROMISC flag as well, like the NIC
driver does */

- allmulti = (dev->flags & IFF_PROMISC) ? true : false;
+ allmulti = (ndev->flags & IFF_PROMISC) ? true : false;
allmulti_le = cpu_to_le32(allmulti);

memset(&ioc, 0, sizeof(ioc));
@@ -277,7 +277,7 @@ _brcmf_set_mac_address(struct work_struct *work)
brcmf_dbg(ERROR, "%s: set cur_etheraddr failed\n",
brcmf_ifname(&drvr_priv->pub, 0));
else
- memcpy(drvr_priv->iflist[0]->net->dev_addr,
+ memcpy(drvr_priv->iflist[0]->ndev->dev_addr,
drvr_priv->macvalue, ETH_ALEN);

return;
@@ -299,23 +299,23 @@ static void brcmf_op_if(struct brcmf_if *ifp)
* Delete the existing interface before overwriting it
* in case we missed the BRCMF_E_IF_DEL event.
*/
- if (ifp->net != NULL) {
+ if (ifp->ndev != NULL) {
brcmf_dbg(ERROR, "ERROR: netdev:%s already exists, try free & unregister\n",
- ifp->net->name);
- netif_stop_queue(ifp->net);
- unregister_netdev(ifp->net);
- free_netdev(ifp->net);
+ ifp->ndev->name);
+ netif_stop_queue(ifp->ndev);
+ unregister_netdev(ifp->ndev);
+ free_netdev(ifp->ndev);
}
/* Allocate netdev, including space for private structure */
- ifp->net = alloc_netdev(sizeof(drvr_priv), "wlan%d",
- ether_setup);
- if (!ifp->net) {
+ ifp->ndev = alloc_netdev(sizeof(drvr_priv), "wlan%d",
+ ether_setup);
+ if (!ifp->ndev) {
brcmf_dbg(ERROR, "OOM - alloc_netdev\n");
ret = -ENOMEM;
}
if (ret == 0) {
- strcpy(ifp->net->name, ifp->name);
- memcpy(netdev_priv(ifp->net), &drvr_priv,
+ strcpy(ifp->ndev->name, ifp->name);
+ memcpy(netdev_priv(ifp->ndev), &drvr_priv,
sizeof(drvr_priv));
err = brcmf_net_attach(&drvr_priv->pub, ifp->idx);
if (err != 0) {
@@ -324,16 +324,16 @@ static void brcmf_op_if(struct brcmf_if *ifp)
ret = -EOPNOTSUPP;
} else {
brcmf_dbg(TRACE, " ==== pid:%x, net_device for if:%s created ===\n",
- current->pid, ifp->net->name);
+ current->pid, ifp->ndev->name);
ifp->state = 0;
}
}
break;
case BRCMF_E_IF_DEL:
- if (ifp->net != NULL) {
+ if (ifp->ndev != NULL) {
brcmf_dbg(TRACE, "got 'WLC_E_IF_DEL' state\n");
- netif_stop_queue(ifp->net);
- unregister_netdev(ifp->net);
+ netif_stop_queue(ifp->ndev);
+ unregister_netdev(ifp->ndev);
ret = BRCMF_DEL_IF; /* Make sure the free_netdev()
is called */
}
@@ -344,21 +344,22 @@ static void brcmf_op_if(struct brcmf_if *ifp)
}

if (ret < 0) {
- if (ifp->net)
- free_netdev(ifp->net);
+ if (ifp->ndev)
+ free_netdev(ifp->ndev);

drvr_priv->iflist[ifp->idx] = NULL;
kfree(ifp);
}
}

-static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
+static int brcmf_netdev_set_mac_address(struct net_device *ndev, void *addr)
{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)
+ netdev_priv(ndev);
struct sockaddr *sa = (struct sockaddr *)addr;
int ifidx;

- ifidx = brcmf_net2idx(drvr_priv, dev);
+ ifidx = brcmf_net2idx(drvr_priv, ndev);
if (ifidx == BRCMF_BAD_IF)
return -1;

@@ -367,12 +368,13 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
return 0;
}

-static void brcmf_netdev_set_multicast_list(struct net_device *dev)
+static void brcmf_netdev_set_multicast_list(struct net_device *ndev)
{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)
+ netdev_priv(ndev);
int ifidx;

- ifidx = brcmf_net2idx(drvr_priv, dev);
+ ifidx = brcmf_net2idx(drvr_priv, ndev);
if (ifidx == BRCMF_BAD_IF)
return;

@@ -405,10 +407,11 @@ int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx, struct sk_buff *pktbuf)
return brcmf_sdbrcm_bus_txdata(drvr->bus, pktbuf);
}

-static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
+static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{
int ret;
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)
+ netdev_priv(ndev);
int ifidx;

brcmf_dbg(TRACE, "Enter\n");
@@ -417,14 +420,14 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
if (!drvr_priv->pub.up || (drvr_priv->pub.busstate == BRCMF_BUS_DOWN)) {
brcmf_dbg(ERROR, "xmit rejected pub.up=%d busstate=%d\n",
drvr_priv->pub.up, drvr_priv->pub.busstate);
- netif_stop_queue(net);
+ netif_stop_queue(ndev);
return -ENODEV;
}

- ifidx = brcmf_net2idx(drvr_priv, net);
+ ifidx = brcmf_net2idx(drvr_priv, ndev);
if (ifidx == BRCMF_BAD_IF) {
brcmf_dbg(ERROR, "bad ifidx %d\n", ifidx);
- netif_stop_queue(net);
+ netif_stop_queue(ndev);
return -ENODEV;
}

@@ -460,17 +463,17 @@ done:

void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool state)
{
- struct net_device *net;
+ struct net_device *ndev;
struct brcmf_info *drvr_priv = drvr->info;

brcmf_dbg(TRACE, "Enter\n");

drvr->txoff = state;
- net = drvr_priv->iflist[ifidx]->net;
+ ndev = drvr_priv->iflist[ifidx]->ndev;
if (state == ON)
- netif_stop_queue(net);
+ netif_stop_queue(ndev);
else
- netif_wake_queue(net);
+ netif_wake_queue(ndev);
}

static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx,
@@ -483,8 +486,8 @@ static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx,
if (bcmerror != 0)
return bcmerror;

- if (drvr_priv->iflist[*ifidx]->net)
- brcmf_cfg80211_event(drvr_priv->iflist[*ifidx]->net,
+ if (drvr_priv->iflist[*ifidx]->ndev)
+ brcmf_cfg80211_event(drvr_priv->iflist[*ifidx]->ndev,
event, *data);

return bcmerror;
@@ -530,7 +533,7 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
if (ifp == NULL)
ifp = drvr_priv->iflist[0];

- skb->dev = ifp->net;
+ skb->dev = ifp->ndev;
skb->protocol = eth_type_trans(skb, skb->dev);

if (skb->pkt_type == PACKET_MULTICAST)
@@ -552,8 +555,8 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
!drvr_priv->iflist[ifidx]->state)
ifp = drvr_priv->iflist[ifidx];

- if (ifp->net)
- ifp->net->last_rx = jiffies;
+ if (ifp->ndev)
+ ifp->ndev->last_rx = jiffies;

drvr->dstats.rx_bytes += skb->len;
drvr->rx_packets++; /* Local count */
@@ -588,15 +591,16 @@ void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp, bool success)

}

-static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
+static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *ndev)
{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)
+ netdev_priv(ndev);
struct brcmf_if *ifp;
int ifidx;

brcmf_dbg(TRACE, "Enter\n");

- ifidx = brcmf_net2idx(drvr_priv, net);
+ ifidx = brcmf_net2idx(drvr_priv, ndev);
if (ifidx == BRCMF_BAD_IF)
return NULL;

@@ -698,10 +702,11 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
return 0;
}

-static void brcmf_ethtool_get_drvinfo(struct net_device *net,
+static void brcmf_ethtool_get_drvinfo(struct net_device *ndev,
struct ethtool_drvinfo *info)
{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)
+ netdev_priv(ndev);

sprintf(info->driver, KBUILD_MODNAME);
sprintf(info->version, "%lu", drvr_priv->pub.drv_version);
@@ -809,10 +814,10 @@ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void __user *uaddr)
/* If setting TX checksum mode, tell Linux the new mode */
if (cmd == ETHTOOL_STXCSUM) {
if (edata.data)
- drvr_priv->iflist[0]->net->features |=
+ drvr_priv->iflist[0]->ndev->features |=
NETIF_F_IP_CSUM;
else
- drvr_priv->iflist[0]->net->features &=
+ drvr_priv->iflist[0]->ndev->features &=
~NETIF_F_IP_CSUM;
}

@@ -825,13 +830,14 @@ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void __user *uaddr)
return 0;
}

-static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
+static int brcmf_netdev_ioctl_entry(struct net_device *ndev, struct ifreq *ifr,
int cmd)
{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)
+ netdev_priv(ndev);
int ifidx;

- ifidx = brcmf_net2idx(drvr_priv, net);
+ ifidx = brcmf_net2idx(drvr_priv, ndev);
brcmf_dbg(TRACE, "ifidx %d, cmd 0x%04x\n", ifidx, cmd);

if (ifidx == BRCMF_BAD_IF)
@@ -844,15 +850,16 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
}

/* called only from within this driver */
-int brcmf_netdev_ioctl_priv(struct net_device *net, struct brcmf_ioctl *ioc)
+int brcmf_netdev_ioctl_priv(struct net_device *ndev, struct brcmf_ioctl *ioc)
{
int bcmerror = 0;
int buflen = 0;
bool is_set_key_cmd;
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)
+ netdev_priv(ndev);
int ifidx;

- ifidx = brcmf_net2idx(drvr_priv, net);
+ ifidx = brcmf_net2idx(drvr_priv, ndev);

if (ioc->buf != NULL)
buflen = min_t(uint, ioc->len, BRCMF_IOCTL_MAXLEN);
@@ -879,7 +886,7 @@ int brcmf_netdev_ioctl_priv(struct net_device *net, struct brcmf_ioctl *ioc)
((ioc->cmd == BRCMF_C_SET_VAR) &&
!(strncmp("bsscfg:wsec_key", ioc->buf, 15))));
if (is_set_key_cmd)
- brcmf_netdev_wait_pend8021x(net);
+ brcmf_netdev_wait_pend8021x(ndev);

bcmerror = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, ioc, buflen);

@@ -890,9 +897,9 @@ done:
return bcmerror;
}

-static int brcmf_netdev_stop(struct net_device *net)
+static int brcmf_netdev_stop(struct net_device *ndev)
{
- struct brcmf_pub *drvr = *(struct brcmf_pub **) netdev_priv(net);
+ struct brcmf_pub *drvr = *(struct brcmf_pub **) netdev_priv(ndev);

brcmf_dbg(TRACE, "Enter\n");
brcmf_cfg80211_down(drvr->config);
@@ -901,16 +908,17 @@ static int brcmf_netdev_stop(struct net_device *net)

/* Set state and stop OS transmissions */
drvr->up = 0;
- netif_stop_queue(net);
+ netif_stop_queue(ndev);

return 0;
}

-static int brcmf_netdev_open(struct net_device *net)
+static int brcmf_netdev_open(struct net_device *ndev)
{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)
+ netdev_priv(ndev);
u32 toe_ol;
- int ifidx = brcmf_net2idx(drvr_priv, net);
+ int ifidx = brcmf_net2idx(drvr_priv, ndev);
s32 ret = 0;

brcmf_dbg(TRACE, "ifidx %d\n", ifidx);
@@ -925,19 +933,19 @@ static int brcmf_netdev_open(struct net_device *net)
}
atomic_set(&drvr_priv->pend_8021x_cnt, 0);

- memcpy(net->dev_addr, drvr_priv->pub.mac, ETH_ALEN);
+ memcpy(ndev->dev_addr, drvr_priv->pub.mac, ETH_ALEN);

/* Get current TOE mode from dongle */
if (brcmf_toe_get(drvr_priv, ifidx, &toe_ol) >= 0
&& (toe_ol & TOE_TX_CSUM_OL) != 0)
- drvr_priv->iflist[ifidx]->net->features |=
+ drvr_priv->iflist[ifidx]->ndev->features |=
NETIF_F_IP_CSUM;
else
- drvr_priv->iflist[ifidx]->net->features &=
+ drvr_priv->iflist[ifidx]->ndev->features &=
~NETIF_F_IP_CSUM;
}
/* Allow transmit calls */
- netif_start_queue(net);
+ netif_start_queue(ndev);
drvr_priv->pub.up = 1;
if (brcmf_cfg80211_up(drvr_priv->pub.config)) {
brcmf_dbg(ERROR, "failed to bring up cfg80211\n");
@@ -948,12 +956,12 @@ static int brcmf_netdev_open(struct net_device *net)
}

int
-brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, struct net_device *net,
+brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, struct net_device *ndev,
char *name, u8 *mac_addr, u32 flags, u8 bssidx)
{
struct brcmf_if *ifp;

- brcmf_dbg(TRACE, "idx %d, handle->%p\n", ifidx, net);
+ brcmf_dbg(TRACE, "idx %d, handle->%p\n", ifidx, ndev);

ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
@@ -969,12 +977,12 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, struct net_device *net,
if (mac_addr != NULL)
memcpy(&ifp->mac_addr, mac_addr, ETH_ALEN);

- if (net == NULL) {
+ if (ndev == NULL) {
ifp->state = BRCMF_E_IF_ADD;
ifp->idx = ifidx;
brcmf_op_if(ifp);
} else
- ifp->net = net;
+ ifp->ndev = ndev;

return 0;
}
@@ -999,13 +1007,13 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
{
struct brcmf_info *drvr_priv = NULL;
- struct net_device *net;
+ struct net_device *ndev;

brcmf_dbg(TRACE, "Enter\n");

/* Allocate netdev, including space for private structure */
- net = alloc_netdev(sizeof(drvr_priv), "wlan%d", ether_setup);
- if (!net) {
+ ndev = alloc_netdev(sizeof(drvr_priv), "wlan%d", ether_setup);
+ if (!ndev) {
brcmf_dbg(ERROR, "OOM - alloc_netdev\n");
goto fail;
}
@@ -1018,13 +1026,13 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
/*
* Save the brcmf_info into the priv
*/
- memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
+ memcpy(netdev_priv(ndev), &drvr_priv, sizeof(drvr_priv));

- if (brcmf_add_if(drvr_priv, 0, net, net->name, NULL, 0, 0) ==
+ if (brcmf_add_if(drvr_priv, 0, ndev, ndev->name, NULL, 0, 0) ==
BRCMF_BAD_IF)
goto fail;

- net->netdev_ops = NULL;
+ ndev->netdev_ops = NULL;
mutex_init(&drvr_priv->proto_block);

/* Link to info module */
@@ -1042,7 +1050,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)

/* Attach and link in the cfg80211 */
drvr_priv->pub.config =
- brcmf_cfg80211_attach(net,
+ brcmf_cfg80211_attach(ndev,
brcmf_bus_get_device(bus),
&drvr_priv->pub);
if (drvr_priv->pub.config == NULL) {
@@ -1056,13 +1064,13 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
/*
* Save the brcmf_info into the priv
*/
- memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
+ memcpy(netdev_priv(ndev), &drvr_priv, sizeof(drvr_priv));

return &drvr_priv->pub;

fail:
- if (net)
- free_netdev(net);
+ if (ndev)
+ free_netdev(ndev);
if (drvr_priv)
brcmf_detach(&drvr_priv->pub);

@@ -1143,14 +1151,14 @@ static struct net_device_ops brcmf_netdev_ops_pri = {
int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
{
struct brcmf_info *drvr_priv = drvr->info;
- struct net_device *net;
+ struct net_device *ndev;
u8 temp_addr[ETH_ALEN] = {
0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};

brcmf_dbg(TRACE, "ifidx %d\n", ifidx);

- net = drvr_priv->iflist[ifidx]->net;
- net->netdev_ops = &brcmf_netdev_ops_pri;
+ ndev = drvr_priv->iflist[ifidx]->ndev;
+ ndev->netdev_ops = &brcmf_netdev_ops_pri;

/*
* We have to use the primary MAC for virtual interfaces
@@ -1168,25 +1176,25 @@ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
- Locally Administered address */

}
- net->hard_header_len = ETH_HLEN + drvr_priv->pub.hdrlen;
- net->ethtool_ops = &brcmf_ethtool_ops;
+ ndev->hard_header_len = ETH_HLEN + drvr_priv->pub.hdrlen;
+ ndev->ethtool_ops = &brcmf_ethtool_ops;

- drvr_priv->pub.rxsz = net->mtu + net->hard_header_len +
- drvr_priv->pub.hdrlen;
+ drvr_priv->pub.rxsz = ndev->mtu + ndev->hard_header_len +
+ drvr_priv->pub.hdrlen;

- memcpy(net->dev_addr, temp_addr, ETH_ALEN);
+ memcpy(ndev->dev_addr, temp_addr, ETH_ALEN);

- if (register_netdev(net) != 0) {
+ if (register_netdev(ndev) != 0) {
brcmf_dbg(ERROR, "couldn't register the net device\n");
goto fail;
}

- brcmf_dbg(INFO, "%s: Broadcom Dongle Host Driver\n", net->name);
+ brcmf_dbg(INFO, "%s: Broadcom Dongle Host Driver\n", ndev->name);

return 0;

fail:
- net->netdev_ops = NULL;
+ ndev->netdev_ops = NULL;
return -EBADE;
}

@@ -1225,9 +1233,9 @@ void brcmf_detach(struct brcmf_pub *drvr)
brcmf_del_if(drvr_priv, i);

ifp = drvr_priv->iflist[0];
- if (ifp->net->netdev_ops == &brcmf_netdev_ops_pri) {
- brcmf_netdev_stop(ifp->net);
- unregister_netdev(ifp->net);
+ if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) {
+ brcmf_netdev_stop(ifp->ndev);
+ unregister_netdev(ifp->ndev);
}

cancel_work_sync(&drvr_priv->setmacaddr_work);
@@ -1240,7 +1248,7 @@ void brcmf_detach(struct brcmf_pub *drvr)

brcmf_cfg80211_detach(drvr->config);

- free_netdev(ifp->net);
+ free_netdev(ifp->ndev);
kfree(ifp);
kfree(drvr_priv);
}
@@ -1305,9 +1313,9 @@ static int brcmf_get_pend_8021x_cnt(struct brcmf_info *drvr_priv)

#define MAX_WAIT_FOR_8021X_TX 10

-int brcmf_netdev_wait_pend8021x(struct net_device *dev)
+int brcmf_netdev_wait_pend8021x(struct net_device *ndev)
{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(ndev);
int timeout = 10 * HZ / 1000;
int ntimes = MAX_WAIT_FOR_8021X_TX;
int pend = brcmf_get_pend_8021x_cnt(drvr_priv);
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 45c9e78..b707bc0 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -267,12 +267,12 @@ brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)

/* function for reading/writing a single u32 from/to the dongle */
static int
-brcmf_dev_ioctl_u32(struct net_device *dev, u32 cmd, u32 *par)
+brcmf_dev_ioctl_u32(struct net_device *ndev, u32 cmd, u32 *par)
{
int err;
__le32 par_le = cpu_to_le32(*par);

- err = brcmf_dev_ioctl(dev, cmd, &par_le, sizeof(__le32));
+ err = brcmf_dev_ioctl(ndev, cmd, &par_le, sizeof(__le32));
*par = le32_to_cpu(par_le);

return err;
@@ -292,14 +292,14 @@ static void convert_key_from_CPU(struct brcmf_wsec_key *key,
memcpy(key_le->ea, key->ea, sizeof(key->ea));
}

-static int send_key_to_dongle(struct net_device *dev,
+static int send_key_to_dongle(struct net_device *ndev,
struct brcmf_wsec_key *key)
{
int err;
struct brcmf_wsec_key_le key_le;

convert_key_from_CPU(key, &key_le);
- err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key_le, sizeof(key_le));
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_KEY, &key_le, sizeof(key_le));
if (err)
WL_ERR("WLC_SET_KEY error (%d)\n", err);
return err;
@@ -356,7 +356,7 @@ done:
return err;
}

-static s32 brcmf_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
+static s32 brcmf_dev_intvar_set(struct net_device *ndev, s8 *name, s32 val)
{
s8 buf[BRCMF_C_IOCTL_SMLEN];
u32 len;
@@ -368,7 +368,7 @@ static s32 brcmf_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
sizeof(buf));
BUG_ON(!len);

- err = brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, buf, len);
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR, buf, len);
if (err)
WL_ERR("error (%d)\n", err);

@@ -376,7 +376,7 @@ static s32 brcmf_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
}

static s32
-brcmf_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
+brcmf_dev_intvar_get(struct net_device *ndev, s8 *name, s32 *retval)
{
union {
s8 buf[BRCMF_C_IOCTL_SMLEN];
@@ -390,7 +390,7 @@ brcmf_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
brcmu_mkiovar(name, (char *)(&data_null), 0, (char *)(&var),
sizeof(var.buf));
BUG_ON(!len);
- err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, &var, len);
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_VAR, &var, len);
if (err)
WL_ERR("error (%d)\n", err);

@@ -430,7 +430,7 @@ static void wl_iscan_prep(struct brcmf_scan_params_le *params_le,
}

static s32
-brcmf_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
+brcmf_dev_iovar_setbuf(struct net_device *ndev, s8 * iovar, void *param,
s32 paramlen, void *bufptr, s32 buflen)
{
s32 iolen;
@@ -438,11 +438,11 @@ brcmf_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(!iolen);

- return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, bufptr, iolen);
+ return brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR, bufptr, iolen);
}

static s32
-brcmf_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
+brcmf_dev_iovar_getbuf(struct net_device *ndev, s8 * iovar, void *param,
s32 paramlen, void *bufptr, s32 buflen)
{
s32 iolen;
@@ -450,7 +450,7 @@ brcmf_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(!iolen);

- return brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, bufptr, buflen);
+ return brcmf_dev_ioctl(ndev, BRCMF_C_GET_VAR, bufptr, buflen);
}

static s32
@@ -475,8 +475,8 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
params->action = cpu_to_le16(action);
params->scan_duration = cpu_to_le16(0);

- err = brcmf_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
- iscan->ioctl_buf, BRCMF_C_IOCTL_SMLEN);
+ err = brcmf_dev_iovar_setbuf(iscan->ndev, "iscan", params, params_size,
+ iscan->ioctl_buf, BRCMF_C_IOCTL_SMLEN);
if (err) {
if (err == -EBUSY)
WL_INFO("system busy : iscan canceled\n");
@@ -634,34 +634,34 @@ brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
return err;
}

-static s32 brcmf_set_rts(struct net_device *dev, u32 rts_threshold)
+static s32 brcmf_set_rts(struct net_device *ndev, u32 rts_threshold)
{
s32 err = 0;

- err = brcmf_dev_intvar_set(dev, "rtsthresh", rts_threshold);
+ err = brcmf_dev_intvar_set(ndev, "rtsthresh", rts_threshold);
if (err)
WL_ERR("Error (%d)\n", err);

return err;
}

-static s32 brcmf_set_frag(struct net_device *dev, u32 frag_threshold)
+static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold)
{
s32 err = 0;

- err = brcmf_dev_intvar_set(dev, "fragthresh", frag_threshold);
+ err = brcmf_dev_intvar_set(ndev, "fragthresh", frag_threshold);
if (err)
WL_ERR("Error (%d)\n", err);

return err;
}

-static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l)
+static s32 brcmf_set_retry(struct net_device *ndev, u32 retry, bool l)
{
s32 err = 0;
u32 cmd = (l ? BRCM_SET_LRL : BRCM_SET_SRL);

- err = brcmf_dev_ioctl_u32(dev, cmd, &retry);
+ err = brcmf_dev_ioctl_u32(ndev, cmd, &retry);
if (err) {
WL_ERR("cmd (%d) , error (%d)\n", cmd, err);
return err;
@@ -802,15 +802,15 @@ static void brcmf_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,

static void brcmf_link_down(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct net_device *dev = NULL;
+ struct net_device *ndev = NULL;
s32 err = 0;

WL_TRACE("Enter\n");

if (cfg_priv->link_up) {
- dev = cfg_to_ndev(cfg_priv);
+ ndev = cfg_to_ndev(cfg_priv);
WL_INFO("Call WLC_DISASSOC to stop excess roaming\n ");
- err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_DISASSOC, NULL, 0);
if (err)
WL_ERR("WLC_DISASSOC failed (%d)\n", err);
cfg_priv->link_up = false;
@@ -819,7 +819,7 @@ static void brcmf_link_down(struct brcmf_cfg80211_priv *cfg_priv)
}

static s32
-brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_ibss_params *params)
{
struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
@@ -884,7 +884,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
if (params->privacy)
wsec |= WEP_ENABLED;

- err = brcmf_dev_intvar_set(dev, "wsec", wsec);
+ err = brcmf_dev_intvar_set(ndev, "wsec", wsec);
if (err) {
WL_ERR("wsec failed (%d)\n", err);
goto done;
@@ -896,7 +896,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
else
bcnprd = 100;

- err = brcmf_dev_ioctl_u32(dev, BRCM_SET_BCNPRD, &bcnprd);
+ err = brcmf_dev_ioctl_u32(ndev, BRCM_SET_BCNPRD, &bcnprd);
if (err) {
WL_ERR("WLC_SET_BCNPRD failed (%d)\n", err);
goto done;
@@ -940,7 +940,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,

/* set channel for starter */
target_channel = cfg_priv->channel;
- err = brcmf_dev_ioctl_u32(dev, BRCM_SET_CHANNEL,
+ err = brcmf_dev_ioctl_u32(ndev, BRCM_SET_CHANNEL,
&target_channel);
if (err) {
WL_ERR("WLC_SET_CHANNEL failed (%d)\n", err);
@@ -952,7 +952,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
cfg_priv->ibss_starter = false;


- err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_SSID,
&join_params, join_params_size);
if (err) {
WL_ERR("WLC_SET_SSID failed (%d)\n", err);
@@ -967,7 +967,7 @@ done:
}

static s32
-brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
+brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *ndev)
{
struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
s32 err = 0;
@@ -983,10 +983,10 @@ brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
return err;
}

-static s32 brcmf_set_wpa_version(struct net_device *dev,
+static s32 brcmf_set_wpa_version(struct net_device *ndev,
struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
@@ -998,7 +998,7 @@ static s32 brcmf_set_wpa_version(struct net_device *dev,
else
val = WPA_AUTH_DISABLED;
WL_CONN("setting wpa_auth to 0x%0x\n", val);
- err = brcmf_dev_intvar_set(dev, "wpa_auth", val);
+ err = brcmf_dev_intvar_set(ndev, "wpa_auth", val);
if (err) {
WL_ERR("set wpa_auth failed (%d)\n", err);
return err;
@@ -1008,10 +1008,10 @@ static s32 brcmf_set_wpa_version(struct net_device *dev,
return err;
}

-static s32
-brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
+static s32 brcmf_set_auth_type(struct net_device *ndev,
+ struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
@@ -1037,7 +1037,7 @@ brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
break;
}

- err = brcmf_dev_intvar_set(dev, "auth", val);
+ err = brcmf_dev_intvar_set(ndev, "auth", val);
if (err) {
WL_ERR("set auth failed (%d)\n", err);
return err;
@@ -1048,10 +1048,10 @@ brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
}

static s32
-brcmf_set_set_cipher(struct net_device *dev,
+brcmf_set_set_cipher(struct net_device *ndev,
struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
struct brcmf_cfg80211_security *sec;
s32 pval = 0;
s32 gval = 0;
@@ -1101,7 +1101,7 @@ brcmf_set_set_cipher(struct net_device *dev,
}

WL_CONN("pval (%d) gval (%d)\n", pval, gval);
- err = brcmf_dev_intvar_set(dev, "wsec", pval | gval);
+ err = brcmf_dev_intvar_set(ndev, "wsec", pval | gval);
if (err) {
WL_ERR("error (%d)\n", err);
return err;
@@ -1115,15 +1115,15 @@ brcmf_set_set_cipher(struct net_device *dev,
}

static s32
-brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
+brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;

if (sme->crypto.n_akm_suites) {
- err = brcmf_dev_intvar_get(dev, "wpa_auth", &val);
+ err = brcmf_dev_intvar_get(ndev, "wpa_auth", &val);
if (err) {
WL_ERR("could not get wpa_auth (%d)\n", err);
return err;
@@ -1157,7 +1157,7 @@ brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
}

WL_CONN("setting wpa_auth to %d\n", val);
- err = brcmf_dev_intvar_set(dev, "wpa_auth", val);
+ err = brcmf_dev_intvar_set(ndev, "wpa_auth", val);
if (err) {
WL_ERR("could not set wpa_auth (%d)\n", err);
return err;
@@ -1170,10 +1170,10 @@ brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
}

static s32
-brcmf_set_set_sharedkey(struct net_device *dev,
+brcmf_set_set_sharedkey(struct net_device *ndev,
struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
struct brcmf_cfg80211_security *sec;
struct brcmf_wsec_key key;
s32 val;
@@ -1214,14 +1214,14 @@ brcmf_set_set_sharedkey(struct net_device *dev,
WL_CONN("key length (%d) key index (%d) algo (%d)\n",
key.len, key.index, key.algo);
WL_CONN("key \"%s\"\n", key.data);
- err = send_key_to_dongle(dev, &key);
+ err = send_key_to_dongle(ndev, &key);
if (err)
return err;

if (sec->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) {
WL_CONN("set auth_type to shared key\n");
val = 1; /* shared key */
- err = brcmf_dev_intvar_set(dev, "auth", val);
+ err = brcmf_dev_intvar_set(ndev, "auth", val);
if (err) {
WL_ERR("set auth failed (%d)\n", err);
return err;
@@ -1233,7 +1233,7 @@ brcmf_set_set_sharedkey(struct net_device *dev,
}

static s32
-brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_connect_params *sme)
{
struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
@@ -1265,31 +1265,31 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,

WL_INFO("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len);

- err = brcmf_set_wpa_version(dev, sme);
+ err = brcmf_set_wpa_version(ndev, sme);
if (err) {
WL_ERR("wl_set_wpa_version failed (%d)\n", err);
goto done;
}

- err = brcmf_set_auth_type(dev, sme);
+ err = brcmf_set_auth_type(ndev, sme);
if (err) {
WL_ERR("wl_set_auth_type failed (%d)\n", err);
goto done;
}

- err = brcmf_set_set_cipher(dev, sme);
+ err = brcmf_set_set_cipher(ndev, sme);
if (err) {
WL_ERR("wl_set_set_cipher failed (%d)\n", err);
goto done;
}

- err = brcmf_set_key_mgmt(dev, sme);
+ err = brcmf_set_key_mgmt(ndev, sme);
if (err) {
WL_ERR("wl_set_key_mgmt failed (%d)\n", err);
goto done;
}

- err = brcmf_set_set_sharedkey(dev, sme);
+ err = brcmf_set_set_sharedkey(ndev, sme);
if (err) {
WL_ERR("wl_set_set_sharedkey failed (%d)\n", err);
goto done;
@@ -1312,7 +1312,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,

brcmf_ch_to_chanspec(cfg_priv->channel,
&join_params, &join_params_size);
- err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_SSID,
&join_params, join_params_size);
if (err)
WL_ERR("WLC_SET_SSID failed (%d)\n", err);
@@ -1325,7 +1325,7 @@ done:
}

static s32
-brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *ndev,
u16 reason_code)
{
struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
@@ -1340,7 +1340,7 @@ brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,

memcpy(&scbval.ea, brcmf_read_prof(cfg_priv, WL_PROF_BSSID), ETH_ALEN);
scbval.val = cpu_to_le32(reason_code);
- err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_DISASSOC, &scbval,
sizeof(struct brcmf_scb_val_le));
if (err)
WL_ERR("error (%d)\n", err);
@@ -1432,7 +1432,7 @@ done:
}

static s32
-brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *ndev,
u8 key_idx, bool unicast, bool multicast)
{
u32 index;
@@ -1444,7 +1444,7 @@ brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
if (!check_sys_up(wiphy))
return -EIO;

- err = brcmf_dev_ioctl_u32(dev, BRCMF_C_GET_WSEC, &wsec);
+ err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_GET_WSEC, &wsec);
if (err) {
WL_ERR("WLC_GET_WSEC error (%d)\n", err);
goto done;
@@ -1453,7 +1453,8 @@ brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
if (wsec & WEP_ENABLED) {
/* Just select a new current key */
index = key_idx;
- err = brcmf_dev_ioctl_u32(dev, BRCMF_C_SET_KEY_PRIMARY, &index);
+ err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_SET_KEY_PRIMARY,
+ &index);
if (err)
WL_ERR("error (%d)\n", err);
}
@@ -1463,7 +1464,7 @@ done:
}

static s32
-brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
+brcmf_add_keyext(struct wiphy *wiphy, struct net_device *ndev,
u8 key_idx, const u8 *mac_addr, struct key_params *params)
{
struct brcmf_wsec_key key;
@@ -1480,7 +1481,7 @@ brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
/* check for key index change */
if (key.len == 0) {
/* key delete */
- err = send_key_to_dongle(dev, &key);
+ err = send_key_to_dongle(ndev, &key);
if (err)
return err;
} else {
@@ -1537,8 +1538,8 @@ brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
}
convert_key_from_CPU(&key, &key_le);

- brcmf_netdev_wait_pend8021x(dev);
- err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key_le,
+ brcmf_netdev_wait_pend8021x(ndev);
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_KEY, &key_le,
sizeof(key_le));
if (err) {
WL_ERR("WLC_SET_KEY error (%d)\n", err);
@@ -1549,7 +1550,7 @@ brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
}

static s32
-brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
u8 key_idx, bool pairwise, const u8 *mac_addr,
struct key_params *params)
{
@@ -1566,7 +1567,7 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,

if (mac_addr) {
WL_TRACE("Exit");
- return brcmf_add_keyext(wiphy, dev, key_idx, mac_addr, params);
+ return brcmf_add_keyext(wiphy, ndev, key_idx, mac_addr, params);
}
memset(&key, 0, sizeof(key));

@@ -1611,26 +1612,26 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
goto done;
}

- err = send_key_to_dongle(dev, &key); /* Set the new key/index */
+ err = send_key_to_dongle(ndev, &key); /* Set the new key/index */
if (err)
goto done;

val = WEP_ENABLED;
- err = brcmf_dev_intvar_get(dev, "wsec", &wsec);
+ err = brcmf_dev_intvar_get(ndev, "wsec", &wsec);
if (err) {
WL_ERR("get wsec error (%d)\n", err);
goto done;
}
wsec &= ~(WEP_ENABLED);
wsec |= val;
- err = brcmf_dev_intvar_set(dev, "wsec", wsec);
+ err = brcmf_dev_intvar_set(ndev, "wsec", wsec);
if (err) {
WL_ERR("set wsec error (%d)\n", err);
goto done;
}

val = 1; /* assume shared key. otherwise 0 */
- err = brcmf_dev_ioctl_u32(dev, BRCMF_C_SET_AUTH, &val);
+ err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_SET_AUTH, &val);
if (err)
WL_ERR("WLC_SET_AUTH error (%d)\n", err);
done:
@@ -1639,7 +1640,7 @@ done:
}

static s32
-brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
u8 key_idx, bool pairwise, const u8 *mac_addr)
{
struct brcmf_wsec_key key;
@@ -1660,7 +1661,7 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
WL_CONN("key index (%d)\n", key_idx);

/* Set the new key/index */
- err = send_key_to_dongle(dev, &key);
+ err = send_key_to_dongle(ndev, &key);
if (err) {
if (err == -EINVAL) {
if (key.index >= DOT11_MAX_DEFAULT_KEYS)
@@ -1673,7 +1674,7 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
}

val = 0;
- err = brcmf_dev_intvar_get(dev, "wsec", &wsec);
+ err = brcmf_dev_intvar_get(ndev, "wsec", &wsec);
if (err) {
WL_ERR("get wsec error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1682,7 +1683,7 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
}
wsec &= ~(WEP_ENABLED);
wsec |= val;
- err = brcmf_dev_intvar_set(dev, "wsec", wsec);
+ err = brcmf_dev_intvar_set(ndev, "wsec", wsec);
if (err) {
WL_ERR("set wsec error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1691,7 +1692,7 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
}

val = 0; /* assume open key. otherwise 1 */
- err = brcmf_dev_ioctl_u32(dev, BRCMF_C_SET_AUTH, &val);
+ err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_SET_AUTH, &val);
if (err) {
WL_ERR("WLC_SET_AUTH error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1703,7 +1704,7 @@ done:
}

static s32
-brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie,
void (*callback) (void *cookie, struct key_params * params))
{
@@ -1720,7 +1721,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,

memset(&params, 0, sizeof(params));

- err = brcmf_dev_ioctl_u32(dev, BRCMF_C_GET_WSEC, &wsec);
+ err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_GET_WSEC, &wsec);
if (err) {
WL_ERR("WLC_GET_WSEC error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1760,7 +1761,7 @@ done:

static s32
brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
- struct net_device *dev, u8 key_idx)
+ struct net_device *ndev, u8 key_idx)
{
WL_INFO("Not supported\n");

@@ -1768,7 +1769,7 @@ brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
}

static s32
-brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
u8 *mac, struct station_info *sinfo)
{
struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
@@ -1793,7 +1794,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
}

/* Report the current tx rate */
- err = brcmf_dev_ioctl_u32(dev, BRCMF_C_GET_RATE, &rate);
+ err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_GET_RATE, &rate);
if (err) {
WL_ERR("Could not get rate (%d)\n", err);
} else {
@@ -1804,7 +1805,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,

if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) {
scb_val.val = cpu_to_le32(0);
- err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_RSSI, &scb_val,
sizeof(struct brcmf_scb_val_le));
if (err)
WL_ERR("Could not get rssi (%d)\n", err);
@@ -1821,7 +1822,7 @@ done:
}

static s32
-brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev,
bool enabled, s32 timeout)
{
s32 pm;
@@ -1848,7 +1849,7 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
pm = enabled ? PM_FAST : PM_OFF;
WL_INFO("power save %s\n", (pm ? "enabled" : "disabled"));

- err = brcmf_dev_ioctl_u32(dev, BRCMF_C_SET_PM, &pm);
+ err = brcmf_dev_ioctl_u32(ndev, BRCMF_C_SET_PM, &pm);
if (err) {
if (err == -ENODEV)
WL_ERR("net_device is not ready yet\n");
@@ -1861,7 +1862,7 @@ done:
}

static s32
-brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *ndev,
const u8 *addr,
const struct cfg80211_bitrate_mask *mask)
{
@@ -1879,7 +1880,7 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,

/* addr param is always NULL. ignore it */
/* Get current rateset */
- err = brcmf_dev_ioctl(dev, BRCM_GET_CURR_RATESET, &rateset_le,
+ err = brcmf_dev_ioctl(ndev, BRCM_GET_CURR_RATESET, &rateset_le,
sizeof(rateset_le));
if (err) {
WL_ERR("could not get current rateset (%d)\n", err);
@@ -1907,8 +1908,8 @@ brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
* Set rate override,
* Since the is a/b/g-blind, both a/bg_rate are enforced.
*/
- err_bg = brcmf_dev_intvar_set(dev, "bg_rate", rate);
- err_a = brcmf_dev_intvar_set(dev, "a_rate", rate);
+ err_bg = brcmf_dev_intvar_set(ndev, "bg_rate", rate);
+ err_a = brcmf_dev_intvar_set(ndev, "a_rate", rate);
if (err_bg && err_a) {
WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a);
err = err_bg | err_a;
@@ -2004,7 +2005,7 @@ static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv)
}

static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
- struct net_device *dev, const u8 *bssid)
+ struct net_device *ndev, const u8 *bssid)
{
struct wiphy *wiphy = cfg_to_wiphy(cfg_priv);
struct ieee80211_channel *notify_channel;
@@ -2031,7 +2032,7 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,

*(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX);

- err = brcmf_dev_ioctl(dev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
if (err) {
WL_ERR("WLC_GET_BSS_INFO failed: %d\n", err);
goto CleanUp;
@@ -2214,9 +2215,9 @@ brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan, u32 *status,

memset(&list, 0, sizeof(list));
list.results_le.buflen = cpu_to_le32(WL_ISCAN_BUF_MAX);
- err = brcmf_dev_iovar_getbuf(iscan->dev, "iscanresults", &list,
- BRCMF_ISCAN_RESULTS_FIXED_SIZE, iscan->scan_buf,
- WL_ISCAN_BUF_MAX);
+ err = brcmf_dev_iovar_getbuf(iscan->ndev, "iscanresults", &list,
+ BRCMF_ISCAN_RESULTS_FIXED_SIZE,
+ iscan->scan_buf, WL_ISCAN_BUF_MAX);
if (err) {
WL_ERR("error (%d)\n", err);
return err;
@@ -2352,7 +2353,7 @@ static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv)
int err = 0;

if (cfg_priv->iscan_on) {
- iscan->dev = cfg_to_ndev(cfg_priv);
+ iscan->ndev = cfg_to_ndev(cfg_priv);
brcmf_init_iscan_eloop(&iscan->el);
iscan->timer_ms = WL_ISCAN_TIMER_INTERVAL_MS;
init_timer(&iscan->timer);
@@ -2454,32 +2455,32 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
}

static __used s32
-brcmf_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
+brcmf_dev_bufvar_set(struct net_device *ndev, s8 *name, s8 *buf, s32 len)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
u32 buflen;

buflen = brcmu_mkiovar(name, buf, len, cfg_priv->ioctl_buf,
WL_IOCTL_LEN_MAX);
BUG_ON(!buflen);

- return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, cfg_priv->ioctl_buf,
+ return brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR, cfg_priv->ioctl_buf,
buflen);
}

static s32
-brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
+brcmf_dev_bufvar_get(struct net_device *ndev, s8 *name, s8 *buf,
s32 buf_len)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
u32 len;
s32 err = 0;

len = brcmu_mkiovar(name, NULL, 0, cfg_priv->ioctl_buf,
WL_IOCTL_LEN_MAX);
BUG_ON(!len);
- err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)cfg_priv->ioctl_buf,
- WL_IOCTL_LEN_MAX);
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_VAR, cfg_priv->ioctl_buf,
+ WL_IOCTL_LEN_MAX);
if (err) {
WL_ERR("error (%d)\n", err);
return err;
@@ -2490,7 +2491,7 @@ brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
}

static __used s32
-brcmf_update_pmklist(struct net_device *dev,
+brcmf_update_pmklist(struct net_device *ndev,
struct brcmf_cfg80211_pmk_list *pmk_list, s32 err)
{
int i, j;
@@ -2504,14 +2505,14 @@ brcmf_update_pmklist(struct net_device *dev,
}

if (!err)
- brcmf_dev_bufvar_set(dev, "pmkid_info", (char *)pmk_list,
+ brcmf_dev_bufvar_set(ndev, "pmkid_info", (char *)pmk_list,
sizeof(*pmk_list));

return err;
}

static s32
-brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_pmksa *pmksa)
{
struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
@@ -2539,14 +2540,14 @@ brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
for (i = 0; i < WLAN_PMKID_LEN; i++)
WL_CONN("%02x\n", pmkids->pmkid[pmkids->npmkid].PMKID[i]);

- err = brcmf_update_pmklist(dev, cfg_priv->pmk_list, err);
+ err = brcmf_update_pmklist(ndev, cfg_priv->pmk_list, err);

WL_TRACE("Exit\n");
return err;
}

static s32
-brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_pmksa *pmksa)
{
struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
@@ -2588,7 +2589,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
} else
err = -EINVAL;

- err = brcmf_update_pmklist(dev, cfg_priv->pmk_list, err);
+ err = brcmf_update_pmklist(ndev, cfg_priv->pmk_list, err);

WL_TRACE("Exit\n");
return err;
@@ -2596,7 +2597,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
}

static s32
-brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
+brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *ndev)
{
struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
s32 err = 0;
@@ -2606,7 +2607,7 @@ brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
return -EIO;

memset(cfg_priv->pmk_list, 0, sizeof(*cfg_priv->pmk_list));
- err = brcmf_update_pmklist(dev, cfg_priv->pmk_list, err);
+ err = brcmf_update_pmklist(ndev, cfg_priv->pmk_list, err);

WL_TRACE("Exit\n");
return err;
@@ -2655,7 +2656,7 @@ static s32 brcmf_mode_to_nl80211_iftype(s32 mode)
}

static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
- struct device *dev)
+ struct device *ndev)
{
struct wireless_dev *wdev;
s32 err = 0;
@@ -2672,7 +2673,7 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
err = -ENOMEM;
goto wiphy_new_out;
}
- set_wiphy_dev(wdev->wiphy, dev);
+ set_wiphy_dev(wdev->wiphy, ndev);
wdev->wiphy->max_scan_ssids = WL_NUM_SCAN_MAX;
wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
wdev->wiphy->interface_modes =
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 14a32e1..afc60d9 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -243,7 +243,7 @@ struct brcmf_cfg80211_iscan_eloop {

/* dongle iscan controller */
struct brcmf_cfg80211_iscan_ctrl {
- struct net_device *dev;
+ struct net_device *ndev;
struct timer_list timer;
u32 timer_ms;
u32 timer_on;
--
1.7.1



2011-09-21 13:52:18

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

W dniu 21 września 2011 15:40 użytkownik John W. Linville
<[email protected]> napisał:
> On Tue, Sep 20, 2011 at 10:56:49PM +0200, Rafał Miłecki wrote:
>> 2011/9/20 Johannes Berg <[email protected]>:
>> > On Tue, 2011-09-20 at 06:03 -0700, Greg KH wrote:
>> >
>> >> And while code is great and nice, I still haven't seen any real answers
>> >> to all of the questions that were asked of the Broadcom driver team
>> >> during that review by the linux-wireless developers about how things
>> >> will be handled properly due to the overlap in functionality with the
>> >> existing "real" driver in the tree.
>> >
>> > Let's qualify this to "some developers".
>> >
>> > One thing I'd like to point out is that the Broadcom's firmware API has
>> > always undergone changes over time. I'm actually surprised that b43
>> > works as well as it does (which, tbh, isn't very well at all, at least
>> > for me with some 11n PHY). I also don't think that Broadcom are going to
>> > maintain compatibility and/or maintain new firmware features for old
>> > devices, that just doesn't make any sense.
>>
>> Actually, when we got some single response from Broadcom about their
>> relation to b43, they haven't mentioned support for old HW is any
>> problem at all. They just pointed we don't support calibration for
>> N-PHY and we don't support 802.11n feature for a better performance.
>>
>> I feel we're creating some problems ourself. Just some guessing that
>> support for older HW can be real problem for future development... not
>> confirmed by anyone at all.
>
> Their new firmware doesn't run on the older hardware, no?

AFAIK it does (unless you mean hardware covered by b43legacy).

If you take a look at 666.2 firmware, it's still available for core 5
(and 9, 13, etc.)

--
Rafał

2011-09-22 09:04:55

by Arend van Spriel

[permalink] [raw]
Subject: RE: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

PiBGcm9tOiBsaW51eC13aXJlbGVzcy1vd25lckB2Z2VyLmtlcm5lbC5vcmcgW21haWx0bzpsaW51
eC13aXJlbGVzcy0NCj4gb3duZXJAdmdlci5rZXJuZWwub3JnXSBPbiBCZWhhbGYgT2YgSGF1a2Ug
TWVocnRlbnMNCj4gU2VudDogZG9uZGVyZGFnIDIyIHNlcHRlbWJlciAyMDExIDg6NDcNCj4gVG86
IEJyZXR0IFJ1ZGxleQ0KPiBDYzogUmFmYcWCIE1pxYJlY2tpOyBHcmVnIEtIOyBKb2huIFcuIExp
bnZpbGxlOyBGcmFua3kgKFpoZW5odWkpIExpbjsNCj4gZ3JlZ2toQHN1c2UuZGU7IGRldmVsQGxp
bnV4ZHJpdmVycHJvamVjdC5vcmc7IGxpbnV4LQ0KPiB3aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmcN
Cj4gU3ViamVjdDogUmU6IFtQQVRDSCAwMC8yMF0gc3RhZ2luZzogYnJjbTgwMjExOiA3dGggcmVh
Y3Rpb24gZm9yDQo+IG1haW5saW5lIHBhdGNoICMyDQo+IA0KPiBPbiAwOS8yMi8yMDExIDEyOjEy
IEFNLCBCcmV0dCBSdWRsZXkgd3JvdGU6DQo+ID4+PiBPdXIgb3JpZ2luYWwgcGxhbiB3YXMgdG8g
cmVtYWluIGEgc2VwYXJhdGUgZHJpdmVyIGZyb20gYjQzLiBXZSB3ZXJlDQo+ID4+IGF3YXJlIG9m
IGl0IGFuZCBhbGwgdGhlIGdvb2Qgd29yayB0aGF0IGhhZCBiZWVuIGRvbmUgdG8gY3JlYXRlIGl0
DQo+IGFuZCB3ZQ0KPiA+PiBoYWQgbm8gaW50ZW50aW9uIG9mIGludGVyZmVyaW5nIHdpdGggaXQu
ICBBdCB0aGF0IHBvaW50IHRoZXJlIGhhZA0KPiBub3QNCj4gPj4gYmVlbiB2ZXJ5IG11Y2ggcmVj
ZW50IG1vdmVtZW50IGluIGI0MyBhbmQgaXQgZGlkIG5vdCBzdXBwb3J0IGFueSBvZg0KPiBvdXIN
Cj4gPj4gQVhJIGJhc2VkIGNoaXBzLiAgV2UgZmlndXJlZCB0aGF0IHNzYiB2cyBBWEkgd2FzIGEg
Z29vZCBkaXZpZGluZw0KPiBsaW5lIGFuZA0KPiA+PiB0aGVyZSB3b3VsZCBiZSBubyBjb25mbGlj
dCwgYW5kIHRoZXJlIHdhc24ndCBpbml0aWFsbHkuDQo+ID4+DQo+ID4+IFRoZSBmaXJzdCBvYnZp
b3VzIHByb2JsZW0gaXMgdGhhdCB0aGVyZSBhcmUgU1NCIGFuZCBCQ01BIChha2EgQVhJKQ0KPiA+
PiBjYXJkcyB1c2luZyBOLVBIWS4gVGhhdCByZXN1bHRlZCBpbiBQSFkgY29kZSBkdXBsaWNhdGlv
biBiZXR3ZWVuIGI0Mw0KPiA+PiBhbmQgYnJjbXNtYWMuIEFuZCBzaW5jZSB3ZSBhbHJlYWR5IHN1
cHBvcnRlZCBOLVBIWSBpbiBiNDMsIGFkZGluZw0KPiBiY21hDQo+ID4+IHN1cHBvcnQgYXV0b21h
dGljYWxseSBnYXZlIHVzIEJDTTQzMjI0IGFuZCBCQ000MzIyNSBzdXBwb3J0LiBUaGF0IG9mDQo+
ID4+IGNvdXJzZSBtZWFucyBkdXBsaWNhdGVkIHN1cHBvcnRlZCBmb3IgdGhlIHNhbWUgaGFyZHdh
cmUuDQo+ID4NCj4gPiBBZ3JlZSwgd2hlbiB5b3UgY3JlYXRlZCBiY21hLCBpdCBkaWQgZHVwbGlj
YXRlIEhXIHN1cHBvcnQgYWxyZWFkeSBpbg0KPiBicmNtc21hYy4gIFdoeSBkaWRuJ3QgeW91IGFk
ZHJlc3MgdGhhdCB0aGVuPw0KPiANCj4gYmNtYSBpcyBub3Qgb25seSB1c2VkIHRvIHN1cHBvcnQg
dGhlIGJ1cyBvbiBhIHBjaSBiYXNlZCB3aXJlbGVzcyBjYXJkcw0KPiBpdCBub3cgYWxzbyBjb250
YWlucyBzdXBwb3J0IGZvciBTb0NzIGxpa2UgdGhlIEJDTTQ3MTguIFRoZXJlIGl0DQo+IHByb3Zp
ZGVzIGEgY29tbW9uIGludGVyZmFjZSB0byB0aGUgaGFyZHdhcmUgZm9yIHRoZSB3aXJlbGVzcyBz
byB0aGF0DQo+IHRoZXJlIHdlcmUgbm8gY2hhbmdlcyBpbiBiNDMgbmVlZGVkIHRvIGdldCB0aGUg
d2lyZWxlc3MgY29yZSBydW5uaW5nIG9uDQo+IHRoaXMgU29DLiBJdCBhbHNvIHByb3ZpZGVzIHNv
bWUgcGFydHMgbmVlZGVkIHRvIGdldCB0aGUgU29DIGJvb3QgaW4NCj4gTGludXggYW5kIHNvIG9u
LCBzb21lIHBhcnRzIGFyZSByZWxhdGVkIHRvIHRoZSBNSVBTIENQVSBhbmQgbm90IHJlbGF0ZWQN
Cj4gdG8gdGhlIHdpcmVsZXNzIGNvcmUsIHNvIGl0IG1ha2VzIHNlbnNlIHRvIHB1dCB0aGF0IGlu
dG8gYW4gb3duIG1vZHVsZS4NCj4gDQo+IEhhdWtlDQoNCllvdSBhcmUgcmlnaHQuIEJDTUEgaW4g
aXRzZWxmIG9ubHkgZHVwbGljYXRlcyBwYXJ0IG9mIHdoYXQgaXMgaW4gYnJjbXNtYWMNCmFuZCBp
dHMgZXhpc3RlbmNlIHByb3ZpZGVzIGdvb2QgZnVuY3Rpb25hbCBzZXBhcmF0aW9uLiBUaGF0IGlz
IHdoeSB3ZSBmdWxseQ0KaW50ZW5kIHRvIGhhdmUgYnJjbXNtYWMgdXNlIGJjbWEuIEJyZXR0IG1l
YW50IHRoYXQgdGhlIGR1cGxpY2F0aW9uIHN0YXJ0ZWQNCndoZW4gYjQzIHdhcyBnZXR0aW5nIHBh
dGNoZXMgZm9yIGJjbWEgc3VwcG9ydC4NCg0KUmFmYcWCIGluZGljYXRlZCB0aGF0IGI0MyB0ZWFt
IHdhcyB3b3JraW5nIG9uIG4tcGh5IHN1cHBvcnQgd2hlbiB3ZSByZWxlYXNlZA0KdGhlIGJyY204
MDIxMSBkcml2ZXIgKGFrYSBicmNtc21hYykuIE5vIG9uZSBpbmRpY2F0ZWQgdGhpcyBiZWZvcmUg
c28gSSBjYW4NCm9ubHkgYXNzdW1lIHRoYXQgYjQzIGRlY2lkZWQgdG8gbW92ZSBvbiBidWlsZGlu
ZyBiY21hIGFuZCBoYXZlIG5vIGludGVyZXN0DQppbiBicmNtc21hYyBtb3ZpbmcgaW4gdGhlIGxp
bnV4IHRyZWUuDQoNCkdyLiBBdlMNCg==


2011-09-20 13:40:23

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/20 Johannes Berg <[email protected]>:
> On Tue, 2011-09-20 at 06:03 -0700, Greg KH wrote:
>
>> And while code is great and nice, I still haven't seen any real answers
>> to all of the questions that were asked of the Broadcom driver team
>> during that review by the linux-wireless developers about how things
>> will be handled properly due to the overlap in functionality with the
>> existing "real" driver in the tree.
>
> Let's qualify this to "some developers".
>
> One thing I'd like to point out is that the Broadcom's firmware API has
> always undergone changes over time. I'm actually surprised that b43
> works as well as it does (which, tbh, isn't very well at all, at least
> for me with some 11n PHY). I also don't think that Broadcom are going to
> maintain compatibility and/or maintain new firmware features for old
> devices, that just doesn't make any sense.

It's hard to talk about API compatibility breakage, until it really
happens. So far we support all firmwares, I don't have much more to
say about that. We can decide about some driver splitting, when API
breakage really happens. Now I think that are just thoeritical talks.


> As a consequence, I don't think there's any sense in saying b43 should
> be the driver that Broadcom must support upstream. Even we, back then,
> split b43 into b43 and b43legacy when it wasn't really possible any more
> to test and maintain a single driver for different devices. Rafal has
> shown that it is possible today (to some extent) to do that for the
> newer chips and the older 11g only chips that b43 still supports, but
> I'm not convinced that with new features like P2P this will be true in
> the future.

That's what we try to discuss with Broadcom. If they really see a
requirement to split driver into 2, they have to explain that and
discuss it with us.

I'm flexible, I've accepted Michaels' view on SSB & BCMA. We just need
to make Broadcom talk with us.


> And this is just discussing the technical side -- the support side is an
> entirely different question.
>
> Now, don't get me wrong -- I don't think the duplication is a good
> thing. A lot of the PHY code could be shared. However, I think it will
> probably not be possible for much longer to share the higher level MAC
> code that programs the SHM etc.
>
> So I don't claim to know what the solution is, but I think simply
> rejecting the Broadcom effort like most people seem to imply is a good
> solution at all. It will leave all of us in a bad spot by creating a
> driver that has to support too many different devices.

Having Broadcom ignoring all out questions and just sending more&more
patches is not good as well. How differently we can make them talk?
I've requested for discussion several times.

--
Rafał

2011-09-22 06:36:15

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

W dniu 22 września 2011 04:07 użytkownik Brett Rudley
<[email protected]> napisał:
>> > We did however initially propose (and implement) a dividing line of ssb
>> chips for b43 and AXI based chips for brcmsmac but b43 team chose to
>> ignore/reject that.
>>
>> Well, what about embedded, for instance?
>
> I was referring to smac. There isn't any controversy over fmac AFAIK.

I was question about embedded devices like routers I believe.

--
Rafał

2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 16/20] staging: brcm80211: removed log after kzalloc()/kmalloc() failure

From: Roland Vossen <[email protected]>

kzalloc/kmalloc already reports an allocation failure themselves.

Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 4 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 13 ++----
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 19 ++------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 26 ++---------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 50 ++++++----------------
drivers/staging/brcm80211/brcmsmac/ampdu.c | 6 +--
drivers/staging/brcm80211/brcmsmac/antsel.c | 5 +--
drivers/staging/brcm80211/brcmsmac/channel.c | 5 +--
drivers/staging/brcm80211/brcmsmac/dma.c | 16 +------
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 11 +----
drivers/staging/brcm80211/brcmsmac/nicpci.c | 3 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.c | 7 +--
12 files changed, 41 insertions(+), 124 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 28bdf9e..91b4d3c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -417,10 +417,8 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)
struct brcmf_proto *cdc;

cdc = kzalloc(sizeof(struct brcmf_proto), GFP_ATOMIC);
- if (!cdc) {
- brcmf_dbg(ERROR, "kmalloc failed\n");
+ if (!cdc)
goto fail;
- }

/* ensure that the msg buf directly follows the cdc msg struct */
if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) {
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 0c41c1c..963d1a9 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -562,10 +562,9 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
struct brcmf_pkt_filter_enable *pkt_filterp;

arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
- if (!arg_save) {
- brcmf_dbg(ERROR, "kmalloc failed\n");
+ if (!arg_save)
goto fail;
- }
+
arg_org = arg_save;
memcpy(arg_save, arg, strlen(arg) + 1);

@@ -635,18 +634,14 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
char *arg_save = NULL, *arg_org = NULL;

arg_save = kstrdup(arg, GFP_ATOMIC);
- if (!arg_save) {
- brcmf_dbg(ERROR, "kmalloc failed\n");
+ if (!arg_save)
goto fail;
- }

arg_org = arg_save;

buf = kmalloc(PKTFILTER_BUF_SIZE, GFP_ATOMIC);
- if (!buf) {
- brcmf_dbg(ERROR, "kmalloc failed\n");
+ if (!buf)
goto fail;
- }

argv[i] = strsep(&arg_save, " ");
while (argv[i++])
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index cc8564a..659a9c2 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -159,11 +159,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work)

buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETH_ALEN);
bufp = buf = kmalloc(buflen, GFP_ATOMIC);
- if (!bufp) {
- brcmf_dbg(ERROR, "%s: out of memory for mcast_list, cnt %d\n",
- brcmf_ifname(&drvr_priv->pub, 0), cnt);
+ if (!bufp)
return;
- }

strcpy(bufp, "mcast_list");
bufp += strlen("mcast_list") + 1;
@@ -202,11 +199,9 @@ static void _brcmf_set_multicast_list(struct work_struct *work)

buflen = sizeof("allmulti") + sizeof(allmulti);
buf = kmalloc(buflen, GFP_ATOMIC);
- if (!buf) {
- brcmf_dbg(ERROR, "%s: out of memory for allmulti\n",
- brcmf_ifname(&drvr_priv->pub, 0));
+ if (!buf)
return;
- }
+
allmulti_le = cpu_to_le32(allmulti);

if (!brcmu_mkiovar
@@ -963,10 +958,8 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, struct net_device *net,
ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
- if (!ifp) {
- brcmf_dbg(ERROR, "OOM - struct brcmf_if\n");
+ if (!ifp)
return -ENOMEM;
- }
}

memset(ifp, 0, sizeof(struct brcmf_if));
@@ -1019,10 +1012,8 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)

/* Allocate primary brcmf_info */
drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC);
- if (!drvr_priv) {
- brcmf_dbg(ERROR, "OOM - alloc brcmf_info\n");
+ if (!drvr_priv)
goto fail;
- }

/*
* Save the brcmf_info into the priv
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 66ab752..9f8bcb3 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -2956,10 +2956,8 @@ static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus)
/* Get full mem size */
size = bus->ramsize;
buf = kmalloc(size, GFP_ATOMIC);
- if (!buf) {
- brcmf_dbg(ERROR, "Out of memory (%d bytes)\n", size);
+ if (!buf)
return -1;
- }

/* Read mem content */
printk(KERN_DEBUG "Dump dongle memory");
@@ -3013,7 +3011,6 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
size = msize;
mbuffer = data = kmalloc(msize, GFP_ATOMIC);
if (mbuffer == NULL) {
- brcmf_dbg(ERROR, "kmalloc(%d) failed\n", msize);
bcmerror = -ENOMEM;
goto done;
}
@@ -3021,7 +3018,6 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)

str = kmalloc(maxstrlen, GFP_ATOMIC);
if (str == NULL) {
- brcmf_dbg(ERROR, "kmalloc(%d) failed\n", maxstrlen);
bcmerror = -ENOMEM;
goto done;
}
@@ -3737,8 +3733,6 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus)

memptr = memblock = kmalloc(MEMBLOCK + BRCMF_SDALIGN, GFP_ATOMIC);
if (memblock == NULL) {
- brcmf_dbg(ERROR, "Failed to allocate memory %d bytes\n",
- MEMBLOCK);
ret = -ENOMEM;
goto err;
}
@@ -3837,8 +3831,6 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus)

memblock = kmalloc(MEMBLOCK, GFP_ATOMIC);
if (memblock == NULL) {
- brcmf_dbg(ERROR, "Failed to allocate memory %d bytes\n",
- MEMBLOCK);
ret = -ENOMEM;
goto err;
}
@@ -4254,18 +4246,13 @@ static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus)
roundup((bus->drvr->maxctl + SDPCM_HDRLEN),
ALIGNMENT) + BRCMF_SDALIGN;
bus->rxbuf = kmalloc(bus->rxblen, GFP_ATOMIC);
- if (!(bus->rxbuf)) {
- brcmf_dbg(ERROR, "kmalloc of %d-byte rxbuf failed\n",
- bus->rxblen);
+ if (!(bus->rxbuf))
goto fail;
- }
}

/* Allocate buffer to receive glomed packet */
bus->databuf = kmalloc(MAX_DATA_BUF, GFP_ATOMIC);
if (!(bus->databuf)) {
- brcmf_dbg(ERROR, "kmalloc of %d-byte databuf failed\n",
- MAX_DATA_BUF);
/* release rxbuf which was already located as above */
if (!bus->rxblen)
kfree(bus->rxbuf);
@@ -4457,10 +4444,8 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)

/* alloc chip_info_t */
ci = kzalloc(sizeof(struct chip_info), GFP_ATOMIC);
- if (NULL == ci) {
- brcmf_dbg(ERROR, "malloc failed!\n");
+ if (NULL == ci)
return -ENOMEM;
- }

/* bus/core/clk setup for register access */
/* Try forcing SDIO core to do ALPAvail request only */
@@ -4785,10 +4770,9 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,

/* Allocate private bus interface state */
bus = kzalloc(sizeof(struct brcmf_bus), GFP_ATOMIC);
- if (!bus) {
- brcmf_dbg(ERROR, "kmalloc of struct dhd_bus failed\n");
+ if (!bus)
goto fail;
- }
+
bus->sdiodev = sdiodev;
sdiodev->bus = bus;
bus->txbound = BRCMF_TXBOUND;
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 6acaaae..d0ae2b6 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -2023,7 +2023,6 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,

buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
if (buf == NULL) {
- WL_ERR("kzalloc() failed\n");
err = -ENOMEM;
goto CleanUp;
}
@@ -2660,10 +2659,9 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
s32 err = 0;

wdev = kzalloc(sizeof(*wdev), GFP_KERNEL);
- if (!wdev) {
- WL_ERR("Could not allocate wireless device\n");
+ if (!wdev)
return ERR_PTR(-ENOMEM);
- }
+
wdev->wiphy =
wiphy_new(&wl_cfg80211_ops,
sizeof(struct brcmf_cfg80211_priv) + sizeof_iface);
@@ -3124,51 +3122,33 @@ static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
{
cfg_priv->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
- if (!cfg_priv->scan_results) {
- WL_ERR("Scan results alloc failed\n");
+ if (!cfg_priv->scan_results)
goto init_priv_mem_out;
- }
cfg_priv->conf = kzalloc(sizeof(*cfg_priv->conf), GFP_KERNEL);
- if (!cfg_priv->conf) {
- WL_ERR("wl_conf alloc failed\n");
+ if (!cfg_priv->conf)
goto init_priv_mem_out;
- }
cfg_priv->profile = kzalloc(sizeof(*cfg_priv->profile), GFP_KERNEL);
- if (!cfg_priv->profile) {
- WL_ERR("wl_profile alloc failed\n");
+ if (!cfg_priv->profile)
goto init_priv_mem_out;
- }
cfg_priv->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
- if (!cfg_priv->bss_info) {
- WL_ERR("Bss information alloc failed\n");
+ if (!cfg_priv->bss_info)
goto init_priv_mem_out;
- }
cfg_priv->scan_req_int = kzalloc(sizeof(*cfg_priv->scan_req_int),
GFP_KERNEL);
- if (!cfg_priv->scan_req_int) {
- WL_ERR("Scan req alloc failed\n");
+ if (!cfg_priv->scan_req_int)
goto init_priv_mem_out;
- }
cfg_priv->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL);
- if (!cfg_priv->ioctl_buf) {
- WL_ERR("Ioctl buf alloc failed\n");
+ if (!cfg_priv->ioctl_buf)
goto init_priv_mem_out;
- }
cfg_priv->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
- if (!cfg_priv->extra_buf) {
- WL_ERR("Extra buf alloc failed\n");
+ if (!cfg_priv->extra_buf)
goto init_priv_mem_out;
- }
cfg_priv->iscan = kzalloc(sizeof(*cfg_priv->iscan), GFP_KERNEL);
- if (!cfg_priv->iscan) {
- WL_ERR("Iscan buf alloc failed\n");
+ if (!cfg_priv->iscan)
goto init_priv_mem_out;
- }
cfg_priv->pmk_list = kzalloc(sizeof(*cfg_priv->pmk_list), GFP_KERNEL);
- if (!cfg_priv->pmk_list) {
- WL_ERR("pmk list alloc failed\n");
+ if (!cfg_priv->pmk_list)
goto init_priv_mem_out;
- }

return 0;

@@ -3210,10 +3190,8 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
s32 err = 0;

e = kzalloc(sizeof(struct brcmf_cfg80211_event_q), GFP_KERNEL);
- if (!e) {
- WL_ERR("event alloc failed\n");
+ if (!e)
return -ENOMEM;
- }

e->etype = event;
memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));
@@ -3333,10 +3311,8 @@ struct brcmf_cfg80211_dev *brcmf_cfg80211_attach(struct net_device *ndev,
return NULL;
}
cfg_dev = kzalloc(sizeof(struct brcmf_cfg80211_dev), GFP_KERNEL);
- if (!cfg_dev) {
- WL_ERR("wl_cfg80211_dev is invalid\n");
+ if (!cfg_dev)
return NULL;
- }

wdev = brcmf_alloc_wdev(sizeof(struct brcmf_cfg80211_iface), busdev);
if (IS_ERR(wdev)) {
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.c b/drivers/staging/brcm80211/brcmsmac/ampdu.c
index d221a3a..b94d60c 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.c
@@ -227,11 +227,9 @@ struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc)
int i;

ampdu = kzalloc(sizeof(struct ampdu_info), GFP_ATOMIC);
- if (!ampdu) {
- wiphy_err(wlc->wiphy, "wl%d: brcms_c_ampdu_attach: out of mem"
- "\n", wlc->pub->unit);
+ if (!ampdu)
return NULL;
- }
+
ampdu->wlc = wlc;

for (i = 0; i < AMPDU_MAX_SCB_TID; i++)
diff --git a/drivers/staging/brcm80211/brcmsmac/antsel.c b/drivers/staging/brcm80211/brcmsmac/antsel.c
index 29b51a1..c61c520 100644
--- a/drivers/staging/brcm80211/brcmsmac/antsel.c
+++ b/drivers/staging/brcm80211/brcmsmac/antsel.c
@@ -110,11 +110,8 @@ struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc)
struct antsel_info *asi;

asi = kzalloc(sizeof(struct antsel_info), GFP_ATOMIC);
- if (!asi) {
- wiphy_err(wlc->wiphy, "wl%d: brcms_c_antsel_attach: out of "
- "mem\n", wlc->pub->unit);
+ if (!asi)
return NULL;
- }

asi->wlc = wlc;
asi->pub = wlc->pub;
diff --git a/drivers/staging/brcm80211/brcmsmac/channel.c b/drivers/staging/brcm80211/brcmsmac/channel.c
index af01c9d..a9defe2 100644
--- a/drivers/staging/brcm80211/brcmsmac/channel.c
+++ b/drivers/staging/brcm80211/brcmsmac/channel.c
@@ -1090,11 +1090,8 @@ struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc)
BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);

wlc_cm = kzalloc(sizeof(struct brcms_cm_info), GFP_ATOMIC);
- if (wlc_cm == NULL) {
- wiphy_err(wlc->wiphy, "wl%d: %s: out of memory", pub->unit,
- __func__);
+ if (wlc_cm == NULL)
return NULL;
- }
wlc_cm->pub = pub;
wlc_cm->wlc = wlc;
wlc->cmi = wlc_cm;
diff --git a/drivers/staging/brcm80211/brcmsmac/dma.c b/drivers/staging/brcm80211/brcmsmac/dma.c
index 06990b3..714c74c 100644
--- a/drivers/staging/brcm80211/brcmsmac/dma.c
+++ b/drivers/staging/brcm80211/brcmsmac/dma.c
@@ -559,12 +559,8 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,

/* allocate private info structure */
di = kzalloc(sizeof(struct dma_info), GFP_ATOMIC);
- if (di == NULL) {
-#ifdef BCMDBG
- printk(KERN_ERR "dma_attach: out of memory\n");
-#endif
+ if (di == NULL)
return NULL;
- }

di->msg_level = msg_level ? msg_level : &dma_msg_level;

@@ -651,22 +647,16 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
if (ntxd) {
size = ntxd * sizeof(void *);
di->txp = kzalloc(size, GFP_ATOMIC);
- if (di->txp == NULL) {
- DMA_ERROR(("%s: dma_attach: out of tx memory\n",
- di->name));
+ if (di->txp == NULL)
goto fail;
- }
}

/* allocate rx packet pointer vector */
if (nrxd) {
size = nrxd * sizeof(void *);
di->rxp = kzalloc(size, GFP_ATOMIC);
- if (di->rxp == NULL) {
- DMA_ERROR(("%s: dma_attach: out of rx memory\n",
- di->name));
+ if (di->rxp == NULL)
goto fail;
- }
}

/*
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 65d30b5..32d7abf 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -1541,11 +1541,8 @@ struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
struct brcms_timer *t;

t = kzalloc(sizeof(struct brcms_timer), GFP_ATOMIC);
- if (!t) {
- wiphy_err(wl->wiphy, "wl%d: brcms_init_timer: out of memory\n",
- wl->pub->unit);
+ if (!t)
return NULL;
- }

init_timer(&t->timer);
t->timer.data = (unsigned long) t;
@@ -1659,11 +1656,9 @@ int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, u32 idx)
pdata = wl->fw.fw_bin[i]->data +
le32_to_cpu(hdr->offset);
*pbuf = kmalloc(len, GFP_ATOMIC);
- if (*pbuf == NULL) {
- wiphy_err(wl->wiphy, "fail to alloc %d"
- " bytes\n", len);
+ if (*pbuf == NULL)
goto fail;
- }
+
memcpy(*pbuf, pdata, len);
return 0;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/nicpci.c b/drivers/staging/brcm80211/brcmsmac/nicpci.c
index a2cab5c..f5a2695 100644
--- a/drivers/staging/brcm80211/brcmsmac/nicpci.c
+++ b/drivers/staging/brcm80211/brcmsmac/nicpci.c
@@ -245,9 +245,8 @@ struct pcicore_info *pcicore_init(struct si_pub *sih, struct pci_dev *pdev,

/* alloc struct pcicore_info */
pi = kzalloc(sizeof(struct pcicore_info), GFP_ATOMIC);
- if (pi == NULL) {
+ if (pi == NULL)
return NULL;
- }

pi->sih = sih;
pi->dev = pdev;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy_shim.c b/drivers/staging/brcm80211/brcmsmac/phy_shim.c
index 31c9374..e0c19b6 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy_shim.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy_shim.c
@@ -41,12 +41,9 @@ struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
struct phy_shim_info *physhim = NULL;

physhim = kzalloc(sizeof(struct phy_shim_info), GFP_ATOMIC);
- if (!physhim) {
- wiphy_err(wlc_hw->wlc->wiphy,
- "wl%d: wlc_phy_shim_attach: out of mem\n",
- wlc_hw->unit);
+ if (!physhim)
return NULL;
- }
+
physhim->wlc_hw = wlc_hw;
physhim->wlc = wlc;
physhim->wl = wl;
--
1.7.1



2011-09-21 23:29:08

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Wed, 21 Sep 2011 16:15:10 -0700
"Brett Rudley" <[email protected]> wrote:

> We did however initially propose (and implement) a dividing line of ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose to ignore/reject that.

Well, what about embedded, for instance?

> I'm not totally opposed to that idea but it does not solve the primary issue of conflicting b43 and brcmsmac modules.

I'm not convinced that this is an issue at all and I'm not convinced that it has to be resolved.
At least not now.

--
Greetings, Michael.

2011-09-19 21:26:26

by Franky Lin

[permalink] [raw]
Subject: [PATCH 01/20] staging: brcm80211: sparse endianness warnings on dongle events

From: Roland Vossen <[email protected]>

Structures received from dongle have been annotated.

Reported-by: Johannes Berg <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 14 ++++++------
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 3 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 21 ++++++++++---------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 24 +++++++++++-----------
4 files changed, 32 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index da53dd0..c368f71 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -134,13 +134,13 @@
#define BRCMF_EVENT_MSG_GROUP 0x04

struct brcmf_event_msg {
- u16 version;
- u16 flags;
- u32 event_type;
- u32 status;
- u32 reason;
- u32 auth_type;
- u32 datalen;
+ __be16 version;
+ __be16 flags;
+ __be32 event_type;
+ __be32 status;
+ __be32 reason;
+ __be32 auth_type;
+ __be32 datalen;
u8 addr[ETH_ALEN];
char ifname[IFNAMSIZ];
} __packed;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 0d8389e..6f65683 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -322,7 +322,8 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
/* Intercept the wme_dp ioctl here */
if (!ret && ioc->cmd == BRCMF_C_SET_VAR &&
!strcmp(ioc->buf, "wme_dp")) {
- int slen, val = 0;
+ int slen;
+ __le32 val = 0;

slen = strlen("wme_dp") + 1;
if (len >= (int)(slen + sizeof(int)))
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 02c022a..c9bf92a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -53,15 +53,15 @@ static const char brcmf_version[] =
struct msgtrace_hdr {
u8 version;
u8 spare;
- u16 len; /* Len of the trace */
- u32 seqnum; /* Sequence number of message. Useful
+ __be16 len; /* Len of the trace */
+ __be32 seqnum; /* Sequence number of message. Useful
* if the messsage has been lost
* because of DMA error or a bus reset
* (ex: SDIO Func2)
*/
- u32 discarded_bytes; /* Number of discarded bytes because of
+ __be32 discarded_bytes; /* Number of discarded bytes because of
trace overflow */
- u32 discarded_printf; /* Number of discarded printf
+ __be32 discarded_printf; /* Number of discarded printf
because of trace overflow */
} __packed;

@@ -401,7 +401,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)

case BRCMF_E_RSSI:
brcmf_dbg(EVENT, "MACEVENT: %s %d\n",
- event_name, be32_to_cpu(*((int *)event_data)));
+ event_name, be32_to_cpu(*((__be32 *)event_data)));
break;

default:
@@ -498,14 +498,15 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,

/* put it back to BRCMF_E_NDIS_LINK */
if (type == BRCMF_E_NDIS_LINK) {
- u32 temp;
+ u32 temp1;
+ __be32 temp2;

- temp = get_unaligned_be32(&event->event_type);
+ temp1 = get_unaligned_be32(&event->event_type);
brcmf_dbg(TRACE, "Converted to WLC_E_LINK type %d\n",
- temp);
+ temp1);

- temp = be32_to_cpu(BRCMF_E_NDIS_LINK);
- memcpy((void *)(&pvt_data->msg.event_type), &temp,
+ temp2 = cpu_to_be32(BRCMF_E_NDIS_LINK);
+ memcpy((void *)(&pvt_data->msg.event_type), &temp2,
sizeof(pvt_data->msg.event_type));
}
break;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 720f567..fb9b351 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -63,10 +63,10 @@ struct brcmf_trap {

#define CBUF_LEN (128)

-struct rte_log {
- u32 buf; /* Can't be pointer on (64-bit) hosts */
- uint buf_size;
- uint idx;
+struct rte_log_le {
+ __le32 buf; /* Can't be pointer on (64-bit) hosts */
+ __le32 buf_size;
+ __le32 idx;
char *_buf_compat; /* Redundant pointer for backward compat. */
};

@@ -89,7 +89,7 @@ struct rte_console {
* Output will be lost if the output wraps around faster than the host
* polls.
*/
- struct rte_log log;
+ struct rte_log_le log_le;

/* Console input line buffer
* Characters are read one at a time into cbuf
@@ -512,7 +512,7 @@ struct sdpcmd_regs {
struct brcmf_console {
uint count; /* Poll interval msec counter */
uint log_addr; /* Log struct address (fixed) */
- struct rte_log log; /* Log struct (host copy) */
+ struct rte_log_le log_le; /* Log struct (host copy) */
uint bufsize; /* Size of log buffer */
u8 *buf; /* Log buffer (host copy) */
uint last; /* Last buffer read index */
@@ -3153,21 +3153,21 @@ static int brcmf_sdbrcm_readconsole(struct brcmf_bus *bus)
return 0;

/* Read console log struct */
- addr = bus->console_addr + offsetof(struct rte_console, log);
- rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *)&c->log,
- sizeof(c->log));
+ addr = bus->console_addr + offsetof(struct rte_console, log_le);
+ rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *)&c->log_le,
+ sizeof(c->log_le));
if (rv < 0)
return rv;

/* Allocate console buffer (one time only) */
if (c->buf == NULL) {
- c->bufsize = le32_to_cpu(c->log.buf_size);
+ c->bufsize = le32_to_cpu(c->log_le.buf_size);
c->buf = kmalloc(c->bufsize, GFP_ATOMIC);
if (c->buf == NULL)
return -ENOMEM;
}

- idx = le32_to_cpu(c->log.idx);
+ idx = le32_to_cpu(c->log_le.idx);

/* Protect against corrupt value */
if (idx > c->bufsize)
@@ -3179,7 +3179,7 @@ static int brcmf_sdbrcm_readconsole(struct brcmf_bus *bus)
return 0;

/* Read the console buffer */
- addr = le32_to_cpu(c->log.buf);
+ addr = le32_to_cpu(c->log_le.buf);
rv = brcmf_sdbrcm_membytes(bus, false, addr, c->buf, c->bufsize);
if (rv < 0)
return rv;
--
1.7.1



2011-09-22 10:07:57

by Jonas Gorski

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/22 Arend Van Spriel <[email protected]>:
>> From: [email protected] [mailto:linux-wireless-
>> [email protected]] On Behalf Of Michael Büsch
>> Sent: donderdag 22 september 2011 1:29
>> To: Brett Rudley
>> Cc: Rafał Miłecki; Greg KH; John W. Linville; Franky (Zhenhui) Lin;
>> [email protected]; [email protected]; linux-
>> [email protected]
>> Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for
>> mainline patch #2
>>
>> On Wed, 21 Sep 2011 16:15:10 -0700
>> "Brett Rudley" <[email protected]> wrote:
>>
>> > We did however initially propose (and implement) a dividing line of
>> ssb chips for b43 and AXI based chips for brcmsmac but b43 team chose
>> to ignore/reject that.
>>
>> Well, what about embedded, for instance?
>
> The brcmsmac driver has been tested on a MIPS platform by Jonas Gorski
> although only in STA mode (on a bcm63xx). Not having AP mode has been
> explained in other emails.

This just happened to be a MIPS, but apart from that it was still a
mostly standard fare PCIe connected BCM4313, no nothing really
embedded. What Michael (and Hauke, and Rafal) is talking about are
BCM47xx SoC where AMBA/AXI is the System Bus, and there is no PCI(e)
at all (except maybe for connecting a /second/ wifi).

This was one of the main motivations of the bcma driver.

Regards,
Jonas

P.S: Which reminds me, do you plan to (not) support the integrated
wifi in the BCM6362? This one seems to be neither bcma nor ssb, but
it's definitely Broadcom ;) (Haven't gotten my hands yet on a device
though).

2011-09-20 21:12:11

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/20 Rafał Miłecki <[email protected]>:
> 2011/9/20 Johannes Berg <[email protected]>:
>> On Tue, 2011-09-20 at 06:03 -0700, Greg KH wrote:
>>
>>> And while code is great and nice, I still haven't seen any real answers
>>> to all of the questions that were asked of the Broadcom driver team
>>> during that review by the linux-wireless developers about how things
>>> will be handled properly due to the overlap in functionality with the
>>> existing "real" driver in the tree.
>>
>> Let's qualify this to "some developers".
>>
>> One thing I'd like to point out is that the Broadcom's firmware API has
>> always undergone changes over time. I'm actually surprised that b43
>> works as well as it does (which, tbh, isn't very well at all, at least
>> for me with some 11n PHY). I also don't think that Broadcom are going to
>> maintain compatibility and/or maintain new firmware features for old
>> devices, that just doesn't make any sense.
>
> Actually, when we got some single response from Broadcom about their
> relation to b43, they haven't mentioned support for old HW is any
> problem at all.

If you look at it from the perspective of a hardware manufacturer,
supporting EOLed chips is generally not a good return on investment.
There is no new revenue associated with them so any work that goes
into them stands to return very little.

Alex

2011-09-20 21:26:10

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

W dniu 20 września 2011 23:12 użytkownik Alex Deucher
<[email protected]> napisał:
> 2011/9/20 Rafał Miłecki <[email protected]>:
>> 2011/9/20 Johannes Berg <[email protected]>:
>>> On Tue, 2011-09-20 at 06:03 -0700, Greg KH wrote:
>>>
>>>> And while code is great and nice, I still haven't seen any real answers
>>>> to all of the questions that were asked of the Broadcom driver team
>>>> during that review by the linux-wireless developers about how things
>>>> will be handled properly due to the overlap in functionality with the
>>>> existing "real" driver in the tree.
>>>
>>> Let's qualify this to "some developers".
>>>
>>> One thing I'd like to point out is that the Broadcom's firmware API has
>>> always undergone changes over time. I'm actually surprised that b43
>>> works as well as it does (which, tbh, isn't very well at all, at least
>>> for me with some 11n PHY). I also don't think that Broadcom are going to
>>> maintain compatibility and/or maintain new firmware features for old
>>> devices, that just doesn't make any sense.
>>
>> Actually, when we got some single response from Broadcom about their
>> relation to b43, they haven't mentioned support for old HW is any
>> problem at all.
>
> If you look at it from the perspective of a hardware manufacturer,
> supporting EOLed chips is generally not a good return on investment.
> There is no new revenue associated with them so any work that goes
> into them stands to return very little.

That's another thing to discuss with Broadcom.

In open source kernel world, we hopefully won't let anyone drop
support for older hardware, just because it's not produced anymore.
Probably something like forking driver or modularizing it makes more
sense to us.

On the other hand we don't want Broadcom to support b43 and all the
PHYs it covers. We've already mentioned they could decide to support
b43 but limit their official support to selected cards only. They
(again) didn't response how they see such an idea.

What we really need is some communication with Broadcom and I guess
that's what Greg mostly wanted to achieve.

--
Rafał

2011-09-22 09:10:21

by Arend van Spriel

[permalink] [raw]
Subject: RE: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

PiBGcm9tOiBSYWZhxYIgTWnFgmVja2kgW21haWx0bzp6YWplYzVAZ21haWwuY29tXQ0KPiBTZW50
OiBkb25kZXJkYWcgMjIgc2VwdGVtYmVyIDIwMTEgMTA6NTcNCj4gVG86IEFyZW5kIFZhbiBTcHJp
ZWwNCj4gQ2M6IE1pY2hhZWwgQsO8c2NoOyBCcmV0dCBSdWRsZXk7IEdyZWcgS0g7IEpvaG4gVy4g
TGludmlsbGU7IEZyYW5reQ0KPiAoWmhlbmh1aSkgTGluOyBncmVna2hAc3VzZS5kZTsgZGV2ZWxA
bGludXhkcml2ZXJwcm9qZWN0Lm9yZzsgbGludXgtDQo+IHdpcmVsZXNzQHZnZXIua2VybmVsLm9y
Zzsgam9uYXMuZ29yc2tpQGdtYWlsLmNvbQ0KPiBTdWJqZWN0OiBSZTogW1BBVENIIDAwLzIwXSBz
dGFnaW5nOiBicmNtODAyMTE6IDd0aCByZWFjdGlvbiBmb3INCj4gbWFpbmxpbmUgcGF0Y2ggIzIN
Cj4gDQo+IFcgZG5pdSAyMiB3cnplxZtuaWEgMjAxMSAxMDo1MyB1xbx5dGtvd25payBBcmVuZCBW
YW4gU3ByaWVsDQo+IDxhcmVuZEBicm9hZGNvbS5jb20+IG5hcGlzYcWCOg0KPiA+PiBGcm9tOiBs
aW51eC13aXJlbGVzcy1vd25lckB2Z2VyLmtlcm5lbC5vcmcgW21haWx0bzpsaW51eC13aXJlbGVz
cy0NCj4gPj4gb3duZXJAdmdlci5rZXJuZWwub3JnXSBPbiBCZWhhbGYgT2YgTWljaGFlbCBCw7xz
Y2gNCj4gPj4gU2VudDogZG9uZGVyZGFnIDIyIHNlcHRlbWJlciAyMDExIDE6MjkNCj4gPj4gVG86
IEJyZXR0IFJ1ZGxleQ0KPiA+PiBDYzogUmFmYcWCIE1pxYJlY2tpOyBHcmVnIEtIOyBKb2huIFcu
IExpbnZpbGxlOyBGcmFua3kgKFpoZW5odWkpIExpbjsNCj4gPj4gZ3JlZ2toQHN1c2UuZGU7IGRl
dmVsQGxpbnV4ZHJpdmVycHJvamVjdC5vcmc7IGxpbnV4LQ0KPiA+PiB3aXJlbGVzc0B2Z2VyLmtl
cm5lbC5vcmcNCj4gPj4gU3ViamVjdDogUmU6IFtQQVRDSCAwMC8yMF0gc3RhZ2luZzogYnJjbTgw
MjExOiA3dGggcmVhY3Rpb24gZm9yDQo+ID4+IG1haW5saW5lIHBhdGNoICMyDQo+ID4+DQo+ID4+
IE9uIFdlZCwgMjEgU2VwIDIwMTEgMTY6MTU6MTAgLTA3MDANCj4gPj4gIkJyZXR0IFJ1ZGxleSIg
PGJydWRsZXlAYnJvYWRjb20uY29tPiB3cm90ZToNCj4gPj4NCj4gPj4gPiBXZSBkaWQgaG93ZXZl
ciBpbml0aWFsbHkgcHJvcG9zZSAoYW5kIGltcGxlbWVudCkgYSBkaXZpZGluZyBsaW5lDQo+IG9m
DQo+ID4+IHNzYiBjaGlwcyBmb3IgYjQzIGFuZCBBWEkgYmFzZWQgY2hpcHMgZm9yIGJyY21zbWFj
IGJ1dCBiNDMgdGVhbQ0KPiBjaG9zZQ0KPiA+PiB0byBpZ25vcmUvcmVqZWN0IHRoYXQuDQo+ID4+
DQo+ID4+IFdlbGwsIHdoYXQgYWJvdXQgZW1iZWRkZWQsIGZvciBpbnN0YW5jZT8NCj4gPg0KPiA+
IFRoZSBicmNtc21hYyBkcml2ZXIgaGFzIGJlZW4gdGVzdGVkIG9uIGEgTUlQUyBwbGF0Zm9ybSBi
eSBKb25hcw0KPiBHb3Jza2kNCj4gPiBhbHRob3VnaCBvbmx5IGluIFNUQSBtb2RlIChvbiBhIGJj
bTYzeHgpLiBOb3QgaGF2aW5nIEFQIG1vZGUgaGFzIGJlZW4NCj4gPiBleHBsYWluZWQgaW4gb3Ro
ZXIgZW1haWxzLg0KPiA+DQo+ID4gQWxzbyB3ZSBmdWxseSBpbnRlbmQgdG8gdHJhbnNpdGlvbiB0
byBCQ01BIGJ1dCB0aGF0IHdvdWxkIGFsc28gYmUgbmV3DQo+ID4gZmVhdHVyZSBhZGRlZC4gSGF2
aW5nIEFQIG1vZGUgYW5kIEJDTUEgd291bGQgZW5hYmxlIHlvdSBndXlzIGZvcg0KPiB1c2luZw0K
PiA+IGl0IGluIHRoZSBlbWJlZGRlZCB0YXJnZXRzLCByaWdodD8NCj4gPg0KPiA+PiA+IEknbSBu
b3QgdG90YWxseSBvcHBvc2VkIHRvIHRoYXQgaWRlYSBidXQgaXQgZG9lcyBub3Qgc29sdmUgdGhl
DQo+ID4+IHByaW1hcnkgaXNzdWUgb2YgY29uZmxpY3RpbmcgYjQzIGFuZCBicmNtc21hYyBtb2R1
bGVzLg0KPiA+Pg0KPiA+PiBJJ20gbm90IGNvbnZpbmNlZCB0aGF0IHRoaXMgaXMgYW4gaXNzdWUg
YXQgYWxsIGFuZCBJJ20gbm90IGNvbnZpbmNlZA0KPiA+PiB0aGF0IGl0IGhhcyB0byBiZSByZXNv
bHZlZC4NCj4gPj4gQXQgbGVhc3Qgbm90IG5vdy4NCj4gPj4NCj4gPg0KPiA+IEl0IG5ldmVyIGh1
cnRzIHRvIGxvb2sgYWhlYWQuIEJvdGggZHJpdmVycyBoYXZlIHRoZWlyIHVzZSBpbiB0aGUNCj4g
bGludXgNCj4gPiB0cmVlIGFuZCB3ZSBzaG91bGQgYWxpZ24gd2hpY2ggZHJpdmVyIGlzIGRvaW5n
IHdoYXQuIEFwcGFyZW50bHkgd2UNCj4gc2hvdWxkDQo+ID4gaGF2ZSB5ZWxsZWQgcmVhbGx5IGhh
cmQgd2hlbiBiNDMgd2FzIGFkZGluZyBiY21hIHN1cHBvcnQsIGJlY2F1c2UNCj4gdGhlbg0KPiA+
IGl0IHNuYXRjaGVkIHRoZSBjaGlwc2V0cyB3ZSBzdXBwb3J0IGFzIHdlbGwuIFlvdSBsZWFybiB5
b3VyIGxlc3NvbnMNCj4gdGhlDQo+ID4gaGFyZCB3YXkgaW4gTGludXggbGFuZCwgb3Igc28gaXQg
c2VlbXMgOy0pDQo+IA0KPiBBbmQgSSBzaG91bGQgaGF2ZSBub3RpY2UgeW91IGFkZCBjb2RlIGZv
ciBOLVBIWSB3aXRoIHlvdXIgaW5pdGlhbA0KPiBicmNtODAyMTEgY29tbWl0IDspIFRoZXJlJ3Mg
YWx3YXlzIHNvbWV0aGluZyB0aGF0IHlvdSB3b24ndCBub3RpY2UgYXQNCj4gdGhlIGNvcnJlY3Qg
dGltZS4NCj4gDQo+IC0tDQo+IFJhZmHFgg0KDQpXZXJlIHlvdSB1bmF3YXJlIG9mIHRoZSBjaGlw
c2V0cyB0aGF0IGJyY21zbWFjIHdhcyBzdXBwb3J0aW5nPyBXaGVuIHlvdQ0KV2VyZSB3b3JraW5n
IG9uIE4tUEhZIGl0IHdhcyB0byBlbmFibGUgY2VydGFpbiBjaGlwc2V0cywgcmlnaHQ/IFdhcyB0
aGF0DQppbiBzc2IgY29udGV4dD8NCg0KR3IuIEF2Uw0K


2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 08/20] staging: brcm80211: remove fullmac module_param brcmf_dongle_memsize

remove unused module parameter brcmf_dongle_memsize and related code

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 3 --
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 35 +++---------------------
2 files changed, 5 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index aa05b1c..d02cb10 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -24,9 +24,6 @@
* Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
*/

-/* dongle ram module parameter */
-extern int brcmf_dongle_memsize;
-
/* Tx/Rx bounds module parameters */
extern uint brcmf_txbound;
extern uint brcmf_rxbound;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 9d4850d..7090a36 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -568,7 +568,6 @@ struct brcmf_bus {
uint varsz; /* Size of variables buffer */

u32 ramsize; /* Size of RAM in SOCRAM (bytes) */
- u32 orig_ramsize; /* Size of RAM in SOCRAM (bytes) */

u32 hostintmask; /* Copy of Host Interrupt Mask */
u32 intstatus; /* Intstatus bits (events) pending */
@@ -772,11 +771,6 @@ module_param(brcmf_poll, uint, 0);
uint brcmf_intr = true;
module_param(brcmf_intr, uint, 0);

-/* override the RAM size if possible */
-#define DONGLE_MIN_MEMSIZE (128 * 1024)
-int brcmf_dongle_memsize;
-module_param(brcmf_dongle_memsize, int, 0);
-
#define RETRYCHAN(chan) ((chan) == SDPCM_EVENT_CHANNEL)

/* Retry count for register access failures */
@@ -857,17 +851,6 @@ static void brcmf_sdbrcm_pktfree2(struct brcmf_bus *bus, struct sk_buff *pkt)
brcmu_pkt_buf_free_skb(pkt);
}

-static void brcmf_sdbrcm_setmemsize(struct brcmf_bus *bus, int mem_size)
-{
- s32 min_size = DONGLE_MIN_MEMSIZE;
- /* Restrict the memsize to user specified limit */
- brcmf_dbg(ERROR, "user: Restrict the dongle ram size to %d, min %d\n",
- brcmf_dongle_memsize, min_size);
- if ((brcmf_dongle_memsize > min_size) &&
- (brcmf_dongle_memsize < (s32) bus->orig_ramsize))
- bus->ramsize = brcmf_dongle_memsize;
-}
-
static void brcmf_sdbrcm_sdlock(struct brcmf_bus *bus)
{
if (bus->threads_only)
@@ -3531,11 +3514,10 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
}

/* adjust to the user specified RAM */
- brcmf_dbg(INFO, "Physical memory size: %d, usable memory size: %d\n",
- bus->orig_ramsize, bus->ramsize);
+ brcmf_dbg(INFO, "Physical memory size: %d\n", bus->ramsize);
brcmf_dbg(INFO, "Vars are at %d, orig varsize is %d\n",
varaddr, varsize);
- varsize = ((bus->orig_ramsize - 4) - varaddr);
+ varsize = ((bus->ramsize - 4) - varaddr);

/*
* Determine the length token:
@@ -3555,7 +3537,7 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
varsize, varsizew);

/* Write the length token to the last word */
- bcmerror = brcmf_sdbrcm_membytes(bus, true, (bus->orig_ramsize - 4),
+ bcmerror = brcmf_sdbrcm_membytes(bus, true, (bus->ramsize - 4),
(u8 *)&varsizew_le, 4);

return bcmerror;
@@ -4630,17 +4612,11 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, u32 regsva)
/* Get info on the ARM and SOCRAM cores... */
brcmf_sdcard_reg_read(bus->sdiodev,
CORE_SB(bus->ci->armcorebase, sbidhigh), 4);
- bus->orig_ramsize = bus->ci->ramsize;
- if (!(bus->orig_ramsize)) {
+ bus->ramsize = bus->ci->ramsize;
+ if (!(bus->ramsize)) {
brcmf_dbg(ERROR, "failed to find SOCRAM memory!\n");
goto fail;
}
- bus->ramsize = bus->orig_ramsize;
- if (brcmf_dongle_memsize)
- brcmf_sdbrcm_setmemsize(bus, brcmf_dongle_memsize);
-
- brcmf_dbg(ERROR, "DHD: dongle ram size is set to %d(orig %d)\n",
- bus->ramsize, bus->orig_ramsize);

/* Set core control so an SDIO reset does a backplane reset */
reg_addr = bus->ci->buscorebase +
@@ -4819,7 +4795,6 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
*/
brcmf_txbound = BRCMF_TXBOUND;
brcmf_rxbound = BRCMF_RXBOUND;
- brcmf_dongle_memsize = 0;
brcmf_txminmax = BRCMF_TXMINMAX;

brcmf_c_init();
--
1.7.1



2011-09-21 22:35:44

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Wed, 21 Sep 2011 15:12:02 -0700
"Brett Rudley" <[email protected]> wrote:

> But other than the one line comment on code, you still haven't answered the question of why you think b43 is a better driver.

I think that is a completely bogus question.
Whether b43 or brcmsmac is better does completely depend on the application.
And for that single reason I do not see either b43 or brcmsmac being dropped
in favor of the other one any time soon.

You guys obviously don't want to support legacy hardware. So there is absolutely
no way to drop b43 in favor of brcmsmac. That is _impossible_.
And I do agree that it would be completely insane for you guys to support the legacy
b43 802.11g code.

The other way around, dropping brcmsmac in favor of b43 would be insanely stupid, too.
It would basically be dropping broadcom-linux-wlan support. Nobody wants that.

I do, however, think that a separate broadcom-supported PHY module should be created,
that is used by both brcmsmac and b43.

--
Greetings, Michael.

2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 14/20] staging: brcm80211: added endianness check flag to fullmac Makefile

From: Roland Vossen <[email protected]>

Reported-by: Johannes Berg <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 3d0878f..a1b7637 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -30,3 +30,4 @@ DHDOFILES = \

obj-$(CONFIG_BRCMFMAC) += brcmfmac.o
brcmfmac-objs += $(DHDOFILES)
+ccflags-y += -D__CHECK_ENDIAN__
--
1.7.1



2011-09-22 07:28:57

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

W dniu 22 września 2011 00:12 użytkownik Brett Rudley
<[email protected]> napisał:
> Do you think were in the smokey back room making deals or something?  All our patches are out in the open.
> We have tried to be as transparent as possible.
> We responded and integrated all (almost all?) feedback that we got on our patches.
> We published our TODO list and updated it several times throughout devel cycle.
>
> We helped you with bcma.   You asked us to send you an Arasan board which are hard to get and cost
> about $1k, I can't do that.  I handed out 4313 and 43224 boards like candy early on to anyone who asked.

Take a look at "Request for free-distributable Broadcom's (G|LP)-PHY
firmware" thread. I've been requesting and pinging you guys several
times. The response we got was:

W dniu 20 października 2010 23:50 użytkownik Henry Ptasinski
<[email protected]> napisał:
> Sorry for the delay in responding.  We are exploring what is possible but
> for the moment the answer is no. At present our focus is on providing the
> best open source solution we can for 4313, 43224, 43225, 4329 and future
> chips sets.

That's all. Not really helpful.

--
Rafał

2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 20/20] staging: brcm80211: reduced checkpatch warnings to zero

From: Roland Vossen <[email protected]>

Both community and Broadcom patches introduced checkpatch warnings.

Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 27 ++-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 10 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 23 ++-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 15 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 215 ++++++++++++---------
drivers/staging/brcm80211/brcmsmac/aiutils.c | 14 +-
drivers/staging/brcm80211/brcmsmac/main.c | 3 +-
drivers/staging/brcm80211/brcmsmac/nicpci.c | 3 +-
drivers/staging/brcm80211/brcmsmac/srom.c | 3 +-
9 files changed, 177 insertions(+), 136 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 1cbdb80..bff5066 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -96,7 +96,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
(sdiodev->func[2]);
if (err_ret)
brcmf_dbg(ERROR,
- "enable F2 failed:%d\n",
+ "enable F2 "
+ "failed:%d\n",
err_ret);
} else {
/* Disable Function 2 */
@@ -105,7 +106,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
(sdiodev->func[2]);
if (err_ret)
brcmf_dbg(ERROR,
- "Disable F2 failed:%d\n",
+ "Disable F2 "
+ "failed:%d\n",
err_ret);
}
sdio_release_host(sdiodev->func[2]);
@@ -124,8 +126,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
regaddr, &err_ret);
sdio_release_host(sdiodev->func[func]);
} else if (regaddr < 0xF0) {
- brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n",
- regaddr);
+ brcmf_dbg(ERROR, "F0 Wr:0x%02x: write "
+ "disallowed\n", regaddr);
} else {
/* Claim host controller, perform F0 write,
and release */
@@ -160,7 +162,8 @@ int brcmf_sdioh_request_byte(struct brcmf_sdio_dev *sdiodev, uint rw, uint func,
}

if (err_ret)
- brcmf_dbg(ERROR, "Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n",
+ brcmf_dbg(ERROR, "Failed to %s byte F%d:@0x%05x=%02x, "
+ "Err: %d\n",
rw ? "write" : "read", func, regaddr, *byte, err_ret);

return err_ret;
@@ -260,11 +263,13 @@ brcmf_sdioh_request_packet(struct brcmf_sdio_dev *sdiodev, uint fix_inc,
}

if (err_ret) {
- brcmf_dbg(ERROR, "%s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=0x%08x\n",
+ brcmf_dbg(ERROR, "%s FAILED %p[%d], addr=0x%05x, "
+ "pkt_len=%d, ERR=0x%08x\n",
write ? "TX" : "RX", pnext, SGCount, addr,
pkt_len, err_ret);
} else {
- brcmf_dbg(TRACE, "%s xfr'd %p[%d], addr=0x%05x, len=%d\n",
+ brcmf_dbg(TRACE, "%s xfr'd %p[%d], addr=0x%05x, "
+ "len=%d\n",
write ? "TX" : "RX", pnext, SGCount, addr,
pkt_len);
}
@@ -316,8 +321,8 @@ int brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev,
write ? "TX" : "RX", buflen_u);
mypkt = brcmu_pkt_buf_get_skb(buflen_u);
if (!mypkt) {
- brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n",
- buflen_u);
+ brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len "
+ "%d\n", buflen_u);
return -EIO;
}

@@ -342,8 +347,8 @@ int brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev,
write ? "TX" : "RX", pkt->len);
mypkt = brcmu_pkt_buf_get_skb(pkt->len);
if (!mypkt) {
- brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n",
- pkt->len);
+ brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: "
+ "len %d\n", pkt->len);
return -EIO;
}

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 4c171a3..f9dfd72 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -290,7 +290,8 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
goto done;

if (prot->pending == true) {
- brcmf_dbg(TRACE, "CDC packet is pending!!!! cmd=0x%x (%lu) lastcmd=0x%x (%lu)\n",
+ brcmf_dbg(TRACE, "CDC packet is pending!!!! cmd=0x%x (%lu) "
+ "lastcmd=0x%x (%lu)\n",
ioc->cmd, (unsigned long)ioc->cmd, prot->lastcmd,
(unsigned long)prot->lastcmd);
if ((ioc->cmd == BRCMF_C_SET_VAR) ||
@@ -405,8 +406,8 @@ int brcmf_proto_hdrpull(struct brcmf_pub *drvr, int *ifidx,
}

if (h->flags & BDC_FLAG_SUM_GOOD) {
- brcmf_dbg(INFO, "%s: BDC packet received with good rx-csum, flags 0x%x\n",
- brcmf_ifname(drvr, *ifidx), h->flags);
+ brcmf_dbg(INFO, "%s: BDC packet received with good rx-csum, "
+ "flags 0x%x\n", brcmf_ifname(drvr, *ifidx), h->flags);
pkt_set_sum_good(pktbuf, true);
}

@@ -427,7 +428,8 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)

/* ensure that the msg buf directly follows the cdc msg struct */
if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) {
- brcmf_dbg(ERROR, "struct brcmf_proto is not correctly defined\n");
+ brcmf_dbg(ERROR,
+ "struct brcmf_proto is not correctly defined\n");
goto fail;
}

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 963d1a9..ee49688 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -219,7 +219,8 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
}

brcmf_dbg(EVENT, "EVENT: %s, event ID = %d\n", event_name, event_type);
- brcmf_dbg(EVENT, "flags 0x%04x, status %d, reason %d, auth_type %d MAC %s\n",
+ brcmf_dbg(EVENT,
+ "flags 0x%04x, status %d, reason %d, auth_type %d MAC %s\n",
flags, status, reason, auth_type, eabuf);

if (flags & BRCMF_EVENT_MSG_LINK)
@@ -250,10 +251,12 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, TIMEOUT\n",
event_name, eabuf);
else if (status == BRCMF_E_STATUS_FAIL)
- brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, FAILURE, reason %d\n",
+ brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, FAILURE, "
+ "reason %d\n",
event_name, eabuf, (int)reason);
else
- brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, unexpected status %d\n",
+ brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, unexpected "
+ "status %d\n",
event_name, eabuf, (int)status);
break;

@@ -283,7 +286,8 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, %s, TIMEOUT\n",
event_name, eabuf, auth_str);
else if (status == BRCMF_E_STATUS_FAIL) {
- brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, %s, FAILURE, reason %d\n",
+ brcmf_dbg(EVENT, "MACEVENT: %s, MAC %s, %s, FAILURE, "
+ "reason %d\n",
event_name, eabuf, auth_str, (int)reason);
}

@@ -524,7 +528,8 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
{
int i;
if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
- brcmf_dbg(ERROR, "Mask invalid format. Needs to start with 0x\n");
+ brcmf_dbg(ERROR,
+ "Mask invalid format. Needs to start with 0x\n");
return -EINVAL;
}
src = src + 2; /* Skip past 0x */
@@ -759,8 +764,8 @@ static void brcmf_c_arp_offload_set(struct brcmf_pub *drvr, int arp_mode)
iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
- brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, retcode = %d\n",
- arp_mode, retcode);
+ brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, "
+ "retcode = %d\n", arp_mode, retcode);
else
brcmf_dbg(TRACE, "successfully set ARP offload mode to 0x%x\n",
arp_mode);
@@ -776,8 +781,8 @@ static void brcmf_c_arp_offload_enable(struct brcmf_pub *drvr, int arp_enable)
iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
- brcmf_dbg(TRACE, "failed to enable ARP offload to %d, retcode = %d\n",
- arp_enable, retcode);
+ brcmf_dbg(TRACE, "failed to enable ARP offload to %d, "
+ "retcode = %d\n", arp_enable, retcode);
else
brcmf_dbg(TRACE, "successfully enabled ARP offload to %d\n",
arp_enable);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 3ae0d43..4c63d22 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -207,8 +207,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
if (!brcmu_mkiovar
("allmulti", (void *)&allmulti_le,
sizeof(allmulti_le), buf, buflen)) {
- brcmf_dbg(ERROR, "%s: mkiovar failed for allmulti, datalen %d buflen %u\n",
- brcmf_ifname(&drvr_priv->pub, 0),
+ brcmf_dbg(ERROR, "%s: mkiovar failed for allmulti, datalen %d "
+ "buflen %u\n", brcmf_ifname(&drvr_priv->pub, 0),
(int)sizeof(allmulti), buflen);
kfree(buf);
return;
@@ -300,8 +300,8 @@ static void brcmf_op_if(struct brcmf_if *ifp)
* in case we missed the BRCMF_E_IF_DEL event.
*/
if (ifp->ndev != NULL) {
- brcmf_dbg(ERROR, "ERROR: netdev:%s already exists, try free & unregister\n",
- ifp->ndev->name);
+ brcmf_dbg(ERROR, "ERROR: netdev:%s already exists, try "
+ "free & unregister\n", ifp->ndev->name);
netif_stop_queue(ifp->ndev);
unregister_netdev(ifp->ndev);
free_netdev(ifp->ndev);
@@ -319,11 +319,12 @@ static void brcmf_op_if(struct brcmf_if *ifp)
sizeof(drvr_priv));
err = brcmf_net_attach(&drvr_priv->pub, ifp->idx);
if (err != 0) {
- brcmf_dbg(ERROR, "brcmf_net_attach failed, err %d\n",
- err);
+ brcmf_dbg(ERROR, "brcmf_net_attach failed, "
+ "err %d\n", err);
ret = -EOPNOTSUPP;
} else {
- brcmf_dbg(TRACE, " ==== pid:%x, net_device for if:%s created ===\n",
+ brcmf_dbg(TRACE, " ==== pid:%x, net_device for "
+ "if:%s created ===\n",
current->pid, ifp->ndev->name);
ifp->state = 0;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 9f8bcb3..2ebbe9b 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -900,8 +900,8 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
if (err) {
- brcmf_dbg(ERROR, "Devctl error setting CA: %d\n",
- err);
+ brcmf_dbg(ERROR, "Devctl error setting CA: "
+ "%d\n", err);
return -EBADE;
}

@@ -940,8 +940,8 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
return -EBADE;
}
if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
- brcmf_dbg(ERROR, "HT Avail timeout (%d): clkctl 0x%02x\n",
- PMU_MAX_TRANSITION_DLY, clkctl);
+ brcmf_dbg(ERROR, "HT Avail timeout (%d): clkctl "
+ "0x%02x\n", PMU_MAX_TRANSITION_DLY, clkctl);
return -EBADE;
}

@@ -975,8 +975,8 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err);
brcmf_dbg(INFO, "CLKCTL: turned OFF\n");
if (err) {
- brcmf_dbg(ERROR, "Failed access turning clock off: %d\n",
- err);
+ brcmf_dbg(ERROR,
+ "Failed access turning clock off: %d\n", err);
return -EBADE;
}
}
@@ -1078,7 +1078,8 @@ static int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
w_sdreg32(bus, SMB_USE_OOB,
offsetof(struct sdpcmd_regs, tosbmailbox), &retries);
if (retries > retry_limit)
- brcmf_dbg(ERROR, "CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n");
+ brcmf_dbg(ERROR,
+ "CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n");

/* Turn off our contribution to the HT clock request */
brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
@@ -1122,7 +1123,8 @@ static int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
&retries);

if (retries > retry_limit)
- brcmf_dbg(ERROR, "CANNOT SIGNAL CHIP TO CLEAR OOB!!\n");
+ brcmf_dbg(ERROR,
+ "CANNOT SIGNAL CHIP TO CLEAR OOB!!\n");

/* Make sure we have SD bus access */
brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
@@ -1160,8 +1162,8 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)

/* Dongle recomposed rx frames, accept them again */
if (hmb_data & HMB_DATA_NAKHANDLED) {
- brcmf_dbg(INFO, "Dongle reports NAK handled, expect rtx of %d\n",
- bus->rx_seq);
+ brcmf_dbg(INFO, "Dongle reports NAK handled, expect rtx of "
+ "%d\n", bus->rx_seq);
if (!bus->rxskip)
brcmf_dbg(ERROR, "unexpected NAKHANDLED!\n");

@@ -1247,8 +1249,8 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
break;

if ((hi > (lastrbc >> 8)) && (lo > (lastrbc & 0x00ff))) {
- brcmf_dbg(ERROR, "count growing: last 0x%04x now 0x%04x\n",
- lastrbc, (hi << 8) + lo);
+ brcmf_dbg(ERROR, "count growing: last 0x%04x now "
+ "0x%04x\n", lastrbc, (hi << 8) + lo);
}
lastrbc = (hi << 8) + lo;
}
@@ -1302,8 +1304,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
dlen = (u16) (bus->glomd->len);
dptr = bus->glomd->data;
if (!dlen || (dlen & 1)) {
- brcmf_dbg(ERROR, "bad glomd len(%d), ignore descriptor\n",
- dlen);
+ brcmf_dbg(ERROR, "bad glomd len(%d), ignore "
+ "descriptor\n", dlen);
dlen = 0;
}

@@ -1320,8 +1322,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
break;
}
if (sublen % BRCMF_SDALIGN) {
- brcmf_dbg(ERROR, "sublen %d not multiple of %d\n",
- sublen, BRCMF_SDALIGN);
+ brcmf_dbg(ERROR, "sublen %d not multiple of "
+ "%d\n", sublen, BRCMF_SDALIGN);
usechain = false;
}
totlen += sublen;
@@ -1337,8 +1339,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
/* Allocate/chain packet for next subframe */
pnext = brcmu_pkt_buf_get_skb(sublen + BRCMF_SDALIGN);
if (pnext == NULL) {
- brcmf_dbg(ERROR, "bcm_pkt_buf_get_skb failed, num %d len %d\n",
- num, sublen);
+ brcmf_dbg(ERROR, "bcm_pkt_buf_get_skb failed, "
+ "num %d len %d\n", num, sublen);
break;
}
if (!pfirst) {
@@ -1355,11 +1357,13 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
/* If all allocations succeeded, save packet chain
in bus structure */
if (pnext) {
- brcmf_dbg(GLOM, "allocated %d-byte packet chain for %d subframes\n",
- totlen, num);
+ brcmf_dbg(GLOM, "allocated %d-byte packet chain for %d "
+ "subframes\n", totlen, num);
if (BRCMF_GLOM_ON() && bus->nextlen) {
if (totlen != bus->nextlen) {
- brcmf_dbg(GLOM, "glomdesc mismatch: nextlen %d glomdesc %d rxseq %d\n",
+ brcmf_dbg(GLOM, "glomdesc mismatch: "
+ "nextlen %d glomdesc %d "
+ "rxseq %d\n",
bus->nextlen, totlen, rxseq);
}
}
@@ -1412,14 +1416,14 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
sublen = (u16) brcmu_pktfrombuf(pfirst, 0, dlen,
bus->dataptr);
if (sublen != dlen) {
- brcmf_dbg(ERROR, "FAILED TO COPY, dlen %d sublen %d\n",
- dlen, sublen);
+ brcmf_dbg(ERROR, "FAILED TO COPY, dlen %d "
+ "sublen %d\n", dlen, sublen);
errcode = -1;
}
pnext = NULL;
} else {
- brcmf_dbg(ERROR, "COULDN'T ALLOC %d-BYTE GLOM, FORCE FAILURE\n",
- dlen);
+ brcmf_dbg(ERROR, "COULDN'T ALLOC %d-BYTE GLOM, FORCE "
+ "FAILURE\n", dlen);
errcode = -1;
}
bus->f2rxdata++;
@@ -1467,11 +1471,12 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)

errcode = 0;
if ((u16)~(sublen ^ check)) {
- brcmf_dbg(ERROR, "(superframe): HW hdr error: len/check 0x%04x/0x%04x\n",
- sublen, check);
+ brcmf_dbg(ERROR, "(superframe): HW hdr error: len/check"
+ " 0x%04x/0x%04x\n", sublen, check);
errcode = -1;
} else if (roundup(sublen, bus->blocksize) != dlen) {
- brcmf_dbg(ERROR, "(superframe): len 0x%04x, rounded 0x%04x, expect 0x%04x\n",
+ brcmf_dbg(ERROR, "(superframe): len 0x%04x, rounded "
+ "0x%04x, expect 0x%04x\n",
sublen, roundup(sublen, bus->blocksize),
dlen);
errcode = -1;
@@ -1486,7 +1491,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
errcode = -1;
} else if ((doff < SDPCM_HDRLEN) ||
(doff > (pfirst->len - SDPCM_HDRLEN))) {
- brcmf_dbg(ERROR, "(superframe): Bad data offset %d: HW %d pkt %d min %d\n",
+ brcmf_dbg(ERROR, "(superframe): Bad data offset %d: "
+ "HW %d pkt %d min %d\n",
doff, sublen, pfirst->len, SDPCM_HDRLEN);
errcode = -1;
}
@@ -1529,20 +1535,23 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
#endif

if ((u16)~(sublen ^ check)) {
- brcmf_dbg(ERROR, "(subframe %d): HW hdr error: len/check 0x%04x/0x%04x\n",
+ brcmf_dbg(ERROR, "(subframe %d): HW hdr error: "
+ "len/check 0x%04x/0x%04x\n",
num, sublen, check);
errcode = -1;
} else if ((sublen > dlen) || (sublen < SDPCM_HDRLEN)) {
- brcmf_dbg(ERROR, "(subframe %d): length mismatch: len 0x%04x, expect 0x%04x\n",
- num, sublen, dlen);
+ brcmf_dbg(ERROR, "(subframe %d): length "
+ "mismatch: len 0x%04x, expect "
+ "0x%04x\n", num, sublen, dlen);
errcode = -1;
} else if ((chan != SDPCM_DATA_CHANNEL) &&
(chan != SDPCM_EVENT_CHANNEL)) {
- brcmf_dbg(ERROR, "(subframe %d): bad channel %d\n",
- num, chan);
+ brcmf_dbg(ERROR, "(subframe %d): bad channel "
+ "%d\n", num, chan);
errcode = -1;
} else if ((doff < SDPCM_HDRLEN) || (doff > sublen)) {
- brcmf_dbg(ERROR, "(subframe %d): Bad data offset %d: HW %d min %d\n",
+ brcmf_dbg(ERROR, "(subframe %d): Bad data "
+ "offset %d: HW %d min %d\n",
num, doff, sublen, SDPCM_HDRLEN);
errcode = -1;
}
@@ -1581,7 +1590,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
seq = SDPCM_PACKET_SEQUENCE(&dptr[SDPCM_FRAMETAG_LEN]);
doff = SDPCM_DOFFSET_VALUE(&dptr[SDPCM_FRAMETAG_LEN]);

- brcmf_dbg(GLOM, "Get subframe %d, %p(%p/%d), sublen %d chan %d seq %d\n",
+ brcmf_dbg(GLOM, "Get subframe %d, %p(%p/%d), sublen %d "
+ "chan %d seq %d\n",
num, pfirst, pfirst->data,
pfirst->len, sublen, chan, seq);

@@ -1634,7 +1644,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)

#ifdef BCMDBG
if (BRCMF_GLOM_ON()) {
- brcmf_dbg(GLOM, "subframe %d to stack, %p (%p/%d) nxt/lnk %p/%p\n",
+ brcmf_dbg(GLOM, "subframe %d to stack, %p "
+ "(%p/%d) nxt/lnk %p/%p\n",
num, pfirst, pfirst->data,
pfirst->len, pfirst->next,
pfirst->prev);
@@ -1724,15 +1735,16 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)

/* Drop if the read is too big or it exceeds our maximum */
if ((rdlen + BRCMF_FIRSTREAD) > bus->drvr->maxctl) {
- brcmf_dbg(ERROR, "%d-byte control read exceeds %d-byte buffer\n",
- rdlen, bus->drvr->maxctl);
+ brcmf_dbg(ERROR, "%d-byte control read exceeds %d-byte "
+ "buffer\n", rdlen, bus->drvr->maxctl);
bus->drvr->rx_errors++;
brcmf_sdbrcm_rxfail(bus, false, false);
goto done;
}

if ((len - doff) > bus->drvr->maxctl) {
- brcmf_dbg(ERROR, "%d-byte ctl frame (%d-byte ctl data) exceeds %d-byte limit\n",
+ brcmf_dbg(ERROR, "%d-byte ctl frame (%d-byte ctl data) exceeds "
+ "%d-byte limit\n",
len, len - doff, bus->drvr->maxctl);
bus->drvr->rx_errors++;
bus->rx_toolong++;
@@ -1854,7 +1866,9 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
pkt = brcmu_pkt_buf_get_skb(rdlen + BRCMF_SDALIGN);
if (!pkt) {
/* Give up on data, request rtx of events */
- brcmf_dbg(ERROR, "(nextlen): brcmu_pkt_buf_get_skb failed: len %d rdlen %d expected rxseq %d\n",
+ brcmf_dbg(ERROR, "(nextlen): brcmu_pkt_buf_get"
+ "_skb failed: len %d rdlen %d "
+ "expected rxseq %d\n",
len, rdlen, rxseq);
continue;
} else {
@@ -1869,7 +1883,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
bus->f2rxdata++;

if (sdret < 0) {
- brcmf_dbg(ERROR, "(nextlen): read %d bytes failed: %d\n",
+ brcmf_dbg(ERROR, "(nextlen): read %d "
+ "bytes failed: %d\n",
rdlen, sdret);
brcmu_pkt_buf_free_skb(pkt);
bus->drvr->rx_errors++;
@@ -1891,15 +1906,17 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* All zeros means readahead info was bad */
if (!(len | check)) {
- brcmf_dbg(INFO, "(nextlen): read zeros in HW header???\n");
+ brcmf_dbg(INFO, "(nextlen): read zeros in HW "
+ "header???\n");
brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
}

/* Validate check bytes */
if ((u16)~(len ^ check)) {
- brcmf_dbg(ERROR, "(nextlen): HW hdr error: nextlen/len/check 0x%04x/0x%04x/0x%04x\n",
- nextlen, len, check);
+ brcmf_dbg(ERROR, "(nextlen): HW hdr error: "
+ "nextlen/len/check 0x%04x/0x%04x/"
+ "0x%04x\n", nextlen, len, check);
bus->rx_badhdr++;
brcmf_sdbrcm_rxfail(bus, false, false);
brcmf_sdbrcm_pktfree2(bus, pkt);
@@ -1908,8 +1925,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* Validate frame length */
if (len < SDPCM_HDRLEN) {
- brcmf_dbg(ERROR, "(nextlen): HW hdr length invalid: %d\n",
- len);
+ brcmf_dbg(ERROR, "(nextlen): HW hdr length "
+ "invalid: %d\n", len);
brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
}
@@ -1919,9 +1936,10 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
if (len_consistent) {
/* Mismatch, force retry w/normal
header (may be >4K) */
- brcmf_dbg(ERROR, "(nextlen): mismatch, nextlen %d len %d rnd %d; expected rxseq %d\n",
- nextlen, len, roundup(len, 16),
- rxseq);
+ brcmf_dbg(ERROR, "(nextlen): mismatch, nextlen "
+ "%d len %d rnd %d; expected rxseq"
+ " %d\n", nextlen, len,
+ roundup(len, 16), rxseq);
brcmf_sdbrcm_rxfail(bus, true, true);
brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
@@ -1941,7 +1959,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
bus->rxhdr[SDPCM_FRAMETAG_LEN +
SDPCM_NEXTLEN_OFFSET];
if ((bus->nextlen << 4) > MAX_RX_DATASZ) {
- brcmf_dbg(INFO, "(nextlen): got frame w/nextlen too large (%d), seq %d\n",
+ brcmf_dbg(INFO, "(nextlen): got frame w/nextlen"
+ " too large (%d), seq %d\n",
bus->nextlen, seq);
bus->nextlen = 0;
}
@@ -1965,16 +1984,16 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* Check and update sequence number */
if (rxseq != seq) {
- brcmf_dbg(INFO, "(nextlen): rx_seq %d, expected %d\n",
- seq, rxseq);
+ brcmf_dbg(INFO, "(nextlen): rx_seq %d, expected"
+ " %d\n", seq, rxseq);
bus->rx_badseq++;
rxseq = seq;
}

/* Check window for sanity */
if ((u8) (txmax - bus->tx_seq) > 0x40) {
- brcmf_dbg(ERROR, "got unlikely tx max %d with tx_seq %d\n",
- txmax, bus->tx_seq);
+ brcmf_dbg(ERROR, "got unlikely tx max %d with "
+ "tx_seq %d\n", txmax, bus->tx_seq);
txmax = bus->tx_seq + 2;
}
bus->tx_max = txmax;
@@ -1992,7 +2011,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
#endif

if (chan == SDPCM_CONTROL_CHANNEL) {
- brcmf_dbg(ERROR, "(nextlen): readahead on control packet %d?\n",
+ brcmf_dbg(ERROR, "(nextlen): readahead on "
+ "control packet %d?\n",
seq);
/* Force retry w/normal header read */
bus->nextlen = 0;
@@ -2003,7 +2023,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* Validate data offset */
if ((doff < SDPCM_HDRLEN) || (doff > len)) {
- brcmf_dbg(ERROR, "(nextlen): bad data offset %d: HW len %d min %d\n",
+ brcmf_dbg(ERROR, "(nextlen): bad data offset "
+ "%d: HW len %d min %d\n",
doff, len, SDPCM_HDRLEN);
brcmf_sdbrcm_rxfail(bus, false, false);
brcmf_sdbrcm_pktfree2(bus, pkt);
@@ -2046,7 +2067,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* Validate check bytes */
if ((u16) ~(len ^ check)) {
- brcmf_dbg(ERROR, "HW hdr err: len/check 0x%04x/0x%04x\n",
+ brcmf_dbg(ERROR,
+ "HW hdr err: len/check 0x%04x/0x%04x\n",
len, check);
bus->rx_badhdr++;
brcmf_sdbrcm_rxfail(bus, false, false);
@@ -2067,8 +2089,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* Validate data offset */
if ((doff < SDPCM_HDRLEN) || (doff > len)) {
- brcmf_dbg(ERROR, "Bad data offset %d: HW len %d, min %d seq %d\n",
- doff, len, SDPCM_HDRLEN, seq);
+ brcmf_dbg(ERROR, "Bad data offset %d: HW len %d, min %d"
+ " seq %d\n", doff, len, SDPCM_HDRLEN, seq);
bus->rx_badhdr++;
brcmf_sdbrcm_rxfail(bus, false, false);
continue;
@@ -2078,8 +2100,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
bus->nextlen =
bus->rxhdr[SDPCM_FRAMETAG_LEN + SDPCM_NEXTLEN_OFFSET];
if ((bus->nextlen << 4) > MAX_RX_DATASZ) {
- brcmf_dbg(INFO, "(nextlen): got frame w/nextlen too large (%d), seq %d\n",
- bus->nextlen, seq);
+ brcmf_dbg(INFO, "(nextlen): got frame w/nextlen too "
+ "large (%d), seq %d\n", bus->nextlen, seq);
bus->nextlen = 0;
}

@@ -2154,8 +2176,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
BRCMF_FIRSTREAD + BRCMF_SDALIGN);
if (!pkt) {
/* Give up on data, request rtx of events */
- brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: rdlen %d chan %d\n",
- rdlen, chan);
+ brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: "
+ "rdlen %d chan %d\n", rdlen, chan);
bus->drvr->rx_dropped++;
brcmf_sdbrcm_rxfail(bus, false, RETRYCHAN(chan));
continue;
@@ -2311,7 +2333,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt,
bus->drvr->tx_realloc++;
new = brcmu_pkt_buf_get_skb(pkt->len + BRCMF_SDALIGN);
if (!new) {
- brcmf_dbg(ERROR, "couldn't allocate new %d-byte packet\n",
+ brcmf_dbg(ERROR, "couldn't allocate new %d-byte"
+ " packet\n",
pkt->len + BRCMF_SDALIGN);
ret = -ENOMEM;
goto done;
@@ -2384,7 +2407,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt,

if (ret < 0) {
/* On failure, abort the command and terminate the frame */
- brcmf_dbg(INFO, "sdio error %d, abort command and terminate frame\n",
+ brcmf_dbg(INFO,
+ "sdio error %d, abort command and terminate frame\n",
ret);
bus->tx_sderrs++;

@@ -2649,8 +2673,8 @@ clkwait:
if (ret < 0) {
/* On failure, abort the command and
terminate the frame */
- brcmf_dbg(INFO, "sdio error %d, abort command and terminate frame\n",
- ret);
+ brcmf_dbg(INFO, "sdio error %d, abort command and "
+ "terminate frame\n", ret);
bus->tx_sderrs++;

brcmf_sdcard_abort(bus->sdiodev, SDIO_FUNC_2);
@@ -2698,12 +2722,13 @@ clkwait:
no resched or interrupts */
if ((bus->drvr->busstate == BRCMF_BUS_DOWN) ||
brcmf_sdcard_regfail(bus->sdiodev)) {
- brcmf_dbg(ERROR, "failed backplane access over SDIO, halting operation %d\n",
- brcmf_sdcard_regfail(bus->sdiodev));
+ brcmf_dbg(ERROR, "failed backplane access over SDIO, halting "
+ "operation %d\n", brcmf_sdcard_regfail(bus->sdiodev));
bus->drvr->busstate = BRCMF_BUS_DOWN;
bus->intstatus = 0;
} else if (bus->clkstate == CLK_PENDING) {
- brcmf_dbg(INFO, "rescheduled due to CLK_PENDING awaiting I_CHIPACTIVE interrupt\n");
+ brcmf_dbg(INFO, "rescheduled due to CLK_PENDING awaiting "
+ "I_CHIPACTIVE interrupt\n");
resched = true;
} else if (bus->intstatus || bus->ipend ||
(!bus->fcstate && brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol)
@@ -2854,7 +2879,8 @@ brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data,

/* Do the transfer(s) */
while (size) {
- brcmf_dbg(INFO, "%s %d bytes at offset 0x%08x in window 0x%08x\n",
+ brcmf_dbg(INFO,
+ "%s %d bytes at offset 0x%08x in window 0x%08x\n",
write ? "write" : "read", dsize,
sdaddr, address & SBSDIO_SBWINDOW_MASK);
bcmerror = brcmf_sdcard_rwdata(bus->sdiodev, write,
@@ -2936,7 +2962,8 @@ brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
memcpy(sh->tag, sh_le.tag, sizeof(sh->tag));

if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
- brcmf_dbg(ERROR, "sdpcm_shared version %d in brcmf is different than sdpcm_shared version %d in dongle\n",
+ brcmf_dbg(ERROR, "sdpcm_shared version %d in brcmf is different"
+ " than sdpcm_shared version %d in dongle\n",
SDPCM_SHARED_VERSION,
sh->flags & SDPCM_SHARED_VERSION_MASK);
return -EBADE;
@@ -3262,7 +3289,8 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
put_unaligned_le32(0, frame + SDPCM_FRAMETAG_LEN + sizeof(swheader));

if (!data_ok(bus)) {
- brcmf_dbg(INFO, "No bus credit bus->tx_max %d, bus->tx_seq %d\n",
+ brcmf_dbg(INFO,
+ "No bus credit bus->tx_max %d, bus->tx_seq %d\n",
bus->tx_max, bus->tx_seq);
bus->ctrl_frame_stat = true;
/* Send from dpc */
@@ -3301,8 +3329,8 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
if (ret < 0) {
/* On failure, abort the command and
terminate the frame */
- brcmf_dbg(INFO, "sdio error %d, abort command and terminate frame\n",
- ret);
+ brcmf_dbg(INFO, "sdio error %d, abort command "
+ "and terminate frame\n", ret);
bus->tx_sderrs++;

brcmf_sdcard_abort(bus->sdiodev, SDIO_FUNC_2);
@@ -3477,14 +3505,16 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
brcmf_sdbrcm_membytes(bus, false, varaddr, nvram_ularray,
varsize);
if (bcmerror) {
- brcmf_dbg(ERROR, "error %d on reading %d nvram bytes at 0x%08x\n",
- bcmerror, varsize, varaddr);
+ brcmf_dbg(ERROR, "error %d on reading %d nvram bytes at"
+ " 0x%08x\n", bcmerror, varsize, varaddr);
}
/* Compare the org NVRAM with the one read from RAM */
if (memcmp(vbuffer, nvram_ularray, varsize))
- brcmf_dbg(ERROR, "Downloaded NVRAM image is corrupted\n");
+ brcmf_dbg(ERROR,
+ "Downloaded NVRAM image is corrupted\n");
else
- brcmf_dbg(ERROR, "Download/Upload/Compare of NVRAM ok\n");
+ brcmf_dbg(ERROR,
+ "Download/Upload/Compare of NVRAM ok\n");

kfree(nvram_ularray);
#endif /* BCMDBG */
@@ -3745,8 +3775,8 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus)
brcmf_sdbrcm_get_image((char *)memptr, MEMBLOCK, bus))) {
ret = brcmf_sdbrcm_membytes(bus, true, offset, memptr, len);
if (ret) {
- brcmf_dbg(ERROR, "error %d on writing %d membytes at 0x%08x\n",
- ret, MEMBLOCK, offset);
+ brcmf_dbg(ERROR, "error %d on writing %d membytes at "
+ "0x%08x\n", ret, MEMBLOCK, offset);
goto err;
}

@@ -4342,7 +4372,8 @@ static void brcmf_sdbrcm_sdiod_drive_strength_init(struct brcmf_bus *bus,
str_shift = 11;
break;
default:
- brcmf_dbg(ERROR, "No SDIO Drive strength init done for chip %s rev %d pmurev %d\n",
+ brcmf_dbg(ERROR, "No SDIO Drive strength init done for chip %s"
+ " rev %d pmurev %d\n",
brcmu_chipname(bus->ci->chip, chn, 8),
bus->ci->chiprev, bus->ci->pmurev);
break;
@@ -4372,7 +4403,8 @@ static void brcmf_sdbrcm_sdiod_drive_strength_init(struct brcmf_bus *bus,
CORE_CC_REG(bus->ci->cccorebase, chipcontrol_addr),
4, cc_data_temp);

- brcmf_dbg(INFO, "SDIO: %dmA drive strength selected, set to 0x%08x\n",
+ brcmf_dbg(INFO,
+ "SDIO: %dmA drive strength selected, set to 0x%08x\n",
drivestrength, cc_data_temp);
}
}
@@ -4469,8 +4501,8 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
!SBSDIO_ALPAV(clkval)),
PMU_MAX_TRANSITION_DLY);
if (!SBSDIO_ALPAV(clkval)) {
- brcmf_dbg(ERROR, "timeout on ALPAV wait, clkval 0x%02x\n",
- clkval);
+ brcmf_dbg(ERROR, "timeout on ALPAV wait, clkval "
+ "0x%02x\n", clkval);
err = -EBUSY;
goto fail;
}
@@ -4481,8 +4513,8 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
clkset, &err);
udelay(65);
} else {
- brcmf_dbg(ERROR, "ChipClkCSR access: wrote 0x%02x read 0x%02x\n",
- clkset, clkval);
+ brcmf_dbg(ERROR, "ChipClkCSR access: wrote 0x%02x read "
+ "0x%02x\n", clkset, clkval);
err = -EACCES;
goto fail;
}
@@ -4560,8 +4592,8 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, u32 regsva)
SBSDIO_FUNC1_CHIPCLKCSR, &err);

if (err || ((clkctl & ~SBSDIO_AVBITS) != BRCMF_INIT_CLKCTL1)) {
- brcmf_dbg(ERROR, "ChipClkCSR access: err %d wrote 0x%02x read 0x%02x\n",
- err, BRCMF_INIT_CLKCTL1, clkctl);
+ brcmf_dbg(ERROR, "ChipClkCSR access: err %d wrote 0x%02x read "
+ "0x%02x\n", err, BRCMF_INIT_CLKCTL1, clkctl);
goto fail;
}

@@ -4982,7 +5014,8 @@ int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
bcmerror = -EIO;
} else {
bcmerror = -EISCONN;
- brcmf_dbg(ERROR, "Set DEVRESET=false invoked when device is on\n");
+ brcmf_dbg(ERROR, "Set DEVRESET=false invoked when "
+ "device is on\n");
bcmerror = -EIO;
}
brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.c b/drivers/staging/brcm80211/brcmsmac/aiutils.c
index b7b0bdf..f0c5639 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.c
@@ -1054,9 +1054,8 @@ static struct si_info *ai_doattach(struct si_info *sii,
cc = (struct chipcregs *) regs;

/* bus/core/clk setup for register access */
- if (!ai_buscore_prep(sii)) {
+ if (!ai_buscore_prep(sii))
return NULL;
- }

/*
* ChipID recognition.
@@ -1084,19 +1083,18 @@ static struct si_info *ai_doattach(struct si_info *sii,
return NULL;
}
/* no cores found, bail out */
- if (sii->numcores == 0) {
+ if (sii->numcores == 0)
return NULL;
- }
+
/* bus/core/clk setup */
origidx = SI_CC_IDX;
- if (!ai_buscore_setup(sii, savewin, &origidx)) {
+ if (!ai_buscore_setup(sii, savewin, &origidx))
goto exit;
- }

/* Init nvram from sprom/otp if they exist */
- if (srom_var_init(&sii->pub, cc, vars, varsz)) {
+ if (srom_var_init(&sii->pub, cc, vars, varsz))
goto exit;
- }
+
pvars = vars ? *vars : NULL;
ai_nvram_process(sii, pvars);

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 2c9ac6d..959e90c 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -5951,9 +5951,8 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)
* If we are switching to gmode == GMODE_LEGACY_B,
* clean up rate info that may refer to OFDM rates.
*/
- if ((gmode == GMODE_LEGACY_B) && (band->gmode != GMODE_LEGACY_B)) {
+ if (gmode == GMODE_LEGACY_B && band->gmode != GMODE_LEGACY_B)
band->gmode = gmode;
- }

band->gmode = gmode;

diff --git a/drivers/staging/brcm80211/brcmsmac/nicpci.c b/drivers/staging/brcm80211/brcmsmac/nicpci.c
index f5a2695..df39afe 100644
--- a/drivers/staging/brcm80211/brcmsmac/nicpci.c
+++ b/drivers/staging/brcm80211/brcmsmac/nicpci.c
@@ -394,9 +394,8 @@ static bool pcie_mdiosetblock(struct pcicore_info *pi, uint blk)
i++;
}

- if (i >= pcie_serdes_spinwait) {
+ if (i >= pcie_serdes_spinwait)
return false;
- }

return true;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/srom.c b/drivers/staging/brcm80211/brcmsmac/srom.c
index 5bf0732..ece81ad 100644
--- a/drivers/staging/brcm80211/brcmsmac/srom.c
+++ b/drivers/staging/brcm80211/brcmsmac/srom.c
@@ -1169,8 +1169,7 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
if (sromrev == 0x10)
sromrev = 1;
}
- }
- else {
+ } else {
/* Use OTP if SPROM not available */
err = otp_read_pci(sih, srom, SROM_MAX);
if (err == 0)
--
1.7.1



2011-09-21 22:12:13

by Brett Rudley

[permalink] [raw]
Subject: RE: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

PiA+IE91ciBvcmlnaW5hbCBwbGFuIHdhcyB0byByZW1haW4gYSBzZXBhcmF0ZSBkcml2ZXIgZnJv
bSBiNDMuIFdlIHdlcmUNCj4gYXdhcmUgb2YgaXQgYW5kIGFsbCB0aGUgZ29vZCB3b3JrIHRoYXQg
aGFkIGJlZW4gZG9uZSB0byBjcmVhdGUgaXQgYW5kIHdlDQo+IGhhZCBubyBpbnRlbnRpb24gb2Yg
aW50ZXJmZXJpbmcgd2l0aCBpdC4gwqBBdCB0aGF0IHBvaW50IHRoZXJlIGhhZCBub3QNCj4gYmVl
biB2ZXJ5IG11Y2ggcmVjZW50IG1vdmVtZW50IGluIGI0MyBhbmQgaXQgZGlkIG5vdCBzdXBwb3J0
IGFueSBvZiBvdXINCj4gQVhJIGJhc2VkIGNoaXBzLiDCoFdlIGZpZ3VyZWQgdGhhdCBzc2IgdnMg
QVhJIHdhcyBhIGdvb2QgZGl2aWRpbmcgbGluZSBhbmQNCj4gdGhlcmUgd291bGQgYmUgbm8gY29u
ZmxpY3QsIGFuZCB0aGVyZSB3YXNuJ3QgaW5pdGlhbGx5Lg0KPiANCj4gVGhlIGZpcnN0IG9idmlv
dXMgcHJvYmxlbSBpcyB0aGF0IHRoZXJlIGFyZSBTU0IgYW5kIEJDTUEgKGFrYSBBWEkpDQo+IGNh
cmRzIHVzaW5nIE4tUEhZLiBUaGF0IHJlc3VsdGVkIGluIFBIWSBjb2RlIGR1cGxpY2F0aW9uIGJl
dHdlZW4gYjQzDQo+IGFuZCBicmNtc21hYy4gQW5kIHNpbmNlIHdlIGFscmVhZHkgc3VwcG9ydGVk
IE4tUEhZIGluIGI0MywgYWRkaW5nIGJjbWENCj4gc3VwcG9ydCBhdXRvbWF0aWNhbGx5IGdhdmUg
dXMgQkNNNDMyMjQgYW5kIEJDTTQzMjI1IHN1cHBvcnQuIFRoYXQgb2YNCj4gY291cnNlIG1lYW5z
IGR1cGxpY2F0ZWQgc3VwcG9ydGVkIGZvciB0aGUgc2FtZSBoYXJkd2FyZS4NCg0KQWdyZWUsIHdo
ZW4geW91IGNyZWF0ZWQgYmNtYSwgaXQgZGlkIGR1cGxpY2F0ZSBIVyBzdXBwb3J0IGFscmVhZHkg
aW4gYnJjbXNtYWMuICBXaHkgZGlkbid0IHlvdSBhZGRyZXNzIHRoYXQgdGhlbj8NCg0KQWxzbywg
YnJjbXNtYWMgcmVhbGl6ZXMgdGhhdCB0aGVyZSBhcmUgdHdlYWtzIGFuZCBmZWF0dXJlcyBzcGVj
aWZpYyB0byBlYWNoIGNoaXAgYW5kIHRvIGVhY2ggcmV2aXNpb24gb2YgZWFjaCBwaHkuICBXaGls
ZSB0aGV5IGFyZSBvZiB0aGUgc2FtZSBmYW1pbHksIGVhY2ggdmVyc2lvbiBoYXMgaXRzIG93biBm
ZWF0dXJlIHNldCBhbmQgc2V0dGluZ3MuDQoNCkJ1dCBiNDMgZ290IDIyNC81IHNvIGNhbGxlZCBz
dXBwb3J0ICdhdXRvbWF0aWNseScgc2ltcGx5IGJ5IGFkZGluZyBBWEkgYWNjZXNzLg0KDQo+IA0K
PiA+IEludGVybmFsbHksIHByaW9yIHRvIHJlbGVhc2luZyB0byBzdGFnaW5nIHRyZWUsIGRldmVs
b3BtZW50IGhhZCBnb25lDQo+IHF1aWNrbHkgYW5kIGl0IGRpZG4ndCB0YWtlIGxvbmcgYXQgYWxs
IHRvIGdldCB0aGUgZHJpdmVyIHVwIGFuZCBydW5uaW5nLg0KPiDCoFdlIGRpZCBub3QgYW50aWNp
cGF0ZSB0aGF0IHRoaW5ncyB3b3VsZCBnbyBzb21ld2hhdCBzbG93ZXIgaW4gdGhlDQo+IHN0YWdp
bmcgdHJlZSBhbmQgYSB5ZWFyIChhbmQgaHVuZHJlZHMgb2YgcGF0Y2hlcykgbGF0ZXIgd2UgYXJl
IHN0aWxsDQo+IHRoZXJlLiDCoER1cmluZyB0aGF0IHllYXIgYjQzIGdvdCBzb21lIGxpbWl0ZWQg
c3VwcG9ydCBmb3IgdGhlIHNhbWUgbmV3DQo+IGNoaXBzIGJyY21zbWFjIGFscmVhZHkgaGFkLCBp
bnRvIGl0cyBkcml2ZXIuIMKgU28gbm93LCBoZXJlIHdlIGFyZS4uLiBib3RoDQo+IGRyaXZlcnMg
c3VwcG9ydGluZyB0aGUgbmV3IGNoaXBzIGFuZCBiNDMgYWxzbyBzdXBwb3J0aW5nIHRoZSBvbGQu
DQo+ID4NCj4gPiBXZSBoYXZlIHNlZW4gdGhlIHJlcXVlc3RzIGZvciB1cyB0byBhZGQgQVhJIGJh
c2VkIGNoaXBzZXQgc3VwcG9ydCBpbnRvDQo+IGI0My4gwqBJIGRvbid0IHRoaW5rIHRoYXQgd2ls
bCBoYXBwZW4gaW4gYSBzdWJzdGFudGlhbCB3YXk6DQo+ID4gLSBPdXIgZHJpdmVyIGlzIGFscmVh
ZHkgc3RhYmxlIGFuZCBwZXJmb3JtYW5jZSBpcyBiZXR0ZXIgdGhhbiBiNDMgaW4NCj4gdGVybXMg
b2YgQVhJIGNoaXBzLiDCoEI0MyBzZWVtcyBxdWl0ZSByYXc6IGl0cyBmdWxsIG9mIFRPRE8gYW5k
IEZJWE1FDQo+IG5vdGVzIGFuZCBwZXJmb3JtYW5jZSBpcyAxLzEwdGggb2YgYnJjbXNtYWMgb24g
b3VyIHRlc3RpbmcuIFNwZW5kaW5nDQo+IGFub3RoZXIgcm91bmQgb2YgdGltZSBhbmQgZWZmb3J0
IG9uIGI0MyB0byBnZXQgaXQgdG8gdGhlIHBsYWNlIHdoZXJlIHNtYWMNCj4gYWxyZWFkeSBpcywg
c2VlbXMgcmVkdW5kYW50IGFuZCB1bmF0dHJhY3RpdmUuDQo+IA0KPiBXZWxsLCBJIGd1ZXNzIHlv
dSB3ZXJlIGNvbXBhcmluZyBicmNtc21hYyB3b3JraW5nIGluIDgwMi4xMW4gbW9kZSB2cy4NCj4g
YjQzIHdvcmtpbiBpbiA4MDIuMTFnIG1vZGU/IA0KDQpJIGp1c3QgbG9hZGVkIHRoZSB0d28gZHJp
dmVycyBvbiBteSBtYWNoaW5lIGFuZCByYW4gaXBlcmYuICBBcmUgdXNlcnMgZXhwZWN0ZWQgdG8g
ZG8gc29tZXRoaW5nIGVsc2U/ICA4MDIuMTFOIEFQcyBhcmUgbm90IGVzb3RlcmljIGVxdWlwbWVu
dCBhbnltb3JlLCBzb3JyeS4NCg0KPiANCj4gWWVzLCBJJ20gYXdhcmUgeW91IG1heSBiZSBub3Qg
c28gY29tZm9ydGFibGUgd2l0aCBkaWZmZXJlbmNlcyBiZXR3ZWVuDQo+IGludGVybmFsIGRyaXZl
ciBhbmQgYjQzLg0KPiBIb3dldmVyIHlvdSdyZSBhbHJlYWR5IGF0IHRoZSBwbGFjZSwgd2hlbiB5
b3UgY2FuIG5vdCBqdXN0IGNvcHkmcGFzdGUNCj4gY29kZSBmcm9tIHlvdXIgaW50ZXJuYWwgZHJp
dmVyIHRvIGJyY21zbWFjLiBZb3UgaGF2ZSB0byBhZG9wdCBpbg0KPiBhbnl3YXkuIEFyZSB0aGVy
ZSByZWFsbHkgc28gbWFueSBkaWZmZXJlbmNlcyBpZiB5b3UgbG9vayBhdCBiNDM/IERNQQ0KPiBp
cyBzb21ldGhpbmcgeW91IHByb2JhYmx5IGRvbid0IG5lZWQgdG8gdG91Y2guIFBIWSBjb2RlIHNo
b3VsZCBiZQ0KPiBwb3J0YWJsZSB0byBiNDMgaW4gdGhlIHNhbWUgd2F5IGl0IGlzIHRvIGJyY21z
bWFjLiBUaGUgYmlnZ2VzdCBwcm9ibGVtDQo+IGlzIHRvIHRvdWNoIHNvbWUgZ2VuZXJhbCB0aGlu
Z3MsIG5vdCBQSFktZGlyZWN0bHktcmVsYXRlZC4gQW5kIGV2ZW4gaW4NCj4gdGhhdCBjb2RlIHdl
IHNoYXJlIGEgbG90IG9mIGNvZGUuIE91ciBjb2RlIGlzIGJhc2VkIG9uIFJFIG9mIHlvdXINCj4g
ZHJpdmVyLiBJdCBoYXMgdG8gYmUgc2ltaWxhci4NCg0KSWYgdGhleSBhcmUgc28gc2ltaWxhciB3
aHkgZG8geW91IHRoaW5rIGI0MyBpcyBiZXR0ZXI/DQoNCj4gDQo+IA0KPiA+IC0gTW9zdCBvZiB0
aGUgcmVjZW50IGI0MyBhZGRpdGlvbnMgc3VwcG9ydCBjb21lcyBmcm9tIGEgc2luZ2xlIHBlcnNv
bg0KPiBkb2luZyByZXZlcnNlIGVuZ2luZWVyaW5nLiBicmNtc21hYyBoYXMgYSBmZXcgc29mdHdh
cmUgcGVvcGxlIHdvcmtpbmcgb24NCj4gaXQgZGlyZWN0bHkgYW5kIGh1bmRyZWRzIG9mIHBlb3Bs
ZSB3b3JraW5nIG9uIGl0IGluZGlyZWN0bHkgKHRocm91Z2ggdGhlDQo+IGludGVybmFsIHZlcnNp
b24pIGluY2x1ZGluZyBlbmdpbmVlcnMgd29ya2luZyBvbiBmaXJtd2FyZSwgUlRMLCB0ZXN0aW5n
LA0KPiBldGMuDQo+IA0KPiBZb3UncmUgZG9pbmcgbXVjaCBoYXJkZXIgam9iIGFuZCBvYnZpb3Vz
bHkgeW91IG5lZWQgbXVjaCBtb3JlIHBlb3BsZS4NCj4gSSBqdXN0IGltcGxlbWVudCB0aGUgZHJp
dmVyLCB3aXRob3V0IHRlc3RpbmcgaGFyZHdhcmUgZm9yIHZhcmlvdXMNCj4gcG9zc2libGUgY29u
ZmlndXJhdGlvbnMsIGV0Yy4gVGhhdCdzIHRoZSBvbmx5IGV4cGxhbmF0aW9uIGhvdyB3ZSd2ZQ0K
PiBhY2hpZXZlZCBzdWNoIGEgZ29vZCBzdGF0ZS4gV2UgY29waWVkIGluaXQvY29uZmlnIHZhbHVl
cyBmcm9tIHlvdXINCj4gZHJpdmVyLCBkaWRuJ3QgaW52ZW50IHRoZW0gb3Vyc2VsZi4NCg0KU3Bl
YWtpbmcgb2YgaW5pdCB2YWx1ZXMsIEkgbm90aWNlZCB5b3UgaGF2ZSBpbml0IHZhbHVlcyBidXQg
bm8gb3RoZXJzIGFmdGVyIHRoYXQgZHVyaW5nIHJ1bnRpbWUuICBXZSBkb24ndCBkcml2ZSBvdXIg
Y2hpcHMNCndpdGhvdXQgcHJvcGVyIHBlcmlvZGljIGNhbGlicmF0aW9ucy4NCiAgDQo+IA0KPiBX
ZWxsLCB5b3Ugc3BlbnQgYSBsb3Qgb2YgdGltZSBvbiBjbGVhbmluZyBicmNtc21hYywgSSBzcGVu
dCBhIGxvdCBvZg0KPiB0aW1lIG9uIGFkZGluZyBzdXBwb3J0IGZvciBuZXcgaGFyZHdhcmUuIEkg
YmVsaWV2ZSBub3cgd2UgYm90aCBhcmUgYXQNCj4gc2ltaWxhciBzdGFnZSBmcm9tIHJlYWNoaW5n
IGZ1bGx5IGZ1bmN0aW9uYWwsIGZlYXR1cmUtZnVsbCBkcml2ZXIuIDE6MQ0KPiBmb3IgYm90aCBv
ZiB1cyA7KQ0KPiANCg0KDQo+IFdlbGwsIHlvdSB3ZXJlIHN1Ym1pdHRpbmcgcGF0Y2hlcywgYnV0
IHlvdSB3ZXJlbid0IGRpc2N1c3NpbmcgYW55dGhpbmcNCj4gd2l0aCB1cy4gVGhhdCdzIHJlYWxs
eSBpbXBvcnRhbnQgaW4gYmVpbmcgYSBnb29kIGNpdGl6ZW5zLg0KPiBIb3cgbWFueSB0aW1lcyBo
YXZlIEkgYXNrZWQgYWJvdXQgdGhlIGZpcm13YXJlPyBIb3cgbWFueSB0aW1lcyBhYm91dA0KPiBh
Y2Nlc3MgdG8gdGhlIGhhcmR3YXJlPyBIb3cgbWFueSB0aW1lcyBhYm91dCB0aGUgZnV0dXJlPyBS
ZWFsbHksIEkgd2FzDQo+IHRyeWluZyBoYXJkIHRvIGNvb3BlcmF0ZSwgeW91IGp1c3Qgd2VyZSBp
Z25vcmluZyBhbGwgb2YgdGhhdCA6fA0KPiBXZSd2ZSBub3cgZmluYWxseSBtYWRlIHlvdSByZXNw
b25kIHRvIHRoZSBxdWVzdGlvbnMgYWJvdXQgdGhlIGZ1dHVyZSwNCj4gYnV0IHlvdSBzdGlsbCBp
Z25vcmUgbXkgZncgcXVlc3Rpb25zIGFuZCBodyByZXF1ZXN0cy4NCj4gVGhpcyBvZiBjb3Vyc2Ug
cmVzdWx0ZWQgaW4gdGhlIGNvbXBsZXggc2l0dWF0aW9uIHdlIGhhdmUgbm93Lg0KPg0KDQpEbyB5
b3UgdGhpbmsgd2VyZSBpbiB0aGUgc21va2V5IGJhY2sgcm9vbSBtYWtpbmcgZGVhbHMgb3Igc29t
ZXRoaW5nPyAgQWxsIG91ciBwYXRjaGVzIGFyZSBvdXQgaW4gdGhlIG9wZW4uDQpXZSBoYXZlIHRy
aWVkIHRvIGJlIGFzIHRyYW5zcGFyZW50IGFzIHBvc3NpYmxlLg0KV2UgcmVzcG9uZGVkIGFuZCBp
bnRlZ3JhdGVkIGFsbCAoYWxtb3N0IGFsbD8pIGZlZWRiYWNrIHRoYXQgd2UgZ290IG9uIG91ciBw
YXRjaGVzLg0KV2UgcHVibGlzaGVkIG91ciBUT0RPIGxpc3QgYW5kIHVwZGF0ZWQgaXQgc2V2ZXJh
bCB0aW1lcyB0aHJvdWdob3V0IGRldmVsIGN5Y2xlLg0KDQpXZSBoZWxwZWQgeW91IHdpdGggYmNt
YS4gICBZb3UgYXNrZWQgdXMgdG8gc2VuZCB5b3UgYW4gQXJhc2FuIGJvYXJkIHdoaWNoIGFyZSBo
YXJkIHRvIGdldCBhbmQgY29zdCANCmFib3V0ICQxaywgSSBjYW4ndCBkbyB0aGF0LiAgSSBoYW5k
ZWQgb3V0IDQzMTMgYW5kIDQzMjI0IGJvYXJkcyBsaWtlIGNhbmR5IGVhcmx5IG9uIHRvIGFueW9u
ZSB3aG8gYXNrZWQuDQoNCiANCj4gDQo+ID4gT3RoZXIgdGhhbiBiYXJlbHkgc3VwcG9ydGluZyBv
bmUgb2Ygb3VyIGNoaXBzIGZpcnN0IGluIG1haW5saW5lLCBJDQo+IHdvdWxkIHJlYWxseSBsaWtl
IHRvIHVuZGVyc3RhbmQgd2hhdCBhcmUgdGhlIGJlbmVmaXRzIGFuZCBqdXN0aWZpY2F0aW9ucw0K
PiBvZiB1c2luZyBiNDMgb3ZlciBicmNtc21hYyBmb3IgQVhJIGJhc2VkIGNoaXBzIGluIHRoZSBs
b25nIHJ1bi4gwqBDYW4NCj4gc29tZW9uZSBleHBsYWluIHRoZW0/DQo+IA0KPiBXaGF0IEkgZG9u
J3QgbGlrZSBhYm91dCBicmNtc21hYz8NCj4gMSkgTm90IG1vZHVsYXJpemVkLCBiY21hIHN1cHBv
cnQgYnVpbHQgaW4gYW5kIGR1cGxpY2F0ZWQgd2l0aCBiY21hIG1vZHVsZQ0KDQpBcyBkaXNjdXNz
ZWQgbnVtZXJvdXMgdGltZXM6IA0KV2UgaGF2ZSBiZWVuIGluIHN0YWdpbmcgYW5kIG5vIG5ldyBm
ZWF0dXJlcyBpcyB0aGUgcnVsZS4gV2UgaGF2ZSBiY21hIGNvZGUgd2FpdGluZyB0byBiZSByZWxl
YXNlZC4gIA0KDQo+IDIpIFBvb3IgcXVhbGl0eSBjb2RlDQoNCj4gMykgRHVwbGljYXRpb24gb2Yg
YSBsb3Qgb2YgY29kZSB3aXRoIGJjbWEmYjQzLiBOb3QganVzdCBQSFkgY29kZSwgYnV0DQo+IGFs
c28gbW9yZSBnZW5lcmFsIGZ1bmN0aW9ucywgRE1BIHN1cHBvcnQsIE1BQywgZXRjLg0KDQpTZXJp
b3VzbHk/IEFnYWluPyBZb3Uga2VlcCBicmluZ2luZyB0aGlzIHVwLiBEbyB5b3UgdW5kZXJzdGFu
ZCB0aGF0IHRoZXJlIHdhcyBubyBiY21hIHdoZW4gd2UgcmVsZWFzZWQgdG8gc3RhZ2luZyBhbmQg
dGhhdCB3ZQ0Kd2VyZSBhc2tlZCBub3QgdG8gYWRkIG5ldyBmZWF0dXJlcyB3aGlsZSBpbiBzdGFn
aW5nPyAgIEl0IHdvdWxkIGJlIG5pY2UgaWYgeW91IGNvdWxkIGFja25vd2xlZGdlIHRoYXQuDQoN
CkJ1dCBvdGhlciB0aGFuIHRoZSBvbmUgbGluZSBjb21tZW50IG9uIGNvZGUsIHlvdSBzdGlsbCBo
YXZlbid0IGFuc3dlcmVkIHRoZSBxdWVzdGlvbiBvZiB3aHkgeW91IHRoaW5rIGI0MyBpcyBhIGJl
dHRlciBkcml2ZXIuDQoNCj4gLS0NCj4gUmFmYcWCDQoNCg==


2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 12/20] staging: brcm80211: remove global variables for data frame boundary

Put boundary settings in brcmf_bus structure

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 4 ----
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 24 ++++++++++--------------
2 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index 104c0e7..a5064f5 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -27,10 +27,6 @@
* Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
*/

-/* Tx/Rx bounds module parameters */
-extern uint brcmf_txbound;
-extern uint brcmf_rxbound;
-
/* Indicate (dis)interest in finding dongles. */
extern int brcmf_bus_register(void);
extern void brcmf_bus_unregister(void);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 57049ec..66ab752 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -588,6 +588,10 @@ struct brcmf_bus {
u8 rx_seq; /* Receive sequence number (expected) */
bool rxskip; /* Skip receive (awaiting NAK ACK) */

+ uint rxbound; /* Rx frames to read before resched */
+ uint txbound; /* Tx frames to send before resched */
+ uint txminmax;
+
struct sk_buff *glomd; /* Packet containing glomming descriptor */
struct sk_buff *glom; /* Packet chain for glommed superframe */
uint glomerr; /* Glom packet read errors */
@@ -740,13 +744,6 @@ module_param(brcmf_watchdog_prio, int, 0);
int brcmf_dpc_prio = 98;
module_param(brcmf_dpc_prio, int, 0);

-/* Tx/Rx bounds */
-uint brcmf_txbound;
-uint brcmf_rxbound;
-module_param(brcmf_txbound, uint, 0);
-module_param(brcmf_rxbound, uint, 0);
-static uint brcmf_txminmax;
-
#define SDIO_DRIVE_STRENGTH 6 /* in milliamps */

/* Use polling */
@@ -2488,8 +2485,8 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
{
u32 intstatus, newstatus = 0;
uint retries = 0;
- uint rxlimit = brcmf_rxbound; /* Rx frames to read before resched */
- uint txlimit = brcmf_txbound; /* Tx frames to send before resched */
+ uint rxlimit = bus->rxbound; /* Rx frames to read before resched */
+ uint txlimit = bus->txbound; /* Tx frames to send before resched */
uint framecnt = 0; /* Temporary counter of tx/rx frames */
bool rxdone = true; /* Flag for no more read data */
bool resched = false; /* Flag indicating resched wanted */
@@ -2690,7 +2687,7 @@ clkwait:
else if ((bus->clkstate == CLK_AVAIL) && !bus->fcstate &&
brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && txlimit
&& data_ok(bus)) {
- framecnt = rxdone ? txlimit : min(txlimit, brcmf_txminmax);
+ framecnt = rxdone ? txlimit : min(txlimit, bus->txminmax);
framecnt = brcmf_sdbrcm_sendfromq(bus, framecnt);
txlimit -= framecnt;
}
@@ -4779,10 +4776,6 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
* first time that the driver is initialized vs subsequent
* initializations.
*/
- brcmf_txbound = BRCMF_TXBOUND;
- brcmf_rxbound = BRCMF_RXBOUND;
- brcmf_txminmax = BRCMF_TXMINMAX;
-
brcmf_c_init();

brcmf_dbg(TRACE, "Enter\n");
@@ -4798,6 +4791,9 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
}
bus->sdiodev = sdiodev;
sdiodev->bus = bus;
+ bus->txbound = BRCMF_TXBOUND;
+ bus->rxbound = BRCMF_RXBOUND;
+ bus->txminmax = BRCMF_TXMINMAX;
bus->tx_seq = SDPCM_SEQUENCE_WRAP - 1;
bus->usebufpool = false; /* Use bufpool if allocated,
else use locally malloced rxbuf */
--
1.7.1



2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 03/20] staging: brcm80211: sparse endianness warnings for struct brcmf_proto_cdc_ioctl

From: Roland Vossen <[email protected]>

Structure that is send/received to/from dongle has been annotated.

Reported-by: Johannes Berg <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 6f65683..28bdf9e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -28,11 +28,11 @@
#include "dhd_dbg.h"

struct brcmf_proto_cdc_ioctl {
- u32 cmd; /* ioctl command value */
- u32 len; /* lower 16: output buflen;
+ __le32 cmd; /* ioctl command value */
+ __le32 len; /* lower 16: output buflen;
* upper 16: input buflen (excludes header) */
- u32 flags; /* flag defns given below */
- u32 status; /* status code returned from the device */
+ __le32 flags; /* flag defns given below */
+ __le32 status; /* status code returned from the device */
};

/* Max valid buffer size that can be sent to the dongle */
@@ -47,9 +47,6 @@ struct brcmf_proto_cdc_ioctl {
#define CDCF_IOC_ID_SHIFT 16 /* ID Mask shift bits */
#define CDC_IOC_ID(flags) \
(((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)
-#define CDC_SET_IF_IDX(hdr, idx) \
- ((hdr)->flags = (((hdr)->flags & ~CDCF_IOC_IF_MASK) | \
- ((idx) << CDCF_IOC_IF_SHIFT)))

/*
* BDC header - Broadcom specific extension of CDC.
@@ -144,7 +141,7 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
void *info;
int ret = 0, retries = 0;
- u32 id, flags = 0;
+ u32 id, flags;

brcmf_dbg(TRACE, "Enter\n");
brcmf_dbg(CTL, "cmd %d len %d\n", cmd, len);
@@ -165,9 +162,9 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,

msg->cmd = cpu_to_le32(cmd);
msg->len = cpu_to_le32(len);
- msg->flags = (++prot->reqid << CDCF_IOC_ID_SHIFT);
- CDC_SET_IF_IDX(msg, ifidx);
- msg->flags = cpu_to_le32(msg->flags);
+ flags = (++prot->reqid << CDCF_IOC_ID_SHIFT);
+ flags = (flags & ~CDCF_IOC_IF_MASK) | (ifidx << CDCF_IOC_IF_SHIFT);
+ msg->flags = cpu_to_le32(flags);

if (buf)
memcpy(prot->buf, buf, len);
@@ -233,9 +230,9 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,

msg->cmd = cpu_to_le32(cmd);
msg->len = cpu_to_le32(len);
- msg->flags = (++prot->reqid << CDCF_IOC_ID_SHIFT) | CDCF_IOC_SET;
- CDC_SET_IF_IDX(msg, ifidx);
- msg->flags = cpu_to_le32(msg->flags);
+ flags = (++prot->reqid << CDCF_IOC_ID_SHIFT) | CDCF_IOC_SET;
+ flags = (flags & ~CDCF_IOC_IF_MASK) | (ifidx << CDCF_IOC_IF_SHIFT);
+ msg->flags = cpu_to_le32(flags);

if (buf)
memcpy(prot->buf, buf, len);
--
1.7.1



2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 02/20] staging: brcm80211: various fulmac sparse endianness fixes

From: Roland Vossen <[email protected]>

Reported-by: Johannes Berg <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 6 +++-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 23 +++++++++++---------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 19 ++++++++++-------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 12 +++++-----
4 files changed, 34 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 443e3a8..1cbdb80 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -401,7 +401,9 @@ static int brcmf_sdioh_get_cisaddr(struct brcmf_sdio_dev *sdiodev, u32 regaddr)
/* read 24 bits and return valid 17 bit addr */
int i;
u32 scratch, regdata;
- u8 *ptr = (u8 *)&scratch;
+ __le32 scratch_le;
+ u8 *ptr = (u8 *)&scratch_le;
+
for (i = 0; i < 3; i++) {
if ((brcmf_sdioh_card_regread(sdiodev, 0, regaddr, 1,
&regdata)) != SUCCESS)
@@ -412,7 +414,7 @@ static int brcmf_sdioh_get_cisaddr(struct brcmf_sdio_dev *sdiodev, u32 regaddr)
}

/* Only the lower 17-bits are valid */
- scratch = le32_to_cpu(scratch);
+ scratch = le32_to_cpu(scratch_le);
scratch &= 0x0001FFFF;
return scratch;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 9919fa5..e1d7456 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -138,6 +138,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
struct net_device *dev;
struct netdev_hw_addr *ha;
u32 allmulti, cnt;
+ __le32 cnt_le;
+ __le32 allmulti_le;

struct brcmf_ioctl ioc;
char *buf, *bufp;
@@ -166,9 +168,9 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
strcpy(bufp, "mcast_list");
bufp += strlen("mcast_list") + 1;

- cnt = cpu_to_le32(cnt);
- memcpy(bufp, &cnt, sizeof(cnt));
- bufp += sizeof(cnt);
+ cnt_le = cpu_to_le32(cnt);
+ memcpy(bufp, &cnt_le, sizeof(cnt));
+ bufp += sizeof(cnt_le);

netdev_for_each_mc_addr(ha, dev) {
if (!cnt)
@@ -205,10 +207,11 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
brcmf_ifname(&drvr_priv->pub, 0));
return;
}
- allmulti = cpu_to_le32(allmulti);
+ allmulti_le = cpu_to_le32(allmulti);

if (!brcmu_mkiovar
- ("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) {
+ ("allmulti", (void *)&allmulti_le,
+ sizeof(allmulti_le), buf, buflen)) {
brcmf_dbg(ERROR, "%s: mkiovar failed for allmulti, datalen %d buflen %u\n",
brcmf_ifname(&drvr_priv->pub, 0),
(int)sizeof(allmulti), buflen);
@@ -226,7 +229,7 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
if (ret < 0) {
brcmf_dbg(ERROR, "%s: set allmulti %d failed\n",
brcmf_ifname(&drvr_priv->pub, 0),
- le32_to_cpu(allmulti));
+ le32_to_cpu(allmulti_le));
}

kfree(buf);
@@ -235,19 +238,19 @@ static void _brcmf_set_multicast_list(struct work_struct *work)
driver does */

allmulti = (dev->flags & IFF_PROMISC) ? true : false;
- allmulti = cpu_to_le32(allmulti);
+ allmulti_le = cpu_to_le32(allmulti);

memset(&ioc, 0, sizeof(ioc));
ioc.cmd = BRCMF_C_SET_PROMISC;
- ioc.buf = &allmulti;
- ioc.len = sizeof(allmulti);
+ ioc.buf = &allmulti_le;
+ ioc.len = sizeof(allmulti_le);
ioc.set = true;

ret = brcmf_proto_ioctl(&drvr_priv->pub, 0, &ioc, ioc.len);
if (ret < 0) {
brcmf_dbg(ERROR, "%s: set promisc %d failed\n",
brcmf_ifname(&drvr_priv->pub, 0),
- le32_to_cpu(allmulti));
+ le32_to_cpu(allmulti_le));
}
}

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index fb9b351..57001d4 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -2361,8 +2361,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt,

/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
len = (u16) (pkt->len);
- *(u16 *) frame = cpu_to_le16(len);
- *(((u16 *) frame) + 1) = cpu_to_le16(~len);
+ *(__le16 *) frame = cpu_to_le16(len);
+ *(((__le16 *) frame) + 1) = cpu_to_le16(~len);

/* Software tag: channel, sequence number, data offset */
swheader =
@@ -2917,16 +2917,17 @@ static int
brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
{
u32 addr;
+ __le32 addr_le;
int rv;

/* Read last word in memory to determine address of
sdpcm_shared structure */
- rv = brcmf_sdbrcm_membytes(bus, false, bus->ramsize - 4, (u8 *)&addr,
+ rv = brcmf_sdbrcm_membytes(bus, false, bus->ramsize - 4, (u8 *)&addr_le,
4);
if (rv < 0)
return rv;

- addr = le32_to_cpu(addr);
+ addr = le32_to_cpu(addr_le);

brcmf_dbg(INFO, "sdpcm_shared address 0x%08X\n", addr);

@@ -3273,8 +3274,8 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);

/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
- *(u16 *) frame = cpu_to_le16((u16) msglen);
- *(((u16 *) frame) + 1) = cpu_to_le16(~msglen);
+ *(__le16 *) frame = cpu_to_le16((u16) msglen);
+ *(((__le16 *) frame) + 1) = cpu_to_le16(~msglen);

/* Software tag: channel, sequence number, data offset */
swheader =
@@ -3466,6 +3467,7 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
u32 varaddr;
u8 *vbuffer;
u32 varsizew;
+ __le32 varsizew_le;
#ifdef BCMDBG
char *nvram_ularray;
#endif /* BCMDBG */
@@ -3529,10 +3531,11 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
*/
if (bcmerror) {
varsizew = 0;
+ varsizew_le = cpu_to_le32(0);
} else {
varsizew = varsize / 4;
varsizew = (~varsizew << 16) | (varsizew & 0x0000FFFF);
- varsizew = cpu_to_le32(varsizew);
+ varsizew_le = cpu_to_le32(varsizew);
}

brcmf_dbg(INFO, "New varsize is %d, length token=0x%08x\n",
@@ -3540,7 +3543,7 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)

/* Write the length token to the last word */
bcmerror = brcmf_sdbrcm_membytes(bus, true, (bus->orig_ramsize - 4),
- (u8 *)&varsizew, 4);
+ (u8 *)&varsizew_le, 4);

return bcmerror;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 9e07f77..b4befec 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -378,7 +378,7 @@ brcmf_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
{
union {
s8 buf[BRCMF_C_IOCTL_SMLEN];
- s32 val;
+ __le32 val;
} var;
u32 len;
u32 data_null;
@@ -890,11 +890,11 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,

/* Configure Beacon Interval for starter */
if (params->beacon_interval)
- bcnprd = cpu_to_le32(params->beacon_interval);
+ bcnprd = params->beacon_interval;
else
- bcnprd = cpu_to_le32(100);
+ bcnprd = 100;

- err = brcmf_dev_ioctl(dev, BRCM_SET_BCNPRD, &bcnprd, sizeof(bcnprd));
+ err = brcmf_dev_ioctl_u32(dev, BRCM_SET_BCNPRD, &bcnprd);
if (unlikely(err)) {
WL_ERR("WLC_SET_BCNPRD failed (%d)\n", err);
goto done;
@@ -2029,7 +2029,7 @@ static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
goto CleanUp;
}

- *(u32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX);
+ *(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX);

err = brcmf_dev_ioctl(dev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
if (unlikely(err)) {
@@ -2098,7 +2098,7 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)

ssid = (struct brcmf_ssid *)brcmf_read_prof(cfg_priv, WL_PROF_SSID);

- *(u32 *)cfg_priv->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
+ *(__le32 *)cfg_priv->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCMF_C_GET_BSS_INFO,
cfg_priv->extra_buf, WL_EXTRA_BUF_MAX);
if (unlikely(err)) {
--
1.7.1



2011-09-19 21:26:31

by Franky Lin

[permalink] [raw]
Subject: [PATCH 07/20] staging: brcm80211: remove event handler thread from fullmac

Use work queue to defer cfg80211 event handle jobs

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Signed-off-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 85 +++++-----------------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 3 +-
2 files changed, 21 insertions(+), 67 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 5e86e21..2dd28a2 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -3248,69 +3248,30 @@ static void brcmf_put_event(struct brcmf_cfg80211_event_q *e)
kfree(e);
}

-static s32 brcmf_event_handler(void *data)
+static void brcmf_cfg80211_event_handler(struct work_struct *work)
{
struct brcmf_cfg80211_priv *cfg_priv =
- (struct brcmf_cfg80211_priv *)data;
- struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
+ container_of(work, struct brcmf_cfg80211_priv,
+ event_work);
struct brcmf_cfg80211_event_q *e;
- DECLARE_WAITQUEUE(wait, current);

- sched_setscheduler(current, SCHED_FIFO, &param);
- allow_signal(SIGTERM);
- add_wait_queue(&cfg_priv->event_waitq, &wait);
- while (1) {
- prepare_to_wait(&cfg_priv->event_waitq, &wait,
- TASK_INTERRUPTIBLE);
-
- schedule();
-
- if (kthread_should_stop())
- break;
-
- e = brcmf_deq_event(cfg_priv);
- if (unlikely(!e)) {
- WL_ERR("event queue empty...\n");
- continue;
- }
-
- do {
- WL_INFO("event type (%d)\n", e->etype);
- if (cfg_priv->el.handler[e->etype])
- cfg_priv->el.handler[e->etype](cfg_priv,
- cfg_to_ndev(cfg_priv),
- &e->emsg, e->edata);
- else
- WL_INFO("Unknown Event (%d): ignoring\n",
- e->etype);
- brcmf_put_event(e);
- } while ((e = brcmf_deq_event(cfg_priv)));
+ e = brcmf_deq_event(cfg_priv);
+ if (unlikely(!e)) {
+ WL_ERR("event queue empty...\n");
+ return;
}
- finish_wait(&cfg_priv->event_waitq, &wait);
- WL_INFO("was terminated\n");
- return 0;
-}

-static s32 brcmf_create_event_handler(struct brcmf_cfg80211_priv *cfg_priv)
-{
- init_waitqueue_head(&cfg_priv->event_waitq);
- cfg_priv->event_tsk = kthread_run(brcmf_event_handler, cfg_priv,
- "wl_event_handler");
- if (IS_ERR(cfg_priv->event_tsk)) {
- cfg_priv->event_tsk = NULL;
- WL_ERR("failed to create event thread\n");
- return -ENOMEM;
- }
- return 0;
-}
+ do {
+ WL_INFO("event type (%d)\n", e->etype);
+ if (cfg_priv->el.handler[e->etype])
+ cfg_priv->el.handler[e->etype](cfg_priv,
+ cfg_to_ndev(cfg_priv),
+ &e->emsg, e->edata);
+ else
+ WL_INFO("Unknown Event (%d): ignoring\n", e->etype);
+ brcmf_put_event(e);
+ } while ((e = brcmf_deq_event(cfg_priv)));

-static void brcmf_destroy_event_handler(struct brcmf_cfg80211_priv *cfg_priv)
-{
- if (cfg_priv->event_tsk) {
- send_sig(SIGTERM, cfg_priv->event_tsk, 1);
- kthread_stop(cfg_priv->event_tsk);
- cfg_priv->event_tsk = NULL;
- }
}

static void brcmf_init_eq(struct brcmf_cfg80211_priv *cfg_priv)
@@ -3352,8 +3313,7 @@ static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
err = brcmf_init_priv_mem(cfg_priv);
if (unlikely(err))
return err;
- if (unlikely(brcmf_create_event_handler(cfg_priv)))
- return -ENOMEM;
+ INIT_WORK(&cfg_priv->event_work, brcmf_cfg80211_event_handler);
brcmf_init_eloop_handler(&cfg_priv->el);
mutex_init(&cfg_priv->usr_sync);
err = brcmf_init_iscan(cfg_priv);
@@ -3368,7 +3328,7 @@ static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)

static void wl_deinit_priv(struct brcmf_cfg80211_priv *cfg_priv)
{
- brcmf_destroy_event_handler(cfg_priv);
+ cancel_work_sync(&cfg_priv->event_work);
cfg_priv->dongle_up = false; /* dongle down */
brcmf_flush_eq(cfg_priv);
brcmf_link_down(cfg_priv);
@@ -3438,11 +3398,6 @@ void brcmf_cfg80211_detach(struct brcmf_cfg80211_dev *cfg_dev)
kfree(cfg_dev);
}

-static void brcmf_wakeup_event(struct brcmf_cfg80211_priv *cfg_priv)
-{
- wake_up(&cfg_priv->event_waitq);
-}
-
void
brcmf_cfg80211_event(struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
@@ -3451,7 +3406,7 @@ brcmf_cfg80211_event(struct net_device *ndev,
struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);

if (likely(!brcmf_enq_event(cfg_priv, event_type, e)))
- brcmf_wakeup_event(cfg_priv);
+ schedule_work(&cfg_priv->event_work);
}

static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index d27d4e6..79806c0 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -298,8 +298,7 @@ struct brcmf_cfg80211_priv {
struct brcmf_cfg80211_iscan_ctrl *iscan; /* iscan controller */
struct brcmf_cfg80211_connect_info conn_info; /* association info */
struct brcmf_cfg80211_pmk_list *pmk_list; /* wpa2 pmk list */
- struct task_struct *event_tsk; /* task of main event handler thread */
- wait_queue_head_t event_waitq; /* wait queue for main event handling */
+ struct work_struct event_work; /* event handler work struct */
unsigned long status; /* current dongle status */
void *pub;
u32 channel; /* current channel */
--
1.7.1



2011-09-22 06:54:05

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

W dniu 22 września 2011 00:12 użytkownik Brett Rudley
<[email protected]> napisał:
>> > Our original plan was to remain a separate driver from b43. We were
>> aware of it and all the good work that had been done to create it and we
>> had no intention of interfering with it.  At that point there had not
>> been very much recent movement in b43 and it did not support any of our
>> AXI based chips.  We figured that ssb vs AXI was a good dividing line and
>> there would be no conflict, and there wasn't initially.
>>
>> The first obvious problem is that there are SSB and BCMA (aka AXI)
>> cards using N-PHY. That resulted in PHY code duplication between b43
>> and brcmsmac. And since we already supported N-PHY in b43, adding bcma
>> support automatically gave us BCM43224 and BCM43225 support. That of
>> course means duplicated supported for the same hardware.
>
> Agree, when you created bcma, it did duplicate HW support already in brcmsmac.  Why didn't you address that then?

bcma is not the issue, it had to be created anyway. We can not accept
one driver handling all the BCMA/AXI cores (80211, ethernet, whatever
else). And you, I believe brcmsmac has to switch to bcma.


> Also, brcmsmac realizes that there are tweaks and features specific to each chip and to each revision of each phy.  While they are of the same family, each version has its own feature set and settings.
>
> But b43 got 224/5 so called support 'automaticly' simply by adding AXI access.

Chips tweaks mostly lays in bus code, which is bcma in this case. As
for PHY code, you've not even cared to take a look at our phy_n.c! But
you're commenting that anyway.
BCM43224 and BCM43225 are nothing special, there are N-PHY rev 6.
We've code for revs 1-6 from the beginning. That's how we got support
for that cards "automaticly". I was here since "ever", we just got to
add BCMA/AXI support.


>> > Internally, prior to releasing to staging tree, development had gone
>> quickly and it didn't take long at all to get the driver up and running.
>>  We did not anticipate that things would go somewhat slower in the
>> staging tree and a year (and hundreds of patches) later we are still
>> there.  During that year b43 got some limited support for the same new
>> chips brcmsmac already had, into its driver.  So now, here we are... both
>> drivers supporting the new chips and b43 also supporting the old.
>> >
>> > We have seen the requests for us to add AXI based chipset support into
>> b43.  I don't think that will happen in a substantial way:
>> > - Our driver is already stable and performance is better than b43 in
>> terms of AXI chips.  B43 seems quite raw: its full of TODO and FIXME
>> notes and performance is 1/10th of brcmsmac on our testing. Spending
>> another round of time and effort on b43 to get it to the place where smac
>> already is, seems redundant and unattractive.
>>
>> Well, I guess you were comparing brcmsmac working in 802.11n mode vs.
>> b43 workin in 802.11g mode?
>
> I just loaded the two drivers on my machine and ran iperf.  Are users expected to do something else?  802.11N APs are not esoteric equipment anymore, sorry.

[irony, yes]
Monitor mode is nothing esoteric anymore. I've compared b43 with
brcmsmac. b43 is 100000000 times faster (compared to 0 b/s).


>> Yes, I'm aware you may be not so comfortable with differences between
>> internal driver and b43.
>> However you're already at the place, when you can not just copy&paste
>> code from your internal driver to brcmsmac. You have to adopt in
>> anyway. Are there really so many differences if you look at b43? DMA
>> is something you probably don't need to touch. PHY code should be
>> portable to b43 in the same way it is to brcmsmac. The biggest problem
>> is to touch some general things, not PHY-directly-related. And even in
>> that code we share a lot of code. Our code is based on RE of your
>> driver. It has to be similar.
>
> If they are so similar why do you think b43 is better?

I've said what I don't like currently in brcmsmac. I've also said both
drivers should be equal in next few months. Nothing really more to
add, it's not about flamewar. Plus Michael commented this nicely.


>> > - Most of the recent b43 additions support comes from a single person
>> doing reverse engineering. brcmsmac has a few software people working on
>> it directly and hundreds of people working on it indirectly (through the
>> internal version) including engineers working on firmware, RTL, testing,
>> etc.
>>
>> You're doing much harder job and obviously you need much more people.
>> I just implement the driver, without testing hardware for various
>> possible configurations, etc. That's the only explanation how we've
>> achieved such a good state. We copied init/config values from your
>> driver, didn't invent them ourself.
>
> Speaking of init values, I noticed you have init values but no others after that during runtime.  We don't drive our chips
> without proper periodic calibrations.

You really got to ignore previous thread about going mainline.
That issue was already pointed to me, and I've already started sending
patches for that.


>> Well, you spent a lot of time on cleaning brcmsmac, I spent a lot of
>> time on adding support for new hardware. I believe now we both are at
>> similar stage from reaching fully functional, feature-full driver. 1:1
>> for both of us ;)
>>
>
>
>> Well, you were submitting patches, but you weren't discussing anything
>> with us. That's really important in being a good citizens.
>> How many times have I asked about the firmware? How many times about
>> access to the hardware? How many times about the future? Really, I was
>> trying hard to cooperate, you just were ignoring all of that :|
>> We've now finally made you respond to the questions about the future,
>> but you still ignore my fw questions and hw requests.
>> This of course resulted in the complex situation we have now.
>>
>
> Do you think were in the smokey back room making deals or something?  All our patches are out in the open.
> We have tried to be as transparent as possible.
> We responded and integrated all (almost all?) feedback that we got on our patches.
> We published our TODO list and updated it several times throughout devel cycle.

I didn't comment your patches. Maybe I've said sth about amount of
them, but it's your choice to spend your time on cleaning, cleaning,
cleaning, I'm find with that.


> We helped you with bcma.   You asked us to send you an Arasan board which are hard to get and cost
> about $1k, I can't do that.  I handed out 4313 and 43224 boards like candy early on to anyone who asked.

I don't remember you saying finally "Sorry, we won't be able to donate
you with that". Will re-check.
Still, you refused to share BCM4331 (which is already available on
market, and even hackish-supported by b43). Same for BCM43227 and
BCM43228. I didn't even care to ask for some SSLPN card (which is also
available on the market in some routers, can find proves).
Oh, and you still didn't care too much about our firmware requests.


>> > Other than barely supporting one of our chips first in mainline, I
>> would really like to understand what are the benefits and justifications
>> of using b43 over brcmsmac for AXI based chips in the long run.  Can
>> someone explain them?
>>
>> What I don't like about brcmsmac?
>> 1) Not modularized, bcma support built in and duplicated with bcma module
>
> As discussed numerous times:
> We have been in staging and no new features is the rule. We have bcma code waiting to be released.

Please, do this soon. When merge window for 3.2 will open, you'll
receive all recent bcma code. If there is anything missing in bcma you
need, *please report that* (or provide patches).
I believe this is part of cleaning, nothing like new features. You'll
simply drop a lot of duplicated code by switching to bcma.


>> 2) Poor quality code
>
>> 3) Duplication of a lot of code with bcma&b43. Not just PHY code, but
>> also more general functions, DMA support, MAC, etc.
>
> Seriously? Again? You keep bringing this up. Do you understand that there was no bcma when we released to staging and that we
> were asked not to add new features while in staging?   It would be nice if you could acknowledge that.
>
> But other than the one line comment on code, you still haven't answered the question of why you think b43 is a better driver.

--
Rafał

2011-09-22 07:25:00

by Rafał Miłecki

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

W dniu 22 września 2011 08:54 użytkownik Rafał Miłecki
<[email protected]> napisał:
> W dniu 22 września 2011 00:12 użytkownik Brett Rudley
>> We helped you with bcma.   You asked us to send you an Arasan board which are hard to get and cost
>> about $1k, I can't do that.  I handed out 4313 and 43224 boards like candy early on to anyone who asked.
>
> I don't remember you saying finally "Sorry, we won't be able to donate
> you with that". Will re-check.

Yup, there is my question and respond from Henry:


W dniu 26 sierpnia 2011 19:31 użytkownik Henry Ptasinski
<[email protected]> napisał:
>> > Is there a chance you can donate me with such a adapter and card?
>>
>> Ping?
>
> Sorry, I meant to respond to this earlier.  The Arasan adapters are in very
> short supply here, and honestly they have enough issues that we're looking for
> better options.  A possibly better approach would be a device with a BCM4329 on
> the motherboard (e.g. table, phone, etc) that can run a relatively stock linux
> kernel.  However, I don't know of a specific platform at the moment to
> recommend.
>
> A second choice would be something with a decent sdio controller built-in.
> Some older laptops worked ok (e.g. Dell E4100), but they're more and more
> diffucult to find.

Unfortunately not a word about donating me such a hardware. Plus not a
word about the cost.

--
Rafał

2011-09-20 13:21:22

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

On Tue, 2011-09-20 at 06:03 -0700, Greg KH wrote:

> And while code is great and nice, I still haven't seen any real answers
> to all of the questions that were asked of the Broadcom driver team
> during that review by the linux-wireless developers about how things
> will be handled properly due to the overlap in functionality with the
> existing "real" driver in the tree.

Let's qualify this to "some developers".

One thing I'd like to point out is that the Broadcom's firmware API has
always undergone changes over time. I'm actually surprised that b43
works as well as it does (which, tbh, isn't very well at all, at least
for me with some 11n PHY). I also don't think that Broadcom are going to
maintain compatibility and/or maintain new firmware features for old
devices, that just doesn't make any sense.

As a consequence, I don't think there's any sense in saying b43 should
be the driver that Broadcom must support upstream. Even we, back then,
split b43 into b43 and b43legacy when it wasn't really possible any more
to test and maintain a single driver for different devices. Rafal has
shown that it is possible today (to some extent) to do that for the
newer chips and the older 11g only chips that b43 still supports, but
I'm not convinced that with new features like P2P this will be true in
the future.

And this is just discussing the technical side -- the support side is an
entirely different question.

Now, don't get me wrong -- I don't think the duplication is a good
thing. A lot of the PHY code could be shared. However, I think it will
probably not be possible for much longer to share the higher level MAC
code that programs the SHM etc.

So I don't claim to know what the solution is, but I think simply
rejecting the Broadcom effort like most people seem to imply is a good
solution at all. It will leave all of us in a bad spot by creating a
driver that has to support too many different devices.

johannes


2011-09-21 23:26:35

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 00/20] staging: brcm80211: 7th reaction for mainline patch #2

2011/9/20 Alex Deucher <[email protected]>:
> 2011/9/20 Rafał Miłecki <[email protected]>:
>> 2011/9/20 Johannes Berg <[email protected]>:
>>> On Tue, 2011-09-20 at 06:03 -0700, Greg KH wrote:
>>>
>>>> And while code is great and nice, I still haven't seen any real answers
>>>> to all of the questions that were asked of the Broadcom driver team
>>>> during that review by the linux-wireless developers about how things
>>>> will be handled properly due to the overlap in functionality with the
>>>> existing "real" driver in the tree.
>>>
>>> Let's qualify this to "some developers".
>>>
>>> One thing I'd like to point out is that the Broadcom's firmware API has
>>> always undergone changes over time. I'm actually surprised that b43
>>> works as well as it does (which, tbh, isn't very well at all, at least
>>> for me with some 11n PHY). I also don't think that Broadcom are going to
>>> maintain compatibility and/or maintain new firmware features for old
>>> devices, that just doesn't make any sense.
>>
>> Actually, when we got some single response from Broadcom about their
>> relation to b43, they haven't mentioned support for old HW is any
>> problem at all.
>
> If you look at it from the perspective of a hardware manufacturer,
> supporting EOLed chips is generally not a good return on investment.
> There is no new revenue associated with them so any work that goes
> into them stands to return very little.

Support is one thing, the other is to enable the community. The later
can be done while real support goes into the newer chipsets.

Luis