]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
staging: brcm80211: cleaned up several softmac macro's
authorRoland Vossen <rvossen@broadcom.com>
Thu, 1 Sep 2011 09:17:19 +0000 (11:17 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Sep 2011 23:39:20 +0000 (16:39 -0700)
Moved, deleted or substituted macro's.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmsmac/d11.h
drivers/staging/brcm80211/brcmsmac/dma.c
drivers/staging/brcm80211/brcmsmac/dma.h
drivers/staging/brcm80211/brcmsmac/mac80211_if.c

index f0c3f5a75a2c8a7411d420ebfc96cd8700280626..14e60a5d130d0ff83b748cb94dc86b9d0c2fb261 100644 (file)
@@ -23,8 +23,6 @@
 #include "pub.h"
 #include "dma.h"
 
-#define        BCN_TMPL_LEN            512     /* length of the BCN template area */
-
 /* RX FIFO numbers */
 #define        RX_FIFO                 0       /* data and ctl frames */
 #define        RX_TXSTATUS_FIFO        3       /* RX fifo for tx status packages */
@@ -1397,9 +1395,6 @@ struct d11rxhdr {
        u16 RxChan;
 } __packed;
 
-#define        RXHDR_LEN               24      /* sizeof struct d11rxhdr */
-#define        FRAMELEN(h)             ((h)->RxFrameSize)
-
 /*
  * rxhdr: received frame header data
  * tsf_l: TSF_L reading
index 85680c81c3b19ef7489b44b0ea45313661adddbe..63e5e0e8cfb378020ed2d78b6518eed5bf27121a 100644 (file)
 
 #define        MAXNAMEL        8       /* 8 char names */
 
-#define        DI_INFO(dmah)   ((dma_info_t *)dmah)
-
 /* descriptor bumping macros */
 /* faster than %, but n must be power of 2 */
 #define        XXD(x, n)       ((x) & ((n) - 1))
index 2ce5963818d45046d97df1f583b4978074a1d4ff..4075dc9c74b3efc1a80e43d5a029b7ceac85ae0c 100644 (file)
 #include <linux/delay.h>
 #include "types.h"             /* forward structure declarations */
 
+/* map/unmap direction */
+#define        DMA_TX  1               /* TX direction for DMA */
+#define        DMA_RX  2               /* RX direction for DMA */
+
 /* DMA structure:
  *  support two DMA engines: 32 bits address or 64 bit addressing
  *  basic DMA register set is per channel(transmit or receive)
@@ -47,11 +51,6 @@ struct dma64regs {
        u32 status1;    /* active descriptor, xmt error */
 };
 
