wireless: Read scan flags correctly on x86-64
authorDavid Kilroy <kilroyd@googlemail.com>
Sat, 13 Sep 2008 11:22:05 +0000 (12:22 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 24 Sep 2008 20:17:58 +0000 (16:17 -0400)
The SIOCSIWSCAN handler is passed data in an iw_point structure. Some
drivers erronously use an iw_param instead.

On 32 bit architectures the difference isn't noticed as the flags
parameter tends to be the only one used by scan handlers and is at the
same offset.

On 64 bit architectures the pointer in the iw_point structure means the
flag parameter is at different offsets in these structures.

Thanks to Jean Tourrilhes for tracking this down for orinoco, and Pavel
Roskin for confirming the fix and identifying other suspect handlers.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Acked-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/airo.c
drivers/net/wireless/atmel.c
drivers/net/wireless/orinoco.c
drivers/net/wireless/rndis_wlan.c

index ae58a12befd349a2e8445fcf2f20324395cf921b..370133e492d259431df941fc3eee94bb770fa117 100644 (file)
@@ -7107,7 +7107,7 @@ static int airo_get_aplist(struct net_device *dev,
  */
 static int airo_set_scan(struct net_device *dev,
                         struct iw_request_info *info,
-                        struct iw_param *vwrq,
+                        struct iw_point *dwrq,
                         char *extra)
 {
        struct airo_info *ai = dev->priv;
index bd65c485098c4bb8b33c0fa84d8fffcb0a677b1e..ecb02bdaab5be183821287d1d540a1eaad872d22 100644 (file)
@@ -2258,7 +2258,7 @@ static int atmel_get_freq(struct net_device *dev,
 
 static int atmel_set_scan(struct net_device *dev,
                          struct iw_request_info *info,
-                         struct iw_param *vwrq,
+                         struct iw_point *dwrq,
                          char *extra)
 {
        struct atmel_private *priv = netdev_priv(dev);
index 9a2fcc0163d6ffc0a915ed0f4c560851aeae092c..50904771f2912b5d167deb38a227213204683ae8 100644 (file)
@@ -5291,7 +5291,7 @@ static int orinoco_ioctl_getrid(struct net_device *dev,
 /* Trigger a scan (look for other cells in the vicinity) */
 static int orinoco_ioctl_setscan(struct net_device *dev,
                                 struct iw_request_info *info,
-                                struct iw_param *srq,
+                                struct iw_point *srq,
                                 char *extra)
 {
        struct orinoco_private *priv = netdev_priv(dev);
index 00e965b9da75b02345bf4df19b378c89b4bf88e4..2b414899dfa08107f8c2faba4be42e0aa2ffde79 100644 (file)
@@ -1627,7 +1627,6 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
 static int rndis_iw_set_scan(struct net_device *dev,
     struct iw_request_info *info, union iwreq_data *wrqu, char *extra)
 {
-       struct iw_param *param = &wrqu->param;
        struct usbnet *usbdev = dev->priv;
        union iwreq_data evt;
        int ret = -EINVAL;
@@ -1635,7 +1634,7 @@ static int rndis_iw_set_scan(struct net_device *dev,
 
        devdbg(usbdev, "SIOCSIWSCAN");
 
-       if (param->flags == 0) {
+       if (wrqu->data.flags == 0) {
                tmp = ccpu2(1);
                ret = rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp,
                                                                sizeof(tmp));