aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-10-26 04:12:14 -0400
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:03:34 -0500
commit9f9dac281ba2acd3d6d3574076f86b8f99aaebc0 (patch)
treed895e893f307d210fdecbc74c5b4b746e4507623 /drivers
parent49df2b33478fd67e642d05786d06de322504842c (diff)
libertas: move wlan_*_association_work from header to c file
Move wlan_postpone_association_work() and wlan_cancel_association_work() from a assoc.h file to the sole user, into wext.c. Renamed those two functions to to libertas_XXX as well. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/libertas/assoc.h18
-rw-r--r--drivers/net/wireless/libertas/wext.c50
2 files changed, 34 insertions, 34 deletions
diff --git a/drivers/net/wireless/libertas/assoc.h b/drivers/net/wireless/libertas/assoc.h
index e09b7490abbd..ed737eb995c0 100644
--- a/drivers/net/wireless/libertas/assoc.h
+++ b/drivers/net/wireless/libertas/assoc.h
@@ -11,22 +11,4 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter);
11 11
12void libertas_sync_channel(struct work_struct *work); 12void libertas_sync_channel(struct work_struct *work);
13 13
14#define ASSOC_DELAY (HZ / 2)
15static inline void wlan_postpone_association_work(wlan_private *priv)
16{
17 if (priv->adapter->surpriseremoved)
18 return;
19 cancel_delayed_work(&priv->assoc_work);
20 queue_delayed_work(priv->work_thread, &priv->assoc_work, ASSOC_DELAY);
21}
22
23static inline void wlan_cancel_association_work(wlan_private *priv)
24{
25 cancel_delayed_work(&priv->assoc_work);
26 if (priv->adapter->pending_assoc_req) {
27 kfree(priv->adapter->pending_assoc_req);
28 priv->adapter->pending_assoc_req = NULL;
29 }
30}
31
32#endif /* _WLAN_ASSOC_H */ 14#endif /* _WLAN_ASSOC_H */
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 395b7882d4d6..135116d90703 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -21,6 +21,24 @@
21#include "assoc.h" 21#include "assoc.h"
22 22
23 23
24static inline void libertas_postpone_association_work(wlan_private *priv)
25{
26 if (priv->adapter->surpriseremoved)
27 return;
28 cancel_delayed_work(&priv->assoc_work);
29 queue_delayed_work(priv->work_thread, &priv->assoc_work, HZ / 2);
30}
31
32static inline void libertas_cancel_association_work(wlan_private *priv)
33{
34 cancel_delayed_work(&priv->assoc_work);
35 if (priv->adapter->pending_assoc_req) {
36 kfree(priv->adapter->pending_assoc_req);
37 priv->adapter->pending_assoc_req = NULL;
38 }
39}
40
41
24/** 42/**
25 * @brief Find the channel frequency power info with specific channel 43 * @brief Find the channel frequency power info with specific channel
26 * 44 *
@@ -949,9 +967,9 @@ static int wlan_set_freq(struct net_device *dev, struct iw_request_info *info,
949out: 967out:
950 if (ret == 0) { 968 if (ret == 0) {
951 set_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags); 969 set_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags);
952 wlan_postpone_association_work(priv); 970 libertas_postpone_association_work(priv);
953 } else { 971 } else {
954 wlan_cancel_association_work(priv); 972 libertas_cancel_association_work(priv);
955 } 973 }
956 mutex_unlock(&adapter->lock); 974 mutex_unlock(&adapter->lock);
957 975
@@ -1050,11 +1068,11 @@ static int wlan_set_mode(struct net_device *dev,
1050 assoc_req = wlan_get_association_request(adapter); 1068 assoc_req = wlan_get_association_request(adapter);
1051 if (!assoc_req) { 1069 if (!assoc_req) {
1052 ret = -ENOMEM; 1070 ret = -ENOMEM;
1053 wlan_cancel_association_work(priv); 1071 libertas_cancel_association_work(priv);
1054 } else { 1072 } else {
1055 assoc_req->mode = *uwrq; 1073 assoc_req->mode = *uwrq;
1056 set_bit(ASSOC_FLAG_MODE, &assoc_req->flags); 1074 set_bit(ASSOC_FLAG_MODE, &assoc_req->flags);
1057 wlan_postpone_association_work(priv); 1075 libertas_postpone_association_work(priv);
1058 lbs_deb_wext("Switching to mode: 0x%x\n", *uwrq); 1076 lbs_deb_wext("Switching to mode: 0x%x\n", *uwrq);
1059 } 1077 }
1060 mutex_unlock(&adapter->lock); 1078 mutex_unlock(&adapter->lock);
@@ -1335,9 +1353,9 @@ static int wlan_set_encode(struct net_device *dev,
1335out: 1353out:
1336 if (ret == 0) { 1354 if (ret == 0) {
1337 set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); 1355 set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags);
1338 wlan_postpone_association_work(priv); 1356 libertas_postpone_association_work(priv);
1339 } else { 1357 } else {
1340 wlan_cancel_association_work(priv); 1358 libertas_cancel_association_work(priv);
1341 } 1359 }
1342 mutex_unlock(&adapter->lock); 1360 mutex_unlock(&adapter->lock);
1343 1361
@@ -1576,9 +1594,9 @@ static int wlan_set_encodeext(struct net_device *dev,
1576 1594
1577out: 1595out:
1578 if (ret == 0) { 1596 if (ret == 0) {
1579 wlan_postpone_association_work(priv); 1597 libertas_postpone_association_work(priv);
1580 } else { 1598 } else {
1581 wlan_cancel_association_work(priv); 1599 libertas_cancel_association_work(priv);
1582 } 1600 }
1583 mutex_unlock(&adapter->lock); 1601 mutex_unlock(&adapter->lock);
1584 1602
@@ -1623,9 +1641,9 @@ static int wlan_set_genie(struct net_device *dev,
1623out: 1641out:
1624 if (ret == 0) { 1642 if (ret == 0) {
1625 set_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags); 1643 set_bit(ASSOC_FLAG_WPA_IE, &assoc_req->flags);
1626 wlan_postpone_association_work(priv); 1644 libertas_postpone_association_work(priv);
1627 } else { 1645 } else {
1628 wlan_cancel_association_work(priv); 1646 libertas_cancel_association_work(priv);
1629 } 1647 }
1630 mutex_unlock(&adapter->lock); 1648 mutex_unlock(&adapter->lock);
1631 1649
@@ -1752,9 +1770,9 @@ out:
1752 if (ret == 0) { 1770 if (ret == 0) {
1753 if (updated) 1771 if (updated)
1754 set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags); 1772 set_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags);
1755 wlan_postpone_association_work(priv); 1773 libertas_postpone_association_work(priv);
1756 } else if (ret != -EOPNOTSUPP) { 1774 } else if (ret != -EOPNOTSUPP) {
1757 wlan_cancel_association_work(priv); 1775 libertas_cancel_association_work(priv);
1758 } 1776 }
1759 mutex_unlock(&adapter->lock); 1777 mutex_unlock(&adapter->lock);
1760 1778
@@ -1929,13 +1947,13 @@ out:
1929 memcpy(&assoc_req->ssid, &ssid, IW_ESSID_MAX_SIZE); 1947 memcpy(&assoc_req->ssid, &ssid, IW_ESSID_MAX_SIZE);
1930 assoc_req->ssid_len = ssid_len; 1948 assoc_req->ssid_len = ssid_len;
1931 set_bit(ASSOC_FLAG_SSID, &assoc_req->flags); 1949 set_bit(ASSOC_FLAG_SSID, &assoc_req->flags);
1932 wlan_postpone_association_work(priv); 1950 libertas_postpone_association_work(priv);
1933 } 1951 }
1934 } 1952 }
1935 1953
1936 /* Cancel the association request if there was an error */ 1954 /* Cancel the association request if there was an error */
1937 if (ret != 0) { 1955 if (ret != 0) {
1938 wlan_cancel_association_work(priv); 1956 libertas_cancel_association_work(priv);
1939 } 1957 }
1940 1958
1941 mutex_unlock(&adapter->lock); 1959 mutex_unlock(&adapter->lock);
@@ -1974,13 +1992,13 @@ static int wlan_set_wap(struct net_device *dev, struct iw_request_info *info,
1974 /* Get or create the current association request */ 1992 /* Get or create the current association request */
1975 assoc_req = wlan_get_association_request(adapter); 1993 assoc_req = wlan_get_association_request(adapter);
1976 if (!assoc_req) { 1994 if (!assoc_req) {
1977 wlan_cancel_association_work(priv); 1995 libertas_cancel_association_work(priv);
1978 ret = -ENOMEM; 1996 ret = -ENOMEM;
1979 } else { 1997 } else {
1980 /* Copy the BSSID to the association request */ 1998 /* Copy the BSSID to the association request */
1981 memcpy(&assoc_req->bssid, awrq->sa_data, ETH_ALEN); 1999 memcpy(&assoc_req->bssid, awrq->sa_data, ETH_ALEN);
1982 set_bit(ASSOC_FLAG_BSSID, &assoc_req->flags); 2000 set_bit(ASSOC_FLAG_BSSID, &assoc_req->flags);
1983 wlan_postpone_association_work(priv); 2001 libertas_postpone_association_work(priv);
1984 } 2002 }
1985 2003
1986 mutex_unlock(&adapter->lock); 2004 mutex_unlock(&adapter->lock);