diff options
author | Felix Fietkau <nbd@nbd.name> | 2019-09-30 23:09:06 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-02-14 09:49:59 +0300 |
commit | ac24dd35028b07a9343227c13f630617681a236e (patch) | |
tree | f7866d9896bde152ed24ddcd84a2ed63375622da /drivers/net/wireless/mediatek/mt76/mac80211.c | |
parent | e54432563b68592867adefa5c3ab4d7e46546e83 (diff) | |
download | linux-ac24dd35028b07a9343227c13f630617681a236e.tar.xz |
mt76: introduce struct mt76_phy
This is preparation for supporting multiple wiphys per device to support the
concurrent dual-band feature of MT7615D
On the first wiphy, hw->priv will point to struct mt76_dev, which contains a
struct mt76_phy at the start. For the secondary wiphy, hw->priv will point
to a mt76_phy encapsulated in a driver specific struct
To simplify access to struct mt76_phy members from drivers, the driver specific
device struct is changed to add a union of struct mt76_dev and struct mt76_phy
as the first element
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mac80211.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mac80211.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 73853b449730..14e5e1a54768 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -274,6 +274,7 @@ mt76_alloc_device(struct device *pdev, unsigned int size, const struct mt76_driver_ops *drv_ops) { struct ieee80211_hw *hw; + struct mt76_phy *phy; struct mt76_dev *dev; int i; @@ -286,6 +287,10 @@ mt76_alloc_device(struct device *pdev, unsigned int size, dev->dev = pdev; dev->drv = drv_ops; + phy = &dev->phy; + phy->dev = dev; + phy->hw = hw; + spin_lock_init(&dev->rx_lock); spin_lock_init(&dev->lock); spin_lock_init(&dev->cc_lock); |