Skip to content

Commit

Permalink
staging: brcm80211: remove DHD_USE_STATIC_BUF
Browse files Browse the repository at this point in the history
The DHD_USE_STATIC_BUF cannot be enabled in the build configuration,
remove it.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
mike.rapoport@gmail.com authored and Greg Kroah-Hartman committed Oct 14, 2010
1 parent 6ddcfdc commit 6a92fdf
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 264 deletions.
17 changes: 0 additions & 17 deletions drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,11 +1040,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (pkt == NULL) {
sd_data(("%s: Creating new %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", buflen_u));
#ifdef DHD_USE_STATIC_BUF
mypkt = PKTGET_STATIC(sd->osh, buflen_u, write ? true : false);
#else
mypkt = PKTGET(sd->osh, buflen_u, write ? true : false);
#endif /* DHD_USE_STATIC_BUF */
if (!mypkt) {
sd_err(("%s: PKTGET failed: len %d\n",
__func__, buflen_u));
Expand All @@ -1062,11 +1058,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (!write)
bcopy(PKTDATA(mypkt), buffer, buflen_u);

#ifdef DHD_USE_STATIC_BUF
PKTFREE_STATIC(sd->osh, mypkt, write ? true : false);
#else
PKTFREE(sd->osh, mypkt, write ? true : false);
#endif /* DHD_USE_STATIC_BUF */
} else if (((u32) (PKTDATA(pkt)) & DMA_ALIGN_MASK) != 0) {
/* Case 2: We have a packet, but it is unaligned. */

Expand All @@ -1075,12 +1067,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,

sd_data(("%s: Creating aligned %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", PKTLEN(pkt)));
#ifdef DHD_USE_STATIC_BUF
mypkt = PKTGET_STATIC(sd->osh, PKTLEN(pkt),
write ? true : false);
#else
mypkt = PKTGET(sd->osh, PKTLEN(pkt), write ? true : false);
#endif /* DHD_USE_STATIC_BUF */
if (!mypkt) {
sd_err(("%s: PKTGET failed: len %d\n",
__func__, PKTLEN(pkt)));
Expand All @@ -1098,11 +1085,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (!write)
bcopy(PKTDATA(mypkt), PKTDATA(pkt), PKTLEN(mypkt));

#ifdef DHD_USE_STATIC_BUF
PKTFREE_STATIC(sd->osh, mypkt, write ? true : false);
#else
PKTFREE(sd->osh, mypkt, write ? true : false);
#endif /* DHD_USE_STATIC_BUF */
} else { /* case 3: We have a packet and
it is aligned. */
sd_data(("%s: Aligned %s Packet, direct DMA\n",
Expand Down
4 changes: 1 addition & 3 deletions drivers/staging/brcm80211/brcmfmac/dhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ enum dhd_prealloc_index {
DHD_PREALLOC_DATABUF,
DHD_PREALLOC_OSL_BUF
};
#ifdef DHD_USE_STATIC_BUF
extern void *dhd_os_prealloc(int section, unsigned long size);
#endif

/* Common structure for module and instance linkage */
typedef struct dhd_pub {
/* Linkage ponters */
Expand Down
13 changes: 0 additions & 13 deletions drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,20 +406,11 @@ int dhd_prot_attach(dhd_pub_t *dhd)
{
dhd_prot_t *cdc;

#ifndef DHD_USE_STATIC_BUF
cdc = (dhd_prot_t *) MALLOC(dhd->osh, sizeof(dhd_prot_t));
if (!cdc) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}
#else
cdc = (dhd_prot_t *) dhd_os_prealloc(DHD_PREALLOC_PROT,
sizeof(dhd_prot_t));
if (!cdc) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}
#endif /* DHD_USE_STATIC_BUF */
memset(cdc, 0, sizeof(dhd_prot_t));

/* ensure that the msg buf directly follows the cdc msg struct */
Expand All @@ -436,19 +427,15 @@ int dhd_prot_attach(dhd_pub_t *dhd)
return 0;

fail:
#ifndef DHD_USE_STATIC_BUF
if (cdc != NULL)
MFREE(dhd->osh, cdc, sizeof(dhd_prot_t));
#endif
return BCME_NOMEM;
}

/* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */
void dhd_prot_detach(dhd_pub_t *dhd)
{
#ifndef DHD_USE_STATIC_BUF
MFREE(dhd->osh, dhd->prot, sizeof(dhd_prot_t));
#endif
dhd->prot = NULL;
}

Expand Down
21 changes: 0 additions & 21 deletions drivers/staging/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -2678,27 +2678,6 @@ void dhd_os_sdtxunlock(dhd_pub_t *pub)
dhd_os_sdunlock(pub);
}

#ifdef DHD_USE_STATIC_BUF
void *dhd_os_prealloc(int section, unsigned long size)
{
#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
void *alloc_ptr = NULL;
if (wifi_control_data && wifi_control_data->mem_prealloc) {
alloc_ptr = wifi_control_data->mem_prealloc(section, size);
if (alloc_ptr) {
DHD_INFO(("success alloc section %d\n", section));
bzero(alloc_ptr, size);
return alloc_ptr;
}
}

DHD_ERROR(("can't alloc section %d\n", section));
return 0;
#else
return MALLOC(0, size);
#endif /* #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC) */
}
#endif /* DHD_USE_STATIC_BUF */
#if defined(CONFIG_WIRELESS_EXT)
struct iw_statistics *dhd_get_wireless_stats(struct net_device *dev)
{
Expand Down
25 changes: 0 additions & 25 deletions drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -5382,7 +5382,6 @@ static bool dhdsdio_probe_malloc(dhd_bus_t *bus, osl_t *osh, void *sdh)
{
DHD_TRACE(("%s: Enter\n", __func__));

#ifndef DHD_USE_STATIC_BUF
if (bus->dhd->maxctl) {
bus->rxblen =
roundup((bus->dhd->maxctl + SDPCM_HDRLEN),
Expand All @@ -5405,26 +5404,6 @@ static bool dhdsdio_probe_malloc(dhd_bus_t *bus, osl_t *osh, void *sdh)
MFREE(osh, bus->rxbuf, bus->rxblen);
goto fail;
}
#else
if (bus->dhd->maxctl) {
bus->rxblen =
roundup((bus->dhd->maxctl + SDPCM_HDRLEN),
ALIGNMENT) + DHD_SDALIGN;
bus->rxbuf = dhd_os_prealloc(DHD_PREALLOC_RXBUF, bus->rxblen);
if (!(bus->rxbuf)) {
DHD_ERROR(("%s: MALLOC of %d-byte rxbuf failed\n",
__func__, bus->rxblen));
goto fail;
}
}
/* Allocate buffer to receive glomed packet */
bus->databuf = dhd_os_prealloc(DHD_PREALLOC_DATABUF, MAX_DATA_BUF);
if (!(bus->databuf)) {
DHD_ERROR(("%s: MALLOC of %d-byte databuf failed\n",
__func__, MAX_DATA_BUF));
goto fail;
}
#endif /* DHD_USE_STATIC_BUF */

/* Align the buffer */
if ((uintptr) bus->databuf % DHD_SDALIGN)
Expand Down Expand Up @@ -5583,17 +5562,13 @@ static void dhdsdio_release_malloc(dhd_bus_t *bus, osl_t *osh)
return;

if (bus->rxbuf) {
#ifndef DHD_USE_STATIC_BUF
MFREE(osh, bus->rxbuf, bus->rxblen);
#endif
bus->rxctl = bus->rxbuf = NULL;
bus->rxlen = 0;
}

if (bus->databuf) {
#ifndef DHD_USE_STATIC_BUF
MFREE(osh, bus->databuf, MAX_DATA_BUF);
#endif
bus->databuf = NULL;
}
}
Expand Down
5 changes: 0 additions & 5 deletions drivers/staging/brcm80211/include/linux_osl.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,6 @@ extern void *osl_pktget(osl_t *osh, uint len);
extern void osl_pktfree(osl_t *osh, void *skb, bool send);

#ifdef BRCM_FULLMAC
#ifdef DHD_USE_STATIC_BUF
#define PKTGET_STATIC(osh, len, send) osl_pktget_static((osh), (len))
#define PKTFREE_STATIC(osh, skb, send) \
osl_pktfree_static((osh), (skb), (send))
#endif
extern void *osl_pktget_static(osl_t *osh, uint len);
extern void osl_pktfree_static(osl_t *osh, void *skb, bool send);

Expand Down
Loading

0 comments on commit 6a92fdf

Please sign in to comment.