Skip to content

Commit

Permalink
staging: brcm80211: remove conditional code fragments from brcmfmac
Browse files Browse the repository at this point in the history
The fullmac sources contained a lot of conditional code sections that
are never to be enabled for the fullmac driver. These have been removed.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Jul 5, 2011
1 parent e327ec2 commit 67a646f
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 747 deletions.
9 changes: 0 additions & 9 deletions drivers/staging/brcm80211/brcmfmac/bcmsdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ struct brcmf_sdio {
/* local copy of bcm sd handler */
struct brcmf_sdio *l_bcmsdh;

#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
extern int brcmf_sdioh_enable_hw_oob_intr(void *sdioh, bool enable);

void brcmf_sdcard_enable_hw_oob_intr(struct brcmf_sdio *sdh, bool enable)
{
brcmf_sdioh_enable_hw_oob_intr(sdh->sdioh, enable);
}
#endif

struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
{
struct brcmf_sdio *bcmsdh;
Expand Down
101 changes: 0 additions & 101 deletions drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@
#include <brcmu_wifi.h>
#include "sdio_host.h"

#if defined(OOB_INTR_ONLY)
#include <linux/irq.h>
extern void brcmf_sdbrcm_isr(void *args);
#endif /* defined(OOB_INTR_ONLY) */
#if defined(CONFIG_MACH_SANDGATE2G) || defined(CONFIG_MACH_LOGICPD_PXA270)

#include <linux/platform_device.h>
#endif /* CONFIG_MACH_SANDGATE2G */

#include "dngl_stats.h"
#include "dhd.h"
Expand All @@ -56,9 +49,6 @@ struct bcmsdh_hc {
unsigned long oob_flags; /* OOB Host specifiction
as edge and etc */
bool oob_irq_registered;
#if defined(OOB_INTR_ONLY)
spinlock_t irq_lock;
#endif
};
static struct bcmsdh_hc *sdhcinfo;

Expand Down Expand Up @@ -129,20 +119,6 @@ int brcmf_sdio_probe(struct device *dev)
u32 vendevid;
unsigned long irq_flags = 0;

#if defined(OOB_INTR_ONLY)
#ifdef HW_OOB
irq_flags =
IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL |
IORESOURCE_IRQ_SHAREABLE;
#else
irq_flags = IRQF_TRIGGER_FALLING;
#endif /* HW_OOB */
irq = brcmf_customer_oob_irq_map(&irq_flags);
if (irq < 0) {
SDLX_MSG(("%s: Host irq is not defined\n", __func__));
return 1;
}
#endif /* defined(OOB_INTR_ONLY) */
/* allocate SDIO Host Controller state info */
sdhc = kzalloc(sizeof(struct bcmsdh_hc), GFP_ATOMIC);
if (!sdhc) {
Expand All @@ -161,9 +137,6 @@ int brcmf_sdio_probe(struct device *dev)
sdhc->oob_irq = irq;
sdhc->oob_flags = irq_flags;
sdhc->oob_irq_registered = false; /* to make sure.. */
#if defined(OOB_INTR_ONLY)
spin_lock_init(&sdhc->irq_lock);
#endif

/* chain SDIO Host Controller info together */
sdhc->next = sdhcinfo;
Expand Down Expand Up @@ -238,80 +211,6 @@ void brcmf_sdio_unregister(void)
brcmf_sdio_function_cleanup();
}

#if defined(OOB_INTR_ONLY)
void brcmf_sdio_oob_intr_set(bool enable)
{
static bool curstate = 1;
unsigned long flags;

spin_lock_irqsave(&sdhcinfo->irq_lock, flags);
if (curstate != enable) {
if (enable)
enable_irq(sdhcinfo->oob_irq);
else
disable_irq_nosync(sdhcinfo->oob_irq);
curstate = enable;
}
spin_unlock_irqrestore(&sdhcinfo->irq_lock, flags);
}

static irqreturn_t brcmf_sdio_oob_irq(int irq, void *dev_id)
{
dhd_pub_t *dhdp;

dhdp = (dhd_pub_t *) dev_get_drvdata(sdhcinfo->dev);

brcmf_sdio_oob_intr_set(0);

if (dhdp == NULL) {
SDLX_MSG(("Out of band GPIO interrupt fired way too early\n"));
return IRQ_HANDLED;
}

brcmf_sdbrcm_isr((void *)dhdp->bus);

return IRQ_HANDLED;
}

int brcmf_sdio_register_oob_intr(void *dhdp)
{
int error = 0;

SDLX_MSG(("%s Enter\n", __func__));

sdhcinfo->oob_flags =
IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL |
IORESOURCE_IRQ_SHAREABLE;
dev_set_drvdata(sdhcinfo->dev, dhdp);

if (!sdhcinfo->oob_irq_registered) {
SDLX_MSG(("%s IRQ=%d Type=%X\n", __func__,
(int)sdhcinfo->oob_irq, (int)sdhcinfo->oob_flags));
/* Refer to customer Host IRQ docs about
proper irqflags definition */
error =
request_irq(sdhcinfo->oob_irq, brcmf_sdio_oob_irq,
sdhcinfo->oob_flags, "bcmsdh_sdmmc", NULL);
if (error)
return -ENODEV;

irq_set_irq_wake(sdhcinfo->oob_irq, 1);
sdhcinfo->oob_irq_registered = true;
}

return 0;
}

void brcmf_sdio_unregister_oob_intr(void)
{
SDLX_MSG(("%s: Enter\n", __func__));

irq_set_irq_wake(sdhcinfo->oob_irq, 0);
disable_irq(sdhcinfo->oob_irq); /* just in case.. */
free_irq(sdhcinfo->oob_irq, NULL);
sdhcinfo->oob_irq_registered = false;
}
#endif /* defined(OOB_INTR_ONLY) */
/* Module parameters specific to each host-controller driver */

extern uint sd_msglevel; /* Debug message level */
Expand Down
135 changes: 3 additions & 132 deletions drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@
extern int brcmf_sdio_function_init(void);
extern void brcmf_sdio_function_cleanup(void);

#if !defined(OOB_INTR_ONLY)
static void brcmf_sdioh_irqhandler(struct sdio_func *func);
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
#endif /* !defined(OOB_INTR_ONLY) */
static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr);
extern int brcmf_sdioh_reset_comm(struct mmc_card *card);

Expand Down Expand Up @@ -191,74 +189,6 @@ extern int brcmf_sdioh_detach(struct sdioh_info *sd)
return SDIOH_API_RC_SUCCESS;
}

