@@ -334,6 +334,9 @@ int __mt7925_start(struct mt792x_phy *phy)
334334 ieee80211_queue_delayed_work (mphy -> hw , & mphy -> mac_work ,
335335 MT792x_WATCHDOG_TIME );
336336
337+ if (phy -> chip_cap & MT792x_CHIP_CAP_WF_RF_PIN_CTRL_EVT_EN )
338+ wiphy_rfkill_start_polling (mphy -> hw -> wiphy );
339+
337340 return 0 ;
338341}
339342EXPORT_SYMBOL_GPL (__mt7925_start );
@@ -2205,6 +2208,18 @@ static void mt7925_unassign_vif_chanctx(struct ieee80211_hw *hw,
22052208 mutex_unlock (& dev -> mt76 .mutex );
22062209}
22072210
2211+ static void mt7925_rfkill_poll (struct ieee80211_hw * hw )
2212+ {
2213+ struct mt792x_phy * phy = mt792x_hw_phy (hw );
2214+ int ret ;
2215+
2216+ mt792x_mutex_acquire (phy -> dev );
2217+ ret = mt7925_mcu_wf_rf_pin_ctrl (phy );
2218+ mt792x_mutex_release (phy -> dev );
2219+
2220+ wiphy_rfkill_set_hw_state (hw -> wiphy , ret == 0 );
2221+ }
2222+
22082223const struct ieee80211_ops mt7925_ops = {
22092224 .tx = mt792x_tx ,
22102225 .start = mt7925_start ,
@@ -2267,6 +2282,7 @@ const struct ieee80211_ops mt7925_ops = {
22672282 .link_info_changed = mt7925_link_info_changed ,
22682283 .change_vif_links = mt7925_change_vif_links ,
22692284 .change_sta_links = mt7925_change_sta_links ,
2285+ .rfkill_poll = mt7925_rfkill_poll ,
22702286};
22712287EXPORT_SYMBOL_GPL (mt7925_ops );
22722288
0 commit comments