Commit 98ff26e5 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Kalle Valo
Browse files

mt76: unify mt76x02_vif struct



Private vif structures definitions are the same for mt76x2 and mt76x0.

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 459e237f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -689,7 +689,7 @@ int mt76x0_register_device(struct mt76x0_dev *dev)
	hw->max_rate_tries = 1;

	hw->sta_data_size = sizeof(struct mt76_sta);
	hw->vif_data_size = sizeof(struct mt76_vif);
	hw->vif_data_size = sizeof(struct mt76x02_vif);

	SET_IEEE80211_PERM_ADDR(hw, dev->macaddr);

+4 −4
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ static int mt76x0_add_interface(struct ieee80211_hw *hw,
				 struct ieee80211_vif *vif)
{
	struct mt76x0_dev *dev = hw->priv;
	struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
	struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
	unsigned int idx;

	idx = ffs(~dev->vif_mask);
@@ -77,7 +77,7 @@ static void mt76x0_remove_interface(struct ieee80211_hw *hw,
				     struct ieee80211_vif *vif)
{
	struct mt76x0_dev *dev = hw->priv;
	struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
	struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
	unsigned int wcid = mvif->group_wcid.idx;

	dev->wcid_mask[wcid / BITS_PER_LONG] &= ~BIT(wcid % BITS_PER_LONG);
@@ -160,7 +160,7 @@ mt76x0_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
{
	struct mt76x0_dev *dev = hw->priv;
	struct mt76_sta *msta = (struct mt76_sta *) sta->drv_priv;
	struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
	struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
	int ret = 0;
	int idx = 0;

@@ -242,7 +242,7 @@ mt76x0_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
		struct ieee80211_key_conf *key)
{
	struct mt76x0_dev *dev = hw->priv;
	struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
	struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
	struct mt76_sta *msta = sta ? (struct mt76_sta *) sta->drv_priv : NULL;
	struct mt76_wcid *wcid = msta ? &msta->wcid : &mvif->group_wcid;
	int idx = key->keyidx;
+0 −6
Original line number Diff line number Diff line
@@ -219,12 +219,6 @@ struct mt76x0_wcid {
	u8 tx_rate_nss;
};

struct mt76_vif {
	u8 idx;

	struct mt76_wcid group_wcid;
};

struct mt76_tx_status {
	u8 valid:1;
	u8 success:1;
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ void mt76x0_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
		msta = (struct mt76_sta *) sta->drv_priv;
		wcid = &msta->wcid;
	} else if (vif && (!info->control.hw_key && wcid->hw_key_idx != 0xff)) {
		struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
		struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;

		wcid = &mvif->group_wcid;
	}
+6 −0
Original line number Diff line number Diff line
@@ -18,6 +18,12 @@
#ifndef __MT76X02_MAC_H
#define __MT76X02_MAC_H

struct mt76x02_vif {
	u8 idx;

	struct mt76_wcid group_wcid;
};

static inline bool mt76x02_wait_for_mac(struct mt76_dev *dev)
{
	const u32 MAC_CSR0 = 0x1000;
Loading