#if defined(OOB_INTR_ONLY) && defined(HW_OOB)

extern int brcmf_sdioh_enable_func_intr(void)
{
u8 reg;
int err;

if (gInstance->func[0]) {
sdio_claim_host(gInstance->func[0]);

reg = sdio_readb(gInstance->func[0], SDIOD_CCCR_INTEN, &err);
if (err) {
sd_err(("%s: error for read SDIO_CCCR_IENx : 0x%x\n",
__func__, err));
sdio_release_host(gInstance->func[0]);
return SDIOH_API_RC_FAIL;
}

/* Enable F1 and F2 interrupts, set master enable */
reg |=
(INTR_CTL_FUNC1_EN | INTR_CTL_FUNC2_EN |
INTR_CTL_MASTER_EN);

sdio_writeb(gInstance->func[0], reg, SDIOD_CCCR_INTEN, &err);
sdio_release_host(gInstance->func[0]);

if (err) {
sd_err(("%s: error for write SDIO_CCCR_IENx : 0x%x\n",
__func__, err));
return SDIOH_API_RC_FAIL;
}
}

return SDIOH_API_RC_SUCCESS;
}

extern int brcmf_sdioh_disable_func_intr(void)
{
u8 reg;
int err;

if (gInstance->func[0]) {
sdio_claim_host(gInstance->func[0]);
reg = sdio_readb(gInstance->func[0], SDIOD_CCCR_INTEN, &err);
if (err) {
sd_err(("%s: error for read SDIO_CCCR_IENx : 0x%x\n",
__func__, err));
sdio_release_host(gInstance->func[0]);
return SDIOH_API_RC_FAIL;
}

reg &= ~(INTR_CTL_FUNC1_EN | INTR_CTL_FUNC2_EN);
/* Disable master interrupt with the last function interrupt */
if (!(reg & 0xFE))
reg = 0;
sdio_writeb(gInstance->func[0], reg, SDIOD_CCCR_INTEN, &err);

sdio_release_host(gInstance->func[0]);
if (err) {
sd_err(("%s: error for write SDIO_CCCR_IENx : 0x%x\n",
__func__, err));
return SDIOH_API_RC_FAIL;
}
}
return SDIOH_API_RC_SUCCESS;
}
#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */

/* Configure callback to client when we receive client interrupt */
extern int
brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
Expand All @@ -270,7 +200,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
__func__));
return SDIOH_API_RC_FAIL;
}
#if !defined(OOB_INTR_ONLY)

