staging: brcm80211: making wiphy object accessible from wlc and phy
authorRoland Vossen <rvossen@broadcom.com>
Tue, 3 May 2011 09:35:05 +0000 (11:35 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 3 May 2011 19:42:28 +0000 (12:42 -0700)
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: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_cmn.c
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_hal.h
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_int.h
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
drivers/staging/brcm80211/brcmsmac/wl_mac80211.h
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
drivers/staging/brcm80211/brcmsmac/wlc_main.c
drivers/staging/brcm80211/brcmsmac/wlc_main.h
drivers/staging/brcm80211/brcmsmac/wlc_pub.h

index 873d64c9d60c5eff36369df47b7b61d39cd7f421..8fb3e0486f70ec467bf112bd270f25944fc691cd 100644 (file)
@@ -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;
        u32 sflags = 0;
@@ -611,6 +612,7 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars
        if (pi == NULL) {
                return NULL;
        }
+       pi->wiphy = wiphy;
        pi->regs = (d11regs_t *) regs;
        pi->sh = sh;
        pi->phy_init_por = true;
index bf962d5b339af57fe9a40903c1038099ee96ab57..12eabc9f960f3ea432cd61ca0ea3e10b596df8be 100644 (file)
@@ -21,6 +21,7 @@
 #include <siutils.h>
 #include <d11.h>
 #include <wlc_phy_shim.h>
+#include <net/mac80211.h>      /* struct wiphy */
 
 #define        IDCODE_VER_MASK         0x0000000f
 #define        IDCODE_VER_SHIFT        0
@@ -149,7 +150,7 @@ typedef struct shared_phy_params {
 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 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 bool wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype,
index 6e12a95c736051de60b8f4604fc5f17d5ed0fe9d..3d1cd342eb3b839e35793fbd578a6897fcdbed1e 100644 (file)
@@ -936,6 +936,7 @@ struct phy_info {
        u8 phycal_tempdelta;
        u32 mcs20_po;
        u32 mcs40_po;
+       struct wiphy *wiphy;
 };
 
 typedef s32 fixed;
index 3c9994a391a3d2ca30089b1b6a03202d6f4f5a82..f2e481f03c64b78e9e4d26b2201ba3575779d9d3 100644 (file)
@@ -722,6 +722,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
        hw = pci_get_drvdata(btparam);  /* btparam == pdev */
        wl = hw->priv;
        ASSERT(wl);
+       wl->wiphy = hw->wiphy;
 
        atomic_set(&wl->callbacks, 0);
 
index f3198ccd5f58cf0bf22aaa421483d663981b7b06..e7e95169219b178e0ff9d55902b0b1fc8b575afb 100644 (file)
@@ -72,6 +72,7 @@ struct wl_info {
        /* ping-pong stats counters updated by Linux watchdog */
        struct net_device_stats stats_watchdog[2];
        struct wl_firmware fw;
+       struct wiphy *wiphy;
 };
 
 #define WL_LOCK(wl)    spin_lock_bh(&(wl)->lock)
index bd8a629a924b8d0b25c7b6a1bf9bea3db4d04468..9c4b313317a6395ffdf5e12bc02b65eeae70ef72 100644 (file)
@@ -849,7 +849,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
 
                /* Get a phy for this band */
                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) {
                        WL_ERROR("wl%d: wlc_bmac_attach: wlc_phy_attach failed\n",
                                 unit);
index 8c9e1fb604d0446719dbdd89c9100d94f7434f27..b4ca207c856691125e5b45e431459a71f2fe1bdf 100644 (file)
@@ -52,6 +52,8 @@
 #include "wlc_alloc.h"
 #include "wl_dbg.h"
 
+#include "wl_mac80211.h"
+
 /*
  *     Disable statistics counting for WME
  */
@@ -1674,8 +1676,9 @@ struct wlc_pub *wlc_pub(void *wlc)
 /*
  * The common driver entry routine. Error codes should be unique
  */
-void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
-                void *regsva, uint bustype, void *btparam, uint *perr)
+void *wlc_attach(struct wl_info *wl, u16 vendor, u16 device, uint unit,
+                bool piomode, void *regsva, uint bustype, void *btparam,
+                uint *perr)
 {
        struct wlc_info *wlc;
        uint err = 0;
@@ -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);
        if (wlc == NULL)
                goto fail;
+       wlc->wiphy = wl->wiphy;
        pub = wlc->pub;
 
 #if defined(BCMDBG)
index f11161dc0c01e6b28c9f4171a088298b77b1b048..a8583561fb09e702e6b8e54e9054fb05ac57b5e2 100644 (file)
@@ -757,6 +757,7 @@ struct wlc_info {
                                 */
        bool pr80838_war;
        uint hwrxoff;
+       struct wiphy *wiphy;
 };
 
 /* antsel module specific state */
index 273c5085720fee696e92b9e1599252b39c482a4d..2b51440f886e3e54fe758b92344b7036262800eb 100644 (file)
@@ -480,7 +480,7 @@ extern const u8 wme_fifo2ac[];
 #define        WLC_PROT_N_OBSS         16      /* non-HT OBSS present */
 
 /* 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,
                        uint *perr);
 extern uint wlc_detach(struct wlc_info *wlc);