From: Yogesh Ashok Powar Date: Fri, 25 Jan 2013 10:47:56 +0000 (+0530) Subject: mwl8k: Move tx/rx antenna configuration to mwl8k_probe_hw X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a246ac38cdd886bf053f67d5275a20e1a99ff586;p=linux-beck.git mwl8k: Move tx/rx antenna configuration to mwl8k_probe_hw This avoids calling mwl8k_cmd_rf_antenna functions every time mwl8k_config function is called. Signed-off-by: Yogesh Ashok Powar Signed-off-by: Nishant Sarmukadam Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 78a89f6426b1..b17ef49f9303 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c @@ -4814,12 +4814,6 @@ static int mwl8k_config(struct ieee80211_hw *hw, u32 changed) goto out; } - rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_RX, 0x3); - if (rc) - wiphy_warn(hw->wiphy, "failed to set # of RX antennas"); - rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_TX, 0x7); - if (rc) - wiphy_warn(hw->wiphy, "failed to set # of TX antennas"); } else { rc = mwl8k_cmd_rf_tx_power(hw, conf->power_level); @@ -5709,6 +5703,15 @@ static int mwl8k_probe_hw(struct ieee80211_hw *hw) goto err_free_irq; } + /* Configure Antennas */ + rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_RX, 0x3); + if (rc) + wiphy_warn(hw->wiphy, "failed to set # of RX antennas"); + rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_TX, 0x7); + if (rc) + wiphy_warn(hw->wiphy, "failed to set # of TX antennas"); + + /* Disable interrupts */ iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); free_irq(priv->pdev->irq, hw);