sd->intr_handler = fn;
sd->intr_handler_arg = argh;
sd->intr_handler_valid = true;
Expand All @@ -287,17 +217,14 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
sdio_claim_irq(gInstance->func[1], brcmf_sdioh_irqhandler);
sdio_release_host(gInstance->func[1]);
}
#elif defined(HW_OOB)
brcmf_sdioh_enable_func_intr();
#endif /* defined(OOB_INTR_ONLY) */

return SDIOH_API_RC_SUCCESS;
}

extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
{
sd_trace(("%s: Entering\n", __func__));

#if !defined(OOB_INTR_ONLY)
if (gInstance->func[1]) {
/* register and unmask irq */
sdio_claim_host(gInstance->func[1]);
Expand All @@ -316,9 +243,7 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
sd->intr_handler_valid = false;
sd->intr_handler = NULL;
sd->intr_handler_arg = NULL;
#elif defined(HW_OOB)
brcmf_sdioh_disable_func_intr();
#endif /* !defined(OOB_INTR_ONLY) */

return SDIOH_API_RC_SUCCESS;
}

Expand Down Expand Up @@ -536,24 +461,6 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
return bcmerror;
}

#if defined(OOB_INTR_ONLY) && defined(HW_OOB)

int brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
{
int status;
u8 data;

if (enable)
data = 3; /* enable hw oob interrupt */
else
data = 4; /* disable hw oob interrupt */
data |= 4; /* Active HIGH */

status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, 0, 0xf2, &data);
return status;
}
#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */

extern int
brcmf_sdioh_cfg_read(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
{
Expand Down Expand Up @@ -800,13 +707,6 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
pkt_len += 3;
pkt_len &= 0xFFFFFFFC;

#ifdef CONFIG_MMC_MSM7X00A
if ((pkt_len % 64) == 32) {
sd_trace(("%s: Rounding up TX packet +=32\n",
__func__));
pkt_len += 32;
}
#endif /* CONFIG_MMC_MSM7X00A */
/* Make sure the packet is aligned properly.
* If it isn't, then this
* is the fault of brcmf_sdioh_request_buffer() which
Expand Down Expand Up @@ -1007,7 +907,6 @@ brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
return SUCCESS;
}

#if !defined(OOB_INTR_ONLY)
/* bcmsdh_sdmmc interrupt handler */
static void brcmf_sdioh_irqhandler(struct sdio_func *func)
{
Expand Down Expand Up @@ -1045,34 +944,6 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)

ASSERT(sd != NULL);
}
#endif /* !defined(OOB_INTR_ONLY) */

#ifdef NOTUSED
/* Write client card reg */
static int
brcmf_sdioh_card_regwrite(struct sdioh_info *sd, int func, u32 regaddr,
int regsize, u32 data)
{

if ((func == 0) || (regsize == 1)) {
u8 temp;

temp = data & 0xff;
brcmf_sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
sd_data(("%s: byte write data=0x%02x\n", __func__, data));
} else {
if (regsize == 2)
data &= 0xffff;

brcmf_sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr,
&data, regsize);

sd_data(("%s: word write data=0x%08x\n", __func__, data));
}

return SUCCESS;
}
#endif /* NOTUSED */

int brcmf_sdioh_start(struct sdioh_info *si, int stage)
{
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,11 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
sdos = (struct sdos_info *)sd->sdos_info;
ASSERT(sdos);

#if !defined(OOB_INTR_ONLY)
if (enable && !(sd->intr_handler && sd->intr_handler_arg)) {
sd_err(("%s: no handler registered, will not enable\n",
__func__));
return SDIOH_API_RC_FAIL;
}
#endif /* !defined(OOB_INTR_ONLY) */

/* Ensure atomicity for enable/disable calls */
spin_lock_irqsave(&sdos->lock, flags);
Expand Down
6 changes: 0 additions & 6 deletions drivers/staging/brcm80211/brcmfmac/dhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,6 @@ typedef struct dhd_pub {
int suspend_disable_flag; /* "1" to disable all extra powersaving
during suspend */
int in_suspend; /* flag set to 1 when early suspend called */
#ifdef PNO_SUPPORT
int pno_enable; /* pno status : "1" is pno enable */
#endif /* PNO_SUPPORT */
int dtim_skip; /* dtim skip , default 0 means wake each dtim */

/* Pkt filter defination */
Expand Down Expand Up @@ -936,9 +933,6 @@ extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
#ifdef BCMDBG
extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
#endif /* BCMDBG */
#if defined(OOB_INTR_ONLY)
extern int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr);
#endif /* defined(OOB_INTR_ONLY) */

extern void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec);
extern int brcmf_timeout_expired(dhd_timeout_t *tmo);
Expand Down
Loading

0 comments on commit 67a646f

Please sign in to comment.