2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 00/31] staging: brcm80211: fullmac cleanup and checkpatch fixes

This series mainly consists of fullmac cleanup. Several checkpatch warnings
were fixed and some review comments from the previous series were addressed.

Arend van Spriel (10):
staging: brcm80211: clean up checkpatch error
staging: brcm80211: rename macros in dhd_dbg.h
staging: brcm80211: remove checkpatch warnings 'suspect code indent'
staging: brcm80211: made name lookup arrays more const
staging: brcm80211: remove checkpatch warnings from phy_n.c
staging: brcm80211: replace occurrences of __attribute__((packed))
staging: brcm80211: remove several externs from dhd_linux.c
staging: brcm80211: remove external definitions from phy_lcn.c
staging: brcm80211: remove macro WLBANDINITFN from brcmsmac
staging: brcm80211: added newlines to some debug macros in
bcmsdh_sdmmc.c

Roland Vossen (21):
staging: brcm80211: removed occurrences of 'dhd'
staging: brcm80211: removed unused #ifdef sections in fullmac
staging: brcm80211: removed asserts from two fullmac files
staging: brcm80211: removed asserts from bcmsdh.c
staging: brcm80211: removed asserts from dhd_cdc.c and dhd_common.c
staging: brcm80211: removed asserts from dhd_linux.c
staging: brcm80211: removed asserts from dhd_sdio.c
staging: brcm80211: removed remains of assert mechanism in fullmac
staging: brcm80211: replaced various typedefs in softmac
staging: brcm80211: replaced typedef phy_info_t by struct brcms_phy
staging: brcm80211: replaced typedef wlc_phy_t with struct
brcms_phy_pub
staging: brcm80211: replaced typedef tx_power_t by struct
brcms_tx_power
staging: brcm80211: renamed structures in softmac
staging: brcm80211: replaced Broadcom specific acronym WLC
staging: brcm80211: deleted two fullmac source files
staging: brcm80211: merged dngl_stats.h into dhd.h
staging: brcm80211: merged sbsdio.h into sdio_host.h
staging: brcm80211: merged bcmsdbus.h into sdio_host.h
staging: brcm80211: moved fullmac definitions from .h to .c files
staging: brcm80211: removed #ifdef SDIOH_API_ACCESS_RETRY_LIMIT
staging: brcm80211: simpler string handling in
brcmf_c_pktfilter_offload_set()

drivers/staging/brcm80211/brcmfmac/Makefile | 4 +-
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 190 ---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 208 +++-
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 178 ---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 344 +++++-
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 262 ----
drivers/staging/brcm80211/brcmfmac/dhd.h | 49 +-
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 15 +-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 78 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 251 ++--
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 68 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 468 ++-----
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 32 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 1344 +++++++++++---------
drivers/staging/brcm80211/brcmfmac/dngl_stats.h | 32 -
drivers/staging/brcm80211/brcmfmac/sbsdio.h | 277 ----
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 152 +++
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 44 +-
drivers/staging/brcm80211/brcmsmac/aiutils.c | 134 +-
drivers/staging/brcm80211/brcmsmac/aiutils.h | 2 +-
drivers/staging/brcm80211/brcmsmac/alloc.c | 79 +-
drivers/staging/brcm80211/brcmsmac/ampdu.c | 121 +-
drivers/staging/brcm80211/brcmsmac/ampdu.h | 4 +-
drivers/staging/brcm80211/brcmsmac/antsel.c | 21 +-
drivers/staging/brcm80211/brcmsmac/bmac.c | 452 ++++----
drivers/staging/brcm80211/brcmsmac/bmac.h | 98 +-
drivers/staging/brcm80211/brcmsmac/channel.c | 417 ++++---
drivers/staging/brcm80211/brcmsmac/channel.h | 61 +-
drivers/staging/brcm80211/brcmsmac/d11.h | 32 +-
drivers/staging/brcm80211/brcmsmac/dma.c | 300 +++---
drivers/staging/brcm80211/brcmsmac/dma.h | 8 +-
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 26 +-
drivers/staging/brcm80211/brcmsmac/mac80211_if.h | 4 +-
drivers/staging/brcm80211/brcmsmac/main.c | 804 ++++++------
drivers/staging/brcm80211/brcmsmac/main.h | 295 +++--
drivers/staging/brcm80211/brcmsmac/nicpci.c | 103 +-
drivers/staging/brcm80211/brcmsmac/otp.c | 45 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 550 ++++----
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h | 203 ++--
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h | 336 +++---
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 532 ++++----
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h | 4 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 832 ++++++------
.../staging/brcm80211/brcmsmac/phy/phytbl_lcn.c | 29 +-
.../staging/brcm80211/brcmsmac/phy/phytbl_lcn.h | 30 +-
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c | 18 +-
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h | 8 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.c | 74 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.h | 76 +-
drivers/staging/brcm80211/brcmsmac/pub.h | 186 ++--
drivers/staging/brcm80211/brcmsmac/rate.c | 153 ++-
drivers/staging/brcm80211/brcmsmac/rate.h | 90 +-
drivers/staging/brcm80211/brcmsmac/scb.h | 5 +-
drivers/staging/brcm80211/brcmsmac/srom.c | 26 +-
drivers/staging/brcm80211/brcmsmac/stf.c | 43 +-
drivers/staging/brcm80211/brcmsmac/stf.h | 2 +-
drivers/staging/brcm80211/brcmsmac/types.h | 127 +--
drivers/staging/brcm80211/include/brcmu_utils.h | 4 -
drivers/staging/brcm80211/include/brcmu_wifi.h | 37 +-
drivers/staging/brcm80211/include/defs.h | 26 +-
60 files changed, 4940 insertions(+), 5453 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
delete mode 100644 drivers/staging/brcm80211/brcmfmac/dngl_stats.h
delete mode 100644 drivers/staging/brcm80211/brcmfmac/sbsdio.h

--
1.7.4.1




2011-07-06 14:27:37

by Roland Vossen

[permalink] [raw]
Subject: Re: [PATCH 07/31] staging: brcm80211: removed asserts from dhd_cdc.c and dhd_common.c

Hi Dan,

>> @@ -317,14 +312,16 @@ brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name,
>>
>> BRCMF_TRACE(("%s: Enter\n", __func__));
>>
>> - ASSERT(name);
>> - ASSERT(len>= 0);
>> + if (name == NULL || len<= 0)
>> + return -EINVAL;
>>
>
> In the original code len == 0 was OK but now we return -EINVAL.

Agreed, this is non desirable behavior. We did not see a regression in
our fullmac driver testing (which, I admit, is fairly limited at this
stage). I will create an additional patch to fix this.

Thanks, Roland.


2011-07-05 22:03:20

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 31/31] staging: brcm80211: added newlines to some debug macros in bcmsdh_sdmmc.c

Some macros were missing a terminating '\n' character. This commit fixes
those.

Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 6567363..38bd9ba 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -220,7 +220,7 @@ static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
sdio_release_host(gInstance->func[1]);
if (err_ret) {
sd_err(("brcmf_sdioh_enablefuncs: Failed to enable F1 "
- "Err: 0x%08x", err_ret));
+ "Err: 0x%08x\n", err_ret));
}

return false;
@@ -671,7 +671,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
if (err_ret)
sd_err(("request_byte: "
"enable F2 "
- "failed:%d",
+ "failed:%d\n",
err_ret));
} else {
/* Disable Function 2 */
@@ -681,7 +681,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
if (err_ret)
sd_err(("request_byte: "
"Disab F2 "
- "failed:%d",
+ "failed:%d\n",
err_ret));
}
sdio_release_host(gInstance->func[2]);
@@ -789,7 +789,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
sdio_release_host(gInstance->func[func]);

if (err_ret) {
- sd_err(("brcmf: Failed to %s word, Err: 0x%08x",
+ sd_err(("brcmf: Failed to %s word, Err: 0x%08x\n",
rw ? "Write" : "Read", err_ret));
}

--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 02/31] staging: brcm80211: removed occurrences of 'dhd'

From: Roland Vossen <[email protected]>

DHD is a Broadcom internal term and has been replaced by BRCMF.

Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 26 ++--
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 8 +-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 7 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 4 +-
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 6 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 45 +++----
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 32 +++---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 158 +++++++++++------------
8 files changed, 132 insertions(+), 154 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 1540804..229a702 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -18,8 +18,8 @@
* Common types *
*/

-#ifndef _dhd_h_
-#define _dhd_h_
+#ifndef _BRCMF_H_
+#define _BRCMF_H_

#define BRCMF_VERSION_STR "4.218.248.5"

@@ -310,10 +310,10 @@ struct brcmf_event {
#define BRCMF_E_LINK_BSSCFG_DIS 4

/* The level of bus communication with the dongle */
-enum dhd_bus_state {
- DHD_BUS_DOWN, /* Not ready for frame transfers */
- DHD_BUS_LOAD, /* Download access only (CPU reset) */
- DHD_BUS_DATA /* Ready for frame transfers */
+enum brcmf_bus_state {
+ BRCMF_BUS_DOWN, /* Not ready for frame transfers */
+ BRCMF_BUS_LOAD, /* Download access only (CPU reset) */
+ BRCMF_BUS_DATA /* Ready for frame transfers */
};

/* Pattern matching filter. Specifies an offset within received packets to
@@ -533,12 +533,12 @@ struct brcmf_pub {
struct brcmf_proto *prot;
struct brcmf_info *info;

- /* Internal dhd items */
+ /* Internal brcmf items */
bool up; /* Driver up/down (to OS) */
bool txoff; /* Transmit flow-controlled */
bool dongle_reset; /* true = DEVRESET put dongle into reset */
- enum dhd_bus_state busstate;
- uint hdrlen; /* Total DHD header length (proto + bus) */
+ enum brcmf_bus_state busstate;
+ uint hdrlen; /* Total BRCMF header length (proto + bus) */
uint maxctl; /* Max size rxctl request from proto to bus */
uint rxsz; /* Rx buffer size bus module should use */
u8 wme_dp; /* wme discard priority */
@@ -564,7 +564,7 @@ struct brcmf_pub {
unsigned long rx_dropped; /* Packets dropped locally (no memory) */
unsigned long rx_flushed; /* Packets flushed due to
unscheduled sendup thread */
- unsigned long wd_dpc_sched; /* Number of times dhd dpc scheduled by
+ unsigned long wd_dpc_sched; /* Number of times dpc scheduled by
watchdog timer */

unsigned long rx_readahead_cnt; /* Number of packets where header read-ahead
@@ -744,10 +744,6 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
{
}

-/*
- * Exported from dhd OS modules (dhd_linux/dhd_ndis)
- */
-
/* Indication from bus module regarding presence/insertion of dongle.
* Return struct brcmf_pub pointer, used as handle to OS module in later calls.
* Returned structure should have bus and prot pointers filled in.
@@ -902,4 +898,4 @@ struct brcmf_pktgen {
#define BRCMF_IDLE_ACTIVE 0 /* Do not request any SD clock change
when idle */

-#endif /* _dhd_h_ */
+#endif /* _BRCMF_H_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index a60aa41..a94152e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -14,8 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

-#ifndef _dhd_bus_h_
-#define _dhd_bus_h_
+#ifndef _BRCMF_BUS_H_
+#define _BRCMF_BUS_H_

/* Packet alignment for most efficient SDIO (can change based on platform) */
#ifndef BRCMF_SDALIGN
@@ -26,7 +26,7 @@
#endif

/*
- * Exported from dhd bus module (dhd_usb, dhd_sdio)
+ * Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
*/

/* Watchdog timer interval */
@@ -68,4 +68,4 @@ extern void brcmf_bus_clearcounts(struct brcmf_pub *drvr);

extern void brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick);

-#endif /* _dhd_bus_h_ */
+#endif /* _BRCMF_BUS_H_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index a1902f2..30c5d2d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -82,7 +82,6 @@ struct brcmf_proto_bdc_header {

#define RETRIES 2 /* # of retries to retrieve matching ioctl response */
#define BUS_HEADER_LEN (16+BRCMF_SDALIGN) /* Must be atleast SDPCM_RESERVE
- * defined in dhd_sdio.c
* (amount of header tha might be added)
* plus any space that might be needed
* for alignment padding.
@@ -176,8 +175,8 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,

ret = brcmf_proto_cdc_msg(drvr);
if (ret < 0) {
- DHD_ERROR(("dhdcdc_query_ioctl: dhdcdc_msg failed w/status "
- "%d\n", ret));
+ DHD_ERROR(("brcmf_proto_cdc_query_ioctl: brcmf_proto_cdc_msg "
+ "failed w/status %d\n", ret));
goto done;
}

@@ -280,7 +279,7 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
struct brcmf_proto *prot = drvr->prot;
int ret = -1;

- if (drvr->busstate == DHD_BUS_DOWN) {
+ if (drvr->busstate == BRCMF_BUS_DOWN) {
DHD_ERROR(("%s : bus is down. we have nothing to do\n",
__func__));
return ret;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index ec6093e..aead274 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -118,7 +118,7 @@ static int brcmf_c_dump(struct brcmf_pub *drvr, char *buf, int buflen)

brcmu_binit(strbuf, buf, buflen);

- /* Base DHD info */
+ /* Base info */
brcmu_bprintf(strbuf, "%s\n", brcmf_version);
brcmu_bprintf(strbuf, "\n");
brcmu_bprintf(strbuf, "pub.up %d pub.txoff %d pub.busstate %d\n",
@@ -672,7 +672,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
if (hdr.version != MSGTRACE_VERSION) {
DHD_ERROR(
("\nMACEVENT: %s [unsupported version --> "
- "dhd version:%d dongle version:%d]\n",
+ "brcmf version:%d dongle version:%d]\n",
event_name, MSGTRACE_VERSION, hdr.version)
);
/* Reset datalen to avoid display below */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
index 4733de7..2b1ccca 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
@@ -14,8 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

-#ifndef _dhd_dbg_
-#define _dhd_dbg_
+#ifndef _BRCMF_DBG_H_
+#define _BRCMF_DBG_H_

#if defined(BCMDBG)

@@ -73,4 +73,4 @@

extern int brcmf_msg_level;

-#endif /* _dhd_dbg_ */
+#endif /* _BRCMF_DBG_H_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index a6dc346..f62a3c0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -50,7 +50,6 @@ u32 g_assert_type;
#if defined(CONFIG_PM_SLEEP)
#include <linux/suspend.h>
atomic_t brcmf_mmc_suspend;
-DECLARE_WAIT_QUEUE_HEAD(dhd_dpc_wait);
#endif /* defined(CONFIG_PM_SLEEP) */

MODULE_AUTHOR("Broadcom Corporation");
@@ -175,13 +174,6 @@ uint brcmf_pktgen_len;
module_param(brcmf_pktgen_len, uint, 0);
#endif

-/* Version string to report */
-#ifdef BCMDBG
-#define DHD_COMPILED "\nCompiled in " SRCBASE
-#else
-#define DHD_COMPILED
-#endif
-
static int brcmf_toe_get(struct brcmf_info *drvr_priv, int idx, u32 *toe_ol);
static int brcmf_toe_set(struct brcmf_info *drvr_priv, int idx, u32 toe_ol);
static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
@@ -274,7 +266,7 @@ static void brcmf_early_suspend(struct early_suspend *h)
DHD_TRACE(("%s: enter\n", __func__));

if (drvr_priv)
- dhd_suspend_resume_helper(drvr_priv, 1);
+ brcmf_suspend_resume_helper(drvr_priv, 1);

}

@@ -286,7 +278,7 @@ static void brcmf_late_resume(struct early_suspend *h)
DHD_TRACE(("%s: enter\n", __func__));

if (drvr_priv)
- dhd_suspend_resume_helper(drvr_priv, 0);
+ brcmf_suspend_resume_helper(drvr_priv, 0);
}
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */

@@ -589,7 +581,7 @@ static void brcmf_op_if(struct brcmf_if *ifp)
memcpy(netdev_priv(ifp->net), &drvr_priv, sizeof(drvr_priv));
err = brcmf_net_attach(&drvr_priv->pub, ifp->idx);
if (err != 0) {
- DHD_ERROR(("%s: dhd_net_attach failed, "
+ DHD_ERROR(("%s: brcmf_net_attach failed, "
"err %d\n",
__func__, err));
ret = -EOPNOTSUPP;
@@ -741,7 +733,7 @@ int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx, struct sk_buff *pktbuf)
struct brcmf_info *drvr_priv = drvr->info;

/* Reject if down */
- if (!drvr->up || (drvr->busstate == DHD_BUS_DOWN))
+ if (!drvr->up || (drvr->busstate == BRCMF_BUS_DOWN))
return -ENODEV;

/* Update multicast statistic */
@@ -771,7 +763,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
DHD_TRACE(("%s: Enter\n", __func__));

/* Reject if down */
- if (!drvr_priv->pub.up || (drvr_priv->pub.busstate == DHD_BUS_DOWN)) {
+ if (!drvr_priv->pub.up || (drvr_priv->pub.busstate == BRCMF_BUS_DOWN)) {
DHD_ERROR(("%s: xmit rejected pub.up=%d busstate=%d\n",
__func__, drvr_priv->pub.up, drvr_priv->pub.busstate));
netif_stop_queue(net);
@@ -1087,7 +1079,7 @@ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)
memset(&info, 0, sizeof(info));
info.cmd = cmd;

- /* if dhd requested, identify ourselves */
+ /* if requested, identify ourselves */
if (strcmp(drvname, "?dhd") == 0) {
sprintf(info.driver, "dhd");
strcpy(info.version, BRCMF_VERSION_STR);
@@ -1225,7 +1217,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
}
}

- /* To differentiate between wl and dhd read 4 more byes */
+ /* To differentiate read 4 more byes */
if ((copy_from_user(&driver, (char *)ifr->ifr_data +
sizeof(struct brcmf_ioctl), sizeof(uint)) != 0)) {
bcmerror = -EINVAL;
@@ -1237,7 +1229,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
goto done;
}

- /* check for local dhd ioctl and handle it */
+ /* check for local brcmf ioctl and handle it */
if (driver == BRCMF_IOCTL_MAGIC) {
bcmerror = brcmf_c_ioctl((void *)&drvr_priv->pub, &ioc, buf, buflen);
if (bcmerror)
@@ -1246,7 +1238,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
}

/* send to dongle (must be up, and wl) */
- if ((drvr_priv->pub.busstate != DHD_BUS_DATA)) {
+ if ((drvr_priv->pub.busstate != BRCMF_BUS_DATA)) {
DHD_ERROR(("%s DONGLE_DOWN,__func__\n", __func__));
bcmerror = -EIO;
goto done;
@@ -1362,7 +1354,7 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
if (!ifp) {
ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
if (!ifp) {
- DHD_ERROR(("%s: OOM - struct dhd_if\n", __func__));
+ DHD_ERROR(("%s: OOM - struct brcmf_if\n", __func__));
return -ENOMEM;
}
}
@@ -1421,7 +1413,7 @@ 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) {
- DHD_ERROR(("%s: OOM - alloc dhd_info\n", __func__));
+ DHD_ERROR(("%s: OOM - alloc brcmf_info\n", __func__));
goto fail;
}

@@ -1460,7 +1452,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)

/* Attach and link in the protocol */
if (brcmf_proto_attach(&drvr_priv->pub) != 0) {
- DHD_ERROR(("dhd_prot_attach failed\n"));
+ DHD_ERROR(("brcmf_proto_attach failed\n"));
goto fail;
}

@@ -1473,10 +1465,10 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
if (brcmf_sysioc) {
sema_init(&drvr_priv->sysioc_sem, 0);
drvr_priv->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, drvr_priv,
- "_dhd_sysioc");
+ "_brcmf_sysioc");
if (IS_ERR(drvr_priv->sysioc_tsk)) {
printk(KERN_WARNING
- "_dhd_sysioc thread failed to start\n");
+ "_brcmf_sysioc thread failed to start\n");
drvr_priv->sysioc_tsk = NULL;
}
} else
@@ -1493,7 +1485,6 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
#if defined(CONFIG_PM_SLEEP)
atomic_set(&brcmf_mmc_suspend, false);
#endif /* defined(CONFIG_PM_SLEEP) */
- /* && defined(DHD_GPL) */
/* Init lock suspend to prevent kernel going to suspend */
#ifdef CONFIG_HAS_EARLYSUSPEND
drvr_priv->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
@@ -1533,7 +1524,7 @@ int brcmf_bus_start(struct brcmf_pub *drvr)
}

/* If bus is not ready, can't come up */
- if (drvr_priv->pub.busstate != DHD_BUS_DATA) {
+ if (drvr_priv->pub.busstate != BRCMF_BUS_DATA) {
DHD_ERROR(("%s failed bus is not ready\n", __func__));
return -ENODEV;
}
@@ -1703,7 +1694,6 @@ void brcmf_detach(struct brcmf_pub *drvr)

brcmf_cfg80211_detach();

- /* && defined(DHD_GPL) */
free_netdev(ifp->net);
kfree(ifp);
kfree(drvr_priv);
@@ -1727,7 +1717,7 @@ static int __init brcmf_module_init(void)
error = brcmf_bus_register();

if (error) {
- DHD_ERROR(("%s: dhd_bus_register failed\n", __func__));
+ DHD_ERROR(("%s: brcmf_bus_register failed\n", __func__));
goto failed;
}
return 0;
@@ -1739,9 +1729,6 @@ failed:
module_init(brcmf_module_init);
module_exit(brcmf_module_cleanup);

-/*
- * OS specific functions required to implement DHD driver in OS independent way
- */
int brcmf_os_proto_block(struct brcmf_pub *drvr)
{
struct brcmf_info *drvr_priv = drvr->info;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
index 0a76216..ff788b3 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
@@ -14,8 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

-#ifndef _dhd_proto_h_
-#define _dhd_proto_h_
+#ifndef _BRCMF_PROTO_H_
+#define _BRCMF_PROTO_H_

#ifndef IOCTL_RESP_TIMEOUT
#define IOCTL_RESP_TIMEOUT 2000 /* In milli second */
@@ -26,22 +26,22 @@
#endif

/*
- * Exported from the dhd protocol module (dhd_cdc, dhd_rndis)
+ * Exported from the brcmf protocol module (brcmf_cdc)
*/

/* Linkage, sets prot link and updates hdrlen in pub */
-extern int brcmf_proto_attach(struct brcmf_pub *dhdp);
+extern int brcmf_proto_attach(struct brcmf_pub *drvr);

-/* Unlink, frees allocated protocol memory (including dhd_prot) */
-extern void brcmf_proto_detach(struct brcmf_pub *dhdp);
+/* Unlink, frees allocated protocol memory (including brcmf_proto) */
+extern void brcmf_proto_detach(struct brcmf_pub *drvr);

/* Initialize protocol: sync w/dongle state.
* Sets dongle media info (iswl, drv_version, mac address).
*/
-extern int brcmf_proto_init(struct brcmf_pub *dhdp);
+extern int brcmf_proto_init(struct brcmf_pub *drvr);

/* Stop protocol: sync w/dongle state. */
-extern void brcmf_proto_stop(struct brcmf_pub *dhdp);
+extern void brcmf_proto_stop(struct brcmf_pub *drvr);

/* Add any protocol-specific data header.
* Caller must reserve prot_hdrlen prepend space.
@@ -54,22 +54,22 @@ extern int brcmf_proto_hdrpull(struct brcmf_pub *, int *ifidx,
struct sk_buff *rxp);

/* Use protocol to issue ioctl to dongle */
-extern int brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx,
+extern int brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx,
struct brcmf_ioctl *ioc, void *buf, int len);

/* Add prot dump output to a buffer */
-extern void brcmf_proto_dump(struct brcmf_pub *dhdp,
+extern void brcmf_proto_dump(struct brcmf_pub *drvr,
struct brcmu_strbuf *strbuf);

/* Update local copy of dongle statistics */
-extern void brcmf_proto_dstats(struct brcmf_pub *dhdp);
+extern void brcmf_proto_dstats(struct brcmf_pub *drvr);

-extern int brcmf_c_ioctl(struct brcmf_pub *dhd_pub, struct brcmf_c_ioctl *ioc,
+extern int brcmf_c_ioctl(struct brcmf_pub *drvr, struct brcmf_c_ioctl *ioc,
void *buf, uint buflen);

-extern int brcmf_c_preinit_ioctls(struct brcmf_pub *dhd);
+extern int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr);

-extern int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
- void *buf, uint len);
+extern int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx,
+ uint cmd, void *buf, uint len);

-#endif /* _dhd_proto_h_ */
+#endif /* _BRCMF_PROTO_H_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 5e079b0..c5552f1 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -167,17 +167,17 @@ struct rte_console {
#define TXRETRIES 2 /* # of retries for tx frames */

#if defined(CONFIG_MACH_SANDGATE2G)
-#define DHD_RXBOUND 250 /* Default for max rx frames in
+#define BRCMF_RXBOUND 250 /* Default for max rx frames in
one scheduling */
#else
-#define DHD_RXBOUND 50 /* Default for max rx frames in
+#define BRCMF_RXBOUND 50 /* Default for max rx frames in
one scheduling */
#endif /* defined(CONFIG_MACH_SANDGATE2G) */

-#define DHD_TXBOUND 20 /* Default for max tx frames in
+#define BRCMF_TXBOUND 20 /* Default for max tx frames in
one scheduling */

-#define DHD_TXMINMAX 1 /* Max tx frames if rx still pending */
+#define BRCMF_TXMINMAX 1 /* Max tx frames if rx still pending */

#define MEMBLOCK 2048 /* Block size used for downloading
of dongle image */
@@ -318,7 +318,7 @@ struct rte_console {
#define MAX_RX_DATASZ 2048

/* Maximum milliseconds to wait for F2 to come up */
-#define DHD_WAIT_F2RDY 3000
+#define BRCMF_WAIT_F2RDY 3000

/* Bump up limit on waiting for HT to account for first startup;
* if the image is doing a CRC calculation before programming the PMU
@@ -331,7 +331,7 @@ struct rte_console {
#endif

/* Value for ChipClockCSR during initial setup */
-#define DHD_INIT_CLKCTL1 (SBSDIO_FORCE_HW_CLKREQ_OFF | \
+#define BRCMF_INIT_CLKCTL1 (SBSDIO_FORCE_HW_CLKREQ_OFF | \
SBSDIO_ALP_AVAIL_REQ)

/* Flags for SDH calls */
@@ -483,7 +483,7 @@ struct sdpcmd_regs {

#ifdef BCMDBG
/* Device console log buffer state */
-struct dhd_console {
+struct brcmf_console {
uint count; /* Poll interval msec counter */
uint log_addr; /* Log struct address (fixed) */
struct rte_log log; /* Log struct (host copy) */
@@ -580,7 +580,7 @@ struct brcmf_bus {
uint pollcnt; /* Count of active polls */

#ifdef BCMDBG
- struct dhd_console console; /* Console output polling support */
+ struct brcmf_console console; /* Console output polling support */
uint console_addr; /* Console address from shared struct */
#endif /* BCMDBG */

@@ -592,7 +592,7 @@ struct brcmf_bus {
s32 idlecount; /* Activity timeout counter */
s32 idleclock; /* How to set bus driver when idle */
s32 sd_rxchain;
- bool use_rxchain; /* If dhd should use PKT chains */
+ bool use_rxchain; /* If brcmf should use PKT chains */
bool sleeping; /* Is SDIO bus sleeping? */
bool rxflow_mode; /* Rx flow control mode */
bool rxflow; /* Is rx flow control on */
@@ -716,7 +716,7 @@ struct sbconfig {
#define CLK_PENDING 2 /* Not used yet */
#define CLK_AVAIL 3

-#define DHD_NOPMU(dhd) (false)
+#define BRCMF_NOPMU(brcmf) (false)

#ifdef BCMDBG
static int qcount[NUMPRIO];
@@ -743,12 +743,12 @@ module_param(brcmf_dpc_prio, int, 0);
/* Console poll interval */
uint brcmf_console_ms;
module_param(brcmf_console_ms, uint, 0);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */

/* Tx/Rx bounds */
uint brcmf_txbound;
uint brcmf_rxbound;
-uint dhd_txminmax;
+uint brcmf_txminmax;

/* override the RAM size if possible */
#define DONGLE_MIN_MEMSIZE (128 * 1024)
@@ -832,7 +832,7 @@ w_sdreg32(struct brcmf_bus *bus, u32 regval, u32 reg_offset, u32 *retryvar)
}
}

-#define DHD_BUS SDIO_BUS
+#define BRCMF_BUS SDIO_BUS

#define PKT_AVAILABLE() (intstatus & I_HMB_FRAME_IND)

@@ -1223,7 +1223,7 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
bus->sleeping = false;

/* Enable interrupts again */
- if (bus->intr && (bus->drvr->busstate == DHD_BUS_DATA)) {
+ if (bus->intr && (bus->drvr->busstate == BRCMF_BUS_DATA)) {
bus->intdis = false;
brcmf_sdcard_intr_enable(bus->card);
}
@@ -1544,7 +1544,7 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)
}

/* Deflow-control stack if needed */
- if (drvr->up && (drvr->busstate == DHD_BUS_DATA) &&
+ if (drvr->up && (drvr->busstate == BRCMF_BUS_DATA) &&
drvr->txoff && (pktq_len(&bus->txq) < TXLOW))
brcmf_txflowcontrol(drvr, 0, OFF);

@@ -1742,7 +1742,7 @@ int brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msgle
brcmf_sdbrcm_sdlock(bus);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
brcmf_sdbrcm_sdunlock(bus);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
} else if (pending == true) {
DHD_CTL(("%s: cancelled\n", __func__));
return -ERESTARTSYS;
@@ -1752,7 +1752,7 @@ int brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msgle
brcmf_sdbrcm_sdlock(bus);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
brcmf_sdbrcm_sdunlock(bus);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
}

if (rxlen)
@@ -1802,7 +1802,7 @@ enum {
IOV_VARS
};

-const struct brcmu_iovar dhdsdio_iovars[] = {
+const struct brcmu_iovar brcmf_sdio_iovars[] = {
{"intr", IOV_INTR, 0, IOVT_BOOL, 0},
{"sleep", IOV_SLEEP, 0, IOVT_BOOL, 0},
{"pollrate", IOV_POLLRATE, 0, IOVT_UINT32, 0},
@@ -1855,7 +1855,7 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
};

static void
-dhd_dump_pct(struct brcmu_strbuf *strbuf, char *desc, uint num, uint div)
+brcmf_dump_pct(struct brcmu_strbuf *strbuf, char *desc, uint num, uint div)
{
uint q1, q2;

@@ -1901,43 +1901,43 @@ void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr, struct brcmu_strbuf *strbuf)
(bus->f2rxhdrs + bus->f2rxdata), bus->f2rxhdrs,
bus->f2rxdata, bus->f2txdata, bus->f1regdata);
{
- dhd_dump_pct(strbuf, "\nRx: pkts/f2rd", bus->drvr->rx_packets,
+ brcmf_dump_pct(strbuf, "\nRx: pkts/f2rd", bus->drvr->rx_packets,
(bus->f2rxhdrs + bus->f2rxdata));
- dhd_dump_pct(strbuf, ", pkts/f1sd", bus->drvr->rx_packets,
+ brcmf_dump_pct(strbuf, ", pkts/f1sd", bus->drvr->rx_packets,
bus->f1regdata);
- dhd_dump_pct(strbuf, ", pkts/sd", bus->drvr->rx_packets,
+ brcmf_dump_pct(strbuf, ", pkts/sd", bus->drvr->rx_packets,
(bus->f2rxhdrs + bus->f2rxdata + bus->f1regdata));
- dhd_dump_pct(strbuf, ", pkts/int", bus->drvr->rx_packets,
+ brcmf_dump_pct(strbuf, ", pkts/int", bus->drvr->rx_packets,
bus->intrcount);
brcmu_bprintf(strbuf, "\n");

- dhd_dump_pct(strbuf, "Rx: glom pct", (100 * bus->rxglompkts),
+ brcmf_dump_pct(strbuf, "Rx: glom pct", (100 * bus->rxglompkts),
bus->drvr->rx_packets);
- dhd_dump_pct(strbuf, ", pkts/glom", bus->rxglompkts,
+ brcmf_dump_pct(strbuf, ", pkts/glom", bus->rxglompkts,
bus->rxglomframes);
brcmu_bprintf(strbuf, "\n");

- dhd_dump_pct(strbuf, "Tx: pkts/f2wr", bus->drvr->tx_packets,
+ brcmf_dump_pct(strbuf, "Tx: pkts/f2wr", bus->drvr->tx_packets,
bus->f2txdata);
- dhd_dump_pct(strbuf, ", pkts/f1sd", bus->drvr->tx_packets,
+ brcmf_dump_pct(strbuf, ", pkts/f1sd", bus->drvr->tx_packets,
bus->f1regdata);
- dhd_dump_pct(strbuf, ", pkts/sd", bus->drvr->tx_packets,
+ brcmf_dump_pct(strbuf, ", pkts/sd", bus->drvr->tx_packets,
(bus->f2txdata + bus->f1regdata));
- dhd_dump_pct(strbuf, ", pkts/int", bus->drvr->tx_packets,
+ brcmf_dump_pct(strbuf, ", pkts/int", bus->drvr->tx_packets,
bus->intrcount);
brcmu_bprintf(strbuf, "\n");

- dhd_dump_pct(strbuf, "Total: pkts/f2rw",
+ brcmf_dump_pct(strbuf, "Total: pkts/f2rw",
(bus->drvr->tx_packets + bus->drvr->rx_packets),
(bus->f2txdata + bus->f2rxhdrs + bus->f2rxdata));
- dhd_dump_pct(strbuf, ", pkts/f1sd",
+ brcmf_dump_pct(strbuf, ", pkts/f1sd",
(bus->drvr->tx_packets + bus->drvr->rx_packets),
bus->f1regdata);
- dhd_dump_pct(strbuf, ", pkts/sd",
+ brcmf_dump_pct(strbuf, ", pkts/sd",
(bus->drvr->tx_packets + bus->drvr->rx_packets),
(bus->f2txdata + bus->f2rxhdrs + bus->f2rxdata +
bus->f1regdata));
- dhd_dump_pct(strbuf, ", pkts/int",
+ brcmf_dump_pct(strbuf, ", pkts/int",
(bus->drvr->tx_packets + bus->drvr->rx_packets),
bus->intrcount);
brcmu_bprintf(strbuf, "\n\n");
@@ -2140,7 +2140,7 @@ static int brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *s
sh->msgtrace_addr = le32_to_cpu(sh->msgtrace_addr);

if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
- DHD_ERROR(("%s: sdpcm_shared version %d in dhd "
+ DHD_ERROR(("%s: sdpcm_shared version %d in brcmf "
"is different than sdpcm_shared version %d in dongle\n",
__func__, SDPCM_SHARED_VERSION,
sh->flags & SDPCM_SHARED_VERSION_MASK));
@@ -2330,7 +2330,7 @@ static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus)

static int brcmf_sdbrcm_readconsole(struct brcmf_bus *bus)
{
- struct dhd_console *c = &bus->console;
+ struct brcmf_console *c = &bus->console;
u8 line[CONSOLE_LINE_MAX], ch;
u32 n, idx, addr;
int rv;
@@ -2803,12 +2803,12 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
break;

case IOV_GVAL(IOV_TXMINMAX):
- int_val = (s32) dhd_txminmax;
+ int_val = (s32) brcmf_txminmax;
memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_TXMINMAX):
- dhd_txminmax = (uint) int_val;
+ brcmf_txminmax = (uint) int_val;
break;
#endif /* BCMDBG */

@@ -3017,7 +3017,7 @@ static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter)
/* Allow HT Clock now that the ARM is running. */
bus->alp_only = false;

- bus->drvr->busstate = DHD_BUS_LOAD;
+ bus->drvr->busstate = BRCMF_BUS_LOAD;
}
fail:
return bcmerror;
@@ -3045,7 +3045,7 @@ brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
ASSERT(!set || (!params && !plen));

/* Look up var locally; if not found pass to host driver */
- vi = brcmu_iovar_lookup(dhdsdio_iovars, name);
+ vi = brcmu_iovar_lookup(brcmf_sdio_iovars, name);
if (vi == NULL) {
brcmf_sdbrcm_sdlock(bus);

@@ -3148,7 +3148,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
bus->hostintmask = 0;

/* Change our idea of bus state */
- bus->drvr->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = BRCMF_BUS_DOWN;

/* Force clocks on backplane to be sure F2 interrupt propagates */
saveclk = brcmf_sdcard_cfg_read(bus->card, SDIO_FUNC_1,
@@ -3212,7 +3212,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
DHD_TRACE(("%s: Enter\n", __func__));

/* try to download image and nvram to the dongle */
- if (drvr->busstate == DHD_BUS_DOWN) {
+ if (drvr->busstate == BRCMF_BUS_DOWN) {
if (!(brcmf_sdbrcm_download_firmware(bus, bus->card)))
return -1;
}
@@ -3257,7 +3257,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
NULL);

/* Give the dongle some time to do its thing and set IOR2 */
- brcmf_timeout_start(&tmo, DHD_WAIT_F2RDY * 1000);
+ brcmf_timeout_start(&tmo, BRCMF_WAIT_F2RDY * 1000);

ready = 0;
while (ready != enable && !brcmf_timeout_expired(&tmo))
@@ -3278,7 +3278,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
(u8) watermark, &err);

/* Set bus state according to enable result */
- drvr->busstate = DHD_BUS_DATA;
+ drvr->busstate = BRCMF_BUS_DATA;

bus->intdis = false;
if (bus->intr) {
@@ -3317,7 +3317,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
#endif /* defined(OOB_INTR_ONLY) */

/* If we didn't come up, turn off backplane clock */
- if (drvr->busstate != DHD_BUS_DATA)
+ if (drvr->busstate != BRCMF_BUS_DATA)
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);

exit:
@@ -3388,7 +3388,7 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)

/* If we can't reach the device, signal failure */
if (err || brcmf_sdcard_regfail(card))
- bus->drvr->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = BRCMF_BUS_DOWN;
}

static void
@@ -3474,7 +3474,7 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)
if (sdret < 0) {
DHD_ERROR(("%s: read %d control bytes failed: %d\n",
__func__, rdlen, sdret));
- bus->rxc_errors++; /* dhd.rx_ctlerrs is higher level */
+ bus->rxc_errors++;
brcmf_sdbrcm_rxfail(bus, true, true);
goto done;
}
@@ -3941,7 +3941,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
*finished = false;

for (rxseq = bus->rx_seq, rxleft = maxframes;
- !bus->rxskip && rxleft && bus->drvr->busstate != DHD_BUS_DOWN;
+ !bus->rxskip && rxleft && bus->drvr->busstate != BRCMF_BUS_DOWN;
rxseq++, rxleft--) {

/* Handle glomming separately */
@@ -4216,8 +4216,9 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* Validate data offset */
if ((doff < SDPCM_HDRLEN) || (doff > len)) {
- DHD_ERROR(("%s (nextlen): bad data offset %d: HW len %d min %d\n",
- __func__, doff, len, SDPCM_HDRLEN));
+ DHD_ERROR(("%s (nextlen): bad data offset %d: "
+ "HW len %d min %d\n",
+ __func__, doff, len, SDPCM_HDRLEN));
brcmf_sdbrcm_rxfail(bus, false, false);
brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
@@ -4602,7 +4603,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
if (err) {
DHD_ERROR(("%s: error reading DEVCTL: %d\n",
__func__, err));
- bus->drvr->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = BRCMF_BUS_DOWN;
} else {
ASSERT(devctl & SBSDIO_DEVCTL_CA_INT_ONLY);
}
@@ -4614,7 +4615,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
if (err) {
DHD_ERROR(("%s: error reading CSR: %d\n", __func__,
err));
- bus->drvr->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = BRCMF_BUS_DOWN;
}

DHD_INFO(("DPC: PENDING, devctl 0x%02x clkctl 0x%02x\n", devctl,
@@ -4626,7 +4627,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
if (err) {
DHD_ERROR(("%s: error reading DEVCTL: %d\n",
__func__, err));
- bus->drvr->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = BRCMF_BUS_DOWN;
}
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
@@ -4634,7 +4635,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
if (err) {
DHD_ERROR(("%s: error writing DEVCTL: %d\n",
__func__, err));
- bus->drvr->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = BRCMF_BUS_DOWN;
}
bus->clkstate = CLK_AVAIL;
} else {
@@ -4791,7 +4792,7 @@ clkwait:
else if ((bus->clkstate == CLK_AVAIL) && !bus->fcstate &&
brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && txlimit
&& DATAOK(bus)) {
- framecnt = rxdone ? txlimit : min(txlimit, dhd_txminmax);
+ framecnt = rxdone ? txlimit : min(txlimit, brcmf_txminmax);
framecnt = brcmf_sdbrcm_sendfromq(bus, framecnt);
txlimit -= framecnt;
}
@@ -4800,12 +4801,12 @@ clkwait:
else await next interrupt */
/* On failed register access, all bets are off:
no resched or interrupts */
- if ((bus->drvr->busstate == DHD_BUS_DOWN) ||
+ if ((bus->drvr->busstate == BRCMF_BUS_DOWN) ||
brcmf_sdcard_regfail(card)) {
DHD_ERROR(("%s: failed backplane access over SDIO, halting "
"operation %d\n", __func__,
brcmf_sdcard_regfail(card)));
- bus->drvr->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = BRCMF_BUS_DOWN;
bus->intstatus = 0;
} else if (bus->clkstate == CLK_PENDING) {
DHD_INFO(("%s: rescheduled due to CLK_PENDING awaiting "
@@ -4844,7 +4845,7 @@ void brcmf_sdbrcm_isr(void *arg)
}
card = bus->card;

- if (bus->drvr->busstate == DHD_BUS_DOWN) {
+ if (bus->drvr->busstate == BRCMF_BUS_DOWN) {
DHD_ERROR(("%s : bus is down. we have nothing to do\n",
__func__));
return;
@@ -5196,7 +5197,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
}
#ifdef BCMDBG
/* Poll for console output periodically */
- if (drvr->busstate == DHD_BUS_DATA && brcmf_console_ms != 0) {
+ 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;
@@ -5329,14 +5330,14 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
* first time that the driver is initialized vs subsequent
* initializations.
*/
- brcmf_txbound = DHD_TXBOUND;
- brcmf_rxbound = DHD_RXBOUND;
+ brcmf_txbound = BRCMF_TXBOUND;
+ brcmf_rxbound = BRCMF_RXBOUND;
brcmf_alignctl = true;
sd1idle = true;
brcmf_readahead = true;
retrydata = false;
brcmf_dongle_memsize = 0;
- dhd_txminmax = DHD_TXMINMAX;
+ brcmf_txminmax = BRCMF_TXMINMAX;

forcealign = true;

@@ -5400,7 +5401,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
}
bus->card = card;
bus->cl_devid = (u16) devid;
- bus->bus = DHD_BUS;
+ bus->bus = BRCMF_BUS;
bus->tx_seq = SDPCM_SEQUENCE_WRAP - 1;
bus->usebufpool = false; /* Use bufpool if allocated,
else use locally malloced rxbuf */
@@ -5446,10 +5447,10 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
/* Initialize DPC thread */
init_completion(&bus->dpc_wait);
bus->dpc_tsk = kthread_run(brcmf_sdbrcm_dpc_thread,
- bus, "dhd_dpc");
+ bus, "brcmf_dpc");
if (IS_ERR(bus->dpc_tsk)) {
printk(KERN_WARNING
- "dhd_dpc thread failed to start\n");
+ "brcmf_dpc thread failed to start\n");
bus->dpc_tsk = NULL;
}
} else {
@@ -5458,10 +5459,10 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
bus->dpc_tsk = NULL;
}

- /* Attach to the dhd/OS/network interface */
+ /* Attach to the brcmf/OS/network interface */
bus->drvr = brcmf_attach(bus, SDPCM_RESERVE);
if (!bus->drvr) {
- DHD_ERROR(("%s: dhd_attach failed\n", __func__));
+ DHD_ERROR(("%s: brcmf_attach failed\n", __func__));
goto fail;
}

@@ -5536,16 +5537,16 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva,
*/

brcmf_sdcard_cfg_write(card, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- DHD_INIT_CLKCTL1, &err);
+ BRCMF_INIT_CLKCTL1, &err);
if (!err)
clkctl =
brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, &err);

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

@@ -5563,7 +5564,7 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva,
brcmf_sdbrcm_sdiod_drive_strength_init(bus, brcmf_sdiod_drive_strength);

/* Get info on the ARM and SOCRAM cores... */
- if (!DHD_NOPMU(bus)) {
+ if (!BRCMF_NOPMU(bus)) {
brcmf_sdcard_reg_read(bus->card,
CORE_SB(bus->ci->armcorebase, sbidhigh), 4);
bus->orig_ramsize = bus->ci->ramsize;
@@ -5657,7 +5658,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card)
brcmf_sdcard_cfg_write(card, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL);

- bus->drvr->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = BRCMF_BUS_DOWN;
bus->sleeping = false;
bus->rxflow = false;

@@ -5790,7 +5791,7 @@ static void brcmf_sdbrcm_disconnect(void *ptr)
* order to look for or await the device.
*/

-static struct brcmf_sdioh_driver dhd_sdio = {
+static struct brcmf_sdioh_driver brcmf_sdio = {
brcmf_sdbrcm_probe,
brcmf_sdbrcm_disconnect
};
@@ -5814,7 +5815,7 @@ int brcmf_bus_register(void)
return -EINVAL;
} while (0);

- return brcmf_sdio_register(&dhd_sdio);
+ return brcmf_sdio_register(&brcmf_sdio);
}

void brcmf_bus_unregister(void)
@@ -5995,11 +5996,6 @@ static int _brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus)
goto err;
}

- /* EXAMPLE: nvram_array */
- /* If a valid nvram_arry is specified as above, it can be passed
- down to dongle */
- /* dhd_bus_set_nvram_params(bus, (char *)&nvram_array); */
-
/* External nvram takes precedence if specified */
if (brcmf_sdbrcm_download_nvram(bus)) {
DHD_ERROR(("%s: dongle nvram file download failed\n",
@@ -6566,7 +6562,7 @@ brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick)
static uint save_ms;

/* don't start the wd until fw is loaded */
- if (bus->drvr->busstate == DHD_BUS_DOWN)
+ if (bus->drvr->busstate == BRCMF_BUS_DOWN)
return;

/* Totally stop the timer */
@@ -6625,7 +6621,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data)
if (!wait_for_completion_interruptible(&bus->dpc_wait)) {
/* Call bus dpc unless it indicated down
(then clean stop) */
- if (bus->drvr->busstate != DHD_BUS_DOWN) {
+ if (bus->drvr->busstate != BRCMF_BUS_DOWN) {
if (brcmf_sdbrcm_dpc(bus))
complete(&bus->dpc_wait);
} else {
@@ -6642,7 +6638,7 @@ static void brcmf_sdbrcm_dpc_tasklet(unsigned long data)
struct brcmf_bus *bus = (struct brcmf_bus *) data;

/* Call bus dpc unless it indicated down (then clean stop) */
- if (bus->drvr->busstate != DHD_BUS_DOWN) {
+ if (bus->drvr->busstate != BRCMF_BUS_DOWN) {
if (brcmf_sdbrcm_dpc(bus))
tasklet_schedule(&bus->tasklet);
} else
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 04/31] staging: brcm80211: rename macros in dhd_dbg.h

The header file dhd_dbg.h contains several macros used throughout
the code starting with DHD_. These have been renamed to get rid
of this broadcom specific acronym.

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 72 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 218 +++---
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 62 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 224 +++---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 1018 ++++++++++++-----------
5 files changed, 815 insertions(+), 779 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 30c5d2d..4b8eb9c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -105,7 +105,7 @@ static int brcmf_proto_cdc_msg(struct brcmf_pub *drvr)
int len = le32_to_cpu(prot->msg.len) +
sizeof(struct brcmf_proto_cdc_ioctl);

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* NOTE : cdc->msg.len holds the desired length of the buffer to be
* returned. Only up to CDC_MAX_MSG_SIZE of this buffer area
@@ -124,7 +124,7 @@ static int brcmf_proto_cdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len)
int ret;
struct brcmf_proto *prot = drvr->prot;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

do {
ret = brcmf_sdbrcm_bus_rxctl(drvr->bus,
@@ -147,8 +147,8 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
int ret = 0, retries = 0;
u32 id, flags = 0;

- DHD_TRACE(("%s: Enter\n", __func__));
- DHD_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
+ BRCMF_TRACE(("%s: Enter\n", __func__));
+ BRCMF_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));

/* Respond "bcmerror" and "bcmerrorstr" with local cache */
if (cmd == BRCMF_C_GET_VAR && buf) {
@@ -175,8 +175,8 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,

ret = brcmf_proto_cdc_msg(drvr);
if (ret < 0) {
- DHD_ERROR(("brcmf_proto_cdc_query_ioctl: brcmf_proto_cdc_msg "
- "failed w/status %d\n", ret));
+ BRCMF_ERROR(("brcmf_proto_cdc_query_ioctl: brcmf_proto_cdc_msg "
+ "failed w/status %d\n", ret));
goto done;
}

@@ -192,9 +192,9 @@ retry:
if ((id < prot->reqid) && (++retries < RETRIES))
goto retry;
if (id != prot->reqid) {
- DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
- brcmf_ifname(drvr, ifidx), __func__, id,
- prot->reqid));
+ BRCMF_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
+ brcmf_ifname(drvr, ifidx), __func__, id,
+ prot->reqid));
ret = -EINVAL;
goto done;
}
@@ -228,8 +228,8 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
int ret = 0;
u32 flags, id;

- DHD_TRACE(("%s: Enter\n", __func__));
- DHD_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
+ BRCMF_TRACE(("%s: Enter\n", __func__));
+ BRCMF_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));

memset(msg, 0, sizeof(struct brcmf_proto_cdc_ioctl));

@@ -254,9 +254,9 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
id = (flags & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT;

if (id != prot->reqid) {
- DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
- brcmf_ifname(drvr, ifidx), __func__, id,
- prot->reqid));
+ BRCMF_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
+ brcmf_ifname(drvr, ifidx), __func__, id,
+ prot->reqid));
ret = -EINVAL;
goto done;
}
@@ -280,13 +280,13 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
int ret = -1;

if (drvr->busstate == BRCMF_BUS_DOWN) {
- DHD_ERROR(("%s : bus is down. we have nothing to do\n",
- __func__));
+ BRCMF_ERROR(("%s : bus is down. we have nothing to do\n",
+ __func__));
return ret;
}
brcmf_os_proto_block(drvr);

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

ASSERT(len <= BRCMF_C_IOCTL_MAXLEN);

@@ -294,13 +294,13 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
goto done;

if (prot->pending == true) {
- DHD_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));
+ BRCMF_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) ||
(ioc->cmd == BRCMF_C_GET_VAR))
- DHD_TRACE(("iovar cmd=%s\n", (char *)buf));
+ BRCMF_TRACE(("iovar cmd=%s\n", (char *)buf));

goto done;
}
@@ -361,7 +361,7 @@ void brcmf_proto_hdrpush(struct brcmf_pub *drvr, int ifidx,
{
struct brcmf_proto_bdc_header *h;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Push BDC header used to convey priority for buses that don't */

@@ -384,13 +384,13 @@ int brcmf_proto_hdrpull(struct brcmf_pub *drvr, int *ifidx,
{
struct brcmf_proto_bdc_header *h;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Pop BDC header used to convey priority for buses that don't */

if (pktbuf->len < BDC_HEADER_LEN) {
- DHD_ERROR(("%s: rx data too short (%d < %d)\n", __func__,
- pktbuf->len, BDC_HEADER_LEN));
+ BRCMF_ERROR(("%s: rx data too short (%d < %d)\n", __func__,
+ pktbuf->len, BDC_HEADER_LEN));
return -EBADE;
}

@@ -398,22 +398,22 @@ int brcmf_proto_hdrpull(struct brcmf_pub *drvr, int *ifidx,

*ifidx = BDC_GET_IF_IDX(h);
if (*ifidx >= BRCMF_MAX_IFS) {
- DHD_ERROR(("%s: rx data ifnum out of range (%d)\n",
- __func__, *ifidx));
+ BRCMF_ERROR(("%s: rx data ifnum out of range (%d)\n",
+ __func__, *ifidx));
return -EBADE;
}

if (((h->flags & BDC_FLAG_VER_MASK) >> BDC_FLAG_VER_SHIFT) !=
BDC_PROTO_VER) {
- DHD_ERROR(("%s: non-BDC packet received, flags 0x%x\n",
- brcmf_ifname(drvr, *ifidx), h->flags));
+ BRCMF_ERROR(("%s: non-BDC packet received, flags 0x%x\n",
+ brcmf_ifname(drvr, *ifidx), h->flags));
return -EBADE;
}

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

@@ -430,13 +430,13 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)

cdc = kzalloc(sizeof(struct brcmf_proto), GFP_ATOMIC);
if (!cdc) {
- DHD_ERROR(("%s: kmalloc failed\n", __func__));
+ BRCMF_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}

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

@@ -475,7 +475,7 @@ int brcmf_proto_init(struct brcmf_pub *drvr)
int ret = 0;
char buf[128];

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

brcmf_os_proto_block(drvr);

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index aead274..12cb90d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -176,7 +176,7 @@ brcmf_c_doiovar(struct brcmf_pub *drvr, const struct brcmu_iovar *vi,
int bcmerror = 0;
s32 int_val = 0;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

bcmerror = brcmu_iovar_lencheck(vi, arg, len, IOV_ISSET(actionid));
if (bcmerror != 0)
@@ -288,8 +288,8 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
p = discard_oldest ? brcmu_pktq_pdeq(q, eprec) :
brcmu_pktq_pdeq_tail(q, eprec);
if (p == NULL) {
- DHD_ERROR(("%s: brcmu_pktq_penq() failed, oldest %d.",
- __func__, discard_oldest));
+ BRCMF_ERROR(("%s: brcmu_pktq_penq() failed, oldest %d.",
+ __func__, discard_oldest));
ASSERT(p);
}

@@ -299,7 +299,7 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
/* Enqueue */
p = brcmu_pktq_penq(q, prec, pkt);
if (p == NULL) {
- DHD_ERROR(("%s: brcmu_pktq_penq() failed.", __func__));
+ BRCMF_ERROR(("%s: brcmu_pktq_penq() failed.", __func__));
ASSERT(p);
}

@@ -315,7 +315,7 @@ brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name,
const struct brcmu_iovar *vi = NULL;
u32 actionid;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

ASSERT(name);
ASSERT(len >= 0);
@@ -332,8 +332,8 @@ brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name,
goto exit;
}

- DHD_CTL(("%s: %s %s, len %d plen %d\n", __func__,
- name, (set ? "set" : "get"), len, plen));
+ BRCMF_CTL(("%s: %s %s, len %d plen %d\n", __func__,
+ name, (set ? "set" : "get"), len, plen));

/* set up 'params' pointer in case this is a set command so that
* the convenience int and bool code can be common to set and get
@@ -365,7 +365,7 @@ int brcmf_c_ioctl(struct brcmf_pub *drvr, struct brcmf_c_ioctl *ioc, void *buf,
{
int bcmerror = 0;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (!buf)
return -EINVAL;
@@ -521,9 +521,9 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
event_name = event_names[i].event_name;
}

- DHD_EVENT(("EVENT: %s, event ID = %d\n", event_name, event_type));
- DHD_EVENT(("flags 0x%04x, status %d, reason %d, auth_type %d MAC %s\n",
- flags, status, reason, auth_type, eabuf));
+ BRCMF_EVENT(("EVENT: %s, event ID = %d\n", event_name, event_type));
+ BRCMF_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)
link = true;
@@ -536,35 +536,36 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
case BRCMF_E_START:
case BRCMF_E_DEAUTH:
case BRCMF_E_DISASSOC:
- DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
break;

case BRCMF_E_ASSOC_IND:
case BRCMF_E_REASSOC_IND:
- DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
break;

case BRCMF_E_ASSOC:
case BRCMF_E_REASSOC:
if (status == BRCMF_E_STATUS_SUCCESS) {
- DHD_EVENT(("MACEVENT: %s, MAC %s, SUCCESS\n",
- event_name, eabuf));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, SUCCESS\n",
+ event_name, eabuf));
} else if (status == BRCMF_E_STATUS_TIMEOUT) {
- DHD_EVENT(("MACEVENT: %s, MAC %s, TIMEOUT\n",
- event_name, eabuf));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, TIMEOUT\n",
+ event_name, eabuf));
} else if (status == BRCMF_E_STATUS_FAIL) {
- DHD_EVENT(("MACEVENT: %s, MAC %s, FAILURE, reason %d\n",
- event_name, eabuf, (int)reason));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, FAILURE,"
+ " reason %d\n", event_name, eabuf,
+ (int)reason));
} else {
- DHD_EVENT(("MACEVENT: %s, MAC %s, unexpected status "
- "%d\n", event_name, eabuf, (int)status));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, unexpected status "
+ "%d\n", event_name, eabuf, (int)status));
}
break;

case BRCMF_E_DEAUTH_IND:
case BRCMF_E_DISASSOC_IND:
- DHD_EVENT(("MACEVENT: %s, MAC %s, reason %d\n", event_name,
- eabuf, (int)reason));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, reason %d\n", event_name,
+ eabuf, (int)reason));
break;

case BRCMF_E_AUTH:
@@ -578,18 +579,18 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
auth_str = err_msg;
}
if (event_type == BRCMF_E_AUTH_IND) {
- DHD_EVENT(("MACEVENT: %s, MAC %s, %s\n", event_name,
- eabuf, auth_str));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s\n", event_name,
+ eabuf, auth_str));
} else if (status == BRCMF_E_STATUS_SUCCESS) {
- DHD_EVENT(("MACEVENT: %s, MAC %s, %s, SUCCESS\n",
- event_name, eabuf, auth_str));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, SUCCESS\n",
+ event_name, eabuf, auth_str));
} else if (status == BRCMF_E_STATUS_TIMEOUT) {
- DHD_EVENT(("MACEVENT: %s, MAC %s, %s, TIMEOUT\n",
- event_name, eabuf, auth_str));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, TIMEOUT\n",
+ event_name, eabuf, auth_str));
} else if (status == BRCMF_E_STATUS_FAIL) {
- DHD_EVENT(("MACEVENT: %s, MAC %s, %s, FAILURE, "
- "reason %d\n",
- event_name, eabuf, auth_str, (int)reason));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, FAILURE, "
+ "reason %d\n",
+ event_name, eabuf, auth_str, (int)reason));
}

break;
@@ -598,64 +599,64 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
case BRCMF_E_ROAM:
case BRCMF_E_SET_SSID:
if (status == BRCMF_E_STATUS_SUCCESS) {
- DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name,
- eabuf));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name,
+ eabuf));
} else if (status == BRCMF_E_STATUS_FAIL) {
- DHD_EVENT(("MACEVENT: %s, failed\n", event_name));
+ BRCMF_EVENT(("MACEVENT: %s, failed\n", event_name));
} else if (status == BRCMF_E_STATUS_NO_NETWORKS) {
- DHD_EVENT(("MACEVENT: %s, no networks found\n",
- event_name));
+ BRCMF_EVENT(("MACEVENT: %s, no networks found\n",
+ event_name));
} else {
- DHD_EVENT(("MACEVENT: %s, unexpected status %d\n",
- event_name, (int)status));
+ BRCMF_EVENT(("MACEVENT: %s, unexpected status %d\n",
+ event_name, (int)status));
}
break;

case BRCMF_E_BEACON_RX:
if (status == BRCMF_E_STATUS_SUCCESS) {
- DHD_EVENT(("MACEVENT: %s, SUCCESS\n", event_name));
+ BRCMF_EVENT(("MACEVENT: %s, SUCCESS\n", event_name));
} else if (status == BRCMF_E_STATUS_FAIL) {
- DHD_EVENT(("MACEVENT: %s, FAIL\n", event_name));
+ BRCMF_EVENT(("MACEVENT: %s, FAIL\n", event_name));
} else {
- DHD_EVENT(("MACEVENT: %s, status %d\n", event_name,
- status));
+ BRCMF_EVENT(("MACEVENT: %s, status %d\n", event_name,
+ status));
}
break;

case BRCMF_E_LINK:
- DHD_EVENT(("MACEVENT: %s %s\n", event_name,
- link ? "UP" : "DOWN"));
+ BRCMF_EVENT(("MACEVENT: %s %s\n", event_name,
+ link ? "UP" : "DOWN"));
break;

case BRCMF_E_MIC_ERROR:
- DHD_EVENT(("MACEVENT: %s, MAC %s, Group %d, Flush %d\n",
- event_name, eabuf, group, flush_txq));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s, Group %d, Flush %d\n",
+ event_name, eabuf, group, flush_txq));
break;

case BRCMF_E_ICV_ERROR:
case BRCMF_E_UNICAST_DECODE_ERROR:
case BRCMF_E_MULTICAST_DECODE_ERROR:
- DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
+ BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
break;

case BRCMF_E_TXFAIL:
- DHD_EVENT(("MACEVENT: %s, RA %s\n", event_name, eabuf));
+ BRCMF_EVENT(("MACEVENT: %s, RA %s\n", event_name, eabuf));
break;

case BRCMF_E_SCAN_COMPLETE:
case BRCMF_E_PMKID_CACHE:
- DHD_EVENT(("MACEVENT: %s\n", event_name));
+ BRCMF_EVENT(("MACEVENT: %s\n", event_name));
break;

case BRCMF_E_PFN_NET_FOUND:
case BRCMF_E_PFN_NET_LOST:
case BRCMF_E_PFN_SCAN_COMPLETE:
- DHD_EVENT(("PNOEVENT: %s\n", event_name));
+ BRCMF_EVENT(("PNOEVENT: %s\n", event_name));
break;

case BRCMF_E_PSK_SUP:
case BRCMF_E_PRUNE:
- DHD_EVENT(("MACEVENT: %s, status %d, reason %d\n",
+ BRCMF_EVENT(("MACEVENT: %s, status %d, reason %d\n",
event_name, (int)status, (int)reason));
break;

@@ -670,7 +671,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
memcpy(&hdr, buf, sizeof(struct msgtrace_hdr));

if (hdr.version != MSGTRACE_VERSION) {
- DHD_ERROR(
+ BRCMF_ERROR(
("\nMACEVENT: %s [unsupported version --> "
"brcmf version:%d dongle version:%d]\n",
event_name, MSGTRACE_VERSION, hdr.version)
@@ -686,7 +687,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)

if (be32_to_cpu(hdr.discarded_bytes)
|| be32_to_cpu(hdr.discarded_printf)) {
- DHD_ERROR(
+ BRCMF_ERROR(
("\nWLC_E_TRACE: [Discarded traces in dongle -->"
"discarded_bytes %d discarded_printf %d]\n",
be32_to_cpu(hdr.discarded_bytes),
@@ -695,7 +696,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)

nblost = be32_to_cpu(hdr.seqnum) - seqnum_prev - 1;
if (nblost > 0) {
- DHD_ERROR(
+ BRCMF_ERROR(
("\nWLC_E_TRACE: [Event lost --> seqnum %d nblost %d\n",
be32_to_cpu(hdr.seqnum), nblost));
}
@@ -719,24 +720,24 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
break;

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

default:
- DHD_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));
+ BRCMF_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;
}

/* show any appended data */
if (datalen) {
buf = (unsigned char *) event_data;
- DHD_EVENT((" data (%d) : ", datalen));
+ BRCMF_EVENT((" data (%d) : ", datalen));
for (i = 0; i < datalen; i++)
- DHD_EVENT((" 0x%02x ", *buf++));
- DHD_EVENT(("\n"));
+ BRCMF_EVENT((" 0x%02x ", *buf++));
+ BRCMF_EVENT(("\n"));
}
}
#endif /* SHOW_EVENTS */
@@ -753,14 +754,14 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
int evlen;

if (memcmp(BRCM_OUI, &pvt_data->hdr.oui[0], DOT11_OUI_LEN)) {
- DHD_ERROR(("%s: mismatched OUI, bailing\n", __func__));
+ BRCMF_ERROR(("%s: mismatched OUI, bailing\n", __func__));
return -EBADE;
}

/* BRCM event pkt may be unaligned - use xxx_ua to load user_subtype. */
if (get_unaligned_be16(&pvt_data->hdr.usr_subtype) !=
BCMILCP_BCM_SUBTYPE_EVENT) {
- DHD_ERROR(("%s: mismatched subtype, bailing\n", __func__));
+ BRCMF_ERROR(("%s: mismatched subtype, bailing\n", __func__));
return -EBADE;
}

@@ -781,7 +782,7 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
{
struct brcmf_if_event *ifevent =
(struct brcmf_if_event *) event_data;
- DHD_TRACE(("%s: if event\n", __func__));
+ BRCMF_TRACE(("%s: if event\n", __func__));

if (ifevent->ifidx > 0 &&
ifevent->ifidx < BRCMF_MAX_IFS) {
@@ -794,9 +795,9 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
else
brcmf_del_if(drvr_priv, ifevent->ifidx);
} else {
- DHD_ERROR(("%s: Invalid ifidx %d for %s\n",
- __func__, ifevent->ifidx,
- event->ifname));
+ BRCMF_ERROR(("%s: Invalid ifidx %d for %s\n",
+ __func__, ifevent->ifidx,
+ event->ifname));
}
}
/* send up the if event: btamp user needs it */
@@ -813,15 +814,16 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
/* Fall through: this should get _everything_ */

*ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
- DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
- __func__, type, flags, status));
+ BRCMF_TRACE(("%s: MAC event %d, flags %x, status %x\n",
+ __func__, type, flags, status));

/* put it back to BRCMF_E_NDIS_LINK */
if (type == BRCMF_E_NDIS_LINK) {
u32 temp;

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

temp = be32_to_cpu(BRCMF_E_NDIS_LINK);
memcpy((void *)(&pvt_data->msg.event_type), &temp,
@@ -842,12 +844,12 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
{
int i;
if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
- DHD_ERROR(("Mask invalid format. Needs to start with 0x\n"));
+ BRCMF_ERROR(("Mask invalid format. Needs to start with 0x\n"));
return -1;
}
src = src + 2; /* Skip past 0x */
if (strlen(src) % 2 != 0) {
- DHD_ERROR(("Mask invalid format. Length must be even.\n"));
+ BRCMF_ERROR(("Mask invalid format. Length must be even.\n"));
return -1;
}
for (i = 0; *src != '\0'; i++) {
@@ -877,7 +879,7 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,

arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
if (!arg_save) {
- DHD_ERROR(("%s: kmalloc failed\n", __func__));
+ BRCMF_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}
arg_org = arg_save;
@@ -887,7 +889,7 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,

i = 0;
if (NULL == argv[i]) {
- DHD_ERROR(("No args provided\n"));
+ BRCMF_ERROR(("No args provided\n"));
goto fail;
}

@@ -912,11 +914,11 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
rc = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, buf, buf_len);
rc = rc >= 0 ? 0 : rc;
if (rc)
- DHD_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
- __func__, arg, rc));
+ BRCMF_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
+ __func__, arg, rc));
else
- DHD_TRACE(("%s: successfully added pktfilter %s\n",
- __func__, arg));
+ BRCMF_TRACE(("%s: successfully added pktfilter %s\n",
+ __func__, arg));

/* Contorl the master mode */
brcmu_mkiovar("pkt_filter_mode", (char *)&master_mode, 4, buf,
@@ -925,8 +927,8 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
sizeof(buf));
rc = rc >= 0 ? 0 : rc;
if (rc)
- DHD_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
- __func__, arg, rc));
+ BRCMF_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
+ __func__, arg, rc));

fail:
kfree(arg_org);
@@ -948,7 +950,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)

arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
if (!arg_save) {
- DHD_ERROR(("%s: kmalloc failed\n", __func__));
+ BRCMF_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}

@@ -956,15 +958,15 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)

buf = kmalloc(PKTFILTER_BUF_SIZE, GFP_ATOMIC);
if (!buf) {
- DHD_ERROR(("%s: kmalloc failed\n", __func__));
+ BRCMF_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}

memcpy(arg_save, arg, strlen(arg) + 1);

if (strlen(arg) > PKTFILTER_BUF_SIZE) {
- DHD_ERROR(("Not enough buffer %d < %d\n", (int)strlen(arg),
- (int)sizeof(buf)));
+ BRCMF_ERROR(("Not enough buffer %d < %d\n", (int)strlen(arg),
+ (int)sizeof(buf)));
goto fail;
}

@@ -974,7 +976,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)

i = 0;
if (NULL == argv[i]) {
- DHD_ERROR(("No args provided\n"));
+ BRCMF_ERROR(("No args provided\n"));
goto fail;
}

@@ -990,7 +992,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
pkt_filter.id = simple_strtoul(argv[i], NULL, 0);

if (NULL == argv[++i]) {
- DHD_ERROR(("Polarity not provided\n"));
+ BRCMF_ERROR(("Polarity not provided\n"));
goto fail;
}

@@ -998,7 +1000,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
pkt_filter.negate_match = simple_strtoul(argv[i], NULL, 0);

if (NULL == argv[++i]) {
- DHD_ERROR(("Filter type not provided\n"));
+ BRCMF_ERROR(("Filter type not provided\n"));
goto fail;
}

@@ -1006,7 +1008,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
pkt_filter.type = simple_strtoul(argv[i], NULL, 0);

if (NULL == argv[++i]) {
- DHD_ERROR(("Offset not provided\n"));
+ BRCMF_ERROR(("Offset not provided\n"));
goto fail;
}

@@ -1014,7 +1016,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
pkt_filter.u.pattern.offset = simple_strtoul(argv[i], NULL, 0);

if (NULL == argv[++i]) {
- DHD_ERROR(("Bitmask not provided\n"));
+ BRCMF_ERROR(("Bitmask not provided\n"));
goto fail;
}

@@ -1024,7 +1026,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
(argv[i], (char *)pkt_filterp->u.pattern.mask_and_pattern);

if (NULL == argv[++i]) {
- DHD_ERROR(("Pattern not provided\n"));
+ BRCMF_ERROR(("Pattern not provided\n"));
goto fail;
}

@@ -1035,7 +1037,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
mask_and_pattern[mask_size]);

if (mask_size != pattern_size) {
- DHD_ERROR(("Mask and pattern not the same size\n"));
+ BRCMF_ERROR(("Mask and pattern not the same size\n"));
goto fail;
}

@@ -1056,11 +1058,11 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
rc = rc >= 0 ? 0 : rc;

if (rc)
- DHD_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
- __func__, arg, rc));
+ BRCMF_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
+ __func__, arg, rc));
else
- DHD_TRACE(("%s: successfully added pktfilter %s\n",
- __func__, arg));
+ BRCMF_TRACE(("%s: successfully added pktfilter %s\n",
+ __func__, arg));

fail:
kfree(arg_org);
@@ -1078,11 +1080,11 @@ void brcmf_c_arp_offload_set(struct brcmf_pub *drvr, int arp_mode)
iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
- DHD_TRACE(("%s: failed to set ARP offload mode to 0x%x, "
- "retcode = %d\n", __func__, arp_mode, retcode));
+ BRCMF_TRACE(("%s: failed to set ARP offload mode to 0x%x, "
+ "retcode = %d\n", __func__, arp_mode, retcode));
else
- DHD_TRACE(("%s: successfully set ARP offload mode to 0x%x\n",
- __func__, arp_mode));
+ BRCMF_TRACE(("%s: successfully set ARP offload mode to 0x%x\n",
+ __func__, arp_mode));
}

void brcmf_c_arp_offload_enable(struct brcmf_pub *drvr, int arp_enable)
@@ -1095,11 +1097,11 @@ void brcmf_c_arp_offload_enable(struct brcmf_pub *drvr, int arp_enable)
iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
- DHD_TRACE(("%s: failed to enabe ARP offload to %d, "
- "retcode = %d\n", __func__, arp_enable, retcode));
+ BRCMF_TRACE(("%s: failed to enabe ARP offload to %d, "
+ "retcode = %d\n", __func__, arp_enable, retcode));
else
- DHD_TRACE(("%s: successfully enabed ARP offload to %d\n",
- __func__, arp_enable));
+ BRCMF_TRACE(("%s: successfully enabed ARP offload to %d\n",
+ __func__, arp_enable));
}

int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr)
@@ -1123,8 +1125,8 @@ int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr)
if (brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_COUNTRY,
drvr->country_code,
sizeof(drvr->country_code)) < 0) {
- DHD_ERROR(("%s: country code setting failed\n",
- __func__));
+ BRCMF_ERROR(("%s: country code setting failed\n",
+ __func__));
}
}

@@ -1135,7 +1137,7 @@ int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr)
brcmf_proto_cdc_query_ioctl(drvr, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
strsep(&ptr, "\n");
/* Print fw version info */
- DHD_ERROR(("Firmware version = %s\n", buf));
+ BRCMF_ERROR(("Firmware version = %s\n", buf));

/* Set PowerSave mode */
brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_PM, (char *)&power_mode,
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
index 2b1ccca..5be4d7a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
@@ -19,55 +19,49 @@

#if defined(BCMDBG)

-#define DHD_ERROR(args) \
+#define BRCMF_ERROR(args) \
do {if ((brcmf_msg_level & BRCMF_ERROR_VAL) && (net_ratelimit())) \
printk args; } while (0)
-#define DHD_TRACE(args) do {if (brcmf_msg_level & BRCMF_TRACE_VAL) \
+#define BRCMF_TRACE(args) do {if (brcmf_msg_level & BRCMF_TRACE_VAL) \
printk args; } while (0)
-#define DHD_INFO(args) do {if (brcmf_msg_level & BRCMF_INFO_VAL) \
+#define BRCMF_INFO(args) do {if (brcmf_msg_level & BRCMF_INFO_VAL) \
printk args; } while (0)
-#define DHD_DATA(args) do {if (brcmf_msg_level & BRCMF_DATA_VAL) \
+#define BRCMF_DATA(args) do {if (brcmf_msg_level & BRCMF_DATA_VAL) \
printk args; } while (0)
-#define DHD_CTL(args) do {if (brcmf_msg_level & BRCMF_CTL_VAL) \
+#define BRCMF_CTL(args) do {if (brcmf_msg_level & BRCMF_CTL_VAL) \
printk args; } while (0)
-#define DHD_TIMER(args) do {if (brcmf_msg_level & BRCMF_TIMER_VAL) \
+#define BRCMF_TIMER(args) do {if (brcmf_msg_level & BRCMF_TIMER_VAL) \
printk args; } while (0)
-#define DHD_HDRS(args) do {if (brcmf_msg_level & BRCMF_HDRS_VAL) \
+#define BRCMF_INTR(args) do {if (brcmf_msg_level & BRCMF_INTR_VAL) \
printk args; } while (0)
-#define DHD_BYTES(args) do {if (brcmf_msg_level & BRCMF_BYTES_VAL) \
+#define BRCMF_GLOM(args) do {if (brcmf_msg_level & BRCMF_GLOM_VAL) \
printk args; } while (0)
-#define DHD_INTR(args) do {if (brcmf_msg_level & BRCMF_INTR_VAL) \
- printk args; } while (0)
-#define DHD_GLOM(args) do {if (brcmf_msg_level & BRCMF_GLOM_VAL) \
- printk args; } while (0)
-#define DHD_EVENT(args) do {if (brcmf_msg_level & BRCMF_EVENT_VAL) \
+#define BRCMF_EVENT(args) do {if (brcmf_msg_level & BRCMF_EVENT_VAL) \
printk args; } while (0)

-#define DHD_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
-#define DHD_CTL_ON() (brcmf_msg_level & BRCMF_CTL_VAL)
-#define DHD_HDRS_ON() (brcmf_msg_level & BRCMF_HDRS_VAL)
-#define DHD_BYTES_ON() (brcmf_msg_level & BRCMF_BYTES_VAL)
-#define DHD_GLOM_ON() (brcmf_msg_level & BRCMF_GLOM_VAL)
+#define BRCMF_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
+#define BRCMF_CTL_ON() (brcmf_msg_level & BRCMF_CTL_VAL)
+#define BRCMF_HDRS_ON() (brcmf_msg_level & BRCMF_HDRS_VAL)
+#define BRCMF_BYTES_ON() (brcmf_msg_level & BRCMF_BYTES_VAL)
+#define BRCMF_GLOM_ON() (brcmf_msg_level & BRCMF_GLOM_VAL)

#else /* (defined BCMDBG) || (defined BCMDBG) */

-#define DHD_ERROR(args) do {if (net_ratelimit()) printk args; } while (0)
-#define DHD_TRACE(args)
-#define DHD_INFO(args)
-#define DHD_DATA(args)
-#define DHD_CTL(args)
-#define DHD_TIMER(args)
-#define DHD_HDRS(args)
-#define DHD_BYTES(args)
-#define DHD_INTR(args)
-#define DHD_GLOM(args)
-#define DHD_EVENT(args)
+#define BRCMF_ERROR(args) do {if (net_ratelimit()) printk args; } while (0)
+#define BRCMF_TRACE(args)
+#define BRCMF_INFO(args)
+#define BRCMF_DATA(args)
+#define BRCMF_CTL(args)
+#define BRCMF_TIMER(args)
+#define BRCMF_INTR(args)
+#define BRCMF_GLOM(args)
+#define BRCMF_EVENT(args)

-#define DHD_DATA_ON() 0
-#define DHD_CTL_ON() 0
-#define DHD_HDRS_ON() 0
-#define DHD_BYTES_ON() 0
-#define DHD_GLOM_ON() 0
+#define BRCMF_DATA_ON() 0
+#define BRCMF_CTL_ON() 0
+#define BRCMF_HDRS_ON() 0
+#define BRCMF_BYTES_ON() 0
+#define BRCMF_GLOM_ON() 0

#endif /* defined(BCMDBG) */

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 423d5da..afb1e32 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -259,7 +259,7 @@ int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name)
&& !strncmp(drvr_priv->iflist[i]->name, name, IFNAMSIZ))
break;

- DHD_TRACE(("%s: return idx %d for \"%s\"\n", __func__, i, name));
+ BRCMF_TRACE(("%s: return idx %d for \"%s\"\n", __func__, i, name));

return i; /* default - the primary interface */
}
@@ -271,12 +271,12 @@ char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx)
ASSERT(drvr_priv);

if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) {
- DHD_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
+ BRCMF_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
return "<if_bad>";
}

if (drvr_priv->iflist[ifidx] == NULL) {
- DHD_ERROR(("%s: null i/f %d\n", __func__, ifidx));
+ BRCMF_ERROR(("%s: null i/f %d\n", __func__, ifidx));
return "<if_null>";
}

@@ -309,8 +309,8 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETH_ALEN);
bufp = buf = kmalloc(buflen, GFP_ATOMIC);
if (!bufp) {
- DHD_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
- brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
+ BRCMF_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
return;
}

@@ -337,8 +337,8 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
- DHD_ERROR(("%s: set mcast_list failed, cnt %d\n",
- brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
+ BRCMF_ERROR(("%s: set mcast_list failed, cnt %d\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
allmulti = cnt ? true : allmulti;
}

@@ -352,17 +352,18 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
buflen = sizeof("allmulti") + sizeof(allmulti);
buf = kmalloc(buflen, GFP_ATOMIC);
if (!buf) {
- DHD_ERROR(("%s: out of memory for allmulti\n",
- brcmf_ifname(&drvr_priv->pub, ifidx)));
+ BRCMF_ERROR(("%s: out of memory for allmulti\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
return;
}
allmulti = cpu_to_le32(allmulti);

if (!brcmu_mkiovar
("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) {
- DHD_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
- "buflen %u\n", brcmf_ifname(&drvr_priv->pub, ifidx),
- (int)sizeof(allmulti), buflen));
+ BRCMF_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
+ "buflen %u\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx),
+ (int)sizeof(allmulti), buflen));
kfree(buf);
return;
}
@@ -375,9 +376,9 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)

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

kfree(buf);
@@ -396,9 +397,9 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)

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

@@ -408,11 +409,11 @@ static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *a
struct brcmf_ioctl ioc;
int ret;

- DHD_TRACE(("%s enter\n", __func__));
+ BRCMF_TRACE(("%s enter\n", __func__));
if (!brcmu_mkiovar
("cur_etheraddr", (char *)addr, ETH_ALEN, buf, 32)) {
- DHD_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
- brcmf_ifname(&drvr_priv->pub, ifidx)));
+ BRCMF_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
return -1;
}
memset(&ioc, 0, sizeof(ioc));
@@ -423,8 +424,8 @@ static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *a

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
- DHD_ERROR(("%s: set cur_etheraddr failed\n",
- brcmf_ifname(&drvr_priv->pub, ifidx)));
+ BRCMF_ERROR(("%s: set cur_etheraddr failed\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
} else {
memcpy(drvr_priv->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN);
}
@@ -445,7 +446,7 @@ static void brcmf_op_if(struct brcmf_if *ifp)

drvr_priv = ifp->info;

- DHD_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));
+ BRCMF_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));

switch (ifp->state) {
case BRCMF_E_IF_ADD:
@@ -454,9 +455,9 @@ static void brcmf_op_if(struct brcmf_if *ifp)
* in case we missed the BRCMF_E_IF_DEL event.
*/
if (ifp->net != NULL) {
- DHD_ERROR(("%s: ERROR: netdev:%s already exists, "
- "try free & unregister\n",
- __func__, ifp->net->name));
+ BRCMF_ERROR(("%s: ERROR: netdev:%s already exists, "
+ "try free & unregister\n",
+ __func__, ifp->net->name));
netif_stop_queue(ifp->net);
unregister_netdev(ifp->net);
free_netdev(ifp->net);
@@ -464,7 +465,7 @@ static void brcmf_op_if(struct brcmf_if *ifp)
/* Allocate etherdev, including space for private structure */
ifp->net = alloc_etherdev(sizeof(drvr_priv));
if (!ifp->net) {
- DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
+ BRCMF_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
ret = -ENOMEM;
}
if (ret == 0) {
@@ -472,9 +473,9 @@ static void brcmf_op_if(struct brcmf_if *ifp)
memcpy(netdev_priv(ifp->net), &drvr_priv, sizeof(drvr_priv));
err = brcmf_net_attach(&drvr_priv->pub, ifp->idx);
if (err != 0) {
- DHD_ERROR(("%s: brcmf_net_attach failed, "
- "err %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: brcmf_net_attach failed, "
+ "err %d\n",
+ __func__, err));
ret = -EOPNOTSUPP;
} else {
#ifdef SOFTAP
@@ -489,17 +490,17 @@ static void brcmf_op_if(struct brcmf_if *ifp)
wl0.1 is ready */
up(&ap_eth_sema);
#endif
- DHD_TRACE(("\n ==== pid:%x, net_device for "
- "if:%s created ===\n\n",
- current->pid, ifp->net->name));
+ BRCMF_TRACE(("\n ==== pid:%x, net_device for "
+ "if:%s created ===\n\n",
+ current->pid, ifp->net->name));
ifp->state = 0;
}
}
break;
case BRCMF_E_IF_DEL:
if (ifp->net != NULL) {
- DHD_TRACE(("\n%s: got 'WLC_E_IF_DEL' state\n",
- __func__));
+ BRCMF_TRACE(("\n%s: got 'WLC_E_IF_DEL' state\n",
+ __func__));
netif_stop_queue(ifp->net);
unregister_netdev(ifp->net);
ret = BRCMF_DEL_IF; /* Make sure the free_netdev()
@@ -507,7 +508,7 @@ static void brcmf_op_if(struct brcmf_if *ifp)
}
break;
default:
- DHD_ERROR(("%s: bad op %d\n", __func__, ifp->state));
+ BRCMF_ERROR(("%s: bad op %d\n", __func__, ifp->state));
ASSERT(!ifp->state);
break;
}
@@ -540,32 +541,35 @@ static int _brcmf_sysioc_thread(void *data)
if (kthread_should_stop())
break;
for (i = 0; i < BRCMF_MAX_IFS; i++) {
- if (drvr_priv->iflist[i]) {
+ struct brcmf_if *ifentry = drvr_priv->iflist[i];
+ if (ifentry) {
#ifdef SOFTAP
in_ap = (ap_net_dev != NULL);
#endif /* SOFTAP */
- if (drvr_priv->iflist[i]->state)
- brcmf_op_if(drvr_priv->iflist[i]);
+ if (ifentry->state)
+ brcmf_op_if(ifentry);
#ifdef SOFTAP
if (drvr_priv->iflist[i] == NULL) {
- DHD_TRACE(("\n\n %s: interface %d "
- "removed!\n", __func__, i));
+ BRCMF_TRACE(("\n\n %s: interface %d "
+ "removed!\n", __func__,
+ i));
continue;
}

if (in_ap && drvr_priv->set_macaddress) {
- DHD_TRACE(("attempt to set MAC for %s "
- "in AP Mode," "blocked.\n",
- drvr_priv->iflist[i]->net->name));
+ BRCMF_TRACE(("attempt to set MAC for"
+ " %s in AP Mode,"
+ " blocked.\n",
+ ifentry->net->name));
drvr_priv->set_macaddress = false;
continue;
}

if (in_ap && drvr_priv->set_multicast) {
- DHD_TRACE(("attempt to set MULTICAST "
- "list for %s in AP Mode, "
- "blocked.\n",
- drvr_priv->iflist[i]->net->name));
+ BRCMF_TRACE(("attempt to set MULTICAST "
+ "list for %s in AP Mode, "
+ "blocked.\n",
+ ifentry->net->name));
drvr_priv->set_multicast = false;
continue;
}
@@ -577,7 +581,7 @@ static int _brcmf_sysioc_thread(void *data)
if (drvr_priv->set_macaddress) {
drvr_priv->set_macaddress = false;
_brcmf_set_mac_address(drvr_priv, i,
- drvr_priv->macvalue);
+ drvr_priv->macvalue);
}
}
}
@@ -651,19 +655,20 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
int ifidx;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Reject if down */
if (!drvr_priv->pub.up || (drvr_priv->pub.busstate == BRCMF_BUS_DOWN)) {
- DHD_ERROR(("%s: xmit rejected pub.up=%d busstate=%d\n",
- __func__, drvr_priv->pub.up, drvr_priv->pub.busstate));
+ BRCMF_ERROR(("%s: xmit rejected pub.up=%d busstate=%d\n",
+ __func__, drvr_priv->pub.up,
+ drvr_priv->pub.busstate));
netif_stop_queue(net);
return -ENODEV;
}

ifidx = brcmf_net2idx(drvr_priv, net);
if (ifidx == BRCMF_BAD_IF) {
- DHD_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
+ BRCMF_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
netif_stop_queue(net);
return -ENODEV;
}
@@ -672,15 +677,15 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
if (skb_headroom(skb) < drvr_priv->pub.hdrlen) {
struct sk_buff *skb2;

- DHD_INFO(("%s: insufficient headroom\n",
- brcmf_ifname(&drvr_priv->pub, ifidx)));
+ BRCMF_INFO(("%s: insufficient headroom\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
drvr_priv->pub.tx_realloc++;
skb2 = skb_realloc_headroom(skb, drvr_priv->pub.hdrlen);
dev_kfree_skb(skb);
skb = skb2;
if (skb == NULL) {
- DHD_ERROR(("%s: skb_realloc_headroom failed\n",
- brcmf_ifname(&drvr_priv->pub, ifidx)));
+ BRCMF_ERROR(("%s: skb_realloc_headroom failed\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
ret = -ENOMEM;
goto done;
}
@@ -703,7 +708,7 @@ void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool state)
struct net_device *net;
struct brcmf_info *drvr_priv = drvr->info;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

drvr->txoff = state;
ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
@@ -726,7 +731,7 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
struct brcmf_if *ifp;
struct brcmf_event_msg event;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

save_pktbuf = skb;

@@ -821,7 +826,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
struct brcmf_if *ifp;
int ifidx;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

ifidx = brcmf_net2idx(drvr_priv, net);
if (ifidx == BRCMF_BAD_IF)
@@ -869,13 +874,13 @@ static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol)
if (ret < 0) {
/* Check for older dongle image that doesn't support toe_ol */
if (ret == -EIO) {
- DHD_ERROR(("%s: toe not supported by device\n",
- brcmf_ifname(&drvr_priv->pub, ifidx)));
+ BRCMF_ERROR(("%s: toe not supported by device\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
return -EOPNOTSUPP;
}

- DHD_INFO(("%s: could not get toe_ol: ret=%d\n",
- brcmf_ifname(&drvr_priv->pub, ifidx), ret));
+ BRCMF_INFO(("%s: could not get toe_ol: ret=%d\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx), ret));
return ret;
}

@@ -905,8 +910,8 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
- DHD_ERROR(("%s: could not set toe_ol: ret=%d\n",
- brcmf_ifname(&drvr_priv->pub, ifidx), ret));
+ BRCMF_ERROR(("%s: could not set toe_ol: ret=%d\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx), ret));
return ret;
}

@@ -919,8 +924,8 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)

ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
- DHD_ERROR(("%s: could not set toe: ret=%d\n",
- brcmf_ifname(&drvr_priv->pub, ifidx), ret));
+ BRCMF_ERROR(("%s: could not set toe: ret=%d\n",
+ brcmf_ifname(&drvr_priv->pub, ifidx), ret));
return ret;
}

@@ -952,7 +957,7 @@ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)
u32 toe_cmpnt, csum_dir;
int ret;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* all ethtool calls start with a cmd word */
if (copy_from_user(&cmd, uaddr, sizeof(u32)))
@@ -978,7 +983,7 @@ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)

/* otherwise, require dongle to be up */
else if (!drvr_priv->pub.up) {
- DHD_ERROR(("%s: dongle is not up\n", __func__));
+ BRCMF_ERROR(("%s: dongle is not up\n", __func__));
return -ENODEV;
}

@@ -991,8 +996,8 @@ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)
sprintf(info.version, "%lu", drvr_priv->pub.drv_version);
if (copy_to_user(uaddr, &info, sizeof(info)))
return -EFAULT;
- DHD_CTL(("%s: given %*s, returning %s\n", __func__,
- (int)sizeof(drvname), drvname, info.driver));
+ BRCMF_CTL(("%s: given %*s, returning %s\n", __func__,
+ (int)sizeof(drvname), drvname, info.driver));
break;

/* Get toe offload components from dongle */
@@ -1067,7 +1072,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
bool is_set_key_cmd;

ifidx = brcmf_net2idx(drvr_priv, net);
- DHD_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));
+ BRCMF_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));

if (ifidx == BRCMF_BAD_IF)
return -1;
@@ -1130,7 +1135,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,

/* send to dongle (must be up, and wl) */
if ((drvr_priv->pub.busstate != BRCMF_BUS_DATA)) {
- DHD_ERROR(("%s DONGLE_DOWN,__func__\n", __func__));
+ BRCMF_ERROR(("%s DONGLE_DOWN,__func__\n", __func__));
bcmerror = -EIO;
goto done;
}
@@ -1175,7 +1180,7 @@ static int brcmf_netdev_stop(struct net_device *net)
#if !defined(IGNORE_ETH0_DOWN)
struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));
brcmf_cfg80211_down();
if (drvr_priv->pub.up == 0)
return 0;
@@ -1184,8 +1189,8 @@ static int brcmf_netdev_stop(struct net_device *net)
drvr_priv->pub.up = 0;
netif_stop_queue(net);
#else
- DHD_ERROR(("BYPASS %s:due to BRCM compilation : under investigation\n",
- __func__));
+ BRCMF_ERROR(("BYPASS %s:due to BRCM compilation: under investigation\n",
+ __func__));
#endif /* !defined(IGNORE_ETH0_DOWN) */

return 0;
@@ -1198,14 +1203,15 @@ static int brcmf_netdev_open(struct net_device *net)
int ifidx = brcmf_net2idx(drvr_priv, net);
s32 ret = 0;

- DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
+ BRCMF_TRACE(("%s: ifidx %d\n", __func__, ifidx));

if (ifidx == 0) { /* do it only for primary eth0 */

/* try to bring up bus */
ret = brcmf_bus_start(&drvr_priv->pub);
if (ret != 0) {
- DHD_ERROR(("%s: failed with code %d\n", __func__, ret));
+ BRCMF_ERROR(("%s: failed with code %d\n",
+ __func__, ret));
return -1;
}
atomic_set(&drvr_priv->pend_8021x_cnt, 0);
@@ -1215,16 +1221,18 @@ static int brcmf_netdev_open(struct net_device *net)
/* 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 |= NETIF_F_IP_CSUM;
+ drvr_priv->iflist[ifidx]->net->features |=
+ NETIF_F_IP_CSUM;
else
- drvr_priv->iflist[ifidx]->net->features &= ~NETIF_F_IP_CSUM;
+ drvr_priv->iflist[ifidx]->net->features &=
+ ~NETIF_F_IP_CSUM;
}
/* Allow transmit calls */
netif_start_queue(net);
drvr_priv->pub.up = 1;
if (unlikely(brcmf_cfg80211_up())) {
- DHD_ERROR(("%s: failed to bring up cfg80211\n",
- __func__));
+ BRCMF_ERROR(("%s: failed to bring up cfg80211\n",
+ __func__));
return -1;
}

@@ -1237,7 +1245,7 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
{
struct brcmf_if *ifp;

- DHD_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
+ BRCMF_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));

ASSERT(drvr_priv && (ifidx < BRCMF_MAX_IFS));

@@ -1245,7 +1253,7 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
if (!ifp) {
ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
if (!ifp) {
- DHD_ERROR(("%s: OOM - struct brcmf_if\n", __func__));
+ BRCMF_ERROR(("%s: OOM - struct brcmf_if\n", __func__));
return -ENOMEM;
}
}
@@ -1272,12 +1280,12 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
{
struct brcmf_if *ifp;

- DHD_TRACE(("%s: idx %d\n", __func__, ifidx));
+ BRCMF_TRACE(("%s: idx %d\n", __func__, ifidx));

ASSERT(drvr_priv && ifidx && (ifidx < BRCMF_MAX_IFS));
ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
- DHD_ERROR(("%s: Null interface\n", __func__));
+ BRCMF_ERROR(("%s: Null interface\n", __func__));
return;
}

@@ -1292,19 +1300,19 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
struct brcmf_info *drvr_priv = NULL;
struct net_device *net;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Allocate etherdev, including space for private structure */
net = alloc_etherdev(sizeof(drvr_priv));
if (!net) {
- DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
+ BRCMF_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
goto fail;
}

/* Allocate primary brcmf_info */
drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC);
if (!drvr_priv) {
- DHD_ERROR(("%s: OOM - alloc brcmf_info\n", __func__));
+ BRCMF_ERROR(("%s: OOM - alloc brcmf_info\n", __func__));
goto fail;
}

@@ -1343,13 +1351,13 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)

/* Attach and link in the protocol */
if (brcmf_proto_attach(&drvr_priv->pub) != 0) {
- DHD_ERROR(("brcmf_proto_attach failed\n"));
+ BRCMF_ERROR(("brcmf_prot_attach failed\n"));
goto fail;
}

/* Attach and link in the cfg80211 */
if (unlikely(brcmf_cfg80211_attach(net, &drvr_priv->pub))) {
- DHD_ERROR(("wl_cfg80211_attach failed\n"));
+ BRCMF_ERROR(("wl_cfg80211_attach failed\n"));
goto fail;
}

@@ -1393,19 +1401,19 @@ int brcmf_bus_start(struct brcmf_pub *drvr)

ASSERT(drvr_priv);

- DHD_TRACE(("%s:\n", __func__));
+ BRCMF_TRACE(("%s:\n", __func__));

/* Bring up the bus */
ret = brcmf_sdbrcm_bus_init(&drvr_priv->pub, true);
if (ret != 0) {
- DHD_ERROR(("%s, brcmf_sdbrcm_bus_init failed %d\n", __func__,
- ret));
+ BRCMF_ERROR(("%s, brcmf_sdbrcm_bus_init failed %d\n", __func__,
+ ret));
return ret;
}

/* If bus is not ready, can't come up */
if (drvr_priv->pub.busstate != BRCMF_BUS_DATA) {
- DHD_ERROR(("%s failed bus is not ready\n", __func__));
+ BRCMF_ERROR(("%s failed bus is not ready\n", __func__));
return -ENODEV;
}

@@ -1465,7 +1473,7 @@ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
u8 temp_addr[ETH_ALEN] = {
0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};

- DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
+ BRCMF_TRACE(("%s: ifidx %d\n", __func__, ifidx));

ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);

@@ -1485,7 +1493,7 @@ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
}

if (ifidx == 1) {
- DHD_TRACE(("%s ACCESS POINT MAC:\n", __func__));
+ BRCMF_TRACE(("%s ACCESS POINT MAC:\n", __func__));
/* ACCESSPOINT INTERFACE CASE */
temp_addr[0] |= 0X02; /* set bit 2 ,
- Locally Administered address */
@@ -1500,12 +1508,12 @@ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
memcpy(net->dev_addr, temp_addr, ETH_ALEN);

if (register_netdev(net) != 0) {
- DHD_ERROR(("%s: couldn't register the net device\n",
- __func__));
+ BRCMF_ERROR(("%s: couldn't register the net device\n",
+ __func__));
goto fail;
}

- DHD_INFO(("%s: Broadcom Dongle Host Driver\n", net->name));
+ BRCMF_INFO(("%s: Broadcom Dongle Host Driver\n", net->name));

return 0;

@@ -1518,7 +1526,7 @@ static void brcmf_bus_detach(struct brcmf_pub *drvr)
{
struct brcmf_info *drvr_priv;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (drvr) {
drvr_priv = drvr->info;
@@ -1536,7 +1544,7 @@ void brcmf_detach(struct brcmf_pub *drvr)
{
struct brcmf_info *drvr_priv;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (drvr) {
drvr_priv = drvr->info;
@@ -1577,7 +1585,7 @@ void brcmf_detach(struct brcmf_pub *drvr)

static void __exit brcmf_module_cleanup(void)
{
- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

brcmf_bus_unregister();
}
@@ -1586,12 +1594,12 @@ static int __init brcmf_module_init(void)
{
int error;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

error = brcmf_bus_register();

if (error) {
- DHD_ERROR(("%s: brcmf_bus_register failed\n", __func__));
+ BRCMF_ERROR(("%s: brcmf_bus_register failed\n", __func__));
goto failed;
}
return 0;
@@ -1742,7 +1750,7 @@ int brcmf_write_to_file(struct brcmf_pub *drvr, u8 *buf, int size)
/* open file to write */
fp = filp_open("/tmp/mem_dump", O_WRONLY | O_CREAT, 0640);
if (!fp) {
- DHD_ERROR(("%s: open file error\n", __func__));
+ BRCMF_ERROR(("%s: open file error\n", __func__));
ret = -1;
goto exit;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 4c801e7..2ed770d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -805,7 +805,7 @@ r_sdreg32(struct brcmf_bus *bus, u32 *regvar, u32 reg_offset, u32 *retryvar)
if (*retryvar) {
bus->regfails += (*retryvar-1);
if (*retryvar > retry_limit) {
- DHD_ERROR(("FAILED READ %Xh\n", reg_offset));
+ BRCMF_ERROR(("FAILED READ %Xh\n", reg_offset));
*regvar = 0;
}
}
@@ -823,7 +823,8 @@ w_sdreg32(struct brcmf_bus *bus, u32 regval, u32 reg_offset, u32 *retryvar)
if (*retryvar) {
bus->regfails += (*retryvar-1);
if (*retryvar > retry_limit)
- DHD_ERROR(("FAILED REGISTER WRITE %Xh\n", reg_offset));
+ BRCMF_ERROR(("FAILED REGISTER WRITE"
+ " %Xh\n", reg_offset));
}
}

@@ -907,8 +908,8 @@ 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 */
- DHD_ERROR(("user: Restrict the dongle ram size to %d, min %d\n",
- brcmf_dongle_memsize, min_size));
+ BRCMF_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;
@@ -938,7 +939,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
u8 clkctl, clkreq, devctl;
struct brcmf_sdio_card *card;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

clkctl = 0;
card = bus->card;
@@ -955,8 +956,8 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err);
if (err) {
- DHD_ERROR(("%s: HT Avail request error: %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: HT Avail request error: %d\n",
+ __func__, err));
return -EBADE;
}

@@ -972,8 +973,8 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
clkctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (err) {
- DHD_ERROR(("%s: HT Avail read error: %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: HT Avail read error: %d\n",
+ __func__, err));
return -EBADE;
}

@@ -983,15 +984,15 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
devctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
if (err) {
- DHD_ERROR(("%s: Devctl error setting CA: %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: Devctl error setting CA:"
+ " %d\n", __func__, err));
return -EBADE;
}

devctl |= SBSDIO_DEVCTL_CA_INT_ONLY;
brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, devctl, &err);
- DHD_INFO(("CLKCTL: set PENDING\n"));
+ BRCMF_INFO(("CLKCTL: set PENDING\n"));
bus->clkstate = CLK_PENDING;

return 0;
@@ -1016,25 +1017,26 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
PMU_MAX_TRANSITION_DLY);
}
if (err) {
- DHD_ERROR(("%s: HT Avail request error: %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: HT Avail request error: %d\n",
+ __func__, err));
return -EBADE;
}
if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
- DHD_ERROR(("%s: HT Avail timeout (%d): clkctl 0x%02x\n",
- __func__, PMU_MAX_TRANSITION_DLY, clkctl));
+ BRCMF_ERROR(("%s: HT Avail timeout (%d): "
+ "clkctl 0x%02x\n", __func__,
+ PMU_MAX_TRANSITION_DLY, clkctl));
return -EBADE;
}

/* Mark clock available */
bus->clkstate = CLK_AVAIL;
- DHD_INFO(("CLKCTL: turned ON\n"));
+ BRCMF_INFO(("CLKCTL: turned ON\n"));

#if defined(BCMDBG)
if (bus->alp_only != true) {
if (SBSDIO_ALPONLY(clkctl)) {
- DHD_ERROR(("%s: HT Clock should be on.\n",
- __func__));
+ BRCMF_ERROR(("%s: HT Clock should be on.\n",
+ __func__));
}
}
#endif /* defined (BCMDBG) */
@@ -1055,10 +1057,10 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
bus->clkstate = CLK_SDONLY;
brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err);
- DHD_INFO(("CLKCTL: turned OFF\n"));
+ BRCMF_INFO(("CLKCTL: turned OFF\n"));
if (err) {
- DHD_ERROR(("%s: Failed access turning clock off: %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: Failed access turning clock off:"
+ " %d\n", __func__, err));
return -EBADE;
}
}
@@ -1068,7 +1070,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
/* Change idle/active SD state */
static int brcmf_sdbrcm_sdclk(struct brcmf_bus *bus, bool on)
{
- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (on)
bus->clkstate = CLK_SDONLY;
@@ -1085,7 +1087,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
uint oldstate = bus->clkstate;
#endif /* BCMDBG */

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Early exit if we're already there */
if (bus->clkstate == target) {
@@ -1114,8 +1116,8 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
else if (bus->clkstate == CLK_AVAIL)
brcmf_sdbrcm_htclk(bus, false, false);
else
- DHD_ERROR(("brcmf_sdbrcm_clkctl: request for %d -> %d"
- "\n", bus->clkstate, target));
+ BRCMF_ERROR(("brcmf_sdbrcm_clkctl: request for %d -> %d"
+ "\n", bus->clkstate, target));
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
break;

@@ -1129,7 +1131,8 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
break;
}
#ifdef BCMDBG
- DHD_INFO(("brcmf_sdbrcm_clkctl: %d -> %d\n", oldstate, bus->clkstate));
+ BRCMF_INFO(("brcmf_sdbrcm_clkctl: %d -> %d\n",
+ oldstate, bus->clkstate));
#endif /* BCMDBG */

return 0;
@@ -1140,9 +1143,9 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
struct brcmf_sdio_card *card = bus->card;
uint retries = 0;

- DHD_INFO(("brcmf_sdbrcm_bussleep: request %s (currently %s)\n",
- (sleep ? "SLEEP" : "WAKE"),
- (bus->sleeping ? "SLEEP" : "WAKE")));
+ BRCMF_INFO(("brcmf_sdbrcm_bussleep: request %s (currently %s)\n",
+ (sleep ? "SLEEP" : "WAKE"),
+ (bus->sleeping ? "SLEEP" : "WAKE")));

/* Done if we're already in the requested state */
if (sleep == bus->sleeping)
@@ -1164,7 +1167,8 @@ 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)
- DHD_ERROR(("CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n"));
+ BRCMF_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);
@@ -1209,7 +1213,7 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
&retries);

if (retries > retry_limit)
- DHD_ERROR(("CANNOT SIGNAL CHIP TO CLEAR OOB!!\n"));
+ BRCMF_ERROR(("CANNOT SIGNAL CHIP TO CLEAR OOB!!\n"));

/* Make sure we have SD bus access */
brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
@@ -1247,7 +1251,7 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, uint c
struct sk_buff *new;
int i;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

card = bus->card;

@@ -1262,14 +1266,14 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, uint c
pad = ((unsigned long)frame % BRCMF_SDALIGN);
if (pad) {
if (skb_headroom(pkt) < pad) {
- DHD_INFO(("%s: insufficient headroom %d for %d pad\n",
- __func__, skb_headroom(pkt), pad));
+ BRCMF_INFO(("%s: insufficient headroom %d for %d pad\n",
+ __func__, skb_headroom(pkt), pad));
bus->drvr->tx_realloc++;
new = brcmu_pkt_buf_get_skb(pkt->len + BRCMF_SDALIGN);
if (!new) {
- DHD_ERROR(("%s: couldn't allocate new %d-byte "
- "packet\n",
- __func__, pkt->len + BRCMF_SDALIGN));
+ BRCMF_ERROR(("%s: couldn't allocate new "
+ "%d-byte packet\n", __func__,
+ pkt->len + BRCMF_SDALIGN));
ret = -ENOMEM;
goto done;
}
@@ -1310,12 +1314,12 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, uint c

#ifdef BCMDBG
tx_packets[pkt->priority]++;
- if (DHD_BYTES_ON() &&
- (((DHD_CTL_ON() && (chan == SDPCM_CONTROL_CHANNEL)) ||
- (DHD_DATA_ON() && (chan != SDPCM_CONTROL_CHANNEL))))) {
+ if (BRCMF_BYTES_ON() &&
+ (((BRCMF_CTL_ON() && (chan == SDPCM_CONTROL_CHANNEL)) ||
+ (BRCMF_DATA_ON() && (chan != SDPCM_CONTROL_CHANNEL))))) {
printk(KERN_DEBUG "Tx Frame:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, frame, len);
- } else if (DHD_HDRS_ON()) {
+ } else if (BRCMF_HDRS_ON()) {
printk(KERN_DEBUG "TxHdr:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
frame, min_t(u16, len, 16));
@@ -1345,8 +1349,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, uint c
if (ret < 0) {
/* On failure, abort the command
and terminate the frame */
- DHD_INFO(("%s: sdio error %d, abort command and "
- "terminate frame.\n", __func__, ret));
+ BRCMF_INFO(("%s: sdio error %d, abort command and "
+ "terminate frame.\n", __func__, ret));
bus->tx_sderrs++;

brcmf_sdcard_abort(card, SDIO_FUNC_2);
@@ -1392,7 +1396,7 @@ int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *pkt)
int ret = -EBADE;
uint datalen, prec;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

datalen = pkt->len;

@@ -1422,8 +1426,8 @@ int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *pkt)
|| bus->dpc_sched || (!DATAOK(bus))
|| (bus->flowcontrol & NBITVAL(prec))
|| (bus->clkstate != CLK_AVAIL)) {
- DHD_TRACE(("%s: deferring pktq len %d\n", __func__,
- pktq_len(&bus->txq)));
+ BRCMF_TRACE(("%s: deferring pktq len %d\n", __func__,
+ pktq_len(&bus->txq)));
bus->fcqueued++;

/* Priority based enq */
@@ -1432,7 +1436,7 @@ int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *pkt)
skb_pull(pkt, SDPCM_HDRLEN);
brcmf_txcomplete(bus->drvr, pkt, false);
brcmu_pkt_buf_free_skb(pkt);
- DHD_ERROR(("%s: out of bus->txq !!!\n", __func__));
+ BRCMF_ERROR(("%s: out of bus->txq !!!\n", __func__));
ret = -ENOSR;
} else {
ret = 0;
@@ -1461,7 +1465,7 @@ int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *pkt)
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, true);

#ifndef SDTEST
- DHD_TRACE(("%s: calling txpkt\n", __func__));
+ BRCMF_TRACE(("%s: calling txpkt\n", __func__));
ret = brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_DATA_CHANNEL, true);
#else
ret = brcmf_sdbrcm_txpkt(bus, pkt,
@@ -1497,7 +1501,7 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)

struct brcmf_pub *drvr = bus->drvr;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

tx_prec_map = ~bus->flowcontrol;

@@ -1558,7 +1562,7 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
int ret = -1;
int i;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (bus->drvr->dongle_reset)
return -EIO;
@@ -1617,8 +1621,9 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
put_unaligned_le32(0, frame + SDPCM_FRAMETAG_LEN + sizeof(swheader));

if (!DATAOK(bus)) {
- DHD_INFO(("%s: No bus credit bus->tx_max %d, bus->tx_seq %d\n",
- __func__, bus->tx_max, bus->tx_seq));
+ BRCMF_INFO(("%s: No bus credit bus->tx_max %d,"
+ " bus->tx_seq %d\n", __func__,
+ bus->tx_max, bus->tx_seq));
bus->ctrl_frame_stat = true;
/* Send from dpc */
bus->ctrl_frame_buf = frame;
@@ -1627,21 +1632,22 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
brcmf_sdbrcm_wait_for_event(bus, &bus->ctrl_frame_stat);

if (bus->ctrl_frame_stat == false) {
- DHD_INFO(("%s: ctrl_frame_stat == false\n", __func__));
+ BRCMF_INFO(("%s: ctrl_frame_stat == false\n",
+ __func__));
ret = 0;
} else {
- DHD_INFO(("%s: ctrl_frame_stat == true\n", __func__));
+ BRCMF_INFO(("%s: ctrl_frame_stat == true\n", __func__));
ret = -1;
}
}

if (ret == -1) {
#ifdef BCMDBG
- if (DHD_BYTES_ON() && DHD_CTL_ON()) {
+ if (BRCMF_BYTES_ON() && BRCMF_CTL_ON()) {
printk(KERN_DEBUG "Tx Frame:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
frame, len);
- } else if (DHD_HDRS_ON()) {
+ } else if (BRCMF_HDRS_ON()) {
printk(KERN_DEBUG "TxHdr:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
frame, min_t(u16, len, 16));
@@ -1659,8 +1665,9 @@ 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 */
- DHD_INFO(("%s: sdio error %d, abort command and terminate frame.\n",
- __func__, ret));
+ BRCMF_INFO(("%s: sdio error %d, abort command "
+ "and terminate frame.\n",
+ __func__, ret));
bus->tx_sderrs++;

brcmf_sdcard_abort(card, SDIO_FUNC_2);
@@ -1714,7 +1721,7 @@ int brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msgle
uint rxlen = 0;
bool pending;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (bus->drvr->dongle_reset)
return -EIO;
@@ -1729,20 +1736,20 @@ int brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msgle
brcmf_sdbrcm_sdunlock(bus);

if (rxlen) {
- DHD_CTL(("%s: resumed on rxctl frame, got %d expected %d\n",
- __func__, rxlen, msglen));
+ BRCMF_CTL(("%s: resumed on rxctl frame, got %d expected %d\n",
+ __func__, rxlen, msglen));
} else if (timeleft == 0) {
- DHD_ERROR(("%s: resumed on timeout\n", __func__));
+ BRCMF_ERROR(("%s: resumed on timeout\n", __func__));
#ifdef BCMDBG
brcmf_sdbrcm_sdlock(bus);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
brcmf_sdbrcm_sdunlock(bus);
#endif /* BCMDBG */
} else if (pending == true) {
- DHD_CTL(("%s: cancelled\n", __func__));
+ BRCMF_CTL(("%s: cancelled\n", __func__));
return -ERESTARTSYS;
} else {
- DHD_CTL(("%s: resumed for unknown reason?\n", __func__));
+ BRCMF_CTL(("%s: resumed for unknown reason?\n", __func__));
#ifdef BCMDBG
brcmf_sdbrcm_sdlock(bus);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
@@ -2049,19 +2056,20 @@ brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data,
/* Set the backplane window to include the start address */
bcmerror = brcmf_sdbrcm_set_siaddr_window(bus, address);
if (bcmerror) {
- DHD_ERROR(("%s: window change failed\n", __func__));
+ BRCMF_ERROR(("%s: window change failed\n", __func__));
goto xfer_done;
}

/* Do the transfer(s) */
while (size) {
- DHD_INFO(("%s: %s %d bytes at offset 0x%08x in window 0x%08x\n",
- __func__, (write ? "write" : "read"), dsize,
- sdaddr, (address & SBSDIO_SBWINDOW_MASK)));
+ BRCMF_INFO(("%s: %s %d bytes at offset 0x%08x in window"
+ " 0x%08x\n", __func__, (write ? "write" : "read"),
+ dsize, sdaddr, (address & SBSDIO_SBWINDOW_MASK)));
bcmerror =
brcmf_sdcard_rwdata(bus->card, write, sdaddr, data, dsize);
if (bcmerror) {
- DHD_ERROR(("%s: membytes transfer failed\n", __func__));
+ BRCMF_ERROR(("%s: membytes transfer failed\n",
+ __func__));
break;
}

@@ -2072,8 +2080,8 @@ brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data,
address += dsize;
bcmerror = brcmf_sdbrcm_set_siaddr_window(bus, address);
if (bcmerror) {
- DHD_ERROR(("%s: window change failed\n",
- __func__));
+ BRCMF_ERROR(("%s: window change failed\n",
+ __func__));
break;
}
sdaddr = 0;
@@ -2085,8 +2093,8 @@ xfer_done:
/* Return the window to backplane enumeration space for core access */
if (brcmf_sdbrcm_set_siaddr_window(bus,
brcmf_sdcard_cur_sbwad(bus->card))) {
- DHD_ERROR(("%s: FAILED to set window back to 0x%x\n",
- __func__, brcmf_sdcard_cur_sbwad(bus->card)));
+ BRCMF_ERROR(("%s: FAILED to set window back to 0x%x\n",
+ __func__, brcmf_sdcard_cur_sbwad(bus->card)));
}

return bcmerror;
@@ -2107,15 +2115,15 @@ static int brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *s

addr = le32_to_cpu(addr);

- DHD_INFO(("sdpcm_shared address 0x%08X\n", addr));
+ BRCMF_INFO(("sdpcm_shared address 0x%08X\n", addr));

/*
* Check if addr is valid.
* NVRAM length at the end of memory should have been overwritten.
*/
if (addr == 0 || ((~addr >> 16) & 0xffff) == (addr & 0xffff)) {
- DHD_ERROR(("%s: address (0x%08x) of sdpcm_shared invalid\n",
- __func__, addr));
+ BRCMF_ERROR(("%s: address (0x%08x) of sdpcm_shared invalid\n",
+ __func__, addr));
return -EBADE;
}

@@ -2135,10 +2143,10 @@ static int brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *s
sh->msgtrace_addr = le32_to_cpu(sh->msgtrace_addr);

if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
- DHD_ERROR(("%s: sdpcm_shared version %d in brcmf "
- "is different than sdpcm_shared version %d in dongle\n",
- __func__, SDPCM_SHARED_VERSION,
- sh->flags & SDPCM_SHARED_VERSION_MASK));
+ BRCMF_ERROR(("%s: sdpcm_shared version %d in brcmf "
+ "is different than sdpcm_shared version %d in dongle\n",
+ __func__, SDPCM_SHARED_VERSION,
+ sh->flags & SDPCM_SHARED_VERSION_MASK));
return -EBADE;
}

@@ -2156,7 +2164,7 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
struct sdpcm_shared sdpcm_shared;
struct brcmu_strbuf strbuf;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (data == NULL) {
/*
@@ -2166,8 +2174,8 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
size = msize;
mbuffer = data = kmalloc(msize, GFP_ATOMIC);
if (mbuffer == NULL) {
- DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__,
- msize));
+ BRCMF_ERROR(("%s: kmalloc(%d) failed\n", __func__,
+ msize));
bcmerror = -ENOMEM;
goto done;
}
@@ -2175,7 +2183,7 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)

str = kmalloc(maxstrlen, GFP_ATOMIC);
if (str == NULL) {
- DHD_ERROR(("%s: kmalloc(%d) failed\n", __func__, maxstrlen));
+ BRCMF_ERROR(("%s: kmalloc(%d) failed\n", __func__, maxstrlen));
bcmerror = -ENOMEM;
goto done;
}
@@ -2258,7 +2266,7 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
}

if (sdpcm_shared.flags & (SDPCM_SHARED_ASSERT | SDPCM_SHARED_TRAP))
- DHD_ERROR(("%s: %s\n", __func__, strbuf.origbuf));
+ BRCMF_ERROR(("%s: %s\n", __func__, strbuf.origbuf));

#ifdef BCMDBG
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
@@ -2286,7 +2294,7 @@ static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus)
size = bus->ramsize;
buf = kmalloc(size, GFP_ATOMIC);
if (!buf) {
- DHD_ERROR(("%s: Out of memory (%d bytes)\n", __func__, size));
+ BRCMF_ERROR(("%s: Out of memory (%d bytes)\n", __func__, size));
return -1;
}

@@ -2298,7 +2306,7 @@ static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus)
ret = brcmf_sdbrcm_membytes(bus, false, start, databuf,
read_size);
if (ret) {
- DHD_ERROR(("%s: Error membytes %d\n", __func__, ret));
+ BRCMF_ERROR(("%s: Error membytes %d\n", __func__, ret));
kfree(buf);
return -1;
}
@@ -2313,7 +2321,7 @@ static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus)

/* free buf before return !!! */
if (brcmf_write_to_file(bus->drvr, buf, bus->ramsize)) {
- DHD_ERROR(("%s: Error writing to files\n", __func__));
+ BRCMF_ERROR(("%s: Error writing to files\n", __func__));
return -1;
}

@@ -2404,7 +2412,7 @@ int brcmf_sdbrcm_downloadvars(struct brcmf_bus *bus, void *arg, int len)
{
int bcmerror = 0;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Basic sanity checks */
if (bus->drvr->up) {
@@ -2442,9 +2450,9 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
s32 int_val = 0;
bool bool_val = 0;

- DHD_TRACE(("%s: Enter, action %d name %s params %p plen %d arg %p "
- "len %d val_size %d\n",
- __func__, actionid, name, params, plen, arg, len, val_size));
+ BRCMF_TRACE(("%s: Enter, action %d name %s params %p plen %d arg %p "
+ "len %d val_size %d\n", __func__, actionid, name, params,
+ plen, arg, len, val_size));

bcmerror = brcmu_iovar_lencheck(vi, arg, len, IOV_ISSET(actionid));
if (bcmerror != 0)
@@ -2492,13 +2500,11 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
bus->intr = bool_val;
bus->intdis = false;
if (bus->drvr->up) {
+ BRCMF_INTR(("%s: %s SDIO interrupts\n", __func__,
+ bus->intr ? "enable" : "disable"));
if (bus->intr) {
- DHD_INTR(("%s: enable SDIO device interrupts\n",
- __func__));
brcmf_sdcard_intr_enable(bus->card);
} else {
- DHD_INTR(("%s: disable SDIO interrupts\n",
- __func__));
brcmf_sdcard_intr_disable(bus->card);
}
}
@@ -2563,25 +2569,25 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
/* Do some validation */
dsize = set ? plen - (2 * sizeof(int)) : len;
if (dsize < size) {
- DHD_ERROR(("%s: error on %s membytes, addr "
- "0x%08x size %d dsize %d\n",
- __func__, (set ? "set" : "get"),
- address, size, dsize));
+ BRCMF_ERROR(("%s: error on %s membytes, addr "
+ "0x%08x size %d dsize %d\n",
+ __func__, (set ? "set" : "get"),
+ address, size, dsize));
bcmerror = -EINVAL;
break;
}

- DHD_INFO(("%s: Request to %s %d bytes at address "
- "0x%08x\n",
- __func__, (set ? "write" : "read"), size, address));
+ BRCMF_INFO(("%s: Request to %s %d bytes at address "
+ "0x%08x\n", __func__,
+ (set ? "write" : "read"), size, address));

/* If we know about SOCRAM, check for a fit */
if ((bus->orig_ramsize) &&
((address > bus->orig_ramsize)
|| (address + size > bus->orig_ramsize))) {
- DHD_ERROR(("%s: ramsize 0x%08x doesn't have %d "
- "bytes at 0x%08x\n",
- __func__, bus->orig_ramsize, size, address));
+ BRCMF_ERROR(("%s: ramsize 0x%08x doesn't have"
+ " %d bytes at 0x%08x\n", __func__,
+ bus->orig_ramsize, size, address));
bcmerror = -EINVAL;
break;
}
@@ -2827,17 +2833,17 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
#endif /* SDTEST */

case IOV_SVAL(IOV_DEVRESET):
- DHD_TRACE(("%s: Called set IOV_DEVRESET=%d dongle_reset=%d "
- "busstate=%d\n",
- __func__, bool_val, bus->drvr->dongle_reset,
- bus->drvr->busstate));
+ BRCMF_TRACE(("%s: Called set IOV_DEVRESET=%d dongle_reset=%d "
+ "busstate=%d\n",
+ __func__, bool_val, bus->drvr->dongle_reset,
+ bus->drvr->busstate));

brcmf_bus_devreset(bus->drvr, (u8) bool_val);

break;

case IOV_GVAL(IOV_DEVRESET):
- DHD_TRACE(("%s: Called get IOV_DEVRESET\n", __func__));
+ BRCMF_TRACE(("%s: Called get IOV_DEVRESET\n", __func__));

/* Get its status */
int_val = (bool) bus->drvr->dongle_reset;
@@ -2905,7 +2911,7 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
brcmf_sdbrcm_membytes(bus, true, varaddr, vbuffer, varsize);
#ifdef BCMDBG
/* Verify NVRAM bytes */
- DHD_INFO(("Compare NVRAM dl & ul; varsize=%d\n", varsize));
+ BRCMF_INFO(("Compare NVRAM dl & ul; varsize=%d\n", varsize));
nvram_ularray = kmalloc(varsize, GFP_ATOMIC);
if (!nvram_ularray)
return -ENOMEM;
@@ -2918,16 +2924,17 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
brcmf_sdbrcm_membytes(bus, false, varaddr, nvram_ularray,
varsize);
if (bcmerror) {
- DHD_ERROR(("%s: error %d on reading %d nvram bytes at "
- "0x%08x\n", __func__, bcmerror, varsize, varaddr));
+ BRCMF_ERROR(("%s: error %d on reading %d nvram bytes"
+ " at 0x%08x\n", __func__, bcmerror,
+ varsize, varaddr));
}
/* Compare the org NVRAM with the one read from RAM */
if (memcmp(vbuffer, nvram_ularray, varsize)) {
- DHD_ERROR(("%s: Downloaded NVRAM image is corrupted.\n",
- __func__));
+ BRCMF_ERROR(("%s: Downloaded NVRAM image is "
+ "corrupted.\n", __func__));
} else
- DHD_ERROR(("%s: Download/Upload/Compare of NVRAM ok.\n",
- __func__));
+ BRCMF_ERROR(("%s: Download/Upload/Compare of"
+ " NVRAM ok.\n", __func__));

kfree(nvram_ularray);
#endif /* BCMDBG */
@@ -2936,9 +2943,9 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
}

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

/*
@@ -2954,8 +2961,8 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
varsizew = cpu_to_le32(varsizew);
}

- DHD_INFO(("New varsize is %d, length token=0x%08x\n", varsize,
- varsizew));
+ BRCMF_INFO(("New varsize is %d, length token=0x%08x\n", varsize,
+ varsizew));

/* Write the length token to the last word */
bcmerror = brcmf_sdbrcm_membytes(bus, true, (bus->orig_ramsize - 4),
@@ -2992,15 +2999,15 @@ static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter)
regdata &= (SBTML_RESET | SBTML_REJ_MASK |
(SICF_CLOCK_EN << SBTML_SICF_SHIFT));
if ((SICF_CLOCK_EN << SBTML_SICF_SHIFT) != regdata) {
- DHD_ERROR(("%s: SOCRAM core is down after reset?\n",
- __func__));
+ BRCMF_ERROR(("%s: SOCRAM core is down after reset?\n",
+ __func__));
bcmerror = -EBADE;
goto fail;
}

bcmerror = brcmf_sdbrcm_write_vars(bus);
if (bcmerror) {
- DHD_ERROR(("%s: no vars written to RAM\n", __func__));
+ BRCMF_ERROR(("%s: no vars written to RAM\n", __func__));
bcmerror = 0;
}

@@ -3028,7 +3035,7 @@ brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
int val_size;
u32 actionid;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

ASSERT(name);
ASSERT(len >= 0);
@@ -3060,12 +3067,12 @@ brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
&bus->blocksize, sizeof(s32),
false) != 0) {
bus->blocksize = 0;
- DHD_ERROR(("%s: fail on %s get\n", __func__,
- "sd_blocksize"));
+ BRCMF_ERROR(("%s: fail on %s get\n", __func__,
+ "sd_blocksize"));
} else {
- DHD_INFO(("%s: noted %s update, value now %d\n",
- __func__, "sd_blocksize",
- bus->blocksize));
+ BRCMF_INFO(("%s: noted sd_blocksize update,"
+ " value now %d\n", __func__,
+ bus->blocksize));
}
}
bus->roundup = min(max_roundup, bus->blocksize);
@@ -3080,8 +3087,8 @@ brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
goto exit;
}

- DHD_CTL(("%s: %s %s, len %d plen %d\n", __func__,
- name, (set ? "set" : "get"), len, plen));
+ BRCMF_CTL(("%s: %s %s, len %d plen %d\n", __func__,
+ name, (set ? "set" : "get"), len, plen));

/* set up 'params' pointer in case this is a set command so that
* the convenience int and bool code can be common to set and get
@@ -3114,7 +3121,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
uint retries;
int err;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (enforce_mutex)
brcmf_sdbrcm_sdlock(bus);
@@ -3154,12 +3161,12 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
(saveclk | SBSDIO_FORCE_HT), &err);
}
if (err) {
- DHD_ERROR(("%s: Failed to force clock for F2: err %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: Failed to force clock for F2: err %d\n",
+ __func__, err));
}

/* Turn off the bus (F2), free any pending packets */
- DHD_INTR(("%s: disable SDIO interrupts\n", __func__));
+ BRCMF_INTR(("%s: disable SDIO interrupts\n", __func__));
brcmf_sdcard_intr_disable(bus->card);
brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL);
@@ -3204,7 +3211,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
int err, ret = 0;
u8 saveclk;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* try to download image and nvram to the dongle */
if (drvr->busstate == BRCMF_BUS_DOWN) {
@@ -3238,8 +3245,8 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
(saveclk | SBSDIO_FORCE_HT), &err);
}
if (err) {
- DHD_ERROR(("%s: Failed to force clock for F2: err %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: Failed to force clock for F2: err %d\n",
+ __func__, err));
goto exit;
}

@@ -3259,8 +3266,8 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
ready = brcmf_sdcard_cfg_read(bus->card, SDIO_FUNC_0,
SDIO_CCCR_IORx, NULL);

- DHD_INFO(("%s: enable 0x%02x, ready 0x%02x (waited %uus)\n",
- __func__, enable, ready, tmo.elapsed));
+ BRCMF_INFO(("%s: enable 0x%02x, ready 0x%02x (waited %uus)\n",
+ __func__, enable, ready, tmo.elapsed));

/* If F2 successfully enabled, set core and enable interrupts */
if (ready == enable) {
@@ -3277,11 +3284,11 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)

bus->intdis = false;
if (bus->intr) {
- DHD_INTR(("%s: enable SDIO device interrupts\n",
- __func__));
+ BRCMF_INTR(("%s: enable SDIO device interrupts\n",
+ __func__));
brcmf_sdcard_intr_enable(bus->card);
} else {
- DHD_INTR(("%s: disable SDIO interrupts\n", __func__));
+ BRCMF_INTR(("%s: disable SDIO interrupts\n", __func__));
brcmf_sdcard_intr_disable(bus->card);
}

@@ -3302,7 +3309,8 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
/* Host registration for OOB interrupt */
if (brcmf_sdio_register_oob_intr(bus->dhd)) {
brcmf_sdbrcm_wd_timer(bus, 0);
- DHD_ERROR(("%s Host failed to resgister for OOB\n", __func__));
+ BRCMF_ERROR(("%s Host failed to resgister for OOB\n",
+ __func__));
ret = -ENODEV;
goto exit;
}
@@ -3330,9 +3338,9 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
u8 hi, lo;
int err;

- DHD_ERROR(("%s: %sterminate frame%s\n", __func__,
- (abort ? "abort command, " : ""),
- (rtx ? ", send NAK" : "")));
+ BRCMF_ERROR(("%s: %sterminate frame%s\n", __func__,
+ (abort ? "abort command, " : ""),
+ (rtx ? ", send NAK" : "")));

if (abort)
brcmf_sdcard_abort(card, SDIO_FUNC_2);
@@ -3353,19 +3361,19 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
break;

if ((hi > (lastrbc >> 8)) && (lo > (lastrbc & 0x00ff))) {
- DHD_ERROR(("%s: count growing: last 0x%04x now "
- "0x%04x\n",
- __func__, lastrbc, ((hi << 8) + lo)));
+ BRCMF_ERROR(("%s: count growing: last 0x%04x now "
+ "0x%04x\n",
+ __func__, lastrbc, ((hi << 8) + lo)));
}
lastrbc = (hi << 8) + lo;
}

if (!retries) {
- DHD_ERROR(("%s: count never zeroed: last 0x%04x\n",
- __func__, lastrbc));
+ BRCMF_ERROR(("%s: count never zeroed: last 0x%04x\n",
+ __func__, lastrbc));
} else {
- DHD_INFO(("%s: flush took %d iterations\n", __func__,
- (0xffff - retries)));
+ BRCMF_INFO(("%s: flush took %d iterations\n", __func__,
+ (0xffff - retries)));
}

if (rtx) {
@@ -3394,7 +3402,7 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)

int sdret;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Control data already received in aligned rxctl */
if ((bus->bus == SPI_BUS) && (!bus->usebufpool))
@@ -3440,17 +3448,17 @@ 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 + firstread) > bus->drvr->maxctl) {
- DHD_ERROR(("%s: %d-byte control read exceeds %d-byte buffer\n",
- __func__, rdlen, bus->drvr->maxctl));
+ BRCMF_ERROR(("%s: %d-byte control read exceeds %d-byte"
+ " buffer\n", __func__, rdlen, bus->drvr->maxctl));
bus->drvr->rx_errors++;
brcmf_sdbrcm_rxfail(bus, false, false);
goto done;
}

if ((len - doff) > bus->drvr->maxctl) {
- DHD_ERROR(("%s: %d-byte ctl frame (%d-byte ctl data) exceeds "
- "%d-byte limit\n",
- __func__, len, (len - doff), bus->drvr->maxctl));
+ BRCMF_ERROR(("%s: %d-byte ctl frame (%d-byte ctl data) exceeds "
+ "%d-byte limit\n",
+ __func__, len, (len - doff), bus->drvr->maxctl));
bus->drvr->rx_errors++;
bus->rx_toolong++;
brcmf_sdbrcm_rxfail(bus, false, false);
@@ -3467,8 +3475,8 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)

/* Control frame failures need retransmission */
if (sdret < 0) {
- DHD_ERROR(("%s: read %d control bytes failed: %d\n",
- __func__, rdlen, sdret));
+ BRCMF_ERROR(("%s: read %d control bytes failed: %d\n",
+ __func__, rdlen, sdret));
bus->rxc_errors++;
brcmf_sdbrcm_rxfail(bus, true, true);
goto done;
@@ -3477,7 +3485,7 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)
gotpkt:

#ifdef BCMDBG
- if (DHD_BYTES_ON() && DHD_CTL_ON()) {
+ if (BRCMF_BYTES_ON() && BRCMF_CTL_ON()) {
printk(KERN_DEBUG "RxCtrl:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, bus->rxctl, len);
}
@@ -3510,8 +3518,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
/* If packets, issue read(s) and send up packet chain */
/* Return sequence numbers consumed? */

- DHD_TRACE(("brcmf_sdbrcm_rxglom: start: glomd %p glom %p\n", bus->glomd,
- bus->glom));
+ BRCMF_TRACE(("brcmf_sdbrcm_rxglom: start: glomd %p glom %p\n",
+ bus->glomd, bus->glom));

/* If there's a descriptor, generate the packet chain */
if (bus->glomd) {
@@ -3519,8 +3527,9 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
dlen = (u16) (bus->glomd->len);
dptr = bus->glomd->data;
if (!dlen || (dlen & 1)) {
- DHD_ERROR(("%s: bad glomd len(%d), ignore descriptor\n",
- __func__, dlen));
+ BRCMF_ERROR(("%s: bad glomd len(%d),"
+ " ignore descriptor\n",
+ __func__, dlen));
dlen = 0;
}

@@ -3531,14 +3540,15 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
dptr += sizeof(u16);
if ((sublen < SDPCM_HDRLEN) ||
((num == 0) && (sublen < (2 * SDPCM_HDRLEN)))) {
- DHD_ERROR(("%s: descriptor len %d bad: %d\n",
- __func__, num, sublen));
+ BRCMF_ERROR(("%s: descriptor len %d bad: %d\n",
+ __func__, num, sublen));
pnext = NULL;
break;
}
if (sublen % BRCMF_SDALIGN) {
- DHD_ERROR(("%s: sublen %d not multiple of %d\n",
- __func__, sublen, BRCMF_SDALIGN));
+ BRCMF_ERROR(("%s: sublen %d not multiple of"
+ " %d\n", __func__, sublen,
+ BRCMF_SDALIGN));
usechain = false;
}
totlen += sublen;
@@ -3554,9 +3564,9 @@ 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) {
- DHD_ERROR(("%s: bcm_pkt_buf_get_skb failed, "
- "num %d len %d\n", __func__,
- num, sublen));
+ BRCMF_ERROR(("%s: bcm_pkt_buf_get_skb failed, "
+ "num %d len %d\n", __func__,
+ num, sublen));
break;
}
ASSERT(!(pnext->prev));
@@ -3576,13 +3586,15 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
/* If all allocations succeeded, save packet chain
in bus structure */
if (pnext) {
- DHD_GLOM(("%s: allocated %d-byte packet chain for %d "
- "subframes\n", __func__, totlen, num));
- if (DHD_GLOM_ON() && bus->nextlen) {
+ BRCMF_GLOM(("%s: allocated %d-byte packet chain for %d "
+ "subframes\n", __func__, totlen, num));
+ if (BRCMF_GLOM_ON() && bus->nextlen) {
if (totlen != bus->nextlen) {
- DHD_GLOM(("%s: glomdesc mismatch: nextlen %d glomdesc %d " "rxseq %d\n",
- __func__, bus->nextlen,
- totlen, rxseq));
+ BRCMF_GLOM(("%s: glomdesc mismatch: "
+ "nextlen %d glomdesc %d "
+ "rxseq %d\n", __func__,
+ bus->nextlen,
+ totlen, rxseq));
}
}
bus->glom = pfirst;
@@ -3603,13 +3615,13 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
/* Ok -- either we just generated a packet chain,
or had one from before */
if (bus->glom) {
- if (DHD_GLOM_ON()) {
- DHD_GLOM(("%s: try superframe read, packet chain:\n",
- __func__));
+ if (BRCMF_GLOM_ON()) {
+ BRCMF_GLOM(("%s: try superframe read, packet chain:\n",
+ __func__));
for (pnext = bus->glom; pnext; pnext = pnext->next) {
- DHD_GLOM((" %p: %p len 0x%04x (%d)\n",
- pnext, (u8 *) (pnext->data),
- pnext->len, pnext->len));
+ BRCMF_GLOM((" %p: %p len 0x%04x (%d)\n",
+ pnext, (u8 *) (pnext->data),
+ pnext->len, pnext->len));
}
}

@@ -3635,14 +3647,15 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
sublen = (u16) brcmu_pktfrombuf(pfirst, 0, dlen,
bus->dataptr);
if (sublen != dlen) {
- DHD_ERROR(("%s: FAILED TO COPY, dlen %d sublen %d\n",
- __func__, dlen, sublen));
+ BRCMF_ERROR(("%s: FAILED TO COPY, dlen %d "
+ "sublen %d\n",
+ __func__, dlen, sublen));
errcode = -1;
}
pnext = NULL;
} else {
- DHD_ERROR(("COULDN'T ALLOC %d-BYTE GLOM, FORCE FAILURE\n",
- dlen));
+ BRCMF_ERROR(("COULDN'T ALLOC %d-BYTE GLOM, "
+ "FORCE FAILURE\n", dlen));
errcode = -1;
}
bus->f2rxdata++;
@@ -3650,8 +3663,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)

/* On failure, kill the superframe, allow a couple retries */
if (errcode < 0) {
- DHD_ERROR(("%s: glom read of %d bytes failed: %d\n",
- __func__, dlen, errcode));
+ BRCMF_ERROR(("%s: glom read of %d bytes failed: %d\n",
+ __func__, dlen, errcode));
bus->drvr->rx_errors++;

if (bus->glomerr++ < 3) {
@@ -3666,7 +3679,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
return 0;
}
#ifdef BCMDBG
- if (DHD_GLOM_ON()) {
+ if (BRCMF_GLOM_ON()) {
printk(KERN_DEBUG "SUPERFRAME:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
pfirst->data, min_t(int, pfirst->len, 48));
@@ -3682,8 +3695,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
seq = SDPCM_PACKET_SEQUENCE(&dptr[SDPCM_FRAMETAG_LEN]);
bus->nextlen = dptr[SDPCM_FRAMETAG_LEN + SDPCM_NEXTLEN_OFFSET];
if ((bus->nextlen << 4) > MAX_RX_DATASZ) {
- DHD_INFO(("%s: nextlen too large (%d) seq %d\n",
- __func__, bus->nextlen, seq));
+ BRCMF_INFO(("%s: nextlen too large (%d) seq %d\n",
+ __func__, bus->nextlen, seq));
bus->nextlen = 0;
}
doff = SDPCM_DOFFSET_VALUE(&dptr[SDPCM_FRAMETAG_LEN]);
@@ -3691,47 +3704,48 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)

errcode = 0;
if ((u16)~(sublen ^ check)) {
- DHD_ERROR(("%s (superframe): HW hdr error: len/check "
- "0x%04x/0x%04x\n", __func__, sublen, check));
+ BRCMF_ERROR(("%s (superframe): HW hdr error: len/check "
+ "0x%04x/0x%04x\n", __func__, sublen,
+ check));
errcode = -1;
} else if (roundup(sublen, bus->blocksize) != dlen) {
- DHD_ERROR(("%s (superframe): len 0x%04x, rounded "
- "0x%04x, expect 0x%04x\n",
- __func__, sublen,
- roundup(sublen, bus->blocksize), dlen));
+ BRCMF_ERROR(("%s (superframe): len 0x%04x, rounded "
+ "0x%04x, expect 0x%04x\n",
+ __func__, sublen,
+ roundup(sublen, bus->blocksize), dlen));
errcode = -1;
} else if (SDPCM_PACKET_CHANNEL(&dptr[SDPCM_FRAMETAG_LEN]) !=
SDPCM_GLOM_CHANNEL) {
- DHD_ERROR(("%s (superframe): bad channel %d\n",
+ BRCMF_ERROR(("%s (superframe): bad channel %d\n",
__func__,
SDPCM_PACKET_CHANNEL(&dptr
[SDPCM_FRAMETAG_LEN])));
errcode = -1;
} else if (SDPCM_GLOMDESC(&dptr[SDPCM_FRAMETAG_LEN])) {
- DHD_ERROR(("%s (superframe): got second descriptor?\n",
- __func__));
+ BRCMF_ERROR(("%s (superframe): got 2nd descriptor?\n",
+ __func__));
errcode = -1;
} else if ((doff < SDPCM_HDRLEN) ||
(doff > (pfirst->len - SDPCM_HDRLEN))) {
- DHD_ERROR(("%s (superframe): Bad data offset %d: HW %d "
- "pkt %d min %d\n",
- __func__, doff, sublen,
- pfirst->len, SDPCM_HDRLEN));
+ BRCMF_ERROR(("%s (superframe): Bad data offset %d: "
+ "HW %d pkt %d min %d\n",
+ __func__, doff, sublen,
+ pfirst->len, SDPCM_HDRLEN));
errcode = -1;
}

/* Check sequence number of superframe SW header */
if (rxseq != seq) {
- DHD_INFO(("%s: (superframe) rx_seq %d, expected %d\n",
- __func__, seq, rxseq));
+ BRCMF_INFO(("%s: (superframe) rx_seq %d, expected %d\n",
+ __func__, seq, rxseq));
bus->rx_badseq++;
rxseq = seq;
}

/* Check window for sanity */
if ((u8) (txmax - bus->tx_seq) > 0x40) {
- DHD_ERROR(("%s: unlikely tx max %d with tx_seq %d\n",
- __func__, txmax, bus->tx_seq));
+ BRCMF_ERROR(("%s: unlikely tx max %d with tx_seq %d\n",
+ __func__, txmax, bus->tx_seq));
txmax = bus->tx_seq + 2;
}
bus->tx_max = txmax;
@@ -3750,7 +3764,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
chan = SDPCM_PACKET_CHANNEL(&dptr[SDPCM_FRAMETAG_LEN]);
doff = SDPCM_DOFFSET_VALUE(&dptr[SDPCM_FRAMETAG_LEN]);
#ifdef BCMDBG
- if (DHD_GLOM_ON()) {
+ if (BRCMF_GLOM_ON()) {
printk(KERN_DEBUG "subframe:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
dptr, 32);
@@ -3758,24 +3772,25 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
#endif

if ((u16)~(sublen ^ check)) {
- DHD_ERROR(("%s (subframe %d): HW hdr error: "
- "len/check 0x%04x/0x%04x\n",
- __func__, num, sublen, check));
+ BRCMF_ERROR(("%s (subframe %d): HW hdr error: "
+ "len/check 0x%04x/0x%04x\n",
+ __func__, num, sublen, check));
errcode = -1;
} else if ((sublen > dlen) || (sublen < SDPCM_HDRLEN)) {
- DHD_ERROR(("%s (subframe %d): length mismatch: "
- "len 0x%04x, expect 0x%04x\n",
- __func__, num, sublen, dlen));
+ BRCMF_ERROR(("%s (subframe %d): length mismatch"
+ ": len 0x%04x, expect 0x%04x\n",
+ __func__, num, sublen, dlen));
errcode = -1;
} else if ((chan != SDPCM_DATA_CHANNEL) &&
(chan != SDPCM_EVENT_CHANNEL)) {
- DHD_ERROR(("%s (subframe %d): bad channel %d\n",
- __func__, num, chan));
+ BRCMF_ERROR(("%s (subframe %d): bad channel"
+ " %d\n", __func__, num, chan));
errcode = -1;
} else if ((doff < SDPCM_HDRLEN) || (doff > sublen)) {
- DHD_ERROR(("%s (subframe %d): Bad data offset %d: HW %d min %d\n",
- __func__, num, doff, sublen,
- SDPCM_HDRLEN));
+ BRCMF_ERROR(("%s (subframe %d): Bad data offset"
+ " %d: HW %d min %d\n",
+ __func__, num, doff, sublen,
+ SDPCM_HDRLEN));
errcode = -1;
}
}
@@ -3813,22 +3828,22 @@ 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]);

- DHD_GLOM(("%s: Get subframe %d, %p(%p/%d), sublen %d "
- "chan %d seq %d\n",
- __func__, num, pfirst, pfirst->data,
- pfirst->len, sublen, chan, seq));
+ BRCMF_GLOM(("%s: Get subframe %d, %p(%p/%d), sublen %d "
+ "chan %d seq %d\n",
+ __func__, num, pfirst, pfirst->data,
+ pfirst->len, sublen, chan, seq));

ASSERT((chan == SDPCM_DATA_CHANNEL)
|| (chan == SDPCM_EVENT_CHANNEL));

if (rxseq != seq) {
- DHD_GLOM(("%s: rx_seq %d, expected %d\n",
- __func__, seq, rxseq));
+ BRCMF_GLOM(("%s: rx_seq %d, expected %d\n",
+ __func__, seq, rxseq));
bus->rx_badseq++;
rxseq = seq;
}
#ifdef BCMDBG
- if (DHD_BYTES_ON() && DHD_DATA_ON()) {
+ if (BRCMF_BYTES_ON() && BRCMF_DATA_ON()) {
printk(KERN_DEBUG "Rx Subframe Data:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
dptr, dlen);
@@ -3849,8 +3864,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
continue;
} else if (brcmf_proto_hdrpull(bus->drvr, &ifidx, pfirst)
!= 0) {
- DHD_ERROR(("%s: rx protocol error\n",
- __func__));
+ BRCMF_ERROR(("%s: rx protocol error\n",
+ __func__));
bus->drvr->rx_errors++;
brcmu_pkt_buf_free_skb(pfirst);
if (plast) {
@@ -3869,12 +3884,12 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
num++;

#ifdef BCMDBG
- if (DHD_GLOM_ON()) {
- DHD_GLOM(("%s subframe %d to stack, %p(%p/%d) "
- "nxt/lnk %p/%p\n",
- __func__, num, pfirst, pfirst->data,
- pfirst->len, pfirst->next,
- pfirst->prev));
+ if (BRCMF_GLOM_ON()) {
+ BRCMF_GLOM(("%s subframe %d to stack, %p"
+ "(%p/%d) nxt/lnk %p/%p\n",
+ __func__, num, pfirst, pfirst->data,
+ pfirst->len, pfirst->next,
+ pfirst->prev));
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
pfirst->data,
min_t(int, pfirst->len, 32));
@@ -3920,7 +3935,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
bool sdtest = false; /* To limit message spew from test mode */
#endif

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

ASSERT(maxframes);

@@ -3942,10 +3957,10 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
/* Handle glomming separately */
if (bus->glom || bus->glomd) {
u8 cnt;
- DHD_GLOM(("%s: calling rxglom: glomd %p, glom %p\n",
- __func__, bus->glomd, bus->glom));
+ BRCMF_GLOM(("%s: calling rxglom: glomd %p, glom %p\n",
+ __func__, bus->glomd, bus->glom));
cnt = brcmf_sdbrcm_rxglom(bus, rxseq);
- DHD_GLOM(("%s: rxglom returned %d\n", __func__, cnt));
+ BRCMF_GLOM(("%s: rxglom returned %d\n", __func__, cnt));
rxseq += cnt - 1;
rxleft = (rxleft > cnt) ? (rxleft - cnt) : 1;
continue;
@@ -4017,9 +4032,11 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
/* Control frame failures need
retransmission */
if (sdret < 0) {
- DHD_ERROR(("%s: read %d control bytes failed: %d\n",
- __func__,
- rdlen, sdret));
+ BRCMF_ERROR(("%s: read %d "
+ "control bytes "
+ "failed: %d\n",
+ __func__,
+ rdlen, sdret));
/* dhd.rx_ctlerrs is higher */
bus->rxc_errors++;
brcmf_sdbrcm_rxfail(bus, true,
@@ -4031,12 +4048,12 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
} else {
/* Give up on data,
request rtx of events */
- DHD_ERROR(("%s (nextlen): "
- "brcmu_pkt_buf_get_skb "
- "failed:"
- " len %d rdlen %d expected"
- " rxseq %d\n", __func__,
- len, rdlen, rxseq));
+ BRCMF_ERROR(("%s (nextlen): "
+ "brcmu_pkt_buf_get_skb "
+ "failed:"
+ " len %d rdlen %d expected"
+ " rxseq %d\n", __func__,
+ len, rdlen, rxseq));
continue;
}
} else {
@@ -4056,8 +4073,9 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
ASSERT(sdret != -BCME_PENDING);

if (sdret < 0) {
- DHD_ERROR(("%s (nextlen): read %d bytes failed: %d\n",
- __func__, rdlen, sdret));
+ BRCMF_ERROR(("%s (nextlen): read %d"
+ " bytes failed: %d\n",
+ __func__, rdlen, sdret));
brcmu_pkt_buf_free_skb(pkt);
bus->drvr->rx_errors++;
/* Force retry w/normal header read.
@@ -4081,18 +4099,18 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

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

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

/* Validate frame length */
if (len < SDPCM_HDRLEN) {
- DHD_ERROR(("%s (nextlen): HW hdr length "
- "invalid: %d\n", __func__, len));
+ BRCMF_ERROR(("%s (nextlen): HW hdr length "
+ "invalid: %d\n", __func__, len));
brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
}
@@ -4112,11 +4130,11 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
if (len_consistent) {
/* Mismatch, force retry w/normal
header (may be >4K) */
- DHD_ERROR(("%s (nextlen): mismatch, "
- "nextlen %d len %d rnd %d; "
- "expected rxseq %d\n",
- __func__, nextlen,
- len, roundup(len, 16), rxseq));
+ BRCMF_ERROR(("%s (nextlen): mismatch, "
+ "nextlen %d len %d rnd %d; "
+ "expected rxseq %d\n",
+ __func__, nextlen,
+ len, roundup(len, 16), rxseq));
brcmf_sdbrcm_rxfail(bus, true,
bus->bus != SPI_BUS);
brcmf_sdbrcm_pktfree2(bus, pkt);
@@ -4137,8 +4155,9 @@ 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) {
- DHD_INFO(("%s (nextlen): got frame w/nextlen too large" " (%d), seq %d\n",
- __func__, bus->nextlen, seq));
+ BRCMF_INFO(("%s (nextlen): got frame w/nextlen"
+ " too large (%d), seq %d\n",
+ __func__, bus->nextlen, seq));
bus->nextlen = 0;
}

@@ -4161,27 +4180,27 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

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

/* Check window for sanity */
if ((u8) (txmax - bus->tx_seq) > 0x40) {
- DHD_ERROR(("%s: got unlikely tx max %d with "
- "tx_seq %d\n",
- __func__, txmax, bus->tx_seq));
+ BRCMF_ERROR(("%s: got unlikely tx max %d with "
+ "tx_seq %d\n",
+ __func__, txmax, bus->tx_seq));
txmax = bus->tx_seq + 2;
}
bus->tx_max = txmax;

#ifdef BCMDBG
- if (DHD_BYTES_ON() && DHD_DATA_ON()) {
+ if (BRCMF_BYTES_ON() && BRCMF_DATA_ON()) {
printk(KERN_DEBUG "Rx Data:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
rxbuf, len);
- } else if (DHD_HDRS_ON()) {
+ } else if (BRCMF_HDRS_ON()) {
printk(KERN_DEBUG "RxHdr:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
bus->rxhdr, SDPCM_HDRLEN);
@@ -4193,8 +4212,9 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
brcmf_sdbrcm_read_control(bus, rxbuf,
len, doff);
} else {
- DHD_ERROR(("%s (nextlen): readahead on control" " packet %d?\n",
- __func__, seq));
+ BRCMF_ERROR(("%s (nextlen): readahead"
+ " on control packet %d?\n",
+ __func__, seq));
/* Force retry w/normal header read */
bus->nextlen = 0;
brcmf_sdbrcm_rxfail(bus, false, true);
@@ -4204,16 +4224,18 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
}

if ((bus->bus == SPI_BUS) && !bus->usebufpool) {
- DHD_ERROR(("Received %d bytes on %d channel. Running out of " "rx pktbuf's or not yet malloced.\n",
- len, chan));
+ BRCMF_ERROR(("Received %d bytes on %d channel."
+ " Running out of " "rx pktbuf's or"
+ " not yet malloced.\n",
+ len, chan));
continue;
}

/* Validate data offset */
if ((doff < SDPCM_HDRLEN) || (doff > len)) {
- DHD_ERROR(("%s (nextlen): bad data offset %d: "
- "HW len %d min %d\n",
- __func__, doff, len, SDPCM_HDRLEN));
+ BRCMF_ERROR(("%s (nextlen): bad data offset %d:"
+ " HW len %d min %d\n", __func__,
+ doff, len, SDPCM_HDRLEN));
brcmf_sdbrcm_rxfail(bus, false, false);
brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
@@ -4235,14 +4257,14 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
ASSERT(sdret != -BCME_PENDING);

if (sdret < 0) {
- DHD_ERROR(("%s: RXHEADER FAILED: %d\n", __func__,
- sdret));
+ BRCMF_ERROR(("%s: RXHEADER FAILED: %d\n", __func__,
+ sdret));
bus->rx_hdrfail++;
brcmf_sdbrcm_rxfail(bus, true, true);
continue;
}
#ifdef BCMDBG
- if (DHD_BYTES_ON() || DHD_HDRS_ON()) {
+ if (BRCMF_BYTES_ON() || BRCMF_HDRS_ON()) {
printk(KERN_DEBUG "RxHdr:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
bus->rxhdr, SDPCM_HDRLEN);
@@ -4261,8 +4283,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* Validate check bytes */
if ((u16) ~(len ^ check)) {
- DHD_ERROR(("%s: HW hdr err: len/check 0x%04x/0x%04x\n",
- __func__, len, check));
+ BRCMF_ERROR(("%s: HW hdr err: len/check "
+ "0x%04x/0x%04x\n", __func__, len, check));
bus->rx_badhdr++;
brcmf_sdbrcm_rxfail(bus, false, false);
continue;
@@ -4270,8 +4292,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* Validate frame length */
if (len < SDPCM_HDRLEN) {
- DHD_ERROR(("%s: HW hdr length invalid: %d\n",
- __func__, len));
+ BRCMF_ERROR(("%s: HW hdr length invalid: %d\n",
+ __func__, len));
continue;
}

@@ -4283,9 +4305,9 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

/* Validate data offset */
if ((doff < SDPCM_HDRLEN) || (doff > len)) {
- DHD_ERROR(("%s: Bad data offset %d: HW len %d, min %d "
- "seq %d\n",
- __func__, doff, len, SDPCM_HDRLEN, seq));
+ BRCMF_ERROR(("%s: Bad data offset %d: HW len %d,"
+ " min %d seq %d\n", __func__, doff,
+ len, SDPCM_HDRLEN, seq));
bus->rx_badhdr++;
ASSERT(0);
brcmf_sdbrcm_rxfail(bus, false, false);
@@ -4296,9 +4318,9 @@ 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) {
- DHD_INFO(("%s (nextlen): got frame w/nextlen too large "
- "(%d), seq %d\n",
- __func__, bus->nextlen, seq));
+ BRCMF_INFO(("%s (nextlen): got frame w/nextlen too"
+ " large (%d), seq %d\n",
+ __func__, bus->nextlen, seq));
bus->nextlen = 0;
}

@@ -4318,16 +4340,16 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

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

/* Check window for sanity */
if ((u8) (txmax - bus->tx_seq) > 0x40) {
- DHD_ERROR(("%s: unlikely tx max %d with tx_seq %d\n",
- __func__, txmax, bus->tx_seq));
+ BRCMF_ERROR(("%s: unlikely tx max %d with tx_seq %d\n",
+ __func__, txmax, bus->tx_seq));
txmax = bus->tx_seq + 2;
}
bus->tx_max = txmax;
@@ -4363,8 +4385,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

if ((rdlen + firstread) > MAX_RX_DATASZ) {
/* Too long -- skip this frame */
- DHD_ERROR(("%s: too long: len %d rdlen %d\n",
- __func__, len, rdlen));
+ BRCMF_ERROR(("%s: too long: len %d rdlen %d\n",
+ __func__, len, rdlen));
bus->drvr->rx_errors++;
bus->rx_toolong++;
brcmf_sdbrcm_rxfail(bus, false, false);
@@ -4374,8 +4396,9 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
pkt = brcmu_pkt_buf_get_skb(rdlen + firstread + BRCMF_SDALIGN);
if (!pkt) {
/* Give up on data, request rtx of events */
- DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed: rdlen %d"
- " chan %d\n", __func__, rdlen, chan));
+ BRCMF_ERROR(("%s: brcmu_pkt_buf_get_skb failed:"
+ " rdlen %d chan %d\n", __func__, rdlen,
+ chan));
bus->drvr->rx_dropped++;
brcmf_sdbrcm_rxfail(bus, false, RETRYCHAN(chan));
continue;
@@ -4397,13 +4420,11 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
ASSERT(sdret != -BCME_PENDING);

if (sdret < 0) {
- DHD_ERROR(("%s: read %d %s bytes failed: %d\n",
- __func__, rdlen,
- ((chan ==
- SDPCM_EVENT_CHANNEL) ? "event" : ((chan ==
- SDPCM_DATA_CHANNEL)
- ? "data" : "test")),
- sdret));
+ BRCMF_ERROR(("%s: read %d %s bytes failed: %d\n",
+ __func__, rdlen,
+ ((chan == SDPCM_EVENT_CHANNEL) ? "event"
+ : ((chan == SDPCM_DATA_CHANNEL) ? "data"
+ : "test")), sdret));
brcmu_pkt_buf_free_skb(pkt);
bus->drvr->rx_errors++;
brcmf_sdbrcm_rxfail(bus, true, RETRYCHAN(chan));
@@ -4415,7 +4436,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
memcpy(pkt->data, bus->rxhdr, firstread);

#ifdef BCMDBG
- if (DHD_BYTES_ON() && DHD_DATA_ON()) {
+ if (BRCMF_BYTES_ON() && BRCMF_DATA_ON()) {
printk(KERN_DEBUG "Rx Data:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
pkt->data, len);
@@ -4426,10 +4447,10 @@ deliver:
/* Save superframe descriptor and allocate packet frame */
if (chan == SDPCM_GLOM_CHANNEL) {
if (SDPCM_GLOMDESC(&bus->rxhdr[SDPCM_FRAMETAG_LEN])) {
- DHD_GLOM(("%s: glom descriptor, %d bytes:\n",
- __func__, len));
+ BRCMF_GLOM(("%s: glom descriptor, %d bytes:\n",
+ __func__, len));
#ifdef BCMDBG
- if (DHD_GLOM_ON()) {
+ if (BRCMF_GLOM_ON()) {
printk(KERN_DEBUG "Glom Data:\n");
print_hex_dump_bytes("",
DUMP_PREFIX_OFFSET,
@@ -4441,8 +4462,8 @@ deliver:
skb_pull(pkt, SDPCM_HDRLEN);
bus->glomd = pkt;
} else {
- DHD_ERROR(("%s: glom superframe w/o "
- "descriptor!\n", __func__));
+ BRCMF_ERROR(("%s: glom superframe w/o "
+ "descriptor!\n", __func__));
brcmf_sdbrcm_rxfail(bus, false, false);
}
continue;
@@ -4464,7 +4485,7 @@ deliver:
brcmu_pkt_buf_free_skb(pkt);
continue;
} else if (brcmf_proto_hdrpull(bus->drvr, &ifidx, pkt) != 0) {
- DHD_ERROR(("%s: rx protocol error\n", __func__));
+ BRCMF_ERROR(("%s: rx protocol error\n", __func__));
brcmu_pkt_buf_free_skb(pkt);
bus->drvr->rx_errors++;
continue;
@@ -4479,11 +4500,11 @@ deliver:
#ifdef BCMDBG
/* Message if we hit the limit */
if (!rxleft && !sdtest)
- DHD_DATA(("%s: hit rx limit of %d frames\n", __func__,
- maxframes));
+ BRCMF_DATA(("%s: hit rx limit of %d frames\n", __func__,
+ maxframes));
else
#endif /* BCMDBG */
- DHD_DATA(("%s: processed %d frames\n", __func__, rxcount));
+ BRCMF_DATA(("%s: processed %d frames\n", __func__, rxcount));
/* Back off rxseq if awaiting rtx, update rx_seq */
if (bus->rxskip)
rxseq--;
@@ -4499,7 +4520,7 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
u8 fcbits;
uint retries = 0;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Read mailbox data and ack that we did so */
r_sdreg32(bus, &hmb_data,
@@ -4512,10 +4533,10 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)

/* Dongle recomposed rx frames, accept them again */
if (hmb_data & HMB_DATA_NAKHANDLED) {
- DHD_INFO(("Dongle reports NAK handled, expect rtx of %d\n",
- bus->rx_seq));
+ BRCMF_INFO(("Dongle reports NAK handled, expect rtx of %d\n",
+ bus->rx_seq));
if (!bus->rxskip)
- DHD_ERROR(("%s: unexpected NAKHANDLED!\n", __func__));
+ BRCMF_ERROR(("%s: unexpected NAKHANDLED!\n", __func__));

bus->rxskip = false;
intstatus |= I_HMB_FRAME_IND;
@@ -4529,12 +4550,12 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
(hmb_data & HMB_DATA_VERSION_MASK) >>
HMB_DATA_VERSION_SHIFT;
if (bus->sdpcm_ver != SDPCM_PROT_VERSION)
- DHD_ERROR(("Version mismatch, dongle reports %d, "
- "expecting %d\n",
- bus->sdpcm_ver, SDPCM_PROT_VERSION));
+ BRCMF_ERROR(("Version mismatch, dongle reports %d, "
+ "expecting %d\n",
+ bus->sdpcm_ver, SDPCM_PROT_VERSION));
else
- DHD_INFO(("Dongle ready, protocol version %d\n",
- bus->sdpcm_ver));
+ BRCMF_INFO(("Dongle ready, protocol version %d\n",
+ bus->sdpcm_ver));
}

/*
@@ -4562,7 +4583,8 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
HMB_DATA_FC |
HMB_DATA_FWREADY |
HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK)) {
- DHD_ERROR(("Unknown mailbox data content: 0x%02x\n", hmb_data));
+ BRCMF_ERROR(("Unknown mailbox data content: 0x%02x\n",
+ hmb_data));
}

return intstatus;
@@ -4579,7 +4601,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
bool rxdone = true; /* Flag for no more read data */
bool resched = false; /* Flag indicating resched wanted */

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Start with leftover status bits */
intstatus = bus->intstatus;
@@ -4596,8 +4618,8 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
devctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
if (err) {
- DHD_ERROR(("%s: error reading DEVCTL: %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: error reading DEVCTL: %d\n",
+ __func__, err));
bus->drvr->busstate = BRCMF_BUS_DOWN;
} else {
ASSERT(devctl & SBSDIO_DEVCTL_CA_INT_ONLY);
@@ -4608,28 +4630,28 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
clkctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (err) {
- DHD_ERROR(("%s: error reading CSR: %d\n", __func__,
- err));
+ BRCMF_ERROR(("%s: error reading CSR: %d\n", __func__,
+ err));
bus->drvr->busstate = BRCMF_BUS_DOWN;
}

- DHD_INFO(("DPC: PENDING, devctl 0x%02x clkctl 0x%02x\n", devctl,
- clkctl));
+ BRCMF_INFO(("DPC: PENDING, devctl 0x%02x clkctl 0x%02x\n",
+ devctl, clkctl));

if (SBSDIO_HTAV(clkctl)) {
devctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
if (err) {
- DHD_ERROR(("%s: error reading DEVCTL: %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: error reading DEVCTL: %d\n",
+ __func__, err));
bus->drvr->busstate = BRCMF_BUS_DOWN;
}
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, devctl, &err);
if (err) {
- DHD_ERROR(("%s: error writing DEVCTL: %d\n",
- __func__, err));
+ BRCMF_ERROR(("%s: error writing DEVCTL: %d\n",
+ __func__, err));
bus->drvr->busstate = BRCMF_BUS_DOWN;
}
bus->clkstate = CLK_AVAIL;
@@ -4692,23 +4714,23 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)

/* Generally don't ask for these, can get CRC errors... */
if (intstatus & I_WR_OOSYNC) {
- DHD_ERROR(("Dongle reports WR_OOSYNC\n"));
+ BRCMF_ERROR(("Dongle reports WR_OOSYNC\n"));
intstatus &= ~I_WR_OOSYNC;
}

if (intstatus & I_RD_OOSYNC) {
- DHD_ERROR(("Dongle reports RD_OOSYNC\n"));
+ BRCMF_ERROR(("Dongle reports RD_OOSYNC\n"));
intstatus &= ~I_RD_OOSYNC;
}

if (intstatus & I_SBINT) {
- DHD_ERROR(("Dongle reports SBINT\n"));
+ BRCMF_ERROR(("Dongle reports SBINT\n"));
intstatus &= ~I_SBINT;
}

/* Would be active due to wake-wlan in gSPI */
if (intstatus & I_CHIPACTIVE) {
- DHD_INFO(("Dongle reports CHIPACTIVE\n"));
+ BRCMF_INFO(("Dongle reports CHIPACTIVE\n"));
intstatus &= ~I_CHIPACTIVE;
}

@@ -4733,8 +4755,8 @@ clkwait:
* (Unless register access seems hosed, as we may not be able to ACK...)
*/
if (bus->intr && bus->intdis && !brcmf_sdcard_regfail(card)) {
- DHD_INTR(("%s: enable SDIO interrupts, rxdone %d framecnt %d\n",
- __func__, rxdone, framecnt));
+ BRCMF_INTR(("%s: enable SDIO interrupts, rxdone %d"
+ " framecnt %d\n", __func__, rxdone, framecnt));
bus->intdis = false;
brcmf_sdcard_intr_enable(card);
}
@@ -4751,8 +4773,8 @@ clkwait:
if (ret < 0) {
/* On failure, abort the command and
terminate the frame */
- DHD_INFO(("%s: sdio error %d, abort command and "
- "terminate frame.\n", __func__, ret));
+ BRCMF_INFO(("%s: sdio error %d, abort command and "
+ "terminate frame.\n", __func__, ret));
bus->tx_sderrs++;

brcmf_sdcard_abort(card, SDIO_FUNC_2);
@@ -4779,7 +4801,7 @@ clkwait:
if (ret == 0)
bus->tx_seq = (bus->tx_seq + 1) % SDPCM_SEQUENCE_WRAP;

- DHD_INFO(("Return_dpc value is : %d\n", ret));
+ BRCMF_INFO(("Return_dpc value is : %d\n", ret));
bus->ctrl_frame_stat = false;
brcmf_sdbrcm_wait_event_wakeup(bus);
}
@@ -4798,14 +4820,14 @@ clkwait:
no resched or interrupts */
if ((bus->drvr->busstate == BRCMF_BUS_DOWN) ||
brcmf_sdcard_regfail(card)) {
- DHD_ERROR(("%s: failed backplane access over SDIO, halting "
- "operation %d\n", __func__,
- brcmf_sdcard_regfail(card)));
+ BRCMF_ERROR(("%s: failed backplane access over SDIO, halting "
+ "operation %d\n", __func__,
+ brcmf_sdcard_regfail(card)));
bus->drvr->busstate = BRCMF_BUS_DOWN;
bus->intstatus = 0;
} else if (bus->clkstate == CLK_PENDING) {
- DHD_INFO(("%s: rescheduled due to CLK_PENDING awaiting "
- "I_CHIPACTIVE interrupt\n", __func__));
+ BRCMF_INFO(("%s: rescheduled due to CLK_PENDING awaiting "
+ "I_CHIPACTIVE interrupt\n", __func__));
resched = true;
} else if (bus->intstatus || bus->ipend ||
(!bus->fcstate && brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol)
@@ -4832,16 +4854,16 @@ void brcmf_sdbrcm_isr(void *arg)
struct brcmf_bus *bus = (struct brcmf_bus *) arg;
struct brcmf_sdio_card *card;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (!bus) {
- DHD_ERROR(("%s : bus is null pointer , exit\n", __func__));
+ BRCMF_ERROR(("%s : bus is null pointer , exit\n", __func__));
return;
}
card = bus->card;

if (bus->drvr->busstate == BRCMF_BUS_DOWN) {
- DHD_ERROR(("%s : bus is down. we have nothing to do\n",
+ BRCMF_ERROR(("%s : bus is down. we have nothing to do\n",
__func__));
return;
}
@@ -4851,21 +4873,21 @@ void brcmf_sdbrcm_isr(void *arg)

/* Shouldn't get this interrupt if we're sleeping? */
if (bus->sleeping) {
- DHD_ERROR(("INTERRUPT WHILE SLEEPING??\n"));
+ BRCMF_ERROR(("INTERRUPT WHILE SLEEPING??\n"));
return;
}

/* Disable additional interrupts (is this needed now)? */
if (bus->intr)
- DHD_INTR(("%s: disable SDIO interrupts\n", __func__));
+ BRCMF_INTR(("%s: disable SDIO interrupts\n", __func__));
else
- DHD_ERROR(("brcmf_sdbrcm_isr() w/o interrupt configured!\n"));
+ BRCMF_ERROR(("brcmf_sdbrcm_isr() w/o interrupt configured!\n"));

brcmf_sdcard_intr_disable(card);
bus->intdis = true;

#if defined(SDIO_ISR_THREAD)
- DHD_TRACE(("Calling brcmf_sdbrcm_dpc() from %s\n", __func__));
+ BRCMF_TRACE(("Calling brcmf_sdbrcm_dpc() from %s\n", __func__));
while (brcmf_sdbrcm_dpc(bus))
;
#else
@@ -4936,8 +4958,8 @@ static void brcmf_sdbrcm_pktgen(struct brcmf_bus *bus)
len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + BRCMF_SDALIGN,
true);
if (!pkt) {
- DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n",
- __func__));
+ BRCMF_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n",
+ __func__));
break;
}
PKTALIGN(pkt, (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN),
@@ -4962,8 +4984,8 @@ static void brcmf_sdbrcm_pktgen(struct brcmf_bus *bus)
break;

default:
- DHD_ERROR(("Unrecognized pktgen mode %d\n",
- bus->pktgen_mode));
+ BRCMF_ERROR(("Unrecognized pktgen mode %d\n",
+ bus->pktgen_mode));
brcmu_pkt_buf_free_skb(pkt, true);
bus->pktgen_count = 0;
return;
@@ -4980,7 +5002,7 @@ static void brcmf_sdbrcm_pktgen(struct brcmf_bus *bus)
SDPCM_TEST_FILL(fillbyte, (u8) bus->pktgen_sent);

#ifdef BCMDBG
- if (DHD_BYTES_ON() && DHD_DATA_ON()) {
+ if (BRCMF_BYTES_ON() && BRCMF_DATA_ON()) {
data = (u8 *) (pkt->data) + SDPCM_HDRLEN;
printk(KERN_DEBUG "brcmf_sdbrcm_pktgen: Tx Data:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, data,
@@ -5016,7 +5038,7 @@ static void brcmf_sdbrcm_sdtest_set(struct brcmf_bus *bus, bool start)
pkt = brcmu_pkt_buf_get_skb(SDPCM_HDRLEN + SDPCM_TEST_HDRLEN +
BRCMF_SDALIGN, true);
if (!pkt) {
- DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n", __func__));
+ BRCMF_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n", __func__));
return;
}
PKTALIGN(pkt, (SDPCM_HDRLEN + SDPCM_TEST_HDRLEN), BRCMF_SDALIGN);
@@ -5047,8 +5069,8 @@ brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, struct sk_buff *pkt, uint seq)
/* Check for min length */
pktlen = pkt->len;
if (pktlen < SDPCM_TEST_HDRLEN) {
- DHD_ERROR(("brcmf_sdbrcm_checkdied: toss runt frame, pktlen "
- "%d\n", pktlen));
+ BRCMF_ERROR(("brcmf_sdbrcm_checkdied: toss runt frame, pktlen "
+ "%d\n", pktlen));
brcmu_pkt_buf_free_skb(pkt, false);
return;
}
@@ -5064,10 +5086,10 @@ brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, struct sk_buff *pkt, uint seq)
if (cmd == SDPCM_TEST_DISCARD || cmd == SDPCM_TEST_ECHOREQ
|| cmd == SDPCM_TEST_ECHORSP) {
if (pktlen != len + SDPCM_TEST_HDRLEN) {
- DHD_ERROR(("brcmf_sdbrcm_checkdied: frame length "
- "mismatch, pktlen %d seq %d" " cmd %d extra %d "
- "len %d\n",
- pktlen, seq, cmd, extra, len));
+ BRCMF_ERROR(("brcmf_sdbrcm_checkdied: frame length "
+ "mismatch, pktlen %d seq %d"
+ " cmd %d extra %d len %d\n",
+ pktlen, seq, cmd, extra, len));
brcmu_pkt_buf_free_skb(pkt, false);
return;
}
@@ -5097,12 +5119,13 @@ brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, struct sk_buff *pkt, uint seq)

for (offset = 0; offset < len; offset++, data++) {
if (*data != SDPCM_TEST_FILL(offset, extra)) {
- DHD_ERROR(("brcmf_sdbrcm_checkdied: echo data "
- "mismatch: " "offset %d (len %d) "
- "expect 0x%02x rcvd 0x%02x\n",
- offset, len,
- SDPCM_TEST_FILL(offset, extra),
- *data));
+ BRCMF_ERROR(("brcmf_sdbrcm_checkdied: echo"
+ " data mismatch: "
+ "offset %d (len %d) "
+ "expect 0x%02x rcvd 0x%02x\n",
+ offset, len,
+ SDPCM_TEST_FILL(offset, extra),
+ *data));
break;
}
}
@@ -5118,9 +5141,9 @@ brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, struct sk_buff *pkt, uint seq)
case SDPCM_TEST_BURST:
case SDPCM_TEST_SEND:
default:
- DHD_INFO(("brcmf_sdbrcm_checkdied: unsupported or unknown "
- "command, pktlen %d seq %d" " cmd %d extra %d len %d\n",
- pktlen, seq, cmd, extra, len));
+ BRCMF_INFO(("brcmf_sdbrcm_checkdied: unsupported or unknown "
+ "command, pktlen %d seq %d" " cmd %d extra %d"
+ " len %d\n", pktlen, seq, cmd, extra, len));
brcmu_pkt_buf_free_skb(pkt, false);
break;
}
@@ -5140,7 +5163,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
{
struct brcmf_bus *bus;

- DHD_TIMER(("%s: Enter\n", __func__));
+ BRCMF_TIMER(("%s: Enter\n", __func__));

bus = drvr->bus;

@@ -5338,8 +5361,8 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,

brcmf_c_init();

- DHD_TRACE(("%s: Enter\n", __func__));
- DHD_INFO(("%s: venid 0x%04x devid 0x%04x\n", __func__, venid, devid));
+ BRCMF_TRACE(("%s: Enter\n", __func__));
+ BRCMF_INFO(("%s: venid 0x%04x devid 0x%04x\n", __func__, venid, devid));

/* We make assumptions about address window mappings */
ASSERT(regsva == SI_ENUM_BASE);
@@ -5355,7 +5378,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
case PCI_VENDOR_ID_BROADCOM:
break;
default:
- DHD_ERROR(("%s: unknown vendor: 0x%04x\n", __func__, venid));
+ BRCMF_ERROR(("%s: unknown vendor: 0x%04x\n", __func__, venid));
return NULL;
}

@@ -5364,34 +5387,35 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
case BCM4325_D11DUAL_ID: /* 4325 802.11a/g id */
case BCM4325_D11G_ID: /* 4325 802.11g 2.4Ghz band id */
case BCM4325_D11A_ID: /* 4325 802.11a 5Ghz band id */
- DHD_INFO(("%s: found 4325 Dongle\n", __func__));
+ BRCMF_INFO(("%s: found 4325 Dongle\n", __func__));
break;
case BCM4329_D11NDUAL_ID: /* 4329 802.11n dualband device */
case BCM4329_D11N2G_ID: /* 4329 802.11n 2.4G device */
case BCM4329_D11N5G_ID: /* 4329 802.11n 5G device */
case 0x4329:
- DHD_INFO(("%s: found 4329 Dongle\n", __func__));
+ BRCMF_INFO(("%s: found 4329 Dongle\n", __func__));
break;
case BCM4319_D11N_ID: /* 4319 802.11n id */
case BCM4319_D11N2G_ID: /* 4319 802.11n2g id */
case BCM4319_D11N5G_ID: /* 4319 802.11n5g id */
- DHD_INFO(("%s: found 4319 Dongle\n", __func__));
+ BRCMF_INFO(("%s: found 4319 Dongle\n", __func__));
break;
case 0:
- DHD_INFO(("%s: allow device id 0, will check chip internals\n",
- __func__));
+ BRCMF_INFO(("%s: allow device id 0, will check chip"
+ " internals\n", __func__));
break;

default:
- DHD_ERROR(("%s: skipping 0x%04x/0x%04x, not a dongle\n",
- __func__, venid, devid));
+ BRCMF_ERROR(("%s: skipping 0x%04x/0x%04x, not a dongle\n",
+ __func__, venid, devid));
return NULL;
}

/* Allocate private bus interface state */
bus = kzalloc(sizeof(struct brcmf_bus), GFP_ATOMIC);
if (!bus) {
- DHD_ERROR(("%s: kmalloc of struct dhd_bus failed\n", __func__));
+ BRCMF_ERROR(("%s: kmalloc of struct dhd_bus failed\n",
+ __func__));
goto fail;
}
bus->card = card;
@@ -5403,7 +5427,8 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,

/* attempt to attach to the dongle */
if (!(brcmf_sdbrcm_probe_attach(bus, card, regsva, devid))) {
- DHD_ERROR(("%s: brcmf_sdbrcm_probe_attach failed\n", __func__));
+ BRCMF_ERROR(("%s: brcmf_sdbrcm_probe_attach failed\n",
+ __func__));
goto fail;
}

@@ -5457,46 +5482,48 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
/* Attach to the brcmf/OS/network interface */
bus->drvr = brcmf_attach(bus, SDPCM_RESERVE);
if (!bus->drvr) {
- DHD_ERROR(("%s: brcmf_attach failed\n", __func__));
+ BRCMF_ERROR(("%s: brcmf_attach failed\n", __func__));
goto fail;
}

/* Allocate buffers */
if (!(brcmf_sdbrcm_probe_malloc(bus, card))) {
- DHD_ERROR(("%s: brcmf_sdbrcm_probe_malloc failed\n", __func__));
+ BRCMF_ERROR(("%s: brcmf_sdbrcm_probe_malloc failed\n",
+ __func__));
goto fail;
}

if (!(brcmf_sdbrcm_probe_init(bus, card))) {
- DHD_ERROR(("%s: brcmf_sdbrcm_probe_init failed\n", __func__));
+ BRCMF_ERROR(("%s: brcmf_sdbrcm_probe_init failed\n", __func__));
goto fail;
}

/* Register interrupt callback, but mask it (not operational yet). */
- DHD_INTR(("%s: disable SDIO interrupts (not interested yet)\n",
- __func__));
+ BRCMF_INTR(("%s: disable SDIO interrupts (not interested yet)\n",
+ __func__));
brcmf_sdcard_intr_disable(card);
ret = brcmf_sdcard_intr_reg(card, brcmf_sdbrcm_isr, bus);
if (ret != 0) {
- DHD_ERROR(("%s: FAILED: sdcard_intr_reg returned %d\n",
- __func__, ret));
+ BRCMF_ERROR(("%s: FAILED: sdcard_intr_reg returned %d\n",
+ __func__, ret));
goto fail;
}
- DHD_INTR(("%s: registered SDIO interrupt function ok\n", __func__));
+ BRCMF_INTR(("%s: registered SDIO interrupt function ok\n", __func__));

- DHD_INFO(("%s: completed!!\n", __func__));
+ BRCMF_INFO(("%s: completed!!\n", __func__));

/* if firmware path present try to download and bring up bus */
ret = brcmf_bus_start(bus->drvr);
if (ret != 0) {
if (ret == -ENOLINK) {
- DHD_ERROR(("%s: dongle is not responding\n", __func__));
+ BRCMF_ERROR(("%s: dongle is not responding\n",
+ __func__));
goto fail;
}
}
/* Ok, have the per-port tell the stack we're open for business */
if (brcmf_net_attach(bus->drvr, 0) != 0) {
- DHD_ERROR(("%s: Net attach failed!!\n", __func__));
+ BRCMF_ERROR(("%s: Net attach failed!!\n", __func__));
goto fail;
}

@@ -5518,7 +5545,8 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva,

/* Return the window to backplane enumeration space for core access */
if (brcmf_sdbrcm_set_siaddr_window(bus, SI_ENUM_BASE))
- DHD_ERROR(("%s: FAILED to return to SI_ENUM_BASE\n", __func__));
+ BRCMF_ERROR(("%s: FAILED to return to SI_ENUM_BASE\n",
+ __func__));

#ifdef BCMDBG
printk(KERN_DEBUG "F1 signature read @0x18000000=0x%4x\n",
@@ -5539,20 +5567,21 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva,
SBSDIO_FUNC1_CHIPCLKCSR, &err);

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

if (brcmf_sdbrcm_chip_attach(bus, regsva)) {
- DHD_ERROR(("%s: brcmf_sdbrcm_chip_attach failed!\n", __func__));
+ BRCMF_ERROR(("%s: brcmf_sdbrcm_chip_attach failed!\n",
+ __func__));
goto fail;
}

if (!brcmf_sdbrcm_chipmatch((u16) bus->ci->chip)) {
- DHD_ERROR(("%s: unsupported chip: 0x%04x\n",
- __func__, bus->ci->chip));
+ BRCMF_ERROR(("%s: unsupported chip: 0x%04x\n",
+ __func__, bus->ci->chip));
goto fail;
}

@@ -5564,16 +5593,16 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva,
CORE_SB(bus->ci->armcorebase, sbidhigh), 4);
bus->orig_ramsize = bus->ci->ramsize;
if (!(bus->orig_ramsize)) {
- DHD_ERROR(("%s: failed to find SOCRAM memory!\n",
- __func__));
+ BRCMF_ERROR(("%s: failed to find SOCRAM memory!\n",
+ __func__));
goto fail;
}
bus->ramsize = bus->orig_ramsize;
if (brcmf_dongle_memsize)
brcmf_sdbrcm_setmemsize(bus, brcmf_dongle_memsize);

- DHD_ERROR(("DHD: dongle ram size is set to %d(orig %d)\n",
- bus->ramsize, bus->orig_ramsize));
+ BRCMF_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 */
@@ -5601,7 +5630,7 @@ fail:

static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus, void *card)
{
- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (bus->drvr->maxctl) {
bus->rxblen =
@@ -5609,8 +5638,8 @@ static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus, void *card)
ALIGNMENT) + BRCMF_SDALIGN;
bus->rxbuf = kmalloc(bus->rxblen, GFP_ATOMIC);
if (!(bus->rxbuf)) {
- DHD_ERROR(("%s: kmalloc of %d-byte rxbuf failed\n",
- __func__, bus->rxblen));
+ BRCMF_ERROR(("%s: kmalloc of %d-byte rxbuf failed\n",
+ __func__, bus->rxblen));
goto fail;
}
}
@@ -5618,8 +5647,8 @@ static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus, void *card)
/* Allocate buffer to receive glomed packet */
bus->databuf = kmalloc(MAX_DATA_BUF, GFP_ATOMIC);
if (!(bus->databuf)) {
- DHD_ERROR(("%s: kmalloc of %d-byte databuf failed\n",
- __func__, MAX_DATA_BUF));
+ BRCMF_ERROR(("%s: kmalloc of %d-byte databuf failed\n",
+ __func__, MAX_DATA_BUF));
/* release rxbuf which was already located as above */
if (!bus->rxblen)
kfree(bus->rxbuf);
@@ -5643,7 +5672,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card)
{
s32 fnum;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

#ifdef SDTEST
brcmf_sdbrcm_pktgen_init(bus);
@@ -5671,10 +5700,10 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card)
if (brcmf_sdcard_iovar_op(card, "sd_blocksize", &fnum, sizeof(s32),
&bus->blocksize, sizeof(s32), false) != 0) {
bus->blocksize = 0;
- DHD_ERROR(("%s: fail on %s get\n", __func__, "sd_blocksize"));
+ BRCMF_ERROR(("%s: fail on %s get\n", __func__, "sd_blocksize"));
} else {
- DHD_INFO(("%s: Initial value for %s is %d\n",
- __func__, "sd_blocksize", bus->blocksize));
+ BRCMF_INFO(("%s: Initial value for %s is %d\n",
+ __func__, "sd_blocksize", bus->blocksize));
}
bus->roundup = min(max_roundup, bus->blocksize);

@@ -5685,9 +5714,9 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card)
false) != 0) {
bus->sd_rxchain = false;
} else {
- DHD_INFO(("%s: bus module (through sdiocard API) %s chaining\n",
- __func__,
- (bus->sd_rxchain ? "supports" : "does not support")));
+ BRCMF_INFO(("%s: bus module (through sdiocard API) %s"
+ " chaining\n", __func__, bus->sd_rxchain
+ ? "supports" : "does not support"));
}
bus->use_rxchain = (bool) bus->sd_rxchain;

@@ -5712,7 +5741,7 @@ brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus, void *card)
/* Detach and free everything */
static void brcmf_sdbrcm_release(struct brcmf_bus *bus)
{
- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (bus) {
/* De-register interrupt handler */
@@ -5730,12 +5759,12 @@ static void brcmf_sdbrcm_release(struct brcmf_bus *bus)
kfree(bus);
}

- DHD_TRACE(("%s: Disconnected\n", __func__));
+ BRCMF_TRACE(("%s: Disconnected\n", __func__));
}

static void brcmf_sdbrcm_release_malloc(struct brcmf_bus *bus)
{
- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (bus->drvr && bus->drvr->dongle_reset)
return;
@@ -5750,7 +5779,7 @@ static void brcmf_sdbrcm_release_malloc(struct brcmf_bus *bus)

static void brcmf_sdbrcm_release_dongle(struct brcmf_bus *bus)
{
- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (bus->drvr && bus->drvr->dongle_reset)
return;
@@ -5764,21 +5793,21 @@ static void brcmf_sdbrcm_release_dongle(struct brcmf_bus *bus)
bus->vars = NULL;
}

- DHD_TRACE(("%s: Disconnected\n", __func__));
+ BRCMF_TRACE(("%s: Disconnected\n", __func__));
}

static void brcmf_sdbrcm_disconnect(void *ptr)
{
struct brcmf_bus *bus = (struct brcmf_bus *)ptr;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

if (bus) {
ASSERT(bus->drvr);
brcmf_sdbrcm_release(bus);
}

- DHD_TRACE(("%s: Disconnected\n", __func__));
+ BRCMF_TRACE(("%s: Disconnected\n", __func__));
}

/* Register/Unregister functions are called by the main DHD entry
@@ -5793,7 +5822,7 @@ static struct brcmf_sdioh_driver brcmf_sdio = {

int brcmf_bus_register(void)
{
- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* Sanity check on the module parameters */
do {
@@ -5806,7 +5835,7 @@ int brcmf_bus_register(void)
&& brcmf_deferred_tx)
break;

- DHD_ERROR(("Invalid module parameters.\n"));
+ BRCMF_ERROR(("Invalid module parameters.\n"));
return -EINVAL;
} while (0);

@@ -5815,7 +5844,7 @@ int brcmf_bus_register(void)

void brcmf_bus_unregister(void)
{
- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

brcmf_sdio_unregister();
}
@@ -5827,21 +5856,22 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus)
u8 *memblock = NULL, *memptr;
int ret;

- DHD_INFO(("%s: Enter\n", __func__));
+ BRCMF_INFO(("%s: Enter\n", __func__));

bus->fw_name = BCM4329_FW_NAME;
ret = request_firmware(&bus->firmware, bus->fw_name,
&gInstance->func[2]->dev);
if (ret) {
- DHD_ERROR(("%s: Fail to request firmware %d\n", __func__, ret));
+ BRCMF_ERROR(("%s: Fail to request firmware %d\n",
+ __func__, ret));
return ret;
}
bus->fw_ptr = 0;

memptr = memblock = kmalloc(MEMBLOCK + BRCMF_SDALIGN, GFP_ATOMIC);
if (memblock == NULL) {
- DHD_ERROR(("%s: Failed to allocate memory %d bytes\n",
- __func__, MEMBLOCK));
+ BRCMF_ERROR(("%s: Failed to allocate memory %d bytes\n",
+ __func__, MEMBLOCK));
ret = -ENOMEM;
goto err;
}
@@ -5854,8 +5884,9 @@ 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) {
- DHD_ERROR(("%s: error %d on writing %d membytes at "
- "0x%08x\n", __func__, ret, MEMBLOCK, offset));
+ BRCMF_ERROR(("%s: error %d on writing %d membytes at "
+ "0x%08x\n", __func__, ret, MEMBLOCK,
+ offset));
goto err;
}

@@ -5933,15 +5964,15 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus)
ret = request_firmware(&bus->firmware, bus->nv_name,
&gInstance->func[2]->dev);
if (ret) {
- DHD_ERROR(("%s: Fail to request nvram %d\n", __func__, ret));
+ BRCMF_ERROR(("%s: Fail to request nvram %d\n", __func__, ret));
return ret;
}
bus->fw_ptr = 0;

memblock = kmalloc(MEMBLOCK, GFP_ATOMIC);
if (memblock == NULL) {
- DHD_ERROR(("%s: Failed to allocate memory %d bytes\n",
- __func__, MEMBLOCK));
+ BRCMF_ERROR(("%s: Failed to allocate memory %d bytes\n",
+ __func__, MEMBLOCK));
ret = -ENOMEM;
goto err;
}
@@ -5957,11 +5988,11 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus)
if (len)
ret = brcmf_sdbrcm_downloadvars(bus, memblock, len + 1);
if (ret)
- DHD_ERROR(("%s: error downloading vars: %d\n",
- __func__, ret));
+ BRCMF_ERROR(("%s: error downloading vars: %d\n",
+ __func__, ret));
} else {
- DHD_ERROR(("%s: error reading nvram file: %d\n",
- __func__, len));
+ BRCMF_ERROR(("%s: error reading nvram file: %d\n",
+ __func__, len));
ret = -EIO;
}

@@ -5980,27 +6011,28 @@ static int _brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus)

/* Keep arm in reset */
if (brcmf_sdbrcm_download_state(bus, true)) {
- DHD_ERROR(("%s: error placing ARM core in reset\n", __func__));
+ BRCMF_ERROR(("%s: error placing ARM core in reset\n",
+ __func__));
goto err;
}

/* External image takes precedence if specified */
if (brcmf_sdbrcm_download_code_file(bus)) {
- DHD_ERROR(("%s: dongle image file download failed\n",
- __func__));
+ BRCMF_ERROR(("%s: dongle image file download failed\n",
+ __func__));
goto err;
}

/* External nvram takes precedence if specified */
if (brcmf_sdbrcm_download_nvram(bus)) {
- DHD_ERROR(("%s: dongle nvram file download failed\n",
- __func__));
+ BRCMF_ERROR(("%s: dongle nvram file download failed\n",
+ __func__));
}

/* Take arm out of reset */
if (brcmf_sdbrcm_download_state(bus, false)) {
- DHD_ERROR(("%s: error getting out of ARM core reset\n",
- __func__));
+ BRCMF_ERROR(("%s: error getting out of ARM core reset\n",
+ __func__));
goto err;
}

@@ -6045,14 +6077,14 @@ int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
bus->drvr->dongle_reset = true;
bus->drvr->up = false;

- DHD_TRACE(("%s: WLAN OFF DONE\n", __func__));
+ BRCMF_TRACE(("%s: WLAN OFF DONE\n", __func__));
/* App can now remove power from device */
} else
bcmerror = -EIO;
} else {
/* App must have restored power to device before calling */

- DHD_TRACE(("\n\n%s: == WLAN ON ==\n", __func__));
+ BRCMF_TRACE(("\n\n%s: == WLAN ON ==\n", __func__));

if (bus->drvr->dongle_reset) {
/* Turn on WLAN */
@@ -6069,16 +6101,16 @@ int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
bus->drvr->dongle_reset = false;
bus->drvr->up = true;

- DHD_TRACE(("%s: WLAN ON DONE\n",
- __func__));
+ BRCMF_TRACE(("%s: WLAN ON DONE\n",
+ __func__));
} else
bcmerror = -EIO;
} else
bcmerror = -EIO;
} else {
bcmerror = -EISCONN;
- DHD_ERROR(("%s: Set DEVRESET=false invoked when device "
- "is on\n", __func__));
+ BRCMF_ERROR(("%s: Set DEVRESET=false invoked when"
+ " device is on\n", __func__));
bcmerror = -EIO;
}
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
@@ -6104,8 +6136,8 @@ brcmf_sdbrcm_chip_recognition(struct brcmf_sdio_card *card,
ci->chip = regdata & CID_ID_MASK;
ci->chiprev = (regdata & CID_REV_MASK) >> CID_REV_SHIFT;

- DHD_INFO(("%s: chipid=0x%x chiprev=%d\n",
- __func__, ci->chip, ci->chiprev));
+ BRCMF_INFO(("%s: chipid=0x%x chiprev=%d\n",
+ __func__, ci->chip, ci->chiprev));

/* Address of cores for new chips should be added here */
switch (ci->chip) {
@@ -6116,8 +6148,8 @@ brcmf_sdbrcm_chip_recognition(struct brcmf_sdio_card *card,
ci->ramsize = BCM4329_RAMSIZE;
break;
default:
- DHD_ERROR(("%s: chipid 0x%x is not supported\n",
- __func__, ci->chip));
+ BRCMF_ERROR(("%s: chipid 0x%x is not supported\n",
+ __func__, ci->chip));
return -ENODEV;
}

@@ -6134,9 +6166,9 @@ brcmf_sdbrcm_chip_recognition(struct brcmf_sdio_card *card,
ci->buscorerev = SBCOREREV(regdata);
ci->buscoretype = (regdata & SBIDH_CC_MASK) >> SBIDH_CC_SHIFT;

- DHD_INFO(("%s: ccrev=%d, pmurev=%d, buscore rev/type=%d/0x%x\n",
- __func__, ci->ccrev, ci->pmurev,
- ci->buscorerev, ci->buscoretype));
+ BRCMF_INFO(("%s: ccrev=%d, pmurev=%d, buscore rev/type=%d/0x%x\n",
+ __func__, ci->ccrev, ci->pmurev,
+ ci->buscorerev, ci->buscoretype));

/* get chipcommon capabilites */
ci->cccaps = brcmf_sdcard_reg_read(card,
@@ -6177,7 +6209,7 @@ brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio_card *card, u32 corebase)
regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbtmstatehigh), 4);
if (regdata & SBTMH_BUSY)
- DHD_ERROR(("%s: ARM core still busy\n", __func__));
+ BRCMF_ERROR(("%s: ARM core still busy\n", __func__));

regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbidlow), 4);
@@ -6231,12 +6263,12 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
int err;
u8 clkval, clkset;

- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

/* alloc chip_info_t */
ci = kmalloc(sizeof(struct chip_info), GFP_ATOMIC);
if (NULL == ci) {
- DHD_ERROR(("%s: malloc failed!\n", __func__));
+ BRCMF_ERROR(("%s: malloc failed!\n", __func__));
return -ENOMEM;
}

@@ -6248,7 +6280,7 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
clkset, &err);
if (err) {
- DHD_ERROR(("%s: error writing for HT off\n", __func__));
+ BRCMF_ERROR(("%s: error writing for HT off\n", __func__));
goto fail;
}

@@ -6264,8 +6296,8 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
!SBSDIO_ALPAV(clkval)),
PMU_MAX_TRANSITION_DLY);
if (!SBSDIO_ALPAV(clkval)) {
- DHD_ERROR(("%s: timeout on ALPAV wait, clkval 0x%02x\n",
- __func__, clkval));
+ BRCMF_ERROR(("%s: timeout on ALPAV wait,"
+ " clkval 0x%02x\n", __func__, clkval));
err = -EBUSY;
goto fail;
}
@@ -6276,8 +6308,8 @@ brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
clkset, &err);
udelay(65);
} else {
- DHD_ERROR(("%s: ChipClkCSR access: wrote 0x%02x read 0x%02x\n",
- __func__, clkset, clkval));
+ BRCMF_ERROR(("%s: ChipClkCSR access: wrote 0x%02x"
+ " read 0x%02x\n", __func__, clkset, clkval));
err = -EACCES;
goto fail;
}
@@ -6435,10 +6467,10 @@ brcmf_sdbrcm_sdiod_drive_strength_init(struct brcmf_bus *bus, u32 drivestrength)
str_shift = 11;
break;
default:
- DHD_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));
+ BRCMF_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;
}

@@ -6466,15 +6498,15 @@ brcmf_sdbrcm_sdiod_drive_strength_init(struct brcmf_bus *bus, u32 drivestrength)
CORE_CC_REG(bus->ci->cccorebase, chipcontrol_addr),
4, cc_data_temp);

- DHD_INFO(("SDIO: %dmA drive strength selected, set to 0x%08x\n",
- drivestrength, cc_data_temp));
+ BRCMF_INFO(("SDIO: %dmA drive strength selected, "
+ "set to 0x%08x\n", drivestrength, cc_data_temp));
}
}

static void
brcmf_sdbrcm_chip_detach(struct brcmf_bus *bus)
{
- DHD_TRACE(("%s: Enter\n", __func__));
+ BRCMF_TRACE(("%s: Enter\n", __func__));

kfree(bus->ci);
bus->ci = NULL;
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 14/31] staging: brcm80211: replaced typedef tx_power_t by struct brcms_tx_power

From: Roland Vossen <[email protected]>


Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 4 ++--
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h | 2 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.h | 2 +-
drivers/staging/brcm80211/brcmsmac/stf.c | 2 +-
drivers/staging/brcm80211/brcmsmac/types.h | 1 -
5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 43a1dc5..8850d6d 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -2179,7 +2179,7 @@ static u32 wlc_phy_txpower_est_power_nphy(struct brcms_phy *pi)
}

void
-wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi, tx_power_t *power,
+wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi, struct tx_power *power,
uint channel)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
@@ -2187,7 +2187,7 @@ wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi, tx_power_t *power,
u8 min_pwr, max_pwr;

#if WL_TX_POWER_RATES != TXP_NUM_RATES
-#error "tx_power_t struct out of sync with this fn"
+#error "struct tx_power out of sync with this fn"
#endif

if (ISNPHY(pi)) {
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
index a2df6b4..e327a57 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
@@ -270,7 +270,7 @@ extern void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, mbool flags);
extern void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type);

extern void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi,
- tx_power_t *power, uint channel);
+ struct tx_power *power, uint channel);

extern void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal);
extern bool wlc_phy_test_ison(struct brcms_phy_pub *ppi);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy_shim.h b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
index a4550ed..0a29b67 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy_shim.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
@@ -98,7 +98,7 @@
/* sslpnphy specifics */
#define WL_TX_POWER_MCS20_SISO_FIRST_SSN 12 /* Index for first 20MHz MCS SISO rate */

-/* tx_power_t.flags bits */
+/* struct tx_power::flags bits */
#define WL_TX_POWER_F_ENABLED 1
#define WL_TX_POWER_F_HW 2
#define WL_TX_POWER_F_MIMO 4
diff --git a/drivers/staging/brcm80211/brcmsmac/stf.c b/drivers/staging/brcm80211/brcmsmac/stf.c
index 3d5979b..b51ca7a 100644
--- a/drivers/staging/brcm80211/brcmsmac/stf.c
+++ b/drivers/staging/brcm80211/brcmsmac/stf.c
@@ -97,7 +97,7 @@ void
brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc, u16 *ss_algo_channel,
chanspec_t chanspec)
{
- tx_power_t power;
+ struct tx_power power;
u8 siso_mcs_id, cdd_mcs_id, stbc_mcs_id;

/* Clear previous settings */
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index 9e9fe56..7ab4263 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -383,7 +383,6 @@ typedef volatile struct dma32diag dma32diag_t;
typedef volatile struct dma64regs dma64regs_t;
typedef struct brcms_rateset wlc_rateset_t;
typedef u32 ratespec_t;
-typedef struct tx_power tx_power_t;
typedef struct chanvec chanvec_t;
typedef s32 fixed;
typedef struct _cs32 cs32;
--
1.7.4.1



2011-07-05 22:03:12

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 07/31] staging: brcm80211: removed asserts from dhd_cdc.c and dhd_common.c

From: Roland Vossen <[email protected]>

Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 2 --
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 21 +++++++++------------
2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 4b8eb9c..d464606 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -288,8 +288,6 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,

BRCMF_TRACE(("%s: Enter\n", __func__));

- ASSERT(len <= BRCMF_C_IOCTL_MAXLEN);
-
if (len > BRCMF_C_IOCTL_MAXLEN)
goto done;

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 12cb90d..59c2726 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -272,7 +272,6 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
eprec = prec;
else if (pktq_full(q)) {
p = brcmu_pktq_peek_tail(q, &eprec);
- ASSERT(p);
if (eprec > prec)
return false;
}
@@ -280,7 +279,6 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
/* Evict if needed */
if (eprec >= 0) {
/* Detect queueing to unconfigured precedence */
- ASSERT(!pktq_pempty(q, eprec));
discard_oldest = AC_BITMAP_TST(drvr->wme_dp, eprec);
if (eprec == prec && !discard_oldest)
return false; /* refuse newer (incoming) packet */
@@ -290,9 +288,7 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
if (p == NULL) {
BRCMF_ERROR(("%s: brcmu_pktq_penq() failed, oldest %d.",
__func__, discard_oldest));
- ASSERT(p);
}
-
brcmu_pkt_buf_free_skb(p);
}

@@ -300,10 +296,9 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
p = brcmu_pktq_penq(q, prec, pkt);
if (p == NULL) {
BRCMF_ERROR(("%s: brcmu_pktq_penq() failed.", __func__));
- ASSERT(p);
}

- return true;
+ return p != NULL;
}

static int
@@ -317,14 +312,16 @@ brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name,

BRCMF_TRACE(("%s: Enter\n", __func__));

- ASSERT(name);
- ASSERT(len >= 0);
+ if (name == NULL || len <= 0)
+ return -EINVAL;

- /* Get MUST have return space */
- ASSERT(set || (arg && len));
+ /* Set does not take qualifiers */
+ if (set && (params || plen))
+ return -EINVAL;

- /* Set does NOT take qualifiers */
- ASSERT(!set || (!params && !plen));
+ /* Get must have return space;*/
+ if (!set && !(arg && len))
+ return -EINVAL;

vi = brcmu_iovar_lookup(brcmf_iovars, name);
if (vi == NULL) {
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 11/31] staging: brcm80211: replaced various typedefs in softmac

From: Roland Vossen <[email protected]>

typedefs are undesirable according to documentation/CodingStyle.

Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/aiutils.c | 134 +++++-----
drivers/staging/brcm80211/brcmsmac/aiutils.h | 2 +-
drivers/staging/brcm80211/brcmsmac/alloc.c | 30 +-
drivers/staging/brcm80211/brcmsmac/ampdu.c | 73 +++---
drivers/staging/brcm80211/brcmsmac/ampdu.h | 2 +-
drivers/staging/brcm80211/brcmsmac/antsel.c | 8 +-
drivers/staging/brcm80211/brcmsmac/bmac.c | 20 +-
drivers/staging/brcm80211/brcmsmac/bmac.h | 2 +-
drivers/staging/brcm80211/brcmsmac/channel.c | 205 +++++++-------
drivers/staging/brcm80211/brcmsmac/channel.h | 15 +-
drivers/staging/brcm80211/brcmsmac/d11.h | 6 +-
drivers/staging/brcm80211/brcmsmac/dma.c | 300 ++++++++++----------
drivers/staging/brcm80211/brcmsmac/dma.h | 8 +-
drivers/staging/brcm80211/brcmsmac/mac80211_if.h | 2 +-
drivers/staging/brcm80211/brcmsmac/main.c | 117 ++++----
drivers/staging/brcm80211/brcmsmac/main.h | 61 +++--
drivers/staging/brcm80211/brcmsmac/nicpci.c | 103 ++++----
drivers/staging/brcm80211/brcmsmac/otp.c | 45 ++--
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 32 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h | 6 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h | 85 +++---
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 239 ++++++++--------
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h | 2 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 293 ++++++++++----------
.../staging/brcm80211/brcmsmac/phy/phytbl_lcn.c | 29 +-
.../staging/brcm80211/brcmsmac/phy/phytbl_lcn.h | 28 +-
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c | 18 +-
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h | 8 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.c | 68 +++---
drivers/staging/brcm80211/brcmsmac/phy_shim.h | 64 ++--
drivers/staging/brcm80211/brcmsmac/pub.h | 21 +-
drivers/staging/brcm80211/brcmsmac/rate.c | 24 +-
drivers/staging/brcm80211/brcmsmac/rate.h | 58 ++--
drivers/staging/brcm80211/brcmsmac/scb.h | 5 +-
drivers/staging/brcm80211/brcmsmac/srom.c | 26 +-
drivers/staging/brcm80211/brcmsmac/types.h | 87 +-----
36 files changed, 1110 insertions(+), 1116 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.c b/drivers/staging/brcm80211/brcmsmac/aiutils.c
index 2018664..a25901e 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.c
@@ -239,7 +239,7 @@
/* resetctrl */
#define AIRC_RESET 1

-typedef volatile struct _aidmp {
+struct aidmp {
u32 oobselina30; /* 0x000 */
u32 oobselina74; /* 0x004 */
u32 PAD[6];
@@ -355,7 +355,7 @@ typedef volatile struct _aidmp {
u32 componentid1; /* 0xff4 */
u32 componentid2; /* 0xff8 */
u32 componentid3; /* 0xffc */
-} aidmp_t;
+};

/* EROM parsing */

@@ -429,14 +429,14 @@ get_asd(struct si_pub *sih, u32 **eromptr, uint sp, uint ad, uint st,
return asd;
}

-static void ai_hwfixup(si_info_t *sii)
+static void ai_hwfixup(struct si_info *sii)
{
}

/* parse the enumeration rom to identify all cores */
void ai_scan(struct si_pub *sih, void *regs)
{
- si_info_t *sii = SI_INFO(sih);
+ struct si_info *sii = SI_INFO(sih);
chipcregs_t *cc = (chipcregs_t *) regs;
u32 erombase, *eromptr, *eromlim;

@@ -639,7 +639,7 @@ void ai_scan(struct si_pub *sih, void *regs)
*/
void *ai_setcoreidx(struct si_pub *sih, uint coreidx)
{
- si_info_t *sii = SI_INFO(sih);
+ struct si_info *sii = SI_INFO(sih);
u32 addr = sii->coresba[coreidx];
u32 wrap = sii->wrapba[coreidx];
void *regs;
@@ -694,7 +694,7 @@ int ai_numaddrspaces(struct si_pub *sih)
/* Return the address of the nth address space in the current core */
u32 ai_addrspace(struct si_pub *sih, uint asidx)
{
- si_info_t *sii;
+ struct si_info *sii;
uint cidx;

sii = SI_INFO(sih);
@@ -713,7 +713,7 @@ u32 ai_addrspace(struct si_pub *sih, uint asidx)
/* Return the size of the nth address space in the current core */
u32 ai_addrspacesize(struct si_pub *sih, uint asidx)
{
- si_info_t *sii;
+ struct si_info *sii;
uint cidx;

sii = SI_INFO(sih);
@@ -731,8 +731,8 @@ u32 ai_addrspacesize(struct si_pub *sih, uint asidx)

uint ai_flag(struct si_pub *sih)
{
- si_info_t *sii;
- aidmp_t *ai;
+ struct si_info *sii;
+ struct aidmp *ai;

sii = SI_INFO(sih);
if (BCM47162_DMP()) {
@@ -750,7 +750,7 @@ void ai_setint(struct si_pub *sih, int siflag)

uint ai_corevendor(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;
u32 cia;

sii = SI_INFO(sih);
@@ -760,7 +760,7 @@ uint ai_corevendor(struct si_pub *sih)

uint ai_corerev(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;
u32 cib;

sii = SI_INFO(sih);
@@ -770,8 +770,8 @@ uint ai_corerev(struct si_pub *sih)

bool ai_iscoreup(struct si_pub *sih)
{
- si_info_t *sii;
- aidmp_t *ai;
+ struct si_info *sii;
+ struct aidmp *ai;

sii = SI_INFO(sih);
ai = sii->curwrap;
@@ -783,8 +783,8 @@ bool ai_iscoreup(struct si_pub *sih)

void ai_core_cflags_wo(struct si_pub *sih, u32 mask, u32 val)
{
- si_info_t *sii;
- aidmp_t *ai;
+ struct si_info *sii;
+ struct aidmp *ai;
u32 w;

sii = SI_INFO(sih);
@@ -805,8 +805,8 @@ void ai_core_cflags_wo(struct si_pub *sih, u32 mask, u32 val)

u32 ai_core_cflags(struct si_pub *sih, u32 mask, u32 val)
{
- si_info_t *sii;
- aidmp_t *ai;
+ struct si_info *sii;
+ struct aidmp *ai;
u32 w;

sii = SI_INFO(sih);
@@ -828,8 +828,8 @@ u32 ai_core_cflags(struct si_pub *sih, u32 mask, u32 val)

u32 ai_core_sflags(struct si_pub *sih, u32 mask, u32 val)
{
- si_info_t *sii;
- aidmp_t *ai;
+ struct si_info *sii;
+ struct aidmp *ai;
u32 w;

sii = SI_INFO(sih);
@@ -850,19 +850,19 @@ u32 ai_core_sflags(struct si_pub *sih, u32 mask, u32 val)

/* *************** from siutils.c ************** */
/* local prototypes */
-static si_info_t *ai_doattach(si_info_t *sii, void *regs,
+static struct si_info *ai_doattach(struct si_info *sii, void *regs,
uint bustype, void *sdh, char **vars,
uint *varsz);
-static bool ai_buscore_prep(si_info_t *sii, uint bustype);
-static bool ai_buscore_setup(si_info_t *sii, chipcregs_t *cc, uint bustype,
+static bool ai_buscore_prep(struct si_info *sii, uint bustype);
+static bool ai_buscore_setup(struct si_info *sii, chipcregs_t *cc, uint bustype,
u32 savewin, uint *origidx, void *regs);
-static void ai_nvram_process(si_info_t *sii, char *pvars);
+static void ai_nvram_process(struct si_info *sii, char *pvars);

/* dev path concatenation util */
static char *ai_devpathvar(struct si_pub *sih, char *var, int len,
const char *name);
-static bool _ai_clkctl_cc(si_info_t *sii, uint mode);
-static bool ai_ispcie(si_info_t *sii);
+static bool _ai_clkctl_cc(struct si_info *sii, uint mode);
+static bool ai_ispcie(struct si_info *sii);

/* global variable to indicate reservation/release of gpio's */
static u32 ai_gpioreservation;
@@ -879,10 +879,10 @@ static u32 ai_gpioreservation;
struct si_pub *ai_attach(void *regs, uint bustype,
void *sdh, char **vars, uint *varsz)
{
- si_info_t *sii;
+ struct si_info *sii;

- /* alloc si_info_t */
- sii = kmalloc(sizeof(si_info_t), GFP_ATOMIC);
+ /* alloc struct si_info */
+ sii = kmalloc(sizeof(struct si_info), GFP_ATOMIC);
if (sii == NULL) {
SI_ERROR(("si_attach: malloc failed!\n"));
return NULL;
@@ -900,9 +900,9 @@ struct si_pub *ai_attach(void *regs, uint bustype,
}

/* global kernel resource */
-static si_info_t ksii;
+static struct si_info ksii;

-static bool ai_buscore_prep(si_info_t *sii, uint bustype)
+static bool ai_buscore_prep(struct si_info *sii, uint bustype)
{
/* kludge to enable the clock on the 4306 which lacks a slowclock */
if (bustype == PCI_BUS && !ai_ispcie(sii))
@@ -910,7 +910,7 @@ static bool ai_buscore_prep(si_info_t *sii, uint bustype)
return true;
}

-static bool ai_buscore_setup(si_info_t *sii, chipcregs_t *cc, uint bustype,
+static bool ai_buscore_setup(struct si_info *sii, chipcregs_t *cc, uint bustype,
u32 savewin, uint *origidx, void *regs)
{
bool pci, pcie;
@@ -1019,7 +1019,7 @@ static bool ai_buscore_setup(si_info_t *sii, chipcregs_t *cc, uint bustype,
return true;
}

-static __used void ai_nvram_process(si_info_t *sii, char *pvars)
+static __used void ai_nvram_process(struct si_info *sii, char *pvars)
{
uint w = 0;

@@ -1068,7 +1068,7 @@ static __used void ai_nvram_process(si_info_t *sii, char *pvars)
sii->pub.boardflags = getintvar(pvars, "boardflags");
}

-static si_info_t *ai_doattach(si_info_t *sii,
+static struct si_info *ai_doattach(struct si_info *sii,
void *regs, uint bustype, void *pbus,
char **vars, uint *varsz)
{
@@ -1079,7 +1079,7 @@ static si_info_t *ai_doattach(si_info_t *sii,
uint socitype;
uint origidx;

- memset((unsigned char *) sii, 0, sizeof(si_info_t));
+ memset((unsigned char *) sii, 0, sizeof(struct si_info));

savewin = 0;

@@ -1241,7 +1241,7 @@ static si_info_t *ai_doattach(si_info_t *sii,
/* may be called with core in reset */
void ai_detach(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;
uint idx;

struct si_pub *si_local = NULL;
@@ -1275,7 +1275,7 @@ ai_register_intr_callback(struct si_pub *sih, void *intrsoff_fn,
void *intrsrestore_fn,
void *intrsenabled_fn, void *intr_arg)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);
sii->intr_arg = intr_arg;
@@ -1290,7 +1290,7 @@ ai_register_intr_callback(struct si_pub *sih, void *intrsoff_fn,

void ai_deregister_intr_callback(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);
sii->intrsoff_fn = NULL;
@@ -1298,7 +1298,7 @@ void ai_deregister_intr_callback(struct si_pub *sih)

uint ai_coreid(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);
return sii->coreid[sii->curidx];
@@ -1306,7 +1306,7 @@ uint ai_coreid(struct si_pub *sih)

uint ai_coreidx(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);
return sii->curidx;
@@ -1320,7 +1320,7 @@ bool ai_backplane64(struct si_pub *sih)
/* return index of coreid or BADIDX if not found */
uint ai_findcoreidx(struct si_pub *sih, uint coreid, uint coreunit)
{
- si_info_t *sii;
+ struct si_info *sii;
uint found;
uint i;

@@ -1360,7 +1360,7 @@ void *ai_switch_core(struct si_pub *sih, uint coreid, uint *origidx,
uint *intr_val)
{
void *cc;
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);

@@ -1384,7 +1384,7 @@ void *ai_switch_core(struct si_pub *sih, uint coreid, uint *origidx,
/* restore coreidx and restore interrupt */
void ai_restore_core(struct si_pub *sih, uint coreid, uint intr_val)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);
if (SI_FAST(sii)
@@ -1397,7 +1397,7 @@ void ai_restore_core(struct si_pub *sih, uint coreid, uint intr_val)

void ai_write_wrapperreg(struct si_pub *sih, u32 offset, u32 val)
{
- si_info_t *sii = SI_INFO(sih);
+ struct si_info *sii = SI_INFO(sih);
u32 *w = (u32 *) sii->curwrap;
W_REG(w + (offset / 4), val);
return;
@@ -1421,7 +1421,7 @@ uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask,
uint w;
uint intr_val = 0;
bool fast = false;
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);

@@ -1500,9 +1500,9 @@ uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask,

void ai_core_disable(struct si_pub *sih, u32 bits)
{
- si_info_t *sii;
+ struct si_info *sii;
u32 dummy;
- aidmp_t *ai;
+ struct aidmp *ai;

sii = SI_INFO(sih);

@@ -1527,8 +1527,8 @@ void ai_core_disable(struct si_pub *sih, u32 bits)
*/
void ai_core_reset(struct si_pub *sih, u32 bits, u32 resetbits)
{
- si_info_t *sii;
- aidmp_t *ai;
+ struct si_info *sii;
+ struct aidmp *ai;
u32 dummy;

sii = SI_INFO(sih);
@@ -1554,7 +1554,7 @@ void ai_core_reset(struct si_pub *sih, u32 bits, u32 resetbits)
}

/* return the slow clock source - LPO, XTAL, or PCI */
-static uint ai_slowclk_src(si_info_t *sii)
+static uint ai_slowclk_src(struct si_info *sii)
{
chipcregs_t *cc;
u32 val;
@@ -1578,7 +1578,7 @@ static uint ai_slowclk_src(si_info_t *sii)
* return the ILP (slowclock) min or max frequency
* precondition: we've established the chip has dynamic clk control
*/
-static uint ai_slowclk_freq(si_info_t *sii, bool max_freq, chipcregs_t *cc)
+static uint ai_slowclk_freq(struct si_info *sii, bool max_freq, chipcregs_t *cc)
{
u32 slowclk;
uint div;
@@ -1612,7 +1612,7 @@ static uint ai_slowclk_freq(si_info_t *sii, bool max_freq, chipcregs_t *cc)
return 0;
}

-static void ai_clkctl_setdelay(si_info_t *sii, void *chipcregs)
+static void ai_clkctl_setdelay(struct si_info *sii, void *chipcregs)
{
chipcregs_t *cc = (chipcregs_t *) chipcregs;
uint slowmaxfreq, pll_delay, slowclk;
@@ -1644,7 +1644,7 @@ static void ai_clkctl_setdelay(si_info_t *sii, void *chipcregs)
/* initialize power control delay registers */
void ai_clkctl_init(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;
uint origidx = 0;
chipcregs_t *cc;
bool fast;
@@ -1682,7 +1682,7 @@ void ai_clkctl_init(struct si_pub *sih)
*/
u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;
uint origidx = 0;
chipcregs_t *cc;
uint slowminfreq;
@@ -1730,7 +1730,7 @@ u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih)
/* turn primary xtal and/or pll off/on */
int ai_clkctl_xtal(struct si_pub *sih, uint what, bool on)
{
- si_info_t *sii;
+ struct si_info *sii;
u32 in, out, outen;

sii = SI_INFO(sih);
@@ -1807,7 +1807,7 @@ int ai_clkctl_xtal(struct si_pub *sih, uint what, bool on)
*/
bool ai_clkctl_cc(struct si_pub *sih, uint mode)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);

@@ -1822,7 +1822,7 @@ bool ai_clkctl_cc(struct si_pub *sih, uint mode)
}

/* clk control mechanism through chipcommon, no policy checking */
-static bool _ai_clkctl_cc(si_info_t *sii, uint mode)
+static bool _ai_clkctl_cc(struct si_info *sii, uint mode)
{
uint origidx = 0;
chipcregs_t *cc;
@@ -2001,7 +2001,7 @@ static char *ai_devpathvar(struct si_pub *sih, char *var, int len,
}

/* return true if PCIE capability exists in the pci config space */
-static bool ai_ispcie(si_info_t *sii)
+static bool ai_ispcie(struct si_info *sii)
{
u8 cap_ptr;

@@ -2019,7 +2019,7 @@ static bool ai_ispcie(si_info_t *sii)

bool ai_pci_war16165(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);

@@ -2028,7 +2028,7 @@ bool ai_pci_war16165(struct si_pub *sih)

void ai_pci_up(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);

@@ -2047,7 +2047,7 @@ void ai_pci_up(struct si_pub *sih)
/* Unconfigure and/or apply various WARs when system is going to sleep mode */
void ai_pci_sleep(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);

@@ -2057,7 +2057,7 @@ void ai_pci_sleep(struct si_pub *sih)
/* Unconfigure and/or apply various WARs when going down */
void ai_pci_down(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);

@@ -2078,7 +2078,7 @@ void ai_pci_down(struct si_pub *sih)
*/
void ai_pci_setup(struct si_pub *sih, uint coremask)
{
- si_info_t *sii;
+ struct si_info *sii;
void *regs = NULL;
u32 siflag = 0, w;
uint idx = 0;
@@ -2130,7 +2130,7 @@ int ai_pci_fixcfg(struct si_pub *sih)
uint origidx;
void *regs = NULL;

- si_info_t *sii = SI_INFO(sih);
+ struct si_info *sii = SI_INFO(sih);

/* Fixup PI in SROM shadow area to enable the correct PCI core access */
/* save the current index */
@@ -2170,7 +2170,7 @@ u32 ai_gpiocontrol(struct si_pub *sih, u32 mask, u32 val, u8 priority)

void ai_chipcontrl_epa4331(struct si_pub *sih, bool on)
{
- si_info_t *sii;
+ struct si_info *sii;
chipcregs_t *cc;
uint origidx;
u32 val;
@@ -2204,7 +2204,7 @@ void ai_chipcontrl_epa4331(struct si_pub *sih, bool on)
/* Enable BT-COEX & Ex-PA for 4313 */
void ai_epa_4313war(struct si_pub *sih)
{
- si_info_t *sii;
+ struct si_info *sii;
chipcregs_t *cc;
uint origidx;

@@ -2224,7 +2224,7 @@ void ai_epa_4313war(struct si_pub *sih)
bool ai_deviceremoved(struct si_pub *sih)
{
u32 w;
- si_info_t *sii;
+ struct si_info *sii;

sii = SI_INFO(sih);

@@ -2241,7 +2241,7 @@ bool ai_deviceremoved(struct si_pub *sih)
bool ai_is_sprom_available(struct si_pub *sih)
{
if (sih->ccrev >= 31) {
- si_info_t *sii;
+ struct si_info *sii;
uint origidx;
chipcregs_t *cc;
u32 sromctrl;
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.h b/drivers/staging/brcm80211/brcmsmac/aiutils.h
index b00780d..e245c27 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.h
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.h
@@ -278,7 +278,7 @@
#define BCM5357_CHIP_ID 0x5357 /* 5357 chipcommon chipid */


-#define SI_INFO(sih) ((si_info_t *)sih)
+#define SI_INFO(sih) ((struct si_info *)sih)

#define GOODCOREADDR(x, b) \
(((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
diff --git a/drivers/staging/brcm80211/brcmsmac/alloc.c b/drivers/staging/brcm80211/brcmsmac/alloc.c
index 34eafbe..62770b3 100644
--- a/drivers/staging/brcm80211/brcmsmac/alloc.c
+++ b/drivers/staging/brcm80211/brcmsmac/alloc.c
@@ -22,12 +22,12 @@

static struct brcms_c_bsscfg *brcms_c_bsscfg_malloc(uint unit);
static void brcms_c_bsscfg_mfree(struct brcms_c_bsscfg *cfg);
-static struct wlc_pub *brcms_c_pub_malloc(uint unit,
+static struct brcms_pub *brcms_c_pub_malloc(uint unit,
uint *err, uint devid);
-static void brcms_c_pub_mfree(struct wlc_pub *pub);
-static void brcms_c_tunables_init(wlc_tunables_t *tunables, uint devid);
+static void brcms_c_pub_mfree(struct brcms_pub *pub);
+static void brcms_c_tunables_init(struct brcms_tunables *tunables, uint devid);

-static void brcms_c_tunables_init(wlc_tunables_t *tunables, uint devid)
+static void brcms_c_tunables_init(struct brcms_tunables *tunables, uint devid)
{
tunables->ntxd = NTXD;
tunables->nrxd = NRXD;
@@ -45,17 +45,17 @@ static void brcms_c_tunables_init(wlc_tunables_t *tunables, uint devid)
tunables->txsbnd = TXSBND;
}

-static struct wlc_pub *brcms_c_pub_malloc(uint unit, uint *err, uint devid)
+static struct brcms_pub *brcms_c_pub_malloc(uint unit, uint *err, uint devid)
{
- struct wlc_pub *pub;
+ struct brcms_pub *pub;

- pub = kzalloc(sizeof(struct wlc_pub), GFP_ATOMIC);
+ pub = kzalloc(sizeof(struct brcms_pub), GFP_ATOMIC);
if (pub == NULL) {
*err = 1001;
goto fail;
}

- pub->tunables = kzalloc(sizeof(wlc_tunables_t), GFP_ATOMIC);
+ pub->tunables = kzalloc(sizeof(struct brcms_tunables), GFP_ATOMIC);
if (pub->tunables == NULL) {
*err = 1028;
goto fail;
@@ -77,7 +77,7 @@ static struct wlc_pub *brcms_c_pub_malloc(uint unit, uint *err, uint devid)
return NULL;
}

-static void brcms_c_pub_mfree(struct wlc_pub *pub)
+static void brcms_c_pub_mfree(struct brcms_pub *pub)
{
if (pub == NULL)
return;
@@ -95,7 +95,7 @@ static struct brcms_c_bsscfg *brcms_c_bsscfg_malloc(uint unit)
if (cfg == NULL)
goto fail;

- cfg->current_bss = kzalloc(sizeof(wlc_bss_info_t), GFP_ATOMIC);
+ cfg->current_bss = kzalloc(sizeof(struct brcms_bss_info), GFP_ATOMIC);
if (cfg->current_bss == NULL)
goto fail;

@@ -175,7 +175,7 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
goto fail;
}

- wlc->default_bss = kzalloc(sizeof(wlc_bss_info_t), GFP_ATOMIC);
+ wlc->default_bss = kzalloc(sizeof(struct brcms_bss_info), GFP_ATOMIC);
if (wlc->default_bss == NULL) {
*err = 1010;
goto fail;
@@ -189,16 +189,16 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
brcms_c_bsscfg_ID_assign(wlc, wlc->cfg);

wlc->wsec_def_keys[0] =
- kzalloc(sizeof(wsec_key_t) * WLC_DEFAULT_KEYS, GFP_ATOMIC);
+ kzalloc(sizeof(struct wsec_key) * WLC_DEFAULT_KEYS, GFP_ATOMIC);
if (wlc->wsec_def_keys[0] == NULL) {
*err = 1015;
goto fail;
} else {
int i;
for (i = 1; i < WLC_DEFAULT_KEYS; i++) {
- wlc->wsec_def_keys[i] = (wsec_key_t *)
+ wlc->wsec_def_keys[i] = (struct wsec_key *)
((unsigned long)wlc->wsec_def_keys[0] +
- (sizeof(wsec_key_t) * i));
+ (sizeof(struct wsec_key) * i));
}
}

@@ -237,7 +237,7 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
}

wlc->corestate->macstat_snapshot =
- kzalloc(sizeof(macstat_t), GFP_ATOMIC);
+ kzalloc(sizeof(struct macstat), GFP_ATOMIC);
if (wlc->corestate->macstat_snapshot == NULL) {
*err = 1027;
goto fail;
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.c b/drivers/staging/brcm80211/brcmsmac/ampdu.c
index 6271ad1..4060ee2 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.c
@@ -60,7 +60,7 @@
* This allows to maintain a specific state independently of
* how often and/or when the wlc counters are updated.
*/
-typedef struct wlc_fifo_info {
+struct brcms_fifo_info {
u16 ampdu_pld_size; /* number of bytes to be pre-loaded */
u8 mcs2ampdu_table[FFPLD_MAX_MCS + 1]; /* per-mcs max # of mpdus in an ampdu */
u16 prev_txfunfl; /* num of underflows last read from the HW macstats counter */
@@ -68,7 +68,7 @@ typedef struct wlc_fifo_info {
u32 accum_txampdu; /* num of tx ampdu since we modified pld params */
u32 prev_txampdu; /* previous reading of tx ampdu */
u32 dmaxferrate; /* estimated dma avg xfer rate in kbits/sec */
-} wlc_fifo_info_t;
+};

/* AMPDU module specific state */
struct ampdu_info {
@@ -94,7 +94,8 @@ struct ampdu_info {
u32 tx_max_funl; /* underflows should be kept such that
* (tx_max_funfl*underflows) < tx frames
*/
- wlc_fifo_info_t fifo_tb[NUM_FFPLD_FIFO]; /* table of fifo infos */
+ /* table of fifo infos */
+ struct brcms_fifo_info fifo_tb[NUM_FFPLD_FIFO];

};

@@ -122,10 +123,12 @@ static void brcms_c_scb_ampdu_update_config_all(struct ampdu_info *ampdu);

#define brcms_c_ampdu_txflowcontrol(a, b, c) do {} while (0)

-static void brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu,
- struct scb *scb,
- struct sk_buff *p, tx_status_t *txs,
- u32 frmtxstatus, u32 frmtxstatus2);
+static void
+brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu,
+ struct scb *scb,
+ struct sk_buff *p, struct tx_status *txs,
+ u32 frmtxstatus, u32 frmtxstatus2);
+
static bool brcms_c_ampdu_cap(struct ampdu_info *ampdu);
static int brcms_c_ampdu_set(struct ampdu_info *ampdu, bool on);

@@ -203,7 +206,7 @@ void brcms_c_ampdu_detach(struct ampdu_info *ampdu)
static void brcms_c_scb_ampdu_update_config(struct ampdu_info *ampdu,
struct scb *scb)
{
- scb_ampdu_t *scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb);
+ struct scb_ampdu *scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb);
int i;

scb_ampdu->max_pdu = (u8) ampdu->wlc->pub->tunables->ampdunummpdu;
@@ -237,7 +240,7 @@ static void brcms_c_scb_ampdu_update_config_all(struct ampdu_info *ampdu)
static void brcms_c_ffpld_init(struct ampdu_info *ampdu)
{
int i, j;
- wlc_fifo_info_t *fifo;
+ struct brcms_fifo_info *fifo;

for (j = 0; j < NUM_FFPLD_FIFO; j++) {
fifo = (ampdu->fifo_tb + j);
@@ -267,14 +270,14 @@ static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int fid)
u32 current_ampdu_cnt = 0;
u16 max_pld_size;
u32 new_txunfl;
- wlc_fifo_info_t *fifo = (ampdu->fifo_tb + fid);
+ struct brcms_fifo_info *fifo = (ampdu->fifo_tb + fid);
uint xmtfifo_sz;
u16 cur_txunfl;

/* return if we got here for a different reason than underflows */
- cur_txunfl =
- brcms_c_read_shm(wlc,
- M_UCODE_MACSTAT + offsetof(macstat_t, txfunfl[fid]));
+ cur_txunfl = brcms_c_read_shm(wlc,
+ M_UCODE_MACSTAT +
+ offsetof(struct macstat, txfunfl[fid]));
new_txunfl = (u16) (cur_txunfl - fifo->prev_txfunfl);
if (new_txunfl == 0) {
BCMMSG(wlc->wiphy, "TX status FRAG set but no tx underflows\n");
@@ -381,7 +384,7 @@ static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
int i;
u32 phy_rate, dma_rate, tmp;
u8 max_mpdu;
- wlc_fifo_info_t *fifo = (ampdu->fifo_tb + f);
+ struct brcms_fifo_info *fifo = (ampdu->fifo_tb + f);

/* recompute the dma rate */
/* note : we divide/multiply by 100 to avoid integer overflows */
@@ -413,8 +416,8 @@ brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
u8 ba_wsize, /* negotiated ba window size (in pdu) */
uint max_rx_ampdu_bytes) /* from ht_cap in beacon */
{
- scb_ampdu_t *scb_ampdu;
- scb_ampdu_tid_ini_t *ini;
+ struct scb_ampdu *scb_ampdu;
+ struct scb_ampdu_tid_ini *ini;
struct ampdu_info *ampdu = wlc->ampdu;
struct scb *scb = wlc->pub->global_scb;
scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb);
@@ -449,12 +452,12 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
uint i, count = 0, fifo, seg_cnt = 0;
u16 plen, len, seq = 0, mcl, mch, index, frameid, dma_len = 0;
u32 ampdu_len, max_ampdu_bytes = 0;
- d11txh_t *txh = NULL;
+ struct d11txh *txh = NULL;
u8 *plcp;
struct ieee80211_hdr *h;
struct scb *scb;
- scb_ampdu_t *scb_ampdu;
- scb_ampdu_tid_ini_t *ini;
+ struct scb_ampdu *scb_ampdu;
+ struct scb_ampdu_tid_ini *ini;
u8 mcs = 0;
bool use_rts = false, use_cts = false;
ratespec_t rspec = 0, rspec_fallback = 0;
@@ -462,7 +465,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
u16 mimo_ctlchbw = PHY_TXC1_BW_20MHZ;
struct ieee80211_rts *rts;
u8 rr_retry_limit;
- wlc_fifo_info_t *f;
+ struct brcms_fifo_info *f;
bool fbr_iscck;
struct ieee80211_tx_info *tx_info;
u16 qlen;
@@ -524,7 +527,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
}

/* pkt is good to be aggregated */
- txh = (d11txh_t *) p->data;
+ txh = (struct d11txh *) p->data;
plcp = (u8 *) (txh + 1);
h = (struct ieee80211_hdr *)(plcp + D11_PHY_HDR_LEN);
seq = le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT;
@@ -701,7 +704,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,

if (count) {
/* patch up the last txh */
- txh = (d11txh_t *) pkt[count - 1]->data;
+ txh = (struct d11txh *) pkt[count - 1]->data;
mcl = le16_to_cpu(txh->MacTxControlLow);
mcl &= ~TXC_AMPDU_MASK;
mcl |= (TXC_AMPDU_LAST << TXC_AMPDU_SHIFT);
@@ -719,7 +722,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
ampdu_len -= roundup(len, 4) - len;

/* patch up the first txh & plcp */
- txh = (d11txh_t *) pkt[0]->data;
+ txh = (struct d11txh *) pkt[0]->data;
plcp = (u8 *) (txh + 1);

WLC_SET_MIMO_PLCP_LEN(plcp, ampdu_len);
@@ -809,11 +812,11 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,

void
brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
- struct sk_buff *p, tx_status_t *txs)
+ struct sk_buff *p, struct tx_status *txs)
{
- scb_ampdu_t *scb_ampdu;
+ struct scb_ampdu *scb_ampdu;
struct brcms_c_info *wlc = ampdu->wlc;
- scb_ampdu_tid_ini_t *ini;
+ struct scb_ampdu_tid_ini *ini;
u32 s1 = 0, s2 = 0;
struct ieee80211_tx_info *tx_info;

@@ -845,11 +848,11 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
} else {
/* loop through all pkts and free */
u8 queue = txs->frameid & TXFID_QUEUE_MASK;
- d11txh_t *txh;
+ struct d11txh *txh;
u16 mcl;
while (p) {
tx_info = IEEE80211_SKB_CB(p);
- txh = (d11txh_t *) p->data;
+ txh = (struct d11txh *) p->data;
mcl = le16_to_cpu(txh->MacTxControlLow);
brcmu_pkt_buf_free_skb(p);
/* break out if last packet of ampdu */
@@ -866,7 +869,7 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
static void
brcms_c_ampdu_rate_status(struct brcms_c_info *wlc,
struct ieee80211_tx_info *tx_info,
- tx_status_t *txs, u8 mcs)
+ struct tx_status *txs, u8 mcs)
{
struct ieee80211_tx_rate *txrate = tx_info->status.rates;
int i;
@@ -882,14 +885,14 @@ brcms_c_ampdu_rate_status(struct brcms_c_info *wlc,

static void
brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
- struct sk_buff *p, tx_status_t *txs,
+ struct sk_buff *p, struct tx_status *txs,
u32 s1, u32 s2)
{
- scb_ampdu_t *scb_ampdu;
+ struct scb_ampdu *scb_ampdu;
struct brcms_c_info *wlc = ampdu->wlc;
- scb_ampdu_tid_ini_t *ini;
+ struct scb_ampdu_tid_ini *ini;
u8 bitmap[8], queue, tid;
- d11txh_t *txh;
+ struct d11txh *txh;
u8 *plcp;
struct ieee80211_hdr *h;
u16 seq, start_seq = 0, bindex, index, mcl;
@@ -982,7 +985,7 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,

if (WL_ERROR_ON()) {
brcmu_prpkt("txpkt (AMPDU)", p);
- brcms_c_print_txdesc((d11txh_t *) p->data);
+ brcms_c_print_txdesc((struct d11txh *) p->data);
}
brcms_c_print_txstatus(txs);
}
@@ -991,7 +994,7 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
/* loop through all pkts and retry if not acked */
while (p) {
tx_info = IEEE80211_SKB_CB(p);
- txh = (d11txh_t *) p->data;
+ txh = (struct d11txh *) p->data;
mcl = le16_to_cpu(txh->MacTxControlLow);
plcp = (u8 *) (txh + 1);
h = (struct ieee80211_hdr *)(plcp + D11_PHY_HDR_LEN);
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.h b/drivers/staging/brcm80211/brcmsmac/ampdu.h
index 5fba4ae..07b53fc 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.h
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.h
@@ -23,7 +23,7 @@ extern int brcms_c_sendampdu(struct ampdu_info *ampdu,
struct brcms_c_txq_info *qi,
struct sk_buff **aggp, int prec);
extern void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
- struct sk_buff *p, tx_status_t *txs);
+ struct sk_buff *p, struct tx_status *txs);
extern void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
extern void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);

diff --git a/drivers/staging/brcm80211/brcmsmac/antsel.c b/drivers/staging/brcm80211/brcmsmac/antsel.c
index 2cfda7f..e93d8ae 100644
--- a/drivers/staging/brcm80211/brcmsmac/antsel.c
+++ b/drivers/staging/brcm80211/brcmsmac/antsel.c
@@ -51,11 +51,11 @@

/* static functions */
static int brcms_c_antsel_cfgupd(struct antsel_info *asi,
- wlc_antselcfg_t *antsel);
+ struct brcms_antselcfg *antsel);
static u8 brcms_c_antsel_id2antcfg(struct antsel_info *asi, u8 id);
static u16 brcms_c_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg);
static void brcms_c_antsel_init_cfg(struct antsel_info *asi,
- wlc_antselcfg_t *antsel,
+ struct brcms_antselcfg *antsel,
bool auto_sel);

const u16 mimo_2x4_div_antselpat_tbl[] = {
@@ -160,7 +160,7 @@ void brcms_c_antsel_init(struct antsel_info *asi)

/* boardlevel antenna selection: init antenna selection structure */
static void
-brcms_c_antsel_init_cfg(struct antsel_info *asi, wlc_antselcfg_t *antsel,
+brcms_c_antsel_init_cfg(struct antsel_info *asi, struct brcms_antselcfg *antsel,
bool auto_sel)
{
if (asi->antsel_type == ANTSEL_2x3) {
@@ -282,7 +282,7 @@ static u16 brcms_c_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg)

/* boardlevel antenna selection: ucode interface control */
static int brcms_c_antsel_cfgupd(struct antsel_info *asi,
- wlc_antselcfg_t *antsel)
+ struct brcms_antselcfg *antsel)
{
struct brcms_c_info *wlc = asi->wlc;
u8 ant_cfg;
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index 4a220d4..b506d16 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -83,8 +83,8 @@ static void brcms_ucode_download(struct brcms_c_hw_info *wlc);
static void brcms_c_ucode_txant_set(struct brcms_c_hw_info *wlc_hw);

/* used by brcms_c_dpc() */
-static bool brcms_b_dotxstatus(struct brcms_c_hw_info *wlc, tx_status_t *txs,
- u32 s2);
+static bool brcms_b_dotxstatus(struct brcms_c_hw_info *wlc,
+ struct tx_status *txs, u32 s2);
static bool brcms_b_txstatus(struct brcms_c_hw_info *wlc, bool bound,
bool *fatal);
static bool brcms_b_recv(struct brcms_c_hw_info *wlc_hw, uint fifo, bool bound);
@@ -246,7 +246,7 @@ brcms_b_recv(struct brcms_c_hw_info *wlc_hw, uint fifo, bool bound)
struct sk_buff *tail = NULL;
uint n = 0;
uint bound_limit = bound ? wlc_hw->wlc->pub->tunables->rxbnd : -1;
- wlc_d11rxhdr_t *wlc_rxhdr = NULL;
+ struct brcms_d11rxhdr *wlc_rxhdr = NULL;

BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
/* gather received frames */
@@ -272,7 +272,7 @@ brcms_b_recv(struct brcms_c_hw_info *wlc_hw, uint fifo, bool bound)
head = head->prev;
p->prev = NULL;

- wlc_rxhdr = (wlc_d11rxhdr_t *) p->data;
+ wlc_rxhdr = (struct brcms_d11rxhdr *) p->data;

/* compute the RSSI from d11rxhdr and record it in wlc_rxd11hr */
wlc_phy_rssi_compute(wlc_hw->band->pi, wlc_rxhdr);
@@ -457,7 +457,8 @@ brcms_b_set_chanspec(struct brcms_c_hw_info *wlc_hw, chanspec_t chanspec,
}
}

-int brcms_b_state_get(struct brcms_c_hw_info *wlc_hw, brcms_b_state_t *state)
+int brcms_b_state_get(struct brcms_c_hw_info *wlc_hw,
+ struct brcms_b_state *state)
{
state->machwcap = wlc_hw->machwcap;

@@ -472,7 +473,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
u16 pio_mhf2 = 0;
struct brcms_c_hw_info *wlc_hw = wlc->hw;
uint unit = wlc_hw->unit;
- wlc_tunables_t *tune = wlc->pub->tunables;
+ struct brcms_tunables *tune = wlc->pub->tunables;
struct wiphy *wiphy = wlc->wiphy;

/* name and offsets for dma_attach */
@@ -589,7 +590,7 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
uint err = 0;
uint j;
bool wme = false;
- shared_phy_params_t sha_params;
+ struct shared_phy_params sha_params;
struct wiphy *wiphy = wlc->wiphy;

BCMMSG(wlc->wiphy, "wl%d: vendor 0x%x device 0x%x\n", unit, vendor,
@@ -2959,7 +2960,8 @@ bool brcms_c_isr(struct brcms_c_info *wlc, bool *wantdpc)
}

static bool
-brcms_b_dotxstatus(struct brcms_c_hw_info *wlc_hw, tx_status_t *txs, u32 s2)
+brcms_b_dotxstatus(struct brcms_c_hw_info *wlc_hw, struct tx_status *txs,
+ u32 s2)
{
/* discard intermediate indications for ucode with one legitimate case:
* e.g. if "useRTS" is set. ucode did a successful rts/cts exchange, but the subsequent
@@ -2983,7 +2985,7 @@ brcms_b_txstatus(struct brcms_c_hw_info *wlc_hw, bool bound, bool *fatal)
bool morepending = false;
struct brcms_c_info *wlc = wlc_hw->wlc;
d11regs_t *regs;
- tx_status_t txstatus, *txs;
+ struct tx_status txstatus, *txs;
u32 s1, s2;
uint n = 0;
/*
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.h b/drivers/staging/brcm80211/brcmsmac/bmac.h
index 3a1ee78..af4afa9 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.h
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.h
@@ -119,7 +119,7 @@ extern u16 brcms_b_get_txant(struct brcms_c_hw_info *wlc_hw);
extern void brcms_b_antsel_type_set(struct brcms_c_hw_info *wlc_hw,
u8 antsel_type);
extern int brcms_b_state_get(struct brcms_c_hw_info *wlc_hw,
- brcms_b_state_t *state);
+ struct brcms_b_state *state);
extern void brcms_b_write_shm(struct brcms_c_hw_info *wlc_hw, uint offset,
u16 v);
extern u16 brcms_b_read_shm(struct brcms_c_hw_info *wlc_hw, uint offset);
diff --git a/drivers/staging/brcm80211/brcmsmac/channel.c b/drivers/staging/brcm80211/brcmsmac/channel.c
index 6b28a35..6cf8ca1 100644
--- a/drivers/staging/brcm80211/brcmsmac/channel.c
+++ b/drivers/staging/brcm80211/brcmsmac/channel.c
@@ -30,69 +30,77 @@
brcms_c_valid_channel20_in_band((wlc)->cmi, bandunit, val)
#define VALID_CHANNEL20(wlc, val) brcms_c_valid_channel20((wlc)->cmi, val)

-typedef struct wlc_cm_band {
- u8 locale_flags; /* locale_info_t flags */
+struct brcms_cm_band {
+ u8 locale_flags; /* struct locale_info flags */
chanvec_t valid_channels; /* List of valid channels in the country */
const chanvec_t *restricted_channels; /* List of restricted use channels */
const chanvec_t *radar_channels; /* List of radar sensitive channels */
u8 PAD[8];
-} wlc_cm_band_t;
+};

-struct wlc_cm_info {
- struct wlc_pub *pub;
+struct brcms_cm_info {
+ struct brcms_pub *pub;
struct brcms_c_info *wlc;
char srom_ccode[WLC_CNTRY_BUF_SZ]; /* Country Code in SROM */
uint srom_regrev; /* Regulatory Rev for the SROM ccode */
- const country_info_t *country; /* current country def */
+ const struct country_info *country; /* current country def */
char ccode[WLC_CNTRY_BUF_SZ]; /* current internal Country Code */
uint regrev; /* current Regulatory Revision */
char country_abbrev[WLC_CNTRY_BUF_SZ]; /* current advertised ccode */
- wlc_cm_band_t bandstate[MAXBANDS]; /* per-band state (one per phy/radio) */
+ /* per-band state (one per phy/radio) */
+ struct brcms_cm_band bandstate[MAXBANDS];
/* quiet channels currently for radar sensitivity or 11h support */
chanvec_t quiet_channels; /* channels on which we cannot transmit */
};

-static int brcms_c_channels_init(wlc_cm_info_t *wlc_cm,
- const country_info_t *country);
-static void brcms_c_set_country_common(wlc_cm_info_t *wlc_cm,
+static int brcms_c_channels_init(struct brcms_cm_info *wlc_cm,
+ const struct country_info *country);
+static void brcms_c_set_country_common(struct brcms_cm_info *wlc_cm,
const char *country_abbrev,
const char *ccode, uint regrev,
- const country_info_t *country);
-static int brcms_c_set_countrycode(wlc_cm_info_t *wlc_cm, const char *ccode);
-static int brcms_c_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
+ const struct country_info *country);
+static int brcms_c_set_countrycode(struct brcms_cm_info *wlc_cm,
+ const char *ccode);
+static int brcms_c_set_countrycode_rev(struct brcms_cm_info *wlc_cm,
const char *country_abbrev,
const char *ccode, int regrev);
-static int brcms_c_country_aggregate_map(wlc_cm_info_t *wlc_cm,
+static int brcms_c_country_aggregate_map(struct brcms_cm_info *wlc_cm,
const char *ccode,
char *mapped_ccode, uint *mapped_regrev);
-static const country_info_t *brcms_c_country_lookup_direct(const char *ccode,
- uint regrev);
-static const country_info_t *brcms_c_countrycode_map(wlc_cm_info_t *wlc_cm,
- const char *ccode,
- char *mapped_ccode,
- uint *mapped_regrev);
-static void brcms_c_channels_commit(wlc_cm_info_t *wlc_cm);
-static void brcms_c_quiet_channels_reset(wlc_cm_info_t *wlc_cm);
-static bool brcms_c_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec);
-static bool brcms_c_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val);
-static bool brcms_c_valid_channel20_in_band(wlc_cm_info_t *wlc_cm,
+
+static const struct country_info *
+brcms_c_country_lookup_direct(const char *ccode, uint regrev);
+
+static const struct country_info *
+brcms_c_countrycode_map(struct brcms_cm_info *wlc_cm,
+ const char *ccode, char *mapped_ccode,
+ uint *mapped_regrev);
+
+static void brcms_c_channels_commit(struct brcms_cm_info *wlc_cm);
+static void brcms_c_quiet_channels_reset(struct brcms_cm_info *wlc_cm);
+static bool brcms_c_quiet_chanspec(struct brcms_cm_info *wlc_cm,
+ chanspec_t chspec);
+static bool brcms_c_valid_channel20_db(struct brcms_cm_info *wlc_cm, uint val);
+static bool brcms_c_valid_channel20_in_band(struct brcms_cm_info *wlc_cm,
uint bandunit, uint val);
-static bool brcms_c_valid_channel20(wlc_cm_info_t *wlc_cm, uint val);
-static const country_info_t *brcms_c_country_lookup(struct brcms_c_info *wlc,
- const char *ccode);
-static void brcms_c_locale_get_channels(const locale_info_t *locale,
+static bool brcms_c_valid_channel20(struct brcms_cm_info *wlc_cm, uint val);
+
+static const struct country_info *
+brcms_c_country_lookup(struct brcms_c_info *wlc, const char *ccode);
+
+static void brcms_c_locale_get_channels(const struct locale_info *locale,
chanvec_t *valid_channels);
-static const locale_info_t *brcms_c_get_locale_2g(u8 locale_idx);
-static const locale_info_t *brcms_c_get_locale_5g(u8 locale_idx);
+static const struct locale_info *brcms_c_get_locale_2g(u8 locale_idx);
+static const struct locale_info *brcms_c_get_locale_5g(u8 locale_idx);
static bool brcms_c_japan(struct brcms_c_info *wlc);
static bool brcms_c_japan_ccode(const char *ccode);
static void brcms_c_channel_min_txpower_limits_with_local_constraint(
- wlc_cm_info_t *wlc_cm, struct txpwr_limits *txpwr,
+ struct brcms_cm_info *wlc_cm, struct txpwr_limits *txpwr,
u8 local_constraint_qdbm);
static void brcms_c_locale_add_channels(chanvec_t *target,
const chanvec_t *channels);
-static const locale_mimo_info_t *brcms_c_get_mimo_2g(u8 locale_idx);
-static const locale_mimo_info_t *brcms_c_get_mimo_5g(u8 locale_idx);
+static const struct locale_mimo_info *brcms_c_get_mimo_2g(u8 locale_idx);
+static const struct locale_mimo_info *brcms_c_get_mimo_5g(u8 locale_idx);

/* QDB() macro takes a dB value and converts to a quarter dB value */
#ifdef QDB
@@ -389,7 +397,7 @@ static void brcms_c_locale_add_channels(chanvec_t *target,
}
}

-static void brcms_c_locale_get_channels(const locale_info_t *locale,
+static void brcms_c_locale_get_channels(const struct locale_info *locale,
chanvec_t *channels)
{
u8 i;
@@ -407,7 +415,7 @@ static void brcms_c_locale_get_channels(const locale_info_t *locale,
/*
* Locale Definitions - 2.4 GHz
*/
-static const locale_info_t locale_i = { /* locale i. channel 1 - 13 */
+static const struct locale_info locale_i = { /* locale i. channel 1 - 13 */
LOCALE_CHAN_01_11 | LOCALE_CHAN_12_13,
LOCALE_RADAR_SET_NONE,
LOCALE_RESTRICTED_SET_2G_SHORT,
@@ -420,7 +428,7 @@ static const locale_info_t locale_i = { /* locale i. channel 1 - 13 */
/*
* Locale Definitions - 5 GHz
*/
-static const locale_info_t locale_11 = {
+static const struct locale_info locale_11 = {
/* locale 11. channel 36 - 48, 52 - 64, 100 - 140, 149 - 165 */
LOCALE_CHAN_36_64 | LOCALE_CHAN_100_140 | LOCALE_CHAN_149_165,
LOCALE_RADAR_SET_1,
@@ -431,19 +439,19 @@ static const locale_info_t locale_11 = {
};

#define LOCALE_2G_IDX_i 0
-static const locale_info_t *g_locale_2g_table[] = {
+static const struct locale_info *g_locale_2g_table[] = {
&locale_i
};

#define LOCALE_5G_IDX_11 0
-static const locale_info_t *g_locale_5g_table[] = {
+static const struct locale_info *g_locale_5g_table[] = {
&locale_11
};

/*
* MIMO Locale Definitions - 2.4 GHz
*/
-static const locale_mimo_info_t locale_bn = {
+static const struct locale_mimo_info locale_bn = {
{QDB(13), QDB(13), QDB(13), QDB(13), QDB(13),
QDB(13), QDB(13), QDB(13), QDB(13), QDB(13),
QDB(13), QDB(13), QDB(13)},
@@ -456,21 +464,21 @@ static const locale_mimo_info_t locale_bn = {
/* locale mimo 2g indexes */
#define LOCALE_MIMO_IDX_bn 0

-static const locale_mimo_info_t *g_mimo_2g_table[] = {
+static const struct locale_mimo_info *g_mimo_2g_table[] = {
&locale_bn
};

/*
* MIMO Locale Definitions - 5 GHz
*/
-static const locale_mimo_info_t locale_11n = {
+static const struct locale_mimo_info locale_11n = {
{ /* 12.5 dBm */ 50, 50, 50, QDB(15), QDB(15)},
{QDB(14), QDB(15), QDB(15), QDB(15), QDB(15)},
0
};

#define LOCALE_MIMO_IDX_11n 0
-static const locale_mimo_info_t *g_mimo_5g_table[] = {
+static const struct locale_mimo_info *g_mimo_5g_table[] = {
&locale_11n
};

@@ -493,7 +501,7 @@ static const locale_mimo_info_t *g_mimo_5g_table[] = {

static const struct {
char abbrev[WLC_CNTRY_BUF_SZ]; /* country abbreviation */
- country_info_t country;
+ struct country_info country;
} cntry_locales[] = {
{
"X2", LOCALES(i, 11, bn, 11n)}, /* Worldwide RoW 2 */
@@ -576,7 +584,7 @@ struct chan20_info chan20_info[] = {
};
#endif /* SUPPORT_40MHZ */

-static const locale_info_t *brcms_c_get_locale_2g(u8 locale_idx)
+static const struct locale_info *brcms_c_get_locale_2g(u8 locale_idx)
{
if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) {
return NULL; /* error condition */
@@ -584,7 +592,7 @@ static const locale_info_t *brcms_c_get_locale_2g(u8 locale_idx)
return g_locale_2g_table[locale_idx];
}

-static const locale_info_t *brcms_c_get_locale_5g(u8 locale_idx)
+static const struct locale_info *brcms_c_get_locale_5g(u8 locale_idx)
{
if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) {
return NULL; /* error condition */
@@ -592,7 +600,7 @@ static const locale_info_t *brcms_c_get_locale_5g(u8 locale_idx)
return g_locale_5g_table[locale_idx];
}

-static const locale_mimo_info_t *brcms_c_get_mimo_2g(u8 locale_idx)
+static const struct locale_mimo_info *brcms_c_get_mimo_2g(u8 locale_idx)
{
if (locale_idx >= ARRAY_SIZE(g_mimo_2g_table)) {
return NULL;
@@ -600,7 +608,7 @@ static const locale_mimo_info_t *brcms_c_get_mimo_2g(u8 locale_idx)
return g_mimo_2g_table[locale_idx];
}

-static const locale_mimo_info_t *brcms_c_get_mimo_5g(u8 locale_idx)
+static const struct locale_mimo_info *brcms_c_get_mimo_5g(u8 locale_idx)
{
if (locale_idx >= ARRAY_SIZE(g_mimo_5g_table)) {
return NULL;
@@ -608,17 +616,17 @@ static const locale_mimo_info_t *brcms_c_get_mimo_5g(u8 locale_idx)
return g_mimo_5g_table[locale_idx];
}

-wlc_cm_info_t *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc)
+struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc)
{
- wlc_cm_info_t *wlc_cm;
+ struct brcms_cm_info *wlc_cm;
char country_abbrev[WLC_CNTRY_BUF_SZ];
- const country_info_t *country;
- struct wlc_pub *pub = wlc->pub;
+ const struct country_info *country;
+ struct brcms_pub *pub = wlc->pub;
char *ccode;

BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);

- wlc_cm = kzalloc(sizeof(wlc_cm_info_t), GFP_ATOMIC);
+ 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__);
@@ -650,12 +658,14 @@ wlc_cm_info_t *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc)
return wlc_cm;
}

-void brcms_c_channel_mgr_detach(wlc_cm_info_t *wlc_cm)
+void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm)
{
kfree(wlc_cm);
}

-u8 brcms_c_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm, uint bandunit)
+u8
+brcms_c_channel_locale_flags_in_band(struct brcms_cm_info *wlc_cm,
+ uint bandunit)
{
return wlc_cm->bandstate[bandunit].locale_flags;
}
@@ -663,7 +673,8 @@ u8 brcms_c_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm, uint bandunit)
/* set the driver's current country and regulatory information using a country code
* as the source. Lookup built in country information found with the country code.
*/
-static int brcms_c_set_countrycode(wlc_cm_info_t *wlc_cm, const char *ccode)
+static int
+brcms_c_set_countrycode(struct brcms_cm_info *wlc_cm, const char *ccode)
{
char country_abbrev[WLC_CNTRY_BUF_SZ];
strncpy(country_abbrev, ccode, WLC_CNTRY_BUF_SZ);
@@ -671,11 +682,11 @@ static int brcms_c_set_countrycode(wlc_cm_info_t *wlc_cm, const char *ccode)
}

static int
-brcms_c_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
+brcms_c_set_countrycode_rev(struct brcms_cm_info *wlc_cm,
const char *country_abbrev,
const char *ccode, int regrev)
{
- const country_info_t *country;
+ const struct country_info *country;
char mapped_ccode[WLC_CNTRY_BUF_SZ];
uint mapped_regrev;

@@ -708,13 +719,13 @@ brcms_c_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
* as the source. Look up built in country information found with the country code.
*/
static void
-brcms_c_set_country_common(wlc_cm_info_t *wlc_cm,
+brcms_c_set_country_common(struct brcms_cm_info *wlc_cm,
const char *country_abbrev,
const char *ccode, uint regrev,
- const country_info_t *country)
+ const struct country_info *country)
{
- const locale_mimo_info_t *li_mimo;
- const locale_info_t *locale;
+ const struct locale_mimo_info *li_mimo;
+ const struct locale_info *locale;
struct brcms_c_info *wlc = wlc_cm->wlc;
char prev_country_abbrev[WLC_CNTRY_BUF_SZ];

@@ -758,10 +769,10 @@ brcms_c_set_country_common(wlc_cm_info_t *wlc_cm,
/* Lookup a country info structure from a null terminated country code
* The lookup is case sensitive.
*/
-static const country_info_t *brcms_c_country_lookup(struct brcms_c_info *wlc,
- const char *ccode)
+static const struct country_info *
+brcms_c_country_lookup(struct brcms_c_info *wlc, const char *ccode)
{
- const country_info_t *country;
+ const struct country_info *country;
char mapped_ccode[WLC_CNTRY_BUF_SZ];
uint mapped_regrev;

@@ -772,13 +783,12 @@ static const country_info_t *brcms_c_country_lookup(struct brcms_c_info *wlc,
return country;
}

-static const country_info_t *brcms_c_countrycode_map(wlc_cm_info_t *wlc_cm,
- const char *ccode,
- char *mapped_ccode,
- uint *mapped_regrev)
+static const struct country_info *
+brcms_c_countrycode_map(struct brcms_cm_info *wlc_cm, const char *ccode,
+ char *mapped_ccode, uint *mapped_regrev)
{
struct brcms_c_info *wlc = wlc_cm->wlc;
- const country_info_t *country;
+ const struct country_info *country;
uint srom_regrev = wlc_cm->srom_regrev;
const char *srom_ccode = wlc_cm->srom_ccode;
int mapped;
@@ -822,7 +832,7 @@ static const country_info_t *brcms_c_countrycode_map(wlc_cm_info_t *wlc_cm,
}

static int
-brcms_c_country_aggregate_map(wlc_cm_info_t *wlc_cm, const char *ccode,
+brcms_c_country_aggregate_map(struct brcms_cm_info *wlc_cm, const char *ccode,
char *mapped_ccode, uint *mapped_regrev)
{
return false;
@@ -831,8 +841,8 @@ brcms_c_country_aggregate_map(wlc_cm_info_t *wlc_cm, const char *ccode,
/* Lookup a country info structure from a null terminated country
* abbreviation and regrev directly with no translation.
*/
-static const country_info_t *brcms_c_country_lookup_direct(const char *ccode,
- uint regrev)
+static const struct country_info *
+brcms_c_country_lookup_direct(const char *ccode, uint regrev)
{
uint size, i;

@@ -854,14 +864,15 @@ static const country_info_t *brcms_c_country_lookup_direct(const char *ccode,
}

static int
-brcms_c_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country)
+brcms_c_channels_init(struct brcms_cm_info *wlc_cm,
+ const struct country_info *country)
{
struct brcms_c_info *wlc = wlc_cm->wlc;
uint i, j;
struct brcms_c_band *band;
- const locale_info_t *li;
+ const struct locale_info *li;
chanvec_t sup_chan;
- const locale_mimo_info_t *li_mimo;
+ const struct locale_mimo_info *li_mimo;

band = wlc->band;
for (i = 0; i < NBANDS(wlc);
@@ -906,7 +917,7 @@ brcms_c_channels_init(wlc_cm_info_t *wlc_cm, const country_info_t *country)
/* Update the radio state (enable/disable) and tx power targets
* based on a new set of channel/regulatory information
*/
-static void brcms_c_channels_commit(wlc_cm_info_t *wlc_cm)
+static void brcms_c_channels_commit(struct brcms_cm_info *wlc_cm)
{
struct brcms_c_info *wlc = wlc_cm->wlc;
uint chan;
@@ -955,7 +966,7 @@ static void brcms_c_channels_commit(wlc_cm_info_t *wlc_cm)
}

/* reset the quiet channels vector to the union of the restricted and radar channel sets */
-static void brcms_c_quiet_channels_reset(wlc_cm_info_t *wlc_cm)
+static void brcms_c_quiet_channels_reset(struct brcms_cm_info *wlc_cm)
{
struct brcms_c_info *wlc = wlc_cm->wlc;
uint i, j;
@@ -976,7 +987,8 @@ static void brcms_c_quiet_channels_reset(wlc_cm_info_t *wlc_cm)
}
}

-static bool brcms_c_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec)
+static bool
+brcms_c_quiet_chanspec(struct brcms_cm_info *wlc_cm, chanspec_t chspec)
{
return N_ENAB(wlc_cm->wlc->pub) && CHSPEC_IS40(chspec) ?
(isset
@@ -993,7 +1005,7 @@ static bool brcms_c_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec)
/* Is the channel valid for the current locale? (but don't consider channels not
* available due to bandlocking)
*/
-static bool brcms_c_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val)
+static bool brcms_c_valid_channel20_db(struct brcms_cm_info *wlc_cm, uint val)
{
struct brcms_c_info *wlc = wlc_cm->wlc;

@@ -1003,15 +1015,15 @@ static bool brcms_c_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val)
}

/* Is the channel valid for the current locale and specified band? */
-static bool
-brcms_c_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit, uint val)
+static bool brcms_c_valid_channel20_in_band(struct brcms_cm_info *wlc_cm,
+ uint bandunit, uint val)
{
return ((val < MAXCHANNEL)
&& isset(wlc_cm->bandstate[bandunit].valid_channels.vec, val));
}

/* Is the channel valid for the current locale and current band? */
-static bool brcms_c_valid_channel20(wlc_cm_info_t *wlc_cm, uint val)
+static bool brcms_c_valid_channel20(struct brcms_cm_info *wlc_cm, uint val)
{
struct brcms_c_info *wlc = wlc_cm->wlc;

@@ -1021,10 +1033,9 @@ static bool brcms_c_valid_channel20(wlc_cm_info_t *wlc_cm, uint val)
}

static void
-brcms_c_channel_min_txpower_limits_with_local_constraint(wlc_cm_info_t *wlc_cm,
- struct txpwr_limits *txpwr,
- u8
- local_constraint_qdbm)
+brcms_c_channel_min_txpower_limits_with_local_constraint(
+ struct brcms_cm_info *wlc_cm, struct txpwr_limits *txpwr,
+ u8 local_constraint_qdbm)
{
int j;

@@ -1108,7 +1119,7 @@ brcms_c_channel_min_txpower_limits_with_local_constraint(wlc_cm_info_t *wlc_cm,
}

void
-brcms_c_channel_set_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
+brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
u8 local_constraint_qdbm)
{
struct brcms_c_info *wlc = wlc_cm->wlc;
@@ -1125,7 +1136,7 @@ brcms_c_channel_set_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
}

#ifdef POWER_DBG
-static void wlc_phy_txpower_limits_dump(txpwr_limits_t *txpwr)
+static void wlc_phy_txpower_limits_dump(struct txpwr_limits *txpwr)
{
int i;
char buf[80];
@@ -1242,25 +1253,25 @@ static void wlc_phy_txpower_limits_dump(txpwr_limits_t *txpwr)
#endif /* POWER_DBG */

void
-brcms_c_channel_reg_limits(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
- txpwr_limits_t *txpwr)
+brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
+ struct txpwr_limits *txpwr)
{
struct brcms_c_info *wlc = wlc_cm->wlc;
uint i;
uint chan;
int maxpwr;
int delta;
- const country_info_t *country;
+ const struct country_info *country;
struct brcms_c_band *band;
- const locale_info_t *li;
+ const struct locale_info *li;
int conducted_max;
int conducted_ofdm_max;
- const locale_mimo_info_t *li_mimo;
+ const struct locale_mimo_info *li_mimo;
int maxpwr20, maxpwr40;
int maxpwr_idx;
uint j;

- memset(txpwr, 0, sizeof(txpwr_limits_t));
+ memset(txpwr, 0, sizeof(struct txpwr_limits));

if (!brcms_c_valid_chanspec_db(wlc_cm, chanspec)) {
country = brcms_c_country_lookup(wlc, wlc->autocountry_default);
@@ -1472,7 +1483,7 @@ static bool brcms_c_japan_ccode(const char *ccode)
* are valid 20MZH channels in this locale and they are also a legal HT combination
*/
static bool
-brcms_c_valid_chanspec_ext(wlc_cm_info_t *wlc_cm, chanspec_t chspec,
+brcms_c_valid_chanspec_ext(struct brcms_cm_info *wlc_cm, chanspec_t chspec,
bool dualband)
{
struct brcms_c_info *wlc = wlc_cm->wlc;
@@ -1534,7 +1545,7 @@ brcms_c_valid_chanspec_ext(wlc_cm_info_t *wlc_cm, chanspec_t chspec,
return false;
}

-bool brcms_c_valid_chanspec_db(wlc_cm_info_t *wlc_cm, chanspec_t chspec)
+bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm, chanspec_t chspec)
{
return brcms_c_valid_chanspec_ext(wlc_cm, chspec, true);
}
diff --git a/drivers/staging/brcm80211/brcmsmac/channel.h b/drivers/staging/brcm80211/brcmsmac/channel.h
index 6fe8050..ff7123c 100644
--- a/drivers/staging/brcm80211/brcmsmac/channel.h
+++ b/drivers/staging/brcm80211/brcmsmac/channel.h
@@ -103,18 +103,21 @@ struct country_info {
const u8 locale_mimo_5G; /* 5G mimo info */
};

-extern wlc_cm_info_t *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
-extern void brcms_c_channel_mgr_detach(wlc_cm_info_t *wlc_cm);
+extern struct brcms_cm_info *
+brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);

-extern u8 brcms_c_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm,
+extern void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm);
+
+extern u8 brcms_c_channel_locale_flags_in_band(struct brcms_cm_info *wlc_cm,
uint bandunit);

-extern bool brcms_c_valid_chanspec_db(wlc_cm_info_t *wlc_cm, chanspec_t chspec);
+extern bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm,
+ chanspec_t chspec);

-extern void brcms_c_channel_reg_limits(wlc_cm_info_t *wlc_cm,
+extern void brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm,
chanspec_t chanspec,
struct txpwr_limits *txpwr);
-extern void brcms_c_channel_set_chanspec(wlc_cm_info_t *wlc_cm,
+extern void brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm,
chanspec_t chanspec,
u8 local_constraint_qdbm);

diff --git a/drivers/staging/brcm80211/brcmsmac/d11.h b/drivers/staging/brcm80211/brcmsmac/d11.h
index bb8bb38..37629bf 100644
--- a/drivers/staging/brcm80211/brcmsmac/d11.h
+++ b/drivers/staging/brcm80211/brcmsmac/d11.h
@@ -1308,11 +1308,11 @@ struct d11rxhdr {
u16 RxChan; /* gain code, channel radio code, and phy type */
} __attribute__((packed));

-#define RXHDR_LEN 24 /* sizeof d11rxhdr_t */
+#define RXHDR_LEN 24 /* sizeof struct d11rxhdr */
#define FRAMELEN(h) ((h)->RxFrameSize)

-struct wlc_d11rxhdr {
- d11rxhdr_t rxhdr;
+struct brcms_d11rxhdr {
+ struct d11rxhdr rxhdr;
u32 tsf_l; /* TSF_L reading */
s8 rssi; /* computed instanteneous rssi in BMAC */
s8 rxpwr0; /* obsoleted, place holder for legacy ROM code. use rxpwr[] */
diff --git a/drivers/staging/brcm80211/brcmsmac/dma.c b/drivers/staging/brcm80211/brcmsmac/dma.c
index 5cdbfe9..ea17671 100644
--- a/drivers/staging/brcm80211/brcmsmac/dma.c
+++ b/drivers/staging/brcm80211/brcmsmac/dma.c
@@ -34,7 +34,7 @@
#define D64MAXRINGSZ (1 << D64RINGALIGN_BITS)
#define D64RINGALIGN (1 << D64RINGALIGN_BITS)

-#define D64MAXDD (D64MAXRINGSZ / sizeof(dma64dd_t))
+#define D64MAXDD (D64MAXRINGSZ / sizeof(struct dma64desc))

/* transmit channel control */
#define D64_XC_XE 0x00000001 /* transmit enable */
@@ -205,31 +205,31 @@ static uint dma_msg_level;
#define W_SM(r, v) (*(r) = (v))

/* One physical DMA segment */
-typedef struct {
+struct dma_seg {
dmaaddr_t addr;
u32 length;
-} dma_seg_t;
+};

-typedef struct {
+struct dma_seg_map {
void *oshdmah; /* Opaque handle for OSL to store its information */
uint origsize; /* Size of the virtual packet */
uint nsegs;
- dma_seg_t segs[MAX_DMA_SEGS];
-} dma_seg_map_t;
+ struct dma_seg segs[MAX_DMA_SEGS];
+};

/*
* DMA Descriptor
* Descriptors are only read by the hardware, never written back.
*/
-typedef volatile struct {
+struct dma64desc {
u32 ctrl1; /* misc control bits & bufcount */
u32 ctrl2; /* buffer count and address extension */
u32 addrlow; /* memory address of the date buffer, bits 31:0 */
u32 addrhigh; /* memory address of the date buffer, bits 63:32 */
-} dma64dd_t;
+};

/* dma engine software state */
-typedef struct dma_info {
+struct dma_info {
struct dma_pub dma; /* exported structure */
uint *msg_level; /* message level pointer */
char name[MAXNAMEL]; /* callers name for diag msgs */
@@ -243,8 +243,10 @@ typedef struct dma_info {
struct {
dma64regs_t *txregs_64; /* 64-bit dma tx engine registers */
dma64regs_t *rxregs_64; /* 64-bit dma rx engine registers */
- dma64dd_t *txd_64; /* pointer to dma64 tx descriptor ring */
- dma64dd_t *rxd_64; /* pointer to dma64 rx descriptor ring */
+ /* pointer to dma64 tx descriptor ring */
+ struct dma64desc *txd_64;
+ /* pointer to dma64 rx descriptor ring */
+ struct dma64desc *rxd_64;
} d64_u;
} dregs;

@@ -254,7 +256,7 @@ typedef struct dma_info {
u16 txin; /* index of next descriptor to reclaim */
u16 txout; /* index of next descriptor to post */
void **txp; /* pointer to parallel array of pointers to packets */
- dma_seg_map_t *txp_dmah; /* DMA MAP meta-data handle */
+ struct dma_seg_map *txp_dmah; /* DMA MAP meta-data handle */
dmaaddr_t txdpa; /* Aligned physical address of descriptor ring */
dmaaddr_t txdpaorig; /* Original physical address of descriptor ring */
u16 txdalign; /* #bytes added to alloc'd mem to align txd */
@@ -268,7 +270,7 @@ typedef struct dma_info {
u16 rxin; /* index of next descriptor to reclaim */
u16 rxout; /* index of next descriptor to post */
void **rxp; /* pointer to parallel array of pointers to packets */
- dma_seg_map_t *rxp_dmah; /* DMA MAP meta-data handle */
+ struct dma_seg_map *rxp_dmah; /* DMA MAP meta-data handle */
dmaaddr_t rxdpa; /* Aligned physical address of descriptor ring */
dmaaddr_t rxdpaorig; /* Original physical address of descriptor ring */
u16 rxdalign; /* #bytes added to alloc'd mem to align rxd */
@@ -292,7 +294,7 @@ typedef struct dma_info {
uint dataoffsetlow; /* add to get dma address of data buffer, low 32 bits */
uint dataoffsethigh; /* high 32 bits */
bool aligndesc_4k; /* descriptor base need to be aligned or not */
-} dma_info_t;
+};

/* DMA Scatter-gather list is supported. Note this is limited to TX direction only */
#ifdef BCMDMASGLISTOSL
@@ -324,65 +326,67 @@ typedef struct dma_info {
#define PCI64ADDR_HIGH_SHIFT 31 /* address[63] */

/* Common prototypes */
-static bool _dma_isaddrext(dma_info_t *di);
-static bool _dma_descriptor_align(dma_info_t *di);
-static bool _dma_alloc(dma_info_t *di, uint direction);
-static void _dma_detach(dma_info_t *di);
-static void _dma_ddtable_init(dma_info_t *di, uint direction, dmaaddr_t pa);
-static void _dma_rxinit(dma_info_t *di);
-static void *_dma_rx(dma_info_t *di);
-static bool _dma_rxfill(dma_info_t *di);
-static void _dma_rxreclaim(dma_info_t *di);
-static void _dma_rxenable(dma_info_t *di);
-static void *_dma_getnextrxp(dma_info_t *di, bool forceall);
-static void _dma_rx_param_get(dma_info_t *di, u16 *rxoffset,
+static bool _dma_isaddrext(struct dma_info *di);
+static bool _dma_descriptor_align(struct dma_info *di);
+static bool _dma_alloc(struct dma_info *di, uint direction);
+static void _dma_detach(struct dma_info *di);
+static void _dma_ddtable_init(struct dma_info *di, uint direction,
+ dmaaddr_t pa);
+static void _dma_rxinit(struct dma_info *di);
+static void *_dma_rx(struct dma_info *di);
+static bool _dma_rxfill(struct dma_info *di);
+static void _dma_rxreclaim(struct dma_info *di);
+static void _dma_rxenable(struct dma_info *di);
+static void *_dma_getnextrxp(struct dma_info *di, bool forceall);
+static void _dma_rx_param_get(struct dma_info *di, u16 *rxoffset,
u16 *rxbufsize);

-static void _dma_txblock(dma_info_t *di);
-static void _dma_txunblock(dma_info_t *di);
-static uint _dma_txactive(dma_info_t *di);
-static uint _dma_rxactive(dma_info_t *di);
-static uint _dma_txpending(dma_info_t *di);
-static uint _dma_txcommitted(dma_info_t *di);
-
-static void *_dma_peeknexttxp(dma_info_t *di);
-static void *_dma_peeknextrxp(dma_info_t *di);
-static unsigned long _dma_getvar(dma_info_t *di, const char *name);
-static void _dma_counterreset(dma_info_t *di);
-static void _dma_fifoloopbackenable(dma_info_t *di);
-static uint _dma_ctrlflags(dma_info_t *di, uint mask, uint flags);
+static void _dma_txblock(struct dma_info *di);
+static void _dma_txunblock(struct dma_info *di);
+static uint _dma_txactive(struct dma_info *di);
+static uint _dma_rxactive(struct dma_info *di);
+static uint _dma_txpending(struct dma_info *di);
+static uint _dma_txcommitted(struct dma_info *di);
+
+static void *_dma_peeknexttxp(struct dma_info *di);
+static void *_dma_peeknextrxp(struct dma_info *di);
+static unsigned long _dma_getvar(struct dma_info *di, const char *name);
+static void _dma_counterreset(struct dma_info *di);
+static void _dma_fifoloopbackenable(struct dma_info *di);
+static uint _dma_ctrlflags(struct dma_info *di, uint mask, uint flags);
static u8 dma_align_sizetobits(uint size);
-static void *dma_ringalloc(dma_info_t *di, u32 boundary, uint size,
+static void *dma_ringalloc(struct dma_info *di, u32 boundary, uint size,
u16 *alignbits, uint *alloced,
dmaaddr_t *descpa);

/* Prototypes for 64-bit routines */
-static bool dma64_alloc(dma_info_t *di, uint direction);
-static bool dma64_txreset(dma_info_t *di);
-static bool dma64_rxreset(dma_info_t *di);
-static bool dma64_txsuspendedidle(dma_info_t *di);
-static int dma64_txfast(dma_info_t *di, struct sk_buff *p0, bool commit);
-static int dma64_txunframed(dma_info_t *di, void *p0, uint len, bool commit);
-static void *dma64_getpos(dma_info_t *di, bool direction);
-static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range);
-static void *dma64_getnextrxp(dma_info_t *di, bool forceall);
-static void dma64_txrotate(dma_info_t *di);
-
-static bool dma64_rxidle(dma_info_t *di);
-static void dma64_txinit(dma_info_t *di);
-static bool dma64_txenabled(dma_info_t *di);
-static void dma64_txsuspend(dma_info_t *di);
-static void dma64_txresume(dma_info_t *di);
-static bool dma64_txsuspended(dma_info_t *di);
-static void dma64_txreclaim(dma_info_t *di, txd_range_t range);
-static bool dma64_txstopped(dma_info_t *di);
-static bool dma64_rxstopped(dma_info_t *di);
-static bool dma64_rxenabled(dma_info_t *di);
+static bool dma64_alloc(struct dma_info *di, uint direction);
+static bool dma64_txreset(struct dma_info *di);
+static bool dma64_rxreset(struct dma_info *di);
+static bool dma64_txsuspendedidle(struct dma_info *di);
+static int dma64_txfast(struct dma_info *di, struct sk_buff *p0, bool commit);
+static int dma64_txunframed(struct dma_info *di, void *p0, uint len,
+ bool commit);
+static void *dma64_getpos(struct dma_info *di, bool direction);
+static void *dma64_getnexttxp(struct dma_info *di, enum txd_range range);
+static void *dma64_getnextrxp(struct dma_info *di, bool forceall);
+static void dma64_txrotate(struct dma_info *di);
+
+static bool dma64_rxidle(struct dma_info *di);
+static void dma64_txinit(struct dma_info *di);
+static bool dma64_txenabled(struct dma_info *di);
+static void dma64_txsuspend(struct dma_info *di);
+static void dma64_txresume(struct dma_info *di);
+static bool dma64_txsuspended(struct dma_info *di);
+static void dma64_txreclaim(struct dma_info *di, enum txd_range range);
+static bool dma64_txstopped(struct dma_info *di);
+static bool dma64_rxstopped(struct dma_info *di);
+static bool dma64_rxenabled(struct dma_info *di);
static bool _dma64_addrext(dma64regs_t *dma64regs);

static inline u32 parity32(u32 data);

-const di_fcn_t dma64proc = {
+const struct di_fcn_s dma64proc = {
(di_detach_t) _dma_detach,
(di_txinit_t) dma64_txinit,
(di_txreset_t) dma64_txreset,
@@ -434,11 +438,11 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
uint nrxd, uint rxbufsize, int rxextheadroom,
uint nrxpost, uint rxoffset, uint *msg_level)
{
- dma_info_t *di;
+ struct dma_info *di;
uint size;

/* allocate private info structure */
- di = kzalloc(sizeof(dma_info_t), GFP_ATOMIC);
+ di = kzalloc(sizeof(struct dma_info), GFP_ATOMIC);
if (di == NULL) {
#ifdef BCMDBG
printk(KERN_ERR "dma_attach: out of memory\n");
@@ -454,7 +458,7 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
/* init dma reg pointer */
di->d64txregs = (dma64regs_t *) dmaregstx;
di->d64rxregs = (dma64regs_t *) dmaregsrx;
- di->dma.di_fn = (const di_fcn_t *)&dma64proc;
+ di->dma.di_fn = (const struct di_fcn_s *)&dma64proc;

/* Default flags (which can be changed by the driver calling dma_ctrlflags
* before enable): For backwards compatibility both Rx Overflow Continue
@@ -582,14 +586,14 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
/* allocate DMA mapping vectors */
if (DMASGLIST_ENAB) {
if (ntxd) {
- size = ntxd * sizeof(dma_seg_map_t);
+ size = ntxd * sizeof(struct dma_seg_map);
di->txp_dmah = kzalloc(size, GFP_ATOMIC);
if (di->txp_dmah == NULL)
goto fail;
}

if (nrxd) {
- size = nrxd * sizeof(dma_seg_map_t);
+ size = nrxd * sizeof(struct dma_seg_map);
di->rxp_dmah = kzalloc(size, GFP_ATOMIC);
if (di->rxp_dmah == NULL)
goto fail;
@@ -618,8 +622,8 @@ static inline u32 parity32(u32 data)
#define DMA64_DD_PARITY(dd) parity32((dd)->addrlow ^ (dd)->addrhigh ^ (dd)->ctrl1 ^ (dd)->ctrl2)

static inline void
-dma64_dd_upd(dma_info_t *di, dma64dd_t *ddring, dmaaddr_t pa, uint outidx,
- u32 *flags, u32 bufcount)
+dma64_dd_upd(struct dma_info *di, struct dma64desc *ddring,
+ dmaaddr_t pa, uint outidx, u32 *flags, u32 bufcount)
{
u32 ctrl2 = bufcount & D64_CTRL2_BC_MASK;

@@ -660,7 +664,7 @@ dma64_dd_upd(dma_info_t *di, dma64dd_t *ddring, dmaaddr_t pa, uint outidx,
}
}

-static bool _dma_alloc(dma_info_t *di, uint direction)
+static bool _dma_alloc(struct dma_info *di, uint direction)
{
return dma64_alloc(di, direction);
}
@@ -678,7 +682,7 @@ void *dma_alloc_consistent(struct pci_dev *pdev, uint size, u16 align_bits,
}

/* !! may be called with core in reset */
-static void _dma_detach(dma_info_t *di)
+static void _dma_detach(struct dma_info *di)
{

DMA_TRACE(("%s: dma_detach\n", di->name));
@@ -708,7 +712,7 @@ static void _dma_detach(dma_info_t *di)

}

-static bool _dma_descriptor_align(dma_info_t *di)
+static bool _dma_descriptor_align(struct dma_info *di)
{
u32 addrl;

@@ -728,7 +732,7 @@ static bool _dma_descriptor_align(dma_info_t *di)
}

/* return true if this dma engine supports DmaExtendedAddrChanges, otherwise false */
-static bool _dma_isaddrext(dma_info_t *di)
+static bool _dma_isaddrext(struct dma_info *di)
{
/* DMA64 supports full 32- or 64-bit operation. AE is always valid */

@@ -750,7 +754,7 @@ static bool _dma_isaddrext(dma_info_t *di)
}

/* initialize descriptor table base address */
-static void _dma_ddtable_init(dma_info_t *di, uint direction, dmaaddr_t pa)
+static void _dma_ddtable_init(struct dma_info *di, uint direction, dmaaddr_t pa)
{
if (!di->aligndesc_4k) {
if (direction == DMA_TX)
@@ -799,14 +803,14 @@ static void _dma_ddtable_init(dma_info_t *di, uint direction, dmaaddr_t pa)
}
}

-static void _dma_fifoloopbackenable(dma_info_t *di)
+static void _dma_fifoloopbackenable(struct dma_info *di)
{
DMA_TRACE(("%s: dma_fifoloopbackenable\n", di->name));

OR_REG(&di->d64txregs->control, D64_XC_LE);
}

-static void _dma_rxinit(dma_info_t *di)
+static void _dma_rxinit(struct dma_info *di)
{
DMA_TRACE(("%s: dma_rxinit\n", di->name));

@@ -817,7 +821,7 @@ static void _dma_rxinit(dma_info_t *di)

/* clear rx descriptor ring */
memset((void *)di->rxd64, '\0',
- (di->nrxd * sizeof(dma64dd_t)));
+ (di->nrxd * sizeof(struct dma64desc)));

/* DMA engine with out alignment requirement requires table to be inited
* before enabling the engine
@@ -831,7 +835,7 @@ static void _dma_rxinit(dma_info_t *di)
_dma_ddtable_init(di, DMA_RX, di->rxdpa);
}

-static void _dma_rxenable(dma_info_t *di)
+static void _dma_rxenable(struct dma_info *di)
{
uint dmactrlflags = di->dma.dmactrlflags;
u32 control;
@@ -853,7 +857,7 @@ static void _dma_rxenable(dma_info_t *di)
}

static void
-_dma_rx_param_get(dma_info_t *di, u16 *rxoffset, u16 *rxbufsize)
+_dma_rx_param_get(struct dma_info *di, u16 *rxoffset, u16 *rxbufsize)
{
/* the normal values fit into 16 bits */
*rxoffset = (u16) di->rxoffset;
@@ -869,7 +873,7 @@ _dma_rx_param_get(dma_info_t *di, u16 *rxoffset, u16 *rxbufsize)
* After it reaches the max size of buffer, the data continues in next DMA descriptor
* buffer WITHOUT DMA header
*/
-static void *_dma_rx(dma_info_t *di)
+static void *_dma_rx(struct dma_info *di)
{
struct sk_buff *p, *head, *tail;
uint len;
@@ -909,7 +913,7 @@ static void *_dma_rx(dma_info_t *di)
B2I(((R_REG(&di->d64rxregs->status0) &
D64_RS0_CD_MASK) -
di->rcvptrbase) & D64_RS0_CD_MASK,
- dma64dd_t);
+ struct dma64desc);
DMA_ERROR(("_dma_rx, rxin %d rxout %d, hw_curr %d\n",
di->rxin, di->rxout, cur));
}
@@ -932,7 +936,7 @@ static void *_dma_rx(dma_info_t *di)
* this will stall the rx dma and user might want to call rxfill again asap
* This unlikely happens on memory-rich NIC, but often on memory-constrained dongle
*/
-static bool _dma_rxfill(dma_info_t *di)
+static bool _dma_rxfill(struct dma_info *di)
{
struct sk_buff *p;
u16 rxin, rxout;
@@ -990,7 +994,7 @@ static bool _dma_rxfill(dma_info_t *di)

if (DMASGLIST_ENAB)
memset(&di->rxp_dmah[rxout], 0,
- sizeof(dma_seg_map_t));
+ sizeof(struct dma_seg_map));

pa = pci_map_single(di->pbus, p->data,
di->rxbufsize, PCI_DMA_FROMDEVICE);
@@ -1012,13 +1016,13 @@ static bool _dma_rxfill(dma_info_t *di)

/* update the chip lastdscr pointer */
W_REG(&di->d64rxregs->ptr,
- di->rcvptrbase + I2B(rxout, dma64dd_t));
+ di->rcvptrbase + I2B(rxout, struct dma64desc));

return ring_empty;
}

/* like getnexttxp but no reclaim */
-static void *_dma_peeknexttxp(dma_info_t *di)
+static void *_dma_peeknexttxp(struct dma_info *di)
{
uint end, i;

@@ -1028,7 +1032,7 @@ static void *_dma_peeknexttxp(dma_info_t *di)
end =
B2I(((R_REG(&di->d64txregs->status0) &
D64_XS0_CD_MASK) - di->xmtptrbase) & D64_XS0_CD_MASK,
- dma64dd_t);
+ struct dma64desc);

for (i = di->txin; i != end; i = NEXTTXD(i))
if (di->txp[i])
@@ -1038,7 +1042,7 @@ static void *_dma_peeknexttxp(dma_info_t *di)
}

/* like getnextrxp but not take off the ring */
-static void *_dma_peeknextrxp(dma_info_t *di)
+static void *_dma_peeknextrxp(struct dma_info *di)
{
uint end, i;

@@ -1048,7 +1052,7 @@ static void *_dma_peeknextrxp(dma_info_t *di)
end =
B2I(((R_REG(&di->d64rxregs->status0) &
D64_RS0_CD_MASK) - di->rcvptrbase) & D64_RS0_CD_MASK,
- dma64dd_t);
+ struct dma64desc);

for (i = di->rxin; i != end; i = NEXTRXD(i))
if (di->rxp[i])
@@ -1057,7 +1061,7 @@ static void *_dma_peeknextrxp(dma_info_t *di)
return NULL;
}

-static void _dma_rxreclaim(dma_info_t *di)
+static void _dma_rxreclaim(struct dma_info *di)
{
void *p;

@@ -1067,7 +1071,7 @@ static void _dma_rxreclaim(dma_info_t *di)
brcmu_pkt_buf_free_skb(p);
}

-static void *_dma_getnextrxp(dma_info_t *di, bool forceall)
+static void *_dma_getnextrxp(struct dma_info *di, bool forceall)
{
if (di->nrxd == 0)
return NULL;
@@ -1075,34 +1079,34 @@ static void *_dma_getnextrxp(dma_info_t *di, bool forceall)
return dma64_getnextrxp(di, forceall);
}

-static void _dma_txblock(dma_info_t *di)
+static void _dma_txblock(struct dma_info *di)
{
di->dma.txavail = 0;
}

-static void _dma_txunblock(dma_info_t *di)
+static void _dma_txunblock(struct dma_info *di)
{
di->dma.txavail = di->ntxd - NTXDACTIVE(di->txin, di->txout) - 1;
}

-static uint _dma_txactive(dma_info_t *di)
+static uint _dma_txactive(struct dma_info *di)
{
return NTXDACTIVE(di->txin, di->txout);
}

-static uint _dma_txpending(dma_info_t *di)
+static uint _dma_txpending(struct dma_info *di)
{
uint curr;

curr =
B2I(((R_REG(&di->d64txregs->status0) &
D64_XS0_CD_MASK) - di->xmtptrbase) & D64_XS0_CD_MASK,
- dma64dd_t);
+ struct dma64desc);

return NTXDACTIVE(curr, di->txout);
}

-static uint _dma_txcommitted(dma_info_t *di)
+static uint _dma_txcommitted(struct dma_info *di)
{
uint ptr;
uint txin = di->txin;
@@ -1110,17 +1114,17 @@ static uint _dma_txcommitted(dma_info_t *di)
if (txin == di->txout)
return 0;

- ptr = B2I(R_REG(&di->d64txregs->ptr), dma64dd_t);
+ ptr = B2I(R_REG(&di->d64txregs->ptr), struct dma64desc);

return NTXDACTIVE(di->txin, ptr);
}

-static uint _dma_rxactive(dma_info_t *di)
+static uint _dma_rxactive(struct dma_info *di)
{
return NRXDACTIVE(di->rxin, di->rxout);
}

-static void _dma_counterreset(dma_info_t *di)
+static void _dma_counterreset(struct dma_info *di)
{
/* reset all software counter */
di->dma.rxgiants = 0;
@@ -1128,7 +1132,7 @@ static void _dma_counterreset(dma_info_t *di)
di->dma.txnobuf = 0;
}

-static uint _dma_ctrlflags(dma_info_t *di, uint mask, uint flags)
+static uint _dma_ctrlflags(struct dma_info *di, uint mask, uint flags)
{
uint dmactrlflags = di->dma.dmactrlflags;

@@ -1165,7 +1169,7 @@ static uint _dma_ctrlflags(dma_info_t *di, uint mask, uint flags)
}

/* get the address of the var in order to change later */
-static unsigned long _dma_getvar(dma_info_t *di, const char *name)
+static unsigned long _dma_getvar(struct dma_info *di, const char *name)
{
if (!strcmp(name, "&txavail"))
return (unsigned long)&(di->dma.txavail);
@@ -1188,7 +1192,7 @@ u8 dma_align_sizetobits(uint size)
* descriptor ring size aligned location. This will ensure that the ring will
* not cross page boundary
*/
-static void *dma_ringalloc(dma_info_t *di, u32 boundary, uint size,
+static void *dma_ringalloc(struct dma_info *di, u32 boundary, uint size,
u16 *alignbits, uint *alloced,
dmaaddr_t *descpa)
{
@@ -1214,7 +1218,7 @@ static void *dma_ringalloc(dma_info_t *di, u32 boundary, uint size,

/* 64-bit DMA functions */

-static void dma64_txinit(dma_info_t *di)
+static void dma64_txinit(struct dma_info *di)
{
u32 control = D64_XC_XE;

@@ -1227,7 +1231,7 @@ static void dma64_txinit(dma_info_t *di)
di->dma.txavail = di->ntxd - 1;

/* clear tx descriptor ring */
- memset((void *)di->txd64, '\0', (di->ntxd * sizeof(dma64dd_t)));
+ memset((void *)di->txd64, '\0', (di->ntxd * sizeof(struct dma64desc)));

/* DMA engine with out alignment requirement requires table to be inited
* before enabling the engine
@@ -1246,7 +1250,7 @@ static void dma64_txinit(dma_info_t *di)
_dma_ddtable_init(di, DMA_TX, di->txdpa);
}

-static bool dma64_txenabled(dma_info_t *di)
+static bool dma64_txenabled(struct dma_info *di)
{
u32 xc;

@@ -1255,7 +1259,7 @@ static bool dma64_txenabled(dma_info_t *di)
return (xc != 0xffffffff) && (xc & D64_XC_XE);
}

-static void dma64_txsuspend(dma_info_t *di)
+static void dma64_txsuspend(struct dma_info *di)
{
DMA_TRACE(("%s: dma_txsuspend\n", di->name));

@@ -1265,7 +1269,7 @@ static void dma64_txsuspend(dma_info_t *di)
OR_REG(&di->d64txregs->control, D64_XC_SE);
}

-static void dma64_txresume(dma_info_t *di)
+static void dma64_txresume(struct dma_info *di)
{
DMA_TRACE(("%s: dma_txresume\n", di->name));

@@ -1275,14 +1279,14 @@ static void dma64_txresume(dma_info_t *di)
AND_REG(&di->d64txregs->control, ~D64_XC_SE);
}

-static bool dma64_txsuspended(dma_info_t *di)
+static bool dma64_txsuspended(struct dma_info *di)
{
return (di->ntxd == 0) ||
((R_REG(&di->d64txregs->control) & D64_XC_SE) ==
D64_XC_SE);
}

-static void dma64_txreclaim(dma_info_t *di, txd_range_t range)
+static void dma64_txreclaim(struct dma_info *di, enum txd_range range)
{
void *p;

@@ -1302,19 +1306,19 @@ static void dma64_txreclaim(dma_info_t *di, txd_range_t range)
}
}

-static bool dma64_txstopped(dma_info_t *di)
+static bool dma64_txstopped(struct dma_info *di)
{
return ((R_REG(&di->d64txregs->status0) & D64_XS0_XS_MASK) ==
D64_XS0_XS_STOPPED);
}

-static bool dma64_rxstopped(dma_info_t *di)
+static bool dma64_rxstopped(struct dma_info *di)
{
return ((R_REG(&di->d64rxregs->status0) & D64_RS0_RS_MASK) ==
D64_RS0_RS_STOPPED);
}

-static bool dma64_alloc(dma_info_t *di, uint direction)
+static bool dma64_alloc(struct dma_info *di, uint direction)
{
u16 size;
uint ddlen;
@@ -1323,7 +1327,7 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
u16 align;
u16 align_bits;

- ddlen = sizeof(dma64dd_t);
+ ddlen = sizeof(struct dma64desc);

size = (direction == DMA_TX) ? (di->ntxd * ddlen) : (di->nrxd * ddlen);
align_bits = di->dmadesc_align;
@@ -1337,7 +1341,8 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
return false;
}
align = (1 << align_bits);
- di->txd64 = (dma64dd_t *) roundup((unsigned long)va, align);
+ di->txd64 = (struct dma64desc *)
+ roundup((unsigned long)va, align);
di->txdalign = (uint) ((s8 *)di->txd64 - (s8 *) va);
PHYSADDRLOSET(di->txdpa,
PHYSADDRLO(di->txdpaorig) + di->txdalign);
@@ -1351,7 +1356,8 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
return false;
}
align = (1 << align_bits);
- di->rxd64 = (dma64dd_t *) roundup((unsigned long)va, align);
+ di->rxd64 = (struct dma64desc *)
+ roundup((unsigned long)va, align);
di->rxdalign = (uint) ((s8 *)di->rxd64 - (s8 *) va);
PHYSADDRLOSET(di->rxdpa,
PHYSADDRLO(di->rxdpaorig) + di->rxdalign);
@@ -1362,7 +1368,7 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
return true;
}

-static bool dma64_txreset(dma_info_t *di)
+static bool dma64_txreset(struct dma_info *di)
{
u32 status;

@@ -1387,7 +1393,7 @@ static bool dma64_txreset(dma_info_t *di)
return status == D64_XS0_XS_DISABLED;
}

-static bool dma64_rxidle(dma_info_t *di)
+static bool dma64_rxidle(struct dma_info *di)
{
DMA_TRACE(("%s: dma_rxidle\n", di->name));

@@ -1398,7 +1404,7 @@ static bool dma64_rxidle(dma_info_t *di)
(R_REG(&di->d64rxregs->ptr) & D64_RS0_CD_MASK));
}

-static bool dma64_rxreset(dma_info_t *di)
+static bool dma64_rxreset(struct dma_info *di)
{
u32 status;

@@ -1413,7 +1419,7 @@ static bool dma64_rxreset(dma_info_t *di)
return status == D64_RS0_RS_DISABLED;
}

-static bool dma64_rxenabled(dma_info_t *di)
+static bool dma64_rxenabled(struct dma_info *di)
{
u32 rc;

@@ -1421,7 +1427,7 @@ static bool dma64_rxenabled(dma_info_t *di)
return (rc != 0xffffffff) && (rc & D64_RC_RE);
}

-static bool dma64_txsuspendedidle(dma_info_t *di)
+static bool dma64_txsuspendedidle(struct dma_info *di)
{

if (di->ntxd == 0)
@@ -1441,7 +1447,7 @@ static bool dma64_txsuspendedidle(dma_info_t *di)
* We return a pointer to the beginning of the DATA buffer of the current descriptor.
* If DMA is idle, we return NULL.
*/
-static void *dma64_getpos(dma_info_t *di, bool direction)
+static void *dma64_getpos(struct dma_info *di, bool direction)
{
void *va;
bool idle;
@@ -1451,12 +1457,12 @@ static void *dma64_getpos(dma_info_t *di, bool direction)
cd_offset =
R_REG(&di->d64txregs->status0) & D64_XS0_CD_MASK;
idle = !NTXDACTIVE(di->txin, di->txout);
- va = di->txp[B2I(cd_offset, dma64dd_t)];
+ va = di->txp[B2I(cd_offset, struct dma64desc)];
} else {
cd_offset =
R_REG(&di->d64rxregs->status0) & D64_XS0_CD_MASK;
idle = !NRXDACTIVE(di->rxin, di->rxout);
- va = di->rxp[B2I(cd_offset, dma64dd_t)];
+ va = di->rxp[B2I(cd_offset, struct dma64desc)];
}

/* If DMA is IDLE, return NULL */
@@ -1476,7 +1482,8 @@ static void *dma64_getpos(dma_info_t *di, bool direction)
* Each call to this is results in a single descriptor being added for "len" bytes of
* data starting at "buf", it doesn't handle chained buffers.
*/
-static int dma64_txunframed(dma_info_t *di, void *buf, uint len, bool commit)
+static int
+dma64_txunframed(struct dma_info *di, void *buf, uint len, bool commit)
{
u16 txout;
u32 flags = 0;
@@ -1510,7 +1517,7 @@ static int dma64_txunframed(dma_info_t *di, void *buf, uint len, bool commit)
/* kick the chip */
if (commit) {
W_REG(&di->d64txregs->ptr,
- di->xmtptrbase + I2B(txout, dma64dd_t));
+ di->xmtptrbase + I2B(txout, struct dma64desc));
}

/* tx flow control */
@@ -1529,7 +1536,7 @@ static int dma64_txunframed(dma_info_t *di, void *buf, uint len, bool commit)
* WARNING: call must check the return value for error.
* the error(toss frames) could be fatal and cause many subsequent hard to debug problems
*/
-static int dma64_txfast(dma_info_t *di, struct sk_buff *p0,
+static int dma64_txfast(struct dma_info *di, struct sk_buff *p0,
bool commit)
{
struct sk_buff *p, *next;
@@ -1549,7 +1556,7 @@ static int dma64_txfast(dma_info_t *di, struct sk_buff *p0,
*/
for (p = p0; p; p = next) {
uint nsegs, j;
- dma_seg_map_t *map;
+ struct dma_seg_map *map;

data = p->data;
len = p->len;
@@ -1565,7 +1572,7 @@ static int dma64_txfast(dma_info_t *di, struct sk_buff *p0,
/* get physical address of buffer start */
if (DMASGLIST_ENAB)
memset(&di->txp_dmah[txout], 0,
- sizeof(dma_seg_map_t));
+ sizeof(struct dma_seg_map));

pa = pci_map_single(di->pbus, data, len, PCI_DMA_TODEVICE);

@@ -1626,7 +1633,7 @@ static int dma64_txfast(dma_info_t *di, struct sk_buff *p0,
/* kick the chip */
if (commit)
W_REG(&di->d64txregs->ptr,
- di->xmtptrbase + I2B(txout, dma64dd_t));
+ di->xmtptrbase + I2B(txout, struct dma64desc));

/* tx flow control */
di->dma.txavail = di->ntxd - NTXDACTIVE(di->txin, di->txout) - 1;
@@ -1651,7 +1658,7 @@ static int dma64_txfast(dma_info_t *di, struct sk_buff *p0,
* If range is DMA_RANGE_ALL, reclaim all txd(s) posted to the ring and
* return associated packet regardless of the value of hardware pointers.
*/
-static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range)
+static void *dma64_getnexttxp(struct dma_info *di, enum txd_range range)
{
u16 start, end, i;
u16 active_desc;
@@ -1674,11 +1681,10 @@ static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range)
else {
dma64regs_t *dregs = di->d64txregs;

- end =
- (u16) (B2I
- (((R_REG(&dregs->status0) &
+ end = (u16) (B2I(((R_REG(&dregs->status0) &
D64_XS0_CD_MASK) -
- di->xmtptrbase) & D64_XS0_CD_MASK, dma64dd_t));
+ di->xmtptrbase) & D64_XS0_CD_MASK,
+ struct dma64desc));

if (range == DMA_RANGE_TRANSFERED) {
active_desc =
@@ -1686,7 +1692,7 @@ static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range)
D64_XS1_AD_MASK);
active_desc =
(active_desc - di->xmtptrbase) & D64_XS0_CD_MASK;
- active_desc = B2I(active_desc, dma64dd_t);
+ active_desc = B2I(active_desc, struct dma64desc);
if (end != active_desc)
end = PREVTXD(active_desc);
}
@@ -1697,7 +1703,7 @@ static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range)

for (i = start; i != end && !txp; i = NEXTTXD(i)) {
dmaaddr_t pa;
- dma_seg_map_t *map = NULL;
+ struct dma_seg_map *map = NULL;
uint size, j, nsegs;

PHYSADDRLOSET(pa,
@@ -1743,7 +1749,7 @@ static void *dma64_getnexttxp(dma_info_t *di, txd_range_t range)
return NULL;
}

-static void *dma64_getnextrxp(dma_info_t *di, bool forceall)
+static void *dma64_getnextrxp(struct dma_info *di, bool forceall)
{
uint i, curr;
void *rxp;
@@ -1757,7 +1763,7 @@ static void *dma64_getnextrxp(dma_info_t *di, bool forceall)

curr =
B2I(((R_REG(&di->d64rxregs->status0) & D64_RS0_CD_MASK) -
- di->rcvptrbase) & D64_RS0_CD_MASK, dma64dd_t);
+ di->rcvptrbase) & D64_RS0_CD_MASK, struct dma64desc);

/* ignore curr if forceall */
if (!forceall && (i == curr))
@@ -1797,7 +1803,7 @@ static bool _dma64_addrext(dma64regs_t *dma64regs)
/*
* Rotate all active tx dma ring entries "forward" by (ActiveDescriptor - txin).
*/
-static void dma64_txrotate(dma_info_t *di)
+static void dma64_txrotate(struct dma_info *di)
{
u16 ad;
uint nactive;
@@ -1807,10 +1813,9 @@ static void dma64_txrotate(dma_info_t *di)
u16 first, last;

nactive = _dma_txactive(di);
- ad = (u16) (B2I
- ((((R_REG(&di->d64txregs->status1) &
- D64_XS1_AD_MASK)
- - di->xmtptrbase) & D64_XS1_AD_MASK), dma64dd_t));
+ ad = (u16) (B2I((((R_REG(&di->d64txregs->status1) &
+ D64_XS1_AD_MASK) - di->xmtptrbase) &
+ D64_XS1_AD_MASK), struct dma64desc));
rot = TXD(ad - di->txin);

/* full-ring case is a lot harder - don't worry about this */
@@ -1851,8 +1856,9 @@ static void dma64_txrotate(dma_info_t *di)
/* Move the map */
if (DMASGLIST_ENAB) {
memcpy(&di->txp_dmah[new], &di->txp_dmah[old],
- sizeof(dma_seg_map_t));
- memset(&di->txp_dmah[old], 0, sizeof(dma_seg_map_t));
+ sizeof(struct dma_seg_map));
+ memset(&di->txp_dmah[old], 0,
+ sizeof(struct dma_seg_map));
}

di->txp[old] = NULL;
@@ -1865,7 +1871,7 @@ static void dma64_txrotate(dma_info_t *di)

/* kick the chip */
W_REG(&di->d64txregs->ptr,
- di->xmtptrbase + I2B(di->txout, dma64dd_t));
+ di->xmtptrbase + I2B(di->txout, struct dma64desc));
}

uint dma_addrwidth(struct si_pub *sih, void *dmaregs)
@@ -1894,7 +1900,7 @@ uint dma_addrwidth(struct si_pub *sih, void *dmaregs)
void dma_walk_packets(struct dma_pub *dmah, void (*callback_fnc)
(void *pkt, void *arg_a), void *arg_a)
{
- dma_info_t *di = (dma_info_t *) dmah;
+ struct dma_info *di = (struct dma_info *) dmah;
uint i = di->txin;
uint end = di->txout;
struct sk_buff *skb;
diff --git a/drivers/staging/brcm80211/brcmsmac/dma.h b/drivers/staging/brcm80211/brcmsmac/dma.h
index ae411a5..9c8b9a6 100644
--- a/drivers/staging/brcm80211/brcmsmac/dma.h
+++ b/drivers/staging/brcm80211/brcmsmac/dma.h
@@ -82,11 +82,11 @@ typedef bool(*di_rxenable_t) (struct dma_pub *dmah);
typedef bool(*di_rxenabled_t) (struct dma_pub *dmah);
typedef void *(*di_rx_t) (struct dma_pub *dmah);
typedef bool(*di_rxfill_t) (struct dma_pub *dmah);
-typedef void (*di_txreclaim_t) (struct dma_pub *dmah, txd_range_t range);
+typedef void (*di_txreclaim_t) (struct dma_pub *dmah, enum txd_range range);
typedef void (*di_rxreclaim_t) (struct dma_pub *dmah);
typedef unsigned long (*di_getvar_t) (struct dma_pub *dmah,
const char *name);
-typedef void *(*di_getnexttxp_t) (struct dma_pub *dmah, txd_range_t range);
+typedef void *(*di_getnexttxp_t) (struct dma_pub *dmah, enum txd_range range);
typedef void *(*di_getnextrxp_t) (struct dma_pub *dmah, bool forceall);
typedef void *(*di_peeknexttxp_t) (struct dma_pub *dmah);
typedef void *(*di_peeknextrxp_t) (struct dma_pub *dmah);
@@ -161,7 +161,7 @@ struct di_fcn_s {
*/
/* export structure */
struct dma_pub {
- const di_fcn_t *di_fn; /* DMA function pointers */
+ const struct di_fcn_s *di_fn; /* DMA function pointers */
uint txavail; /* # free tx descriptors */
uint dmactrlflags; /* dma control flags */

@@ -177,7 +177,7 @@ extern struct dma_pub *dma_attach(char *name, struct si_pub *sih,
uint nrxd, uint rxbufsize, int rxextheadroom,
uint nrxpost, uint rxoffset, uint *msg_level);

-extern const di_fcn_t dma64proc;
+extern const struct di_fcn_s dma64proc;

#define dma_detach(di) (dma64proc.detach(di))
#define dma_txreset(di) (dma64proc.txreset(di))
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
index 26a0a30..42fc04c 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
@@ -56,7 +56,7 @@ struct brcms_firmware {
};

struct brcms_info {
- struct wlc_pub *pub; /* pointer to public wlc state */
+ struct brcms_pub *pub; /* pointer to public wlc state */
void *wlc; /* pointer to private common os-independent data */
u32 magic;

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 7c91b0b..f9e134a 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -304,7 +304,7 @@ static u16 brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc,
struct scb *scb, uint frag,
uint nfrags, uint queue,
uint next_frag_len,
- wsec_key_t *key,
+ struct wsec_key *key,
ratespec_t rspec_override);
static void brcms_c_bss_default_init(struct brcms_c_info *wlc);
static void brcms_c_ucode_mac_upd(struct brcms_c_info *wlc);
@@ -333,9 +333,9 @@ static void brcms_c_compute_mimo_plcp(ratespec_t rate, uint length, u8 *plcp);
static u16 brcms_c_compute_frame_dur(struct brcms_c_info *wlc, ratespec_t rate,
u8 preamble_type, uint next_frag_len);
static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
- struct wlc_d11rxhdr *rxh);
+ struct brcms_d11rxhdr *rxh);
static void brcms_c_recvctl(struct brcms_c_info *wlc,
- d11rxhdr_t *rxh, struct sk_buff *p);
+ struct d11rxhdr *rxh, struct sk_buff *p);
static uint brcms_c_calc_frame_len(struct brcms_c_info *wlc, ratespec_t rate,
u8 preamble_type, uint dur);
static uint brcms_c_calc_ack_time(struct brcms_c_info *wlc, ratespec_t rate,
@@ -417,7 +417,7 @@ void brcms_c_reset(struct brcms_c_info *wlc)

/* reset our snapshot of macstat counters */
memset((char *)wlc->core->macstat_snapshot, 0,
- sizeof(macstat_t));
+ sizeof(struct macstat));

brcms_b_reset(wlc->hw);
}
@@ -1072,9 +1072,10 @@ static void WLBANDINITFN(brcms_c_setband) (struct brcms_c_info *wlc,
}

/* Initialize a WME Parameter Info Element with default STA parameters from WMM Spec, Table 12 */
-void brcms_c_wme_initparams_sta(struct brcms_c_info *wlc, wme_param_ie_t *pe)
+void
+brcms_c_wme_initparams_sta(struct brcms_c_info *wlc, struct wme_param_ie *pe)
{
- static const wme_param_ie_t stadef = {
+ static const struct wme_param_ie stadef = {
WME_OUI,
WME_TYPE,
WME_SUBTYPE_PARAM_IE,
@@ -1100,7 +1101,7 @@ void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
bool suspend)
{
int i;
- shm_acparams_t acp_shm;
+ struct shm_acparams acp_shm;
u16 *shm_entry;

/* Only apply params if the core is out of reset and has clocks */
@@ -1111,7 +1112,7 @@ void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
}

do {
- memset((char *)&acp_shm, 0, sizeof(shm_acparams_t));
+ memset((char *)&acp_shm, 0, sizeof(struct shm_acparams));
/* fill in shm ac params struct */
acp_shm.txop = le16_to_cpu(params->txop);
/* convert from units of 32us to us for ucode */
@@ -1145,7 +1146,7 @@ void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,

/* Fill in shm acparam table */
shm_entry = (u16 *) &acp_shm;
- for (i = 0; i < (int)sizeof(shm_acparams_t); i += 2)
+ for (i = 0; i < (int)sizeof(struct shm_acparams); i += 2)
brcms_c_write_shm(wlc,
M_EDCF_QINFO +
wme_shmemacindex(aci) * M_EDCF_QLEN + i,
@@ -1165,7 +1166,7 @@ void brcms_c_edcf_setparams(struct brcms_c_info *wlc, bool suspend)
{
u16 aci;
int i_ac;
- edcf_acparam_t *edcf_acp;
+ struct edcf_acparam *edcf_acp;

struct ieee80211_tx_queue_params txq_pars;
struct ieee80211_tx_queue_params *params = &txq_pars;
@@ -1176,7 +1177,7 @@ void brcms_c_edcf_setparams(struct brcms_c_info *wlc, bool suspend)
* STA uses AC params from wme_param_ie.
*/

- edcf_acp = (edcf_acparam_t *) &wlc->wme_param_ie.acparam[0];
+ edcf_acp = (struct edcf_acparam *) &wlc->wme_param_ie.acparam[0];

for (i_ac = 0; i_ac < AC_COUNT; i_ac++, edcf_acp++) {
/* find out which ac this set of params applies to */
@@ -1307,7 +1308,7 @@ void brcms_c_info_init(struct brcms_c_info *wlc, int unit)

static bool brcms_c_state_bmac_sync(struct brcms_c_info *wlc)
{
- brcms_b_state_t state_bmac;
+ struct brcms_b_state state_bmac;

if (brcms_b_state_get(wlc->hw, &state_bmac) != 0)
return false;
@@ -1351,7 +1352,7 @@ static uint brcms_c_attach_module(struct brcms_c_info *wlc)
return err;
}

-struct wlc_pub *brcms_c_pub(void *wlc)
+struct brcms_pub *brcms_c_pub(void *wlc)
{
return ((struct brcms_c_info *) wlc)->pub;
}
@@ -1368,7 +1369,7 @@ void *brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
struct brcms_c_info *wlc;
uint err = 0;
uint j;
- struct wlc_pub *pub;
+ struct brcms_pub *pub;
uint n_disabled;

/* allocate struct brcms_c_info state and its substructures */
@@ -2531,7 +2532,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
bool ta_ok;
uint band;
struct brcms_c_bsscfg *bsscfg;
- wlc_bss_info_t *current_bss;
+ struct brcms_bss_info *current_bss;

/* update bsscfg pointer */
bsscfg = wlc->cfg;
@@ -2770,7 +2771,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
/*
* register watchdog and down handlers.
*/
-int brcms_c_module_register(struct wlc_pub *pub,
+int brcms_c_module_register(struct brcms_pub *pub,
const char *name, void *hdl,
watchdog_fn_t w_fn, down_fn_t d_fn)
{
@@ -2793,7 +2794,8 @@ int brcms_c_module_register(struct wlc_pub *pub,
}

/* unregister module callbacks */
-int brcms_c_module_unregister(struct wlc_pub *pub, const char *name, void *hdl)
+int
+brcms_c_module_unregister(struct brcms_pub *pub, const char *name, void *hdl)
{
struct brcms_c_info *wlc = (struct brcms_c_info *) pub->wlc;
int i;
@@ -2855,7 +2857,7 @@ static void brcms_c_print_txs_status(u16 s)
}
#endif /* BCMDBG */

-void brcms_c_print_txstatus(tx_status_t *txs)
+void brcms_c_print_txstatus(struct tx_status *txs)
{
#if defined(BCMDBG)
u16 s = txs->status;
@@ -2883,7 +2885,7 @@ void brcms_c_print_txstatus(tx_status_t *txs)
void brcms_c_statsupd(struct brcms_c_info *wlc)
{
int i;
- macstat_t macstats;
+ struct macstat macstats;
#ifdef BCMDBG
u16 delta;
u16 rxf0ovfl;
@@ -2905,7 +2907,7 @@ void brcms_c_statsupd(struct brcms_c_info *wlc)

/* Read mac stats from contiguous shared memory */
brcms_b_copyfrom_shm(wlc->hw, M_UCODE_MACSTAT,
- &macstats, sizeof(macstat_t));
+ &macstats, sizeof(struct macstat));

#ifdef BCMDBG
/* check for rx fifo 0 overflow */
@@ -2954,7 +2956,7 @@ bool brcms_c_chipmatch(u16 vendor, u16 device)
}

#if defined(BCMDBG)
-void brcms_c_print_txdesc(d11txh_t *txh)
+void brcms_c_print_txdesc(struct d11txh *txh)
{
u16 mtcl = le16_to_cpu(txh->MacTxControlLow);
u16 mtch = le16_to_cpu(txh->MacTxControlHigh);
@@ -2990,7 +2992,7 @@ void brcms_c_print_txdesc(d11txh_t *txh)
/* add plcp header along with txh descriptor */
printk(KERN_DEBUG "Raw TxDesc + plcp header:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
- txh, sizeof(d11txh_t) + 48);
+ txh, sizeof(struct d11txh) + 48);

printk(KERN_DEBUG "TxCtlLow: %04x ", mtcl);
printk(KERN_DEBUG "TxCtlHigh: %04x ", mtch);
@@ -3040,7 +3042,7 @@ void brcms_c_print_txdesc(d11txh_t *txh)
#endif /* defined(BCMDBG) */

#if defined(BCMDBG)
-void brcms_c_print_rxh(d11rxhdr_t *rxh)
+void brcms_c_print_rxh(struct d11rxhdr *rxh)
{
u16 len = rxh->RxFrameSize;
u16 phystatus_0 = rxh->PhyRxStatus_0;
@@ -3062,7 +3064,8 @@ void brcms_c_print_rxh(d11rxhdr_t *rxh)
};

printk(KERN_DEBUG "Raw RxDesc:\n");
- print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, rxh, sizeof(d11rxhdr_t));
+ print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, rxh,
+ sizeof(struct d11rxhdr));

brcmu_format_flags(macstat_flags, macstatus1, flagstr, 64);

@@ -3286,7 +3289,7 @@ void brcms_c_send_q(struct brcms_c_info *wlc)
*/
static inline u16
bcmc_fid_generate(struct brcms_c_info *wlc, struct brcms_c_bsscfg *bsscfg,
- d11txh_t *txh)
+ struct d11txh *txh)
{
u16 frameid;

@@ -3305,9 +3308,9 @@ brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p,
bool commit, s8 txpktpend)
{
u16 frameid = INVALIDFID;
- d11txh_t *txh;
+ struct d11txh *txh;

- txh = (d11txh_t *) (p->data);
+ txh = (struct d11txh *) (p->data);

/* When a BC/MC frame is being committed to the BCMC fifo via DMA (NOT PIO), update
* ucode or BSS info as appropriate.
@@ -3378,7 +3381,7 @@ brcms_c_compute_ofdm_plcp(ratespec_t rspec, u32 length, u8 *plcp)
/* encode rate per 802.11a-1999 sec 17.3.4.1, with lsb transmitted first */
rate_signal = rate_info[rate] & WLC_RATE_MASK;
memset(plcp, 0, D11_PHY_HDR_LEN);
- D11A_PHY_HDR_SRATE((ofdm_phy_hdr_t *) plcp, rate_signal);
+ D11A_PHY_HDR_SRATE((struct ofdm_phy_hdr *) plcp, rate_signal);

tmp = (length & 0xfff) << 5;
plcp[2] |= (tmp >> 16) & 0xff;
@@ -3622,7 +3625,7 @@ brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, ratespec_t rspec,
}

/*
- * Add d11txh_t, cck_phy_hdr_t.
+ * Add struct d11txh, struct cck_phy_hdr.
*
* 'p' data must start with 802.11 MAC header
* 'p' must allow enough bytes of local headers to be "pushed" onto the packet
@@ -3634,10 +3637,10 @@ static u16
brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
struct sk_buff *p, struct scb *scb, uint frag,
uint nfrags, uint queue, uint next_frag_len,
- wsec_key_t *key, ratespec_t rspec_override)
+ struct wsec_key *key, ratespec_t rspec_override)
{
struct ieee80211_hdr *h;
- d11txh_t *txh;
+ struct d11txh *txh;
u8 *plcp, plcp_fallback[D11_PHY_HDR_LEN];
int len, phylen, rts_phylen;
u16 mch, phyctl, xfts, mainrates;
@@ -3693,7 +3696,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
plcp = skb_push(p, D11_PHY_HDR_LEN);

/* add Broadcom tx descriptor header */
- txh = (d11txh_t *) skb_push(p, D11_TXH_LEN);
+ txh = (struct d11txh *) skb_push(p, D11_TXH_LEN);
memset(txh, 0, D11_TXH_LEN);

/* setup frameid */
@@ -3912,7 +3915,8 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
(phylen > wlc->RTSThresh) && !is_multicast_ether_addr(h->addr1))
use_rts = true;

- /* (3) PLCP: determine PLCP header and MAC duration, fill d11txh_t */
+ /* (3) PLCP: determine PLCP header and MAC duration,
+ * fill struct d11txh */
brcms_c_compute_plcp(wlc, rspec[0], phylen, plcp);
brcms_c_compute_plcp(wlc, rspec[1], phylen, plcp_fallback);
memcpy(&txh->FragPLCPFallback,
@@ -3925,9 +3929,9 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
}

/* MIMO-RATE: need validation ?? */
- mainrates =
- IS_OFDM(rspec[0]) ? D11A_PHY_HDR_GRATE((ofdm_phy_hdr_t *) plcp) :
- plcp[0];
+ mainrates = IS_OFDM(rspec[0]) ?
+ D11A_PHY_HDR_GRATE((struct ofdm_phy_hdr *) plcp) :
+ plcp[0];

/* DUR field for main rate */
if (!ieee80211_is_pspoll(h->frame_control) &&
@@ -4011,7 +4015,8 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
txh->MaxABytes_FBR = cpu_to_le16(0);
txh->MinMBytes = cpu_to_le16(0);

- /* (5) RTS/CTS: determine RTS/CTS PLCP header and MAC duration, furnish d11txh_t */
+ /* (5) RTS/CTS: determine RTS/CTS PLCP header and MAC duration,
+ * furnish struct d11txh */
/* RTS PLCP header and RTS frame */
if (use_rts || use_cts) {
if (use_rts && use_cts)
@@ -4091,8 +4096,9 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
* high 8 bits: rts/cts rate/mcs
*/
mainrates |= (IS_OFDM(rts_rspec[0]) ?
- D11A_PHY_HDR_GRATE((ofdm_phy_hdr_t *) rts_plcp) :
- rts_plcp[0]) << 8;
+ D11A_PHY_HDR_GRATE(
+ (struct ofdm_phy_hdr *) rts_plcp) :
+ rts_plcp[0]) << 8;
} else {
memset((char *)txh->RTSPhyHeader, 0, D11_PHY_HDR_LEN);
memset((char *)&txh->rts_frame, 0,
@@ -4283,14 +4289,14 @@ static void brcms_c_war16165(struct brcms_c_info *wlc, bool tx)
}
}

-/* process an individual tx_status_t */
+/* process an individual struct tx_status */
/* WLC_HIGH_API */
bool
-brcms_c_dotxstatus(struct brcms_c_info *wlc, tx_status_t *txs, u32 frm_tx2)
+brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs, u32 frm_tx2)
{
struct sk_buff *p;
uint queue;
- d11txh_t *txh;
+ struct d11txh *txh;
struct scb *scb = NULL;
bool free_pdu;
int tx_rts, tx_frame_count, tx_rts_count;
@@ -4328,7 +4334,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, tx_status_t *txs, u32 frm_tx2)
if (p == NULL)
goto fatal;

- txh = (d11txh_t *) (p->data);
+ txh = (struct d11txh *) (p->data);
mcl = le16_to_cpu(txh->MacTxControlLow);

if (txs->phyerr) {
@@ -4495,7 +4501,7 @@ void brcms_c_bcn_li_upd(struct brcms_c_info *wlc)
* are used. Finally, the tsf_h is read from the tsf register.
*/
static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
- struct wlc_d11rxhdr *rxh)
+ struct brcms_d11rxhdr *rxh)
{
u32 tsf_h, tsf_l;
u16 rx_tsf_0_15, rx_tsf_16_31;
@@ -4519,11 +4525,11 @@ static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
}

static void
-prep_mac80211_status(struct brcms_c_info *wlc, d11rxhdr_t *rxh,
+prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
struct sk_buff *p,
struct ieee80211_rx_status *rx_status)
{
- wlc_d11rxhdr_t *wlc_rxh = (wlc_d11rxhdr_t *) rxh;
+ struct brcms_d11rxhdr *wlc_rxh = (struct brcms_d11rxhdr *) rxh;
int preamble;
int channel;
ratespec_t rspec;
@@ -4630,7 +4636,8 @@ prep_mac80211_status(struct brcms_c_info *wlc, d11rxhdr_t *rxh,
}

static void
-brcms_c_recvctl(struct brcms_c_info *wlc, d11rxhdr_t *rxh, struct sk_buff *p)
+brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
+ struct sk_buff *p)
{
int len_mpdu;
struct ieee80211_rx_status rx_status;
@@ -4656,7 +4663,7 @@ brcms_c_recvctl(struct brcms_c_info *wlc, d11rxhdr_t *rxh, struct sk_buff *p)
/* WLC_HIGH_API */
void brcms_c_recv(struct brcms_c_info *wlc, struct sk_buff *p)
{
- d11rxhdr_t *rxh;
+ struct d11rxhdr *rxh;
struct ieee80211_hdr *h;
uint len;
bool is_amsdu;
@@ -4664,7 +4671,7 @@ void brcms_c_recv(struct brcms_c_info *wlc, struct sk_buff *p)
BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);

/* frame starts with rxhdr */
- rxh = (d11rxhdr_t *) (p->data);
+ rxh = (struct d11rxhdr *) (p->data);

/* strip off rxhdr */
skb_pull(p, WL_HWRXOFF);
@@ -5245,7 +5252,7 @@ brcms_c_bcn_prb_template(struct brcms_c_info *wlc, u16 type,
struct brcms_c_bsscfg *cfg, u16 *buf, int *len)
{
static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
- cck_phy_hdr_t *plcp;
+ struct cck_phy_hdr *plcp;
struct ieee80211_mgmt *h;
int hdr_len, body_len;

@@ -5260,7 +5267,7 @@ brcms_c_bcn_prb_template(struct brcms_c_info *wlc, u16 type,
/* format PHY and MAC headers */
memset((char *)buf, 0, hdr_len);

- plcp = (cck_phy_hdr_t *) buf;
+ plcp = (struct cck_phy_hdr *) buf;

/* PLCP for Probe Response frames are filled in from core's rate table */
if (type == IEEE80211_STYPE_BEACON && !MBSS_BCN_ENAB(cfg)) {
@@ -5440,11 +5447,11 @@ brcms_c_bss_update_probe_resp(struct brcms_c_info *wlc,
int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu, uint *fifop)
{
uint fifo;
- d11txh_t *txh;
+ struct d11txh *txh;
struct ieee80211_hdr *h;
struct scb *scb;

- txh = (d11txh_t *) (pdu->data);
+ txh = (struct d11txh *) (pdu->data);
h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);

/* get the pkt queue info. This was put at brcms_c_sendctl or
@@ -5495,10 +5502,10 @@ static void brcms_c_bss_default_init(struct brcms_c_info *wlc)
{
chanspec_t chanspec;
struct brcms_c_band *band;
- wlc_bss_info_t *bi = wlc->default_bss;
+ struct brcms_bss_info *bi = wlc->default_bss;

/* init default and target BSS with some sane initial values */
- memset((char *)(bi), 0, sizeof(wlc_bss_info_t));
+ memset((char *)(bi), 0, sizeof(struct brcms_bss_info));
bi->beacon_period = BEACON_INTERVAL_DEFAULT;
bi->dtim_period = DTIM_INTERVAL_DEFAULT;

diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 323f210..1501a4b 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -77,7 +77,7 @@
struct brcms_c_bss_list {
uint count;
bool beacon; /* set for beacon, cleared for probe response */
- wlc_bss_info_t *ptrs[MAXBSS];
+ struct brcms_bss_info *ptrs[MAXBSS];
};

#define SW_TIMER_MAC_STAT_UPD 30 /* periodic MAC stats update */
@@ -292,7 +292,7 @@ struct brcms_c_stf {
#define WLC_CHAN_CHANNEL(x) (((x) & RXS_CHAN_ID_MASK) >> RXS_CHAN_ID_SHIFT)
#define WLC_RX_CHANNEL(rxh) (WLC_CHAN_CHANNEL((rxh)->RxChan))

-/* wlc_bss_info flag bit values */
+/* brcms_bss_info flag bit values */
#define WLC_BSS_HT 0x0020 /* BSS is HT (MIMO) capable */

/* Flags used in brcms_c_txq_info.stopped */
@@ -341,8 +341,8 @@ struct wsec_key {
u32 len; /* key length..don't move this var */
/* data is 4byte aligned */
u8 data[WLAN_MAX_KEY_LEN]; /* key data */
- wsec_iv_t rxiv[WLC_NUMRXIVS]; /* Rx IV (one per TID) */
- wsec_iv_t txiv; /* Tx IV */
+ struct wsec_iv rxiv[WLC_NUMRXIVS]; /* Rx IV (one per TID) */
+ struct wsec_iv txiv; /* Tx IV */
};

/*
@@ -355,7 +355,7 @@ struct brcms_c_core {
uint *txavail[NFIFO]; /* # tx descriptors available */
s16 txpktpend[NFIFO]; /* tx admission control */

- macstat_t *macstat_snapshot; /* mac hw prev read values */
+ struct macstat *macstat_snapshot; /* mac hw prev read values */
};

/*
@@ -437,7 +437,7 @@ struct wme_param_ie {
u8 version;
u8 qosinfo;
u8 rsvd;
- edcf_acparam_t acparam[AC_COUNT];
+ struct edcf_acparam acparam[AC_COUNT];
} __attribute__((packed));

/* virtual interface */
@@ -571,7 +571,7 @@ struct brcms_c_txq_info {
* Principal common (os-independent) software data structure.
*/
struct brcms_c_info {
- struct wlc_pub *pub; /* pointer to wlc public state */
+ struct brcms_pub *pub; /* pointer to wlc public state */
struct brcms_info *wl; /* pointer to os-specific private state */
d11regs_t *regs; /* pointer to device registers */

@@ -615,7 +615,7 @@ struct brcms_c_info {

struct ampdu_info *ampdu; /* ampdu module handler */
struct antsel_info *asi; /* antsel module handler */
- wlc_cm_info_t *cmi; /* channel manager module handler */
+ struct brcms_cm_info *cmi; /* channel manager module handler */

uint vars_size; /* size of vars, free vars on detach */

@@ -664,11 +664,13 @@ struct brcms_c_info {
/* WME */
ac_bitmap_t wme_dp; /* Discard (oldest first) policy per AC */
u16 edcf_txop[AC_COUNT]; /* current txop for each ac */
- wme_param_ie_t wme_param_ie; /* WME parameter info element, which on STA
- * contains parameters in use locally, and on
- * AP contains parameters advertised to STA
- * in beacons and assoc responses.
- */
+
+ /*
+ * WME parameter info element, which on STA contains parameters in use
+ * locally, and on AP contains parameters advertised to STA in beacons
+ * and assoc responses.
+ */
+ struct wme_param_ie wme_param_ie;
u16 wme_retries[AC_COUNT]; /* per-AC retry limits */

u16 tx_prec_map; /* Precedence map based on HW FIFO space */
@@ -685,8 +687,9 @@ struct brcms_c_info {
struct brcms_c_txq_info *tx_queues; /* common TX Queue list */

/* security */
- wsec_key_t *wsec_keys[WSEC_MAX_KEYS]; /* dynamic key storage */
- wsec_key_t *wsec_def_keys[WLC_DEFAULT_KEYS]; /* default key storage */
+ struct wsec_key *wsec_keys[WSEC_MAX_KEYS]; /* dynamic key storage */
+ /* default key storage */
+ struct wsec_key *wsec_def_keys[WLC_DEFAULT_KEYS];
bool wsec_swkeys; /* indicates that all keys should be
* treated as sw keys (used for debugging)
*/
@@ -699,7 +702,7 @@ struct brcms_c_info {
/* HT CAP IE being advertised by this node: */
struct ieee80211_ht_cap ht_cap;

- wlc_bss_info_t *default_bss; /* configured BSS parameters */
+ struct brcms_bss_info *default_bss; /* configured BSS parameters */

u16 mc_fid_counter; /* BC/MC FIFO frame ID counter */

@@ -761,14 +764,14 @@ struct brcms_c_info {
/* antsel module specific state */
struct antsel_info {
struct brcms_c_info *wlc; /* pointer to main wlc structure */
- struct wlc_pub *pub; /* pointer to public fn */
+ struct brcms_pub *pub; /* pointer to public fn */
u8 antsel_type; /* Type of boardlevel mimo antenna switch-logic
* 0 = N/A, 1 = 2x4 board, 2 = 2x3 CB2 board
*/
u8 antsel_antswitch; /* board level antenna switch type */
bool antsel_avail; /* Ant selection availability (SROM based) */
- wlc_antselcfg_t antcfg_11n; /* antenna configuration */
- wlc_antselcfg_t antcfg_cur; /* current antenna config (auto) */
+ struct brcms_antselcfg antcfg_11n; /* antenna configuration */
+ struct brcms_antselcfg antcfg_cur; /* current antenna config (auto) */
};

/* BSS configuration state */
@@ -800,9 +803,11 @@ struct brcms_c_bsscfg {
u16 WPA_auth; /* WPA: authenticated key management */
bool wpa2_preauth; /* default is true, wpa_cap sets value */
bool wsec_portopen; /* indicates keys are plumbed */
- wsec_iv_t wpa_none_txiv; /* global txiv for WPA_NONE, tkip and aes */
+ /* global txiv for WPA_NONE, tkip and aes */
+ struct wsec_iv wpa_none_txiv;
int wsec_index; /* 0-3: default tx key, -1: not set */
- wsec_key_t *bss_def_keys[WLC_DEFAULT_KEYS]; /* default key storage */
+ /* default key storage: */
+ struct wsec_key *bss_def_keys[WLC_DEFAULT_KEYS];

/* TKIP countermeasures */
bool tkip_countermeasures; /* flags TKIP no-assoc period */
@@ -829,7 +834,7 @@ struct brcms_c_bsscfg {
pmkid_t pmkid[MAXPMKID]; /* PMKID cache */
uint npmkid; /* num cached PMKIDs */

- wlc_bss_info_t *current_bss; /* BSS parms in ASSOCIATED state */
+ struct brcms_bss_info *current_bss; /* BSS parms in ASSOCIATED state */

/* PM states */
bool PMawakebcn; /* bcn recvd during current waking state */
@@ -840,7 +845,7 @@ struct brcms_c_bsscfg {
/* BSSID entry in RCMTA, use the wsec key management infrastructure to
* manage the RCMTA entries.
*/
- wsec_key_t *rcmta;
+ struct wsec_key *rcmta;

/* 'unique' ID of this bsscfg, assigned at bsscfg allocation */
u16 ID;
@@ -874,7 +879,7 @@ struct brcms_c_bsscfg {
extern void brcms_c_fatal_error(struct brcms_c_info *wlc);
extern void brcms_b_rpc_watchdog(struct brcms_c_info *wlc);
extern void brcms_c_recv(struct brcms_c_info *wlc, struct sk_buff *p);
-extern bool brcms_c_dotxstatus(struct brcms_c_info *wlc, tx_status_t *txs,
+extern bool brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs,
u32 frm_tx2);
extern void brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo,
struct sk_buff *p,
@@ -884,7 +889,7 @@ extern void brcms_c_txfifo_complete(struct brcms_c_info *wlc, uint fifo,
extern void brcms_c_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu,
uint prec);
extern void brcms_c_info_init(struct brcms_c_info *wlc, int unit);
-extern void brcms_c_print_txstatus(tx_status_t *txs);
+extern void brcms_c_print_txstatus(struct tx_status *txs);
extern int brcms_c_xmtfifo_sz_get(struct brcms_c_info *wlc, uint fifo,
uint *blocks);
extern void brcms_c_write_template_ram(struct brcms_c_info *wlc, int offset,
@@ -895,8 +900,8 @@ extern void brcms_c_pllreq(struct brcms_c_info *wlc, bool set, mbool req_bit);
extern void brcms_c_reset_bmac_done(struct brcms_c_info *wlc);

#if defined(BCMDBG)
-extern void brcms_c_print_rxh(d11rxhdr_t *rxh);
-extern void brcms_c_print_txdesc(d11txh_t *txh);
+extern void brcms_c_print_rxh(struct d11rxhdr *rxh);
+extern void brcms_c_print_txdesc(struct d11txh *txh);
#else
#define brcms_c_print_txdesc(a)
#endif
@@ -1007,6 +1012,6 @@ extern void brcms_c_set_home_chanspec(struct brcms_c_info *wlc,
extern bool brcms_c_ps_allowed(struct brcms_c_info *wlc);
extern bool brcms_c_stay_awake(struct brcms_c_info *wlc);
extern void brcms_c_wme_initparams_sta(struct brcms_c_info *wlc,
- wme_param_ie_t *pe);
+ struct wme_param_ie *pe);

#endif /* _BRCM_MAIN_H_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/nicpci.c b/drivers/staging/brcm80211/brcmsmac/nicpci.c
index a5eebf3..4915592 100644
--- a/drivers/staging/brcm80211/brcmsmac/nicpci.c
+++ b/drivers/staging/brcm80211/brcmsmac/nicpci.c
@@ -145,7 +145,7 @@ struct sbpciregs {
};

/* SB side: PCIE core and host control registers */
-typedef struct sbpcieregs {
+struct sbpcieregs {
u32 control; /* host mode only */
u32 PAD[2];
u32 biststatus; /* bist Status: 0x00C */
@@ -177,11 +177,11 @@ typedef struct sbpcieregs {
u32 PAD[177];
u32 pciecfg[4][64]; /* 0x400 - 0x7FF, PCIE Cfg Space */
u16 sprom[64]; /* SPROM shadow Area */
-} sbpcieregs_t;
+};

-typedef struct {
+struct pcicore_info {
union {
- sbpcieregs_t *pcieregs;
+ struct sbpcieregs *pcieregs;
struct sbpciregs *pciregs;
} regs; /* Memory mapped register to the core */

@@ -194,7 +194,7 @@ typedef struct {

u8 pmecap_offset; /* PM Capability offset in the config space */
bool pmecap; /* Capable of generating PME */
-} pcicore_info_t;
+};

/* debug/trace */
#define PCI_ERROR(args)
@@ -202,22 +202,22 @@ typedef struct {
(((sih)->bustype == PCI_BUS) && ((sih)->buscoretype == PCIE_CORE_ID))

/* routines to access mdio slave device registers */
-static bool pcie_mdiosetblock(pcicore_info_t *pi, uint blk);
-static int pcie_mdioop(pcicore_info_t *pi, uint physmedia, uint regaddr,
+static bool pcie_mdiosetblock(struct pcicore_info *pi, uint blk);
+static int pcie_mdioop(struct pcicore_info *pi, uint physmedia, uint regaddr,
bool write, uint *val);
-static int pcie_mdiowrite(pcicore_info_t *pi, uint physmedia, uint readdr,
+static int pcie_mdiowrite(struct pcicore_info *pi, uint physmedia, uint readdr,
uint val);
-static int pcie_mdioread(pcicore_info_t *pi, uint physmedia, uint readdr,
+static int pcie_mdioread(struct pcicore_info *pi, uint physmedia, uint readdr,
uint *ret_val);

-static void pcie_extendL1timer(pcicore_info_t *pi, bool extend);
-static void pcie_clkreq_upd(pcicore_info_t *pi, uint state);
+static void pcie_extendL1timer(struct pcicore_info *pi, bool extend);
+static void pcie_clkreq_upd(struct pcicore_info *pi, uint state);

-static void pcie_war_aspm_clkreq(pcicore_info_t *pi);
-static void pcie_war_serdes(pcicore_info_t *pi);
-static void pcie_war_noplldown(pcicore_info_t *pi);
-static void pcie_war_polarity(pcicore_info_t *pi);
-static void pcie_war_pci_setup(pcicore_info_t *pi);
+static void pcie_war_aspm_clkreq(struct pcicore_info *pi);
+static void pcie_war_serdes(struct pcicore_info *pi);
+static void pcie_war_noplldown(struct pcicore_info *pi);
+static void pcie_war_polarity(struct pcicore_info *pi);
+static void pcie_war_pci_setup(struct pcicore_info *pi);

#define PCIE_ASPM(sih) ((PCIE_PUB(sih)) && (((sih)->buscorerev >= 3) && ((sih)->buscorerev <= 5)))

@@ -230,10 +230,10 @@ static void pcie_war_pci_setup(pcicore_info_t *pi);
*/
void *pcicore_init(struct si_pub *sih, void *pdev, void *regs)
{
- pcicore_info_t *pi;
+ struct pcicore_info *pi;

- /* alloc pcicore_info_t */
- pi = kzalloc(sizeof(pcicore_info_t), GFP_ATOMIC);
+ /* alloc struct pcicore_info */
+ pi = kzalloc(sizeof(struct pcicore_info), GFP_ATOMIC);
if (pi == NULL) {
PCI_ERROR(("pci_attach: malloc failed!\n"));
return NULL;
@@ -244,7 +244,7 @@ void *pcicore_init(struct si_pub *sih, void *pdev, void *regs)

if (sih->buscoretype == PCIE_CORE_ID) {
u8 cap_ptr;
- pi->regs.pcieregs = (sbpcieregs_t *) regs;
+ pi->regs.pcieregs = (struct sbpcieregs *) regs;
cap_ptr = pcicore_find_pci_capability(pi->dev, PCI_CAP_ID_EXP,
NULL, NULL);
pi->pciecap_lcreg_offset = cap_ptr + PCIE_CAP_LINKCTRL_OFFSET;
@@ -256,7 +256,7 @@ void *pcicore_init(struct si_pub *sih, void *pdev, void *regs)

void pcicore_deinit(void *pch)
{
- pcicore_info_t *pi = (pcicore_info_t *) pch;
+ struct pcicore_info *pi = (struct pcicore_info *) pch;

if (pi == NULL)
return;
@@ -327,7 +327,7 @@ pcicore_find_pci_capability(void *dev, u8 req_cap_id,

/* ***** Register Access API */
static uint
-pcie_readreg(sbpcieregs_t *pcieregs, uint addrtype,
+pcie_readreg(struct sbpcieregs *pcieregs, uint addrtype,
uint offset)
{
uint retval = 0xFFFFFFFF;
@@ -351,7 +351,7 @@ pcie_readreg(sbpcieregs_t *pcieregs, uint addrtype,
}

static uint
-pcie_writereg(sbpcieregs_t *pcieregs, uint addrtype,
+pcie_writereg(struct sbpcieregs *pcieregs, uint addrtype,
uint offset, uint val)
{
switch (addrtype) {
@@ -369,9 +369,9 @@ pcie_writereg(sbpcieregs_t *pcieregs, uint addrtype,
return 0;
}

-static bool pcie_mdiosetblock(pcicore_info_t *pi, uint blk)
+static bool pcie_mdiosetblock(struct pcicore_info *pi, uint blk)
{
- sbpcieregs_t *pcieregs = pi->regs.pcieregs;
+ struct sbpcieregs *pcieregs = pi->regs.pcieregs;
uint mdiodata, i = 0;
uint pcie_serdes_spinwait = 200;

@@ -402,10 +402,10 @@ static bool pcie_mdiosetblock(pcicore_info_t *pi, uint blk)
}

static int
-pcie_mdioop(pcicore_info_t *pi, uint physmedia, uint regaddr, bool write,
+pcie_mdioop(struct pcicore_info *pi, uint physmedia, uint regaddr, bool write,
uint *val)
{
- sbpcieregs_t *pcieregs = pi->regs.pcieregs;
+ struct sbpcieregs *pcieregs = pi->regs.pcieregs;
uint mdiodata;
uint i = 0;
uint pcie_serdes_spinwait = 10;
@@ -462,14 +462,15 @@ pcie_mdioop(pcicore_info_t *pi, uint physmedia, uint regaddr, bool write,

/* use the mdio interface to read from mdio slaves */
static int
-pcie_mdioread(pcicore_info_t *pi, uint physmedia, uint regaddr, uint *regval)
+pcie_mdioread(struct pcicore_info *pi, uint physmedia, uint regaddr,
+ uint *regval)
{
return pcie_mdioop(pi, physmedia, regaddr, false, regval);
}

/* use the mdio interface to write to mdio slaves */
static int
-pcie_mdiowrite(pcicore_info_t *pi, uint physmedia, uint regaddr, uint val)
+pcie_mdiowrite(struct pcicore_info *pi, uint physmedia, uint regaddr, uint val)
{
return pcie_mdioop(pi, physmedia, regaddr, true, &val);
}
@@ -477,7 +478,7 @@ pcie_mdiowrite(pcicore_info_t *pi, uint physmedia, uint regaddr, uint val)
/* ***** Support functions ***** */
static u8 pcie_clkreq(void *pch, u32 mask, u32 val)
{
- pcicore_info_t *pi = (pcicore_info_t *) pch;
+ struct pcicore_info *pi = (struct pcicore_info *) pch;
u32 reg_val;
u8 offset;

@@ -501,11 +502,11 @@ static u8 pcie_clkreq(void *pch, u32 mask, u32 val)
return 0;
}

-static void pcie_extendL1timer(pcicore_info_t *pi, bool extend)
+static void pcie_extendL1timer(struct pcicore_info *pi, bool extend)
{
u32 w;
struct si_pub *sih = pi->sih;
- sbpcieregs_t *pcieregs = pi->regs.pcieregs;
+ struct sbpcieregs *pcieregs = pi->regs.pcieregs;

if (!PCIE_PUB(sih) || sih->buscorerev < 7)
return;
@@ -520,7 +521,7 @@ static void pcie_extendL1timer(pcicore_info_t *pi, bool extend)
}

/* centralized clkreq control policy */
-static void pcie_clkreq_upd(pcicore_info_t *pi, uint state)
+static void pcie_clkreq_upd(struct pcicore_info *pi, uint state)
{
struct si_pub *sih = pi->sih;

@@ -560,7 +561,7 @@ static void pcie_clkreq_upd(pcicore_info_t *pi, uint state)

/* ***** PCI core WARs ***** */
/* Done only once at attach time */
-static void pcie_war_polarity(pcicore_info_t *pi)
+static void pcie_war_polarity(struct pcicore_info *pi)
{
u32 w;

@@ -585,9 +586,9 @@ static void pcie_war_polarity(pcicore_info_t *pi)
* : Coming out of 'standby'/'hibernate'
* : If pcie_war_aspm_ovr state changed
*/
-static void pcie_war_aspm_clkreq(pcicore_info_t *pi)
+static void pcie_war_aspm_clkreq(struct pcicore_info *pi)
{
- sbpcieregs_t *pcieregs = pi->regs.pcieregs;
+ struct sbpcieregs *pcieregs = pi->regs.pcieregs;
struct si_pub *sih = pi->sih;
u16 val16, *reg16;
u32 w;
@@ -628,7 +629,7 @@ static void pcie_war_aspm_clkreq(pcicore_info_t *pi)

/* Apply the polarity determined at the start */
/* Needs to happen when coming out of 'standby'/'hibernate' */
-static void pcie_war_serdes(pcicore_info_t *pi)
+static void pcie_war_serdes(struct pcicore_info *pi)
{
u32 w = 0;

@@ -645,9 +646,9 @@ static void pcie_war_serdes(pcicore_info_t *pi)

/* Fix MISC config to allow coming out of L2/L3-Ready state w/o PRST */
/* Needs to happen when coming out of 'standby'/'hibernate' */
-static void pcie_misc_config_fixup(pcicore_info_t *pi)
+static void pcie_misc_config_fixup(struct pcicore_info *pi)
{
- sbpcieregs_t *pcieregs = pi->regs.pcieregs;
+ struct sbpcieregs *pcieregs = pi->regs.pcieregs;
u16 val16, *reg16;

reg16 = &pcieregs->sprom[SRSH_PCIE_MISC_CONFIG];
@@ -661,9 +662,9 @@ static void pcie_misc_config_fixup(pcicore_info_t *pi)

/* quick hack for testing */
/* Needs to happen when coming out of 'standby'/'hibernate' */
-static void pcie_war_noplldown(pcicore_info_t *pi)
+static void pcie_war_noplldown(struct pcicore_info *pi)
{
- sbpcieregs_t *pcieregs = pi->regs.pcieregs;
+ struct sbpcieregs *pcieregs = pi->regs.pcieregs;
u16 *reg16;

/* turn off serdes PLL down */
@@ -676,10 +677,10 @@ static void pcie_war_noplldown(pcicore_info_t *pi)
}

/* Needs to happen when coming out of 'standby'/'hibernate' */
-static void pcie_war_pci_setup(pcicore_info_t *pi)
+static void pcie_war_pci_setup(struct pcicore_info *pi)
{
struct si_pub *sih = pi->sih;
- sbpcieregs_t *pcieregs = pi->regs.pcieregs;
+ struct sbpcieregs *pcieregs = pi->regs.pcieregs;
u32 w;

if ((sih->buscorerev == 0) || (sih->buscorerev == 1)) {
@@ -723,7 +724,7 @@ static void pcie_war_pci_setup(pcicore_info_t *pi)
/* ***** Functions called during driver state changes ***** */
void pcicore_attach(void *pch, char *pvars, int state)
{
- pcicore_info_t *pi = (pcicore_info_t *) pch;
+ struct pcicore_info *pi = (struct pcicore_info *) pch;
struct si_pub *sih = pi->sih;

/* Determine if this board needs override */
@@ -748,7 +749,7 @@ void pcicore_attach(void *pch, char *pvars, int state)

void pcicore_hwup(void *pch)
{
- pcicore_info_t *pi = (pcicore_info_t *) pch;
+ struct pcicore_info *pi = (struct pcicore_info *) pch;

if (!pi || !PCIE_PUB(pi->sih))
return;
@@ -758,7 +759,7 @@ void pcicore_hwup(void *pch)

void pcicore_up(void *pch, int state)
{
- pcicore_info_t *pi = (pcicore_info_t *) pch;
+ struct pcicore_info *pi = (struct pcicore_info *) pch;

if (!pi || !PCIE_PUB(pi->sih))
return;
@@ -772,7 +773,7 @@ void pcicore_up(void *pch, int state)
/* When the device is going to enter D3 state (or the system is going to enter S3/S4 states */
void pcicore_sleep(void *pch)
{
- pcicore_info_t *pi = (pcicore_info_t *) pch;
+ struct pcicore_info *pi = (struct pcicore_info *) pch;
u32 w;

if (!pi || !PCIE_ASPM(pi->sih))
@@ -787,7 +788,7 @@ void pcicore_sleep(void *pch)

void pcicore_down(void *pch, int state)
{
- pcicore_info_t *pi = (pcicore_info_t *) pch;
+ struct pcicore_info *pi = (struct pcicore_info *) pch;

if (!pi || !PCIE_PUB(pi->sih))
return;
@@ -803,10 +804,10 @@ void pcicore_down(void *pch, int state)
*/
void pcicore_fixcfg(void *pch, void *regs)
{
- pcicore_info_t *pi = (pcicore_info_t *) pch;
+ struct pcicore_info *pi = (struct pcicore_info *) pch;
struct si_info *sii = SI_INFO(pi->sih);
struct sbpciregs *pciregs = regs;
- sbpcieregs_t *pcieregs = regs;
+ struct sbpcieregs *pcieregs = regs;
u16 val16, *reg16 = NULL;
uint pciidx;

@@ -831,7 +832,7 @@ void pcicore_fixcfg(void *pch, void *regs)
*/
void pcicore_pci_setup(void *pch, void *regs)
{
- pcicore_info_t *pi = (pcicore_info_t *) pch;
+ struct pcicore_info *pi = (struct pcicore_info *) pch;
struct sbpciregs *pciregs = regs;
u32 w;

diff --git a/drivers/staging/brcm80211/brcmsmac/otp.c b/drivers/staging/brcm80211/brcmsmac/otp.c
index 7edc435..34253cf 100644
--- a/drivers/staging/brcm80211/brcmsmac/otp.c
+++ b/drivers/staging/brcm80211/brcmsmac/otp.c
@@ -69,18 +69,18 @@ typedef int (*otp_read_region_t) (struct si_pub *sih, int region, u16 *data,
typedef int (*otp_nvread_t) (void *oh, char *data, uint *len);

/* OTP function struct */
-typedef struct otp_fn_s {
+struct otp_fn_s {
otp_size_t size;
otp_read_bit_t read_bit;
otp_init_t init;
otp_read_region_t read_region;
otp_nvread_t nvread;
otp_status_t status;
-} otp_fn_t;
+};

-typedef struct {
+struct otpinfo {
uint ccrev; /* chipc revision */
- otp_fn_t *fn; /* OTP functions */
+ struct otp_fn_s *fn; /* OTP functions */
struct si_pub *sih; /* Saved sb handle */

/* IPX OTP section */
@@ -97,9 +97,9 @@ typedef struct {
u16 fbase; /* fuse subregion offset */
u16 flim; /* fuse subregion boundary */
int otpgu_base; /* offset to General Use Region */
-} otpinfo_t;
+};

-static otpinfo_t otpinfo;
+static struct otpinfo otpinfo;

/*
* IPX OTP Code
@@ -153,29 +153,29 @@ static otpinfo_t otpinfo;

static int ipxotp_status(void *oh)
{
- otpinfo_t *oi = (otpinfo_t *) oh;
+ struct otpinfo *oi = (struct otpinfo *) oh;
return (int)(oi->status);
}

/* Return size in bytes */
static int ipxotp_size(void *oh)
{
- otpinfo_t *oi = (otpinfo_t *) oh;
+ struct otpinfo *oi = (struct otpinfo *) oh;
return (int)oi->wsize * 2;
}

static u16 ipxotp_otpr(void *oh, chipcregs_t *cc, uint wn)
{
- otpinfo_t *oi;
+ struct otpinfo *oi;

- oi = (otpinfo_t *) oh;
+ oi = (struct otpinfo *) oh;

return R_REG(&cc->sromotp[wn]);
}

static u16 ipxotp_read_bit(void *oh, chipcregs_t *cc, uint off)
{
- otpinfo_t *oi = (otpinfo_t *) oh;
+ struct otpinfo *oi = (struct otpinfo *) oh;
uint k, row, col;
u32 otpp, st;

@@ -225,7 +225,7 @@ static int ipxotp_max_rgnsz(struct si_pub *sih, int osizew)
return ret;
}

-static void _ipxotp_init(otpinfo_t *oi, chipcregs_t *cc)
+static void _ipxotp_init(struct otpinfo *oi, chipcregs_t *cc)
{
uint k;
u32 otpp, st;
@@ -300,7 +300,7 @@ static void *ipxotp_init(struct si_pub *sih)
{
uint idx;
chipcregs_t *cc;
- otpinfo_t *oi;
+ struct otpinfo *oi;

/* Make sure we're running IPX OTP */
if (!OTPTYPE_IPX(sih->ccrev))
@@ -356,7 +356,7 @@ static void *ipxotp_init(struct si_pub *sih)

static int ipxotp_read_region(void *oh, int region, u16 *data, uint *wlen)
{
- otpinfo_t *oi = (otpinfo_t *) oh;
+ struct otpinfo *oi = (struct otpinfo *) oh;
uint idx;
chipcregs_t *cc;
uint base, i, sz;
@@ -444,7 +444,7 @@ static int ipxotp_nvread(void *oh, char *data, uint *len)
return -ENOTSUPP;
}

-static otp_fn_t ipxotp_fn = {
+static struct otp_fn_s ipxotp_fn = {
(otp_size_t) ipxotp_size,
(otp_read_bit_t) ipxotp_read_bit,

@@ -466,21 +466,21 @@ static otp_fn_t ipxotp_fn = {

int otp_status(void *oh)
{
- otpinfo_t *oi = (otpinfo_t *) oh;
+ struct otpinfo *oi = (struct otpinfo *) oh;

return oi->fn->status(oh);
}

int otp_size(void *oh)
{
- otpinfo_t *oi = (otpinfo_t *) oh;
+ struct otpinfo *oi = (struct otpinfo *) oh;

return oi->fn->size(oh);
}

u16 otp_read_bit(void *oh, uint offset)
{
- otpinfo_t *oi = (otpinfo_t *) oh;
+ struct otpinfo *oi = (struct otpinfo *) oh;
uint idx = ai_coreidx(oi->sih);
chipcregs_t *cc = ai_setcoreidx(oi->sih, SI_CC_IDX);
u16 readBit = (u16) oi->fn->read_bit(oh, cc, offset);
@@ -490,11 +490,11 @@ u16 otp_read_bit(void *oh, uint offset)

void *otp_init(struct si_pub *sih)
{
- otpinfo_t *oi;
+ struct otpinfo *oi;
void *ret = NULL;

oi = &otpinfo;
- memset(oi, 0, sizeof(otpinfo_t));
+ memset(oi, 0, sizeof(struct otpinfo));

oi->ccrev = sih->ccrev;

@@ -529,7 +529,8 @@ otp_read_region(struct si_pub *sih, int region, u16 *data,
goto out;
}

- err = (((otpinfo_t *) oh)->fn->read_region) (oh, region, data, wlen);
+ err = (((struct otpinfo *) oh)->fn->read_region)
+ (oh, region, data, wlen);

out:
return err;
@@ -537,7 +538,7 @@ otp_read_region(struct si_pub *sih, int region, u16 *data,

int otp_nvread(void *oh, char *data, uint *len)
{
- otpinfo_t *oi = (otpinfo_t *) oh;
+ struct otpinfo *oi = (struct otpinfo *) oh;

return oi->fn->nvread(oh, data, len);
}
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index b527e5f..57195a5 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -29,13 +29,12 @@

u32 phyhal_msg_level = PHYHAL_ERROR;

-typedef struct _chan_info_basic {
+struct chan_info_basic {
u16 chan;
u16 freq;
-} chan_info_basic_t;
-
-static chan_info_basic_t chan_info_all[] = {
+};

+static struct chan_info_basic chan_info_all[] = {
{1, 2412},
{2, 2417},
{3, 2422},
@@ -469,11 +468,11 @@ static void WLBANDINITFN(wlc_set_phy_uninitted) (phy_info_t *pi)
}
}

-shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp)
+struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp)
{
- shared_phy_t *sh;
+ struct shared_phy *sh;

- sh = kzalloc(sizeof(shared_phy_t), GFP_ATOMIC);
+ sh = kzalloc(sizeof(struct shared_phy), GFP_ATOMIC);
if (sh == NULL) {
return NULL;
}
@@ -506,7 +505,7 @@ shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp)
return sh;
}

-wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
+wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
char *vars, struct wiphy *wiphy)
{
phy_info_t *pi;
@@ -998,7 +997,7 @@ void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val)
}

void
-wlc_phy_write_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
+wlc_phy_write_table(phy_info_t *pi, const struct phytbl_info *ptbl_info,
u16 tblAddr, u16 tblDataHi, u16 tblDataLo)
{
uint idx;
@@ -1038,7 +1037,7 @@ wlc_phy_write_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
}

void
-wlc_phy_read_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
+wlc_phy_read_table(phy_info_t *pi, const struct phytbl_info *ptbl_info,
u16 tblAddr, u16 tblDataHi, u16 tblDataLo)
{
uint idx;
@@ -1076,7 +1075,8 @@ wlc_phy_read_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
}

uint
-wlc_phy_init_radio_regs_allbands(phy_info_t *pi, radio_20xx_regs_t *radioregs)
+wlc_phy_init_radio_regs_allbands(phy_info_t *pi,
+ struct radio_20xx_regs *radioregs)
{
uint i = 0;

@@ -1093,7 +1093,7 @@ wlc_phy_init_radio_regs_allbands(phy_info_t *pi, radio_20xx_regs_t *radioregs)
}

uint
-wlc_phy_init_radio_regs(phy_info_t *pi, radio_regs_t *radioregs,
+wlc_phy_init_radio_regs(phy_info_t *pi, struct radio_regs *radioregs,
u16 core_offset)
{
uint i = 0;
@@ -2440,7 +2440,7 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
OR_REG(&pi->regs->maccommand,
MCMD_BG_NOISE);
} else {
- phy_iq_est_t est[PHY_CORE_MAX];
+ struct phy_iq_est est[PHY_CORE_MAX];
u32 cmplx_pwr[PHY_CORE_MAX];
s8 noise_dbm_ant[PHY_CORE_MAX];
u16 log_num_samps, num_samps, classif_state = 0;
@@ -2675,8 +2675,8 @@ void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_cmplx_pwr_dB, u8 core)

void wlc_phy_rssi_compute(wlc_phy_t *pih, void *ctx)
{
- wlc_d11rxhdr_t *wlc_rxhdr = (wlc_d11rxhdr_t *) ctx;
- d11rxhdr_t *rxh = &wlc_rxhdr->rxhdr;
+ struct brcms_d11rxhdr *wlc_rxhdr = (struct brcms_d11rxhdr *) ctx;
+ struct d11rxhdr *rxh = &wlc_rxhdr->rxhdr;
int rssi = le16_to_cpu(rxh->PhyRxStatus_1) & PRXS1_JSSI_MASK;
uint radioid = pih->radioid;
phy_info_t *pi = (phy_info_t *) pih;
@@ -2694,7 +2694,7 @@ void wlc_phy_rssi_compute(wlc_phy_t *pih, void *ctx)

if (ISLCNPHY(pi)) {
u8 gidx = (le16_to_cpu(rxh->PhyRxStatus_2) & 0xFC00) >> 10;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (rssi > 127)
rssi -= 256;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
index 0ea337b..d1d03a6 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
@@ -176,9 +176,9 @@ struct shared_phy_params {
};


-extern shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp);
-extern wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
- char *vars, struct wiphy *wiphy);
+extern struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
+extern wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs,
+ int bandtype, char *vars, struct wiphy *wiphy);
extern void wlc_phy_detach(wlc_phy_t *ppi);

extern bool wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype,
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
index 0019c04..d8c86d9 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
@@ -41,7 +41,7 @@ extern u32 phyhal_msg_level;

#define LCNXN_BASEREV 16

-struct wlc_phy_srom_fem {
+struct brcms_phy_srom_fem {
u8 tssipos; /* TSSI positive slope, 1: positive, 0: negative */
u8 extpagain; /* Ext PA gain-type: full-gain: 0, pa-lite: 1, no_pa: 2 */
u8 pdetrange; /* support 32 combinations of different Pdet dynamic ranges */
@@ -441,11 +441,11 @@ struct txiqcal_cache {

u16 txcal_coeffs_2G[8];
u16 txcal_radio_regs_2G[8];
- nphy_iq_comp_t rxcal_coeffs_2G;
+ struct nphy_iq_comp rxcal_coeffs_2G;

u16 txcal_coeffs_5G[8];
u16 txcal_radio_regs_5G[8];
- nphy_iq_comp_t rxcal_coeffs_5G;
+ struct nphy_iq_comp rxcal_coeffs_5G;
};

struct nphy_pwrctrl {
@@ -595,12 +595,12 @@ struct phy_func_ptr {

struct phy_info {
wlc_phy_t pubpi_ro;
- shared_phy_t *sh;
- phy_func_ptr_t pi_fptr;
+ struct shared_phy *sh;
+ struct phy_func_ptr pi_fptr;
void *pi_ptr;

union {
- phy_info_lcnphy_t *pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcnphy;
} u;
bool user_txpwr_at_rfport;

@@ -650,8 +650,8 @@ struct phy_info {
s8 tx_power_offset[TXP_NUM_RATES];
u8 tx_power_target[TXP_NUM_RATES];

- wlc_phy_srom_fem_t srom_fem2g;
- wlc_phy_srom_fem_t srom_fem5g;
+ struct brcms_phy_srom_fem srom_fem2g;
+ struct brcms_phy_srom_fem srom_fem5g;

u8 tx_power_max;
u8 tx_power_max_rate_ind;
@@ -722,7 +722,8 @@ struct phy_info {

u16 mintxbias;
u16 mintxmag;
- lo_complex_abgphy_info_t gphy_locomp_iq[STATIC_NUM_RF][STATIC_NUM_BB];
+ struct lo_complex_abgphy_info gphy_locomp_iq
+ [STATIC_NUM_RF][STATIC_NUM_BB];
s8 stats_11b_txpower[STATIC_NUM_RF][STATIC_NUM_BB];
u16 gain_table[TX_GAIN_TABLE_LENGTH];
bool loopback_gain;
@@ -780,8 +781,8 @@ struct phy_info {
u32 nphy_bb_mult_save;
u16 nphy_txiqlocal_bestc[11];
bool nphy_txiqlocal_coeffsvalid;
- phy_txpwrindex_t nphy_txpwrindex[PHY_CORE_NUM_2];
- phy_pwrctrl_t nphy_pwrctrl_info[PHY_CORE_NUM_2];
+ struct nphy_txpwrindex nphy_txpwrindex[PHY_CORE_NUM_2];
+ struct nphy_pwrctrl nphy_pwrctrl_info[PHY_CORE_NUM_2];
u16 cck2gpo;
u32 ofdm2gpo;
u32 ofdm5gpo;
@@ -849,8 +850,8 @@ struct phy_info {
bool internal_tx_iqlo_cal_tapoff_intpa_nphy;
s16 nphy_lastcal_temp;

- txiqcal_cache_t calibration_cache;
- rssical_cache_t rssical_cache;
+ struct txiqcal_cache calibration_cache;
+ struct rssical_cache rssical_cache;

u8 nphy_txpwr_idx[2];
u8 nphy_papd_cal_type;
@@ -881,7 +882,7 @@ struct phy_info {
u8 nphy_txcal_pwr_idx[2];
u8 nphy_rxcal_pwr_idx[2];
u16 nphy_cal_orig_tx_gain[2];
- nphy_txgains_t nphy_cal_target_gain;
+ struct nphy_txgains nphy_cal_target_gain;
u16 nphy_txcal_bbmult;
u16 nphy_gmval;

@@ -892,7 +893,7 @@ struct phy_info {
bool nphy_aband_spurwar_en;
u16 nphy_rccal_value;
u16 nphy_crsminpwr[3];
- phy_noisevar_buf_t nphy_saved_noisevars;
+ struct nphy_noisevar_buf nphy_saved_noisevars;
bool nphy_anarxlpf_adjusted;
bool nphy_crsminpwr_adjusted;
bool nphy_noisevars_adjusted;
@@ -963,21 +964,23 @@ struct lcnphy_radio_regs {
u8 do_init_g;
};

-extern lcnphy_radio_regs_t lcnphy_radio_regs_2064[];
-extern lcnphy_radio_regs_t lcnphy_radio_regs_2066[];
-extern radio_regs_t regs_2055[], regs_SYN_2056[], regs_TX_2056[],
+extern struct lcnphy_radio_regs lcnphy_radio_regs_2064[];
+extern struct lcnphy_radio_regs lcnphy_radio_regs_2066[];
+extern struct radio_regs regs_2055[], regs_SYN_2056[], regs_TX_2056[],
regs_RX_2056[];
-extern radio_regs_t regs_SYN_2056_A1[], regs_TX_2056_A1[], regs_RX_2056_A1[];
-extern radio_regs_t regs_SYN_2056_rev5[], regs_TX_2056_rev5[],
+extern struct radio_regs regs_SYN_2056_A1[], regs_TX_2056_A1[],
+ regs_RX_2056_A1[];
+extern struct radio_regs regs_SYN_2056_rev5[], regs_TX_2056_rev5[],
regs_RX_2056_rev5[];
-extern radio_regs_t regs_SYN_2056_rev6[], regs_TX_2056_rev6[],
+extern struct radio_regs regs_SYN_2056_rev6[], regs_TX_2056_rev6[],
regs_RX_2056_rev6[];
-extern radio_regs_t regs_SYN_2056_rev7[], regs_TX_2056_rev7[],
+extern struct radio_regs regs_SYN_2056_rev7[], regs_TX_2056_rev7[],
regs_RX_2056_rev7[];
-extern radio_regs_t regs_SYN_2056_rev8[], regs_TX_2056_rev8[],
+extern struct radio_regs regs_SYN_2056_rev8[], regs_TX_2056_rev8[],
regs_RX_2056_rev8[];
-extern radio_20xx_regs_t regs_2057_rev4[], regs_2057_rev5[], regs_2057_rev5v1[];
-extern radio_20xx_regs_t regs_2057_rev7[], regs_2057_rev8[];
+extern struct radio_20xx_regs regs_2057_rev4[], regs_2057_rev5[],
+ regs_2057_rev5v1[];
+extern struct radio_20xx_regs regs_2057_rev7[], regs_2057_rev8[];

extern char *phy_getvar(phy_info_t *pi, const char *name);
extern int phy_getintvar(phy_info_t *pi, const char *name);
@@ -1004,12 +1007,13 @@ extern void wlc_phyreg_exit(wlc_phy_t *pih);
extern void wlc_radioreg_enter(wlc_phy_t *pih);
extern void wlc_radioreg_exit(wlc_phy_t *pih);

-extern void wlc_phy_read_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
+extern void wlc_phy_read_table(phy_info_t *pi,
+ const struct phytbl_info *ptbl_info,
u16 tblAddr, u16 tblDataHi,
u16 tblDatalo);
extern void wlc_phy_write_table(phy_info_t *pi,
- const phytbl_info_t *ptbl_info, u16 tblAddr,
- u16 tblDataHi, u16 tblDatalo);
+ const struct phytbl_info *ptbl_info,
+ u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
extern void wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
u16 tblAddr, u16 tblDataHi,
u16 tblDataLo);
@@ -1023,8 +1027,9 @@ extern u8 wlc_phy_nbits(s32 value);
extern void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);

extern uint wlc_phy_init_radio_regs_allbands(phy_info_t *pi,
- radio_20xx_regs_t *radioregs);
-extern uint wlc_phy_init_radio_regs(phy_info_t *pi, radio_regs_t *radioregs,
+ struct radio_20xx_regs *radioregs);
+extern uint wlc_phy_init_radio_regs(phy_info_t *pi,
+ struct radio_regs *radioregs,
u16 core_offset);

extern void wlc_phy_txpower_ipa_upd(phy_info_t *pi);
@@ -1101,8 +1106,9 @@ extern void wlc_phy_txpower_recalc_target(phy_info_t *pi);

#define LCNPHY_TX_PWR_CTRL_TEMPBASED 0xE001

-extern void wlc_lcnphy_write_table(phy_info_t *pi, const phytbl_info_t *pti);
-extern void wlc_lcnphy_read_table(phy_info_t *pi, phytbl_info_t *pti);
+extern void wlc_lcnphy_write_table(phy_info_t *pi,
+ const struct phytbl_info *pti);
+extern void wlc_lcnphy_read_table(phy_info_t *pi, struct phytbl_info *pti);
extern void wlc_lcnphy_set_tx_iqcc(phy_info_t *pi, u16 a, u16 b);
extern void wlc_lcnphy_set_tx_locc(phy_info_t *pi, u16 didq);
extern void wlc_lcnphy_get_tx_iqcc(phy_info_t *pi, u16 *a, u16 *b);
@@ -1167,12 +1173,12 @@ extern s16 wlc_phy_tempsense_nphy(phy_info_t *pi);

extern u16 wlc_phy_classifier_nphy(phy_info_t *pi, u16 mask, u16 val);

-extern void wlc_phy_rx_iq_est_nphy(phy_info_t *pi, phy_iq_est_t *est,
+extern void wlc_phy_rx_iq_est_nphy(phy_info_t *pi, struct phy_iq_est *est,
u16 num_samps, u8 wait_time,
u8 wait_for_crs);

extern void wlc_phy_rx_iq_coeffs_nphy(phy_info_t *pi, u8 write,
- nphy_iq_comp_t *comp);
+ struct nphy_iq_comp *comp);
extern void wlc_phy_aci_and_noise_reduction_nphy(phy_info_t *pi);

extern void wlc_phy_rxcore_setstate_nphy(wlc_phy_t *pih, u8 rxcore_bitmask);
@@ -1184,10 +1190,12 @@ extern void wlc_phy_txpwr_apply_nphy(phy_info_t *pi);
extern void wlc_phy_txpwr_papd_cal_nphy(phy_info_t *pi);
extern u16 wlc_phy_txpwr_idx_get_nphy(phy_info_t *pi);

-extern nphy_txgains_t wlc_phy_get_tx_gain_nphy(phy_info_t *pi);
-extern int wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain,
+extern struct nphy_txgains wlc_phy_get_tx_gain_nphy(phy_info_t *pi);
+extern int wlc_phy_cal_txiqlo_nphy(phy_info_t *pi,
+ struct nphy_txgains target_gain,
bool full, bool m);
-extern int wlc_phy_cal_rxiq_nphy(phy_info_t *pi, nphy_txgains_t target_gain,
+extern int wlc_phy_cal_rxiq_nphy(phy_info_t *pi,
+ struct nphy_txgains target_gain,
u8 type, bool d);
extern void wlc_phy_txpwr_index_nphy(phy_info_t *pi, u8 core_mask,
s8 txpwrindex, bool res);
@@ -1205,7 +1213,8 @@ extern void wlc_phy_est_tonepwr_nphy(phy_info_t *pi, s32 *qdBm_pwrbuf,
u8 num_samps);
extern void wlc_phy_radio205x_vcocal_nphy(phy_info_t *pi);

-extern int wlc_phy_rssi_compute_nphy(phy_info_t *pi, wlc_d11rxhdr_t *wlc_rxh);
+extern int wlc_phy_rssi_compute_nphy(phy_info_t *pi,
+ struct brcms_d11rxhdr *wlc_rxh);

#define NPHY_TESTPATTERN_BPHY_EVM 0
#define NPHY_TESTPATTERN_BPHY_RFCS 1
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index 3b61beb..47a0a1a 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -136,60 +136,55 @@
(0 != (read_phy_reg((pi), 0x43b) & (0x1 << 6)))

#define wlc_lcnphy_total_tx_frames(pi) \
- wlapi_bmac_read_shm((pi)->sh->physhim, M_UCODE_MACSTAT + offsetof(macstat_t, txallfrm))
+ wlapi_bmac_read_shm((pi)->sh->physhim, \
+ M_UCODE_MACSTAT + offsetof(struct macstat, txallfrm))

-typedef struct {
+struct lcnphy_txgains {
u16 gm_gain;
u16 pga_gain;
u16 pad_gain;
u16 dac_gain;
-} lcnphy_txgains_t;
+};

-typedef enum {
+enum lcnphy_cal_mode {
LCNPHY_CAL_FULL,
LCNPHY_CAL_RECAL,
LCNPHY_CAL_CURRECAL,
LCNPHY_CAL_DIGCAL,
LCNPHY_CAL_GCTRL
-} lcnphy_cal_mode_t;
-
-typedef struct {
- lcnphy_txgains_t gains;
- bool useindex;
- u8 index;
-} lcnphy_txcalgains_t;
+};

-typedef struct {
+struct lcnphy_rx_iqcomp {
u8 chan;
s16 a;
s16 b;
-} lcnphy_rx_iqcomp_t;
+};

-typedef struct {
+struct lcnphy_spb_tone {
s16 re;
s16 im;
-} lcnphy_spb_tone_t;
+};

-typedef struct {
+struct lcnphy_unsign16_struct {
u16 re;
u16 im;
-} lcnphy_unsign16_struct;
+};

-typedef struct {
+struct lcnphy_iq_est {
u32 iq_prod;
u32 i_pwr;
u32 q_pwr;
-} lcnphy_iq_est_t;
+};

-typedef struct {
+struct lcnphy_sfo_cfg {
u16 ptcentreTs20;
u16 ptcentreFactor;
-} lcnphy_sfo_cfg_t;
+};

-typedef enum {
+enum lcnphy_papd_cal_type {
LCNPHY_PAPD_CAL_CW,
LCNPHY_PAPD_CAL_OFDM
-} lcnphy_papd_cal_type_t;
+};

typedef u16 iqcal_gain_params_lcnphy[9];

@@ -206,7 +201,7 @@ static const u16 iqcal_gainparams_numgains_lcnphy[1] = {
sizeof(*tbl_iqcal_gainparams_lcnphy_2G),
};

-static const lcnphy_sfo_cfg_t lcnphy_sfo_cfg[] = {
+static const struct lcnphy_sfo_cfg lcnphy_sfo_cfg[] = {
{965, 1087},
{967, 1085},
{969, 1082},
@@ -272,7 +267,7 @@ u16 lcnphy_iqcal_ir_gainladder[] = {
};

static const
-lcnphy_spb_tone_t lcnphy_spb_tone_3750[] = {
+struct lcnphy_spb_tone lcnphy_spb_tone_3750[] = {
{88, 0},
{73, 49},
{34, 81},
@@ -365,7 +360,7 @@ u16 rxiq_cal_rf_reg[11] = {
};

static const
-lcnphy_rx_iqcomp_t lcnphy_rx_iqcomp_table_rev0[] = {
+struct lcnphy_rx_iqcomp lcnphy_rx_iqcomp_table_rev0[] = {
{1, 0, 0},
{2, 0, 0},
{3, 0, 0},
@@ -542,11 +537,11 @@ static const s8 lcnphy_gain_index_offset_for_rssi[] = {

extern const u8 spur_tbl_rev0[];
extern const u32 dot11lcnphytbl_rx_gain_info_sz_rev1;
-extern const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_rev1[];
-extern const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa;
-extern const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250;
+extern const struct phytbl_info dot11lcnphytbl_rx_gain_info_rev1[];
+extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa;
+extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250;

-typedef struct _chan_info_2064_lcnphy {
+struct chan_info_2064_lcnphy {
uint chan;
uint freq;
u8 logen_buftune;
@@ -557,9 +552,9 @@ typedef struct _chan_info_2064_lcnphy {
u8 pa_rxrf_lna1_freq_tune;
u8 pa_rxrf_lna2_freq_tune;
u8 rxrf_rxrf_spare1;
-} chan_info_2064_lcnphy_t;
+};

-static chan_info_2064_lcnphy_t chan_info_2064_lcnphy[] = {
+static struct chan_info_2064_lcnphy chan_info_2064_lcnphy[] = {
{1, 2412, 0x0B, 0x0A, 0x00, 0x07, 0x0A, 0x88, 0x88, 0x80},
{2, 2417, 0x0B, 0x0A, 0x00, 0x07, 0x0A, 0x88, 0x88, 0x80},
{3, 2422, 0x0B, 0x0A, 0x00, 0x07, 0x0A, 0x88, 0x88, 0x80},
@@ -576,7 +571,7 @@ static chan_info_2064_lcnphy_t chan_info_2064_lcnphy[] = {
{14, 2484, 0x0B, 0x0A, 0x00, 0x07, 0x0A, 0x88, 0x88, 0x80},
};

-lcnphy_radio_regs_t lcnphy_radio_regs_2064[] = {
+struct lcnphy_radio_regs lcnphy_radio_regs_2064[] = {
{0x00, 0, 0, 0, 0},
{0x01, 0x64, 0x64, 0, 0},
{0x02, 0x20, 0x20, 0, 0},
@@ -982,14 +977,15 @@ static void wlc_lcnphy_set_pa_gain(phy_info_t *pi, u16 gain);
static void wlc_lcnphy_set_trsw_override(phy_info_t *pi, bool tx, bool rx);
static void wlc_lcnphy_set_bbmult(phy_info_t *pi, u8 m0);
static u8 wlc_lcnphy_get_bbmult(phy_info_t *pi);
-static void wlc_lcnphy_get_tx_gain(phy_info_t *pi, lcnphy_txgains_t *gains);
+static void wlc_lcnphy_get_tx_gain(phy_info_t *pi,
+ struct lcnphy_txgains *gains);
static void wlc_lcnphy_set_tx_gain_override(phy_info_t *pi, bool bEnable);
static void wlc_lcnphy_toggle_afe_pwdn(phy_info_t *pi);
static void wlc_lcnphy_rx_gain_override_enable(phy_info_t *pi, bool enable);
static void wlc_lcnphy_set_tx_gain(phy_info_t *pi,
- lcnphy_txgains_t *target_gains);
+ struct lcnphy_txgains *target_gains);
static bool wlc_lcnphy_rx_iq_est(phy_info_t *pi, u16 num_samps,
- u8 wait_time, lcnphy_iq_est_t *iq_est);
+ u8 wait_time, struct lcnphy_iq_est *iq_est);
static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps);
static u16 wlc_lcnphy_get_pa_gain(phy_info_t *pi);
static void wlc_lcnphy_afe_clk_init(phy_info_t *pi, u8 mode);
@@ -998,7 +994,7 @@ static void wlc_lcnphy_radio_2064_channel_tune_4313(phy_info_t *pi,
u8 channel);

static void wlc_lcnphy_load_tx_gain_table(phy_info_t *pi,
- const lcnphy_tx_gain_tbl_entry *g);
+ const struct lcnphy_tx_gain_tbl_entry *g);

static void wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo,
u16 thresh, s16 *ptr, int mode);
@@ -1009,7 +1005,8 @@ static void wlc_lcnphy_tx_iqlo_loopback_cleanup(phy_info_t *pi,
u16 *values_to_save);
static void wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, s16 coeff_x,
s16 coeff_y);
-static lcnphy_unsign16_struct wlc_lcnphy_get_cc(phy_info_t *pi, int cal_type);
+static struct lcnphy_unsign16_struct wlc_lcnphy_get_cc(phy_info_t *pi,
+ int cal_type);
static void wlc_lcnphy_a1(phy_info_t *pi, int cal_type,
int num_levels, int step_size_lg2);
static void wlc_lcnphy_tx_iqlo_soft_cal_full(phy_info_t *pi);
@@ -1028,12 +1025,12 @@ static int wlc_lcnphy_load_tx_iir_filter(phy_info_t *pi, bool is_ofdm,
s16 filt_type);
static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, u16 a, u16 b);

-void wlc_lcnphy_write_table(phy_info_t *pi, const phytbl_info_t *pti)
+void wlc_lcnphy_write_table(phy_info_t *pi, const struct phytbl_info *pti)
{
wlc_phy_write_table(pi, pti, 0x455, 0x457, 0x456);
}

-void wlc_lcnphy_read_table(phy_info_t *pi, phytbl_info_t *pti)
+void wlc_lcnphy_read_table(phy_info_t *pi, struct phytbl_info *pti)
{
wlc_phy_read_table(pi, pti, 0x455, 0x457, 0x456);
}
@@ -1043,7 +1040,7 @@ wlc_lcnphy_common_read_table(phy_info_t *pi, u32 tbl_id,
const void *tbl_ptr, u32 tbl_len,
u32 tbl_width, u32 tbl_offset)
{
- phytbl_info_t tab;
+ struct phytbl_info tab;
tab.tbl_id = tbl_id;
tab.tbl_ptr = tbl_ptr;
tab.tbl_len = tbl_len;
@@ -1058,7 +1055,7 @@ wlc_lcnphy_common_write_table(phy_info_t *pi, u32 tbl_id,
u32 tbl_width, u32 tbl_offset)
{

- phytbl_info_t tab;
+ struct phytbl_info tab;
tab.tbl_id = tbl_id;
tab.tbl_ptr = tbl_ptr;
tab.tbl_len = tbl_len;
@@ -1116,7 +1113,7 @@ static int wlc_lcnphy_calc_floor(s16 coeff_x, int type)
s8 wlc_lcnphy_get_current_tx_pwr_idx(phy_info_t *pi)
{
s8 index;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (txpwrctrl_off(pi))
index = pi_lcn->lcnphy_current_index;
@@ -1131,7 +1128,7 @@ s8 wlc_lcnphy_get_current_tx_pwr_idx(phy_info_t *pi)

static u32 wlc_lcnphy_measure_digital_power(phy_info_t *pi, u16 nsamples)
{
- lcnphy_iq_est_t iq_est = { 0, 0, 0 };
+ struct lcnphy_iq_est iq_est = { 0, 0, 0 };

if (!wlc_lcnphy_rx_iq_est(pi, nsamples, 32, &iq_est))
return 0;
@@ -1276,7 +1273,7 @@ static u16 wlc_lcnphy_get_pa_gain(phy_info_t *pi)
}

static void
-wlc_lcnphy_set_tx_gain(phy_info_t *pi, lcnphy_txgains_t *target_gains)
+wlc_lcnphy_set_tx_gain(phy_info_t *pi, struct lcnphy_txgains *target_gains)
{
u16 pa_gain = wlc_lcnphy_get_pa_gain(pi);

@@ -1304,7 +1301,7 @@ wlc_lcnphy_set_tx_gain(phy_info_t *pi, lcnphy_txgains_t *target_gains)
static void wlc_lcnphy_set_bbmult(phy_info_t *pi, u8 m0)
{
u16 m0m1 = (u16) m0 << 8;
- phytbl_info_t tab;
+ struct phytbl_info tab;

tab.tbl_ptr = &m0m1;
tab.tbl_len = 1;
@@ -1317,7 +1314,7 @@ static void wlc_lcnphy_set_bbmult(phy_info_t *pi, u8 m0)
static void wlc_lcnphy_clear_tx_power_offsets(phy_info_t *pi)
{
u32 data_buf[64];
- phytbl_info_t tab;
+ struct phytbl_info tab;

memset(data_buf, 0, sizeof(data_buf));

@@ -1337,13 +1334,13 @@ static void wlc_lcnphy_clear_tx_power_offsets(phy_info_t *pi)
wlc_lcnphy_write_table(pi, &tab);
}

-typedef enum {
+enum lcnphy_tssi_mode {
LCNPHY_TSSI_PRE_PA,
LCNPHY_TSSI_POST_PA,
LCNPHY_TSSI_EXT
-} lcnphy_tssi_mode_t;
+};

-static void wlc_lcnphy_set_tssi_mux(phy_info_t *pi, lcnphy_tssi_mode_t pos)
+static void wlc_lcnphy_set_tssi_mux(phy_info_t *pi, enum lcnphy_tssi_mode pos)
{
mod_phy_reg(pi, 0x4d7, (0x1 << 0), (0x1) << 0);

@@ -1406,7 +1403,7 @@ static u16 wlc_lcnphy_rfseq_tbl_adc_pwrup(phy_info_t *pi)
static void wlc_lcnphy_pwrctrl_rssiparams(phy_info_t *pi)
{
u16 auxpga_vmid, auxpga_vmid_temp, auxpga_gain_temp;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

auxpga_vmid =
(2 << 8) | (pi_lcn->lcnphy_rssi_vc << 4) | pi_lcn->lcnphy_rssi_vf;
@@ -1449,7 +1446,7 @@ static void wlc_lcnphy_pwrctrl_rssiparams(phy_info_t *pi)

static void wlc_lcnphy_tssi_setup(phy_info_t *pi)
{
- phytbl_info_t tab;
+ struct phytbl_info tab;
u32 rfseq, ind;

tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL;
@@ -1564,7 +1561,7 @@ static void wlc_lcnphy_tssi_setup(phy_info_t *pi)
void wlc_lcnphy_tx_pwr_update_npt(phy_info_t *pi)
{
u16 tx_cnt, tx_total, npt;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

tx_total = wlc_lcnphy_total_tx_frames(pi);
tx_cnt = tx_total - pi_lcn->lcnphy_tssi_tx_cnt;
@@ -1593,7 +1590,7 @@ s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1)

static void wlc_lcnphy_txpower_reset_npt(phy_info_t *pi)
{
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi))
return;

@@ -1603,7 +1600,7 @@ static void wlc_lcnphy_txpower_reset_npt(phy_info_t *pi)

void wlc_lcnphy_txpower_recalc_target(phy_info_t *pi)
{
- phytbl_info_t tab;
+ struct phytbl_info tab;
u32 rate_table[WLC_NUM_RATES_CCK + WLC_NUM_RATES_OFDM +
WLC_NUM_RATES_MCS_1_STREAM];
uint i, j;
@@ -1638,7 +1635,7 @@ static void wlc_lcnphy_set_tx_pwr_soft_ctrl(phy_info_t *pi, s8 index)
u32 ofdm_offset, reg_offset_cck;
int i;
u16 index2;
- phytbl_info_t tab;
+ struct phytbl_info tab;

if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi))
return;
@@ -1691,7 +1688,7 @@ static s8 wlc_lcnphy_tempcompensated_txpwrctrl(phy_info_t *pi)
s16 manp, meas_temp, temp_diff;
bool neg = 0;
u16 temp;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi))
return pi_lcn->lcnphy_current_index;
@@ -1767,7 +1764,7 @@ void wlc_lcnphy_set_tx_pwr_ctrl(phy_info_t *pi, u16 mode)
{
u16 old_mode = wlc_lcnphy_get_tx_pwr_ctrl(pi);
s8 index;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

mode = wlc_lcnphy_set_tx_pwr_ctrl_mode(pi, mode);
old_mode = wlc_lcnphy_set_tx_pwr_ctrl_mode(pi, old_mode);
@@ -1831,11 +1828,11 @@ static bool wlc_lcnphy_iqcal_wait(phy_info_t *pi)

static void
wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
- lcnphy_txgains_t *target_gains,
- lcnphy_cal_mode_t cal_mode, bool keep_tone)
+ struct lcnphy_txgains *target_gains,
+ enum lcnphy_cal_mode cal_mode, bool keep_tone)
{

- lcnphy_txgains_t cal_gains, temp_gains;
+ struct lcnphy_txgains cal_gains, temp_gains;
u16 hash;
u8 band_idx;
int j;
@@ -1861,10 +1858,10 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
u16 tx_pwr_ctrl_old, save_txpwrctrlrfctrl2;
u16 save_sslpnCalibClkEnCtrl, save_sslpnRxFeClkEnCtrl;
bool tx_gain_override_old;
- lcnphy_txgains_t old_gains;
+ struct lcnphy_txgains old_gains;
uint i, n_cal_cmds = 0, n_cal_start = 0;
u16 *values_to_save;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return;
@@ -2068,7 +2065,7 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
static void wlc_lcnphy_idle_tssi_est(wlc_phy_t *ppi)
{
bool suspend, tx_gain_override_old;
- lcnphy_txgains_t old_gains;
+ struct lcnphy_txgains old_gains;
phy_info_t *pi = (phy_info_t *) ppi;
u16 idleTssi, idleTssi0_2C, idleTssi0_OB, idleTssi0_regvalue_OB,
idleTssi0_regvalue_2C;
@@ -2137,14 +2134,14 @@ static void wlc_lcnphy_vbat_temp_sense_setup(phy_info_t *pi, u8 mode)
u16 save_txpwrCtrlEn;
u8 auxpga_vmidcourse, auxpga_vmidfine, auxpga_gain;
u16 auxpga_vmid;
- phytbl_info_t tab;
+ struct phytbl_info tab;
u32 val;
u8 save_reg007, save_reg0FF, save_reg11F, save_reg005, save_reg025,
save_reg112;
u16 values_to_save[14];
s8 index;
int i;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
udelay(999);

save_reg007 = (u8) read_radio_reg(pi, RADIO_2064_REG007);
@@ -2275,9 +2272,9 @@ static void wlc_lcnphy_vbat_temp_sense_setup(phy_info_t *pi, u8 mode)

void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (wlc_phy_t *ppi)
{
- lcnphy_txgains_t tx_gains;
+ struct lcnphy_txgains tx_gains;
u8 bbmult;
- phytbl_info_t tab;
+ struct phytbl_info tab;
s32 a1, b0, b1;
s32 tssi, pwr, maxtargetpwr, mintargetpwr;
bool suspend;
@@ -2354,7 +2351,7 @@ void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (wlc_phy_t *ppi)
static u8 wlc_lcnphy_get_bbmult(phy_info_t *pi)
{
u16 m0m1;
- phytbl_info_t tab;
+ struct phytbl_info tab;

tab.tbl_ptr = &m0m1;
tab.tbl_len = 1;
@@ -2386,7 +2383,7 @@ wlc_lcnphy_get_radio_loft(phy_info_t *pi,
*fq0 = LCNPHY_IQLOCC_READ(read_radio_reg(pi, RADIO_2064_REG08C));
}

-static void wlc_lcnphy_get_tx_gain(phy_info_t *pi, lcnphy_txgains_t *gains)
+static void wlc_lcnphy_get_tx_gain(phy_info_t *pi, struct lcnphy_txgains *gains)
{
u16 dac_gain;

@@ -2407,7 +2404,7 @@ static void wlc_lcnphy_get_tx_gain(phy_info_t *pi, lcnphy_txgains_t *gains)

void wlc_lcnphy_set_tx_iqcc(phy_info_t *pi, u16 a, u16 b)
{
- phytbl_info_t tab;
+ struct phytbl_info tab;
u16 iqcc[2];

iqcc[0] = a;
@@ -2423,7 +2420,7 @@ void wlc_lcnphy_set_tx_iqcc(phy_info_t *pi, u16 a, u16 b)

void wlc_lcnphy_set_tx_locc(phy_info_t *pi, u16 didq)
{
- phytbl_info_t tab;
+ struct phytbl_info tab;

tab.tbl_id = LCNPHY_TBL_ID_IQLOCAL;
tab.tbl_width = 16;
@@ -2435,12 +2432,12 @@ void wlc_lcnphy_set_tx_locc(phy_info_t *pi, u16 didq)

void wlc_lcnphy_set_tx_pwr_by_index(phy_info_t *pi, int index)
{
- phytbl_info_t tab;
+ struct phytbl_info tab;
u16 a, b;
u8 bb_mult;
u32 bbmultiqcomp, txgain, locoeffs, rfpower;
- lcnphy_txgains_t gains;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct lcnphy_txgains gains;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

pi_lcn->lcnphy_tx_power_idx_override = (s8) index;
pi_lcn->lcnphy_current_index = (u8) index;
@@ -2505,7 +2502,7 @@ static void wlc_lcnphy_set_trsw_override(phy_info_t *pi, bool tx, bool rx)
static void wlc_lcnphy_clear_papd_comptable(phy_info_t *pi)
{
u32 j;
- phytbl_info_t tab;
+ struct phytbl_info tab;
u32 temp_offset[128];
tab.tbl_ptr = temp_offset;
tab.tbl_len = 128;
@@ -2720,8 +2717,8 @@ wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz, u16 max_val,
cs32 tone_samp;
u32 data_buf[64];
u16 i_samp, q_samp;
- phytbl_info_t tab;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phytbl_info tab;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

pi->phy_tx_tone_freq = f_kHz;

@@ -2776,7 +2773,7 @@ wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz, u16 max_val,
void wlc_lcnphy_stop_tx_tone(phy_info_t *pi)
{
s16 playback_status;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

pi->phy_tx_tone_freq = 0;
if (pi_lcn->lcnphy_spurmod) {
@@ -2813,7 +2810,7 @@ static void wlc_lcnphy_clear_trsw_override(phy_info_t *pi)
void wlc_lcnphy_get_tx_iqcc(phy_info_t *pi, u16 *a, u16 *b)
{
u16 iqcc[2];
- phytbl_info_t tab;
+ struct phytbl_info tab;

tab.tbl_ptr = iqcc;
tab.tbl_len = 2;
@@ -2828,7 +2825,7 @@ void wlc_lcnphy_get_tx_iqcc(phy_info_t *pi, u16 *a, u16 *b)

u16 wlc_lcnphy_get_tx_locc(phy_info_t *pi)
{
- phytbl_info_t tab;
+ struct phytbl_info tab;
u16 didq;

tab.tbl_id = 0;
@@ -2844,15 +2841,15 @@ u16 wlc_lcnphy_get_tx_locc(phy_info_t *pi)
static void wlc_lcnphy_txpwrtbl_iqlo_cal(phy_info_t *pi)
{

- lcnphy_txgains_t target_gains, old_gains;
+ struct lcnphy_txgains target_gains, old_gains;
u8 save_bb_mult;
u16 a, b, didq, save_pa_gain = 0;
uint idx, SAVE_txpwrindex = 0xFF;
u32 val;
u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
- phytbl_info_t tab;
+ struct phytbl_info tab;
u8 ei0, eq0, fi0, fq0;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

wlc_lcnphy_get_tx_gain(pi, &old_gains);
save_pa_gain = wlc_lcnphy_get_pa_gain(pi);
@@ -3006,7 +3003,7 @@ u16 wlc_lcnphy_tempsense(phy_info_t *pi, bool mode)
s32 avg = 0;
bool suspend = 0;
u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return -1;
@@ -3123,7 +3120,7 @@ static void wlc_lcnphy_afe_clk_init(phy_info_t *pi, u8 mode)
static bool
wlc_lcnphy_rx_iq_est(phy_info_t *pi,
u16 num_samps,
- u8 wait_time, lcnphy_iq_est_t *iq_est)
+ u8 wait_time, struct lcnphy_iq_est *iq_est)
{
int wait_count = 0;
bool result = true;
@@ -3172,12 +3169,12 @@ static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
#define LCNPHY_MIN_RXIQ_PWR 2
bool result;
u16 a0_new, b0_new;
- lcnphy_iq_est_t iq_est = { 0, 0, 0 };
+ struct lcnphy_iq_est iq_est = { 0, 0, 0 };
s32 a, b, temp;
s16 iq_nbits, qq_nbits, arsh, brsh;
s32 iq;
u32 ii, qq;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

a0_new = ((read_phy_reg(pi, 0x645) & (0x3ff << 0)) >> 0);
b0_new = ((read_phy_reg(pi, 0x646) & (0x3ff << 0)) >> 0);
@@ -3253,11 +3250,11 @@ static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
}

static bool
-wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const lcnphy_rx_iqcomp_t *iqcomp,
+wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const struct lcnphy_rx_iqcomp *iqcomp,
int iqcomp_sz, bool tx_switch, bool rx_switch, int module,
int tx_gain_idx)
{
- lcnphy_txgains_t old_gains;
+ struct lcnphy_txgains old_gains;
u16 tx_pwr_ctrl;
u8 tx_gain_index_old = 0;
bool result = false, tx_gain_override_old = false;
@@ -3270,7 +3267,7 @@ wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const lcnphy_rx_iqcomp_t *iqcomp,
u16 old_sslpnCalibClkEnCtrl, old_sslpnRxFeClkEnCtrl;
u16 values_to_save[11];
s16 *ptr;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

ptr = kmalloc(sizeof(s16) * 131, GFP_ATOMIC);
if (NULL == ptr) {
@@ -3432,7 +3429,7 @@ static void wlc_lcnphy_glacial_timer_based_cal(phy_info_t *pi)
bool suspend;
s8 index;
u16 SAVE_pwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
suspend =
(0 == (R_REG(&pi->regs->maccontrol) & MCTL_EN_MAC));
if (!suspend)
@@ -3455,14 +3452,14 @@ static void wlc_lcnphy_glacial_timer_based_cal(phy_info_t *pi)
static void wlc_lcnphy_periodic_cal(phy_info_t *pi)
{
bool suspend, full_cal;
- const lcnphy_rx_iqcomp_t *rx_iqcomp;
+ const struct lcnphy_rx_iqcomp *rx_iqcomp;
int rx_iqcomp_sz;
u16 SAVE_pwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
s8 index;
- phytbl_info_t tab;
+ struct phytbl_info tab;
s32 a1, b0, b1;
s32 tssi, pwr, maxtargetpwr, mintargetpwr;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return;
@@ -3528,7 +3525,7 @@ void wlc_lcnphy_calib_modes(phy_info_t *pi, uint mode)
{
u16 temp_new;
int temp1, temp2, temp_diff;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

switch (mode) {
case PHY_PERICAL_CHAN:
@@ -3594,7 +3591,7 @@ void WLBANDINITFN(wlc_phy_cal_init_lcnphy) (phy_info_t *pi)
static void wlc_lcnphy_set_chanspec_tweaks(phy_info_t *pi, chanspec_t chanspec)
{
u8 channel = CHSPEC_CHANNEL(chanspec);
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return;
@@ -3648,7 +3645,7 @@ void wlc_lcnphy_tx_power_adjustment(wlc_phy_t *ppi)
s8 index;
u16 index2;
phy_info_t *pi = (phy_info_t *) ppi;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi) && SAVE_txpwrctrl) {
index = wlc_lcnphy_tempcompensated_txpwrctrl(pi);
@@ -3679,7 +3676,7 @@ static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, u16 a, u16 b)
void WLBANDINITFN(wlc_phy_init_lcnphy) (phy_info_t *pi)
{
u8 phybw40;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
phybw40 = CHSPEC_IS40(pi->radio_chanspec);

pi_lcn->lcnphy_cal_counter = 0;
@@ -3826,7 +3823,7 @@ wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo, u16 thresh,
u16 sslpnCalibClkEnCtrl, timer;
u16 old_sslpnCalibClkEnCtrl;
s16 imag, real;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

timer = 0;
old_sslpnCalibClkEnCtrl = read_phy_reg(pi, 0x6da);
@@ -3897,7 +3894,7 @@ wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo, u16 thresh,

static void wlc_lcnphy_tx_iqlo_soft_cal_full(phy_info_t *pi)
{
- lcnphy_unsign16_struct iqcc0, locc2, locc3, locc4;
+ struct lcnphy_unsign16_struct iqcc0, locc2, locc3, locc4;

wlc_lcnphy_set_cc(pi, 0, 0, 0);
wlc_lcnphy_set_cc(pi, 2, 0, 0);
@@ -3962,11 +3959,12 @@ wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, s16 coeff_x, s16 coeff_y)
}
}

-static lcnphy_unsign16_struct wlc_lcnphy_get_cc(phy_info_t *pi, int cal_type)
+static struct lcnphy_unsign16_struct
+wlc_lcnphy_get_cc(phy_info_t *pi, int cal_type)
{
u16 a, b, didq;
u8 di0, dq0, ei, eq, fi, fq;
- lcnphy_unsign16_struct cc;
+ struct lcnphy_unsign16_struct cc;
cc.re = 0;
cc.im = 0;
switch (cal_type) {
@@ -3999,9 +3997,9 @@ static lcnphy_unsign16_struct wlc_lcnphy_get_cc(phy_info_t *pi, int cal_type)
static void
wlc_lcnphy_a1(phy_info_t *pi, int cal_type, int num_levels, int step_size_lg2)
{
- const lcnphy_spb_tone_t *phy_c1;
- lcnphy_spb_tone_t phy_c2;
- lcnphy_unsign16_struct phy_c3;
+ const struct lcnphy_spb_tone *phy_c1;
+ struct lcnphy_spb_tone phy_c2;
+ struct lcnphy_unsign16_struct phy_c3;
int phy_c4, phy_c5, k, l, j, phy_c6;
u16 phy_c7, phy_c8, phy_c9;
s16 phy_c10, phy_c11, phy_c12, phy_c13, phy_c14, phy_c15, phy_c16;
@@ -4211,10 +4209,9 @@ wlc_lcnphy_tx_iqlo_loopback_cleanup(phy_info_t *pi, u16 *values_to_save)

static void
WLBANDINITFN(wlc_lcnphy_load_tx_gain_table) (phy_info_t *pi,
- const lcnphy_tx_gain_tbl_entry *
- gain_table) {
+ const struct lcnphy_tx_gain_tbl_entry *gain_table) {
u32 j;
- phytbl_info_t tab;
+ struct phytbl_info tab;
u32 val;
u16 pa_gain;
u16 gm_gain;
@@ -4248,7 +4245,7 @@ WLBANDINITFN(wlc_lcnphy_load_tx_gain_table) (phy_info_t *pi,

static void wlc_lcnphy_load_rfpower(phy_info_t *pi)
{
- phytbl_info_t tab;
+ struct phytbl_info tab;
u32 val, bbmult, rfgain;
u8 index;
u8 scale_factor = 1;
@@ -4299,7 +4296,7 @@ static void WLBANDINITFN(wlc_lcnphy_tbl_init) (phy_info_t *pi)
{
uint idx;
u8 phybw40;
- phytbl_info_t tab;
+ struct phytbl_info tab;
u32 val;

phybw40 = CHSPEC_IS40(pi->radio_chanspec);
@@ -4393,7 +4390,7 @@ static void WLBANDINITFN(wlc_lcnphy_tbl_init) (phy_info_t *pi)
static void WLBANDINITFN(wlc_lcnphy_rev0_baseband_init) (phy_info_t *pi)
{
u16 afectrl1;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

write_radio_reg(pi, RADIO_2064_REG11C, 0x0);

@@ -4449,9 +4446,9 @@ static void WLBANDINITFN(wlc_lcnphy_rev2_baseband_init) (phy_info_t *pi)
static void wlc_lcnphy_agc_temp_init(phy_info_t *pi)
{
s16 temp;
- phytbl_info_t tab;
+ struct phytbl_info tab;
u32 tableBuffer[2];
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return;
@@ -4575,7 +4572,7 @@ static void WLBANDINITFN(wlc_lcnphy_baseband_init) (phy_info_t *pi)
static void WLBANDINITFN(wlc_radio_2064_init) (phy_info_t *pi)
{
u32 i;
- lcnphy_radio_regs_t *lcnphyregs = NULL;
+ struct lcnphy_radio_regs *lcnphyregs = NULL;

lcnphyregs = lcnphy_radio_regs_2064;

@@ -4699,7 +4696,7 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(phy_info_t *pi)
{
s8 txpwr = 0;
int i;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (CHSPEC_IS2G(pi->radio_chanspec)) {
u16 cckpo = 0;
@@ -4836,7 +4833,7 @@ static void
wlc_lcnphy_radio_2064_channel_tune_4313(phy_info_t *pi, u8 channel)
{
uint i;
- const chan_info_2064_lcnphy_t *ci;
+ const struct chan_info_2064_lcnphy *ci;
u8 rfpll_doubler = 0;
u8 pll_pwrup, pll_pwrup_ovr;
fixed qFxtal, qFref, qFvco, qFcal;
@@ -5030,9 +5027,9 @@ void wlc_phy_detach_lcnphy(phy_info_t *pi)

bool wlc_phy_attach_lcnphy(phy_info_t *pi)
{
- phy_info_lcnphy_t *pi_lcn;
+ struct phy_info_lcnphy *pi_lcn;

- pi->u.pi_lcnphy = kzalloc(sizeof(phy_info_lcnphy_t), GFP_ATOMIC);
+ pi->u.pi_lcnphy = kzalloc(sizeof(struct phy_info_lcnphy), GFP_ATOMIC);
if (pi->u.pi_lcnphy == NULL) {
return false;
}
@@ -5110,7 +5107,7 @@ static u32 wlc_lcnphy_get_receive_power(phy_info_t *pi, s32 *gain_index)
u32 received_power = 0;
s32 max_index = 0;
u32 gain_code = 0;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

max_index = 36;
if (*gain_index >= 0)
@@ -5149,7 +5146,7 @@ s32 wlc_lcnphy_rx_signal_power(phy_info_t *pi, s32 gain_index)
input_power_db;
s32 received_power, temperature;
uint freq;
- phy_info_lcnphy_t *pi_lcn = pi->u.pi_lcnphy;
+ struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;

received_power = wlc_lcnphy_get_receive_power(pi, &gain_index);

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h
index d360714..b21a29b 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h
@@ -100,7 +100,7 @@ struct phy_info_lcnphy {
u16 lcnphy_extstxctrl1;
s16 lcnphy_cck_dig_filt_type;
s16 lcnphy_ofdm_dig_filt_type;
- lcnphy_cal_results_t lcnphy_cal_results;
+ struct lcnphy_cal_results lcnphy_cal_results;

u8 lcnphy_psat_pwr;
u8 lcnphy_psat_indx;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index c79c047..e6fe8b7 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -141,7 +141,7 @@
#define CCTRL5357_EXTPA (1<<14) /* extPA in ChipControl 1, bit 14 */
#define CCTRL5357_ANT_MUX_2o3 (1<<15) /* 2o3 in ChipControl 1, bit 15 */

-typedef struct _nphy_iqcal_params {
+struct nphy_iqcal_params {
u16 txlpf;
u16 txgm;
u16 pga;
@@ -149,20 +149,20 @@ typedef struct _nphy_iqcal_params {
u16 ipa;
u16 cal_gain;
u16 ncorr[5];
-} nphy_iqcal_params_t;
+};

-typedef struct _nphy_txiqcal_ladder {
+struct nphy_txiqcal_ladder {
u8 percent;
u8 g_env;
-} nphy_txiqcal_ladder_t;
+};

-typedef struct {
- nphy_txgains_t gains;
+struct nphy_ipa_txcalgains {
+ struct nphy_txgains gains;
bool useindex;
u8 index;
-} nphy_ipa_txcalgains_t;
+};

-typedef struct nphy_papd_restore_state_t {
+struct nphy_papd_restore_state {
u16 fbmix[2];
u16 vga_master[2];
u16 intpa_master[2];
@@ -171,20 +171,20 @@ typedef struct nphy_papd_restore_state_t {
u16 pwrup[2];
u16 atten[2];
u16 mm;
-} nphy_papd_restore_state;
+};

-typedef struct _nphy_ipa_txrxgain {
+struct nphy_ipa_txrxgain {
u16 hpvga;
u16 lpf_biq1;
u16 lpf_biq0;
u16 lna2;
u16 lna1;
s8 txpwrindex;
-} nphy_ipa_txrxgain_t;
+};

#define NPHY_IPA_RXCAL_MAXGAININDEX (6 - 1)

-nphy_ipa_txrxgain_t nphy_ipa_rxcal_gaintbl_5GHz[] = { {0, 0, 0, 0, 0, 100},
+struct nphy_ipa_txrxgain nphy_ipa_rxcal_gaintbl_5GHz[] = { {0, 0, 0, 0, 0, 100},
{0, 0, 0, 0, 0, 50},
{0, 0, 0, 0, 0, -1},
{0, 0, 0, 3, 0, -1},
@@ -192,7 +192,7 @@ nphy_ipa_txrxgain_t nphy_ipa_rxcal_gaintbl_5GHz[] = { {0, 0, 0, 0, 0, 100},
{0, 2, 3, 3, 0, -1}
};

-nphy_ipa_txrxgain_t nphy_ipa_rxcal_gaintbl_2GHz[] = { {0, 0, 0, 0, 0, 128},
+struct nphy_ipa_txrxgain nphy_ipa_rxcal_gaintbl_2GHz[] = { {0, 0, 0, 0, 0, 128},
{0, 0, 0, 0, 0, 70},
{0, 0, 0, 0, 0, 20},
{0, 0, 0, 3, 0, 20},
@@ -200,7 +200,8 @@ nphy_ipa_txrxgain_t nphy_ipa_rxcal_gaintbl_2GHz[] = { {0, 0, 0, 0, 0, 128},
{0, 2, 3, 3, 0, 20}
};

-nphy_ipa_txrxgain_t nphy_ipa_rxcal_gaintbl_5GHz_rev7[] = { {0, 0, 0, 0, 0, 100},
+struct nphy_ipa_txrxgain nphy_ipa_rxcal_gaintbl_5GHz_rev7[] = {
+{0, 0, 0, 0, 0, 100},
{0, 0, 0, 0, 0, 50},
{0, 0, 0, 0, 0, -1},
{0, 0, 0, 3, 0, -1},
@@ -208,7 +209,8 @@ nphy_ipa_txrxgain_t nphy_ipa_rxcal_gaintbl_5GHz_rev7[] = { {0, 0, 0, 0, 0, 100},
{0, 0, 5, 3, 0, -1}
};

-nphy_ipa_txrxgain_t nphy_ipa_rxcal_gaintbl_2GHz_rev7[] = { {0, 0, 0, 0, 0, 10},
+struct nphy_ipa_txrxgain nphy_ipa_rxcal_gaintbl_2GHz_rev7[] = {
+{0, 0, 0, 0, 0, 10},
{0, 0, 0, 1, 0, 10},
{0, 0, 1, 2, 0, 10},
{0, 0, 1, 3, 0, 10},
@@ -255,7 +257,7 @@ u16 NPHY_IPA_REV4_txdigi_filtcoeffs[][NPHY_NUM_DIG_FILT_COEFFS] = {
0x97, 0x12d, 0x97, 0x25a, 0xd10, 0x25a}
};

-typedef struct _chan_info_nphy_2055 {
+struct chan_info_nphy_2055 {
u16 chan;
u16 freq;
uint unknown;
@@ -287,9 +289,9 @@ typedef struct _chan_info_nphy_2055 {
u16 PHY_BW4;
u16 PHY_BW5;
u16 PHY_BW6;
-} chan_info_nphy_2055_t;
+};

-typedef struct _chan_info_nphy_radio205x {
+struct chan_info_nphy_radio205x {
u16 chan;
u16 freq;
u8 RF_SYN_pll_vcocal1;
@@ -335,9 +337,9 @@ typedef struct _chan_info_nphy_radio205x {
u16 PHY_BW4;
u16 PHY_BW5;
u16 PHY_BW6;
-} chan_info_nphy_radio205x_t;
+};

-typedef struct _chan_info_nphy_radio2057 {
+struct chan_info_nphy_radio2057 {
u16 chan;
u16 freq;
u8 RF_vcocal_countval0;
@@ -374,9 +376,9 @@ typedef struct _chan_info_nphy_radio2057 {
u16 PHY_BW4;
u16 PHY_BW5;
u16 PHY_BW6;
-} chan_info_nphy_radio2057_t;
+};

-typedef struct _chan_info_nphy_radio2057_rev5 {
+struct chan_info_nphy_radio2057_rev5 {
u16 chan;
u16 freq;
u8 RF_vcocal_countval0;
@@ -403,18 +405,18 @@ typedef struct _chan_info_nphy_radio2057_rev5 {
u16 PHY_BW4;
u16 PHY_BW5;
u16 PHY_BW6;
-} chan_info_nphy_radio2057_rev5_t;
+};

-typedef struct nphy_sfo_cfg {
+struct nphy_sfo_cfg {
u16 PHY_BW1a;
u16 PHY_BW2;
u16 PHY_BW3;
u16 PHY_BW4;
u16 PHY_BW5;
u16 PHY_BW6;
-} nphy_sfo_cfg_t;
+};

-static chan_info_nphy_2055_t chan_info_nphy_2055[] = {
+static struct chan_info_nphy_2055 chan_info_nphy_2055[] = {
{
184, 4920, 3280, 0x71, 0x01, 0xEC, 0x0F, 0xFF, 0x01, 0x04, 0x0A,
0x00, 0x8F, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0x0F, 0x8F, 0xFF, 0x00, 0x0F,
@@ -913,7 +915,7 @@ static chan_info_nphy_2055_t chan_info_nphy_2055[] = {
0x01, 0x80, 0x3E6, 0x3E2, 0x3DE, 0x41B, 0x41F, 0x424}
};

-static chan_info_nphy_radio205x_t chan_info_nphyrev3_2056[] = {
+static struct chan_info_nphy_radio205x chan_info_nphyrev3_2056[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xff, 0x00, 0x08, 0x00, 0x7f,
@@ -1536,7 +1538,7 @@ static chan_info_nphy_radio205x_t chan_info_nphyrev3_2056[] = {
0x0f, 0x00, 0x0d, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};

-static chan_info_nphy_radio205x_t chan_info_nphyrev4_2056_A1[] = {
+static struct chan_info_nphy_radio205x chan_info_nphyrev4_2056_A1[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xff, 0x00, 0x0e, 0x00, 0x7f,
@@ -2159,7 +2161,7 @@ static chan_info_nphy_radio205x_t chan_info_nphyrev4_2056_A1[] = {
0x0f, 0x00, 0x0e, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};

-static chan_info_nphy_radio205x_t chan_info_nphyrev5_2056v5[] = {
+static struct chan_info_nphy_radio205x chan_info_nphyrev5_2056v5[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xff, 0x00, 0x0b, 0x00, 0x70,
@@ -2782,7 +2784,7 @@ static chan_info_nphy_radio205x_t chan_info_nphyrev5_2056v5[] = {
0x0d, 0x00, 0x08, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};

-static chan_info_nphy_radio205x_t chan_info_nphyrev6_2056v6[] = {
+static struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v6[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xfe, 0x00, 0x09, 0x00, 0x77,
@@ -3405,7 +3407,7 @@ static chan_info_nphy_radio205x_t chan_info_nphyrev6_2056v6[] = {
0x09, 0x00, 0x09, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};

-static chan_info_nphy_radio205x_t chan_info_nphyrev5n6_2056v7[] = {
+static struct chan_info_nphy_radio205x chan_info_nphyrev5n6_2056v7[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xff, 0x00, 0x0b, 0x00, 0x70,
@@ -4028,7 +4030,7 @@ static chan_info_nphy_radio205x_t chan_info_nphyrev5n6_2056v7[] = {
0x0d, 0x00, 0x08, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};

-static chan_info_nphy_radio205x_t chan_info_nphyrev6_2056v8[] = {
+static struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v8[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xfe, 0x00, 0x09, 0x00, 0x77,
@@ -4651,7 +4653,7 @@ static chan_info_nphy_radio205x_t chan_info_nphyrev6_2056v8[] = {
0x09, 0x00, 0x09, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};

-static chan_info_nphy_radio205x_t chan_info_nphyrev6_2056v11[] = {
+static struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v11[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x02, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xfe, 0x00, 0x09, 0x00, 0x77,
@@ -5274,7 +5276,7 @@ static chan_info_nphy_radio205x_t chan_info_nphyrev6_2056v11[] = {
0x09, 0x00, 0x09, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};

-static chan_info_nphy_radio2057_t chan_info_nphyrev7_2057_rev4[] = {
+static struct chan_info_nphy_radio2057 chan_info_nphyrev7_2057_rev4[] = {
{
184, 4920, 0x68, 0x16, 0x10, 0x0c, 0x0c, 0x0c, 0x30, 0xec, 0x01, 0x0f,
0x00, 0x0f, 0x00, 0xff, 0x00, 0x00, 0x0f, 0x0f, 0xf3, 0x00, 0xef, 0x00,
@@ -6137,7 +6139,7 @@ static chan_info_nphy_radio2057_t chan_info_nphyrev7_2057_rev4[] = {
0x0424}
};

-static chan_info_nphy_radio2057_rev5_t chan_info_nphyrev8_2057_rev5[] = {
+static struct chan_info_nphy_radio2057_rev5 chan_info_nphyrev8_2057_rev5[] = {
{
1, 2412, 0x48, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x6c, 0x09, 0x0d,
0x08, 0x0e, 0x61, 0x03, 0xff, 0x61, 0x03, 0xff, 0x03c9, 0x03c5, 0x03c1,
@@ -6196,7 +6198,7 @@ static chan_info_nphy_radio2057_rev5_t chan_info_nphyrev8_2057_rev5[] = {
0x041b, 0x041f, 0x0424}
};

-static chan_info_nphy_radio2057_rev5_t chan_info_nphyrev9_2057_rev5v1[] = {
+static struct chan_info_nphy_radio2057_rev5 chan_info_nphyrev9_2057_rev5v1[] = {
{
1, 2412, 0x48, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x6c, 0x09, 0x0d,
0x08, 0x0e, 0x61, 0x03, 0xff, 0x61, 0x03, 0xff, 0x03c9, 0x03c5, 0x03c1,
@@ -6255,7 +6257,7 @@ static chan_info_nphy_radio2057_rev5_t chan_info_nphyrev9_2057_rev5v1[] = {
0x041b, 0x041f, 0x0424}
};

-static chan_info_nphy_radio2057_t chan_info_nphyrev8_2057_rev7[] = {
+static struct chan_info_nphy_radio2057 chan_info_nphyrev8_2057_rev7[] = {
{
184, 4920, 0x68, 0x16, 0x10, 0x0c, 0x0c, 0x0c, 0x30, 0xec, 0x01, 0x0f,
0x00, 0x0f, 0x00, 0xff, 0x00, 0xd3, 0x0f, 0x0f, 0xd3, 0x00, 0xff, 0x00,
@@ -6996,7 +6998,7 @@ static chan_info_nphy_radio2057_t chan_info_nphyrev8_2057_rev7[] = {
0x0424}
};

-static chan_info_nphy_radio2057_t chan_info_nphyrev8_2057_rev8[] = {
+static struct chan_info_nphy_radio2057 chan_info_nphyrev8_2057_rev8[] = {
{
186, 4930, 0x6b, 0x16, 0x10, 0x0c, 0x0c, 0x0c, 0x30, 0xed, 0x01, 0x0f,
0x00, 0x0f, 0x00, 0xff, 0x00, 0xd3, 0x0f, 0x0f, 0xd3, 0x00, 0xff, 0x00,
@@ -7731,7 +7733,7 @@ static chan_info_nphy_radio2057_t chan_info_nphyrev8_2057_rev8[] = {
0x0424}
};

-radio_regs_t regs_2055[] = {
+struct radio_regs regs_2055[] = {
{0x02, 0x80, 0x80, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0x27, 0x27, 0, 0},
@@ -7960,7 +7962,7 @@ radio_regs_t regs_2055[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_regs_t regs_SYN_2056[] = {
+struct radio_regs regs_SYN_2056[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -8145,7 +8147,7 @@ radio_regs_t regs_SYN_2056[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_TX_2056[] = {
+struct radio_regs regs_TX_2056[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -8294,7 +8296,7 @@ radio_regs_t regs_TX_2056[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_RX_2056[] = {
+struct radio_regs regs_RX_2056[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -8445,7 +8447,7 @@ radio_regs_t regs_RX_2056[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_SYN_2056_A1[] = {
+struct radio_regs regs_SYN_2056_A1[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -8630,7 +8632,7 @@ radio_regs_t regs_SYN_2056_A1[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_TX_2056_A1[] = {
+struct radio_regs regs_TX_2056_A1[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -8779,7 +8781,7 @@ radio_regs_t regs_TX_2056_A1[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_RX_2056_A1[] = {
+struct radio_regs regs_RX_2056_A1[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -8930,7 +8932,7 @@ radio_regs_t regs_RX_2056_A1[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_SYN_2056_rev5[] = {
+struct radio_regs regs_SYN_2056_rev5[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -9115,7 +9117,7 @@ radio_regs_t regs_SYN_2056_rev5[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_TX_2056_rev5[] = {
+struct radio_regs regs_TX_2056_rev5[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -9272,7 +9274,7 @@ radio_regs_t regs_TX_2056_rev5[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_RX_2056_rev5[] = {
+struct radio_regs regs_RX_2056_rev5[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -9423,7 +9425,7 @@ radio_regs_t regs_RX_2056_rev5[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_SYN_2056_rev6[] = {
+struct radio_regs regs_SYN_2056_rev6[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -9608,7 +9610,7 @@ radio_regs_t regs_SYN_2056_rev6[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_TX_2056_rev6[] = {
+struct radio_regs regs_TX_2056_rev6[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -9765,7 +9767,7 @@ radio_regs_t regs_TX_2056_rev6[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_RX_2056_rev6[] = {
+struct radio_regs regs_RX_2056_rev6[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -9916,7 +9918,7 @@ radio_regs_t regs_RX_2056_rev6[] = {
{0xFFFF, 0, 0, 0, 0}
};

-radio_regs_t regs_SYN_2056_rev7[] = {
+struct radio_regs regs_SYN_2056_rev7[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -10101,7 +10103,7 @@ radio_regs_t regs_SYN_2056_rev7[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_regs_t regs_TX_2056_rev7[] = {
+struct radio_regs regs_TX_2056_rev7[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -10258,7 +10260,7 @@ radio_regs_t regs_TX_2056_rev7[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_regs_t regs_RX_2056_rev7[] = {
+struct radio_regs regs_RX_2056_rev7[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -10409,7 +10411,7 @@ radio_regs_t regs_RX_2056_rev7[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_regs_t regs_SYN_2056_rev8[] = {
+struct radio_regs regs_SYN_2056_rev8[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -10594,7 +10596,7 @@ radio_regs_t regs_SYN_2056_rev8[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_regs_t regs_TX_2056_rev8[] = {
+struct radio_regs regs_TX_2056_rev8[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -10751,7 +10753,7 @@ radio_regs_t regs_TX_2056_rev8[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_regs_t regs_RX_2056_rev8[] = {
+struct radio_regs regs_RX_2056_rev8[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -10902,7 +10904,7 @@ radio_regs_t regs_RX_2056_rev8[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_regs_t regs_SYN_2056_rev11[] = {
+struct radio_regs regs_SYN_2056_rev11[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -11087,7 +11089,7 @@ radio_regs_t regs_SYN_2056_rev11[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_regs_t regs_TX_2056_rev11[] = {
+struct radio_regs regs_TX_2056_rev11[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -11244,7 +11246,7 @@ radio_regs_t regs_TX_2056_rev11[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_regs_t regs_RX_2056_rev11[] = {
+struct radio_regs regs_RX_2056_rev11[] = {
{0x02, 0, 0, 0, 0},
{0x03, 0, 0, 0, 0},
{0x04, 0, 0, 0, 0},
@@ -11395,7 +11397,7 @@ radio_regs_t regs_RX_2056_rev11[] = {
{0xFFFF, 0, 0, 0, 0},
};

-radio_20xx_regs_t regs_2057_rev4[] = {
+struct radio_20xx_regs regs_2057_rev4[] = {
{0x00, 0x84, 0},
{0x01, 0, 0},
{0x02, 0x60, 0},
@@ -11785,7 +11787,7 @@ radio_20xx_regs_t regs_2057_rev4[] = {
{0xFFFF, 0, 0},
};

-radio_20xx_regs_t regs_2057_rev5[] = {
+struct radio_20xx_regs regs_2057_rev5[] = {
{0x00, 0, 1},
{0x01, 0x57, 1},
{0x02, 0x20, 1},
@@ -12117,7 +12119,7 @@ radio_20xx_regs_t regs_2057_rev5[] = {
{0xFFFF, 0, 0}
};

-radio_20xx_regs_t regs_2057_rev5v1[] = {
+struct radio_20xx_regs regs_2057_rev5v1[] = {
{0x00, 0x15, 1},
{0x01, 0x57, 1},
{0x02, 0x20, 1},
@@ -12449,7 +12451,7 @@ radio_20xx_regs_t regs_2057_rev5v1[] = {
{0xFFFF, 0, 0}
};

-radio_20xx_regs_t regs_2057_rev7[] = {
+struct radio_20xx_regs regs_2057_rev7[] = {
{0x00, 0, 1},
{0x01, 0x57, 1},
{0x02, 0x20, 1},
@@ -12865,7 +12867,7 @@ radio_20xx_regs_t regs_2057_rev7[] = {
{0xFFFF, 0, 0}
};

-radio_20xx_regs_t regs_2057_rev8[] = {
+struct radio_20xx_regs regs_2057_rev8[] = {
{0x00, 0x8, 1},
{0x01, 0x57, 1},
{0x02, 0x20, 1},
@@ -14084,12 +14086,12 @@ static u8 ant_sw_ctrl_tbl_rev8_2057v7_core1[] = {
0x09, 0x0a, 0x09, 0x0a, 0x15, 0x16 };

static bool wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f,
- chan_info_nphy_radio2057_t **t0,
- chan_info_nphy_radio205x_t **t1,
- chan_info_nphy_radio2057_rev5_t **t2,
- chan_info_nphy_2055_t **t3);
+ struct chan_info_nphy_radio2057 **t0,
+ struct chan_info_nphy_radio205x **t1,
+ struct chan_info_nphy_radio2057_rev5 **t2,
+ struct chan_info_nphy_2055 **t3);
static void wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chans,
- const nphy_sfo_cfg_t *c);
+ const struct nphy_sfo_cfg *c);

static void wlc_phy_adjust_rx_analpfbw_nphy(phy_info_t *pi,
u16 reduction_factr);
@@ -14116,7 +14118,7 @@ static void wlc_phy_adjust_lnagaintbl_nphy(phy_info_t *pi);
static void wlc_phy_restore_rssical_nphy(phy_info_t *pi);
static void wlc_phy_reapply_txcal_coeffs_nphy(phy_info_t *pi);
static void wlc_phy_tx_iq_war_nphy(phy_info_t *pi);
-static int wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, nphy_txgains_t tg,
+static int wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, struct nphy_txgains tg,
u8 type, bool d);
static void wlc_phy_rxcal_gainctrl_nphy_rev5(phy_info_t *pi, u8 rxcore,
u16 *rg, u8 type);
@@ -14140,12 +14142,12 @@ static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi);
static void wlc_phy_a1_nphy(phy_info_t *pi, u8 core, u32 winsz, u32,
u32 e);
static u8 wlc_phy_a3_nphy(phy_info_t *pi, u8 start_gain, u8 core);
-static void wlc_phy_a2_nphy(phy_info_t *pi, nphy_ipa_txcalgains_t *,
- phy_cal_mode_t, u8);
+static void wlc_phy_a2_nphy(phy_info_t *pi, struct nphy_ipa_txcalgains *,
+ enum phy_cal_mode, u8);
static void wlc_phy_papd_cal_cleanup_nphy(phy_info_t *pi,
- nphy_papd_restore_state *state);
+ struct nphy_papd_restore_state *state);
static void wlc_phy_papd_cal_setup_nphy(phy_info_t *pi,
- nphy_papd_restore_state *state, u8);
+ struct nphy_papd_restore_state *state, u8);

static void wlc_phy_clip_det_nphy(phy_info_t *pi, u8 write, u16 *vals);

@@ -14246,7 +14248,7 @@ void
wlc_phy_table_write_nphy(phy_info_t *pi, u32 id, u32 len, u32 offset,
u32 width, const void *data)
{
- mimophytbl_info_t tbl;
+ struct phytbl_info tbl;

tbl.tbl_id = id;
tbl.tbl_len = len;
@@ -14260,7 +14262,7 @@ void
wlc_phy_table_read_nphy(phy_info_t *pi, u32 id, u32 len, u32 offset,
u32 width, void *data)
{
- mimophytbl_info_t tbl;
+ struct phytbl_info tbl;

tbl.tbl_id = id;
tbl.tbl_len = len;
@@ -14525,7 +14527,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
{
u16 val;
u16 clip1_ths[2];
- nphy_txgains_t target_gain;
+ struct nphy_txgains target_gain;
u8 tx_pwr_ctrl_state;
bool do_nphy_cal = false;
uint core;
@@ -17442,9 +17444,9 @@ static void wlc_phy_radio_preinit_205x(phy_info_t *pi)

static void wlc_phy_radio_init_2056(phy_info_t *pi)
{
- radio_regs_t *regs_SYN_2056_ptr = NULL;
- radio_regs_t *regs_TX_2056_ptr = NULL;
- radio_regs_t *regs_RX_2056_ptr = NULL;
+ struct radio_regs *regs_SYN_2056_ptr = NULL;
+ struct radio_regs *regs_TX_2056_ptr = NULL;
+ struct radio_regs *regs_RX_2056_ptr = NULL;

if (NREV_IS(pi->pubpi.phy_rev, 3)) {
regs_SYN_2056_ptr = regs_SYN_2056;
@@ -17530,7 +17532,7 @@ static void wlc_phy_radio_postinit_2056(phy_info_t *pi)

static void wlc_phy_radio_init_2057(phy_info_t *pi)
{
- radio_20xx_regs_t *regs_2057_ptr = NULL;
+ struct radio_20xx_regs *regs_2057_ptr = NULL;

if (NREV_IS(pi->pubpi.phy_rev, 7)) {

@@ -17590,15 +17592,15 @@ static void wlc_phy_radio_postinit_2057(phy_info_t *pi)

static bool
wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f,
- chan_info_nphy_radio2057_t **t0,
- chan_info_nphy_radio205x_t **t1,
- chan_info_nphy_radio2057_rev5_t **t2,
- chan_info_nphy_2055_t **t3)
+ struct chan_info_nphy_radio2057 **t0,
+ struct chan_info_nphy_radio205x **t1,
+ struct chan_info_nphy_radio2057_rev5 **t2,
+ struct chan_info_nphy_2055 **t3)
{
uint i;
- chan_info_nphy_radio2057_t *chan_info_tbl_p_0 = NULL;
- chan_info_nphy_radio205x_t *chan_info_tbl_p_1 = NULL;
- chan_info_nphy_radio2057_rev5_t *chan_info_tbl_p_2 = NULL;
+ struct chan_info_nphy_radio2057 *chan_info_tbl_p_0 = NULL;
+ struct chan_info_nphy_radio205x *chan_info_tbl_p_1 = NULL;
+ struct chan_info_nphy_radio2057_rev5 *chan_info_tbl_p_2 = NULL;
u32 tbl_len = 0;

int freq = 0;
@@ -17760,10 +17762,10 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f,
u8 wlc_phy_get_chan_freq_range_nphy(phy_info_t *pi, uint channel)
{
int freq;
- chan_info_nphy_radio2057_t *t0 = NULL;
- chan_info_nphy_radio205x_t *t1 = NULL;
- chan_info_nphy_radio2057_rev5_t *t2 = NULL;
- chan_info_nphy_2055_t *t3 = NULL;
+ struct chan_info_nphy_radio2057 *t0 = NULL;
+ struct chan_info_nphy_radio205x *t1 = NULL;
+ struct chan_info_nphy_radio2057_rev5 *t2 = NULL;
+ struct chan_info_nphy_2055 *t3 = NULL;

if (NORADIO_ENAB(pi->pubpi))
return WL_CHAN_FREQ_RANGE_2G;
@@ -17786,7 +17788,7 @@ u8 wlc_phy_get_chan_freq_range_nphy(phy_info_t *pi, uint channel)
}

static void
-wlc_phy_chanspec_radio2055_setup(phy_info_t *pi, chan_info_nphy_2055_t *ci)
+wlc_phy_chanspec_radio2055_setup(phy_info_t *pi, struct chan_info_nphy_2055 *ci)
{

write_radio_reg(pi, RADIO_2055_PLL_REF, ci->RF_pll_ref);
@@ -17849,9 +17851,9 @@ wlc_phy_chanspec_radio2055_setup(phy_info_t *pi, chan_info_nphy_2055_t *ci)

static void
wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
- const chan_info_nphy_radio205x_t *ci)
+ const struct chan_info_nphy_radio205x *ci)
{
- radio_regs_t *regs_SYN_2056_ptr = NULL;
+ struct radio_regs *regs_SYN_2056_ptr = NULL;

write_radio_reg(pi,
RADIO_2056_SYN_PLL_VCOCAL1 | RADIO_2056_SYN,
@@ -18292,8 +18294,8 @@ static u16 wlc_phy_radio205x_rcal(phy_info_t *pi)

static void
wlc_phy_chanspec_radio2057_setup(phy_info_t *pi,
- const chan_info_nphy_radio2057_t *ci,
- const chan_info_nphy_radio2057_rev5_t *ci2)
+ const struct chan_info_nphy_radio2057 *ci,
+ const struct chan_info_nphy_radio2057_rev5 *ci2)
{
int coreNum;
u16 txmix2g_tune_boost_pu = 0;
@@ -18910,7 +18912,7 @@ static void wlc_phy_spurwar_nphy(phy_info_t *pi)

static void
wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
- const nphy_sfo_cfg_t *ci)
+ const struct nphy_sfo_cfg *ci)
{
u16 val;

@@ -19047,10 +19049,10 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
void wlc_phy_chanspec_set_nphy(phy_info_t *pi, chanspec_t chanspec)
{
int freq;
- chan_info_nphy_radio2057_t *t0 = NULL;
- chan_info_nphy_radio205x_t *t1 = NULL;
- chan_info_nphy_radio2057_rev5_t *t2 = NULL;
- chan_info_nphy_2055_t *t3 = NULL;
+ struct chan_info_nphy_radio2057 *t0 = NULL;
+ struct chan_info_nphy_radio205x *t1 = NULL;
+ struct chan_info_nphy_radio2057_rev5 *t2 = NULL;
+ struct chan_info_nphy_2055 *t3 = NULL;

if (NORADIO_ENAB(pi->pubpi)) {
return;
@@ -19097,12 +19099,9 @@ void wlc_phy_chanspec_set_nphy(phy_info_t *pi, chanspec_t chanspec)

wlc_phy_chanspec_radio2057_setup(pi, t0, t2);
wlc_phy_chanspec_nphy_setup(pi, chanspec,
- (pi->pubpi.radiorev ==
- 5) ? (const nphy_sfo_cfg_t
- *)&(t2->
- PHY_BW1a)
- : (const nphy_sfo_cfg_t *)
- &(t0->PHY_BW1a));
+ (pi->pubpi.radiorev == 5) ?
+ (const struct nphy_sfo_cfg *)&(t2->PHY_BW1a) :
+ (const struct nphy_sfo_cfg *)&(t0->PHY_BW1a));

} else {

@@ -19113,8 +19112,7 @@ void wlc_phy_chanspec_set_nphy(phy_info_t *pi, chanspec_t chanspec)
wlc_phy_chanspec_radio2056_setup(pi, t1);

wlc_phy_chanspec_nphy_setup(pi, chanspec,
- (const nphy_sfo_cfg_t *)
- &(t1->PHY_BW1a));
+ (const struct nphy_sfo_cfg *) &(t1->PHY_BW1a));
}

} else {
@@ -19125,7 +19123,7 @@ void wlc_phy_chanspec_set_nphy(phy_info_t *pi, chanspec_t chanspec)

wlc_phy_chanspec_radio2055_setup(pi, t3);
wlc_phy_chanspec_nphy_setup(pi, chanspec,
- (const nphy_sfo_cfg_t *)&(t3->
+ (const struct nphy_sfo_cfg *)&(t3->
PHY_BW1a));
}

@@ -21369,9 +21367,9 @@ static void wlc_phy_rssi_cal_nphy_rev2(phy_info_t *pi, u8 rssi_type)
}

int
-wlc_phy_rssi_compute_nphy(phy_info_t *pi, wlc_d11rxhdr_t *wlc_rxh)
+wlc_phy_rssi_compute_nphy(phy_info_t *pi, struct brcms_d11rxhdr *wlc_rxh)
{
- d11rxhdr_t *rxh = &wlc_rxh->rxhdr;
+ struct d11rxhdr *rxh = &wlc_rxh->rxhdr;
s16 rxpwr, rxpwr0, rxpwr1;
s16 phyRx0_l, phyRx2_l;

@@ -22464,11 +22462,11 @@ void wlc_phy_stopplayback_nphy(phy_info_t *pi)
wlc_phy_stay_in_carriersearch_nphy(pi, false);
}

-nphy_txgains_t wlc_phy_get_tx_gain_nphy(phy_info_t *pi)
+struct nphy_txgains wlc_phy_get_tx_gain_nphy(phy_info_t *pi)
{
u16 base_idx[2], curr_gain[2];
u8 core_no;
- nphy_txgains_t target_gain;
+ struct nphy_txgains target_gain;
u32 *tx_pwrctrl_tbl = NULL;

if (pi->nphy_txpwrctrl == PHY_TPC_HW_OFF) {
@@ -22623,8 +22621,8 @@ nphy_txgains_t wlc_phy_get_tx_gain_nphy(phy_info_t *pi)

static void
wlc_phy_iqcal_gainparams_nphy(phy_info_t *pi, u16 core_no,
- nphy_txgains_t target_gain,
- nphy_iqcal_params_t *params)
+ struct nphy_txgains target_gain,
+ struct nphy_iqcal_params *params)
{
u8 k;
int idx;
@@ -23700,13 +23698,13 @@ static void wlc_phy_update_txcal_ladder_nphy(phy_info_t *pi, u16 core)
u16 bbmult;
u16 tblentry;

- nphy_txiqcal_ladder_t ladder_lo[] = {
+ struct nphy_txiqcal_ladder ladder_lo[] = {
{3, 0}, {4, 0}, {6, 0}, {9, 0}, {13, 0}, {18, 0},
{25, 0}, {25, 1}, {25, 2}, {25, 3}, {25, 4}, {25, 5},
{25, 6}, {25, 7}, {35, 7}, {50, 7}, {71, 7}, {100, 7}
};

- nphy_txiqcal_ladder_t ladder_iq[] = {
+ struct nphy_txiqcal_ladder ladder_iq[] = {
{3, 0}, {4, 0}, {6, 0}, {9, 0}, {13, 0}, {18, 0},
{25, 0}, {35, 0}, {50, 0}, {71, 0}, {100, 0}, {100, 1},
{100, 2}, {100, 3}, {100, 4}, {100, 5}, {100, 6}, {100, 7}
@@ -23737,7 +23735,7 @@ static void wlc_phy_update_txcal_ladder_nphy(phy_info_t *pi, u16 core)

void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
{
- nphy_txgains_t target_gain;
+ struct nphy_txgains target_gain;
u8 tx_pwr_ctrl_state;
bool fullcal = true;
bool restore_tx_gain = false;
@@ -23987,7 +23985,7 @@ void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
}

int
-wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain,
+wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, struct nphy_txgains target_gain,
bool fullcal, bool mphase)
{
u16 val;
@@ -24002,7 +24000,7 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, nphy_txgains_t target_gain,
u16 tone_freq;
u16 gain_save[2];
u16 cal_gain[2];
- nphy_iqcal_params_t cal_params[2];
+ struct nphy_iqcal_params cal_params[2];
u32 tbl_len;
void *tbl_ptr;
bool ladder_updated[2];
@@ -24394,7 +24392,7 @@ static void wlc_phy_reapply_txcal_coeffs_nphy(phy_info_t *pi)

static void wlc_phy_tx_iq_war_nphy(phy_info_t *pi)
{
- nphy_iq_comp_t tx_comp;
+ struct nphy_iq_comp tx_comp;

wlc_phy_table_read_nphy(pi, 15, 4, 0x50, 16, (void *)&tx_comp);

@@ -24405,7 +24403,7 @@ static void wlc_phy_tx_iq_war_nphy(phy_info_t *pi)
}

void
-wlc_phy_rx_iq_coeffs_nphy(phy_info_t *pi, u8 write, nphy_iq_comp_t *pcomp)
+wlc_phy_rx_iq_coeffs_nphy(phy_info_t *pi, u8 write, struct nphy_iq_comp *pcomp)
{
if (write) {
write_phy_reg(pi, 0x9a, pcomp->a0);
@@ -24421,7 +24419,7 @@ wlc_phy_rx_iq_coeffs_nphy(phy_info_t *pi, u8 write, nphy_iq_comp_t *pcomp)
}

void
-wlc_phy_rx_iq_est_nphy(phy_info_t *pi, phy_iq_est_t *est, u16 num_samps,
+wlc_phy_rx_iq_est_nphy(phy_info_t *pi, struct phy_iq_est *est, u16 num_samps,
u8 wait_time, u8 wait_for_crs)
{
u8 core;
@@ -24458,8 +24456,8 @@ wlc_phy_rx_iq_est_nphy(phy_info_t *pi, phy_iq_est_t *est, u16 num_samps,
static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
{
u8 curr_core;
- phy_iq_est_t est[PHY_CORE_MAX];
- nphy_iq_comp_t old_comp, new_comp;
+ struct phy_iq_est est[PHY_CORE_MAX];
+ struct nphy_iq_comp old_comp, new_comp;
s32 iq = 0;
u32 ii = 0, qq = 0;
s16 iq_nbits, qq_nbits, brsh, arsh;
@@ -25205,9 +25203,9 @@ wlc_phy_rxcal_gainctrl_nphy_rev5(phy_info_t *pi, u8 rx_core,
{

u16 num_samps;
- phy_iq_est_t est[PHY_CORE_MAX];
+ struct phy_iq_est est[PHY_CORE_MAX];
u8 tx_core;
- nphy_iq_comp_t save_comp, zero_comp;
+ struct nphy_iq_comp save_comp, zero_comp;
u32 i_pwr, q_pwr, curr_pwr, optim_pwr = 0, prev_pwr = 0, thresh_pwr =
10000;
s16 desired_log2_pwr, actual_log2_pwr, delta_pwr;
@@ -25216,7 +25214,7 @@ wlc_phy_rxcal_gainctrl_nphy_rev5(phy_info_t *pi, u8 rx_core,
s8 optim_gaintbl_index = 0, prev_gaintbl_index = 0;
s8 curr_gaintbl_index = 3;
u8 gainctrl_dirn = NPHY_RXCAL_GAIN_INIT;
- nphy_ipa_txrxgain_t *nphy_rxcal_gaintbl;
+ struct nphy_ipa_txrxgain *nphy_rxcal_gaintbl;
u16 hpvga, lpf_biq1, lpf_biq0, lna2, lna1;
int fine_gain_idx;
s8 txpwrindex;
@@ -25447,7 +25445,7 @@ wlc_phy_rc_sweep_nphy(phy_info_t *pi, u8 core_idx, u8 loopback_type)
u16 rccal_val, last_rccal_val = 0, best_rccal_val = 0;
u32 ref_iq_vals = 0, target_iq_vals = 0;
u16 num_samps, log_num_samps = 10;
- phy_iq_est_t est[PHY_CORE_MAX];
+ struct phy_iq_est est[PHY_CORE_MAX];

if (NREV_GE(pi->pubpi.phy_rev, 7)) {
return 0;
@@ -25656,7 +25654,7 @@ wlc_phy_rc_sweep_nphy(phy_info_t *pi, u8 core_idx, u8 loopback_type)

#define WAIT_FOR_SCOPE 4000
static int
-wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, nphy_txgains_t target_gain,
+wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, struct nphy_txgains target_gain,
u8 cal_type, bool debug)
{
u16 orig_BBConfig;
@@ -25664,7 +25662,7 @@ wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, nphy_txgains_t target_gain,
u8 best_rccal[2];
u16 gain_save[2];
u16 cal_gain[2];
- nphy_iqcal_params_t cal_params[2];
+ struct nphy_iqcal_params cal_params[2];
u8 rxcore_state;
s8 rxlpf_rccal_hpc, txlpf_rccal_lpc;
s8 txlpf_idac;
@@ -25813,10 +25811,10 @@ wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, nphy_txgains_t target_gain,
}

static int
-wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, nphy_txgains_t target_gain,
+wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, struct nphy_txgains target_gain,
bool debug)
{
- phy_iq_est_t est[PHY_CORE_MAX];
+ struct phy_iq_est est[PHY_CORE_MAX];
u8 core_num, rx_core, tx_core;
u16 lna_vals[] = { 0x3, 0x3, 0x1 };
u16 hpf1_vals[] = { 0x7, 0x2, 0x0 };
@@ -25832,7 +25830,7 @@ wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, nphy_txgains_t target_gain,
u16 core_no;
u16 gain_save[2];
u16 cal_gain[2];
- nphy_iqcal_params_t cal_params[2];
+ struct nphy_iqcal_params cal_params[2];
u8 phy_bw;
int bcmerror = 0;
bool first_playtone = true;
@@ -26039,7 +26037,7 @@ wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, nphy_txgains_t target_gain,
}

int
-wlc_phy_cal_rxiq_nphy(phy_info_t *pi, nphy_txgains_t target_gain,
+wlc_phy_cal_rxiq_nphy(phy_info_t *pi, struct nphy_txgains target_gain,
u8 cal_type, bool debug)
{
if (NREV_GE(pi->pubpi.phy_rev, 7)) {
@@ -26200,8 +26198,8 @@ static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi)
}

static void
-wlc_phy_papd_cal_setup_nphy(phy_info_t *pi, nphy_papd_restore_state *state,
- u8 core)
+wlc_phy_papd_cal_setup_nphy(phy_info_t *pi,
+ struct nphy_papd_restore_state *state, u8 core)
{
s32 tone_freq;
u8 off_core;
@@ -26470,7 +26468,8 @@ wlc_phy_papd_cal_setup_nphy(phy_info_t *pi, nphy_papd_restore_state *state,
}

static void
-wlc_phy_papd_cal_cleanup_nphy(phy_info_t *pi, nphy_papd_restore_state *state)
+wlc_phy_papd_cal_cleanup_nphy(phy_info_t *pi,
+ struct nphy_papd_restore_state *state)
{
u8 core;

@@ -26648,15 +26647,15 @@ wlc_phy_a1_nphy(phy_info_t *pi, u8 core, u32 winsz, u32 start,
}

static void
-wlc_phy_a2_nphy(phy_info_t *pi, nphy_ipa_txcalgains_t *txgains,
- phy_cal_mode_t cal_mode, u8 core)
+wlc_phy_a2_nphy(phy_info_t *pi, struct nphy_ipa_txcalgains *txgains,
+ enum phy_cal_mode cal_mode, u8 core)
{
u16 phy_a1, phy_a2, phy_a3;
u16 phy_a4, phy_a5;
bool phy_a6;
u8 phy_a7, m[2];
u32 phy_a8 = 0;
- nphy_txgains_t phy_a9;
+ struct nphy_txgains phy_a9;

if (NREV_LT(pi->pubpi.phy_rev, 3))
return;
@@ -26942,7 +26941,7 @@ static u8 wlc_phy_a3_nphy(phy_info_t *pi, u8 start_gain, u8 core)
int phy_a1;
int phy_a2;
bool phy_a3;
- nphy_ipa_txcalgains_t phy_a4;
+ struct nphy_ipa_txcalgains phy_a4;
bool phy_a5 = false;
bool phy_a6 = true;
s32 phy_a7, phy_a8;
@@ -27100,8 +27099,8 @@ static u8 wlc_phy_a3_nphy(phy_info_t *pi, u8 start_gain, u8 core)

static void wlc_phy_a4(phy_info_t *pi, bool full_cal)
{
- nphy_ipa_txcalgains_t phy_b1[2];
- nphy_papd_restore_state phy_b2;
+ struct nphy_ipa_txcalgains phy_b1[2];
+ struct nphy_papd_restore_state phy_b2;
bool phy_b3;
u8 phy_b4;
u8 phy_b5;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c
index 5b6538f..023d05a 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c
@@ -1505,7 +1505,7 @@ const u32 dot11lcn_gain_tbl_5G[] = {
0x00000000
};

-const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_rev0[] = {
+const struct phytbl_info dot11lcnphytbl_rx_gain_info_rev0[] = {
{&dot11lcn_gain_tbl_rev0,
sizeof(dot11lcn_gain_tbl_rev0) / sizeof(dot11lcn_gain_tbl_rev0[0]), 18,
0, 32}
@@ -1520,7 +1520,7 @@ const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_rev0[] = {
,
};

-const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_rev1[] = {
+const struct phytbl_info dot11lcnphytbl_rx_gain_info_rev1[] = {
{&dot11lcn_gain_tbl_rev1,
sizeof(dot11lcn_gain_tbl_rev1) / sizeof(dot11lcn_gain_tbl_rev1[0]), 18,
0, 32}
@@ -1535,7 +1535,7 @@ const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_rev1[] = {
,
};

-const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_2G_rev2[] = {
+const struct phytbl_info dot11lcnphytbl_rx_gain_info_2G_rev2[] = {
{&dot11lcn_gain_tbl_2G,
sizeof(dot11lcn_gain_tbl_2G) / sizeof(dot11lcn_gain_tbl_2G[0]), 18, 0,
32}
@@ -1553,7 +1553,7 @@ const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_2G_rev2[] = {
17, 0, 8}
};

-const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_5G_rev2[] = {
+const struct phytbl_info dot11lcnphytbl_rx_gain_info_5G_rev2[] = {
{&dot11lcn_gain_tbl_5G,
sizeof(dot11lcn_gain_tbl_5G) / sizeof(dot11lcn_gain_tbl_5G[0]), 18, 0,
32}
@@ -1571,7 +1571,7 @@ const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_5G_rev2[] = {
17, 0, 8}
};

-const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_extlna_2G_rev2[] = {
+const struct phytbl_info dot11lcnphytbl_rx_gain_info_extlna_2G_rev2[] = {
{&dot11lcn_gain_tbl_extlna_2G,
sizeof(dot11lcn_gain_tbl_extlna_2G) /
sizeof(dot11lcn_gain_tbl_extlna_2G[0]), 18, 0, 32}
@@ -1589,7 +1589,7 @@ const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_extlna_2G_rev2[] = {
sizeof(dot11lcn_gain_val_tbl_extlna_2G[0]), 17, 0, 8}
};

-const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_extlna_5G_rev2[] = {
+const struct phytbl_info dot11lcnphytbl_rx_gain_info_extlna_5G_rev2[] = {
{&dot11lcn_gain_tbl_5G,
sizeof(dot11lcn_gain_tbl_5G) / sizeof(dot11lcn_gain_tbl_5G[0]), 18, 0,
32}
@@ -2773,7 +2773,7 @@ const u32 dot11lcn_papd_compdelta_tbl_rev0[] = {
0x00080000,
};

-const dot11lcnphytbl_info_t dot11lcnphytbl_info_rev0[] = {
+const struct phytbl_info dot11lcnphytbl_info_rev0[] = {
{&dot11lcn_min_sig_sq_tbl_rev0,
sizeof(dot11lcn_min_sig_sq_tbl_rev0) /
sizeof(dot11lcn_min_sig_sq_tbl_rev0[0]), 2, 0, 16}
@@ -2832,25 +2832,25 @@ const dot11lcnphytbl_info_t dot11lcnphytbl_info_rev0[] = {
,
};

-const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313 = {
+const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313 = {
&dot11lcn_sw_ctrl_tbl_4313_rev0,
sizeof(dot11lcn_sw_ctrl_tbl_4313_rev0) /
sizeof(dot11lcn_sw_ctrl_tbl_4313_rev0[0]), 15, 0, 16
};

-const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_epa = {
+const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_epa = {
&dot11lcn_sw_ctrl_tbl_4313_epa_rev0,
sizeof(dot11lcn_sw_ctrl_tbl_4313_epa_rev0) /
sizeof(dot11lcn_sw_ctrl_tbl_4313_epa_rev0[0]), 15, 0, 16
};

-const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa = {
+const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa = {
&dot11lcn_sw_ctrl_tbl_4313_epa_rev0_combo,
sizeof(dot11lcn_sw_ctrl_tbl_4313_epa_rev0_combo) /
sizeof(dot11lcn_sw_ctrl_tbl_4313_epa_rev0_combo[0]), 15, 0, 16
};

-const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250 = {
+const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250 = {
&dot11lcn_sw_ctrl_tbl_4313_bt_epa_p250_rev0,
sizeof(dot11lcn_sw_ctrl_tbl_4313_bt_epa_p250_rev0) /
sizeof(dot11lcn_sw_ctrl_tbl_4313_bt_epa_p250_rev0[0]), 15, 0, 16
@@ -2859,7 +2859,8 @@ const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250 = {
const u32 dot11lcnphytbl_info_sz_rev0 =
sizeof(dot11lcnphytbl_info_rev0) / sizeof(dot11lcnphytbl_info_rev0[0]);

-const lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_extPA_gaintable_rev0[128] = {
+const struct lcnphy_tx_gain_tbl_entry
+dot11lcnphy_2GHz_extPA_gaintable_rev0[128] = {
{3, 0, 31, 0, 72,}
,
{3, 0, 31, 0, 70,}
@@ -3118,7 +3119,7 @@ const lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_extPA_gaintable_rev0[128] = {
,
};

-const lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_gaintable_rev0[128] = {
+const struct lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_gaintable_rev0[128] = {
{7, 0, 31, 0, 72,}
,
{7, 0, 31, 0, 70,}
@@ -3377,7 +3378,7 @@ const lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_gaintable_rev0[128] = {
,
};

-const lcnphy_tx_gain_tbl_entry dot11lcnphy_5GHz_gaintable_rev0[128] = {
+const struct lcnphy_tx_gain_tbl_entry dot11lcnphy_5GHz_gaintable_rev0[128] = {
{255, 255, 0xf0, 0, 152,}
,
{255, 255, 0xf0, 0, 147,}
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.h b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.h
index 96f5a68..644389f 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.h
@@ -17,26 +17,26 @@
#include <types.h>
#include "phy_int.h"

-extern const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_rev0[];
+extern const struct phytbl_info dot11lcnphytbl_rx_gain_info_rev0[];
extern const u32 dot11lcnphytbl_rx_gain_info_sz_rev0;
-extern const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313;
-extern const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_epa;
-extern const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_epa_combo;
+extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313;
+extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_epa;
+extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_epa_combo;

-extern const dot11lcnphytbl_info_t dot11lcnphytbl_info_rev0[];
+extern const struct phytbl_info dot11lcnphytbl_info_rev0[];
extern const u32 dot11lcnphytbl_info_sz_rev0;

-extern const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_2G_rev2[];
+extern const struct phytbl_info dot11lcnphytbl_rx_gain_info_2G_rev2[];
extern const u32 dot11lcnphytbl_rx_gain_info_2G_rev2_sz;

-extern const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_5G_rev2[];
+extern const struct phytbl_info dot11lcnphytbl_rx_gain_info_5G_rev2[];
extern const u32 dot11lcnphytbl_rx_gain_info_5G_rev2_sz;

-extern const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_extlna_2G_rev2[];
+extern const struct phytbl_info dot11lcnphytbl_rx_gain_info_extlna_2G_rev2[];

-extern const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_extlna_5G_rev2[];
+extern const struct phytbl_info dot11lcnphytbl_rx_gain_info_extlna_5G_rev2[];

-struct _lcnphy_tx_gain_tbl_entry {
+struct lcnphy_tx_gain_tbl_entry {
unsigned char gm;
unsigned char pga;
unsigned char pad;
@@ -44,7 +44,9 @@ struct _lcnphy_tx_gain_tbl_entry {
unsigned char bb_mult;
};

-extern const lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_gaintable_rev0[];
-extern const lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_extPA_gaintable_rev0[];
+extern const struct lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_gaintable_rev0[];

-extern const lcnphy_tx_gain_tbl_entry dot11lcnphy_5GHz_gaintable_rev0[];
+extern const struct
+lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_extPA_gaintable_rev0[];
+
+extern const struct lcnphy_tx_gain_tbl_entry dot11lcnphy_5GHz_gaintable_rev0[];
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c
index 8835367..7f741f4 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c
@@ -4436,7 +4436,7 @@ const u16 loft_lut_core1_rev0[] = {
0x0103,
};

-const mimophytbl_info_t mimophytbl_info_rev0_volatile[] = {
+const struct phytbl_info mimophytbl_info_rev0_volatile[] = {
{&bdi_tbl_rev0, sizeof(bdi_tbl_rev0) / sizeof(bdi_tbl_rev0[0]), 21, 0,
16}
,
@@ -4484,7 +4484,7 @@ const mimophytbl_info_t mimophytbl_info_rev0_volatile[] = {
,
};

-const mimophytbl_info_t mimophytbl_info_rev0[] = {
+const struct phytbl_info mimophytbl_info_rev0[] = {
{&frame_struct_rev0,
sizeof(frame_struct_rev0) / sizeof(frame_struct_rev0[0]), 10, 0, 32}
,
@@ -9361,34 +9361,34 @@ const u32 papd_cal_scalars_tbl_core1_rev3[] = {
0x002606a4,
};

-const mimophytbl_info_t mimophytbl_info_rev3_volatile[] = {
+const struct phytbl_info mimophytbl_info_rev3_volatile[] = {
{&ant_swctrl_tbl_rev3,
sizeof(ant_swctrl_tbl_rev3) / sizeof(ant_swctrl_tbl_rev3[0]), 9, 0, 16}
,
};

-const mimophytbl_info_t mimophytbl_info_rev3_volatile1[] = {
+const struct phytbl_info mimophytbl_info_rev3_volatile1[] = {
{&ant_swctrl_tbl_rev3_1,
sizeof(ant_swctrl_tbl_rev3_1) / sizeof(ant_swctrl_tbl_rev3_1[0]), 9, 0,
16}
,
};

-const mimophytbl_info_t mimophytbl_info_rev3_volatile2[] = {
+const struct phytbl_info mimophytbl_info_rev3_volatile2[] = {
{&ant_swctrl_tbl_rev3_2,
sizeof(ant_swctrl_tbl_rev3_2) / sizeof(ant_swctrl_tbl_rev3_2[0]), 9, 0,
16}
,
};

-const mimophytbl_info_t mimophytbl_info_rev3_volatile3[] = {
+const struct phytbl_info mimophytbl_info_rev3_volatile3[] = {
{&ant_swctrl_tbl_rev3_3,
sizeof(ant_swctrl_tbl_rev3_3) / sizeof(ant_swctrl_tbl_rev3_3[0]), 9, 0,
16}
,
};

-const mimophytbl_info_t mimophytbl_info_rev3[] = {
+const struct phytbl_info mimophytbl_info_rev3[] = {
{&frame_struct_rev3,
sizeof(frame_struct_rev3) / sizeof(frame_struct_rev3[0]), 10, 0, 32}
,
@@ -10467,7 +10467,7 @@ const u32 papd_cal_scalars_tbl_core1_rev7[] = {
0x004e068c,
};

-const mimophytbl_info_t mimophytbl_info_rev7[] = {
+const struct phytbl_info mimophytbl_info_rev7[] = {
{&frame_struct_rev3,
sizeof(frame_struct_rev3) / sizeof(frame_struct_rev3[0]), 10, 0, 32}
,
@@ -10581,7 +10581,7 @@ const mimophytbl_info_t mimophytbl_info_rev7[] = {
const u32 mimophytbl_info_sz_rev7 =
sizeof(mimophytbl_info_rev7) / sizeof(mimophytbl_info_rev7[0]);

-const mimophytbl_info_t mimophytbl_info_rev16[] = {
+const struct phytbl_info mimophytbl_info_rev16[] = {
{&noise_var_tbl_rev7,
sizeof(noise_var_tbl_rev7) / sizeof(noise_var_tbl_rev7[0]), 16, 0, 32}
,
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h
index 4b2a04d..c5266cf 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h
@@ -19,11 +19,11 @@
#include <types.h>
#include "phy_int.h"

-extern const mimophytbl_info_t mimophytbl_info_rev0[],
+extern const struct phytbl_info mimophytbl_info_rev0[],
mimophytbl_info_rev0_volatile[];
extern const u32 mimophytbl_info_sz_rev0, mimophytbl_info_sz_rev0_volatile;

-extern const mimophytbl_info_t mimophytbl_info_rev3[],
+extern const struct phytbl_info mimophytbl_info_rev3[],
mimophytbl_info_rev3_volatile[], mimophytbl_info_rev3_volatile1[],
mimophytbl_info_rev3_volatile2[], mimophytbl_info_rev3_volatile3[];
extern const u32 mimophytbl_info_sz_rev3, mimophytbl_info_sz_rev3_volatile,
@@ -32,9 +32,9 @@ extern const u32 mimophytbl_info_sz_rev3, mimophytbl_info_sz_rev3_volatile,

extern const u32 noise_var_tbl_rev3[];

-extern const mimophytbl_info_t mimophytbl_info_rev7[];
+extern const struct phytbl_info mimophytbl_info_rev7[];
extern const u32 mimophytbl_info_sz_rev7;
extern const u32 noise_var_tbl_rev7[];

-extern const mimophytbl_info_t mimophytbl_info_rev16[];
+extern const struct phytbl_info mimophytbl_info_rev16[];
extern const u32 mimophytbl_info_sz_rev16;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy_shim.c b/drivers/staging/brcm80211/brcmsmac/phy_shim.c
index 915efdf..e681f83 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy_shim.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy_shim.c
@@ -29,17 +29,17 @@
#include "phy_shim.h"

/* PHY SHIM module specific state */
-struct wlc_phy_shim_info {
+struct phy_shim_info {
struct brcms_c_hw_info *wlc_hw; /* pointer to main wlc_hw structure */
void *wlc; /* pointer to main wlc structure */
void *wl; /* pointer to os-specific private state */
};

-wlc_phy_shim_info_t *wlc_phy_shim_attach(struct brcms_c_hw_info *wlc_hw,
+struct phy_shim_info *wlc_phy_shim_attach(struct brcms_c_hw_info *wlc_hw,
void *wl, void *wlc) {
- wlc_phy_shim_info_t *physhim = NULL;
+ struct phy_shim_info *physhim = NULL;

- physhim = kzalloc(sizeof(wlc_phy_shim_info_t), GFP_ATOMIC);
+ 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",
@@ -53,12 +53,12 @@ wlc_phy_shim_info_t *wlc_phy_shim_attach(struct brcms_c_hw_info *wlc_hw,
return physhim;
}

-void wlc_phy_shim_detach(wlc_phy_shim_info_t *physhim)
+void wlc_phy_shim_detach(struct phy_shim_info *physhim)
{
kfree(physhim);
}

-struct wlapi_timer *wlapi_init_timer(wlc_phy_shim_info_t *physhim,
+struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
void (*fn) (void *arg), void *arg,
const char *name)
{
@@ -66,152 +66,152 @@ struct wlapi_timer *wlapi_init_timer(wlc_phy_shim_info_t *physhim,
brcms_init_timer(physhim->wl, fn, arg, name);
}

-void wlapi_free_timer(wlc_phy_shim_info_t *physhim, struct wlapi_timer *t)
+void wlapi_free_timer(struct phy_shim_info *physhim, struct wlapi_timer *t)
{
brcms_free_timer(physhim->wl, (struct brcms_timer *)t);
}

void
-wlapi_add_timer(wlc_phy_shim_info_t *physhim, struct wlapi_timer *t, uint ms,
+wlapi_add_timer(struct phy_shim_info *physhim, struct wlapi_timer *t, uint ms,
int periodic)
{
brcms_add_timer(physhim->wl, (struct brcms_timer *)t, ms, periodic);
}

-bool wlapi_del_timer(wlc_phy_shim_info_t *physhim, struct wlapi_timer *t)
+bool wlapi_del_timer(struct phy_shim_info *physhim, struct wlapi_timer *t)
{
return brcms_del_timer(physhim->wl, (struct brcms_timer *)t);
}

-void wlapi_intrson(wlc_phy_shim_info_t *physhim)
+void wlapi_intrson(struct phy_shim_info *physhim)
{
brcms_intrson(physhim->wl);
}

-u32 wlapi_intrsoff(wlc_phy_shim_info_t *physhim)
+u32 wlapi_intrsoff(struct phy_shim_info *physhim)
{
return brcms_intrsoff(physhim->wl);
}

-void wlapi_intrsrestore(wlc_phy_shim_info_t *physhim, u32 macintmask)
+void wlapi_intrsrestore(struct phy_shim_info *physhim, u32 macintmask)
{
brcms_intrsrestore(physhim->wl, macintmask);
}

-void wlapi_bmac_write_shm(wlc_phy_shim_info_t *physhim, uint offset, u16 v)
+void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset, u16 v)
{
brcms_b_write_shm(physhim->wlc_hw, offset, v);
}

-u16 wlapi_bmac_read_shm(wlc_phy_shim_info_t *physhim, uint offset)
+u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset)
{
return brcms_b_read_shm(physhim->wlc_hw, offset);
}

void
-wlapi_bmac_mhf(wlc_phy_shim_info_t *physhim, u8 idx, u16 mask,
+wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx, u16 mask,
u16 val, int bands)
{
brcms_b_mhf(physhim->wlc_hw, idx, mask, val, bands);
}

-void wlapi_bmac_corereset(wlc_phy_shim_info_t *physhim, u32 flags)
+void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags)
{
brcms_b_corereset(physhim->wlc_hw, flags);
}

-void wlapi_suspend_mac_and_wait(wlc_phy_shim_info_t *physhim)
+void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim)
{
brcms_c_suspend_mac_and_wait(physhim->wlc);
}

-void wlapi_switch_macfreq(wlc_phy_shim_info_t *physhim, u8 spurmode)
+void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode)
{
brcms_b_switch_macfreq(physhim->wlc_hw, spurmode);
}

-void wlapi_enable_mac(wlc_phy_shim_info_t *physhim)
+void wlapi_enable_mac(struct phy_shim_info *physhim)
{
brcms_c_enable_mac(physhim->wlc);
}

-void wlapi_bmac_mctrl(wlc_phy_shim_info_t *physhim, u32 mask, u32 val)
+void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask, u32 val)
{
brcms_b_mctrl(physhim->wlc_hw, mask, val);
}

-void wlapi_bmac_phy_reset(wlc_phy_shim_info_t *physhim)
+void wlapi_bmac_phy_reset(struct phy_shim_info *physhim)
{
brcms_b_phy_reset(physhim->wlc_hw);
}

-void wlapi_bmac_bw_set(wlc_phy_shim_info_t *physhim, u16 bw)
+void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw)
{
brcms_b_bw_set(physhim->wlc_hw, bw);
}

-u16 wlapi_bmac_get_txant(wlc_phy_shim_info_t *physhim)
+u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim)
{
return brcms_b_get_txant(physhim->wlc_hw);
}

-void wlapi_bmac_phyclk_fgc(wlc_phy_shim_info_t *physhim, bool clk)
+void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk)
{
brcms_b_phyclk_fgc(physhim->wlc_hw, clk);
}

-void wlapi_bmac_macphyclk_set(wlc_phy_shim_info_t *physhim, bool clk)
+void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk)
{
brcms_b_macphyclk_set(physhim->wlc_hw, clk);
}

-void wlapi_bmac_core_phypll_ctl(wlc_phy_shim_info_t *physhim, bool on)
+void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on)
{
brcms_b_core_phypll_ctl(physhim->wlc_hw, on);
}

-void wlapi_bmac_core_phypll_reset(wlc_phy_shim_info_t *physhim)
+void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim)
{
brcms_b_core_phypll_reset(physhim->wlc_hw);
}

-void wlapi_bmac_ucode_wake_override_phyreg_set(wlc_phy_shim_info_t *physhim)
+void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *physhim)
{
brcms_c_ucode_wake_override_set(physhim->wlc_hw,
WLC_WAKE_OVERRIDE_PHYREG);
}

-void wlapi_bmac_ucode_wake_override_phyreg_clear(wlc_phy_shim_info_t *physhim)
+void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *physhim)
{
brcms_c_ucode_wake_override_clear(physhim->wlc_hw,
WLC_WAKE_OVERRIDE_PHYREG);
}

void
-wlapi_bmac_write_template_ram(wlc_phy_shim_info_t *physhim, int offset,
+wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int offset,
int len, void *buf)
{
brcms_b_write_template_ram(physhim->wlc_hw, offset, len, buf);
}

-u16 wlapi_bmac_rate_shm_offset(wlc_phy_shim_info_t *physhim, u8 rate)
+u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim, u8 rate)
{
return brcms_b_rate_shm_offset(physhim->wlc_hw, rate);
}

-void wlapi_ucode_sample_init(wlc_phy_shim_info_t *physhim)
+void wlapi_ucode_sample_init(struct phy_shim_info *physhim)
{
}

void
-wlapi_copyfrom_objmem(wlc_phy_shim_info_t *physhim, uint offset, void *buf,
+wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint offset, void *buf,
int len, u32 sel)
{
brcms_b_copyfrom_objmem(physhim->wlc_hw, offset, buf, len, sel);
}

void
-wlapi_copyto_objmem(wlc_phy_shim_info_t *physhim, uint offset, const void *buf,
+wlapi_copyto_objmem(struct phy_shim_info *physhim, uint offset, const void *buf,
int l, u32 sel)
{
brcms_b_copyto_objmem(physhim->wlc_hw, offset, buf, l, sel);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy_shim.h b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
index 61b3720..a4550ed 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy_shim.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
@@ -108,57 +108,57 @@
#define WLC_N_TXRX_CHAIN0 0
#define WLC_N_TXRX_CHAIN1 1

-extern wlc_phy_shim_info_t *wlc_phy_shim_attach(struct brcms_c_hw_info *wlc_hw,
+extern struct phy_shim_info *wlc_phy_shim_attach(struct brcms_c_hw_info *wlc_hw,
void *wl, void *wlc);
-extern void wlc_phy_shim_detach(wlc_phy_shim_info_t *physhim);
+extern void wlc_phy_shim_detach(struct phy_shim_info *physhim);

/* PHY to WL utility functions */
-extern struct wlapi_timer *wlapi_init_timer(wlc_phy_shim_info_t *physhim,
+extern struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
void (*fn) (void *arg), void *arg,
const char *name);
-extern void wlapi_free_timer(wlc_phy_shim_info_t *physhim,
+extern void wlapi_free_timer(struct phy_shim_info *physhim,
struct wlapi_timer *t);
-extern void wlapi_add_timer(wlc_phy_shim_info_t *physhim,
+extern void wlapi_add_timer(struct phy_shim_info *physhim,
struct wlapi_timer *t, uint ms, int periodic);
-extern bool wlapi_del_timer(wlc_phy_shim_info_t *physhim,
+extern bool wlapi_del_timer(struct phy_shim_info *physhim,
struct wlapi_timer *t);
-extern void wlapi_intrson(wlc_phy_shim_info_t *physhim);
-extern u32 wlapi_intrsoff(wlc_phy_shim_info_t *physhim);
-extern void wlapi_intrsrestore(wlc_phy_shim_info_t *physhim,
+extern void wlapi_intrson(struct phy_shim_info *physhim);
+extern u32 wlapi_intrsoff(struct phy_shim_info *physhim);
+extern void wlapi_intrsrestore(struct phy_shim_info *physhim,
u32 macintmask);

-extern void wlapi_bmac_write_shm(wlc_phy_shim_info_t *physhim, uint offset,
+extern void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset,
u16 v);
-extern u16 wlapi_bmac_read_shm(wlc_phy_shim_info_t *physhim, uint offset);
-extern void wlapi_bmac_mhf(wlc_phy_shim_info_t *physhim, u8 idx,
+extern u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset);
+extern void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx,
u16 mask, u16 val, int bands);
-extern void wlapi_bmac_corereset(wlc_phy_shim_info_t *physhim, u32 flags);
-extern void wlapi_suspend_mac_and_wait(wlc_phy_shim_info_t *physhim);
-extern void wlapi_switch_macfreq(wlc_phy_shim_info_t *physhim, u8 spurmode);
-extern void wlapi_enable_mac(wlc_phy_shim_info_t *physhim);
-extern void wlapi_bmac_mctrl(wlc_phy_shim_info_t *physhim, u32 mask,
+extern void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags);
+extern void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim);
+extern void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode);
+extern void wlapi_enable_mac(struct phy_shim_info *physhim);
+extern void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask,
u32 val);
-extern void wlapi_bmac_phy_reset(wlc_phy_shim_info_t *physhim);
-extern void wlapi_bmac_bw_set(wlc_phy_shim_info_t *physhim, u16 bw);
-extern void wlapi_bmac_phyclk_fgc(wlc_phy_shim_info_t *physhim, bool clk);
-extern void wlapi_bmac_macphyclk_set(wlc_phy_shim_info_t *physhim, bool clk);
-extern void wlapi_bmac_core_phypll_ctl(wlc_phy_shim_info_t *physhim, bool on);
-extern void wlapi_bmac_core_phypll_reset(wlc_phy_shim_info_t *physhim);
-extern void wlapi_bmac_ucode_wake_override_phyreg_set(wlc_phy_shim_info_t *
+extern void wlapi_bmac_phy_reset(struct phy_shim_info *physhim);
+extern void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw);
+extern void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk);
+extern void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk);
+extern void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on);
+extern void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim);
+extern void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *
physhim);
-extern void wlapi_bmac_ucode_wake_override_phyreg_clear(wlc_phy_shim_info_t *
+extern void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *
physhim);
-extern void wlapi_bmac_write_template_ram(wlc_phy_shim_info_t *physhim, int o,
+extern void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o,
int len, void *buf);
-extern u16 wlapi_bmac_rate_shm_offset(wlc_phy_shim_info_t *physhim,
+extern u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim,
u8 rate);
-extern void wlapi_ucode_sample_init(wlc_phy_shim_info_t *physhim);
-extern void wlapi_copyfrom_objmem(wlc_phy_shim_info_t *physhim, uint,
+extern void wlapi_ucode_sample_init(struct phy_shim_info *physhim);
+extern void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint,
void *buf, int, u32 sel);
-extern void wlapi_copyto_objmem(wlc_phy_shim_info_t *physhim, uint,
+extern void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint,
const void *buf, int, u32);

-extern void wlapi_high_update_phy_mode(wlc_phy_shim_info_t *physhim,
+extern void wlapi_high_update_phy_mode(struct phy_shim_info *physhim,
u32 phy_mode);
-extern u16 wlapi_bmac_get_txant(wlc_phy_shim_info_t *physhim);
+extern u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
#endif /* _BRCM_PHY_SHIM_H_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/pub.h b/drivers/staging/brcm80211/brcmsmac/pub.h
index 58ae61d..c1f2fdc 100644
--- a/drivers/staging/brcm80211/brcmsmac/pub.h
+++ b/drivers/staging/brcm80211/brcmsmac/pub.h
@@ -106,7 +106,7 @@
#define WL_SPURAVOID_ON1 1
#define WL_SPURAVOID_ON2 2

-struct wlc_tunables {
+struct brcms_tunables {
int ntxd; /* size of tx descriptor table */
int nrxd; /* size of rx descriptor table */
int rxbufsz; /* size of rx buffers to post */
@@ -124,7 +124,7 @@ struct wlc_tunables {
int memreserved; /* memory reserved for BMAC's USB dma rx */
};

-struct wlc_rateset {
+struct brcms_rateset {
uint count; /* number of rates in rates[] */
u8 rates[WLC_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
u8 htphy_membership; /* HT PHY Membership */
@@ -160,7 +160,7 @@ struct rsn_parms {
IEEE80211_HT_CAP_MAX_AMSDU | IEEE80211_HT_CAP_DSSSCCK40)

/* wlc internal bss_info */
-struct wlc_bss_info {
+struct brcms_bss_info {
u8 BSSID[ETH_ALEN]; /* network BSSID */
u16 flags; /* flags for internal attributes */
u8 SSID_len; /* the length of SSID */
@@ -242,12 +242,12 @@ typedef int (*iovar_fn_t) (void *handle, const struct brcmu_iovar *vi,
* Public portion of "common" os-independent state structure.
* The wlc handle points at this.
*/
-struct wlc_pub {
+struct brcms_pub {
void *wlc;

struct ieee80211_hw *ieee_hw;
struct scb *global_scb;
- scb_ampdu_t *global_ampdu;
+ struct scb_ampdu *global_ampdu;
uint mac80211_state;
uint unit; /* device instance number */
uint corerev; /* core revision */
@@ -255,7 +255,8 @@ struct wlc_pub {
char *vars; /* "environment" name=value */
bool up; /* interface up and running */
bool hw_off; /* HW is off */
- wlc_tunables_t *tunables; /* tunables: ntxd, nrxd, maxscb, etc. */
+ /* tunables: ntxd, nrxd, maxscb, etc. */
+ struct brcms_tunables *tunables;
bool hw_up; /* one time hw up/down(from boot or hibernation) */
bool _piomode; /* true if pio mode *//* BMAC_NOTE: NEED In both */
uint _nbands; /* # bands supported */
@@ -570,7 +571,7 @@ extern const u8 wme_fifo2ac[];

#define HIGHEST_SINGLE_STREAM_MCS 7 /* MCS values greater than this enable multiple streams */

-struct wlc_antselcfg {
+struct brcms_antselcfg {
u8 ant_config[ANT_SELCFG_MAX]; /* antenna configuration */
u8 num_antcfg; /* number of available antenna configurations */
};
@@ -615,7 +616,7 @@ extern void brcms_c_set_addrmatch(struct brcms_c_info *wlc,
extern void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
const struct ieee80211_tx_queue_params *arg,
bool suspend);
-extern struct wlc_pub *brcms_c_pub(void *wlc);
+extern struct brcms_pub *brcms_c_pub(void *wlc);

/* common functions for every port */
extern void brcms_c_mhf(struct brcms_c_info *wlc, u8 idx, u16 mask, u16 val,
@@ -639,10 +640,10 @@ extern int getintvar(char *vars, const char *name);
extern void brcms_c_set_ps_ctrl(struct brcms_c_info *wlc);
extern void brcms_c_mctrl(struct brcms_c_info *wlc, u32 mask, u32 val);

-extern int brcms_c_module_register(struct wlc_pub *pub,
+extern int brcms_c_module_register(struct brcms_pub *pub,
const char *name, void *hdl,
watchdog_fn_t watchdog_fn, down_fn_t down_fn);
-extern int brcms_c_module_unregister(struct wlc_pub *pub, const char *name,
+extern int brcms_c_module_unregister(struct brcms_pub *pub, const char *name,
void *hdl);
extern void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc);
extern void brcms_c_enable_mac(struct brcms_c_info *wlc);
diff --git a/drivers/staging/brcm80211/brcmsmac/rate.c b/drivers/staging/brcm80211/brcmsmac/rate.c
index dec508d..487523e 100644
--- a/drivers/staging/brcm80211/brcmsmac/rate.c
+++ b/drivers/staging/brcm80211/brcmsmac/rate.c
@@ -38,7 +38,7 @@ const u8 rate_info[WLC_MAXRATE + 1] = {
};

/* rates are in units of Kbps */
-const mcs_info_t mcs_table[MCS_TABLE_SIZE] = {
+const struct brcms_mcs_info mcs_table[MCS_TABLE_SIZE] = {
/* MCS 0: SS 1, MOD: BPSK, CR 1/2 */
{6500, 13500, CEIL(6500 * 10, 9), CEIL(13500 * 10, 9), 0x00,
WLC_RATE_6M},
@@ -143,17 +143,18 @@ const mcs_info_t mcs_table[MCS_TABLE_SIZE] = {
* Number of spatial streams: always 1
* other fields: refer to table 78 of section 17.3.2.2 of the original .11a standard
*/
-typedef struct legacy_phycfg {
+struct legacy_phycfg {
u32 rate_ofdm; /* ofdm mac rate */
u8 tx_phy_ctl3; /* phy ctl byte 3, code rate, modulation type, # of streams */
-} legacy_phycfg_t;
+};

#define LEGACY_PHYCFG_TABLE_SIZE 12 /* Number of legacy_rate_cfg entries in the table */

/* In CCK mode LPPHY overloads OFDM Modulation bits with CCK Data Rate */
/* Eventually MIMOPHY would also be converted to this format */
/* 0 = 1Mbps; 1 = 2Mbps; 2 = 5.5Mbps; 3 = 11Mbps */
-static const legacy_phycfg_t legacy_phycfg_table[LEGACY_PHYCFG_TABLE_SIZE] = {
+static const struct
+legacy_phycfg legacy_phycfg_table[LEGACY_PHYCFG_TABLE_SIZE] = {
{WLC_RATE_1M, 0x00}, /* CCK 1Mbps, data rate 0 */
{WLC_RATE_2M, 0x08}, /* CCK 2Mbps, data rate 1 */
{WLC_RATE_5M5, 0x10}, /* CCK 5.5Mbps, data rate 2 */
@@ -320,7 +321,7 @@ brcms_c_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
}

/* calculate the rate of a rx'd frame and return it as a ratespec */
-ratespec_t brcms_c_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
+ratespec_t brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp)
{
int phy_type;
ratespec_t rspec = PHY_TXC1_BW_20MHZ << RSPEC_BW_SHIFT;
@@ -333,12 +334,13 @@ ratespec_t brcms_c_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
switch (rxh->PhyRxStatus_0 & PRXS0_FT_MASK) {
case PRXS0_CCK:
rspec =
- CCK_PHY2MAC_RATE(((cck_phy_hdr_t *) plcp)->signal);
+ CCK_PHY2MAC_RATE(
+ ((struct cck_phy_hdr *) plcp)->signal);
break;
case PRXS0_OFDM:
rspec =
- OFDM_PHY2MAC_RATE(((ofdm_phy_hdr_t *) plcp)->
- rlpt[0]);
+ OFDM_PHY2MAC_RATE(
+ ((struct ofdm_phy_hdr *) plcp)->rlpt[0]);
break;
case PRXS0_PREN:
rspec = (plcp[0] & MIMO_PLCP_MCS_MASK) | RSPEC_MIMORATE;
@@ -358,9 +360,11 @@ ratespec_t brcms_c_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
rspec |= RSPEC_SHORT_GI;
} else
if ((phy_type == PHY_TYPE_A) || (rxh->PhyRxStatus_0 & PRXS0_OFDM))
- rspec = OFDM_PHY2MAC_RATE(((ofdm_phy_hdr_t *) plcp)->rlpt[0]);
+ rspec = OFDM_PHY2MAC_RATE(
+ ((struct ofdm_phy_hdr *) plcp)->rlpt[0]);
else
- rspec = CCK_PHY2MAC_RATE(((cck_phy_hdr_t *) plcp)->signal);
+ rspec = CCK_PHY2MAC_RATE(
+ ((struct cck_phy_hdr *) plcp)->signal);

return rspec;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/rate.h b/drivers/staging/brcm80211/brcmsmac/rate.h
index 268125f..c3dec35 100644
--- a/drivers/staging/brcm80211/brcmsmac/rate.h
+++ b/drivers/staging/brcm80211/brcmsmac/rate.h
@@ -20,16 +20,16 @@
#include "types.h"

extern const u8 rate_info[];
-extern const struct wlc_rateset cck_ofdm_mimo_rates;
-extern const struct wlc_rateset ofdm_mimo_rates;
-extern const struct wlc_rateset cck_ofdm_rates;
-extern const struct wlc_rateset ofdm_rates;
-extern const struct wlc_rateset cck_rates;
-extern const struct wlc_rateset gphy_legacy_rates;
-extern const struct wlc_rateset wlc_lrs_rates;
-extern const struct wlc_rateset rate_limit_1_2;
-
-struct mcs_info {
+extern const struct brcms_rateset cck_ofdm_mimo_rates;
+extern const struct brcms_rateset ofdm_mimo_rates;
+extern const struct brcms_rateset cck_ofdm_rates;
+extern const struct brcms_rateset ofdm_rates;
+extern const struct brcms_rateset cck_rates;
+extern const struct brcms_rateset gphy_legacy_rates;
+extern const struct brcms_rateset wlc_lrs_rates;
+extern const struct brcms_rateset rate_limit_1_2;
+
+struct brcms_mcs_info {
u32 phy_rate_20; /* phy rate in kbps [20Mhz] */
u32 phy_rate_40; /* phy rate in kbps [40Mhz] */
u32 phy_rate_20_sgi; /* phy rate in kbps [20Mhz] with SGI */
@@ -40,7 +40,7 @@ struct mcs_info {

#define WLC_MAXMCS 32 /* max valid mcs index */
#define MCS_TABLE_SIZE 33 /* Number of mcs entries in the table */
-extern const mcs_info_t mcs_table[];
+extern const struct brcms_mcs_info mcs_table[];

#define MCS_INVALID 0xFF
#define MCS_CR_MASK 0x07 /* Code Rate bit mask */
@@ -139,31 +139,33 @@ extern const u8 ofdm_rate_lookup[];
#define WLC_RATES_OFDM 2

/* sanitize, and sort a rateset with the basic bit(s) preserved, validate rateset */
-extern bool brcms_c_rate_hwrs_filter_sort_validate(struct wlc_rateset *rs,
- const struct wlc_rateset *hw_rs,
- bool check_brate,
- u8 txstreams);
+extern bool
+brcms_c_rate_hwrs_filter_sort_validate(struct brcms_rateset *rs,
+ const struct brcms_rateset *hw_rs,
+ bool check_brate, u8 txstreams);
/* copy rateset src to dst as-is (no masking or sorting) */
-extern void brcms_c_rateset_copy(const struct wlc_rateset *src,
- struct wlc_rateset *dst);
+extern void brcms_c_rateset_copy(const struct brcms_rateset *src,
+ struct brcms_rateset *dst);

/* would be nice to have these documented ... */
-extern ratespec_t brcms_c_compute_rspec(d11rxhdr_t *rxh, u8 *plcp);
+extern ratespec_t brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp);

-extern void brcms_c_rateset_filter(struct wlc_rateset *src,
- struct wlc_rateset *dst, bool basic_only, u8 rates, uint xmask,
+extern void brcms_c_rateset_filter(struct brcms_rateset *src,
+ struct brcms_rateset *dst, bool basic_only, u8 rates, uint xmask,
bool mcsallow);

-extern void brcms_c_rateset_default(struct wlc_rateset *rs_tgt,
- const struct wlc_rateset *rs_hw, uint phy_type,
- int bandtype, bool cck_only, uint rate_mask,
- bool mcsallow, u8 bw, u8 txstreams);
+extern void
+brcms_c_rateset_default(struct brcms_rateset *rs_tgt,
+ const struct brcms_rateset *rs_hw, uint phy_type,
+ int bandtype, bool cck_only, uint rate_mask,
+ bool mcsallow, u8 bw, u8 txstreams);
+
extern s16 brcms_c_rate_legacy_phyctl(uint rate);

-extern void brcms_c_rateset_mcs_upd(struct wlc_rateset *rs, u8 txstreams);
-extern void brcms_c_rateset_mcs_clear(struct wlc_rateset *rateset);
-extern void brcms_c_rateset_mcs_build(struct wlc_rateset *rateset,
+extern void brcms_c_rateset_mcs_upd(struct brcms_rateset *rs, u8 txstreams);
+extern void brcms_c_rateset_mcs_clear(struct brcms_rateset *rateset);
+extern void brcms_c_rateset_mcs_build(struct brcms_rateset *rateset,
u8 txstreams);
-extern void brcms_c_rateset_bw_mcs_filter(struct wlc_rateset *rateset, u8 bw);
+extern void brcms_c_rateset_bw_mcs_filter(struct brcms_rateset *rateset, u8 bw);

#endif /* _WLC_RATE_H_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/scb.h b/drivers/staging/brcm80211/brcmsmac/scb.h
index e814e5e..d6c8328 100644
--- a/drivers/staging/brcm80211/brcmsmac/scb.h
+++ b/drivers/staging/brcm80211/brcmsmac/scb.h
@@ -47,7 +47,8 @@ struct scb_ampdu {
* of having mac80211 hold it for us. Also could be made dynamic per tid instead of
* static.
*/
- scb_ampdu_tid_ini_t ini[AMPDU_MAX_SCB_TID]; /* initiator info - per tid (NUMPRIO) */
+ /* initiator info - per tid (NUMPRIO): */
+ struct scb_ampdu_tid_ini ini[AMPDU_MAX_SCB_TID];
};

#define SCB_MAGIC 0xbeefcafe
@@ -68,7 +69,7 @@ struct scb {
*/
u16 seqnum[NUMPRIO]; /* WME: driver maintained sw seqnum per priority */

- scb_ampdu_t scb_ampdu; /* AMPDU state including per tid info */
+ struct scb_ampdu scb_ampdu; /* AMPDU state including per tid info */
};

/* scb flags */
diff --git a/drivers/staging/brcm80211/brcmsmac/srom.c b/drivers/staging/brcm80211/brcmsmac/srom.c
index de3e703..f39442e 100644
--- a/drivers/staging/brcm80211/brcmsmac/srom.c
+++ b/drivers/staging/brcm80211/brcmsmac/srom.c
@@ -361,19 +361,19 @@
/* Max. nvram variable table size */
#define MAXSZ_NVRAM_VARS 4096

-typedef struct {
+struct brcms_sromvar {
const char *name;
u32 revmask;
u32 flags;
u16 off;
u16 mask;
-} sromvar_t;
+};

-typedef struct varbuf {
+struct brcms_varbuf {
char *base; /* pointer to buffer base */
char *buf; /* pointer to current position */
unsigned int size; /* current (residual) size in bytes */
-} varbuf_t;
+};

/* Assumptions:
* - Ethernet address spans across 3 consective words
@@ -387,7 +387,7 @@ typedef struct varbuf {
* - The last entry's name field must be NULL to indicate the end of the table. Other
* entries must have non-NULL name.
*/
-static const sromvar_t pci_sromvars[] = {
+static const struct brcms_sromvar pci_sromvars[] = {
{"devid", 0xffffff00, SRFL_PRHEX | SRFL_NOVAR, PCI_F0DEVID, 0xffff},
{"boardrev", 0x0000000e, SRFL_PRHEX, SROM_AABREV, SROM_BR_MASK},
{"boardrev", 0x000000f0, SRFL_PRHEX, SROM4_BREV, 0xffff},
@@ -731,7 +731,7 @@ static const sromvar_t pci_sromvars[] = {
{NULL, 0, 0, 0, 0}
};

-static const sromvar_t perpath_pci_sromvars[] = {
+static const struct brcms_sromvar perpath_pci_sromvars[] = {
{"maxp2ga", 0x000000f0, 0, SROM4_2G_ITT_MAXP, 0x00ff},
{"itt2ga", 0x000000f0, 0, SROM4_2G_ITT_MAXP, 0xff00},
{"itt5ga", 0x000000f0, 0, SROM4_5G_ITT_MAXP, 0xff00},
@@ -775,7 +775,8 @@ static const sromvar_t perpath_pci_sromvars[] = {
{NULL, 0, 0, 0, 0}
};

-static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b);
+static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off,
+ struct brcms_varbuf *b);
static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
uint *count);
static int sprom_read_pci(struct si_pub *sih, u16 *sprom,
@@ -788,14 +789,14 @@ static int initvars_table(char *start, char *end,
char **vars, uint *count);

/* Initialization of varbuf structure */
-static void varbuf_init(varbuf_t *b, char *buf, uint size)
+static void varbuf_init(struct brcms_varbuf *b, char *buf, uint size)
{
b->size = size;
b->base = b->buf = buf;
}

/* append a null terminated var=value string */
-static int varbuf_append(varbuf_t *b, const char *fmt, ...)
+static int varbuf_append(struct brcms_varbuf *b, const char *fmt, ...)
{
va_list ap;
int r;
@@ -1011,11 +1012,12 @@ static uint mask_width(u16 mask)
return 0;
}

-static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b)
+static void
+_initvars_srom_pci(u8 sromrev, u16 *srom, uint off, struct brcms_varbuf *b)
{
u16 w;
u32 val;
- const sromvar_t *srv;
+ const struct brcms_sromvar *srv;
uint width;
uint flags;
u32 sr = (1 << sromrev);
@@ -1153,7 +1155,7 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
u16 *srom, *sromwindow;
u8 sromrev = 0;
u32 sr;
- varbuf_t b;
+ struct brcms_varbuf b;
char *vp, *base = NULL;
int err = 0;

diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index b1370be..9ab7fe2 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -206,7 +206,7 @@
* Defaults for tunables (e.g. sizing constants)
*
* For each new tunable, add a member to the end
- * of wlc_tunables_t in brcms_c_pub.h to enable
+ * of struct brcms_tunables in brcms_c_pub.h to enable
* runtime checks of tunable values. (Directly
* using the macros in code invalidates ROM code)
*
@@ -353,105 +353,42 @@ typedef u32 mbool;
#define mboolmaskset(mb, mask, val) ((mb) = (((mb) & ~(mask)) | (val)))

/* forward declarations */
-struct sk_buff;
+struct wiphy;
+struct ieee80211_sta;
+struct ieee80211_tx_queue_params;
struct brcms_info;
struct brcms_c_info;
struct brcms_c_hw_info;
struct brcms_c_if;
-struct brcms_if;
-struct ampdu_info;
-struct antsel_info;
-struct bmac_pmq;
-struct d11init;
-struct dma_pub;
-struct brcms_c_bsscfg;
-struct brcmu_strbuf;
-struct si_pub;
-struct wiphy;
struct brcmu_iovar;
+struct brcmu_strbuf;
struct brcms_c_txq_info;
struct brcms_c_band;
-struct ieee80211_tx_queue_params;
-struct ieee80211_sta;
+struct dma_pub;
+struct si_pub;
+struct tx_status;
+struct d11rxhdr;
+struct brcms_d11rxhdr;
+struct txpwr_limits;

-typedef struct gpioh_item gpioh_item_t;
-typedef struct si_info si_info_t;
-typedef struct brcms_b_state brcms_b_state_t;
-typedef struct locale_info locale_info_t;
-typedef struct locale_mimo_info locale_mimo_info_t;
-typedef struct country_info country_info_t;
-typedef struct wlc_cm_info wlc_cm_info_t;
typedef volatile struct intctrlregs intctrlregs_t;
typedef volatile struct pio2regs pio2regs_t;
typedef volatile struct pio2regp pio2regp_t;
-typedef struct ofdm_phy_hdr ofdm_phy_hdr_t;
-typedef struct cck_phy_hdr cck_phy_hdr_t;
-typedef struct d11txh d11txh_t;
-typedef struct tx_status tx_status_t;
-typedef struct shm_acparams shm_acparams_t;
-typedef struct d11rxhdr d11rxhdr_t;
-typedef struct wlc_d11rxhdr wlc_d11rxhdr_t;
typedef volatile struct pio4regs pio4regs_t;
typedef volatile struct pio4regp pio4regp_t;
typedef volatile struct fifo64 fifo64_t;
typedef volatile struct d11regs d11regs_t;
-typedef struct macstat macstat_t;
-typedef struct d11cnt d11cnt_t;
typedef volatile struct dma32diag dma32diag_t;
typedef volatile struct dma64regs dma64regs_t;
-typedef enum txd_range txd_range_t;
-typedef struct di_fcn_s di_fcn_t;
-typedef struct wsec_iv wsec_iv_t;
-typedef struct wsec_key wsec_key_t;
-typedef struct edcf_acparam edcf_acparam_t;
-typedef struct wme_param_ie wme_param_ie_t;
-typedef struct wlc_phy_shim_info wlc_phy_shim_info_t;
-typedef struct wlc_tunables wlc_tunables_t;
-typedef struct wlc_rateset wlc_rateset_t;
-typedef struct wlc_bss_info wlc_bss_info_t;
-typedef struct wl_rxsts wl_rxsts_t;
-typedef struct wlc_antselcfg wlc_antselcfg_t;
-typedef struct mcs_info mcs_info_t;
+typedef struct brcms_rateset wlc_rateset_t;
typedef u32 ratespec_t;
-typedef struct scb_ampdu_tid_ini scb_ampdu_tid_ini_t;
-typedef struct scb_ampdu scb_ampdu_t;
-typedef struct txpwr_limits txpwr_limits_t;
typedef struct tx_power tx_power_t;
-typedef struct tx_inst_power tx_inst_power_t;
typedef struct chanvec chanvec_t;
-typedef struct shared_phy shared_phy_t;
-typedef struct shared_phy_params shared_phy_params_t;
typedef struct phy_pub wlc_phy_t;
-typedef struct wlc_phy_srom_fem wlc_phy_srom_fem_t;
typedef struct phy_info phy_info_t;
-typedef enum phy_cal_mode phy_cal_mode_t;
-typedef struct phy_table_info phy_table_info_t;
-typedef struct phytbl_info phytbl_info_t;
-typedef struct interference_info interference_info_t;
-typedef struct aci_save_gphy aci_save_gphy_t;
-typedef struct lo_complex_abgphy_info lo_complex_abgphy_info_t;
-typedef struct nphy_iq_comp nphy_iq_comp_t;
-typedef struct nphy_txpwrindex phy_txpwrindex_t;
-typedef struct txiqcal_cache txiqcal_cache_t;
-typedef struct nphy_pwrctrl phy_pwrctrl_t;
-typedef struct nphy_txgains nphy_txgains_t;
-typedef struct nphy_noisevar_buf phy_noisevar_buf_t;
-typedef struct rssical_cache rssical_cache_t;
-typedef struct lcnphy_cal_results lcnphy_cal_results_t;
-typedef struct phy_info_nphy phy_info_nphy_t;
-typedef struct phy_info_lcnphy phy_info_lcnphy_t;
-typedef struct phy_func_ptr phy_func_ptr_t;
typedef s32 fixed;
typedef struct _cs32 cs32;
-typedef struct radio_regs radio_regs_t;
-typedef struct radio_20xx_regs radio_20xx_regs_t;
-typedef struct lcnphy_radio_regs lcnphy_radio_regs_t;
-typedef struct phy_iq_est phy_iq_est_t;
-typedef phytbl_info_t dot11lcnphytbl_info_t;
-typedef struct _lcnphy_tx_gain_tbl_entry lcnphy_tx_gain_tbl_entry;
-typedef phytbl_info_t mimophytbl_info_t;
typedef volatile union pmqreg pmqreg_t;
-typedef enum _ePsmScratchPadRegDefinitions ePsmScratchPadRegDefinitions;

/* brcm_msg_level is a bit vector with defs in defs.h */
extern u32 brcm_msg_level;
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 08/31] staging: brcm80211: removed asserts from dhd_linux.c

From: Roland Vossen <[email protected]>

Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 33 +-----------------------
1 files changed, 1 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index afb1e32..0ea8084 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -235,7 +235,6 @@ static int brcmf_net2idx(struct brcmf_info *drvr_priv, struct net_device *net)
{
int i = 0;

- ASSERT(drvr_priv);
while (i < BRCMF_MAX_IFS) {
if (drvr_priv->iflist[i] && (drvr_priv->iflist[i]->net == net))
return i;
@@ -249,8 +248,6 @@ int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name)
{
int i = BRCMF_MAX_IFS;

- ASSERT(drvr_priv);
-
if (name == NULL || *name == '\0')
return 0;

@@ -268,8 +265,6 @@ char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx)
{
struct brcmf_info *drvr_priv = drvr->info;

- ASSERT(drvr_priv);
-
if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) {
BRCMF_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
return "<if_bad>";
@@ -297,7 +292,6 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
uint buflen;
int ret;

- ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
dev = drvr_priv->iflist[ifidx]->net;
cnt = netdev_mc_count(dev);

@@ -437,13 +431,12 @@ static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *a
extern struct net_device *ap_net_dev;
#endif

+/* Virtual interfaces only ((ifp && ifp->info && ifp->idx == true) */
static void brcmf_op_if(struct brcmf_if *ifp)
{
struct brcmf_info *drvr_priv;
int ret = 0, err = 0;

- ASSERT(ifp && ifp->info && ifp->idx); /* Virtual interfaces only */
-
drvr_priv = ifp->info;

BRCMF_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));
@@ -509,7 +502,6 @@ static void brcmf_op_if(struct brcmf_if *ifp)
break;
default:
BRCMF_ERROR(("%s: bad op %d\n", __func__, ifp->state));
- ASSERT(!ifp->state);
break;
}

@@ -601,7 +593,6 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
if (ifidx == BRCMF_BAD_IF)
return -1;

- ASSERT(drvr_priv->sysioc_tsk);
memcpy(&drvr_priv->macvalue, sa->sa_data, ETH_ALEN);
drvr_priv->set_macaddress = true;
up(&drvr_priv->sysioc_sem);
@@ -618,7 +609,6 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
if (ifidx == BRCMF_BAD_IF)
return;

- ASSERT(drvr_priv->sysioc_tsk);
drvr_priv->set_multicast = true;
up(&drvr_priv->sysioc_sem);
}
@@ -711,7 +701,6 @@ void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool state)
BRCMF_TRACE(("%s: Enter\n", __func__));

drvr->txoff = state;
- ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
net = drvr_priv->iflist[ifidx]->net;
if (state == ON)
netif_stop_queue(net);
@@ -759,7 +748,6 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
if (ifp == NULL)
ifp = drvr_priv->iflist[0];

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

@@ -778,7 +766,6 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
skb_mac_header(skb),
&event, &data);

- ASSERT(ifidx < BRCMF_MAX_IFS && drvr_priv->iflist[ifidx]);
if (drvr_priv->iflist[ifidx] &&
!drvr_priv->iflist[ifidx]->state)
ifp = drvr_priv->iflist[ifidx];
@@ -833,7 +820,6 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
return NULL;

ifp = drvr_priv->iflist[ifidx];
- ASSERT(drvr_priv && ifp);

if (drvr_priv->pub.up) {
/* Use the protocol to get dongle stats */
@@ -1247,8 +1233,6 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,

BRCMF_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));

- ASSERT(drvr_priv && (ifidx < BRCMF_MAX_IFS));
-
ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
@@ -1268,7 +1252,6 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
if (handle == NULL) {
ifp->state = BRCMF_E_IF_ADD;
ifp->idx = ifidx;
- ASSERT(drvr_priv->sysioc_tsk);
up(&drvr_priv->sysioc_sem);
} else
ifp->net = (struct net_device *)handle;
@@ -1282,7 +1265,6 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)

BRCMF_TRACE(("%s: idx %d\n", __func__, ifidx));

- ASSERT(drvr_priv && ifidx && (ifidx < BRCMF_MAX_IFS));
ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
BRCMF_ERROR(("%s: Null interface\n", __func__));
@@ -1291,7 +1273,6 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)

ifp->state = BRCMF_E_IF_DEL;
ifp->idx = ifidx;
- ASSERT(drvr_priv->sysioc_tsk);
up(&drvr_priv->sysioc_sem);
}

@@ -1399,8 +1380,6 @@ int brcmf_bus_start(struct brcmf_pub *drvr)
/* Room for "event_msgs" + '\0' + bitvec */
char iovbuf[BRCMF_EVENTING_MASK_LEN + 12];

- ASSERT(drvr_priv);
-
BRCMF_TRACE(("%s:\n", __func__));

/* Bring up the bus */
@@ -1475,12 +1454,7 @@ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)

BRCMF_TRACE(("%s: ifidx %d\n", __func__, ifidx));

- ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
-
net = drvr_priv->iflist[ifidx]->net;
- ASSERT(net);
-
- ASSERT(!net->netdev_ops);
net->netdev_ops = &brcmf_netdev_ops_pri;

/*
@@ -1557,7 +1531,6 @@ void brcmf_detach(struct brcmf_pub *drvr)
brcmf_del_if(drvr_priv, i);

ifp = drvr_priv->iflist[0];
- ASSERT(ifp);
if (ifp->net->netdev_ops == &brcmf_netdev_ops_pri) {
brcmf_netdev_stop(ifp->net);
unregister_netdev(ifp->net);
@@ -1685,14 +1658,10 @@ static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktd
{
int bcmerror = 0;

- ASSERT(drvr_priv != NULL);
-
bcmerror = brcmf_c_host_event(drvr_priv, ifidx, pktdata, event, data);
if (bcmerror != 0)
return bcmerror;

- ASSERT(drvr_priv->iflist[*ifidx] != NULL);
- ASSERT(drvr_priv->iflist[*ifidx]->net != NULL);
if (drvr_priv->iflist[*ifidx]->net)
brcmf_cfg80211_event(drvr_priv->iflist[*ifidx]->net,
event, *data);
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 12/31] staging: brcm80211: replaced typedef phy_info_t by struct brcms_phy

From: Roland Vossen <[email protected]>

Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 249 +++++++------
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h | 248 +++++++------
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 342 +++++++++---------
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h | 2 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 431 +++++++++++-----------
drivers/staging/brcm80211/brcmsmac/types.h | 2 +-
6 files changed, 648 insertions(+), 626 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 57195a5..7c8bf17 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -121,29 +121,31 @@ const u8 ofdm_rate_lookup[] = {

#define PHY_WREG_LIMIT 24

-static void wlc_set_phy_uninitted(phy_info_t *pi);
-static u32 wlc_phy_get_radio_ver(phy_info_t *pi);
+static void wlc_set_phy_uninitted(struct brcms_phy *pi);
+static u32 wlc_phy_get_radio_ver(struct brcms_phy *pi);
static void wlc_phy_timercb_phycal(void *arg);

-static bool wlc_phy_noise_calc_phy(phy_info_t *pi, u32 *cmplx_pwr,
+static bool wlc_phy_noise_calc_phy(struct brcms_phy *pi, u32 *cmplx_pwr,
s8 *pwr_ant);

-static void wlc_phy_cal_perical_mphase_schedule(phy_info_t *pi, uint delay);
-static void wlc_phy_noise_cb(phy_info_t *pi, u8 channel, s8 noise_dbm);
+static void wlc_phy_cal_perical_mphase_schedule(struct brcms_phy *pi,
+ uint delay);
+
+static void wlc_phy_noise_cb(struct brcms_phy *pi, u8 channel, s8 noise_dbm);
static void wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason,
u8 ch);

-static void wlc_phy_txpower_reg_limit_calc(phy_info_t *pi,
+static void wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi,
struct txpwr_limits *tp, chanspec_t);
-static bool wlc_phy_cal_txpower_recalc_sw(phy_info_t *pi);
+static bool wlc_phy_cal_txpower_recalc_sw(struct brcms_phy *pi);

-static s8 wlc_user_txpwr_antport_to_rfport(phy_info_t *pi, uint chan,
+static s8 wlc_user_txpwr_antport_to_rfport(struct brcms_phy *pi, uint chan,
u32 band, u8 rate);
-static void wlc_phy_upd_env_txpwr_rate_limits(phy_info_t *pi, u32 band);
-static s8 wlc_phy_env_measure_vbat(phy_info_t *pi);
-static s8 wlc_phy_env_measure_temperature(phy_info_t *pi);
+static void wlc_phy_upd_env_txpwr_rate_limits(struct brcms_phy *pi, u32 band);
+static s8 wlc_phy_env_measure_vbat(struct brcms_phy *pi);
+static s8 wlc_phy_env_measure_temperature(struct brcms_phy *pi);

-char *phy_getvar(phy_info_t *pi, const char *name)
+char *phy_getvar(struct brcms_phy *pi, const char *name)
{
char *vars = pi->vars;
char *s;
@@ -167,7 +169,7 @@ char *phy_getvar(phy_info_t *pi, const char *name)
return NULL;
}

-int phy_getintvar(phy_info_t *pi, const char *name)
+int phy_getintvar(struct brcms_phy *pi, const char *name)
{
char *val;

@@ -180,19 +182,19 @@ int phy_getintvar(phy_info_t *pi, const char *name)

void wlc_phyreg_enter(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
wlapi_bmac_ucode_wake_override_phyreg_set(pi->sh->physhim);
}

void wlc_phyreg_exit(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
wlapi_bmac_ucode_wake_override_phyreg_clear(pi->sh->physhim);
}

void wlc_radioreg_enter(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
wlapi_bmac_mctrl(pi->sh->physhim, MCTL_LOCK_RADIO, MCTL_LOCK_RADIO);

udelay(10);
@@ -200,7 +202,7 @@ void wlc_radioreg_enter(wlc_phy_t *pih)

void wlc_radioreg_exit(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
volatile u16 dummy;

dummy = R_REG(&pi->regs->phyversion);
@@ -208,7 +210,7 @@ void wlc_radioreg_exit(wlc_phy_t *pih)
wlapi_bmac_mctrl(pi->sh->physhim, MCTL_LOCK_RADIO, 0);
}

-u16 read_radio_reg(phy_info_t *pi, u16 addr)
+u16 read_radio_reg(struct brcms_phy *pi, u16 addr)
{
u16 data;

@@ -258,7 +260,7 @@ u16 read_radio_reg(phy_info_t *pi, u16 addr)
return data;
}

-void write_radio_reg(phy_info_t *pi, u16 addr, u16 val)
+void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val)
{
if (NORADIO_ENAB(pi->pubpi))
return;
@@ -282,7 +284,7 @@ void write_radio_reg(phy_info_t *pi, u16 addr, u16 val)
}
}

-static u32 read_radio_id(phy_info_t *pi)
+static u32 read_radio_id(struct brcms_phy *pi)
{
u32 id;

@@ -310,7 +312,7 @@ static u32 read_radio_id(phy_info_t *pi)
return id;
}

-void and_radio_reg(phy_info_t *pi, u16 addr, u16 val)
+void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val)
{
u16 rval;

@@ -321,7 +323,7 @@ void and_radio_reg(phy_info_t *pi, u16 addr, u16 val)
write_radio_reg(pi, addr, (rval & val));
}

-void or_radio_reg(phy_info_t *pi, u16 addr, u16 val)
+void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val)
{
u16 rval;

@@ -332,7 +334,7 @@ void or_radio_reg(phy_info_t *pi, u16 addr, u16 val)
write_radio_reg(pi, addr, (rval | val));
}

-void xor_radio_reg(phy_info_t *pi, u16 addr, u16 mask)
+void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask)
{
u16 rval;

@@ -343,7 +345,7 @@ void xor_radio_reg(phy_info_t *pi, u16 addr, u16 mask)
write_radio_reg(pi, addr, (rval ^ mask));
}

-void mod_radio_reg(phy_info_t *pi, u16 addr, u16 mask, u16 val)
+void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val)
{
u16 rval;

@@ -354,12 +356,12 @@ void mod_radio_reg(phy_info_t *pi, u16 addr, u16 mask, u16 val)
write_radio_reg(pi, addr, (rval & ~mask) | (val & mask));
}

-void write_phy_channel_reg(phy_info_t *pi, uint val)
+void write_phy_channel_reg(struct brcms_phy *pi, uint val)
{
W_REG(&pi->regs->phychannel, val);
}

-u16 read_phy_reg(phy_info_t *pi, u16 addr)
+u16 read_phy_reg(struct brcms_phy *pi, u16 addr)
{
d11regs_t *regs;

@@ -371,7 +373,7 @@ u16 read_phy_reg(phy_info_t *pi, u16 addr)
return R_REG(&regs->phyregdata);
}

-void write_phy_reg(phy_info_t *pi, u16 addr, u16 val)
+void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val)
{
d11regs_t *regs;

@@ -394,7 +396,7 @@ void write_phy_reg(phy_info_t *pi, u16 addr, u16 val)
#endif
}

-void and_phy_reg(phy_info_t *pi, u16 addr, u16 val)
+void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val)
{
d11regs_t *regs;

@@ -406,7 +408,7 @@ void and_phy_reg(phy_info_t *pi, u16 addr, u16 val)
pi->phy_wreg = 0;
}

-void or_phy_reg(phy_info_t *pi, u16 addr, u16 val)
+void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val)
{
d11regs_t *regs;

@@ -418,7 +420,7 @@ void or_phy_reg(phy_info_t *pi, u16 addr, u16 val)
pi->phy_wreg = 0;
}

-void mod_phy_reg(phy_info_t *pi, u16 addr, u16 mask, u16 val)
+void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val)
{
d11regs_t *regs;

@@ -431,7 +433,7 @@ void mod_phy_reg(phy_info_t *pi, u16 addr, u16 mask, u16 val)
pi->phy_wreg = 0;
}

-static void WLBANDINITFN(wlc_set_phy_uninitted) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_set_phy_uninitted) (struct brcms_phy *pi)
{
int i, j;

@@ -508,7 +510,7 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp)
wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
char *vars, struct wiphy *wiphy)
{
- phy_info_t *pi;
+ struct brcms_phy *pi;
u32 sflags = 0;
uint phyversion;
u32 idcode;
@@ -533,7 +535,7 @@ wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
return &pi->pubpi_ro;
}

- pi = kzalloc(sizeof(phy_info_t), GFP_ATOMIC);
+ pi = kzalloc(sizeof(struct brcms_phy), GFP_ATOMIC);
if (pi == NULL) {
return NULL;
}
@@ -679,7 +681,7 @@ wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,

void wlc_phy_detach(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (pih) {
if (--pi->refcnt) {
@@ -707,7 +709,7 @@ bool
wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype, u16 *phyrev,
u16 *radioid, u16 *radiover)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
*phytype = (u16) pi->pubpi.phy_type;
*phyrev = (u16) pi->pubpi.phy_rev;
*radioid = pi->pubpi.radioid;
@@ -718,19 +720,19 @@ wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype, u16 *phyrev,

bool wlc_phy_get_encore(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
return pi->pubpi.abgphy_encore;
}

u32 wlc_phy_get_coreflags(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
return pi->pubpi.coreflags;
}

static void wlc_phy_timercb_phycal(void *arg)
{
- phy_info_t *pi = (phy_info_t *) arg;
+ struct brcms_phy *pi = (struct brcms_phy *) arg;
uint delay = 5;

if (PHY_PERICAL_MPHASE_PENDING(pi)) {
@@ -753,7 +755,7 @@ static void wlc_phy_timercb_phycal(void *arg)

void wlc_phy_anacore(wlc_phy_t *pih, bool on)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (ISNPHY(pi)) {
if (on) {
@@ -790,7 +792,7 @@ void wlc_phy_anacore(wlc_phy_t *pih, bool on)

u32 wlc_phy_clk_bwbits(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

u32 phy_bw_clkbits = 0;

@@ -815,14 +817,14 @@ u32 wlc_phy_clk_bwbits(wlc_phy_t *pih)

void WLBANDINITFN(wlc_phy_por_inform) (wlc_phy_t *ppi)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->phy_init_por = true;
}

void wlc_phy_edcrs_lock(wlc_phy_t *pih, bool lock)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

pi->edcrs_threshold_lock = lock;

@@ -834,14 +836,14 @@ void wlc_phy_edcrs_lock(wlc_phy_t *pih, bool lock)

void wlc_phy_initcal_enable(wlc_phy_t *pih, bool initcal)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

pi->do_initcal = initcal;
}

void wlc_phy_hw_clk_state_upd(wlc_phy_t *pih, bool newstate)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (!pi || !pi->sh)
return;
@@ -851,7 +853,7 @@ void wlc_phy_hw_clk_state_upd(wlc_phy_t *pih, bool newstate)

void wlc_phy_hw_state_upd(wlc_phy_t *pih, bool newstate)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (!pi || !pi->sh)
return;
@@ -863,7 +865,7 @@ void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)
{
u32 mc;
initfn_t phy_init = NULL;
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (pi->init_in_progress)
return;
@@ -917,7 +919,7 @@ void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)

void wlc_phy_cal_init(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
initfn_t cal_init = NULL;

if (WARN((R_REG(&pi->regs->maccontrol) & MCTL_EN_MAC) != 0,
@@ -935,7 +937,7 @@ void wlc_phy_cal_init(wlc_phy_t *pih)

int wlc_phy_down(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
int callbacks = 0;

if (pi->phycal_timer
@@ -948,7 +950,7 @@ int wlc_phy_down(wlc_phy_t *pih)
return callbacks;
}

-static u32 wlc_phy_get_radio_ver(phy_info_t *pi)
+static u32 wlc_phy_get_radio_ver(struct brcms_phy *pi)
{
u32 ver;

@@ -958,7 +960,7 @@ static u32 wlc_phy_get_radio_ver(phy_info_t *pi)
}

void
-wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
+wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id, uint tbl_offset,
u16 tblAddr, u16 tblDataHi, u16 tblDataLo)
{
write_phy_reg(pi, tblAddr, (tbl_id << 10) | tbl_offset);
@@ -974,7 +976,7 @@ wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
}
}

-void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val)
+void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val)
{
if ((pi->sh->chip == BCM43224_CHIP_ID) &&
(pi->sh->chiprev == 1) &&
@@ -997,7 +999,7 @@ void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val)
}

void
-wlc_phy_write_table(phy_info_t *pi, const struct phytbl_info *ptbl_info,
+wlc_phy_write_table(struct brcms_phy *pi, const struct phytbl_info *ptbl_info,
u16 tblAddr, u16 tblDataHi, u16 tblDataLo)
{
uint idx;
@@ -1037,7 +1039,7 @@ wlc_phy_write_table(phy_info_t *pi, const struct phytbl_info *ptbl_info,
}

void
-wlc_phy_read_table(phy_info_t *pi, const struct phytbl_info *ptbl_info,
+wlc_phy_read_table(struct brcms_phy *pi, const struct phytbl_info *ptbl_info,
u16 tblAddr, u16 tblDataHi, u16 tblDataLo)
{
uint idx;
@@ -1075,7 +1077,7 @@ wlc_phy_read_table(phy_info_t *pi, const struct phytbl_info *ptbl_info,
}

uint
-wlc_phy_init_radio_regs_allbands(phy_info_t *pi,
+wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
struct radio_20xx_regs *radioregs)
{
uint i = 0;
@@ -1093,7 +1095,7 @@ wlc_phy_init_radio_regs_allbands(phy_info_t *pi,
}

uint
-wlc_phy_init_radio_regs(phy_info_t *pi, struct radio_regs *radioregs,
+wlc_phy_init_radio_regs(struct brcms_phy *pi, struct radio_regs *radioregs,
u16 core_offset)
{
uint i = 0;
@@ -1126,7 +1128,7 @@ wlc_phy_init_radio_regs(phy_info_t *pi, struct radio_regs *radioregs,
return i;
}

-void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on)
+void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on)
{
#define DUMMY_PKT_LEN 20
d11regs_t *regs = pi->regs;
@@ -1206,7 +1208,7 @@ void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on)

void wlc_phy_hold_upd(wlc_phy_t *pih, mbool id, bool set)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (set) {
mboolset(pi->measure_hold, id);
@@ -1219,7 +1221,7 @@ void wlc_phy_hold_upd(wlc_phy_t *pih, mbool id, bool set)

void wlc_phy_mute_upd(wlc_phy_t *pih, bool mute, mbool flags)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (mute) {
mboolset(pi->measure_hold, PHY_HOLD_FOR_MUTE);
@@ -1234,7 +1236,7 @@ void wlc_phy_mute_upd(wlc_phy_t *pih, bool mute, mbool flags)

void wlc_phy_clear_tssi(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (ISNPHY(pi)) {
return;
@@ -1246,14 +1248,14 @@ void wlc_phy_clear_tssi(wlc_phy_t *pih)
}
}

-static bool wlc_phy_cal_txpower_recalc_sw(phy_info_t *pi)
+static bool wlc_phy_cal_txpower_recalc_sw(struct brcms_phy *pi)
{
return false;
}

void wlc_phy_switch_radio(wlc_phy_t *pih, bool on)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (NORADIO_ENAB(pi->pubpi))
return;
@@ -1296,35 +1298,35 @@ void wlc_phy_switch_radio(wlc_phy_t *pih, bool on)

u16 wlc_phy_bw_state_get(wlc_phy_t *ppi)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

return pi->bw;
}

void wlc_phy_bw_state_set(wlc_phy_t *ppi, u16 bw)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->bw = bw;
}

void wlc_phy_chanspec_radio_set(wlc_phy_t *ppi, chanspec_t newch)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
pi->radio_chanspec = newch;

}

chanspec_t wlc_phy_chanspec_get(wlc_phy_t *ppi)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

return pi->radio_chanspec;
}

void wlc_phy_chanspec_set(wlc_phy_t *ppi, chanspec_t chanspec)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
u16 m_cur_channel;
chansetfn_t chanspec_set = NULL;

@@ -1357,7 +1359,7 @@ int wlc_phy_chanspec_freq2bandrange_lpssn(uint freq)
return range;
}

-int wlc_phy_chanspec_bandrange_get(phy_info_t *pi, chanspec_t chanspec)
+int wlc_phy_chanspec_bandrange_get(struct brcms_phy *pi, chanspec_t chanspec)
{
int range = -1;
uint channel = CHSPEC_CHANNEL(chanspec);
@@ -1374,7 +1376,7 @@ int wlc_phy_chanspec_bandrange_get(phy_info_t *pi, chanspec_t chanspec)

void wlc_phy_chanspec_ch14_widefilter_set(wlc_phy_t *ppi, bool wide_filter)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->channel_14_wide_filter = wide_filter;

@@ -1393,7 +1395,7 @@ int wlc_phy_channel2freq(uint channel)
void
wlc_phy_chanspec_band_validch(wlc_phy_t *ppi, uint band, chanvec_t *channels)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
uint i;
uint channel;

@@ -1414,7 +1416,7 @@ wlc_phy_chanspec_band_validch(wlc_phy_t *ppi, uint band, chanvec_t *channels)

chanspec_t wlc_phy_chanspec_band_firstch(wlc_phy_t *ppi, uint band)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
uint i;
uint channel;
chanspec_t chspec;
@@ -1459,7 +1461,7 @@ chanspec_t wlc_phy_chanspec_band_firstch(wlc_phy_t *ppi, uint band)

int wlc_phy_txpower_get(wlc_phy_t *ppi, uint *qdbm, bool *override)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

*qdbm = pi->tx_user_target[0];
if (override != NULL)
@@ -1470,7 +1472,7 @@ int wlc_phy_txpower_get(wlc_phy_t *ppi, uint *qdbm, bool *override)
void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr)
{
bool mac_enabled = false;
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

memcpy(&pi->tx_user_target[TXP_FIRST_CCK],
&txpwr->cck[0], WLC_NUM_RATES_CCK);
@@ -1518,7 +1520,7 @@ void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr)

int wlc_phy_txpower_set(wlc_phy_t *ppi, uint qdbm, bool override)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
int i;

if (qdbm > 127)
@@ -1555,7 +1557,7 @@ void
wlc_phy_txpower_sromlimit(wlc_phy_t *ppi, uint channel, u8 *min_pwr,
u8 *max_pwr, int txp_rate_idx)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
uint i;

*min_pwr = pi->min_txpower * WLC_TXPWR_DB_FACTOR;
@@ -1605,7 +1607,7 @@ void
wlc_phy_txpower_sromlimit_max_get(wlc_phy_t *ppi, uint chan, u8 *max_txpwr,
u8 *min_txpwr)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
u8 tx_pwr_max = 0;
u8 tx_pwr_min = 255;
u8 max_num_rate;
@@ -1641,19 +1643,19 @@ wlc_phy_txpower_boardlimit_band(wlc_phy_t *ppi, uint bandunit, s32 *max_pwr,

u8 wlc_phy_txpower_get_target_min(wlc_phy_t *ppi)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

return pi->tx_power_min;
}

u8 wlc_phy_txpower_get_target_max(wlc_phy_t *ppi)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

return pi->tx_power_max;
}

-void wlc_phy_txpower_recalc_target(phy_info_t *pi)
+void wlc_phy_txpower_recalc_target(struct brcms_phy *pi)
{
u8 maxtxpwr, mintxpwr, rate, pactrl;
uint target_chan;
@@ -1772,7 +1774,7 @@ void wlc_phy_txpower_recalc_target(phy_info_t *pi)
}

void
-wlc_phy_txpower_reg_limit_calc(phy_info_t *pi, struct txpwr_limits *txpwr,
+wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi, struct txpwr_limits *txpwr,
chanspec_t chanspec)
{
u8 tmp_txpwr_limit[2 * WLC_NUM_RATES_OFDM];
@@ -1926,21 +1928,21 @@ wlc_phy_txpower_reg_limit_calc(phy_info_t *pi, struct txpwr_limits *txpwr,

void wlc_phy_txpwr_percent_set(wlc_phy_t *ppi, u8 txpwr_percent)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->txpwr_percent = txpwr_percent;
}

void wlc_phy_machwcap_set(wlc_phy_t *ppi, u32 machwcap)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->sh->machwcap = machwcap;
}

void wlc_phy_runbist_config(wlc_phy_t *ppi, bool start_end)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
u16 rxc;
rxc = 0;

@@ -1972,7 +1974,7 @@ void
wlc_phy_txpower_limit_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr,
chanspec_t chanspec)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

wlc_phy_txpower_reg_limit_calc(pi, txpwr, chanspec);

@@ -1996,19 +1998,19 @@ wlc_phy_txpower_limit_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr,

void wlc_phy_ofdm_rateset_war(wlc_phy_t *pih, bool war)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

pi->ofdm_rateset_war = war;
}

void wlc_phy_bf_preempt_enable(wlc_phy_t *pih, bool bf_preempt)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

pi->bf_preempt_4306 = bf_preempt;
}

-void wlc_phy_txpower_update_shm(phy_info_t *pi)
+void wlc_phy_txpower_update_shm(struct brcms_phy *pi)
{
int j;
if (ISNPHY(pi)) {
@@ -2061,7 +2063,7 @@ void wlc_phy_txpower_update_shm(phy_info_t *pi)

bool wlc_phy_txpower_hw_ctrl_get(wlc_phy_t *ppi)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

if (ISNPHY(pi)) {
return pi->nphy_txpwrctrl;
@@ -2072,7 +2074,7 @@ bool wlc_phy_txpower_hw_ctrl_get(wlc_phy_t *ppi)

void wlc_phy_txpower_hw_ctrl_set(wlc_phy_t *ppi, bool hwpwrctrl)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
bool cur_hwpwrctrl = pi->hwpwrctrl;
bool suspend;

@@ -2108,7 +2110,7 @@ void wlc_phy_txpower_hw_ctrl_set(wlc_phy_t *ppi, bool hwpwrctrl)
}
}

-void wlc_phy_txpower_ipa_upd(phy_info_t *pi)
+void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi)
{

if (NREV_GE(pi->pubpi.phy_rev, 3)) {
@@ -2120,9 +2122,9 @@ void wlc_phy_txpower_ipa_upd(phy_info_t *pi)
}
}

-static u32 wlc_phy_txpower_est_power_nphy(phy_info_t *pi);
+static u32 wlc_phy_txpower_est_power_nphy(struct brcms_phy *pi);

-static u32 wlc_phy_txpower_est_power_nphy(phy_info_t *pi)
+static u32 wlc_phy_txpower_est_power_nphy(struct brcms_phy *pi)
{
s16 tx0_status, tx1_status;
u16 estPower1, estPower2;
@@ -2174,7 +2176,7 @@ static u32 wlc_phy_txpower_est_power_nphy(phy_info_t *pi)
void
wlc_phy_txpower_get_current(wlc_phy_t *ppi, tx_power_t *power, uint channel)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
uint rate, num_rates;
u8 min_pwr, max_pwr;

@@ -2271,21 +2273,21 @@ wlc_phy_txpower_get_current(wlc_phy_t *ppi, tx_power_t *power, uint channel)

void wlc_phy_antsel_type_set(wlc_phy_t *ppi, u8 antsel_type)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->antsel_type = antsel_type;
}

bool wlc_phy_test_ison(wlc_phy_t *ppi)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

return pi->phytest_on;
}

void wlc_phy_ant_rxdiv_set(wlc_phy_t *ppi, u8 val)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
bool suspend;

pi->sh->rx_antdiv = val;
@@ -2331,7 +2333,7 @@ void wlc_phy_ant_rxdiv_set(wlc_phy_t *ppi, u8 val)
}

static bool
-wlc_phy_noise_calc_phy(phy_info_t *pi, u32 *cmplx_pwr, s8 *pwr_ant)
+wlc_phy_noise_calc_phy(struct brcms_phy *pi, u32 *cmplx_pwr, s8 *pwr_ant)
{
s8 cmplx_pwr_dbm[PHY_CORE_MAX];
u8 i;
@@ -2359,7 +2361,7 @@ wlc_phy_noise_calc_phy(phy_info_t *pi, u32 *cmplx_pwr, s8 *pwr_ant)
static void
wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
bool sampling_in_progress = (pi->phynoise_state != 0);
bool wait_for_intr = true;
@@ -2500,7 +2502,7 @@ void wlc_phy_noise_sample_request_external(wlc_phy_t *pih)
wlc_phy_noise_sample_request(pih, PHY_NOISE_SAMPLE_EXTERNAL, channel);
}

-static void wlc_phy_noise_cb(phy_info_t *pi, u8 channel, s8 noise_dbm)
+static void wlc_phy_noise_cb(struct brcms_phy *pi, u8 channel, s8 noise_dbm)
{
if (!pi->phynoise_state)
return;
@@ -2521,7 +2523,7 @@ static void wlc_phy_noise_cb(phy_info_t *pi, u8 channel, s8 noise_dbm)

}

-static s8 wlc_phy_noise_read_shmem(phy_info_t *pi)
+static s8 wlc_phy_noise_read_shmem(struct brcms_phy *pi)
{
u32 cmplx_pwr[PHY_CORE_MAX];
s8 noise_dbm_ant[PHY_CORE_MAX];
@@ -2564,7 +2566,7 @@ static s8 wlc_phy_noise_read_shmem(phy_info_t *pi)

void wlc_phy_noise_sample_intr(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
u16 jssi_aux;
u8 channel = 0;
s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
@@ -2679,7 +2681,7 @@ void wlc_phy_rssi_compute(wlc_phy_t *pih, void *ctx)
struct d11rxhdr *rxh = &wlc_rxhdr->rxhdr;
int rssi = le16_to_cpu(rxh->PhyRxStatus_1) & PRXS1_JSSI_MASK;
uint radioid = pih->radioid;
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (NORADIO_ENAB(pi->pubpi)) {
rssi = WLC_RSSI_INVALID;
@@ -2694,7 +2696,7 @@ void wlc_phy_rssi_compute(wlc_phy_t *pih, void *ctx)

if (ISLCNPHY(pi)) {
u8 gidx = (le16_to_cpu(rxh->PhyRxStatus_2) & 0xFC00) >> 10;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (rssi > 127)
rssi -= 256;
@@ -2734,8 +2736,8 @@ void wlc_phy_freqtrack_end(wlc_phy_t *pih)

void wlc_phy_set_deaf(wlc_phy_t *ppi, bool user_flag)
{
- phy_info_t *pi;
- pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi;
+ pi = (struct brcms_phy *) ppi;

if (ISLCNPHY(pi))
wlc_lcnphy_deaf_mode(pi, true);
@@ -2745,7 +2747,7 @@ void wlc_phy_set_deaf(wlc_phy_t *ppi, bool user_flag)

void wlc_phy_watchdog(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
bool delay_phy_cal = false;
pi->sh->now++;

@@ -2810,7 +2812,7 @@ void wlc_phy_watchdog(wlc_phy_t *pih)

void wlc_phy_BSSinit(wlc_phy_t *pih, bool bonlyap, int rssi)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
uint i;
uint k;

@@ -2906,7 +2908,7 @@ void wlc_phy_cordic(fixed theta, cs32 *val)
val[0].q = val[0].q * signx;
}

-void wlc_phy_cal_perical_mphase_reset(phy_info_t *pi)
+void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi)
{
wlapi_del_timer(pi->sh->physhim, pi->phycal_timer);

@@ -2915,7 +2917,8 @@ void wlc_phy_cal_perical_mphase_reset(phy_info_t *pi)
pi->mphase_txcal_cmdidx = 0;
}

-static void wlc_phy_cal_perical_mphase_schedule(phy_info_t *pi, uint delay)
+static void
+wlc_phy_cal_perical_mphase_schedule(struct brcms_phy *pi, uint delay)
{

if ((pi->nphy_perical != PHY_PERICAL_MPHASE) &&
@@ -2933,7 +2936,7 @@ void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason)
s16 nphy_currtemp = 0;
s16 delta_temp = 0;
bool do_periodic_cal = true;
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

if (!ISNPHY(pi))
return;
@@ -3008,7 +3011,7 @@ void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason)
}
}

-void wlc_phy_cal_perical_mphase_restart(phy_info_t *pi)
+void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi)
{
pi->mphase_cal_phase_id = MPHASE_CAL_STATE_INIT;
pi->mphase_txcal_cmdidx = 0;
@@ -3028,7 +3031,7 @@ u8 wlc_phy_nbits(s32 value)

void wlc_phy_stf_chain_init(wlc_phy_t *pih, u8 txchain, u8 rxchain)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

pi->sh->hw_phytxchain = txchain;
pi->sh->hw_phyrxchain = rxchain;
@@ -3039,7 +3042,7 @@ void wlc_phy_stf_chain_init(wlc_phy_t *pih, u8 txchain, u8 rxchain)

void wlc_phy_stf_chain_set(wlc_phy_t *pih, u8 txchain, u8 rxchain)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

pi->sh->phytxchain = txchain;

@@ -3051,7 +3054,7 @@ void wlc_phy_stf_chain_set(wlc_phy_t *pih, u8 txchain, u8 rxchain)

void wlc_phy_stf_chain_get(wlc_phy_t *pih, u8 *txchain, u8 *rxchain)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

*txchain = pi->sh->phytxchain;
*rxchain = pi->sh->phyrxchain;
@@ -3061,7 +3064,7 @@ u8 wlc_phy_stf_chain_active_get(wlc_phy_t *pih)
{
s16 nphy_currtemp;
u8 active_bitmap;
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

active_bitmap = (pi->phy_txcore_heatedup) ? 0x31 : 0x33;

@@ -3091,7 +3094,7 @@ u8 wlc_phy_stf_chain_active_get(wlc_phy_t *pih)

s8 wlc_phy_stf_ssmode_get(wlc_phy_t *pih, chanspec_t chanspec)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
u8 siso_mcs_id, cdd_mcs_id;

siso_mcs_id =
@@ -3113,7 +3116,7 @@ const u8 *wlc_phy_get_ofdm_rate_lookup(void)
return ofdm_rate_lookup;
}

-void wlc_lcnphy_epa_switch(phy_info_t *pi, bool mode)
+void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode)
{
if ((pi->sh->chip == BCM4313_CHIP_ID) &&
(pi->sh->boardflags & BFL_FEM)) {
@@ -3151,7 +3154,7 @@ void wlc_lcnphy_epa_switch(phy_info_t *pi, bool mode)
}

static s8
-wlc_user_txpwr_antport_to_rfport(phy_info_t *pi, uint chan, u32 band,
+wlc_user_txpwr_antport_to_rfport(struct brcms_phy *pi, uint chan, u32 band,
u8 rate)
{
s8 offset = 0;
@@ -3161,7 +3164,7 @@ wlc_user_txpwr_antport_to_rfport(phy_info_t *pi, uint chan, u32 band,
return offset;
}

-static s8 wlc_phy_env_measure_vbat(phy_info_t *pi)
+static s8 wlc_phy_env_measure_vbat(struct brcms_phy *pi)
{
if (ISLCNPHY(pi))
return wlc_lcnphy_vbatsense(pi, 0);
@@ -3169,7 +3172,7 @@ static s8 wlc_phy_env_measure_vbat(phy_info_t *pi)
return 0;
}

-static s8 wlc_phy_env_measure_temperature(phy_info_t *pi)
+static s8 wlc_phy_env_measure_temperature(struct brcms_phy *pi)
{
if (ISLCNPHY(pi))
return wlc_lcnphy_tempsense_degree(pi, 0);
@@ -3177,7 +3180,7 @@ static s8 wlc_phy_env_measure_temperature(phy_info_t *pi)
return 0;
}

-static void wlc_phy_upd_env_txpwr_rate_limits(phy_info_t *pi, u32 band)
+static void wlc_phy_upd_env_txpwr_rate_limits(struct brcms_phy *pi, u32 band)
{
u8 i;
s8 temp, vbat;
@@ -3196,13 +3199,13 @@ void wlc_phy_ldpc_override_set(wlc_phy_t *ppi, bool ldpc)
}

void
-wlc_phy_get_pwrdet_offsets(phy_info_t *pi, s8 *cckoffset, s8 *ofdmoffset)
+wlc_phy_get_pwrdet_offsets(struct brcms_phy *pi, s8 *cckoffset, s8 *ofdmoffset)
{
*cckoffset = 0;
*ofdmoffset = 0;
}

-s8 wlc_phy_upd_rssi_offset(phy_info_t *pi, s8 rssi, chanspec_t chanspec)
+s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi, chanspec_t chanspec)
{

return rssi;
@@ -3210,7 +3213,7 @@ s8 wlc_phy_upd_rssi_offset(phy_info_t *pi, s8 rssi, chanspec_t chanspec)

bool wlc_phy_txpower_ipa_ison(wlc_phy_t *ppi)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

if (ISNPHY(pi))
return wlc_phy_n_txpower_ipa_ison(pi);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
index d8c86d9..6e4c2b1 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
@@ -49,16 +49,16 @@ struct brcms_phy_srom_fem {
u8 antswctrllut; /* antswctrl lookup table configuration: 32 possible choices */
};

-typedef void (*initfn_t) (phy_info_t *);
-typedef void (*chansetfn_t) (phy_info_t *, chanspec_t);
-typedef int (*longtrnfn_t) (phy_info_t *, int);
-typedef void (*txiqccgetfn_t) (phy_info_t *, u16 *, u16 *);
-typedef void (*txiqccsetfn_t) (phy_info_t *, u16, u16);
-typedef u16(*txloccgetfn_t) (phy_info_t *);
-typedef void (*radioloftgetfn_t) (phy_info_t *, u8 *, u8 *, u8 *,
+typedef void (*initfn_t) (struct brcms_phy *);
+typedef void (*chansetfn_t) (struct brcms_phy *, chanspec_t);
+typedef int (*longtrnfn_t) (struct brcms_phy *, int);
+typedef void (*txiqccgetfn_t) (struct brcms_phy *, u16 *, u16 *);
+typedef void (*txiqccsetfn_t) (struct brcms_phy *, u16, u16);
+typedef u16(*txloccgetfn_t) (struct brcms_phy *);
+typedef void (*radioloftgetfn_t) (struct brcms_phy *, u8 *, u8 *, u8 *,
u8 *);
-typedef s32(*rxsigpwrfn_t) (phy_info_t *, s32);
-typedef void (*detachfn_t) (phy_info_t *);
+typedef s32(*rxsigpwrfn_t) (struct brcms_phy *, s32);
+typedef void (*detachfn_t) (struct brcms_phy *);

#undef ISNPHY
#undef ISLCNPHY
@@ -529,7 +529,7 @@ struct lcnphy_cal_results {
};

struct shared_phy {
- struct phy_info *phy_head;
+ struct brcms_phy *phy_head;
uint unit;
struct si_pub *sih;
void *physhim;
@@ -593,19 +593,19 @@ struct phy_func_ptr {
detachfn_t detach;
};

-struct phy_info {
+struct brcms_phy {
wlc_phy_t pubpi_ro;
struct shared_phy *sh;
struct phy_func_ptr pi_fptr;
void *pi_ptr;

union {
- struct phy_info_lcnphy *pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcnphy;
} u;
bool user_txpwr_at_rfport;

d11regs_t *regs;
- struct phy_info *next;
+ struct brcms_phy *next;
char *vars;
wlc_phy_t pubpi;

@@ -982,98 +982,100 @@ extern struct radio_20xx_regs regs_2057_rev4[], regs_2057_rev5[],
regs_2057_rev5v1[];
extern struct radio_20xx_regs regs_2057_rev7[], regs_2057_rev8[];

-extern char *phy_getvar(phy_info_t *pi, const char *name);
-extern int phy_getintvar(phy_info_t *pi, const char *name);
+extern char *phy_getvar(struct brcms_phy *pi, const char *name);
+extern int phy_getintvar(struct brcms_phy *pi, const char *name);
#define PHY_GETVAR(pi, name) phy_getvar(pi, name)
#define PHY_GETINTVAR(pi, name) phy_getintvar(pi, name)

-extern u16 read_phy_reg(phy_info_t *pi, u16 addr);
-extern void write_phy_reg(phy_info_t *pi, u16 addr, u16 val);
-extern void and_phy_reg(phy_info_t *pi, u16 addr, u16 val);
-extern void or_phy_reg(phy_info_t *pi, u16 addr, u16 val);
-extern void mod_phy_reg(phy_info_t *pi, u16 addr, u16 mask, u16 val);
+extern u16 read_phy_reg(struct brcms_phy *pi, u16 addr);
+extern void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
+extern void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
+extern void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
+extern void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);

-extern u16 read_radio_reg(phy_info_t *pi, u16 addr);
-extern void or_radio_reg(phy_info_t *pi, u16 addr, u16 val);
-extern void and_radio_reg(phy_info_t *pi, u16 addr, u16 val);
-extern void mod_radio_reg(phy_info_t *pi, u16 addr, u16 mask,
+extern u16 read_radio_reg(struct brcms_phy *pi, u16 addr);
+extern void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
+extern void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
+extern void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask,
u16 val);
-extern void xor_radio_reg(phy_info_t *pi, u16 addr, u16 mask);
+extern void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask);

-extern void write_radio_reg(phy_info_t *pi, u16 addr, u16 val);
+extern void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);

extern void wlc_phyreg_enter(wlc_phy_t *pih);
extern void wlc_phyreg_exit(wlc_phy_t *pih);
extern void wlc_radioreg_enter(wlc_phy_t *pih);
extern void wlc_radioreg_exit(wlc_phy_t *pih);

-extern void wlc_phy_read_table(phy_info_t *pi,
+extern void wlc_phy_read_table(struct brcms_phy *pi,
const struct phytbl_info *ptbl_info,
u16 tblAddr, u16 tblDataHi,
u16 tblDatalo);
-extern void wlc_phy_write_table(phy_info_t *pi,
+extern void wlc_phy_write_table(struct brcms_phy *pi,
const struct phytbl_info *ptbl_info,
u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
-extern void wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
- u16 tblAddr, u16 tblDataHi,
+extern void wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id,
+ uint tbl_offset, u16 tblAddr, u16 tblDataHi,
u16 tblDataLo);
-extern void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val);
+extern void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val);

-extern void write_phy_channel_reg(phy_info_t *pi, uint val);
-extern void wlc_phy_txpower_update_shm(phy_info_t *pi);
+extern void write_phy_channel_reg(struct brcms_phy *pi, uint val);
+extern void wlc_phy_txpower_update_shm(struct brcms_phy *pi);

extern void wlc_phy_cordic(fixed theta, cs32 *val);
extern u8 wlc_phy_nbits(s32 value);
extern void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);

-extern uint wlc_phy_init_radio_regs_allbands(phy_info_t *pi,
+extern uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
struct radio_20xx_regs *radioregs);
-extern uint wlc_phy_init_radio_regs(phy_info_t *pi,
+extern uint wlc_phy_init_radio_regs(struct brcms_phy *pi,
struct radio_regs *radioregs,
u16 core_offset);

-extern void wlc_phy_txpower_ipa_upd(phy_info_t *pi);
+extern void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi);

-extern void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on);
+extern void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on);
extern void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real,
s32 *eps_imag);

-extern void wlc_phy_cal_perical_mphase_reset(phy_info_t *pi);
-extern void wlc_phy_cal_perical_mphase_restart(phy_info_t *pi);
+extern void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi);
+extern void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi);

-extern bool wlc_phy_attach_nphy(phy_info_t *pi);
-extern bool wlc_phy_attach_lcnphy(phy_info_t *pi);
+extern bool wlc_phy_attach_nphy(struct brcms_phy *pi);
+extern bool wlc_phy_attach_lcnphy(struct brcms_phy *pi);

-extern void wlc_phy_detach_lcnphy(phy_info_t *pi);
+extern void wlc_phy_detach_lcnphy(struct brcms_phy *pi);

-extern void wlc_phy_init_nphy(phy_info_t *pi);
-extern void wlc_phy_init_lcnphy(phy_info_t *pi);
+extern void wlc_phy_init_nphy(struct brcms_phy *pi);
+extern void wlc_phy_init_lcnphy(struct brcms_phy *pi);

-extern void wlc_phy_cal_init_nphy(phy_info_t *pi);
-extern void wlc_phy_cal_init_lcnphy(phy_info_t *pi);
+extern void wlc_phy_cal_init_nphy(struct brcms_phy *pi);
+extern void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi);

-extern void wlc_phy_chanspec_set_nphy(phy_info_t *pi, chanspec_t chanspec);
-extern void wlc_phy_chanspec_set_lcnphy(phy_info_t *pi, chanspec_t chanspec);
-extern void wlc_phy_chanspec_set_fixup_lcnphy(phy_info_t *pi,
+extern void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi,
+ chanspec_t chanspec);
+extern void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi,
+ chanspec_t chanspec);
+extern void wlc_phy_chanspec_set_fixup_lcnphy(struct brcms_phy *pi,
chanspec_t chanspec);
extern int wlc_phy_channel2freq(uint channel);
extern int wlc_phy_chanspec_freq2bandrange_lpssn(uint);
-extern int wlc_phy_chanspec_bandrange_get(phy_info_t *, chanspec_t);
+extern int wlc_phy_chanspec_bandrange_get(struct brcms_phy *, chanspec_t);

-extern void wlc_lcnphy_set_tx_pwr_ctrl(phy_info_t *pi, u16 mode);
-extern s8 wlc_lcnphy_get_current_tx_pwr_idx(phy_info_t *pi);
+extern void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode);
+extern s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi);

-extern void wlc_phy_txpower_recalc_target_nphy(phy_info_t *pi);
-extern void wlc_lcnphy_txpower_recalc_target(phy_info_t *pi);
-extern void wlc_phy_txpower_recalc_target_lcnphy(phy_info_t *pi);
+extern void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi);
+extern void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi);
+extern void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi);

-extern void wlc_lcnphy_set_tx_pwr_by_index(phy_info_t *pi, int index);
-extern void wlc_lcnphy_tx_pu(phy_info_t *pi, bool bEnable);
-extern void wlc_lcnphy_stop_tx_tone(phy_info_t *pi);
-extern void wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz,
+extern void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index);
+extern void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable);
+extern void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi);
+extern void wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz,
u16 max_val, bool iqcalmode);

-extern void wlc_phy_txpower_sromlimit_get_nphy(phy_info_t *pi, uint chan,
+extern void wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan,
u8 *max_pwr, u8 rate_id);
extern void wlc_phy_ofdm_to_mcs_powers_nphy(u8 *power, u8 rate_mcs_start,
u8 rate_mcs_end,
@@ -1083,16 +1085,16 @@ extern void wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power,
u8 rate_ofdm_end,
u8 rate_mcs_start);

-extern u16 wlc_lcnphy_tempsense(phy_info_t *pi, bool mode);
-extern s16 wlc_lcnphy_tempsense_new(phy_info_t *pi, bool mode);
-extern s8 wlc_lcnphy_tempsense_degree(phy_info_t *pi, bool mode);
-extern s8 wlc_lcnphy_vbatsense(phy_info_t *pi, bool mode);
-extern void wlc_phy_carrier_suppress_lcnphy(phy_info_t *pi);
-extern void wlc_lcnphy_crsuprs(phy_info_t *pi, int channel);
-extern void wlc_lcnphy_epa_switch(phy_info_t *pi, bool mode);
-extern void wlc_2064_vco_cal(phy_info_t *pi);
+extern u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode);
+extern s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode);
+extern s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode);
+extern s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode);
+extern void wlc_phy_carrier_suppress_lcnphy(struct brcms_phy *pi);
+extern void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel);
+extern void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode);
+extern void wlc_2064_vco_cal(struct brcms_phy *pi);

-extern void wlc_phy_txpower_recalc_target(phy_info_t *pi);
+extern void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);

#define LCNPHY_TBL_ID_PAPDCOMPDELTATBL 0x18
#define LCNPHY_TX_POWER_TABLE_SIZE 128
@@ -1106,25 +1108,26 @@ extern void wlc_phy_txpower_recalc_target(phy_info_t *pi);

#define LCNPHY_TX_PWR_CTRL_TEMPBASED 0xE001

-extern void wlc_lcnphy_write_table(phy_info_t *pi,
+extern void wlc_lcnphy_write_table(struct brcms_phy *pi,
const struct phytbl_info *pti);
-extern void wlc_lcnphy_read_table(phy_info_t *pi, struct phytbl_info *pti);
-extern void wlc_lcnphy_set_tx_iqcc(phy_info_t *pi, u16 a, u16 b);
-extern void wlc_lcnphy_set_tx_locc(phy_info_t *pi, u16 didq);
-extern void wlc_lcnphy_get_tx_iqcc(phy_info_t *pi, u16 *a, u16 *b);
-extern u16 wlc_lcnphy_get_tx_locc(phy_info_t *pi);
-extern void wlc_lcnphy_get_radio_loft(phy_info_t *pi, u8 *ei0,
+extern void wlc_lcnphy_read_table(struct brcms_phy *pi,
+ struct phytbl_info *pti);
+extern void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b);
+extern void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq);
+extern void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b);
+extern u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi);
+extern void wlc_lcnphy_get_radio_loft(struct brcms_phy *pi, u8 *ei0,
u8 *eq0, u8 *fi0, u8 *fq0);
-extern void wlc_lcnphy_calib_modes(phy_info_t *pi, uint mode);
-extern void wlc_lcnphy_deaf_mode(phy_info_t *pi, bool mode);
-extern bool wlc_phy_tpc_isenabled_lcnphy(phy_info_t *pi);
-extern void wlc_lcnphy_tx_pwr_update_npt(phy_info_t *pi);
+extern void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode);
+extern void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode);
+extern bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi);
+extern void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi);
extern s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
-extern void wlc_lcnphy_get_tssi(phy_info_t *pi, s8 *ofdm_pwr,
+extern void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr,
s8 *cck_pwr);
extern void wlc_lcnphy_tx_power_adjustment(wlc_phy_t *ppi);

-extern s32 wlc_lcnphy_rx_signal_power(phy_info_t *pi, s32 gain_index);
+extern s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);

#define NPHY_MAX_HPVGA1_INDEX 10
#define NPHY_DEF_HPVGA1_INDEXLIMIT 7
@@ -1135,8 +1138,9 @@ struct phy_iq_est {
u32 q_pwr;
};

-extern void wlc_phy_stay_in_carriersearch_nphy(phy_info_t *pi, bool enable);
-extern void wlc_nphy_deaf_mode(phy_info_t *pi, bool mode);
+extern void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi,
+ bool enable);
+extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);

#define wlc_phy_write_table_nphy(pi, pti) wlc_phy_write_table(pi, pti, 0x72, \
0x74, 0x73)
@@ -1146,9 +1150,9 @@ extern void wlc_nphy_deaf_mode(phy_info_t *pi, bool mode);
0x72, 0x74, 0x73)
#define wlc_nphy_table_data_write(pi, w, v) wlc_phy_table_data_write((pi), (w), (v))

-extern void wlc_phy_table_read_nphy(phy_info_t *pi, u32, u32 l, u32 o,
+extern void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o,
u32 w, void *d);
-extern void wlc_phy_table_write_nphy(phy_info_t *pi, u32, u32, u32,
+extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32,
u32, const void *);

#define PHY_IPA(pi) \
@@ -1159,72 +1163,72 @@ extern void wlc_phy_table_write_nphy(phy_info_t *pi, u32, u32, u32,
if (((pi)->sh->bustype == PCI_BUS) && NREV_LT((pi)->pubpi.phy_rev, 3)) \
(void)R_REG(&(pi)->regs->maccontrol)

-extern void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype);
-extern void wlc_phy_aci_reset_nphy(phy_info_t *pi);
-extern void wlc_phy_pa_override_nphy(phy_info_t *pi, bool en);
+extern void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype);
+extern void wlc_phy_aci_reset_nphy(struct brcms_phy *pi);
+extern void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en);

-extern u8 wlc_phy_get_chan_freq_range_nphy(phy_info_t *pi, uint chan);
-extern void wlc_phy_switch_radio_nphy(phy_info_t *pi, bool on);
+extern u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint chan);
+extern void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on);

-extern void wlc_phy_stf_chain_upd_nphy(phy_info_t *pi);
+extern void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi);

-extern void wlc_phy_force_rfseq_nphy(phy_info_t *pi, u8 cmd);
-extern s16 wlc_phy_tempsense_nphy(phy_info_t *pi);
+extern void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd);
+extern s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi);

-extern u16 wlc_phy_classifier_nphy(phy_info_t *pi, u16 mask, u16 val);
+extern u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val);

-extern void wlc_phy_rx_iq_est_nphy(phy_info_t *pi, struct phy_iq_est *est,
+extern void wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est,
u16 num_samps, u8 wait_time,
u8 wait_for_crs);

-extern void wlc_phy_rx_iq_coeffs_nphy(phy_info_t *pi, u8 write,
+extern void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
struct nphy_iq_comp *comp);
-extern void wlc_phy_aci_and_noise_reduction_nphy(phy_info_t *pi);
+extern void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi);

extern void wlc_phy_rxcore_setstate_nphy(wlc_phy_t *pih, u8 rxcore_bitmask);
extern u8 wlc_phy_rxcore_getstate_nphy(wlc_phy_t *pih);

-extern void wlc_phy_txpwrctrl_enable_nphy(phy_info_t *pi, u8 ctrl_type);
-extern void wlc_phy_txpwr_fixpower_nphy(phy_info_t *pi);
-extern void wlc_phy_txpwr_apply_nphy(phy_info_t *pi);
-extern void wlc_phy_txpwr_papd_cal_nphy(phy_info_t *pi);
-extern u16 wlc_phy_txpwr_idx_get_nphy(phy_info_t *pi);
+extern void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type);
+extern void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi);
+extern void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi);
+extern void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi);
+extern u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi);

-extern struct nphy_txgains wlc_phy_get_tx_gain_nphy(phy_info_t *pi);
-extern int wlc_phy_cal_txiqlo_nphy(phy_info_t *pi,
+extern struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi);
+extern int wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi,
struct nphy_txgains target_gain,
bool full, bool m);
-extern int wlc_phy_cal_rxiq_nphy(phy_info_t *pi,
+extern int wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi,
struct nphy_txgains target_gain,
u8 type, bool d);
-extern void wlc_phy_txpwr_index_nphy(phy_info_t *pi, u8 core_mask,
+extern void wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask,
s8 txpwrindex, bool res);
-extern void wlc_phy_rssisel_nphy(phy_info_t *pi, u8 core, u8 rssi_type);
-extern int wlc_phy_poll_rssi_nphy(phy_info_t *pi, u8 rssi_type,
+extern void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core, u8 rssi_type);
+extern int wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type,
s32 *rssi_buf, u8 nsamps);
-extern void wlc_phy_rssi_cal_nphy(phy_info_t *pi);
-extern int wlc_phy_aci_scan_nphy(phy_info_t *pi);
-extern void wlc_phy_cal_txgainctrl_nphy(phy_info_t *pi, s32 dBm_targetpower,
- bool debug);
-extern int wlc_phy_tx_tone_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
+extern void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi);
+extern int wlc_phy_aci_scan_nphy(struct brcms_phy *pi);
+extern void wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi,
+ s32 dBm_targetpower, bool debug);
+extern int wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val,
u8 mode, u8, bool);
-extern void wlc_phy_stopplayback_nphy(phy_info_t *pi);
-extern void wlc_phy_est_tonepwr_nphy(phy_info_t *pi, s32 *qdBm_pwrbuf,
+extern void wlc_phy_stopplayback_nphy(struct brcms_phy *pi);
+extern void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
u8 num_samps);
-extern void wlc_phy_radio205x_vcocal_nphy(phy_info_t *pi);
+extern void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);

-extern int wlc_phy_rssi_compute_nphy(phy_info_t *pi,
+extern int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi,
struct brcms_d11rxhdr *wlc_rxh);

#define NPHY_TESTPATTERN_BPHY_EVM 0
#define NPHY_TESTPATTERN_BPHY_RFCS 1

-extern void wlc_phy_nphy_tkip_rifs_war(phy_info_t *pi, u8 rifs);
+extern void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs);

-void wlc_phy_get_pwrdet_offsets(phy_info_t *pi, s8 *cckoffset,
+void wlc_phy_get_pwrdet_offsets(struct brcms_phy *pi, s8 *cckoffset,
s8 *ofdmoffset);
-extern s8 wlc_phy_upd_rssi_offset(phy_info_t *pi, s8 rssi,
+extern s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi,
chanspec_t chanspec);

-extern bool wlc_phy_n_txpower_ipa_ison(phy_info_t *pih);
+extern bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih);
#endif /* _BRCM_PHY_INT_H_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index 47a0a1a..0c9ceb7 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -967,76 +967,79 @@ u16 LCNPHY_txdigfiltcoeffs_ofdm[LCNPHY_NUM_TX_DIG_FILTERS_OFDM]

static u32 wlc_lcnphy_qdiv_roundup(u32 divident, u32 divisor,
u8 precision);
-static void wlc_lcnphy_set_rx_gain_by_distribution(phy_info_t *pi,
+static void wlc_lcnphy_set_rx_gain_by_distribution(struct brcms_phy *pi,
u16 ext_lna, u16 trsw,
u16 biq2, u16 biq1,
u16 tia, u16 lna2,
u16 lna1);
-static void wlc_lcnphy_clear_tx_power_offsets(phy_info_t *pi);
-static void wlc_lcnphy_set_pa_gain(phy_info_t *pi, u16 gain);
-static void wlc_lcnphy_set_trsw_override(phy_info_t *pi, bool tx, bool rx);
-static void wlc_lcnphy_set_bbmult(phy_info_t *pi, u8 m0);
-static u8 wlc_lcnphy_get_bbmult(phy_info_t *pi);
-static void wlc_lcnphy_get_tx_gain(phy_info_t *pi,
+static void wlc_lcnphy_clear_tx_power_offsets(struct brcms_phy *pi);
+static void wlc_lcnphy_set_pa_gain(struct brcms_phy *pi, u16 gain);
+static void wlc_lcnphy_set_trsw_override(struct brcms_phy *pi, bool tx,
+ bool rx);
+static void wlc_lcnphy_set_bbmult(struct brcms_phy *pi, u8 m0);
+static u8 wlc_lcnphy_get_bbmult(struct brcms_phy *pi);
+static void wlc_lcnphy_get_tx_gain(struct brcms_phy *pi,
struct lcnphy_txgains *gains);
-static void wlc_lcnphy_set_tx_gain_override(phy_info_t *pi, bool bEnable);
-static void wlc_lcnphy_toggle_afe_pwdn(phy_info_t *pi);
-static void wlc_lcnphy_rx_gain_override_enable(phy_info_t *pi, bool enable);
-static void wlc_lcnphy_set_tx_gain(phy_info_t *pi,
+static void wlc_lcnphy_set_tx_gain_override(struct brcms_phy *pi, bool bEnable);
+static void wlc_lcnphy_toggle_afe_pwdn(struct brcms_phy *pi);
+static void wlc_lcnphy_rx_gain_override_enable(struct brcms_phy *pi,
+ bool enable);
+static void wlc_lcnphy_set_tx_gain(struct brcms_phy *pi,
struct lcnphy_txgains *target_gains);
-static bool wlc_lcnphy_rx_iq_est(phy_info_t *pi, u16 num_samps,
+static bool wlc_lcnphy_rx_iq_est(struct brcms_phy *pi, u16 num_samps,
u8 wait_time, struct lcnphy_iq_est *iq_est);
-static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps);
-static u16 wlc_lcnphy_get_pa_gain(phy_info_t *pi);
-static void wlc_lcnphy_afe_clk_init(phy_info_t *pi, u8 mode);
+static bool wlc_lcnphy_calc_rx_iq_comp(struct brcms_phy *pi, u16 num_samps);
+static u16 wlc_lcnphy_get_pa_gain(struct brcms_phy *pi);
+static void wlc_lcnphy_afe_clk_init(struct brcms_phy *pi, u8 mode);
extern void wlc_lcnphy_tx_pwr_ctrl_init(wlc_phy_t *ppi);
-static void wlc_lcnphy_radio_2064_channel_tune_4313(phy_info_t *pi,
+static void wlc_lcnphy_radio_2064_channel_tune_4313(struct brcms_phy *pi,
u8 channel);

-static void wlc_lcnphy_load_tx_gain_table(phy_info_t *pi,
+static void wlc_lcnphy_load_tx_gain_table(struct brcms_phy *pi,
const struct lcnphy_tx_gain_tbl_entry *g);

-static void wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo,
+static void wlc_lcnphy_samp_cap(struct brcms_phy *pi, int clip_detect_algo,
u16 thresh, s16 *ptr, int mode);
static int wlc_lcnphy_calc_floor(s16 coeff, int type);
-static void wlc_lcnphy_tx_iqlo_loopback(phy_info_t *pi,
+static void wlc_lcnphy_tx_iqlo_loopback(struct brcms_phy *pi,
u16 *values_to_save);
-static void wlc_lcnphy_tx_iqlo_loopback_cleanup(phy_info_t *pi,
+static void wlc_lcnphy_tx_iqlo_loopback_cleanup(struct brcms_phy *pi,
u16 *values_to_save);
-static void wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, s16 coeff_x,
+static void wlc_lcnphy_set_cc(struct brcms_phy *pi, int cal_type, s16 coeff_x,
s16 coeff_y);
-static struct lcnphy_unsign16_struct wlc_lcnphy_get_cc(phy_info_t *pi,
+static struct lcnphy_unsign16_struct wlc_lcnphy_get_cc(struct brcms_phy *pi,
int cal_type);
-static void wlc_lcnphy_a1(phy_info_t *pi, int cal_type,
+static void wlc_lcnphy_a1(struct brcms_phy *pi, int cal_type,
int num_levels, int step_size_lg2);
-static void wlc_lcnphy_tx_iqlo_soft_cal_full(phy_info_t *pi);
+static void wlc_lcnphy_tx_iqlo_soft_cal_full(struct brcms_phy *pi);

-static void wlc_lcnphy_set_chanspec_tweaks(phy_info_t *pi,
+static void wlc_lcnphy_set_chanspec_tweaks(struct brcms_phy *pi,
chanspec_t chanspec);
-static void wlc_lcnphy_agc_temp_init(phy_info_t *pi);
-static void wlc_lcnphy_temp_adj(phy_info_t *pi);
-static void wlc_lcnphy_clear_papd_comptable(phy_info_t *pi);
-static void wlc_lcnphy_baseband_init(phy_info_t *pi);
-static void wlc_lcnphy_radio_init(phy_info_t *pi);
-static void wlc_lcnphy_rc_cal(phy_info_t *pi);
-static void wlc_lcnphy_rcal(phy_info_t *pi);
-static void wlc_lcnphy_txrx_spur_avoidance_mode(phy_info_t *pi, bool enable);
-static int wlc_lcnphy_load_tx_iir_filter(phy_info_t *pi, bool is_ofdm,
+static void wlc_lcnphy_agc_temp_init(struct brcms_phy *pi);
+static void wlc_lcnphy_temp_adj(struct brcms_phy *pi);
+static void wlc_lcnphy_clear_papd_comptable(struct brcms_phy *pi);
+static void wlc_lcnphy_baseband_init(struct brcms_phy *pi);
+static void wlc_lcnphy_radio_init(struct brcms_phy *pi);
+static void wlc_lcnphy_rc_cal(struct brcms_phy *pi);
+static void wlc_lcnphy_rcal(struct brcms_phy *pi);
+static void wlc_lcnphy_txrx_spur_avoidance_mode(struct brcms_phy *pi,
+ bool enable);
+static int wlc_lcnphy_load_tx_iir_filter(struct brcms_phy *pi, bool is_ofdm,
s16 filt_type);
-static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, u16 a, u16 b);
+static void wlc_lcnphy_set_rx_iq_comp(struct brcms_phy *pi, u16 a, u16 b);

-void wlc_lcnphy_write_table(phy_info_t *pi, const struct phytbl_info *pti)
+void wlc_lcnphy_write_table(struct brcms_phy *pi, const struct phytbl_info *pti)
{
wlc_phy_write_table(pi, pti, 0x455, 0x457, 0x456);
}

-void wlc_lcnphy_read_table(phy_info_t *pi, struct phytbl_info *pti)
+void wlc_lcnphy_read_table(struct brcms_phy *pi, struct phytbl_info *pti)
{
wlc_phy_read_table(pi, pti, 0x455, 0x457, 0x456);
}

static void
-wlc_lcnphy_common_read_table(phy_info_t *pi, u32 tbl_id,
+wlc_lcnphy_common_read_table(struct brcms_phy *pi, u32 tbl_id,
const void *tbl_ptr, u32 tbl_len,
u32 tbl_width, u32 tbl_offset)
{
@@ -1050,7 +1053,7 @@ wlc_lcnphy_common_read_table(phy_info_t *pi, u32 tbl_id,
}

static void
-wlc_lcnphy_common_write_table(phy_info_t *pi, u32 tbl_id,
+wlc_lcnphy_common_write_table(struct brcms_phy *pi, u32 tbl_id,
const void *tbl_ptr, u32 tbl_len,
u32 tbl_width, u32 tbl_offset)
{
@@ -1110,10 +1113,10 @@ static int wlc_lcnphy_calc_floor(s16 coeff_x, int type)
return k;
}

-s8 wlc_lcnphy_get_current_tx_pwr_idx(phy_info_t *pi)
+s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi)
{
s8 index;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (txpwrctrl_off(pi))
index = pi_lcn->lcnphy_current_index;
@@ -1126,7 +1129,7 @@ s8 wlc_lcnphy_get_current_tx_pwr_idx(phy_info_t *pi)
return index;
}

-static u32 wlc_lcnphy_measure_digital_power(phy_info_t *pi, u16 nsamples)
+static u32 wlc_lcnphy_measure_digital_power(struct brcms_phy *pi, u16 nsamples)
{
struct lcnphy_iq_est iq_est = { 0, 0, 0 };

@@ -1135,7 +1138,7 @@ static u32 wlc_lcnphy_measure_digital_power(phy_info_t *pi, u16 nsamples)
return (iq_est.i_pwr + iq_est.q_pwr) / nsamples;
}

-void wlc_lcnphy_crsuprs(phy_info_t *pi, int channel)
+void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel)
{
u16 afectrlovr, afectrlovrval;
afectrlovr = read_phy_reg(pi, 0x43b);
@@ -1166,7 +1169,7 @@ void wlc_lcnphy_crsuprs(phy_info_t *pi, int channel)
}
}

-static void wlc_lcnphy_toggle_afe_pwdn(phy_info_t *pi)
+static void wlc_lcnphy_toggle_afe_pwdn(struct brcms_phy *pi)
{
u16 save_AfeCtrlOvrVal, save_AfeCtrlOvr;

@@ -1183,7 +1186,8 @@ static void wlc_lcnphy_toggle_afe_pwdn(phy_info_t *pi)
write_phy_reg(pi, 0x43b, save_AfeCtrlOvr);
}

-static void wlc_lcnphy_txrx_spur_avoidance_mode(phy_info_t *pi, bool enable)
+static void
+wlc_lcnphy_txrx_spur_avoidance_mode(struct brcms_phy *pi, bool enable)
{
if (enable) {
write_phy_reg(pi, 0x942, 0x7);
@@ -1202,7 +1206,7 @@ static void wlc_lcnphy_txrx_spur_avoidance_mode(phy_info_t *pi, bool enable)
wlapi_switch_macfreq(pi->sh->physhim, enable);
}

-void wlc_phy_chanspec_set_lcnphy(phy_info_t *pi, chanspec_t chanspec)
+void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi, chanspec_t chanspec)
{
u8 channel = CHSPEC_CHANNEL(chanspec);

@@ -1239,7 +1243,7 @@ void wlc_phy_chanspec_set_lcnphy(phy_info_t *pi, chanspec_t chanspec)

}

-static void wlc_lcnphy_set_dac_gain(phy_info_t *pi, u16 dac_gain)
+static void wlc_lcnphy_set_dac_gain(struct brcms_phy *pi, u16 dac_gain)
{
u16 dac_ctrl;

@@ -1250,7 +1254,7 @@ static void wlc_lcnphy_set_dac_gain(phy_info_t *pi, u16 dac_gain)

}

-static void wlc_lcnphy_set_tx_gain_override(phy_info_t *pi, bool bEnable)
+static void wlc_lcnphy_set_tx_gain_override(struct brcms_phy *pi, bool bEnable)
{
u16 bit = bEnable ? 1 : 0;

@@ -1261,7 +1265,7 @@ static void wlc_lcnphy_set_tx_gain_override(phy_info_t *pi, bool bEnable)
mod_phy_reg(pi, 0x43b, (0x1 << 6), bit << 6);
}

-static u16 wlc_lcnphy_get_pa_gain(phy_info_t *pi)
+static u16 wlc_lcnphy_get_pa_gain(struct brcms_phy *pi)
{
u16 pa_gain;

@@ -1272,8 +1276,8 @@ static u16 wlc_lcnphy_get_pa_gain(phy_info_t *pi)
return pa_gain;
}

-static void
-wlc_lcnphy_set_tx_gain(phy_info_t *pi, struct lcnphy_txgains *target_gains)
+static void wlc_lcnphy_set_tx_gain(struct brcms_phy *pi,
+ struct lcnphy_txgains *target_gains)
{
u16 pa_gain = wlc_lcnphy_get_pa_gain(pi);

@@ -1298,7 +1302,7 @@ wlc_lcnphy_set_tx_gain(phy_info_t *pi, struct lcnphy_txgains *target_gains)
wlc_lcnphy_enable_tx_gain_override(pi);
}

-static void wlc_lcnphy_set_bbmult(phy_info_t *pi, u8 m0)
+static void wlc_lcnphy_set_bbmult(struct brcms_phy *pi, u8 m0)
{
u16 m0m1 = (u16) m0 << 8;
struct phytbl_info tab;
@@ -1311,7 +1315,7 @@ static void wlc_lcnphy_set_bbmult(phy_info_t *pi, u8 m0)
wlc_lcnphy_write_table(pi, &tab);
}

-static void wlc_lcnphy_clear_tx_power_offsets(phy_info_t *pi)
+static void wlc_lcnphy_clear_tx_power_offsets(struct brcms_phy *pi)
{
u32 data_buf[64];
struct phytbl_info tab;
@@ -1340,7 +1344,8 @@ enum lcnphy_tssi_mode {
LCNPHY_TSSI_EXT
};

-static void wlc_lcnphy_set_tssi_mux(phy_info_t *pi, enum lcnphy_tssi_mode pos)
+static void
+wlc_lcnphy_set_tssi_mux(struct brcms_phy *pi, enum lcnphy_tssi_mode pos)
{
mod_phy_reg(pi, 0x4d7, (0x1 << 0), (0x1) << 0);

@@ -1379,7 +1384,7 @@ static void wlc_lcnphy_set_tssi_mux(phy_info_t *pi, enum lcnphy_tssi_mode pos)
}
}

-static u16 wlc_lcnphy_rfseq_tbl_adc_pwrup(phy_info_t *pi)
+static u16 wlc_lcnphy_rfseq_tbl_adc_pwrup(struct brcms_phy *pi)
{
u16 N1, N2, N3, N4, N5, N6, N;
N1 = ((read_phy_reg(pi, 0x4a5) & (0xff << 0))
@@ -1400,10 +1405,10 @@ static u16 wlc_lcnphy_rfseq_tbl_adc_pwrup(phy_info_t *pi)
return N;
}

-static void wlc_lcnphy_pwrctrl_rssiparams(phy_info_t *pi)
+static void wlc_lcnphy_pwrctrl_rssiparams(struct brcms_phy *pi)
{
u16 auxpga_vmid, auxpga_vmid_temp, auxpga_gain_temp;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

auxpga_vmid =
(2 << 8) | (pi_lcn->lcnphy_rssi_vc << 4) | pi_lcn->lcnphy_rssi_vf;
@@ -1444,7 +1449,7 @@ static void wlc_lcnphy_pwrctrl_rssiparams(phy_info_t *pi)
mod_radio_reg(pi, RADIO_2064_REG082, (1 << 5), (1 << 5));
}

-static void wlc_lcnphy_tssi_setup(phy_info_t *pi)
+static void wlc_lcnphy_tssi_setup(struct brcms_phy *pi)
{
struct phytbl_info tab;
u32 rfseq, ind;
@@ -1558,10 +1563,10 @@ static void wlc_lcnphy_tssi_setup(phy_info_t *pi)
wlc_lcnphy_pwrctrl_rssiparams(pi);
}

-void wlc_lcnphy_tx_pwr_update_npt(phy_info_t *pi)
+void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi)
{
u16 tx_cnt, tx_total, npt;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

tx_total = wlc_lcnphy_total_tx_frames(pi);
tx_cnt = tx_total - pi_lcn->lcnphy_tssi_tx_cnt;
@@ -1588,9 +1593,9 @@ s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1)
return p;
}

-static void wlc_lcnphy_txpower_reset_npt(phy_info_t *pi)
+static void wlc_lcnphy_txpower_reset_npt(struct brcms_phy *pi)
{
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi))
return;

@@ -1598,7 +1603,7 @@ static void wlc_lcnphy_txpower_reset_npt(phy_info_t *pi)
pi_lcn->lcnphy_tssi_npt = LCNPHY_TX_PWR_CTRL_START_NPT;
}

-void wlc_lcnphy_txpower_recalc_target(phy_info_t *pi)
+void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi)
{
struct phytbl_info tab;
u32 rate_table[WLC_NUM_RATES_CCK + WLC_NUM_RATES_OFDM +
@@ -1629,7 +1634,7 @@ void wlc_lcnphy_txpower_recalc_target(phy_info_t *pi)
}
}

-static void wlc_lcnphy_set_tx_pwr_soft_ctrl(phy_info_t *pi, s8 index)
+static void wlc_lcnphy_set_tx_pwr_soft_ctrl(struct brcms_phy *pi, s8 index)
{
u32 cck_offset[4] = { 22, 22, 22, 22 };
u32 ofdm_offset, reg_offset_cck;
@@ -1682,13 +1687,13 @@ static void wlc_lcnphy_set_tx_pwr_soft_ctrl(phy_info_t *pi, s8 index)

}

-static s8 wlc_lcnphy_tempcompensated_txpwrctrl(phy_info_t *pi)
+static s8 wlc_lcnphy_tempcompensated_txpwrctrl(struct brcms_phy *pi)
{
s8 index, delta_brd, delta_temp, new_index, tempcorrx;
s16 manp, meas_temp, temp_diff;
bool neg = 0;
u16 temp;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi))
return pi_lcn->lcnphy_current_index;
@@ -1747,7 +1752,7 @@ static s8 wlc_lcnphy_tempcompensated_txpwrctrl(phy_info_t *pi)
return new_index;
}

-static u16 wlc_lcnphy_set_tx_pwr_ctrl_mode(phy_info_t *pi, u16 mode)
+static u16 wlc_lcnphy_set_tx_pwr_ctrl_mode(struct brcms_phy *pi, u16 mode)
{

u16 current_mode = mode;
@@ -1760,11 +1765,11 @@ static u16 wlc_lcnphy_set_tx_pwr_ctrl_mode(phy_info_t *pi, u16 mode)
return current_mode;
}

-void wlc_lcnphy_set_tx_pwr_ctrl(phy_info_t *pi, u16 mode)
+void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode)
{
u16 old_mode = wlc_lcnphy_get_tx_pwr_ctrl(pi);
s8 index;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

mode = wlc_lcnphy_set_tx_pwr_ctrl_mode(pi, mode);
old_mode = wlc_lcnphy_set_tx_pwr_ctrl_mode(pi, old_mode);
@@ -1811,7 +1816,7 @@ void wlc_lcnphy_set_tx_pwr_ctrl(phy_info_t *pi, u16 mode)
}
}

-static bool wlc_lcnphy_iqcal_wait(phy_info_t *pi)
+static bool wlc_lcnphy_iqcal_wait(struct brcms_phy *pi)
{
uint delay_count = 0;

@@ -1827,7 +1832,7 @@ static bool wlc_lcnphy_iqcal_wait(phy_info_t *pi)
}

static void
-wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
+wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi,
struct lcnphy_txgains *target_gains,
enum lcnphy_cal_mode cal_mode, bool keep_tone)
{
@@ -1861,7 +1866,7 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
struct lcnphy_txgains old_gains;
uint i, n_cal_cmds = 0, n_cal_start = 0;
u16 *values_to_save;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return;
@@ -2066,7 +2071,7 @@ static void wlc_lcnphy_idle_tssi_est(wlc_phy_t *ppi)
{
bool suspend, tx_gain_override_old;
struct lcnphy_txgains old_gains;
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
u16 idleTssi, idleTssi0_2C, idleTssi0_OB, idleTssi0_regvalue_OB,
idleTssi0_regvalue_2C;
u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
@@ -2078,7 +2083,7 @@ static void wlc_lcnphy_idle_tssi_est(wlc_phy_t *ppi)
idleTssi = read_phy_reg(pi, 0x4ab);
suspend =
(0 ==
- (R_REG(&((phy_info_t *) pi)->regs->maccontrol) &
+ (R_REG(&((struct brcms_phy *) pi)->regs->maccontrol) &
MCTL_EN_MAC));
if (!suspend)
wlapi_suspend_mac_and_wait(pi->sh->physhim);
@@ -2128,7 +2133,7 @@ static void wlc_lcnphy_idle_tssi_est(wlc_phy_t *ppi)
wlapi_enable_mac(pi->sh->physhim);
}

-static void wlc_lcnphy_vbat_temp_sense_setup(phy_info_t *pi, u8 mode)
+static void wlc_lcnphy_vbat_temp_sense_setup(struct brcms_phy *pi, u8 mode)
{
bool suspend;
u16 save_txpwrCtrlEn;
@@ -2141,7 +2146,7 @@ static void wlc_lcnphy_vbat_temp_sense_setup(phy_info_t *pi, u8 mode)
u16 values_to_save[14];
s8 index;
int i;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
udelay(999);

save_reg007 = (u8) read_radio_reg(pi, RADIO_2064_REG007);
@@ -2278,7 +2283,7 @@ void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (wlc_phy_t *ppi)
s32 a1, b0, b1;
s32 tssi, pwr, maxtargetpwr, mintargetpwr;
bool suspend;
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;

suspend =
(0 == (R_REG(&pi->regs->maccontrol) & MCTL_EN_MAC));
@@ -2348,7 +2353,7 @@ void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (wlc_phy_t *ppi)
wlapi_enable_mac(pi->sh->physhim);
}

-static u8 wlc_lcnphy_get_bbmult(phy_info_t *pi)
+static u8 wlc_lcnphy_get_bbmult(struct brcms_phy *pi)
{
u16 m0m1;
struct phytbl_info tab;
@@ -2363,7 +2368,7 @@ static u8 wlc_lcnphy_get_bbmult(phy_info_t *pi)
return (u8) ((m0m1 & 0xff00) >> 8);
}

-static void wlc_lcnphy_set_pa_gain(phy_info_t *pi, u16 gain)
+static void wlc_lcnphy_set_pa_gain(struct brcms_phy *pi, u16 gain)
{
mod_phy_reg(pi, 0x4fb,
LCNPHY_txgainctrlovrval1_pagain_ovr_val1_MASK,
@@ -2374,7 +2379,7 @@ static void wlc_lcnphy_set_pa_gain(phy_info_t *pi, u16 gain)
}

void
-wlc_lcnphy_get_radio_loft(phy_info_t *pi,
+wlc_lcnphy_get_radio_loft(struct brcms_phy *pi,
u8 *ei0, u8 *eq0, u8 *fi0, u8 *fq0)
{
*ei0 = LCNPHY_IQLOCC_READ(read_radio_reg(pi, RADIO_2064_REG089));
@@ -2383,7 +2388,8 @@ wlc_lcnphy_get_radio_loft(phy_info_t *pi,
*fq0 = LCNPHY_IQLOCC_READ(read_radio_reg(pi, RADIO_2064_REG08C));
}

-static void wlc_lcnphy_get_tx_gain(phy_info_t *pi, struct lcnphy_txgains *gains)
+static void
+wlc_lcnphy_get_tx_gain(struct brcms_phy *pi, struct lcnphy_txgains *gains)
{
u16 dac_gain;

@@ -2402,7 +2408,7 @@ static void wlc_lcnphy_get_tx_gain(phy_info_t *pi, struct lcnphy_txgains *gains)
}
}

-void wlc_lcnphy_set_tx_iqcc(phy_info_t *pi, u16 a, u16 b)
+void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b)
{
struct phytbl_info tab;
u16 iqcc[2];
@@ -2418,7 +2424,7 @@ void wlc_lcnphy_set_tx_iqcc(phy_info_t *pi, u16 a, u16 b)
wlc_lcnphy_write_table(pi, &tab);
}

-void wlc_lcnphy_set_tx_locc(phy_info_t *pi, u16 didq)
+void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq)
{
struct phytbl_info tab;

@@ -2430,14 +2436,14 @@ void wlc_lcnphy_set_tx_locc(phy_info_t *pi, u16 didq)
wlc_lcnphy_write_table(pi, &tab);
}

-void wlc_lcnphy_set_tx_pwr_by_index(phy_info_t *pi, int index)
+void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index)
{
struct phytbl_info tab;
u16 a, b;
u8 bb_mult;
u32 bbmultiqcomp, txgain, locoeffs, rfpower;
struct lcnphy_txgains gains;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

pi_lcn->lcnphy_tx_power_idx_override = (s8) index;
pi_lcn->lcnphy_current_index = (u8) index;
@@ -2489,7 +2495,7 @@ void wlc_lcnphy_set_tx_pwr_by_index(phy_info_t *pi, int index)
}
}

-static void wlc_lcnphy_set_trsw_override(phy_info_t *pi, bool tx, bool rx)
+static void wlc_lcnphy_set_trsw_override(struct brcms_phy *pi, bool tx, bool rx)
{

mod_phy_reg(pi, 0x44d,
@@ -2499,7 +2505,7 @@ static void wlc_lcnphy_set_trsw_override(phy_info_t *pi, bool tx, bool rx)
or_phy_reg(pi, 0x44c, (0x1 << 1) | (0x1 << 0));
}

-static void wlc_lcnphy_clear_papd_comptable(phy_info_t *pi)
+static void wlc_lcnphy_clear_papd_comptable(struct brcms_phy *pi)
{
u32 j;
struct phytbl_info tab;
@@ -2519,7 +2525,7 @@ static void wlc_lcnphy_clear_papd_comptable(phy_info_t *pi)
}

static void
-wlc_lcnphy_set_rx_gain_by_distribution(phy_info_t *pi,
+wlc_lcnphy_set_rx_gain_by_distribution(struct brcms_phy *pi,
u16 trsw,
u16 ext_lna,
u16 biq2,
@@ -2553,7 +2559,8 @@ wlc_lcnphy_set_rx_gain_by_distribution(phy_info_t *pi,

}

-static void wlc_lcnphy_rx_gain_override_enable(phy_info_t *pi, bool enable)
+static void
+wlc_lcnphy_rx_gain_override_enable(struct brcms_phy *pi, bool enable)
{
u16 ebit = enable ? 1 : 0;

@@ -2578,7 +2585,7 @@ static void wlc_lcnphy_rx_gain_override_enable(phy_info_t *pi, bool enable)
}
}

-void wlc_lcnphy_tx_pu(phy_info_t *pi, bool bEnable)
+void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable)
{
if (!bEnable) {

@@ -2656,7 +2663,7 @@ void wlc_lcnphy_tx_pu(phy_info_t *pi, bool bEnable)
}

static void
-wlc_lcnphy_run_samples(phy_info_t *pi,
+wlc_lcnphy_run_samples(struct brcms_phy *pi,
u16 num_samps,
u16 num_loops, u16 wait, bool iqcalmode)
{
@@ -2682,7 +2689,7 @@ wlc_lcnphy_run_samples(phy_info_t *pi,
or_radio_reg(pi, RADIO_2064_REG112, 0x6);
}

-void wlc_lcnphy_deaf_mode(phy_info_t *pi, bool mode)
+void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode)
{

u8 phybw40;
@@ -2707,7 +2714,7 @@ void wlc_lcnphy_deaf_mode(phy_info_t *pi, bool mode)
}

void
-wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz, u16 max_val,
+wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz, u16 max_val,
bool iqcalmode)
{
u8 phy_bw;
@@ -2718,7 +2725,7 @@ wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz, u16 max_val,
u32 data_buf[64];
u16 i_samp, q_samp;
struct phytbl_info tab;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

pi->phy_tx_tone_freq = f_kHz;

@@ -2770,10 +2777,10 @@ wlc_lcnphy_start_tx_tone(phy_info_t *pi, s32 f_kHz, u16 max_val,
wlc_lcnphy_run_samples(pi, num_samps, 0xffff, 0, iqcalmode);
}

-void wlc_lcnphy_stop_tx_tone(phy_info_t *pi)
+void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi)
{
s16 playback_status;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

pi->phy_tx_tone_freq = 0;
if (pi_lcn->lcnphy_spurmod) {
@@ -2801,13 +2808,13 @@ void wlc_lcnphy_stop_tx_tone(phy_info_t *pi)
wlc_lcnphy_deaf_mode(pi, false);
}

-static void wlc_lcnphy_clear_trsw_override(phy_info_t *pi)
+static void wlc_lcnphy_clear_trsw_override(struct brcms_phy *pi)
{

and_phy_reg(pi, 0x44c, (u16) ~((0x1 << 1) | (0x1 << 0)));
}

-void wlc_lcnphy_get_tx_iqcc(phy_info_t *pi, u16 *a, u16 *b)
+void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b)
{
u16 iqcc[2];
struct phytbl_info tab;
@@ -2823,7 +2830,7 @@ void wlc_lcnphy_get_tx_iqcc(phy_info_t *pi, u16 *a, u16 *b)
*b = iqcc[1];
}

-u16 wlc_lcnphy_get_tx_locc(phy_info_t *pi)
+u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi)
{
struct phytbl_info tab;
u16 didq;
@@ -2838,7 +2845,7 @@ u16 wlc_lcnphy_get_tx_locc(phy_info_t *pi)
return didq;
}

-static void wlc_lcnphy_txpwrtbl_iqlo_cal(phy_info_t *pi)
+static void wlc_lcnphy_txpwrtbl_iqlo_cal(struct brcms_phy *pi)
{

struct lcnphy_txgains target_gains, old_gains;
@@ -2849,7 +2856,7 @@ static void wlc_lcnphy_txpwrtbl_iqlo_cal(phy_info_t *pi)
u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
struct phytbl_info tab;
u8 ei0, eq0, fi0, fq0;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

wlc_lcnphy_get_tx_gain(pi, &old_gains);
save_pa_gain = wlc_lcnphy_get_pa_gain(pi);
@@ -2952,7 +2959,7 @@ static void wlc_lcnphy_txpwrtbl_iqlo_cal(phy_info_t *pi)
wlc_lcnphy_set_tx_pwr_by_index(pi, SAVE_txpwrindex);
}

-s16 wlc_lcnphy_tempsense_new(phy_info_t *pi, bool mode)
+s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode)
{
u16 tempsenseval1, tempsenseval2;
s16 avg = 0;
@@ -2997,13 +3004,13 @@ s16 wlc_lcnphy_tempsense_new(phy_info_t *pi, bool mode)
return avg;
}

-u16 wlc_lcnphy_tempsense(phy_info_t *pi, bool mode)
+u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode)
{
u16 tempsenseval1, tempsenseval2;
s32 avg = 0;
bool suspend = 0;
u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return -1;
@@ -3058,7 +3065,7 @@ u16 wlc_lcnphy_tempsense(phy_info_t *pi, bool mode)
return (u16) avg;
}

-s8 wlc_lcnphy_tempsense_degree(phy_info_t *pi, bool mode)
+s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode)
{
s32 degree = wlc_lcnphy_tempsense_new(pi, mode);
degree =
@@ -3067,7 +3074,7 @@ s8 wlc_lcnphy_tempsense_degree(phy_info_t *pi, bool mode)
return (s8) degree;
}

-s8 wlc_lcnphy_vbatsense(phy_info_t *pi, bool mode)
+s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode)
{
u16 vbatsenseval;
s32 avg = 0;
@@ -3103,7 +3110,7 @@ s8 wlc_lcnphy_vbatsense(phy_info_t *pi, bool mode)
return (s8) avg;
}

-static void wlc_lcnphy_afe_clk_init(phy_info_t *pi, u8 mode)
+static void wlc_lcnphy_afe_clk_init(struct brcms_phy *pi, u8 mode)
{
u8 phybw40;
phybw40 = CHSPEC_IS40(pi->radio_chanspec);
@@ -3118,7 +3125,7 @@ static void wlc_lcnphy_afe_clk_init(phy_info_t *pi, u8 mode)
}

static bool
-wlc_lcnphy_rx_iq_est(phy_info_t *pi,
+wlc_lcnphy_rx_iq_est(struct brcms_phy *pi,
u16 num_samps,
u8 wait_time, struct lcnphy_iq_est *iq_est)
{
@@ -3164,7 +3171,7 @@ wlc_lcnphy_rx_iq_est(phy_info_t *pi,
return result;
}

-static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
+static bool wlc_lcnphy_calc_rx_iq_comp(struct brcms_phy *pi, u16 num_samps)
{
#define LCNPHY_MIN_RXIQ_PWR 2
bool result;
@@ -3174,7 +3181,7 @@ static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
s16 iq_nbits, qq_nbits, arsh, brsh;
s32 iq;
u32 ii, qq;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

a0_new = ((read_phy_reg(pi, 0x645) & (0x3ff << 0)) >> 0);
b0_new = ((read_phy_reg(pi, 0x646) & (0x3ff << 0)) >> 0);
@@ -3250,7 +3257,8 @@ static bool wlc_lcnphy_calc_rx_iq_comp(phy_info_t *pi, u16 num_samps)
}

static bool
-wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const struct lcnphy_rx_iqcomp *iqcomp,
+wlc_lcnphy_rx_iq_cal(struct brcms_phy *pi,
+ const struct lcnphy_rx_iqcomp *iqcomp,
int iqcomp_sz, bool tx_switch, bool rx_switch, int module,
int tx_gain_idx)
{
@@ -3267,7 +3275,7 @@ wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const struct lcnphy_rx_iqcomp *iqcomp,
u16 old_sslpnCalibClkEnCtrl, old_sslpnRxFeClkEnCtrl;
u16 values_to_save[11];
s16 *ptr;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

ptr = kmalloc(sizeof(s16) * 131, GFP_ATOMIC);
if (NULL == ptr) {
@@ -3418,18 +3426,18 @@ wlc_lcnphy_rx_iq_cal(phy_info_t *pi, const struct lcnphy_rx_iqcomp *iqcomp,
return result;
}

-static void wlc_lcnphy_temp_adj(phy_info_t *pi)
+static void wlc_lcnphy_temp_adj(struct brcms_phy *pi)
{
if (NORADIO_ENAB(pi->pubpi))
return;
}

-static void wlc_lcnphy_glacial_timer_based_cal(phy_info_t *pi)
+static void wlc_lcnphy_glacial_timer_based_cal(struct brcms_phy *pi)
{
bool suspend;
s8 index;
u16 SAVE_pwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
suspend =
(0 == (R_REG(&pi->regs->maccontrol) & MCTL_EN_MAC));
if (!suspend)
@@ -3449,7 +3457,7 @@ static void wlc_lcnphy_glacial_timer_based_cal(phy_info_t *pi)

}

-static void wlc_lcnphy_periodic_cal(phy_info_t *pi)
+static void wlc_lcnphy_periodic_cal(struct brcms_phy *pi)
{
bool suspend, full_cal;
const struct lcnphy_rx_iqcomp *rx_iqcomp;
@@ -3459,7 +3467,7 @@ static void wlc_lcnphy_periodic_cal(phy_info_t *pi)
struct phytbl_info tab;
s32 a1, b0, b1;
s32 tssi, pwr, maxtargetpwr, mintargetpwr;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return;
@@ -3521,11 +3529,11 @@ static void wlc_lcnphy_periodic_cal(phy_info_t *pi)
wlapi_enable_mac(pi->sh->physhim);
}

-void wlc_lcnphy_calib_modes(phy_info_t *pi, uint mode)
+void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode)
{
u16 temp_new;
int temp1, temp2, temp_diff;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

switch (mode) {
case PHY_PERICAL_CHAN:
@@ -3560,7 +3568,7 @@ void wlc_lcnphy_calib_modes(phy_info_t *pi, uint mode)
}
}

-void wlc_lcnphy_get_tssi(phy_info_t *pi, s8 *ofdm_pwr, s8 *cck_pwr)
+void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr, s8 *cck_pwr)
{
s8 cck_offset;
u16 status;
@@ -3582,16 +3590,17 @@ void wlc_lcnphy_get_tssi(phy_info_t *pi, s8 *ofdm_pwr, s8 *cck_pwr)
}
}

-void WLBANDINITFN(wlc_phy_cal_init_lcnphy) (phy_info_t *pi)
+void WLBANDINITFN(wlc_phy_cal_init_lcnphy) (struct brcms_phy *pi)
{
return;

}

-static void wlc_lcnphy_set_chanspec_tweaks(phy_info_t *pi, chanspec_t chanspec)
+static void
+wlc_lcnphy_set_chanspec_tweaks(struct brcms_phy *pi, chanspec_t chanspec)
{
u8 channel = CHSPEC_CHANNEL(chanspec);
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return;
@@ -3644,8 +3653,8 @@ void wlc_lcnphy_tx_power_adjustment(wlc_phy_t *ppi)
{
s8 index;
u16 index2;
- phy_info_t *pi = (phy_info_t *) ppi;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
u16 SAVE_txpwrctrl = wlc_lcnphy_get_tx_pwr_ctrl(pi);
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi) && SAVE_txpwrctrl) {
index = wlc_lcnphy_tempcompensated_txpwrctrl(pi);
@@ -3657,7 +3666,7 @@ void wlc_lcnphy_tx_power_adjustment(wlc_phy_t *ppi)
}
}

-static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, u16 a, u16 b)
+static void wlc_lcnphy_set_rx_iq_comp(struct brcms_phy *pi, u16 a, u16 b)
{
mod_phy_reg(pi, 0x645, (0x3ff << 0), (a) << 0);

@@ -3673,10 +3682,10 @@ static void wlc_lcnphy_set_rx_iq_comp(phy_info_t *pi, u16 a, u16 b)

}

-void WLBANDINITFN(wlc_phy_init_lcnphy) (phy_info_t *pi)
+void WLBANDINITFN(wlc_phy_init_lcnphy) (struct brcms_phy *pi)
{
u8 phybw40;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
phybw40 = CHSPEC_IS40(pi->radio_chanspec);

pi_lcn->lcnphy_cal_counter = 0;
@@ -3723,7 +3732,7 @@ void WLBANDINITFN(wlc_phy_init_lcnphy) (phy_info_t *pi)
}

static void
-wlc_lcnphy_tx_iqlo_loopback(phy_info_t *pi, u16 *values_to_save)
+wlc_lcnphy_tx_iqlo_loopback(struct brcms_phy *pi, u16 *values_to_save)
{
u16 vmid;
int i;
@@ -3816,14 +3825,14 @@ wlc_lcnphy_tx_iqlo_loopback(phy_info_t *pi, u16 *values_to_save)
}

static void
-wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo, u16 thresh,
+wlc_lcnphy_samp_cap(struct brcms_phy *pi, int clip_detect_algo, u16 thresh,
s16 *ptr, int mode)
{
u32 curval1, curval2, stpptr, curptr, strptr, val;
u16 sslpnCalibClkEnCtrl, timer;
u16 old_sslpnCalibClkEnCtrl;
s16 imag, real;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

timer = 0;
old_sslpnCalibClkEnCtrl = read_phy_reg(pi, 0x6da);
@@ -3892,7 +3901,7 @@ wlc_lcnphy_samp_cap(phy_info_t *pi, int clip_detect_algo, u16 thresh,
W_REG(&pi->regs->psm_corectlsts, curval1);
}

-static void wlc_lcnphy_tx_iqlo_soft_cal_full(phy_info_t *pi)
+static void wlc_lcnphy_tx_iqlo_soft_cal_full(struct brcms_phy *pi)
{
struct lcnphy_unsign16_struct iqcc0, locc2, locc3, locc4;

@@ -3915,7 +3924,7 @@ static void wlc_lcnphy_tx_iqlo_soft_cal_full(phy_info_t *pi)
}

static void
-wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, s16 coeff_x, s16 coeff_y)
+wlc_lcnphy_set_cc(struct brcms_phy *pi, int cal_type, s16 coeff_x, s16 coeff_y)
{
u16 di0dq0;
u16 x, y, data_rf;
@@ -3960,7 +3969,7 @@ wlc_lcnphy_set_cc(phy_info_t *pi, int cal_type, s16 coeff_x, s16 coeff_y)
}

static struct lcnphy_unsign16_struct
-wlc_lcnphy_get_cc(phy_info_t *pi, int cal_type)
+wlc_lcnphy_get_cc(struct brcms_phy *pi, int cal_type)
{
u16 a, b, didq;
u8 di0, dq0, ei, eq, fi, fq;
@@ -3995,7 +4004,8 @@ wlc_lcnphy_get_cc(phy_info_t *pi, int cal_type)
}

static void
-wlc_lcnphy_a1(phy_info_t *pi, int cal_type, int num_levels, int step_size_lg2)
+wlc_lcnphy_a1(struct brcms_phy *pi, int cal_type, int num_levels,
+ int step_size_lg2)
{
const struct lcnphy_spb_tone *phy_c1;
struct lcnphy_spb_tone phy_c2;
@@ -4193,7 +4203,7 @@ wlc_lcnphy_a1(phy_info_t *pi, int cal_type, int num_levels, int step_size_lg2)
}

static void
-wlc_lcnphy_tx_iqlo_loopback_cleanup(phy_info_t *pi, u16 *values_to_save)
+wlc_lcnphy_tx_iqlo_loopback_cleanup(struct brcms_phy *pi, u16 *values_to_save)
{
int i;

@@ -4208,7 +4218,7 @@ wlc_lcnphy_tx_iqlo_loopback_cleanup(phy_info_t *pi, u16 *values_to_save)
}

static void
-WLBANDINITFN(wlc_lcnphy_load_tx_gain_table) (phy_info_t *pi,
+WLBANDINITFN(wlc_lcnphy_load_tx_gain_table) (struct brcms_phy *pi,
const struct lcnphy_tx_gain_tbl_entry *gain_table) {
u32 j;
struct phytbl_info tab;
@@ -4243,7 +4253,7 @@ WLBANDINITFN(wlc_lcnphy_load_tx_gain_table) (phy_info_t *pi,
}
}

-static void wlc_lcnphy_load_rfpower(phy_info_t *pi)
+static void wlc_lcnphy_load_rfpower(struct brcms_phy *pi)
{
struct phytbl_info tab;
u32 val, bbmult, rfgain;
@@ -4292,7 +4302,7 @@ static void wlc_lcnphy_load_rfpower(phy_info_t *pi)
}
}

-static void WLBANDINITFN(wlc_lcnphy_tbl_init) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_lcnphy_tbl_init) (struct brcms_phy *pi)
{
uint idx;
u8 phybw40;
@@ -4387,10 +4397,10 @@ static void WLBANDINITFN(wlc_lcnphy_tbl_init) (phy_info_t *pi)
wlc_lcnphy_clear_papd_comptable(pi);
}

-static void WLBANDINITFN(wlc_lcnphy_rev0_baseband_init) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_lcnphy_rev0_baseband_init) (struct brcms_phy *pi)
{
u16 afectrl1;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

write_radio_reg(pi, RADIO_2064_REG11C, 0x0);

@@ -4434,7 +4444,7 @@ static void WLBANDINITFN(wlc_lcnphy_rev0_baseband_init) (phy_info_t *pi)

}

-static void WLBANDINITFN(wlc_lcnphy_rev2_baseband_init) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_lcnphy_rev2_baseband_init) (struct brcms_phy *pi)
{
if (CHSPEC_IS5G(pi->radio_chanspec)) {
mod_phy_reg(pi, 0x416, (0xff << 0), 80 << 0);
@@ -4443,12 +4453,12 @@ static void WLBANDINITFN(wlc_lcnphy_rev2_baseband_init) (phy_info_t *pi)
}
}

-static void wlc_lcnphy_agc_temp_init(phy_info_t *pi)
+static void wlc_lcnphy_agc_temp_init(struct brcms_phy *pi)
{
s16 temp;
struct phytbl_info tab;
u32 tableBuffer[2];
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (NORADIO_ENAB(pi->pubpi))
return;
@@ -4504,7 +4514,7 @@ static void wlc_lcnphy_agc_temp_init(phy_info_t *pi)

}

-static void WLBANDINITFN(wlc_lcnphy_bu_tweaks) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_lcnphy_bu_tweaks) (struct brcms_phy *pi)
{
if (NORADIO_ENAB(pi->pubpi))
return;
@@ -4559,7 +4569,7 @@ static void WLBANDINITFN(wlc_lcnphy_bu_tweaks) (phy_info_t *pi)
}
}

-static void WLBANDINITFN(wlc_lcnphy_baseband_init) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_lcnphy_baseband_init) (struct brcms_phy *pi)
{

wlc_lcnphy_tbl_init(pi);
@@ -4569,7 +4579,7 @@ static void WLBANDINITFN(wlc_lcnphy_baseband_init) (phy_info_t *pi)
wlc_lcnphy_bu_tweaks(pi);
}

-static void WLBANDINITFN(wlc_radio_2064_init) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_radio_2064_init) (struct brcms_phy *pi)
{
u32 i;
struct lcnphy_radio_regs *lcnphyregs = NULL;
@@ -4630,7 +4640,7 @@ static void WLBANDINITFN(wlc_radio_2064_init) (phy_info_t *pi)
wlc_lcnphy_rc_cal(pi);
}

-static void WLBANDINITFN(wlc_lcnphy_radio_init) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_lcnphy_radio_init) (struct brcms_phy *pi)
{
if (NORADIO_ENAB(pi->pubpi))
return;
@@ -4638,7 +4648,7 @@ static void WLBANDINITFN(wlc_lcnphy_radio_init) (phy_info_t *pi)
wlc_radio_2064_init(pi);
}

-static void wlc_lcnphy_rcal(phy_info_t *pi)
+static void wlc_lcnphy_rcal(struct brcms_phy *pi)
{
u8 rcal_value;

@@ -4669,7 +4679,7 @@ static void wlc_lcnphy_rcal(phy_info_t *pi)
and_radio_reg(pi, RADIO_2064_REG057, 0xFE);
}

-static void wlc_lcnphy_rc_cal(phy_info_t *pi)
+static void wlc_lcnphy_rc_cal(struct brcms_phy *pi)
{
u8 dflt_rc_cal_val;
u16 flt_val;
@@ -4692,11 +4702,11 @@ static void wlc_lcnphy_rc_cal(phy_info_t *pi)
return;
}

-static bool wlc_phy_txpwr_srom_read_lcnphy(phy_info_t *pi)
+static bool wlc_phy_txpwr_srom_read_lcnphy(struct brcms_phy *pi)
{
s8 txpwr = 0;
int i;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

if (CHSPEC_IS2G(pi->radio_chanspec)) {
u16 cckpo = 0;
@@ -4814,7 +4824,7 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(phy_info_t *pi)
return true;
}

-void wlc_2064_vco_cal(phy_info_t *pi)
+void wlc_2064_vco_cal(struct brcms_phy *pi)
{
u8 calnrst;

@@ -4830,7 +4840,7 @@ void wlc_2064_vco_cal(phy_info_t *pi)
}

static void
-wlc_lcnphy_radio_2064_channel_tune_4313(phy_info_t *pi, u8 channel)
+wlc_lcnphy_radio_2064_channel_tune_4313(struct brcms_phy *pi, u8 channel)
{
uint i;
const struct chan_info_2064_lcnphy *ci;
@@ -4995,7 +5005,7 @@ wlc_lcnphy_radio_2064_channel_tune_4313(phy_info_t *pi, u8 channel)
}
}

-bool wlc_phy_tpc_isenabled_lcnphy(phy_info_t *pi)
+bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi)
{
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi))
return 0;
@@ -5004,7 +5014,7 @@ bool wlc_phy_tpc_isenabled_lcnphy(phy_info_t *pi)
wlc_lcnphy_get_tx_pwr_ctrl((pi)));
}

-void wlc_phy_txpower_recalc_target_lcnphy(phy_info_t *pi)
+void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi)
{
u16 pwr_ctrl;
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi)) {
@@ -5020,16 +5030,16 @@ void wlc_phy_txpower_recalc_target_lcnphy(phy_info_t *pi)
return;
}

-void wlc_phy_detach_lcnphy(phy_info_t *pi)
+void wlc_phy_detach_lcnphy(struct brcms_phy *pi)
{
kfree(pi->u.pi_lcnphy);
}

-bool wlc_phy_attach_lcnphy(phy_info_t *pi)
+bool wlc_phy_attach_lcnphy(struct brcms_phy *pi)
{
- struct phy_info_lcnphy *pi_lcn;
+ struct brcms_phy_lcnphy *pi_lcn;

- pi->u.pi_lcnphy = kzalloc(sizeof(struct phy_info_lcnphy), GFP_ATOMIC);
+ pi->u.pi_lcnphy = kzalloc(sizeof(struct brcms_phy_lcnphy), GFP_ATOMIC);
if (pi->u.pi_lcnphy == NULL) {
return false;
}
@@ -5072,7 +5082,7 @@ bool wlc_phy_attach_lcnphy(phy_info_t *pi)
return true;
}

-static void wlc_lcnphy_set_rx_gain(phy_info_t *pi, u32 gain)
+static void wlc_lcnphy_set_rx_gain(struct brcms_phy *pi, u32 gain)
{
u16 trsw, ext_lna, lna1, lna2, tia, biq0, biq1, gain0_15, gain16_19;

@@ -5102,12 +5112,12 @@ static void wlc_lcnphy_set_rx_gain(phy_info_t *pi, u32 gain)
wlc_lcnphy_rx_gain_override_enable(pi, true);
}

-static u32 wlc_lcnphy_get_receive_power(phy_info_t *pi, s32 *gain_index)
+static u32 wlc_lcnphy_get_receive_power(struct brcms_phy *pi, s32 *gain_index)
{
u32 received_power = 0;
s32 max_index = 0;
u32 gain_code = 0;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

max_index = 36;
if (*gain_index >= 0)
@@ -5138,7 +5148,7 @@ static u32 wlc_lcnphy_get_receive_power(phy_info_t *pi, s32 *gain_index)
return received_power;
}

-s32 wlc_lcnphy_rx_signal_power(phy_info_t *pi, s32 gain_index)
+s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index)
{
s32 gain = 0;
s32 nominal_power_db;
@@ -5146,7 +5156,7 @@ s32 wlc_lcnphy_rx_signal_power(phy_info_t *pi, s32 gain_index)
input_power_db;
s32 received_power, temperature;
uint freq;
- struct phy_info_lcnphy *pi_lcn = pi->u.pi_lcnphy;
+ struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;

received_power = wlc_lcnphy_get_receive_power(pi, &gain_index);

@@ -5210,7 +5220,7 @@ s32 wlc_lcnphy_rx_signal_power(phy_info_t *pi, s32 gain_index)
}

static int
-wlc_lcnphy_load_tx_iir_filter(phy_info_t *pi, bool is_ofdm, s16 filt_type)
+wlc_lcnphy_load_tx_iir_filter(struct brcms_phy *pi, bool is_ofdm, s16 filt_type)
{
s16 filt_index = -1;
int j;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h
index b21a29b..f4a8ab0 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.h
@@ -19,7 +19,7 @@

#include <types.h>

-struct phy_info_lcnphy {
+struct brcms_phy_lcnphy {
int lcnphy_txrf_sp_9_override;
u8 lcnphy_full_cal_channel;
u8 lcnphy_cal_counter;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index e6fe8b7..6e2417e 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -14085,118 +14085,118 @@ static u8 ant_sw_ctrl_tbl_rev8_2057v7_core0[] = {
static u8 ant_sw_ctrl_tbl_rev8_2057v7_core1[] = {
0x09, 0x0a, 0x09, 0x0a, 0x15, 0x16 };

-static bool wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f,
+static bool wlc_phy_chan2freq_nphy(struct brcms_phy *pi, uint channel, int *f,
struct chan_info_nphy_radio2057 **t0,
struct chan_info_nphy_radio205x **t1,
struct chan_info_nphy_radio2057_rev5 **t2,
struct chan_info_nphy_2055 **t3);
-static void wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chans,
+static void wlc_phy_chanspec_nphy_setup(struct brcms_phy *pi, chanspec_t chans,
const struct nphy_sfo_cfg *c);

-static void wlc_phy_adjust_rx_analpfbw_nphy(phy_info_t *pi,
+static void wlc_phy_adjust_rx_analpfbw_nphy(struct brcms_phy *pi,
u16 reduction_factr);
-static void wlc_phy_adjust_min_noisevar_nphy(phy_info_t *pi, int ntones, int *,
- u32 *buf);
-static void wlc_phy_adjust_crsminpwr_nphy(phy_info_t *pi, u8 minpwr);
-static void wlc_phy_txlpfbw_nphy(phy_info_t *pi);
-static void wlc_phy_spurwar_nphy(phy_info_t *pi);
-
-static void wlc_phy_radio_preinit_2055(phy_info_t *pi);
-static void wlc_phy_radio_init_2055(phy_info_t *pi);
-static void wlc_phy_radio_postinit_2055(phy_info_t *pi);
-static void wlc_phy_radio_preinit_205x(phy_info_t *pi);
-static void wlc_phy_radio_init_2056(phy_info_t *pi);
-static void wlc_phy_radio_postinit_2056(phy_info_t *pi);
-static void wlc_phy_radio_init_2057(phy_info_t *pi);
-static void wlc_phy_radio_postinit_2057(phy_info_t *pi);
-static void wlc_phy_workarounds_nphy(phy_info_t *pi);
-static void wlc_phy_workarounds_nphy_gainctrl(phy_info_t *pi);
-static void wlc_phy_workarounds_nphy_gainctrl_2057_rev5(phy_info_t *pi);
-static void wlc_phy_workarounds_nphy_gainctrl_2057_rev6(phy_info_t *pi);
-static void wlc_phy_adjust_lnagaintbl_nphy(phy_info_t *pi);
-
-static void wlc_phy_restore_rssical_nphy(phy_info_t *pi);
-static void wlc_phy_reapply_txcal_coeffs_nphy(phy_info_t *pi);
-static void wlc_phy_tx_iq_war_nphy(phy_info_t *pi);
-static int wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, struct nphy_txgains tg,
- u8 type, bool d);
-static void wlc_phy_rxcal_gainctrl_nphy_rev5(phy_info_t *pi, u8 rxcore,
+static void wlc_phy_adjust_min_noisevar_nphy(struct brcms_phy *pi,
+ int ntones, int *, u32 *buf);
+static void wlc_phy_adjust_crsminpwr_nphy(struct brcms_phy *pi, u8 minpwr);
+static void wlc_phy_txlpfbw_nphy(struct brcms_phy *pi);
+static void wlc_phy_spurwar_nphy(struct brcms_phy *pi);
+
+static void wlc_phy_radio_preinit_2055(struct brcms_phy *pi);
+static void wlc_phy_radio_init_2055(struct brcms_phy *pi);
+static void wlc_phy_radio_postinit_2055(struct brcms_phy *pi);
+static void wlc_phy_radio_preinit_205x(struct brcms_phy *pi);
+static void wlc_phy_radio_init_2056(struct brcms_phy *pi);
+static void wlc_phy_radio_postinit_2056(struct brcms_phy *pi);
+static void wlc_phy_radio_init_2057(struct brcms_phy *pi);
+static void wlc_phy_radio_postinit_2057(struct brcms_phy *pi);
+static void wlc_phy_workarounds_nphy(struct brcms_phy *pi);
+static void wlc_phy_workarounds_nphy_gainctrl(struct brcms_phy *pi);
+static void wlc_phy_workarounds_nphy_gainctrl_2057_rev5(struct brcms_phy *pi);
+static void wlc_phy_workarounds_nphy_gainctrl_2057_rev6(struct brcms_phy *pi);
+static void wlc_phy_adjust_lnagaintbl_nphy(struct brcms_phy *pi);
+
+static void wlc_phy_restore_rssical_nphy(struct brcms_phy *pi);
+static void wlc_phy_reapply_txcal_coeffs_nphy(struct brcms_phy *pi);
+static void wlc_phy_tx_iq_war_nphy(struct brcms_phy *pi);
+static int wlc_phy_cal_rxiq_nphy_rev3(struct brcms_phy *pi,
+ struct nphy_txgains tg, u8 type, bool d);
+static void wlc_phy_rxcal_gainctrl_nphy_rev5(struct brcms_phy *pi, u8 rxcore,
u16 *rg, u8 type);
-static void wlc_phy_update_mimoconfig_nphy(phy_info_t *pi, s32 preamble);
-static void wlc_phy_savecal_nphy(phy_info_t *pi);
-static void wlc_phy_restorecal_nphy(phy_info_t *pi);
-static void wlc_phy_resetcca_nphy(phy_info_t *pi);
-
-static void wlc_phy_txpwrctrl_config_nphy(phy_info_t *pi);
-static void wlc_phy_internal_cal_txgain_nphy(phy_info_t *pi);
-static void wlc_phy_precal_txgain_nphy(phy_info_t *pi);
-static void wlc_phy_update_txcal_ladder_nphy(phy_info_t *pi, u16 core);
-
-static void wlc_phy_extpa_set_tx_digi_filts_nphy(phy_info_t *pi);
-static void wlc_phy_ipa_set_tx_digi_filts_nphy(phy_info_t *pi);
-static void wlc_phy_ipa_restore_tx_digi_filts_nphy(phy_info_t *pi);
-static u16 wlc_phy_ipa_get_bbmult_nphy(phy_info_t *pi);
-static void wlc_phy_ipa_set_bbmult_nphy(phy_info_t *pi, u8 m0, u8 m1);
-static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi);
-
-static void wlc_phy_a1_nphy(phy_info_t *pi, u8 core, u32 winsz, u32,
+static void wlc_phy_update_mimoconfig_nphy(struct brcms_phy *pi, s32 preamble);
+static void wlc_phy_savecal_nphy(struct brcms_phy *pi);
+static void wlc_phy_restorecal_nphy(struct brcms_phy *pi);
+static void wlc_phy_resetcca_nphy(struct brcms_phy *pi);
+
+static void wlc_phy_txpwrctrl_config_nphy(struct brcms_phy *pi);
+static void wlc_phy_internal_cal_txgain_nphy(struct brcms_phy *pi);
+static void wlc_phy_precal_txgain_nphy(struct brcms_phy *pi);
+static void wlc_phy_update_txcal_ladder_nphy(struct brcms_phy *pi, u16 core);
+
+static void wlc_phy_extpa_set_tx_digi_filts_nphy(struct brcms_phy *pi);
+static void wlc_phy_ipa_set_tx_digi_filts_nphy(struct brcms_phy *pi);
+static void wlc_phy_ipa_restore_tx_digi_filts_nphy(struct brcms_phy *pi);
+static u16 wlc_phy_ipa_get_bbmult_nphy(struct brcms_phy *pi);
+static void wlc_phy_ipa_set_bbmult_nphy(struct brcms_phy *pi, u8 m0, u8 m1);
+static u32 *wlc_phy_get_ipa_gaintbl_nphy(struct brcms_phy *pi);
+
+static void wlc_phy_a1_nphy(struct brcms_phy *pi, u8 core, u32 winsz, u32,
u32 e);
-static u8 wlc_phy_a3_nphy(phy_info_t *pi, u8 start_gain, u8 core);
-static void wlc_phy_a2_nphy(phy_info_t *pi, struct nphy_ipa_txcalgains *,
+static u8 wlc_phy_a3_nphy(struct brcms_phy *pi, u8 start_gain, u8 core);
+static void wlc_phy_a2_nphy(struct brcms_phy *pi, struct nphy_ipa_txcalgains *,
enum phy_cal_mode, u8);
-static void wlc_phy_papd_cal_cleanup_nphy(phy_info_t *pi,
+static void wlc_phy_papd_cal_cleanup_nphy(struct brcms_phy *pi,
struct nphy_papd_restore_state *state);
-static void wlc_phy_papd_cal_setup_nphy(phy_info_t *pi,
+static void wlc_phy_papd_cal_setup_nphy(struct brcms_phy *pi,
struct nphy_papd_restore_state *state, u8);

-static void wlc_phy_clip_det_nphy(phy_info_t *pi, u8 write, u16 *vals);
+static void wlc_phy_clip_det_nphy(struct brcms_phy *pi, u8 write, u16 *vals);

-static void wlc_phy_set_rfseq_nphy(phy_info_t *pi, u8 cmd, u8 *evts,
+static void wlc_phy_set_rfseq_nphy(struct brcms_phy *pi, u8 cmd, u8 *evts,
u8 *dlys, u8 len);

-static u16 wlc_phy_read_lpf_bw_ctl_nphy(phy_info_t *pi, u16 offset);
+static u16 wlc_phy_read_lpf_bw_ctl_nphy(struct brcms_phy *pi, u16 offset);

static void
-wlc_phy_rfctrl_override_nphy_rev7(phy_info_t *pi, u16 field, u16 value,
+wlc_phy_rfctrl_override_nphy_rev7(struct brcms_phy *pi, u16 field, u16 value,
u8 core_mask, u8 off,
u8 override_id);

-static void wlc_phy_rssi_cal_nphy_rev2(phy_info_t *pi, u8 rssi_type);
-static void wlc_phy_rssi_cal_nphy_rev3(phy_info_t *pi);
+static void wlc_phy_rssi_cal_nphy_rev2(struct brcms_phy *pi, u8 rssi_type);
+static void wlc_phy_rssi_cal_nphy_rev3(struct brcms_phy *pi);

-static bool wlc_phy_txpwr_srom_read_nphy(phy_info_t *pi);
+static bool wlc_phy_txpwr_srom_read_nphy(struct brcms_phy *pi);
static void wlc_phy_txpwr_nphy_srom_convert(u8 *srom_max,
u16 *pwr_offset,
u8 tmp_max_pwr, u8 rate_start,
u8 rate_end);

-static void wlc_phy_txpwr_limit_to_tbl_nphy(phy_info_t *pi);
-static void wlc_phy_txpwrctrl_coeff_setup_nphy(phy_info_t *pi);
-static void wlc_phy_txpwrctrl_idle_tssi_nphy(phy_info_t *pi);
-static void wlc_phy_txpwrctrl_pwr_setup_nphy(phy_info_t *pi);
+static void wlc_phy_txpwr_limit_to_tbl_nphy(struct brcms_phy *pi);
+static void wlc_phy_txpwrctrl_coeff_setup_nphy(struct brcms_phy *pi);
+static void wlc_phy_txpwrctrl_idle_tssi_nphy(struct brcms_phy *pi);
+static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi);

-static bool wlc_phy_txpwr_ison_nphy(phy_info_t *pi);
-static u8 wlc_phy_txpwr_idx_cur_get_nphy(phy_info_t *pi, u8 core);
-static void wlc_phy_txpwr_idx_cur_set_nphy(phy_info_t *pi, u8 idx0,
+static bool wlc_phy_txpwr_ison_nphy(struct brcms_phy *pi);
+static u8 wlc_phy_txpwr_idx_cur_get_nphy(struct brcms_phy *pi, u8 core);
+static void wlc_phy_txpwr_idx_cur_set_nphy(struct brcms_phy *pi, u8 idx0,
u8 idx1);
-static void wlc_phy_a4(phy_info_t *pi, bool full_cal);
+static void wlc_phy_a4(struct brcms_phy *pi, bool full_cal);

-static u16 wlc_phy_radio205x_rcal(phy_info_t *pi);
+static u16 wlc_phy_radio205x_rcal(struct brcms_phy *pi);

-static u16 wlc_phy_radio2057_rccal(phy_info_t *pi);
+static u16 wlc_phy_radio2057_rccal(struct brcms_phy *pi);

-static u16 wlc_phy_gen_load_samples_nphy(phy_info_t *pi, u32 f_kHz,
+static u16 wlc_phy_gen_load_samples_nphy(struct brcms_phy *pi, u32 f_kHz,
u16 max_val,
u8 dac_test_mode);
-static void wlc_phy_loadsampletable_nphy(phy_info_t *pi, cs32 *tone_buf,
+static void wlc_phy_loadsampletable_nphy(struct brcms_phy *pi, cs32 *tone_buf,
u16 num_samps);
-static void wlc_phy_runsamples_nphy(phy_info_t *pi, u16 n, u16 lps,
+static void wlc_phy_runsamples_nphy(struct brcms_phy *pi, u16 n, u16 lps,
u16 wait, u8 iq, u8 dac_test_mode,
bool modify_bbmult);

bool wlc_phy_bist_check_phy(wlc_phy_t *pih)
{
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
u32 phybist0, phybist1, phybist2, phybist3, phybist4;

if (NREV_GE(pi->pubpi.phy_rev, 16))
@@ -14216,7 +14216,7 @@ bool wlc_phy_bist_check_phy(wlc_phy_t *pih)
return false;
}

-static void WLBANDINITFN(wlc_phy_bphy_init_nphy) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_phy_bphy_init_nphy) (struct brcms_phy *pi)
{
u16 addr, val;

@@ -14245,7 +14245,7 @@ static void WLBANDINITFN(wlc_phy_bphy_init_nphy) (phy_info_t *pi)
}

void
-wlc_phy_table_write_nphy(phy_info_t *pi, u32 id, u32 len, u32 offset,
+wlc_phy_table_write_nphy(struct brcms_phy *pi, u32 id, u32 len, u32 offset,
u32 width, const void *data)
{
struct phytbl_info tbl;
@@ -14259,7 +14259,7 @@ wlc_phy_table_write_nphy(phy_info_t *pi, u32 id, u32 len, u32 offset,
}

void
-wlc_phy_table_read_nphy(phy_info_t *pi, u32 id, u32 len, u32 offset,
+wlc_phy_table_read_nphy(struct brcms_phy *pi, u32 id, u32 len, u32 offset,
u32 width, void *data)
{
struct phytbl_info tbl;
@@ -14272,7 +14272,8 @@ wlc_phy_table_read_nphy(phy_info_t *pi, u32 id, u32 len, u32 offset,
wlc_phy_read_table_nphy(pi, &tbl);
}

-static void WLBANDINITFN(wlc_phy_static_table_download_nphy) (phy_info_t *pi)
+static void
+WLBANDINITFN(wlc_phy_static_table_download_nphy) (struct brcms_phy *pi)
{
uint idx;

@@ -14295,7 +14296,7 @@ static void WLBANDINITFN(wlc_phy_static_table_download_nphy) (phy_info_t *pi)
}
}

-static void WLBANDINITFN(wlc_phy_tbl_init_nphy) (phy_info_t *pi)
+static void WLBANDINITFN(wlc_phy_tbl_init_nphy) (struct brcms_phy *pi)
{
uint idx = 0;
u8 antswctrllut;
@@ -14417,13 +14418,13 @@ static void WLBANDINITFN(wlc_phy_tbl_init_nphy) (phy_info_t *pi)
}

static void
-wlc_phy_write_txmacreg_nphy(phy_info_t *pi, u16 holdoff, u16 delay)
+wlc_phy_write_txmacreg_nphy(struct brcms_phy *pi, u16 holdoff, u16 delay)
{
write_phy_reg(pi, 0x77, holdoff);
write_phy_reg(pi, 0xb4, delay);
}

-void wlc_phy_nphy_tkip_rifs_war(phy_info_t *pi, u8 rifs)
+void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs)
{
u16 holdoff, delay;

@@ -14444,7 +14445,7 @@ void wlc_phy_nphy_tkip_rifs_war(phy_info_t *pi, u8 rifs)
}
}

-bool wlc_phy_attach_nphy(phy_info_t *pi)
+bool wlc_phy_attach_nphy(struct brcms_phy *pi)
{
uint i;

@@ -14503,7 +14504,7 @@ bool wlc_phy_attach_nphy(phy_info_t *pi)
return true;
}

-static void wlc_phy_txpwrctrl_config_nphy(phy_info_t *pi)
+static void wlc_phy_txpwrctrl_config_nphy(struct brcms_phy *pi)
{

if (NREV_GE(pi->pubpi.phy_rev, 3)) {
@@ -14523,7 +14524,7 @@ static void wlc_phy_txpwrctrl_config_nphy(phy_info_t *pi)
pi->phy_5g_pwrgain = true;
}

-void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
+void WLBANDINITFN(wlc_phy_init_nphy) (struct brcms_phy *pi)
{
u16 val;
u16 clip1_ths[2];
@@ -14924,7 +14925,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)

}

-static void wlc_phy_update_mimoconfig_nphy(phy_info_t *pi, s32 preamble)
+static void wlc_phy_update_mimoconfig_nphy(struct brcms_phy *pi, s32 preamble)
{
bool gf_preamble = false;
u16 val;
@@ -14943,7 +14944,7 @@ static void wlc_phy_update_mimoconfig_nphy(phy_info_t *pi, s32 preamble)
write_phy_reg(pi, 0xed, val);
}

-static void wlc_phy_resetcca_nphy(phy_info_t *pi)
+static void wlc_phy_resetcca_nphy(struct brcms_phy *pi)
{
u16 val;

@@ -14959,7 +14960,7 @@ static void wlc_phy_resetcca_nphy(phy_info_t *pi)
wlc_phy_force_rfseq_nphy(pi, NPHY_RFSEQ_RESET2RX);
}

-void wlc_phy_pa_override_nphy(phy_info_t *pi, bool en)
+void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en)
{
u16 rfctrlintc_override_val;

@@ -14988,7 +14989,7 @@ void wlc_phy_pa_override_nphy(phy_info_t *pi, bool en)

}

-void wlc_phy_stf_chain_upd_nphy(phy_info_t *pi)
+void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi)
{

u16 txrx_chain =
@@ -15028,7 +15029,7 @@ void wlc_phy_rxcore_setstate_nphy(wlc_phy_t *pih, u8 rxcore_bitmask)
u16 regval;
u16 tbl_buf[16];
uint i;
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;
u16 tbl_opcode;
bool suspend;

@@ -15107,7 +15108,7 @@ void wlc_phy_rxcore_setstate_nphy(wlc_phy_t *pih, u8 rxcore_bitmask)
u8 wlc_phy_rxcore_getstate_nphy(wlc_phy_t *pih)
{
u16 regval, rxen_bits;
- phy_info_t *pi = (phy_info_t *) pih;
+ struct brcms_phy *pi = (struct brcms_phy *) pih;

regval = read_phy_reg(pi, 0xa2);
rxen_bits = (regval >> 4) & 0xf;
@@ -15115,12 +15116,12 @@ u8 wlc_phy_rxcore_getstate_nphy(wlc_phy_t *pih)
return (u8) rxen_bits;
}

-bool wlc_phy_n_txpower_ipa_ison(phy_info_t *pi)
+bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pi)
{
return PHY_IPA(pi);
}

-static void wlc_phy_txpwr_limit_to_tbl_nphy(phy_info_t *pi)
+static void wlc_phy_txpwr_limit_to_tbl_nphy(struct brcms_phy *pi)
{
u8 idx, idx2, i, delta_ind;

@@ -15214,11 +15215,12 @@ static void wlc_phy_txpwr_limit_to_tbl_nphy(phy_info_t *pi)
}
}

-void wlc_phy_cal_init_nphy(phy_info_t *pi)
+void wlc_phy_cal_init_nphy(struct brcms_phy *pi)
{
}

-static void wlc_phy_war_force_trsw_to_R_cliplo_nphy(phy_info_t *pi, u8 core)
+static void
+wlc_phy_war_force_trsw_to_R_cliplo_nphy(struct brcms_phy *pi, u8 core)
{
if (core == PHY_CORE_0) {
write_phy_reg(pi, 0x38, 0x4);
@@ -15237,7 +15239,7 @@ static void wlc_phy_war_force_trsw_to_R_cliplo_nphy(phy_info_t *pi, u8 core)
}
}

-static void wlc_phy_war_txchain_upd_nphy(phy_info_t *pi, u8 txchain)
+static void wlc_phy_war_txchain_upd_nphy(struct brcms_phy *pi, u8 txchain)
{
u8 txchain0, txchain1;

@@ -15252,7 +15254,7 @@ static void wlc_phy_war_txchain_upd_nphy(phy_info_t *pi, u8 txchain)
}
}

-static void wlc_phy_workarounds_nphy(phy_info_t *pi)
+static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)
{
u8 rfseq_rx2tx_events[] = {
NPHY_RFSEQ_CMD_NOP,
@@ -16325,7 +16327,7 @@ static void wlc_phy_workarounds_nphy(phy_info_t *pi)
wlc_phy_stay_in_carriersearch_nphy(pi, false);
}

-static void wlc_phy_workarounds_nphy_gainctrl(phy_info_t *pi)
+static void wlc_phy_workarounds_nphy_gainctrl(struct brcms_phy *pi)
{
u16 w1th, hpf_code, currband;
int ctr;
@@ -16945,7 +16947,7 @@ static void wlc_phy_workarounds_nphy_gainctrl(phy_info_t *pi)
}
}

-static void wlc_phy_workarounds_nphy_gainctrl_2057_rev5(phy_info_t *pi)
+static void wlc_phy_workarounds_nphy_gainctrl_2057_rev5(struct brcms_phy *pi)
{
s8 lna1_gain_db[] = { 8, 13, 17, 22 };
s8 lna2_gain_db[] = { -2, 7, 11, 15 };
@@ -17000,7 +17002,7 @@ static void wlc_phy_workarounds_nphy_gainctrl_2057_rev5(phy_info_t *pi)
}
}

-static void wlc_phy_workarounds_nphy_gainctrl_2057_rev6(phy_info_t *pi)
+static void wlc_phy_workarounds_nphy_gainctrl_2057_rev6(struct brcms_phy *pi)
{
u16 currband;
s8 lna1G_gain_db_rev7[] = { 9, 14, 19, 24 };
@@ -17206,7 +17208,7 @@ static void wlc_phy_workarounds_nphy_gainctrl_2057_rev6(phy_info_t *pi)

}

-static void wlc_phy_adjust_lnagaintbl_nphy(phy_info_t *pi)
+static void wlc_phy_adjust_lnagaintbl_nphy(struct brcms_phy *pi)
{
uint core;
int ctr;
@@ -17269,7 +17271,7 @@ static void wlc_phy_adjust_lnagaintbl_nphy(phy_info_t *pi)
wlc_phy_stay_in_carriersearch_nphy(pi, false);
}

-void wlc_phy_switch_radio_nphy(phy_info_t *pi, bool on)
+void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on)
{
if (on) {
if (NREV_GE(pi->pubpi.phy_rev, 7)) {
@@ -17352,7 +17354,7 @@ void wlc_phy_switch_radio_nphy(phy_info_t *pi, bool on)
}
}

-static void wlc_phy_radio_preinit_2055(phy_info_t *pi)
+static void wlc_phy_radio_preinit_2055(struct brcms_phy *pi)
{

and_phy_reg(pi, 0x78, ~RFCC_POR_FORCE);
@@ -17361,12 +17363,12 @@ static void wlc_phy_radio_preinit_2055(phy_info_t *pi)
or_phy_reg(pi, 0x78, RFCC_POR_FORCE);
}

-static void wlc_phy_radio_init_2055(phy_info_t *pi)
+static void wlc_phy_radio_init_2055(struct brcms_phy *pi)
{
wlc_phy_init_radio_regs(pi, regs_2055, RADIO_DEFAULT_CORE);
}

-static void wlc_phy_radio_postinit_2055(phy_info_t *pi)
+static void wlc_phy_radio_postinit_2055(struct brcms_phy *pi)
{

and_radio_reg(pi, RADIO_2055_MASTER_CNTRL1,
@@ -17431,7 +17433,7 @@ static void wlc_phy_radio_postinit_2055(phy_info_t *pi)
udelay(2);
}

-static void wlc_phy_radio_preinit_205x(phy_info_t *pi)
+static void wlc_phy_radio_preinit_205x(struct brcms_phy *pi)
{

and_phy_reg(pi, 0x78, ~RFCC_CHIP0_PU);
@@ -17442,7 +17444,7 @@ static void wlc_phy_radio_preinit_205x(phy_info_t *pi)

}

-static void wlc_phy_radio_init_2056(phy_info_t *pi)
+static void wlc_phy_radio_init_2056(struct brcms_phy *pi)
{
struct radio_regs *regs_SYN_2056_ptr = NULL;
struct radio_regs *regs_TX_2056_ptr = NULL;
@@ -17505,7 +17507,7 @@ static void wlc_phy_radio_init_2056(phy_info_t *pi)
wlc_phy_init_radio_regs(pi, regs_RX_2056_ptr, (u16) RADIO_2056_RX1);
}

-static void wlc_phy_radio_postinit_2056(phy_info_t *pi)
+static void wlc_phy_radio_postinit_2056(struct brcms_phy *pi)
{
mod_radio_reg(pi, RADIO_2056_SYN_COM_CTRL, 0xb, 0xb);

@@ -17530,7 +17532,7 @@ static void wlc_phy_radio_postinit_2056(phy_info_t *pi)
}
}

-static void wlc_phy_radio_init_2057(phy_info_t *pi)
+static void wlc_phy_radio_init_2057(struct brcms_phy *pi)
{
struct radio_20xx_regs *regs_2057_ptr = NULL;

@@ -17571,7 +17573,7 @@ static void wlc_phy_radio_init_2057(phy_info_t *pi)
wlc_phy_init_radio_regs_allbands(pi, regs_2057_ptr);
}

-static void wlc_phy_radio_postinit_2057(phy_info_t *pi)
+static void wlc_phy_radio_postinit_2057(struct brcms_phy *pi)
{

mod_radio_reg(pi, RADIO_2057_XTALPUOVR_PINCTRL, 0x1, 0x1);
@@ -17591,7 +17593,7 @@ static void wlc_phy_radio_postinit_2057(phy_info_t *pi)
}

static bool
-wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f,
+wlc_phy_chan2freq_nphy(struct brcms_phy *pi, uint channel, int *f,
struct chan_info_nphy_radio2057 **t0,
struct chan_info_nphy_radio205x **t1,
struct chan_info_nphy_radio2057_rev5 **t2,
@@ -17759,7 +17761,7 @@ wlc_phy_chan2freq_nphy(phy_info_t *pi, uint channel, int *f,
return false;
}

-u8 wlc_phy_get_chan_freq_range_nphy(phy_info_t *pi, uint channel)
+u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint channel)
{
int freq;
struct chan_info_nphy_radio2057 *t0 = NULL;
@@ -17788,7 +17790,8 @@ u8 wlc_phy_get_chan_freq_range_nphy(phy_info_t *pi, uint channel)
}

static void
-wlc_phy_chanspec_radio2055_setup(phy_info_t *pi, struct chan_info_nphy_2055 *ci)
+wlc_phy_chanspec_radio2055_setup(struct brcms_phy *pi,
+ struct chan_info_nphy_2055 *ci)
{

write_radio_reg(pi, RADIO_2055_PLL_REF, ci->RF_pll_ref);
@@ -17850,7 +17853,7 @@ wlc_phy_chanspec_radio2055_setup(phy_info_t *pi, struct chan_info_nphy_2055 *ci)
}

static void
-wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
+wlc_phy_chanspec_radio2056_setup(struct brcms_phy *pi,
const struct chan_info_nphy_radio205x *ci)
{
struct radio_regs *regs_SYN_2056_ptr = NULL;
@@ -18166,7 +18169,7 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
wlc_phy_radio205x_vcocal_nphy(pi);
}

-void wlc_phy_radio205x_vcocal_nphy(phy_info_t *pi)
+void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi)
{
if (NREV_GE(pi->pubpi.phy_rev, 7)) {
mod_radio_reg(pi, RADIO_2057_RFPLL_MISC_EN, 0x01, 0x0);
@@ -18187,7 +18190,7 @@ void wlc_phy_radio205x_vcocal_nphy(phy_info_t *pi)

#define MAX_205x_RCAL_WAITLOOPS 10000

-static u16 wlc_phy_radio205x_rcal(phy_info_t *pi)
+static u16 wlc_phy_radio205x_rcal(struct brcms_phy *pi)
{
u16 rcal_reg = 0;
int i;
@@ -18293,7 +18296,7 @@ static u16 wlc_phy_radio205x_rcal(phy_info_t *pi)
}

static void
-wlc_phy_chanspec_radio2057_setup(phy_info_t *pi,
+wlc_phy_chanspec_radio2057_setup(struct brcms_phy *pi,
const struct chan_info_nphy_radio2057 *ci,
const struct chan_info_nphy_radio2057_rev5 *ci2)
{
@@ -18488,7 +18491,7 @@ wlc_phy_chanspec_radio2057_setup(phy_info_t *pi,
wlc_phy_radio205x_vcocal_nphy(pi);
}

-static u16 wlc_phy_radio2057_rccal(phy_info_t *pi)
+static u16 wlc_phy_radio2057_rccal(struct brcms_phy *pi)
{
u16 rccal_valid;
int i;
@@ -18572,7 +18575,7 @@ static u16 wlc_phy_radio2057_rccal(phy_info_t *pi)
}

static void
-wlc_phy_adjust_rx_analpfbw_nphy(phy_info_t *pi, u16 reduction_factr)
+wlc_phy_adjust_rx_analpfbw_nphy(struct brcms_phy *pi, u16 reduction_factr)
{
if (NREV_GE(pi->pubpi.phy_rev, 3) && NREV_LT(pi->pubpi.phy_rev, 7)) {
if ((CHSPEC_CHANNEL(pi->radio_chanspec) == 11) &&
@@ -18600,8 +18603,8 @@ wlc_phy_adjust_rx_analpfbw_nphy(phy_info_t *pi, u16 reduction_factr)
}

static void
-wlc_phy_adjust_min_noisevar_nphy(phy_info_t *pi, int ntones, int *tone_id_buf,
- u32 *noise_var_buf)
+wlc_phy_adjust_min_noisevar_nphy(struct brcms_phy *pi, int ntones,
+ int *tone_id_buf, u32 *noise_var_buf)
{
int i;
u32 offset;
@@ -18649,7 +18652,7 @@ wlc_phy_adjust_min_noisevar_nphy(phy_info_t *pi, int ntones, int *tone_id_buf,
}
}

-static void wlc_phy_adjust_crsminpwr_nphy(phy_info_t *pi, u8 minpwr)
+static void wlc_phy_adjust_crsminpwr_nphy(struct brcms_phy *pi, u8 minpwr)
{
u16 regval;

@@ -18700,7 +18703,7 @@ static void wlc_phy_adjust_crsminpwr_nphy(phy_info_t *pi, u8 minpwr)
}
}

-static void wlc_phy_txlpfbw_nphy(phy_info_t *pi)
+static void wlc_phy_txlpfbw_nphy(struct brcms_phy *pi)
{
u8 tx_lpf_bw = 0;

@@ -18739,7 +18742,7 @@ static void wlc_phy_txlpfbw_nphy(phy_info_t *pi)
}
}

-static void wlc_phy_spurwar_nphy(phy_info_t *pi)
+static void wlc_phy_spurwar_nphy(struct brcms_phy *pi)
{
u16 cur_channel = 0;
int nphy_adj_tone_id_buf[] = { 57, 58 };
@@ -18911,7 +18914,7 @@ static void wlc_phy_spurwar_nphy(phy_info_t *pi)
}

static void
-wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
+wlc_phy_chanspec_nphy_setup(struct brcms_phy *pi, chanspec_t chanspec,
const struct nphy_sfo_cfg *ci)
{
u16 val;
@@ -19046,7 +19049,7 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
wlc_phy_spurwar_nphy(pi);
}

-void wlc_phy_chanspec_set_nphy(phy_info_t *pi, chanspec_t chanspec)
+void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, chanspec_t chanspec)
{
int freq;
struct chan_info_nphy_radio2057 *t0 = NULL;
@@ -19129,7 +19132,7 @@ void wlc_phy_chanspec_set_nphy(phy_info_t *pi, chanspec_t chanspec)

}

-static void wlc_phy_savecal_nphy(phy_info_t *pi)
+static void wlc_phy_savecal_nphy(struct brcms_phy *pi)
{
void *tbl_ptr;
int coreNum;
@@ -19278,7 +19281,7 @@ static void wlc_phy_savecal_nphy(phy_info_t *pi)
wlc_phy_stay_in_carriersearch_nphy(pi, false);
}

-static void wlc_phy_restorecal_nphy(phy_info_t *pi)
+static void wlc_phy_restorecal_nphy(struct brcms_phy *pi)
{
u16 *loft_comp;
u16 txcal_coeffs_bphy[4];
@@ -19479,7 +19482,7 @@ static void wlc_phy_restorecal_nphy(phy_info_t *pi)

void wlc_phy_antsel_init(wlc_phy_t *ppi, bool lut_init)
{
- phy_info_t *pi = (phy_info_t *) ppi;
+ struct brcms_phy *pi = (struct brcms_phy *) ppi;
u16 mask = 0xfc00;
u32 mc = 0;

@@ -19537,7 +19540,7 @@ void wlc_phy_antsel_init(wlc_phy_t *ppi, bool lut_init)
}
}

-u16 wlc_phy_classifier_nphy(phy_info_t *pi, u16 mask, u16 val)
+u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val)
{
u16 curr_ctl, new_ctl;
bool suspended = false;
@@ -19562,7 +19565,7 @@ u16 wlc_phy_classifier_nphy(phy_info_t *pi, u16 mask, u16 val)
return new_ctl;
}

-static void wlc_phy_clip_det_nphy(phy_info_t *pi, u8 write, u16 *vals)
+static void wlc_phy_clip_det_nphy(struct brcms_phy *pi, u8 write, u16 *vals)
{

if (write == 0) {
@@ -19574,7 +19577,7 @@ static void wlc_phy_clip_det_nphy(phy_info_t *pi, u8 write, u16 *vals)
}
}

-void wlc_phy_force_rfseq_nphy(phy_info_t *pi, u8 cmd)
+void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd)
{
u16 trigger_mask, status_mask;
u16 orig_RfseqCoreActv;
@@ -19619,7 +19622,7 @@ void wlc_phy_force_rfseq_nphy(phy_info_t *pi, u8 cmd)
}

static void
-wlc_phy_set_rfseq_nphy(phy_info_t *pi, u8 cmd, u8 *events, u8 *dlys,
+wlc_phy_set_rfseq_nphy(struct brcms_phy *pi, u8 cmd, u8 *events, u8 *dlys,
u8 len)
{
u32 t1_offset, t2_offset;
@@ -19650,7 +19653,7 @@ wlc_phy_set_rfseq_nphy(phy_info_t *pi, u8 cmd, u8 *events, u8 *dlys,
wlc_phy_stay_in_carriersearch_nphy(pi, false);
}

-static u16 wlc_phy_read_lpf_bw_ctl_nphy(phy_info_t *pi, u16 offset)
+static u16 wlc_phy_read_lpf_bw_ctl_nphy(struct brcms_phy *pi, u16 offset)
{
u16 lpf_bw_ctl_val = 0;
u16 rx2tx_lpf_rc_lut_offset = 0;
@@ -19674,7 +19677,7 @@ static u16 wlc_phy_read_lpf_bw_ctl_nphy(phy_info_t *pi, u16 offset)
}

static void
-wlc_phy_rfctrl_override_nphy_rev7(phy_info_t *pi, u16 field, u16 value,
+wlc_phy_rfctrl_override_nphy_rev7(struct brcms_phy *pi, u16 field, u16 value,
u8 core_mask, u8 off, u8 override_id)
{
u8 core_num;
@@ -19944,7 +19947,7 @@ wlc_phy_rfctrl_override_nphy_rev7(phy_info_t *pi, u16 field, u16 value,
}

static void
-wlc_phy_rfctrl_override_nphy(phy_info_t *pi, u16 field, u16 value,
+wlc_phy_rfctrl_override_nphy(struct brcms_phy *pi, u16 field, u16 value,
u8 core_mask, u8 off)
{
u8 core_num;
@@ -20190,7 +20193,7 @@ wlc_phy_rfctrl_override_nphy(phy_info_t *pi, u16 field, u16 value,
}

static void
-wlc_phy_rfctrl_override_1tomany_nphy(phy_info_t *pi, u16 cmd, u16 value,
+wlc_phy_rfctrl_override_1tomany_nphy(struct brcms_phy *pi, u16 cmd, u16 value,
u8 core_mask, u8 off)
{
u16 rfmxgain = 0, lpfgain = 0;
@@ -20276,7 +20279,7 @@ wlc_phy_rfctrl_override_1tomany_nphy(phy_info_t *pi, u16 cmd, u16 value,
}

static void
-wlc_phy_scale_offset_rssi_nphy(phy_info_t *pi, u16 scale, s8 offset,
+wlc_phy_scale_offset_rssi_nphy(struct brcms_phy *pi, u16 scale, s8 offset,
u8 coresel, u8 rail, u8 rssi_type)
{
u16 valuetostuff;
@@ -20416,7 +20419,7 @@ wlc_phy_scale_offset_rssi_nphy(phy_info_t *pi, u16 scale, s8 offset,
}
}

-void wlc_phy_rssisel_nphy(phy_info_t *pi, u8 core_code, u8 rssi_type)
+void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core_code, u8 rssi_type)
{
u16 mask, val;
u16 afectrlovr_rssi_val, rfctrlcmd_rxen_val, rfctrlcmd_coresel_val,
@@ -20720,7 +20723,7 @@ void wlc_phy_rssisel_nphy(phy_info_t *pi, u8 core_code, u8 rssi_type)
}

int
-wlc_phy_poll_rssi_nphy(phy_info_t *pi, u8 rssi_type, s32 *rssi_buf,
+wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type, s32 *rssi_buf,
u8 nsamps)
{
s16 rssi0, rssi1;
@@ -20819,7 +20822,7 @@ wlc_phy_poll_rssi_nphy(phy_info_t *pi, u8 rssi_type, s32 *rssi_buf,
return rssi_out_val;
}

-s16 wlc_phy_tempsense_nphy(phy_info_t *pi)
+s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi)
{
u16 core1_txrf_iqcal1_save, core1_txrf_iqcal2_save;
u16 core2_txrf_iqcal1_save, core2_txrf_iqcal2_save;
@@ -21093,7 +21096,7 @@ s16 wlc_phy_tempsense_nphy(phy_info_t *pi)
}

static void
-wlc_phy_set_rssi_2055_vcm(phy_info_t *pi, u8 rssi_type, u8 *vcm_buf)
+wlc_phy_set_rssi_2055_vcm(struct brcms_phy *pi, u8 rssi_type, u8 *vcm_buf)
{
u8 core;

@@ -21147,7 +21150,7 @@ wlc_phy_set_rssi_2055_vcm(phy_info_t *pi, u8 rssi_type, u8 *vcm_buf)
}
}

-void wlc_phy_rssi_cal_nphy(phy_info_t *pi)
+void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi)
{
if (NREV_GE(pi->pubpi.phy_rev, 3)) {

@@ -21159,7 +21162,7 @@ void wlc_phy_rssi_cal_nphy(phy_info_t *pi)
}
}

-static void wlc_phy_rssi_cal_nphy_rev2(phy_info_t *pi, u8 rssi_type)
+static void wlc_phy_rssi_cal_nphy_rev2(struct brcms_phy *pi, u8 rssi_type)
{
s32 target_code;
u16 classif_state;
@@ -21367,7 +21370,7 @@ static void wlc_phy_rssi_cal_nphy_rev2(phy_info_t *pi, u8 rssi_type)
}

int
-wlc_phy_rssi_compute_nphy(phy_info_t *pi, struct brcms_d11rxhdr *wlc_rxh)
+wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct brcms_d11rxhdr *wlc_rxh)
{
struct d11rxhdr *rxh = &wlc_rxh->rxhdr;
s16 rxpwr, rxpwr0, rxpwr1;
@@ -21407,7 +21410,7 @@ wlc_phy_rssi_compute_nphy(phy_info_t *pi, struct brcms_d11rxhdr *wlc_rxh)
}

static void
-wlc_phy_rfctrlintc_override_nphy(phy_info_t *pi, u8 field, u16 value,
+wlc_phy_rfctrlintc_override_nphy(struct brcms_phy *pi, u8 field, u16 value,
u8 core_code)
{
u16 mask;
@@ -21642,7 +21645,7 @@ wlc_phy_rfctrlintc_override_nphy(phy_info_t *pi, u8 field, u16 value,
}
}

-static void wlc_phy_rssi_cal_nphy_rev3(phy_info_t *pi)
+static void wlc_phy_rssi_cal_nphy_rev3(struct brcms_phy *pi)
{
u16 classif_state;
u16 clip_state[2];
@@ -22129,7 +22132,7 @@ static void wlc_phy_rssi_cal_nphy_rev3(phy_info_t *pi)
wlc_phy_clip_det_nphy(pi, 1, clip_state);
}

-static void wlc_phy_restore_rssical_nphy(phy_info_t *pi)
+static void wlc_phy_restore_rssical_nphy(struct brcms_phy *pi)
{
if (CHSPEC_IS2G(pi->radio_chanspec)) {
if (pi->nphy_rssical_chanspec_2G == 0)
@@ -22236,7 +22239,7 @@ static void wlc_phy_restore_rssical_nphy(phy_info_t *pi)
}

static u16
-wlc_phy_gen_load_samples_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
+wlc_phy_gen_load_samples_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val,
u8 dac_test_mode)
{
u8 phy_bw, is_phybw40;
@@ -22285,7 +22288,7 @@ wlc_phy_gen_load_samples_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
}

int
-wlc_phy_tx_tone_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
+wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val,
u8 iqmode, u8 dac_test_mode, bool modify_bbmult)
{
u16 num_samps;
@@ -22305,7 +22308,7 @@ wlc_phy_tx_tone_nphy(phy_info_t *pi, u32 f_kHz, u16 max_val,
}

static void
-wlc_phy_loadsampletable_nphy(phy_info_t *pi, cs32 *tone_buf,
+wlc_phy_loadsampletable_nphy(struct brcms_phy *pi, cs32 *tone_buf,
u16 num_samps)
{
u16 t;
@@ -22333,7 +22336,7 @@ wlc_phy_loadsampletable_nphy(phy_info_t *pi, cs32 *tone_buf,
}

static void
-wlc_phy_runsamples_nphy(phy_info_t *pi, u16 num_samps, u16 loops,
+wlc_phy_runsamples_nphy(struct brcms_phy *pi, u16 num_samps, u16 loops,
u16 wait, u8 iqmode, u8 dac_test_mode,
bool modify_bbmult)
{
@@ -22420,7 +22423,7 @@ wlc_phy_runsamples_nphy(phy_info_t *pi, u16 num_samps, u16 loops,
write_phy_reg(pi, 0xa1, orig_RfseqCoreActv);
}

-void wlc_phy_stopplayback_nphy(phy_info_t *pi)
+void wlc_phy_stopplayback_nphy(struct brcms_phy *pi)
{
u16 playback_status;
u16 bb_mult;
@@ -22462,7 +22465,7 @@ void wlc_phy_stopplayback_nphy(phy_info_t *pi)
wlc_phy_stay_in_carriersearch_nphy(pi, false);
}

-struct nphy_txgains wlc_phy_get_tx_gain_nphy(phy_info_t *pi)
+struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi)
{
u16 base_idx[2], curr_gain[2];
u8 core_no;
@@ -22620,7 +22623,7 @@ struct nphy_txgains wlc_phy_get_tx_gain_nphy(phy_info_t *pi)
}

static void
-wlc_phy_iqcal_gainparams_nphy(phy_info_t *pi, u16 core_no,
+wlc_phy_iqcal_gainparams_nphy(struct brcms_phy *pi, u16 core_no,
struct nphy_txgains target_gain,
struct nphy_iqcal_params *params)
{
@@ -22683,7 +22686,7 @@ wlc_phy_iqcal_gainparams_nphy(phy_info_t *pi, u16 core_no,
}
}

-static void wlc_phy_txcal_radio_setup_nphy(phy_info_t *pi)
+static void wlc_phy_txcal_radio_setup_nphy(struct brcms_phy *pi)
{
u16 jtag_core, core;

@@ -22993,7 +22996,7 @@ static void wlc_phy_txcal_radio_setup_nphy(phy_info_t *pi)
}
}

-static void wlc_phy_txcal_radio_cleanup_nphy(phy_info_t *pi)
+static void wlc_phy_txcal_radio_cleanup_nphy(struct brcms_phy *pi)
{
u16 jtag_core, core;

@@ -23131,7 +23134,7 @@ static void wlc_phy_txcal_radio_cleanup_nphy(phy_info_t *pi)
}
}

-static void wlc_phy_txcal_physetup_nphy(phy_info_t *pi)
+static void wlc_phy_txcal_physetup_nphy(struct brcms_phy *pi)
{
u16 val, mask;

@@ -23283,7 +23286,7 @@ static void wlc_phy_txcal_physetup_nphy(phy_info_t *pi)
}
}

-static void wlc_phy_txcal_phycleanup_nphy(phy_info_t *pi)
+static void wlc_phy_txcal_phycleanup_nphy(struct brcms_phy *pi)
{
u16 mask;

@@ -23365,7 +23368,7 @@ static void wlc_phy_txcal_phycleanup_nphy(phy_info_t *pi)
#define NPHY_TEST_TONE_FREQ_20MHz 2500

void
-wlc_phy_est_tonepwr_nphy(phy_info_t *pi, s32 *qdBm_pwrbuf, u8 num_samps)
+wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf, u8 num_samps)
{
u16 tssi_reg;
s32 temp, pwrindex[2];
@@ -23412,7 +23415,7 @@ wlc_phy_est_tonepwr_nphy(phy_info_t *pi, s32 *qdBm_pwrbuf, u8 num_samps)
(u32) pwrindex[1], 32, &qdBm_pwrbuf[1]);
}

-static void wlc_phy_internal_cal_txgain_nphy(phy_info_t *pi)
+static void wlc_phy_internal_cal_txgain_nphy(struct brcms_phy *pi)
{
u16 txcal_gain[2];

@@ -23436,7 +23439,7 @@ static void wlc_phy_internal_cal_txgain_nphy(phy_info_t *pi)
txcal_gain);
}

-static void wlc_phy_precal_txgain_nphy(phy_info_t *pi)
+static void wlc_phy_precal_txgain_nphy(struct brcms_phy *pi)
{
bool save_bbmult = false;
u8 txcal_index_2057_rev5n7 = 0;
@@ -23524,7 +23527,8 @@ static void wlc_phy_precal_txgain_nphy(phy_info_t *pi)
}

void
-wlc_phy_cal_txgainctrl_nphy(phy_info_t *pi, s32 dBm_targetpower, bool debug)
+wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi, s32 dBm_targetpower,
+ bool debug)
{
int gainctrl_loopidx;
uint core;
@@ -23691,7 +23695,7 @@ wlc_phy_cal_txgainctrl_nphy(phy_info_t *pi, s32 dBm_targetpower, bool debug)
wlc_phy_stay_in_carriersearch_nphy(pi, false);
}

-static void wlc_phy_update_txcal_ladder_nphy(phy_info_t *pi, u16 core)
+static void wlc_phy_update_txcal_ladder_nphy(struct brcms_phy *pi, u16 core)
{
int index;
u32 bbmult_scale;
@@ -23733,7 +23737,7 @@ static void wlc_phy_update_txcal_ladder_nphy(phy_info_t *pi, u16 core)
}
}

-void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
+void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype)
{
struct nphy_txgains target_gain;
u8 tx_pwr_ctrl_state;
@@ -23985,7 +23989,7 @@ void wlc_phy_cal_perical_nphy_run(phy_info_t *pi, u8 caltype)
}

int
-wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, struct nphy_txgains target_gain,
+wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi, struct nphy_txgains target_gain,
bool fullcal, bool mphase)
{
u16 val;
@@ -24355,7 +24359,7 @@ wlc_phy_cal_txiqlo_nphy(phy_info_t *pi, struct nphy_txgains target_gain,
return bcmerror;
}

-static void wlc_phy_reapply_txcal_coeffs_nphy(phy_info_t *pi)
+static void wlc_phy_reapply_txcal_coeffs_nphy(struct brcms_phy *pi)
{
u16 tbl_buf[7];

@@ -24390,7 +24394,7 @@ static void wlc_phy_reapply_txcal_coeffs_nphy(phy_info_t *pi)
}
}

-static void wlc_phy_tx_iq_war_nphy(phy_info_t *pi)
+static void wlc_phy_tx_iq_war_nphy(struct brcms_phy *pi)
{
struct nphy_iq_comp tx_comp;

@@ -24403,7 +24407,8 @@ static void wlc_phy_tx_iq_war_nphy(phy_info_t *pi)
}

void
-wlc_phy_rx_iq_coeffs_nphy(phy_info_t *pi, u8 write, struct nphy_iq_comp *pcomp)
+wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
+ struct nphy_iq_comp *pcomp)
{
if (write) {
write_phy_reg(pi, 0x9a, pcomp->a0);
@@ -24419,8 +24424,8 @@ wlc_phy_rx_iq_coeffs_nphy(phy_info_t *pi, u8 write, struct nphy_iq_comp *pcomp)
}

void
-wlc_phy_rx_iq_est_nphy(phy_info_t *pi, struct phy_iq_est *est, u16 num_samps,
- u8 wait_time, u8 wait_for_crs)
+wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est,
+ u16 num_samps, u8 wait_time, u8 wait_for_crs)
{
u8 core;

@@ -24453,7 +24458,7 @@ wlc_phy_rx_iq_est_nphy(phy_info_t *pi, struct phy_iq_est *est, u16 num_samps,
}

#define CAL_RETRY_CNT 2
-static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
+static void wlc_phy_calc_rx_iq_comp_nphy(struct brcms_phy *pi, u8 core_mask)
{
u8 curr_core;
struct phy_iq_est est[PHY_CORE_MAX];
@@ -24577,7 +24582,7 @@ static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
wlc_phy_rx_iq_coeffs_nphy(pi, 1, &new_comp);
}

-static void wlc_phy_rxcal_radio_setup_nphy(phy_info_t *pi, u8 rx_core)
+static void wlc_phy_rxcal_radio_setup_nphy(struct brcms_phy *pi, u8 rx_core)
{
u16 offtune_val;
u16 bias_g = 0;
@@ -24874,7 +24879,7 @@ static void wlc_phy_rxcal_radio_setup_nphy(phy_info_t *pi, u8 rx_core)
}
}

-static void wlc_phy_rxcal_radio_cleanup_nphy(phy_info_t *pi, u8 rx_core)
+static void wlc_phy_rxcal_radio_cleanup_nphy(struct brcms_phy *pi, u8 rx_core)
{
if (NREV_GE(pi->pubpi.phy_rev, 7)) {
if (rx_core == PHY_CORE_0) {
@@ -25044,7 +25049,7 @@ static void wlc_phy_rxcal_radio_cleanup_nphy(phy_info_t *pi, u8 rx_core)
}
}

-static void wlc_phy_rxcal_physetup_nphy(phy_info_t *pi, u8 rx_core)
+static void wlc_phy_rxcal_physetup_nphy(struct brcms_phy *pi, u8 rx_core)
{
u8 tx_core;
u16 rx_antval, tx_antval;
@@ -25171,7 +25176,7 @@ static void wlc_phy_rxcal_physetup_nphy(phy_info_t *pi, u8 rx_core)
}
}

-static void wlc_phy_rxcal_phycleanup_nphy(phy_info_t *pi, u8 rx_core)
+static void wlc_phy_rxcal_phycleanup_nphy(struct brcms_phy *pi, u8 rx_core)
{

write_phy_reg(pi, 0xa2, pi->tx_rx_cal_phy_saveregs[0]);
@@ -25198,7 +25203,7 @@ static void wlc_phy_rxcal_phycleanup_nphy(phy_info_t *pi, u8 rx_core)
}

static void
-wlc_phy_rxcal_gainctrl_nphy_rev5(phy_info_t *pi, u8 rx_core,
+wlc_phy_rxcal_gainctrl_nphy_rev5(struct brcms_phy *pi, u8 rx_core,
u16 *rxgain, u8 cal_type)
{

@@ -25406,14 +25411,14 @@ wlc_phy_rxcal_gainctrl_nphy_rev5(phy_info_t *pi, u8 rx_core,
}

static void
-wlc_phy_rxcal_gainctrl_nphy(phy_info_t *pi, u8 rx_core, u16 *rxgain,
+wlc_phy_rxcal_gainctrl_nphy(struct brcms_phy *pi, u8 rx_core, u16 *rxgain,
u8 cal_type)
{
wlc_phy_rxcal_gainctrl_nphy_rev5(pi, rx_core, rxgain, cal_type);
}

static u8
-wlc_phy_rc_sweep_nphy(phy_info_t *pi, u8 core_idx, u8 loopback_type)
+wlc_phy_rc_sweep_nphy(struct brcms_phy *pi, u8 core_idx, u8 loopback_type)
{
u32 target_bws[2] = { 9500, 21000 };
u32 ref_tones[2] = { 3000, 6000 };
@@ -25653,9 +25658,9 @@ wlc_phy_rc_sweep_nphy(phy_info_t *pi, u8 core_idx, u8 loopback_type)
}

#define WAIT_FOR_SCOPE 4000
-static int
-wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, struct nphy_txgains target_gain,
- u8 cal_type, bool debug)
+static int wlc_phy_cal_rxiq_nphy_rev3(struct brcms_phy *pi,
+ struct nphy_txgains target_gain,
+ u8 cal_type, bool debug)
{
u16 orig_BBConfig;
u8 core_no, rx_core;
@@ -25811,8 +25816,8 @@ wlc_phy_cal_rxiq_nphy_rev3(phy_info_t *pi, struct nphy_txgains target_gain,
}

static int
-wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, struct nphy_txgains target_gain,
- bool debug)
+wlc_phy_cal_rxiq_nphy_rev2(struct brcms_phy *pi,
+ struct nphy_txgains target_gain, bool debug)
{
struct phy_iq_est est[PHY_CORE_MAX];
u8 core_num, rx_core, tx_core;
@@ -26037,7 +26042,7 @@ wlc_phy_cal_rxiq_nphy_rev2(phy_info_t *pi, struct nphy_txgains target_gain,
}

int
-wlc_phy_cal_rxiq_nphy(phy_info_t *pi, struct nphy_txgains target_gain,
+wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi, struct nphy_txgains target_gain,
u8 cal_type, bool debug)
{
if (NREV_GE(pi->pubpi.phy_rev, 7)) {
@@ -26052,7 +26057,7 @@ wlc_phy_cal_rxiq_nphy(phy_info_t *pi, struct nphy_txgains target_gain,
}
}

-static void wlc_phy_extpa_set_tx_digi_filts_nphy(phy_info_t *pi)
+static void wlc_phy_extpa_set_tx_digi_filts_nphy(struct brcms_phy *pi)
{
int j, type = 2;
u16 addr_offset = 0x2c5;
@@ -26063,7 +26068,7 @@ static void wlc_phy_extpa_set_tx_digi_filts_nphy(phy_info_t *pi)
}
}

-static void wlc_phy_ipa_set_tx_digi_filts_nphy(phy_info_t *pi)
+static void wlc_phy_ipa_set_tx_digi_filts_nphy(struct brcms_phy *pi)
{
int j, type;
u16 addr_offset[] = { 0x186, 0x195,
@@ -26101,7 +26106,7 @@ static void wlc_phy_ipa_set_tx_digi_filts_nphy(phy_info_t *pi)
}
}

-static void wlc_phy_ipa_restore_tx_digi_filts_nphy(phy_info_t *pi)
+static void wlc_phy_ipa_restore_tx_digi_filts_nphy(struct brcms_phy *pi)
{
int j;

@@ -26118,7 +26123,7 @@ static void wlc_phy_ipa_restore_tx_digi_filts_nphy(phy_info_t *pi)
}
}

-static u16 wlc_phy_ipa_get_bbmult_nphy(phy_info_t *pi)
+static u16 wlc_phy_ipa_get_bbmult_nphy(struct brcms_phy *pi)
{
u16 m0m1;

@@ -26127,7 +26132,7 @@ static u16 wlc_phy_ipa_get_bbmult_nphy(phy_info_t *pi)
return m0m1;
}

-static void wlc_phy_ipa_set_bbmult_nphy(phy_info_t *pi, u8 m0, u8 m1)
+static void wlc_phy_ipa_set_bbmult_nphy(struct brcms_phy *pi, u8 m0, u8 m1)
{
u16 m0m1 = (u16) ((m0 << 8) | m1);

@@ -26135,7 +26140,7 @@ static void wlc_phy_ipa_set_bbmult_nphy(phy_info_t *pi, u8 m0, u8 m1)
wlc_phy_table_write_nphy(pi, 15, 1, 95, 16, &m0m1);
}

-static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi)
+static u32 *wlc_phy_get_ipa_gaintbl_nphy(struct brcms_phy *pi)
{
u32 *tx_pwrctrl_tbl = NULL;

@@ -26198,7 +26203,7 @@ static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi)
}

static void
-wlc_phy_papd_cal_setup_nphy(phy_info_t *pi,
+wlc_phy_papd_cal_setup_nphy(struct brcms_phy *pi,
struct nphy_papd_restore_state *state, u8 core)
{
s32 tone_freq;
@@ -26468,7 +26473,7 @@ wlc_phy_papd_cal_setup_nphy(phy_info_t *pi,
}

static void
-wlc_phy_papd_cal_cleanup_nphy(phy_info_t *pi,
+wlc_phy_papd_cal_cleanup_nphy(struct brcms_phy *pi,
struct nphy_papd_restore_state *state)
{
u8 core;
@@ -26595,7 +26600,7 @@ wlc_phy_papd_cal_cleanup_nphy(phy_info_t *pi,
}

static void
-wlc_phy_a1_nphy(phy_info_t *pi, u8 core, u32 winsz, u32 start,
+wlc_phy_a1_nphy(struct brcms_phy *pi, u8 core, u32 winsz, u32 start,
u32 end)
{
u32 *buf, *src, *dst, sz;
@@ -26647,7 +26652,7 @@ wlc_phy_a1_nphy(phy_info_t *pi, u8 core, u32 winsz, u32 start,
}

static void
-wlc_phy_a2_nphy(phy_info_t *pi, struct nphy_ipa_txcalgains *txgains,
+wlc_phy_a2_nphy(struct brcms_phy *pi, struct nphy_ipa_txcalgains *txgains,
enum phy_cal_mode cal_mode, u8 core)
{
u16 phy_a1, phy_a2, phy_a3;
@@ -26936,7 +26941,7 @@ wlc_phy_a2_nphy(phy_info_t *pi, struct nphy_ipa_txcalgains *txgains,
}
}

-static u8 wlc_phy_a3_nphy(phy_info_t *pi, u8 start_gain, u8 core)
+static u8 wlc_phy_a3_nphy(struct brcms_phy *pi, u8 start_gain, u8 core)
{
int phy_a1;
int phy_a2;
@@ -27097,7 +27102,7 @@ static u8 wlc_phy_a3_nphy(phy_info_t *pi, u8 start_gain, u8 core)

}

-static void wlc_phy_a4(phy_info_t *pi, bool full_cal)
+static void wlc_phy_a4(struct brcms_phy *pi, bool full_cal)
{
struct nphy_ipa_txcalgains phy_b1[2];
struct nphy_papd_restore_state phy_b2;
@@ -27386,7 +27391,7 @@ static void wlc_phy_a4(phy_info_t *pi, bool full_cal)
}
}

-void wlc_phy_txpwr_fixpower_nphy(phy_info_t *pi)
+void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi)
{
uint core;
u32 txgain;
@@ -27598,7 +27603,7 @@ wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power, u8 rate_ofdm_start,
}
}

-void wlc_phy_txpwr_apply_nphy(phy_info_t *pi)
+void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi)
{
uint rate1, rate2, band_num;
u8 tmp_bw40po = 0, tmp_cddpo = 0, tmp_stbcpo = 0;
@@ -27796,7 +27801,7 @@ void wlc_phy_txpwr_apply_nphy(phy_info_t *pi)
return;
}

-static void wlc_phy_txpwr_srom_read_ppr_nphy(phy_info_t *pi)
+static void wlc_phy_txpwr_srom_read_ppr_nphy(struct brcms_phy *pi)
{
u16 bw40po, cddpo, stbcpo, bwduppo;
uint band_num;
@@ -28004,7 +28009,7 @@ static void wlc_phy_txpwr_srom_read_ppr_nphy(phy_info_t *pi)
wlc_phy_txpwr_apply_nphy(pi);
}

-static bool wlc_phy_txpwr_srom_read_nphy(phy_info_t *pi)
+static bool wlc_phy_txpwr_srom_read_nphy(struct brcms_phy *pi)
{

pi->antswitch = (u8) PHY_GETINTVAR(pi, "antswitch");
@@ -28064,7 +28069,7 @@ static bool wlc_phy_txpwr_srom_read_nphy(phy_info_t *pi)
return true;
}

-void wlc_phy_txpower_recalc_target_nphy(phy_info_t *pi)
+void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi)
{
u8 tx_pwr_ctrl_state;
wlc_phy_txpwr_limit_to_tbl_nphy(pi);
@@ -28084,7 +28089,7 @@ void wlc_phy_txpower_recalc_target_nphy(phy_info_t *pi)
wlapi_bmac_mctrl(pi->sh->physhim, MCTL_PHYLOCK, 0);
}

-static void wlc_phy_txpwrctrl_coeff_setup_nphy(phy_info_t *pi)
+static void wlc_phy_txpwrctrl_coeff_setup_nphy(struct brcms_phy *pi)
{
u32 idx;
u16 iqloCalbuf[7];
@@ -28155,7 +28160,7 @@ static void wlc_phy_txpwrctrl_coeff_setup_nphy(phy_info_t *pi)
wlc_phy_stay_in_carriersearch_nphy(pi, false);
}

-static void wlc_phy_ipa_internal_tssi_setup_nphy(phy_info_t *pi)
+static void wlc_phy_ipa_internal_tssi_setup_nphy(struct brcms_phy *pi)
{
u8 core;

@@ -28265,7 +28270,7 @@ static void wlc_phy_ipa_internal_tssi_setup_nphy(phy_info_t *pi)
}
}

-static void wlc_phy_txpwrctrl_idle_tssi_nphy(phy_info_t *pi)
+static void wlc_phy_txpwrctrl_idle_tssi_nphy(struct brcms_phy *pi)
{
s32 rssi_buf[4];
s32 int_val;
@@ -28331,7 +28336,7 @@ static void wlc_phy_txpwrctrl_idle_tssi_nphy(phy_info_t *pi)

}

-static void wlc_phy_txpwrctrl_pwr_setup_nphy(phy_info_t *pi)
+static void wlc_phy_txpwrctrl_pwr_setup_nphy(struct brcms_phy *pi)
{
u32 idx;
s16 a1[2], b0[2], b1[2];
@@ -28568,13 +28573,13 @@ static void wlc_phy_txpwrctrl_pwr_setup_nphy(phy_info_t *pi)
wlc_phy_stay_in_carriersearch_nphy(pi, false);
}

-static bool wlc_phy_txpwr_ison_nphy(phy_info_t *pi)
+static bool wlc_phy_txpwr_ison_nphy(struct brcms_phy *pi)
{
return read_phy_reg((pi), 0x1e7) & ((0x1 << 15) |
(0x1 << 14) | (0x1 << 13));
}

-static u8 wlc_phy_txpwr_idx_cur_get_nphy(phy_info_t *pi, u8 core)
+static u8 wlc_phy_txpwr_idx_cur_get_nphy(struct brcms_phy *pi, u8 core)
{
u16 tmp;
tmp = read_phy_reg(pi, ((core == PHY_CORE_0) ? 0x1ed : 0x1ee));
@@ -28584,7 +28589,7 @@ static u8 wlc_phy_txpwr_idx_cur_get_nphy(phy_info_t *pi, u8 core)
}

static void
-wlc_phy_txpwr_idx_cur_set_nphy(phy_info_t *pi, u8 idx0, u8 idx1)
+wlc_phy_txpwr_idx_cur_set_nphy(struct brcms_phy *pi, u8 idx0, u8 idx1)
{
mod_phy_reg(pi, 0x1e7, (0x7f << 0), idx0);

@@ -28592,7 +28597,7 @@ wlc_phy_txpwr_idx_cur_set_nphy(phy_info_t *pi, u8 idx0, u8 idx1)
mod_phy_reg(pi, 0x222, (0xff << 0), idx1);
}

-u16 wlc_phy_txpwr_idx_get_nphy(phy_info_t *pi)
+u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi)
{
u16 tmp;
u16 pwr_idx[2];
@@ -28614,7 +28619,7 @@ u16 wlc_phy_txpwr_idx_get_nphy(phy_info_t *pi)
return tmp;
}

-void wlc_phy_txpwr_papd_cal_nphy(phy_info_t *pi)
+void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi)
{
if (PHY_IPA(pi)
&& (pi->nphy_force_papd_cal
@@ -28630,7 +28635,7 @@ void wlc_phy_txpwr_papd_cal_nphy(phy_info_t *pi)
}
}

-void wlc_phy_txpwrctrl_enable_nphy(phy_info_t *pi, u8 ctrl_type)
+void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type)
{
u16 mask = 0, val = 0, ishw = 0;
u8 ctr;
@@ -28776,7 +28781,7 @@ void wlc_phy_txpwrctrl_enable_nphy(phy_info_t *pi, u8 ctrl_type)
}

void
-wlc_phy_txpwr_index_nphy(phy_info_t *pi, u8 core_mask, s8 txpwrindex,
+wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask, s8 txpwrindex,
bool restore_cals)
{
u8 core, txpwrctl_tbl;
@@ -29015,7 +29020,7 @@ wlc_phy_txpwr_index_nphy(phy_info_t *pi, u8 core_mask, s8 txpwrindex,
}

void
-wlc_phy_txpower_sromlimit_get_nphy(phy_info_t *pi, uint chan, u8 *max_pwr,
+wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan, u8 *max_pwr,
u8 txp_rate_idx)
{
u8 chan_freq_range;
@@ -29042,7 +29047,7 @@ wlc_phy_txpower_sromlimit_get_nphy(phy_info_t *pi, uint chan, u8 *max_pwr,
return;
}

-void wlc_phy_stay_in_carriersearch_nphy(phy_info_t *pi, bool enable)
+void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi, bool enable)
{
u16 clip_off[] = { 0xffff, 0xffff };

@@ -29070,7 +29075,7 @@ void wlc_phy_stay_in_carriersearch_nphy(phy_info_t *pi, bool enable)
}
}

-void wlc_nphy_deaf_mode(phy_info_t *pi, bool mode)
+void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode)
{
wlapi_suspend_mac_and_wait(pi->sh->physhim);

diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index 9ab7fe2..32eb429 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -370,6 +370,7 @@ struct tx_status;
struct d11rxhdr;
struct brcms_d11rxhdr;
struct txpwr_limits;
+struct brcms_phy;

typedef volatile struct intctrlregs intctrlregs_t;
typedef volatile struct pio2regs pio2regs_t;
@@ -385,7 +386,6 @@ typedef u32 ratespec_t;
typedef struct tx_power tx_power_t;
typedef struct chanvec chanvec_t;
typedef struct phy_pub wlc_phy_t;
-typedef struct phy_info phy_info_t;
typedef s32 fixed;
typedef struct _cs32 cs32;
typedef volatile union pmqreg pmqreg_t;
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 19/31] staging: brcm80211: replaced Broadcom specific acronym WLC

From: Roland Vossen <[email protected]>

WLC (caps) was replaced, wlc (small caps) has not been replaced yet.

Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 2 +-
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 40 +-
drivers/staging/brcm80211/brcmsmac/alloc.c | 15 +-
drivers/staging/brcm80211/brcmsmac/ampdu.c | 44 +-
drivers/staging/brcm80211/brcmsmac/antsel.c | 13 +-
drivers/staging/brcm80211/brcmsmac/bmac.c | 138 +++---
drivers/staging/brcm80211/brcmsmac/channel.c | 206 ++++----
drivers/staging/brcm80211/brcmsmac/channel.h | 44 +-
drivers/staging/brcm80211/brcmsmac/d11.h | 12 +-
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 26 +-
drivers/staging/brcm80211/brcmsmac/mac80211_if.h | 2 +-
drivers/staging/brcm80211/brcmsmac/main.c | 595 +++++++++++-----------
drivers/staging/brcm80211/brcmsmac/main.h | 155 +++---
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 106 ++--
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h | 44 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h | 2 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 6 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 31 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.c | 4 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.h | 10 +-
drivers/staging/brcm80211/brcmsmac/pub.h | 165 +++----
drivers/staging/brcm80211/brcmsmac/rate.c | 129 +++---
drivers/staging/brcm80211/brcmsmac/rate.h | 32 +-
drivers/staging/brcm80211/brcmsmac/stf.c | 37 +-
drivers/staging/brcm80211/brcmsmac/types.h | 30 +-
drivers/staging/brcm80211/include/brcmu_wifi.h | 37 +-
drivers/staging/brcm80211/include/defs.h | 26 +-
27 files changed, 995 insertions(+), 956 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index b4d786f..0a3c6e5 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -590,7 +590,7 @@ struct brcmf_pub {
char *pktfilter[100];
int pktfilter_count;

- u8 country_code[WLC_CNTRY_BUF_SZ];
+ u8 country_code[BRCM_CNTRY_BUF_SZ];
char eventmask[BRCMF_EVENTING_MASK_LEN];

};
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 12c6ee3..f6118d1 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -363,18 +363,18 @@ do { \
}

static struct ieee80211_rate __wl_rates[] = {
- RATETAB_ENT(WLC_RATE_1M, 0),
- RATETAB_ENT(WLC_RATE_2M, IEEE80211_RATE_SHORT_PREAMBLE),
- RATETAB_ENT(WLC_RATE_5M5, IEEE80211_RATE_SHORT_PREAMBLE),
- RATETAB_ENT(WLC_RATE_11M, IEEE80211_RATE_SHORT_PREAMBLE),
- RATETAB_ENT(WLC_RATE_6M, 0),
- RATETAB_ENT(WLC_RATE_9M, 0),
- RATETAB_ENT(WLC_RATE_12M, 0),
- RATETAB_ENT(WLC_RATE_18M, 0),
- RATETAB_ENT(WLC_RATE_24M, 0),
- RATETAB_ENT(WLC_RATE_36M, 0),
- RATETAB_ENT(WLC_RATE_48M, 0),
- RATETAB_ENT(WLC_RATE_54M, 0),
+ RATETAB_ENT(BRCM_RATE_1M, 0),
+ RATETAB_ENT(BRCM_RATE_2M, IEEE80211_RATE_SHORT_PREAMBLE),
+ RATETAB_ENT(BRCM_RATE_5M5, IEEE80211_RATE_SHORT_PREAMBLE),
+ RATETAB_ENT(BRCM_RATE_11M, IEEE80211_RATE_SHORT_PREAMBLE),
+ RATETAB_ENT(BRCM_RATE_6M, 0),
+ RATETAB_ENT(BRCM_RATE_9M, 0),
+ RATETAB_ENT(BRCM_RATE_12M, 0),
+ RATETAB_ENT(BRCM_RATE_18M, 0),
+ RATETAB_ENT(BRCM_RATE_24M, 0),
+ RATETAB_ENT(BRCM_RATE_36M, 0),
+ RATETAB_ENT(BRCM_RATE_48M, 0),
+ RATETAB_ENT(BRCM_RATE_54M, 0),
};

#define wl_a_rates (__wl_rates + 4)
@@ -895,7 +895,7 @@ static s32 brcmf_set_frag(struct net_device *dev, u32 frag_threshold)
static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l)
{
s32 err = 0;
- u32 cmd = (l ? WLC_SET_LRL : WLC_SET_SRL);
+ u32 cmd = (l ? BRCM_SET_LRL : BRCM_SET_SRL);

retry = cpu_to_le32(retry);
err = brcmf_dev_ioctl(dev, cmd, &retry, sizeof(retry));
@@ -1025,7 +1025,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
else
bcnprd = cpu_to_le32(100);

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

/* set channel for starter */
target_channel = cpu_to_le32(cfg_priv->channel);
- err = brcmf_dev_ioctl(dev, WLC_SET_CHANNEL,
+ err = brcmf_dev_ioctl(dev, BRCM_SET_CHANNEL,
&target_channel, sizeof(target_channel));
if (unlikely(err)) {
WL_ERR("WLC_SET_CHANNEL failed (%d)\n", err);
@@ -2039,7 +2039,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, WLC_GET_CURR_RATESET, &rateset,
+ err = brcmf_dev_ioctl(dev, BRCM_GET_CURR_RATESET, &rateset,
sizeof(rateset));
if (unlikely(err)) {
WL_ERR("could not get current rateset (%d)\n", err);
@@ -3755,7 +3755,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
}

roamtrigger[0] = WL_ROAM_TRIGGER_LEVEL;
- roamtrigger[1] = WLC_BAND_ALL;
+ roamtrigger[1] = BRCM_BAND_ALL;
err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_ROAM_TRIGGER,
(void *)roamtrigger, sizeof(roamtrigger));
if (unlikely(err)) {
@@ -3764,7 +3764,7 @@ brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
}

roam_delta[0] = WL_ROAM_DELTA;
- roam_delta[1] = WLC_BAND_ALL;
+ 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)) {
@@ -3865,8 +3865,8 @@ static s32 wl_update_wiphybands(struct brcmf_cfg80211_priv *cfg_priv)
s8 phy;
s32 err = 0;

- err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), WLC_GET_PHYLIST, &phy_list,
- sizeof(phy_list));
+ err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCM_GET_PHYLIST,
+ &phy_list, sizeof(phy_list));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
return err;
diff --git a/drivers/staging/brcm80211/brcmsmac/alloc.c b/drivers/staging/brcm80211/brcmsmac/alloc.c
index bf01ba0..7f8dd7b 100644
--- a/drivers/staging/brcm80211/brcmsmac/alloc.c
+++ b/drivers/staging/brcm80211/brcmsmac/alloc.c
@@ -36,11 +36,11 @@ static void brcms_c_tunables_init(struct brcms_tunables *tunables, uint devid)
tunables->maxscb = MAXSCB;
tunables->ampdunummpdu = AMPDU_NUM_MPDU;
tunables->maxpktcb = MAXPKTCB;
- tunables->maxucodebss = WLC_MAX_UCODE_BSS;
- tunables->maxucodebss4 = WLC_MAX_UCODE_BSS4;
+ tunables->maxucodebss = BRCMS_MAX_UCODE_BSS;
+ tunables->maxucodebss4 = BRCMS_MAX_UCODE_BSS4;
tunables->maxbss = MAXBSS;
- tunables->datahiwat = WLC_DATAHIWAT;
- tunables->ampdudatahiwat = WLC_AMPDUDATAHIWAT;
+ tunables->datahiwat = BRCMS_DATAHIWAT;
+ tunables->ampdudatahiwat = BRCMS_AMPDUDATAHIWAT;
tunables->rxbnd = RXBND;
tunables->txsbnd = TXSBND;
}
@@ -169,7 +169,7 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
}

wlc->modulecb =
- kzalloc(sizeof(struct modulecb) * WLC_MAXMODULES, GFP_ATOMIC);
+ kzalloc(sizeof(struct modulecb) * BRCMS_MAXMODULES, GFP_ATOMIC);
if (wlc->modulecb == NULL) {
*err = 1009;
goto fail;
@@ -189,13 +189,14 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
brcms_c_bsscfg_ID_assign(wlc, wlc->cfg);

wlc->wsec_def_keys[0] =
- kzalloc(sizeof(struct wsec_key) * WLC_DEFAULT_KEYS, GFP_ATOMIC);
+ kzalloc(sizeof(struct wsec_key) * BRCMS_DEFAULT_KEYS,
+ GFP_ATOMIC);
if (wlc->wsec_def_keys[0] == NULL) {
*err = 1015;
goto fail;
} else {
int i;
- for (i = 1; i < WLC_DEFAULT_KEYS; i++) {
+ for (i = 1; i < BRCMS_DEFAULT_KEYS; i++) {
wlc->wsec_def_keys[i] = (struct wsec_key *)
((unsigned long)wlc->wsec_def_keys[0] +
(sizeof(struct wsec_key) * i));
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.c b/drivers/staging/brcm80211/brcmsmac/ampdu.c
index 599f6e9..fcaf61e 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.c
@@ -164,7 +164,7 @@ struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc)

ampdu->ffpld_rsvd = AMPDU_DEF_FFPLD_RSVD;
/* bump max ampdu rcv size to 64k for all 11n devices except 4321A0 and 4321A1 */
- if (WLCISNPHY(wlc->band) && NREV_LT(wlc->band->phyrev, 2))
+ if (BRCMS_ISNPHY(wlc->band) && NREV_LT(wlc->band->phyrev, 2))
ampdu->rx_factor = IEEE80211_HT_MAX_AMPDU_32K;
else
ampdu->rx_factor = IEEE80211_HT_MAX_AMPDU_64K;
@@ -443,10 +443,10 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
struct sk_buff *p, *pkt[AMPDU_MAX_MPDU];
u8 tid, ndelim;
int err = 0;
- u8 preamble_type = WLC_GF_PREAMBLE;
- u8 fbr_preamble_type = WLC_GF_PREAMBLE;
- u8 rts_preamble_type = WLC_LONG_PREAMBLE;
- u8 rts_fbr_preamble_type = WLC_LONG_PREAMBLE;
+ u8 preamble_type = BRCMS_GF_PREAMBLE;
+ u8 fbr_preamble_type = BRCMS_GF_PREAMBLE;
+ u8 rts_preamble_type = BRCMS_LONG_PREAMBLE;
+ u8 rts_fbr_preamble_type = BRCMS_LONG_PREAMBLE;

bool rr = true, fbr = false;
uint i, count = 0, fifo, seg_cnt = 0;
@@ -551,8 +551,8 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
}

/* extract the length info */
- len = fbr_iscck ? WLC_GET_CCK_PLCP_LEN(txh->FragPLCPFallback)
- : WLC_GET_MIMO_PLCP_LEN(txh->FragPLCPFallback);
+ len = fbr_iscck ? BRCMS_GET_CCK_PLCP_LEN(txh->FragPLCPFallback)
+ : BRCMS_GET_MIMO_PLCP_LEN(txh->FragPLCPFallback);

/* retrieve null delimiter count */
ndelim = txh->RTSPLCPFallback[AMPDU_FBR_NULL_DELIM];
@@ -622,8 +622,8 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,

if (is40)
mimo_ctlchbw =
- CHSPEC_SB_UPPER(WLC_BAND_PI_RADIO_CHANSPEC)
- ? PHY_TXC1_BW_20MHZ_UP : PHY_TXC1_BW_20MHZ;
+ CHSPEC_SB_UPPER(BRCMS_BAND_PI_RADIO_CHANSPEC)
+ ? PHY_TXC1_BW_20MHZ_UP : PHY_TXC1_BW_20MHZ;

/* rebuild the rspec and rspec_fallback */
rspec = RSPEC_MIMORATE;
@@ -717,31 +717,31 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,

/* remove the pad len from last mpdu */
fbr_iscck = ((le16_to_cpu(txh->XtraFrameTypes) & 0x3) == 0);
- len = fbr_iscck ? WLC_GET_CCK_PLCP_LEN(txh->FragPLCPFallback)
- : WLC_GET_MIMO_PLCP_LEN(txh->FragPLCPFallback);
+ len = fbr_iscck ? BRCMS_GET_CCK_PLCP_LEN(txh->FragPLCPFallback)
+ : BRCMS_GET_MIMO_PLCP_LEN(txh->FragPLCPFallback);
ampdu_len -= roundup(len, 4) - len;

/* patch up the first txh & plcp */
txh = (struct d11txh *) pkt[0]->data;
plcp = (u8 *) (txh + 1);

- WLC_SET_MIMO_PLCP_LEN(plcp, ampdu_len);
+ BRCMS_SET_MIMO_PLCP_LEN(plcp, ampdu_len);
/* mark plcp to indicate ampdu */
- WLC_SET_MIMO_PLCP_AMPDU(plcp);
+ BRCMS_SET_MIMO_PLCP_AMPDU(plcp);

/* reset the mixed mode header durations */
if (txh->MModeLen) {
u16 mmodelen =
brcms_c_calc_lsig_len(wlc, rspec, ampdu_len);
txh->MModeLen = cpu_to_le16(mmodelen);
- preamble_type = WLC_MM_PREAMBLE;
+ preamble_type = BRCMS_MM_PREAMBLE;
}
if (txh->MModeFbrLen) {
u16 mmfbrlen =
brcms_c_calc_lsig_len(wlc, rspec_fallback,
ampdu_len);
txh->MModeFbrLen = cpu_to_le16(mmfbrlen);
- fbr_preamble_type = WLC_MM_PREAMBLE;
+ fbr_preamble_type = BRCMS_MM_PREAMBLE;
}

/* set the preload length */
@@ -759,11 +759,11 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
rts = (struct ieee80211_rts *)&txh->rts_frame;
if ((mch & TXC_PREAMBLE_RTS_MAIN_SHORT) ==
TXC_PREAMBLE_RTS_MAIN_SHORT)
- rts_preamble_type = WLC_SHORT_PREAMBLE;
+ rts_preamble_type = BRCMS_SHORT_PREAMBLE;

if ((mch & TXC_PREAMBLE_RTS_FB_SHORT) ==
TXC_PREAMBLE_RTS_FB_SHORT)
- rts_fbr_preamble_type = WLC_SHORT_PREAMBLE;
+ rts_fbr_preamble_type = BRCMS_SHORT_PREAMBLE;

durid =
brcms_c_compute_rtscts_dur(wlc, use_cts, rts_rspec,
@@ -788,8 +788,8 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
if (fbr) {
mch |= TXC_AMPDU_FBR;
txh->MacTxControlHigh = cpu_to_le16(mch);
- WLC_SET_MIMO_PLCP_AMPDU(plcp);
- WLC_SET_MIMO_PLCP_AMPDU(txh->FragPLCPFallback);
+ BRCMS_SET_MIMO_PLCP_AMPDU(plcp);
+ BRCMS_SET_MIMO_PLCP_AMPDU(txh->FragPLCPFallback);
}

BCMMSG(wlc->wiphy, "wl%d: count %d ampdu_len %d\n",
@@ -1046,9 +1046,9 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
ini->tx_in_transit--;
/* Use high prededence for retransmit to give some punch */
/* brcms_c_txq_enq(wlc, scb, p,
- * WLC_PRIO_TO_PREC(tid)); */
+ * BRCMS_PRIO_TO_PREC(tid)); */
brcms_c_txq_enq(wlc, scb, p,
- WLC_PRIO_TO_HI_PREC(tid));
+ BRCMS_PRIO_TO_HI_PREC(tid));
} else {
/* Retry timeout */
ini->tx_in_transit--;
@@ -1108,7 +1108,7 @@ static int brcms_c_ampdu_set(struct ampdu_info *ampdu, bool on)

static bool brcms_c_ampdu_cap(struct ampdu_info *ampdu)
{
- if (WLC_PHY_11N_CAP(ampdu->wlc->band))
+ if (BRCMS_PHY_11N_CAP(ampdu->wlc->band))
return true;
else
return false;
diff --git a/drivers/staging/brcm80211/brcmsmac/antsel.c b/drivers/staging/brcm80211/brcmsmac/antsel.c
index e93d8ae..c4e76c0 100644
--- a/drivers/staging/brcm80211/brcmsmac/antsel.c
+++ b/drivers/staging/brcm80211/brcmsmac/antsel.c
@@ -31,11 +31,12 @@
#define ANT_SELCFG_RX_DEF 3 /* default rx antenna configuration */

/* useful macros */
-#define WLC_ANTSEL_11N_0(ant) ((((ant) & ANT_SELCFG_MASK) >> 4) & 0xf)
-#define WLC_ANTSEL_11N_1(ant) (((ant) & ANT_SELCFG_MASK) & 0xf)
-#define WLC_ANTIDX_11N(ant) (((WLC_ANTSEL_11N_0(ant)) << 2) + (WLC_ANTSEL_11N_1(ant)))
-#define WLC_ANT_ISAUTO_11N(ant) (((ant) & ANT_SELCFG_AUTO) == ANT_SELCFG_AUTO)
-#define WLC_ANTSEL_11N(ant) ((ant) & ANT_SELCFG_MASK)
+#define BRCMS_ANTSEL_11N_0(ant) ((((ant) & ANT_SELCFG_MASK) >> 4) & 0xf)
+#define BRCMS_ANTSEL_11N_1(ant) (((ant) & ANT_SELCFG_MASK) & 0xf)
+#define BRCMS_ANTIDX_11N(ant) (((BRCMS_ANTSEL_11N_0(ant)) << 2) +\
+ (BRCMS_ANTSEL_11N_1(ant)))
+#define BRCMS_ANT_ISAUTO_11N(ant) (((ant) & ANT_SELCFG_AUTO) == ANT_SELCFG_AUTO)
+#define BRCMS_ANTSEL_11N(ant) ((ant) & ANT_SELCFG_MASK)

/* antenna switch */
/* defines for no boardlevel antenna diversity */
@@ -263,7 +264,7 @@ static u8 brcms_c_antsel_id2antcfg(struct antsel_info *asi, u8 id)
/* boardlevel antenna selection: convert ant_cfg to mimo_antsel (ucode interface) */
static u16 brcms_c_antsel_antcfg2antsel(struct antsel_info *asi, u8 ant_cfg)
{
- u8 idx = WLC_ANTIDX_11N(WLC_ANTSEL_11N(ant_cfg));
+ u8 idx = BRCMS_ANTIDX_11N(BRCMS_ANTSEL_11N(ant_cfg));
u16 mimo_antsel = 0;

if (asi->antsel_type == ANTSEL_2x4) {
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index 412611e..225178e 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -38,7 +38,6 @@
#define SYNTHPU_DLY_PHY_US_QT 100 /* QT synthpu_dly time in us */

#ifndef BMAC_DUP_TO_REMOVE
-#define WLC_RM_WAIT_TX_SUSPEND 4 /* Wait Tx Suspend */

#define ANTCNT 10 /* vanilla M_MAX_ANTCNT value */

@@ -186,7 +185,7 @@ static void WLBANDINITFN(brcms_c_ucode_bsinit) (struct brcms_hardware *wlc_hw)

/* do band-specific ucode IHR, SHM, and SCR inits */
if (D11REV_IS(wlc_hw->corerev, 23)) {
- if (WLCISNPHY(wlc_hw->band)) {
+ if (BRCMS_ISNPHY(wlc_hw->band)) {
brcms_c_write_inits(wlc_hw, d11n0bsinitvals16);
} else {
wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
@@ -195,7 +194,7 @@ static void WLBANDINITFN(brcms_c_ucode_bsinit) (struct brcms_hardware *wlc_hw)
}
} else {
if (D11REV_IS(wlc_hw->corerev, 24)) {
- if (WLCISLCNPHY(wlc_hw->band)) {
+ if (BRCMS_ISLCNPHY(wlc_hw->band)) {
brcms_c_write_inits(wlc_hw,
d11lcn0bsinitvals24);
} else
@@ -421,7 +420,7 @@ brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, chanspec_t chanspec,

/* Switch bands if necessary */
if (NBANDS_HW(wlc_hw) > 1) {
- bandunit = CHSPEC_WLCBANDUNIT(chanspec);
+ bandunit = CHSPEC_BANDUNIT(chanspec);
if (wlc_hw->band->bandunit != bandunit) {
/* brcms_b_setband disables other bandunit,
* use light band switch if not up yet
@@ -501,7 +500,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
NULL), DMAREG(wlc_hw, DMA_RX, 0),
(wme ? tune->ntxd : 0), tune->nrxd,
tune->rxbufsz, -1, tune->nrxbufpost,
- WL_HWRXOFF, &brcm_msg_level);
+ BRCMS_HWRXOFF, &brcm_msg_level);
dma_attach_err |= (NULL == wlc_hw->di[0]);

/*
@@ -681,7 +680,7 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
* But it will be called again inside wlc_corereset, after d11 is out of reset.
*/
brcms_b_clkctl_clk(wlc_hw, CLK_FAST);
- brcms_b_corereset(wlc_hw, WLC_USE_COREFLAGS);
+ brcms_b_corereset(wlc_hw, BRCMS_USE_COREFLAGS);

if (!brcms_b_validate_chip_access(wlc_hw)) {
wiphy_err(wiphy, "wl%d: brcms_b_attach: validate_chip_access "
@@ -708,7 +707,7 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
wlc_hw->boardflags2 = (u32) getintvar(vars, "boardflags2");

if (wlc_hw->boardflags & BFL_NOPLLDOWN)
- brcms_b_pllreq(wlc_hw, true, WLC_PLLREQ_SHARED);
+ brcms_b_pllreq(wlc_hw, true, BRCMS_PLLREQ_SHARED);

if ((wlc_hw->sih->bustype == PCI_BUS)
&& (ai_pci_war16165(wlc_hw->sih)))
@@ -788,9 +787,9 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
brcms_c_setxband(wlc_hw, j);

wlc_hw->band->bandunit = j;
- wlc_hw->band->bandtype = j ? WLC_BAND_5G : WLC_BAND_2G;
+ wlc_hw->band->bandtype = j ? BRCM_BAND_5G : BRCM_BAND_2G;
wlc->band->bandunit = j;
- wlc->band->bandtype = j ? WLC_BAND_5G : WLC_BAND_2G;
+ wlc->band->bandtype = j ? BRCM_BAND_5G : BRCM_BAND_2G;
wlc->core->coreidx = ai_coreidx(wlc_hw->sih);

wlc_hw->machwcap = R_REG(&regs->machwcap);
@@ -824,12 +823,12 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
wlc_phy_get_coreflags(wlc_hw->band->pi);

/* verify good phy_type & supported phy revision */
- if (WLCISNPHY(wlc_hw->band)) {
+ if (BRCMS_ISNPHY(wlc_hw->band)) {
if (NCONF_HAS(wlc_hw->band->phyrev))
goto good_phy;
else
goto bad_phy;
- } else if (WLCISLCNPHY(wlc_hw->band)) {
+ } else if (BRCMS_ISLCNPHY(wlc_hw->band)) {
if (LCNCONF_HAS(wlc_hw->band->phyrev))
goto good_phy;
else
@@ -1002,7 +1001,7 @@ void brcms_b_reset(struct brcms_hardware *wlc_hw)

/* reset the core */
if (!DEVICEREMOVED(wlc_hw->wlc))
- brcms_b_corereset(wlc_hw, WLC_USE_COREFLAGS);
+ brcms_b_corereset(wlc_hw, BRCMS_USE_COREFLAGS);

/* purge the dma rings */
brcms_c_flushqueues(wlc_hw->wlc);
@@ -1028,7 +1027,7 @@ brcms_b_init(struct brcms_hardware *wlc_hw, chanspec_t chanspec,
macintmask = brcms_intrsoff(wlc->wl);

/* set up the specified band and chanspec */
- brcms_c_setxband(wlc_hw, CHSPEC_WLCBANDUNIT(chanspec));
+ brcms_c_setxband(wlc_hw, CHSPEC_BANDUNIT(chanspec));
wlc_phy_chanspec_radio_set(wlc_hw->band->pi, chanspec);

/* do one-time phy inits and calibration */
@@ -1047,10 +1046,10 @@ brcms_b_init(struct brcms_hardware *wlc_hw, chanspec_t chanspec,
/* restore macintmask */
brcms_intrsrestore(wlc->wl, macintmask);

- /* seed wake_override with WLC_WAKE_OVERRIDE_MACSUSPEND since the mac is suspended
- * and brcms_c_enable_mac() will clear this override bit.
+ /* seed wake_override with BRCMS_WAKE_OVERRIDE_MACSUSPEND since the mac
+ * is suspended and brcms_c_enable_mac() will clear this override bit.
*/
- mboolset(wlc_hw->wake_override, WLC_WAKE_OVERRIDE_MACSUSPEND);
+ mboolset(wlc_hw->wake_override, BRCMS_WAKE_OVERRIDE_MACSUSPEND);

/*
* initialize mac_suspend_depth to 1 to match ucode initial suspended state
@@ -1101,7 +1100,7 @@ int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
ai_pci_up(wlc_hw->sih);

/* reset the d11 core */
- brcms_b_corereset(wlc_hw, WLC_USE_COREFLAGS);
+ brcms_b_corereset(wlc_hw, BRCMS_USE_COREFLAGS);

return 0;
}
@@ -1274,10 +1273,10 @@ static void brcms_b_clkctl_clk(struct brcms_hardware *wlc_hw, uint mode)
*/
if (wlc_hw->forcefastclk)
mboolset(wlc_hw->wake_override,
- WLC_WAKE_OVERRIDE_FORCEFAST);
+ BRCMS_WAKE_OVERRIDE_FORCEFAST);
else
mboolclr(wlc_hw->wake_override,
- WLC_WAKE_OVERRIDE_FORCEFAST);
+ BRCMS_WAKE_OVERRIDE_FORCEFAST);
}
}

@@ -1295,7 +1294,7 @@ brcms_c_mhfdef(struct brcms_c_info *wlc, u16 *mhfs, u16 mhf2_init)
if (wlc_hw->boardflags & BFL_NOPLLDOWN)
mhfs[MHF1] |= MHF1_FORCEFASTCLK;

- if (WLCISNPHY(wlc_hw->band) && NREV_LT(wlc_hw->band->phyrev, 2)) {
+ if (BRCMS_ISNPHY(wlc_hw->band) && NREV_LT(wlc_hw->band->phyrev, 2)) {
mhfs[MHF2] |= MHF2_NPHY40MHZ_WAR;
mhfs[MHF1] |= MHF1_IQSWAP_WAR;
}
@@ -1307,10 +1306,10 @@ brcms_c_mhfdef(struct brcms_c_info *wlc, u16 *mhfs, u16 mhf2_init)
* pre-CLK changes should use wlc_write_mhf to get around the optimization
*
*
- * bands values are: WLC_BAND_AUTO <--- Current band only
- * WLC_BAND_5G <--- 5G band only
- * WLC_BAND_2G <--- 2G band only
- * WLC_BAND_ALL <--- All bands
+ * bands values are: BRCM_BAND_AUTO <--- Current band only
+ * BRCM_BAND_5G <--- 5G band only
+ * BRCM_BAND_2G <--- 2G band only
+ * BRCM_BAND_ALL <--- All bands
*/
void
brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val,
@@ -1330,14 +1329,14 @@ brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val,
/* Current band only or all bands,
* then set the band to current band
*/
- case WLC_BAND_AUTO:
- case WLC_BAND_ALL:
+ case BRCM_BAND_AUTO:
+ case BRCM_BAND_ALL:
band = wlc_hw->band;
break;
- case WLC_BAND_5G:
+ case BRCM_BAND_5G:
band = wlc_hw->bandstate[BAND_5G_INDEX];
break;
- case WLC_BAND_2G:
+ case BRCM_BAND_2G:
band = wlc_hw->bandstate[BAND_2G_INDEX];
break;
default:
@@ -1357,7 +1356,7 @@ brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val,
(u16) band->mhfs[idx]);
}

- if (bands == WLC_BAND_ALL) {
+ if (bands == BRCM_BAND_ALL) {
wlc_hw->bandstate[0]->mhfs[idx] =
(wlc_hw->bandstate[0]->mhfs[idx] & ~mask) | val;
wlc_hw->bandstate[1]->mhfs[idx] =
@@ -1372,13 +1371,13 @@ u16 brcms_b_mhf_get(struct brcms_hardware *wlc_hw, u8 idx, int bands)
if (idx >= MHFMAX)
return 0; /* error condition */
switch (bands) {
- case WLC_BAND_AUTO:
+ case BRCM_BAND_AUTO:
band = wlc_hw->band;
break;
- case WLC_BAND_5G:
+ case BRCM_BAND_5G:
band = wlc_hw->bandstate[BAND_5G_INDEX];
break;
- case WLC_BAND_2G:
+ case BRCM_BAND_2G:
band = wlc_hw->bandstate[BAND_2G_INDEX];
break;
default:
@@ -1678,9 +1677,9 @@ static void WLBANDINITFN(brcms_b_upd_synthpu) (struct brcms_hardware *wlc_hw)
struct brcms_c_info *wlc = wlc_hw->wlc;
/* update SYNTHPU_DLY */

- if (WLCISLCNPHY(wlc->band)) {
+ if (BRCMS_ISLCNPHY(wlc->band)) {
v = SYNTHPU_DLY_LPPHY_US;
- } else if (WLCISNPHY(wlc->band) && (NREV_GE(wlc->band->phyrev, 3))) {
+ } else if (BRCMS_ISNPHY(wlc->band) && (NREV_GE(wlc->band->phyrev, 3))) {
v = SYNTHPU_DLY_NPHY_US;
} else {
v = SYNTHPU_DLY_BPHY_US;
@@ -1772,7 +1771,7 @@ void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw)
void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk)
{
/* support(necessary for NPHY and HYPHY) only */
- if (!WLCISNPHY(wlc_hw->band))
+ if (!BRCMS_ISNPHY(wlc_hw->band))
return;

if (ON == clk)
@@ -1804,7 +1803,7 @@ void brcms_b_phy_reset(struct brcms_hardware *wlc_hw)
phy_bw_clkbits = wlc_phy_clk_bwbits(wlc_hw->band->pi);

/* Specific reset sequence required for NPHY rev 3 and 4 */
- if (WLCISNPHY(wlc_hw->band) && NREV_GE(wlc_hw->band->phyrev, 3) &&
+ if (BRCMS_ISNPHY(wlc_hw->band) && NREV_GE(wlc_hw->band->phyrev, 3) &&
NREV_LE(wlc_hw->band->phyrev, 4)) {
/* Set the PHY bandwidth */
ai_core_cflags(wlc_hw->sih, SICF_BWMASK, phy_bw_clkbits);
@@ -2065,7 +2064,7 @@ void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags)
bool fastclk;
u32 resetbits = 0;

- if (flags == WLC_USE_COREFLAGS)
+ if (flags == BRCMS_USE_COREFLAGS)
flags = (wlc_hw->band->pi ? wlc_hw->band->core_flags : 0);

BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
@@ -2238,14 +2237,14 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
sflags = ai_core_sflags(wlc_hw->sih, 0, 0);

if (D11REV_IS(wlc_hw->corerev, 23)) {
- if (WLCISNPHY(wlc_hw->band))
+ if (BRCMS_ISNPHY(wlc_hw->band))
brcms_c_write_inits(wlc_hw, d11n0initvals16);
else
wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
" %d\n", __func__, wlc_hw->unit,
wlc_hw->corerev);
} else if (D11REV_IS(wlc_hw->corerev, 24)) {
- if (WLCISLCNPHY(wlc_hw->band)) {
+ if (BRCMS_ISLCNPHY(wlc_hw->band)) {
brcms_c_write_inits(wlc_hw, d11lcn0initvals24);
} else {
wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
@@ -2403,7 +2402,7 @@ void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode)
W_REG(&regs->tsf_clk_frac_l, 0x8889);
W_REG(&regs->tsf_clk_frac_h, 0x8);
}
- } else if (WLCISLCNPHY(wlc_hw->band)) {
+ } else if (BRCMS_ISLCNPHY(wlc_hw->band)) {
if (spurmode == WL_SPURAVOID_ON1) { /* 82Mhz */
W_REG(&regs->tsf_clk_frac_l, 0x7CE0);
W_REG(&regs->tsf_clk_frac_h, 0xC);
@@ -2440,9 +2439,9 @@ static void brcms_c_gpio_init(struct brcms_c_info *wlc)
if (wlc_hw->antsel_type == ANTSEL_2x3) {
/* Enable antenna diversity, use 2x3 mode */
brcms_b_mhf(wlc_hw, MHF3, MHF3_ANTSEL_EN,
- MHF3_ANTSEL_EN, WLC_BAND_ALL);
+ MHF3_ANTSEL_EN, BRCM_BAND_ALL);
brcms_b_mhf(wlc_hw, MHF3, MHF3_ANTSEL_MODE,
- MHF3_ANTSEL_MODE, WLC_BAND_ALL);
+ MHF3_ANTSEL_MODE, BRCM_BAND_ALL);

/* init superswitch control */
wlc_phy_antsel_init(wlc_hw->band->pi, false);
@@ -2460,9 +2459,9 @@ static void brcms_c_gpio_init(struct brcms_c_info *wlc)

/* Enable antenna diversity, use 2x4 mode */
brcms_b_mhf(wlc_hw, MHF3, MHF3_ANTSEL_EN,
- MHF3_ANTSEL_EN, WLC_BAND_ALL);
+ MHF3_ANTSEL_EN, BRCM_BAND_ALL);
brcms_b_mhf(wlc_hw, MHF3, MHF3_ANTSEL_MODE, 0,
- WLC_BAND_ALL);
+ BRCM_BAND_ALL);

/* Configure the desired clock to be 4Mhz */
brcms_b_write_shm(wlc_hw, M_ANTSEL_CLKDIV,
@@ -2486,7 +2485,7 @@ static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
return;

if (D11REV_IS(wlc_hw->corerev, 23)) {
- if (WLCISNPHY(wlc_hw->band)) {
+ if (BRCMS_ISNPHY(wlc_hw->band)) {
brcms_ucode_write(wlc_hw, bcm43xx_16_mimo,
bcm43xx_16_mimosz);
wlc_hw->ucode_loaded = true;
@@ -2495,7 +2494,7 @@ static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
"corerev %d\n",
__func__, wlc_hw->unit, wlc_hw->corerev);
} else if (D11REV_IS(wlc_hw->corerev, 24)) {
- if (WLCISLCNPHY(wlc_hw->band)) {
+ if (BRCMS_ISLCNPHY(wlc_hw->band)) {
brcms_ucode_write(wlc_hw, bcm43xx_24_lcn,
bcm43xx_24_lcnsz);
wlc_hw->ucode_loaded = true;
@@ -2796,7 +2795,7 @@ static void brcms_b_tx_fifo_suspend(struct brcms_hardware *wlc_hw,
/* force the core awake only if not already */
if (wlc_hw->suspended_fifos == 0)
brcms_c_ucode_wake_override_set(wlc_hw,
- WLC_WAKE_OVERRIDE_TXFIFO);
+ BRCMS_WAKE_OVERRIDE_TXFIFO);

wlc_hw->suspended_fifos |= fifo;

@@ -2805,12 +2804,12 @@ static void brcms_b_tx_fifo_suspend(struct brcms_hardware *wlc_hw,
* which may result in mismatch between ucode and driver
* so suspend the mac before suspending the FIFO
*/
- if (WLC_PHY_11N_CAP(wlc_hw->band))
+ if (BRCMS_PHY_11N_CAP(wlc_hw->band))
brcms_c_suspend_mac_and_wait(wlc_hw->wlc);

dma_txsuspend(wlc_hw->di[tx_fifo]);

- if (WLC_PHY_11N_CAP(wlc_hw->band))
+ if (BRCMS_PHY_11N_CAP(wlc_hw->band))
brcms_c_enable_mac(wlc_hw->wlc);
}
}
@@ -2818,7 +2817,7 @@ static void brcms_b_tx_fifo_suspend(struct brcms_hardware *wlc_hw,
static void brcms_b_tx_fifo_resume(struct brcms_hardware *wlc_hw,
uint tx_fifo)
{
- /* BMAC_NOTE: WLC_TX_FIFO_ENAB is done in brcms_c_dpc() for DMA case
+ /* BMAC_NOTE: BRCMS_TX_FIFO_ENAB is done in brcms_c_dpc() for DMA case
* but need to be done here for PIO otherwise the watchdog will catch
* the inconsistency and fire
*/
@@ -2833,7 +2832,7 @@ static void brcms_b_tx_fifo_resume(struct brcms_hardware *wlc_hw,
wlc_hw->suspended_fifos &= ~(1 << tx_fifo);
if (wlc_hw->suspended_fifos == 0)
brcms_c_ucode_wake_override_clear(wlc_hw,
- WLC_WAKE_OVERRIDE_TXFIFO);
+ BRCMS_WAKE_OVERRIDE_TXFIFO);
}
}

@@ -3048,7 +3047,7 @@ void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc)
return;

/* force the core awake */
- brcms_c_ucode_wake_override_set(wlc_hw, WLC_WAKE_OVERRIDE_MACSUSPEND);
+ brcms_c_ucode_wake_override_set(wlc_hw, BRCMS_WAKE_OVERRIDE_MACSUSPEND);

mc = R_REG(&regs->maccontrol);

@@ -3074,12 +3073,12 @@ void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc)
brcms_b_mctrl(wlc_hw, MCTL_EN_MAC, 0);

SPINWAIT(!(R_REG(&regs->macintstatus) & MI_MACSSPNDD),
- WLC_MAX_MAC_SUSPEND);
+ BRCMS_MAX_MAC_SUSPEND);

if (!(R_REG(&regs->macintstatus) & MI_MACSSPNDD)) {
wiphy_err(wiphy, "wl%d: wlc_suspend_mac_and_wait: waited %d uS"
" and MI_MACSSPNDD is still not on.\n",
- wlc_hw->unit, WLC_MAX_MAC_SUSPEND);
+ wlc_hw->unit, BRCMS_MAX_MAC_SUSPEND);
wiphy_err(wiphy, "wl%d: psmdebug 0x%08x, phydebug 0x%08x, "
"psm_brc 0x%04x\n", wlc_hw->unit,
R_REG(&regs->psmdebug),
@@ -3131,21 +3130,22 @@ void brcms_c_enable_mac(struct brcms_c_info *wlc)
mi = R_REG(&regs->macintstatus);
WARN_ON(mi & MI_MACSSPNDD);

- brcms_c_ucode_wake_override_clear(wlc_hw, WLC_WAKE_OVERRIDE_MACSUSPEND);
+ brcms_c_ucode_wake_override_clear(wlc_hw,
+ BRCMS_WAKE_OVERRIDE_MACSUSPEND);
}

static void brcms_upd_ofdm_pctl1_table(struct brcms_hardware *wlc_hw)
{
u8 rate;
u8 rates[8] = {
- WLC_RATE_6M, WLC_RATE_9M, WLC_RATE_12M, WLC_RATE_18M,
- WLC_RATE_24M, WLC_RATE_36M, WLC_RATE_48M, WLC_RATE_54M
+ BRCM_RATE_6M, BRCM_RATE_9M, BRCM_RATE_12M, BRCM_RATE_18M,
+ BRCM_RATE_24M, BRCM_RATE_36M, BRCM_RATE_48M, BRCM_RATE_54M
};
u16 entry_ptr;
u16 pctl1;
uint i;

- if (!WLC_PHY_11N_CAP(wlc_hw->band))
+ if (!BRCMS_PHY_11N_CAP(wlc_hw->band))
return;

/* walk the phy rate table and update the entries */
@@ -3179,14 +3179,14 @@ static u16 brcms_b_ofdm_ratetable_offset(struct brcms_hardware *wlc_hw,
};
/* OFDM RATE sub-field of PLCP SIGNAL field, per 802.11 sec 17.3.4.1 */
const struct plcp_signal_rate_lookup rate_lookup[] = {
- {WLC_RATE_6M, 0xB},
- {WLC_RATE_9M, 0xF},
- {WLC_RATE_12M, 0xA},
- {WLC_RATE_18M, 0xE},
- {WLC_RATE_24M, 0x9},
- {WLC_RATE_36M, 0xD},
- {WLC_RATE_48M, 0x8},
- {WLC_RATE_54M, 0xC}
+ {BRCM_RATE_6M, 0xB},
+ {BRCM_RATE_9M, 0xF},
+ {BRCM_RATE_12M, 0xA},
+ {BRCM_RATE_18M, 0xE},
+ {BRCM_RATE_24M, 0x9},
+ {BRCM_RATE_36M, 0xD},
+ {BRCM_RATE_48M, 0x8},
+ {BRCM_RATE_54M, 0xC}
};

for (i = 0; i < ARRAY_SIZE(rate_lookup); i++) {
@@ -3543,7 +3543,7 @@ void brcms_b_pllreq(struct brcms_hardware *wlc_hw, bool set, mbool req_bit)

mboolset(wlc_hw->pllreq, req_bit);

- if (mboolisset(wlc_hw->pllreq, WLC_PLLREQ_FLIP)) {
+ if (mboolisset(wlc_hw->pllreq, BRCMS_PLLREQ_FLIP)) {
if (!wlc_hw->sbclk) {
brcms_b_xtal(wlc_hw, ON);
}
@@ -3554,7 +3554,7 @@ void brcms_b_pllreq(struct brcms_hardware *wlc_hw, bool set, mbool req_bit)

mboolclr(wlc_hw->pllreq, req_bit);

- if (mboolisset(wlc_hw->pllreq, WLC_PLLREQ_FLIP)) {
+ if (mboolisset(wlc_hw->pllreq, BRCMS_PLLREQ_FLIP)) {
if (wlc_hw->sbclk) {
brcms_b_xtal(wlc_hw, OFF);
}
@@ -3578,7 +3578,7 @@ u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate)
/* for a given rate, the LS-nibble of the PLCP SIGNAL field is
* the index into the rate table.
*/
- phy_rate = rate_info[rate] & WLC_RATE_MASK;
+ phy_rate = rate_info[rate] & BRCMS_RATE_MASK;
index = phy_rate & 0xf;

/* Find the SHM pointer to the rate table entry by looking in the
diff --git a/drivers/staging/brcm80211/brcmsmac/channel.c b/drivers/staging/brcm80211/brcmsmac/channel.c
index ba245d8..f59693e 100644
--- a/drivers/staging/brcm80211/brcmsmac/channel.c
+++ b/drivers/staging/brcm80211/brcmsmac/channel.c
@@ -41,12 +41,12 @@ struct brcms_cm_band {
struct brcms_cm_info {
struct brcms_pub *pub;
struct brcms_c_info *wlc;
- char srom_ccode[WLC_CNTRY_BUF_SZ]; /* Country Code in SROM */
+ char srom_ccode[BRCM_CNTRY_BUF_SZ]; /* Country Code in SROM */
uint srom_regrev; /* Regulatory Rev for the SROM ccode */
const struct country_info *country; /* current country def */
- char ccode[WLC_CNTRY_BUF_SZ]; /* current internal Country Code */
+ char ccode[BRCM_CNTRY_BUF_SZ]; /* current internal Country Code */
uint regrev; /* current Regulatory Revision */
- char country_abbrev[WLC_CNTRY_BUF_SZ]; /* current advertised ccode */
+ char country_abbrev[BRCM_CNTRY_BUF_SZ]; /* current advertised ccode */
/* per-band state (one per phy/radio) */
struct brcms_cm_band bandstate[MAXBANDS];
/* quiet channels currently for radar sensitivity or 11h support */
@@ -106,7 +106,7 @@ static const struct locale_mimo_info *brcms_c_get_mimo_5g(u8 locale_idx);
#ifdef QDB
#undef QDB
#endif
-#define QDB(n) ((n) * WLC_TXPWR_DB_FACTOR)
+#define QDB(n) ((n) * BRCMS_TXPWR_DB_FACTOR)

/* Regulatory Matrix Spreadsheet (CLM) MIMO v3.7.9 */

@@ -422,7 +422,7 @@ static const struct locale_info locale_i = { /* locale i. channel 1 - 13 */
{QDB(19), QDB(19), QDB(19),
QDB(19), QDB(19), QDB(19)},
{20, 20, 20, 0},
- WLC_EIRP
+ BRCMS_EIRP
};

/*
@@ -435,7 +435,7 @@ static const struct locale_info locale_11 = {
LOCALE_RESTRICTED_NONE,
{QDB(21), QDB(21), QDB(21), QDB(21), QDB(21)},
{23, 23, 23, 30, 30},
- WLC_EIRP | WLC_DFS_EU
+ BRCMS_EIRP | BRCMS_DFS_EU
};

#define LOCALE_2G_IDX_i 0
@@ -500,7 +500,7 @@ static const struct locale_mimo_info *g_mimo_5g_table[] = {
#define LOCALES(band2, band5, mimo2, mimo5) {LC_2G(band2), LC_5G(band5), LC(mimo2), LC(mimo5)}

static const struct {
- char abbrev[WLC_CNTRY_BUF_SZ]; /* country abbreviation */
+ char abbrev[BRCM_CNTRY_BUF_SZ]; /* country abbreviation */
struct country_info country;
} cntry_locales[] = {
{
@@ -619,7 +619,7 @@ static const struct locale_mimo_info *brcms_c_get_mimo_5g(u8 locale_idx)
struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc)
{
struct brcms_cm_info *wlc_cm;
- char country_abbrev[WLC_CNTRY_BUF_SZ];
+ char country_abbrev[BRCM_CNTRY_BUF_SZ];
const struct country_info *country;
struct brcms_pub *pub = wlc->pub;
char *ccode;
@@ -639,19 +639,19 @@ struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc)
/* store the country code for passing up as a regulatory hint */
ccode = getvar(wlc->pub->vars, "ccode");
if (ccode) {
- strncpy(wlc->pub->srom_ccode, ccode, WLC_CNTRY_BUF_SZ - 1);
+ strncpy(wlc->pub->srom_ccode, ccode, BRCM_CNTRY_BUF_SZ - 1);
}

/* internal country information which must match regulatory constraints in firmware */
- memset(country_abbrev, 0, WLC_CNTRY_BUF_SZ);
+ memset(country_abbrev, 0, BRCM_CNTRY_BUF_SZ);
strncpy(country_abbrev, "X2", sizeof(country_abbrev) - 1);
country = brcms_c_country_lookup(wlc, country_abbrev);

/* save default country for exiting 11d regulatory mode */
- strncpy(wlc->country_default, country_abbrev, WLC_CNTRY_BUF_SZ - 1);
+ strncpy(wlc->country_default, country_abbrev, BRCM_CNTRY_BUF_SZ - 1);

/* initialize autocountry_default to driver default */
- strncpy(wlc->autocountry_default, "X2", WLC_CNTRY_BUF_SZ - 1);
+ strncpy(wlc->autocountry_default, "X2", BRCM_CNTRY_BUF_SZ - 1);

brcms_c_set_countrycode(wlc_cm, country_abbrev);

@@ -676,8 +676,8 @@ brcms_c_channel_locale_flags_in_band(struct brcms_cm_info *wlc_cm,
static int
brcms_c_set_countrycode(struct brcms_cm_info *wlc_cm, const char *ccode)
{
- char country_abbrev[WLC_CNTRY_BUF_SZ];
- strncpy(country_abbrev, ccode, WLC_CNTRY_BUF_SZ);
+ char country_abbrev[BRCM_CNTRY_BUF_SZ];
+ strncpy(country_abbrev, ccode, BRCM_CNTRY_BUF_SZ);
return brcms_c_set_countrycode_rev(wlc_cm, country_abbrev, ccode, -1);
}

@@ -687,7 +687,7 @@ brcms_c_set_countrycode_rev(struct brcms_cm_info *wlc_cm,
const char *ccode, int regrev)
{
const struct country_info *country;
- char mapped_ccode[WLC_CNTRY_BUF_SZ];
+ char mapped_ccode[BRCM_CNTRY_BUF_SZ];
uint mapped_regrev;

/* if regrev is -1, lookup the mapped country code,
@@ -701,7 +701,7 @@ brcms_c_set_countrycode_rev(struct brcms_cm_info *wlc_cm,
} else {
/* find the matching built-in country definition */
country = brcms_c_country_lookup_direct(ccode, regrev);
- strncpy(mapped_ccode, ccode, WLC_CNTRY_BUF_SZ);
+ strncpy(mapped_ccode, ccode, BRCM_CNTRY_BUF_SZ);
mapped_regrev = regrev;
}

@@ -727,22 +727,22 @@ brcms_c_set_country_common(struct brcms_cm_info *wlc_cm,
const struct locale_mimo_info *li_mimo;
const struct locale_info *locale;
struct brcms_c_info *wlc = wlc_cm->wlc;
- char prev_country_abbrev[WLC_CNTRY_BUF_SZ];
+ char prev_country_abbrev[BRCM_CNTRY_BUF_SZ];

/* save current country state */
wlc_cm->country = country;

- memset(&prev_country_abbrev, 0, WLC_CNTRY_BUF_SZ);
+ memset(&prev_country_abbrev, 0, BRCM_CNTRY_BUF_SZ);
strncpy(prev_country_abbrev, wlc_cm->country_abbrev,
- WLC_CNTRY_BUF_SZ - 1);
+ BRCM_CNTRY_BUF_SZ - 1);

- strncpy(wlc_cm->country_abbrev, country_abbrev, WLC_CNTRY_BUF_SZ - 1);
- strncpy(wlc_cm->ccode, ccode, WLC_CNTRY_BUF_SZ - 1);
+ strncpy(wlc_cm->country_abbrev, country_abbrev, BRCM_CNTRY_BUF_SZ - 1);
+ strncpy(wlc_cm->ccode, ccode, BRCM_CNTRY_BUF_SZ - 1);
wlc_cm->regrev = regrev;

/* disable/restore nmode based on country regulations */
li_mimo = brcms_c_get_mimo_2g(country->locale_mimo_2G);
- if (li_mimo && (li_mimo->flags & WLC_NO_MIMO)) {
+ if (li_mimo && (li_mimo->flags & BRCMS_NO_MIMO)) {
brcms_c_set_nmode(wlc, OFF);
wlc->stf->no_cddstbc = true;
} else {
@@ -755,7 +755,7 @@ brcms_c_set_country_common(struct brcms_cm_info *wlc_cm,
brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]);
/* set or restore gmode as required by regulatory */
locale = brcms_c_get_locale_2g(country->locale_2G);
- if (locale && (locale->flags & WLC_NO_OFDM)) {
+ if (locale && (locale->flags & BRCMS_NO_OFDM)) {
brcms_c_set_gmode(wlc, GMODE_LEGACY_B, false);
} else {
brcms_c_set_gmode(wlc, wlc->protection->gmode_user, false);
@@ -773,7 +773,7 @@ static const struct country_info *
brcms_c_country_lookup(struct brcms_c_info *wlc, const char *ccode)
{
const struct country_info *country;
- char mapped_ccode[WLC_CNTRY_BUF_SZ];
+ char mapped_ccode[BRCM_CNTRY_BUF_SZ];
uint mapped_regrev;

/* map the country code to a built-in country code, regrev, and country_info struct */
@@ -794,14 +794,14 @@ brcms_c_countrycode_map(struct brcms_cm_info *wlc_cm, const char *ccode,
int mapped;

/* check for currently supported ccode size */
- if (strlen(ccode) > (WLC_CNTRY_BUF_SZ - 1)) {
+ if (strlen(ccode) > (BRCM_CNTRY_BUF_SZ - 1)) {
wiphy_err(wlc->wiphy, "wl%d: %s: ccode \"%s\" too long for "
"match\n", wlc->pub->unit, __func__, ccode);
return NULL;
}

/* default mapping is the given ccode and regrev 0 */
- strncpy(mapped_ccode, ccode, WLC_CNTRY_BUF_SZ);
+ strncpy(mapped_ccode, ccode, BRCM_CNTRY_BUF_SZ);
*mapped_regrev = 0;

/* If the desired country code matches the srom country code,
@@ -959,8 +959,7 @@ static void brcms_c_channels_commit(struct brcms_cm_info *wlc_cm)
if (wlc->pub->up && chan != INVCHANNEL) {
brcms_c_channel_reg_limits(wlc_cm, wlc->chanspec, &txpwr);
brcms_c_channel_min_txpower_limits_with_local_constraint(wlc_cm,
- &txpwr,
- WLC_TXPWR_MAX);
+ &txpwr, BRCMS_TXPWR_MAX);
wlc_phy_txpower_limit_set(wlc->band->pi, &txpwr, wlc->chanspec);
}
}
@@ -1050,66 +1049,66 @@ brcms_c_channel_min_txpower_limits_with_local_constraint(
}

/* 20 MHz Legacy OFDM CDD */
- for (j = 0; j < WLC_NUM_RATES_OFDM; j++) {
+ for (j = 0; j < BRCMS_NUM_RATES_OFDM; j++) {
txpwr->ofdm_cdd[j] =
min(txpwr->ofdm_cdd[j], local_constraint_qdbm);
}

/* 40 MHz Legacy OFDM SISO */
- for (j = 0; j < WLC_NUM_RATES_OFDM; j++) {
+ for (j = 0; j < BRCMS_NUM_RATES_OFDM; j++) {
txpwr->ofdm_40_siso[j] =
min(txpwr->ofdm_40_siso[j], local_constraint_qdbm);
}

/* 40 MHz Legacy OFDM CDD */
- for (j = 0; j < WLC_NUM_RATES_OFDM; j++) {
+ for (j = 0; j < BRCMS_NUM_RATES_OFDM; j++) {
txpwr->ofdm_40_cdd[j] =
min(txpwr->ofdm_40_cdd[j], local_constraint_qdbm);
}

/* 20MHz MCS 0-7 SISO */
- for (j = 0; j < WLC_NUM_RATES_MCS_1_STREAM; j++) {
+ for (j = 0; j < BRCMS_NUM_RATES_MCS_1_STREAM; j++) {
txpwr->mcs_20_siso[j] =
min(txpwr->mcs_20_siso[j], local_constraint_qdbm);
}

/* 20MHz MCS 0-7 CDD */
- for (j = 0; j < WLC_NUM_RATES_MCS_1_STREAM; j++) {
+ for (j = 0; j < BRCMS_NUM_RATES_MCS_1_STREAM; j++) {
txpwr->mcs_20_cdd[j] =
min(txpwr->mcs_20_cdd[j], local_constraint_qdbm);
}

/* 20MHz MCS 0-7 STBC */
- for (j = 0; j < WLC_NUM_RATES_MCS_1_STREAM; j++) {
+ for (j = 0; j < BRCMS_NUM_RATES_MCS_1_STREAM; j++) {
txpwr->mcs_20_stbc[j] =
min(txpwr->mcs_20_stbc[j], local_constraint_qdbm);
}

/* 20MHz MCS 8-15 MIMO */
- for (j = 0; j < WLC_NUM_RATES_MCS_2_STREAM; j++)
+ for (j = 0; j < BRCMS_NUM_RATES_MCS_2_STREAM; j++)
txpwr->mcs_20_mimo[j] =
min(txpwr->mcs_20_mimo[j], local_constraint_qdbm);

/* 40MHz MCS 0-7 SISO */
- for (j = 0; j < WLC_NUM_RATES_MCS_1_STREAM; j++) {
+ for (j = 0; j < BRCMS_NUM_RATES_MCS_1_STREAM; j++) {
txpwr->mcs_40_siso[j] =
min(txpwr->mcs_40_siso[j], local_constraint_qdbm);
}

/* 40MHz MCS 0-7 CDD */
- for (j = 0; j < WLC_NUM_RATES_MCS_1_STREAM; j++) {
+ for (j = 0; j < BRCMS_NUM_RATES_MCS_1_STREAM; j++) {
txpwr->mcs_40_cdd[j] =
min(txpwr->mcs_40_cdd[j], local_constraint_qdbm);
}

/* 40MHz MCS 0-7 STBC */
- for (j = 0; j < WLC_NUM_RATES_MCS_1_STREAM; j++) {
+ for (j = 0; j < BRCMS_NUM_RATES_MCS_1_STREAM; j++) {
txpwr->mcs_40_stbc[j] =
min(txpwr->mcs_40_stbc[j], local_constraint_qdbm);
}

/* 40MHz MCS 8-15 MIMO */
- for (j = 0; j < WLC_NUM_RATES_MCS_2_STREAM; j++)
+ for (j = 0; j < BRCMS_NUM_RATES_MCS_2_STREAM; j++)
txpwr->mcs_40_mimo[j] =
min(txpwr->mcs_40_mimo[j], local_constraint_qdbm);

@@ -1143,112 +1142,122 @@ static void wlc_phy_txpower_limits_dump(struct txpwr_limits *txpwr)
char fraction[4][4] = { " ", ".25", ".5 ", ".75" };

sprintf(buf, "CCK ");
- for (i = 0; i < WLC_NUM_RATES_CCK; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_CCK; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->cck[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->cck[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->cck[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->cck[i] % BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "20 MHz OFDM SISO ");
- for (i = 0; i < WLC_NUM_RATES_OFDM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_OFDM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->ofdm[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->ofdm[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->ofdm[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->ofdm[i] % BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "20 MHz OFDM CDD ");
- for (i = 0; i < WLC_NUM_RATES_OFDM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_OFDM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->ofdm_cdd[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->ofdm_cdd[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->ofdm_cdd[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->ofdm_cdd[i] % BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "40 MHz OFDM SISO ");
- for (i = 0; i < WLC_NUM_RATES_OFDM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_OFDM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->ofdm_40_siso[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->ofdm_40_siso[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->ofdm_40_siso[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->ofdm_40_siso[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "40 MHz OFDM CDD ");
- for (i = 0; i < WLC_NUM_RATES_OFDM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_OFDM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->ofdm_40_cdd[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->ofdm_40_cdd[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->ofdm_40_cdd[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->ofdm_40_cdd[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "20 MHz MCS0-7 SISO ");
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->mcs_20_siso[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->mcs_20_siso[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->mcs_20_siso[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->mcs_20_siso[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "20 MHz MCS0-7 CDD ");
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->mcs_20_cdd[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->mcs_20_cdd[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->mcs_20_cdd[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->mcs_20_cdd[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "20 MHz MCS0-7 STBC ");
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->mcs_20_stbc[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->mcs_20_stbc[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->mcs_20_stbc[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->mcs_20_stbc[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "20 MHz MCS8-15 SDM ");
- for (i = 0; i < WLC_NUM_RATES_MCS_2_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_2_STREAM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->mcs_20_mimo[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->mcs_20_mimo[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->mcs_20_mimo[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->mcs_20_mimo[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "40 MHz MCS0-7 SISO ");
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->mcs_40_siso[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->mcs_40_siso[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->mcs_40_siso[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->mcs_40_siso[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "40 MHz MCS0-7 CDD ");
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->mcs_40_cdd[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->mcs_40_cdd[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->mcs_40_cdd[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->mcs_40_cdd[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "40 MHz MCS0-7 STBC ");
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->mcs_40_stbc[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->mcs_40_stbc[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->mcs_40_stbc[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->mcs_40_stbc[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

sprintf(buf, "40 MHz MCS8-15 SDM ");
- for (i = 0; i < WLC_NUM_RATES_MCS_2_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_2_STREAM; i++) {
sprintf(buf[strlen(buf)], " %2d%s",
- txpwr->mcs_40_mimo[i] / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->mcs_40_mimo[i] % WLC_TXPWR_DB_FACTOR]);
+ txpwr->mcs_40_mimo[i] / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->mcs_40_mimo[i] %
+ BRCMS_TXPWR_DB_FACTOR]);
}
printk(KERN_DEBUG "%s\n", buf);

printk(KERN_DEBUG "MCS32 %2d%s\n",
- txpwr->mcs32 / WLC_TXPWR_DB_FACTOR,
- fraction[txpwr->mcs32 % WLC_TXPWR_DB_FACTOR]);
+ txpwr->mcs32 / BRCMS_TXPWR_DB_FACTOR,
+ fraction[txpwr->mcs32 % BRCMS_TXPWR_DB_FACTOR]);
}
#endif /* POWER_DBG */

@@ -1282,7 +1291,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
}

chan = CHSPEC_CHANNEL(chanspec);
- band = wlc->bandstate[CHSPEC_WLCBANDUNIT(chanspec)];
+ band = wlc->bandstate[CHSPEC_BANDUNIT(chanspec)];
li = BAND_5G(band->bandtype) ?
brcms_c_get_locale_5g(country->locale_5G) :
brcms_c_get_locale_2g(country->locale_2G);
@@ -1291,7 +1300,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
brcms_c_get_mimo_5g(country->locale_mimo_5G) :
brcms_c_get_mimo_2g(country->locale_mimo_2G);

- if (li->flags & WLC_EIRP) {
+ if (li->flags & BRCMS_EIRP) {
delta = band->antgain;
} else {
delta = 0;
@@ -1312,7 +1321,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
maxpwr = max(maxpwr, 0);
maxpwr = min(maxpwr, conducted_max);

- for (i = 0; i < WLC_NUM_RATES_CCK; i++)
+ for (i = 0; i < BRCMS_NUM_RATES_CCK; i++)
txpwr->cck[i] = (u8) maxpwr;
}

@@ -1332,11 +1341,10 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
if (BAND_2G(band->bandtype))
maxpwr = min_t(int, maxpwr, txpwr->cck[0]);

- for (i = 0; i < WLC_NUM_RATES_OFDM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_OFDM; i++)
txpwr->ofdm[i] = (u8) maxpwr;
- }

- for (i = 0; i < WLC_NUM_RATES_OFDM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_OFDM; i++) {
/* OFDM 40 MHz SISO has the same power as the corresponding MCS0-7 rate unless
* overriden by the locale specific code. We set this value to 0 as a
* flag (presumably 0 dBm isn't a possibility) and then copy the MCS0-7 value
@@ -1350,7 +1358,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
}

/* MIMO/HT specific limits */
- if (li_mimo->flags & WLC_EIRP) {
+ if (li_mimo->flags & BRCMS_EIRP) {
delta = band->antgain;
} else {
delta = 0;
@@ -1372,7 +1380,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
maxpwr40 = max(maxpwr40, 0);

/* Fill in the MCS 0-7 (SISO) rates */
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {

/* 20 MHz has the same power as the corresponding OFDM rate unless
* overriden by the locale specific code.
@@ -1382,7 +1390,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
}

/* Fill in the MCS 0-7 CDD rates */
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
txpwr->mcs_20_cdd[i] = (u8) maxpwr20;
txpwr->mcs_40_cdd[i] = (u8) maxpwr40;
}
@@ -1398,20 +1406,20 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
}
}

- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
txpwr->mcs_20_siso[i] = (u8) maxpwr20;
txpwr->mcs_40_siso[i] = (u8) maxpwr40;
}
}

/* Fill in the MCS 0-7 STBC rates */
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
txpwr->mcs_20_stbc[i] = 0;
txpwr->mcs_40_stbc[i] = 0;
}

/* Fill in the MCS 8-15 SDM rates */
- for (i = 0; i < WLC_NUM_RATES_MCS_2_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_2_STREAM; i++) {
txpwr->mcs_20_mimo[i] = (u8) maxpwr20;
txpwr->mcs_40_mimo[i] = (u8) maxpwr40;
}
@@ -1419,7 +1427,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
/* Fill in MCS32 */
txpwr->mcs32 = (u8) maxpwr40;

- for (i = 0, j = 0; i < WLC_NUM_RATES_OFDM; i++, j++) {
+ for (i = 0, j = 0; i < BRCMS_NUM_RATES_OFDM; i++, j++) {
if (txpwr->ofdm_40_cdd[i] == 0)
txpwr->ofdm_40_cdd[i] = txpwr->mcs_40_cdd[j];
if (i == 0) {
@@ -1433,12 +1441,12 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
* provided explicitly.
*/

- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
if (txpwr->mcs_40_siso[i] == 0)
txpwr->mcs_40_siso[i] = txpwr->mcs_40_cdd[i];
}

- for (i = 0, j = 0; i < WLC_NUM_RATES_OFDM; i++, j++) {
+ for (i = 0, j = 0; i < BRCMS_NUM_RATES_OFDM; i++, j++) {
if (txpwr->ofdm_40_siso[i] == 0)
txpwr->ofdm_40_siso[i] = txpwr->mcs_40_siso[j];
if (i == 0) {
@@ -1451,7 +1459,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
/* Copy the 20 and 40 MHz MCS0-7 CDD values to the corresponding STBC values if they weren't
* provided explicitly.
*/
- for (i = 0; i < WLC_NUM_RATES_MCS_1_STREAM; i++) {
+ for (i = 0; i < BRCMS_NUM_RATES_MCS_1_STREAM; i++) {
if (txpwr->mcs_20_stbc[i] == 0)
txpwr->mcs_20_stbc[i] = txpwr->mcs_20_cdd[i];

@@ -1497,7 +1505,7 @@ brcms_c_valid_chanspec_ext(struct brcms_cm_info *wlc_cm, chanspec_t chspec,
}

if (CHANNEL_BANDUNIT(wlc_cm->wlc, channel) !=
- CHSPEC_WLCBANDUNIT(chspec))
+ CHSPEC_BANDUNIT(chspec))
return false;

/* Check a 20Mhz channel */
@@ -1511,12 +1519,12 @@ brcms_c_valid_chanspec_ext(struct brcms_cm_info *wlc_cm, chanspec_t chspec,
/* We know we are now checking a 40MHZ channel, so we should only be here
* for NPHYS
*/
- if (WLCISNPHY(wlc->band) || WLCISSSLPNPHY(wlc->band)) {
+ if (BRCMS_ISNPHY(wlc->band) || BRCMS_ISSSLPNPHY(wlc->band)) {
u8 upper_sideband = 0, idx;
u8 num_ch20_entries =
sizeof(chan20_info) / sizeof(struct chan20_info);

- if (!VALID_40CHANSPEC_IN_BAND(wlc, CHSPEC_WLCBANDUNIT(chspec)))
+ if (!VALID_40CHANSPEC_IN_BAND(wlc, CHSPEC_BANDUNIT(chspec)))
return false;

if (dualband) {
diff --git a/drivers/staging/brcm80211/brcmsmac/channel.h b/drivers/staging/brcm80211/brcmsmac/channel.h
index ff7123c..d22f2f5 100644
--- a/drivers/staging/brcm80211/brcmsmac/channel.h
+++ b/drivers/staging/brcm80211/brcmsmac/channel.h
@@ -17,7 +17,8 @@
#ifndef _BRCM_CHANNEL_H_
#define _BRCM_CHANNEL_H_

-#define WLC_TXPWR_DB_FACTOR 4 /* conversion for phy txpwr cacluations that use .25 dB units */
+/* conversion for phy txpwr calculations that use .25 dB units */
+#define BRCMS_TXPWR_DB_FACTOR 4


/* maxpwr mapping to 5GHz band channels:
@@ -46,8 +47,10 @@
#define CHANNEL_POWER_IDX_5G(c) \
(((c) < 52) ? 0 : (((c) < 62) ? 1 : (((c) < 100) ? 2 : (((c) < 149) ? 3 : 4))))

-#define WLC_MAXPWR_TBL_SIZE 6 /* max of BAND_5G_PWR_LVLS and 6 for 2.4 GHz */
-#define WLC_MAXPWR_MIMO_TBL_SIZE 14 /* max of BAND_5G_PWR_LVLS and 14 for 2.4 GHz */
+/* max of BAND_5G_PWR_LVLS and 6 for 2.4 GHz */
+#define BRCMS_MAXPWR_TBL_SIZE 6
+/* max of BAND_5G_PWR_LVLS and 14 for 2.4 GHz */
+#define BRCMS_MAXPWR_MIMO_TBL_SIZE 14

#define NBANDS(wlc) ((wlc)->pub->_nbands)
#define NBANDS_PUB(pub) ((pub)->_nbands)
@@ -58,9 +61,12 @@
/* locale channel and power info. */
struct locale_info {
u32 valid_channels;
- u8 radar_channels; /* List of radar sensitive channels */
- u8 restricted_channels; /* List of channels used only if APs are detected */
- s8 maxpwr[WLC_MAXPWR_TBL_SIZE]; /* Max tx pwr in qdBm for each sub-band */
+ /* List of radar sensitive channels */
+ u8 radar_channels;
+ /* List of channels used only if APs are detected */
+ u8 restricted_channels;
+ /* Max tx pwr in qdBm for each sub-band */
+ s8 maxpwr[BRCMS_MAXPWR_TBL_SIZE];
s8 pub_maxpwr[BAND_5G_PWR_LVLS]; /* Country IE advertised max tx pwr in dBm
* per sub-band
*/
@@ -68,25 +74,27 @@ struct locale_info {
};

/* bits for locale_info flags */
-#define WLC_PEAK_CONDUCTED 0x00 /* Peak for locals */
-#define WLC_EIRP 0x01 /* Flag for EIRP */
-#define WLC_DFS_TPC 0x02 /* Flag for DFS TPC */
-#define WLC_NO_OFDM 0x04 /* Flag for No OFDM */
-#define WLC_NO_40MHZ 0x08 /* Flag for No MIMO 40MHz */
-#define WLC_NO_MIMO 0x10 /* Flag for No MIMO, 20 or 40 MHz */
-#define WLC_RADAR_TYPE_EU 0x20 /* Flag for EU */
-#define WLC_DFS_FCC WLC_DFS_TPC /* Flag for DFS FCC */
-#define WLC_DFS_EU (WLC_DFS_TPC | WLC_RADAR_TYPE_EU) /* Flag for DFS EU */
-
-#define ISDFS_EU(fl) (((fl) & WLC_DFS_EU) == WLC_DFS_EU)
+#define BRCMS_PEAK_CONDUCTED 0x00 /* Peak for locals */
+#define BRCMS_EIRP 0x01 /* Flag for EIRP */
+#define BRCMS_DFS_TPC 0x02 /* Flag for DFS TPC */
+#define BRCMS_NO_OFDM 0x04 /* Flag for No OFDM */
+#define BRCMS_NO_40MHZ 0x08 /* Flag for No MIMO 40MHz */
+#define BRCMS_NO_MIMO 0x10 /* Flag for No MIMO, 20 or 40 MHz */
+#define BRCMS_RADAR_TYPE_EU 0x20 /* Flag for EU */
+#define BRCMS_DFS_FCC BRCMS_DFS_TPC /* Flag for DFS FCC */
+#define BRCMS_DFS_EU (BRCMS_DFS_TPC | BRCMS_RADAR_TYPE_EU) /* Flag for DFS EU */
+
+#define ISDFS_EU(fl) (((fl) & BRCMS_DFS_EU) == BRCMS_DFS_EU)

/* locale per-channel tx power limits for MIMO frames
* maxpwr arrays are index by channel for 2.4 GHz limits, and
* by sub-band for 5 GHz limits using CHANNEL_POWER_IDX_5G(channel)
*/
struct locale_mimo_info {
- s8 maxpwr20[WLC_MAXPWR_MIMO_TBL_SIZE]; /* tx 20 MHz power limits, qdBm units */
- s8 maxpwr40[WLC_MAXPWR_MIMO_TBL_SIZE]; /* tx 40 MHz power limits, qdBm units */
+ /* tx 20 MHz power limits, qdBm units */
+ s8 maxpwr20[BRCMS_MAXPWR_MIMO_TBL_SIZE];
+ /* tx 40 MHz power limits, qdBm units */
+ s8 maxpwr40[BRCMS_MAXPWR_MIMO_TBL_SIZE];
u8 flags;
};

diff --git a/drivers/staging/brcm80211/brcmsmac/d11.h b/drivers/staging/brcm80211/brcmsmac/d11.h
index 37629bf..70d3802 100644
--- a/drivers/staging/brcm80211/brcmsmac/d11.h
+++ b/drivers/staging/brcm80211/brcmsmac/d11.h
@@ -681,17 +681,17 @@ struct cck_phy_hdr {
#define MIMO_PLCP_40MHZ 0x80 /* 40 Hz frame */
#define MIMO_PLCP_AMPDU 0x08 /* ampdu */

-#define WLC_GET_CCK_PLCP_LEN(plcp) (plcp[4] + (plcp[5] << 8))
-#define WLC_GET_MIMO_PLCP_LEN(plcp) (plcp[1] + (plcp[2] << 8))
-#define WLC_SET_MIMO_PLCP_LEN(plcp, len) \
+#define BRCMS_GET_CCK_PLCP_LEN(plcp) (plcp[4] + (plcp[5] << 8))
+#define BRCMS_GET_MIMO_PLCP_LEN(plcp) (plcp[1] + (plcp[2] << 8))
+#define BRCMS_SET_MIMO_PLCP_LEN(plcp, len) \
do { \
plcp[1] = len & 0xff; \
plcp[2] = ((len >> 8) & 0xff); \
} while (0);

-#define WLC_SET_MIMO_PLCP_AMPDU(plcp) (plcp[3] |= MIMO_PLCP_AMPDU)
-#define WLC_CLR_MIMO_PLCP_AMPDU(plcp) (plcp[3] &= ~MIMO_PLCP_AMPDU)
-#define WLC_IS_MIMO_PLCP_AMPDU(plcp) (plcp[3] & MIMO_PLCP_AMPDU)
+#define BRCMS_SET_MIMO_PLCP_AMPDU(plcp) (plcp[3] |= MIMO_PLCP_AMPDU)
+#define BRCMS_CLR_MIMO_PLCP_AMPDU(plcp) (plcp[3] &= ~MIMO_PLCP_AMPDU)
+#define BRCMS_IS_MIMO_PLCP_AMPDU(plcp) (plcp[3] & MIMO_PLCP_AMPDU)

/* The dot11a PLCP header is 5 bytes. To simplify the software (so that we
* don't need e.g. different tx DMA headers for 11a and 11b), the PLCP header has
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 77b06d5..84245b9 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -248,7 +248,7 @@ ieee_set_channel(struct ieee80211_hw *hw, struct ieee80211_channel *chan,
switch (type) {
case NL80211_CHAN_HT20:
case NL80211_CHAN_NO_HT:
- err = brcms_c_set(wl->wlc, WLC_SET_CHANNEL, chan->hw_value);
+ err = brcms_c_set(wl->wlc, BRCM_SET_CHANNEL, chan->hw_value);
break;
case NL80211_CHAN_HT40MINUS:
case NL80211_CHAN_HT40PLUS:
@@ -310,13 +310,13 @@ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
}
if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
if (brcms_c_set
- (wl->wlc, WLC_SET_SRL,
+ (wl->wlc, BRCM_SET_SRL,
conf->short_frame_max_tx_count) < 0) {
wiphy_err(wiphy, "%s: Error setting srl\n", __func__);
err = -EIO;
goto config_out;
}
- if (brcms_c_set(wl->wlc, WLC_SET_LRL,
+ if (brcms_c_set(wl->wlc, BRCM_SET_LRL,
conf->long_frame_max_tx_count) < 0) {
wiphy_err(wiphy, "%s: Error setting lrl\n", __func__);
err = -EIO;
@@ -355,7 +355,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
else
val = 0;
LOCK(wl);
- brcms_c_set(wl->wlc, WLC_SET_SHORTSLOT_OVERRIDE, val);
+ brcms_c_set(wl->wlc, BRCMS_SET_SHORTSLOT_OVERRIDE, val);
UNLOCK(wl);
}

@@ -364,11 +364,11 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
u16 mode = info->ht_operation_mode;

LOCK(wl);
- brcms_c_protection_upd(wl->wlc, WLC_PROT_N_CFG,
+ brcms_c_protection_upd(wl->wlc, BRCMS_PROT_N_CFG,
mode & IEEE80211_HT_OP_MODE_PROTECTION);
- brcms_c_protection_upd(wl->wlc, WLC_PROT_N_NONGF,
+ brcms_c_protection_upd(wl->wlc, BRCMS_PROT_N_NONGF,
mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
- brcms_c_protection_upd(wl->wlc, WLC_PROT_N_OBSS,
+ brcms_c_protection_upd(wl->wlc, BRCMS_PROT_N_OBSS,
mode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT);
UNLOCK(wl);
}
@@ -381,7 +381,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,

/* retrieve the current rates */
LOCK(wl);
- error = brcms_c_ioctl(wl->wlc, WLC_GET_CURR_RATESET,
+ error = brcms_c_ioctl(wl->wlc, BRCM_GET_CURR_RATESET,
&rs, sizeof(rs), NULL);
UNLOCK(wl);
if (error) {
@@ -402,13 +402,13 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,

/* update the rate set */
LOCK(wl);
- brcms_c_ioctl(wl->wlc, WLC_SET_RATESET, &rs, sizeof(rs), NULL);
+ brcms_c_ioctl(wl->wlc, BRCM_SET_RATESET, &rs, sizeof(rs), NULL);
UNLOCK(wl);
}
if (changed & BSS_CHANGED_BEACON_INT) {
/* Beacon interval changed */
LOCK(wl);
- brcms_c_set(wl->wlc, WLC_SET_BCNPRD, info->beacon_int);
+ brcms_c_set(wl->wlc, BRCM_SET_BCNPRD, info->beacon_int);
UNLOCK(wl);
}
if (changed & BSS_CHANGED_BSSID) {
@@ -1045,7 +1045,7 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw)
hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL;
hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;

- if (brcms_c_get(wl->wlc, WLC_GET_PHYLIST, (int *)&phy_list) < 0)
+ if (brcms_c_get(wl->wlc, BRCM_GET_PHYLIST, (int *)&phy_list) < 0)
wiphy_err(hw->wiphy, "Phy list failed\n");

if (phy_list[0] == 'n' || phy_list[0] == 'c') {
@@ -1382,9 +1382,9 @@ static void brcms_set_basic_rate(struct wl_rateset *rs, u16 rate, bool is_br)
continue;

if (is_br)
- rs->rates[i] |= WLC_RATE_FLAG;
+ rs->rates[i] |= BRCMS_RATE_FLAG;
else
- rs->rates[i] &= WLC_RATE_MASK;
+ rs->rates[i] &= BRCMS_RATE_MASK;
return;
}
}
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
index 42fc04c..40e3d37 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
@@ -21,7 +21,7 @@
#include <linux/interrupt.h>

/* softmac ioctl definitions */
-#define WLC_SET_SHORTSLOT_OVERRIDE 146
+#define BRCMS_SET_SHORTSLOT_OVERRIDE 146


/* BMAC Note: High-only driver is no longer working in softirq context as it needs to block and
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index b89b0ec..7c06026 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -54,11 +54,14 @@
#define TIMER_INTERVAL_WATCHDOG 1000 /* watchdog timer, in unit of ms */
#define TIMER_INTERVAL_RADIOCHK 800 /* radio monitor timer, in unit of ms */

-#ifndef WLC_MPC_MAX_DELAYCNT
-#define WLC_MPC_MAX_DELAYCNT 10 /* Max MPC timeout, in unit of watchdog */
+/* Max MPC timeout, in unit of watchdog */
+#ifndef BRCMS_MPC_MAX_DELAYCNT
+#define BRCMS_MPC_MAX_DELAYCNT 10
#endif
-#define WLC_MPC_MIN_DELAYCNT 1 /* Min MPC timeout, in unit of watchdog */
-#define WLC_MPC_THRESHOLD 3 /* MPC count threshold level */
+
+/* Min MPC timeout, in unit of watchdog */
+#define BRCMS_MPC_MIN_DELAYCNT 1
+#define BRCMS_MPC_THRESHOLD 3 /* MPC count threshold level */

#define BEACON_INTERVAL_DEFAULT 100 /* beacon interval, in unit of 1024TU */
#define DTIM_INTERVAL_DEFAULT 3 /* DTIM interval, in unit of beacon interval */
@@ -167,7 +170,7 @@
/* To inform the ucode of the last mcast frame posted so that it can clear moredata bit */
#define BCMCFID(wlc, fid) brcms_b_write_shm((wlc)->hw, M_BCMC_FID, (fid))

-#define WLC_WAR16165(wlc) (wlc->pub->sih->bustype == PCI_BUS && \
+#define BRCMS_WAR16165(wlc) (wlc->pub->sih->bustype == PCI_BUS && \
(!AP_ENAB(wlc->pub)) && (wlc->war16165))

/* debug/trace */
@@ -179,7 +182,7 @@ uint brcm_msg_level =
#endif /* BCMDBG */

/* Find basic rate for a given rate */
-#define WLC_BASIC_RATE(wlc, rspec) (IS_MCS(rspec) ? \
+#define BRCMS_BASIC_RATE(wlc, rspec) (IS_MCS(rspec) ? \
(wlc)->band->basic_rate[mcs_table[rspec & RSPEC_RATE_MASK].leg_ofdm] : \
(wlc)->band->basic_rate[rspec & RSPEC_RATE_MASK])

@@ -187,7 +190,7 @@ uint brcm_msg_level =

#define RFDISABLE_DEFAULT 10000000 /* rfdisable delay timer 500 ms, runs of ALP clock */

-#define WLC_TEMPSENSE_PERIOD 10 /* 10 second timeout */
+#define BRCMS_TEMPSENSE_PERIOD 10 /* 10 second timeout */

#define SCAN_IN_PROGRESS(x) 0

@@ -214,22 +217,22 @@ const u8 prio2fifo[NUMPRIO] = {
* Odd numbers are used for HI priority traffic at same precedence levels
* These constants are used ONLY by wlc_prio2prec_map. Do not use them elsewhere.
*/
-#define _WLC_PREC_NONE 0 /* None = - */
-#define _WLC_PREC_BK 2 /* BK - Background */
-#define _WLC_PREC_BE 4 /* BE - Best-effort */
-#define _WLC_PREC_EE 6 /* EE - Excellent-effort */
-#define _WLC_PREC_CL 8 /* CL - Controlled Load */
-#define _WLC_PREC_VI 10 /* Vi - Video */
-#define _WLC_PREC_VO 12 /* Vo - Voice */
-#define _WLC_PREC_NC 14 /* NC - Network Control */
+#define _BRCMS_PREC_NONE 0 /* None = - */
+#define _BRCMS_PREC_BK 2 /* BK - Background */
+#define _BRCMS_PREC_BE 4 /* BE - Best-effort */
+#define _BRCMS_PREC_EE 6 /* EE - Excellent-effort */
+#define _BRCMS_PREC_CL 8 /* CL - Controlled Load */
+#define _BRCMS_PREC_VI 10 /* Vi - Video */
+#define _BRCMS_PREC_VO 12 /* Vo - Voice */
+#define _BRCMS_PREC_NC 14 /* NC - Network Control */

#define MAXMACLIST 64 /* max # source MAC matches */
#define BCN_TEMPLATE_COUNT 2

-#define WLC_BSSCFG_HW_BCN 0x20 /* The BSS is generating beacons in HW */
+/* The BSS is generating beacons in HW */
+#define BRCMS_BSSCFG_HW_BCN 0x20

-#define HWBCN_ENAB(cfg) (((cfg)->flags & WLC_BSSCFG_HW_BCN) != 0)
-#define HWPRB_ENAB(cfg) (((cfg)->flags & WLC_BSSCFG_HW_PRB) != 0)
+#define HWBCN_ENAB(cfg) (((cfg)->flags & BRCMS_BSSCFG_HW_BCN) != 0)

#define MBSS_BCN_ENAB(cfg) 0
#define MBSS_PRB_ENAB(cfg) 0
@@ -237,14 +240,14 @@ const u8 prio2fifo[NUMPRIO] = {

/* 802.1D Priority to precedence queue mapping */
const u8 wlc_prio2prec_map[] = {
- _WLC_PREC_BE, /* 0 BE - Best-effort */
- _WLC_PREC_BK, /* 1 BK - Background */
- _WLC_PREC_NONE, /* 2 None = - */
- _WLC_PREC_EE, /* 3 EE - Excellent-effort */
- _WLC_PREC_CL, /* 4 CL - Controlled Load */
- _WLC_PREC_VI, /* 5 Vi - Video */
- _WLC_PREC_VO, /* 6 Vo - Voice */
- _WLC_PREC_NC, /* 7 NC - Network Control */
+ _BRCMS_PREC_BE, /* 0 BE - Best-effort */
+ _BRCMS_PREC_BK, /* 1 BK - Background */
+ _BRCMS_PREC_NONE, /* 2 None = - */
+ _BRCMS_PREC_EE, /* 3 EE - Excellent-effort */
+ _BRCMS_PREC_CL, /* 4 CL - Controlled Load */
+ _BRCMS_PREC_VI, /* 5 Vi - Video */
+ _BRCMS_PREC_VO, /* 6 Vo - Voice */
+ _BRCMS_PREC_NC, /* 7 NC - Network Control */
};

/* Check if a particular BSS config is AP or STA */
@@ -254,18 +257,9 @@ const u8 wlc_prio2prec_map[] = {

/* As above for all non-NULL BSS configs */
#define FOREACH_BSS(wlc, idx, cfg) \
- for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
+ for (idx = 0; (int) idx < BRCMS_MAXBSSCFG; idx++) \
if ((cfg = (wlc)->bsscfg[idx]))

-/* Sanity check for tx_prec_map and fifo synchup
- * Either there are some packets pending for the fifo, else if fifo is empty then
- * all the corresponding precmap bits should be set
- */
-#define WLC_TX_FIFO_CHECK(wlc, fifo) (TXPKTPENDGET((wlc), (fifo)) || \
- (TXPKTPENDGET((wlc), (fifo)) == 0 && \
- ((wlc)->tx_prec_map & (wlc)->fifo2prec_map[(fifo)]) == \
- (wlc)->fifo2prec_map[(fifo)]))
-
/* TX FIFO number to WME/802.1E Access Category */
const u8 wme_fifo2ac[] = { AC_BK, AC_BE, AC_VI, AC_VO, AC_BE, AC_BE };

@@ -292,10 +286,8 @@ static const u8 acbitmap2maxprio[] = {
};

/* currently the best mechanism for determining SIFS is the band in use */
-#define SIFS(band) ((band)->bandtype == WLC_BAND_5G ? APHY_SIFS_TIME : BPHY_SIFS_TIME);
-
-/* value for # replay counters currently supported */
-#define WLC_REPLAY_CNTRS_VALUE WPA_CAP_16_REPLAY_CNTRS
+#define SIFS(band) ((band)->bandtype == BRCM_BAND_5G ? APHY_SIFS_TIME : \
+ BPHY_SIFS_TIME);

/* local prototypes */
static u16 brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc,
@@ -390,14 +382,14 @@ bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
if (AP_ACTIVE(wlc) || wlc->monitor)
return false;

- for (idx = 0; idx < WLC_MAXBSSCFG; idx++) {
+ for (idx = 0; idx < BRCMS_MAXBSSCFG; idx++) {
cfg = wlc->bsscfg[idx];
if (cfg && BSSCFG_STA(cfg) && cfg->associated) {
/*
* disallow PS when one of the following
* bsscfg specific conditions meets
*/
- if (!cfg->BSS || !WLC_PORTOPEN(cfg))
+ if (!cfg->BSS || !BRCMS_PORTOPEN(cfg))
return false;

if (!cfg->dtim_programmed)
@@ -561,13 +553,14 @@ void brcms_c_init(struct brcms_c_info *wlc)
W_REG(&wlc->regs->rfdisabledly, RFDISABLE_DEFAULT);

/* initialize mpc delay */
- wlc->mpc_delay_off = wlc->mpc_dlycnt = WLC_MPC_MIN_DELAYCNT;
+ wlc->mpc_delay_off = wlc->mpc_dlycnt = BRCMS_MPC_MIN_DELAYCNT;

/*
* Initialize WME parameters; if they haven't been set by some other
* mechanism (IOVar, etc) then read them from the hardware.
*/
- if (WLC_WME_RETRY_SHORT_GET(wlc, 0) == 0) { /* Uninitialized; read from HW */
+ if (BRCMS_WME_RETRY_SHORT_GET(wlc, 0) == 0) {
+ /* Uninitialized; read from HW */
int ac;

for (ac = 0; ac < AC_COUNT; ac++) {
@@ -686,8 +679,8 @@ void brcms_c_switch_shortslot(struct brcms_c_info *wlc, bool shortslot)
struct brcms_bss_cfg *cfg;

/* use the override if it is set */
- if (wlc->shortslot_override != WLC_SHORTSLOT_AUTO)
- shortslot = (wlc->shortslot_override == WLC_SHORTSLOT_ON);
+ if (wlc->shortslot_override != BRCMS_SHORTSLOT_AUTO)
+ shortslot = (wlc->shortslot_override == BRCMS_SHORTSLOT_ON);

if (wlc->shortslot == shortslot)
return;
@@ -713,7 +706,7 @@ static u8 brcms_c_local_constraint_qdbm(struct brcms_c_info *wlc)
u8 local;
s16 local_max;

- local = WLC_TXPWR_MAX;
+ local = BRCMS_TXPWR_MAX;
if (wlc->pub->associated &&
(brcmu_chspec_ctlchan(wlc->chanspec) ==
brcmu_chspec_ctlchan(wlc->home_chanspec))) {
@@ -721,11 +714,12 @@ static u8 brcms_c_local_constraint_qdbm(struct brcms_c_info *wlc)
/* get the local power constraint if we are on the AP's
* channel [802.11h, 7.3.2.13]
*/
- /* Clamp the value between 0 and WLC_TXPWR_MAX w/o overflowing the target */
+ /* Clamp the value between 0 and BRCMS_TXPWR_MAX w/o
+ * overflowing the target */
local_max =
(wlc->txpwr_local_max -
- wlc->txpwr_local_constraint) * WLC_TXPWR_DB_FACTOR;
- if (local_max > 0 && local_max < WLC_TXPWR_MAX)
+ wlc->txpwr_local_constraint) * BRCMS_TXPWR_DB_FACTOR;
+ if (local_max > 0 && local_max < BRCMS_TXPWR_MAX)
return (u8) local_max;
if (local_max < 0)
return 0;
@@ -787,7 +781,7 @@ void brcms_c_set_chanspec(struct brcms_c_info *wlc, chanspec_t chanspec)

/* Switch bands if necessary */
if (NBANDS(wlc) > 1) {
- bandunit = CHSPEC_WLCBANDUNIT(chanspec);
+ bandunit = CHSPEC_BANDUNIT(chanspec);
if (wlc->band->bandunit != bandunit || wlc->bandinit_pending) {
switchband = true;
if (wlc->bandlocked) {
@@ -836,10 +830,10 @@ ratespec_t brcms_c_lowest_basic_rspec(struct brcms_c_info *wlc,
uint i;

/* Use the lowest basic rate */
- lowest_basic_rspec = rs->rates[0] & WLC_RATE_MASK;
+ lowest_basic_rspec = rs->rates[0] & BRCMS_RATE_MASK;
for (i = 0; i < rs->count; i++) {
- if (rs->rates[i] & WLC_RATE_FLAG) {
- lowest_basic_rspec = rs->rates[i] & WLC_RATE_MASK;
+ if (rs->rates[i] & BRCMS_RATE_FLAG) {
+ lowest_basic_rspec = rs->rates[i] & BRCMS_RATE_MASK;
break;
}
}
@@ -866,9 +860,8 @@ void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc,
u16 mask = PHY_TXC_ANT_MASK;

/* for non-siso rates or default setting, use the available chains */
- if (WLC_PHY_11N_CAP(wlc->band)) {
+ if (BRCMS_PHY_11N_CAP(wlc->band))
phytxant = brcms_c_stf_phytxchain_sel(wlc, bcn_rspec);
- }

phyctl = brcms_c_read_shm(wlc, M_BCN_PCTLWD);
phyctl = (phyctl & ~mask) | phytxant;
@@ -883,37 +876,37 @@ void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, int val)
BCMMSG(wlc->wiphy, "idx %d, val %d\n", idx, val);

switch (idx) {
- case WLC_PROT_G_SPEC:
+ case BRCMS_PROT_G_SPEC:
wlc->protection->_g = (bool) val;
break;
- case WLC_PROT_G_OVR:
+ case BRCMS_PROT_G_OVR:
wlc->protection->g_override = (s8) val;
break;
- case WLC_PROT_G_USER:
+ case BRCMS_PROT_G_USER:
wlc->protection->gmode_user = (u8) val;
break;
- case WLC_PROT_OVERLAP:
+ case BRCMS_PROT_OVERLAP:
wlc->protection->overlap = (s8) val;
break;
- case WLC_PROT_N_USER:
+ case BRCMS_PROT_N_USER:
wlc->protection->nmode_user = (s8) val;
break;
- case WLC_PROT_N_CFG:
+ case BRCMS_PROT_N_CFG:
wlc->protection->n_cfg = (s8) val;
break;
- case WLC_PROT_N_CFG_OVR:
+ case BRCMS_PROT_N_CFG_OVR:
wlc->protection->n_cfg_override = (s8) val;
break;
- case WLC_PROT_N_NONGF:
+ case BRCMS_PROT_N_NONGF:
wlc->protection->nongf = (bool) val;
break;
- case WLC_PROT_N_NONGF_OVR:
+ case BRCMS_PROT_N_NONGF_OVR:
wlc->protection->nongf_override = (s8) val;
break;
- case WLC_PROT_N_PAM_OVR:
+ case BRCMS_PROT_N_PAM_OVR:
wlc->protection->n_pam_override = (s8) val;
break;
- case WLC_PROT_N_OBSS:
+ case BRCMS_PROT_N_OBSS:
wlc->protection->n_obss = (bool) val;
break;

@@ -927,9 +920,9 @@ static void brcms_c_ht_update_sgi_rx(struct brcms_c_info *wlc, int val)
{
wlc->ht_cap.cap_info &= ~(IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40);
- wlc->ht_cap.cap_info |= (val & WLC_N_SGI_20) ?
+ wlc->ht_cap.cap_info |= (val & BRCMS_N_SGI_20) ?
IEEE80211_HT_CAP_SGI_20 : 0;
- wlc->ht_cap.cap_info |= (val & WLC_N_SGI_40) ?
+ wlc->ht_cap.cap_info |= (val & BRCMS_N_SGI_40) ?
IEEE80211_HT_CAP_SGI_40 : 0;

if (wlc->pub->up) {
@@ -962,7 +955,7 @@ static void brcms_c_ucode_mac_upd(struct brcms_c_info *wlc)
/* enable or disable any active IBSSs depending on whether or not
* we are on the home channel
*/
- if (wlc->home_chanspec == WLC_BAND_PI_RADIO_CHANSPEC) {
+ if (wlc->home_chanspec == BRCMS_BAND_PI_RADIO_CHANSPEC) {
if (wlc->pub->associated) {
/* BMAC_NOTE: This is something that should be fixed in ucode inits.
* I think that the ucode inits set up the bcn templates and shm values
@@ -970,7 +963,7 @@ static void brcms_c_ucode_mac_upd(struct brcms_c_info *wlc)
* to set up a beacon for testing, the test routines should write it down,
* not expect the inits to populate a bogus beacon.
*/
- if (WLC_PHY_11N_CAP(wlc->band)) {
+ if (BRCMS_PHY_11N_CAP(wlc->band)) {
brcms_c_write_shm(wlc, M_BCN_TXTSF_OFFSET,
wlc->band->bcntsfoff);
}
@@ -1002,7 +995,7 @@ static void brcms_c_bandinit_ordered(struct brcms_c_info *wlc,
band_order[0] = band_order[1] = parkband;
} else {
/* park on the band of the specified chanspec */
- parkband = CHSPEC_WLCBANDUNIT(chanspec);
+ parkband = CHSPEC_BANDUNIT(chanspec);

/* order so that parkband initialize last */
band_order[0] = parkband ^ 1;
@@ -1019,7 +1012,7 @@ static void brcms_c_bandinit_ordered(struct brcms_c_info *wlc,

/* fill in hw_rate */
brcms_c_rateset_filter(&default_rateset, &wlc->band->hw_rateset,
- false, WLC_RATES_CCK_OFDM, WLC_RATE_MASK,
+ false, BRCMS_RATES_CCK_OFDM, BRCMS_RATE_MASK,
(bool) N_ENAB(wlc->pub));

/* init basic rate lookup */
@@ -1060,7 +1053,7 @@ static void WLBANDINITFN(brcms_c_setband) (struct brcms_c_info *wlc,
return;

/* wait for at least one beacon before entering sleeping state */
- for (idx = 0; idx < WLC_MAXBSSCFG; idx++) {
+ for (idx = 0; idx < BRCMS_MAXBSSCFG; idx++) {
cfg = wlc->bsscfg[idx];
if (cfg && BSSCFG_STA(cfg) && cfg->associated)
cfg->PMawakebcn = true;
@@ -1247,19 +1240,21 @@ void brcms_c_info_init(struct brcms_c_info *wlc, int unit)

/* various 802.11g modes */
wlc->shortslot = false;
- wlc->shortslot_override = WLC_SHORTSLOT_AUTO;
+ wlc->shortslot_override = BRCMS_SHORTSLOT_AUTO;

- brcms_c_protection_upd(wlc, WLC_PROT_G_OVR, WLC_PROTECTION_AUTO);
- brcms_c_protection_upd(wlc, WLC_PROT_G_SPEC, false);
+ brcms_c_protection_upd(wlc, BRCMS_PROT_G_OVR, BRCMS_PROTECTION_AUTO);
+ brcms_c_protection_upd(wlc, BRCMS_PROT_G_SPEC, false);

- brcms_c_protection_upd(wlc, WLC_PROT_N_CFG_OVR, WLC_PROTECTION_AUTO);
- brcms_c_protection_upd(wlc, WLC_PROT_N_CFG, WLC_N_PROTECTION_OFF);
- brcms_c_protection_upd(wlc, WLC_PROT_N_NONGF_OVR, WLC_PROTECTION_AUTO);
- brcms_c_protection_upd(wlc, WLC_PROT_N_NONGF, false);
- brcms_c_protection_upd(wlc, WLC_PROT_N_PAM_OVR, AUTO);
+ brcms_c_protection_upd(wlc, BRCMS_PROT_N_CFG_OVR,
+ BRCMS_PROTECTION_AUTO);
+ brcms_c_protection_upd(wlc, BRCMS_PROT_N_CFG, BRCMS_N_PROTECTION_OFF);
+ brcms_c_protection_upd(wlc, BRCMS_PROT_N_NONGF_OVR,
+ BRCMS_PROTECTION_AUTO);
+ brcms_c_protection_upd(wlc, BRCMS_PROT_N_NONGF, false);
+ brcms_c_protection_upd(wlc, BRCMS_PROT_N_PAM_OVR, AUTO);

- brcms_c_protection_upd(wlc, WLC_PROT_OVERLAP,
- WLC_PROTECTION_CTL_OVERLAP);
+ brcms_c_protection_upd(wlc, BRCMS_PROT_OVERLAP,
+ BRCMS_PROTECTION_CTL_OVERLAP);

/* 802.11g draft 4.0 NonERP elt advertisement */
wlc->include_legacy_erp = true;
@@ -1267,7 +1262,7 @@ void brcms_c_info_init(struct brcms_c_info *wlc, int unit)
wlc->stf->ant_rx_ovr = ANT_RX_DIV_DEF;
wlc->stf->txant = ANT_TX_DEF;

- wlc->prb_resp_timeout = WLC_PRB_RESP_TIMEOUT;
+ wlc->prb_resp_timeout = BRCMS_PRB_RESP_TIMEOUT;

wlc->usr_fragthresh = DOT11_DEFAULT_FRAG_LEN;
for (i = 0; i < NFIFO; i++)
@@ -1303,7 +1298,7 @@ void brcms_c_info_init(struct brcms_c_info *wlc, int unit)
wlc->pub->_coex = ON;

/* initialize mpc delay */
- wlc->mpc_delay_off = wlc->mpc_dlycnt = WLC_MPC_MIN_DELAYCNT;
+ wlc->mpc_delay_off = wlc->mpc_dlycnt = BRCMS_MPC_MIN_DELAYCNT;
}

static bool brcms_c_state_bmac_sync(struct brcms_c_info *wlc)
@@ -1314,7 +1309,7 @@ static bool brcms_c_state_bmac_sync(struct brcms_c_info *wlc)
return false;

wlc->machwcap = state_bmac.machwcap;
- brcms_c_protection_upd(wlc, WLC_PROT_N_PAM_OVR,
+ brcms_c_protection_upd(wlc, BRCMS_PROT_N_PAM_OVR,
(s8) state_bmac.preamble_ovr);

return true;
@@ -1416,7 +1411,7 @@ void *brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
goto fail;
}

- pub->phy_11ncapable = WLC_PHY_11N_CAP(wlc->band);
+ pub->phy_11ncapable = BRCMS_PHY_11N_CAP(wlc->band);

/* propagate *vars* from BMAC driver to high driver */
brcms_b_copyfrom_vars(wlc->hw, &pub->vars, &wlc->vars_size);
@@ -1431,7 +1426,7 @@ void *brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
brcms_c_stf_phy_chain_calc(wlc);

/* txchain 1: txant 0, txchain 2: txant 1 */
- if (WLCISNPHY(wlc->band) && (wlc->stf->txstreams == 1))
+ if (BRCMS_ISNPHY(wlc->band) && (wlc->stf->txstreams == 1))
wlc->stf->txant = wlc->stf->hw_txchain - 1;

/* push to BMAC driver */
@@ -1468,19 +1463,19 @@ void *brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
/* init gmode value */
if (BAND_2G(wlc->band->bandtype)) {
wlc->band->gmode = GMODE_AUTO;
- brcms_c_protection_upd(wlc, WLC_PROT_G_USER,
+ brcms_c_protection_upd(wlc, BRCMS_PROT_G_USER,
wlc->band->gmode);
}

/* init _n_enab supported mode */
- if (WLC_PHY_11N_CAP(wlc->band) && CHIP_SUPPORTS_11N(wlc)) {
+ if (BRCMS_PHY_11N_CAP(wlc->band) && CHIP_SUPPORTS_11N(wlc)) {
if (n_disabled & WLFEATURE_DISABLE_11N) {
pub->_n_enab = OFF;
- brcms_c_protection_upd(wlc, WLC_PROT_N_USER,
+ brcms_c_protection_upd(wlc, BRCMS_PROT_N_USER,
OFF);
} else {
pub->_n_enab = SUPPORT_11N;
- brcms_c_protection_upd(wlc, WLC_PROT_N_USER,
+ brcms_c_protection_upd(wlc, BRCMS_PROT_N_USER,
((pub->_n_enab ==
SUPPORT_11N) ? WL_11N_2x2 :
WL_11N_3x3));
@@ -1490,10 +1485,10 @@ void *brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
/* init per-band default rateset, depend on band->gmode */
brcms_default_rateset(wlc, &wlc->band->defrateset);

- /* fill in hw_rateset (used early by WLC_SET_RATESET) */
+ /* fill in hw_rateset (used early by BRCM_SET_RATESET) */
brcms_c_rateset_filter(&wlc->band->defrateset,
&wlc->band->hw_rateset, false,
- WLC_RATES_CCK_OFDM, WLC_RATE_MASK,
+ BRCMS_RATES_CCK_OFDM, BRCMS_RATE_MASK,
(bool) N_ENAB(wlc->pub));
}

@@ -1552,14 +1547,16 @@ void *brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
wlc->mimo_40txbw = AUTO;
wlc->ofdm_40txbw = AUTO;
wlc->cck_40txbw = AUTO;
- brcms_c_update_mimo_band_bwcap(wlc, WLC_N_BW_20IN2G_40IN5G);
+ brcms_c_update_mimo_band_bwcap(wlc, BRCMS_N_BW_20IN2G_40IN5G);

/* Set default values of SGI */
- if (WLC_SGI_CAP_PHY(wlc)) {
- brcms_c_ht_update_sgi_rx(wlc, (WLC_N_SGI_20 | WLC_N_SGI_40));
+ if (BRCMS_SGI_CAP_PHY(wlc)) {
+ brcms_c_ht_update_sgi_rx(wlc, (BRCMS_N_SGI_20 |
+ BRCMS_N_SGI_40));
wlc->sgi_tx = AUTO;
- } else if (WLCISSSLPNPHY(wlc->band)) {
- brcms_c_ht_update_sgi_rx(wlc, (WLC_N_SGI_20 | WLC_N_SGI_40));
+ } else if (BRCMS_ISSSLPNPHY(wlc->band)) {
+ brcms_c_ht_update_sgi_rx(wlc, (BRCMS_N_SGI_20 |
+ BRCMS_N_SGI_40));
wlc->sgi_tx = AUTO;
} else {
brcms_c_ht_update_sgi_rx(wlc, 0);
@@ -1752,9 +1749,11 @@ uint brcms_c_detach(struct brcms_c_info *wlc)
void brcms_c_ap_upd(struct brcms_c_info *wlc)
{
if (AP_ENAB(wlc->pub))
- wlc->PLCPHdr_override = WLC_PLCP_AUTO; /* AP: short not allowed, but not enforced */
+ /* AP: short not allowed, but not enforced */
+ wlc->PLCPHdr_override = BRCMS_PLCP_AUTO;
else
- wlc->PLCPHdr_override = WLC_PLCP_SHORT; /* STA-BSS; short capable */
+ /* STA-BSS; short capable */
+ wlc->PLCPHdr_override = BRCMS_PLCP_SHORT;

/* fixup mpc */
wlc->mpc = true;
@@ -1819,10 +1818,10 @@ void brcms_c_radio_mpc_upd(struct brcms_c_info *wlc)
else if (radio_state == OFF && mpc_radio == ON) {
mboolclr(wlc->pub->radio_disabled, WL_RADIO_MPC_DISABLE);
brcms_c_radio_upd(wlc);
- if (wlc->mpc_offcnt < WLC_MPC_THRESHOLD) {
- wlc->mpc_dlycnt = WLC_MPC_MAX_DELAYCNT;
- } else
- wlc->mpc_dlycnt = WLC_MPC_MIN_DELAYCNT;
+ if (wlc->mpc_offcnt < BRCMS_MPC_THRESHOLD)
+ wlc->mpc_dlycnt = BRCMS_MPC_MAX_DELAYCNT;
+ else
+ wlc->mpc_dlycnt = BRCMS_MPC_MIN_DELAYCNT;
wlc->mpc_dur += OSL_SYSUPTIME() - wlc->mpc_laston_ts;
}
/* Below logic is meant to capture the transition from mpc off to mpc on for reasons
@@ -1855,9 +1854,9 @@ static void brcms_c_down_led_upd(struct brcms_c_info *wlc)
/* maintain LEDs while in down state, turn on sbclk if not available yet */
/* turn on sbclk if necessary */
if (!AP_ENAB(wlc->pub)) {
- brcms_c_pllreq(wlc, true, WLC_PLLREQ_FLIP);
+ brcms_c_pllreq(wlc, true, BRCMS_PLLREQ_FLIP);

- brcms_c_pllreq(wlc, false, WLC_PLLREQ_FLIP);
+ brcms_c_pllreq(wlc, false, BRCMS_PLLREQ_FLIP);
}
}

@@ -1904,7 +1903,7 @@ static void brcms_c_radio_timer(void *arg)
}

/* cap mpc off count */
- if (wlc->mpc_offcnt < WLC_MPC_MAX_DELAYCNT)
+ if (wlc->mpc_offcnt < BRCMS_MPC_MAX_DELAYCNT)
wlc->mpc_offcnt++;

brcms_c_radio_hwdisable_upd(wlc);
@@ -1918,7 +1917,7 @@ static bool brcms_c_radio_monitor_start(struct brcms_c_info *wlc)
return true;

wlc->radio_monitor = true;
- brcms_c_pllreq(wlc, true, WLC_PLLREQ_RADIO_MON);
+ brcms_c_pllreq(wlc, true, BRCMS_PLLREQ_RADIO_MON);
brcms_add_timer(wlc->wl, wlc->radio_timer, TIMER_INTERVAL_RADIOCHK,
true);
return true;
@@ -1930,7 +1929,7 @@ bool brcms_c_radio_monitor_stop(struct brcms_c_info *wlc)
return true;

wlc->radio_monitor = false;
- brcms_c_pllreq(wlc, false, WLC_PLLREQ_RADIO_MON);
+ brcms_c_pllreq(wlc, false, BRCMS_PLLREQ_RADIO_MON);
return brcms_del_timer(wlc->wl, wlc->radio_timer);
}

@@ -1998,14 +1997,14 @@ static void brcms_c_watchdog(void *arg)
}

/* Call any registered watchdog handlers */
- for (i = 0; i < WLC_MAXMODULES; i++) {
+ for (i = 0; i < BRCMS_MAXMODULES; i++) {
if (wlc->modulecb[i].watchdog_fn)
wlc->modulecb[i].watchdog_fn(wlc->modulecb[i].hdl);
}

- if (WLCISNPHY(wlc->band) && !wlc->pub->tempsense_disable &&
+ if (BRCMS_ISNPHY(wlc->band) && !wlc->pub->tempsense_disable &&
((wlc->pub->now - wlc->tempsense_lasttime) >=
- WLC_TEMPSENSE_PERIOD)) {
+ BRCMS_TEMPSENSE_PERIOD)) {
wlc->tempsense_lasttime = wlc->pub->now;
brcms_c_tempsense_upd(wlc);
}
@@ -2030,10 +2029,10 @@ int brcms_c_up(struct brcms_c_info *wlc)
if (wlc->pub->boardrev >= 0x1250
&& (wlc->pub->boardflags & BFL_FEM_BT)) {
brcms_c_mhf(wlc, MHF5, MHF5_4313_GPIOCTRL,
- MHF5_4313_GPIOCTRL, WLC_BAND_ALL);
+ MHF5_4313_GPIOCTRL, BRCM_BAND_ALL);
} else {
brcms_c_mhf(wlc, MHF4, MHF4_EXTPA_ENABLE,
- MHF4_EXTPA_ENABLE, WLC_BAND_ALL);
+ MHF4_EXTPA_ENABLE, BRCM_BAND_ALL);
}
}

@@ -2080,14 +2079,14 @@ int brcms_c_up(struct brcms_c_info *wlc)

/* Set EDCF hostflags */
if (EDCF_ENAB(wlc->pub)) {
- brcms_c_mhf(wlc, MHF1, MHF1_EDCF, MHF1_EDCF, WLC_BAND_ALL);
+ brcms_c_mhf(wlc, MHF1, MHF1_EDCF, MHF1_EDCF, BRCM_BAND_ALL);
} else {
- brcms_c_mhf(wlc, MHF1, MHF1_EDCF, 0, WLC_BAND_ALL);
+ brcms_c_mhf(wlc, MHF1, MHF1_EDCF, 0, BRCM_BAND_ALL);
}

- if (WLC_WAR16165(wlc))
+ if (BRCMS_WAR16165(wlc))
brcms_c_mhf(wlc, MHF2, MHF2_PCISLOWCLKWAR, MHF2_PCISLOWCLKWAR,
- WLC_BAND_ALL);
+ BRCM_BAND_ALL);

brcms_init(wlc->wl);
wlc->pub->up = true;
@@ -2123,20 +2122,20 @@ int brcms_c_up(struct brcms_c_info *wlc)
/* Initialize the base precedence map for dequeueing from txq based on WME settings */
static void brcms_c_tx_prec_map_init(struct brcms_c_info *wlc)
{
- wlc->tx_prec_map = WLC_PREC_BMP_ALL;
+ wlc->tx_prec_map = BRCMS_PREC_BMP_ALL;
memset(wlc->fifo2prec_map, 0, NFIFO * sizeof(u16));

/* For non-WME, both fifos have overlapping MAXPRIO. So just disable all precedences
* if either is full.
*/
if (!EDCF_ENAB(wlc->pub)) {
- wlc->fifo2prec_map[TX_DATA_FIFO] = WLC_PREC_BMP_ALL;
- wlc->fifo2prec_map[TX_CTL_FIFO] = WLC_PREC_BMP_ALL;
+ wlc->fifo2prec_map[TX_DATA_FIFO] = BRCMS_PREC_BMP_ALL;
+ wlc->fifo2prec_map[TX_CTL_FIFO] = BRCMS_PREC_BMP_ALL;
} else {
- wlc->fifo2prec_map[TX_AC_BK_FIFO] = WLC_PREC_BMP_AC_BK;
- wlc->fifo2prec_map[TX_AC_BE_FIFO] = WLC_PREC_BMP_AC_BE;
- wlc->fifo2prec_map[TX_AC_VI_FIFO] = WLC_PREC_BMP_AC_VI;
- wlc->fifo2prec_map[TX_AC_VO_FIFO] = WLC_PREC_BMP_AC_VO;
+ wlc->fifo2prec_map[TX_AC_BK_FIFO] = BRCMS_PREC_BMP_AC_BK;
+ wlc->fifo2prec_map[TX_AC_BE_FIFO] = BRCMS_PREC_BMP_AC_BE;
+ wlc->fifo2prec_map[TX_AC_VI_FIFO] = BRCMS_PREC_BMP_AC_VI;
+ wlc->fifo2prec_map[TX_AC_VO_FIFO] = BRCMS_PREC_BMP_AC_VO;
}
}

@@ -2179,7 +2178,7 @@ uint brcms_c_down(struct brcms_c_info *wlc)
dev_gone = DEVICEREMOVED(wlc);

/* Call any registered down handlers */
- for (i = 0; i < WLC_MAXMODULES; i++) {
+ for (i = 0; i < BRCMS_MAXMODULES; i++) {
if (wlc->modulecb[i].down_fn)
callbacks +=
wlc->modulecb[i].down_fn(wlc->modulecb[i].hdl);
@@ -2222,11 +2221,13 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)
uint i;
wlc_rateset_t rs;
/* Default to 54g Auto */
- s8 shortslot = WLC_SHORTSLOT_AUTO; /* Advertise and use shortslot (-1/0/1 Auto/Off/On) */
+ /* Advertise and use shortslot (-1/0/1 Auto/Off/On) */
+ s8 shortslot = BRCMS_SHORTSLOT_AUTO;
bool shortslot_restrict = false; /* Restrict association to stations that support shortslot
*/
bool ofdm_basic = false; /* Make 6, 12, and 24 basic rates */
- int preamble = WLC_PLCP_LONG; /* Advertise and use short preambles (-1/0/1 Auto/Off/On) */
+ /* Advertise and use short preambles (-1/0/1 Auto/Off/On) */
+ int preamble = BRCMS_PLCP_LONG;
bool preamble_restrict = false; /* Restrict association to stations that support short
* preambles
*/
@@ -2239,22 +2240,22 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)
return -ENOTSUPP;

/* verify that we are dealing with 2G band and grab the band pointer */
- if (wlc->band->bandtype == WLC_BAND_2G)
+ if (wlc->band->bandtype == BRCM_BAND_2G)
band = wlc->band;
else if ((NBANDS(wlc) > 1) &&
- (wlc->bandstate[OTHERBANDUNIT(wlc)]->bandtype == WLC_BAND_2G))
+ (wlc->bandstate[OTHERBANDUNIT(wlc)]->bandtype == BRCM_BAND_2G))
band = wlc->bandstate[OTHERBANDUNIT(wlc)];
else
return -EINVAL;

/* Legacy or bust when no OFDM is supported by regulatory */
if ((brcms_c_channel_locale_flags_in_band(wlc->cmi, band->bandunit) &
- WLC_NO_OFDM) && (gmode != GMODE_LEGACY_B))
+ BRCMS_NO_OFDM) && (gmode != GMODE_LEGACY_B))
return -EINVAL;

/* update configuration value */
if (config == true)
- brcms_c_protection_upd(wlc, WLC_PROT_G_USER, gmode);
+ brcms_c_protection_upd(wlc, BRCMS_PROT_G_USER, gmode);

/* Clear supported rates filter */
memset(&wlc->sup_rates_override, 0, sizeof(wlc_rateset_t));
@@ -2264,7 +2265,7 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)

switch (gmode) {
case GMODE_LEGACY_B:
- shortslot = WLC_SHORTSLOT_OFF;
+ shortslot = BRCMS_SHORTSLOT_OFF;
brcms_c_rateset_copy(&gphy_legacy_rates, &rs);

break;
@@ -2281,7 +2282,7 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)

case GMODE_ONLY:
ofdm_basic = true;
- preamble = WLC_PLCP_SHORT;
+ preamble = BRCMS_PLCP_SHORT;
preamble_restrict = true;
break;

@@ -2290,10 +2291,10 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)
brcms_c_rateset_copy(&cck_ofdm_rates,
&wlc->sup_rates_override);

- shortslot = WLC_SHORTSLOT_ON;
+ shortslot = BRCMS_SHORTSLOT_ON;
shortslot_restrict = true;
ofdm_basic = true;
- preamble = WLC_PLCP_SHORT;
+ preamble = BRCMS_PLCP_SHORT;
preamble_restrict = true;
break;

@@ -2327,18 +2328,18 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)
/* wlc->ap->shortslot_restrict = shortslot_restrict; */
wlc->PLCPHdr_override =
(preamble !=
- WLC_PLCP_LONG) ? WLC_PLCP_SHORT : WLC_PLCP_AUTO;
+ BRCMS_PLCP_LONG) ? BRCMS_PLCP_SHORT : BRCMS_PLCP_AUTO;
}

- if ((AP_ENAB(wlc->pub) && preamble != WLC_PLCP_LONG)
- || preamble == WLC_PLCP_SHORT)
+ if ((AP_ENAB(wlc->pub) && preamble != BRCMS_PLCP_LONG)
+ || preamble == BRCMS_PLCP_SHORT)
wlc->default_bss->capability |= WLAN_CAPABILITY_SHORT_PREAMBLE;
else
wlc->default_bss->capability &= ~WLAN_CAPABILITY_SHORT_PREAMBLE;

/* Update shortslot capability bit for AP and IBSS */
- if ((AP_ENAB(wlc->pub) && shortslot == WLC_SHORTSLOT_AUTO) ||
- shortslot == WLC_SHORTSLOT_ON)
+ if ((AP_ENAB(wlc->pub) && shortslot == BRCMS_SHORTSLOT_AUTO) ||
+ shortslot == BRCMS_SHORTSLOT_ON)
wlc->default_bss->capability |= WLAN_CAPABILITY_SHORT_SLOT_TIME;
else
wlc->default_bss->capability &=
@@ -2350,10 +2351,10 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)

if (ofdm_basic) {
for (i = 0; i < rs.count; i++) {
- if (rs.rates[i] == WLC_RATE_6M
- || rs.rates[i] == WLC_RATE_12M
- || rs.rates[i] == WLC_RATE_24M)
- rs.rates[i] |= WLC_RATE_FLAG;
+ if (rs.rates[i] == BRCM_RATE_6M
+ || rs.rates[i] == BRCM_RATE_12M
+ || rs.rates[i] == BRCM_RATE_24M)
+ rs.rates[i] |= BRCMS_RATE_FLAG;
}
}

@@ -2377,7 +2378,7 @@ static int brcms_c_nmode_validate(struct brcms_c_info *wlc, s32 nmode)
case AUTO:
case WL_11N_2x2:
case WL_11N_3x3:
- if (!(WLC_PHY_11N_CAP(wlc->band)))
+ if (!(BRCMS_PHY_11N_CAP(wlc->band)))
err = -EINVAL;
break;

@@ -2401,7 +2402,7 @@ int brcms_c_set_nmode(struct brcms_c_info *wlc, s32 nmode)
switch (nmode) {
case OFF:
wlc->pub->_n_enab = OFF;
- wlc->default_bss->flags &= ~WLC_BSS_HT;
+ wlc->default_bss->flags &= ~BRCMS_BSS_HT;
/* delete the mcs rates from the default and hw ratesets */
brcms_c_rateset_mcs_clear(&wlc->default_bss->rateset);
for (i = 0; i < NBANDS(wlc); i++) {
@@ -2429,7 +2430,7 @@ int brcms_c_set_nmode(struct brcms_c_info *wlc, s32 nmode)
wlc->pub->_n_enab = SUPPORT_HT;
else
wlc->pub->_n_enab = SUPPORT_11N;
- wlc->default_bss->flags |= WLC_BSS_HT;
+ wlc->default_bss->flags |= BRCMS_BSS_HT;
/* add the mcs rates to the default and hw ratesets */
brcms_c_rateset_mcs_build(&wlc->default_bss->rateset,
wlc->stf->txstreams);
@@ -2453,7 +2454,7 @@ static int brcms_c_set_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs_arg)
memcpy(&rs, rs_arg, sizeof(wlc_rateset_t));

/* check for bad count value */
- if ((rs.count == 0) || (rs.count > WLC_NUMRATES))
+ if ((rs.count == 0) || (rs.count > BRCMS_NUMRATES))
return -EINVAL;

/* try the current band */
@@ -2573,7 +2574,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,

switch (cmd) {

- case WLC_SET_CHANNEL:{
+ case BRCM_SET_CHANNEL:{
chanspec_t chspec = CH20MHZ_CHSPEC(val);

if (val < 0 || val > MAXCHANNEL) {
@@ -2588,7 +2589,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,

if (!wlc->pub->up && IS_MBAND_UNLOCKED(wlc)) {
if (wlc->band->bandunit !=
- CHSPEC_WLCBANDUNIT(chspec))
+ CHSPEC_BANDUNIT(chspec))
wlc->bandinit_pending = true;
else
wlc->bandinit_pending = false;
@@ -2598,7 +2599,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
/* brcms_c_BSSinit() will sanitize the rateset before
* using it.. */
if (wlc->pub->up &&
- (WLC_BAND_PI_RADIO_CHANSPEC != chspec)) {
+ (BRCMS_BAND_PI_RADIO_CHANSPEC != chspec)) {
brcms_c_set_home_chanspec(wlc, chspec);
brcms_c_suspend_mac_and_wait(wlc);
brcms_c_set_chanspec(wlc, chspec);
@@ -2607,7 +2608,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
break;
}

- case WLC_SET_SRL:
+ case BRCM_SET_SRL:
if (val >= 1 && val <= RETRY_SHORT_MAX) {
int ac;
wlc->SRL = (u16) val;
@@ -2615,14 +2616,14 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
brcms_b_retrylimit_upd(wlc->hw, wlc->SRL, wlc->LRL);

for (ac = 0; ac < AC_COUNT; ac++) {
- WLC_WME_RETRY_SHORT_SET(wlc, ac, wlc->SRL);
+ BRCMS_WME_RETRY_SHORT_SET(wlc, ac, wlc->SRL);
}
brcms_c_wme_retries_write(wlc);
} else
bcmerror = -EINVAL;
break;

- case WLC_SET_LRL:
+ case BRCM_SET_LRL:
if (val >= 1 && val <= 255) {
int ac;
wlc->LRL = (u16) val;
@@ -2630,14 +2631,14 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
brcms_b_retrylimit_upd(wlc->hw, wlc->SRL, wlc->LRL);

for (ac = 0; ac < AC_COUNT; ac++) {
- WLC_WME_RETRY_LONG_SET(wlc, ac, wlc->LRL);
+ BRCMS_WME_RETRY_LONG_SET(wlc, ac, wlc->LRL);
}
brcms_c_wme_retries_write(wlc);
} else
bcmerror = -EINVAL;
break;

- case WLC_GET_CURR_RATESET:{
+ case BRCM_GET_CURR_RATESET:{
wl_rateset_t *ret_rs = (wl_rateset_t *) arg;
wlc_rateset_t *rs;

@@ -2657,7 +2658,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
break;
}

- case WLC_SET_RATESET:{
+ case BRCM_SET_RATESET:{
wlc_rateset_t rs;
wl_rateset_t *in_rs = (wl_rateset_t *) arg;

@@ -2666,7 +2667,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
break;
}

- if (in_rs->count > WLC_NUMRATES) {
+ if (in_rs->count > BRCMS_NUMRATES) {
bcmerror = -ENOBUFS;
break;
}
@@ -2697,16 +2698,16 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
break;
}

- case WLC_SET_BCNPRD:
+ case BRCM_SET_BCNPRD:
/* range [1, 0xffff] */
if (val >= DOT11_MIN_BEACON_PERIOD
- && val <= DOT11_MAX_BEACON_PERIOD) {
+ && val <= DOT11_MAX_BEACON_PERIOD)
wlc->default_bss->beacon_period = (u16) val;
- } else
+ else
bcmerror = -EINVAL;
break;

- case WLC_GET_PHYLIST:
+ case BRCM_GET_PHYLIST:
{
unsigned char *cp = arg;
if (len < 3) {
@@ -2714,20 +2715,19 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
break;
}

- if (WLCISNPHY(wlc->band)) {
+ if (BRCMS_ISNPHY(wlc->band))
*cp++ = 'n';
- } else if (WLCISLCNPHY(wlc->band)) {
+ else if (BRCMS_ISLCNPHY(wlc->band))
*cp++ = 'c';
- } else if (WLCISSSLPNPHY(wlc->band)) {
+ else if (BRCMS_ISSSLPNPHY(wlc->band))
*cp++ = 's';
- }
*cp = '\0';
break;
}

- case WLC_SET_SHORTSLOT_OVERRIDE:
- if ((val != WLC_SHORTSLOT_AUTO) &&
- (val != WLC_SHORTSLOT_OFF) && (val != WLC_SHORTSLOT_ON)) {
+ case BRCMS_SET_SHORTSLOT_OVERRIDE:
+ if (val != BRCMS_SHORTSLOT_AUTO && val != BRCMS_SHORTSLOT_OFF &&
+ val != BRCMS_SHORTSLOT_ON) {
bcmerror = -EINVAL;
break;
}
@@ -2748,12 +2748,12 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
} else {
/* driver is down, so just update the brcms_c_info
* value */
- if (wlc->shortslot_override == WLC_SHORTSLOT_AUTO) {
+ if (wlc->shortslot_override == BRCMS_SHORTSLOT_AUTO) {
wlc->shortslot = false;
} else {
wlc->shortslot =
(wlc->shortslot_override ==
- WLC_SHORTSLOT_ON);
+ BRCMS_SHORTSLOT_ON);
}
}

@@ -2779,7 +2779,7 @@ int brcms_c_module_register(struct brcms_pub *pub,
int i;

/* find an empty entry and just add, no duplication check! */
- for (i = 0; i < WLC_MAXMODULES; i++) {
+ for (i = 0; i < BRCMS_MAXMODULES; i++) {
if (wlc->modulecb[i].name[0] == '\0') {
strncpy(wlc->modulecb[i].name, name,
sizeof(wlc->modulecb[i].name) - 1);
@@ -2803,7 +2803,7 @@ brcms_c_module_unregister(struct brcms_pub *pub, const char *name, void *hdl)
if (wlc == NULL)
return -ENODATA;

- for (i = 0; i < WLC_MAXMODULES; i++) {
+ for (i = 0; i < BRCMS_MAXMODULES; i++) {
if (!strcmp(wlc->modulecb[i].name, name) &&
(wlc->modulecb[i].hdl == hdl)) {
memset(&wlc->modulecb[i], 0, sizeof(struct modulecb));
@@ -3210,7 +3210,7 @@ brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
(brcms_c_d11hdrs_mac80211(
wlc, hw, pkt, scb, 0, 1, fifo, 0, NULL, 0)))
return -EINVAL;
- brcms_c_txq_enq(wlc, scb, pkt, WLC_PRIO_TO_PREC(prio));
+ brcms_c_txq_enq(wlc, scb, pkt, BRCMS_PRIO_TO_PREC(prio));
brcms_c_send_q(wlc);
return 0;
}
@@ -3320,7 +3320,7 @@ brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p,

}

- if (WLC_WAR16165(wlc))
+ if (BRCMS_WAR16165(wlc))
brcms_c_war16165(wlc, true);


@@ -3363,7 +3363,7 @@ static void brcms_c_compute_mimo_plcp(ratespec_t rspec, uint length, u8 *plcp)
plcp[0] = mcs;
if (RSPEC_IS40MHZ(rspec) || (mcs == 32))
plcp[0] |= MIMO_PLCP_40MHZ;
- WLC_SET_MIMO_PLCP_LEN(plcp, length);
+ BRCMS_SET_MIMO_PLCP_LEN(plcp, length);
plcp[3] = RSPEC_MIMOPLCP3(rspec); /* rspec already holds this byte */
plcp[3] |= 0x7; /* set smoothing, not sounding ppdu & reserved */
plcp[4] = 0; /* number of extension spatial streams bit 0 & 1 */
@@ -3379,7 +3379,7 @@ brcms_c_compute_ofdm_plcp(ratespec_t rspec, u32 length, u8 *plcp)
int rate = RSPEC2RATE(rspec);

/* encode rate per 802.11a-1999 sec 17.3.4.1, with lsb transmitted first */
- rate_signal = rate_info[rate] & WLC_RATE_MASK;
+ rate_signal = rate_info[rate] & BRCMS_RATE_MASK;
memset(plcp, 0, D11_PHY_HDR_LEN);
D11A_PHY_HDR_SRATE((struct ofdm_phy_hdr *) plcp, rate_signal);

@@ -3405,18 +3405,18 @@ static void brcms_c_cck_plcp_set(struct brcms_c_info *wlc, int rate_500,
u8 le = 0;

switch (rate_500) {
- case WLC_RATE_1M:
+ case BRCM_RATE_1M:
usec = length << 3;
break;
- case WLC_RATE_2M:
+ case BRCM_RATE_2M:
usec = length << 2;
break;
- case WLC_RATE_5M5:
+ case BRCM_RATE_5M5:
usec = (length << 4) / 11;
if ((length << 4) - (usec * 11) > 0)
usec++;
break;
- case WLC_RATE_11M:
+ case BRCM_RATE_11M:
usec = (length << 3) / 11;
if ((length << 3) - (usec * 11) > 0) {
usec++;
@@ -3428,7 +3428,7 @@ static void brcms_c_cck_plcp_set(struct brcms_c_info *wlc, int rate_500,
default:
wiphy_err(wlc->wiphy, "brcms_c_cck_plcp_set: unsupported rate %d"
"\n", rate_500);
- rate_500 = WLC_RATE_1M;
+ rate_500 = BRCM_RATE_1M;
usec = length << 3;
break;
}
@@ -3522,7 +3522,7 @@ brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
if (ba)
dur +=
(u16) brcms_c_calc_ba_time(wlc, frame_rate,
- WLC_SHORT_PREAMBLE);
+ BRCMS_SHORT_PREAMBLE);
else
dur +=
(u16) brcms_c_calc_ack_time(wlc, frame_rate,
@@ -3535,7 +3535,7 @@ u16 brcms_c_phytxctl1_calc(struct brcms_c_info *wlc, ratespec_t rspec)
u16 phyctl1 = 0;
u16 bw;

- if (WLCISLCNPHY(wlc->band)) {
+ if (BRCMS_ISLCNPHY(wlc->band)) {
bw = PHY_TXC1_BW_20MHZ;
} else {
bw = RSPEC_GET_BW(rspec);
@@ -3554,8 +3554,8 @@ u16 brcms_c_phytxctl1_calc(struct brcms_c_info *wlc, ratespec_t rspec)
phyctl1 = RSPEC_PHYTXBYTE2(rspec);
/* set the upper byte of phyctl1 */
phyctl1 |= (mcs_table[mcs].tx_phy_ctl3 << 8);
- } else if (IS_CCK(rspec) && !WLCISLCNPHY(wlc->band)
- && !WLCISSSLPNPHY(wlc->band)) {
+ } else if (IS_CCK(rspec) && !BRCMS_ISLCNPHY(wlc->band)
+ && !BRCMS_ISSSLPNPHY(wlc->band)) {
/* In CCK mode LPPHY overloads OFDM Modulation bits with CCK Data Rate */
/* Eventually MIMOPHY would also be converted to this format */
/* 0 = 1Mbps; 1 = 2Mbps; 2 = 5.5Mbps; 3 = 11Mbps */
@@ -3589,21 +3589,21 @@ brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, ratespec_t rspec,

} else if (wlc->band->gmode && wlc->protection->_g && !IS_CCK(rspec)) {
/* Use 11Mbps as the g protection RTS target rate and fallback.
- * Use the WLC_BASIC_RATE() lookup to find the best basic rate under the
- * target in case 11 Mbps is not Basic.
+ * Use the BRCMS_BASIC_RATE() lookup to find the best basic rate
+ * under the target in case 11 Mbps is not Basic.
* 6 and 9 Mbps are not usually selected by rate selection, but even
* if the OFDM rate we are protecting is 6 or 9 Mbps, 11 is more robust.
*/
- rts_rspec = WLC_BASIC_RATE(wlc, WLC_RATE_11M);
+ rts_rspec = BRCMS_BASIC_RATE(wlc, BRCM_RATE_11M);
} else {
/* calculate RTS rate and fallback rate based on the frame rate
* RTS must be sent at a basic rate since it is a
* control frame, sec 9.6 of 802.11 spec
*/
- rts_rspec = WLC_BASIC_RATE(wlc, rspec);
+ rts_rspec = BRCMS_BASIC_RATE(wlc, rspec);
}

- if (WLC_PHY_11N_CAP(wlc->band)) {
+ if (BRCMS_PHY_11N_CAP(wlc->band)) {
/* set rts txbw to correct side band */
rts_rspec &= ~RSPEC_BW_MASK;

@@ -3645,14 +3645,14 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
int len, phylen, rts_phylen;
u16 mch, phyctl, xfts, mainrates;
u16 seq = 0, mcl = 0, status = 0, frameid = 0;
- ratespec_t rspec[2] = { WLC_RATE_1M, WLC_RATE_1M }, rts_rspec[2] = {
- WLC_RATE_1M, WLC_RATE_1M};
+ ratespec_t rspec[2] = { BRCM_RATE_1M, BRCM_RATE_1M }, rts_rspec[2] = {
+ BRCM_RATE_1M, BRCM_RATE_1M};
bool use_rts = false;
bool use_cts = false;
bool use_rifs = false;
bool short_preamble[2] = { false, false };
- u8 preamble_type[2] = { WLC_LONG_PREAMBLE, WLC_LONG_PREAMBLE };
- u8 rts_preamble_type[2] = { WLC_LONG_PREAMBLE, WLC_LONG_PREAMBLE };
+ u8 preamble_type[2] = { BRCMS_LONG_PREAMBLE, BRCMS_LONG_PREAMBLE };
+ u8 rts_preamble_type[2] = { BRCMS_LONG_PREAMBLE, BRCMS_LONG_PREAMBLE };
u8 *rts_plcp, rts_plcp_fallback[D11_PHY_HDR_LEN];
struct ieee80211_rts *rts = NULL;
bool qos;
@@ -3704,7 +3704,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
/* non-AP STA should never use BCMC queue */
if (queue == TX_BCMC_FIFO) {
wiphy_err(wlc->wiphy, "wl%d: %s: ASSERT queue == "
- "TX_BCMC!\n", WLCWLUNIT(wlc), __func__);
+ "TX_BCMC!\n", BRCMS_UNIT(wlc), __func__);
frameid = bcmc_fid_generate(wlc, NULL, txh);
} else {
/* Increment the counter for first fragment */
@@ -3750,7 +3750,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ?
true : false;
} else {
- rate_val[k] = WLC_RATE_1M;
+ rate_val[k] = BRCM_RATE_1M;
}
} else {
rate_val[k] = txrate[k]->idx;
@@ -3772,7 +3772,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,

/* (1) RATE: determine and validate primary rate and fallback rates */
if (!RSPEC_ACTIVE(rspec[k])) {
- rspec[k] = WLC_RATE_1M;
+ rspec[k] = BRCM_RATE_1M;
} else {
if (!is_multicast_ether_addr(h->addr1)) {
/* set tx antenna config */
@@ -3796,7 +3796,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,

/* For SISO MCS use STBC if possible */
if (IS_MCS(rspec[k])
- && WLC_STF_SS_STBC_TX(wlc, scb)) {
+ && BRCMS_STF_SS_STBC_TX(wlc, scb)) {
u8 stc;

stc = 1; /* Nss for single stream is always 1 */
@@ -3810,11 +3810,11 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
}

/* Is the phy configured to use 40MHZ frames? If so then pick the desired txbw */
- if (CHSPEC_WLC_BW(wlc->chanspec) == WLC_40_MHZ) {
+ if (CHSPEC_WLC_BW(wlc->chanspec) == BRCMS_40_MHZ) {
/* default txbw is 20in40 SB */
mimo_ctlchbw = mimo_txbw =
- CHSPEC_SB_UPPER(WLC_BAND_PI_RADIO_CHANSPEC)
- ? PHY_TXC1_BW_20MHZ_UP : PHY_TXC1_BW_20MHZ;
+ CHSPEC_SB_UPPER(BRCMS_BAND_PI_RADIO_CHANSPEC)
+ ? PHY_TXC1_BW_20MHZ_UP : PHY_TXC1_BW_20MHZ;

if (IS_MCS(rspec[k])) {
/* mcs 32 must be 40b/w DUP */
@@ -3863,15 +3863,15 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
rspec[k] &= ~RSPEC_SHORT_GI;
#endif

- mimo_preamble_type = WLC_MM_PREAMBLE;
+ mimo_preamble_type = BRCMS_MM_PREAMBLE;
if (txrate[k]->flags & IEEE80211_TX_RC_GREEN_FIELD)
- mimo_preamble_type = WLC_GF_PREAMBLE;
+ mimo_preamble_type = BRCMS_GF_PREAMBLE;

if ((txrate[k]->flags & IEEE80211_TX_RC_MCS)
&& (!IS_MCS(rspec[k]))) {
wiphy_err(wlc->wiphy, "wl%d: %s: IEEE80211_TX_"
"RC_MCS != IS_MCS(rspec)\n",
- WLCWLUNIT(wlc), __func__);
+ BRCMS_UNIT(wlc), __func__);
}

if (IS_MCS(rspec[k])) {
@@ -3881,7 +3881,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
if ((rspec[k] & RSPEC_SHORT_GI)
&& IS_SINGLE_STREAM(rspec[k] &
RSPEC_RATE_MASK)) {
- preamble_type[k] = WLC_MM_PREAMBLE;
+ preamble_type[k] = BRCMS_MM_PREAMBLE;
}
}

@@ -3889,7 +3889,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
if (!IS_MCS(rspec[0])
&& (tx_info->control.rates[0].
flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE))
- preamble_type[k] = WLC_SHORT_PREAMBLE;
+ preamble_type[k] = BRCMS_SHORT_PREAMBLE;
}
} else {
for (k = 0; k < hw->max_rates; k++) {
@@ -3898,7 +3898,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
rspec[k] |= (PHY_TXC1_BW_20MHZ << RSPEC_BW_SHIFT);

/* for nphy, stf of ofdm frames must follow policies */
- if (WLCISNPHY(wlc->band) && IS_OFDM(rspec[k])) {
+ if (BRCMS_ISNPHY(wlc->band) && IS_OFDM(rspec[k])) {
rspec[k] &= ~RSPEC_STF_MASK;
rspec[k] |= phyctl1_stf << RSPEC_STF_SHIFT;
}
@@ -3971,7 +3971,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
if (BAND_5G(wlc->band->bandtype))
mcl |= TXC_FREQBAND_5G;

- if (CHSPEC_IS40(WLC_BAND_PI_RADIO_CHANSPEC))
+ if (CHSPEC_IS40(BRCMS_BAND_PI_RADIO_CHANSPEC))
mcl |= TXC_BW_40;

/* set AMIC bit if using hardware TKIP MIC */
@@ -3984,9 +3984,9 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
mch = 0;

/* Set fallback rate preamble type */
- if ((preamble_type[1] == WLC_SHORT_PREAMBLE) ||
- (preamble_type[1] == WLC_GF_PREAMBLE)) {
- if (RSPEC2RATE(rspec[1]) != WLC_RATE_1M)
+ if ((preamble_type[1] == BRCMS_SHORT_PREAMBLE) ||
+ (preamble_type[1] == BRCMS_GF_PREAMBLE)) {
+ if (RSPEC2RATE(rspec[1]) != BRCM_RATE_1M)
mch |= TXC_PREAMBLE_DATA_FB_SHORT;
}

@@ -4029,16 +4029,16 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
}

if (!IS_OFDM(rts_rspec[0]) &&
- !((RSPEC2RATE(rts_rspec[0]) == WLC_RATE_1M) ||
- (wlc->PLCPHdr_override == WLC_PLCP_LONG))) {
- rts_preamble_type[0] = WLC_SHORT_PREAMBLE;
+ !((RSPEC2RATE(rts_rspec[0]) == BRCM_RATE_1M) ||
+ (wlc->PLCPHdr_override == BRCMS_PLCP_LONG))) {
+ rts_preamble_type[0] = BRCMS_SHORT_PREAMBLE;
mch |= TXC_PREAMBLE_RTS_MAIN_SHORT;
}

if (!IS_OFDM(rts_rspec[1]) &&
- !((RSPEC2RATE(rts_rspec[1]) == WLC_RATE_1M) ||
- (wlc->PLCPHdr_override == WLC_PLCP_LONG))) {
- rts_preamble_type[1] = WLC_SHORT_PREAMBLE;
+ !((RSPEC2RATE(rts_rspec[1]) == BRCM_RATE_1M) ||
+ (wlc->PLCPHdr_override == BRCMS_PLCP_LONG))) {
+ rts_preamble_type[1] = BRCMS_SHORT_PREAMBLE;
mch |= TXC_PREAMBLE_RTS_FB_SHORT;
}

@@ -4127,14 +4127,14 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
xfts |= (FRAMETYPE(rts_rspec[0], wlc->mimoft) << XFTS_RTS_FT_SHIFT);
xfts |= (FRAMETYPE(rts_rspec[1], wlc->mimoft) << XFTS_FBRRTS_FT_SHIFT);
xfts |=
- CHSPEC_CHANNEL(WLC_BAND_PI_RADIO_CHANSPEC) << XFTS_CHANNEL_SHIFT;
+ CHSPEC_CHANNEL(BRCMS_BAND_PI_RADIO_CHANSPEC) << XFTS_CHANNEL_SHIFT;
txh->XtraFrameTypes = cpu_to_le16(xfts);

/* PhyTxControlWord */
phyctl = FRAMETYPE(rspec[0], wlc->mimoft);
- if ((preamble_type[0] == WLC_SHORT_PREAMBLE) ||
- (preamble_type[0] == WLC_GF_PREAMBLE)) {
- if (RSPEC2RATE(rspec[0]) != WLC_RATE_1M)
+ if ((preamble_type[0] == BRCMS_SHORT_PREAMBLE) ||
+ (preamble_type[0] == BRCMS_GF_PREAMBLE)) {
+ if (RSPEC2RATE(rspec[0]) != BRCM_RATE_1M)
phyctl |= PHY_TXC_SHORT_HDR;
}

@@ -4143,7 +4143,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
txh->PhyTxControlWord = cpu_to_le16(phyctl);

/* PhyTxControlWord_1 */
- if (WLC_PHY_11N_CAP(wlc->band)) {
+ if (BRCMS_PHY_11N_CAP(wlc->band)) {
u16 phyctl1 = 0;

phyctl1 = brcms_c_phytxctl1_calc(wlc, rspec[0]);
@@ -4163,13 +4163,15 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
* fill in non-zero MModeLen and/or MModeFbrLen
* it will be unnecessary if they are separated
*/
- if (IS_MCS(rspec[0]) && (preamble_type[0] == WLC_MM_PREAMBLE)) {
+ if (IS_MCS(rspec[0]) &&
+ (preamble_type[0] == BRCMS_MM_PREAMBLE)) {
u16 mmodelen =
brcms_c_calc_lsig_len(wlc, rspec[0], phylen);
txh->MModeLen = cpu_to_le16(mmodelen);
}

- if (IS_MCS(rspec[1]) && (preamble_type[1] == WLC_MM_PREAMBLE)) {
+ if (IS_MCS(rspec[1]) &&
+ (preamble_type[1] == BRCMS_MM_PREAMBLE)) {
u16 mmodefbrlen =
brcms_c_calc_lsig_len(wlc, rspec[1], phylen);
txh->MModeFbrLen = cpu_to_le16(mmodefbrlen);
@@ -4290,7 +4292,6 @@ static void brcms_c_war16165(struct brcms_c_info *wlc, bool tx)
}

/* process an individual struct tx_status */
-/* WLC_HIGH_API */
bool
brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs, u32 frm_tx2)
{
@@ -4329,7 +4330,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs, u32 frm_tx2)
}

p = GETNEXTTXP(wlc, queue);
- if (WLC_WAR16165(wlc))
+ if (BRCMS_WAR16165(wlc))
brcms_c_war16165(wlc, false);
if (p == NULL)
goto fatal;
@@ -4389,8 +4390,8 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs, u32 frm_tx2)
fbl;

if (queue < AC_COUNT) {
- sfbl = WLC_WME_RETRY_SFB_GET(wlc, wme_fifo2ac[queue]);
- lfbl = WLC_WME_RETRY_LFB_GET(wlc, wme_fifo2ac[queue]);
+ sfbl = BRCMS_WME_RETRY_SFB_GET(wlc, wme_fifo2ac[queue]);
+ lfbl = BRCMS_WME_RETRY_LFB_GET(wlc, wme_fifo2ac[queue]);
} else {
sfbl = wlc->SFBL;
lfbl = wlc->LFBL;
@@ -4461,12 +4462,12 @@ brcms_c_txfifo_complete(struct brcms_c_info *wlc, uint fifo, s8 txpktpend)
TXPKTPENDGET(wlc, fifo));

/* There is more room; mark precedences related to this FIFO sendable */
- WLC_TX_FIFO_ENAB(wlc, fifo);
+ BRCMS_TX_FIFO_ENAB(wlc, fifo);

/* Clear MHF2_TXBCMC_NOW flag if BCMC fifo has drained */
if (AP_ENAB(wlc->pub) &&
!TXPKTPENDGET(wlc, TX_BCMC_FIFO)) {
- brcms_c_mhf(wlc, MHF2, MHF2_TXBCMC_NOW, 0, WLC_BAND_AUTO);
+ brcms_c_mhf(wlc, MHF2, MHF2_TXBCMC_NOW, 0, BRCM_BAND_AUTO);
}

/* figure out which bsscfg is being worked on... */
@@ -4539,7 +4540,7 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
rx_status->mactime = brcms_c_recover_tsf64(wlc, wlc_rxh);
rx_status->flag |= RX_FLAG_MACTIME_MPDU;

- channel = WLC_CHAN_CHANNEL(rxh->RxChan);
+ channel = BRCMS_CHAN_CHANNEL(rxh->RxChan);

if (channel > 14) {
rx_status->band = IEEE80211_BAND_5GHZ;
@@ -4567,40 +4568,40 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
rx_status->flag |= RX_FLAG_40MHZ;
} else {
switch (RSPEC2RATE(rspec)) {
- case WLC_RATE_1M:
+ case BRCM_RATE_1M:
rx_status->rate_idx = 0;
break;
- case WLC_RATE_2M:
+ case BRCM_RATE_2M:
rx_status->rate_idx = 1;
break;
- case WLC_RATE_5M5:
+ case BRCM_RATE_5M5:
rx_status->rate_idx = 2;
break;
- case WLC_RATE_11M:
+ case BRCM_RATE_11M:
rx_status->rate_idx = 3;
break;
- case WLC_RATE_6M:
+ case BRCM_RATE_6M:
rx_status->rate_idx = 4;
break;
- case WLC_RATE_9M:
+ case BRCM_RATE_9M:
rx_status->rate_idx = 5;
break;
- case WLC_RATE_12M:
+ case BRCM_RATE_12M:
rx_status->rate_idx = 6;
break;
- case WLC_RATE_18M:
+ case BRCM_RATE_18M:
rx_status->rate_idx = 7;
break;
- case WLC_RATE_24M:
+ case BRCM_RATE_24M:
rx_status->rate_idx = 8;
break;
- case WLC_RATE_36M:
+ case BRCM_RATE_36M:
rx_status->rate_idx = 9;
break;
- case WLC_RATE_48M:
+ case BRCM_RATE_48M:
rx_status->rate_idx = 10;
break;
- case WLC_RATE_54M:
+ case BRCM_RATE_54M:
rx_status->rate_idx = 11;
break;
default:
@@ -4660,7 +4661,6 @@ brcms_c_recvctl(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
* Return true if more frames need to be processed. false otherwise.
* Param 'bound' indicates max. # frames to process before break out.
*/
-/* WLC_HIGH_API */
void brcms_c_recv(struct brcms_c_info *wlc, struct sk_buff *p)
{
struct d11rxhdr *rxh;
@@ -4674,7 +4674,7 @@ void brcms_c_recv(struct brcms_c_info *wlc, struct sk_buff *p)
rxh = (struct d11rxhdr *) (p->data);

/* strip off rxhdr */
- skb_pull(p, WL_HWRXOFF);
+ skb_pull(p, BRCMS_HWRXOFF);

/* fixup rx header endianness */
rxh->RxFrameSize = le16_to_cpu(rxh->RxFrameSize);
@@ -4808,7 +4808,7 @@ brcms_c_calc_frame_time(struct brcms_c_info *wlc, ratespec_t ratespec,
if (rate == 0) {
wiphy_err(wlc->wiphy, "wl%d: WAR: using rate of 1 mbps\n",
wlc->pub->unit);
- rate = WLC_RATE_1M;
+ rate = BRCM_RATE_1M;
}

BCMMSG(wlc->wiphy, "wl%d: rspec 0x%x, preamble_type %d, len%d\n",
@@ -4819,7 +4819,7 @@ brcms_c_calc_frame_time(struct brcms_c_info *wlc, ratespec_t ratespec,
int tot_streams = MCS_TXS(mcs) + RSPEC_STC(ratespec);

dur = PREN_PREAMBLE + (tot_streams * PREN_PREAMBLE_EXT);
- if (preamble_type == WLC_MM_PREAMBLE)
+ if (preamble_type == BRCMS_MM_PREAMBLE)
dur += PREN_MM_EXT;
/* 1000Ndbps = kbps * 4 */
kNdps =
@@ -4858,7 +4858,7 @@ brcms_c_calc_frame_time(struct brcms_c_info *wlc, ratespec_t ratespec,
mac_len = mac_len * 8 * 2;
/* calc ceiling of bits/rate = microseconds of air time */
dur = (mac_len + rate - 1) / rate;
- if (preamble_type & WLC_SHORT_PREAMBLE)
+ if (preamble_type & BRCMS_SHORT_PREAMBLE)
dur += BPHY_PLCP_SHORT_TIME;
else
dur += BPHY_PLCP_TIME;
@@ -4902,7 +4902,7 @@ brcms_c_calc_frame_len(struct brcms_c_info *wlc, ratespec_t ratespec,
((nsyms * Ndps) -
(APHY_SERVICE_NBITS + APHY_TAIL_NBITS)) / 8;
} else {
- if (preamble_type & WLC_SHORT_PREAMBLE)
+ if (preamble_type & BRCMS_SHORT_PREAMBLE)
dur -= BPHY_PLCP_SHORT_TIME;
else
dur -= BPHY_PLCP_TIME;
@@ -4922,7 +4922,7 @@ brcms_c_calc_ba_time(struct brcms_c_info *wlc, ratespec_t rspec,
/* Spec 9.6: ack rate is the highest rate in BSSBasicRateSet that is less than
* or equal to the rate of the immediately previous frame in the FES
*/
- rspec = WLC_BASIC_RATE(wlc, rspec);
+ rspec = BRCMS_BASIC_RATE(wlc, rspec);
/* BA len == 32 == 16(ctl hdr) + 4(ba len) + 8(bitmap) + 4(fcs) */
return brcms_c_calc_frame_time(wlc, rspec, preamble_type,
(DOT11_BA_LEN + DOT11_BA_BITMAP_LEN +
@@ -4940,7 +4940,7 @@ brcms_c_calc_ack_time(struct brcms_c_info *wlc, ratespec_t rspec,
/* Spec 9.6: ack rate is the highest rate in BSSBasicRateSet that is less than
* or equal to the rate of the immediately previous frame in the FES
*/
- rspec = WLC_BASIC_RATE(wlc, rspec);
+ rspec = BRCMS_BASIC_RATE(wlc, rspec);
/* ACK frame len == 14 == 2(fc) + 2(dur) + 6(ra) + 4(fcs) */
dur =
brcms_c_calc_frame_time(wlc, rspec, preamble_type,
@@ -4968,20 +4968,20 @@ void brcms_c_rate_lookup_init(struct brcms_c_info *wlc, wlc_rateset_t *rateset)
uint i;

/* incoming rates are in 500kbps units as in 802.11 Supported Rates */
- memset(br, 0, WLC_MAXRATE + 1);
+ memset(br, 0, BRCM_MAXRATE + 1);

/* For each basic rate in the rates list, make an entry in the
* best basic lookup.
*/
for (i = 0; i < rateset->count; i++) {
/* only make an entry for a basic rate */
- if (!(rateset->rates[i] & WLC_RATE_FLAG))
+ if (!(rateset->rates[i] & BRCMS_RATE_FLAG))
continue;

/* mask off basic bit */
- rate = (rateset->rates[i] & WLC_RATE_MASK);
+ rate = (rateset->rates[i] & BRCMS_RATE_MASK);

- if (rate > WLC_MAXRATE) {
+ if (rate > BRCM_MAXRATE) {
wiphy_err(wlc->wiphy, "brcms_c_rate_lookup_init: "
"invalid rate 0x%X in rate set\n",
rateset->rates[i]);
@@ -5033,12 +5033,12 @@ void brcms_c_rate_lookup_init(struct brcms_c_info *wlc, wlc_rateset_t *rateset)

if (IS_OFDM(rate)) {
/* In 11g and 11a, the OFDM mandatory rates are 6, 12, and 24 Mbps */
- if (rate >= WLC_RATE_24M)
- mandatory = WLC_RATE_24M;
- else if (rate >= WLC_RATE_12M)
- mandatory = WLC_RATE_12M;
+ if (rate >= BRCM_RATE_24M)
+ mandatory = BRCM_RATE_24M;
+ else if (rate >= BRCM_RATE_12M)
+ mandatory = BRCM_RATE_12M;
else
- mandatory = WLC_RATE_6M;
+ mandatory = BRCM_RATE_6M;
} else {
/* In 11b, all the CCK rates are mandatory 1 - 11 Mbps */
mandatory = rate;
@@ -5066,8 +5066,8 @@ static void brcms_c_write_rate_shm(struct brcms_c_info *wlc, u8 rate,
* for a given rate, the LS-nibble of the PLCP SIGNAL field is
* the index into the rate table.
*/
- phy_rate = rate_info[rate] & WLC_RATE_MASK;
- basic_phy_rate = rate_info[basic_rate] & WLC_RATE_MASK;
+ phy_rate = rate_info[rate] & BRCMS_RATE_MASK;
+ basic_phy_rate = rate_info[basic_rate] & BRCMS_RATE_MASK;
index = phy_rate & 0xf;
basic_index = basic_phy_rate & 0xf;

@@ -5086,7 +5086,7 @@ static const wlc_rateset_t *brcms_c_rateset_get_hwrs(struct brcms_c_info *wlc)
{
const wlc_rateset_t *rs_dflt;

- if (WLC_PHY_11N_CAP(wlc->band)) {
+ if (BRCMS_PHY_11N_CAP(wlc->band)) {
if (BAND_5G(wlc->band->bandtype))
rs_dflt = &ofdm_mimo_rates;
else
@@ -5113,17 +5113,17 @@ void brcms_c_set_ratetable(struct brcms_c_info *wlc)

/* walk the phy rate table and update SHM basic rate lookup table */
for (i = 0; i < rs.count; i++) {
- rate = rs.rates[i] & WLC_RATE_MASK;
+ rate = rs.rates[i] & BRCMS_RATE_MASK;

- /* for a given rate WLC_BASIC_RATE returns the rate at
+ /* for a given rate BRCMS_BASIC_RATE returns the rate at
* which a response ACK/CTS should be sent.
*/
- basic_rate = WLC_BASIC_RATE(wlc, rate);
+ basic_rate = BRCMS_BASIC_RATE(wlc, rate);
if (basic_rate == 0) {
/* This should only happen if we are using a
* restricted rateset.
*/
- basic_rate = rs.rates[0] & WLC_RATE_MASK;
+ basic_rate = rs.rates[0] & BRCMS_RATE_MASK;
}

brcms_c_write_rate_shm(wlc, rate, basic_rate);
@@ -5132,7 +5132,7 @@ void brcms_c_set_ratetable(struct brcms_c_info *wlc)

/*
* Return true if the specified rate is supported by the specified band.
- * WLC_BAND_AUTO indicates the current band.
+ * BRCM_BAND_AUTO indicates the current band.
*/
bool brcms_c_valid_rate(struct brcms_c_info *wlc, ratespec_t rspec, int band,
bool verbose)
@@ -5140,7 +5140,7 @@ bool brcms_c_valid_rate(struct brcms_c_info *wlc, ratespec_t rspec, int band,
wlc_rateset_t *hw_rateset;
uint i;

- if ((band == WLC_BAND_AUTO) || (band == wlc->band->bandtype)) {
+ if ((band == BRCM_BAND_AUTO) || (band == wlc->band->bandtype)) {
hw_rateset = &wlc->band->hw_rateset;
} else if (NBANDS(wlc) > 1) {
hw_rateset = &wlc->bandstate[OTHERBANDUNIT(wlc)]->hw_rateset;
@@ -5178,14 +5178,14 @@ static void brcms_c_update_mimo_band_bwcap(struct brcms_c_info *wlc, u8 bwcap)
if (IS_SINGLEBAND_5G(wlc->deviceid))
i = BAND_5G_INDEX;
band = wlc->bandstate[i];
- if (band->bandtype == WLC_BAND_5G) {
- if ((bwcap == WLC_N_BW_40ALL)
- || (bwcap == WLC_N_BW_20IN2G_40IN5G))
+ if (band->bandtype == BRCM_BAND_5G) {
+ if ((bwcap == BRCMS_N_BW_40ALL)
+ || (bwcap == BRCMS_N_BW_20IN2G_40IN5G))
band->mimo_cap_40 = true;
else
band->mimo_cap_40 = false;
} else {
- if (bwcap == WLC_N_BW_40ALL)
+ if (bwcap == BRCMS_N_BW_40ALL)
band->mimo_cap_40 = true;
else
band->mimo_cap_40 = false;
@@ -5212,7 +5212,7 @@ void brcms_c_mod_prb_rsp_rate_table(struct brcms_c_info *wlc, uint frame_len)

/* walk the phy rate table and update MAC core SHM basic rate table entries */
for (i = 0; i < rs.count; i++) {
- rate = rs.rates[i] & WLC_RATE_MASK;
+ rate = rs.rates[i] & BRCMS_RATE_MASK;

entry_ptr = brcms_c_rate_shm_offset(wlc, rate);

@@ -5220,9 +5220,8 @@ void brcms_c_mod_prb_rsp_rate_table(struct brcms_c_info *wlc, uint frame_len)
brcms_c_compute_plcp(wlc, rate, frame_len, plcp);

/* Calculate the duration of the Probe Response frame plus SIFS for the MAC */
- dur =
- (u16) brcms_c_calc_frame_time(wlc, rate, WLC_LONG_PREAMBLE,
- frame_len);
+ dur = (u16) brcms_c_calc_frame_time(wlc, rate,
+ BRCMS_LONG_PREAMBLE, frame_len);
dur += sifs;

/* Update the SHM Rate Table entry Probe Response values */
@@ -5465,7 +5464,7 @@ int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu, uint *fifop)
/* return if insufficient dma resources */
if (TXAVAIL(wlc, fifo) < MAX_DMA_SEGS) {
/* Mark precedences related to this FIFO, unsendable */
- WLC_TX_FIFO_CLEAR(wlc, fifo);
+ BRCMS_TX_FIFO_CLEAR(wlc, fifo);
return -EBUSY;
}
return 0;
@@ -5492,7 +5491,7 @@ void brcms_c_bsscfg_reprate_init(struct brcms_bss_cfg *bsscfg)
void brcms_default_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs)
{
brcms_c_rateset_default(rs, NULL, wlc->band->phytype,
- wlc->band->bandtype, false, WLC_RATE_MASK_FULL,
+ wlc->band->bandtype, false, BRCMS_RATE_MASK_FULL,
(bool) N_ENAB(wlc->pub),
CHSPEC_WLC_BW(wlc->default_bss->chanspec),
wlc->stf->txstreams);
@@ -5517,17 +5516,17 @@ static void brcms_c_bss_default_init(struct brcms_c_info *wlc)

/* find the band of our default channel */
band = wlc->band;
- if (NBANDS(wlc) > 1 && band->bandunit != CHSPEC_WLCBANDUNIT(chanspec))
+ if (NBANDS(wlc) > 1 && band->bandunit != CHSPEC_BANDUNIT(chanspec))
band = wlc->bandstate[OTHERBANDUNIT(wlc)];

/* init bss rates to the band specific default rate set */
brcms_c_rateset_default(&bi->rateset, NULL, band->phytype,
- band->bandtype, false, WLC_RATE_MASK_FULL,
+ band->bandtype, false, BRCMS_RATE_MASK_FULL,
(bool) N_ENAB(wlc->pub), CHSPEC_WLC_BW(chanspec),
wlc->stf->txstreams);

if (N_ENAB(wlc->pub))
- bi->flags |= WLC_BSS_HT;
+ bi->flags |= BRCMS_BSS_HT;
}

static ratespec_t
@@ -5552,7 +5551,7 @@ mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
/* mcs only allowed when nmode */
if (stf > PHY_TXC1_MODE_SDM) {
wiphy_err(wlc->wiphy, "wl%d: %s: Invalid stf\n",
- WLCWLUNIT(wlc), __func__);
+ BRCMS_UNIT(wlc), __func__);
bcmerror = -EINVAL;
goto done;
}
@@ -5563,7 +5562,7 @@ mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
((stf != PHY_TXC1_MODE_SISO)
&& (stf != PHY_TXC1_MODE_CDD))) {
wiphy_err(wlc->wiphy, "wl%d: %s: Invalid mcs "
- "32\n", WLCWLUNIT(wlc), __func__);
+ "32\n", BRCMS_UNIT(wlc), __func__);
bcmerror = -EINVAL;
goto done;
}
@@ -5573,16 +5572,16 @@ mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
if (stf != PHY_TXC1_MODE_SDM) {
BCMMSG(wlc->wiphy, "wl%d: enabling "
"SDM mode for mcs %d\n",
- WLCWLUNIT(wlc), rate);
+ BRCMS_UNIT(wlc), rate);
stf = PHY_TXC1_MODE_SDM;
}
} else {
/* MCS 0-7 may use SISO, CDD, and for phy_rev >= 3 STBC */
if ((stf > PHY_TXC1_MODE_STBC) ||
- (!WLC_STBC_CAP_PHY(wlc)
+ (!BRCMS_STBC_CAP_PHY(wlc)
&& (stf == PHY_TXC1_MODE_STBC))) {
wiphy_err(wlc->wiphy, "wl%d: %s: Invalid STBC"
- "\n", WLCWLUNIT(wlc), __func__);
+ "\n", BRCMS_UNIT(wlc), __func__);
bcmerror = -EINVAL;
goto done;
}
@@ -5590,28 +5589,28 @@ mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
} else if (IS_OFDM(rate)) {
if ((stf != PHY_TXC1_MODE_CDD) && (stf != PHY_TXC1_MODE_SISO)) {
wiphy_err(wlc->wiphy, "wl%d: %s: Invalid OFDM\n",
- WLCWLUNIT(wlc), __func__);
+ BRCMS_UNIT(wlc), __func__);
bcmerror = -EINVAL;
goto done;
}
} else if (IS_CCK(rate)) {
- if ((cur_band->bandtype != WLC_BAND_2G)
+ if ((cur_band->bandtype != BRCM_BAND_2G)
|| (stf != PHY_TXC1_MODE_SISO)) {
wiphy_err(wlc->wiphy, "wl%d: %s: Invalid CCK\n",
- WLCWLUNIT(wlc), __func__);
+ BRCMS_UNIT(wlc), __func__);
bcmerror = -EINVAL;
goto done;
}
} else {
wiphy_err(wlc->wiphy, "wl%d: %s: Unknown rate type\n",
- WLCWLUNIT(wlc), __func__);
+ BRCMS_UNIT(wlc), __func__);
bcmerror = -EINVAL;
goto done;
}
/* make sure multiple antennae are available for non-siso rates */
if ((stf != PHY_TXC1_MODE_SISO) && (wlc->stf->txstreams == 1)) {
wiphy_err(wlc->wiphy, "wl%d: %s: SISO antenna but !SISO "
- "request\n", WLCWLUNIT(wlc), __func__);
+ "request\n", BRCMS_UNIT(wlc), __func__);
bcmerror = -EINVAL;
goto done;
}
@@ -5877,7 +5876,7 @@ brcms_c_txflowcontrol_signal(struct brcms_c_info *wlc,
struct brcms_c_if *wlcif;

for (wlcif = wlc->wlcif_list; wlcif != NULL; wlcif = wlcif->next) {
- if (wlcif->qi == qi && wlcif->flags & WLC_IF_LINKED)
+ if (wlcif->qi == qi && wlcif->flags & BRCMS_IF_LINKED)
brcms_txflowcontrol(wlc->wl, wlcif->wlif, on, prio);
}
#endif
@@ -5895,7 +5894,7 @@ static struct brcms_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc)
* leave PS mode. The watermark for flowcontrol to OS packets
* will remain the same
*/
- brcmu_pktq_init(&qi->q, WLC_PREC_COUNT,
+ brcmu_pktq_init(&qi->q, BRCMS_PREC_COUNT,
(2 * wlc->pub->tunables->datahiwat) + PKTQ_LEN_DEFAULT
+ wlc->pub->psq_pkts_total);

diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 80b08a9..2d0a567 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -24,10 +24,12 @@
#include "d11.h"

#define MA_WINDOW_SZ 8 /* moving average window size */
-#define WL_HWRXOFF 38 /* chip rx buffer offset */
+#define BRCMS_HWRXOFF 38 /* chip rx buffer offset */
#define INVCHANNEL 255 /* invalid channel */
-#define MAXCOREREV 28 /* max # supported core revisions (0 .. MAXCOREREV - 1) */
-#define WLC_MAXMODULES 22 /* max # brcms_c_module_register() calls */
+/* max # supported core revisions (0 .. MAXCOREREV - 1) */
+#define MAXCOREREV 28
+/* max # brcms_c_module_register() calls */
+#define BRCMS_MAXMODULES 22

#define SEQNUM_SHIFT 4
#define AMPDU_DELIMITER_LEN 4
@@ -41,14 +43,15 @@

#define NTXRATE 64 /* # tx MPDUs rate is reported for */

-#define WLC_BITSCNT(x) brcmu_bitcount((u8 *)&(x), sizeof(u8))
+#define BRCMS_BITSCNT(x) brcmu_bitcount((u8 *)&(x), sizeof(u8))

/* Maximum wait time for a MAC suspend */
-#define WLC_MAX_MAC_SUSPEND 83000 /* uS: 83mS is max packet time (64KB ampdu @ 6Mbps) */
+/* uS: 83mS is max packet time (64KB ampdu @ 6Mbps) */
+#define BRCMS_MAX_MAC_SUSPEND 83000

/* Probe Response timeout - responses for probe requests older that this are tossed, zero to disable
*/
-#define WLC_PRB_RESP_TIMEOUT 0 /* Disable probe response timeout */
+#define BRCMS_PRB_RESP_TIMEOUT 0 /* Disable probe response timeout */

/* transmit buffer max headroom for protocol headers */
#define TXOFF (D11_TXH_LEN + D11_PHY_HDR_LEN)
@@ -83,26 +86,28 @@
#define VALID_COREREV(corerev) CONF_HAS(D11CONF, corerev)

/* values for shortslot_override */
-#define WLC_SHORTSLOT_AUTO -1 /* Driver will manage Shortslot setting */
-#define WLC_SHORTSLOT_OFF 0 /* Turn off short slot */
-#define WLC_SHORTSLOT_ON 1 /* Turn on short slot */
+#define BRCMS_SHORTSLOT_AUTO -1 /* Driver will manage Shortslot setting */
+#define BRCMS_SHORTSLOT_OFF 0 /* Turn off short slot */
+#define BRCMS_SHORTSLOT_ON 1 /* Turn on short slot */

/* value for short/long and mixmode/greenfield preamble */
-
-#define WLC_LONG_PREAMBLE (0)
-#define WLC_SHORT_PREAMBLE (1 << 0)
-#define WLC_GF_PREAMBLE (1 << 1)
-#define WLC_MM_PREAMBLE (1 << 2)
-#define WLC_IS_MIMO_PREAMBLE(_pre) (((_pre) == WLC_GF_PREAMBLE) || ((_pre) == WLC_MM_PREAMBLE))
+#define BRCMS_LONG_PREAMBLE (0)
+#define BRCMS_SHORT_PREAMBLE (1 << 0)
+#define BRCMS_GF_PREAMBLE (1 << 1)
+#define BRCMS_MM_PREAMBLE (1 << 2)
+#define BRCMS_IS_MIMO_PREAMBLE(_pre) (((_pre) == BRCMS_GF_PREAMBLE) || \
+ ((_pre) == BRCMS_MM_PREAMBLE))

/* values for barker_preamble */
-#define WLC_BARKER_SHORT_ALLOWED 0 /* Short pre-amble allowed */
+#define BRCMS_BARKER_SHORT_ALLOWED 0 /* Short pre-amble allowed */

/* A fifo is full. Clear precedences related to that FIFO */
-#define WLC_TX_FIFO_CLEAR(wlc, fifo) ((wlc)->tx_prec_map &= ~(wlc)->fifo2prec_map[fifo])
+#define BRCMS_TX_FIFO_CLEAR(wlc, fifo) \
+ ((wlc)->tx_prec_map &= ~(wlc)->fifo2prec_map[fifo])

/* Fifo is NOT full. Enable precedences for that FIFO */
-#define WLC_TX_FIFO_ENAB(wlc, fifo) ((wlc)->tx_prec_map |= (wlc)->fifo2prec_map[fifo])
+#define BRCMS_TX_FIFO_ENAB(wlc, fifo) \
+ ((wlc)->tx_prec_map |= (wlc)->fifo2prec_map[fifo])

/* TxFrameID */
/* seq and frag bits: SEQNUM_SHIFT, FRAGNUM_MASK (802.11.h) */
@@ -121,10 +126,10 @@
/* if wpa is in use then portopen is true when the group key is plumbed otherwise it is always true
*/
#define WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
-#define WLC_SW_KEYS(wlc, bsscfg) ((((wlc)->wsec_swkeys) || \
+#define BRCMS_SW_KEYS(wlc, bsscfg) ((((wlc)->wsec_swkeys) || \
((bsscfg)->wsec & WSEC_SWFLAG)))

-#define WLC_PORTOPEN(cfg) \
+#define BRCMS_PORTOPEN(cfg) \
(((cfg)->WPA_auth != WPA_AUTH_DISABLED && WSEC_ENABLED((cfg)->wsec)) ? \
(cfg)->wsec_portopen : true)

@@ -136,11 +141,11 @@
extern const u8 prio2fifo[];

/* Ucode MCTL_WAKE override bits */
-#define WLC_WAKE_OVERRIDE_CLKCTL 0x01
-#define WLC_WAKE_OVERRIDE_PHYREG 0x02
-#define WLC_WAKE_OVERRIDE_MACSUSPEND 0x04
-#define WLC_WAKE_OVERRIDE_TXFIFO 0x08
-#define WLC_WAKE_OVERRIDE_FORCEFAST 0x10
+#define BRCMS_WAKE_OVERRIDE_CLKCTL 0x01
+#define BRCMS_WAKE_OVERRIDE_PHYREG 0x02
+#define BRCMS_WAKE_OVERRIDE_MACSUSPEND 0x04
+#define BRCMS_WAKE_OVERRIDE_TXFIFO 0x08
+#define BRCMS_WAKE_OVERRIDE_FORCEFAST 0x10

/* stuff pulled in from wlc.c */

@@ -179,24 +184,32 @@ extern const u8 prio2fifo[];

#define NFIFO 6 /* # tx/rx fifopairs */

-#define WLC_WME_RETRY_SHORT_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_SHORT)
-#define WLC_WME_RETRY_SFB_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_SFB)
-#define WLC_WME_RETRY_LONG_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_LONG)
-#define WLC_WME_RETRY_LFB_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_LFB)
+#define BRCMS_WME_RETRY_SHORT_GET(wlc, ac) \
+ GFIELD(wlc->wme_retries[ac], EDCF_SHORT)
+#define BRCMS_WME_RETRY_SFB_GET(wlc, ac) \
+ GFIELD(wlc->wme_retries[ac], EDCF_SFB)
+#define BRCMS_WME_RETRY_LONG_GET(wlc, ac) \
+ GFIELD(wlc->wme_retries[ac], EDCF_LONG)
+#define BRCMS_WME_RETRY_LFB_GET(wlc, ac) \
+ GFIELD(wlc->wme_retries[ac], EDCF_LFB)

-#define WLC_WME_RETRY_SHORT_SET(wlc, ac, val) \
+#define BRCMS_WME_RETRY_SHORT_SET(wlc, ac, val) \
(wlc->wme_retries[ac] = SFIELD(wlc->wme_retries[ac], EDCF_SHORT, val))
-#define WLC_WME_RETRY_SFB_SET(wlc, ac, val) \
+#define BRCMS_WME_RETRY_SFB_SET(wlc, ac, val) \
(wlc->wme_retries[ac] = SFIELD(wlc->wme_retries[ac], EDCF_SFB, val))
-#define WLC_WME_RETRY_LONG_SET(wlc, ac, val) \
+#define BRCMS_WME_RETRY_LONG_SET(wlc, ac, val) \
(wlc->wme_retries[ac] = SFIELD(wlc->wme_retries[ac], EDCF_LONG, val))
-#define WLC_WME_RETRY_LFB_SET(wlc, ac, val) \
+#define BRCMS_WME_RETRY_LFB_SET(wlc, ac, val) \
(wlc->wme_retries[ac] = SFIELD(wlc->wme_retries[ac], EDCF_LFB, val))

/* PLL requests */
-#define WLC_PLLREQ_SHARED 0x1 /* pll is shared on old chips */
-#define WLC_PLLREQ_RADIO_MON 0x2 /* hold pll for radio monitor register checking */
-#define WLC_PLLREQ_FLIP 0x4 /* hold/release pll for some short operation */
+
+/* pll is shared on old chips */
+#define BRCMS_PLLREQ_SHARED 0x1
+/* hold pll for radio monitor register checking */
+#define BRCMS_PLLREQ_RADIO_MON 0x2
+/* hold/release pll for some short operation */
+#define BRCMS_PLLREQ_FLIP 0x4

/*
* Macros to check if AP or STA is active.
@@ -227,7 +240,7 @@ extern const u8 prio2fifo[];
(MCTL_PSM_JMP_0 | MCTL_IHR_EN)) != MCTL_IHR_EN) : \
(ai_deviceremoved(wlc->hw->sih)))

-#define WLCWLUNIT(wlc) ((wlc)->pub->unit)
+#define BRCMS_UNIT(wlc) ((wlc)->pub->unit)

struct brcms_protection {
bool _g; /* use g spec protection, driver internal */
@@ -270,37 +283,41 @@ struct brcms_stf {
s8 spatial_policy;
};

-#define WLC_STF_SS_STBC_TX(wlc, scb) \
+#define BRCMS_STF_SS_STBC_TX(wlc, scb) \
(((wlc)->stf->txstreams > 1) && (((wlc)->band->band_stf_stbc_tx == ON) || \
(SCB_STBC_CAP((scb)) && \
(wlc)->band->band_stf_stbc_tx == AUTO && \
isset(&((wlc)->stf->ss_algo_channel), PHY_TXC1_MODE_STBC))))

-#define WLC_STBC_CAP_PHY(wlc) (WLCISNPHY(wlc->band) && NREV_GE(wlc->band->phyrev, 3))
+#define BRCMS_STBC_CAP_PHY(wlc) (BRCMS_ISNPHY(wlc->band) && \
+ NREV_GE(wlc->band->phyrev, 3))

-#define WLC_SGI_CAP_PHY(wlc) ((WLCISNPHY(wlc->band) && NREV_GE(wlc->band->phyrev, 3)) || \
- WLCISLCNPHY(wlc->band))
+#define BRCMS_SGI_CAP_PHY(wlc) ((BRCMS_ISNPHY(wlc->band) && \
+ NREV_GE(wlc->band->phyrev, 3)) || \
+ BRCMS_ISLCNPHY(wlc->band))

-#define WLC_CHAN_PHYTYPE(x) (((x) & RXS_CHAN_PHYTYPE_MASK) >> RXS_CHAN_PHYTYPE_SHIFT)
-#define WLC_CHAN_CHANNEL(x) (((x) & RXS_CHAN_ID_MASK) >> RXS_CHAN_ID_SHIFT)
-#define WLC_RX_CHANNEL(rxh) (WLC_CHAN_CHANNEL((rxh)->RxChan))
+#define BRCMS_CHAN_PHYTYPE(x) (((x) & RXS_CHAN_PHYTYPE_MASK) \
+ >> RXS_CHAN_PHYTYPE_SHIFT)
+#define BRCMS_CHAN_CHANNEL(x) (((x) & RXS_CHAN_ID_MASK) \
+ >> RXS_CHAN_ID_SHIFT)
+#define BRCMS_RX_CHANNEL(rxh) (BRCMS_CHAN_CHANNEL((rxh)->RxChan))

/* brcms_bss_info flag bit values */
-#define WLC_BSS_HT 0x0020 /* BSS is HT (MIMO) capable */
+#define BRCMS_BSS_HT 0x0020 /* BSS is HT (MIMO) capable */

/* Flags used in brcms_c_txq_info.stopped */
#define TXQ_STOP_FOR_PRIOFC_MASK 0x000000FF /* per prio flow control bits */
#define TXQ_STOP_FOR_PKT_DRAIN 0x00000100 /* stop txq enqueue for packet drain */
#define TXQ_STOP_FOR_AMPDU_FLOW_CNTRL 0x00000200 /* stop txq enqueue for ampdu flow control */

-#define WLC_HT_WEP_RESTRICT 0x01 /* restrict HT with WEP */
-#define WLC_HT_TKIP_RESTRICT 0x02 /* restrict HT with TKIP */
+#define BRCMS_HT_WEP_RESTRICT 0x01 /* restrict HT with WEP */
+#define BRCMS_HT_TKIP_RESTRICT 0x02 /* restrict HT with TKIP */

/* Maximum # of keys that wl driver supports in S/W.
* Keys supported in H/W is less than or equal to WSEC_MAX_KEYS.
*/
#define WSEC_MAX_KEYS 54 /* Max # of keys (50 + 4 default keys) */
-#define WLC_DEFAULT_KEYS 4 /* Default # of keys */
+#define BRCMS_DEFAULT_KEYS 4 /* Default # of keys */

/*
* Max # of keys currently supported:
@@ -308,7 +325,7 @@ struct brcms_stf {
* s/w keys if WSEC_SW(wlc->wsec).
* h/w keys otherwise.
*/
-#define WLC_MAX_WSEC_KEYS(wlc) WSEC_MAX_KEYS
+#define BRCMS_MAX_WSEC_KEYS(wlc) WSEC_MAX_KEYS

/* number of 802.11 default (non-paired, group keys) */
#define WSEC_MAX_DEFAULT_KEYS 4 /* # of default keys */
@@ -318,7 +335,7 @@ struct wsec_iv {
u16 lo; /* lower 16 bits of IV */
};

-#define WLC_NUMRXIVS 16 /* # rx IVs (one per 802.11e TID) */
+#define BRCMS_NUMRXIVS 16 /* # rx IVs (one per 802.11e TID) */

struct wsec_key {
u8 ea[ETH_ALEN]; /* per station */
@@ -334,7 +351,7 @@ struct wsec_key {
u32 len; /* key length..don't move this var */
/* data is 4byte aligned */
u8 data[WLAN_MAX_KEY_LEN]; /* key data */
- struct wsec_iv rxiv[WLC_NUMRXIVS]; /* Rx IV (one per TID) */
+ struct wsec_iv rxiv[BRCMS_NUMRXIVS]; /* Rx IV (one per TID) */
struct wsec_iv txiv; /* Tx IV */
};

@@ -355,7 +372,7 @@ struct brcms_core {
* band state (phy+ana+radio)
*/
struct brcms_band {
- int bandtype; /* WLC_BAND_2G, WLC_BAND_5G */
+ int bandtype; /* BRCM_BAND_2G, BRCM_BAND_5G */
uint bandunit; /* bandstate[] index */

u16 phytype; /* phytype */
@@ -376,7 +393,7 @@ struct brcms_band {
u8 band_stf_ss_mode; /* Configured STF type, 0:siso; 1:cdd */
s8 band_stf_stbc_tx; /* STBC TX 0:off; 1:force on; -1:auto */
wlc_rateset_t hw_rateset; /* rates supported by chip (phy-specific) */
- u8 basic_rate[WLC_MAXRATE + 1]; /* basic rates indexed by rate */
+ u8 basic_rate[BRCM_MAXRATE + 1]; /* basic rates indexed by rate */
bool mimo_cap_40; /* 40 MHz cap enabled on this band */
s8 antgain; /* antenna gain from srom */

@@ -436,7 +453,7 @@ struct wme_param_ie {
/* virtual interface */
struct brcms_c_if {
struct brcms_c_if *next;
- u8 type; /* WLC_IFTYPE_BSS or WLC_IFTYPE_WDS */
+ u8 type; /* BSS or WDS */
u8 index; /* assigned in wl_add_if(), index of the wlif if any,
* not necessarily corresponding to bsscfg._idx or
* AID2PVBMAP(scb).
@@ -445,18 +462,18 @@ struct brcms_c_if {
struct brcms_if *wlif; /* pointer to wlif */
struct brcms_txq_info *qi; /* pointer to associated tx queue */
union {
- /* pointer to scb if WLC_IFTYPE_WDS */
+ /* pointer to scb if WDS */
struct scb *scb;
- /* pointer to bsscfg if WLC_IFTYPE_BSS */
+ /* pointer to bsscfg if BSS */
struct brcms_bss_cfg *bsscfg;
} u;
};

/* flags for the interface, this interface is linked to a brcms_if */
-#define WLC_IF_LINKED 0x02
+#define BRCMS_IF_LINKED 0x02

struct brcms_hw_band {
- int bandtype; /* WLC_BAND_2G, WLC_BAND_5G */
+ int bandtype; /* BRCM_BAND_2G, BRCM_BAND_5G */
uint bandunit; /* bandstate[] index */
u16 mhfs[MHFMAX]; /* MHF array shadow */
u8 bandhw_stf_ss_mode; /* HW configured STF type, 0:siso; 1:cdd */
@@ -673,7 +690,7 @@ struct brcms_c_info {
* BSS Configurations set of BSS configurations, idx 0 is default and
* always valid
*/
- struct brcms_bss_cfg *bsscfg[WLC_MAXBSSCFG];
+ struct brcms_bss_cfg *bsscfg[BRCMS_MAXBSSCFG];
struct brcms_bss_cfg *cfg; /* the primary bsscfg (can be AP or STA) */

/* tx queue */
@@ -682,7 +699,7 @@ struct brcms_c_info {
/* security */
struct wsec_key *wsec_keys[WSEC_MAX_KEYS]; /* dynamic key storage */
/* default key storage */
- struct wsec_key *wsec_def_keys[WLC_DEFAULT_KEYS];
+ struct wsec_key *wsec_def_keys[BRCMS_DEFAULT_KEYS];
bool wsec_swkeys; /* indicates that all keys should be
* treated as sw keys (used for debugging)
*/
@@ -699,12 +716,10 @@ struct brcms_c_info {

u16 mc_fid_counter; /* BC/MC FIFO frame ID counter */

- char country_default[WLC_CNTRY_BUF_SZ]; /* saved country for leaving 802.11d
- * auto-country mode
- */
- char autocountry_default[WLC_CNTRY_BUF_SZ]; /* initial country for 802.11d
- * auto-country mode
- */
+ /* saved country for leaving 802.11d auto-country mode */
+ char country_default[BRCM_CNTRY_BUF_SZ];
+ /* initial country for 802.11d auto-country mode */
+ char autocountry_default[BRCM_CNTRY_BUF_SZ];
u16 prb_resp_timeout; /* do not send prb resp if request older than this,
* 0 = disable
*/
@@ -800,7 +815,7 @@ struct brcms_bss_cfg {
struct wsec_iv wpa_none_txiv;
int wsec_index; /* 0-3: default tx key, -1: not set */
/* default key storage: */
- struct wsec_key *bss_def_keys[WLC_DEFAULT_KEYS];
+ struct wsec_key *bss_def_keys[BRCMS_DEFAULT_KEYS];

/* TKIP countermeasures */
bool tkip_countermeasures; /* flags TKIP no-assoc period */
@@ -814,7 +829,7 @@ struct brcms_bss_cfg {
u16 bcmc_fid; /* the last BCMC FID queued to TX_BCMC_FIFO */
u16 bcmc_fid_shm; /* the last BCMC FID written to shared mem */

- u32 flags; /* WLC_BSSCFG flags; see below */
+ u32 flags; /* BSSCFG flags; see below */

u8 *bcn; /* AP beacon */
uint bcn_len; /* AP beacon length */
@@ -853,7 +868,7 @@ struct brcms_bss_cfg {
#define IS_MBAND_UNLOCKED(wlc) \
((NBANDS(wlc) > 1) && !(wlc)->bandlocked)

-#define WLC_BAND_PI_RADIO_CHANSPEC wlc_phy_chanspec_get(wlc->band->pi)
+#define BRCMS_BAND_PI_RADIO_CHANSPEC wlc_phy_chanspec_get(wlc->band->pi)

/* sum the individual fifo tx pending packet counts */
#define TXPKTPENDTOT(wlc) ((wlc)->core->txpktpend[0] + (wlc)->core->txpktpend[1] + \
@@ -866,7 +881,7 @@ struct brcms_bss_cfg {
#define GETNEXTTXP(wlc, _queue) \
dma_getnexttxp((wlc)->hw->di[(_queue)], DMA_RANGE_TRANSMITTED)

-#define WLC_IS_MATCH_SSID(wlc, ssid1, ssid2, len1, len2) \
+#define BRCMS_IS_MATCH_SSID(wlc, ssid1, ssid2, len1, len2) \
((len1 == len2) && !memcmp(ssid1, ssid2, len1))

extern void brcms_c_fatal_error(struct brcms_c_info *wlc);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index c4e9069..7b1b584 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -109,14 +109,14 @@ u16 ltrn_list[PHY_LTRN_LIST_LEN] = {

const u8 ofdm_rate_lookup[] = {

- WLC_RATE_48M,
- WLC_RATE_24M,
- WLC_RATE_12M,
- WLC_RATE_6M,
- WLC_RATE_54M,
- WLC_RATE_36M,
- WLC_RATE_18M,
- WLC_RATE_9M
+ BRCM_RATE_48M,
+ BRCM_RATE_24M,
+ BRCM_RATE_12M,
+ BRCM_RATE_6M,
+ BRCM_RATE_54M,
+ BRCM_RATE_36M,
+ BRCM_RATE_18M,
+ BRCM_RATE_9M
};

#define PHY_WREG_LIMIT 24
@@ -636,9 +636,9 @@ wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
pi->phynoise_polling = false;

for (i = 0; i < TXP_NUM_RATES; i++) {
- pi->txpwr_limit[i] = WLC_TXPWR_MAX;
- pi->txpwr_env_limit[i] = WLC_TXPWR_MAX;
- pi->tx_user_target[i] = WLC_TXPWR_MAX;
+ pi->txpwr_limit[i] = BRCMS_TXPWR_MAX;
+ pi->txpwr_env_limit[i] = BRCMS_TXPWR_MAX;
+ pi->tx_user_target[i] = BRCMS_TXPWR_MAX;
}

pi->radiopwr_override = RADIOPWR_OVERRIDE_DEF;
@@ -1110,7 +1110,7 @@ wlc_phy_init_radio_regs(struct brcms_phy *pi, struct radio_regs *radioregs,
address | core_offset,
(u16) radioregs[i].init_a);
if (ISNPHY(pi) && (++count % 4 == 0))
- WLC_PHY_WAR_PR51571(pi);
+ BRCMS_PHY_WAR_PR51571(pi);
}
} else {
if (radioregs[i].do_init_g) {
@@ -1119,7 +1119,7 @@ wlc_phy_init_radio_regs(struct brcms_phy *pi, struct radio_regs *radioregs,
address | core_offset,
(u16) radioregs[i].init_g);
if (ISNPHY(pi) && (++count % 4 == 0))
- WLC_PHY_WAR_PR51571(pi);
+ BRCMS_PHY_WAR_PR51571(pi);
}
}

@@ -1411,8 +1411,8 @@ wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
&& (channel <= LAST_REF5_CHANNUM))
continue;

- if (((band == WLC_BAND_2G) && (channel <= CH_MAX_2G_CHANNEL)) ||
- ((band == WLC_BAND_5G) && (channel > CH_MAX_2G_CHANNEL)))
+ if ((band == BRCM_BAND_2G && channel <= CH_MAX_2G_CHANNEL) ||
+ (band == BRCM_BAND_5G && channel > CH_MAX_2G_CHANNEL))
setbit(channels->vec, channel);
}
}
@@ -1443,7 +1443,7 @@ chanspec_t wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band)
chspec =
channel | WL_CHANSPEC_BW_40 |
WL_CHANSPEC_CTL_SB_LOWER;
- if (band == WLC_BAND_2G)
+ if (band == BRCM_BAND_2G)
chspec |= WL_CHANSPEC_BAND_2G;
else
chspec |= WL_CHANSPEC_BAND_5G;
@@ -1454,8 +1454,8 @@ chanspec_t wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band)
&& (channel <= LAST_REF5_CHANNUM))
continue;

- if (((band == WLC_BAND_2G) && (channel <= CH_MAX_2G_CHANNEL)) ||
- ((band == WLC_BAND_5G) && (channel > CH_MAX_2G_CHANNEL)))
+ if ((band == BRCM_BAND_2G && channel <= CH_MAX_2G_CHANNEL) ||
+ (band == BRCM_BAND_5G && channel > CH_MAX_2G_CHANNEL))
return chspec;
}

@@ -1479,35 +1479,35 @@ void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
struct brcms_phy *pi = (struct brcms_phy *) ppi;

memcpy(&pi->tx_user_target[TXP_FIRST_CCK],
- &txpwr->cck[0], WLC_NUM_RATES_CCK);
+ &txpwr->cck[0], BRCMS_NUM_RATES_CCK);

memcpy(&pi->tx_user_target[TXP_FIRST_OFDM],
- &txpwr->ofdm[0], WLC_NUM_RATES_OFDM);
+ &txpwr->ofdm[0], BRCMS_NUM_RATES_OFDM);
memcpy(&pi->tx_user_target[TXP_FIRST_OFDM_20_CDD],
- &txpwr->ofdm_cdd[0], WLC_NUM_RATES_OFDM);
+ &txpwr->ofdm_cdd[0], BRCMS_NUM_RATES_OFDM);

memcpy(&pi->tx_user_target[TXP_FIRST_OFDM_40_SISO],
- &txpwr->ofdm_40_siso[0], WLC_NUM_RATES_OFDM);
+ &txpwr->ofdm_40_siso[0], BRCMS_NUM_RATES_OFDM);
memcpy(&pi->tx_user_target[TXP_FIRST_OFDM_40_CDD],
- &txpwr->ofdm_40_cdd[0], WLC_NUM_RATES_OFDM);
+ &txpwr->ofdm_40_cdd[0], BRCMS_NUM_RATES_OFDM);

memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_SISO],
- &txpwr->mcs_20_siso[0], WLC_NUM_RATES_MCS_1_STREAM);
+ &txpwr->mcs_20_siso[0], BRCMS_NUM_RATES_MCS_1_STREAM);
memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_CDD],
- &txpwr->mcs_20_cdd[0], WLC_NUM_RATES_MCS_1_STREAM);
+ &txpwr->mcs_20_cdd[0], BRCMS_NUM_RATES_MCS_1_STREAM);
memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_STBC],
- &txpwr->mcs_20_stbc[0], WLC_NUM_RATES_MCS_1_STREAM);
+ &txpwr->mcs_20_stbc[0], BRCMS_NUM_RATES_MCS_1_STREAM);
memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_SDM],
- &txpwr->mcs_20_mimo[0], WLC_NUM_RATES_MCS_2_STREAM);
+ &txpwr->mcs_20_mimo[0], BRCMS_NUM_RATES_MCS_2_STREAM);

memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_SISO],
- &txpwr->mcs_40_siso[0], WLC_NUM_RATES_MCS_1_STREAM);
+ &txpwr->mcs_40_siso[0], BRCMS_NUM_RATES_MCS_1_STREAM);
memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_CDD],
- &txpwr->mcs_40_cdd[0], WLC_NUM_RATES_MCS_1_STREAM);
+ &txpwr->mcs_40_cdd[0], BRCMS_NUM_RATES_MCS_1_STREAM);
memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_STBC],
- &txpwr->mcs_40_stbc[0], WLC_NUM_RATES_MCS_1_STREAM);
+ &txpwr->mcs_40_stbc[0], BRCMS_NUM_RATES_MCS_1_STREAM);
memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_SDM],
- &txpwr->mcs_40_mimo[0], WLC_NUM_RATES_MCS_2_STREAM);
+ &txpwr->mcs_40_mimo[0], BRCMS_NUM_RATES_MCS_2_STREAM);

if (R_REG(&pi->regs->maccontrol) & MCTL_EN_MAC)
mac_enabled = true;
@@ -1564,7 +1564,7 @@ wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint channel, u8 *min_pwr,
struct brcms_phy *pi = (struct brcms_phy *) ppi;
uint i;

- *min_pwr = pi->min_txpower * WLC_TXPWR_DB_FACTOR;
+ *min_pwr = pi->min_txpower * BRCMS_TXPWR_DB_FACTOR;

if (ISNPHY(pi)) {
if (txp_rate_idx < 0)
@@ -1578,7 +1578,7 @@ wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint channel, u8 *min_pwr,
*max_pwr = pi->tx_srom_max_rate_2g[txp_rate_idx];
} else {

- *max_pwr = WLC_TXPWR_MAX;
+ *max_pwr = BRCMS_TXPWR_MAX;

if (txp_rate_idx < 0)
txp_rate_idx = TXP_FIRST_OFDM;
@@ -1670,7 +1670,7 @@ void wlc_phy_txpower_recalc_target(struct brcms_phy *pi)
u8 max_num_rate;
u8 start_rate = 0;
chanspec_t chspec;
- u32 band = CHSPEC2WLC_BAND(pi->radio_chanspec);
+ u32 band = CHSPEC2BAND(pi->radio_chanspec);
initfn_t txpwr_recalc_fn = NULL;

chspec = pi->radio_chanspec;
@@ -1782,7 +1782,7 @@ void
wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi, struct txpwr_limits *txpwr,
chanspec_t chanspec)
{
- u8 tmp_txpwr_limit[2 * WLC_NUM_RATES_OFDM];
+ u8 tmp_txpwr_limit[2 * BRCMS_NUM_RATES_OFDM];
u8 *txpwr_ptr1 = NULL, *txpwr_ptr2 = NULL;
int rate_start_index = 0, rate1, rate2, k;

@@ -1825,16 +1825,15 @@ wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi, struct txpwr_limits *txpwr,
break;
}

- for (rate2 = 0; rate2 < WLC_NUM_RATES_OFDM; rate2++) {
+ for (rate2 = 0; rate2 < BRCMS_NUM_RATES_OFDM; rate2++) {
tmp_txpwr_limit[rate2] = 0;
- tmp_txpwr_limit[WLC_NUM_RATES_OFDM + rate2] =
+ tmp_txpwr_limit[BRCMS_NUM_RATES_OFDM + rate2] =
txpwr_ptr1[rate2];
}
wlc_phy_mcs_to_ofdm_powers_nphy(tmp_txpwr_limit, 0,
- WLC_NUM_RATES_OFDM - 1,
- WLC_NUM_RATES_OFDM);
+ BRCMS_NUM_RATES_OFDM - 1, BRCMS_NUM_RATES_OFDM);
for (rate1 = rate_start_index, rate2 = 0;
- rate2 < WLC_NUM_RATES_OFDM; rate1++, rate2++)
+ rate2 < BRCMS_NUM_RATES_OFDM; rate1++, rate2++)
pi->txpwr_limit[rate1] =
min(txpwr_ptr2[rate2],
tmp_txpwr_limit[rate2]);
@@ -1867,16 +1866,15 @@ wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi, struct txpwr_limits *txpwr,
rate_start_index = WL_TX_POWER_MCS40_CDD_FIRST;
break;
}
- for (rate2 = 0; rate2 < WLC_NUM_RATES_OFDM; rate2++) {
+ for (rate2 = 0; rate2 < BRCMS_NUM_RATES_OFDM; rate2++) {
tmp_txpwr_limit[rate2] = 0;
- tmp_txpwr_limit[WLC_NUM_RATES_OFDM + rate2] =
+ tmp_txpwr_limit[BRCMS_NUM_RATES_OFDM + rate2] =
txpwr_ptr1[rate2];
}
wlc_phy_ofdm_to_mcs_powers_nphy(tmp_txpwr_limit, 0,
- WLC_NUM_RATES_OFDM - 1,
- WLC_NUM_RATES_OFDM);
+ BRCMS_NUM_RATES_OFDM - 1, BRCMS_NUM_RATES_OFDM);
for (rate1 = rate_start_index, rate2 = 0;
- rate2 < WLC_NUM_RATES_MCS_1_STREAM;
+ rate2 < BRCMS_NUM_RATES_MCS_1_STREAM;
rate1++, rate2++)
pi->txpwr_limit[rate1] =
min(txpwr_ptr2[rate2],
@@ -1897,7 +1895,7 @@ wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi, struct txpwr_limits *txpwr,
break;
}
for (rate1 = rate_start_index, rate2 = 0;
- rate2 < WLC_NUM_RATES_MCS_1_STREAM;
+ rate2 < BRCMS_NUM_RATES_MCS_1_STREAM;
rate1++, rate2++)
pi->txpwr_limit[rate1] = txpwr_ptr1[rate2];
}
@@ -1916,7 +1914,7 @@ wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi, struct txpwr_limits *txpwr,
break;
}
for (rate1 = rate_start_index, rate2 = 0;
- rate2 < WLC_NUM_RATES_MCS_2_STREAM;
+ rate2 < BRCMS_NUM_RATES_MCS_2_STREAM;
rate1++, rate2++)
pi->txpwr_limit[rate1] = txpwr_ptr1[rate2];
}
@@ -1986,7 +1984,7 @@ wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, struct txpwr_limits *txpwr,
if (ISLCNPHY(pi)) {
int i, j;
for (i = TXP_FIRST_OFDM_20_CDD, j = 0;
- j < WLC_NUM_RATES_MCS_1_STREAM; i++, j++) {
+ j < BRCMS_NUM_RATES_MCS_1_STREAM; i++, j++) {
if (txpwr->mcs_20_siso[j])
pi->txpwr_limit[i] = txpwr->mcs_20_siso[j];
else
@@ -2052,7 +2050,7 @@ void wlc_phy_txpower_update_shm(struct brcms_phy *pi)
}

wlapi_bmac_mhf(pi->sh->physhim, MHF2, MHF2_HWPWRCTL,
- MHF2_HWPWRCTL, WLC_BAND_ALL);
+ MHF2_HWPWRCTL, BRCM_BAND_ALL);
} else {
int i;

@@ -2300,10 +2298,10 @@ void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val)
if (!(ISNPHY(pi) && D11REV_IS(pi->sh->corerev, 16))) {
if (val > ANT_RX_DIV_FORCE_1)
wlapi_bmac_mhf(pi->sh->physhim, MHF1, MHF1_ANTDIV,
- MHF1_ANTDIV, WLC_BAND_ALL);
+ MHF1_ANTDIV, BRCM_BAND_ALL);
else
wlapi_bmac_mhf(pi->sh->physhim, MHF1, MHF1_ANTDIV, 0,
- WLC_BAND_ALL);
+ BRCM_BAND_ALL);
}

if (ISNPHY(pi)) {
@@ -2689,13 +2687,13 @@ void wlc_phy_rssi_compute(struct brcms_phy_pub *pih, void *ctx)
struct brcms_phy *pi = (struct brcms_phy *) pih;

if (NORADIO_ENAB(pi->pubpi)) {
- rssi = WLC_RSSI_INVALID;
+ rssi = BRCMS_RSSI_INVALID;
goto end;
}

if ((pi->sh->corerev >= 11)
&& !(le16_to_cpu(rxh->RxStatus2) & RXS_PHYRXST_VALID)) {
- rssi = WLC_RSSI_INVALID;
+ rssi = BRCMS_RSSI_INVALID;
goto end;
}

@@ -3191,7 +3189,7 @@ static void wlc_phy_upd_env_txpwr_rate_limits(struct brcms_phy *pi, u32 band)
s8 temp, vbat;

for (i = 0; i < TXP_NUM_RATES; i++)
- pi->txpwr_env_limit[i] = WLC_TXPWR_MAX;
+ pi->txpwr_env_limit[i] = BRCMS_TXPWR_MAX;

vbat = wlc_phy_env_measure_vbat(pi);
temp = wlc_phy_env_measure_temperature(pi);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
index e327a57..e27d9e9 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
@@ -87,40 +87,40 @@
#define PHY_MODE_CAL 0x0002
#define PHY_MODE_NOISEM 0x0004

-#define WLC_TXPWR_DB_FACTOR 4
+#define BRCMS_TXPWR_DB_FACTOR 4

/* a large TX Power as an init value to factor out of min() calculations,
* keep low enough to fit in an s8, units are .25 dBm
*/
-#define WLC_TXPWR_MAX (127) /* ~32 dBm = 1,500 mW */
+#define BRCMS_TXPWR_MAX (127) /* ~32 dBm = 1,500 mW */

-#define WLC_NUM_RATES_CCK 4
-#define WLC_NUM_RATES_OFDM 8
-#define WLC_NUM_RATES_MCS_1_STREAM 8
-#define WLC_NUM_RATES_MCS_2_STREAM 8
-#define WLC_NUM_RATES_MCS_3_STREAM 8
-#define WLC_NUM_RATES_MCS_4_STREAM 8
+#define BRCMS_NUM_RATES_CCK 4
+#define BRCMS_NUM_RATES_OFDM 8
+#define BRCMS_NUM_RATES_MCS_1_STREAM 8
+#define BRCMS_NUM_RATES_MCS_2_STREAM 8
+#define BRCMS_NUM_RATES_MCS_3_STREAM 8
+#define BRCMS_NUM_RATES_MCS_4_STREAM 8

-#define WLC_RSSI_INVALID 0 /* invalid RSSI value */
+#define BRCMS_RSSI_INVALID 0 /* invalid RSSI value */

struct txpwr_limits {
- u8 cck[WLC_NUM_RATES_CCK];
- u8 ofdm[WLC_NUM_RATES_OFDM];
+ u8 cck[BRCMS_NUM_RATES_CCK];
+ u8 ofdm[BRCMS_NUM_RATES_OFDM];

- u8 ofdm_cdd[WLC_NUM_RATES_OFDM];
+ u8 ofdm_cdd[BRCMS_NUM_RATES_OFDM];

- u8 ofdm_40_siso[WLC_NUM_RATES_OFDM];
- u8 ofdm_40_cdd[WLC_NUM_RATES_OFDM];
+ u8 ofdm_40_siso[BRCMS_NUM_RATES_OFDM];
+ u8 ofdm_40_cdd[BRCMS_NUM_RATES_OFDM];

- u8 mcs_20_siso[WLC_NUM_RATES_MCS_1_STREAM];
- u8 mcs_20_cdd[WLC_NUM_RATES_MCS_1_STREAM];
- u8 mcs_20_stbc[WLC_NUM_RATES_MCS_1_STREAM];
- u8 mcs_20_mimo[WLC_NUM_RATES_MCS_2_STREAM];
+ u8 mcs_20_siso[BRCMS_NUM_RATES_MCS_1_STREAM];
+ u8 mcs_20_cdd[BRCMS_NUM_RATES_MCS_1_STREAM];
+ u8 mcs_20_stbc[BRCMS_NUM_RATES_MCS_1_STREAM];
+ u8 mcs_20_mimo[BRCMS_NUM_RATES_MCS_2_STREAM];

- u8 mcs_40_siso[WLC_NUM_RATES_MCS_1_STREAM];
- u8 mcs_40_cdd[WLC_NUM_RATES_MCS_1_STREAM];
- u8 mcs_40_stbc[WLC_NUM_RATES_MCS_1_STREAM];
- u8 mcs_40_mimo[WLC_NUM_RATES_MCS_2_STREAM];
+ u8 mcs_40_siso[BRCMS_NUM_RATES_MCS_1_STREAM];
+ u8 mcs_40_cdd[BRCMS_NUM_RATES_MCS_1_STREAM];
+ u8 mcs_40_stbc[BRCMS_NUM_RATES_MCS_1_STREAM];
+ u8 mcs_40_mimo[BRCMS_NUM_RATES_MCS_2_STREAM];
u8 mcs32;
};

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
index 4659503..a01b01c 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
@@ -1159,7 +1159,7 @@ extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32,
((pi->ipa2g_on && CHSPEC_IS2G(pi->radio_chanspec)) || \
(pi->ipa5g_on && CHSPEC_IS5G(pi->radio_chanspec)))

-#define WLC_PHY_WAR_PR51571(pi) \
+#define BRCMS_PHY_WAR_PR51571(pi) \
if (((pi)->sh->bustype == PCI_BUS) && NREV_LT((pi)->pubpi.phy_rev, 3)) \
(void)R_REG(&(pi)->regs->maccontrol)

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index 70e79fc..8e98d8f 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -1606,15 +1606,15 @@ static void wlc_lcnphy_txpower_reset_npt(struct brcms_phy *pi)
void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi)
{
struct phytbl_info tab;
- u32 rate_table[WLC_NUM_RATES_CCK + WLC_NUM_RATES_OFDM +
- WLC_NUM_RATES_MCS_1_STREAM];
+ u32 rate_table[BRCMS_NUM_RATES_CCK + BRCMS_NUM_RATES_OFDM +
+ BRCMS_NUM_RATES_MCS_1_STREAM];
uint i, j;
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi))
return;

for (i = 0, j = 0; i < ARRAY_SIZE(rate_table); i++, j++) {

- if (i == WLC_NUM_RATES_CCK + WLC_NUM_RATES_OFDM)
+ if (i == BRCMS_NUM_RATES_CCK + BRCMS_NUM_RATES_OFDM)
j = TXP_FIRST_MCS_20_SISO;

rate_table[i] = (u32) ((s32) (-pi->tx_power_offset[j]));
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index 2a8c9ff..8e19bd0 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -14470,7 +14470,7 @@ bool wlc_phy_attach_nphy(struct brcms_phy *pi)

pi->n_preamble_override = AUTO;
if (NREV_IS(pi->pubpi.phy_rev, 3) || NREV_IS(pi->pubpi.phy_rev, 4))
- pi->n_preamble_override = WLC_N_PREAMBLE_MIXEDMODE;
+ pi->n_preamble_override = BRCMS_N_PREAMBLE_MIXEDMODE;

pi->nphy_txrx_chain = AUTO;
pi->phy_scraminit = AUTO;
@@ -14929,9 +14929,8 @@ static void wlc_phy_update_mimoconfig_nphy(struct brcms_phy *pi, s32 preamble)
bool gf_preamble = false;
u16 val;

- if (preamble == WLC_N_PREAMBLE_GF) {
+ if (preamble == BRCMS_N_PREAMBLE_GF)
gf_preamble = true;
- }

val = read_phy_reg(pi, 0xed);

@@ -14995,14 +14994,14 @@ void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi)
(NPHY_RfseqCoreActv_TxRxChain0 | NPHY_RfseqCoreActv_TxRxChain1);
bool CoreActv_override = false;

- if (pi->nphy_txrx_chain == WLC_N_TXRX_CHAIN0) {
+ if (pi->nphy_txrx_chain == BRCMS_N_TXRX_CHAIN0) {
txrx_chain = NPHY_RfseqCoreActv_TxRxChain0;
CoreActv_override = true;

if (NREV_LE(pi->pubpi.phy_rev, 2)) {
and_phy_reg(pi, 0xa0, ~0x20);
}
- } else if (pi->nphy_txrx_chain == WLC_N_TXRX_CHAIN1) {
+ } else if (pi->nphy_txrx_chain == BRCMS_N_TXRX_CHAIN1) {
txrx_chain = NPHY_RfseqCoreActv_TxRxChain1;
CoreActv_override = true;

@@ -16215,8 +16214,8 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)

if (pi->sh->boardflags2 & BFL2_SINGLEANT_CCK) {
wlapi_bmac_mhf(pi->sh->physhim, MHF4,
- MHF4_BPHY_TXCORE0,
- MHF4_BPHY_TXCORE0, WLC_BAND_ALL);
+ MHF4_BPHY_TXCORE0,
+ MHF4_BPHY_TXCORE0, BRCM_BAND_ALL);
}
}
} else {
@@ -16284,7 +16283,7 @@ static void wlc_phy_workarounds_nphy(struct brcms_phy *pi)
wlapi_bmac_mhf(pi->sh->physhim, MHF3,
MHF3_NPHY_MLADV_WAR,
MHF3_NPHY_MLADV_WAR,
- WLC_BAND_ALL);
+ BRCM_BAND_ALL);

} else if (NREV_IS(pi->pubpi.phy_rev, 2)) {
write_phy_reg(pi, 0x1e3, 0x0);
@@ -17798,21 +17797,21 @@ wlc_phy_chanspec_radio2055_setup(struct brcms_phy *pi,
write_radio_reg(pi, RADIO_2055_RF_PLL_MOD1, ci->RF_rf_pll_mod1);
write_radio_reg(pi, RADIO_2055_VCO_CAP_TAIL, ci->RF_vco_cap_tail);

- WLC_PHY_WAR_PR51571(pi);
+ BRCMS_PHY_WAR_PR51571(pi);

write_radio_reg(pi, RADIO_2055_VCO_CAL1, ci->RF_vco_cal1);
write_radio_reg(pi, RADIO_2055_VCO_CAL2, ci->RF_vco_cal2);
write_radio_reg(pi, RADIO_2055_PLL_LF_C1, ci->RF_pll_lf_c1);
write_radio_reg(pi, RADIO_2055_PLL_LF_R1, ci->RF_pll_lf_r1);

- WLC_PHY_WAR_PR51571(pi);
+ BRCMS_PHY_WAR_PR51571(pi);

write_radio_reg(pi, RADIO_2055_PLL_LF_C2, ci->RF_pll_lf_c2);
write_radio_reg(pi, RADIO_2055_LGBUF_CEN_BUF, ci->RF_lgbuf_cen_buf);
write_radio_reg(pi, RADIO_2055_LGEN_TUNE1, ci->RF_lgen_tune1);
write_radio_reg(pi, RADIO_2055_LGEN_TUNE2, ci->RF_lgen_tune2);

- WLC_PHY_WAR_PR51571(pi);
+ BRCMS_PHY_WAR_PR51571(pi);

write_radio_reg(pi, RADIO_2055_CORE1_LGBUF_A_TUNE,
ci->RF_core1_lgbuf_a_tune);
@@ -17822,7 +17821,7 @@ wlc_phy_chanspec_radio2055_setup(struct brcms_phy *pi,
write_radio_reg(pi, RADIO_2055_CORE1_TX_PGA_PAD_TN,
ci->RF_core1_tx_pga_pad_tn);

- WLC_PHY_WAR_PR51571(pi);
+ BRCMS_PHY_WAR_PR51571(pi);

write_radio_reg(pi, RADIO_2055_CORE1_TX_MX_BGTRIM,
ci->RF_core1_tx_mx_bgtrim);
@@ -17832,7 +17831,7 @@ wlc_phy_chanspec_radio2055_setup(struct brcms_phy *pi,
ci->RF_core2_lgbuf_g_tune);
write_radio_reg(pi, RADIO_2055_CORE2_RXRF_REG1, ci->RF_core2_rxrf_reg1);

- WLC_PHY_WAR_PR51571(pi);
+ BRCMS_PHY_WAR_PR51571(pi);

write_radio_reg(pi, RADIO_2055_CORE2_TX_PGA_PAD_TN,
ci->RF_core2_tx_pga_pad_tn);
@@ -17844,7 +17843,7 @@ wlc_phy_chanspec_radio2055_setup(struct brcms_phy *pi,
write_radio_reg(pi, RADIO_2055_VCO_CAL10, 0x05);
write_radio_reg(pi, RADIO_2055_VCO_CAL10, 0x45);

- WLC_PHY_WAR_PR51571(pi);
+ BRCMS_PHY_WAR_PR51571(pi);

write_radio_reg(pi, RADIO_2055_VCO_CAL10, 0x65);

@@ -28697,7 +28696,7 @@ void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type)

if (NREV_LT(pi->pubpi.phy_rev, 2) && IS40MHZ(pi))
wlapi_bmac_mhf(pi->sh->physhim, MHF1, MHF1_IQSWAP_WAR,
- MHF1_IQSWAP_WAR, WLC_BAND_ALL);
+ MHF1_IQSWAP_WAR, BRCM_BAND_ALL);

} else {

@@ -28756,7 +28755,7 @@ void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type)

if (NREV_LT(pi->pubpi.phy_rev, 2) && IS40MHZ(pi))
wlapi_bmac_mhf(pi->sh->physhim, MHF1, MHF1_IQSWAP_WAR,
- 0x0, WLC_BAND_ALL);
+ 0x0, BRCM_BAND_ALL);

if (PHY_IPA(pi)) {
mod_phy_reg(pi, (0 == PHY_CORE_0) ? 0x297 :
diff --git a/drivers/staging/brcm80211/brcmsmac/phy_shim.c b/drivers/staging/brcm80211/brcmsmac/phy_shim.c
index 12defaa..82ecdcd 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy_shim.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy_shim.c
@@ -178,13 +178,13 @@ void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim)
void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *physhim)
{
brcms_c_ucode_wake_override_set(physhim->wlc_hw,
- WLC_WAKE_OVERRIDE_PHYREG);
+ BRCMS_WAKE_OVERRIDE_PHYREG);
}

void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *physhim)
{
brcms_c_ucode_wake_override_clear(physhim->wlc_hw,
- WLC_WAKE_OVERRIDE_PHYREG);
+ BRCMS_WAKE_OVERRIDE_PHYREG);
}

void
diff --git a/drivers/staging/brcm80211/brcmsmac/phy_shim.h b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
index 0ac7fa5..2d12bb4 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy_shim.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
@@ -63,9 +63,9 @@
#define WL_ANT_IDX_2 1 /* antenna index 2 */

/* values for n_preamble_type */
-#define WLC_N_PREAMBLE_MIXEDMODE 0
-#define WLC_N_PREAMBLE_GF 1
-#define WLC_N_PREAMBLE_GF_BRCM 2
+#define BRCMS_N_PREAMBLE_MIXEDMODE 0
+#define BRCMS_N_PREAMBLE_GF 1
+#define BRCMS_N_PREAMBLE_GF_BRCM 2

#define WL_TX_POWER_RATES_LEGACY 45
#define WL_TX_POWER_MCS20_FIRST 12
@@ -105,8 +105,8 @@
#define WL_TX_POWER_F_SISO 8

/* values to force tx/rx chain */
-#define WLC_N_TXRX_CHAIN0 0
-#define WLC_N_TXRX_CHAIN1 1
+#define BRCMS_N_TXRX_CHAIN0 0
+#define BRCMS_N_TXRX_CHAIN1 1

extern struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
void *wl, void *wlc);
diff --git a/drivers/staging/brcm80211/brcmsmac/pub.h b/drivers/staging/brcm80211/brcmsmac/pub.h
index c1f2fdc..01d7460 100644
--- a/drivers/staging/brcm80211/brcmsmac/pub.h
+++ b/drivers/staging/brcm80211/brcmsmac/pub.h
@@ -21,7 +21,7 @@
#include "types.h"
#include "defs.h"

-#define WLC_NUMRATES 16 /* max # of rates in a rateset */
+#define BRCMS_NUMRATES 16 /* max # of rates in a rateset */
#define MAXMULTILIST 32 /* max # multicast addresses */
#define D11_PHY_HDR_LEN 6 /* Phy header length - 6 bytes */

@@ -36,36 +36,37 @@
#define PHY_TYPE_HT 7 /* Phy type 3-Stream N */

/* bw */
-#define WLC_10_MHZ 10 /* 10Mhz nphy channel bandwidth */
-#define WLC_20_MHZ 20 /* 20Mhz nphy channel bandwidth */
-#define WLC_40_MHZ 40 /* 40Mhz nphy channel bandwidth */
+#define BRCMS_10_MHZ 10 /* 10Mhz nphy channel bandwidth */
+#define BRCMS_20_MHZ 20 /* 20Mhz nphy channel bandwidth */
+#define BRCMS_40_MHZ 40 /* 40Mhz nphy channel bandwidth */

-#define CHSPEC_WLC_BW(chanspec) (CHSPEC_IS40(chanspec) ? WLC_40_MHZ : \
- CHSPEC_IS20(chanspec) ? WLC_20_MHZ : \
- WLC_10_MHZ)
+#define CHSPEC_WLC_BW(chanspec) (CHSPEC_IS40(chanspec) ? BRCMS_40_MHZ : \
+ CHSPEC_IS20(chanspec) ? BRCMS_20_MHZ : \
+ BRCMS_10_MHZ)

-#define WLC_RSSI_MINVAL -200 /* Low value, e.g. for forcing roam */
-#define WLC_RSSI_NO_SIGNAL -91 /* NDIS RSSI link quality cutoffs */
-#define WLC_RSSI_VERY_LOW -80 /* Very low quality cutoffs */
-#define WLC_RSSI_LOW -70 /* Low quality cutoffs */
-#define WLC_RSSI_GOOD -68 /* Good quality cutoffs */
-#define WLC_RSSI_VERY_GOOD -58 /* Very good quality cutoffs */
-#define WLC_RSSI_EXCELLENT -57 /* Excellent quality cutoffs */
+#define BRCMS_RSSI_MINVAL -200 /* Low value, e.g. for forcing roam */
+#define BRCMS_RSSI_NO_SIGNAL -91 /* NDIS RSSI link quality cutoffs */
+#define BRCMS_RSSI_VERY_LOW -80 /* Very low quality cutoffs */
+#define BRCMS_RSSI_LOW -70 /* Low quality cutoffs */
+#define BRCMS_RSSI_GOOD -68 /* Good quality cutoffs */
+#define BRCMS_RSSI_VERY_GOOD -58 /* Very good quality cutoffs */
+#define BRCMS_RSSI_EXCELLENT -57 /* Excellent quality cutoffs */

-#define WLC_PHYTYPE(_x) (_x) /* macro to perform WLC PHY -> D11 PHY TYPE, currently 1:1 */
+/* macro to perform PHY -> D11 PHY TYPE, currently 1:1 */
+#define BRCMS_PHYTYPE(_x) (_x)

#define MA_WINDOW_SZ 8 /* moving average window size */

-#define WLC_SNR_INVALID 0 /* invalid SNR value */
+#define BRCMS_SNR_INVALID 0 /* invalid SNR value */

/* a large TX Power as an init value to factor out of min() calculations,
* keep low enough to fit in an s8, units are .25 dBm
*/
-#define WLC_TXPWR_MAX (127) /* ~32 dBm = 1,500 mW */
+#define BRCMS_TXPWR_MAX (127) /* ~32 dBm = 1,500 mW */

/* rate related definitions */
-#define WLC_RATE_FLAG 0x80 /* Flag to indicate it is a basic rate */
-#define WLC_RATE_MASK 0x7f /* Rate value mask w/o basic rate flag */
+#define BRCMS_RATE_FLAG 0x80 /* Flag to indicate it is a basic rate */
+#define BRCMS_RATE_MASK 0x7f /* Rate value mask w/o basic rate flag */

/* legacy rx Antenna diversity for SISO rates */
#define ANT_RX_DIV_FORCE_0 0 /* Use antenna 0 */
@@ -126,7 +127,8 @@ struct brcms_tunables {

struct brcms_rateset {
uint count; /* number of rates in rates[] */
- u8 rates[WLC_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
+ /* rates in 500kbps units w/hi bit set if basic */
+ u8 rates[BRCMS_NUMRATES];
u8 htphy_membership; /* HT PHY Membership */
u8 mcs[MCSSET_LEN]; /* supported mcs index bit map */
};
@@ -175,7 +177,7 @@ struct brcms_bss_info {
u8 dtim_period; /* DTIM period */
s8 phy_noise; /* noise right after tx (in dBm) */
u16 capability; /* Capability information */
- u8 wme_qosinfo; /* QoS Info from WME IE; valid if WLC_BSS_WME flag set */
+ u8 wme_qosinfo; /* QoS Info from WME IE; valid if BSS_WME flag set */
struct rsn_parms wpa;
struct rsn_parms wpa2;
u16 qbss_load_aac; /* qbss load available admission capacity */
@@ -185,17 +187,6 @@ struct brcms_bss_info {
u8 wpacfg; /* wpa config index */
};

-/* brcms_c_ioctl error codes */
-#define WLC_ENOIOCTL 1 /* No such Ioctl */
-#define WLC_EINVAL 2 /* Invalid value */
-#define WLC_ETOOSMALL 3 /* Value too small */
-#define WLC_ETOOBIG 4 /* Value too big */
-#define WLC_ERANGE 5 /* Out of range */
-#define WLC_EDOWN 6 /* Down */
-#define WLC_EUP 7 /* Up */
-#define WLC_ENOMEM 8 /* No Memory */
-#define WLC_EBUSY 9 /* Busy */
-
/* IOVar flags for common error checks */
#define IOVF_MFG (1<<3) /* flag for mfgtest iovars */
#define IOVF_WHL (1<<4) /* value must be whole (0-max) */
@@ -312,7 +303,7 @@ struct brcms_pub {

u16 boardrev; /* version # of particular board */
u8 sromrev; /* version # of the srom */
- char srom_ccode[WLC_CNTRY_BUF_SZ]; /* Country Code in SROM */
+ char srom_ccode[BRCM_CNTRY_BUF_SZ]; /* Country Code in SROM */
u32 boardflags; /* Board specific flags from srom */
u32 boardflags2; /* More board flags if sromrev >= 4 */
bool tempsense_disable; /* disable periodic tempsense check */
@@ -427,62 +418,64 @@ enum wlc_par_id {

#define PROMISC_ENAB(wlc) ((wlc)->promisc)

-#define WLC_PREC_COUNT 16 /* Max precedence level implemented */
+#define BRCMS_PREC_COUNT 16 /* Max precedence level implemented */

/* pri is priority encoded in the packet. This maps the Packet priority to
* enqueue precedence as defined in wlc_prec_map
*/
extern const u8 wlc_prio2prec_map[];
-#define WLC_PRIO_TO_PREC(pri) wlc_prio2prec_map[(pri) & 7]
+#define BRCMS_PRIO_TO_PREC(pri) wlc_prio2prec_map[(pri) & 7]

/* This maps priority to one precedence higher - Used by PS-Poll response packets to
* simulate enqueue-at-head operation, but still maintain the order on the queue
*/
-#define WLC_PRIO_TO_HI_PREC(pri) min(WLC_PRIO_TO_PREC(pri) + 1, WLC_PREC_COUNT - 1)
+#define BRCMS_PRIO_TO_HI_PREC(pri) min(BRCMS_PRIO_TO_PREC(pri) + 1,\
+ BRCMS_PREC_COUNT - 1)

extern const u8 wme_fifo2ac[];
#define WME_PRIO2AC(prio) wme_fifo2ac[prio2fifo[(prio)]]

/* Mask to describe all precedence levels */
-#define WLC_PREC_BMP_ALL MAXBITVAL(WLC_PREC_COUNT)
+#define BRCMS_PREC_BMP_ALL MAXBITVAL(BRCMS_PREC_COUNT)

/* Define a bitmap of precedences comprised by each AC */
-#define WLC_PREC_BMP_AC_BE (NBITVAL(WLC_PRIO_TO_PREC(PRIO_8021D_BE)) | \
- NBITVAL(WLC_PRIO_TO_HI_PREC(PRIO_8021D_BE)) | \
- NBITVAL(WLC_PRIO_TO_PREC(PRIO_8021D_EE)) | \
- NBITVAL(WLC_PRIO_TO_HI_PREC(PRIO_8021D_EE)))
-#define WLC_PREC_BMP_AC_BK (NBITVAL(WLC_PRIO_TO_PREC(PRIO_8021D_BK)) | \
- NBITVAL(WLC_PRIO_TO_HI_PREC(PRIO_8021D_BK)) | \
- NBITVAL(WLC_PRIO_TO_PREC(PRIO_8021D_NONE)) | \
- NBITVAL(WLC_PRIO_TO_HI_PREC(PRIO_8021D_NONE)))
-#define WLC_PREC_BMP_AC_VI (NBITVAL(WLC_PRIO_TO_PREC(PRIO_8021D_CL)) | \
- NBITVAL(WLC_PRIO_TO_HI_PREC(PRIO_8021D_CL)) | \
- NBITVAL(WLC_PRIO_TO_PREC(PRIO_8021D_VI)) | \
- NBITVAL(WLC_PRIO_TO_HI_PREC(PRIO_8021D_VI)))
-#define WLC_PREC_BMP_AC_VO (NBITVAL(WLC_PRIO_TO_PREC(PRIO_8021D_VO)) | \
- NBITVAL(WLC_PRIO_TO_HI_PREC(PRIO_8021D_VO)) | \
- NBITVAL(WLC_PRIO_TO_PREC(PRIO_8021D_NC)) | \
- NBITVAL(WLC_PRIO_TO_HI_PREC(PRIO_8021D_NC)))
+#define BRCMS_PREC_BMP_AC_BE (NBITVAL(BRCMS_PRIO_TO_PREC(PRIO_8021D_BE)) | \
+ NBITVAL(BRCMS_PRIO_TO_HI_PREC(PRIO_8021D_BE)) | \
+ NBITVAL(BRCMS_PRIO_TO_PREC(PRIO_8021D_EE)) | \
+ NBITVAL(BRCMS_PRIO_TO_HI_PREC(PRIO_8021D_EE)))
+#define BRCMS_PREC_BMP_AC_BK (NBITVAL(BRCMS_PRIO_TO_PREC(PRIO_8021D_BK)) | \
+ NBITVAL(BRCMS_PRIO_TO_HI_PREC(PRIO_8021D_BK)) | \
+ NBITVAL(BRCMS_PRIO_TO_PREC(PRIO_8021D_NONE)) | \
+ NBITVAL(BRCMS_PRIO_TO_HI_PREC(PRIO_8021D_NONE)))
+#define BRCMS_PREC_BMP_AC_VI (NBITVAL(BRCMS_PRIO_TO_PREC(PRIO_8021D_CL)) | \
+ NBITVAL(BRCMS_PRIO_TO_HI_PREC(PRIO_8021D_CL)) | \
+ NBITVAL(BRCMS_PRIO_TO_PREC(PRIO_8021D_VI)) | \
+ NBITVAL(BRCMS_PRIO_TO_HI_PREC(PRIO_8021D_VI)))
+#define BRCMS_PREC_BMP_AC_VO (NBITVAL(BRCMS_PRIO_TO_PREC(PRIO_8021D_VO)) | \
+ NBITVAL(BRCMS_PRIO_TO_HI_PREC(PRIO_8021D_VO)) | \
+ NBITVAL(BRCMS_PRIO_TO_PREC(PRIO_8021D_NC)) | \
+ NBITVAL(BRCMS_PRIO_TO_HI_PREC(PRIO_8021D_NC)))

/* WME Support */
#define WME_ENAB(pub) ((pub)->_wme != OFF)
#define WME_AUTO(wlc) ((wlc)->pub->_wme == AUTO)

-#define WLC_USE_COREFLAGS 0xffffffff /* invalid core flags, use the saved coreflags */
+/* invalid core flags, use the saved coreflags */
+#define BRCMS_USE_COREFLAGS 0xffffffff


/* network protection config */
-#define WLC_PROT_G_SPEC 1 /* SPEC g protection */
-#define WLC_PROT_G_OVR 2 /* SPEC g prot override */
-#define WLC_PROT_G_USER 3 /* gmode specified by user */
-#define WLC_PROT_OVERLAP 4 /* overlap */
-#define WLC_PROT_N_USER 10 /* nmode specified by user */
-#define WLC_PROT_N_CFG 11 /* n protection */
-#define WLC_PROT_N_CFG_OVR 12 /* n protection override */
-#define WLC_PROT_N_NONGF 13 /* non-GF protection */
-#define WLC_PROT_N_NONGF_OVR 14 /* non-GF protection override */
-#define WLC_PROT_N_PAM_OVR 15 /* n preamble override */
-#define WLC_PROT_N_OBSS 16 /* non-HT OBSS present */
+#define BRCMS_PROT_G_SPEC 1 /* SPEC g protection */
+#define BRCMS_PROT_G_OVR 2 /* SPEC g prot override */
+#define BRCMS_PROT_G_USER 3 /* gmode specified by user */
+#define BRCMS_PROT_OVERLAP 4 /* overlap */
+#define BRCMS_PROT_N_USER 10 /* nmode specified by user */
+#define BRCMS_PROT_N_CFG 11 /* n protection */
+#define BRCMS_PROT_N_CFG_OVR 12 /* n protection override */
+#define BRCMS_PROT_N_NONGF 13 /* non-GF protection */
+#define BRCMS_PROT_N_NONGF_OVR 14 /* non-GF protection override */
+#define BRCMS_PROT_N_PAM_OVR 15 /* n preamble override */
+#define BRCMS_PROT_N_OBSS 16 /* non-HT OBSS present */

/*
* 54g modes (basic bits may still be overridden)
@@ -519,36 +512,36 @@ extern const u8 wme_fifo2ac[];
#define GMODE_MAX 6

/* values for PLCPHdr_override */
-#define WLC_PLCP_AUTO -1
-#define WLC_PLCP_SHORT 0
-#define WLC_PLCP_LONG 1
+#define BRCMS_PLCP_AUTO -1
+#define BRCMS_PLCP_SHORT 0
+#define BRCMS_PLCP_LONG 1

/* values for g_protection_override and n_protection_override */
-#define WLC_PROTECTION_AUTO -1
-#define WLC_PROTECTION_OFF 0
-#define WLC_PROTECTION_ON 1
-#define WLC_PROTECTION_MMHDR_ONLY 2
-#define WLC_PROTECTION_CTS_ONLY 3
+#define BRCMS_PROTECTION_AUTO -1
+#define BRCMS_PROTECTION_OFF 0
+#define BRCMS_PROTECTION_ON 1
+#define BRCMS_PROTECTION_MMHDR_ONLY 2
+#define BRCMS_PROTECTION_CTS_ONLY 3

/* values for g_protection_control and n_protection_control */
-#define WLC_PROTECTION_CTL_OFF 0
-#define WLC_PROTECTION_CTL_LOCAL 1
-#define WLC_PROTECTION_CTL_OVERLAP 2
+#define BRCMS_PROTECTION_CTL_OFF 0
+#define BRCMS_PROTECTION_CTL_LOCAL 1
+#define BRCMS_PROTECTION_CTL_OVERLAP 2

/* values for n_protection */
-#define WLC_N_PROTECTION_OFF 0
-#define WLC_N_PROTECTION_OPTIONAL 1
-#define WLC_N_PROTECTION_20IN40 2
-#define WLC_N_PROTECTION_MIXEDMODE 3
+#define BRCMS_N_PROTECTION_OFF 0
+#define BRCMS_N_PROTECTION_OPTIONAL 1
+#define BRCMS_N_PROTECTION_20IN40 2
+#define BRCMS_N_PROTECTION_MIXEDMODE 3

/* values for band specific 40MHz capabilities */
-#define WLC_N_BW_20ALL 0
-#define WLC_N_BW_40ALL 1
-#define WLC_N_BW_20IN2G_40IN5G 2
+#define BRCMS_N_BW_20ALL 0
+#define BRCMS_N_BW_40ALL 1
+#define BRCMS_N_BW_20IN2G_40IN5G 2

/* bitflags for SGI support (sgi_rx iovar) */
-#define WLC_N_SGI_20 0x01
-#define WLC_N_SGI_40 0x02
+#define BRCMS_N_SGI_20 0x01
+#define BRCMS_N_SGI_40 0x02

/* defines used by the nrate iovar */
#define NRATE_MCS_INUSE 0x00000080 /* MSC in use,indicates b0-6 holds an mcs */
@@ -667,6 +660,6 @@ extern bool brcms_c_radio_monitor_stop(struct brcms_c_info *wlc);
#define BAND_5G_NAME "5G"

/* BMAC RPC: 7 u32 params: pkttotlen, fifo, commit, fid, txpktpend, pktflag, rpc_id */
-#define WLC_RPCTX_PARAMS 32
+#define BRCMS_RPCTX_PARAMS 32

#endif /* _BRCM_PUB_H_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/rate.c b/drivers/staging/brcm80211/brcmsmac/rate.c
index 487523e..f0e4b99 100644
--- a/drivers/staging/brcm80211/brcmsmac/rate.c
+++ b/drivers/staging/brcm80211/brcmsmac/rate.c
@@ -22,7 +22,7 @@
#include "rate.h"

/* Rate info per rate: It tells whether a rate is ofdm or not and its phy_rate value */
-const u8 rate_info[WLC_MAXRATE + 1] = {
+const u8 rate_info[BRCM_MAXRATE + 1] = {
/* 0 1 2 3 4 5 6 7 8 9 */
/* 0 */ 0x00, 0x00, 0x0a, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00,
/* 10 */ 0x00, 0x37, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x00,
@@ -41,102 +41,102 @@ const u8 rate_info[WLC_MAXRATE + 1] = {
const struct brcms_mcs_info mcs_table[MCS_TABLE_SIZE] = {
/* MCS 0: SS 1, MOD: BPSK, CR 1/2 */
{6500, 13500, CEIL(6500 * 10, 9), CEIL(13500 * 10, 9), 0x00,
- WLC_RATE_6M},
+ BRCM_RATE_6M},
/* MCS 1: SS 1, MOD: QPSK, CR 1/2 */
{13000, 27000, CEIL(13000 * 10, 9), CEIL(27000 * 10, 9), 0x08,
- WLC_RATE_12M},
+ BRCM_RATE_12M},
/* MCS 2: SS 1, MOD: QPSK, CR 3/4 */
{19500, 40500, CEIL(19500 * 10, 9), CEIL(40500 * 10, 9), 0x0A,
- WLC_RATE_18M},
+ BRCM_RATE_18M},
/* MCS 3: SS 1, MOD: 16QAM, CR 1/2 */
{26000, 54000, CEIL(26000 * 10, 9), CEIL(54000 * 10, 9), 0x10,
- WLC_RATE_24M},
+ BRCM_RATE_24M},
/* MCS 4: SS 1, MOD: 16QAM, CR 3/4 */
{39000, 81000, CEIL(39000 * 10, 9), CEIL(81000 * 10, 9), 0x12,
- WLC_RATE_36M},
+ BRCM_RATE_36M},
/* MCS 5: SS 1, MOD: 64QAM, CR 2/3 */
{52000, 108000, CEIL(52000 * 10, 9), CEIL(108000 * 10, 9), 0x19,
- WLC_RATE_48M},
+ BRCM_RATE_48M},
/* MCS 6: SS 1, MOD: 64QAM, CR 3/4 */
{58500, 121500, CEIL(58500 * 10, 9), CEIL(121500 * 10, 9), 0x1A,
- WLC_RATE_54M},
+ BRCM_RATE_54M},
/* MCS 7: SS 1, MOD: 64QAM, CR 5/6 */
{65000, 135000, CEIL(65000 * 10, 9), CEIL(135000 * 10, 9), 0x1C,
- WLC_RATE_54M},
+ BRCM_RATE_54M},
/* MCS 8: SS 2, MOD: BPSK, CR 1/2 */
{13000, 27000, CEIL(13000 * 10, 9), CEIL(27000 * 10, 9), 0x40,
- WLC_RATE_6M},
+ BRCM_RATE_6M},
/* MCS 9: SS 2, MOD: QPSK, CR 1/2 */
{26000, 54000, CEIL(26000 * 10, 9), CEIL(54000 * 10, 9), 0x48,
- WLC_RATE_12M},
+ BRCM_RATE_12M},
/* MCS 10: SS 2, MOD: QPSK, CR 3/4 */
{39000, 81000, CEIL(39000 * 10, 9), CEIL(81000 * 10, 9), 0x4A,
- WLC_RATE_18M},
+ BRCM_RATE_18M},
/* MCS 11: SS 2, MOD: 16QAM, CR 1/2 */
{52000, 108000, CEIL(52000 * 10, 9), CEIL(108000 * 10, 9), 0x50,
- WLC_RATE_24M},
+ BRCM_RATE_24M},
/* MCS 12: SS 2, MOD: 16QAM, CR 3/4 */
{78000, 162000, CEIL(78000 * 10, 9), CEIL(162000 * 10, 9), 0x52,
- WLC_RATE_36M},
+ BRCM_RATE_36M},
/* MCS 13: SS 2, MOD: 64QAM, CR 2/3 */
{104000, 216000, CEIL(104000 * 10, 9), CEIL(216000 * 10, 9), 0x59,
- WLC_RATE_48M},
+ BRCM_RATE_48M},
/* MCS 14: SS 2, MOD: 64QAM, CR 3/4 */
{117000, 243000, CEIL(117000 * 10, 9), CEIL(243000 * 10, 9), 0x5A,
- WLC_RATE_54M},
+ BRCM_RATE_54M},
/* MCS 15: SS 2, MOD: 64QAM, CR 5/6 */
{130000, 270000, CEIL(130000 * 10, 9), CEIL(270000 * 10, 9), 0x5C,
- WLC_RATE_54M},
+ BRCM_RATE_54M},
/* MCS 16: SS 3, MOD: BPSK, CR 1/2 */
{19500, 40500, CEIL(19500 * 10, 9), CEIL(40500 * 10, 9), 0x80,
- WLC_RATE_6M},
+ BRCM_RATE_6M},
/* MCS 17: SS 3, MOD: QPSK, CR 1/2 */
{39000, 81000, CEIL(39000 * 10, 9), CEIL(81000 * 10, 9), 0x88,
- WLC_RATE_12M},
+ BRCM_RATE_12M},
/* MCS 18: SS 3, MOD: QPSK, CR 3/4 */
{58500, 121500, CEIL(58500 * 10, 9), CEIL(121500 * 10, 9), 0x8A,
- WLC_RATE_18M},
+ BRCM_RATE_18M},
/* MCS 19: SS 3, MOD: 16QAM, CR 1/2 */
{78000, 162000, CEIL(78000 * 10, 9), CEIL(162000 * 10, 9), 0x90,
- WLC_RATE_24M},
+ BRCM_RATE_24M},
/* MCS 20: SS 3, MOD: 16QAM, CR 3/4 */
{117000, 243000, CEIL(117000 * 10, 9), CEIL(243000 * 10, 9), 0x92,
- WLC_RATE_36M},
+ BRCM_RATE_36M},
/* MCS 21: SS 3, MOD: 64QAM, CR 2/3 */
{156000, 324000, CEIL(156000 * 10, 9), CEIL(324000 * 10, 9), 0x99,
- WLC_RATE_48M},
+ BRCM_RATE_48M},
/* MCS 22: SS 3, MOD: 64QAM, CR 3/4 */
{175500, 364500, CEIL(175500 * 10, 9), CEIL(364500 * 10, 9), 0x9A,
- WLC_RATE_54M},
+ BRCM_RATE_54M},
/* MCS 23: SS 3, MOD: 64QAM, CR 5/6 */
{195000, 405000, CEIL(195000 * 10, 9), CEIL(405000 * 10, 9), 0x9B,
- WLC_RATE_54M},
+ BRCM_RATE_54M},
/* MCS 24: SS 4, MOD: BPSK, CR 1/2 */
{26000, 54000, CEIL(26000 * 10, 9), CEIL(54000 * 10, 9), 0xC0,
- WLC_RATE_6M},
+ BRCM_RATE_6M},
/* MCS 25: SS 4, MOD: QPSK, CR 1/2 */
{52000, 108000, CEIL(52000 * 10, 9), CEIL(108000 * 10, 9), 0xC8,
- WLC_RATE_12M},
+ BRCM_RATE_12M},
/* MCS 26: SS 4, MOD: QPSK, CR 3/4 */
{78000, 162000, CEIL(78000 * 10, 9), CEIL(162000 * 10, 9), 0xCA,
- WLC_RATE_18M},
+ BRCM_RATE_18M},
/* MCS 27: SS 4, MOD: 16QAM, CR 1/2 */
{104000, 216000, CEIL(104000 * 10, 9), CEIL(216000 * 10, 9), 0xD0,
- WLC_RATE_24M},
+ BRCM_RATE_24M},
/* MCS 28: SS 4, MOD: 16QAM, CR 3/4 */
{156000, 324000, CEIL(156000 * 10, 9), CEIL(324000 * 10, 9), 0xD2,
- WLC_RATE_36M},
+ BRCM_RATE_36M},
/* MCS 29: SS 4, MOD: 64QAM, CR 2/3 */
{208000, 432000, CEIL(208000 * 10, 9), CEIL(432000 * 10, 9), 0xD9,
- WLC_RATE_48M},
+ BRCM_RATE_48M},
/* MCS 30: SS 4, MOD: 64QAM, CR 3/4 */
{234000, 486000, CEIL(234000 * 10, 9), CEIL(486000 * 10, 9), 0xDA,
- WLC_RATE_54M},
+ BRCM_RATE_54M},
/* MCS 31: SS 4, MOD: 64QAM, CR 5/6 */
{260000, 540000, CEIL(260000 * 10, 9), CEIL(540000 * 10, 9), 0xDB,
- WLC_RATE_54M},
+ BRCM_RATE_54M},
/* MCS 32: SS 1, MOD: BPSK, CR 1/2 */
- {0, 6000, 0, CEIL(6000 * 10, 9), 0x00, WLC_RATE_6M},
+ {0, 6000, 0, CEIL(6000 * 10, 9), 0x00, BRCM_RATE_6M},
};

/* phycfg for legacy OFDM frames: code rate, modulation scheme, spatial streams
@@ -155,18 +155,26 @@ struct legacy_phycfg {
/* 0 = 1Mbps; 1 = 2Mbps; 2 = 5.5Mbps; 3 = 11Mbps */
static const struct
legacy_phycfg legacy_phycfg_table[LEGACY_PHYCFG_TABLE_SIZE] = {
- {WLC_RATE_1M, 0x00}, /* CCK 1Mbps, data rate 0 */
- {WLC_RATE_2M, 0x08}, /* CCK 2Mbps, data rate 1 */
- {WLC_RATE_5M5, 0x10}, /* CCK 5.5Mbps, data rate 2 */
- {WLC_RATE_11M, 0x18}, /* CCK 11Mbps, data rate 3 */
- {WLC_RATE_6M, 0x00}, /* OFDM 6Mbps, code rate 1/2, BPSK, 1 spatial stream */
- {WLC_RATE_9M, 0x02}, /* OFDM 9Mbps, code rate 3/4, BPSK, 1 spatial stream */
- {WLC_RATE_12M, 0x08}, /* OFDM 12Mbps, code rate 1/2, QPSK, 1 spatial stream */
- {WLC_RATE_18M, 0x0A}, /* OFDM 18Mbps, code rate 3/4, QPSK, 1 spatial stream */
- {WLC_RATE_24M, 0x10}, /* OFDM 24Mbps, code rate 1/2, 16-QAM, 1 spatial stream */
- {WLC_RATE_36M, 0x12}, /* OFDM 36Mbps, code rate 3/4, 16-QAM, 1 spatial stream */
- {WLC_RATE_48M, 0x19}, /* OFDM 48Mbps, code rate 2/3, 64-QAM, 1 spatial stream */
- {WLC_RATE_54M, 0x1A}, /* OFDM 54Mbps, code rate 3/4, 64-QAM, 1 spatial stream */
+ {BRCM_RATE_1M, 0x00}, /* CCK 1Mbps, data rate 0 */
+ {BRCM_RATE_2M, 0x08}, /* CCK 2Mbps, data rate 1 */
+ {BRCM_RATE_5M5, 0x10}, /* CCK 5.5Mbps, data rate 2 */
+ {BRCM_RATE_11M, 0x18}, /* CCK 11Mbps, data rate 3 */
+ /* OFDM 6Mbps, code rate 1/2, BPSK, 1 spatial stream */
+ {BRCM_RATE_6M, 0x00},
+ /* OFDM 9Mbps, code rate 3/4, BPSK, 1 spatial stream */
+ {BRCM_RATE_9M, 0x02},
+ /* OFDM 12Mbps, code rate 1/2, QPSK, 1 spatial stream */
+ {BRCM_RATE_12M, 0x08},
+ /* OFDM 18Mbps, code rate 3/4, QPSK, 1 spatial stream */
+ {BRCM_RATE_18M, 0x0A},
+ /* OFDM 24Mbps, code rate 1/2, 16-QAM, 1 spatial stream */
+ {BRCM_RATE_24M, 0x10},
+ /* OFDM 36Mbps, code rate 3/4, 16-QAM, 1 spatial stream */
+ {BRCM_RATE_36M, 0x12},
+ /* OFDM 48Mbps, code rate 2/3, 64-QAM, 1 spatial stream */
+ {BRCM_RATE_48M, 0x19},
+ /* OFDM 54Mbps, code rate 3/4, 64-QAM, 1 spatial stream */
+ {BRCM_RATE_54M, 0x1A},
};

/* Hardware rates (also encodes default basic rates) */
@@ -262,7 +270,7 @@ static bool brcms_c_rateset_valid(wlc_rateset_t *rs, bool check_brate)

/* error if no basic rates */
for (idx = 0; idx < rs->count; idx++) {
- if (rs->rates[idx] & WLC_RATE_FLAG)
+ if (rs->rates[idx] & BRCMS_RATE_FLAG)
return true;
}
return false;
@@ -283,7 +291,7 @@ brcms_c_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
const wlc_rateset_t *hw_rs,
bool check_brate, u8 txstreams)
{
- u8 rateset[WLC_MAXRATE + 1];
+ u8 rateset[BRCM_MAXRATE + 1];
u8 r;
uint count;
uint i;
@@ -292,18 +300,17 @@ brcms_c_rate_hwrs_filter_sort_validate(wlc_rateset_t *rs,
count = rs->count;

for (i = 0; i < count; i++) {
- /* mask off "basic rate" bit, WLC_RATE_FLAG */
- r = (int)rs->rates[i] & WLC_RATE_MASK;
- if ((r > WLC_MAXRATE) || (rate_info[r] == 0)) {
+ /* mask off "basic rate" bit, BRCMS_RATE_FLAG */
+ r = (int)rs->rates[i] & BRCMS_RATE_MASK;
+ if ((r > BRCM_MAXRATE) || (rate_info[r] == 0))
continue;
- }
rateset[r] = rs->rates[i]; /* preserve basic bit! */
}

/* fill out the rates in order, looking at only supported rates */
count = 0;
for (i = 0; i < hw_rs->count; i++) {
- r = hw_rs->rates[i] & WLC_RATE_MASK;
+ r = hw_rs->rates[i] & BRCMS_RATE_MASK;
if (rateset[r])
rs->rates[count++] = rateset[r];
}
@@ -395,18 +402,18 @@ brcms_c_rateset_filter(wlc_rateset_t *src, wlc_rateset_t *dst, bool basic_only,
count = 0;
for (i = 0; i < src->count; i++) {
r = src->rates[i];
- if (basic_only && !(r & WLC_RATE_FLAG))
+ if (basic_only && !(r & BRCMS_RATE_FLAG))
continue;
- if ((rates == WLC_RATES_CCK) && IS_OFDM((r & WLC_RATE_MASK)))
+ if (rates == BRCMS_RATES_CCK && IS_OFDM((r & BRCMS_RATE_MASK)))
continue;
- if ((rates == WLC_RATES_OFDM) && IS_CCK((r & WLC_RATE_MASK)))
+ if (rates == BRCMS_RATES_OFDM && IS_CCK((r & BRCMS_RATE_MASK)))
continue;
dst->rates[count++] = r & xmask;
}
dst->count = count;
dst->htphy_membership = src->htphy_membership;

- if (mcsallow && rates != WLC_RATES_CCK)
+ if (mcsallow && rates != BRCMS_RATES_CCK)
memcpy(&dst->mcs[0], &src->mcs[0], MCSSET_LEN);
else
brcms_c_rateset_mcs_clear(dst);
@@ -427,10 +434,10 @@ brcms_c_rateset_default(wlc_rateset_t *rs_tgt, const wlc_rateset_t *rs_hw,
(PHYTYPE_IS(phy_type, PHY_TYPE_LCN)) ||
(PHYTYPE_IS(phy_type, PHY_TYPE_SSN))) {
if (BAND_5G(bandtype)) {
- rs_dflt = (bw == WLC_20_MHZ ?
+ rs_dflt = (bw == BRCMS_20_MHZ ?
&ofdm_mimo_rates : &ofdm_40bw_mimo_rates);
} else {
- rs_dflt = (bw == WLC_20_MHZ ?
+ rs_dflt = (bw == BRCMS_20_MHZ ?
&cck_ofdm_mimo_rates :
&cck_ofdm_40bw_mimo_rates);
}
@@ -452,7 +459,7 @@ brcms_c_rateset_default(wlc_rateset_t *rs_tgt, const wlc_rateset_t *rs_hw,
brcms_c_rateset_copy(rs_dflt, &rs_sel);
brcms_c_rateset_mcs_upd(&rs_sel, txstreams);
brcms_c_rateset_filter(&rs_sel, rs_tgt, false,
- cck_only ? WLC_RATES_CCK : WLC_RATES_CCK_OFDM,
+ cck_only ? BRCMS_RATES_CCK : BRCMS_RATES_CCK_OFDM,
rate_mask, mcsallow);
brcms_c_rate_hwrs_filter_sort_validate(rs_tgt, rs_hw, false,
mcsallow ? txstreams : 1);
@@ -484,7 +491,7 @@ void brcms_c_rateset_mcs_build(wlc_rateset_t *rateset, u8 txstreams)
/* Based on bandwidth passed, allow/disallow MCS 32 in the rateset */
void brcms_c_rateset_bw_mcs_filter(wlc_rateset_t *rateset, u8 bw)
{
- if (bw == WLC_40_MHZ)
+ if (bw == BRCMS_40_MHZ)
setbit(rateset->mcs, 32);
else
clrbit(rateset->mcs, 32);
diff --git a/drivers/staging/brcm80211/brcmsmac/rate.h b/drivers/staging/brcm80211/brcmsmac/rate.h
index c3dec35..dbfd3e5 100644
--- a/drivers/staging/brcm80211/brcmsmac/rate.h
+++ b/drivers/staging/brcm80211/brcmsmac/rate.h
@@ -14,8 +14,8 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

-#ifndef _WLC_RATE_H_
-#define _WLC_RATE_H_
+#ifndef _BRCM_RATE_H_
+#define _BRCM_RATE_H_

#include "types.h"

@@ -38,7 +38,7 @@ struct brcms_mcs_info {
u8 leg_ofdm; /* matching legacy ofdm rate in 500bkps */
};

-#define WLC_MAXMCS 32 /* max valid mcs index */
+#define BRCMS_MAXMCS 32 /* max valid mcs index */
#define MCS_TABLE_SIZE 33 /* Number of mcs entries in the table */
extern const struct brcms_mcs_info mcs_table[];

@@ -57,9 +57,10 @@ extern const struct brcms_mcs_info mcs_table[];
#define VALID_MCS(_mcs) ((_mcs < MCS_TABLE_SIZE))

/* Macro to use the rate_info table */
-#define WLC_RATE_MASK_FULL 0xff /* Rate value mask with basic rate flag */
+#define BRCMS_RATE_MASK_FULL 0xff /* Rate value mask with basic rate flag */

-#define WLC_RATE_500K_TO_BPS(rate) ((rate) * 500000) /* convert 500kbps to bps */
+/* convert 500kbps to bps */
+#define BRCMS_RATE_500K_TO_BPS(rate) ((rate) * 500000)

/* rate spec : holds rate and mode specific information required to generate a tx frame. */
/* Legacy CCK and OFDM information is held in the same manner as was done in the past */
@@ -81,7 +82,7 @@ extern const struct brcms_mcs_info mcs_table[];
#define RSPEC_OVERRIDE 0x80000000 /* bit indicates override both rate & mode */
#define RSPEC_OVERRIDE_MCS_ONLY 0x40000000 /* bit indicates override rate only */

-#define WLC_HTPHY 127 /* HT PHY Membership */
+#define BRCMS_HTPHY 127 /* HT PHY Membership */

#define RSPEC_ACTIVE(rspec) (rspec & (RSPEC_RATE_MASK | RSPEC_MIMORATE))
#define RSPEC2RATE(rspec) ((rspec & RSPEC_MIMORATE) ? \
@@ -112,12 +113,13 @@ extern const struct brcms_mcs_info mcs_table[];

/* Rate info table; takes a legacy rate or ratespec_t */
#define IS_MCS(r) (r & RSPEC_MIMORATE)
-#define IS_OFDM(r) (!IS_MCS(r) && (rate_info[(r) & RSPEC_RATE_MASK] & WLC_RATE_FLAG))
+#define IS_OFDM(r) (!IS_MCS(r) && (rate_info[(r) & RSPEC_RATE_MASK] & \
+ BRCMS_RATE_FLAG))
#define IS_CCK(r) (!IS_MCS(r) && ( \
- ((r) & WLC_RATE_MASK) == WLC_RATE_1M || \
- ((r) & WLC_RATE_MASK) == WLC_RATE_2M || \
- ((r) & WLC_RATE_MASK) == WLC_RATE_5M5 || \
- ((r) & WLC_RATE_MASK) == WLC_RATE_11M))
+ ((r) & BRCMS_RATE_MASK) == BRCM_RATE_1M || \
+ ((r) & BRCMS_RATE_MASK) == BRCM_RATE_2M || \
+ ((r) & BRCMS_RATE_MASK) == BRCM_RATE_5M5 || \
+ ((r) & BRCMS_RATE_MASK) == BRCM_RATE_11M))
#define IS_SINGLE_STREAM(mcs) (((mcs) <= HIGHEST_SINGLE_STREAM_MCS) || ((mcs) == 32))
#define CCK_RSPEC(cck) ((cck) & RSPEC_RATE_MASK)
#define OFDM_RSPEC(ofdm) (((ofdm) & RSPEC_RATE_MASK) |\
@@ -134,9 +136,9 @@ extern const u8 ofdm_rate_lookup[];
#define CCK_PHY2MAC_RATE(signal) (signal/5)

/* Rates specified in brcms_c_rateset_filter() */
-#define WLC_RATES_CCK_OFDM 0
-#define WLC_RATES_CCK 1
-#define WLC_RATES_OFDM 2
+#define BRCMS_RATES_CCK_OFDM 0
+#define BRCMS_RATES_CCK 1
+#define BRCMS_RATES_OFDM 2

/* sanitize, and sort a rateset with the basic bit(s) preserved, validate rateset */
extern bool
@@ -168,4 +170,4 @@ extern void brcms_c_rateset_mcs_build(struct brcms_rateset *rateset,
u8 txstreams);
extern void brcms_c_rateset_bw_mcs_filter(struct brcms_rateset *rateset, u8 bw);

-#endif /* _WLC_RATE_H_ */
+#endif /* _BRCM_RATE_H_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/stf.c b/drivers/staging/brcm80211/brcmsmac/stf.c
index 6bece8e..a55ff01 100644
--- a/drivers/staging/brcm80211/brcmsmac/stf.c
+++ b/drivers/staging/brcm80211/brcmsmac/stf.c
@@ -28,7 +28,7 @@
#define MIN_SPATIAL_EXPANSION 0
#define MAX_SPATIAL_EXPANSION 1

-#define WLC_STF_SS_STBC_RX(wlc) (WLCISNPHY(wlc->band) && \
+#define BRCMS_STF_SS_STBC_RX(wlc) (BRCMS_ISNPHY(wlc->band) && \
NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6))

static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val);
@@ -55,7 +55,7 @@ const u8 txcore_default[5] = {
static void brcms_c_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val)
{
/* MIMOPHYs rev3-6 cannot receive STBC with only one rx core active */
- if (WLC_STF_SS_STBC_RX(wlc)) {
+ if (BRCMS_STF_SS_STBC_RX(wlc)) {
if ((wlc->stf->rxstreams == 1) && (val != HT_CAP_RX_STBC_NO))
return;
}
@@ -145,7 +145,7 @@ static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val)
return false;

if ((int_val == OFF) || (wlc->stf->txstreams == 1)
- || !WLC_STBC_CAP_PHY(wlc))
+ || !BRCMS_STBC_CAP_PHY(wlc))
wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
else
wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_TX_STBC;
@@ -163,7 +163,7 @@ bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val)
return false;
}

- if (WLC_STF_SS_STBC_RX(wlc)) {
+ if (BRCMS_STF_SS_STBC_RX(wlc)) {
if ((int_val != HT_CAP_RX_STBC_NO)
&& (wlc->stf->rxstreams == 1))
return false;
@@ -179,11 +179,11 @@ static int brcms_c_stf_txcore_set(struct brcms_c_info *wlc, u8 Nsts,
BCMMSG(wlc->wiphy, "wl%d: Nsts %d core_mask %x\n",
wlc->pub->unit, Nsts, core_mask);

- if (WLC_BITSCNT(core_mask) > wlc->stf->txstreams) {
+ if (BRCMS_BITSCNT(core_mask) > wlc->stf->txstreams) {
core_mask = 0;
}

- if ((WLC_BITSCNT(core_mask) == wlc->stf->txstreams) &&
+ if ((BRCMS_BITSCNT(core_mask) == wlc->stf->txstreams) &&
((core_mask & ~wlc->stf->txchain)
|| !(core_mask & wlc->stf->txchain))) {
core_mask = wlc->stf->txchain;
@@ -237,7 +237,7 @@ int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force)
return -EINVAL;

/* if nrate override is configured to be non-SISO STF mode, reject reducing txchain to 1 */
- txstreams = (u8) WLC_BITSCNT(txchain);
+ txstreams = (u8) BRCMS_BITSCNT(txchain);
if (txstreams > MAX_STREAMS_SUPPORTED)
return -EINVAL;

@@ -299,7 +299,7 @@ int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band)
prev_stf_ss = wlc->stf->ss_opmode;

/* NOTE: opmode can only be SISO or CDD as STBC is decided on a per-packet basis */
- if (WLC_STBC_CAP_PHY(wlc) &&
+ if (BRCMS_STBC_CAP_PHY(wlc) &&
wlc->stf->ss_algosel_auto
&& (wlc->stf->ss_algo_channel != (u16) -1)) {
upd_stf_ss = (wlc->stf->no_cddstbc || (wlc->stf->txstreams == 1)
@@ -327,7 +327,7 @@ int brcms_c_stf_attach(struct brcms_c_info *wlc)
wlc->bandstate[BAND_2G_INDEX]->band_stf_ss_mode = PHY_TXC1_MODE_SISO;
wlc->bandstate[BAND_5G_INDEX]->band_stf_ss_mode = PHY_TXC1_MODE_CDD;

- if (WLCISNPHY(wlc->band) &&
+ if (BRCMS_ISNPHY(wlc->band) &&
(wlc_phy_txpower_hw_ctrl_get(wlc->band->pi) != PHY_TPC_HW_ON))
wlc->bandstate[BAND_2G_INDEX]->band_stf_ss_mode =
PHY_TXC1_MODE_CDD;
@@ -338,7 +338,7 @@ int brcms_c_stf_attach(struct brcms_c_info *wlc)
wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = OFF;
wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = OFF;

- if (WLC_STBC_CAP_PHY(wlc)) {
+ if (BRCMS_STBC_CAP_PHY(wlc)) {
wlc->stf->ss_algosel_auto = true;
wlc->stf->ss_algo_channel = (u16) -1; /* Init the default value */
}
@@ -368,19 +368,20 @@ static void _brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc)
s8 txant;

txant = (s8) wlc->stf->txant;
- if (WLC_PHY_11N_CAP(wlc->band)) {
+ if (BRCMS_PHY_11N_CAP(wlc->band)) {
if (txant == ANT_TX_FORCE_0) {
wlc->stf->phytxant = PHY_TXC_ANT_0;
} else if (txant == ANT_TX_FORCE_1) {
wlc->stf->phytxant = PHY_TXC_ANT_1;

- if (WLCISNPHY(wlc->band) &&
+ if (BRCMS_ISNPHY(wlc->band) &&
NREV_GE(wlc->band->phyrev, 3)
&& NREV_LT(wlc->band->phyrev, 7)) {
wlc->stf->phytxant = PHY_TXC_ANT_2;
}
} else {
- if (WLCISLCNPHY(wlc->band) || WLCISSSLPNPHY(wlc->band))
+ if (BRCMS_ISLCNPHY(wlc->band) ||
+ BRCMS_ISSSLPNPHY(wlc->band))
wlc->stf->phytxant = PHY_TXC_LCNPHY_ANT_LAST;
else {
/* catch out of sync wlc->stf->txcore */
@@ -414,7 +415,7 @@ void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc)

/* these parameter are intended to be used for all PHY types */
if (wlc->stf->hw_txchain == 0 || wlc->stf->hw_txchain == 0xf) {
- if (WLCISNPHY(wlc->band)) {
+ if (BRCMS_ISNPHY(wlc->band)) {
wlc->stf->hw_txchain = TXCHAIN_DEF_NPHY;
} else {
wlc->stf->hw_txchain = TXCHAIN_DEF;
@@ -422,10 +423,10 @@ void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc)
}

wlc->stf->txchain = wlc->stf->hw_txchain;
- wlc->stf->txstreams = (u8) WLC_BITSCNT(wlc->stf->hw_txchain);
+ wlc->stf->txstreams = (u8) BRCMS_BITSCNT(wlc->stf->hw_txchain);

if (wlc->stf->hw_rxchain == 0 || wlc->stf->hw_rxchain == 0xf) {
- if (WLCISNPHY(wlc->band)) {
+ if (BRCMS_ISNPHY(wlc->band)) {
wlc->stf->hw_rxchain = RXCHAIN_DEF_NPHY;
} else {
wlc->stf->hw_rxchain = RXCHAIN_DEF;
@@ -433,7 +434,7 @@ void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc)
}

wlc->stf->rxchain = wlc->stf->hw_rxchain;
- wlc->stf->rxstreams = (u8) WLC_BITSCNT(wlc->stf->hw_rxchain);
+ wlc->stf->rxstreams = (u8) BRCMS_BITSCNT(wlc->stf->hw_rxchain);

/* initialize the txcore table */
memcpy(wlc->stf->txcore, txcore_default, sizeof(wlc->stf->txcore));
@@ -467,7 +468,7 @@ u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc, ratespec_t rspec)
u16 mask = PHY_TXC_ANT_MASK;

/* for non-siso rates or default setting, use the available chains */
- if (WLCISNPHY(wlc->band)) {
+ if (BRCMS_ISNPHY(wlc->band)) {
phytxant = _brcms_c_stf_phytxchain_sel(wlc, rspec);
mask = PHY_TXC_HTANT_MASK;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index 17c1d8a..d8514c3 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -191,11 +191,11 @@
PHYTYPE_IS(phytype, PHY_TYPE_SSN))

/* Last but not least: shorter wlc-specific var checks */
-#define WLCISNPHY(band) PHYTYPE_IS((band)->phytype, PHY_TYPE_N)
-#define WLCISLCNPHY(band) PHYTYPE_IS((band)->phytype, PHY_TYPE_LCN)
-#define WLCISSSLPNPHY(band) PHYTYPE_IS((band)->phytype, PHY_TYPE_SSN)
+#define BRCMS_ISNPHY(band) PHYTYPE_IS((band)->phytype, PHY_TYPE_N)
+#define BRCMS_ISLCNPHY(band) PHYTYPE_IS((band)->phytype, PHY_TYPE_LCN)
+#define BRCMS_ISSSLPNPHY(band) PHYTYPE_IS((band)->phytype, PHY_TYPE_SSN)

-#define WLC_PHY_11N_CAP(band) PHYTYPE_11N_CAP((band)->phytype)
+#define BRCMS_PHY_11N_CAP(band) PHYTYPE_11N_CAP((band)->phytype)

/**********************************************************************
* ------------- End of Core phy/rev configuration. ----------------- *
@@ -227,12 +227,18 @@
#define MAXPKTCB MAXSCB /* Max number of packet callbacks */

/* NetBSD also needs to keep track of this */
-#define WLC_MAX_UCODE_BSS (16) /* Number of BSS handled in ucode bcn/prb */
-#define WLC_MAX_UCODE_BSS4 (4) /* Number of BSS handled in sw bcn/prb */
-#define WLC_MAXBSSCFG (1) /* max # BSS configs */
-#define MAXBSS 64 /* max # available networks */
-#define WLC_DATAHIWAT 50 /* data msg txq hiwat mark */
-#define WLC_AMPDUDATAHIWAT 255
+
+/* Number of BSS handled in ucode bcn/prb */
+#define BRCMS_MAX_UCODE_BSS (16)
+/* Number of BSS handled in sw bcn/prb */
+#define BRCMS_MAX_UCODE_BSS4 (4)
+/* max # BSS configs */
+#define BRCMS_MAXBSSCFG (1)
+/* max # available networks */
+#define MAXBSS 64
+/* data msg txq hiwat mark */
+#define BRCMS_DATAHIWAT 50
+#define BRCMS_AMPDUDATAHIWAT 255

/* bounded rx loops */
#define RXBND 8 /* max # frames to process in brcms_c_recv() */
@@ -240,8 +246,8 @@

#define WLBANDINITFN(_fn) _fn

-#define BAND_5G(bt) ((bt) == WLC_BAND_5G)
-#define BAND_2G(bt) ((bt) == WLC_BAND_2G)
+#define BAND_5G(bt) ((bt) == BRCM_BAND_5G)
+#define BAND_2G(bt) ((bt) == BRCM_BAND_2G)

#define BCMMSG(dev, fmt, args...) \
do { \
diff --git a/drivers/staging/brcm80211/include/brcmu_wifi.h b/drivers/staging/brcm80211/include/brcmu_wifi.h
index 72013a4..fde592b 100644
--- a/drivers/staging/brcm80211/include/brcmu_wifi.h
+++ b/drivers/staging/brcm80211/include/brcmu_wifi.h
@@ -31,7 +31,7 @@ typedef u16 chanspec_t;
#define CH_10MHZ_APART 2
#define CH_5MHZ_APART 1 /* 2G band channels are 5 Mhz apart */
#define CH_MAX_2G_CHANNEL 14 /* Max channel in 2G band */
-#define WLC_MAX_2G_CHANNEL CH_MAX_2G_CHANNEL /* legacy define */
+#define BRCM_MAX_2G_CHANNEL CH_MAX_2G_CHANNEL /* legacy define */
#define MAXCHANNEL 224 /* max # supported channels. The max channel no is 216,
* this is that + 1 rounded up to a multiple of NBBY (8).
* DO NOT MAKE it > 255: channels are u8's all over
@@ -67,7 +67,8 @@ typedef u16 chanspec_t;
#define LOWER_20_SB(channel) (((channel) > CH_10MHZ_APART) ? ((channel) - CH_10MHZ_APART) : 0)
#define UPPER_20_SB(channel) (((channel) < (MAXCHANNEL - CH_10MHZ_APART)) ? \
((channel) + CH_10MHZ_APART) : 0)
-#define CHSPEC_WLCBANDUNIT(chspec) (CHSPEC_IS5G(chspec) ? BAND_5G_INDEX : BAND_2G_INDEX)
+#define CHSPEC_BANDUNIT(chspec) (CHSPEC_IS5G(chspec) ? BAND_5G_INDEX : \
+ BAND_2G_INDEX)
#define CH20MHZ_CHSPEC(channel) (chanspec_t)((chanspec_t)(channel) | WL_CHANSPEC_BW_20 | \
WL_CHANSPEC_CTL_SB_NONE | (((channel) <= CH_MAX_2G_CHANNEL) ? \
WL_CHANSPEC_BAND_2G : WL_CHANSPEC_BAND_5G))
@@ -110,26 +111,26 @@ typedef u16 chanspec_t;
#define CHSPEC_CTL_CHAN(chspec) ((CHSPEC_SB_LOWER(chspec)) ? \
(LOWER_20_SB(((chspec) & WL_CHANSPEC_CHAN_MASK))) : \
(UPPER_20_SB(((chspec) & WL_CHANSPEC_CHAN_MASK))))
-#define CHSPEC2WLC_BAND(chspec) (CHSPEC_IS5G(chspec) ? WLC_BAND_5G : WLC_BAND_2G)
+#define CHSPEC2BAND(chspec) (CHSPEC_IS5G(chspec) ? BRCM_BAND_5G : BRCM_BAND_2G)

#define CHANSPEC_STR_LEN 8

/* defined rate in 500kbps */
-#define WLC_MAXRATE 108 /* in 500kbps units */
-#define WLC_RATE_1M 2 /* in 500kbps units */
-#define WLC_RATE_2M 4 /* in 500kbps units */
-#define WLC_RATE_5M5 11 /* in 500kbps units */
-#define WLC_RATE_11M 22 /* in 500kbps units */
-#define WLC_RATE_6M 12 /* in 500kbps units */
-#define WLC_RATE_9M 18 /* in 500kbps units */
-#define WLC_RATE_12M 24 /* in 500kbps units */
-#define WLC_RATE_18M 36 /* in 500kbps units */
-#define WLC_RATE_24M 48 /* in 500kbps units */
-#define WLC_RATE_36M 72 /* in 500kbps units */
-#define WLC_RATE_48M 96 /* in 500kbps units */
-#define WLC_RATE_54M 108 /* in 500kbps units */
-
-#define WLC_2G_25MHZ_OFFSET 5 /* 2.4GHz band channel offset */
+#define BRCM_MAXRATE 108 /* in 500kbps units */
+#define BRCM_RATE_1M 2 /* in 500kbps units */
+#define BRCM_RATE_2M 4 /* in 500kbps units */
+#define BRCM_RATE_5M5 11 /* in 500kbps units */
+#define BRCM_RATE_11M 22 /* in 500kbps units */
+#define BRCM_RATE_6M 12 /* in 500kbps units */
+#define BRCM_RATE_9M 18 /* in 500kbps units */
+#define BRCM_RATE_12M 24 /* in 500kbps units */
+#define BRCM_RATE_18M 36 /* in 500kbps units */
+#define BRCM_RATE_24M 48 /* in 500kbps units */
+#define BRCM_RATE_36M 72 /* in 500kbps units */
+#define BRCM_RATE_48M 96 /* in 500kbps units */
+#define BRCM_RATE_54M 108 /* in 500kbps units */
+
+#define BRCM_2G_25MHZ_OFFSET 5 /* 2.4GHz band channel offset */

#define MCSSET_LEN 16

diff --git a/drivers/staging/brcm80211/include/defs.h b/drivers/staging/brcm80211/include/defs.h
index 20e1407..8b3e17d 100644
--- a/drivers/staging/brcm80211/include/defs.h
+++ b/drivers/staging/brcm80211/include/defs.h
@@ -59,16 +59,16 @@ typedef struct wl_rateset {
u8 rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
} wl_rateset_t;

-#define WLC_CNTRY_BUF_SZ 4 /* Country string is 3 bytes + NUL */
+#define BRCM_CNTRY_BUF_SZ 4 /* Country string is 3 bytes + NUL */

-#define WLC_SET_CHANNEL 30
-#define WLC_SET_SRL 32
-#define WLC_SET_LRL 34
+#define BRCM_SET_CHANNEL 30
+#define BRCM_SET_SRL 32
+#define BRCM_SET_LRL 34

-#define WLC_SET_RATESET 72
-#define WLC_SET_BCNPRD 76
-#define WLC_GET_CURR_RATESET 114 /* current rateset */
-#define WLC_GET_PHYLIST 180
+#define BRCM_SET_RATESET 72
+#define BRCM_SET_BCNPRD 76
+#define BRCM_GET_CURR_RATESET 114 /* current rateset */
+#define BRCM_GET_PHYLIST 180

/* Bit masks for radio disabled status - returned by WL_GET_RADIO */
#define WL_RADIO_SW_DISABLE (1<<0)
@@ -76,14 +76,14 @@ typedef struct wl_rateset {
#define WL_RADIO_MPC_DISABLE (1<<2)
#define WL_RADIO_COUNTRY_DISABLE (1<<3) /* some countries don't support any channel */

-/* Override bit for WLC_SET_TXPWR. if set, ignore other level limits */
+/* Override bit for SET_TXPWR. if set, ignore other level limits */
#define WL_TXPWR_OVERRIDE (1U<<31)

/* band types */
-#define WLC_BAND_AUTO 0 /* auto-select */
-#define WLC_BAND_5G 1 /* 5 Ghz */
-#define WLC_BAND_2G 2 /* 2.4 Ghz */
-#define WLC_BAND_ALL 3 /* all bands */
+#define BRCM_BAND_AUTO 0 /* auto-select */
+#define BRCM_BAND_5G 1 /* 5 Ghz */
+#define BRCM_BAND_2G 2 /* 2.4 Ghz */
+#define BRCM_BAND_ALL 3 /* all bands */

/* Values for PM */
#define PM_OFF 0
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 24/31] staging: brcm80211: moved fullmac definitions from .h to .c files

From: Roland Vossen <[email protected]>

And deleted unused definitions. Improves code since it makes clear that the
definitions are only used by a specific .c file.

Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 7 +
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 97 ++++++++++
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 223 ------------------------
3 files changed, 104 insertions(+), 223 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index a527f29..c9e20e1 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -58,6 +58,13 @@
/* debugging macros */
#define SDLX_MSG(x)

+#define SDIOH_CMD_TYPE_NORMAL 0 /* Normal command */
+#define SDIOH_CMD_TYPE_APPEND 1 /* Append command */
+#define SDIOH_CMD_TYPE_CUTTHRU 2 /* Cut-through command */
+
+#define SDIOH_DATA_PIO 0 /* PIO mode */
+#define SDIOH_DATA_DMA 1 /* DMA mode */
+
struct brcmf_sdio_card {
bool init_success; /* underlying driver successfully attached */
void *sdioh; /* handler for sdioh */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index b34914e..722d4c7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -178,10 +178,107 @@ struct rte_console {
#ifndef BRCMF_FIRSTREAD
#define BRCMF_FIRSTREAD 32
#endif
+
#if !ISPOWEROF2(BRCMF_FIRSTREAD)
#error BRCMF_FIRSTREAD is not a power of 2!
#endif

+/* SBSDIO_DEVICE_CTL */
+#define SBSDIO_DEVCTL_SETBUSY 0x01 /* 1: device will assert busy signal when
+ * receiving CMD53
+ */
+#define SBSDIO_DEVCTL_SPI_INTR_SYNC 0x02 /* 1: assertion of sdio interrupt is
+ * synchronous to the sdio clock
+ */
+#define SBSDIO_DEVCTL_CA_INT_ONLY 0x04 /* 1: mask all interrupts to host
+ * except the chipActive (rev 8)
+ */
+#define SBSDIO_DEVCTL_PADS_ISO 0x08 /* 1: isolate internal sdio signals, put
+ * external pads in tri-state; requires
+ * sdio bus power cycle to clear (rev 9)
+ */
+#define SBSDIO_DEVCTL_SB_RST_CTL 0x30 /* Force SD->SB reset mapping (rev 11) */
+#define SBSDIO_DEVCTL_RST_CORECTL 0x00 /* Determined by CoreControl bit */
+#define SBSDIO_DEVCTL_RST_BPRESET 0x10 /* Force backplane reset */
+#define SBSDIO_DEVCTL_RST_NOBPRESET 0x20 /* Force no backplane reset */
+
+/* SBSDIO_FUNC1_CHIPCLKCSR */
+#define SBSDIO_FORCE_ALP 0x01 /* Force ALP request to backplane */
+#define SBSDIO_FORCE_HT 0x02 /* Force HT request to backplane */
+#define SBSDIO_FORCE_ILP 0x04 /* Force ILP request to backplane */
+#define SBSDIO_ALP_AVAIL_REQ 0x08 /* Make ALP ready (power up xtal) */
+#define SBSDIO_HT_AVAIL_REQ 0x10 /* Make HT ready (power up PLL) */
+#define SBSDIO_FORCE_HW_CLKREQ_OFF 0x20 /* Squelch clock requests from HW */
+#define SBSDIO_ALP_AVAIL 0x40 /* Status: ALP is ready */
+#define SBSDIO_HT_AVAIL 0x80 /* Status: HT is ready */
+
+#define SBSDIO_AVBITS (SBSDIO_HT_AVAIL | SBSDIO_ALP_AVAIL)
+#define SBSDIO_ALPAV(regval) ((regval) & SBSDIO_AVBITS)
+#define SBSDIO_HTAV(regval) (((regval) & SBSDIO_AVBITS) == SBSDIO_AVBITS)
+#define SBSDIO_ALPONLY(regval) (SBSDIO_ALPAV(regval) && !SBSDIO_HTAV(regval))
+#define SBSDIO_CLKAV(regval, alponly) (SBSDIO_ALPAV(regval) && \
+ (alponly ? 1 : SBSDIO_HTAV(regval)))
+/* direct(mapped) cis space */
+#define SBSDIO_CIS_BASE_COMMON 0x1000 /* MAPPED common CIS address */
+#define SBSDIO_CIS_SIZE_LIMIT 0x200 /* maximum bytes in one CIS */
+#define SBSDIO_CIS_OFT_ADDR_MASK 0x1FFFF /* cis offset addr is < 17 bits */
+
+#define SBSDIO_CIS_MANFID_TUPLE_LEN 6 /* manfid tuple length, include tuple,
+ * link bytes
+ */
+
+/* intstatus */
+#define I_SMB_SW0 (1 << 0) /* To SB Mail S/W interrupt 0 */
+#define I_SMB_SW1 (1 << 1) /* To SB Mail S/W interrupt 1 */
+#define I_SMB_SW2 (1 << 2) /* To SB Mail S/W interrupt 2 */
+#define I_SMB_SW3 (1 << 3) /* To SB Mail S/W interrupt 3 */
+#define I_SMB_SW_MASK 0x0000000f /* To SB Mail S/W interrupts mask */
+#define I_SMB_SW_SHIFT 0 /* To SB Mail S/W interrupts shift */
+#define I_HMB_SW0 (1 << 4) /* To Host Mail S/W interrupt 0 */
+#define I_HMB_SW1 (1 << 5) /* To Host Mail S/W interrupt 1 */
+#define I_HMB_SW2 (1 << 6) /* To Host Mail S/W interrupt 2 */
+#define I_HMB_SW3 (1 << 7) /* To Host Mail S/W interrupt 3 */
+#define I_HMB_SW_MASK 0x000000f0 /* To Host Mail S/W interrupts mask */
+#define I_HMB_SW_SHIFT 4 /* To Host Mail S/W interrupts shift */
+#define I_WR_OOSYNC (1 << 8) /* Write Frame Out Of Sync */
+#define I_RD_OOSYNC (1 << 9) /* Read Frame Out Of Sync */
+#define I_PC (1 << 10) /* descriptor error */
+#define I_PD (1 << 11) /* data error */
+#define I_DE (1 << 12) /* Descriptor protocol Error */
+#define I_RU (1 << 13) /* Receive descriptor Underflow */
+#define I_RO (1 << 14) /* Receive fifo Overflow */
+#define I_XU (1 << 15) /* Transmit fifo Underflow */
+#define I_RI (1 << 16) /* Receive Interrupt */
+#define I_BUSPWR (1 << 17) /* SDIO Bus Power Change (rev 9) */
+#define I_XMTDATA_AVAIL (1 << 23) /* bits in fifo */
+#define I_XI (1 << 24) /* Transmit Interrupt */
+#define I_RF_TERM (1 << 25) /* Read Frame Terminate */
+#define I_WF_TERM (1 << 26) /* Write Frame Terminate */
+#define I_PCMCIA_XU (1 << 27) /* PCMCIA Transmit FIFO Underflow */
+#define I_SBINT (1 << 28) /* sbintstatus Interrupt */
+#define I_CHIPACTIVE (1 << 29) /* chip from doze to active state */
+#define I_SRESET (1 << 30) /* CCCR RES interrupt */
+#define I_IOE2 (1U << 31) /* CCCR IOE2 Bit Changed */
+#define I_ERRORS (I_PC | I_PD | I_DE | I_RU | I_RO | I_XU)
+#define I_DMA (I_RI | I_XI | I_ERRORS)
+
+/* corecontrol */
+#define CC_CISRDY (1 << 0) /* CIS Ready */
+#define CC_BPRESEN (1 << 1) /* CCCR RES signal */
+#define CC_F2RDY (1 << 2) /* set CCCR IOR2 bit */
+#define CC_CLRPADSISO (1 << 3) /* clear SDIO pads isolation */
+#define CC_XMTDATAAVAIL_MODE (1 << 4)
+#define CC_XMTDATAAVAIL_CTRL (1 << 5)
+
+/* SDA_FRAMECTRL */
+#define SFC_RF_TERM (1 << 0) /* Read Frame Terminate */
+#define SFC_WF_TERM (1 << 1) /* Write Frame Terminate */
+#define SFC_CRC4WOOS (1 << 2) /* CRC error for write out of sync */
+#define SFC_ABORTALL (1 << 3) /* Abort all in-progress frames */
+
+/* HW frame tag */
+#define SDPCM_FRAMETAG_LEN 4 /* 2 bytes len, 2 bytes check val */
+
/* Total length of frame header for dongle protocol */
#define SDPCM_HDRLEN (SDPCM_FRAMETAG_LEN + SDPCM_SWHEADER_LEN)
#ifdef SDTEST
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index a956339..d345472 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -70,75 +70,6 @@ extern const uint brcmf_sdio_msglevel;
#define SBSDIO_FUNC1_MISC_REG_START 0x10000 /* f1 misc register start */
#define SBSDIO_FUNC1_MISC_REG_LIMIT 0x1001C /* f1 misc register end */

-/* SBSDIO_SPROM_CS */
-#define SBSDIO_SPROM_IDLE 0
-#define SBSDIO_SPROM_WRITE 1
-#define SBSDIO_SPROM_READ 2
-#define SBSDIO_SPROM_WEN 4
-#define SBSDIO_SPROM_WDS 7
-#define SBSDIO_SPROM_DONE 8
-
-/* SBSDIO_SPROM_INFO */
-#define SROM_SZ_MASK 0x03 /* SROM size, 1: 4k, 2: 16k */
-#define SROM_BLANK 0x04 /* depreciated in corerev 6 */
-#define SROM_OTP 0x80 /* OTP present */
-
-/* SBSDIO_CHIP_CTRL */
-#define SBSDIO_CHIP_CTRL_XTAL 0x01 /* or'd with onchip xtal_pu,
- * 1: power on oscillator
- * (for 4318 only)
- */
-/* SBSDIO_WATERMARK */
-#define SBSDIO_WATERMARK_MASK 0x7f /* number of words - 1 for sd device
- * to wait before sending data to host
- */
-
-/* SBSDIO_DEVICE_CTL */
-#define SBSDIO_DEVCTL_SETBUSY 0x01 /* 1: device will assert busy signal when
- * receiving CMD53
- */
-#define SBSDIO_DEVCTL_SPI_INTR_SYNC 0x02 /* 1: assertion of sdio interrupt is
- * synchronous to the sdio clock
- */
-#define SBSDIO_DEVCTL_CA_INT_ONLY 0x04 /* 1: mask all interrupts to host
- * except the chipActive (rev 8)
- */
-#define SBSDIO_DEVCTL_PADS_ISO 0x08 /* 1: isolate internal sdio signals, put
- * external pads in tri-state; requires
- * sdio bus power cycle to clear (rev 9)
- */
-#define SBSDIO_DEVCTL_SB_RST_CTL 0x30 /* Force SD->SB reset mapping (rev 11) */
-#define SBSDIO_DEVCTL_RST_CORECTL 0x00 /* Determined by CoreControl bit */
-#define SBSDIO_DEVCTL_RST_BPRESET 0x10 /* Force backplane reset */
-#define SBSDIO_DEVCTL_RST_NOBPRESET 0x20 /* Force no backplane reset */
-
-/* SBSDIO_FUNC1_CHIPCLKCSR */
-#define SBSDIO_FORCE_ALP 0x01 /* Force ALP request to backplane */
-#define SBSDIO_FORCE_HT 0x02 /* Force HT request to backplane */
-#define SBSDIO_FORCE_ILP 0x04 /* Force ILP request to backplane */
-#define SBSDIO_ALP_AVAIL_REQ 0x08 /* Make ALP ready (power up xtal) */
-#define SBSDIO_HT_AVAIL_REQ 0x10 /* Make HT ready (power up PLL) */
-#define SBSDIO_FORCE_HW_CLKREQ_OFF 0x20 /* Squelch clock requests from HW */
-#define SBSDIO_ALP_AVAIL 0x40 /* Status: ALP is ready */
-#define SBSDIO_HT_AVAIL 0x80 /* Status: HT is ready */
-/* In rev8, actual avail bits followed original docs */
-#define SBSDIO_Rev8_HT_AVAIL 0x40
-#define SBSDIO_Rev8_ALP_AVAIL 0x80
-
-#define SBSDIO_AVBITS (SBSDIO_HT_AVAIL | SBSDIO_ALP_AVAIL)
-#define SBSDIO_ALPAV(regval) ((regval) & SBSDIO_AVBITS)
-#define SBSDIO_HTAV(regval) (((regval) & SBSDIO_AVBITS) == SBSDIO_AVBITS)
-#define SBSDIO_ALPONLY(regval) (SBSDIO_ALPAV(regval) && !SBSDIO_HTAV(regval))
-#define SBSDIO_CLKAV(regval, alponly) (SBSDIO_ALPAV(regval) && \
- (alponly ? 1 : SBSDIO_HTAV(regval)))
-
-/* SBSDIO_FUNC1_SDIOPULLUP */
-#define SBSDIO_PULLUP_D0 0x01 /* Enable D0/MISO pullup */
-#define SBSDIO_PULLUP_D1 0x02 /* Enable D1/INT# pullup */
-#define SBSDIO_PULLUP_D2 0x04 /* Enable D2 pullup */
-#define SBSDIO_PULLUP_CMD 0x08 /* Enable CMD/MOSI pullup */
-#define SBSDIO_PULLUP_ALL 0x0f /* All valid bits */
-
/* function 1 OCP space */
#define SBSDIO_SB_OFT_ADDR_MASK 0x07FFF /* sb offset addr is <= 15 bits, 32k */
#define SBSDIO_SB_OFT_ADDR_LIMIT 0x08000
@@ -151,166 +82,12 @@ extern const uint brcmf_sdio_msglevel;
#define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */
#define SBSDIO_SBWINDOW_MASK 0xffff8000 /* Address bits from SBADDR regs */

-/* direct(mapped) cis space */
-#define SBSDIO_CIS_BASE_COMMON 0x1000 /* MAPPED common CIS address */
-#define SBSDIO_CIS_SIZE_LIMIT 0x200 /* maximum bytes in one CIS */
-#define SBSDIO_OTP_CIS_SIZE_LIMIT 0x078 /* maximum bytes OTP CIS */
-
-#define SBSDIO_CIS_OFT_ADDR_MASK 0x1FFFF /* cis offset addr is < 17 bits */
-
-#define SBSDIO_CIS_MANFID_TUPLE_LEN 6 /* manfid tuple length, include tuple,
- * link bytes
- */
-
-/* indirect cis access (in sprom) */
-#define SBSDIO_SPROM_CIS_OFFSET 0x8 /* 8 control bytes first, CIS starts from
- * 8th byte
- */
-
-#define SBSDIO_BYTEMODE_DATALEN_MAX 64 /* sdio byte mode: maximum length of one
- * data command
- */
-
-#define SBSDIO_CORE_ADDR_MASK 0x1FFFF /* sdio core function one address mask */
-
-/* corecontrol */
-#define CC_CISRDY (1 << 0) /* CIS Ready */
-#define CC_BPRESEN (1 << 1) /* CCCR RES signal */
-#define CC_F2RDY (1 << 2) /* set CCCR IOR2 bit */
-#define CC_CLRPADSISO (1 << 3) /* clear SDIO pads isolation */
-#define CC_XMTDATAAVAIL_MODE (1 << 4)
-#define CC_XMTDATAAVAIL_CTRL (1 << 5)
-
-/* corestatus */
-#define CS_PCMCIAMODE (1 << 0) /* Device Mode; 0=SDIO, 1=PCMCIA */
-#define CS_SMARTDEV (1 << 1) /* 1=smartDev enabled */
-#define CS_F2ENABLED (1 << 2) /* 1=host has enabled the device */
-
-#define PCMCIA_MES_PA_MASK 0x7fff /* PCMCIA Message Portal Address Mask */
-#define PCMCIA_MES_PM_MASK 0x7fff /* PCMCIA Message Portal Mask Mask */
-#define PCMCIA_WFBC_MASK 0xffff /* PCMCIA Write Frame Byte Count Mask */
-#define PCMCIA_UT_MASK 0x07ff /* PCMCIA Underflow Timer Mask */
-
-/* intstatus */
-#define I_SMB_SW0 (1 << 0) /* To SB Mail S/W interrupt 0 */
-#define I_SMB_SW1 (1 << 1) /* To SB Mail S/W interrupt 1 */
-#define I_SMB_SW2 (1 << 2) /* To SB Mail S/W interrupt 2 */
-#define I_SMB_SW3 (1 << 3) /* To SB Mail S/W interrupt 3 */
-#define I_SMB_SW_MASK 0x0000000f /* To SB Mail S/W interrupts mask */
-#define I_SMB_SW_SHIFT 0 /* To SB Mail S/W interrupts shift */
-#define I_HMB_SW0 (1 << 4) /* To Host Mail S/W interrupt 0 */
-#define I_HMB_SW1 (1 << 5) /* To Host Mail S/W interrupt 1 */
-#define I_HMB_SW2 (1 << 6) /* To Host Mail S/W interrupt 2 */
-#define I_HMB_SW3 (1 << 7) /* To Host Mail S/W interrupt 3 */
-#define I_HMB_SW_MASK 0x000000f0 /* To Host Mail S/W interrupts mask */
-#define I_HMB_SW_SHIFT 4 /* To Host Mail S/W interrupts shift */
-#define I_WR_OOSYNC (1 << 8) /* Write Frame Out Of Sync */
-#define I_RD_OOSYNC (1 << 9) /* Read Frame Out Of Sync */
-#define I_PC (1 << 10) /* descriptor error */
-#define I_PD (1 << 11) /* data error */
-#define I_DE (1 << 12) /* Descriptor protocol Error */
-#define I_RU (1 << 13) /* Receive descriptor Underflow */
-#define I_RO (1 << 14) /* Receive fifo Overflow */
-#define I_XU (1 << 15) /* Transmit fifo Underflow */
-#define I_RI (1 << 16) /* Receive Interrupt */
-#define I_BUSPWR (1 << 17) /* SDIO Bus Power Change (rev 9) */
-#define I_XMTDATA_AVAIL (1 << 23) /* bits in fifo */
-#define I_XI (1 << 24) /* Transmit Interrupt */
-#define I_RF_TERM (1 << 25) /* Read Frame Terminate */
-#define I_WF_TERM (1 << 26) /* Write Frame Terminate */
-#define I_PCMCIA_XU (1 << 27) /* PCMCIA Transmit FIFO Underflow */
-#define I_SBINT (1 << 28) /* sbintstatus Interrupt */
-#define I_CHIPACTIVE (1 << 29) /* chip from doze to active state */
-#define I_SRESET (1 << 30) /* CCCR RES interrupt */
-#define I_IOE2 (1U << 31) /* CCCR IOE2 Bit Changed */
-#define I_ERRORS (I_PC | I_PD | I_DE | I_RU | I_RO | I_XU)
-#define I_DMA (I_RI | I_XI | I_ERRORS)
-
-/* sbintstatus */
-#define I_SB_SERR (1 << 8) /* Backplane SError (write) */
-#define I_SB_RESPERR (1 << 9) /* Backplane Response Error (read) */
-#define I_SB_SPROMERR (1 << 10) /* Error accessing the sprom */
-
-/* sdioaccess */
-#define SDA_DATA_MASK 0x000000ff /* Read/Write Data Mask */
-#define SDA_ADDR_MASK 0x000fff00 /* Read/Write Address Mask */
-#define SDA_ADDR_SHIFT 8 /* Read/Write Address Shift */
-#define SDA_WRITE 0x01000000 /* Write bit */
-#define SDA_READ 0x00000000 /* Write bit cleared for Read */
-#define SDA_BUSY 0x80000000 /* Busy bit */
-
-/* sdioaccess-accessible register address spaces */
-#define SDA_CCCR_SPACE 0x000 /* CCCR register space */
-#define SDA_F1_FBR_SPACE 0x100 /* F1 FBR register space */
-#define SDA_F2_FBR_SPACE 0x200 /* F2 FBR register space */
-#define SDA_F1_REG_SPACE 0x300 /* F1 core-specific register space */
-
-/* SDA_F1_REG_SPACE sdioaccess-accessible F1 reg space register offsets */
-#define SDA_CHIPCONTROLDATA 0x006 /* ChipControlData */
-#define SDA_CHIPCONTROLENAB 0x007 /* ChipControlEnable */
-#define SDA_F2WATERMARK 0x008 /* Function 2 Watermark */
-#define SDA_DEVICECONTROL 0x009 /* DeviceControl */
-#define SDA_SBADDRLOW 0x00a /* SbAddrLow */
-#define SDA_SBADDRMID 0x00b /* SbAddrMid */
-#define SDA_SBADDRHIGH 0x00c /* SbAddrHigh */
-#define SDA_FRAMECTRL 0x00d /* FrameCtrl */
-#define SDA_CHIPCLOCKCSR 0x00e /* ChipClockCSR */
-#define SDA_SDIOPULLUP 0x00f /* SdioPullUp */
-#define SDA_SDIOWRFRAMEBCLOW 0x019 /* SdioWrFrameBCLow */
-#define SDA_SDIOWRFRAMEBCHIGH 0x01a /* SdioWrFrameBCHigh */
-#define SDA_SDIORDFRAMEBCLOW 0x01b /* SdioRdFrameBCLow */
-#define SDA_SDIORDFRAMEBCHIGH 0x01c /* SdioRdFrameBCHigh */
-
-/* SDA_F2WATERMARK */
-#define SDA_F2WATERMARK_MASK 0x7f /* F2Watermark Mask */
-
-/* SDA_SBADDRLOW */
-#define SDA_SBADDRLOW_MASK 0x80 /* SbAddrLow Mask */
-
-/* SDA_SBADDRMID */
-#define SDA_SBADDRMID_MASK 0xff /* SbAddrMid Mask */
-
-/* SDA_SBADDRHIGH */
-#define SDA_SBADDRHIGH_MASK 0xff /* SbAddrHigh Mask */
-
-/* SDA_FRAMECTRL */
-#define SFC_RF_TERM (1 << 0) /* Read Frame Terminate */
-#define SFC_WF_TERM (1 << 1) /* Write Frame Terminate */
-#define SFC_CRC4WOOS (1 << 2) /* CRC error for write out of sync */
-#define SFC_ABORTALL (1 << 3) /* Abort all in-progress frames */
-
-/* pcmciaframectrl */
-#define PFC_RF_TERM (1 << 0) /* Read Frame Terminate */
-#define PFC_WF_TERM (1 << 1) /* Write Frame Terminate */
-
-/* intrcvlazy */
-#define IRL_TO_MASK 0x00ffffff /* timeout */
-#define IRL_FC_MASK 0xff000000 /* frame count */
-#define IRL_FC_SHIFT 24 /* frame count */
-
-/* rx header flags */
-#define RXF_CRC 0x0001 /* CRC error detected */
-#define RXF_WOOS 0x0002 /* write frame out of sync */
-#define RXF_WF_TERM 0x0004 /* write frame terminated */
-#define RXF_ABORT 0x0008 /* write frame aborted */
-#define RXF_DISCARD (RXF_CRC | RXF_WOOS | RXF_WF_TERM | RXF_ABORT)
-
-/* HW frame tag */
-#define SDPCM_FRAMETAG_LEN 4 /* 2 bytes len, 2 bytes check val */
-
#define SDIOH_READ 0 /* Read request */
#define SDIOH_WRITE 1 /* Write request */

#define SDIOH_DATA_FIX 0 /* Fixed addressing */
#define SDIOH_DATA_INC 1 /* Incremental addressing */

-#define SDIOH_CMD_TYPE_NORMAL 0 /* Normal command */
-#define SDIOH_CMD_TYPE_APPEND 1 /* Append command */
-#define SDIOH_CMD_TYPE_CUTTHRU 2 /* Cut-through command */
-
-#define SDIOH_DATA_PIO 0 /* PIO mode */
-#define SDIOH_DATA_DMA 1 /* DMA mode */
-
/* internal return code */
#define SUCCESS 0
#define ERROR 1
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 09/31] staging: brcm80211: removed asserts from dhd_sdio.c

From: Roland Vossen <[email protected]>

Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 76 +++++++------------------
1 files changed, 21 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 2ed770d..077cb49 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -772,8 +772,6 @@ static bool forcealign;
uint datalign; \
datalign = (unsigned long)((_p)->data); \
datalign = roundup(datalign, (_align)) - datalign; \
- ASSERT(datalign < (_align)); \
- ASSERT((_p)->len >= ((_len) + datalign)); \
if (datalign) \
skb_pull((_p), datalign); \
__skb_trim((_p), (_len)); \
@@ -1286,17 +1284,16 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, uint c
free_pkt = true;
pkt = new;
frame = (u8 *) (pkt->data);
- ASSERT(((unsigned long)frame % BRCMF_SDALIGN) == 0);
+ /* precondition: (frame % BRCMF_SDALIGN) == 0) */
pad = 0;
} else {
skb_push(pkt, pad);
frame = (u8 *) (pkt->data);
-
- ASSERT((pad + SDPCM_HDRLEN) <= (int)(pkt->len));
+ /* precondition: pad + SDPCM_HDRLEN <= pkt->len */
memset(frame, 0, pad + SDPCM_HDRLEN);
}
}
- ASSERT(pad < BRCMF_SDALIGN);
+ /* precondition: pad < BRCMF_SDALIGN */

/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
len = (u16) (pkt->len);
@@ -1344,7 +1341,6 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, uint c
ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2, F2SYNC, frame, len, pkt, NULL, NULL);
bus->f2txdata++;
- ASSERT(ret != -BCME_PENDING);

if (ret < 0) {
/* On failure, abort the command
@@ -1416,7 +1412,7 @@ int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *pkt)

/* Add space for the header */
skb_push(pkt, SDPCM_HDRLEN);
- ASSERT(IS_ALIGNED((unsigned long)(pkt->data), 2));
+ /* precondition: IS_ALIGNED((unsigned long)(pkt->data), 2) */

prec = PRIO2PREC((pkt->priority & PRIOMASK));

@@ -1580,7 +1576,7 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
msglen += doff;
memset(frame, 0, doff + SDPCM_HDRLEN);
}
- ASSERT(doff < BRCMF_SDALIGN);
+ /* precondition: doff < BRCMF_SDALIGN */
}
doff += SDPCM_HDRLEN;

@@ -1597,7 +1593,7 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
if (forcealign && (len & (ALIGNMENT - 1)))
len = roundup(len, ALIGNMENT);

- ASSERT(IS_ALIGNED((unsigned long)frame, 2));
+ /* precondition: IS_ALIGNED((unsigned long)frame, 2) */

/* Need to lock here to protect txseq and SDIO tx calls */
brcmf_sdbrcm_sdlock(bus);
@@ -1660,8 +1656,6 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
brcmf_sdcard_cur_sbwad(card), SDIO_FUNC_2,
F2SYNC, frame, len, NULL, NULL, NULL);

- ASSERT(ret != -BCME_PENDING);
-
if (ret < 0) {
/* On failure, abort the command and
terminate the frame */
@@ -2559,8 +2553,6 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac

bool set = (actionid == IOV_SVAL(IOV_MEMBYTES));

- ASSERT(plen >= 2 * sizeof(int));
-
address = (u32) int_val;
memcpy(&int_val, (char *)params + sizeof(int_val),
sizeof(int_val));
@@ -3037,14 +3029,16 @@ brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,

BRCMF_TRACE(("%s: Enter\n", __func__));

- ASSERT(name);
- ASSERT(len >= 0);
+ if (name == NULL || len <= 0)
+ return -EINVAL;

- /* Get MUST have return space */
- ASSERT(set || (arg && len));
+ /* Set does not take qualifiers */
+ if (set && (params || plen))
+ return -EINVAL;

- /* Set does NOT take qualifiers */
- ASSERT(!set || (!params && !plen));
+ /* Get must have return space;*/
+ if (!set && !(arg && len))
+ return -EINVAL;

/* Look up var locally; if not found pass to host driver */
vi = brcmu_iovar_lookup(brcmf_sdio_iovars, name);
@@ -3219,7 +3213,6 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
return -1;
}

- ASSERT(bus->drvr);
if (!bus->drvr)
return 0;

@@ -3408,7 +3401,6 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)
if ((bus->bus == SPI_BUS) && (!bus->usebufpool))
goto gotpkt;

- ASSERT(bus->rxbuf);
/* Set rxctl for frame (w/optional alignment) */
bus->rxctl = bus->rxbuf;
if (brcmf_alignctl) {
@@ -3418,7 +3410,6 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)
bus->rxctl += (BRCMF_SDALIGN - pad);
bus->rxctl -= firstread;
}
- ASSERT(bus->rxctl >= bus->rxbuf);

/* Copy the already-read portion over */
memcpy(bus->rxctl, hdr, firstread);
@@ -3471,7 +3462,6 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)
F2SYNC, (bus->rxctl + firstread), rdlen,
NULL, NULL, NULL);
bus->f2rxdata++;
- ASSERT(sdret != -BCME_PENDING);

/* Control frame failures need retransmission */
if (sdret < 0) {
@@ -3569,12 +3559,9 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
num, sublen));
break;
}
- ASSERT(!(pnext->prev));
if (!pfirst) {
- ASSERT(!plast);
pfirst = plast = pnext;
} else {
- ASSERT(plast);
plast->next = pnext;
plast = pnext;
}
@@ -3659,7 +3646,6 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
errcode = -1;
}
bus->f2rxdata++;
- ASSERT(errcode != -BCME_PENDING);

/* On failure, kill the superframe, allow a couple retries */
if (errcode < 0) {
@@ -3833,8 +3819,8 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
__func__, num, pfirst, pfirst->data,
pfirst->len, sublen, chan, seq));

- ASSERT((chan == SDPCM_DATA_CHANNEL)
- || (chan == SDPCM_EVENT_CHANNEL));
+ /* precondition: chan == SDPCM_DATA_CHANNEL ||
+ chan == SDPCM_EVENT_CHANNEL */

if (rxseq != seq) {
BRCMF_GLOM(("%s: rx_seq %d, expected %d\n",
@@ -3858,7 +3844,6 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
if (plast) {
plast->next = pnext;
} else {
- ASSERT(save_pfirst == pfirst);
save_pfirst = pnext;
}
continue;
@@ -3871,7 +3856,6 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
if (plast) {
plast->next = pnext;
} else {
- ASSERT(save_pfirst == pfirst);
save_pfirst = pnext;
}
continue;
@@ -3937,8 +3921,6 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)

BRCMF_TRACE(("%s: Enter\n", __func__));

- ASSERT(maxframes);
-
#ifdef SDTEST
/* Allow pktgen to override maxframes */
if (bus->pktgen_count && (bus->pktgen_mode == BRCMF_PKTGEN_RECV)) {
@@ -4018,7 +4000,6 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
(BRCMF_SDALIGN - pad);
bus->rxctl -= firstread;
}
- ASSERT(bus->rxctl >= bus->rxbuf);
rxbuf = bus->rxctl;
/* Read the entire frame */
sdret = brcmf_sdcard_recv_buf(card,
@@ -4027,7 +4008,6 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
rxbuf, rdlen,
NULL, NULL, NULL);
bus->f2rxdata++;
- ASSERT(sdret != -BCME_PENDING);

/* Control frame failures need
retransmission */
@@ -4060,7 +4040,6 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
if (bus->bus == SPI_BUS)
bus->usebufpool = true;

- ASSERT(!(pkt->prev));
PKTALIGN(pkt, rdlen, BRCMF_SDALIGN);
rxbuf = (u8 *) (pkt->data);
/* Read the entire frame */
@@ -4070,7 +4049,6 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
rxbuf, rdlen,
pkt, NULL, NULL);
bus->f2rxdata++;
- ASSERT(sdret != -BCME_PENDING);

if (sdret < 0) {
BRCMF_ERROR(("%s (nextlen): read %d"
@@ -4254,7 +4232,6 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
SDIO_FUNC_2, F2SYNC, bus->rxhdr, firstread,
NULL, NULL, NULL);
bus->f2rxhdrs++;
- ASSERT(sdret != -BCME_PENDING);

if (sdret < 0) {
BRCMF_ERROR(("%s: RXHEADER FAILED: %d\n", __func__,
@@ -4309,7 +4286,6 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
" min %d seq %d\n", __func__, doff,
len, SDPCM_HDRLEN, seq));
bus->rx_badhdr++;
- ASSERT(0);
brcmf_sdbrcm_rxfail(bus, false, false);
continue;
}
@@ -4360,10 +4336,9 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
continue;
}

- ASSERT((chan == SDPCM_DATA_CHANNEL)
- || (chan == SDPCM_EVENT_CHANNEL)
- || (chan == SDPCM_TEST_CHANNEL)
- || (chan == SDPCM_GLOM_CHANNEL));
+ /* precondition: chan is either SDPCM_DATA_CHANNEL,
+ SDPCM_EVENT_CHANNEL, SDPCM_TEST_CHANNEL or
+ SDPCM_GLOM_CHANNEL */

/* Length to read */
rdlen = (len > firstread) ? (len - firstread) : 0;
@@ -4404,10 +4379,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
continue;
}

- ASSERT(!(pkt->prev));
-
/* Leave room for what we already read, and align remainder */
- ASSERT(firstread < pkt->len);
skb_pull(pkt, firstread);
PKTALIGN(pkt, rdlen, BRCMF_SDALIGN);

@@ -4417,7 +4389,6 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
SDIO_FUNC_2, F2SYNC, ((u8 *) (pkt->data)),
rdlen, pkt, NULL, NULL);
bus->f2rxdata++;
- ASSERT(sdret != -BCME_PENDING);

if (sdret < 0) {
BRCMF_ERROR(("%s: read %d %s bytes failed: %d\n",
@@ -4458,7 +4429,6 @@ deliver:
}
#endif
__skb_trim(pkt, len);
- ASSERT(doff == SDPCM_HDRLEN);
skb_pull(pkt, SDPCM_HDRLEN);
bus->glomd = pkt;
} else {
@@ -4621,8 +4591,6 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
BRCMF_ERROR(("%s: error reading DEVCTL: %d\n",
__func__, err));
bus->drvr->busstate = BRCMF_BUS_DOWN;
- } else {
- ASSERT(devctl & SBSDIO_DEVCTL_CA_INT_ONLY);
}
#endif /* BCMDBG */

@@ -4768,7 +4736,6 @@ clkwait:
ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2, F2SYNC, (u8 *) bus->ctrl_frame_buf,
(u32) bus->ctrl_frame_len, NULL, NULL, NULL);
- ASSERT(ret != -BCME_PENDING);

if (ret < 0) {
/* On failure, abort the command and
@@ -5364,8 +5331,8 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
BRCMF_TRACE(("%s: Enter\n", __func__));
BRCMF_INFO(("%s: venid 0x%04x devid 0x%04x\n", __func__, venid, devid));

- /* We make assumptions about address window mappings */
- ASSERT(regsva == SI_ENUM_BASE);
+ /* We make an assumption about address window mappings:
+ * regsva == SI_ENUM_BASE*/

/* SDIO car passes venid and devid based on CIS parsing -- but
* low-power start
@@ -5803,7 +5770,6 @@ static void brcmf_sdbrcm_disconnect(void *ptr)
BRCMF_TRACE(("%s: Enter\n", __func__));

if (bus) {
- ASSERT(bus->drvr);
brcmf_sdbrcm_release(bus);
}

--
1.7.4.1



2011-07-05 22:03:20

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 29/31] staging: brcm80211: remove macro WLBANDINITFN from brcmsmac

The macro WLBANDINITFN does nothing meaningful in the brcmsmac
driver and has been removed.

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/bmac.c | 12 ++++++------
drivers/staging/brcm80211/brcmsmac/main.c | 4 ++--
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 6 +++---
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 22 +++++++++++-----------
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 8 ++++----
drivers/staging/brcm80211/brcmsmac/types.h | 2 --
6 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index 225178e..b25c517 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -176,7 +176,7 @@ static void brcms_b_update_slot_timing(struct brcms_hardware *wlc_hw,
}
}

-static void WLBANDINITFN(brcms_c_ucode_bsinit) (struct brcms_hardware *wlc_hw)
+static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
{
struct wiphy *wiphy = wlc_hw->wlc->wiphy;

@@ -209,7 +209,7 @@ static void WLBANDINITFN(brcms_c_ucode_bsinit) (struct brcms_hardware *wlc_hw)
}

/* switch to new band but leave it inactive */
-static u32 WLBANDINITFN(brcms_c_setband_inact) (struct brcms_c_info *wlc,
+static u32 brcms_c_setband_inact(struct brcms_c_info *wlc,
uint bandunit)
{
struct brcms_hardware *wlc_hw = wlc->hw;
@@ -1671,7 +1671,7 @@ brcms_b_write_hw_bcntemplates(struct brcms_hardware *wlc_hw, void *bcn,
}
}

-static void WLBANDINITFN(brcms_b_upd_synthpu) (struct brcms_hardware *wlc_hw)
+static void brcms_b_upd_synthpu(struct brcms_hardware *wlc_hw)
{
u16 v;
struct brcms_c_info *wlc = wlc_hw->wlc;
@@ -1690,7 +1690,7 @@ static void WLBANDINITFN(brcms_b_upd_synthpu) (struct brcms_hardware *wlc_hw)

/* band-specific init */
static void
-WLBANDINITFN(brcms_b_bsinit) (struct brcms_c_info *wlc, chanspec_t chanspec)
+brcms_b_bsinit(struct brcms_c_info *wlc, chanspec_t chanspec)
{
struct brcms_hardware *wlc_hw = wlc->hw;

@@ -1833,7 +1833,7 @@ void brcms_b_phy_reset(struct brcms_hardware *wlc_hw)

/* switch to and initialize new band */
static void
-WLBANDINITFN(brcms_b_setband) (struct brcms_hardware *wlc_hw, uint bandunit,
+brcms_b_setband(struct brcms_hardware *wlc_hw, uint bandunit,
chanspec_t chanspec) {
struct brcms_c_info *wlc = wlc_hw->wlc;
u32 macintmask;
@@ -1870,7 +1870,7 @@ WLBANDINITFN(brcms_b_setband) (struct brcms_hardware *wlc_hw, uint bandunit,
}

/* low-level band switch utility routine */
-void WLBANDINITFN(brcms_c_setxband) (struct brcms_hardware *wlc_hw,
+void brcms_c_setxband(struct brcms_hardware *wlc_hw,
uint bandunit)
{
BCMMSG(wlc_hw->wlc->wiphy, "wl%d: bandunit %d\n", wlc_hw->unit,
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 7c06026..1763c45 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -1024,7 +1024,7 @@ static void brcms_c_bandinit_ordered(struct brcms_c_info *wlc,
}

/* band-specific init */
-static void WLBANDINITFN(brcms_c_bsinit) (struct brcms_c_info *wlc)
+static void brcms_c_bsinit(struct brcms_c_info *wlc)
{
BCMMSG(wlc->wiphy, "wl%d: bandunit %d\n",
wlc->pub->unit, wlc->band->bandunit);
@@ -1041,7 +1041,7 @@ static void WLBANDINITFN(brcms_c_bsinit) (struct brcms_c_info *wlc)
}

/* switch to and initialize new band */
-static void WLBANDINITFN(brcms_c_setband) (struct brcms_c_info *wlc,
+static void brcms_c_setband(struct brcms_c_info *wlc,
uint bandunit)
{
int idx;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 7b1b584..17012fb 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -433,7 +433,7 @@ void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val)
pi->phy_wreg = 0;
}

-static void WLBANDINITFN(wlc_set_phy_uninitted) (struct brcms_phy *pi)
+static void wlc_set_phy_uninitted(struct brcms_phy *pi)
{
int i, j;

@@ -816,7 +816,7 @@ u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih)
return phy_bw_clkbits;
}

-void WLBANDINITFN(wlc_phy_por_inform) (struct brcms_phy_pub *ppi)
+void wlc_phy_por_inform(struct brcms_phy_pub *ppi)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

@@ -862,7 +862,7 @@ void wlc_phy_hw_state_upd(struct brcms_phy_pub *pih, bool newstate)
pi->sh->up = newstate;
}

-void WLBANDINITFN(wlc_phy_init) (struct brcms_phy_pub *pih, chanspec_t chanspec)
+void wlc_phy_init(struct brcms_phy_pub *pih, chanspec_t chanspec)
{
u32 mc;
initfn_t phy_init = NULL;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index 41ac681..6a3fbe6 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -2269,7 +2269,7 @@ static void wlc_lcnphy_vbat_temp_sense_setup(struct brcms_phy *pi, u8 mode)
udelay(999);
}

-static void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (struct brcms_phy_pub *ppi)
+static void wlc_lcnphy_tx_pwr_ctrl_init(struct brcms_phy_pub *ppi)
{
struct lcnphy_txgains tx_gains;
u8 bbmult;
@@ -3585,7 +3585,7 @@ void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr, s8 *cck_pwr)
}
}

-void WLBANDINITFN(wlc_phy_cal_init_lcnphy) (struct brcms_phy *pi)
+void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi)
{
return;

@@ -3677,7 +3677,7 @@ static void wlc_lcnphy_set_rx_iq_comp(struct brcms_phy *pi, u16 a, u16 b)

}

-void WLBANDINITFN(wlc_phy_init_lcnphy) (struct brcms_phy *pi)
+void wlc_phy_init_lcnphy(struct brcms_phy *pi)
{
u8 phybw40;
struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
@@ -4213,7 +4213,7 @@ wlc_lcnphy_tx_iqlo_loopback_cleanup(struct brcms_phy *pi, u16 *values_to_save)
}

static void
-WLBANDINITFN(wlc_lcnphy_load_tx_gain_table) (struct brcms_phy *pi,
+wlc_lcnphy_load_tx_gain_table(struct brcms_phy *pi,
const struct lcnphy_tx_gain_tbl_entry *gain_table) {
u32 j;
struct phytbl_info tab;
@@ -4297,7 +4297,7 @@ static void wlc_lcnphy_load_rfpower(struct brcms_phy *pi)
}
}

-static void WLBANDINITFN(wlc_lcnphy_tbl_init) (struct brcms_phy *pi)
+static void wlc_lcnphy_tbl_init(struct brcms_phy *pi)
{
uint idx;
u8 phybw40;
@@ -4392,7 +4392,7 @@ static void WLBANDINITFN(wlc_lcnphy_tbl_init) (struct brcms_phy *pi)
wlc_lcnphy_clear_papd_comptable(pi);
}

-static void WLBANDINITFN(wlc_lcnphy_rev0_baseband_init) (struct brcms_phy *pi)
+static void wlc_lcnphy_rev0_baseband_init(struct brcms_phy *pi)
{
u16 afectrl1;
struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
@@ -4439,7 +4439,7 @@ static void WLBANDINITFN(wlc_lcnphy_rev0_baseband_init) (struct brcms_phy *pi)

}

-static void WLBANDINITFN(wlc_lcnphy_rev2_baseband_init) (struct brcms_phy *pi)
+static void wlc_lcnphy_rev2_baseband_init(struct brcms_phy *pi)
{
if (CHSPEC_IS5G(pi->radio_chanspec)) {
mod_phy_reg(pi, 0x416, (0xff << 0), 80 << 0);
@@ -4509,7 +4509,7 @@ static void wlc_lcnphy_agc_temp_init(struct brcms_phy *pi)

}

-static void WLBANDINITFN(wlc_lcnphy_bu_tweaks) (struct brcms_phy *pi)
+static void wlc_lcnphy_bu_tweaks(struct brcms_phy *pi)
{
if (NORADIO_ENAB(pi->pubpi))
return;
@@ -4564,7 +4564,7 @@ static void WLBANDINITFN(wlc_lcnphy_bu_tweaks) (struct brcms_phy *pi)
}
}

-static void WLBANDINITFN(wlc_lcnphy_baseband_init) (struct brcms_phy *pi)
+static void wlc_lcnphy_baseband_init(struct brcms_phy *pi)
{

wlc_lcnphy_tbl_init(pi);
@@ -4574,7 +4574,7 @@ static void WLBANDINITFN(wlc_lcnphy_baseband_init) (struct brcms_phy *pi)
wlc_lcnphy_bu_tweaks(pi);
}

-static void WLBANDINITFN(wlc_radio_2064_init) (struct brcms_phy *pi)
+static void wlc_radio_2064_init(struct brcms_phy *pi)
{
u32 i;
struct lcnphy_radio_regs *lcnphyregs = NULL;
@@ -4635,7 +4635,7 @@ static void WLBANDINITFN(wlc_radio_2064_init) (struct brcms_phy *pi)
wlc_lcnphy_rc_cal(pi);
}

-static void WLBANDINITFN(wlc_lcnphy_radio_init) (struct brcms_phy *pi)
+static void wlc_lcnphy_radio_init(struct brcms_phy *pi)
{
if (NORADIO_ENAB(pi->pubpi))
return;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index 8e19bd0..f8e4192 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -14216,7 +14216,7 @@ bool wlc_phy_bist_check_phy(struct brcms_phy_pub *pih)
return false;
}

-static void WLBANDINITFN(wlc_phy_bphy_init_nphy) (struct brcms_phy *pi)
+static void wlc_phy_bphy_init_nphy(struct brcms_phy *pi)
{
u16 addr, val;

@@ -14273,7 +14273,7 @@ wlc_phy_table_read_nphy(struct brcms_phy *pi, u32 id, u32 len, u32 offset,
}

static void
-WLBANDINITFN(wlc_phy_static_table_download_nphy) (struct brcms_phy *pi)
+wlc_phy_static_table_download_nphy(struct brcms_phy *pi)
{
uint idx;

@@ -14296,7 +14296,7 @@ WLBANDINITFN(wlc_phy_static_table_download_nphy) (struct brcms_phy *pi)
}
}

-static void WLBANDINITFN(wlc_phy_tbl_init_nphy) (struct brcms_phy *pi)
+static void wlc_phy_tbl_init_nphy(struct brcms_phy *pi)
{
uint idx = 0;
u8 antswctrllut;
@@ -14524,7 +14524,7 @@ static void wlc_phy_txpwrctrl_config_nphy(struct brcms_phy *pi)
pi->phy_5g_pwrgain = true;
}

-void WLBANDINITFN(wlc_phy_init_nphy) (struct brcms_phy *pi)
+void wlc_phy_init_nphy(struct brcms_phy *pi)
{
u16 val;
u16 clip1_ths[2];
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index d8514c3..bbf2189 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -244,8 +244,6 @@
#define RXBND 8 /* max # frames to process in brcms_c_recv() */
#define TXSBND 8 /* max # tx status to process in wlc_txstatus() */

-#define WLBANDINITFN(_fn) _fn
-
#define BAND_5G(bt) ((bt) == BRCM_BAND_5G)
#define BAND_2G(bt) ((bt) == BRCM_BAND_2G)

--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 10/31] staging: brcm80211: removed remains of assert mechanism in fullmac

From: Roland Vossen <[email protected]>

Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 9 ----
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 50 ------------------------
2 files changed, 0 insertions(+), 59 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 229a702..b4d786f 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -703,7 +703,6 @@ extern uint brcmf_pktgen_len;
#define BRCMF_MAX_PKTGEN_LEN 1800
#endif

-extern u32 g_assert_type;
extern const struct bcmevent_name bcmevent_names[];
extern const int bcmevent_names_size;

@@ -815,14 +814,6 @@ extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg);
extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg,
int enable, int master_mode);

-#ifdef BCMDBG
-#define ASSERT(exp) \
- do { if (!(exp)) osl_assert(#exp, __FILE__, __LINE__); } while (0)
-extern void osl_assert(char *exp, char *file, int line);
-#else
-#define ASSERT(exp) do {} while (0)
-#endif /* defined(BCMDBG) */
-
/* Linux network driver ioctl encoding */
struct brcmf_c_ioctl {
uint cmd; /* common ioctl definition */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 0ea8084..1a7752d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -41,9 +41,6 @@
#include "wl_cfg80211.h"
#include "bcmchip.h"

-/* Global ASSERT type flag */
-u32 g_assert_type;
-
#if defined(CONFIG_PM_SLEEP)
#include <linux/suspend.h>
atomic_t brcmf_mmc_suspend;
@@ -1739,50 +1736,3 @@ exit:
return ret;
}
#endif /* BCMDBG */
-
-#if defined(BCMDBG)
-void osl_assert(char *exp, char *file, int line)
-{
- char tempbuf[256];
- char *basename;
-
- basename = strrchr(file, '/');
- /* skip the '/' */
- if (basename)
- basename++;
-
- if (!basename)
- basename = file;
-
- snprintf(tempbuf, 256,
- "assertion \"%s\" failed: file \"%s\", line %d\n", exp,
- basename, line);
-
- /*
- * Print assert message and give it time to
- * be written to /var/log/messages
- */
- if (!in_interrupt()) {
- const int delay = 3;
- printk(KERN_ERR "%s", tempbuf);
- printk(KERN_ERR "panic in %d seconds\n", delay);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(delay * HZ);
- }
-
- switch (g_assert_type) {
- case 0:
- panic(KERN_ERR "%s", tempbuf);
- break;
- case 1:
- printk(KERN_ERR "%s", tempbuf);
- BUG();
- break;
- case 2:
- printk(KERN_ERR "%s", tempbuf);
- break;
- default:
- break;
- }
-}
-#endif /* defined(BCMDBG) */
--
1.7.4.1



2011-07-05 22:03:20

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 20/31] staging: brcm80211: deleted two fullmac source files

From: Roland Vossen <[email protected]>

Having both a 'generic' as a 'linux' specific variant of a file makes
no sense in a Linux environment. Merged bcmsdh_sdmmc_linux.c into
bcmsdh_sdmmc.c, and bcmsdh_linux.c into bcmsdh.c.

Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 4 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 150 +++++++++++-
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 178 -------------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 246 ++++++++++++++++++-
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 260 --------------------
5 files changed, 394 insertions(+), 444 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c

diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index c38fa55..da3c805 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -33,9 +33,7 @@ DHDOFILES = \
dhd_sdio.o \
dhd_linux.o \
bcmsdh.o \
- bcmsdh_linux.o \
- bcmsdh_sdmmc.o \
- bcmsdh_sdmmc_linux.o
+ bcmsdh_sdmmc.o

obj-$(CONFIG_BRCMFMAC) += brcmfmac.o
brcmfmac-objs += $(DHDOFILES)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 97c0f9d..5fdeeaf 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -17,8 +17,10 @@

#include <linux/types.h>
#include <linux/netdevice.h>
+#include <linux/pci.h>
#include <linux/pci_ids.h>
#include <linux/sched.h>
+#include <linux/completion.h>

#include <defs.h>
#include <brcm_hw_ids.h>
@@ -29,12 +31,15 @@
#include "sbsdio.h" /* BRCM sdio device core */
#include "dngl_stats.h"
#include "dhd.h"
+#include "dhd_bus.h"
+#include "sdio_host.h"

#define SDIOH_API_ACCESS_RETRY_LIMIT 2

#define BRCMF_SD_ERROR_VAL 0x0001 /* Error */
#define BRCMF_SD_INFO_VAL 0x0002 /* Info */

+
#ifdef BCMDBG
#define BRCMF_SD_ERROR(x) \
do { \
@@ -53,7 +58,8 @@
#define BRCMF_SD_INFO(x)
#endif /* BCMDBG */

-const uint brcmf_sdio_msglevel = BRCMF_SD_ERROR_VAL;
+/* debugging macros */
+#define SDLX_MSG(x)

struct brcmf_sdio_card {
bool init_success; /* underlying driver successfully attached */
@@ -63,9 +69,46 @@ struct brcmf_sdio_card {
reg_read/reg_write call */
u32 sbwad; /* Save backplane window address */
};
+
+/**
+ * SDIO Host Controller info
+ */
+struct sdio_hc {
+ struct sdio_hc *next;
+ struct device *dev; /* platform device handle */
+ void *regs; /* SDIO Host Controller address */
+ struct brcmf_sdio_card *card;
+ void *ch;
+ unsigned int oob_irq;
+ unsigned long oob_flags; /* OOB Host specifiction
+ as edge and etc */
+ bool oob_irq_registered;
+};
+
/* local copy of bcm sd handler */
static struct brcmf_sdio_card *l_card;

+const uint brcmf_sdio_msglevel = BRCMF_SD_ERROR_VAL;
+
+static struct sdio_hc *sdhcinfo;
+
+/* driver info, initialized when brcmf_sdio_register is called */
+static struct brcmf_sdioh_driver drvinfo = { NULL, NULL };
+
+/* Module parameters specific to each host-controller driver */
+
+module_param(sd_msglevel, uint, 0);
+
+extern uint sd_f2_blocksize;
+module_param(sd_f2_blocksize, int, 0);
+
+/* forward declarations */
+int brcmf_sdio_probe(struct device *dev);
+EXPORT_SYMBOL(brcmf_sdio_probe);
+
+int brcmf_sdio_remove(struct device *dev);
+EXPORT_SYMBOL(brcmf_sdio_remove);
+
struct brcmf_sdio_card*
brcmf_sdcard_attach(void *cfghdl, u32 *regsva, uint irq)
{
@@ -500,3 +543,108 @@ u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_card *card)

return card->sbwad;
}
+
+int brcmf_sdio_probe(struct device *dev)
+{
+ struct sdio_hc *sdhc = NULL;
+ u32 regs = 0;
+ struct brcmf_sdio_card *card = NULL;
+ int irq = 0;
+ u32 vendevid;
+ unsigned long irq_flags = 0;
+
+ /* allocate SDIO Host Controller state info */
+ sdhc = kzalloc(sizeof(struct sdio_hc), GFP_ATOMIC);
+ if (!sdhc) {
+ SDLX_MSG(("%s: out of memory\n", __func__));
+ goto err;
+ }
+ sdhc->dev = (void *)dev;
+
+ card = brcmf_sdcard_attach((void *)0, &regs, irq);
+ if (!card) {
+ SDLX_MSG(("%s: attach failed\n", __func__));
+ goto err;
+ }
+
+ sdhc->card = card;
+ sdhc->oob_irq = irq;
+ sdhc->oob_flags = irq_flags;
+ sdhc->oob_irq_registered = false; /* to make sure.. */
+
+ /* chain SDIO Host Controller info together */
+ sdhc->next = sdhcinfo;
+ sdhcinfo = sdhc;
+ /* Read the vendor/device ID from the CIS */
+ vendevid = brcmf_sdcard_query_device(card);
+
+ /* try to attach to the target device */
+ sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF),
+ 0, 0, 0, 0, regs, card);
+ if (!sdhc->ch) {
+ SDLX_MSG(("%s: device attach failed\n", __func__));
+ goto err;
+ }
+
+ return 0;
+
+ /* error handling */
+err:
+ if (sdhc) {
+ if (sdhc->card)
+ brcmf_sdcard_detach(sdhc->card);
+ kfree(sdhc);
+ }
+
+ return -ENODEV;
+}
+
+int brcmf_sdio_remove(struct device *dev)
+{
+ struct sdio_hc *sdhc, *prev;
+
+ sdhc = sdhcinfo;
+ drvinfo.detach(sdhc->ch);
+ brcmf_sdcard_detach(sdhc->card);
+ /* find the SDIO Host Controller state for this pdev
+ and take it out from the list */
+ for (sdhc = sdhcinfo, prev = NULL; sdhc; sdhc = sdhc->next) {
+ if (sdhc->dev == (void *)dev) {
+ if (prev)
+ prev->next = sdhc->next;
+ else
+ sdhcinfo = NULL;
+ break;
+ }
+ prev = sdhc;
+ }
+ if (!sdhc) {
+ SDLX_MSG(("%s: failed\n", __func__));
+ return 0;
+ }
+
+ /* release SDIO Host Controller info */
+ kfree(sdhc);
+ return 0;
+}
+
+int brcmf_sdio_register(struct brcmf_sdioh_driver *driver)
+{
+ drvinfo = *driver;
+
+ SDLX_MSG(("Linux Kernel SDIO/MMC Driver\n"));
+ return brcmf_sdio_function_init();
+}
+
+void brcmf_sdio_unregister(void)
+{
+ brcmf_sdio_function_cleanup();
+}
+
+void brcmf_sdio_wdtmr_enable(bool enable)
+{
+ if (enable)
+ brcmf_sdbrcm_wd_timer(sdhcinfo->ch, brcmf_watchdog_ms);
+ else
+ brcmf_sdbrcm_wd_timer(sdhcinfo->ch, 0);
+}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
deleted file mode 100644
index ec7d79d..0000000
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/**
- * @file bcmsdh_linux.c
- */
-
-#define __UNDEF_NO_VERSION__
-
-#include <linux/netdevice.h>
-#include <linux/pci.h>
-#include <linux/completion.h>
-#include <linux/sched.h>
-
-#include <defs.h>
-#include <brcm_hw_ids.h>
-#include <brcmu_utils.h>
-#include <brcmu_wifi.h>
-#include "sdio_host.h"
-
-#include "dngl_stats.h"
-#include "dhd.h"
-#include "dhd_bus.h"
-#include "bcmsdbus.h"
-
-/**
- * SDIO Host Controller info
- */
-struct sdio_hc {
- struct sdio_hc *next;
- struct device *dev; /* platform device handle */
- void *regs; /* SDIO Host Controller address */
- struct brcmf_sdio_card *card;
- void *ch;
- unsigned int oob_irq;
- unsigned long oob_flags; /* OOB Host specifiction
- as edge and etc */
- bool oob_irq_registered;
-};
-static struct sdio_hc *sdhcinfo;
-
-/* driver info, initialized when brcmf_sdio_register is called */
-static struct brcmf_sdioh_driver drvinfo = { NULL, NULL };
-
-/* debugging macros */
-#define SDLX_MSG(x)
-
-/* forward declarations */
-int brcmf_sdio_probe(struct device *dev);
-EXPORT_SYMBOL(brcmf_sdio_probe);
-
-int brcmf_sdio_remove(struct device *dev);
-EXPORT_SYMBOL(brcmf_sdio_remove);
-
-int brcmf_sdio_probe(struct device *dev)
-{
- struct sdio_hc *sdhc = NULL;
- u32 regs = 0;
- struct brcmf_sdio_card *card = NULL;
- int irq = 0;
- u32 vendevid;
- unsigned long irq_flags = 0;
-
- /* allocate SDIO Host Controller state info */
- sdhc = kzalloc(sizeof(struct sdio_hc), GFP_ATOMIC);
- if (!sdhc) {
- SDLX_MSG(("%s: out of memory\n", __func__));
- goto err;
- }
- sdhc->dev = (void *)dev;
-
- card = brcmf_sdcard_attach((void *)0, &regs, irq);
- if (!card) {
- SDLX_MSG(("%s: attach failed\n", __func__));
- goto err;
- }
-
- sdhc->card = card;
- sdhc->oob_irq = irq;
- sdhc->oob_flags = irq_flags;
- sdhc->oob_irq_registered = false; /* to make sure.. */
-
- /* chain SDIO Host Controller info together */
- sdhc->next = sdhcinfo;
- sdhcinfo = sdhc;
- /* Read the vendor/device ID from the CIS */
- vendevid = brcmf_sdcard_query_device(card);
-
- /* try to attach to the target device */
- sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF),
- 0, 0, 0, 0, regs, card);
- if (!sdhc->ch) {
- SDLX_MSG(("%s: device attach failed\n", __func__));
- goto err;
- }
-
- return 0;
-
- /* error handling */
-err:
- if (sdhc) {
- if (sdhc->card)
- brcmf_sdcard_detach(sdhc->card);
- kfree(sdhc);
- }
-
- return -ENODEV;
-}
-
-int brcmf_sdio_remove(struct device *dev)
-{
- struct sdio_hc *sdhc, *prev;
-
- sdhc = sdhcinfo;
- drvinfo.detach(sdhc->ch);
- brcmf_sdcard_detach(sdhc->card);
- /* find the SDIO Host Controller state for this pdev
- and take it out from the list */
- for (sdhc = sdhcinfo, prev = NULL; sdhc; sdhc = sdhc->next) {
- if (sdhc->dev == (void *)dev) {
- if (prev)
- prev->next = sdhc->next;
- else
- sdhcinfo = NULL;
- break;
- }
- prev = sdhc;
- }
- if (!sdhc) {
- SDLX_MSG(("%s: failed\n", __func__));
- return 0;
- }
-
- /* release SDIO Host Controller info */
- kfree(sdhc);
- return 0;
-}
-
-int brcmf_sdio_register(struct brcmf_sdioh_driver *driver)
-{
- drvinfo = *driver;
-
- SDLX_MSG(("Linux Kernel SDIO/MMC Driver\n"));
- return brcmf_sdio_function_init();
-}
-
-void brcmf_sdio_unregister(void)
-{
- brcmf_sdio_function_cleanup();
-}
-
-/* Module parameters specific to each host-controller driver */
-
-module_param(sd_msglevel, uint, 0);
-
-extern uint sd_f2_blocksize;
-module_param(sd_f2_blocksize, int, 0);
-
-void brcmf_sdio_wdtmr_enable(bool enable)
-{
- if (enable)
- brcmf_sdbrcm_wd_timer(sdhcinfo->ch, brcmf_watchdog_ms);
- else
- brcmf_sdbrcm_wd_timer(sdhcinfo->ch, 0);
-}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 76a2c8b..d4a380c 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -19,8 +19,11 @@
#include <linux/mmc/core.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
+#include <linux/mmc/card.h>
#include <linux/suspend.h>
#include <linux/errno.h>
+#include <linux/sched.h> /* request_irq() */
+#include <net/cfg80211.h>

#include <defs.h>
#include <brcm_hw_ids.h>
@@ -30,6 +33,8 @@
#include "bcmsdbus.h"
#include "dngl_stats.h"
#include "dhd.h"
+#include "dhd_dbg.h"
+#include "wl_cfg80211.h"

#define BLOCK_SIZE_64 64
#define BLOCK_SIZE_512 512
@@ -41,20 +46,95 @@

#define CLIENT_INTR 0x100 /* Get rid of this! */

+#if !defined(SDIO_VENDOR_ID_BROADCOM)
+#define SDIO_VENDOR_ID_BROADCOM 0x02d0
+#endif /* !defined(SDIO_VENDOR_ID_BROADCOM) */
+
+#define SDIO_DEVICE_ID_BROADCOM_DEFAULT 0x0000
+
+#define DMA_ALIGN_MASK 0x03
+
+#if !defined(SDIO_DEVICE_ID_BROADCOM_4325_SDGWB)
+#define SDIO_DEVICE_ID_BROADCOM_4325_SDGWB 0x0492 /* BCM94325SDGWB */
+#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4325_SDGWB) */
+#if !defined(SDIO_DEVICE_ID_BROADCOM_4325)
+#define SDIO_DEVICE_ID_BROADCOM_4325 0x0493
+#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4325) */
+#if !defined(SDIO_DEVICE_ID_BROADCOM_4329)
+#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329
+#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4329) */
+#if !defined(SDIO_DEVICE_ID_BROADCOM_4319)
+#define SDIO_DEVICE_ID_BROADCOM_4319 0x4319
+#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4329) */
+
+struct sdos_info {
+ struct sdioh_info *sd;
+ spinlock_t lock;
+};
+
static void brcmf_sdioh_irqhandler(struct sdio_func *func);
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr);
+static int brcmf_ops_sdio_probe(struct sdio_func *func,
+ const struct sdio_device_id *id);
+static void brcmf_ops_sdio_remove(struct sdio_func *func);
+
+#ifdef CONFIG_PM
+static int brcmf_sdio_suspend(struct device *dev);
+static int brcmf_sdio_resume(struct device *dev);
+#endif /* CONFIG_PM */

uint sd_f2_blocksize = 512; /* Default blocksize */

uint sd_msglevel = 0x01;
+
+/* module param defaults */
+static int clockoverride;
+
+module_param(clockoverride, int, 0644);
+MODULE_PARM_DESC(clockoverride, "SDIO card clock override");
+
+struct brcmf_sdmmc_instance *gInstance;
+
+struct device sdmmc_dev;
+
+/* devices we support, null terminated */
+static const struct sdio_device_id brcmf_sdmmc_ids[] = {
+ {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_DEFAULT)},
+ {SDIO_DEVICE
+ (SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325_SDGWB)},
+ {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325)},
+ {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4329)},
+ {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4319)},
+ { /* end: all zeroes */ },
+};
+
+#ifdef CONFIG_PM
+static const struct dev_pm_ops brcmf_sdio_pm_ops = {
+ .suspend = brcmf_sdio_suspend,
+ .resume = brcmf_sdio_resume,
+};
+#endif /* CONFIG_PM */
+
+static struct sdio_driver brcmf_sdmmc_driver = {
+ .probe = brcmf_ops_sdio_probe,
+ .remove = brcmf_ops_sdio_remove,
+ .name = "brcmfmac",
+ .id_table = brcmf_sdmmc_ids,
+#ifdef CONFIG_PM
+ .drv = {
+ .pm = &brcmf_sdio_pm_ops,
+ },
+#endif /* CONFIG_PM */
+};
+
+MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
+
BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait);
BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_word_wait);
BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_packet_wait);
BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);

-#define DMA_ALIGN_MASK 0x03
-
static int
brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
int regsize, u32 *data);
@@ -904,3 +984,165 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)

sd = gInstance->sd;
}
+
+static int brcmf_ops_sdio_probe(struct sdio_func *func,
+ const struct sdio_device_id *id)
+{
+ int ret = 0;
+ static struct sdio_func sdio_func_0;
+ sd_trace(("sdio_probe: %s Enter\n", __func__));
+ sd_trace(("sdio_probe: func->class=%x\n", func->class));
+ sd_trace(("sdio_vendor: 0x%04x\n", func->vendor));
+ sd_trace(("sdio_device: 0x%04x\n", func->device));
+ sd_trace(("Function#: 0x%04x\n", func->num));
+
+ if (func->num == 1) {
+ sdio_func_0.num = 0;
+ sdio_func_0.card = func->card;
+ gInstance->func[0] = &sdio_func_0;
+ if (func->device == 0x4) { /* 4318 */
+ gInstance->func[2] = NULL;
+ sd_trace(("NIC found, calling brcmf_sdio_probe...\n"));
+ ret = brcmf_sdio_probe(&sdmmc_dev);
+ }
+ }
+
+ gInstance->func[func->num] = func;
+
+ if (func->num == 2) {
+ brcmf_cfg80211_sdio_func(func);
+ sd_trace(("F2 found, calling brcmf_sdio_probe...\n"));
+ ret = brcmf_sdio_probe(&sdmmc_dev);
+ }
+
+ return ret;
+}
+
+static void brcmf_ops_sdio_remove(struct sdio_func *func)
+{
+ sd_trace(("%s Enter\n", __func__));
+ sd_info(("func->class=%x\n", func->class));
+ sd_info(("sdio_vendor: 0x%04x\n", func->vendor));
+ sd_info(("sdio_device: 0x%04x\n", func->device));
+ sd_info(("Function#: 0x%04x\n", func->num));
+
+ if (func->num == 2) {
+ sd_trace(("F2 found, calling brcmf_sdio_remove...\n"));
+ brcmf_sdio_remove(&sdmmc_dev);
+ }
+}
+
+
+#ifdef CONFIG_PM
+static int brcmf_sdio_suspend(struct device *dev)
+{
+ mmc_pm_flag_t sdio_flags;
+ int ret = 0;
+
+ sd_trace(("%s\n", __func__));
+
+ sdio_flags = sdio_get_host_pm_caps(gInstance->func[1]);
+ if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
+ sd_err(("Host can't keep power while suspended\n"));
+ return -EINVAL;
+ }
+
+ ret = sdio_set_host_pm_flags(gInstance->func[1], MMC_PM_KEEP_POWER);
+ if (ret) {
+ sd_err(("Failed to set pm_flags\n"));
+ return ret;
+ }
+
+ brcmf_sdio_wdtmr_enable(false);
+
+ return ret;
+}
+
+static int brcmf_sdio_resume(struct device *dev)
+{
+ brcmf_sdio_wdtmr_enable(true);
+ return 0;
+}
+#endif /* CONFIG_PM */
+
+int brcmf_sdioh_osinit(struct sdioh_info *sd)
+{
+ struct sdos_info *sdos;
+
+ sdos = kmalloc(sizeof(struct sdos_info), GFP_ATOMIC);
+ sd->sdos_info = (void *)sdos;
+ if (sdos == NULL)
+ return -ENOMEM;
+
+ sdos->sd = sd;
+ spin_lock_init(&sdos->lock);
+ return 0;
+}
+
+void brcmf_sdioh_osfree(struct sdioh_info *sd)
+{
+ struct sdos_info *sdos;
+
+ sdos = (struct sdos_info *)sd->sdos_info;
+ kfree(sdos);
+}
+
+/* Interrupt enable/disable */
+int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
+{
+ unsigned long flags;
+ struct sdos_info *sdos;
+
+ sd_trace(("%s: %s\n", __func__, enable ? "Enabling" : "Disabling"));
+
+ sdos = (struct sdos_info *)sd->sdos_info;
+
+ if (enable && !(sd->intr_handler && sd->intr_handler_arg)) {
+ sd_err(("%s: no handler registered, will not enable\n",
+ __func__));
+ return -EINVAL;
+ }
+
+ /* Ensure atomicity for enable/disable calls */
+ spin_lock_irqsave(&sdos->lock, flags);
+
+ sd->client_intr_enabled = enable;
+ if (enable)
+ brcmf_sdioh_dev_intr_on(sd);
+ else
+ brcmf_sdioh_dev_intr_off(sd);
+
+ spin_unlock_irqrestore(&sdos->lock, flags);
+
+ return 0;
+}
+
+/*
+ * module init
+*/
+int brcmf_sdio_function_init(void)
+{
+ int error = 0;
+ sd_trace(("brcmf_sdio_function_init: %s Enter\n", __func__));
+
+ gInstance = kzalloc(sizeof(struct brcmf_sdmmc_instance), GFP_KERNEL);
+ if (!gInstance)
+ return -ENOMEM;
+
+ memset(&sdmmc_dev, 0, sizeof(sdmmc_dev));
+ error = sdio_register_driver(&brcmf_sdmmc_driver);
+
+ return error;
+}
+
+/*
+ * module cleanup
+*/
+void brcmf_sdio_function_cleanup(void)
+{
+ sd_trace(("%s Enter\n", __func__));
+
+ sdio_unregister_driver(&brcmf_sdmmc_driver);
+
+ kfree(gInstance);
+}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
deleted file mode 100644
index 7d4b2e3..0000000
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#include <linux/types.h>
-#include <linux/sched.h> /* request_irq() */
-#include <linux/netdevice.h>
-#include <linux/mmc/core.h>
-#include <linux/mmc/card.h>
-#include <linux/mmc/sdio_func.h>
-#include <linux/mmc/sdio_ids.h>
-#include <linux/errno.h>
-#include <net/cfg80211.h>
-
-#include <defs.h>
-#include <brcmu_utils.h>
-#include <brcmu_wifi.h>
-#include "sdio_host.h"
-#include "bcmsdbus.h"
-#include "dngl_stats.h"
-#include "dhd.h"
-
-#if !defined(SDIO_VENDOR_ID_BROADCOM)
-#define SDIO_VENDOR_ID_BROADCOM 0x02d0
-#endif /* !defined(SDIO_VENDOR_ID_BROADCOM) */
-
-#define SDIO_DEVICE_ID_BROADCOM_DEFAULT 0x0000
-
-#if !defined(SDIO_DEVICE_ID_BROADCOM_4325_SDGWB)
-#define SDIO_DEVICE_ID_BROADCOM_4325_SDGWB 0x0492 /* BCM94325SDGWB */
-#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4325_SDGWB) */
-#if !defined(SDIO_DEVICE_ID_BROADCOM_4325)
-#define SDIO_DEVICE_ID_BROADCOM_4325 0x0493
-#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4325) */
-#if !defined(SDIO_DEVICE_ID_BROADCOM_4329)
-#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329
-#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4329) */
-#if !defined(SDIO_DEVICE_ID_BROADCOM_4319)
-#define SDIO_DEVICE_ID_BROADCOM_4319 0x4319
-#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4329) */
-
-#include "dhd_dbg.h"
-#include "wl_cfg80211.h"
-
-/* module param defaults */
-static int clockoverride;
-
-module_param(clockoverride, int, 0644);
-MODULE_PARM_DESC(clockoverride, "SDIO card clock override");
-
-struct brcmf_sdmmc_instance *gInstance;
-
-struct device sdmmc_dev;
-
-static int brcmf_ops_sdio_probe(struct sdio_func *func,
- const struct sdio_device_id *id)
-{
- int ret = 0;
- static struct sdio_func sdio_func_0;
- sd_trace(("sdio_probe: %s Enter\n", __func__));
- sd_trace(("sdio_probe: func->class=%x\n", func->class));
- sd_trace(("sdio_vendor: 0x%04x\n", func->vendor));
- sd_trace(("sdio_device: 0x%04x\n", func->device));
- sd_trace(("Function#: 0x%04x\n", func->num));
-
- if (func->num == 1) {
- sdio_func_0.num = 0;
- sdio_func_0.card = func->card;
- gInstance->func[0] = &sdio_func_0;
- if (func->device == 0x4) { /* 4318 */
- gInstance->func[2] = NULL;
- sd_trace(("NIC found, calling brcmf_sdio_probe...\n"));
- ret = brcmf_sdio_probe(&sdmmc_dev);
- }
- }
-
- gInstance->func[func->num] = func;
-
- if (func->num == 2) {
- brcmf_cfg80211_sdio_func(func);
- sd_trace(("F2 found, calling brcmf_sdio_probe...\n"));
- ret = brcmf_sdio_probe(&sdmmc_dev);
- }
-
- return ret;
-}
-
-static void brcmf_ops_sdio_remove(struct sdio_func *func)
-{
- sd_trace(("%s Enter\n", __func__));
- sd_info(("func->class=%x\n", func->class));
- sd_info(("sdio_vendor: 0x%04x\n", func->vendor));
- sd_info(("sdio_device: 0x%04x\n", func->device));
- sd_info(("Function#: 0x%04x\n", func->num));
-
- if (func->num == 2) {
- sd_trace(("F2 found, calling brcmf_sdio_remove...\n"));
- brcmf_sdio_remove(&sdmmc_dev);
- }
-}
-
-/* devices we support, null terminated */
-static const struct sdio_device_id brcmf_sdmmc_ids[] = {
- {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_DEFAULT)},
- {SDIO_DEVICE
- (SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325_SDGWB)},
- {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325)},
- {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4329)},
- {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4319)},
- { /* end: all zeroes */ },
-};
-
-MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
-
-#ifdef CONFIG_PM
-static int brcmf_sdio_suspend(struct device *dev)
-{
- mmc_pm_flag_t sdio_flags;
- int ret = 0;
-
- sd_trace(("%s\n", __func__));
-
- sdio_flags = sdio_get_host_pm_caps(gInstance->func[1]);
- if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
- sd_err(("Host can't keep power while suspended\n"));
- return -EINVAL;
- }
-
- ret = sdio_set_host_pm_flags(gInstance->func[1], MMC_PM_KEEP_POWER);
- if (ret) {
- sd_err(("Failed to set pm_flags\n"));
- return ret;
- }
-
- brcmf_sdio_wdtmr_enable(false);
-
- return ret;
-}
-
-static int brcmf_sdio_resume(struct device *dev)
-{
- brcmf_sdio_wdtmr_enable(true);
- return 0;
-}
-
-static const struct dev_pm_ops brcmf_sdio_pm_ops = {
- .suspend = brcmf_sdio_suspend,
- .resume = brcmf_sdio_resume,
-};
-#endif /* CONFIG_PM */
-
-static struct sdio_driver brcmf_sdmmc_driver = {
- .probe = brcmf_ops_sdio_probe,
- .remove = brcmf_ops_sdio_remove,
- .name = "brcmfmac",
- .id_table = brcmf_sdmmc_ids,
-#ifdef CONFIG_PM
- .drv = {
- .pm = &brcmf_sdio_pm_ops,
- },
-#endif /* CONFIG_PM */
-};
-
-struct sdos_info {
- struct sdioh_info *sd;
- spinlock_t lock;
-};
-
-int brcmf_sdioh_osinit(struct sdioh_info *sd)
-{
- struct sdos_info *sdos;
-
- sdos = kmalloc(sizeof(struct sdos_info), GFP_ATOMIC);
- sd->sdos_info = (void *)sdos;
- if (sdos == NULL)
- return -ENOMEM;
-
- sdos->sd = sd;
- spin_lock_init(&sdos->lock);
- return 0;
-}
-
-void brcmf_sdioh_osfree(struct sdioh_info *sd)
-{
- struct sdos_info *sdos;
-
- sdos = (struct sdos_info *)sd->sdos_info;
- kfree(sdos);
-}
-
-/* Interrupt enable/disable */
-int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
-{
- unsigned long flags;
- struct sdos_info *sdos;
-
- sd_trace(("%s: %s\n", __func__, enable ? "Enabling" : "Disabling"));
-
- sdos = (struct sdos_info *)sd->sdos_info;
-
- if (enable && !(sd->intr_handler && sd->intr_handler_arg)) {
- sd_err(("%s: no handler registered, will not enable\n",
- __func__));
- return -EINVAL;
- }
-
- /* Ensure atomicity for enable/disable calls */
- spin_lock_irqsave(&sdos->lock, flags);
-
- sd->client_intr_enabled = enable;
- if (enable)
- brcmf_sdioh_dev_intr_on(sd);
- else
- brcmf_sdioh_dev_intr_off(sd);
-
- spin_unlock_irqrestore(&sdos->lock, flags);
-
- return 0;
-}
-
-/*
- * module init
-*/
-int brcmf_sdio_function_init(void)
-{
- int error = 0;
- sd_trace(("brcmf_sdio_function_init: %s Enter\n", __func__));
-
- gInstance = kzalloc(sizeof(struct brcmf_sdmmc_instance), GFP_KERNEL);
- if (!gInstance)
- return -ENOMEM;
-
- memset(&sdmmc_dev, 0, sizeof(sdmmc_dev));
- error = sdio_register_driver(&brcmf_sdmmc_driver);
-
- return error;
-}
-
-/*
- * module cleanup
-*/
-void brcmf_sdio_function_cleanup(void)
-{
- sd_trace(("%s Enter\n", __func__));
-
- sdio_unregister_driver(&brcmf_sdmmc_driver);
-
- kfree(gInstance);
-}
--
1.7.4.1



2011-07-05 22:03:12

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 03/31] staging: brcm80211: removed unused #ifdef sections in fullmac

From: Roland Vossen <[email protected]>

CONFIG_MACH_SANDGATE2G, CONFIG_MMC_MSM7X00A,
CONFIG_HAS_EARLYSUSPEND and CONFIG_WIFI_CONTROL_FUNC were never
defined.

Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 126 -----------------------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 5 -
drivers/staging/brcm80211/include/brcmu_utils.h | 4 -
3 files changed, 0 insertions(+), 135 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index f62a3c0..423d5da 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -29,9 +29,6 @@
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <net/cfg80211.h>
-#if defined(CONFIG_HAS_EARLYSUSPEND)
-#include <linux/earlysuspend.h>
-#endif
#include <defs.h>
#include <brcmu_utils.h>
#include <brcmu_wifi.h>
@@ -90,10 +87,6 @@ struct brcmf_info {
bool set_macaddress;
u8 macvalue[ETH_ALEN];
atomic_t pend_8021x_cnt;
-
-#ifdef CONFIG_HAS_EARLYSUSPEND
- struct early_suspend early_suspend;
-#endif /* CONFIG_HAS_EARLYSUSPEND */
};

/* Error bits */
@@ -180,108 +173,6 @@ static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktd
struct brcmf_event_msg *event_ptr,
void **data_ptr);

-#if defined(CONFIG_HAS_EARLYSUSPEND)
-static int brcmf_set_suspend(int value, struct brcmf_pub *drvr)
-{
- int power_mode = PM_MAX;
- /* struct wl_pkt_filter_enable enable_parm; */
- char iovbuf[32];
- int bcn_li_dtim = 3;
-
- DHD_TRACE(("%s: enter, value = %d in_suspend=%d\n",
- __func__, value, drvr->in_suspend));
-
- if (drvr && drvr->up) {
- if (value && drvr->in_suspend) {
-
- /* Kernel suspended */
- DHD_TRACE(("%s: force extra Suspend setting\n",
- __func__));
-
- brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_PM,
- (char *)&power_mode,
- sizeof(power_mode));
-
- /* Enable packet filter, only allow unicast
- packet to send up */
- brcmf_set_packet_filter(1, drvr);
-
- /* if dtim skip setup as default force it
- * to wake each third dtim
- * for better power saving.
- * Note that side effect is chance to miss BC/MC
- * packet
- */
- if ((drvr->dtim_skip == 0) || (drvr->dtim_skip == 1))
- bcn_li_dtim = 3;
- else
- bcn_li_dtim = drvr->dtim_skip;
- brcmu_mkiovar("bcn_li_dtim", (char *)&bcn_li_dtim,
- 4, iovbuf, sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR,
- iovbuf, sizeof(iovbuf));
- } else {
-
- /* Kernel resumed */
- DHD_TRACE(("%s: Remove extra suspend setting\n",
- __func__));
-
- power_mode = PM_FAST;
- brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_PM,
- (char *)&power_mode,
- sizeof(power_mode));
-
- /* disable pkt filter */
- brcmf_set_packet_filter(0, drvr);
-
- /* restore pre-suspend setting for dtim_skip */
- brcmu_mkiovar("bcn_li_dtim", (char *)&drvr->dtim_skip,
- 4, iovbuf, sizeof(iovbuf));
-
- brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR,
- iovbuf, sizeof(iovbuf));
- }
- }
-
- return 0;
-}
-
-static void brcmf_suspend_resume_helper(struct brcmf_info *drvr_priv, int val)
-{
- struct brcmf_pub *drvr = &drvr_priv->pub;
-
- brcmf_os_proto_block(drvr);
- /* Set flag when early suspend was called */
- drvr->in_suspend = val;
- if (!drvr->suspend_disable_flag)
- brcmf_set_suspend(val, drvr);
- brcmf_os_proto_unblock(drvr);
-}
-
-static void brcmf_early_suspend(struct early_suspend *h)
-{
- struct brcmf_info *drvr_priv =
- container_of(h, struct brcmf_info, early_suspend);
-
- DHD_TRACE(("%s: enter\n", __func__));
-
- if (drvr_priv)
- brcmf_suspend_resume_helper(drvr_priv, 1);
-
-}
-
-static void brcmf_late_resume(struct early_suspend *h)
-{
- struct brcmf_info *drvr_priv =
- container_of(h, struct brcmf_info, early_suspend);
-
- DHD_TRACE(("%s: enter\n", __func__));
-
- if (drvr_priv)
- brcmf_suspend_resume_helper(drvr_priv, 0);
-}
-#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
-
/*
* Generalized timeout mechanism. Uses spin sleep with exponential
* back-off until
@@ -1479,20 +1370,9 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
*/
memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));

-#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
- g_bus = bus;
-#endif
#if defined(CONFIG_PM_SLEEP)
atomic_set(&brcmf_mmc_suspend, false);
#endif /* defined(CONFIG_PM_SLEEP) */
- /* Init lock suspend to prevent kernel going to suspend */
-#ifdef CONFIG_HAS_EARLYSUSPEND
- drvr_priv->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
- drvr_priv->early_suspend.suspend = brcmf_early_suspend;
- drvr_priv->early_suspend.resume = brcmf_late_resume;
- register_early_suspend(&drvr_priv->early_suspend);
-#endif
-
return &drvr_priv->pub;

fail:
@@ -1664,12 +1544,6 @@ void brcmf_detach(struct brcmf_pub *drvr)
struct brcmf_if *ifp;
int i;

-#if defined(CONFIG_HAS_EARLYSUSPEND)
- if (drvr_priv->early_suspend.suspend)
- unregister_early_suspend(
- &drvr_priv->early_suspend);
-#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
-
for (i = 1; i < BRCMF_MAX_IFS; i++)
if (drvr_priv->iflist[i])
brcmf_del_if(drvr_priv, i);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index c5552f1..4c801e7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -166,13 +166,8 @@ struct rte_console {

#define TXRETRIES 2 /* # of retries for tx frames */

-#if defined(CONFIG_MACH_SANDGATE2G)
-#define BRCMF_RXBOUND 250 /* Default for max rx frames in
- one scheduling */
-#else
#define BRCMF_RXBOUND 50 /* Default for max rx frames in
one scheduling */
-#endif /* defined(CONFIG_MACH_SANDGATE2G) */

#define BRCMF_TXBOUND 20 /* Default for max tx frames in
one scheduling */
diff --git a/drivers/staging/brcm80211/include/brcmu_utils.h b/drivers/staging/brcm80211/include/brcmu_utils.h
index d0039d7..2d54cc5 100644
--- a/drivers/staging/brcm80211/include/brcmu_utils.h
+++ b/drivers/staging/brcm80211/include/brcmu_utils.h
@@ -205,12 +205,8 @@ extern int brcmu_iovar_lencheck(const struct brcmu_iovar *table, void *arg,
#define ISPOWEROF2(x) ((((x)-1)&(x)) == 0)

/* map physical to virtual I/O */
-#if !defined(CONFIG_MMC_MSM7X00A)
#define REG_MAP(pa, size) ioremap_nocache((unsigned long)(pa), \
(unsigned long)(size))
-#else
-#define REG_MAP(pa, size) (void *)(0)
-#endif

/* the largest reasonable packet buffer driver uses for ethernet MTU in bytes */
#define PKTBUFSZ 2048
--
1.7.4.1



2011-07-05 22:03:12

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 17/31] staging: brcm80211: made name lookup arrays more const

The checkpatch script gave a hint that some character string arrays
probably should have an additional const keyword. This patch changes
the static const char * arrays to static const char * const arrays as
suggested getting rid of two checkpatch warnings.

Reviewed-by: Roland Vossen <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 8d061ad..b89b0ec 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -278,7 +278,7 @@ static bool in_send_q;
#define wme_shmemacindex(ac) wme_ac2fifo[ac]

#ifdef BCMDBG
-static const char *fifo_names[] = {
+static const char * const fifo_names[] = {
"AC_BK", "AC_BE", "AC_VI", "AC_VO", "BCMC", "ATIM" };
#else
static const char fifo_names[6][0];
@@ -2831,7 +2831,7 @@ static void brcms_c_wme_retries_write(struct brcms_c_info *wlc)
}

#ifdef BCMDBG
-static const char *supr_reason[] = {
+static const char * const supr_reason[] = {
"None", "PMQ Entry", "Flush request",
"Previous frag failure", "Channel mismatch",
"Lifetime Expiry", "Underflow"
--
1.7.4.1



2011-07-05 22:03:12

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 05/31] staging: brcm80211: removed asserts from two fullmac files

From: Roland Vossen <[email protected]>

ASSERTs are non desirable, replaced by error handling where applicable.

Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 37 +++++++-------------
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 2 -
2 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 3f3f0ee..76a2c8b 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -279,12 +279,16 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
bool bool_val;
u32 actionid;

- ASSERT(name);
- ASSERT(len >= 0);
+ if (name == NULL || len <= 0)
+ return -EINVAL;

- /* Get must have return space; Set does not take qualifiers */
- ASSERT(set || (arg && len));
- ASSERT(!set || (!params && !plen));
+ /* Set does not take qualifiers */
+ if (set && (params || plen))
+ return -EINVAL;
+
+ /* Get must have return space;*/
+ if (!set && !(arg && len))
+ return -EINVAL;

sd_trace(("%s: Enter (%s %s)\n", __func__, (set ? "set" : "get"),
name));
@@ -676,7 +680,6 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,

sd_trace(("%s: Enter\n", __func__));

- ASSERT(pkt);
BRCMF_PM_RESUME_WAIT(sdioh_request_packet_wait);
BRCMF_PM_RESUME_RETURN_ERROR(-EIO);

@@ -687,14 +690,6 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
pkt_len += 3;
pkt_len &= 0xFFFFFFFC;

- /* Make sure the packet is aligned properly.
- * If it isn't, then this
- * is the fault of brcmf_sdioh_request_buffer() which
- * is supposed to give
- * us something we can work with.
- */
- ASSERT(((ulong) (pkt->data) & DMA_ALIGN_MASK) == 0);
-
if ((write) && (!fifo)) {
err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
((u8 *) (pnext->data)),
@@ -789,11 +784,10 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,

brcmu_pkt_buf_free_skb(mypkt);
} else if (((ulong) (pkt->data) & DMA_ALIGN_MASK) != 0) {
- /* Case 2: We have a packet, but it is unaligned. */
-
- /* In this case, we cannot have a chain. */
- ASSERT(pkt->next == NULL);
-
+ /*
+ * Case 2: We have a packet, but it is unaligned.
+ * In this case, we cannot have a chain (pkt->next == NULL)
+ */
sd_data(("%s: Creating aligned %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", pkt->len));
mypkt = brcmu_pkt_buf_get_skb(pkt->len);
@@ -886,13 +880,10 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
sd_trace(("brcmf: ***IRQHandler\n"));
sd = gInstance->sd;

- ASSERT(sd != NULL);
sdio_release_host(gInstance->func[0]);

if (sd->use_client_ints) {
sd->intrcount++;
- ASSERT(sd->intr_handler);
- ASSERT(sd->intr_handler_arg);
(sd->intr_handler) (sd->intr_handler_arg);
} else {
sd_err(("brcmf: ***IRQHandler\n"));
@@ -912,6 +903,4 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
sd_trace(("brcmf: ***IRQHandlerF2\n"));

sd = gInstance->sd;
-
- ASSERT(sd != NULL);
}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index e229bcb..7d4b2e3 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -194,7 +194,6 @@ int brcmf_sdioh_osinit(struct sdioh_info *sd)
void brcmf_sdioh_osfree(struct sdioh_info *sd)
{
struct sdos_info *sdos;
- ASSERT(sd && sd->sdos_info);

sdos = (struct sdos_info *)sd->sdos_info;
kfree(sdos);
@@ -209,7 +208,6 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
sd_trace(("%s: %s\n", __func__, enable ? "Enabling" : "Disabling"));

sdos = (struct sdos_info *)sd->sdos_info;
- ASSERT(sdos);

if (enable && !(sd->intr_handler && sd->intr_handler_arg)) {
sd_err(("%s: no handler registered, will not enable\n",
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 01/31] staging: brcm80211: clean up checkpatch error

A checkpatch error was introduced in following commit:

0f22b8a staging: brcm80211: remove MMC_SDIO_ABORT macro definition

The patch gets rid of the error.

Reviewed-by: Roland Vossen <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 4c0a031..3f3f0ee 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -567,8 +567,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
sdio_writeb(gInstance->func[func], *byte,
regaddr, &err_ret);
sdio_release_host(gInstance->func[func]);
- }
- else if (regaddr < 0xF0) {
+ } else if (regaddr < 0xF0) {
sd_err(("brcmf: F0 Wr:0x%02x: write "
"disallowed\n", regaddr));
} else {
--
1.7.4.1



2011-07-06 09:25:08

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 07/31] staging: brcm80211: removed asserts from dhd_cdc.c and dhd_common.c

On Wed, Jul 06, 2011 at 12:02:34AM +0200, Arend van Spriel wrote:
> @@ -317,14 +312,16 @@ brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name,
>
> BRCMF_TRACE(("%s: Enter\n", __func__));
>
> - ASSERT(name);
> - ASSERT(len >= 0);
> + if (name == NULL || len <= 0)
> + return -EINVAL;
>

In the original code len == 0 was OK but now we return -EINVAL.

regards,
dan carpenter


2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 23/31] staging: brcm80211: merged bcmsdbus.h into sdio_host.h

From: Roland Vossen <[email protected]>


Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 190 ---------------------
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 1 -
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 51 ++++++-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 1 -
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 117 +++++++++++++
5 files changed, 167 insertions(+), 193 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdbus.h

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
deleted file mode 100644
index c4c6e54..0000000
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _sdio_api_h_
-#define _sdio_api_h_
-
-#include "sdio_host.h"
-
-#define SDIOH_READ 0 /* Read request */
-#define SDIOH_WRITE 1 /* Write request */
-
-#define SDIOH_DATA_FIX 0 /* Fixed addressing */
-#define SDIOH_DATA_INC 1 /* Incremental addressing */
-
-#define SDIOH_CMD_TYPE_NORMAL 0 /* Normal command */
-#define SDIOH_CMD_TYPE_APPEND 1 /* Append command */
-#define SDIOH_CMD_TYPE_CUTTHRU 2 /* Cut-through command */
-
-#define SDIOH_DATA_PIO 0 /* PIO mode */
-#define SDIOH_DATA_DMA 1 /* DMA mode */
-
-/* internal return code */
-#define SUCCESS 0
-#define ERROR 1
-
-/* Common msglevel constants */
-#define SDH_ERROR_VAL 0x0001 /* Error */
-#define SDH_TRACE_VAL 0x0002 /* Trace */
-#define SDH_INFO_VAL 0x0004 /* Info */
-#define SDH_DEBUG_VAL 0x0008 /* Debug */
-#define SDH_DATA_VAL 0x0010 /* Data */
-#define SDH_CTRL_VAL 0x0020 /* Control Regs */
-#define SDH_LOG_VAL 0x0040 /* Enable bcmlog */
-#define SDH_DMA_VAL 0x0080 /* DMA */
-
-#ifdef BCMDBG
-#define sd_err(x) \
- do { \
- if ((sd_msglevel & SDH_ERROR_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_trace(x) \
- do { \
- if ((sd_msglevel & SDH_TRACE_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_info(x) \
- do { \
- if ((sd_msglevel & SDH_INFO_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_debug(x) \
- do { \
- if ((sd_msglevel & SDH_DEBUG_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_data(x) \
- do { \
- if ((sd_msglevel & SDH_DATA_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_ctrl(x) \
- do { \
- if ((sd_msglevel & SDH_CTRL_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#else
-#define sd_err(x)
-#define sd_trace(x)
-#define sd_info(x)
-#define sd_debug(x)
-#define sd_data(x)
-#define sd_ctrl(x)
-#endif
-
-struct brcmf_sdreg {
- int func;
- int offset;
- int value;
-};
-
-struct sdioh_info {
- struct osl_info *osh; /* osh handler */
- bool client_intr_enabled; /* interrupt connnected flag */
- bool intr_handler_valid; /* client driver interrupt handler valid */
- void (*intr_handler)(void *); /* registered interrupt handler */
- void *intr_handler_arg; /* argument to call interrupt handler */
- u16 intmask; /* Current active interrupts */
- void *sdos_info; /* Pointer to per-OS private data */
-
- uint irq; /* Client irq */
- int intrcount; /* Client interrupts */
- bool sd_blockmode; /* sd_blockmode == false => 64 Byte Cmd 53s. */
- /* Must be on for sd_multiblock to be effective */
- bool use_client_ints; /* If this is false, make sure to restore */
- int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */
- u8 num_funcs; /* Supported funcs on client */
- u32 com_cis_ptr;
- u32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
- uint max_dma_len;
- uint max_dma_descriptors; /* DMA Descriptors supported by this controller. */
- /* SDDMA_DESCRIPTOR SGList[32]; *//* Scatter/Gather DMA List */
-};
-
-struct brcmf_sdmmc_instance {
- struct sdioh_info *sd;
- struct sdio_func *func[SDIOD_MAX_IOFUNCS];
- u32 host_claimed;
-};
-
-/* Allocate/init/free per-OS private data */
-extern int brcmf_sdioh_osinit(struct sdioh_info *sd);
-extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
-
-/* Core interrupt enable/disable of device interrupts */
-extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
-extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
-
-/* attach, return handler on success, NULL if failed.
- * The handler shall be provided by all subsequent calls. No local cache
- * cfghdl points to the starting address of pci device mapped memory
- */
-extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
-extern int brcmf_sdioh_detach(struct sdioh_info *si);
-
-extern int
-brcmf_sdioh_interrupt_register(struct sdioh_info *si,
- void (*sdioh_cb_fn)(void *), void *argh);
-
-extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
-
-/* enable or disable SD interrupt */
-extern int
-brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
-
-/* read or write one byte using cmd52 */
-extern int
-brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
- u8 *byte);
-
-/* read or write 2/4 bytes using cmd53 */
-extern int
-brcmf_sdioh_request_word(struct sdioh_info *si, uint cmd_type,
- uint rw, uint fnc, uint addr,
- u32 *word, uint nbyte);
-
-/* read or write any buffer using cmd53 */
-extern int
-brcmf_sdioh_request_buffer(struct sdioh_info *si, uint pio_dma,
- uint fix_inc, uint rw, uint fnc_num,
- u32 addr, uint regwidth,
- u32 buflen, u8 *buffer, struct sk_buff *pkt);
-
-/* get cis data */
-extern int
-brcmf_sdioh_cis_read(struct sdioh_info *si, uint fuc, u8 *cis, u32 length);
-
-extern int
-brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
-extern int
-brcmf_sdioh_cfg_write(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
-
-/* handle iovars */
-extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
- void *params, int plen, void *arg, int len, bool set);
-
-/* Issue abort to the specified function and clear controller as needed */
-extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
-
-/* Watchdog timer interface for pm ops */
-extern void brcmf_sdio_wdtmr_enable(bool enable);
-
-extern uint sd_msglevel; /* Debug message level */
-
-extern struct brcmf_sdmmc_instance *gInstance;
-
-#endif /* _sdio_api_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 6714af7..a527f29 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -27,7 +27,6 @@
#include <brcmu_utils.h>
#include <brcmu_wifi.h>
#include <soc.h>
-#include "bcmsdbus.h" /* common SDIO/controller interface */
#include "dhd.h"
#include "dhd_bus.h"
#include "sdio_host.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 40c93c4..6567363 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -30,7 +30,6 @@
#include <brcmu_utils.h>
#include <brcmu_wifi.h>
#include "sdio_host.h"
-#include "bcmsdbus.h"
#include "dhd.h"
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
@@ -66,6 +65,56 @@
#define SDIO_DEVICE_ID_BROADCOM_4319 0x4319
#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4329) */

+/* Common msglevel constants */
+#define SDH_ERROR_VAL 0x0001 /* Error */
+#define SDH_TRACE_VAL 0x0002 /* Trace */
+#define SDH_INFO_VAL 0x0004 /* Info */
+#define SDH_DEBUG_VAL 0x0008 /* Debug */
+#define SDH_DATA_VAL 0x0010 /* Data */
+#define SDH_CTRL_VAL 0x0020 /* Control Regs */
+#define SDH_LOG_VAL 0x0040 /* Enable bcmlog */
+#define SDH_DMA_VAL 0x0080 /* DMA */
+
+#ifdef BCMDBG
+#define sd_err(x) \
+ do { \
+ if ((sd_msglevel & SDH_ERROR_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_trace(x) \
+ do { \
+ if ((sd_msglevel & SDH_TRACE_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_info(x) \
+ do { \
+ if ((sd_msglevel & SDH_INFO_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_debug(x) \
+ do { \
+ if ((sd_msglevel & SDH_DEBUG_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_data(x) \
+ do { \
+ if ((sd_msglevel & SDH_DATA_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_ctrl(x) \
+ do { \
+ if ((sd_msglevel & SDH_CTRL_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#else
+#define sd_err(x)
+#define sd_trace(x)
+#define sd_info(x)
+#define sd_debug(x)
+#define sd_data(x)
+#define sd_ctrl(x)
+#endif
+
struct sdos_info {
struct sdioh_info *sd;
spinlock_t lock;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index f89b960..b34914e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -32,7 +32,6 @@
#include <brcm_hw_ids.h>
#include <soc.h>
#include "sdio_host.h"
-#include "bcmsdbus.h"

/* register access macros */
#ifndef __BIG_ENDIAN
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 73ee785..a956339 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -298,9 +298,60 @@ extern const uint brcmf_sdio_msglevel;
/* HW frame tag */
#define SDPCM_FRAMETAG_LEN 4 /* 2 bytes len, 2 bytes check val */

+#define SDIOH_READ 0 /* Read request */
+#define SDIOH_WRITE 1 /* Write request */
+
+#define SDIOH_DATA_FIX 0 /* Fixed addressing */
+#define SDIOH_DATA_INC 1 /* Incremental addressing */
+
+#define SDIOH_CMD_TYPE_NORMAL 0 /* Normal command */
+#define SDIOH_CMD_TYPE_APPEND 1 /* Append command */
+#define SDIOH_CMD_TYPE_CUTTHRU 2 /* Cut-through command */
+
+#define SDIOH_DATA_PIO 0 /* PIO mode */
+#define SDIOH_DATA_DMA 1 /* DMA mode */
+
+/* internal return code */
+#define SUCCESS 0
+#define ERROR 1
+
/* forward declarations */
struct brcmf_sdio_card;

+struct brcmf_sdreg {
+ int func;
+ int offset;
+ int value;
+};
+
+struct sdioh_info {
+ struct osl_info *osh; /* osh handler */
+ bool client_intr_enabled; /* interrupt connnected flag */
+ bool intr_handler_valid; /* client driver interrupt handler valid */
+ void (*intr_handler)(void *); /* registered interrupt handler */
+ void *intr_handler_arg; /* argument to call interrupt handler */
+ u16 intmask; /* Current active interrupts */
+ void *sdos_info; /* Pointer to per-OS private data */
+
+ uint irq; /* Client irq */
+ int intrcount; /* Client interrupts */
+ bool sd_blockmode; /* sd_blockmode == false => 64 Byte Cmd 53s. */
+ /* Must be on for sd_multiblock to be effective */
+ bool use_client_ints; /* If this is false, make sure to restore */
+ int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */
+ u8 num_funcs; /* Supported funcs on client */
+ u32 com_cis_ptr;
+ u32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
+ uint max_dma_len;
+ uint max_dma_descriptors; /* DMA Descriptors supported by this controller. */
+ /* SDDMA_DESCRIPTOR SGList[32]; *//* Scatter/Gather DMA List */
+};
+
+struct brcmf_sdmmc_instance {
+ struct sdioh_info *sd;
+ struct sdio_func *func[SDIOD_MAX_IOFUNCS];
+ u32 host_claimed;
+};

/* Attach and build an interface to the underlying SD host driver.
* - Allocates resources (structs, arrays, mem, OS handles, etc) needed by
@@ -450,4 +501,70 @@ extern int brcmf_sdio_remove(struct device *dev);
/* Function to return current window addr */
extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_card *card);

+/* Allocate/init/free per-OS private data */
+extern int brcmf_sdioh_osinit(struct sdioh_info *sd);
+extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
+
+/* Core interrupt enable/disable of device interrupts */
+extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
+extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
+
+/* attach, return handler on success, NULL if failed.
+ * The handler shall be provided by all subsequent calls. No local cache
+ * cfghdl points to the starting address of pci device mapped memory
+ */
+extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
+extern int brcmf_sdioh_detach(struct sdioh_info *si);
+
+extern int
+brcmf_sdioh_interrupt_register(struct sdioh_info *si,
+ void (*sdioh_cb_fn)(void *), void *argh);
+
+extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
+
+/* enable or disable SD interrupt */
+extern int
+brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
+
+/* read or write one byte using cmd52 */
+extern int
+brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
+ u8 *byte);
+
+/* read or write 2/4 bytes using cmd53 */
+extern int
+brcmf_sdioh_request_word(struct sdioh_info *si, uint cmd_type,
+ uint rw, uint fnc, uint addr,
+ u32 *word, uint nbyte);
+
+/* read or write any buffer using cmd53 */
+extern int
+brcmf_sdioh_request_buffer(struct sdioh_info *si, uint pio_dma,
+ uint fix_inc, uint rw, uint fnc_num,
+ u32 addr, uint regwidth,
+ u32 buflen, u8 *buffer, struct sk_buff *pkt);
+
+/* get cis data */
+extern int
+brcmf_sdioh_cis_read(struct sdioh_info *si, uint fuc, u8 *cis, u32 length);
+
+extern int
+brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
+extern int
+brcmf_sdioh_cfg_write(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
+
+/* handle iovars */
+extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
+ void *params, int plen, void *arg, int len, bool set);
+
+/* Issue abort to the specified function and clear controller as needed */
+extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
+
+/* Watchdog timer interface for pm ops */
+extern void brcmf_sdio_wdtmr_enable(bool enable);
+
+extern uint sd_msglevel; /* Debug message level */
+
+extern struct brcmf_sdmmc_instance *gInstance;
+
#endif /* _BRCM_SDH_H_ */
--
1.7.4.1



2011-07-05 22:03:20

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 25/31] staging: brcm80211: removed #ifdef SDIOH_API_ACCESS_RETRY_LIMIT

From: Roland Vossen <[email protected]>

SDIOH_API_ACCESS_RETRY_LIMIT is always defined.

Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index c9e20e1..f4e72ed 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -189,26 +189,20 @@ u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_card *card, uint fnc_num, u32 addr,
int *err)
{
int status;
-#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
-#endif
u8 data = 0;

if (!card)
card = l_card;

-#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
do {
if (retry) /* wait for 1 ms till bus get settled down */
udelay(1000);
-#endif
status =
brcmf_sdioh_cfg_read(card->sdioh, fnc_num, addr,
(u8 *) &data);
-#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (status != 0
&& (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
-#endif
if (err)
*err = status;

@@ -223,25 +217,19 @@ brcmf_sdcard_cfg_write(struct brcmf_sdio_card *card, uint fnc_num, u32 addr,
u8 data, int *err)
{
int status;
-#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
-#endif

if (!card)
card = l_card;

-#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
do {
if (retry) /* wait for 1 ms till bus get settled down */
udelay(1000);
-#endif
status =
brcmf_sdioh_cfg_write(card->sdioh, fnc_num, addr,
(u8 *) &data);
-#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (status != 0
&& (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
-#endif
if (err)
*err = status;

--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 28/31] staging: brcm80211: remove external definitions from phy_lcn.c

The source file phy_lcn.c had several external definitions flagged
by checkpatch.pl script. The patch fixes those.

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 10 ++--------
.../staging/brcm80211/brcmsmac/phy/phytbl_lcn.h | 2 ++
2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index 8e98d8f..41ac681 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -535,12 +535,6 @@ static const s8 lcnphy_gain_index_offset_for_rssi[] = {
-2
};

-extern const u8 spur_tbl_rev0[];
-extern const u32 dot11lcnphytbl_rx_gain_info_sz_rev1;
-extern const struct phytbl_info dot11lcnphytbl_rx_gain_info_rev1[];
-extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa;
-extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250;
-
struct chan_info_2064_lcnphy {
uint chan;
uint freq;
@@ -991,7 +985,7 @@ static bool wlc_lcnphy_rx_iq_est(struct brcms_phy *pi, u16 num_samps,
static bool wlc_lcnphy_calc_rx_iq_comp(struct brcms_phy *pi, u16 num_samps);
static u16 wlc_lcnphy_get_pa_gain(struct brcms_phy *pi);
static void wlc_lcnphy_afe_clk_init(struct brcms_phy *pi, u8 mode);
-extern void wlc_lcnphy_tx_pwr_ctrl_init(struct brcms_phy_pub *ppi);
+static void wlc_lcnphy_tx_pwr_ctrl_init(struct brcms_phy_pub *ppi);
static void wlc_lcnphy_radio_2064_channel_tune_4313(struct brcms_phy *pi,
u8 channel);

@@ -2275,7 +2269,7 @@ static void wlc_lcnphy_vbat_temp_sense_setup(struct brcms_phy *pi, u8 mode)
udelay(999);
}

-void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (struct brcms_phy_pub *ppi)
+static void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (struct brcms_phy_pub *ppi)
{
struct lcnphy_txgains tx_gains;
u8 bbmult;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.h b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.h
index 644389f..5f75e16 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.h
@@ -22,6 +22,8 @@ extern const u32 dot11lcnphytbl_rx_gain_info_sz_rev0;
extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313;
extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_epa;
extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_epa_combo;
+extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa;
+extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250;

extern const struct phytbl_info dot11lcnphytbl_info_rev0[];
extern const u32 dot11lcnphytbl_info_sz_rev0;
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 22/31] staging: brcm80211: merged sbsdio.h into sdio_host.h

From: Roland Vossen <[email protected]>


Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 2 -
drivers/staging/brcm80211/brcmfmac/sbsdio.h | 277 ------------------------
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 258 ++++++++++++++++++++++
4 files changed, 258 insertions(+), 280 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/sbsdio.h

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 23c2300..6714af7 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -28,7 +28,6 @@
#include <brcmu_wifi.h>
#include <soc.h>
#include "bcmsdbus.h" /* common SDIO/controller interface */
-#include "sbsdio.h" /* BRCM sdio device core */
#include "dhd.h"
#include "dhd_bus.h"
#include "sdio_host.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 6cb922f..f89b960 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -150,8 +150,6 @@ struct rte_console {
#endif /* BCMDBG */
#include <chipcommon.h>

-#include "sbsdio.h"
-
#include "dhd.h"
#include "dhd_bus.h"
#include "dhd_proto.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/sbsdio.h b/drivers/staging/brcm80211/brcmfmac/sbsdio.h
deleted file mode 100644
index db9f607..0000000
--- a/drivers/staging/brcm80211/brcmfmac/sbsdio.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _SBSDIO_H
-#define _SBSDIO_H
-
-#define SBSDIO_NUM_FUNCTION 3 /* as of sdiod rev 0, supports 3 functions */
-
-/* function 1 miscellaneous registers */
-#define SBSDIO_SPROM_CS 0x10000 /* sprom command and status */
-#define SBSDIO_SPROM_INFO 0x10001 /* sprom info register */
-#define SBSDIO_SPROM_DATA_LOW 0x10002 /* sprom indirect access data byte 0 */
-#define SBSDIO_SPROM_DATA_HIGH 0x10003 /* sprom indirect access data byte 1 */
-#define SBSDIO_SPROM_ADDR_LOW 0x10004 /* sprom indirect access addr byte 0 */
-#define SBSDIO_SPROM_ADDR_HIGH 0x10005 /* sprom indirect access addr byte 0 */
-#define SBSDIO_CHIP_CTRL_DATA 0x10006 /* xtal_pu (gpio) output */
-#define SBSDIO_CHIP_CTRL_EN 0x10007 /* xtal_pu (gpio) enable */
-#define SBSDIO_WATERMARK 0x10008 /* rev < 7, watermark for sdio device */
-#define SBSDIO_DEVICE_CTL 0x10009 /* control busy signal generation */
-
-/* registers introduced in rev 8, some content (mask/bits) defs in sbsdpcmdev.h */
-#define SBSDIO_FUNC1_SBADDRLOW 0x1000A /* SB Address Window Low (b15) */
-#define SBSDIO_FUNC1_SBADDRMID 0x1000B /* SB Address Window Mid (b23:b16) */
-#define SBSDIO_FUNC1_SBADDRHIGH 0x1000C /* SB Address Window High (b31:b24) */
-#define SBSDIO_FUNC1_FRAMECTRL 0x1000D /* Frame Control (frame term/abort) */
-#define SBSDIO_FUNC1_CHIPCLKCSR 0x1000E /* ChipClockCSR (ALP/HT ctl/status) */
-#define SBSDIO_FUNC1_SDIOPULLUP 0x1000F /* SdioPullUp (on cmd, d0-d2) */
-#define SBSDIO_FUNC1_WFRAMEBCLO 0x10019 /* Write Frame Byte Count Low */
-#define SBSDIO_FUNC1_WFRAMEBCHI 0x1001A /* Write Frame Byte Count High */
-#define SBSDIO_FUNC1_RFRAMEBCLO 0x1001B /* Read Frame Byte Count Low */
-#define SBSDIO_FUNC1_RFRAMEBCHI 0x1001C /* Read Frame Byte Count High */
-
-#define SBSDIO_FUNC1_MISC_REG_START 0x10000 /* f1 misc register start */
-#define SBSDIO_FUNC1_MISC_REG_LIMIT 0x1001C /* f1 misc register end */
-
-/* SBSDIO_SPROM_CS */
-#define SBSDIO_SPROM_IDLE 0
-#define SBSDIO_SPROM_WRITE 1
-#define SBSDIO_SPROM_READ 2
-#define SBSDIO_SPROM_WEN 4
-#define SBSDIO_SPROM_WDS 7
-#define SBSDIO_SPROM_DONE 8
-
-/* SBSDIO_SPROM_INFO */
-#define SROM_SZ_MASK 0x03 /* SROM size, 1: 4k, 2: 16k */
-#define SROM_BLANK 0x04 /* depreciated in corerev 6 */
-#define SROM_OTP 0x80 /* OTP present */
-
-/* SBSDIO_CHIP_CTRL */
-#define SBSDIO_CHIP_CTRL_XTAL 0x01 /* or'd with onchip xtal_pu,
- * 1: power on oscillator
- * (for 4318 only)
- */
-/* SBSDIO_WATERMARK */
-#define SBSDIO_WATERMARK_MASK 0x7f /* number of words - 1 for sd device
- * to wait before sending data to host
- */
-
-/* SBSDIO_DEVICE_CTL */
-#define SBSDIO_DEVCTL_SETBUSY 0x01 /* 1: device will assert busy signal when
- * receiving CMD53
- */
-#define SBSDIO_DEVCTL_SPI_INTR_SYNC 0x02 /* 1: assertion of sdio interrupt is
- * synchronous to the sdio clock
- */
-#define SBSDIO_DEVCTL_CA_INT_ONLY 0x04 /* 1: mask all interrupts to host
- * except the chipActive (rev 8)
- */
-#define SBSDIO_DEVCTL_PADS_ISO 0x08 /* 1: isolate internal sdio signals, put
- * external pads in tri-state; requires
- * sdio bus power cycle to clear (rev 9)
- */
-#define SBSDIO_DEVCTL_SB_RST_CTL 0x30 /* Force SD->SB reset mapping (rev 11) */
-#define SBSDIO_DEVCTL_RST_CORECTL 0x00 /* Determined by CoreControl bit */
-#define SBSDIO_DEVCTL_RST_BPRESET 0x10 /* Force backplane reset */
-#define SBSDIO_DEVCTL_RST_NOBPRESET 0x20 /* Force no backplane reset */
-
-/* SBSDIO_FUNC1_CHIPCLKCSR */
-#define SBSDIO_FORCE_ALP 0x01 /* Force ALP request to backplane */
-#define SBSDIO_FORCE_HT 0x02 /* Force HT request to backplane */
-#define SBSDIO_FORCE_ILP 0x04 /* Force ILP request to backplane */
-#define SBSDIO_ALP_AVAIL_REQ 0x08 /* Make ALP ready (power up xtal) */
-#define SBSDIO_HT_AVAIL_REQ 0x10 /* Make HT ready (power up PLL) */
-#define SBSDIO_FORCE_HW_CLKREQ_OFF 0x20 /* Squelch clock requests from HW */
-#define SBSDIO_ALP_AVAIL 0x40 /* Status: ALP is ready */
-#define SBSDIO_HT_AVAIL 0x80 /* Status: HT is ready */
-/* In rev8, actual avail bits followed original docs */
-#define SBSDIO_Rev8_HT_AVAIL 0x40
-#define SBSDIO_Rev8_ALP_AVAIL 0x80
-
-#define SBSDIO_AVBITS (SBSDIO_HT_AVAIL | SBSDIO_ALP_AVAIL)
-#define SBSDIO_ALPAV(regval) ((regval) & SBSDIO_AVBITS)
-#define SBSDIO_HTAV(regval) (((regval) & SBSDIO_AVBITS) == SBSDIO_AVBITS)
-#define SBSDIO_ALPONLY(regval) (SBSDIO_ALPAV(regval) && !SBSDIO_HTAV(regval))
-#define SBSDIO_CLKAV(regval, alponly) (SBSDIO_ALPAV(regval) && \
- (alponly ? 1 : SBSDIO_HTAV(regval)))
-
-/* SBSDIO_FUNC1_SDIOPULLUP */
-#define SBSDIO_PULLUP_D0 0x01 /* Enable D0/MISO pullup */
-#define SBSDIO_PULLUP_D1 0x02 /* Enable D1/INT# pullup */
-#define SBSDIO_PULLUP_D2 0x04 /* Enable D2 pullup */
-#define SBSDIO_PULLUP_CMD 0x08 /* Enable CMD/MOSI pullup */
-#define SBSDIO_PULLUP_ALL 0x0f /* All valid bits */
-
-/* function 1 OCP space */
-#define SBSDIO_SB_OFT_ADDR_MASK 0x07FFF /* sb offset addr is <= 15 bits, 32k */
-#define SBSDIO_SB_OFT_ADDR_LIMIT 0x08000
-#define SBSDIO_SB_ACCESS_2_4B_FLAG 0x08000 /* with b15, maps to 32-bit SB access */
-
-/* some duplication with sbsdpcmdev.h here */
-/* valid bits in SBSDIO_FUNC1_SBADDRxxx regs */
-#define SBSDIO_SBADDRLOW_MASK 0x80 /* Valid bits in SBADDRLOW */
-#define SBSDIO_SBADDRMID_MASK 0xff /* Valid bits in SBADDRMID */
-#define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */
-#define SBSDIO_SBWINDOW_MASK 0xffff8000 /* Address bits from SBADDR regs */
-
-/* direct(mapped) cis space */
-#define SBSDIO_CIS_BASE_COMMON 0x1000 /* MAPPED common CIS address */
-#define SBSDIO_CIS_SIZE_LIMIT 0x200 /* maximum bytes in one CIS */
-#define SBSDIO_OTP_CIS_SIZE_LIMIT 0x078 /* maximum bytes OTP CIS */
-
-#define SBSDIO_CIS_OFT_ADDR_MASK 0x1FFFF /* cis offset addr is < 17 bits */
-
-#define SBSDIO_CIS_MANFID_TUPLE_LEN 6 /* manfid tuple length, include tuple,
- * link bytes
- */
-
-/* indirect cis access (in sprom) */
-#define SBSDIO_SPROM_CIS_OFFSET 0x8 /* 8 control bytes first, CIS starts from
- * 8th byte
- */
-
-#define SBSDIO_BYTEMODE_DATALEN_MAX 64 /* sdio byte mode: maximum length of one
- * data command
- */
-
-#define SBSDIO_CORE_ADDR_MASK 0x1FFFF /* sdio core function one address mask */
-
-/* corecontrol */
-#define CC_CISRDY (1 << 0) /* CIS Ready */
-#define CC_BPRESEN (1 << 1) /* CCCR RES signal */
-#define CC_F2RDY (1 << 2) /* set CCCR IOR2 bit */
-#define CC_CLRPADSISO (1 << 3) /* clear SDIO pads isolation */
-#define CC_XMTDATAAVAIL_MODE (1 << 4)
-#define CC_XMTDATAAVAIL_CTRL (1 << 5)
-
-/* corestatus */
-#define CS_PCMCIAMODE (1 << 0) /* Device Mode; 0=SDIO, 1=PCMCIA */
-#define CS_SMARTDEV (1 << 1) /* 1=smartDev enabled */
-#define CS_F2ENABLED (1 << 2) /* 1=host has enabled the device */
-
-#define PCMCIA_MES_PA_MASK 0x7fff /* PCMCIA Message Portal Address Mask */
-#define PCMCIA_MES_PM_MASK 0x7fff /* PCMCIA Message Portal Mask Mask */
-#define PCMCIA_WFBC_MASK 0xffff /* PCMCIA Write Frame Byte Count Mask */
-#define PCMCIA_UT_MASK 0x07ff /* PCMCIA Underflow Timer Mask */
-
-/* intstatus */
-#define I_SMB_SW0 (1 << 0) /* To SB Mail S/W interrupt 0 */
-#define I_SMB_SW1 (1 << 1) /* To SB Mail S/W interrupt 1 */
-#define I_SMB_SW2 (1 << 2) /* To SB Mail S/W interrupt 2 */
-#define I_SMB_SW3 (1 << 3) /* To SB Mail S/W interrupt 3 */
-#define I_SMB_SW_MASK 0x0000000f /* To SB Mail S/W interrupts mask */
-#define I_SMB_SW_SHIFT 0 /* To SB Mail S/W interrupts shift */
-#define I_HMB_SW0 (1 << 4) /* To Host Mail S/W interrupt 0 */
-#define I_HMB_SW1 (1 << 5) /* To Host Mail S/W interrupt 1 */
-#define I_HMB_SW2 (1 << 6) /* To Host Mail S/W interrupt 2 */
-#define I_HMB_SW3 (1 << 7) /* To Host Mail S/W interrupt 3 */
-#define I_HMB_SW_MASK 0x000000f0 /* To Host Mail S/W interrupts mask */
-#define I_HMB_SW_SHIFT 4 /* To Host Mail S/W interrupts shift */
-#define I_WR_OOSYNC (1 << 8) /* Write Frame Out Of Sync */
-#define I_RD_OOSYNC (1 << 9) /* Read Frame Out Of Sync */
-#define I_PC (1 << 10) /* descriptor error */
-#define I_PD (1 << 11) /* data error */
-#define I_DE (1 << 12) /* Descriptor protocol Error */
-#define I_RU (1 << 13) /* Receive descriptor Underflow */
-#define I_RO (1 << 14) /* Receive fifo Overflow */
-#define I_XU (1 << 15) /* Transmit fifo Underflow */
-#define I_RI (1 << 16) /* Receive Interrupt */
-#define I_BUSPWR (1 << 17) /* SDIO Bus Power Change (rev 9) */
-#define I_XMTDATA_AVAIL (1 << 23) /* bits in fifo */
-#define I_XI (1 << 24) /* Transmit Interrupt */
-#define I_RF_TERM (1 << 25) /* Read Frame Terminate */
-#define I_WF_TERM (1 << 26) /* Write Frame Terminate */
-#define I_PCMCIA_XU (1 << 27) /* PCMCIA Transmit FIFO Underflow */
-#define I_SBINT (1 << 28) /* sbintstatus Interrupt */
-#define I_CHIPACTIVE (1 << 29) /* chip from doze to active state */
-#define I_SRESET (1 << 30) /* CCCR RES interrupt */
-#define I_IOE2 (1U << 31) /* CCCR IOE2 Bit Changed */
-#define I_ERRORS (I_PC | I_PD | I_DE | I_RU | I_RO | I_XU)
-#define I_DMA (I_RI | I_XI | I_ERRORS)
-
-/* sbintstatus */
-#define I_SB_SERR (1 << 8) /* Backplane SError (write) */
-#define I_SB_RESPERR (1 << 9) /* Backplane Response Error (read) */
-#define I_SB_SPROMERR (1 << 10) /* Error accessing the sprom */
-
-/* sdioaccess */
-#define SDA_DATA_MASK 0x000000ff /* Read/Write Data Mask */
-#define SDA_ADDR_MASK 0x000fff00 /* Read/Write Address Mask */
-#define SDA_ADDR_SHIFT 8 /* Read/Write Address Shift */
-#define SDA_WRITE 0x01000000 /* Write bit */
-#define SDA_READ 0x00000000 /* Write bit cleared for Read */
-#define SDA_BUSY 0x80000000 /* Busy bit */
-
-/* sdioaccess-accessible register address spaces */
-#define SDA_CCCR_SPACE 0x000 /* CCCR register space */
-#define SDA_F1_FBR_SPACE 0x100 /* F1 FBR register space */
-#define SDA_F2_FBR_SPACE 0x200 /* F2 FBR register space */
-#define SDA_F1_REG_SPACE 0x300 /* F1 core-specific register space */
-
-/* SDA_F1_REG_SPACE sdioaccess-accessible F1 reg space register offsets */
-#define SDA_CHIPCONTROLDATA 0x006 /* ChipControlData */
-#define SDA_CHIPCONTROLENAB 0x007 /* ChipControlEnable */
-#define SDA_F2WATERMARK 0x008 /* Function 2 Watermark */
-#define SDA_DEVICECONTROL 0x009 /* DeviceControl */
-#define SDA_SBADDRLOW 0x00a /* SbAddrLow */
-#define SDA_SBADDRMID 0x00b /* SbAddrMid */
-#define SDA_SBADDRHIGH 0x00c /* SbAddrHigh */
-#define SDA_FRAMECTRL 0x00d /* FrameCtrl */
-#define SDA_CHIPCLOCKCSR 0x00e /* ChipClockCSR */
-#define SDA_SDIOPULLUP 0x00f /* SdioPullUp */
-#define SDA_SDIOWRFRAMEBCLOW 0x019 /* SdioWrFrameBCLow */
-#define SDA_SDIOWRFRAMEBCHIGH 0x01a /* SdioWrFrameBCHigh */
-#define SDA_SDIORDFRAMEBCLOW 0x01b /* SdioRdFrameBCLow */
-#define SDA_SDIORDFRAMEBCHIGH 0x01c /* SdioRdFrameBCHigh */
-
-/* SDA_F2WATERMARK */
-#define SDA_F2WATERMARK_MASK 0x7f /* F2Watermark Mask */
-
-/* SDA_SBADDRLOW */
-#define SDA_SBADDRLOW_MASK 0x80 /* SbAddrLow Mask */
-
-/* SDA_SBADDRMID */
-#define SDA_SBADDRMID_MASK 0xff /* SbAddrMid Mask */
-
-/* SDA_SBADDRHIGH */
-#define SDA_SBADDRHIGH_MASK 0xff /* SbAddrHigh Mask */
-
-/* SDA_FRAMECTRL */
-#define SFC_RF_TERM (1 << 0) /* Read Frame Terminate */
-#define SFC_WF_TERM (1 << 1) /* Write Frame Terminate */
-#define SFC_CRC4WOOS (1 << 2) /* CRC error for write out of sync */
-#define SFC_ABORTALL (1 << 3) /* Abort all in-progress frames */
-
-/* pcmciaframectrl */
-#define PFC_RF_TERM (1 << 0) /* Read Frame Terminate */
-#define PFC_WF_TERM (1 << 1) /* Write Frame Terminate */
-
-/* intrcvlazy */
-#define IRL_TO_MASK 0x00ffffff /* timeout */
-#define IRL_FC_MASK 0xff000000 /* frame count */
-#define IRL_FC_SHIFT 24 /* frame count */
-
-/* rx header flags */
-#define RXF_CRC 0x0001 /* CRC error detected */
-#define RXF_WOOS 0x0002 /* write frame out of sync */
-#define RXF_WF_TERM 0x0004 /* write frame terminated */
-#define RXF_ABORT 0x0008 /* write frame aborted */
-#define RXF_DISCARD (RXF_CRC | RXF_WOOS | RXF_WF_TERM | RXF_ABORT)
-
-/* HW frame tag */
-#define SDPCM_FRAMETAG_LEN 4 /* 2 bytes len, 2 bytes check val */
-
-#endif /* _SBSDIO_H */
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 9b3c149..73ee785 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -41,9 +41,267 @@ extern const uint brcmf_sdio_msglevel;
/* Maximum number of I/O funcs */
#define SDIOD_MAX_IOFUNCS 7

+#define SBSDIO_NUM_FUNCTION 3 /* as of sdiod rev 0, supports 3 functions */
+
+/* function 1 miscellaneous registers */
+#define SBSDIO_SPROM_CS 0x10000 /* sprom command and status */
+#define SBSDIO_SPROM_INFO 0x10001 /* sprom info register */
+#define SBSDIO_SPROM_DATA_LOW 0x10002 /* sprom indirect access data byte 0 */
+#define SBSDIO_SPROM_DATA_HIGH 0x10003 /* sprom indirect access data byte 1 */
+#define SBSDIO_SPROM_ADDR_LOW 0x10004 /* sprom indirect access addr byte 0 */
+#define SBSDIO_SPROM_ADDR_HIGH 0x10005 /* sprom indirect access addr byte 0 */
+#define SBSDIO_CHIP_CTRL_DATA 0x10006 /* xtal_pu (gpio) output */
+#define SBSDIO_CHIP_CTRL_EN 0x10007 /* xtal_pu (gpio) enable */
+#define SBSDIO_WATERMARK 0x10008 /* rev < 7, watermark for sdio device */
+#define SBSDIO_DEVICE_CTL 0x10009 /* control busy signal generation */
+
+/* registers introduced in rev 8, some content (mask/bits) defs in sbsdpcmdev.h */
+#define SBSDIO_FUNC1_SBADDRLOW 0x1000A /* SB Address Window Low (b15) */
+#define SBSDIO_FUNC1_SBADDRMID 0x1000B /* SB Address Window Mid (b23:b16) */
+#define SBSDIO_FUNC1_SBADDRHIGH 0x1000C /* SB Address Window High (b31:b24) */
+#define SBSDIO_FUNC1_FRAMECTRL 0x1000D /* Frame Control (frame term/abort) */
+#define SBSDIO_FUNC1_CHIPCLKCSR 0x1000E /* ChipClockCSR (ALP/HT ctl/status) */
+#define SBSDIO_FUNC1_SDIOPULLUP 0x1000F /* SdioPullUp (on cmd, d0-d2) */
+#define SBSDIO_FUNC1_WFRAMEBCLO 0x10019 /* Write Frame Byte Count Low */
+#define SBSDIO_FUNC1_WFRAMEBCHI 0x1001A /* Write Frame Byte Count High */
+#define SBSDIO_FUNC1_RFRAMEBCLO 0x1001B /* Read Frame Byte Count Low */
+#define SBSDIO_FUNC1_RFRAMEBCHI 0x1001C /* Read Frame Byte Count High */
+
+#define SBSDIO_FUNC1_MISC_REG_START 0x10000 /* f1 misc register start */
+#define SBSDIO_FUNC1_MISC_REG_LIMIT 0x1001C /* f1 misc register end */
+
+/* SBSDIO_SPROM_CS */
+#define SBSDIO_SPROM_IDLE 0
+#define SBSDIO_SPROM_WRITE 1
+#define SBSDIO_SPROM_READ 2
+#define SBSDIO_SPROM_WEN 4
+#define SBSDIO_SPROM_WDS 7
+#define SBSDIO_SPROM_DONE 8
+
+/* SBSDIO_SPROM_INFO */
+#define SROM_SZ_MASK 0x03 /* SROM size, 1: 4k, 2: 16k */
+#define SROM_BLANK 0x04 /* depreciated in corerev 6 */
+#define SROM_OTP 0x80 /* OTP present */
+
+/* SBSDIO_CHIP_CTRL */
+#define SBSDIO_CHIP_CTRL_XTAL 0x01 /* or'd with onchip xtal_pu,
+ * 1: power on oscillator
+ * (for 4318 only)
+ */
+/* SBSDIO_WATERMARK */
+#define SBSDIO_WATERMARK_MASK 0x7f /* number of words - 1 for sd device
+ * to wait before sending data to host
+ */
+
+/* SBSDIO_DEVICE_CTL */
+#define SBSDIO_DEVCTL_SETBUSY 0x01 /* 1: device will assert busy signal when
+ * receiving CMD53
+ */
+#define SBSDIO_DEVCTL_SPI_INTR_SYNC 0x02 /* 1: assertion of sdio interrupt is
+ * synchronous to the sdio clock
+ */
+#define SBSDIO_DEVCTL_CA_INT_ONLY 0x04 /* 1: mask all interrupts to host
+ * except the chipActive (rev 8)
+ */
+#define SBSDIO_DEVCTL_PADS_ISO 0x08 /* 1: isolate internal sdio signals, put
+ * external pads in tri-state; requires
+ * sdio bus power cycle to clear (rev 9)
+ */
+#define SBSDIO_DEVCTL_SB_RST_CTL 0x30 /* Force SD->SB reset mapping (rev 11) */
+#define SBSDIO_DEVCTL_RST_CORECTL 0x00 /* Determined by CoreControl bit */
+#define SBSDIO_DEVCTL_RST_BPRESET 0x10 /* Force backplane reset */
+#define SBSDIO_DEVCTL_RST_NOBPRESET 0x20 /* Force no backplane reset */
+
+/* SBSDIO_FUNC1_CHIPCLKCSR */
+#define SBSDIO_FORCE_ALP 0x01 /* Force ALP request to backplane */
+#define SBSDIO_FORCE_HT 0x02 /* Force HT request to backplane */
+#define SBSDIO_FORCE_ILP 0x04 /* Force ILP request to backplane */
+#define SBSDIO_ALP_AVAIL_REQ 0x08 /* Make ALP ready (power up xtal) */
+#define SBSDIO_HT_AVAIL_REQ 0x10 /* Make HT ready (power up PLL) */
+#define SBSDIO_FORCE_HW_CLKREQ_OFF 0x20 /* Squelch clock requests from HW */
+#define SBSDIO_ALP_AVAIL 0x40 /* Status: ALP is ready */
+#define SBSDIO_HT_AVAIL 0x80 /* Status: HT is ready */
+/* In rev8, actual avail bits followed original docs */
+#define SBSDIO_Rev8_HT_AVAIL 0x40
+#define SBSDIO_Rev8_ALP_AVAIL 0x80
+
+#define SBSDIO_AVBITS (SBSDIO_HT_AVAIL | SBSDIO_ALP_AVAIL)
+#define SBSDIO_ALPAV(regval) ((regval) & SBSDIO_AVBITS)
+#define SBSDIO_HTAV(regval) (((regval) & SBSDIO_AVBITS) == SBSDIO_AVBITS)
+#define SBSDIO_ALPONLY(regval) (SBSDIO_ALPAV(regval) && !SBSDIO_HTAV(regval))
+#define SBSDIO_CLKAV(regval, alponly) (SBSDIO_ALPAV(regval) && \
+ (alponly ? 1 : SBSDIO_HTAV(regval)))
+
+/* SBSDIO_FUNC1_SDIOPULLUP */
+#define SBSDIO_PULLUP_D0 0x01 /* Enable D0/MISO pullup */
+#define SBSDIO_PULLUP_D1 0x02 /* Enable D1/INT# pullup */
+#define SBSDIO_PULLUP_D2 0x04 /* Enable D2 pullup */
+#define SBSDIO_PULLUP_CMD 0x08 /* Enable CMD/MOSI pullup */
+#define SBSDIO_PULLUP_ALL 0x0f /* All valid bits */
+
+/* function 1 OCP space */
+#define SBSDIO_SB_OFT_ADDR_MASK 0x07FFF /* sb offset addr is <= 15 bits, 32k */
+#define SBSDIO_SB_OFT_ADDR_LIMIT 0x08000
+#define SBSDIO_SB_ACCESS_2_4B_FLAG 0x08000 /* with b15, maps to 32-bit SB access */
+
+/* some duplication with sbsdpcmdev.h here */
+/* valid bits in SBSDIO_FUNC1_SBADDRxxx regs */
+#define SBSDIO_SBADDRLOW_MASK 0x80 /* Valid bits in SBADDRLOW */
+#define SBSDIO_SBADDRMID_MASK 0xff /* Valid bits in SBADDRMID */
+#define SBSDIO_SBADDRHIGH_MASK 0xffU /* Valid bits in SBADDRHIGH */
+#define SBSDIO_SBWINDOW_MASK 0xffff8000 /* Address bits from SBADDR regs */
+
+/* direct(mapped) cis space */
+#define SBSDIO_CIS_BASE_COMMON 0x1000 /* MAPPED common CIS address */
+#define SBSDIO_CIS_SIZE_LIMIT 0x200 /* maximum bytes in one CIS */
+#define SBSDIO_OTP_CIS_SIZE_LIMIT 0x078 /* maximum bytes OTP CIS */
+
+#define SBSDIO_CIS_OFT_ADDR_MASK 0x1FFFF /* cis offset addr is < 17 bits */
+
+#define SBSDIO_CIS_MANFID_TUPLE_LEN 6 /* manfid tuple length, include tuple,
+ * link bytes
+ */
+
+/* indirect cis access (in sprom) */
+#define SBSDIO_SPROM_CIS_OFFSET 0x8 /* 8 control bytes first, CIS starts from
+ * 8th byte
+ */
+
+#define SBSDIO_BYTEMODE_DATALEN_MAX 64 /* sdio byte mode: maximum length of one
+ * data command
+ */
+
+#define SBSDIO_CORE_ADDR_MASK 0x1FFFF /* sdio core function one address mask */
+
+/* corecontrol */
+#define CC_CISRDY (1 << 0) /* CIS Ready */
+#define CC_BPRESEN (1 << 1) /* CCCR RES signal */
+#define CC_F2RDY (1 << 2) /* set CCCR IOR2 bit */
+#define CC_CLRPADSISO (1 << 3) /* clear SDIO pads isolation */
+#define CC_XMTDATAAVAIL_MODE (1 << 4)
+#define CC_XMTDATAAVAIL_CTRL (1 << 5)
+
+/* corestatus */
+#define CS_PCMCIAMODE (1 << 0) /* Device Mode; 0=SDIO, 1=PCMCIA */
+#define CS_SMARTDEV (1 << 1) /* 1=smartDev enabled */
+#define CS_F2ENABLED (1 << 2) /* 1=host has enabled the device */
+
+#define PCMCIA_MES_PA_MASK 0x7fff /* PCMCIA Message Portal Address Mask */
+#define PCMCIA_MES_PM_MASK 0x7fff /* PCMCIA Message Portal Mask Mask */
+#define PCMCIA_WFBC_MASK 0xffff /* PCMCIA Write Frame Byte Count Mask */
+#define PCMCIA_UT_MASK 0x07ff /* PCMCIA Underflow Timer Mask */
+
+/* intstatus */
+#define I_SMB_SW0 (1 << 0) /* To SB Mail S/W interrupt 0 */
+#define I_SMB_SW1 (1 << 1) /* To SB Mail S/W interrupt 1 */
+#define I_SMB_SW2 (1 << 2) /* To SB Mail S/W interrupt 2 */
+#define I_SMB_SW3 (1 << 3) /* To SB Mail S/W interrupt 3 */
+#define I_SMB_SW_MASK 0x0000000f /* To SB Mail S/W interrupts mask */
+#define I_SMB_SW_SHIFT 0 /* To SB Mail S/W interrupts shift */
+#define I_HMB_SW0 (1 << 4) /* To Host Mail S/W interrupt 0 */
+#define I_HMB_SW1 (1 << 5) /* To Host Mail S/W interrupt 1 */
+#define I_HMB_SW2 (1 << 6) /* To Host Mail S/W interrupt 2 */
+#define I_HMB_SW3 (1 << 7) /* To Host Mail S/W interrupt 3 */
+#define I_HMB_SW_MASK 0x000000f0 /* To Host Mail S/W interrupts mask */
+#define I_HMB_SW_SHIFT 4 /* To Host Mail S/W interrupts shift */
+#define I_WR_OOSYNC (1 << 8) /* Write Frame Out Of Sync */
+#define I_RD_OOSYNC (1 << 9) /* Read Frame Out Of Sync */
+#define I_PC (1 << 10) /* descriptor error */
+#define I_PD (1 << 11) /* data error */
+#define I_DE (1 << 12) /* Descriptor protocol Error */
+#define I_RU (1 << 13) /* Receive descriptor Underflow */
+#define I_RO (1 << 14) /* Receive fifo Overflow */
+#define I_XU (1 << 15) /* Transmit fifo Underflow */
+#define I_RI (1 << 16) /* Receive Interrupt */
+#define I_BUSPWR (1 << 17) /* SDIO Bus Power Change (rev 9) */
+#define I_XMTDATA_AVAIL (1 << 23) /* bits in fifo */
+#define I_XI (1 << 24) /* Transmit Interrupt */
+#define I_RF_TERM (1 << 25) /* Read Frame Terminate */
+#define I_WF_TERM (1 << 26) /* Write Frame Terminate */
+#define I_PCMCIA_XU (1 << 27) /* PCMCIA Transmit FIFO Underflow */
+#define I_SBINT (1 << 28) /* sbintstatus Interrupt */
+#define I_CHIPACTIVE (1 << 29) /* chip from doze to active state */
+#define I_SRESET (1 << 30) /* CCCR RES interrupt */
+#define I_IOE2 (1U << 31) /* CCCR IOE2 Bit Changed */
+#define I_ERRORS (I_PC | I_PD | I_DE | I_RU | I_RO | I_XU)
+#define I_DMA (I_RI | I_XI | I_ERRORS)
+
+/* sbintstatus */
+#define I_SB_SERR (1 << 8) /* Backplane SError (write) */
+#define I_SB_RESPERR (1 << 9) /* Backplane Response Error (read) */
+#define I_SB_SPROMERR (1 << 10) /* Error accessing the sprom */
+
+/* sdioaccess */
+#define SDA_DATA_MASK 0x000000ff /* Read/Write Data Mask */
+#define SDA_ADDR_MASK 0x000fff00 /* Read/Write Address Mask */
+#define SDA_ADDR_SHIFT 8 /* Read/Write Address Shift */
+#define SDA_WRITE 0x01000000 /* Write bit */
+#define SDA_READ 0x00000000 /* Write bit cleared for Read */
+#define SDA_BUSY 0x80000000 /* Busy bit */
+
+/* sdioaccess-accessible register address spaces */
+#define SDA_CCCR_SPACE 0x000 /* CCCR register space */
+#define SDA_F1_FBR_SPACE 0x100 /* F1 FBR register space */
+#define SDA_F2_FBR_SPACE 0x200 /* F2 FBR register space */
+#define SDA_F1_REG_SPACE 0x300 /* F1 core-specific register space */
+
+/* SDA_F1_REG_SPACE sdioaccess-accessible F1 reg space register offsets */
+#define SDA_CHIPCONTROLDATA 0x006 /* ChipControlData */
+#define SDA_CHIPCONTROLENAB 0x007 /* ChipControlEnable */
+#define SDA_F2WATERMARK 0x008 /* Function 2 Watermark */
+#define SDA_DEVICECONTROL 0x009 /* DeviceControl */
+#define SDA_SBADDRLOW 0x00a /* SbAddrLow */
+#define SDA_SBADDRMID 0x00b /* SbAddrMid */
+#define SDA_SBADDRHIGH 0x00c /* SbAddrHigh */
+#define SDA_FRAMECTRL 0x00d /* FrameCtrl */
+#define SDA_CHIPCLOCKCSR 0x00e /* ChipClockCSR */
+#define SDA_SDIOPULLUP 0x00f /* SdioPullUp */
+#define SDA_SDIOWRFRAMEBCLOW 0x019 /* SdioWrFrameBCLow */
+#define SDA_SDIOWRFRAMEBCHIGH 0x01a /* SdioWrFrameBCHigh */
+#define SDA_SDIORDFRAMEBCLOW 0x01b /* SdioRdFrameBCLow */
+#define SDA_SDIORDFRAMEBCHIGH 0x01c /* SdioRdFrameBCHigh */
+
+/* SDA_F2WATERMARK */
+#define SDA_F2WATERMARK_MASK 0x7f /* F2Watermark Mask */
+
+/* SDA_SBADDRLOW */
+#define SDA_SBADDRLOW_MASK 0x80 /* SbAddrLow Mask */
+
+/* SDA_SBADDRMID */
+#define SDA_SBADDRMID_MASK 0xff /* SbAddrMid Mask */
+
+/* SDA_SBADDRHIGH */
+#define SDA_SBADDRHIGH_MASK 0xff /* SbAddrHigh Mask */
+
+/* SDA_FRAMECTRL */
+#define SFC_RF_TERM (1 << 0) /* Read Frame Terminate */
+#define SFC_WF_TERM (1 << 1) /* Write Frame Terminate */
+#define SFC_CRC4WOOS (1 << 2) /* CRC error for write out of sync */
+#define SFC_ABORTALL (1 << 3) /* Abort all in-progress frames */
+
+/* pcmciaframectrl */
+#define PFC_RF_TERM (1 << 0) /* Read Frame Terminate */
+#define PFC_WF_TERM (1 << 1) /* Write Frame Terminate */
+
+/* intrcvlazy */
+#define IRL_TO_MASK 0x00ffffff /* timeout */
+#define IRL_FC_MASK 0xff000000 /* frame count */
+#define IRL_FC_SHIFT 24 /* frame count */
+
+/* rx header flags */
+#define RXF_CRC 0x0001 /* CRC error detected */
+#define RXF_WOOS 0x0002 /* write frame out of sync */
+#define RXF_WF_TERM 0x0004 /* write frame terminated */
+#define RXF_ABORT 0x0008 /* write frame aborted */
+#define RXF_DISCARD (RXF_CRC | RXF_WOOS | RXF_WF_TERM | RXF_ABORT)
+
+/* HW frame tag */
+#define SDPCM_FRAMETAG_LEN 4 /* 2 bytes len, 2 bytes check val */
+
/* forward declarations */
struct brcmf_sdio_card;

+
/* Attach and build an interface to the underlying SD host driver.
* - Allocates resources (structs, arrays, mem, OS handles, etc) needed by
* brcmf_sdcard.
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 26/31] staging: brcm80211: replace occurrences of __attribute__((packed))

One of the checkpatch warning on this driver is about usage of the
__attribute__ keyword. This patch changes this to using the __packed
keyword.

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Pieter-Paul Giesberts <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/d11.h | 14 +++++++-------
drivers/staging/brcm80211/brcmsmac/main.h | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/d11.h b/drivers/staging/brcm80211/brcmsmac/d11.h
index 70d3802..e7ff0e6 100644
--- a/drivers/staging/brcm80211/brcmsmac/d11.h
+++ b/drivers/staging/brcm80211/brcmsmac/d11.h
@@ -625,7 +625,7 @@ struct ofdm_phy_hdr {
u8 rlpt[3]; /* rate, length, parity, tail */
u16 service;
u8 pad;
-} __attribute__((packed));
+} __packed;

#define D11A_PHY_HDR_GRATE(phdr) ((phdr)->rlpt[0] & 0x0f)
#define D11A_PHY_HDR_GRES(phdr) (((phdr)->rlpt[0] >> 4) & 0x01)
@@ -660,7 +660,7 @@ struct cck_phy_hdr {
u8 service;
u16 length;
u16 crc;
-} __attribute__((packed));
+} __packed;

#define D11B_PHY_HDR_LEN 6

@@ -735,7 +735,7 @@ struct d11txh {
u8 RTSPhyHeader[D11_PHY_HDR_LEN]; /* 0x2c - 0x2e */
struct ieee80211_rts rts_frame; /* 0x2f - 0x36 */
u16 PAD; /* 0x37 */
-} __attribute__((packed));
+} __packed;

#define D11_TXH_LEN 112 /* bytes */

@@ -852,7 +852,7 @@ struct tx_status {
u16 sequence;
u16 phyerr;
u16 ackphyrxsh;
-} __attribute__((packed));
+} __packed;

#define TXSTATUS_LEN 16

@@ -1245,7 +1245,7 @@ struct shm_acparams {
u16 reggap;
u16 status;
u16 rsvd[8];
-} __attribute__((packed));
+} __packed;
#define M_EDCF_QLEN (16 * 2)

#define WME_STATUS_NEWAC (1 << 8)
@@ -1306,7 +1306,7 @@ struct d11rxhdr {
u16 RxStatus2; /* extended MAC Rx status */
u16 RxTSFTime; /* RxTSFTime time of first MAC symbol + M_PHY_PLCPRX_DLY */
u16 RxChan; /* gain code, channel radio code, and phy type */
-} __attribute__((packed));
+} __packed;

#define RXHDR_LEN 24 /* sizeof struct d11rxhdr */
#define FRAMELEN(h) ((h)->RxFrameSize)
@@ -1319,7 +1319,7 @@ struct brcms_d11rxhdr {
s8 rxpwr1; /* obsoleted, place holder for legacy ROM code. use rxpwr[] */
s8 do_rssi_ma; /* do per-pkt sampling for per-antenna ma in HIGH */
s8 rxpwr[WL_RSSI_ANT_MAX]; /* rssi for supported antennas */
-} __attribute__((packed));
+} __packed;

/* PhyRxStatus_0: */
#define PRXS0_FT_MASK 0x0003 /* NPHY only: CCK, OFDM, preN, N */
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 2d0a567..f204b1f 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -438,7 +438,7 @@ struct edcf_acparam {
u8 ACI;
u8 ECW;
u16 TXOP;
-} __attribute__((packed));
+} __packed;

struct wme_param_ie {
u8 oui[3];
@@ -448,7 +448,7 @@ struct wme_param_ie {
u8 qosinfo;
u8 rsvd;
struct edcf_acparam acparam[AC_COUNT];
-} __attribute__((packed));
+} __packed;

/* virtual interface */
struct brcms_c_if {
--
1.7.4.1



2011-07-05 22:03:12

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 21/31] staging: brcm80211: merged dngl_stats.h into dhd.h

From: Roland Vossen <[email protected]>


Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 1 -
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 1 -
drivers/staging/brcm80211/brcmfmac/dhd.h | 12 ++++++++
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 1 -
drivers/staging/brcm80211/brcmfmac/dngl_stats.h | 32 ---------------------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 1 -
9 files changed, 12 insertions(+), 39 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/dngl_stats.h

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 5fdeeaf..23c2300 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -29,7 +29,6 @@
#include <soc.h>
#include "bcmsdbus.h" /* common SDIO/controller interface */
#include "sbsdio.h" /* BRCM sdio device core */
-#include "dngl_stats.h"
#include "dhd.h"
#include "dhd_bus.h"
#include "sdio_host.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index d4a380c..40c93c4 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -31,7 +31,6 @@
#include <brcmu_wifi.h>
#include "sdio_host.h"
#include "bcmsdbus.h"
-#include "dngl_stats.h"
#include "dhd.h"
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 0a3c6e5..82bf04d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -161,6 +161,18 @@ struct brcmf_event {
struct brcmf_event_msg msg;
} __packed;

+struct dngl_stats {
+ unsigned long rx_packets; /* total packets received */
+ unsigned long tx_packets; /* total packets transmitted */
+ unsigned long rx_bytes; /* total bytes received */
+ unsigned long tx_bytes; /* total bytes transmitted */
+ unsigned long rx_errors; /* bad packets received */
+ unsigned long tx_errors; /* packet transmit problems */
+ unsigned long rx_dropped; /* packets dropped by dongle */
+ unsigned long tx_dropped; /* packets dropped by dongle */
+ unsigned long multicast; /* multicast packets received */
+};
+
#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 d464606..345acab 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -22,7 +22,6 @@
#include <brcmu_utils.h>
#include <brcmu_wifi.h>

-#include "dngl_stats.h"
#include "dhd.h"
#include "dhd_proto.h"
#include "dhd_bus.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 59c2726..c37128d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -21,7 +21,6 @@
#include <defs.h>
#include <brcmu_wifi.h>
#include <brcmu_utils.h>
-#include "dngl_stats.h"
#include "dhd.h"
#include "dhd_bus.h"
#include "dhd_proto.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 1a7752d..43a5b14 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -33,7 +33,6 @@
#include <brcmu_utils.h>
#include <brcmu_wifi.h>

-#include "dngl_stats.h"
#include "dhd.h"
#include "dhd_bus.h"
#include "dhd_proto.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 077cb49..6cb922f 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -152,7 +152,6 @@ struct rte_console {

#include "sbsdio.h"

-#include "dngl_stats.h"
#include "dhd.h"
#include "dhd_bus.h"
#include "dhd_proto.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/dngl_stats.h b/drivers/staging/brcm80211/brcmfmac/dngl_stats.h
deleted file mode 100644
index 53a50f6..0000000
--- a/drivers/staging/brcm80211/brcmfmac/dngl_stats.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _dngl_stats_h_
-#define _dngl_stats_h_
-
-struct dngl_stats {
- unsigned long rx_packets; /* total packets received */
- unsigned long tx_packets; /* total packets transmitted */
- unsigned long rx_bytes; /* total bytes received */
- unsigned long tx_bytes; /* total bytes transmitted */
- unsigned long rx_errors; /* bad packets received */
- unsigned long tx_errors; /* packet transmit problems */
- unsigned long rx_dropped; /* packets dropped by dongle */
- unsigned long tx_dropped; /* packets dropped by dongle */
- unsigned long multicast; /* multicast packets received */
-};
-
-#endif /* _dngl_stats_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index f6118d1..821206d 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -31,7 +31,6 @@
#include <brcmu_utils.h>
#include <defs.h>
#include <brcmu_wifi.h>
-#include "dngl_stats.h"
#include "dhd.h"
#include "wl_cfg80211.h"

--
1.7.4.1



2011-07-05 22:03:12

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 13/31] staging: brcm80211: replaced typedef wlc_phy_t with struct brcms_phy_pub

From: Roland Vossen <[email protected]>


Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/bmac.c | 2 +-
drivers/staging/brcm80211/brcmsmac/main.h | 4 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 170 +++++++++++-----------
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h | 155 +++++++++++---------
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h | 21 ++--
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 21 ++--
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 49 ++++---
drivers/staging/brcm80211/brcmsmac/stf.c | 2 +-
drivers/staging/brcm80211/brcmsmac/types.h | 1 -
9 files changed, 223 insertions(+), 202 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index b506d16..b0446d8 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -1796,7 +1796,7 @@ void brcms_b_macphyclk_set(struct brcms_c_hw_info *wlc_hw, bool clk)

void brcms_b_phy_reset(struct brcms_c_hw_info *wlc_hw)
{
- wlc_phy_t *pih = wlc_hw->band->pi;
+ struct brcms_phy_pub *pih = wlc_hw->band->pi;
u32 phy_bw_clkbits;
bool phy_in_reset = false;

diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 1501a4b..6b8b4d2 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -369,7 +369,7 @@ struct brcms_c_band {
u16 phyrev;
u16 radioid;
u16 radiorev;
- wlc_phy_t *pi; /* pointer to phy specific information */
+ struct brcms_phy_pub *pi; /* pointer to phy specific information */
bool abgphy_encore;

u8 gmode; /* currently active gmode */
@@ -475,7 +475,7 @@ struct brcms_c_hwband {
u16 phyrev;
u16 radioid;
u16 radiorev;
- wlc_phy_t *pi; /* pointer to phy specific information */
+ struct brcms_phy_pub *pi; /* pointer to phy specific information */
bool abgphy_encore;
};

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 7c8bf17..43a1dc5 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -132,7 +132,7 @@ static void wlc_phy_cal_perical_mphase_schedule(struct brcms_phy *pi,
uint delay);

static void wlc_phy_noise_cb(struct brcms_phy *pi, u8 channel, s8 noise_dbm);
-static void wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason,
+static void wlc_phy_noise_sample_request(struct brcms_phy_pub *pih, u8 reason,
u8 ch);

static void wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi,
@@ -180,19 +180,19 @@ int phy_getintvar(struct brcms_phy *pi, const char *name)
return simple_strtoul(val, NULL, 0);
}

-void wlc_phyreg_enter(wlc_phy_t *pih)
+void wlc_phyreg_enter(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
wlapi_bmac_ucode_wake_override_phyreg_set(pi->sh->physhim);
}

-void wlc_phyreg_exit(wlc_phy_t *pih)
+void wlc_phyreg_exit(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
wlapi_bmac_ucode_wake_override_phyreg_clear(pi->sh->physhim);
}

-void wlc_radioreg_enter(wlc_phy_t *pih)
+void wlc_radioreg_enter(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
wlapi_bmac_mctrl(pi->sh->physhim, MCTL_LOCK_RADIO, MCTL_LOCK_RADIO);
@@ -200,7 +200,7 @@ void wlc_radioreg_enter(wlc_phy_t *pih)
udelay(10);
}

-void wlc_radioreg_exit(wlc_phy_t *pih)
+void wlc_radioreg_exit(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
volatile u16 dummy;
@@ -507,8 +507,9 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp)
return sh;
}

-wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
- char *vars, struct wiphy *wiphy)
+struct brcms_phy_pub *
+wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
+ char *vars, struct wiphy *wiphy)
{
struct brcms_phy *pi;
u32 sflags = 0;
@@ -584,7 +585,7 @@ wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
}
}

- wlc_phy_anacore((wlc_phy_t *) pi, ON);
+ wlc_phy_anacore((struct brcms_phy_pub *) pi, ON);

idcode = wlc_phy_get_radio_ver(pi);
pi->pubpi.radioid =
@@ -596,7 +597,7 @@ wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
if (!VALID_RADIO(pi, pi->pubpi.radioid))
goto err;

- wlc_phy_switch_radio((wlc_phy_t *) pi, OFF);
+ wlc_phy_switch_radio((struct brcms_phy_pub *) pi, OFF);

wlc_set_phy_uninitted(pi);

@@ -670,7 +671,7 @@ wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,

pi->vars = (char *)&pi->vars;

- memcpy(&pi->pubpi_ro, &pi->pubpi, sizeof(wlc_phy_t));
+ memcpy(&pi->pubpi_ro, &pi->pubpi, sizeof(struct brcms_phy_pub));

return &pi->pubpi_ro;

@@ -679,7 +680,7 @@ wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs, int bandtype,
return NULL;
}

-void wlc_phy_detach(wlc_phy_t *pih)
+void wlc_phy_detach(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -706,7 +707,7 @@ void wlc_phy_detach(wlc_phy_t *pih)
}

bool
-wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype, u16 *phyrev,
+wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype, u16 *phyrev,
u16 *radioid, u16 *radiover)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
@@ -718,13 +719,13 @@ wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype, u16 *phyrev,
return true;
}

-bool wlc_phy_get_encore(wlc_phy_t *pih)
+bool wlc_phy_get_encore(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
return pi->pubpi.abgphy_encore;
}

-u32 wlc_phy_get_coreflags(wlc_phy_t *pih)
+u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
return pi->pubpi.coreflags;
@@ -753,7 +754,7 @@ static void wlc_phy_timercb_phycal(void *arg)

}

-void wlc_phy_anacore(wlc_phy_t *pih, bool on)
+void wlc_phy_anacore(struct brcms_phy_pub *pih, bool on)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -790,7 +791,7 @@ void wlc_phy_anacore(wlc_phy_t *pih, bool on)
}
}

-u32 wlc_phy_clk_bwbits(wlc_phy_t *pih)
+u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -815,14 +816,14 @@ u32 wlc_phy_clk_bwbits(wlc_phy_t *pih)
return phy_bw_clkbits;
}

-void WLBANDINITFN(wlc_phy_por_inform) (wlc_phy_t *ppi)
+void WLBANDINITFN(wlc_phy_por_inform) (struct brcms_phy_pub *ppi)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->phy_init_por = true;
}

-void wlc_phy_edcrs_lock(wlc_phy_t *pih, bool lock)
+void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -834,14 +835,14 @@ void wlc_phy_edcrs_lock(wlc_phy_t *pih, bool lock)
write_phy_reg(pi, 0x22f, 0x3c0);
}

-void wlc_phy_initcal_enable(wlc_phy_t *pih, bool initcal)
+void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

pi->do_initcal = initcal;
}

-void wlc_phy_hw_clk_state_upd(wlc_phy_t *pih, bool newstate)
+void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *pih, bool newstate)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -851,7 +852,7 @@ void wlc_phy_hw_clk_state_upd(wlc_phy_t *pih, bool newstate)
pi->sh->clk = newstate;
}

-void wlc_phy_hw_state_upd(wlc_phy_t *pih, bool newstate)
+void wlc_phy_hw_state_upd(struct brcms_phy_pub *pih, bool newstate)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -861,7 +862,7 @@ void wlc_phy_hw_state_upd(wlc_phy_t *pih, bool newstate)
pi->sh->up = newstate;
}

-void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)
+void WLBANDINITFN(wlc_phy_init) (struct brcms_phy_pub *pih, chanspec_t chanspec)
{
u32 mc;
initfn_t phy_init = NULL;
@@ -900,7 +901,7 @@ void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)

pi->nphy_gain_boost = true;

- wlc_phy_switch_radio((wlc_phy_t *) pi, ON);
+ wlc_phy_switch_radio((struct brcms_phy_pub *) pi, ON);

(*phy_init) (pi);

@@ -912,12 +913,12 @@ void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)
if (!(ISNPHY(pi)))
wlc_phy_txpower_update_shm(pi);

- wlc_phy_ant_rxdiv_set((wlc_phy_t *) pi, pi->sh->rx_antdiv);
+ wlc_phy_ant_rxdiv_set((struct brcms_phy_pub *) pi, pi->sh->rx_antdiv);

pi->init_in_progress = false;
}

-void wlc_phy_cal_init(wlc_phy_t *pih)
+void wlc_phy_cal_init(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
initfn_t cal_init = NULL;
@@ -935,7 +936,7 @@ void wlc_phy_cal_init(wlc_phy_t *pih)
}
}

-int wlc_phy_down(wlc_phy_t *pih)
+int wlc_phy_down(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
int callbacks = 0;
@@ -1206,7 +1207,7 @@ void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on)
}
}

-void wlc_phy_hold_upd(wlc_phy_t *pih, mbool id, bool set)
+void wlc_phy_hold_upd(struct brcms_phy_pub *pih, mbool id, bool set)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -1219,7 +1220,7 @@ void wlc_phy_hold_upd(wlc_phy_t *pih, mbool id, bool set)
return;
}

-void wlc_phy_mute_upd(wlc_phy_t *pih, bool mute, mbool flags)
+void wlc_phy_mute_upd(struct brcms_phy_pub *pih, bool mute, mbool flags)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -1234,7 +1235,7 @@ void wlc_phy_mute_upd(wlc_phy_t *pih, bool mute, mbool flags)
return;
}

-void wlc_phy_clear_tssi(wlc_phy_t *pih)
+void wlc_phy_clear_tssi(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -1253,7 +1254,7 @@ static bool wlc_phy_cal_txpower_recalc_sw(struct brcms_phy *pi)
return false;
}

-void wlc_phy_switch_radio(wlc_phy_t *pih, bool on)
+void wlc_phy_switch_radio(struct brcms_phy_pub *pih, bool on)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -1296,35 +1297,35 @@ void wlc_phy_switch_radio(wlc_phy_t *pih, bool on)
}
}

-u16 wlc_phy_bw_state_get(wlc_phy_t *ppi)
+u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

return pi->bw;
}

-void wlc_phy_bw_state_set(wlc_phy_t *ppi, u16 bw)
+void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->bw = bw;
}

-void wlc_phy_chanspec_radio_set(wlc_phy_t *ppi, chanspec_t newch)
+void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi, chanspec_t newch)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
pi->radio_chanspec = newch;

}

-chanspec_t wlc_phy_chanspec_get(wlc_phy_t *ppi)
+chanspec_t wlc_phy_chanspec_get(struct brcms_phy_pub *ppi)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

return pi->radio_chanspec;
}

-void wlc_phy_chanspec_set(wlc_phy_t *ppi, chanspec_t chanspec)
+void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi, chanspec_t chanspec)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
u16 m_cur_channel;
@@ -1374,7 +1375,8 @@ int wlc_phy_chanspec_bandrange_get(struct brcms_phy *pi, chanspec_t chanspec)
return range;
}

-void wlc_phy_chanspec_ch14_widefilter_set(wlc_phy_t *ppi, bool wide_filter)
+void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
+ bool wide_filter)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

@@ -1393,7 +1395,8 @@ int wlc_phy_channel2freq(uint channel)
}

void
-wlc_phy_chanspec_band_validch(wlc_phy_t *ppi, uint band, chanvec_t *channels)
+wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
+ chanvec_t *channels)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
uint i;
@@ -1414,7 +1417,7 @@ wlc_phy_chanspec_band_validch(wlc_phy_t *ppi, uint band, chanvec_t *channels)
}
}

-chanspec_t wlc_phy_chanspec_band_firstch(wlc_phy_t *ppi, uint band)
+chanspec_t wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
uint i;
@@ -1459,7 +1462,7 @@ chanspec_t wlc_phy_chanspec_band_firstch(wlc_phy_t *ppi, uint band)
return (chanspec_t) INVCHANSPEC;
}

-int wlc_phy_txpower_get(wlc_phy_t *ppi, uint *qdbm, bool *override)
+int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm, bool *override)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

@@ -1469,7 +1472,8 @@ int wlc_phy_txpower_get(wlc_phy_t *ppi, uint *qdbm, bool *override)
return 0;
}

-void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr)
+void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
+ struct txpwr_limits *txpwr)
{
bool mac_enabled = false;
struct brcms_phy *pi = (struct brcms_phy *) ppi;
@@ -1518,7 +1522,7 @@ void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr)
wlapi_enable_mac(pi->sh->physhim);
}

-int wlc_phy_txpower_set(wlc_phy_t *ppi, uint qdbm, bool override)
+int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm, bool override)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
int i;
@@ -1554,7 +1558,7 @@ int wlc_phy_txpower_set(wlc_phy_t *ppi, uint qdbm, bool override)
}

void
-wlc_phy_txpower_sromlimit(wlc_phy_t *ppi, uint channel, u8 *min_pwr,
+wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint channel, u8 *min_pwr,
u8 *max_pwr, int txp_rate_idx)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
@@ -1604,8 +1608,8 @@ wlc_phy_txpower_sromlimit(wlc_phy_t *ppi, uint channel, u8 *min_pwr,
}

void
-wlc_phy_txpower_sromlimit_max_get(wlc_phy_t *ppi, uint chan, u8 *max_txpwr,
- u8 *min_txpwr)
+wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi, uint chan,
+ u8 *max_txpwr, u8 *min_txpwr)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
u8 tx_pwr_max = 0;
@@ -1635,20 +1639,20 @@ wlc_phy_txpower_sromlimit_max_get(wlc_phy_t *ppi, uint chan, u8 *max_txpwr,
}

void
-wlc_phy_txpower_boardlimit_band(wlc_phy_t *ppi, uint bandunit, s32 *max_pwr,
- s32 *min_pwr, u32 *step_pwr)
+wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi, uint bandunit,
+ s32 *max_pwr, s32 *min_pwr, u32 *step_pwr)
{
return;
}

-u8 wlc_phy_txpower_get_target_min(wlc_phy_t *ppi)
+u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

return pi->tx_power_min;
}

-u8 wlc_phy_txpower_get_target_max(wlc_phy_t *ppi)
+u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

@@ -1723,7 +1727,8 @@ void wlc_phy_txpower_recalc_target(struct brcms_phy *pi)

{

- wlc_phy_txpower_sromlimit((wlc_phy_t *) pi, target_chan,
+ wlc_phy_txpower_sromlimit((struct brcms_phy_pub *) pi,
+ target_chan,
&mintxpwr, &maxtxpwr, rate);

maxtxpwr = min(maxtxpwr, pi->txpwr_limit[rate]);
@@ -1926,21 +1931,21 @@ wlc_phy_txpower_reg_limit_calc(struct brcms_phy *pi, struct txpwr_limits *txpwr,
}
}

-void wlc_phy_txpwr_percent_set(wlc_phy_t *ppi, u8 txpwr_percent)
+void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi, u8 txpwr_percent)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->txpwr_percent = txpwr_percent;
}

-void wlc_phy_machwcap_set(wlc_phy_t *ppi, u32 machwcap)
+void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->sh->machwcap = machwcap;
}

-void wlc_phy_runbist_config(wlc_phy_t *ppi, bool start_end)
+void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
u16 rxc;
@@ -1971,7 +1976,7 @@ void wlc_phy_runbist_config(wlc_phy_t *ppi, bool start_end)
}

void
-wlc_phy_txpower_limit_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr,
+wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, struct txpwr_limits *txpwr,
chanspec_t chanspec)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
@@ -1996,14 +2001,14 @@ wlc_phy_txpower_limit_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr,
wlapi_enable_mac(pi->sh->physhim);
}

-void wlc_phy_ofdm_rateset_war(wlc_phy_t *pih, bool war)
+void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

pi->ofdm_rateset_war = war;
}

-void wlc_phy_bf_preempt_enable(wlc_phy_t *pih, bool bf_preempt)
+void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih, bool bf_preempt)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -2061,7 +2066,7 @@ void wlc_phy_txpower_update_shm(struct brcms_phy *pi)
}
}

-bool wlc_phy_txpower_hw_ctrl_get(wlc_phy_t *ppi)
+bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

@@ -2072,7 +2077,7 @@ bool wlc_phy_txpower_hw_ctrl_get(wlc_phy_t *ppi)
}
}

-void wlc_phy_txpower_hw_ctrl_set(wlc_phy_t *ppi, bool hwpwrctrl)
+void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi, bool hwpwrctrl)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
bool cur_hwpwrctrl = pi->hwpwrctrl;
@@ -2174,7 +2179,8 @@ static u32 wlc_phy_txpower_est_power_nphy(struct brcms_phy *pi)
}

void
-wlc_phy_txpower_get_current(wlc_phy_t *ppi, tx_power_t *power, uint channel)
+wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi, tx_power_t *power,
+ uint channel)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
uint rate, num_rates;
@@ -2215,9 +2221,9 @@ wlc_phy_txpower_get_current(wlc_phy_t *ppi, tx_power_t *power, uint channel)
u32 est_pout;

wlapi_suspend_mac_and_wait(pi->sh->physhim);
- wlc_phyreg_enter((wlc_phy_t *) pi);
+ wlc_phyreg_enter((struct brcms_phy_pub *) pi);
est_pout = wlc_phy_txpower_est_power_nphy(pi);
- wlc_phyreg_exit((wlc_phy_t *) pi);
+ wlc_phyreg_exit((struct brcms_phy_pub *) pi);
wlapi_enable_mac(pi->sh->physhim);

power->est_Pout[0] = (est_pout >> 8) & 0xff;
@@ -2271,21 +2277,21 @@ wlc_phy_txpower_get_current(wlc_phy_t *ppi, tx_power_t *power, uint channel)
}
}

-void wlc_phy_antsel_type_set(wlc_phy_t *ppi, u8 antsel_type)
+void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

pi->antsel_type = antsel_type;
}

-bool wlc_phy_test_ison(wlc_phy_t *ppi)
+bool wlc_phy_test_ison(struct brcms_phy_pub *ppi)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

return pi->phytest_on;
}

-void wlc_phy_ant_rxdiv_set(wlc_phy_t *ppi, u8 val)
+void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
bool suspend;
@@ -2359,7 +2365,7 @@ wlc_phy_noise_calc_phy(struct brcms_phy *pi, u32 *cmplx_pwr, s8 *pwr_ant)
}

static void
-wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
+wlc_phy_noise_sample_request(struct brcms_phy_pub *pih, u8 reason, u8 ch)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
@@ -2493,7 +2499,7 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)

}

-void wlc_phy_noise_sample_request_external(wlc_phy_t *pih)
+void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *pih)
{
u8 channel;

@@ -2564,7 +2570,7 @@ static s8 wlc_phy_noise_read_shmem(struct brcms_phy *pi)

}

-void wlc_phy_noise_sample_intr(wlc_phy_t *pih)
+void wlc_phy_noise_sample_intr(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
u16 jssi_aux;
@@ -2675,7 +2681,7 @@ void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_cmplx_pwr_dB, u8 core)
}
}

-void wlc_phy_rssi_compute(wlc_phy_t *pih, void *ctx)
+void wlc_phy_rssi_compute(struct brcms_phy_pub *pih, void *ctx)
{
struct brcms_d11rxhdr *wlc_rxhdr = (struct brcms_d11rxhdr *) ctx;
struct d11rxhdr *rxh = &wlc_rxhdr->rxhdr;
@@ -2724,17 +2730,17 @@ void wlc_phy_rssi_compute(wlc_phy_t *pih, void *ctx)
wlc_rxhdr->rssi = (s8) rssi;
}

-void wlc_phy_freqtrack_start(wlc_phy_t *pih)
+void wlc_phy_freqtrack_start(struct brcms_phy_pub *pih)
{
return;
}

-void wlc_phy_freqtrack_end(wlc_phy_t *pih)
+void wlc_phy_freqtrack_end(struct brcms_phy_pub *pih)
{
return;
}

-void wlc_phy_set_deaf(wlc_phy_t *ppi, bool user_flag)
+void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag)
{
struct brcms_phy *pi;
pi = (struct brcms_phy *) ppi;
@@ -2745,7 +2751,7 @@ void wlc_phy_set_deaf(wlc_phy_t *ppi, bool user_flag)
wlc_nphy_deaf_mode(pi, true);
}

-void wlc_phy_watchdog(wlc_phy_t *pih)
+void wlc_phy_watchdog(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
bool delay_phy_cal = false;
@@ -2755,7 +2761,7 @@ void wlc_phy_watchdog(wlc_phy_t *pih)
return;

if (!(SCAN_RM_IN_PROGRESS(pi) || PLT_INPROG_PHY(pi))) {
- wlc_phy_noise_sample_request((wlc_phy_t *) pi,
+ wlc_phy_noise_sample_request((struct brcms_phy_pub *) pi,
PHY_NOISE_SAMPLE_MON,
CHSPEC_CHANNEL(pi->
radio_chanspec));
@@ -2786,7 +2792,7 @@ void wlc_phy_watchdog(wlc_phy_t *pih)
(pi->nphy_perical != PHY_PERICAL_MANUAL) &&
((pi->sh->now - pi->nphy_perical_last) >=
pi->sh->glacial_timer))
- wlc_phy_cal_perical((wlc_phy_t *) pi,
+ wlc_phy_cal_perical((struct brcms_phy_pub *) pi,
PHY_PERICAL_WATCHDOG);

wlc_phy_txpwr_papd_cal_nphy(pi);
@@ -2810,7 +2816,7 @@ void wlc_phy_watchdog(wlc_phy_t *pih)
}
}

-void wlc_phy_BSSinit(wlc_phy_t *pih, bool bonlyap, int rssi)
+void wlc_phy_BSSinit(struct brcms_phy_pub *pih, bool bonlyap, int rssi)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
uint i;
@@ -2931,7 +2937,7 @@ wlc_phy_cal_perical_mphase_schedule(struct brcms_phy *pi, uint delay)
wlapi_add_timer(pi->sh->physhim, pi->phycal_timer, delay, 0);
}

-void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason)
+void wlc_phy_cal_perical(struct brcms_phy_pub *pih, u8 reason)
{
s16 nphy_currtemp = 0;
s16 delta_temp = 0;
@@ -3029,7 +3035,7 @@ u8 wlc_phy_nbits(s32 value)
return nbits;
}

-void wlc_phy_stf_chain_init(wlc_phy_t *pih, u8 txchain, u8 rxchain)
+void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -3040,7 +3046,7 @@ void wlc_phy_stf_chain_init(wlc_phy_t *pih, u8 txchain, u8 rxchain)
pi->pubpi.phy_corenum = (u8) PHY_BITSCNT(pi->sh->phyrxchain);
}

-void wlc_phy_stf_chain_set(wlc_phy_t *pih, u8 txchain, u8 rxchain)
+void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -3052,7 +3058,7 @@ void wlc_phy_stf_chain_set(wlc_phy_t *pih, u8 txchain, u8 rxchain)
pi->pubpi.phy_corenum = (u8) PHY_BITSCNT(pi->sh->phyrxchain);
}

-void wlc_phy_stf_chain_get(wlc_phy_t *pih, u8 *txchain, u8 *rxchain)
+void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain, u8 *rxchain)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;

@@ -3060,7 +3066,7 @@ void wlc_phy_stf_chain_get(wlc_phy_t *pih, u8 *txchain, u8 *rxchain)
*rxchain = pi->sh->phyrxchain;
}

-u8 wlc_phy_stf_chain_active_get(wlc_phy_t *pih)
+u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih)
{
s16 nphy_currtemp;
u8 active_bitmap;
@@ -3092,7 +3098,7 @@ u8 wlc_phy_stf_chain_active_get(wlc_phy_t *pih)
return active_bitmap;
}

-s8 wlc_phy_stf_ssmode_get(wlc_phy_t *pih, chanspec_t chanspec)
+s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih, chanspec_t chanspec)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
u8 siso_mcs_id, cdd_mcs_id;
@@ -3193,7 +3199,7 @@ static void wlc_phy_upd_env_txpwr_rate_limits(struct brcms_phy *pi, u32 band)

}

-void wlc_phy_ldpc_override_set(wlc_phy_t *ppi, bool ldpc)
+void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool ldpc)
{
return;
}
@@ -3211,7 +3217,7 @@ s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi, chanspec_t chanspec)
return rssi;
}

-bool wlc_phy_txpower_ipa_ison(wlc_phy_t *ppi)
+bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *ppi)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
index d1d03a6..a2df6b4 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
@@ -177,107 +177,118 @@ struct shared_phy_params {


extern struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
-extern wlc_phy_t *wlc_phy_attach(struct shared_phy *sh, void *regs,
+extern struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh, void *regs,
int bandtype, char *vars, struct wiphy *wiphy);
-extern void wlc_phy_detach(wlc_phy_t *ppi);
+extern void wlc_phy_detach(struct brcms_phy_pub *ppi);

-extern bool wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype,
+extern bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype,
u16 *phyrev, u16 *radioid,
u16 *radiover);
-extern bool wlc_phy_get_encore(wlc_phy_t *pih);
-extern u32 wlc_phy_get_coreflags(wlc_phy_t *pih);
+extern bool wlc_phy_get_encore(struct brcms_phy_pub *pih);
+extern u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih);

-extern void wlc_phy_hw_clk_state_upd(wlc_phy_t *ppi, bool newstate);
-extern void wlc_phy_hw_state_upd(wlc_phy_t *ppi, bool newstate);
-extern void wlc_phy_init(wlc_phy_t *ppi, chanspec_t chanspec);
-extern void wlc_phy_watchdog(wlc_phy_t *ppi);
-extern int wlc_phy_down(wlc_phy_t *ppi);
-extern u32 wlc_phy_clk_bwbits(wlc_phy_t *pih);
-extern void wlc_phy_cal_init(wlc_phy_t *ppi);
-extern void wlc_phy_antsel_init(wlc_phy_t *ppi, bool lut_init);
+extern void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *ppi, bool newstate);
+extern void wlc_phy_hw_state_upd(struct brcms_phy_pub *ppi, bool newstate);
+extern void wlc_phy_init(struct brcms_phy_pub *ppi, chanspec_t chanspec);
+extern void wlc_phy_watchdog(struct brcms_phy_pub *ppi);
+extern int wlc_phy_down(struct brcms_phy_pub *ppi);
+extern u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih);
+extern void wlc_phy_cal_init(struct brcms_phy_pub *ppi);
+extern void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init);

-extern void wlc_phy_chanspec_set(wlc_phy_t *ppi, chanspec_t chanspec);
-extern chanspec_t wlc_phy_chanspec_get(wlc_phy_t *ppi);
-extern void wlc_phy_chanspec_radio_set(wlc_phy_t *ppi, chanspec_t newch);
-extern u16 wlc_phy_bw_state_get(wlc_phy_t *ppi);
-extern void wlc_phy_bw_state_set(wlc_phy_t *ppi, u16 bw);
+extern void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi,
+ chanspec_t chanspec);
+extern chanspec_t wlc_phy_chanspec_get(struct brcms_phy_pub *ppi);
+extern void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi,
+ chanspec_t newch);
+extern u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
+extern void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);

-extern void wlc_phy_rssi_compute(wlc_phy_t *pih, void *ctx);
-extern void wlc_phy_por_inform(wlc_phy_t *ppi);
-extern void wlc_phy_noise_sample_intr(wlc_phy_t *ppi);
-extern bool wlc_phy_bist_check_phy(wlc_phy_t *ppi);
+extern void wlc_phy_rssi_compute(struct brcms_phy_pub *pih, void *ctx);
+extern void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
+extern void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
+extern bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);

-extern void wlc_phy_set_deaf(wlc_phy_t *ppi, bool user_flag);
+extern void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag);

-extern void wlc_phy_switch_radio(wlc_phy_t *ppi, bool on);
-extern void wlc_phy_anacore(wlc_phy_t *ppi, bool on);
+extern void wlc_phy_switch_radio(struct brcms_phy_pub *ppi, bool on);
+extern void wlc_phy_anacore(struct brcms_phy_pub *ppi, bool on);


-extern void wlc_phy_BSSinit(wlc_phy_t *ppi, bool bonlyap, int rssi);
+extern void wlc_phy_BSSinit(struct brcms_phy_pub *ppi, bool bonlyap, int rssi);

-extern void wlc_phy_chanspec_ch14_widefilter_set(wlc_phy_t *ppi,
+extern void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
bool wide_filter);
-extern void wlc_phy_chanspec_band_validch(wlc_phy_t *ppi, uint band,
+extern void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
chanvec_t *channels);
-extern chanspec_t wlc_phy_chanspec_band_firstch(wlc_phy_t *ppi, uint band);
+extern chanspec_t wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi,
+ uint band);

-extern void wlc_phy_txpower_sromlimit(wlc_phy_t *ppi, uint chan,
+extern void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan,
u8 *_min_, u8 *_max_, int rate);
-extern void wlc_phy_txpower_sromlimit_max_get(wlc_phy_t *ppi, uint chan,
- u8 *_max_, u8 *_min_);
-extern void wlc_phy_txpower_boardlimit_band(wlc_phy_t *ppi, uint band, s32 *,
- s32 *, u32 *);
-extern void wlc_phy_txpower_limit_set(wlc_phy_t *ppi, struct txpwr_limits *,
+extern void wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi,
+ uint chan, u8 *_max_, u8 *_min_);
+extern void wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi,
+ uint band, s32 *, s32 *, u32 *);
+extern void wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi,
+ struct txpwr_limits *,
chanspec_t chanspec);
-extern int wlc_phy_txpower_get(wlc_phy_t *ppi, uint *qdbm, bool *override);
-extern int wlc_phy_txpower_set(wlc_phy_t *ppi, uint qdbm, bool override);
-extern void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *);
-extern bool wlc_phy_txpower_hw_ctrl_get(wlc_phy_t *ppi);
-extern void wlc_phy_txpower_hw_ctrl_set(wlc_phy_t *ppi, bool hwpwrctrl);
-extern u8 wlc_phy_txpower_get_target_min(wlc_phy_t *ppi);
-extern u8 wlc_phy_txpower_get_target_max(wlc_phy_t *ppi);
-extern bool wlc_phy_txpower_ipa_ison(wlc_phy_t *pih);
-
-extern void wlc_phy_stf_chain_init(wlc_phy_t *pih, u8 txchain,
+extern int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm,
+ bool *override);
+extern int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm,
+ bool override);
+extern void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
+ struct txpwr_limits *);
+extern bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi);
+extern void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi,
+ bool hwpwrctrl);
+extern u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi);
+extern u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi);
+extern bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *pih);
+
+extern void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain,
u8 rxchain);
-extern void wlc_phy_stf_chain_set(wlc_phy_t *pih, u8 txchain,
+extern void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain,
u8 rxchain);
-extern void wlc_phy_stf_chain_get(wlc_phy_t *pih, u8 *txchain,
+extern void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain,
u8 *rxchain);
-extern u8 wlc_phy_stf_chain_active_get(wlc_phy_t *pih);
-extern s8 wlc_phy_stf_ssmode_get(wlc_phy_t *pih, chanspec_t chanspec);
-extern void wlc_phy_ldpc_override_set(wlc_phy_t *ppi, bool val);
+extern u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih);
+extern s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih,
+ chanspec_t chanspec);
+extern void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool val);

-extern void wlc_phy_cal_perical(wlc_phy_t *ppi, u8 reason);
-extern void wlc_phy_noise_sample_request_external(wlc_phy_t *ppi);
-extern void wlc_phy_edcrs_lock(wlc_phy_t *pih, bool lock);
-extern void wlc_phy_cal_papd_recal(wlc_phy_t *ppi);
+extern void wlc_phy_cal_perical(struct brcms_phy_pub *ppi, u8 reason);
+extern void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *ppi);
+extern void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock);
+extern void wlc_phy_cal_papd_recal(struct brcms_phy_pub *ppi);

-extern void wlc_phy_ant_rxdiv_set(wlc_phy_t *ppi, u8 val);
-extern void wlc_phy_clear_tssi(wlc_phy_t *ppi);
-extern void wlc_phy_hold_upd(wlc_phy_t *ppi, mbool id, bool val);
-extern void wlc_phy_mute_upd(wlc_phy_t *ppi, bool val, mbool flags);
+extern void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val);
+extern void wlc_phy_clear_tssi(struct brcms_phy_pub *ppi);
+extern void wlc_phy_hold_upd(struct brcms_phy_pub *ppi, mbool id, bool val);
+extern void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, mbool flags);

-extern void wlc_phy_antsel_type_set(wlc_phy_t *ppi, u8 antsel_type);
+extern void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type);

-extern void wlc_phy_txpower_get_current(wlc_phy_t *ppi, tx_power_t *power,
- uint channel);
+extern void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi,
+ tx_power_t *power, uint channel);

-extern void wlc_phy_initcal_enable(wlc_phy_t *pih, bool initcal);
-extern bool wlc_phy_test_ison(wlc_phy_t *ppi);
-extern void wlc_phy_txpwr_percent_set(wlc_phy_t *ppi, u8 txpwr_percent);
-extern void wlc_phy_ofdm_rateset_war(wlc_phy_t *pih, bool war);
-extern void wlc_phy_bf_preempt_enable(wlc_phy_t *pih, bool bf_preempt);
-extern void wlc_phy_machwcap_set(wlc_phy_t *ppi, u32 machwcap);
+extern void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal);
+extern bool wlc_phy_test_ison(struct brcms_phy_pub *ppi);
+extern void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi,
+ u8 txpwr_percent);
+extern void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war);
+extern void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih,
+ bool bf_preempt);
+extern void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap);

-extern void wlc_phy_runbist_config(wlc_phy_t *ppi, bool start_end);
+extern void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end);

-extern void wlc_phy_freqtrack_start(wlc_phy_t *ppi);
-extern void wlc_phy_freqtrack_end(wlc_phy_t *ppi);
+extern void wlc_phy_freqtrack_start(struct brcms_phy_pub *ppi);
+extern void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);

extern const u8 *wlc_phy_get_ofdm_rate_lookup(void);

-extern s8 wlc_phy_get_tx_power_offset_by_mcs(wlc_phy_t *ppi,
+extern s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
u8 mcs_offset);
-extern s8 wlc_phy_get_tx_power_offset(wlc_phy_t *ppi, u8 tbl_offset);
+extern s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
#endif /* _BRCM_PHY_HAL_H_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
index 6e4c2b1..4659503 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
@@ -565,7 +565,7 @@ struct shared_phy {
bool _rifs_phy;
};

-struct phy_pub {
+struct brcms_phy_pub {
uint phy_type;
uint phy_rev;
u8 phy_corenum;
@@ -594,7 +594,7 @@ struct phy_func_ptr {
};

struct brcms_phy {
- wlc_phy_t pubpi_ro;
+ struct brcms_phy_pub pubpi_ro;
struct shared_phy *sh;
struct phy_func_ptr pi_fptr;
void *pi_ptr;
@@ -607,7 +607,7 @@ struct brcms_phy {
d11regs_t *regs;
struct brcms_phy *next;
char *vars;
- wlc_phy_t pubpi;
+ struct brcms_phy_pub pubpi;

bool do_initcal;
bool phytest_on;
@@ -1002,10 +1002,10 @@ extern void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask);

extern void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);

-extern void wlc_phyreg_enter(wlc_phy_t *pih);
-extern void wlc_phyreg_exit(wlc_phy_t *pih);
-extern void wlc_radioreg_enter(wlc_phy_t *pih);
-extern void wlc_radioreg_exit(wlc_phy_t *pih);
+extern void wlc_phyreg_enter(struct brcms_phy_pub *pih);
+extern void wlc_phyreg_exit(struct brcms_phy_pub *pih);
+extern void wlc_radioreg_enter(struct brcms_phy_pub *pih);
+extern void wlc_radioreg_exit(struct brcms_phy_pub *pih);

extern void wlc_phy_read_table(struct brcms_phy *pi,
const struct phytbl_info *ptbl_info,
@@ -1125,7 +1125,7 @@ extern void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi);
extern s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
extern void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr,
s8 *cck_pwr);
-extern void wlc_lcnphy_tx_power_adjustment(wlc_phy_t *ppi);
+extern void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi);

extern s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);

@@ -1185,8 +1185,9 @@ extern void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
struct nphy_iq_comp *comp);
extern void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi);

-extern void wlc_phy_rxcore_setstate_nphy(wlc_phy_t *pih, u8 rxcore_bitmask);
-extern u8 wlc_phy_rxcore_getstate_nphy(wlc_phy_t *pih);
+extern void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih,
+ u8 rxcore_bitmask);
+extern u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih);

extern void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type);
extern void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index 0c9ceb7..70e79fc 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -991,7 +991,7 @@ static bool wlc_lcnphy_rx_iq_est(struct brcms_phy *pi, u16 num_samps,
static bool wlc_lcnphy_calc_rx_iq_comp(struct brcms_phy *pi, u16 num_samps);
static u16 wlc_lcnphy_get_pa_gain(struct brcms_phy *pi);
static void wlc_lcnphy_afe_clk_init(struct brcms_phy *pi, u8 mode);
-extern void wlc_lcnphy_tx_pwr_ctrl_init(wlc_phy_t *ppi);
+extern void wlc_lcnphy_tx_pwr_ctrl_init(struct brcms_phy_pub *ppi);
static void wlc_lcnphy_radio_2064_channel_tune_4313(struct brcms_phy *pi,
u8 channel);

@@ -1210,7 +1210,7 @@ void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi, chanspec_t chanspec)
{
u8 channel = CHSPEC_CHANNEL(chanspec);

- wlc_phy_chanspec_radio_set((wlc_phy_t *) pi, chanspec);
+ wlc_phy_chanspec_radio_set((struct brcms_phy_pub *) pi, chanspec);

wlc_lcnphy_set_chanspec_tweaks(pi, pi->radio_chanspec);

@@ -2067,7 +2067,7 @@ wlc_lcnphy_tx_iqlo_cal(struct brcms_phy *pi,

}

-static void wlc_lcnphy_idle_tssi_est(wlc_phy_t *ppi)
+static void wlc_lcnphy_idle_tssi_est(struct brcms_phy_pub *ppi)
{
bool suspend, tx_gain_override_old;
struct lcnphy_txgains old_gains;
@@ -2275,7 +2275,7 @@ static void wlc_lcnphy_vbat_temp_sense_setup(struct brcms_phy *pi, u8 mode)
udelay(999);
}

-void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (wlc_phy_t *ppi)
+void WLBANDINITFN(wlc_lcnphy_tx_pwr_ctrl_init) (struct brcms_phy_pub *ppi)
{
struct lcnphy_txgains tx_gains;
u8 bbmult;
@@ -3501,7 +3501,7 @@ static void wlc_lcnphy_periodic_cal(struct brcms_phy *pi)

if (wlc_lcnphy_tssi_based_pwr_ctrl_enabled(pi)) {

- wlc_lcnphy_idle_tssi_est((wlc_phy_t *) pi);
+ wlc_lcnphy_idle_tssi_est((struct brcms_phy_pub *) pi);

b0 = pi->txpa_2g[0];
b1 = pi->txpa_2g[1];
@@ -3563,7 +3563,8 @@ void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode)
break;
case LCNPHY_PERICAL_TEMPBASED_TXPWRCTRL:
if (wlc_lcnphy_tempsense_based_pwr_ctrl_enabled(pi))
- wlc_lcnphy_tx_power_adjustment((wlc_phy_t *) pi);
+ wlc_lcnphy_tx_power_adjustment(
+ (struct brcms_phy_pub *) pi);
break;
}
}
@@ -3649,7 +3650,7 @@ wlc_lcnphy_set_chanspec_tweaks(struct brcms_phy *pi, chanspec_t chanspec)
write_phy_reg(pi, 0x44a, 0x80);
}

-void wlc_lcnphy_tx_power_adjustment(wlc_phy_t *ppi)
+void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi)
{
s8 index;
u16 index2;
@@ -3705,9 +3706,9 @@ void WLBANDINITFN(wlc_phy_init_lcnphy) (struct brcms_phy *pi)
wlc_lcnphy_radio_init(pi);

if (CHSPEC_IS2G(pi->radio_chanspec))
- wlc_lcnphy_tx_pwr_ctrl_init((wlc_phy_t *) pi);
+ wlc_lcnphy_tx_pwr_ctrl_init((struct brcms_phy_pub *) pi);

- wlc_phy_chanspec_set((wlc_phy_t *) pi, pi->radio_chanspec);
+ wlc_phy_chanspec_set((struct brcms_phy_pub *) pi, pi->radio_chanspec);

si_pmu_regcontrol(pi->sh->sih, 0, 0xf, 0x9);

@@ -4808,7 +4809,7 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(struct brcms_phy *pi)
pi_lcn->lcnphy_freqoffset_corr =
(u8) PHY_GETINTVAR(pi, "freqoffset_corr");
if ((u8) getintvar(pi->vars, "aa2g") > 1)
- wlc_phy_ant_rxdiv_set((wlc_phy_t *) pi,
+ wlc_phy_ant_rxdiv_set((struct brcms_phy_pub *) pi,
(u8) getintvar(pi->vars,
"aa2g"));
}
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index 6e2417e..bc66c7f 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -14194,7 +14194,7 @@ static void wlc_phy_runsamples_nphy(struct brcms_phy *pi, u16 n, u16 lps,
u16 wait, u8 iq, u8 dac_test_mode,
bool modify_bbmult);

-bool wlc_phy_bist_check_phy(wlc_phy_t *pih)
+bool wlc_phy_bist_check_phy(struct brcms_phy_pub *pih)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
u32 phybist0, phybist1, phybist2, phybist3, phybist4;
@@ -14832,7 +14832,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (struct brcms_phy *pi)
}

if (pi->sh->phyrxchain != 0x3) {
- wlc_phy_rxcore_setstate_nphy((wlc_phy_t *) pi,
+ wlc_phy_rxcore_setstate_nphy((struct brcms_phy_pub *) pi,
pi->sh->phyrxchain);
}

@@ -14871,7 +14871,8 @@ void WLBANDINITFN(wlc_phy_init_nphy) (struct brcms_phy *pi)
target_gain = wlc_phy_get_tx_gain_nphy(pi);

if (pi->antsel_type == ANTSEL_2x3)
- wlc_phy_antsel_init((wlc_phy_t *) pi, true);
+ wlc_phy_antsel_init((struct brcms_phy_pub *) pi,
+ true);

if (pi->nphy_perical != PHY_PERICAL_MPHASE) {
wlc_phy_rssi_cal_nphy(pi);
@@ -14901,7 +14902,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (struct brcms_phy *pi)
} else if (pi->mphase_cal_phase_id ==
MPHASE_CAL_STATE_IDLE) {

- wlc_phy_cal_perical((wlc_phy_t *) pi,
+ wlc_phy_cal_perical((struct brcms_phy_pub *) pi,
PHY_PERICAL_PHYINIT);
}
} else {
@@ -15024,7 +15025,7 @@ void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi)
}
}

-void wlc_phy_rxcore_setstate_nphy(wlc_phy_t *pih, u8 rxcore_bitmask)
+void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih, u8 rxcore_bitmask)
{
u16 regval;
u16 tbl_buf[16];
@@ -15105,7 +15106,7 @@ void wlc_phy_rxcore_setstate_nphy(wlc_phy_t *pih, u8 rxcore_bitmask)
wlapi_enable_mac(pi->sh->physhim);
}

-u8 wlc_phy_rxcore_getstate_nphy(wlc_phy_t *pih)
+u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih)
{
u16 regval, rxen_bits;
struct brcms_phy *pi = (struct brcms_phy *) pih;
@@ -17281,14 +17282,14 @@ void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on)
wlc_phy_radio_postinit_2057(pi);
}

- wlc_phy_chanspec_set((wlc_phy_t *) pi,
+ wlc_phy_chanspec_set((struct brcms_phy_pub *) pi,
pi->radio_chanspec);
} else if (NREV_GE(pi->pubpi.phy_rev, 3)) {
wlc_phy_radio_preinit_205x(pi);
wlc_phy_radio_init_2056(pi);
wlc_phy_radio_postinit_2056(pi);

- wlc_phy_chanspec_set((wlc_phy_t *) pi,
+ wlc_phy_chanspec_set((struct brcms_phy_pub *) pi,
pi->radio_chanspec);
} else {
wlc_phy_radio_preinit_2055(pi);
@@ -17406,7 +17407,7 @@ static void wlc_phy_radio_postinit_2055(struct brcms_phy *pi)
and_radio_reg(pi, RADIO_2055_CAL_LPO_CNTRL,
~(RADIO_2055_CAL_LPO_ENABLE));

- wlc_phy_chanspec_set((wlc_phy_t *) pi, pi->radio_chanspec);
+ wlc_phy_chanspec_set((struct brcms_phy_pub *) pi, pi->radio_chanspec);

write_radio_reg(pi, RADIO_2055_CORE1_RXBB_LPF, 9);
write_radio_reg(pi, RADIO_2055_CORE2_RXBB_LPF, 9);
@@ -19065,7 +19066,7 @@ void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, chanspec_t chanspec)
(pi, CHSPEC_CHANNEL(chanspec), &freq, &t0, &t1, &t2, &t3))
return;

- wlc_phy_chanspec_radio_set((wlc_phy_t *) pi, chanspec);
+ wlc_phy_chanspec_radio_set((struct brcms_phy_pub *) pi, chanspec);

if (CHSPEC_BW(chanspec) != pi->bw)
wlapi_bmac_bw_set(pi->sh->physhim, CHSPEC_BW(chanspec));
@@ -19480,7 +19481,7 @@ static void wlc_phy_restorecal_nphy(struct brcms_phy *pi)
}
}

-void wlc_phy_antsel_init(wlc_phy_t *ppi, bool lut_init)
+void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init)
{
struct brcms_phy *pi = (struct brcms_phy *) ppi;
u16 mask = 0xfc00;
@@ -21784,7 +21785,8 @@ static void wlc_phy_rssi_cal_nphy_rev3(struct brcms_phy *pi)
}
}

- rxcore_state = wlc_phy_rxcore_getstate_nphy((wlc_phy_t *) pi);
+ rxcore_state = wlc_phy_rxcore_getstate_nphy(
+ (struct brcms_phy_pub *) pi);

vcm_level_max = 8;

@@ -23774,7 +23776,7 @@ void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype)

wlapi_suspend_mac_and_wait(pi->sh->physhim);

- wlc_phyreg_enter((wlc_phy_t *) pi);
+ wlc_phyreg_enter((struct brcms_phy_pub *) pi);

if ((pi->mphase_cal_phase_id == MPHASE_CAL_STATE_IDLE) ||
(pi->mphase_cal_phase_id == MPHASE_CAL_STATE_INIT)) {
@@ -23797,7 +23799,7 @@ void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype)
wlc_phy_txpwrctrl_enable_nphy(pi, PHY_TPC_HW_OFF);

if (pi->antsel_type == ANTSEL_2x3)
- wlc_phy_antsel_init((wlc_phy_t *) pi, true);
+ wlc_phy_antsel_init((struct brcms_phy_pub *) pi, true);

mphase = (pi->mphase_cal_phase_id != MPHASE_CAL_STATE_IDLE);
if (!mphase) {
@@ -23814,12 +23816,12 @@ void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype)
if (PHY_IPA(pi))
wlc_phy_a4(pi, true);

- wlc_phyreg_exit((wlc_phy_t *) pi);
+ wlc_phyreg_exit((struct brcms_phy_pub *) pi);
wlapi_enable_mac(pi->sh->physhim);
wlapi_bmac_write_shm(pi->sh->physhim, M_CTS_DURATION,
10000);
wlapi_suspend_mac_and_wait(pi->sh->physhim);
- wlc_phyreg_enter((wlc_phy_t *) pi);
+ wlc_phyreg_enter((struct brcms_phy_pub *) pi);

if (0 == wlc_phy_cal_rxiq_nphy(pi, target_gain,
(pi->
@@ -23984,7 +23986,7 @@ void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype)
}

wlc_phy_txpwrctrl_enable_nphy(pi, tx_pwr_ctrl_state);
- wlc_phyreg_exit((wlc_phy_t *) pi);
+ wlc_phyreg_exit((struct brcms_phy_pub *) pi);
wlapi_enable_mac(pi->sh->physhim);
}

@@ -25694,7 +25696,8 @@ static int wlc_phy_cal_rxiq_nphy_rev3(struct brcms_phy *pi,

wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_RFSEQ, 2, 0x110, 16, cal_gain);

- rxcore_state = wlc_phy_rxcore_getstate_nphy((wlc_phy_t *) pi);
+ rxcore_state = wlc_phy_rxcore_getstate_nphy(
+ (struct brcms_phy_pub *) pi);

for (rx_core = 0; rx_core < pi->pubpi.phy_corenum; rx_core++) {

@@ -25729,8 +25732,8 @@ static int wlc_phy_cal_rxiq_nphy_rev3(struct brcms_phy *pi,
if (rx_core == PHY_CORE_1) {

if (rxcore_state == 1) {
- wlc_phy_rxcore_setstate_nphy((wlc_phy_t
- *) pi, 3);
+ wlc_phy_rxcore_setstate_nphy(
+ (struct brcms_phy_pub *) pi, 3);
}

wlc_phy_rxcal_gainctrl_nphy(pi, rx_core, NULL,
@@ -25741,9 +25744,9 @@ static int wlc_phy_cal_rxiq_nphy_rev3(struct brcms_phy *pi,
pi->nphy_rccal_value = best_rccal[rx_core];

if (rxcore_state == 1) {
- wlc_phy_rxcore_setstate_nphy((wlc_phy_t
- *) pi,
- rxcore_state);
+ wlc_phy_rxcore_setstate_nphy(
+ (struct brcms_phy_pub *) pi,
+ rxcore_state);
}
}
}
diff --git a/drivers/staging/brcm80211/brcmsmac/stf.c b/drivers/staging/brcm80211/brcmsmac/stf.c
index d83d3a3..3d5979b 100644
--- a/drivers/staging/brcm80211/brcmsmac/stf.c
+++ b/drivers/staging/brcm80211/brcmsmac/stf.c
@@ -72,7 +72,7 @@ static void brcms_c_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val)
/* every WLC_TEMPSENSE_PERIOD seconds temperature check to decide whether to turn on/off txchain */
void brcms_c_tempsense_upd(struct brcms_c_info *wlc)
{
- wlc_phy_t *pi = wlc->band->pi;
+ struct brcms_phy_pub *pi = wlc->band->pi;
uint active_chains, txchain;

/* Check if the chip is too hot. Disable one Tx chain, if it is */
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index 32eb429..9e9fe56 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -385,7 +385,6 @@ typedef struct brcms_rateset wlc_rateset_t;
typedef u32 ratespec_t;
typedef struct tx_power tx_power_t;
typedef struct chanvec chanvec_t;
-typedef struct phy_pub wlc_phy_t;
typedef s32 fixed;
typedef struct _cs32 cs32;
typedef volatile union pmqreg pmqreg_t;
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 16/31] staging: brcm80211: remove checkpatch warnings 'suspect code indent'

The driver sources contained a couple of checkpatch warnings of the
given class. These have been cleaned up.

Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 3 +--
drivers/staging/brcm80211/brcmsmac/bmac.c | 4 ----
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 3 +--
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 5 +----
4 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 17a6bf0..12c6ee3 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -3605,8 +3605,7 @@ brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,

e->etype = event;
memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));
- if (data) {
- }
+
brcmf_lock_eq(cfg_priv);
list_add_tail(&e->eq_list, &cfg_priv->eq_list);
brcmf_unlock_eq(cfg_priv);
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index 6f1203c..412611e 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -318,10 +318,6 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
brcms_c_update_beacon(wlc);
}

- /* PMQ entry addition */
- if (macintstatus & MI_PMQ) {
- }
-
/* tx status */
if (macintstatus & MI_TFS) {
if (brcms_b_txstatus(wlc->hw, bounded, &fatal))
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 8850d6d..c4e9069 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -2249,8 +2249,7 @@ wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi, struct tx_power *power,

power->tx_power_max_rate_ind[0] = pi->tx_power_max_rate_ind;
power->tx_power_max_rate_ind[1] = pi->tx_power_max_rate_ind;
- } else if (!pi->hwpwrctrl) {
- } else if (pi->sh->up) {
+ } else if (pi->hwpwrctrl && pi->sh->up) {

wlc_phyreg_enter(ppi);
if (ISLCNPHY(pi)) {
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index bc66c7f..151dc3c 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -20996,10 +20996,8 @@ s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi)
write_radio_reg(pi, RADIO_2056_SYN_TEMPPROCSENSE, 0x01);

wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp, 1);
- if (NREV_GE(pi->pubpi.phy_rev, 7)) {
- } else {
+ if (NREV_LT(pi->pubpi.phy_rev, 7))
write_radio_reg(pi, RADIO_2056_SYN_TEMPPROCSENSE, 0x05);
- }

wlc_phy_poll_rssi_nphy(pi, NPHY_RSSI_SEL_IQ, radio_temp2, 1);
if (NREV_GE(pi->pubpi.phy_rev, 7)) {
@@ -24578,7 +24576,6 @@ static void wlc_phy_calc_rx_iq_comp_nphy(struct brcms_phy *pi, u8 core_mask)
}

new_comp = old_comp;
- } else if (cal_retry > 0) {
}

wlc_phy_rx_iq_coeffs_nphy(pi, 1, &new_comp);
--
1.7.4.1



2011-07-05 22:03:15

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 18/31] staging: brcm80211: remove checkpatch warnings from phy_n.c

The source file phy_n.c had couple of checkpatch warnings that
have been fixed in this patch.

Reviewed-by: Roland Vossen <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 51 ++++++++++-------------
1 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index 151dc3c..2a8c9ff 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -14705,12 +14705,10 @@ void WLBANDINITFN(wlc_phy_init_nphy) (struct brcms_phy *pi)
tx_pwrctrl_tbl = wlc_phy_get_ipa_gaintbl_nphy(pi);
} else {
if (CHSPEC_IS5G(pi->radio_chanspec)) {
- if NREV_IS
- (pi->pubpi.phy_rev, 3) {
+ if (NREV_IS(pi->pubpi.phy_rev, 3)) {
tx_pwrctrl_tbl =
nphy_tpc_5GHz_txgain_rev3;
- } else if NREV_IS
- (pi->pubpi.phy_rev, 4) {
+ } else if (NREV_IS(pi->pubpi.phy_rev, 4)) {
tx_pwrctrl_tbl =
(pi->srom_fem5g.extpagain == 3) ?
nphy_tpc_5GHz_txgain_HiPwrEPA :
@@ -22515,21 +22513,21 @@ struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi)
}
}
} else {
+ uint phyrev = pi->pubpi.phy_rev;
+
base_idx[0] = (read_phy_reg(pi, 0x1ed) >> 8) & 0x7f;
base_idx[1] = (read_phy_reg(pi, 0x1ee) >> 8) & 0x7f;
for (core_no = 0; core_no < 2; core_no++) {
- if (NREV_GE(pi->pubpi.phy_rev, 3)) {
+ if (NREV_GE(phyrev, 3)) {
if (PHY_IPA(pi)) {
tx_pwrctrl_tbl =
wlc_phy_get_ipa_gaintbl_nphy(pi);
} else {
if (CHSPEC_IS5G(pi->radio_chanspec)) {
- if NREV_IS
- (pi->pubpi.phy_rev, 3) {
+ if (NREV_IS(phyrev, 3)) {
tx_pwrctrl_tbl =
nphy_tpc_5GHz_txgain_rev3;
- } else if NREV_IS
- (pi->pubpi.phy_rev, 4) {
+ } else if (NREV_IS(phyrev, 4)) {
tx_pwrctrl_tbl =
(pi->srom_fem5g.
extpagain ==
@@ -22542,8 +22540,7 @@ struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi)
nphy_tpc_5GHz_txgain_rev5;
}
} else {
- if (NREV_GE
- (pi->pubpi.phy_rev, 7)) {
+ if (NREV_GE(phyrev, 7)) {
if (pi->pubpi.
radiorev == 3) {
tx_pwrctrl_tbl =
@@ -22556,9 +22553,7 @@ struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi)
}

} else {
- if (NREV_GE
- (pi->pubpi.phy_rev,
- 5)
+ if (NREV_GE(phyrev, 5)
&& (pi->srom_fem2g.
extpagain ==
3)) {
@@ -22571,8 +22566,7 @@ struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi)
}
}
}
- if NREV_GE
- (pi->pubpi.phy_rev, 7) {
+ if (NREV_GE(phyrev, 7)) {
target_gain.ipa[core_no] =
(tx_pwrctrl_tbl[base_idx[core_no]]
>> 16) & 0x7;
@@ -27449,20 +27443,20 @@ void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi)
pi->nphy_txpwrindex[PHY_CORE_1].index_internal_save = txpi[1];

for (core = 0; core < pi->pubpi.phy_corenum; core++) {
- if (NREV_GE(pi->pubpi.phy_rev, 3)) {
+ uint phyrev = pi->pubpi.phy_rev;
+
+ if (NREV_GE(phyrev, 3)) {
if (PHY_IPA(pi)) {
u32 *tx_gaintbl =
wlc_phy_get_ipa_gaintbl_nphy(pi);
txgain = tx_gaintbl[txpi[core]];
} else {
if (CHSPEC_IS5G(pi->radio_chanspec)) {
- if NREV_IS
- (pi->pubpi.phy_rev, 3) {
+ if (NREV_IS(phyrev, 3)) {
txgain =
nphy_tpc_5GHz_txgain_rev3
[txpi[core]];
- } else if NREV_IS
- (pi->pubpi.phy_rev, 4) {
+ } else if (NREV_IS(phyrev, 4)) {
txgain =
(pi->srom_fem5g.extpagain ==
3) ?
@@ -27476,7 +27470,7 @@ void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi)
[txpi[core]];
}
} else {
- if (NREV_GE(pi->pubpi.phy_rev, 5) &&
+ if (NREV_GE(phyrev, 5) &&
(pi->srom_fem2g.extpagain == 3)) {
txgain =
nphy_tpc_txgain_HiPwrEPA
@@ -27492,20 +27486,19 @@ void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi)
txgain = nphy_tpc_txgain[txpi[core]];
}

- if (NREV_GE(pi->pubpi.phy_rev, 3)) {
+ if (NREV_GE(phyrev, 3))
rad_gain = (txgain >> 16) & ((1 << (32 - 16 + 1)) - 1);
- } else {
+ else
rad_gain = (txgain >> 16) & ((1 << (28 - 16 + 1)) - 1);
- }

- if (NREV_GE(pi->pubpi.phy_rev, 7)) {
+ if (NREV_GE(phyrev, 7))
dac_gain = (txgain >> 8) & ((1 << (10 - 8 + 1)) - 1);
- } else {
+ else
dac_gain = (txgain >> 8) & ((1 << (13 - 8 + 1)) - 1);
- }
+
bbmult = (txgain >> 0) & ((1 << (7 - 0 + 1)) - 1);

- if (NREV_GE(pi->pubpi.phy_rev, 3)) {
+ if (NREV_GE(phyrev, 3)) {
mod_phy_reg(pi, ((core == PHY_CORE_0) ? 0x8f :
0xa5), (0x1 << 8), (0x1 << 8));
} else {
--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 27/31] staging: brcm80211: remove several externs from dhd_linux.c

The script checkpatch.pl flagged for some extern variables in
dhd_linux.c source. Several have been fixed in this patch. Two
remaining are in macro conditional code that needs cleanup so
they are not resolved here.

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

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index a94152e..653cf0d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -29,6 +29,13 @@
* 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;
+
/* Watchdog timer interval */
extern uint brcmf_watchdog_ms;

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 43a5b14..380447f 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -113,7 +113,6 @@ module_param(brcmf_pkt_filter_init, uint, 0);
uint brcmf_master_mode = true;
module_param(brcmf_master_mode, uint, 1);

-extern int brcmf_dongle_memsize;
module_param(brcmf_dongle_memsize, int, 0);

/* Contorl fw roaming */
@@ -148,8 +147,6 @@ uint brcmf_sdiod_drive_strength = 6;
module_param(brcmf_sdiod_drive_strength, uint, 0);

/* Tx/Rx bounds */
-extern uint brcmf_txbound;
-extern uint brcmf_rxbound;
module_param(brcmf_txbound, uint, 0);
module_param(brcmf_rxbound, uint, 0);

--
1.7.4.1



2011-07-05 22:03:12

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 06/31] staging: brcm80211: removed asserts from bcmsdh.c

From: Roland Vossen <[email protected]>

Reviewed-by: Franky (Zhenhui) Lin <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 36 ---------------------------
1 files changed, 0 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index cecb291..97c0f9d 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -119,30 +119,22 @@ brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,

int brcmf_sdcard_intr_enable(struct brcmf_sdio_card *card)
{
- ASSERT(card);
-
return brcmf_sdioh_interrupt_set(card->sdioh, true);
}

int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card)
{
- ASSERT(card);
-
return brcmf_sdioh_interrupt_set(card->sdioh, false);
}

int brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card,
void (*fn)(void *), void *argh)
{
- ASSERT(card);
-
return brcmf_sdioh_interrupt_register(card->sdioh, fn, argh);
}

int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card)
{
- ASSERT(card);
-
return brcmf_sdioh_interrupt_deregister(card->sdioh);
}

@@ -158,8 +150,6 @@ u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_card *card, uint fnc_num, u32 addr,
if (!card)
card = l_card;

- ASSERT(card->init_success);
-
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
do {
if (retry) /* wait for 1 ms till bus get settled down */
@@ -193,8 +183,6 @@ brcmf_sdcard_cfg_write(struct brcmf_sdio_card *card, uint fnc_num, u32 addr,
if (!card)
card = l_card;

- ASSERT(card->init_success);
-
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
do {
if (retry) /* wait for 1 ms till bus get settled down */
@@ -223,8 +211,6 @@ u32 brcmf_sdcard_cfg_read_word(struct brcmf_sdio_card *card, uint fnc_num,
if (!card)
card = l_card;

- ASSERT(card->init_success);
-
status = brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_READ, fnc_num, addr, &data, 4);

@@ -246,8 +232,6 @@ brcmf_sdcard_cfg_write_word(struct brcmf_sdio_card *card, uint fnc_num,
if (!card)
card = l_card;

- ASSERT(card->init_success);
-
status =
brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_WRITE, fnc_num, addr, &data, 4);
@@ -272,10 +256,6 @@ int brcmf_sdcard_cis_read(struct brcmf_sdio_card *card, uint func, u8 * cis,
if (!card)
card = l_card;

- ASSERT(card->init_success);
- ASSERT(cis);
- ASSERT(length <= SBSDIO_CIS_SIZE_LIMIT);
-
status = brcmf_sdioh_cis_read(card->sdioh, func, cis, length);

if (ascii) {
@@ -330,8 +310,6 @@ u32 brcmf_sdcard_reg_read(struct brcmf_sdio_card *card, u32 addr, uint size)
if (!card)
card = l_card;

- ASSERT(card->init_success);
-
if (bar0 != card->sbwad) {
if (brcmf_sdcard_set_sbaddr_window(card, bar0))
return 0xFFFFFFFF;
@@ -384,8 +362,6 @@ u32 brcmf_sdcard_reg_write(struct brcmf_sdio_card *card, u32 addr, uint size,
if (!card)
card = l_card;

- ASSERT(card->init_success);
-
if (bar0 != card->sbwad) {
err = brcmf_sdcard_set_sbaddr_window(card, bar0);
if (err)
@@ -429,14 +405,10 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;

- ASSERT(card);
- ASSERT(card->init_success);
-
BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
__func__, fn, addr, nbytes));

/* Async not implemented yet */
- ASSERT(!(flags & SDIO_REQ_ASYNC));
if (flags & SDIO_REQ_ASYNC)
return -ENOTSUPP;

@@ -473,14 +445,10 @@ brcmf_sdcard_send_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;

- ASSERT(card);
- ASSERT(card->init_success);
-
BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
__func__, fn, addr, nbytes));

/* Async not implemented yet */
- ASSERT(!(flags & SDIO_REQ_ASYNC));
if (flags & SDIO_REQ_ASYNC)
return -ENOTSUPP;

@@ -506,10 +474,6 @@ brcmf_sdcard_send_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
int brcmf_sdcard_rwdata(struct brcmf_sdio_card *card, uint rw, u32 addr,
u8 *buf, uint nbytes)
{
- ASSERT(card);
- ASSERT(card->init_success);
- ASSERT((addr & SBSDIO_SBWINDOW_MASK) == 0);
-
addr &= SBSDIO_SB_OFT_ADDR_MASK;
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;

--
1.7.4.1



2011-07-05 22:03:21

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 15/31] staging: brcm80211: renamed structures in softmac

From: Roland Vossen <[email protected]>

Several structures contained a '_c_' in their name that does not add any
information.

Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/alloc.c | 36 ++--
drivers/staging/brcm80211/brcmsmac/ampdu.c | 4 +-
drivers/staging/brcm80211/brcmsmac/ampdu.h | 2 +-
drivers/staging/brcm80211/brcmsmac/bmac.c | 290 ++++++++++++------------
drivers/staging/brcm80211/brcmsmac/bmac.h | 96 ++++----
drivers/staging/brcm80211/brcmsmac/channel.c | 6 +-
drivers/staging/brcm80211/brcmsmac/main.c | 84 ++++----
drivers/staging/brcm80211/brcmsmac/main.h | 81 +++----
drivers/staging/brcm80211/brcmsmac/phy_shim.c | 4 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.h | 2 +-
drivers/staging/brcm80211/brcmsmac/stf.c | 2 +-
drivers/staging/brcm80211/brcmsmac/stf.h | 2 +-
drivers/staging/brcm80211/brcmsmac/types.h | 6 +-
13 files changed, 304 insertions(+), 311 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/alloc.c b/drivers/staging/brcm80211/brcmsmac/alloc.c
index 62770b3..bf01ba0 100644
--- a/drivers/staging/brcm80211/brcmsmac/alloc.c
+++ b/drivers/staging/brcm80211/brcmsmac/alloc.c
@@ -20,8 +20,8 @@
#include "main.h"
#include "alloc.h"

-static struct brcms_c_bsscfg *brcms_c_bsscfg_malloc(uint unit);
-static void brcms_c_bsscfg_mfree(struct brcms_c_bsscfg *cfg);
+static struct brcms_bss_cfg *brcms_c_bsscfg_malloc(uint unit);
+static void brcms_c_bsscfg_mfree(struct brcms_bss_cfg *cfg);
static struct brcms_pub *brcms_c_pub_malloc(uint unit,
uint *err, uint devid);
static void brcms_c_pub_mfree(struct brcms_pub *pub);
@@ -87,11 +87,11 @@ static void brcms_c_pub_mfree(struct brcms_pub *pub)
kfree(pub);
}

-static struct brcms_c_bsscfg *brcms_c_bsscfg_malloc(uint unit)
+static struct brcms_bss_cfg *brcms_c_bsscfg_malloc(uint unit)
{
- struct brcms_c_bsscfg *cfg;
+ struct brcms_bss_cfg *cfg;

- cfg = kzalloc(sizeof(struct brcms_c_bsscfg), GFP_ATOMIC);
+ cfg = kzalloc(sizeof(struct brcms_bss_cfg), GFP_ATOMIC);
if (cfg == NULL)
goto fail;

@@ -106,7 +106,7 @@ static struct brcms_c_bsscfg *brcms_c_bsscfg_malloc(uint unit)
return NULL;
}

-static void brcms_c_bsscfg_mfree(struct brcms_c_bsscfg *cfg)
+static void brcms_c_bsscfg_mfree(struct brcms_bss_cfg *cfg)
{
if (cfg == NULL)
return;
@@ -117,7 +117,7 @@ static void brcms_c_bsscfg_mfree(struct brcms_c_bsscfg *cfg)
}

static void brcms_c_bsscfg_ID_assign(struct brcms_c_info *wlc,
- struct brcms_c_bsscfg *bsscfg)
+ struct brcms_bss_cfg *bsscfg)
{
bsscfg->ID = wlc->next_bsscfg_ID;
wlc->next_bsscfg_ID++;
@@ -144,9 +144,9 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
}
wlc->pub->wlc = wlc;

- /* allocate struct brcms_c_hw_info state structure */
+ /* allocate struct brcms_hardware state structure */

- wlc->hw = kzalloc(sizeof(struct brcms_c_hw_info), GFP_ATOMIC);
+ wlc->hw = kzalloc(sizeof(struct brcms_hardware), GFP_ATOMIC);
if (wlc->hw == NULL) {
*err = 1005;
goto fail;
@@ -154,7 +154,7 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
wlc->hw->wlc = wlc;

wlc->hw->bandstate[0] =
- kzalloc(sizeof(struct brcms_c_hwband) * MAXBANDS, GFP_ATOMIC);
+ kzalloc(sizeof(struct brcms_hw_band) * MAXBANDS, GFP_ATOMIC);
if (wlc->hw->bandstate[0] == NULL) {
*err = 1006;
goto fail;
@@ -162,9 +162,9 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
int i;

for (i = 1; i < MAXBANDS; i++) {
- wlc->hw->bandstate[i] = (struct brcms_c_hwband *)
+ wlc->hw->bandstate[i] = (struct brcms_hw_band *)
((unsigned long)wlc->hw->bandstate[0] +
- (sizeof(struct brcms_c_hwband) * i));
+ (sizeof(struct brcms_hw_band) * i));
}
}

@@ -202,21 +202,21 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
}
}

- wlc->protection = kzalloc(sizeof(struct brcms_c_protection),
+ wlc->protection = kzalloc(sizeof(struct brcms_protection),
GFP_ATOMIC);
if (wlc->protection == NULL) {
*err = 1016;
goto fail;
}

- wlc->stf = kzalloc(sizeof(struct brcms_c_stf), GFP_ATOMIC);
+ wlc->stf = kzalloc(sizeof(struct brcms_stf), GFP_ATOMIC);
if (wlc->stf == NULL) {
*err = 1017;
goto fail;
}

wlc->bandstate[0] =
- kzalloc(sizeof(struct brcms_c_band)*MAXBANDS, GFP_ATOMIC);
+ kzalloc(sizeof(struct brcms_band)*MAXBANDS, GFP_ATOMIC);
if (wlc->bandstate[0] == NULL) {
*err = 1025;
goto fail;
@@ -224,13 +224,13 @@ struct brcms_c_info *brcms_c_attach_malloc(uint unit, uint *err, uint devid)
int i;

for (i = 1; i < MAXBANDS; i++) {
- wlc->bandstate[i] = (struct brcms_c_band *)
+ wlc->bandstate[i] = (struct brcms_band *)
((unsigned long)wlc->bandstate[0]
- + (sizeof(struct brcms_c_band)*i));
+ + (sizeof(struct brcms_band)*i));
}
}

- wlc->corestate = kzalloc(sizeof(struct brcms_c_core), GFP_ATOMIC);
+ wlc->corestate = kzalloc(sizeof(struct brcms_core), GFP_ATOMIC);
if (wlc->corestate == NULL) {
*err = 1026;
goto fail;
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.c b/drivers/staging/brcm80211/brcmsmac/ampdu.c
index 4060ee2..599f6e9 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.c
@@ -436,7 +436,7 @@ brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
}

int
-brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
+brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
struct sk_buff **pdu, int prec)
{
struct brcms_c_info *wlc;
@@ -1204,7 +1204,7 @@ static void dma_cb_fn_ampdu(void *txi, void *arg_a)
void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
struct ieee80211_sta *sta, u16 tid)
{
- struct brcms_c_txq_info *qi = wlc->pkt_queue;
+ struct brcms_txq_info *qi = wlc->pkt_queue;
struct pktq *pq = &qi->q;
int prec;
struct cb_del_ampdu_pars ampdu_pars;
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.h b/drivers/staging/brcm80211/brcmsmac/ampdu.h
index 07b53fc..421f4ba 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.h
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.h
@@ -20,7 +20,7 @@
extern struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
extern void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
extern int brcms_c_sendampdu(struct ampdu_info *ampdu,
- struct brcms_c_txq_info *qi,
+ struct brcms_txq_info *qi,
struct sk_buff **aggp, int prec);
extern void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
struct sk_buff *p, struct tx_status *txs);
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index b0446d8..6f1203c 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -71,79 +71,79 @@ static u16 xmtfifo_sz[][NFIFO] = {
{9, 58, 22, 14, 14, 5}, /* corerev 24: 2304, 14848, 5632, 3584, 3584, 1280 */
};

-static void brcms_b_clkctl_clk(struct brcms_c_hw_info *wlc, uint mode);
+static void brcms_b_clkctl_clk(struct brcms_hardware *wlc, uint mode);
static void brcms_b_coreinit(struct brcms_c_info *wlc);

/* used by wlc_wakeucode_init() */
-static void brcms_c_write_inits(struct brcms_c_hw_info *wlc_hw,
+static void brcms_c_write_inits(struct brcms_hardware *wlc_hw,
const struct d11init *inits);
-static void brcms_ucode_write(struct brcms_c_hw_info *wlc_hw, const u32 ucode[],
+static void brcms_ucode_write(struct brcms_hardware *wlc_hw, const u32 ucode[],
const uint nbytes);
-static void brcms_ucode_download(struct brcms_c_hw_info *wlc);
-static void brcms_c_ucode_txant_set(struct brcms_c_hw_info *wlc_hw);
+static void brcms_ucode_download(struct brcms_hardware *wlc);
+static void brcms_c_ucode_txant_set(struct brcms_hardware *wlc_hw);

/* used by brcms_c_dpc() */
-static bool brcms_b_dotxstatus(struct brcms_c_hw_info *wlc,
+static bool brcms_b_dotxstatus(struct brcms_hardware *wlc,
struct tx_status *txs, u32 s2);
-static bool brcms_b_txstatus(struct brcms_c_hw_info *wlc, bool bound,
+static bool brcms_b_txstatus(struct brcms_hardware *wlc, bool bound,
bool *fatal);
-static bool brcms_b_recv(struct brcms_c_hw_info *wlc_hw, uint fifo, bool bound);
+static bool brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound);

/* used by brcms_c_down() */
static void brcms_c_flushqueues(struct brcms_c_info *wlc);

-static void brcms_c_write_mhf(struct brcms_c_hw_info *wlc_hw, u16 *mhfs);
-static void brcms_c_mctrl_reset(struct brcms_c_hw_info *wlc_hw);
-static void brcms_b_corerev_fifofixup(struct brcms_c_hw_info *wlc_hw);
-static bool brcms_b_tx_fifo_suspended(struct brcms_c_hw_info *wlc_hw,
+static void brcms_c_write_mhf(struct brcms_hardware *wlc_hw, u16 *mhfs);
+static void brcms_c_mctrl_reset(struct brcms_hardware *wlc_hw);
+static void brcms_b_corerev_fifofixup(struct brcms_hardware *wlc_hw);
+static bool brcms_b_tx_fifo_suspended(struct brcms_hardware *wlc_hw,
uint tx_fifo);
-static void brcms_b_tx_fifo_suspend(struct brcms_c_hw_info *wlc_hw,
+static void brcms_b_tx_fifo_suspend(struct brcms_hardware *wlc_hw,
uint tx_fifo);
-static void brcms_b_tx_fifo_resume(struct brcms_c_hw_info *wlc_hw,
+static void brcms_b_tx_fifo_resume(struct brcms_hardware *wlc_hw,
uint tx_fifo);

/* Low Level Prototypes */
-static int brcms_b_bandtype(struct brcms_c_hw_info *wlc_hw);
-static void brcms_b_info_init(struct brcms_c_hw_info *wlc_hw);
-static void brcms_b_xtal(struct brcms_c_hw_info *wlc_hw, bool want);
-static u16 brcms_b_read_objmem(struct brcms_c_hw_info *wlc_hw, uint offset,
+static int brcms_b_bandtype(struct brcms_hardware *wlc_hw);
+static void brcms_b_info_init(struct brcms_hardware *wlc_hw);
+static void brcms_b_xtal(struct brcms_hardware *wlc_hw, bool want);
+static u16 brcms_b_read_objmem(struct brcms_hardware *wlc_hw, uint offset,
u32 sel);
-static void brcms_b_write_objmem(struct brcms_c_hw_info *wlc_hw, uint offset,
+static void brcms_b_write_objmem(struct brcms_hardware *wlc_hw, uint offset,
u16 v, u32 sel);
-static void brcms_b_core_phy_clk(struct brcms_c_hw_info *wlc_hw, bool clk);
+static void brcms_b_core_phy_clk(struct brcms_hardware *wlc_hw, bool clk);
static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme);
-static void brcms_b_detach_dmapio(struct brcms_c_hw_info *wlc_hw);
-static void brcms_c_ucode_bsinit(struct brcms_c_hw_info *wlc_hw);
-static bool brcms_c_validboardtype(struct brcms_c_hw_info *wlc);
-static bool brcms_c_isgoodchip(struct brcms_c_hw_info *wlc_hw);
-static bool brcms_b_validate_chip_access(struct brcms_c_hw_info *wlc_hw);
-static char *brcms_c_get_macaddr(struct brcms_c_hw_info *wlc_hw);
+static void brcms_b_detach_dmapio(struct brcms_hardware *wlc_hw);
+static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw);
+static bool brcms_c_validboardtype(struct brcms_hardware *wlc);
+static bool brcms_c_isgoodchip(struct brcms_hardware *wlc_hw);
+static bool brcms_b_validate_chip_access(struct brcms_hardware *wlc_hw);
+static char *brcms_c_get_macaddr(struct brcms_hardware *wlc_hw);
static void brcms_c_mhfdef(struct brcms_c_info *wlc, u16 *mhfs, u16 mhf2_init);
-static void brcms_c_mctrl_write(struct brcms_c_hw_info *wlc_hw);
-static void brcms_b_mute(struct brcms_c_hw_info *wlc_hw, bool want,
+static void brcms_c_mctrl_write(struct brcms_hardware *wlc_hw);
+static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool want,
mbool flags);
-static void brcms_c_ucode_mute_override_set(struct brcms_c_hw_info *wlc_hw);
-static void brcms_c_ucode_mute_override_clear(struct brcms_c_hw_info *wlc_hw);
+static void brcms_c_ucode_mute_override_set(struct brcms_hardware *wlc_hw);
+static void brcms_c_ucode_mute_override_clear(struct brcms_hardware *wlc_hw);
static u32 brcms_c_wlintrsoff(struct brcms_c_info *wlc);
static void brcms_c_wlintrsrestore(struct brcms_c_info *wlc, u32 macintmask);
static void brcms_c_gpio_init(struct brcms_c_info *wlc);
-static void brcms_c_write_hw_bcntemplate0(struct brcms_c_hw_info *wlc_hw,
+static void brcms_c_write_hw_bcntemplate0(struct brcms_hardware *wlc_hw,
void *bcn, int len);
-static void brcms_c_write_hw_bcntemplate1(struct brcms_c_hw_info *wlc_hw,
+static void brcms_c_write_hw_bcntemplate1(struct brcms_hardware *wlc_hw,
void *bcn, int len);
static void brcms_b_bsinit(struct brcms_c_info *wlc, chanspec_t chanspec);
static u32 brcms_c_setband_inact(struct brcms_c_info *wlc, uint bandunit);
-static void brcms_b_setband(struct brcms_c_hw_info *wlc_hw, uint bandunit,
+static void brcms_b_setband(struct brcms_hardware *wlc_hw, uint bandunit,
chanspec_t chanspec);
-static void brcms_b_update_slot_timing(struct brcms_c_hw_info *wlc_hw,
+static void brcms_b_update_slot_timing(struct brcms_hardware *wlc_hw,
bool shortslot);
-static void brcms_upd_ofdm_pctl1_table(struct brcms_c_hw_info *wlc_hw);
-static u16 brcms_b_ofdm_ratetable_offset(struct brcms_c_hw_info *wlc_hw,
+static void brcms_upd_ofdm_pctl1_table(struct brcms_hardware *wlc_hw);
+static u16 brcms_b_ofdm_ratetable_offset(struct brcms_hardware *wlc_hw,
u8 rate);

/* === Low Level functions === */

-void brcms_b_set_shortslot(struct brcms_c_hw_info *wlc_hw, bool shortslot)
+void brcms_b_set_shortslot(struct brcms_hardware *wlc_hw, bool shortslot)
{
wlc_hw->shortslot = shortslot;

@@ -159,7 +159,7 @@ void brcms_b_set_shortslot(struct brcms_c_hw_info *wlc_hw, bool shortslot)
* or shortslot 11g (9us slots)
* The PSM needs to be suspended for this call.
*/
-static void brcms_b_update_slot_timing(struct brcms_c_hw_info *wlc_hw,
+static void brcms_b_update_slot_timing(struct brcms_hardware *wlc_hw,
bool shortslot)
{
d11regs_t *regs;
@@ -177,7 +177,7 @@ static void brcms_b_update_slot_timing(struct brcms_c_hw_info *wlc_hw,
}
}

-static void WLBANDINITFN(brcms_c_ucode_bsinit) (struct brcms_c_hw_info *wlc_hw)
+static void WLBANDINITFN(brcms_c_ucode_bsinit) (struct brcms_hardware *wlc_hw)
{
struct wiphy *wiphy = wlc_hw->wlc->wiphy;

@@ -213,7 +213,7 @@ static void WLBANDINITFN(brcms_c_ucode_bsinit) (struct brcms_c_hw_info *wlc_hw)
static u32 WLBANDINITFN(brcms_c_setband_inact) (struct brcms_c_info *wlc,
uint bandunit)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
u32 macintmask;

BCMMSG(wlc->wiphy, "wl%d\n", wlc_hw->unit);
@@ -239,7 +239,7 @@ static u32 WLBANDINITFN(brcms_c_setband_inact) (struct brcms_c_info *wlc,
* Param 'bound' indicates max. # frames to process before break out.
*/
static bool
-brcms_b_recv(struct brcms_c_hw_info *wlc_hw, uint fifo, bool bound)
+brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
{
struct sk_buff *p;
struct sk_buff *head = NULL;
@@ -290,7 +290,7 @@ brcms_b_recv(struct brcms_c_hw_info *wlc_hw, uint fifo, bool bound)
bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
{
u32 macintstatus;
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
d11regs_t *regs = wlc_hw->regs;
bool fatal = false;
struct wiphy *wiphy = wlc->wiphy;
@@ -394,7 +394,7 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
void brcms_b_watchdog(void *arg)
{
struct brcms_c_info *wlc = (struct brcms_c_info *) arg;
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;

BCMMSG(wlc->wiphy, "wl%d\n", wlc_hw->unit);

@@ -414,7 +414,7 @@ void brcms_b_watchdog(void *arg)
}

void
-brcms_b_set_chanspec(struct brcms_c_hw_info *wlc_hw, chanspec_t chanspec,
+brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, chanspec_t chanspec,
bool mute, struct txpwr_limits *txpwr)
{
uint bandunit;
@@ -457,7 +457,7 @@ brcms_b_set_chanspec(struct brcms_c_hw_info *wlc_hw, chanspec_t chanspec,
}
}

-int brcms_b_state_get(struct brcms_c_hw_info *wlc_hw,
+int brcms_b_state_get(struct brcms_hardware *wlc_hw,
struct brcms_b_state *state)
{
state->machwcap = wlc_hw->machwcap;
@@ -471,7 +471,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
char name[8];
/* ucode host flag 2 needed for pio mode, independent of band and fifo */
u16 pio_mhf2 = 0;
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
uint unit = wlc_hw->unit;
struct brcms_tunables *tune = wlc->pub->tunables;
struct wiphy *wiphy = wlc->wiphy;
@@ -562,7 +562,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
return true;
}

-static void brcms_b_detach_dmapio(struct brcms_c_hw_info *wlc_hw)
+static void brcms_b_detach_dmapio(struct brcms_hardware *wlc_hw)
{
uint j;

@@ -583,7 +583,7 @@ static void brcms_b_detach_dmapio(struct brcms_c_hw_info *wlc_hw)
int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
bool piomode, void *regsva, uint bustype, void *btparam)
{
- struct brcms_c_hw_info *wlc_hw;
+ struct brcms_hardware *wlc_hw;
d11regs_t *regs;
char *macaddr = NULL;
char *vars;
@@ -604,7 +604,7 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
wlc_hw->band = wlc_hw->bandstate[0];
wlc_hw->_piomode = piomode;

- /* populate struct brcms_c_hw_info with default values */
+ /* populate struct brcms_hardware with default values */
brcms_b_info_init(wlc_hw);

/*
@@ -929,7 +929,7 @@ int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device, uint unit,
* may get overrides later in this function
* BMAC_NOTES, move low out and resolve the dangling ones
*/
-static void brcms_b_info_init(struct brcms_c_hw_info *wlc_hw)
+static void brcms_b_info_init(struct brcms_hardware *wlc_hw)
{
struct brcms_c_info *wlc = wlc_hw->wlc;

@@ -954,8 +954,8 @@ static void brcms_b_info_init(struct brcms_c_hw_info *wlc_hw)
int brcms_b_detach(struct brcms_c_info *wlc)
{
uint i;
- struct brcms_c_hwband *band;
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hw_band *band;
+ struct brcms_hardware *wlc_hw = wlc->hw;
int callbacks;

callbacks = 0;
@@ -1000,7 +1000,7 @@ int brcms_b_detach(struct brcms_c_info *wlc)

}

-void brcms_b_reset(struct brcms_c_hw_info *wlc_hw)
+void brcms_b_reset(struct brcms_hardware *wlc_hw)
{
BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);

@@ -1015,7 +1015,7 @@ void brcms_b_reset(struct brcms_c_hw_info *wlc_hw)
}

void
-brcms_b_init(struct brcms_c_hw_info *wlc_hw, chanspec_t chanspec,
+brcms_b_init(struct brcms_hardware *wlc_hw, chanspec_t chanspec,
bool mute) {
u32 macintmask;
bool fastclk;
@@ -1066,7 +1066,7 @@ brcms_b_init(struct brcms_c_hw_info *wlc_hw, chanspec_t chanspec,
brcms_b_clkctl_clk(wlc_hw, CLK_DYNAMIC);
}

-int brcms_b_up_prep(struct brcms_c_hw_info *wlc_hw)
+int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
{
uint coremask;

@@ -1110,7 +1110,7 @@ int brcms_b_up_prep(struct brcms_c_hw_info *wlc_hw)
return 0;
}

-int brcms_b_up_finish(struct brcms_c_hw_info *wlc_hw)
+int brcms_b_up_finish(struct brcms_hardware *wlc_hw)
{
BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);

@@ -1123,7 +1123,7 @@ int brcms_b_up_finish(struct brcms_c_hw_info *wlc_hw)
return 0;
}

-int brcms_b_bmac_down_prep(struct brcms_c_hw_info *wlc_hw)
+int brcms_b_bmac_down_prep(struct brcms_hardware *wlc_hw)
{
bool dev_gone;
uint callbacks = 0;
@@ -1151,7 +1151,7 @@ int brcms_b_bmac_down_prep(struct brcms_c_hw_info *wlc_hw)
return callbacks;
}

-int brcms_b_down_finish(struct brcms_c_hw_info *wlc_hw)
+int brcms_b_down_finish(struct brcms_hardware *wlc_hw)
{
uint callbacks = 0;
bool dev_gone;
@@ -1195,7 +1195,7 @@ int brcms_b_down_finish(struct brcms_c_hw_info *wlc_hw)
return callbacks;
}

-void brcms_b_wait_for_wake(struct brcms_c_hw_info *wlc_hw)
+void brcms_b_wait_for_wake(struct brcms_hardware *wlc_hw)
{
/* delay before first read of ucode state */
udelay(40);
@@ -1205,18 +1205,18 @@ void brcms_b_wait_for_wake(struct brcms_c_hw_info *wlc_hw)
DBGST_ASLEEP), wlc_hw->wlc->fastpwrup_dly);
}

-void brcms_b_hw_etheraddr(struct brcms_c_hw_info *wlc_hw, u8 *ea)
+void brcms_b_hw_etheraddr(struct brcms_hardware *wlc_hw, u8 *ea)
{
memcpy(ea, wlc_hw->etheraddr, ETH_ALEN);
}

-static int brcms_b_bandtype(struct brcms_c_hw_info *wlc_hw)
+static int brcms_b_bandtype(struct brcms_hardware *wlc_hw)
{
return wlc_hw->band->bandtype;
}

/* control chip clock to save power, enable dynamic clock or force fast clock */
-static void brcms_b_clkctl_clk(struct brcms_c_hw_info *wlc_hw, uint mode)
+static void brcms_b_clkctl_clk(struct brcms_hardware *wlc_hw, uint mode)
{
if (PMUCTL_ENAB(wlc_hw->sih)) {
/* new chips with PMU, CCS_FORCEHT will distribute the HT clock on backplane,
@@ -1289,7 +1289,7 @@ static void brcms_b_clkctl_clk(struct brcms_c_hw_info *wlc_hw, uint mode)
static void
brcms_c_mhfdef(struct brcms_c_info *wlc, u16 *mhfs, u16 mhf2_init)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;

memset(mhfs, 0, MHFMAX * sizeof(u16));

@@ -1317,7 +1317,7 @@ brcms_c_mhfdef(struct brcms_c_info *wlc, u16 *mhfs, u16 mhf2_init)
* WLC_BAND_ALL <--- All bands
*/
void
-brcms_b_mhf(struct brcms_c_hw_info *wlc_hw, u8 idx, u16 mask, u16 val,
+brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val,
int bands)
{
u16 save;
@@ -1325,7 +1325,7 @@ brcms_b_mhf(struct brcms_c_hw_info *wlc_hw, u8 idx, u16 mask, u16 val,
M_HOST_FLAGS1, M_HOST_FLAGS2, M_HOST_FLAGS3, M_HOST_FLAGS4,
M_HOST_FLAGS5
};
- struct brcms_c_hwband *band;
+ struct brcms_hw_band *band;

if ((val & ~mask) || idx >= MHFMAX)
return; /* error condition */
@@ -1369,9 +1369,9 @@ brcms_b_mhf(struct brcms_c_hw_info *wlc_hw, u8 idx, u16 mask, u16 val,
}
}

-u16 brcms_b_mhf_get(struct brcms_c_hw_info *wlc_hw, u8 idx, int bands)
+u16 brcms_b_mhf_get(struct brcms_hardware *wlc_hw, u8 idx, int bands)
{
- struct brcms_c_hwband *band;
+ struct brcms_hw_band *band;

if (idx >= MHFMAX)
return 0; /* error condition */
@@ -1395,7 +1395,7 @@ u16 brcms_b_mhf_get(struct brcms_c_hw_info *wlc_hw, u8 idx, int bands)
return band->mhfs[idx];
}

-static void brcms_c_write_mhf(struct brcms_c_hw_info *wlc_hw, u16 *mhfs)
+static void brcms_c_write_mhf(struct brcms_hardware *wlc_hw, u16 *mhfs)
{
u8 idx;
u16 addr[] = {
@@ -1411,7 +1411,7 @@ static void brcms_c_write_mhf(struct brcms_c_hw_info *wlc_hw, u16 *mhfs)
/* set the maccontrol register to desired reset state and
* initialize the sw cache of the register
*/
-static void brcms_c_mctrl_reset(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_mctrl_reset(struct brcms_hardware *wlc_hw)
{
/* IHR accesses are always enabled, PSM disabled, HPS off and WAKE on */
wlc_hw->maccontrol = 0;
@@ -1422,7 +1422,7 @@ static void brcms_c_mctrl_reset(struct brcms_c_hw_info *wlc_hw)
}

/* set or clear maccontrol bits */
-void brcms_b_mctrl(struct brcms_c_hw_info *wlc_hw, u32 mask, u32 val)
+void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val)
{
u32 maccontrol;
u32 new_maccontrol;
@@ -1444,7 +1444,7 @@ void brcms_b_mctrl(struct brcms_c_hw_info *wlc_hw, u32 mask, u32 val)
}

/* write the software state of maccontrol and overrides to the maccontrol register */
-static void brcms_c_mctrl_write(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_mctrl_write(struct brcms_hardware *wlc_hw)
{
u32 maccontrol = wlc_hw->maccontrol;

@@ -1461,7 +1461,7 @@ static void brcms_c_mctrl_write(struct brcms_c_hw_info *wlc_hw)
W_REG(&wlc_hw->regs->maccontrol, maccontrol);
}

-void brcms_c_ucode_wake_override_set(struct brcms_c_hw_info *wlc_hw,
+void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
u32 override_bit)
{
if (wlc_hw->wake_override || (wlc_hw->maccontrol & MCTL_WAKE)) {
@@ -1477,7 +1477,7 @@ void brcms_c_ucode_wake_override_set(struct brcms_c_hw_info *wlc_hw,
return;
}

-void brcms_c_ucode_wake_override_clear(struct brcms_c_hw_info *wlc_hw,
+void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
u32 override_bit)
{
mboolclr(wlc_hw->wake_override, override_bit);
@@ -1497,7 +1497,7 @@ void brcms_c_ucode_wake_override_clear(struct brcms_c_hw_info *wlc_hw,
* STA 0 1 <--- This will ensure no beacons
* IBSS 0 0
*/
-static void brcms_c_ucode_mute_override_set(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_ucode_mute_override_set(struct brcms_hardware *wlc_hw)
{
wlc_hw->mute_override = 1;

@@ -1513,7 +1513,7 @@ static void brcms_c_ucode_mute_override_set(struct brcms_c_hw_info *wlc_hw)
}

/* Clear the override on AP and INFRA bits */
-static void brcms_c_ucode_mute_override_clear(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_ucode_mute_override_clear(struct brcms_hardware *wlc_hw)
{
if (wlc_hw->mute_override == 0)
return;
@@ -1533,7 +1533,7 @@ static void brcms_c_ucode_mute_override_clear(struct brcms_c_hw_info *wlc_hw)
* Write a MAC address to the given match reg offset in the RXE match engine.
*/
void
-brcms_b_set_addrmatch(struct brcms_c_hw_info *wlc_hw, int match_reg_offset,
+brcms_b_set_addrmatch(struct brcms_hardware *wlc_hw, int match_reg_offset,
const u8 *addr)
{
d11regs_t *regs;
@@ -1558,7 +1558,7 @@ brcms_b_set_addrmatch(struct brcms_c_hw_info *wlc_hw, int match_reg_offset,
}

void
-brcms_b_write_template_ram(struct brcms_c_hw_info *wlc_hw, int offset, int len,
+brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset, int len,
void *buf)
{
d11regs_t *regs;
@@ -1590,7 +1590,7 @@ brcms_b_write_template_ram(struct brcms_c_hw_info *wlc_hw, int offset, int len,
}
}

-void brcms_b_set_cwmin(struct brcms_c_hw_info *wlc_hw, u16 newmin)
+void brcms_b_set_cwmin(struct brcms_hardware *wlc_hw, u16 newmin)
{
wlc_hw->band->CWmin = newmin;

@@ -1599,7 +1599,7 @@ void brcms_b_set_cwmin(struct brcms_c_hw_info *wlc_hw, u16 newmin)
W_REG(&wlc_hw->regs->objdata, newmin);
}

-void brcms_b_set_cwmax(struct brcms_c_hw_info *wlc_hw, u16 newmax)
+void brcms_b_set_cwmax(struct brcms_hardware *wlc_hw, u16 newmax)
{
wlc_hw->band->CWmax = newmax;

@@ -1608,7 +1608,7 @@ void brcms_b_set_cwmax(struct brcms_c_hw_info *wlc_hw, u16 newmax)
W_REG(&wlc_hw->regs->objdata, newmax);
}

-void brcms_b_bw_set(struct brcms_c_hw_info *wlc_hw, u16 bw)
+void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw)
{
bool fastclk;

@@ -1628,7 +1628,7 @@ void brcms_b_bw_set(struct brcms_c_hw_info *wlc_hw, u16 bw)
}

static void
-brcms_c_write_hw_bcntemplate0(struct brcms_c_hw_info *wlc_hw, void *bcn,
+brcms_c_write_hw_bcntemplate0(struct brcms_hardware *wlc_hw, void *bcn,
int len)
{
d11regs_t *regs = wlc_hw->regs;
@@ -1642,7 +1642,7 @@ brcms_c_write_hw_bcntemplate0(struct brcms_c_hw_info *wlc_hw, void *bcn,
}

static void
-brcms_c_write_hw_bcntemplate1(struct brcms_c_hw_info *wlc_hw, void *bcn,
+brcms_c_write_hw_bcntemplate1(struct brcms_hardware *wlc_hw, void *bcn,
int len)
{
d11regs_t *regs = wlc_hw->regs;
@@ -1657,7 +1657,7 @@ brcms_c_write_hw_bcntemplate1(struct brcms_c_hw_info *wlc_hw, void *bcn,

/* mac is assumed to be suspended at this point */
void
-brcms_b_write_hw_bcntemplates(struct brcms_c_hw_info *wlc_hw, void *bcn,
+brcms_b_write_hw_bcntemplates(struct brcms_hardware *wlc_hw, void *bcn,
int len, bool both)
{
d11regs_t *regs = wlc_hw->regs;
@@ -1676,7 +1676,7 @@ brcms_b_write_hw_bcntemplates(struct brcms_c_hw_info *wlc_hw, void *bcn,
}
}

-static void WLBANDINITFN(brcms_b_upd_synthpu) (struct brcms_c_hw_info *wlc_hw)
+static void WLBANDINITFN(brcms_b_upd_synthpu) (struct brcms_hardware *wlc_hw)
{
u16 v;
struct brcms_c_info *wlc = wlc_hw->wlc;
@@ -1697,7 +1697,7 @@ static void WLBANDINITFN(brcms_b_upd_synthpu) (struct brcms_c_hw_info *wlc_hw)
static void
WLBANDINITFN(brcms_b_bsinit) (struct brcms_c_info *wlc, chanspec_t chanspec)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;

BCMMSG(wlc->wiphy, "wl%d: bandunit %d\n", wlc_hw->unit,
wlc_hw->band->bandunit);
@@ -1727,7 +1727,7 @@ WLBANDINITFN(brcms_b_bsinit) (struct brcms_c_info *wlc, chanspec_t chanspec)
brcms_b_upd_synthpu(wlc_hw);
}

-static void brcms_b_core_phy_clk(struct brcms_c_hw_info *wlc_hw, bool clk)
+static void brcms_b_core_phy_clk(struct brcms_hardware *wlc_hw, bool clk)
{
BCMMSG(wlc_hw->wlc->wiphy, "wl%d: clk %d\n", wlc_hw->unit, clk);

@@ -1752,7 +1752,7 @@ static void brcms_b_core_phy_clk(struct brcms_c_hw_info *wlc_hw, bool clk)
}

/* Perform a soft reset of the PHY PLL */
-void brcms_b_core_phypll_reset(struct brcms_c_hw_info *wlc_hw)
+void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw)
{
BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);

@@ -1773,7 +1773,7 @@ void brcms_b_core_phypll_reset(struct brcms_c_hw_info *wlc_hw)
/* light way to turn on phy clock without reset for NPHY only
* refer to brcms_b_core_phy_clk for full version
*/
-void brcms_b_phyclk_fgc(struct brcms_c_hw_info *wlc_hw, bool clk)
+void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk)
{
/* support(necessary for NPHY and HYPHY) only */
if (!WLCISNPHY(wlc_hw->band))
@@ -1786,7 +1786,7 @@ void brcms_b_phyclk_fgc(struct brcms_c_hw_info *wlc_hw, bool clk)

}

-void brcms_b_macphyclk_set(struct brcms_c_hw_info *wlc_hw, bool clk)
+void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk)
{
if (ON == clk)
ai_core_cflags(wlc_hw->sih, SICF_MPCLKE, SICF_MPCLKE);
@@ -1794,7 +1794,7 @@ void brcms_b_macphyclk_set(struct brcms_c_hw_info *wlc_hw, bool clk)
ai_core_cflags(wlc_hw->sih, SICF_MPCLKE, 0);
}

-void brcms_b_phy_reset(struct brcms_c_hw_info *wlc_hw)
+void brcms_b_phy_reset(struct brcms_hardware *wlc_hw)
{
struct brcms_phy_pub *pih = wlc_hw->band->pi;
u32 phy_bw_clkbits;
@@ -1838,7 +1838,7 @@ void brcms_b_phy_reset(struct brcms_c_hw_info *wlc_hw)

/* switch to and initialize new band */
static void
-WLBANDINITFN(brcms_b_setband) (struct brcms_c_hw_info *wlc_hw, uint bandunit,
+WLBANDINITFN(brcms_b_setband) (struct brcms_hardware *wlc_hw, uint bandunit,
chanspec_t chanspec) {
struct brcms_c_info *wlc = wlc_hw->wlc;
u32 macintmask;
@@ -1875,7 +1875,7 @@ WLBANDINITFN(brcms_b_setband) (struct brcms_c_hw_info *wlc_hw, uint bandunit,
}

/* low-level band switch utility routine */
-void WLBANDINITFN(brcms_c_setxband) (struct brcms_c_hw_info *wlc_hw,
+void WLBANDINITFN(brcms_c_setxband) (struct brcms_hardware *wlc_hw,
uint bandunit)
{
BCMMSG(wlc_hw->wlc->wiphy, "wl%d: bandunit %d\n", wlc_hw->unit,
@@ -1893,7 +1893,7 @@ void WLBANDINITFN(brcms_c_setxband) (struct brcms_c_hw_info *wlc_hw,
}
}

-static bool brcms_c_isgoodchip(struct brcms_c_hw_info *wlc_hw)
+static bool brcms_c_isgoodchip(struct brcms_hardware *wlc_hw)
{

/* reject unsupported corerev */
@@ -1907,7 +1907,7 @@ static bool brcms_c_isgoodchip(struct brcms_c_hw_info *wlc_hw)
}

/* Validate some board info parameters */
-static bool brcms_c_validboardtype(struct brcms_c_hw_info *wlc_hw)
+static bool brcms_c_validboardtype(struct brcms_hardware *wlc_hw)
{
uint boardrev = wlc_hw->boardrev;

@@ -1935,7 +1935,7 @@ static bool brcms_c_validboardtype(struct brcms_c_hw_info *wlc_hw)
return true;
}

-static char *brcms_c_get_macaddr(struct brcms_c_hw_info *wlc_hw)
+static char *brcms_c_get_macaddr(struct brcms_hardware *wlc_hw)
{
const char *varname = "macaddr";
char *macaddr;
@@ -1965,7 +1965,7 @@ static char *brcms_c_get_macaddr(struct brcms_c_hw_info *wlc_hw)
* this function could be called when driver is down and w/o clock
* it operates on different registers depending on corerev and boardflag.
*/
-bool brcms_b_radio_read_hwdisabled(struct brcms_c_hw_info *wlc_hw)
+bool brcms_b_radio_read_hwdisabled(struct brcms_hardware *wlc_hw)
{
bool v, clk, xtal;
u32 resetbits = 0, flags = 0;
@@ -2007,7 +2007,7 @@ bool brcms_b_radio_read_hwdisabled(struct brcms_c_hw_info *wlc_hw)
}

/* Initialize just the hardware when coming out of POR or S3/S5 system states */
-void brcms_b_hw_up(struct brcms_c_hw_info *wlc_hw)
+void brcms_b_hw_up(struct brcms_hardware *wlc_hw)
{
if (wlc_hw->wlc->pub->hw_up)
return;
@@ -2048,7 +2048,7 @@ void brcms_b_hw_up(struct brcms_c_hw_info *wlc_hw)
}
}

-static bool wlc_dma_rxreset(struct brcms_c_hw_info *wlc_hw, uint fifo)
+static bool wlc_dma_rxreset(struct brcms_hardware *wlc_hw, uint fifo)
{
struct dma_pub *di = wlc_hw->di[fifo];
return dma_rxreset(di);
@@ -2062,7 +2062,7 @@ static bool wlc_dma_rxreset(struct brcms_c_hw_info *wlc_hw, uint fifo)
* clear software macintstatus for fresh new start
* one testing hack wlc_hw->noreset will bypass the d11/phy reset
*/
-void brcms_b_corereset(struct brcms_c_hw_info *wlc_hw, u32 flags)
+void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags)
{
d11regs_t *regs;
uint i;
@@ -2145,7 +2145,7 @@ void brcms_b_corereset(struct brcms_c_hw_info *wlc_hw, u32 flags)
/* txfifo sizes needs to be modified(increased) since the newer cores
* have more memory.
*/
-static void brcms_b_corerev_fifofixup(struct brcms_c_hw_info *wlc_hw)
+static void brcms_b_corerev_fifofixup(struct brcms_hardware *wlc_hw)
{
d11regs_t *regs = wlc_hw->regs;
u16 fifo_nu;
@@ -2202,7 +2202,7 @@ static void brcms_b_corerev_fifofixup(struct brcms_c_hw_info *wlc_hw)
*/
static void brcms_b_coreinit(struct brcms_c_info *wlc)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
d11regs_t *regs;
u32 sflags;
uint bcnint_us;
@@ -2390,7 +2390,7 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
* - 559241 = 0x88889 => tsf_clk_frac_h = 0x8, tsf_clk_frac_l = 0x8889
*/

-void brcms_b_switch_macfreq(struct brcms_c_hw_info *wlc_hw, u8 spurmode)
+void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode)
{
d11regs_t *regs;
regs = wlc_hw->regs;
@@ -2421,7 +2421,7 @@ void brcms_b_switch_macfreq(struct brcms_c_hw_info *wlc_hw, u8 spurmode)
/* Initialize GPIOs that are controlled by D11 core */
static void brcms_c_gpio_init(struct brcms_c_info *wlc)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
d11regs_t *regs;
u32 gc, gm;

@@ -2481,7 +2481,7 @@ static void brcms_c_gpio_init(struct brcms_c_info *wlc)
ai_gpiocontrol(wlc_hw->sih, gm, gc, GPIO_DRV_PRIORITY);
}

-static void brcms_ucode_download(struct brcms_c_hw_info *wlc_hw)
+static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
{
struct brcms_c_info *wlc;
wlc = wlc_hw->wlc;
@@ -2511,7 +2511,7 @@ static void brcms_ucode_download(struct brcms_c_hw_info *wlc_hw)
}
}

-static void brcms_ucode_write(struct brcms_c_hw_info *wlc_hw, const u32 ucode[],
+static void brcms_ucode_write(struct brcms_hardware *wlc_hw, const u32 ucode[],
const uint nbytes) {
d11regs_t *regs = wlc_hw->regs;
uint i;
@@ -2527,7 +2527,7 @@ static void brcms_ucode_write(struct brcms_c_hw_info *wlc_hw, const u32 ucode[],
W_REG(&regs->objdata, ucode[i]);
}

-static void brcms_c_write_inits(struct brcms_c_hw_info *wlc_hw,
+static void brcms_c_write_inits(struct brcms_hardware *wlc_hw,
const struct d11init *inits)
{
int i;
@@ -2547,7 +2547,7 @@ static void brcms_c_write_inits(struct brcms_c_hw_info *wlc_hw,
}
}

-static void brcms_c_ucode_txant_set(struct brcms_c_hw_info *wlc_hw)
+static void brcms_c_ucode_txant_set(struct brcms_hardware *wlc_hw)
{
u16 phyctl;
u16 phytxant = wlc_hw->bmac_phytxant;
@@ -2564,7 +2564,7 @@ static void brcms_c_ucode_txant_set(struct brcms_c_hw_info *wlc_hw)
brcms_b_write_shm(wlc_hw, M_RSP_PCTLWD, phyctl);
}

-void brcms_b_txant_set(struct brcms_c_hw_info *wlc_hw, u16 phytxant)
+void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant)
{
/* update sw state */
wlc_hw->bmac_phytxant = phytxant;
@@ -2576,12 +2576,12 @@ void brcms_b_txant_set(struct brcms_c_hw_info *wlc_hw, u16 phytxant)

}

-u16 brcms_b_get_txant(struct brcms_c_hw_info *wlc_hw)
+u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw)
{
return (u16) wlc_hw->wlc->stf->txant;
}

-void brcms_b_antsel_type_set(struct brcms_c_hw_info *wlc_hw, u8 antsel_type)
+void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw, u8 antsel_type)
{
wlc_hw->antsel_type = antsel_type;

@@ -2589,7 +2589,7 @@ void brcms_b_antsel_type_set(struct brcms_c_hw_info *wlc_hw, u8 antsel_type)
wlc_phy_antsel_type_set(wlc_hw->band->pi, antsel_type);
}

-void brcms_b_fifoerrors(struct brcms_c_hw_info *wlc_hw)
+void brcms_b_fifoerrors(struct brcms_hardware *wlc_hw)
{
bool fatal = false;
uint unit;
@@ -2655,7 +2655,7 @@ void brcms_b_fifoerrors(struct brcms_c_hw_info *wlc_hw)

void brcms_c_intrson(struct brcms_c_info *wlc)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
wlc->macintmask = wlc->defmacintmask;
W_REG(&wlc_hw->regs->macintmask, wlc->macintmask);
}
@@ -2683,7 +2683,7 @@ static void brcms_c_wlintrsrestore(struct brcms_c_info *wlc, u32 macintmask)

u32 brcms_c_intrsoff(struct brcms_c_info *wlc)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
u32 macintmask;

if (!wlc_hw->clk)
@@ -2702,7 +2702,7 @@ u32 brcms_c_intrsoff(struct brcms_c_info *wlc)

void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
if (!wlc_hw->clk)
return;

@@ -2710,7 +2710,7 @@ void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask)
W_REG(&wlc_hw->regs->macintmask, wlc->macintmask);
}

-static void brcms_b_mute(struct brcms_c_hw_info *wlc_hw, bool on, mbool flags)
+static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool on, mbool flags)
{
u8 null_ether_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};

@@ -2746,7 +2746,7 @@ static void brcms_b_mute(struct brcms_c_hw_info *wlc_hw, bool on, mbool flags)
brcms_c_ucode_mute_override_clear(wlc_hw);
}

-int brcms_b_xmtfifo_sz_get(struct brcms_c_hw_info *wlc_hw, uint fifo,
+int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
uint *blocks)
{
if (fifo >= NFIFO)
@@ -2766,7 +2766,7 @@ int brcms_b_xmtfifo_sz_get(struct brcms_c_hw_info *wlc_hw, uint fifo,
* be pulling data into a tx fifo, by the time the MAC acks the suspend
* request.
*/
-static bool brcms_b_tx_fifo_suspended(struct brcms_c_hw_info *wlc_hw,
+static bool brcms_b_tx_fifo_suspended(struct brcms_hardware *wlc_hw,
uint tx_fifo)
{
/* check that a suspend has been requested and is no longer pending */
@@ -2786,7 +2786,7 @@ static bool brcms_b_tx_fifo_suspended(struct brcms_c_hw_info *wlc_hw,
return false;
}

-static void brcms_b_tx_fifo_suspend(struct brcms_c_hw_info *wlc_hw,
+static void brcms_b_tx_fifo_suspend(struct brcms_hardware *wlc_hw,
uint tx_fifo)
{
u8 fifo = 1 << tx_fifo;
@@ -2819,7 +2819,7 @@ static void brcms_b_tx_fifo_suspend(struct brcms_c_hw_info *wlc_hw,
}
}

-static void brcms_b_tx_fifo_resume(struct brcms_c_hw_info *wlc_hw,
+static void brcms_b_tx_fifo_resume(struct brcms_hardware *wlc_hw,
uint tx_fifo)
{
/* BMAC_NOTE: WLC_TX_FIFO_ENAB is done in brcms_c_dpc() for DMA case
@@ -2851,7 +2851,7 @@ static void brcms_b_tx_fifo_resume(struct brcms_c_hw_info *wlc_hw,
*/
static inline u32 wlc_intstatus(struct brcms_c_info *wlc, bool in_isr)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
d11regs_t *regs = wlc_hw->regs;
u32 macintstatus;

@@ -2931,7 +2931,7 @@ bool brcms_c_intrsupd(struct brcms_c_info *wlc)
*/
bool brcms_c_isr(struct brcms_c_info *wlc, bool *wantdpc)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
u32 macintstatus;

*wantdpc = false;
@@ -2960,7 +2960,7 @@ bool brcms_c_isr(struct brcms_c_info *wlc, bool *wantdpc)
}

static bool
-brcms_b_dotxstatus(struct brcms_c_hw_info *wlc_hw, struct tx_status *txs,
+brcms_b_dotxstatus(struct brcms_hardware *wlc_hw, struct tx_status *txs,
u32 s2)
{
/* discard intermediate indications for ucode with one legitimate case:
@@ -2980,7 +2980,7 @@ brcms_b_dotxstatus(struct brcms_c_hw_info *wlc_hw, struct tx_status *txs,
* Return true if more tx status need to be processed. false otherwise.
*/
static bool
-brcms_b_txstatus(struct brcms_c_hw_info *wlc_hw, bool bound, bool *fatal)
+brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
{
bool morepending = false;
struct brcms_c_info *wlc = wlc_hw->wlc;
@@ -3036,7 +3036,7 @@ brcms_b_txstatus(struct brcms_c_hw_info *wlc_hw, bool bound, bool *fatal)

void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
d11regs_t *regs = wlc_hw->regs;
u32 mc, mi;
struct wiphy *wiphy = wlc->wiphy;
@@ -3105,7 +3105,7 @@ void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc)

void brcms_c_enable_mac(struct brcms_c_info *wlc)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
d11regs_t *regs = wlc_hw->regs;
u32 mc, mi;

@@ -3138,7 +3138,7 @@ void brcms_c_enable_mac(struct brcms_c_info *wlc)
brcms_c_ucode_wake_override_clear(wlc_hw, WLC_WAKE_OVERRIDE_MACSUSPEND);
}

-static void brcms_upd_ofdm_pctl1_table(struct brcms_c_hw_info *wlc_hw)
+static void brcms_upd_ofdm_pctl1_table(struct brcms_hardware *wlc_hw)
{
u8 rate;
u8 rates[8] = {
@@ -3172,7 +3172,7 @@ static void brcms_upd_ofdm_pctl1_table(struct brcms_c_hw_info *wlc_hw)
}
}

-static u16 brcms_b_ofdm_ratetable_offset(struct brcms_c_hw_info *wlc_hw,
+static u16 brcms_b_ofdm_ratetable_offset(struct brcms_hardware *wlc_hw,
u8 rate)
{
uint i;
@@ -3206,7 +3206,7 @@ static u16 brcms_b_ofdm_ratetable_offset(struct brcms_c_hw_info *wlc_hw,
return 2 * brcms_b_read_shm(wlc_hw, M_RT_DIRMAP_A + (plcp_rate * 2));
}

-void brcms_b_band_stf_ss_set(struct brcms_c_hw_info *wlc_hw, u8 stf_mode)
+void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw, u8 stf_mode)
{
wlc_hw->hw_stf_ss_opmode = stf_mode;

@@ -3215,7 +3215,7 @@ void brcms_b_band_stf_ss_set(struct brcms_c_hw_info *wlc_hw, u8 stf_mode)
}

void
-brcms_b_read_tsf(struct brcms_c_hw_info *wlc_hw, u32 *tsf_l_ptr,
+brcms_b_read_tsf(struct brcms_hardware *wlc_hw, u32 *tsf_l_ptr,
u32 *tsf_h_ptr)
{
d11regs_t *regs = wlc_hw->regs;
@@ -3227,7 +3227,7 @@ brcms_b_read_tsf(struct brcms_c_hw_info *wlc_hw, u32 *tsf_l_ptr,
return;
}

-static bool brcms_b_validate_chip_access(struct brcms_c_hw_info *wlc_hw)
+static bool brcms_b_validate_chip_access(struct brcms_hardware *wlc_hw)
{
d11regs_t *regs;
u32 w, val;
@@ -3292,7 +3292,7 @@ static bool brcms_b_validate_chip_access(struct brcms_c_hw_info *wlc_hw)

#define PHYPLL_WAIT_US 100000

-void brcms_b_core_phypll_ctl(struct brcms_c_hw_info *wlc_hw, bool on)
+void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on)
{
d11regs_t *regs;
u32 tmp;
@@ -3344,7 +3344,7 @@ void brcms_b_core_phypll_ctl(struct brcms_c_hw_info *wlc_hw, bool on)
}
}

-void brcms_c_coredisable(struct brcms_c_hw_info *wlc_hw)
+void brcms_c_coredisable(struct brcms_hardware *wlc_hw)
{
bool dev_gone;

@@ -3382,7 +3382,7 @@ void brcms_c_coredisable(struct brcms_c_hw_info *wlc_hw)
}

/* power both the pll and external oscillator on/off */
-static void brcms_b_xtal(struct brcms_c_hw_info *wlc_hw, bool want)
+static void brcms_b_xtal(struct brcms_hardware *wlc_hw, bool want)
{
BCMMSG(wlc_hw->wlc->wiphy, "wl%d: want %d\n", wlc_hw->unit, want);

@@ -3403,7 +3403,7 @@ static void brcms_b_xtal(struct brcms_c_hw_info *wlc_hw, bool want)

static void brcms_c_flushqueues(struct brcms_c_info *wlc)
{
- struct brcms_c_hw_info *wlc_hw = wlc->hw;
+ struct brcms_hardware *wlc_hw = wlc->hw;
uint i;

wlc->txpend16165war = 0;
@@ -3420,18 +3420,18 @@ static void brcms_c_flushqueues(struct brcms_c_info *wlc)
dma_rxreclaim(wlc_hw->di[RX_FIFO]);
}

-u16 brcms_b_read_shm(struct brcms_c_hw_info *wlc_hw, uint offset)
+u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset)
{
return brcms_b_read_objmem(wlc_hw, offset, OBJADDR_SHM_SEL);
}

-void brcms_b_write_shm(struct brcms_c_hw_info *wlc_hw, uint offset, u16 v)
+void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset, u16 v)
{
brcms_b_write_objmem(wlc_hw, offset, v, OBJADDR_SHM_SEL);
}

static u16
-brcms_b_read_objmem(struct brcms_c_hw_info *wlc_hw, uint offset, u32 sel)
+brcms_b_read_objmem(struct brcms_hardware *wlc_hw, uint offset, u32 sel)
{
d11regs_t *regs = wlc_hw->regs;
volatile u16 *objdata_lo = (volatile u16 *)&regs->objdata;
@@ -3450,7 +3450,7 @@ brcms_b_read_objmem(struct brcms_c_hw_info *wlc_hw, uint offset, u32 sel)
}

static void
-brcms_b_write_objmem(struct brcms_c_hw_info *wlc_hw, uint offset, u16 v,
+brcms_b_write_objmem(struct brcms_hardware *wlc_hw, uint offset, u16 v,
u32 sel)
{
d11regs_t *regs = wlc_hw->regs;
@@ -3472,7 +3472,7 @@ brcms_b_write_objmem(struct brcms_c_hw_info *wlc_hw, uint offset, u16 v,
* 'sel' selects the type of memory
*/
void
-brcms_b_copyto_objmem(struct brcms_c_hw_info *wlc_hw, uint offset,
+brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw, uint offset,
const void *buf, int len, u32 sel)
{
u16 v;
@@ -3494,7 +3494,7 @@ brcms_b_copyto_objmem(struct brcms_c_hw_info *wlc_hw, uint offset,
* 'sel' selects the type of memory
*/
void
-brcms_b_copyfrom_objmem(struct brcms_c_hw_info *wlc_hw, uint offset, void *buf,
+brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset, void *buf,
int len, u32 sel)
{
u16 v;
@@ -3511,7 +3511,7 @@ brcms_b_copyfrom_objmem(struct brcms_c_hw_info *wlc_hw, uint offset, void *buf,
}
}

-void brcms_b_copyfrom_vars(struct brcms_c_hw_info *wlc_hw, char **buf,
+void brcms_b_copyfrom_vars(struct brcms_hardware *wlc_hw, char **buf,
uint *len)
{
BCMMSG(wlc_hw->wlc->wiphy, "nvram vars totlen=%d\n",
@@ -3521,7 +3521,7 @@ void brcms_b_copyfrom_vars(struct brcms_c_hw_info *wlc_hw, char **buf,
*len = wlc_hw->vars_size;
}

-void brcms_b_retrylimit_upd(struct brcms_c_hw_info *wlc_hw, u16 SRL, u16 LRL)
+void brcms_b_retrylimit_upd(struct brcms_hardware *wlc_hw, u16 SRL, u16 LRL)
{
wlc_hw->SRL = SRL;
wlc_hw->LRL = LRL;
@@ -3539,7 +3539,7 @@ void brcms_b_retrylimit_upd(struct brcms_c_hw_info *wlc_hw, u16 SRL, u16 LRL)
}
}

-void brcms_b_pllreq(struct brcms_c_hw_info *wlc_hw, bool set, mbool req_bit)
+void brcms_b_pllreq(struct brcms_hardware *wlc_hw, bool set, mbool req_bit)
{
if (set) {
if (mboolisset(wlc_hw->pllreq, req_bit))
@@ -3568,7 +3568,7 @@ void brcms_b_pllreq(struct brcms_c_hw_info *wlc_hw, bool set, mbool req_bit)
return;
}

-u16 brcms_b_rate_shm_offset(struct brcms_c_hw_info *wlc_hw, u8 rate)
+u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate)
{
u16 table_ptr;
u8 phy_rate, index;
@@ -3591,7 +3591,7 @@ u16 brcms_b_rate_shm_offset(struct brcms_c_hw_info *wlc_hw, u8 rate)
return 2 * brcms_b_read_shm(wlc_hw, table_ptr + (index * 2));
}

-void brcms_b_antsel_set(struct brcms_c_hw_info *wlc_hw, u32 antsel_avail)
+void brcms_b_antsel_set(struct brcms_hardware *wlc_hw, u32 antsel_avail)
{
wlc_hw->antsel_avail = antsel_avail;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.h b/drivers/staging/brcm80211/brcmsmac/bmac.h
index af4afa9..3c9ad4f 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.h
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.h
@@ -19,7 +19,7 @@
#include <brcmu_wifi.h>
#include "types.h"

-/* dup state between BMAC(struct brcms_c_hw_info) and HIGH(struct brcms_c_info)
+/* dup state between BMAC(struct brcms_hardware) and HIGH(struct brcms_c_info)
driver */
struct brcms_b_state {
u32 machwcap; /* mac hw capibility */
@@ -78,97 +78,97 @@ extern int brcms_b_detach(struct brcms_c_info *wlc);
extern void brcms_b_watchdog(void *arg);

/* up/down, reset, clk */
-extern void brcms_b_copyto_objmem(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw,
uint offset, const void *buf, int len,
u32 sel);
-extern void brcms_b_copyfrom_objmem(struct brcms_c_hw_info *wlc_hw, uint offset,
+extern void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
void *buf, int len, u32 sel);
#define brcms_b_copyfrom_shm(wlc_hw, offset, buf, len) \
brcms_b_copyfrom_objmem(wlc_hw, offset, buf, len, OBJADDR_SHM_SEL)
#define brcms_b_copyto_shm(wlc_hw, offset, buf, len) \
brcms_b_copyto_objmem(wlc_hw, offset, buf, len, OBJADDR_SHM_SEL)

-extern void brcms_b_core_phypll_reset(struct brcms_c_hw_info *wlc_hw);
-extern void brcms_b_core_phypll_ctl(struct brcms_c_hw_info *wlc_hw, bool on);
-extern void brcms_b_phyclk_fgc(struct brcms_c_hw_info *wlc_hw, bool clk);
-extern void brcms_b_macphyclk_set(struct brcms_c_hw_info *wlc_hw, bool clk);
-extern void brcms_b_phy_reset(struct brcms_c_hw_info *wlc_hw);
-extern void brcms_b_corereset(struct brcms_c_hw_info *wlc_hw, u32 flags);
-extern void brcms_b_reset(struct brcms_c_hw_info *wlc_hw);
-extern void brcms_b_init(struct brcms_c_hw_info *wlc_hw, chanspec_t chanspec,
+extern void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
+extern void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
+extern void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
+extern void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
+extern void brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
+extern void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
+extern void brcms_b_reset(struct brcms_hardware *wlc_hw);
+extern void brcms_b_init(struct brcms_hardware *wlc_hw, chanspec_t chanspec,
bool mute);
-extern int brcms_b_up_prep(struct brcms_c_hw_info *wlc_hw);
-extern int brcms_b_up_finish(struct brcms_c_hw_info *wlc_hw);
-extern int brcms_b_bmac_down_prep(struct brcms_c_hw_info *wlc_hw);
-extern int brcms_b_down_finish(struct brcms_c_hw_info *wlc_hw);
-extern void brcms_b_switch_macfreq(struct brcms_c_hw_info *wlc_hw, u8 spurmode);
+extern int brcms_b_up_prep(struct brcms_hardware *wlc_hw);
+extern int brcms_b_up_finish(struct brcms_hardware *wlc_hw);
+extern int brcms_b_bmac_down_prep(struct brcms_hardware *wlc_hw);
+extern int brcms_b_down_finish(struct brcms_hardware *wlc_hw);
+extern void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);

/* chanspec, ucode interface */
-extern void brcms_b_set_chanspec(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw,
chanspec_t chanspec,
bool mute, struct txpwr_limits *txpwr);

-extern int brcms_b_xmtfifo_sz_get(struct brcms_c_hw_info *wlc_hw, uint fifo,
+extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
uint *blocks);
-extern void brcms_b_mhf(struct brcms_c_hw_info *wlc_hw, u8 idx, u16 mask,
+extern void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask,
u16 val, int bands);
-extern void brcms_b_mctrl(struct brcms_c_hw_info *wlc_hw, u32 mask, u32 val);
-extern u16 brcms_b_mhf_get(struct brcms_c_hw_info *wlc_hw, u8 idx, int bands);
-extern void brcms_b_txant_set(struct brcms_c_hw_info *wlc_hw, u16 phytxant);
-extern u16 brcms_b_get_txant(struct brcms_c_hw_info *wlc_hw);
-extern void brcms_b_antsel_type_set(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
+extern u16 brcms_b_mhf_get(struct brcms_hardware *wlc_hw, u8 idx, int bands);
+extern void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
+extern u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
+extern void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw,
u8 antsel_type);
-extern int brcms_b_state_get(struct brcms_c_hw_info *wlc_hw,
+extern int brcms_b_state_get(struct brcms_hardware *wlc_hw,
struct brcms_b_state *state);
-extern void brcms_b_write_shm(struct brcms_c_hw_info *wlc_hw, uint offset,
+extern void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset,
u16 v);
-extern u16 brcms_b_read_shm(struct brcms_c_hw_info *wlc_hw, uint offset);
-extern void brcms_b_write_template_ram(struct brcms_c_hw_info *wlc_hw,
+extern u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
+extern void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw,
int offset, int len, void *buf);
-extern void brcms_b_copyfrom_vars(struct brcms_c_hw_info *wlc_hw, char **buf,
+extern void brcms_b_copyfrom_vars(struct brcms_hardware *wlc_hw, char **buf,
uint *len);

-extern void brcms_b_hw_etheraddr(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_b_hw_etheraddr(struct brcms_hardware *wlc_hw,
u8 *ea);

-extern bool brcms_b_radio_read_hwdisabled(struct brcms_c_hw_info *wlc_hw);
-extern void brcms_b_set_shortslot(struct brcms_c_hw_info *wlc_hw,
+extern bool brcms_b_radio_read_hwdisabled(struct brcms_hardware *wlc_hw);
+extern void brcms_b_set_shortslot(struct brcms_hardware *wlc_hw,
bool shortslot);
-extern void brcms_b_band_stf_ss_set(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw,
u8 stf_mode);

-extern void brcms_b_wait_for_wake(struct brcms_c_hw_info *wlc_hw);
+extern void brcms_b_wait_for_wake(struct brcms_hardware *wlc_hw);

-extern void brcms_c_ucode_wake_override_set(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
u32 override_bit);
-extern void brcms_c_ucode_wake_override_clear(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
u32 override_bit);

-extern void brcms_b_set_addrmatch(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_b_set_addrmatch(struct brcms_hardware *wlc_hw,
int match_reg_offset,
const u8 *addr);
-extern void brcms_b_write_hw_bcntemplates(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_b_write_hw_bcntemplates(struct brcms_hardware *wlc_hw,
void *bcn, int len, bool both);

-extern void brcms_b_read_tsf(struct brcms_c_hw_info *wlc_hw, u32 *tsf_l_ptr,
+extern void brcms_b_read_tsf(struct brcms_hardware *wlc_hw, u32 *tsf_l_ptr,
u32 *tsf_h_ptr);
-extern void brcms_b_set_cwmin(struct brcms_c_hw_info *wlc_hw, u16 newmin);
-extern void brcms_b_set_cwmax(struct brcms_c_hw_info *wlc_hw, u16 newmax);
+extern void brcms_b_set_cwmin(struct brcms_hardware *wlc_hw, u16 newmin);
+extern void brcms_b_set_cwmax(struct brcms_hardware *wlc_hw, u16 newmax);

-extern void brcms_b_retrylimit_upd(struct brcms_c_hw_info *wlc_hw, u16 SRL,
+extern void brcms_b_retrylimit_upd(struct brcms_hardware *wlc_hw, u16 SRL,
u16 LRL);

-extern void brcms_b_fifoerrors(struct brcms_c_hw_info *wlc_hw);
+extern void brcms_b_fifoerrors(struct brcms_hardware *wlc_hw);


/* API for BMAC driver (e.g. wlc_phy.c etc) */

-extern void brcms_b_bw_set(struct brcms_c_hw_info *wlc_hw, u16 bw);
-extern void brcms_b_pllreq(struct brcms_c_hw_info *wlc_hw, bool set,
+extern void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
+extern void brcms_b_pllreq(struct brcms_hardware *wlc_hw, bool set,
mbool req_bit);
-extern void brcms_b_hw_up(struct brcms_c_hw_info *wlc_hw);
-extern u16 brcms_b_rate_shm_offset(struct brcms_c_hw_info *wlc_hw, u8 rate);
-extern void brcms_b_antsel_set(struct brcms_c_hw_info *wlc_hw,
+extern void brcms_b_hw_up(struct brcms_hardware *wlc_hw);
+extern u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
+extern void brcms_b_antsel_set(struct brcms_hardware *wlc_hw,
u32 antsel_avail);

#endif /* _BRCM_BOTTOM_MAC_H_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/channel.c b/drivers/staging/brcm80211/brcmsmac/channel.c
index 6cf8ca1..ba245d8 100644
--- a/drivers/staging/brcm80211/brcmsmac/channel.c
+++ b/drivers/staging/brcm80211/brcmsmac/channel.c
@@ -869,7 +869,7 @@ brcms_c_channels_init(struct brcms_cm_info *wlc_cm,
{
struct brcms_c_info *wlc = wlc_cm->wlc;
uint i, j;
- struct brcms_c_band *band;
+ struct brcms_band *band;
const struct locale_info *li;
chanvec_t sup_chan;
const struct locale_mimo_info *li_mimo;
@@ -970,7 +970,7 @@ static void brcms_c_quiet_channels_reset(struct brcms_cm_info *wlc_cm)
{
struct brcms_c_info *wlc = wlc_cm->wlc;
uint i, j;
- struct brcms_c_band *band;
+ struct brcms_band *band;
const chanvec_t *chanvec;

memset(&wlc_cm->quiet_channels, 0, sizeof(chanvec_t));
@@ -1262,7 +1262,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, chanspec_t chanspec,
int maxpwr;
int delta;
const struct country_info *country;
- struct brcms_c_band *band;
+ struct brcms_band *band;
const struct locale_info *li;
int conducted_max;
int conducted_ofdm_max;
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index f9e134a..8d061ad 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -309,7 +309,7 @@ static u16 brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc,
static void brcms_c_bss_default_init(struct brcms_c_info *wlc);
static void brcms_c_ucode_mac_upd(struct brcms_c_info *wlc);
static ratespec_t mac80211_wlc_set_nrate(struct brcms_c_info *wlc,
- struct brcms_c_band *cur_band,
+ struct brcms_band *cur_band,
u32 int_val);
static void brcms_c_tx_prec_map_init(struct brcms_c_info *wlc);
static void brcms_c_watchdog(void *arg);
@@ -319,11 +319,11 @@ static int brcms_c_set_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs_arg);
static u8 brcms_c_local_constraint_qdbm(struct brcms_c_info *wlc);

/* send and receive */
-static struct brcms_c_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc);
+static struct brcms_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc);
static void brcms_c_txq_free(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *qi);
+ struct brcms_txq_info *qi);
static void brcms_c_txflowcontrol_signal(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *qi,
+ struct brcms_txq_info *qi,
bool on, int prio);
static void brcms_c_txflowcontrol_reset(struct brcms_c_info *wlc);
static void brcms_c_compute_cck_plcp(struct brcms_c_info *wlc, ratespec_t rate,
@@ -380,7 +380,7 @@ static int _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
{
int idx;
- struct brcms_c_bsscfg *cfg;
+ struct brcms_bss_cfg *cfg;

/* disallow PS when one of the following global conditions meets */
if (!wlc->pub->associated)
@@ -458,7 +458,7 @@ void brcms_c_init(struct brcms_c_info *wlc)
d11regs_t *regs;
chanspec_t chanspec;
int i;
- struct brcms_c_bsscfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg;
bool mute = false;

BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);
@@ -643,7 +643,7 @@ void brcms_c_set_ps_ctrl(struct brcms_c_info *wlc)
* Write this BSS config's MAC address to core.
* Updates RXE match engine.
*/
-int brcms_c_set_mac(struct brcms_c_bsscfg *cfg)
+int brcms_c_set_mac(struct brcms_bss_cfg *cfg)
{
int err = 0;
struct brcms_c_info *wlc = cfg->wlc;
@@ -661,7 +661,7 @@ int brcms_c_set_mac(struct brcms_c_bsscfg *cfg)
/* Write the BSS config's BSSID address to core (set_bssid in d11procs.tcl).
* Updates RXE match engine.
*/
-void brcms_c_set_bssid(struct brcms_c_bsscfg *cfg)
+void brcms_c_set_bssid(struct brcms_bss_cfg *cfg)
{
struct brcms_c_info *wlc = cfg->wlc;

@@ -683,7 +683,7 @@ void brcms_c_set_bssid(struct brcms_c_bsscfg *cfg)
void brcms_c_switch_shortslot(struct brcms_c_info *wlc, bool shortslot)
{
int idx;
- struct brcms_c_bsscfg *cfg;
+ struct brcms_bss_cfg *cfg;

/* use the override if it is set */
if (wlc->shortslot_override != WLC_SHORTSLOT_AUTO)
@@ -739,7 +739,7 @@ void brcms_c_set_home_chanspec(struct brcms_c_info *wlc, chanspec_t chanspec)
{
if (wlc->home_chanspec != chanspec) {
int idx;
- struct brcms_c_bsscfg *cfg;
+ struct brcms_bss_cfg *cfg;

wlc->home_chanspec = chanspec;

@@ -1052,7 +1052,7 @@ static void WLBANDINITFN(brcms_c_setband) (struct brcms_c_info *wlc,
uint bandunit)
{
int idx;
- struct brcms_c_bsscfg *cfg;
+ struct brcms_bss_cfg *cfg;

wlc->band = wlc->bandstate[bandunit];

@@ -1944,7 +1944,7 @@ static void brcms_c_watchdog(void *arg)
{
struct brcms_c_info *wlc = (struct brcms_c_info *) arg;
int i;
- struct brcms_c_bsscfg *cfg;
+ struct brcms_bss_cfg *cfg;

BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);

@@ -2051,7 +2051,7 @@ int brcms_c_up(struct brcms_c_info *wlc)
if (!mboolisset
(wlc->pub->radio_disabled, WL_RADIO_HW_DISABLE)) {
int idx;
- struct brcms_c_bsscfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg;
mboolset(wlc->pub->radio_disabled,
WL_RADIO_HW_DISABLE);

@@ -2158,7 +2158,7 @@ uint brcms_c_down(struct brcms_c_info *wlc)
uint callbacks = 0;
int i;
bool dev_gone = false;
- struct brcms_c_txq_info *qi;
+ struct brcms_txq_info *qi;

BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);

@@ -2230,7 +2230,7 @@ int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config)
bool preamble_restrict = false; /* Restrict association to stations that support short
* preambles
*/
- struct brcms_c_band *band;
+ struct brcms_band *band;

/* if N-support is enabled, allow Gmode set as long as requested
* Gmode is not GMODE_LEGACY_B
@@ -2531,7 +2531,7 @@ _brcms_c_ioctl(struct brcms_c_info *wlc, int cmd, void *arg, int len,
struct scb *nextscb;
bool ta_ok;
uint band;
- struct brcms_c_bsscfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg;
struct brcms_bss_info *current_bss;

/* update bsscfg pointer */
@@ -3155,7 +3155,7 @@ void brcms_c_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu,
uint prec)
{
struct brcms_c_info *wlc = (struct brcms_c_info *) ctx;
- struct brcms_c_txq_info *qi = wlc->pkt_queue; /* Check me */
+ struct brcms_txq_info *qi = wlc->pkt_queue; /* Check me */
struct pktq *q = &qi->q;
int prio;

@@ -3222,7 +3222,7 @@ void brcms_c_send_q(struct brcms_c_info *wlc)
u16 prec_map;
int err = 0, i, count;
uint fifo;
- struct brcms_c_txq_info *qi = wlc->pkt_queue;
+ struct brcms_txq_info *qi = wlc->pkt_queue;
struct pktq *q = &qi->q;
struct ieee80211_tx_info *tx_info;

@@ -3288,7 +3288,7 @@ void brcms_c_send_q(struct brcms_c_info *wlc)
* for MC frames so is used as part of the sequence number.
*/
static inline u16
-bcmc_fid_generate(struct brcms_c_info *wlc, struct brcms_c_bsscfg *bsscfg,
+bcmc_fid_generate(struct brcms_c_info *wlc, struct brcms_bss_cfg *bsscfg,
struct d11txh *txh)
{
u16 frameid;
@@ -4268,7 +4268,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,

void brcms_c_tbtt(struct brcms_c_info *wlc)
{
- struct brcms_c_bsscfg *cfg = wlc->cfg;
+ struct brcms_bss_cfg *cfg = wlc->cfg;

if (!cfg->BSS) {
/* DirFrmQ is now valid...defer setting until end of ATIM window */
@@ -5172,7 +5172,7 @@ bool brcms_c_valid_rate(struct brcms_c_info *wlc, ratespec_t rspec, int band,
static void brcms_c_update_mimo_band_bwcap(struct brcms_c_info *wlc, u8 bwcap)
{
uint i;
- struct brcms_c_band *band;
+ struct brcms_band *band;

for (i = 0; i < NBANDS(wlc); i++) {
if (IS_SINGLEBAND_5G(wlc->deviceid))
@@ -5249,7 +5249,7 @@ void brcms_c_mod_prb_rsp_rate_table(struct brcms_c_info *wlc, uint frame_len)
static void
brcms_c_bcn_prb_template(struct brcms_c_info *wlc, u16 type,
ratespec_t bcn_rspec,
- struct brcms_c_bsscfg *cfg, u16 *buf, int *len)
+ struct brcms_bss_cfg *cfg, u16 *buf, int *len)
{
static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
struct cck_phy_hdr *plcp;
@@ -5313,7 +5313,7 @@ int brcms_c_get_header_len()
* Otherwise, it updates the hardware template.
*/
void brcms_c_bss_update_beacon(struct brcms_c_info *wlc,
- struct brcms_c_bsscfg *cfg)
+ struct brcms_bss_cfg *cfg)
{
int len = BCN_TMPL_LEN;

@@ -5361,7 +5361,7 @@ void brcms_c_bss_update_beacon(struct brcms_c_info *wlc,
void brcms_c_update_beacon(struct brcms_c_info *wlc)
{
int idx;
- struct brcms_c_bsscfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg;

/* update AP or IBSS beacons */
FOREACH_BSS(wlc, idx, bsscfg) {
@@ -5371,7 +5371,7 @@ void brcms_c_update_beacon(struct brcms_c_info *wlc)
}

/* Write ssid into shared memory */
-void brcms_c_shm_ssid_upd(struct brcms_c_info *wlc, struct brcms_c_bsscfg *cfg)
+void brcms_c_shm_ssid_upd(struct brcms_c_info *wlc, struct brcms_bss_cfg *cfg)
{
u8 *ssidptr = cfg->SSID;
u16 base = M_SSID;
@@ -5390,7 +5390,7 @@ void brcms_c_shm_ssid_upd(struct brcms_c_info *wlc, struct brcms_c_bsscfg *cfg)
void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend)
{
int idx;
- struct brcms_c_bsscfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg;

/* update AP or IBSS probe responses */
FOREACH_BSS(wlc, idx, bsscfg) {
@@ -5401,7 +5401,7 @@ void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend)

void
brcms_c_bss_update_probe_resp(struct brcms_c_info *wlc,
- struct brcms_c_bsscfg *cfg,
+ struct brcms_bss_cfg *cfg,
bool suspend)
{
u16 prb_resp[BCN_TMPL_LEN / 2];
@@ -5475,7 +5475,7 @@ int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu, uint *fifop)
void brcms_c_reprate_init(struct brcms_c_info *wlc)
{
int i;
- struct brcms_c_bsscfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg;

FOREACH_BSS(wlc, i, bsscfg) {
brcms_c_bsscfg_reprate_init(bsscfg);
@@ -5483,7 +5483,7 @@ void brcms_c_reprate_init(struct brcms_c_info *wlc)
}

/* per bsscfg init tx reported rate mechanism */
-void brcms_c_bsscfg_reprate_init(struct brcms_c_bsscfg *bsscfg)
+void brcms_c_bsscfg_reprate_init(struct brcms_bss_cfg *bsscfg)
{
bsscfg->txrspecidx = 0;
memset((char *)bsscfg->txrspec, 0, sizeof(bsscfg->txrspec));
@@ -5501,7 +5501,7 @@ void brcms_default_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs)
static void brcms_c_bss_default_init(struct brcms_c_info *wlc)
{
chanspec_t chanspec;
- struct brcms_c_band *band;
+ struct brcms_band *band;
struct brcms_bss_info *bi = wlc->default_bss;

/* init default and target BSS with some sane initial values */
@@ -5531,7 +5531,7 @@ static void brcms_c_bss_default_init(struct brcms_c_info *wlc)
}

static ratespec_t
-mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_c_band *cur_band,
+mac80211_wlc_set_nrate(struct brcms_c_info *wlc, struct brcms_band *cur_band,
u32 int_val)
{
u8 stf = (int_val & NRATE_STF_MASK) >> NRATE_STF_SHIFT;
@@ -5753,7 +5753,7 @@ void brcms_c_reset_bmac_done(struct brcms_c_info *wlc)
/* check for the particular priority flow control bit being set */
bool
brcms_c_txflowcontrol_prio_isset(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *q,
+ struct brcms_txq_info *q,
int prio)
{
uint prio_mask;
@@ -5769,7 +5769,7 @@ brcms_c_txflowcontrol_prio_isset(struct brcms_c_info *wlc,

/* propagate the flow control to all interfaces using the given tx queue */
void brcms_c_txflowcontrol(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *qi,
+ struct brcms_txq_info *qi,
bool on, int prio)
{
uint prio_bits;
@@ -5812,7 +5812,7 @@ void brcms_c_txflowcontrol(struct brcms_c_info *wlc,

void
brcms_c_txflowcontrol_override(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *qi,
+ struct brcms_txq_info *qi,
bool on, uint override)
{
uint prev_override;
@@ -5858,7 +5858,7 @@ brcms_c_txflowcontrol_override(struct brcms_c_info *wlc,

static void brcms_c_txflowcontrol_reset(struct brcms_c_info *wlc)
{
- struct brcms_c_txq_info *qi;
+ struct brcms_txq_info *qi;

for (qi = wlc->tx_queues; qi != NULL; qi = qi->next) {
if (qi->stopped) {
@@ -5870,7 +5870,7 @@ static void brcms_c_txflowcontrol_reset(struct brcms_c_info *wlc)

static void
brcms_c_txflowcontrol_signal(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *qi, bool on, int prio)
+ struct brcms_txq_info *qi, bool on, int prio)
{
#ifdef NON_FUNCTIONAL
/* wlcif_list is never filled so this function is not functional */
@@ -5883,11 +5883,11 @@ brcms_c_txflowcontrol_signal(struct brcms_c_info *wlc,
#endif
}

-static struct brcms_c_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc)
+static struct brcms_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc)
{
- struct brcms_c_txq_info *qi, *p;
+ struct brcms_txq_info *qi, *p;

- qi = kzalloc(sizeof(struct brcms_c_txq_info), GFP_ATOMIC);
+ qi = kzalloc(sizeof(struct brcms_txq_info), GFP_ATOMIC);
if (qi != NULL) {
/*
* Have enough room for control packets along with HI watermark
@@ -5913,9 +5913,9 @@ static struct brcms_c_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc)
}

static void brcms_c_txq_free(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *qi)
+ struct brcms_txq_info *qi)
{
- struct brcms_c_txq_info *p;
+ struct brcms_txq_info *p;

if (qi == NULL)
return;
@@ -5958,7 +5958,7 @@ void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state)
* AMPDU traffic, packets pending in hardware have to be invalidated so that
* when later on hardware releases them, they can be handled appropriately.
*/
-void brcms_c_inval_dma_pkts(struct brcms_c_hw_info *hw,
+void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
struct ieee80211_sta *sta,
void (*dma_callback_fn))
{
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 6b8b4d2..80b08a9 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -73,13 +73,6 @@
(((val) & (~(field ## _M << field ## _S))) | \
((unsigned)(bits) << field ## _S))

-/* For managing scan result lists */
-struct brcms_c_bss_list {
- uint count;
- bool beacon; /* set for beacon, cleared for probe response */
- struct brcms_bss_info *ptrs[MAXBSS];
-};
-
#define SW_TIMER_MAC_STAT_UPD 30 /* periodic MAC stats update */

/* Double check that unsupported cores are not enabled */
@@ -236,7 +229,7 @@ extern const u8 prio2fifo[];

#define WLCWLUNIT(wlc) ((wlc)->pub->unit)

-struct brcms_c_protection {
+struct brcms_protection {
bool _g; /* use g spec protection, driver internal */
s8 g_override; /* override for use of g spec protection */
u8 gmode_user; /* user config gmode, operating band->gmode is different */
@@ -251,7 +244,7 @@ struct brcms_c_protection {
};

/* anything affects the single/dual streams/antenna operation */
-struct brcms_c_stf {
+struct brcms_stf {
u8 hw_txchain; /* HW txchain bitmap cfg */
u8 txchain; /* txchain bitmap being used */
u8 txstreams; /* number of txchains being used */
@@ -348,7 +341,7 @@ struct wsec_key {
/*
* core state (mac)
*/
-struct brcms_c_core {
+struct brcms_core {
uint coreidx; /* # sb enumerated core */

/* fifo */
@@ -361,7 +354,7 @@ struct brcms_c_core {
/*
* band state (phy+ana+radio)
*/
-struct brcms_c_band {
+struct brcms_band {
int bandtype; /* WLC_BAND_2G, WLC_BAND_5G */
uint bandunit; /* bandstate[] index */

@@ -450,19 +443,19 @@ struct brcms_c_if {
*/
u8 flags; /* flags for the interface */
struct brcms_if *wlif; /* pointer to wlif */
- struct brcms_c_txq_info *qi; /* pointer to associated tx queue */
+ struct brcms_txq_info *qi; /* pointer to associated tx queue */
union {
/* pointer to scb if WLC_IFTYPE_WDS */
struct scb *scb;
/* pointer to bsscfg if WLC_IFTYPE_BSS */
- struct brcms_c_bsscfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg;
} u;
};

/* flags for the interface, this interface is linked to a brcms_if */
#define WLC_IF_LINKED 0x02

-struct brcms_c_hwband {
+struct brcms_hw_band {
int bandtype; /* WLC_BAND_2G, WLC_BAND_5G */
uint bandunit; /* bandstate[] index */
u16 mhfs[MHFMAX]; /* MHF array shadow */
@@ -479,7 +472,7 @@ struct brcms_c_hwband {
bool abgphy_encore;
};

-struct brcms_c_hw_info {
+struct brcms_hardware {
bool _piomode; /* true if pio mode */
struct brcms_c_info *wlc;

@@ -506,9 +499,9 @@ struct brcms_c_hw_info {
d11regs_t *regs; /* pointer to device registers */
void *physhim; /* phy shim layer handler */
void *phy_sh; /* pointer to shared phy state */
- struct brcms_c_hwband *band;/* pointer to active per-band state */
+ struct brcms_hw_band *band;/* pointer to active per-band state */
/* band state per phy/radio */
- struct brcms_c_hwband *bandstate[MAXBANDS];
+ struct brcms_hw_band *bandstate[MAXBANDS];
u16 bmac_phytxant; /* cache of high phytxant state */
bool shortslot; /* currently using 11g ShortSlot timing */
u16 SRL; /* 802.11 dot11ShortRetryLimit */
@@ -561,8 +554,8 @@ struct brcms_c_hw_info {
* if they belong to the same flow of traffic from the device. For multi-channel
* operation there are independent TX Queues for each channel.
*/
-struct brcms_c_txq_info {
- struct brcms_c_txq_info *next;
+struct brcms_txq_info {
+ struct brcms_txq_info *next;
struct pktq q;
uint stopped; /* tx flow control bits */
};
@@ -576,7 +569,7 @@ struct brcms_c_info {
d11regs_t *regs; /* pointer to device registers */

/* HW related state used primarily by BMAC */
- struct brcms_c_hw_info *hw;
+ struct brcms_hardware *hw;

/* clock */
int clkreq_override; /* setting for clkreq for PCIE : Auto, 0, 1 */
@@ -593,11 +586,11 @@ struct brcms_c_info {
bool clk; /* core is out of reset and has clock */

/* multiband */
- struct brcms_c_core *core; /* pointer to active io core */
- struct brcms_c_band *band; /* pointer to active per-band state */
- struct brcms_c_core *corestate; /* per-core state (one per hw core) */
+ struct brcms_core *core; /* pointer to active io core */
+ struct brcms_band *band; /* pointer to active per-band state */
+ struct brcms_core *corestate; /* per-core state (one per hw core) */
/* per-band state (one per phy/radio): */
- struct brcms_c_band *bandstate[MAXBANDS];
+ struct brcms_band *bandstate[MAXBANDS];

bool war16165; /* PCI slow clock 16165 war flag */

@@ -680,11 +673,11 @@ struct brcms_c_info {
* BSS Configurations set of BSS configurations, idx 0 is default and
* always valid
*/
- struct brcms_c_bsscfg *bsscfg[WLC_MAXBSSCFG];
- struct brcms_c_bsscfg *cfg; /* the primary bsscfg (can be AP or STA) */
+ struct brcms_bss_cfg *bsscfg[WLC_MAXBSSCFG];
+ struct brcms_bss_cfg *cfg; /* the primary bsscfg (can be AP or STA) */

/* tx queue */
- struct brcms_c_txq_info *tx_queues; /* common TX Queue list */
+ struct brcms_txq_info *tx_queues; /* common TX Queue list */

/* security */
struct wsec_key *wsec_keys[WSEC_MAX_KEYS]; /* dynamic key storage */
@@ -737,10 +730,10 @@ struct brcms_c_info {
s8 shortslot_override; /* 11g ShortSlot override */
bool include_legacy_erp; /* include Legacy ERP info elt ID 47 as well as g ID 42 */

- struct brcms_c_protection *protection;
+ struct brcms_protection *protection;
s8 PLCPHdr_override; /* 802.11b Preamble Type override */

- struct brcms_c_stf *stf;
+ struct brcms_stf *stf;

ratespec_t bcn_rspec; /* save bcn ratespec purpose */

@@ -751,7 +744,7 @@ struct brcms_c_info {

u16 next_bsscfg_ID;

- struct brcms_c_txq_info *pkt_queue; /* txq for transmit packets */
+ struct brcms_txq_info *pkt_queue; /* txq for transmit packets */
u32 mpc_dur; /* total time (ms) in mpc mode except for the
* portion since radio is turned off last time
*/
@@ -775,7 +768,7 @@ struct antsel_info {
};

/* BSS configuration state */
-struct brcms_c_bsscfg {
+struct brcms_bss_cfg {
struct brcms_c_info *wlc; /* wlc to which this bsscfg belongs to. */
bool up; /* is this configuration up operational */
bool enable; /* is this configuration enabled */
@@ -906,8 +899,8 @@ extern void brcms_c_print_txdesc(struct d11txh *txh);
#define brcms_c_print_txdesc(a)
#endif

-extern void brcms_c_setxband(struct brcms_c_hw_info *wlc_hw, uint bandunit);
-extern void brcms_c_coredisable(struct brcms_c_hw_info *wlc_hw);
+extern void brcms_c_setxband(struct brcms_hardware *wlc_hw, uint bandunit);
+extern void brcms_c_coredisable(struct brcms_hardware *wlc_hw);

extern bool brcms_c_valid_rate(struct brcms_c_info *wlc, ratespec_t rate,
int band, bool verbose);
@@ -915,7 +908,7 @@ extern void brcms_c_ap_upd(struct brcms_c_info *wlc);

/* helper functions */
extern void brcms_c_shm_ssid_upd(struct brcms_c_info *wlc,
- struct brcms_c_bsscfg *cfg);
+ struct brcms_bss_cfg *cfg);
extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);

extern void brcms_c_mac_bcn_promisc_change(struct brcms_c_info *wlc,
@@ -923,13 +916,13 @@ extern void brcms_c_mac_bcn_promisc_change(struct brcms_c_info *wlc,
extern void brcms_c_mac_bcn_promisc(struct brcms_c_info *wlc);
extern void brcms_c_mac_promisc(struct brcms_c_info *wlc);
extern void brcms_c_txflowcontrol(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *qi,
+ struct brcms_txq_info *qi,
bool on, int prio);
extern void brcms_c_txflowcontrol_override(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *qi,
+ struct brcms_txq_info *qi,
bool on, uint override);
extern bool brcms_c_txflowcontrol_prio_isset(struct brcms_c_info *wlc,
- struct brcms_c_txq_info *qi,
+ struct brcms_txq_info *qi,
int prio);
extern void brcms_c_send_q(struct brcms_c_info *wlc);
extern int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu,
@@ -948,12 +941,12 @@ extern u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
bool ba);

extern void brcms_c_tbtt(struct brcms_c_info *wlc);
-extern void brcms_c_inval_dma_pkts(struct brcms_c_hw_info *hw,
+extern void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
struct ieee80211_sta *sta,
void (*dma_callback_fn));

extern void brcms_c_reprate_init(struct brcms_c_info *wlc);
-extern void brcms_c_bsscfg_reprate_init(struct brcms_c_bsscfg *bsscfg);
+extern void brcms_c_bsscfg_reprate_init(struct brcms_bss_cfg *bsscfg);

/* Shared memory access */
extern void brcms_c_write_shm(struct brcms_c_info *wlc, uint offset, u16 v);
@@ -963,11 +956,11 @@ extern void brcms_c_copyto_shm(struct brcms_c_info *wlc, uint offset,

extern void brcms_c_update_beacon(struct brcms_c_info *wlc);
extern void brcms_c_bss_update_beacon(struct brcms_c_info *wlc,
- struct brcms_c_bsscfg *bsscfg);
+ struct brcms_bss_cfg *bsscfg);

extern void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
extern void brcms_c_bss_update_probe_resp(struct brcms_c_info *wlc,
- struct brcms_c_bsscfg *cfg,
+ struct brcms_bss_cfg *cfg,
bool suspend);
extern bool brcms_c_ismpc(struct brcms_c_info *wlc);
extern bool brcms_c_is_non_delay_mpc(struct brcms_c_info *wlc);
@@ -990,15 +983,15 @@ extern bool brcms_c_timers_init(struct brcms_c_info *wlc, int unit);

extern int brcms_c_set_nmode(struct brcms_c_info *wlc, s32 nmode);
extern void brcms_c_mimops_action_ht_send(struct brcms_c_info *wlc,
- struct brcms_c_bsscfg *bsscfg,
+ struct brcms_bss_cfg *bsscfg,
u8 mimops_mode);

extern void brcms_c_switch_shortslot(struct brcms_c_info *wlc, bool shortslot);
-extern void brcms_c_set_bssid(struct brcms_c_bsscfg *cfg);
+extern void brcms_c_set_bssid(struct brcms_bss_cfg *cfg);
extern void brcms_c_edcf_setparams(struct brcms_c_info *wlc, bool suspend);

extern void brcms_c_set_ratetable(struct brcms_c_info *wlc);
-extern int brcms_c_set_mac(struct brcms_c_bsscfg *cfg);
+extern int brcms_c_set_mac(struct brcms_bss_cfg *cfg);
extern void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc,
ratespec_t bcn_rate);
extern void brcms_c_mod_prb_rsp_rate_table(struct brcms_c_info *wlc,
diff --git a/drivers/staging/brcm80211/brcmsmac/phy_shim.c b/drivers/staging/brcm80211/brcmsmac/phy_shim.c
index e681f83..12defaa 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy_shim.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy_shim.c
@@ -30,12 +30,12 @@

/* PHY SHIM module specific state */
struct phy_shim_info {
- struct brcms_c_hw_info *wlc_hw; /* pointer to main wlc_hw structure */
+ struct brcms_hardware *wlc_hw; /* pointer to main wlc_hw structure */
void *wlc; /* pointer to main wlc structure */
void *wl; /* pointer to os-specific private state */
};

-struct phy_shim_info *wlc_phy_shim_attach(struct brcms_c_hw_info *wlc_hw,
+struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
void *wl, void *wlc) {
struct phy_shim_info *physhim = NULL;

diff --git a/drivers/staging/brcm80211/brcmsmac/phy_shim.h b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
index 0a29b67..0ac7fa5 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy_shim.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
@@ -108,7 +108,7 @@
#define WLC_N_TXRX_CHAIN0 0
#define WLC_N_TXRX_CHAIN1 1

-extern struct phy_shim_info *wlc_phy_shim_attach(struct brcms_c_hw_info *wlc_hw,
+extern struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
void *wl, void *wlc);
extern void wlc_phy_shim_detach(struct phy_shim_info *physhim);

diff --git a/drivers/staging/brcm80211/brcmsmac/stf.c b/drivers/staging/brcm80211/brcmsmac/stf.c
index b51ca7a..6bece8e 100644
--- a/drivers/staging/brcm80211/brcmsmac/stf.c
+++ b/drivers/staging/brcm80211/brcmsmac/stf.c
@@ -290,7 +290,7 @@ int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force)
}

/* update wlc->stf->ss_opmode which represents the operational stf_ss mode we're using */
-int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_c_band *band)
+int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band)
{
int ret_code = 0;
u8 prev_stf_ss;
diff --git a/drivers/staging/brcm80211/brcmsmac/stf.h b/drivers/staging/brcm80211/brcmsmac/stf.h
index 2033938..06c2a39 100644
--- a/drivers/staging/brcm80211/brcmsmac/stf.h
+++ b/drivers/staging/brcm80211/brcmsmac/stf.h
@@ -27,7 +27,7 @@ extern void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
u16 *ss_algo_channel,
chanspec_t chanspec);
extern int brcms_c_stf_ss_update(struct brcms_c_info *wlc,
- struct brcms_c_band *band);
+ struct brcms_band *band);
extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
extern int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val,
bool force);
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index 7ab4263..17c1d8a 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -358,12 +358,12 @@ struct ieee80211_sta;
struct ieee80211_tx_queue_params;
struct brcms_info;
struct brcms_c_info;
-struct brcms_c_hw_info;
+struct brcms_hardware;
struct brcms_c_if;
struct brcmu_iovar;
struct brcmu_strbuf;
-struct brcms_c_txq_info;
-struct brcms_c_band;
+struct brcms_txq_info;
+struct brcms_band;
struct dma_pub;
struct si_pub;
struct tx_status;
--
1.7.4.1



2011-07-05 22:03:20

by Arend van Spriel

[permalink] [raw]
Subject: [PATCH 30/31] staging: brcm80211: simpler string handling in brcmf_c_pktfilter_offload_set()

From: Roland Vossen <[email protected]>

Replaced two functions with strcpy().

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index c37128d..fdec468 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -958,13 +958,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
goto fail;
}

- memcpy(arg_save, arg, strlen(arg) + 1);
-
- if (strlen(arg) > PKTFILTER_BUF_SIZE) {
- BRCMF_ERROR(("Not enough buffer %d < %d\n", (int)strlen(arg),
- (int)sizeof(buf)));
- goto fail;
- }
+ strcpy(arg_save, arg);

argv[i] = strsep(&arg_save, " ");
while (argv[i++])
@@ -977,9 +971,8 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
}

str = "pkt_filter_add";
+ strcpy(buf, str);
str_len = strlen(str);
- strncpy(buf, str, str_len);
- buf[str_len] = '\0';
buf_len = str_len + 1;

pkt_filterp = (struct brcmf_pkt_filter *) (buf + str_len + 1);
--
1.7.4.1