]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
staging: brcm80211: unifdef -DWLC_LOW
authorBrett Rudley <brudley@broadcom.com>
Fri, 19 Nov 2010 22:30:54 +0000 (14:30 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 20 Nov 2010 01:09:04 +0000 (17:09 -0800)
Part of BMAC removal.

Signed-off-by: Brett Rudley <brudley@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
14 files changed:
drivers/staging/brcm80211/include/bcm_rpc_tp.h
drivers/staging/brcm80211/include/siutils.h
drivers/staging/brcm80211/phy/wlc_phy_hal.h
drivers/staging/brcm80211/sys/wl_mac80211.c
drivers/staging/brcm80211/sys/wl_mac80211.h
drivers/staging/brcm80211/sys/wlc_alloc.c
drivers/staging/brcm80211/sys/wlc_ampdu.c
drivers/staging/brcm80211/sys/wlc_bmac.c
drivers/staging/brcm80211/sys/wlc_bmac.h
drivers/staging/brcm80211/sys/wlc_cfg.h
drivers/staging/brcm80211/sys/wlc_mac80211.c
drivers/staging/brcm80211/sys/wlc_mac80211.h
drivers/staging/brcm80211/sys/wlc_rpc.h
drivers/staging/brcm80211/sys/wlc_types.h

index 0136118284f9fa20524565dd73469825ee603a92..6102a495f3bd35844c346f554679fc44bae3dc2b 100644 (file)
@@ -53,9 +53,7 @@ typedef struct rpc_transport_info rpc_tp_info_t;
 typedef void (*rpc_tx_complete_fn_t) (void *, rpc_buf_t *, int status);
 typedef void (*rpc_rx_fn_t) (void *, rpc_buf_t *);
 
-#ifdef WLC_LOW
 typedef void (*rpc_txflowctl_cb_t) (void *ctx, bool on);
-#endif
 
 extern rpc_tp_info_t *bcm_rpc_tp_attach(struct osl_info *osh, void *bus);
 extern void bcm_rpc_tp_detach(rpc_tp_info_t *rpcb);
@@ -94,7 +92,6 @@ extern int bcm_rpc_tp_get_device_speed(rpc_tp_info_t *rpc_th);
 extern int bcm_rpc_tp_dump(rpc_tp_info_t *rpcb, struct bcmstrbuf *b);
 #endif
 
-#ifdef WLC_LOW
 /* intercept USB pkt to parse RPC header: USB driver rx-> wl_send -> this -> wl driver */
 extern void bcm_rpc_tp_rx_from_dnglbus(rpc_tp_info_t *rpc_th, struct lbuf *lb);
 
@@ -110,7 +107,6 @@ extern void bcm_rpc_tp_txq_wm_set(rpc_tp_info_t *rpc_th, u8 hiwm,
                                  u8 lowm);
 extern void bcm_rpc_tp_txq_wm_get(rpc_tp_info_t *rpc_th, u8 *hiwm,
                                  u8 *lowm);
-#endif                         /* WLC_LOW */
 
 extern void bcm_rpc_tp_agg_set(rpc_tp_info_t *rpcb, u32 reason, bool set);
 extern void bcm_rpc_tp_agg_limit_set(rpc_tp_info_t *rpc_th, u8 sf,
index 6f83e7e5b313d5e7592b3108da8e0820744c8a82..6a074ab9f34b3d90db8cc8dab7a7855df5c70cb1 100644 (file)
@@ -19,9 +19,6 @@
 
 #include <hndsoc.h>
 
-#if !defined(WLC_LOW)
-#include "bcm_rpc.h"
-#endif
 /*
  * Data structure to export all chip specific common variables
  *   public (read-only) portion of siutils handle returned by si_attach()
@@ -50,19 +47,12 @@ struct si_pub {
        uint socirev;           /* SOC interconnect rev */
        bool pci_pr32414;
 
-#if !defined(WLC_LOW)
-       rpc_info_t *rpc;
-#endif
 };
 
 /* for HIGH_ONLY driver, the si_t must be writable to allow states sync from BMAC to HIGH driver
  * for monolithic driver, it is readonly to prevent accident change
  */
-#if !defined(WLC_LOW)
-typedef struct si_pub si_t;
-#else
 typedef const struct si_pub si_t;
-#endif
 
 /*
  * Many of the routines below take an 'sih' handle as their first arg.
index c462387d20b9f4aa67e0dfa3ca7e616f69a20a3b..514e15e002838c4cfa54bdc925094a0cd52b36bb 100644 (file)
@@ -146,7 +146,6 @@ typedef struct shared_phy_params {
        u32 boardflags2;
 } shared_phy_params_t;
 
-#ifdef WLC_LOW
 
 extern shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp);
 extern void wlc_phy_shared_detach(shared_phy_t *phy_sh);
@@ -185,7 +184,6 @@ extern void wlc_phy_set_deaf(wlc_phy_t *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);
 
-#endif                         /* WLC_LOW */
 
 extern void wlc_phy_BSSinit(wlc_phy_t *ppi, bool bonlyap, int rssi);
 
index e336fef111e53bf2d019f698bb46101078f7e4b1..37e6ced84db5a0b027d3a3e4fc4af62a53576234 100644 (file)
@@ -759,14 +759,12 @@ static wl_info_t *wl_attach(u16 vendor, u16 device, unsigned long regs,
        wlc_iovar_setint(wl->wlc, "sd_drivestrength", sd_drivestrength);
 #endif
 
-#ifdef WLC_LOW
        /* register our interrupt handler */
        if (request_irq(irq, wl_isr, IRQF_SHARED, KBUILD_MODNAME, wl)) {
                WL_ERROR(("wl%d: request_irq() failed\n", unit));
                goto fail;
        }
        wl->irq = irq;
-#endif                         /* WLC_LOW */
 
        /* register module */
        wlc_module_register(wl->pub, NULL, "linux", wl, NULL, wl_linux_watchdog,
@@ -1349,7 +1347,6 @@ void wl_free(wl_info_t *wl)
        osl_detach(osh);
 }
 
-#ifdef WLC_LOW
 /* transmit a packet */
 static int BCMFASTPATH wl_start(struct sk_buff *skb, wl_info_t *wl)
 {
@@ -1358,7 +1355,6 @@ static int BCMFASTPATH wl_start(struct sk_buff *skb, wl_info_t *wl)
 
        return wl_start_int(wl, WL_TO_HW(wl), skb);
 }
-#endif                         /* WLC_LOW */
 
 static int BCMFASTPATH
 wl_start_int(wl_info_t *wl, struct ieee80211_hw *hw, struct sk_buff *skb)
@@ -1400,13 +1396,11 @@ uint wl_reset(wl_info_t *wl)
  */
 void BCMFASTPATH wl_intrson(wl_info_t *wl)
 {
-#if defined(WLC_LOW)
        unsigned long flags;
 
        INT_LOCK(wl, flags);
        wlc_intrson(wl->wlc);
        INT_UNLOCK(wl, flags);
-#endif                         /* WLC_LOW */
 }
 
 bool wl_alloc_dma_resources(wl_info_t *wl, uint addrwidth)
@@ -1416,7 +1410,6 @@ bool wl_alloc_dma_resources(wl_info_t *wl, uint addrwidth)
 
 u32 BCMFASTPATH wl_intrsoff(wl_info_t *wl)
 {
-#if defined(WLC_LOW)
        unsigned long flags;
        u32 status;
 
@@ -1424,20 +1417,15 @@ u32 BCMFASTPATH wl_intrsoff(wl_info_t *wl)
        status = wlc_intrsoff(wl->wlc);
        INT_UNLOCK(wl, flags);
        return status;
-#else
-       return 0;
-#endif                         /* WLC_LOW */
 }
 
 void wl_intrsrestore(wl_info_t *wl, u32 macintmask)
 {
-#if defined(WLC_LOW)
        unsigned long flags;
 
        INT_LOCK(wl, flags);
        wlc_intrsrestore(wl->wlc, macintmask);
        INT_UNLOCK(wl, flags);
-#endif                         /* WLC_LOW */
 }
 
 int wl_up(wl_info_t *wl)
@@ -1473,7 +1461,6 @@ void wl_down(wl_info_t *wl)
 
 irqreturn_t BCMFASTPATH wl_isr(int irq, void *dev_id)
 {
-#if defined(WLC_LOW)
        wl_info_t *wl;
        bool ours, wantdpc;
        unsigned long flags;
@@ -1498,14 +1485,10 @@ irqreturn_t BCMFASTPATH wl_isr(int irq, void *dev_id)
        WL_ISRUNLOCK(wl, flags);
 
        return IRQ_RETVAL(ours);
-#else
-       return IRQ_RETVAL(0);
-#endif                         /* WLC_LOW */
 }
 
 static void BCMFASTPATH wl_dpc(unsigned long data)
 {
-#ifdef WLC_LOW
        wl_info_t *wl;
 
        wl = (wl_info_t *) data;
@@ -1539,7 +1522,6 @@ static void BCMFASTPATH wl_dpc(unsigned long data)
 
  done:
        WL_UNLOCK(wl);
-#endif                         /* WLC_LOW */
 }
 
 static void wl_link_up(wl_info_t *wl, char *ifname)
@@ -1743,7 +1725,6 @@ char *wl_firmwares[WL_MAX_FW] = {
        NULL
 };
 
-#ifdef WLC_LOW
 int wl_ucode_init_buf(wl_info_t *wl, void **pbuf, u32 idx)
 {
        int i, entry;
@@ -1790,7 +1771,6 @@ int wl_ucode_init_uint(wl_info_t *wl, u32 *data, u32 idx)
        printf("ERROR: ucode tag:%d can not be found!\n", idx);
        return -1;
 }
-#endif                         /* WLC_LOW */
 
 static int wl_request_fw(wl_info_t *wl, struct pci_dev *pdev)
 {
@@ -1833,12 +1813,10 @@ static int wl_request_fw(wl_info_t *wl, struct pci_dev *pdev)
        return 0;
 }
 
-#ifdef WLC_LOW
 void wl_ucode_free_buf(void *p)
 {
        kfree(p);
 }
-#endif                         /* WLC_LOW */
 
 static void wl_release_fw(wl_info_t *wl)
 {
index ba9d48cd0193f95d810da27d8adf72dd51754d96..220d570710cb4497c8edfc830e1e1bd71423a6aa 100644 (file)
@@ -122,10 +122,8 @@ extern void wl_free(wl_info_t *wl);
 extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
 extern int wl_ucode_data_init(wl_info_t *wl);
 extern void wl_ucode_data_free(void);
-#ifdef WLC_LOW
 extern void wl_ucode_free_buf(void *);
 extern int wl_ucode_init_buf(wl_info_t *wl, void **pbuf, u32 idx);
 extern int wl_ucode_init_uint(wl_info_t *wl, u32 *data, u32 idx);
-#endif                         /* WLC_LOW */
 
 #endif                         /* _wl_mac80211_h_ */
index e863a81e045c61cc6b67a2c4fdb5c2581011822e..659ebd0ee2de535a28351c233455b97ad3a21dd7 100644 (file)
@@ -196,7 +196,6 @@ wlc_info_t *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
        }
        wlc->hw->wlc = wlc;
 
-#ifdef WLC_LOW
        wlc->hw->bandstate[0] = (wlc_hwband_t *)wlc_calloc(osh, unit,
                (sizeof(wlc_hwband_t) * MAXBANDS));
        if (wlc->hw->bandstate[0] == NULL) {
@@ -211,7 +210,6 @@ wlc_info_t *wlc_attach_malloc(struct osl_info *osh, uint unit, uint *err,
                             (sizeof(wlc_hwband_t) * i));
                }
        }
-#endif                         /* WLC_LOW */
 
        wlc->modulecb = (modulecb_t *)wlc_calloc(osh, unit,
                sizeof(modulecb_t) * WLC_MAXMODULES);
@@ -357,12 +355,10 @@ void wlc_detach_mfree(wlc_info_t *wlc, struct osl_info *osh)
        }
 
        if (wlc->hw) {
-#ifdef WLC_LOW
                if (wlc->hw->bandstate[0]) {
                        kfree(wlc->hw->bandstate[0]);
                        wlc->hw->bandstate[0] = NULL;
                }
-#endif
 
                /* free hw struct */
                kfree(wlc->hw);
index ab883ba76defc1b7287ae0378950b57743998ad9..1fa56cefeed9cb3d1995b320b4c27593b23fbb67 100644 (file)
@@ -908,7 +908,6 @@ wlc_ampdu_dotxstatus(ampdu_info_t *ampdu, struct scb *scb, void *p,
         * call the first one
         */
        if (txs->status & TX_STATUS_ACK_RCV) {
-#ifdef WLC_LOW
                u8 status_delay = 0;
 
                /* wait till the next 8 bytes of txstatus is available */
@@ -926,18 +925,6 @@ wlc_ampdu_dotxstatus(ampdu_info_t *ampdu, struct scb *scb, void *p,
                ASSERT(!(s1 & TX_STATUS_INTERMEDIATE));
                ASSERT(s1 & TX_STATUS_AMPDU);
                s2 = R_REG(wlc->osh, &wlc->regs->frmtxstatus2);
-#else                          /* WLC_LOW */
-
-               /* Store the relevant information in ampdu structure */
-               WL_AMPDU_TX(("wl%d: wlc_ampdu_dotxstatus: High Recvd\n",
-                            wlc->pub->unit));
-
-               ASSERT(!ampdu->p);
-               ampdu->p = p;
-               bcopy(txs, &ampdu->txs, sizeof(tx_status_t));
-               ampdu->waiting_status = true;
-               return;
-#endif                         /* WLC_LOW */
        }
 
        wlc_ampdu_dotxstatus_complete(ampdu, scb, p, txs, s1, s2);
index 214b5d82ab23ccf42239d1c9946c7ae9b1ee5120..110710ad6e783575578d2334eaf16c628b416ad1 100644 (file)
@@ -14,9 +14,6 @@
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#ifndef WLC_LOW
-#error "This file needs WLC_LOW"
-#endif
 
 #include <linux/kernel.h>
 #include <wlc_cfg.h>
index c3d251a6417a3e65addcf21d083928a869da1a0e..c705f667469c5364d7b2603b17b4a0dcb77eac74 100644 (file)
@@ -138,9 +138,7 @@ extern void wlc_bmac_watchdog(void *arg);
 extern void wlc_bmac_info_init(wlc_hw_info_t *wlc_hw);
 
 /* up/down, reset, clk */
-#ifdef WLC_LOW
 extern void wlc_bmac_xtal(wlc_hw_info_t *wlc_hw, bool want);
-#endif
 
 extern void wlc_bmac_copyto_objmem(wlc_hw_info_t *wlc_hw,
                                   uint offset, const void *buf, int len,
index a415e1fd2c053104fb4c229fb624b831e4d694f2..e36d209c72fdfe10094e696d7c287eafb793ad60 100644 (file)
 #define IS_SINGLEBAND_5G(device)       0
 
 /* Keep WLC_HIGH_ONLY, WLC_SPLIT for USB extension later on */
-#if !defined(WLC_LOW)
-#define WLC_HIGH_ONLY
-#endif
-#if !defined(WLC_LOW)
-#define WLC_SPLIT
-#endif
 
 /* **** Core type/rev defaults **** */
 #define D11_DEFAULT    0x0fffffb0      /* Supported  D11 revs: 4, 5, 7-27
index c270d3f4072ffe927a77d0dba0eb27ccd43e3338..c6f64c2e461ab2e48893356fdbd707d442b34f71 100644 (file)
@@ -626,21 +626,11 @@ bool wlc_ps_check(wlc_info_t *wlc)
 
                        res = false;
                }
-#ifdef WLC_LOW
                /* For a monolithic build the wake check can be exact since it looks at wake
                 * override bits. The MCTL_WAKE bit should match the 'wake' value.
                 */
                wake = STAY_AWAKE(wlc) || wlc->hw->wake_override;
                wake_ok = (wake == ((tmp & MCTL_WAKE) != 0));
-#else
-               /* For a split build we will not have access to any wake overrides from the low
-                * level. The check can only make sure the MCTL_WAKE bit is on if the high
-                * level 'wake' value is true. If the high level 'wake' is false, the MCTL_WAKE
-                * may be either true or false due to the low level override.
-                */
-               wake = STAY_AWAKE(wlc);
-               wake_ok = ((tmp & MCTL_WAKE) != 0) || !wake;
-#endif
                if (hps && !wake_ok) {
                        WL_ERROR(("wl%d: wake not sync, sw %d maccontrol 0x%x\n", wlc->pub->unit, wake, tmp));
                        res = false;
@@ -1842,14 +1832,12 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
        wlc_phy_stf_chain_init(wlc->band->pi, wlc->stf->hw_txchain,
                               wlc->stf->hw_rxchain);
 
-#ifdef WLC_LOW
        /* pull up some info resulting from the low attach */
        {
                int i;
                for (i = 0; i < NFIFO; i++)
                        wlc->core->txavail[i] = wlc->hw->txavail[i];
        }
-#endif                         /* WLC_LOW */
 
        wlc_bmac_hw_etheraddr(wlc->hw, &wlc->perm_etheraddr);
 
@@ -2500,9 +2488,7 @@ static void wlc_watchdog(void *arg)
        if (wlc->pub->radio_disabled)
                return;
 
-#ifdef WLC_LOW
        wlc_bmac_watchdog(wlc);
-#endif
 
        /* occasionally sample mac stat counters to detect 16-bit counter wrap */
        if ((WLC_UPDATE_STATS(wlc))
@@ -2531,10 +2517,8 @@ static void wlc_watchdog(void *arg)
                wlc->tempsense_lasttime = wlc->pub->now;
                wlc_tempsense_upd(wlc);
        }
-#ifdef WLC_LOW
        /* BMAC_NOTE: for HIGH_ONLY driver, this seems being called after RPC bus failed */
        ASSERT(wlc_bmac_taclear(wlc->hw, true));
-#endif
 
        /* Verify that tx_prec_map and fifos are in sync to avoid lock ups */
        ASSERT(wlc_tx_prec_map_verify(wlc));
@@ -4228,14 +4212,12 @@ _wlc_ioctl(wlc_info_t *wlc, int cmd, void *arg, int len, struct wlc_if *wlcif)
                }
 
        }
-#ifdef WLC_LOW
        /* BMAC_NOTE: for HIGH_ONLY driver, this seems being called after RPC bus failed */
        /* In hw_off condition, IOCTLs that reach here are deemed safe but taclear would
         * certainly result in getting -1 for register reads. So skip ta_clear altogether
         */
        if (!(wlc->pub->hw_off))
                ASSERT(wlc_bmac_taclear(wlc->hw, ta_ok) || !ta_ok);
-#endif
 
        return bcmerror;
 }
index 9d0d8f336ddef7c30ca198f9218020a7f99253c1..046158813115f568106043f8a8c16dd06c6d6d7d 100644 (file)
@@ -306,13 +306,11 @@ typedef struct wlc_stf {
  * core state (mac)
  */
 typedef struct wlccore {
-#ifdef WLC_LOW
        uint coreidx;           /* # sb enumerated core */
 
        /* fifo */
        uint *txavail[NFIFO];   /* # tx descriptors available */
        s16 txpktpend[NFIFO];   /* tx admission control */
-#endif                         /* WLC_LOW */
 
        macstat_t *macstat_snapshot;    /* mac hw prev read values */
 } wlccore_t;
@@ -406,7 +404,6 @@ struct wlc_if {
 /* flags for the interface */
 #define WLC_IF_LINKED          0x02    /* this interface is linked to a wl_if */
 
-#ifdef WLC_LOW
 typedef struct wlc_hwband {
        int bandtype;           /* WLC_BAND_2G, WLC_BAND_5G */
        uint bandunit;          /* bandstate[] index */
@@ -423,7 +420,6 @@ typedef struct wlc_hwband {
        wlc_phy_t *pi;          /* pointer to phy specific information */
        bool abgphy_encore;
 } wlc_hwband_t;
-#endif                         /* WLC_LOW */
 
 struct wlc_hw_info {
 #ifdef WLC_SPLIT
@@ -436,7 +432,6 @@ struct wlc_hw_info {
        /* fifo */
        hnddma_t *di[NFIFO];    /* hnddma handles, per fifo */
 
-#ifdef WLC_LOW
        uint unit;              /* device instance number */
 
        /* version info */
@@ -502,7 +497,6 @@ struct wlc_hw_info {
                                 * 0 = N/A, 1 = 2x4 board, 2 = 2x3 CB2 board
                                 */
        u32 antsel_avail;       /* put antsel_info_t here if more info is needed */
-#endif                         /* WLC_LOW */
 };
 
 /* TX Queue information
@@ -817,11 +811,7 @@ struct antsel_info {
 #define IS_MBAND_UNLOCKED(wlc) \
        ((NBANDS(wlc) > 1) && !(wlc)->bandlocked)
 
-#ifdef WLC_LOW
 #define WLC_BAND_PI_RADIO_CHANSPEC wlc_phy_chanspec_get(wlc->band->pi)
-#else
-#define WLC_BAND_PI_RADIO_CHANSPEC (wlc->chanspec)
-#endif
 
 /* sum the individual fifo tx pending packet counts */
 #define        TXPKTPENDTOT(wlc) ((wlc)->core->txpktpend[0] + (wlc)->core->txpktpend[1] + \
@@ -881,10 +871,8 @@ extern void wlc_print_txdesc(d11txh_t *txh);
 extern void wlc_print_dot11_mac_hdr(u8 *buf, int len);
 #endif
 
-#ifdef WLC_LOW
 extern void wlc_setxband(wlc_hw_info_t *wlc_hw, uint bandunit);
 extern void wlc_coredisable(wlc_hw_info_t *wlc_hw);
-#endif
 
 extern bool wlc_valid_rate(wlc_info_t *wlc, ratespec_t rate, int band,
                           bool verbose);
index db39645ccbdc774189825f0013836d8013cec43b..e3f31d42dd8085d5744b6409c154a7eae8f17cf1 100644 (file)
@@ -480,13 +480,9 @@ static __inline int _wlc_rpc_call(struct rpc_info *rpc, rpc_buf_t *send)
 #include <sbhndpio.h>
 #include <d11.h>
 
-#ifdef WLC_LOW
 extern void wlc_rpc_bmac_dispatch(wlc_rpc_ctx_t *rpc_ctx, struct rpc_buf *buf);
 extern void wlc_rpc_bmac_dump_txfifohist(wlc_hw_info_t *wlc_hw,
                                         bool dump_clear);
-#else
-extern void wlc_rpc_high_dispatch(wlc_rpc_ctx_t *ctx, struct rpc_buf *buf);
-#endif
 
 /* Packed structure for ease of transport across RPC bus along u32 boundary */
 typedef struct wlc_rpc_txstatus {
index 33047ebab979e72d038b18d5f4fadf8dd177927c..dffba3e8b62fba9e9e3092039e49701e4f805f24 100644 (file)
@@ -35,12 +35,7 @@ typedef struct wlc_auth_info wlc_auth_info_t;
 typedef struct supplicant supplicant_t;
 typedef struct authenticator authenticator_t;
 typedef struct antsel_info antsel_info_t;
-#if !defined(WLC_LOW)
-typedef struct rpctx_info rpctx_info_t;
-#endif
-#ifdef WLC_LOW
 typedef struct bmac_pmq bmac_pmq_t;
-#endif
 
 struct d11init;