Ejemplo n.º 1
0
static int mwl_mac80211_start(struct ieee80211_hw *hw)
{
	struct mwl_priv *priv = hw->priv;
	int rc;

	/* Enable TX and RX tasklets. */
	tasklet_enable(&priv->tx_task);
	tasklet_enable(&priv->tx_done_task);
	tasklet_enable(&priv->rx_task);
	tasklet_enable(&priv->qe_task);

	/* Enable interrupts */
	mwl_fwcmd_int_enable(hw);

	rc = mwl_fwcmd_radio_enable(hw);
	if (rc)
		goto fwcmd_fail;
	rc = mwl_fwcmd_set_rate_adapt_mode(hw, 0);
	if (rc)
		goto fwcmd_fail;
	rc = mwl_fwcmd_set_wmm_mode(hw, true);
	if (rc)
		goto fwcmd_fail;
	rc = mwl_fwcmd_ht_guard_interval(hw, GUARD_INTERVAL_AUTO);
	if (rc)
		goto fwcmd_fail;
	rc = mwl_fwcmd_set_dwds_stamode(hw, true);
	if (rc)
		goto fwcmd_fail;
	rc = mwl_fwcmd_set_fw_flush_timer(hw, SYSADPT_AMSDU_FLUSH_TIME);
	if (rc)
		goto fwcmd_fail;
	rc = mwl_fwcmd_set_optimization_level(hw, 1);
	if (rc)
		goto fwcmd_fail;

	ieee80211_wake_queues(hw);
	return 0;

fwcmd_fail:
	mwl_fwcmd_int_disable(hw);
	tasklet_disable(&priv->tx_task);
	tasklet_disable(&priv->tx_done_task);
	tasklet_disable(&priv->rx_task);
	tasklet_disable(&priv->qe_task);

	return rc;
}
Ejemplo n.º 2
0
static void mwl_mac80211_stop(struct ieee80211_hw *hw)
{
	struct mwl_priv *priv = hw->priv;

	mwl_fwcmd_radio_disable(hw);

	ieee80211_stop_queues(hw);

	/* Disable interrupts */
	mwl_fwcmd_int_disable(hw);

	/* Disable TX reclaim and RX tasklets. */
	tasklet_disable(&priv->tx_task);
	tasklet_disable(&priv->rx_task);
	tasklet_disable(&priv->qe_task);

	/* Return all skbs to mac80211 */
	mwl_tx_done((unsigned long)hw);
}