|
@@ -1021,29 +1021,38 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
|
|
|
|
|
|
|
|
lbs_deb_enter(LBS_DEB_WEXT);
|
|
lbs_deb_enter(LBS_DEB_WEXT);
|
|
|
lbs_deb_wext("vwrq->value %d\n", vwrq->value);
|
|
lbs_deb_wext("vwrq->value %d\n", vwrq->value);
|
|
|
|
|
+ lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed);
|
|
|
|
|
+
|
|
|
|
|
+ if (vwrq->fixed && vwrq->value == -1)
|
|
|
|
|
+ goto out;
|
|
|
|
|
|
|
|
/* Auto rate? */
|
|
/* Auto rate? */
|
|
|
- if (vwrq->value == -1) {
|
|
|
|
|
- priv->auto_rate = 1;
|
|
|
|
|
|
|
+ priv->enablehwauto = !vwrq->fixed;
|
|
|
|
|
+
|
|
|
|
|
+ if (vwrq->value == -1)
|
|
|
priv->cur_rate = 0;
|
|
priv->cur_rate = 0;
|
|
|
- } else {
|
|
|
|
|
|
|
+ else {
|
|
|
if (vwrq->value % 100000)
|
|
if (vwrq->value % 100000)
|
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
|
|
|
|
+ new_rate = vwrq->value / 500000;
|
|
|
|
|
+ priv->cur_rate = new_rate;
|
|
|
|
|
+ /* the rest is only needed for lbs_set_data_rate() */
|
|
|
memset(rates, 0, sizeof(rates));
|
|
memset(rates, 0, sizeof(rates));
|
|
|
copy_active_data_rates(priv, rates);
|
|
copy_active_data_rates(priv, rates);
|
|
|
- new_rate = vwrq->value / 500000;
|
|
|
|
|
if (!memchr(rates, new_rate, sizeof(rates))) {
|
|
if (!memchr(rates, new_rate, sizeof(rates))) {
|
|
|
lbs_pr_alert("fixed data rate 0x%X out of range\n",
|
|
lbs_pr_alert("fixed data rate 0x%X out of range\n",
|
|
|
new_rate);
|
|
new_rate);
|
|
|
goto out;
|
|
goto out;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- priv->cur_rate = new_rate;
|
|
|
|
|
- priv->auto_rate = 0;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ret = lbs_set_data_rate(priv, new_rate);
|
|
|
|
|
|
|
+ /* Try the newer command first (Firmware Spec 5.1 and above) */
|
|
|
|
|
+ ret = lbs_cmd_802_11_rate_adapt_rateset(priv, CMD_ACT_SET);
|
|
|
|
|
+
|
|
|
|
|
+ /* Fallback to older version */
|
|
|
|
|
+ if (ret)
|
|
|
|
|
+ ret = lbs_set_data_rate(priv, new_rate);
|
|
|
|
|
|
|
|
out:
|
|
out:
|
|
|
lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
|
|
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,
|
|
|
if (priv->connect_status == LBS_CONNECTED) {
|
|
if (priv->connect_status == LBS_CONNECTED) {
|
|
|
vwrq->value = priv->cur_rate * 500000;
|
|
vwrq->value = priv->cur_rate * 500000;
|
|
|
|
|
|
|
|
- if (priv->auto_rate)
|
|
|
|
|
|
|
+ if (priv->enablehwauto)
|
|
|
vwrq->fixed = 0;
|
|
vwrq->fixed = 0;
|
|
|
else
|
|
else
|
|
|
vwrq->fixed = 1;
|
|
vwrq->fixed = 1;
|