Commit e929821d authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: removed softmac 'tunable' functionality

Removed unused mechanism as part of code cleanup.
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7456ed29
...@@ -20,61 +20,12 @@ ...@@ -20,61 +20,12 @@
#include "main.h" #include "main.h"
#include "alloc.h" #include "alloc.h"
/* Max # of entries in Tx FIFO based on 4kb page size */
#define NTXD 256
/* Max # of entries in Rx FIFO based on 4kb page size */
#define NRXD 256
/* try to keep this # rbufs posted to the chip */
#define NRXBUFPOST 32
/* Maximum SCBs in cache for STA */
#define MAXSCB 32
/* Count of packet callback structures. either of following
* 1. Set to the number of SCBs since a STA
* can queue up a rate callback for each IBSS STA it knows about, and an AP can
* queue up an "are you there?" Null Data callback for each associated STA
* 2. controlled by tunable config file
*/
#define MAXPKTCB MAXSCB /* Max number of packet callbacks */
/* 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)
/* 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() */
#define TXSBND 8 /* max # tx status to process in wlc_txstatus() */
static void brcms_c_tunables_init(struct brcms_tunables *tunables, uint devid)
{
tunables->ntxd = NTXD;
tunables->nrxd = NRXD;
tunables->rxbufsz = RXBUFSZ;
tunables->nrxbufpost = NRXBUFPOST;
tunables->maxscb = MAXSCB;
tunables->ampdunummpdu = AMPDU_NUM_MPDU;
tunables->maxpktcb = MAXPKTCB;
tunables->maxucodebss = BRCMS_MAX_UCODE_BSS;
tunables->maxucodebss4 = BRCMS_MAX_UCODE_BSS4;
tunables->maxbss = MAXBSS;
tunables->datahiwat = BRCMS_DATAHIWAT;
tunables->ampdudatahiwat = BRCMS_AMPDUDATAHIWAT;
tunables->rxbnd = RXBND;
tunables->txsbnd = TXSBND;
}
static void brcms_c_pub_mfree(struct brcms_pub *pub) static void brcms_c_pub_mfree(struct brcms_pub *pub)
{ {
if (pub == NULL) if (pub == NULL)
return; return;
kfree(pub->multicast); kfree(pub->multicast);
kfree(pub->tunables);
kfree(pub); kfree(pub);
} }
...@@ -88,15 +39,6 @@ static struct brcms_pub *brcms_c_pub_malloc(uint unit, uint *err, uint devid) ...@@ -88,15 +39,6 @@ static struct brcms_pub *brcms_c_pub_malloc(uint unit, uint *err, uint devid)
goto fail; goto fail;
} }
pub->tunables = kzalloc(sizeof(struct brcms_tunables), GFP_ATOMIC);
if (pub->tunables == NULL) {
*err = 1028;
goto fail;
}
/* need to init the tunables now */
brcms_c_tunables_init(pub->tunables, devid);
pub->multicast = kzalloc(ETH_ALEN * MAXMULTILIST, GFP_ATOMIC); pub->multicast = kzalloc(ETH_ALEN * MAXMULTILIST, GFP_ATOMIC);
if (pub->multicast == NULL) { if (pub->multicast == NULL) {
*err = 1003; *err = 1003;
......
...@@ -62,6 +62,9 @@ ...@@ -62,6 +62,9 @@
#define AMPDU_DELIMITER_LEN 4 #define AMPDU_DELIMITER_LEN 4
/* max allowed number of mpdus in an ampdu (2 streams) */
#define AMPDU_NUM_MPDU 16
#define TX_SEQ_TO_INDEX(seq) ((seq) % AMPDU_TX_BA_MAX_WSIZE) #define TX_SEQ_TO_INDEX(seq) ((seq) % AMPDU_TX_BA_MAX_WSIZE)
/* max possible overhead per mpdu in the ampdu; 3 is for roundup if needed */ /* max possible overhead per mpdu in the ampdu; 3 is for roundup if needed */
...@@ -287,7 +290,7 @@ static void brcms_c_scb_ampdu_update_config(struct ampdu_info *ampdu, ...@@ -287,7 +290,7 @@ static void brcms_c_scb_ampdu_update_config(struct ampdu_info *ampdu,
struct scb_ampdu *scb_ampdu = &scb->scb_ampdu; struct scb_ampdu *scb_ampdu = &scb->scb_ampdu;
int i; int i;
scb_ampdu->max_pdu = (u8) ampdu->wlc->pub->tunables->ampdunummpdu; scb_ampdu->max_pdu = AMPDU_NUM_MPDU;
/* go back to legacy size if some preloading is occurring */ /* go back to legacy size if some preloading is occurring */
for (i = 0; i < NUM_FFPLD_FIFO; i++) { for (i = 0; i < NUM_FFPLD_FIFO; i++) {
......
...@@ -320,6 +320,21 @@ ...@@ -320,6 +320,21 @@
#define MAX_DMA_SEGS 4 #define MAX_DMA_SEGS 4
/* Max # of entries in Tx FIFO based on 4kb page size */
#define NTXD 256
/* Max # of entries in Rx FIFO based on 4kb page size */
#define NRXD 256
/* try to keep this # rbufs posted to the chip */
#define NRXBUFPOST 32
/* data msg txq hiwat mark */
#define BRCMS_DATAHIWAT 50
/* bounded rx loops */
#define RXBND 8 /* max # frames to process in brcms_c_recv() */
#define TXSBND 8 /* max # tx status to process in wlc_txstatus() */
/* /*
* 32 SSID chars, max of 4 chars for each SSID char "\xFF", plus NULL. * 32 SSID chars, max of 4 chars for each SSID char "\xFF", plus NULL.
*/ */
...@@ -646,7 +661,7 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound) ...@@ -646,7 +661,7 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
struct sk_buff *head = NULL; struct sk_buff *head = NULL;
struct sk_buff *tail = NULL; struct sk_buff *tail = NULL;
uint n = 0; uint n = 0;
uint bound_limit = bound ? wlc_hw->wlc->pub->tunables->rxbnd : -1; uint bound_limit = bound ? RXBND : -1;
struct brcms_d11rxhdr *wlc_rxhdr = NULL; struct brcms_d11rxhdr *wlc_rxhdr = NULL;
BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit); BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
...@@ -718,7 +733,7 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal) ...@@ -718,7 +733,7 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
* Param 'max_tx_num' indicates max. # tx status to process before * Param 'max_tx_num' indicates max. # tx status to process before
* break out. * break out.
*/ */
uint max_tx_num = bound ? wlc->pub->tunables->txsbnd : -1; uint max_tx_num = bound ? TXSBND : -1;
BCMMSG(wlc->wiphy, "wl%d\n", wlc_hw->unit); BCMMSG(wlc->wiphy, "wl%d\n", wlc_hw->unit);
...@@ -925,7 +940,6 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme) ...@@ -925,7 +940,6 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
u16 pio_mhf2 = 0; u16 pio_mhf2 = 0;
struct brcms_hardware *wlc_hw = wlc->hw; struct brcms_hardware *wlc_hw = wlc->hw;
uint unit = wlc_hw->unit; uint unit = wlc_hw->unit;
struct brcms_tunables *tune = wlc->pub->tunables;
struct wiphy *wiphy = wlc->wiphy; struct wiphy *wiphy = wlc->wiphy;
/* name and offsets for dma_attach */ /* name and offsets for dma_attach */
...@@ -942,8 +956,8 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme) ...@@ -942,8 +956,8 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
wlc_hw->di[0] = dma_attach(name, wlc_hw->sih, wlc_hw->di[0] = dma_attach(name, wlc_hw->sih,
(wme ? DMAREG(wlc_hw, DMA_TX, 0) : (wme ? DMAREG(wlc_hw, DMA_TX, 0) :
NULL), DMAREG(wlc_hw, DMA_RX, 0), NULL), DMAREG(wlc_hw, DMA_RX, 0),
(wme ? tune->ntxd : 0), tune->nrxd, (wme ? NTXD : 0), NRXD,
tune->rxbufsz, -1, tune->nrxbufpost, RXBUFSZ, -1, NRXBUFPOST,
BRCMS_HWRXOFF, &brcm_msg_level); BRCMS_HWRXOFF, &brcm_msg_level);
dma_attach_err |= (NULL == wlc_hw->di[0]); dma_attach_err |= (NULL == wlc_hw->di[0]);
...@@ -955,7 +969,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme) ...@@ -955,7 +969,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
*/ */
wlc_hw->di[1] = dma_attach(name, wlc_hw->sih, wlc_hw->di[1] = dma_attach(name, wlc_hw->sih,
DMAREG(wlc_hw, DMA_TX, 1), NULL, DMAREG(wlc_hw, DMA_TX, 1), NULL,
tune->ntxd, 0, 0, -1, 0, 0, NTXD, 0, 0, -1, 0, 0,
&brcm_msg_level); &brcm_msg_level);
dma_attach_err |= (NULL == wlc_hw->di[1]); dma_attach_err |= (NULL == wlc_hw->di[1]);
...@@ -966,7 +980,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme) ...@@ -966,7 +980,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
*/ */
wlc_hw->di[2] = dma_attach(name, wlc_hw->sih, wlc_hw->di[2] = dma_attach(name, wlc_hw->sih,
DMAREG(wlc_hw, DMA_TX, 2), NULL, DMAREG(wlc_hw, DMA_TX, 2), NULL,
tune->ntxd, 0, 0, -1, 0, 0, NTXD, 0, 0, -1, 0, 0,
&brcm_msg_level); &brcm_msg_level);
dma_attach_err |= (NULL == wlc_hw->di[2]); dma_attach_err |= (NULL == wlc_hw->di[2]);
/* /*
...@@ -976,7 +990,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme) ...@@ -976,7 +990,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
*/ */
wlc_hw->di[3] = dma_attach(name, wlc_hw->sih, wlc_hw->di[3] = dma_attach(name, wlc_hw->sih,
DMAREG(wlc_hw, DMA_TX, 3), DMAREG(wlc_hw, DMA_TX, 3),
NULL, tune->ntxd, 0, 0, -1, NULL, NTXD, 0, 0, -1,
0, 0, &brcm_msg_level); 0, 0, &brcm_msg_level);
dma_attach_err |= (NULL == wlc_hw->di[3]); dma_attach_err |= (NULL == wlc_hw->di[3]);
/* Cleaner to leave this as if with AP defined */ /* Cleaner to leave this as if with AP defined */
...@@ -4963,7 +4977,7 @@ static struct brcms_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc) ...@@ -4963,7 +4977,7 @@ static struct brcms_txq_info *brcms_c_txq_alloc(struct brcms_c_info *wlc)
* will remain the same * will remain the same
*/ */
brcmu_pktq_init(&qi->q, BRCMS_PREC_COUNT, brcmu_pktq_init(&qi->q, BRCMS_PREC_COUNT,
(2 * wlc->pub->tunables->datahiwat) + PKTQ_LEN_DEFAULT 2 * BRCMS_DATAHIWAT + PKTQ_LEN_DEFAULT
+ wlc->pub->psq_pkts_total); + wlc->pub->psq_pkts_total);
/* add this queue to the the global list */ /* add this queue to the the global list */
...@@ -6798,11 +6812,10 @@ void brcms_c_txq_enq(struct brcms_c_info *wlc, struct scb *scb, ...@@ -6798,11 +6812,10 @@ void brcms_c_txq_enq(struct brcms_c_info *wlc, struct scb *scb,
*/ */
if (!EDCF_ENAB(wlc->pub) if (!EDCF_ENAB(wlc->pub)
|| (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL)) { || (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL)) {
if (pktq_len(q) >= wlc->pub->tunables->datahiwat) if (pktq_len(q) >= BRCMS_DATAHIWAT)
brcms_c_txflowcontrol(wlc, qi, ON, ALLPRIO); brcms_c_txflowcontrol(wlc, qi, ON, ALLPRIO);
} else if (wlc->pub->_priofc) { } else if (wlc->pub->_priofc) {
if (pktq_plen(q, wlc_prio2prec_map[prio]) >= if (pktq_plen(q, wlc_prio2prec_map[prio]) >= BRCMS_DATAHIWAT)
wlc->pub->tunables->datahiwat)
brcms_c_txflowcontrol(wlc, qi, ON, prio); brcms_c_txflowcontrol(wlc, qi, ON, prio);
} }
} }
...@@ -7806,14 +7819,14 @@ void brcms_c_send_q(struct brcms_c_info *wlc) ...@@ -7806,14 +7819,14 @@ void brcms_c_send_q(struct brcms_c_info *wlc)
if (!EDCF_ENAB(wlc->pub) if (!EDCF_ENAB(wlc->pub)
|| (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL)) { || (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL)) {
if (brcms_c_txflowcontrol_prio_isset(wlc, qi, ALLPRIO) if (brcms_c_txflowcontrol_prio_isset(wlc, qi, ALLPRIO)
&& (pktq_len(q) < wlc->pub->tunables->datahiwat / 2)) && (pktq_len(q) < BRCMS_DATAHIWAT / 2))
brcms_c_txflowcontrol(wlc, qi, OFF, ALLPRIO); brcms_c_txflowcontrol(wlc, qi, OFF, ALLPRIO);
} else if (wlc->pub->_priofc) { } else if (wlc->pub->_priofc) {
int prio; int prio;
for (prio = MAXPRIO; prio >= 0; prio--) { for (prio = MAXPRIO; prio >= 0; prio--) {
if (brcms_c_txflowcontrol_prio_isset(wlc, qi, prio) && if (brcms_c_txflowcontrol_prio_isset(wlc, qi, prio) &&
q->q[wlc_prio2prec_map[prio]].len < q->q[wlc_prio2prec_map[prio]].len <
wlc->pub->tunables->datahiwat / 2) BRCMS_DATAHIWAT / 2)
brcms_c_txflowcontrol(wlc, qi, OFF, prio); brcms_c_txflowcontrol(wlc, qi, OFF, prio);
} }
} }
......
...@@ -102,24 +102,6 @@ ...@@ -102,24 +102,6 @@
#define MAX_STREAMS_SUPPORTED 4 /* max number of streams supported */ #define MAX_STREAMS_SUPPORTED 4 /* max number of streams supported */
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 */
int nrxbufpost; /* # of rx buffers to post */
int maxscb; /* # of SCBs supported */
int ampdunummpdu; /* max number of mpdu in an ampdu */
int maxpktcb; /* max # of packet callbacks */
int maxucodebss;/* max # of BSS handled in ucode bcn/prb */
int maxucodebss4; /* max # of BSS handled in sw bcn/prb */
int maxbss; /* max # of bss info elements in scan list */
int datahiwat; /* data msg txq hiwat mark */
int ampdudatahiwat; /* AMPDU msg txq hiwat mark */
int rxbnd; /* max # rx bufs to process before deferring to dpc */
int txsbnd; /* max # tx status to process in wlc_txstatus() */
int memreserved;/* memory reserved for BMAC's USB dma rx */
};
struct brcms_c_rateset { struct brcms_c_rateset {
uint count; /* number of rates in rates[] */ uint count; /* number of rates in rates[] */
/* rates in 500kbps units w/hi bit set if basic */ /* rates in 500kbps units w/hi bit set if basic */
...@@ -176,8 +158,6 @@ struct brcms_pub { ...@@ -176,8 +158,6 @@ struct brcms_pub {
char *vars; /* "environment" name=value */ char *vars; /* "environment" name=value */
bool up; /* interface up and running */ bool up; /* interface up and running */
bool hw_off; /* HW is off */ bool hw_off; /* HW is off */
/* tunables: ntxd, nrxd, maxscb, etc. */
struct brcms_tunables *tunables;
bool hw_up; /* one time hw up/down */ bool hw_up; /* one time hw up/down */
bool _piomode; /* true if pio mode */ bool _piomode; /* true if pio mode */
uint _nbands; /* # bands supported */ uint _nbands; /* # bands supported */
......
...@@ -244,26 +244,10 @@ ...@@ -244,26 +244,10 @@
* ******************************************************************** * ********************************************************************
*/ */
/*************************************************
* Defaults for tunables (e.g. sizing constants)
*
* For each new tunable, add a member to the end
* 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)
*
* ***********************************************
*/
/* max allowed number of mpdus in an ampdu (2 streams) */
#define AMPDU_NUM_MPDU 16
/* NetBSD also needs to keep track of this */ /* NetBSD also needs to keep track of this */
/* max # BSS configs */ /* max # BSS configs */
#define BRCMS_MAXBSSCFG (1) #define BRCMS_MAXBSSCFG (1)
/* max # available networks */
#define MAXBSS 64
#define BCMMSG(dev, fmt, args...) \ #define BCMMSG(dev, fmt, args...) \
do { \ do { \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment