aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2009-09-01 08:32:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-09-01 12:48:22 -0400
commit051ae0bf7ff67c0a64485ac3b46a29aeb55a28dc (patch)
tree30c5668f421cddb4719ce2c789a13eae09c8d2f9
parent8f43161aa6bd7bfed0905d3de6cc660fd6b9c2bc (diff)
rndis_wlan: use bool for on/off switches
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rndis_wlan.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 402d36757765..dc2804f9a085 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -466,7 +466,7 @@ struct rndis_wlan_private {
466 u32 param_workaround_interval; 466 u32 param_workaround_interval;
467 467
468 /* hardware state */ 468 /* hardware state */
469 int radio_on; 469 bool radio_on;
470 int infra_mode; 470 int infra_mode;
471 bool connected; 471 bool connected;
472 u8 bssid[ETH_ALEN]; 472 u8 bssid[ETH_ALEN];
@@ -966,8 +966,8 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid)
966 } 966 }
967 if (ret == 0) { 967 if (ret == 0) {
968 memcpy(&priv->essid, ssid, sizeof(priv->essid)); 968 memcpy(&priv->essid, ssid, sizeof(priv->essid));
969 priv->radio_on = 1; 969 priv->radio_on = true;
970 devdbg(usbdev, "set_essid: radio_on = 1"); 970 devdbg(usbdev, "set_essid: radio_on = true");
971 } 971 }
972 972
973 return ret; 973 return ret;
@@ -1028,7 +1028,7 @@ static bool is_associated(struct usbnet *usbdev)
1028} 1028}
1029 1029
1030 1030
1031static int disassociate(struct usbnet *usbdev, int reset_ssid) 1031static int disassociate(struct usbnet *usbdev, bool reset_ssid)
1032{ 1032{
1033 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); 1033 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
1034 struct ndis_80211_ssid ssid; 1034 struct ndis_80211_ssid ssid;
@@ -1037,8 +1037,8 @@ static int disassociate(struct usbnet *usbdev, int reset_ssid)
1037 if (priv->radio_on) { 1037 if (priv->radio_on) {
1038 ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0); 1038 ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0);
1039 if (ret == 0) { 1039 if (ret == 0) {
1040 priv->radio_on = 0; 1040 priv->radio_on = false;
1041 devdbg(usbdev, "disassociate: radio_on = 0"); 1041 devdbg(usbdev, "disassociate: radio_on = false");
1042 1042
1043 if (reset_ssid) 1043 if (reset_ssid)
1044 msleep(100); 1044 msleep(100);
@@ -1234,7 +1234,7 @@ static int deauthenticate(struct usbnet *usbdev)
1234{ 1234{
1235 int ret; 1235 int ret;
1236 1236
1237 ret = disassociate(usbdev, 1); 1237 ret = disassociate(usbdev, true);
1238 set_default_iw_params(usbdev); 1238 set_default_iw_params(usbdev);
1239 return ret; 1239 return ret;
1240} 1240}
@@ -1634,7 +1634,7 @@ static int rndis_set_tx_power(struct wiphy *wiphy, enum tx_power_setting type,
1634 */ 1634 */
1635 if (type == TX_POWER_AUTOMATIC || dbm == get_bcm4320_power_dbm(priv)) { 1635 if (type == TX_POWER_AUTOMATIC || dbm == get_bcm4320_power_dbm(priv)) {
1636 if (!priv->radio_on) 1636 if (!priv->radio_on)
1637 disassociate(usbdev, 1); /* turn on radio */ 1637 disassociate(usbdev, true); /* turn on radio */
1638 1638
1639 return 0; 1639 return 0;
1640 } 1640 }
@@ -1923,7 +1923,7 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
1923 return ret; 1923 return ret;
1924 1924
1925err_turn_radio_on: 1925err_turn_radio_on:
1926 disassociate(usbdev, 1); 1926 disassociate(usbdev, true);
1927 1927
1928 return ret; 1928 return ret;
1929} 1929}
@@ -2031,7 +2031,7 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev,
2031 return ret; 2031 return ret;
2032 2032
2033err_turn_radio_on: 2033err_turn_radio_on:
2034 disassociate(usbdev, 1); 2034 disassociate(usbdev, true);
2035 2035
2036 return ret; 2036 return ret;
2037} 2037}
@@ -2823,8 +2823,8 @@ static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf)
2823 WIPHY_PARAM_FRAG_THRESHOLD | WIPHY_PARAM_RTS_THRESHOLD); 2823 WIPHY_PARAM_FRAG_THRESHOLD | WIPHY_PARAM_RTS_THRESHOLD);
2824 2824
2825 /* turn radio on */ 2825 /* turn radio on */
2826 priv->radio_on = 1; 2826 priv->radio_on = true;
2827 disassociate(usbdev, 1); 2827 disassociate(usbdev, true);
2828 netif_carrier_off(usbdev->net); 2828 netif_carrier_off(usbdev->net);
2829 2829
2830 return 0; 2830 return 0;
@@ -2846,7 +2846,7 @@ static void rndis_wlan_unbind(struct usbnet *usbdev, struct usb_interface *intf)
2846 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); 2846 struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
2847 2847
2848 /* turn radio off */ 2848 /* turn radio off */
2849 disassociate(usbdev, 0); 2849 disassociate(usbdev, false);
2850 2850
2851 cancel_delayed_work_sync(&priv->dev_poller_work); 2851 cancel_delayed_work_sync(&priv->dev_poller_work);
2852 cancel_delayed_work_sync(&priv->scan_work); 2852 cancel_delayed_work_sync(&priv->scan_work);
@@ -2894,7 +2894,7 @@ static int rndis_wlan_stop(struct usbnet *usbdev)
2894 2894
2895 devdbg(usbdev, "rndis_wlan_stop"); 2895 devdbg(usbdev, "rndis_wlan_stop");
2896 2896
2897 retval = disassociate(usbdev, 0); 2897 retval = disassociate(usbdev, false);
2898 2898
2899 priv->work_pending = 0; 2899 priv->work_pending = 0;
2900 cancel_delayed_work_sync(&priv->dev_poller_work); 2900 cancel_delayed_work_sync(&priv->dev_poller_work);