Ejemplo n.º 1
0
int rtl_init_core(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_mac *rtlmac = rtl_mac(rtl_priv(hw));

	/* <1> init mac80211 */
	_rtl_init_mac80211(hw);
	rtlmac->hw = hw;

	/* <2> rate control register */
	if (rtl_rate_control_register()) {
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
			 ("rtl: Unable to register rtl_rc,"
			  "use default RC !!\n"));
	} else {
		hw->rate_control_algorithm = "rtl_rc";
	}

	/*
	 * <3> init CRDA must come after init
	 * mac80211 hw  in _rtl_init_mac80211.
	 */
	if (rtl_regd_init(hw, rtl_reg_notifier)) {
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, ("REGD init failed\n"));
		return 1;
	} else {
		/* CRDA regd hint must after init CRDA */
		if (regulatory_hint(hw->wiphy, rtlpriv->regd.alpha2)) {
			RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
				 ("regulatory_hint fail\n"));
		}
	}

	/* <4> locks */
	mutex_init(&rtlpriv->locks.conf_mutex);
	spin_lock_init(&rtlpriv->locks.ips_lock);
	spin_lock_init(&rtlpriv->locks.irq_th_lock);
	spin_lock_init(&rtlpriv->locks.h2c_lock);
	spin_lock_init(&rtlpriv->locks.rf_ps_lock);
	spin_lock_init(&rtlpriv->locks.rf_lock);
	spin_lock_init(&rtlpriv->locks.lps_lock);

	rtlmac->link_state = MAC80211_NOLINK;

	/* <5> init deferred work */
	_rtl_init_deferred_work(hw);

	return 0;
}
Ejemplo n.º 2
0
int rtl_init_core(struct ieee80211_hw *hw)
{
	struct rtl_priv *rtlpriv = rtl_priv(hw);
	struct rtl_mac *rtlmac = rtl_mac(rtl_priv(hw));

	
	_rtl_init_mac80211(hw);
	rtlmac->hw = hw;

	
	hw->rate_control_algorithm = "rtl_rc";

	if (rtl_regd_init(hw, rtl_reg_notifier)) {
		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "REGD init failed\n");
		return 1;
	} else {
		
		if (regulatory_hint(hw->wiphy, rtlpriv->regd.alpha2)) {
			RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
				 "regulatory_hint fail\n");
		}
	}

	
	mutex_init(&rtlpriv->locks.conf_mutex);
	mutex_init(&rtlpriv->locks.ps_mutex);
	spin_lock_init(&rtlpriv->locks.ips_lock);
	spin_lock_init(&rtlpriv->locks.irq_th_lock);
	spin_lock_init(&rtlpriv->locks.h2c_lock);
	spin_lock_init(&rtlpriv->locks.rf_ps_lock);
	spin_lock_init(&rtlpriv->locks.rf_lock);
	spin_lock_init(&rtlpriv->locks.waitq_lock);
	spin_lock_init(&rtlpriv->locks.cck_and_rw_pagea_lock);

	rtlmac->link_state = MAC80211_NOLINK;

	
	_rtl_init_deferred_work(hw);

	return 0;
}