aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/sme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-07-06 21:56:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:02:33 -0400
commit79c97e97aed7f760d2826c7daf2d42d8eefe9838 (patch)
treebf6d18d0de2c0168a292f05eb6f7296c15278b8b /net/wireless/sme.c
parent667503ddcb96f3b10211f997fe55907fa7509841 (diff)
cfg80211: clean up naming once and for all
We've named the registered devices 'drv' sometimes, thinking of "driver", which is not what it is, it's the internal representation of a wiphy, i.e. a device. Let's clean up the naming once and and use 'rdev' aka 'registered device' everywhere. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r--net/wireless/sme.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 472e2412c781..df9173f73604 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -33,15 +33,15 @@ struct cfg80211_conn {
33 33
34static int cfg80211_conn_scan(struct wireless_dev *wdev) 34static int cfg80211_conn_scan(struct wireless_dev *wdev)
35{ 35{
36 struct cfg80211_registered_device *drv = wiphy_to_dev(wdev->wiphy); 36 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
37 struct cfg80211_scan_request *request; 37 struct cfg80211_scan_request *request;
38 int n_channels, err; 38 int n_channels, err;
39 39
40 ASSERT_RTNL(); 40 ASSERT_RTNL();
41 ASSERT_RDEV_LOCK(drv); 41 ASSERT_RDEV_LOCK(rdev);
42 ASSERT_WDEV_LOCK(wdev); 42 ASSERT_WDEV_LOCK(wdev);
43 43
44 if (drv->scan_req) 44 if (rdev->scan_req)
45 return -EBUSY; 45 return -EBUSY;
46 46
47 if (wdev->conn->params.channel) { 47 if (wdev->conn->params.channel) {
@@ -87,16 +87,16 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
87 request->ssids[0].ssid_len = wdev->conn->params.ssid_len; 87 request->ssids[0].ssid_len = wdev->conn->params.ssid_len;
88 88
89 request->ifidx = wdev->netdev->ifindex; 89 request->ifidx = wdev->netdev->ifindex;
90 request->wiphy = &drv->wiphy; 90 request->wiphy = &rdev->wiphy;
91 91
92 drv->scan_req = request; 92 rdev->scan_req = request;
93 93
94 err = drv->ops->scan(wdev->wiphy, wdev->netdev, request); 94 err = rdev->ops->scan(wdev->wiphy, wdev->netdev, request);
95 if (!err) { 95 if (!err) {
96 wdev->conn->state = CFG80211_CONN_SCANNING; 96 wdev->conn->state = CFG80211_CONN_SCANNING;
97 nl80211_send_scan_start(drv, wdev->netdev); 97 nl80211_send_scan_start(rdev, wdev->netdev);
98 } else { 98 } else {
99 drv->scan_req = NULL; 99 rdev->scan_req = NULL;
100 kfree(request); 100 kfree(request);
101 } 101 }
102 return err; 102 return err;
@@ -104,7 +104,7 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
104 104
105static int cfg80211_conn_do_work(struct wireless_dev *wdev) 105static int cfg80211_conn_do_work(struct wireless_dev *wdev)
106{ 106{
107 struct cfg80211_registered_device *drv = wiphy_to_dev(wdev->wiphy); 107 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
108 struct cfg80211_connect_params *params; 108 struct cfg80211_connect_params *params;
109 int err; 109 int err;
110 110
@@ -119,15 +119,15 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
119 case CFG80211_CONN_SCAN_AGAIN: 119 case CFG80211_CONN_SCAN_AGAIN:
120 return cfg80211_conn_scan(wdev); 120 return cfg80211_conn_scan(wdev);
121 case CFG80211_CONN_AUTHENTICATE_NEXT: 121 case CFG80211_CONN_AUTHENTICATE_NEXT:
122 BUG_ON(!drv->ops->auth); 122 BUG_ON(!rdev->ops->auth);
123 wdev->conn->state = CFG80211_CONN_AUTHENTICATING; 123 wdev->conn->state = CFG80211_CONN_AUTHENTICATING;
124 return __cfg80211_mlme_auth(drv, wdev->netdev, 124 return __cfg80211_mlme_auth(rdev, wdev->netdev,
125 params->channel, params->auth_type, 125 params->channel, params->auth_type,
126 params->bssid, 126 params->bssid,
127 params->ssid, params->ssid_len, 127 params->ssid, params->ssid_len,
128 NULL, 0); 128 NULL, 0);
129 case CFG80211_CONN_ASSOCIATE_NEXT: 129 case CFG80211_CONN_ASSOCIATE_NEXT:
130 BUG_ON(!drv->ops->assoc); 130 BUG_ON(!rdev->ops->assoc);
131 wdev->conn->state = CFG80211_CONN_ASSOCIATING; 131 wdev->conn->state = CFG80211_CONN_ASSOCIATING;
132 /* 132 /*
133 * We could, later, implement roaming here and then actually 133 * We could, later, implement roaming here and then actually
@@ -135,14 +135,14 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
135 * that some APs don't like that -- so we'd need to retry 135 * that some APs don't like that -- so we'd need to retry
136 * the association. 136 * the association.
137 */ 137 */
138 err = __cfg80211_mlme_assoc(drv, wdev->netdev, 138 err = __cfg80211_mlme_assoc(rdev, wdev->netdev,
139 params->channel, params->bssid, 139 params->channel, params->bssid,
140 NULL, 140 NULL,
141 params->ssid, params->ssid_len, 141 params->ssid, params->ssid_len,
142 params->ie, params->ie_len, 142 params->ie, params->ie_len,
143 false, &params->crypto); 143 false, &params->crypto);
144 if (err) 144 if (err)
145 __cfg80211_mlme_deauth(drv, wdev->netdev, params->bssid, 145 __cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
146 NULL, 0, 146 NULL, 0,
147 WLAN_REASON_DEAUTH_LEAVING); 147 WLAN_REASON_DEAUTH_LEAVING);
148 return err; 148 return err;
@@ -153,15 +153,15 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev)
153 153
154void cfg80211_conn_work(struct work_struct *work) 154void cfg80211_conn_work(struct work_struct *work)
155{ 155{
156 struct cfg80211_registered_device *drv = 156 struct cfg80211_registered_device *rdev =
157 container_of(work, struct cfg80211_registered_device, conn_work); 157 container_of(work, struct cfg80211_registered_device, conn_work);
158 struct wireless_dev *wdev; 158 struct wireless_dev *wdev;
159 159
160 rtnl_lock(); 160 rtnl_lock();
161 cfg80211_lock_rdev(drv); 161 cfg80211_lock_rdev(rdev);
162 mutex_lock(&drv->devlist_mtx); 162 mutex_lock(&rdev->devlist_mtx);
163 163
164 list_for_each_entry(wdev, &drv->netdev_list, list) { 164 list_for_each_entry(wdev, &rdev->netdev_list, list) {
165 wdev_lock(wdev); 165 wdev_lock(wdev);
166 if (!netif_running(wdev->netdev)) { 166 if (!netif_running(wdev->netdev)) {
167 wdev_unlock(wdev); 167 wdev_unlock(wdev);
@@ -181,14 +181,14 @@ void cfg80211_conn_work(struct work_struct *work)
181 wdev_unlock(wdev); 181 wdev_unlock(wdev);
182 } 182 }
183 183
184 mutex_unlock(&drv->devlist_mtx); 184 mutex_unlock(&rdev->devlist_mtx);
185 cfg80211_unlock_rdev(drv); 185 cfg80211_unlock_rdev(rdev);
186 rtnl_unlock(); 186 rtnl_unlock();
187} 187}
188 188
189static bool cfg80211_get_conn_bss(struct wireless_dev *wdev) 189static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
190{ 190{
191 struct cfg80211_registered_device *drv = wiphy_to_dev(wdev->wiphy); 191 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
192 struct cfg80211_bss *bss; 192 struct cfg80211_bss *bss;
193 u16 capa = WLAN_CAPABILITY_ESS; 193 u16 capa = WLAN_CAPABILITY_ESS;
194 194
@@ -209,7 +209,7 @@ static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
209 wdev->conn->params.bssid = wdev->conn->bssid; 209 wdev->conn->params.bssid = wdev->conn->bssid;
210 wdev->conn->params.channel = bss->channel; 210 wdev->conn->params.channel = bss->channel;
211 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT; 211 wdev->conn->state = CFG80211_CONN_AUTHENTICATE_NEXT;
212 schedule_work(&drv->conn_work); 212 schedule_work(&rdev->conn_work);
213 213
214 cfg80211_put_bss(bss); 214 cfg80211_put_bss(bss);
215 return true; 215 return true;
@@ -218,7 +218,7 @@ static bool cfg80211_get_conn_bss(struct wireless_dev *wdev)
218static void __cfg80211_sme_scan_done(struct net_device *dev) 218static void __cfg80211_sme_scan_done(struct net_device *dev)
219{ 219{
220 struct wireless_dev *wdev = dev->ieee80211_ptr; 220 struct wireless_dev *wdev = dev->ieee80211_ptr;
221 struct cfg80211_registered_device *drv = wiphy_to_dev(wdev->wiphy); 221 struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
222 222
223 ASSERT_WDEV_LOCK(wdev); 223 ASSERT_WDEV_LOCK(wdev);
224 224
@@ -235,7 +235,7 @@ static void __cfg80211_sme_scan_done(struct net_device *dev)
235 if (!cfg80211_get_conn_bss(wdev)) { 235 if (!cfg80211_get_conn_bss(wdev)) {
236 /* not found */ 236 /* not found */
237 if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN) 237 if (wdev->conn->state == CFG80211_CONN_SCAN_AGAIN)
238 schedule_work(&drv->conn_work); 238 schedule_work(&rdev->conn_work);
239 else 239 else
240 __cfg80211_connect_result( 240 __cfg80211_connect_result(
241 wdev->netdev, 241 wdev->netdev,