diff options
Diffstat (limited to 'sys/contrib/dev/mediatek/mt76/mt7921/main.c')
| -rw-r--r-- | sys/contrib/dev/mediatek/mt76/mt7921/main.c | 28 | 
1 files changed, 18 insertions, 10 deletions
| diff --git a/sys/contrib/dev/mediatek/mt76/mt7921/main.c b/sys/contrib/dev/mediatek/mt76/mt7921/main.c index 13e58c328aff..5881040ac195 100644 --- a/sys/contrib/dev/mediatek/mt76/mt7921/main.c +++ b/sys/contrib/dev/mediatek/mt76/mt7921/main.c @@ -83,6 +83,11 @@ mt7921_init_he_caps(struct mt792x_phy *phy, enum nl80211_band band,  			he_cap_elem->phy_cap_info[9] |=  				IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU |  				IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU; + +			if (is_mt7922(phy->mt76->dev)) { +				he_cap_elem->phy_cap_info[0] |= +					IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G; +			}  			break;  		case NL80211_IFTYPE_STATION:  			he_cap_elem->mac_cap_info[1] |= @@ -364,7 +369,7 @@ void mt7921_roc_abort_sync(struct mt792x_dev *dev)  {  	struct mt792x_phy *phy = &dev->phy; -	del_timer_sync(&phy->roc_timer); +	timer_delete_sync(&phy->roc_timer);  	cancel_work_sync(&phy->roc_work);  	if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))  		ieee80211_iterate_interfaces(mt76_hw(dev), @@ -395,7 +400,7 @@ static int mt7921_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif)  {  	int err = 0; -	del_timer_sync(&phy->roc_timer); +	timer_delete_sync(&phy->roc_timer);  	cancel_work_sync(&phy->roc_work);  	mt792x_mutex_acquire(phy->dev); @@ -619,7 +624,7 @@ void mt7921_set_runtime_pm(struct mt792x_dev *dev)  	mt76_connac_mcu_set_deep_sleep(&dev->mt76, pm->ds_enable);  } -static int mt7921_config(struct ieee80211_hw *hw, u32 changed) +static int mt7921_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)  {  	struct mt792x_dev *dev = mt792x_hw_dev(hw);  	struct mt792x_phy *phy = mt792x_hw_phy(hw); @@ -811,6 +816,7 @@ int mt7921_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,  	msta->deflink.wcid.phy_idx = mvif->bss_conf.mt76.band_idx;  	msta->deflink.wcid.tx_info |= MT_WCID_TX_INFO_SET;  	msta->deflink.last_txs = jiffies; +	msta->deflink.sta = msta;  	ret = mt76_connac_pm_wake(&dev->mphy, &dev->pm);  	if (ret) @@ -901,7 +907,8 @@ void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,  }  EXPORT_SYMBOL_GPL(mt7921_mac_sta_remove); -static int mt7921_set_rts_threshold(struct ieee80211_hw *hw, u32 val) +static int mt7921_set_rts_threshold(struct ieee80211_hw *hw, int radio_idx, +				    u32 val)  {  	struct mt792x_dev *dev = mt792x_hw_dev(hw); @@ -1082,7 +1089,8 @@ mt7921_stop_sched_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif)  }  static int -mt7921_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant) +mt7921_set_antenna(struct ieee80211_hw *hw, int radio_idx, +		   u32 tx_ant, u32 rx_ant)  {  	struct mt792x_dev *dev = mt792x_hw_dev(hw);  	struct mt792x_phy *phy = mt792x_hw_phy(hw); @@ -1174,6 +1182,9 @@ static void mt7921_sta_set_decap_offload(struct ieee80211_hw *hw,  	struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;  	struct mt792x_dev *dev = mt792x_hw_dev(hw); +	if (!msta->deflink.wcid.sta) +		return; +  	mt792x_mutex_acquire(dev);  	if (enabled) @@ -1448,11 +1459,8 @@ static int mt7921_pre_channel_switch(struct ieee80211_hw *hw,  	if (vif->type != NL80211_IFTYPE_STATION || !vif->cfg.assoc)  		return -EOPNOTSUPP; -	/* Avoid beacon loss due to the CAC(Channel Availability Check) time -	 * of the AP. -	 */  	if (!cfg80211_chandef_usable(hw->wiphy, &chsw->chandef, -				     IEEE80211_CHAN_RADAR)) +				     IEEE80211_CHAN_DISABLED))  		return -EOPNOTSUPP;  	return 0; @@ -1475,7 +1483,7 @@ static void mt7921_abort_channel_switch(struct ieee80211_hw *hw,  {  	struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; -	del_timer_sync(&mvif->csa_timer); +	timer_delete_sync(&mvif->csa_timer);  	cancel_work_sync(&mvif->csa_work);  } | 
