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

staging: brcm80211: cleaned up several softmac macro's

Moved, deleted or substituted macro's.
Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fa225449
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
#include "pub.h" #include "pub.h"
#include "dma.h" #include "dma.h"
#define BCN_TMPL_LEN 512 /* length of the BCN template area */
/* RX FIFO numbers */ /* RX FIFO numbers */
#define RX_FIFO 0 /* data and ctl frames */ #define RX_FIFO 0 /* data and ctl frames */
#define RX_TXSTATUS_FIFO 3 /* RX fifo for tx status packages */ #define RX_TXSTATUS_FIFO 3 /* RX fifo for tx status packages */
...@@ -1397,9 +1395,6 @@ struct d11rxhdr { ...@@ -1397,9 +1395,6 @@ struct d11rxhdr {
u16 RxChan; u16 RxChan;
} __packed; } __packed;
#define RXHDR_LEN 24 /* sizeof struct d11rxhdr */
#define FRAMELEN(h) ((h)->RxFrameSize)
/* /*
* rxhdr: received frame header data * rxhdr: received frame header data
* tsf_l: TSF_L reading * tsf_l: TSF_L reading
......
...@@ -199,8 +199,6 @@ ...@@ -199,8 +199,6 @@
#define MAXNAMEL 8 /* 8 char names */ #define MAXNAMEL 8 /* 8 char names */
#define DI_INFO(dmah) ((dma_info_t *)dmah)
/* descriptor bumping macros */ /* descriptor bumping macros */
/* faster than %, but n must be power of 2 */ /* faster than %, but n must be power of 2 */
#define XXD(x, n) ((x) & ((n) - 1)) #define XXD(x, n) ((x) & ((n) - 1))
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#include <linux/delay.h> #include <linux/delay.h>
#include "types.h" /* forward structure declarations */ #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: /* DMA structure:
* support two DMA engines: 32 bits address or 64 bit addressing * support two DMA engines: 32 bits address or 64 bit addressing
* basic DMA register set is per channel(transmit or receive) * basic DMA register set is per channel(transmit or receive)
...@@ -47,11 +51,6 @@ struct dma64regs { ...@@ -47,11 +51,6 @@ struct dma64regs {
u32 status1; /* active descriptor, xmt error */ 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 */ /* range param for dma_getnexttxp() and dma_txreclaim */
enum txd_range { enum txd_range {
DMA_RANGE_ALL = 1, DMA_RANGE_ALL = 1,
......
...@@ -37,9 +37,6 @@ ...@@ -37,9 +37,6 @@
#define LOCK(wl) spin_lock_bh(&(wl)->lock) #define LOCK(wl) spin_lock_bh(&(wl)->lock)
#define UNLOCK(wl) spin_unlock_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 */ /* locking from inside brcms_isr */
#define ISR_LOCK(wl, flags)\ #define ISR_LOCK(wl, flags)\
do {\ do {\
...@@ -308,9 +305,6 @@ static int brcms_ops_start(struct ieee80211_hw *hw) ...@@ -308,9 +305,6 @@ static int brcms_ops_start(struct ieee80211_hw *hw)
{ {
struct brcms_info *wl = hw->priv; struct brcms_info *wl = hw->priv;
bool blocked; bool blocked;
/*
struct ieee80211_channel *curchan = hw->conf.channel;
*/
ieee80211_wake_queues(hw); ieee80211_wake_queues(hw);
LOCK(wl); LOCK(wl);
...@@ -344,7 +338,7 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -344,7 +338,7 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
wl = HW_TO_WL(hw); wl = hw->priv;
LOCK(wl); LOCK(wl);
err = brcms_up(wl); err = brcms_up(wl);
UNLOCK(wl); UNLOCK(wl);
...@@ -361,7 +355,7 @@ brcms_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -361,7 +355,7 @@ brcms_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{ {
struct brcms_info *wl; struct brcms_info *wl;
wl = HW_TO_WL(hw); wl = hw->priv;
/* put driver in down state */ /* put driver in down state */
LOCK(wl); LOCK(wl);
...@@ -376,7 +370,7 @@ static int ...@@ -376,7 +370,7 @@ static int
ieee_set_channel(struct ieee80211_hw *hw, struct ieee80211_channel *chan, ieee_set_channel(struct ieee80211_hw *hw, struct ieee80211_channel *chan,
enum nl80211_channel_type type) enum nl80211_channel_type type)
{ {
struct brcms_info *wl = HW_TO_WL(hw); struct brcms_info *wl = hw->priv;
int err = 0; int err = 0;
switch (type) { switch (type) {
...@@ -400,7 +394,7 @@ ieee_set_channel(struct ieee80211_hw *hw, struct ieee80211_channel *chan, ...@@ -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) static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
{ {
struct ieee80211_conf *conf = &hw->conf; struct ieee80211_conf *conf = &hw->conf;
struct brcms_info *wl = HW_TO_WL(hw); struct brcms_info *wl = hw->priv;
int err = 0; int err = 0;
int new_int; int new_int;
struct wiphy *wiphy = hw->wiphy; struct wiphy *wiphy = hw->wiphy;
...@@ -468,7 +462,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw, ...@@ -468,7 +462,7 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info, u32 changed) 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; struct wiphy *wiphy = hw->wiphy;
int val; int val;
...@@ -818,7 +812,7 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw, ...@@ -818,7 +812,7 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
static void brcms_ops_rfkill_poll(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; bool blocked;
LOCK(wl); LOCK(wl);
...@@ -830,7 +824,7 @@ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw) ...@@ -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) 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"); no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false");
...@@ -1028,7 +1022,7 @@ static void brcms_remove(struct pci_dev *pdev) ...@@ -1028,7 +1022,7 @@ static void brcms_remove(struct pci_dev *pdev)
int status; int status;
hw = pci_get_drvdata(pdev); hw = pci_get_drvdata(pdev);
wl = HW_TO_WL(hw); wl = hw->priv;
if (!wl) { if (!wl) {
pr_err("wl: brcms_remove: pci_get_drvdata failed\n"); pr_err("wl: brcms_remove: pci_get_drvdata failed\n");
return; return;
...@@ -1090,7 +1084,7 @@ static irqreturn_t brcms_isr(int irq, void *dev_id) ...@@ -1090,7 +1084,7 @@ static irqreturn_t brcms_isr(int irq, void *dev_id)
*/ */
static int ieee_hw_rate_init(struct ieee80211_hw *hw) 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; int has_5g;
char phy_list[4]; char phy_list[4];
...@@ -1339,7 +1333,7 @@ static int brcms_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -1339,7 +1333,7 @@ static int brcms_suspend(struct pci_dev *pdev, pm_message_t state)
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
hw = pci_get_drvdata(pdev); hw = pci_get_drvdata(pdev);
wl = HW_TO_WL(hw); wl = hw->priv;
if (!wl) { if (!wl) {
wiphy_err(wl->wiphy, wiphy_err(wl->wiphy,
"brcms_suspend: pci_get_drvdata failed\n"); "brcms_suspend: pci_get_drvdata failed\n");
...@@ -1364,7 +1358,7 @@ static int brcms_resume(struct pci_dev *pdev) ...@@ -1364,7 +1358,7 @@ static int brcms_resume(struct pci_dev *pdev)
u32 val; u32 val;
hw = pci_get_drvdata(pdev); hw = pci_get_drvdata(pdev);
wl = HW_TO_WL(hw); wl = hw->priv;
if (!wl) { if (!wl) {
wiphy_err(wl->wiphy, wiphy_err(wl->wiphy,
"wl: brcms_resume: pci_get_drvdata failed\n"); "wl: brcms_resume: pci_get_drvdata failed\n");
...@@ -1458,7 +1452,7 @@ void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif, ...@@ -1458,7 +1452,7 @@ void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
*/ */
void brcms_init(struct brcms_info *wl) 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_reset(wl);
brcms_c_init(wl->wlc); brcms_c_init(wl->wlc);
...@@ -1469,7 +1463,7 @@ void brcms_init(struct brcms_info *wl) ...@@ -1469,7 +1463,7 @@ void brcms_init(struct brcms_info *wl)
*/ */
uint brcms_reset(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); brcms_c_reset(wl->wlc);
/* dpc will not be rescheduled */ /* dpc will not be rescheduled */
......
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