aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/orinoco.c')
-rw-r--r--drivers/net/wireless/orinoco.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 8a31b591a901..9e19a963febc 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -76,13 +76,13 @@
76 76
77#define DRIVER_NAME "orinoco" 77#define DRIVER_NAME "orinoco"
78 78
79#include <linux/config.h>
80#include <linux/module.h> 79#include <linux/module.h>
81#include <linux/kernel.h> 80#include <linux/kernel.h>
82#include <linux/init.h> 81#include <linux/init.h>
83#include <linux/netdevice.h> 82#include <linux/netdevice.h>
84#include <linux/etherdevice.h> 83#include <linux/etherdevice.h>
85#include <linux/ethtool.h> 84#include <linux/ethtool.h>
85#include <linux/if_arp.h>
86#include <linux/wireless.h> 86#include <linux/wireless.h>
87#include <net/iw_handler.h> 87#include <net/iw_handler.h>
88#include <net/ieee80211.h> 88#include <net/ieee80211.h>
@@ -165,7 +165,7 @@ static const u8 encaps_hdr[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
165#define MAX_RID_LEN 1024 165#define MAX_RID_LEN 1024
166 166
167static const struct iw_handler_def orinoco_handler_def; 167static const struct iw_handler_def orinoco_handler_def;
168static struct ethtool_ops orinoco_ethtool_ops; 168static const struct ethtool_ops orinoco_ethtool_ops;
169 169
170/********************************************************************/ 170/********************************************************************/
171/* Data tables */ 171/* Data tables */
@@ -2876,7 +2876,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,
2876 if (orinoco_lock(priv, &flags) != 0) 2876 if (orinoco_lock(priv, &flags) != 0)
2877 return -EBUSY; 2877 return -EBUSY;
2878 2878
2879 if (erq->pointer) { 2879 if (erq->length > 0) {
2880 if ((index < 0) || (index >= ORINOCO_MAX_KEYS)) 2880 if ((index < 0) || (index >= ORINOCO_MAX_KEYS))
2881 index = priv->tx_key; 2881 index = priv->tx_key;
2882 2882
@@ -2919,7 +2919,7 @@ static int orinoco_ioctl_setiwencode(struct net_device *dev,
2919 if (erq->flags & IW_ENCODE_RESTRICTED) 2919 if (erq->flags & IW_ENCODE_RESTRICTED)
2920 restricted = 1; 2920 restricted = 1;
2921 2921
2922 if (erq->pointer) { 2922 if (erq->pointer && erq->length > 0) {
2923 priv->keys[index].len = cpu_to_le16(xlen); 2923 priv->keys[index].len = cpu_to_le16(xlen);
2924 memset(priv->keys[index].data, 0, 2924 memset(priv->keys[index].data, 0,
2925 sizeof(priv->keys[index].data)); 2925 sizeof(priv->keys[index].data));
@@ -3037,7 +3037,7 @@ static int orinoco_ioctl_getessid(struct net_device *dev,
3037 } 3037 }
3038 3038
3039 erq->flags = 1; 3039 erq->flags = 1;
3040 erq->length = strlen(essidbuf) + 1; 3040 erq->length = strlen(essidbuf);
3041 3041
3042 return 0; 3042 return 0;
3043} 3043}
@@ -3078,7 +3078,7 @@ static int orinoco_ioctl_getnick(struct net_device *dev,
3078 memcpy(nickbuf, priv->nick, IW_ESSID_MAX_SIZE+1); 3078 memcpy(nickbuf, priv->nick, IW_ESSID_MAX_SIZE+1);
3079 orinoco_unlock(priv, &flags); 3079 orinoco_unlock(priv, &flags);
3080 3080
3081 nrq->length = strlen(nickbuf)+1; 3081 nrq->length = strlen(nickbuf);
3082 3082
3083 return 0; 3083 return 0;
3084} 3084}
@@ -3575,14 +3575,14 @@ static int orinoco_ioctl_getretry(struct net_device *dev,
3575 rrq->value = lifetime * 1000; /* ??? */ 3575 rrq->value = lifetime * 1000; /* ??? */
3576 } else { 3576 } else {
3577 /* By default, display the min number */ 3577 /* By default, display the min number */
3578 if ((rrq->flags & IW_RETRY_MAX)) { 3578 if ((rrq->flags & IW_RETRY_LONG)) {
3579 rrq->flags = IW_RETRY_LIMIT | IW_RETRY_MAX; 3579 rrq->flags = IW_RETRY_LIMIT | IW_RETRY_LONG;
3580 rrq->value = long_limit; 3580 rrq->value = long_limit;
3581 } else { 3581 } else {
3582 rrq->flags = IW_RETRY_LIMIT; 3582 rrq->flags = IW_RETRY_LIMIT;
3583 rrq->value = short_limit; 3583 rrq->value = short_limit;
3584 if(short_limit != long_limit) 3584 if(short_limit != long_limit)
3585 rrq->flags |= IW_RETRY_MIN; 3585 rrq->flags |= IW_RETRY_SHORT;
3586 } 3586 }
3587 } 3587 }
3588 3588
@@ -4293,7 +4293,7 @@ static void orinoco_get_drvinfo(struct net_device *dev,
4293 "PCMCIA %p", priv->hw.iobase); 4293 "PCMCIA %p", priv->hw.iobase);
4294} 4294}
4295 4295
4296static struct ethtool_ops orinoco_ethtool_ops = { 4296static const struct ethtool_ops orinoco_ethtool_ops = {
4297 .get_drvinfo = orinoco_get_drvinfo, 4297 .get_drvinfo = orinoco_get_drvinfo,
4298 .get_link = ethtool_op_get_link, 4298 .get_link = ethtool_op_get_link,
4299}; 4299};