diff options
author | Jouni Malinen <jouni.malinen@atheros.com> | 2009-03-03 20:23:28 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-05 22:39:44 +0300 |
commit | bce048d77dff3dcfd75d54dc38580c81baa95853 (patch) | |
tree | 214b954bae87b52bad66c60f625c925be10b3500 /drivers/net/wireless/ath9k/ahb.c | |
parent | 8ca21f0185a606c490867f7471196aa29639e638 (diff) | |
download | linux-bce048d77dff3dcfd75d54dc38580c81baa95853.tar.xz |
ath9k: Add data structure for supporting virtual radio/wiphy operation
This is the initial step in allowing ath9k to register multiple
virtual radios (wiphys). The goal of virtual radios is to allow the
same radio to be shared for multiple virtual interfaces that may
operate on different channels. The mac80211 virtual interface support
is designed only for single channel operation and as such, it is not
suitable for this type of use. Anyway, it can be used on top of the
virtual radio concept, if desired (e.g., use two virtual radios to
handle two channels and then add multiple mac80211 virtual interfaces
on top of each virtual radio).
The new struct ath_wiphy is now registered as the driver data
structure for wiphy. This structure has a pointer to the shared (among
virtual wiphys of the same physical radio) struct ath_softc data. The
primary wiphy maintains the allocated memory for ath_softc. Secondary
(virtual) wiphys will only allocate the new ath_wiphy structure.
Registration of secondary wiphys is added in a separate patch.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/ahb.c')
-rw-r--r-- | drivers/net/wireless/ath9k/ahb.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath9k/ahb.c b/drivers/net/wireless/ath9k/ahb.c index 391c9fd3b646..bc562bd88890 100644 --- a/drivers/net/wireless/ath9k/ahb.c +++ b/drivers/net/wireless/ath9k/ahb.c @@ -96,7 +96,8 @@ static int ath_ahb_probe(struct platform_device *pdev) irq = res->start; - hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops); + hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) + + sizeof(struct ath_softc), &ath9k_ops); if (hw == NULL) { dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); ret = -ENOMEM; @@ -106,7 +107,11 @@ static int ath_ahb_probe(struct platform_device *pdev) SET_IEEE80211_DEV(hw, &pdev->dev); platform_set_drvdata(pdev, hw); - sc = hw->priv; + aphy = hw->priv; + sc = (struct ath_softc *) (aphy + 1); + aphy->sc = sc; + aphy->hw = hw; + sc->pri_wiphy = aphy; sc->hw = hw; sc->dev = &pdev->dev; sc->mem = mem; @@ -156,7 +161,8 @@ static int ath_ahb_remove(struct platform_device *pdev) struct ieee80211_hw *hw = platform_get_drvdata(pdev); if (hw) { - struct ath_softc *sc = hw->priv; + struct ath_wiphy *aphy = hw->priv; + struct ath_softc *sc = aphy->sc; ath_cleanup(sc); platform_set_drvdata(pdev, NULL); |