void ath_start_rfkill_poll(struct ath_softc *sc) { struct ath_hw *ah = sc->sc_ah; if (ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT) wiphy_rfkill_start_polling(sc->hw->wiphy); }
void rtl_init_rfkill(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); bool radio_state; bool blocked; u8 valid = 0; /*set init state to on */ rtlpriv->rfkill.rfkill_state = true; wiphy_rfkill_set_hw_state(hw->wiphy, 0); radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid); if (valid) { pr_info("wireless switch is %s\n", rtlpriv->rfkill.rfkill_state ? "on" : "off"); rtlpriv->rfkill.rfkill_state = radio_state; blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1; wiphy_rfkill_set_hw_state(hw->wiphy, blocked); } wiphy_rfkill_start_polling(hw->wiphy); }
void rtl8187_rfkill_init(struct ieee80211_hw *hw) { struct rtl8187_priv *priv = hw->priv; priv->rfkill_off = rtl8187_is_radio_enabled(priv); printk(KERN_INFO "rtl8187: wireless switch is %s\n", priv->rfkill_off ? "on" : "off"); wiphy_rfkill_set_hw_state(hw->wiphy, !priv->rfkill_off); wiphy_rfkill_start_polling(hw->wiphy); }
/* * precondition: perimeter lock has been acquired */ bool brcms_rfkill_set_hw_state(struct brcms_info *wl) { bool blocked = brcms_c_check_radio_disabled(wl->wlc); spin_unlock_bh(&wl->lock); wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); if (blocked) wiphy_rfkill_start_polling(wl->pub->ieee_hw->wiphy); spin_lock_bh(&wl->lock); return blocked; }
/* * precondition: perimeter lock has been acquired */ bool wl_rfkill_set_hw_state(struct wl_info *wl) { bool blocked = wlc_check_radio_disabled(wl->wlc); WL_UNLOCK(wl); wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); if (blocked) wiphy_rfkill_start_polling(wl->pub->ieee_hw->wiphy); WL_LOCK(wl); return blocked; }
/* * precondition: perimeter lock has been acquired */ bool wl_rfkill_set_hw_state(struct wl_info *wl) { bool blocked = wlc_check_radio_disabled(wl->wlc); WL_NONE("%s: update hw state: blocked=%s\n", __func__, blocked ? "true" : "false"); WL_UNLOCK(wl); wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); if (blocked) wiphy_rfkill_start_polling(wl->pub->ieee_hw->wiphy); WL_LOCK(wl); return blocked; }
/* ======================================================================== Routine Description: Register MAC80211 Module. Arguments: pAdCB - WLAN control block pointer pDev - Generic device interface pNetDev - Network device Return Value: NONE Note: pDev != pNetDev #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) Can not use pNetDev to replace pDev; Or kernel panic. ======================================================================== */ bool CFG80211_Register( IN void *pAd, IN struct device *pDev, IN struct net_device *pNetDev) { CFG80211_CB *pCfg80211_CB = NULL; CFG80211_BAND BandInfo; /* allocate MAC80211 structure */ pCfg80211_CB = kmalloc(sizeof(CFG80211_CB), GFP_ATOMIC); if (pCfg80211_CB == NULL) { DBGPRINT(RT_DEBUG_ERROR, ("80211> Allocate MAC80211 CB fail!\n")); return false; } /* End of if */ /* allocate wireless device */ RTMP_DRIVER_80211_BANDINFO_GET(pAd, &BandInfo); pCfg80211_CB->pCfg80211_Wdev = \ CFG80211_WdevAlloc(pCfg80211_CB, &BandInfo, pAd, pDev); if (pCfg80211_CB->pCfg80211_Wdev == NULL) { DBGPRINT(RT_DEBUG_ERROR, ("80211> Allocate Wdev fail!\n")); kfree(pCfg80211_CB); return false; } /* End of if */ /* bind wireless device with net device */ #ifdef CONFIG_STA_SUPPORT /* default we are station mode */ pCfg80211_CB->pCfg80211_Wdev->iftype = NL80211_IFTYPE_STATION; #endif /* CONFIG_STA_SUPPORT */ pNetDev->ieee80211_ptr = pCfg80211_CB->pCfg80211_Wdev; SET_NETDEV_DEV(pNetDev, wiphy_dev(pCfg80211_CB->pCfg80211_Wdev->wiphy)); pCfg80211_CB->pCfg80211_Wdev->netdev = pNetDev; #ifdef RFKILL_HW_SUPPORT wiphy_rfkill_start_polling(pCfg80211_CB->pCfg80211_Wdev->wiphy); #endif /* RFKILL_HW_SUPPORT */ RTMP_DRIVER_80211_CB_SET(pAd, pCfg80211_CB); CFG80211DBG(RT_DEBUG_ERROR, ("80211> CFG80211_Register\n")); return true; } /* End of CFG80211_Register */
bool rtl8192_rfkill_init(struct net_device *dev) { struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); struct wireless_dev *wdev = &priv->rtllib->wdev; bool radio_enabled; bool valid = rtl8192_is_radio_enabled(dev, &radio_enabled); if (valid) { priv->rfkill_off = radio_enabled; printk(KERN_INFO "rtl8192: wireless switch is %s\n", priv->rfkill_off ? "on" : "off"); wiphy_rfkill_set_hw_state(wdev->wiphy, !priv->rfkill_off); wiphy_rfkill_start_polling(wdev->wiphy); return true; } else { return false; } }
void rtl_init_rfkill(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); bool radio_state; bool blocked; u8 valid = 0; radio_state = rtlpriv->cfg->ops->radio_onoff_checking(hw, &valid); /*set init state to that of switch */ rtlpriv->rfkill.rfkill_state = radio_state; printk(KERN_INFO "rtlwifi: wireless switch is %s\n", rtlpriv->rfkill.rfkill_state ? "on" : "off"); if (valid) { rtlpriv->rfkill.rfkill_state = radio_state; blocked = (rtlpriv->rfkill.rfkill_state == 1) ? 0 : 1; wiphy_rfkill_set_hw_state(hw->wiphy, blocked); } wiphy_rfkill_start_polling(hw->wiphy); }
void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv) { if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT) wiphy_rfkill_start_polling(priv->hw->wiphy); }