Commit 7f8544cc authored by Jean Tourrilhes's avatar Jean Tourrilhes Committed by John W. Linville

[PATCH] WE-21 for airo

Signed-off-by: default avatarJean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent baef1865
...@@ -5868,7 +5868,7 @@ static int airo_set_essid(struct net_device *dev, ...@@ -5868,7 +5868,7 @@ static int airo_set_essid(struct net_device *dev,
int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
/* Check the size of the string */ /* Check the size of the string */
if(dwrq->length > IW_ESSID_MAX_SIZE+1) { if(dwrq->length > IW_ESSID_MAX_SIZE) {
return -E2BIG ; return -E2BIG ;
} }
/* Check if index is valid */ /* Check if index is valid */
...@@ -5880,7 +5880,7 @@ static int airo_set_essid(struct net_device *dev, ...@@ -5880,7 +5880,7 @@ static int airo_set_essid(struct net_device *dev,
memset(SSID_rid.ssids[index].ssid, 0, memset(SSID_rid.ssids[index].ssid, 0,
sizeof(SSID_rid.ssids[index].ssid)); sizeof(SSID_rid.ssids[index].ssid));
memcpy(SSID_rid.ssids[index].ssid, extra, dwrq->length); memcpy(SSID_rid.ssids[index].ssid, extra, dwrq->length);
SSID_rid.ssids[index].len = dwrq->length - 1; SSID_rid.ssids[index].len = dwrq->length;
} }
SSID_rid.len = sizeof(SSID_rid); SSID_rid.len = sizeof(SSID_rid);
/* Write it to the card */ /* Write it to the card */
...@@ -5990,7 +5990,7 @@ static int airo_set_nick(struct net_device *dev, ...@@ -5990,7 +5990,7 @@ static int airo_set_nick(struct net_device *dev,
struct airo_info *local = dev->priv; struct airo_info *local = dev->priv;
/* Check the size of the string */ /* Check the size of the string */
if(dwrq->length > 16 + 1) { if(dwrq->length > 16) {
return -E2BIG; return -E2BIG;
} }
readConfigRid(local, 1); readConfigRid(local, 1);
...@@ -6015,7 +6015,7 @@ static int airo_get_nick(struct net_device *dev, ...@@ -6015,7 +6015,7 @@ static int airo_get_nick(struct net_device *dev,
readConfigRid(local, 1); readConfigRid(local, 1);
strncpy(extra, local->config.nodeName, 16); strncpy(extra, local->config.nodeName, 16);
extra[16] = '\0'; extra[16] = '\0';
dwrq->length = strlen(extra) + 1; dwrq->length = strlen(extra);
return 0; return 0;
} }
...@@ -6767,9 +6767,9 @@ static int airo_set_retry(struct net_device *dev, ...@@ -6767,9 +6767,9 @@ static int airo_set_retry(struct net_device *dev,
} }
readConfigRid(local, 1); readConfigRid(local, 1);
if(vwrq->flags & IW_RETRY_LIMIT) { if(vwrq->flags & IW_RETRY_LIMIT) {
if(vwrq->flags & IW_RETRY_MAX) if(vwrq->flags & IW_RETRY_LONG)
local->config.longRetryLimit = vwrq->value; local->config.longRetryLimit = vwrq->value;
else if (vwrq->flags & IW_RETRY_MIN) else if (vwrq->flags & IW_RETRY_SHORT)
local->config.shortRetryLimit = vwrq->value; local->config.shortRetryLimit = vwrq->value;
else { else {
/* No modifier : set both */ /* No modifier : set both */
...@@ -6805,14 +6805,14 @@ static int airo_get_retry(struct net_device *dev, ...@@ -6805,14 +6805,14 @@ static int airo_get_retry(struct net_device *dev,
if((vwrq->flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) { if((vwrq->flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) {
vwrq->flags = IW_RETRY_LIFETIME; vwrq->flags = IW_RETRY_LIFETIME;
vwrq->value = (int)local->config.txLifetime * 1024; vwrq->value = (int)local->config.txLifetime * 1024;
} else if((vwrq->flags & IW_RETRY_MAX)) { } else if((vwrq->flags & IW_RETRY_LONG)) {
vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_MAX; vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_LONG;
vwrq->value = (int)local->config.longRetryLimit; vwrq->value = (int)local->config.longRetryLimit;
} else { } else {
vwrq->flags = IW_RETRY_LIMIT; vwrq->flags = IW_RETRY_LIMIT;
vwrq->value = (int)local->config.shortRetryLimit; vwrq->value = (int)local->config.shortRetryLimit;
if((int)local->config.shortRetryLimit != (int)local->config.longRetryLimit) if((int)local->config.shortRetryLimit != (int)local->config.longRetryLimit)
vwrq->flags |= IW_RETRY_MIN; vwrq->flags |= IW_RETRY_SHORT;
} }
return 0; return 0;
...@@ -6990,6 +6990,7 @@ static int airo_set_power(struct net_device *dev, ...@@ -6990,6 +6990,7 @@ static int airo_set_power(struct net_device *dev,
local->config.rmode |= RXMODE_BC_MC_ADDR; local->config.rmode |= RXMODE_BC_MC_ADDR;
set_bit (FLAG_COMMIT, &local->flags); set_bit (FLAG_COMMIT, &local->flags);
case IW_POWER_ON: case IW_POWER_ON:
/* This is broken, fixme ;-) */
break; break;
default: default:
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment