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

staging: brcm80211: making wiphy object accessible from wlc and phy

Next commits will replace WL_ERROR and friends with BCMMSG. Because
this new message log function require a wiphy object, device object pointers
have been added to three data structures.

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 13e059c3
...@@ -581,7 +581,8 @@ void wlc_phy_shared_detach(shared_phy_t *phy_sh) ...@@ -581,7 +581,8 @@ void wlc_phy_shared_detach(shared_phy_t *phy_sh)
} }
} }
wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars) wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
char *vars, struct wiphy *wiphy)
{ {
phy_info_t *pi; phy_info_t *pi;
u32 sflags = 0; u32 sflags = 0;
...@@ -611,6 +612,7 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars ...@@ -611,6 +612,7 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars
if (pi == NULL) { if (pi == NULL) {
return NULL; return NULL;
} }
pi->wiphy = wiphy;
pi->regs = (d11regs_t *) regs; pi->regs = (d11regs_t *) regs;
pi->sh = sh; pi->sh = sh;
pi->phy_init_por = true; pi->phy_init_por = true;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <siutils.h> #include <siutils.h>
#include <d11.h> #include <d11.h>
#include <wlc_phy_shim.h> #include <wlc_phy_shim.h>
#include <net/mac80211.h> /* struct wiphy */
#define IDCODE_VER_MASK 0x0000000f #define IDCODE_VER_MASK 0x0000000f
#define IDCODE_VER_SHIFT 0 #define IDCODE_VER_SHIFT 0
...@@ -149,7 +150,7 @@ typedef struct shared_phy_params { ...@@ -149,7 +150,7 @@ typedef struct shared_phy_params {
extern shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp); extern shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp);
extern void wlc_phy_shared_detach(shared_phy_t *phy_sh); extern void wlc_phy_shared_detach(shared_phy_t *phy_sh);
extern wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, extern wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
char *vars); char *vars, struct wiphy *wiphy);
extern void wlc_phy_detach(wlc_phy_t *ppi); extern void wlc_phy_detach(wlc_phy_t *ppi);
extern bool wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype, extern bool wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype,
......
...@@ -936,6 +936,7 @@ struct phy_info { ...@@ -936,6 +936,7 @@ struct phy_info {
u8 phycal_tempdelta; u8 phycal_tempdelta;
u32 mcs20_po; u32 mcs20_po;
u32 mcs40_po; u32 mcs40_po;
struct wiphy *wiphy;
}; };
typedef s32 fixed; typedef s32 fixed;
......
...@@ -722,6 +722,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs, ...@@ -722,6 +722,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
hw = pci_get_drvdata(btparam); /* btparam == pdev */ hw = pci_get_drvdata(btparam); /* btparam == pdev */
wl = hw->priv; wl = hw->priv;
ASSERT(wl); ASSERT(wl);
wl->wiphy = hw->wiphy;
atomic_set(&wl->callbacks, 0); atomic_set(&wl->callbacks, 0);
......
...@@ -72,6 +72,7 @@ struct wl_info { ...@@ -72,6 +72,7 @@ struct wl_info {
/* ping-pong stats counters updated by Linux watchdog */ /* ping-pong stats counters updated by Linux watchdog */
struct net_device_stats stats_watchdog[2]; struct net_device_stats stats_watchdog[2];
struct wl_firmware fw; struct wl_firmware fw;
struct wiphy *wiphy;
}; };
#define WL_LOCK(wl) spin_lock_bh(&(wl)->lock) #define WL_LOCK(wl) spin_lock_bh(&(wl)->lock)
......
...@@ -849,7 +849,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit, ...@@ -849,7 +849,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
/* Get a phy for this band */ /* Get a phy for this band */
wlc_hw->band->pi = wlc_phy_attach(wlc_hw->phy_sh, wlc_hw->band->pi = wlc_phy_attach(wlc_hw->phy_sh,
(void *)regs, wlc_bmac_bandtype(wlc_hw), vars); (void *)regs, wlc_bmac_bandtype(wlc_hw), vars,
wlc->wiphy);
if (wlc_hw->band->pi == NULL) { if (wlc_hw->band->pi == NULL) {
WL_ERROR("wl%d: wlc_bmac_attach: wlc_phy_attach failed\n", WL_ERROR("wl%d: wlc_bmac_attach: wlc_phy_attach failed\n",
unit); unit);
......
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
#include "wlc_alloc.h" #include "wlc_alloc.h"
#include "wl_dbg.h" #include "wl_dbg.h"
#include "wl_mac80211.h"
/* /*
* Disable statistics counting for WME * Disable statistics counting for WME
*/ */
...@@ -1674,8 +1676,9 @@ struct wlc_pub *wlc_pub(void *wlc) ...@@ -1674,8 +1676,9 @@ struct wlc_pub *wlc_pub(void *wlc)
/* /*
* The common driver entry routine. Error codes should be unique * The common driver entry routine. Error codes should be unique
*/ */
void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, void *wlc_attach(struct wl_info *wl, u16 vendor, u16 device, uint unit,
void *regsva, uint bustype, void *btparam, uint *perr) bool piomode, void *regsva, uint bustype, void *btparam,
uint *perr)
{ {
struct wlc_info *wlc; struct wlc_info *wlc;
uint err = 0; uint err = 0;
...@@ -1688,6 +1691,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode, ...@@ -1688,6 +1691,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
wlc = (struct wlc_info *) wlc_attach_malloc(unit, &err, device); wlc = (struct wlc_info *) wlc_attach_malloc(unit, &err, device);
if (wlc == NULL) if (wlc == NULL)
goto fail; goto fail;
wlc->wiphy = wl->wiphy;
pub = wlc->pub; pub = wlc->pub;
#if defined(BCMDBG) #if defined(BCMDBG)
......
...@@ -757,6 +757,7 @@ struct wlc_info { ...@@ -757,6 +757,7 @@ struct wlc_info {
*/ */
bool pr80838_war; bool pr80838_war;
uint hwrxoff; uint hwrxoff;
struct wiphy *wiphy;
}; };
/* antsel module specific state */ /* antsel module specific state */
......
...@@ -480,7 +480,7 @@ extern const u8 wme_fifo2ac[]; ...@@ -480,7 +480,7 @@ extern const u8 wme_fifo2ac[];
#define WLC_PROT_N_OBSS 16 /* non-HT OBSS present */ #define WLC_PROT_N_OBSS 16 /* non-HT OBSS present */
/* common functions for every port */ /* common functions for every port */
extern void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, extern void *wlc_attach(struct wl_info *wl, u16 vendor, u16 device, uint unit,
bool piomode, void *regsva, uint bustype, void *btparam, bool piomode, void *regsva, uint bustype, void *btparam,
uint *perr); uint *perr);
extern uint wlc_detach(struct wlc_info *wlc); extern uint wlc_detach(struct wlc_info *wlc);
......
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