Example #1
0
static int __init rtl_core_module_init(void)
{
	if (rtl_rate_control_register())
		printk(KERN_ERR "rtlwifi: Unable to register rtl_rc,"
		       "use default RC !!\n");
	return 0;
}
Example #2
0
static int __init rtl_core_module_init(void)
{
	if (rtl_rate_control_register())
		pr_err("Unable to register rtl_rc, use default RC !!\n");

	return 0;
}
Example #3
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;
}