aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/wext.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r--drivers/net/wireless/libertas/wext.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 0973d015a520..8b3ed77860b3 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -1002,7 +1002,7 @@ static int lbs_mesh_set_freq(struct net_device *dev,
1002 else if (priv->mode == IW_MODE_ADHOC) 1002 else if (priv->mode == IW_MODE_ADHOC)
1003 lbs_stop_adhoc_network(priv); 1003 lbs_stop_adhoc_network(priv);
1004 } 1004 }
1005 lbs_mesh_config(priv, 1, fwrq->m); 1005 lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START, fwrq->m);
1006 lbs_update_channel(priv); 1006 lbs_update_channel(priv);
1007 ret = 0; 1007 ret = 0;
1008 1008
@@ -1021,29 +1021,38 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
1021 1021
1022 lbs_deb_enter(LBS_DEB_WEXT); 1022 lbs_deb_enter(LBS_DEB_WEXT);
1023 lbs_deb_wext("vwrq->value %d\n", vwrq->value); 1023 lbs_deb_wext("vwrq->value %d\n", vwrq->value);
1024 lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed);
1025
1026 if (vwrq->fixed && vwrq->value == -1)
1027 goto out;
1024 1028
1025 /* Auto rate? */ 1029 /* Auto rate? */
1026 if (vwrq->value == -1) { 1030 priv->enablehwauto = !vwrq->fixed;
1027 priv->auto_rate = 1; 1031
1032 if (vwrq->value == -1)
1028 priv->cur_rate = 0; 1033 priv->cur_rate = 0;
1029 } else { 1034 else {
1030 if (vwrq->value % 100000) 1035 if (vwrq->value % 100000)
1031 goto out; 1036 goto out;
1032 1037
1038 new_rate = vwrq->value / 500000;
1039 priv->cur_rate = new_rate;
1040 /* the rest is only needed for lbs_set_data_rate() */
1033 memset(rates, 0, sizeof(rates)); 1041 memset(rates, 0, sizeof(rates));
1034 copy_active_data_rates(priv, rates); 1042 copy_active_data_rates(priv, rates);
1035 new_rate = vwrq->value / 500000;
1036 if (!memchr(rates, new_rate, sizeof(rates))) { 1043 if (!memchr(rates, new_rate, sizeof(rates))) {
1037 lbs_pr_alert("fixed data rate 0x%X out of range\n", 1044 lbs_pr_alert("fixed data rate 0x%X out of range\n",
1038 new_rate); 1045 new_rate);
1039 goto out; 1046 goto out;
1040 } 1047 }
1041
1042 priv->cur_rate = new_rate;
1043 priv->auto_rate = 0;
1044 } 1048 }
1045 1049
1046 ret = lbs_set_data_rate(priv, new_rate); 1050 /* Try the newer command first (Firmware Spec 5.1 and above) */
1051 ret = lbs_cmd_802_11_rate_adapt_rateset(priv, CMD_ACT_SET);
1052
1053 /* Fallback to older version */
1054 if (ret)
1055 ret = lbs_set_data_rate(priv, new_rate);
1047 1056
1048out: 1057out:
1049 lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); 1058 lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
@@ -1060,7 +1069,7 @@ static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info,
1060 if (priv->connect_status == LBS_CONNECTED) { 1069 if (priv->connect_status == LBS_CONNECTED) {
1061 vwrq->value = priv->cur_rate * 500000; 1070 vwrq->value = priv->cur_rate * 500000;
1062 1071
1063 if (priv->auto_rate) 1072 if (priv->enablehwauto)
1064 vwrq->fixed = 0; 1073 vwrq->fixed = 0;
1065 else 1074 else
1066 vwrq->fixed = 1; 1075 vwrq->fixed = 1;
@@ -2011,7 +2020,8 @@ static int lbs_mesh_set_essid(struct net_device *dev,
2011 priv->mesh_ssid_len = dwrq->length; 2020 priv->mesh_ssid_len = dwrq->length;
2012 } 2021 }
2013 2022
2014 lbs_mesh_config(priv, 1, priv->curbssparams.channel); 2023 lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_START,
2024 priv->curbssparams.channel);
2015 out: 2025 out:
2016 lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret); 2026 lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
2017 return ret; 2027 return ret;