Commit 051ae0bf authored by Jussi Kivilinna's avatar Jussi Kivilinna Committed by John W. Linville

rndis_wlan: use bool for on/off switches

Signed-off-by: default avatarJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 8f43161a
...@@ -466,7 +466,7 @@ struct rndis_wlan_private { ...@@ -466,7 +466,7 @@ struct rndis_wlan_private {
u32 param_workaround_interval; u32 param_workaround_interval;
/* hardware state */ /* hardware state */
int radio_on; bool radio_on;
int infra_mode; int infra_mode;
bool connected; bool connected;
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
...@@ -966,8 +966,8 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) ...@@ -966,8 +966,8 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid)
} }
if (ret == 0) { if (ret == 0) {
memcpy(&priv->essid, ssid, sizeof(priv->essid)); memcpy(&priv->essid, ssid, sizeof(priv->essid));
priv->radio_on = 1; priv->radio_on = true;
devdbg(usbdev, "set_essid: radio_on = 1"); devdbg(usbdev, "set_essid: radio_on = true");
} }
return ret; return ret;
...@@ -1028,7 +1028,7 @@ static bool is_associated(struct usbnet *usbdev) ...@@ -1028,7 +1028,7 @@ static bool is_associated(struct usbnet *usbdev)
} }
static int disassociate(struct usbnet *usbdev, int reset_ssid) static int disassociate(struct usbnet *usbdev, bool reset_ssid)
{ {
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
struct ndis_80211_ssid ssid; struct ndis_80211_ssid ssid;
...@@ -1037,8 +1037,8 @@ static int disassociate(struct usbnet *usbdev, int reset_ssid) ...@@ -1037,8 +1037,8 @@ static int disassociate(struct usbnet *usbdev, int reset_ssid)
if (priv->radio_on) { if (priv->radio_on) {
ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0); ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0);
if (ret == 0) { if (ret == 0) {
priv->radio_on = 0; priv->radio_on = false;
devdbg(usbdev, "disassociate: radio_on = 0"); devdbg(usbdev, "disassociate: radio_on = false");
if (reset_ssid) if (reset_ssid)
msleep(100); msleep(100);
...@@ -1234,7 +1234,7 @@ static int deauthenticate(struct usbnet *usbdev) ...@@ -1234,7 +1234,7 @@ static int deauthenticate(struct usbnet *usbdev)
{ {
int ret; int ret;
ret = disassociate(usbdev, 1); ret = disassociate(usbdev, true);
set_default_iw_params(usbdev); set_default_iw_params(usbdev);
return ret; return ret;
} }
...@@ -1634,7 +1634,7 @@ static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type, ...@@ -1634,7 +1634,7 @@ static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type,
*/ */
if (type == TX_POWER_AUTOMATIC || dbm == get_bcm4320_power_dbm(priv)) { if (type == TX_POWER_AUTOMATIC || dbm == get_bcm4320_power_dbm(priv)) {
if (!priv->radio_on) if (!priv->radio_on)
disassociate(usbdev, 1); /* turn on radio */ disassociate(usbdev, true); /* turn on radio */
return 0; return 0;
} }
...@@ -1923,7 +1923,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1923,7 +1923,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
return ret; return ret;
err_turn_radio_on: err_turn_radio_on:
disassociate(usbdev, 1); disassociate(usbdev, true);
return ret; return ret;
} }
...@@ -2031,7 +2031,7 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev, ...@@ -2031,7 +2031,7 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev,
return ret; return ret;
err_turn_radio_on: err_turn_radio_on:
disassociate(usbdev, 1); disassociate(usbdev, true);
return ret; return ret;
} }
...@@ -2823,8 +2823,8 @@ static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf) ...@@ -2823,8 +2823,8 @@ static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf)
WIPHY_PARAM_FRAG_THRESHOLD | WIPHY_PARAM_RTS_THRESHOLD); WIPHY_PARAM_FRAG_THRESHOLD | WIPHY_PARAM_RTS_THRESHOLD);
/* turn radio on */ /* turn radio on */
priv->radio_on = 1; priv->radio_on = true;
disassociate(usbdev, 1); disassociate(usbdev, true);
netif_carrier_off(usbdev->net); netif_carrier_off(usbdev->net);
return 0; return 0;
...@@ -2846,7 +2846,7 @@ static void rndis_wlan_unbind(struct usbnet *usbdev, struct usb_interface *intf) ...@@ -2846,7 +2846,7 @@ static void rndis_wlan_unbind(struct usbnet *usbdev, struct usb_interface *intf)
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
/* turn radio off */ /* turn radio off */
disassociate(usbdev, 0); disassociate(usbdev, false);
cancel_delayed_work_sync(&priv->dev_poller_work); cancel_delayed_work_sync(&priv->dev_poller_work);
cancel_delayed_work_sync(&priv->scan_work); cancel_delayed_work_sync(&priv->scan_work);
...@@ -2894,7 +2894,7 @@ static int rndis_wlan_stop(struct usbnet *usbdev) ...@@ -2894,7 +2894,7 @@ static int rndis_wlan_stop(struct usbnet *usbdev)
devdbg(usbdev, "rndis_wlan_stop"); devdbg(usbdev, "rndis_wlan_stop");
retval = disassociate(usbdev, 0); retval = disassociate(usbdev, false);
priv->work_pending = 0; priv->work_pending = 0;
cancel_delayed_work_sync(&priv->dev_poller_work); cancel_delayed_work_sync(&priv->dev_poller_work);
......
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