-/* map/unmap direction */
-#define        DMA_TX  1               /* TX direction for DMA */
-#define        DMA_RX  2               /* RX direction for DMA */
-#define BUS_SWAP32(v)          (v)
-
 /* range param for dma_getnexttxp() and dma_txreclaim */
 enum txd_range {
        DMA_RANGE_ALL = 1,
index 227beb6794bfa24b460f10ead391f5614ebe5ef4..23001c25247ce5a7f24c6400420cf711de7b3176 100644 (file)
@@ -37,9 +37,6 @@
 #define LOCK(wl)       spin_lock_bh(&(wl)->lock)
 #define UNLOCK(wl)     spin_unlock_bh(&(wl)->lock)
 
-#define HW_TO_WL(hw)    (hw->priv)
-#define WL_TO_HW(wl)     (wl->pub->ieee_hw)
-
 /* locking from inside brcms_isr */
 #define ISR_LOCK(wl, flags)\
        do {\
@@ -308,9 +305,6 @@ static int brcms_ops_start(struct ieee80211_hw *hw)
 {
        struct brcms_info *wl = hw->priv;
        bool blocked;
-       /*
-         struct ieee80211_channel *curchan = hw->conf.channel;
-       */
 
        ieee80211_wake_queues(hw);
        LOCK(wl);
@@ -344,7 +338,7 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
                return -EOPNOTSUPP;
        }
 
-       wl = HW_TO_WL(hw);
+       wl = hw->priv;
        LOCK(wl);
        err = brcms_up(wl);
        UNLOCK(wl);
@@ -361,7 +355,7 @@ brcms_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 {
        struct brcms_info *wl;
 
-       wl = HW_TO_WL(hw);
+       wl = hw->priv;
 
        /* put driver in down state */
        LOCK(wl);
@@ -376,7 +370,7 @@ static int
 ieee_set_channel(struct ieee80211_hw *hw, struct ieee80211_channel *chan,
                 enum nl80211_channel_type type)
 {
-       struct brcms_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = hw->priv;
        int err = 0;
 
        switch (type) {
@@ -400,7 +394,7 @@ ieee_set_channel(struct ieee80211_hw *hw, struct ieee80211_channel *chan,
 static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
 {
        struct ieee80211_conf *conf = &hw->conf;
-       struct brcms_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = hw->priv;
        int err = 0;
        int new_int;
        struct wiphy *wiphy = hw->wiphy;
@@ -468,7 +462,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
                        struct ieee80211_vif *vif,
                        struct ieee80211_bss_conf *info, u32 changed)
 {
-       struct brcms_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = hw->priv;
        struct wiphy *wiphy = hw->wiphy;
        int val;
 
@@ -818,7 +812,7 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
 
 static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw)
 {
-       struct brcms_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = hw->priv;
        bool blocked;
 
        LOCK(wl);
@@ -830,7 +824,7 @@ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw)
 
 static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop)
 {
-       struct brcms_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = hw->priv;
 
        no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false");
 
@@ -1028,7 +1022,7 @@ static void brcms_remove(struct pci_dev *pdev)
        int status;
 
        hw = pci_get_drvdata(pdev);
-       wl = HW_TO_WL(hw);
+       wl = hw->priv;
        if (!wl) {
                pr_err("wl: brcms_remove: pci_get_drvdata failed\n");
                return;
@@ -1090,7 +1084,7 @@ static irqreturn_t brcms_isr(int irq, void *dev_id)
  */
 static int ieee_hw_rate_init(struct ieee80211_hw *hw)
 {
-       struct brcms_info *wl = HW_TO_WL(hw);
+       struct brcms_info *wl = hw->priv;
        int has_5g;
        char phy_list[4];
 
@@ -1339,7 +1333,7 @@ static int brcms_suspend(struct pci_dev *pdev, pm_message_t state)
        struct ieee80211_hw *hw;
 
        hw = pci_get_drvdata(pdev);
-       wl = HW_TO_WL(hw);
+       wl = hw->priv;
        if (!wl) {
                wiphy_err(wl->wiphy,
                          "brcms_suspend: pci_get_drvdata failed\n");
@@ -1364,7 +1358,7 @@ static int brcms_resume(struct pci_dev *pdev)
        u32 val;
 
        hw = pci_get_drvdata(pdev);
-       wl = HW_TO_WL(hw);
+       wl = hw->priv;
        if (!wl) {
                wiphy_err(wl->wiphy,
                          "wl: brcms_resume: pci_get_drvdata failed\n");
@@ -1458,7 +1452,7 @@ void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
  */
 void brcms_init(struct brcms_info *wl)
 {
-       BCMMSG(WL_TO_HW(wl)->wiphy, "wl%d\n", wl->pub->unit);
+       BCMMSG(wl->pub->ieee_hw->wiphy, "wl%d\n", wl->pub->unit);
        brcms_reset(wl);
 
        brcms_c_init(wl->wlc);
@@ -1469,7 +1463,7 @@ void brcms_init(struct brcms_info *wl)
  */
 uint brcms_reset(struct brcms_info *wl)
 {
-       BCMMSG(WL_TO_HW(wl)->wiphy, "wl%d\n", wl->pub->unit);
+       BCMMSG(wl->pub->ieee_hw->wiphy, "wl%d\n", wl->pub->unit);
        brcms_c_reset(wl->wlc);
 
        /* dpc will not be rescheduled */