aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2011-09-26 23:37:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-30 15:56:59 -0400
commitcbaaf592b742ccecfd066e796cdb1eda461f4db2 (patch)
tree6f5ce9b4d91cab8cbc8cbf304b411492120fc505 /drivers
parent82df4d38a0194ad1804d1ab4716577d194be5a53 (diff)
mwifiex: remove unreachable code
In disconnected state "iw dev mlan0 link" command will return from cfg80211 stack itself. We also have an error check in mwifiex_cfg80211_get_station() routine. Therefore the code under "if (!priv->media_connected)" condition in mwifiex_rate_ioctl_get_rate_value() routine becomes unreachable. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index a9dfeb1b4ace..520800b618e7 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -720,51 +720,9 @@ done:
720static int mwifiex_rate_ioctl_get_rate_value(struct mwifiex_private *priv, 720static int mwifiex_rate_ioctl_get_rate_value(struct mwifiex_private *priv,
721 struct mwifiex_rate_cfg *rate_cfg) 721 struct mwifiex_rate_cfg *rate_cfg)
722{ 722{
723 struct mwifiex_adapter *adapter = priv->adapter;
724
725 rate_cfg->is_rate_auto = priv->is_data_rate_auto; 723 rate_cfg->is_rate_auto = priv->is_data_rate_auto;
726 if (!priv->media_connected) { 724 return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_TX_RATE_QUERY,
727 switch (adapter->config_bands) { 725 HostCmd_ACT_GEN_GET, 0, NULL);
728 case BAND_B:
729 /* Return the lowest supported rate for B band */
730 rate_cfg->rate = supported_rates_b[0] & 0x7f;
731 break;
732 case BAND_G:
733 case BAND_G | BAND_GN:
734 /* Return the lowest supported rate for G band */
735 rate_cfg->rate = supported_rates_g[0] & 0x7f;
736 break;
737 case BAND_B | BAND_G:
738 case BAND_A | BAND_B | BAND_G:
739 case BAND_A | BAND_B:
740 case BAND_A | BAND_B | BAND_G | BAND_AN | BAND_GN:
741 case BAND_B | BAND_G | BAND_GN:
742 /* Return the lowest supported rate for BG band */
743 rate_cfg->rate = supported_rates_bg[0] & 0x7f;
744 break;
745 case BAND_A:
746 case BAND_A | BAND_G:
747 case BAND_A | BAND_G | BAND_AN | BAND_GN:
748 case BAND_A | BAND_AN:
749 /* Return the lowest supported rate for A band */
750 rate_cfg->rate = supported_rates_a[0] & 0x7f;
751 break;
752 case BAND_GN:
753 /* Return the lowest supported rate for N band */
754 rate_cfg->rate = supported_rates_n[0] & 0x7f;
755 break;
756 default:
757 dev_warn(adapter->dev, "invalid band %#x\n",
758 adapter->config_bands);
759 break;
760 }
761 } else {
762 return mwifiex_send_cmd_sync(priv,
763 HostCmd_CMD_802_11_TX_RATE_QUERY,
764 HostCmd_ACT_GEN_GET, 0, NULL);
765 }
766
767 return 0;
768} 726}
769 727
770/* 728/*