Commit d1661dfd authored by Ali Bahar's avatar Ali Bahar Committed by Greg Kroah-Hartman

staging: r8712u: Sets to SSID, and to AP MAC#, can now be done when the interface is Down.

The original Realtek code assumed that ioctl Sets get done after the
interface is Up. This included the set to Essid and to the AP MAC#;
and it fit Realtek's installation procedure. But there is no such
necessity for the adapter, and no stated requirement found
elsewhere. Also, wireless drivers typically permit this.

A typical error message used to be:
Error for wireless request "Set ESSID" (8B1A) :
    SET failed on device wlan0 ; Operation not permitted.
Signed-off-by: default avatarAli Bahar <ali@internetDog.org>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1dac4186
...@@ -117,6 +117,11 @@ struct dvobj_priv { ...@@ -117,6 +117,11 @@ struct dvobj_priv {
struct usb_device *pusbdev; struct usb_device *pusbdev;
}; };
/**
* struct _adapter - the main adapter structure for this device.
*
* bup: True indicates that the interface is Up.
*/
struct _adapter { struct _adapter {
struct dvobj_priv dvobjpriv; struct dvobj_priv dvobjpriv;
struct mlme_priv mlmepriv; struct mlme_priv mlmepriv;
......
...@@ -975,6 +975,13 @@ static int r871x_wx_set_priv(struct net_device *dev, ...@@ -975,6 +975,13 @@ static int r871x_wx_set_priv(struct net_device *dev,
* s2. set_802_11_authentication_mode() * s2. set_802_11_authentication_mode()
* s3. set_802_11_encryption_mode() * s3. set_802_11_encryption_mode()
* s4. set_802_11_bssid() * s4. set_802_11_bssid()
*
* This function intends to handle the Set AP command, which specifies the
* MAC# of a preferred Access Point.
* Currently, the request comes via Wireless Extensions' SIOCSIWAP ioctl.
*
* For this operation to succeed, there is no need for the interface to be Up.
*
*/ */
static int r8711_wx_set_wap(struct net_device *dev, static int r8711_wx_set_wap(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
...@@ -992,8 +999,6 @@ static int r8711_wx_set_wap(struct net_device *dev, ...@@ -992,8 +999,6 @@ static int r8711_wx_set_wap(struct net_device *dev,
struct wlan_network *pnetwork = NULL; struct wlan_network *pnetwork = NULL;
enum NDIS_802_11_AUTHENTICATION_MODE authmode; enum NDIS_802_11_AUTHENTICATION_MODE authmode;
if (padapter->bup == false)
return -1;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true)
return -1; return -1;
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
...@@ -1074,6 +1079,14 @@ static int r871x_wx_set_mlme(struct net_device *dev, ...@@ -1074,6 +1079,14 @@ static int r871x_wx_set_mlme(struct net_device *dev,
return ret; return ret;
} }
/**
*
* This function intends to handle the Set Scan command.
* Currently, the request comes via Wireless Extensions' SIOCSIWSCAN ioctl.
*
* For this operation to succeed, the interface is brought Up beforehand.
*
*/
static int r8711_wx_set_scan(struct net_device *dev, static int r8711_wx_set_scan(struct net_device *dev,
struct iw_request_info *a, struct iw_request_info *a,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
...@@ -1169,6 +1182,12 @@ static int r8711_wx_get_scan(struct net_device *dev, ...@@ -1169,6 +1182,12 @@ static int r8711_wx_get_scan(struct net_device *dev,
* s2. set_802_11_authenticaion_mode() * s2. set_802_11_authenticaion_mode()
* s3. set_802_11_encryption_mode() * s3. set_802_11_encryption_mode()
* s4. set_802_11_ssid() * s4. set_802_11_ssid()
*
* This function intends to handle the Set ESSID command.
* Currently, the request comes via the Wireless Extensions' SIOCSIWESSID ioctl.
*
* For this operation to succeed, there is no need for the interface to be Up.
*
*/ */
static int r8711_wx_set_essid(struct net_device *dev, static int r8711_wx_set_essid(struct net_device *dev,
struct iw_request_info *a, struct iw_request_info *a,
...@@ -1184,8 +1203,6 @@ static int r8711_wx_set_essid(struct net_device *dev, ...@@ -1184,8 +1203,6 @@ static int r8711_wx_set_essid(struct net_device *dev,
struct list_head *phead; struct list_head *phead;
u32 len; u32 len;
if (padapter->bup == false)
return -1;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
return -1; return -1;
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING)) if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
......
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