aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee80211/softmac/ieee80211softmac_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_auth.c')
-rw-r--r--net/ieee80211/softmac/ieee80211softmac_auth.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c
index 826c32d24461..855fa0fe641b 100644
--- a/net/ieee80211/softmac/ieee80211softmac_auth.c
+++ b/net/ieee80211/softmac/ieee80211softmac_auth.c
@@ -35,6 +35,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,
35{ 35{
36 struct ieee80211softmac_auth_queue_item *auth; 36 struct ieee80211softmac_auth_queue_item *auth;
37 unsigned long flags; 37 unsigned long flags;
38 DECLARE_MAC_BUF(mac2);
38 39
39 if (net->authenticating || net->authenticated) 40 if (net->authenticating || net->authenticated)
40 return 0; 41 return 0;
@@ -43,7 +44,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,
43 /* Add the network if it's not already added */ 44 /* Add the network if it's not already added */
44 ieee80211softmac_add_network(mac, net); 45 ieee80211softmac_add_network(mac, net);
45 46
46 dprintk(KERN_NOTICE PFX "Queueing Authentication Request to "MAC_FMT"\n", MAC_ARG(net->bssid)); 47 dprintk(KERN_NOTICE PFX "Queueing Authentication Request to %s\n", print_mac(mac2, net->bssid));
47 /* Queue the auth request */ 48 /* Queue the auth request */
48 auth = (struct ieee80211softmac_auth_queue_item *) 49 auth = (struct ieee80211softmac_auth_queue_item *)
49 kmalloc(sizeof(struct ieee80211softmac_auth_queue_item), GFP_KERNEL); 50 kmalloc(sizeof(struct ieee80211softmac_auth_queue_item), GFP_KERNEL);
@@ -76,6 +77,7 @@ ieee80211softmac_auth_queue(struct work_struct *work)
76 struct ieee80211softmac_auth_queue_item *auth; 77 struct ieee80211softmac_auth_queue_item *auth;
77 struct ieee80211softmac_network *net; 78 struct ieee80211softmac_network *net;
78 unsigned long flags; 79 unsigned long flags;
80 DECLARE_MAC_BUF(mac2);
79 81
80 auth = container_of(work, struct ieee80211softmac_auth_queue_item, 82 auth = container_of(work, struct ieee80211softmac_auth_queue_item,
81 work.work); 83 work.work);
@@ -99,13 +101,14 @@ ieee80211softmac_auth_queue(struct work_struct *work)
99 auth->retry--; 101 auth->retry--;
100 spin_unlock_irqrestore(&mac->lock, flags); 102 spin_unlock_irqrestore(&mac->lock, flags);
101 if (ieee80211softmac_send_mgt_frame(mac, auth->net, IEEE80211_STYPE_AUTH, auth->state)) 103 if (ieee80211softmac_send_mgt_frame(mac, auth->net, IEEE80211_STYPE_AUTH, auth->state))
102 dprintk(KERN_NOTICE PFX "Sending Authentication Request to "MAC_FMT" failed (this shouldn't happen, wait for the timeout).\n", MAC_ARG(net->bssid)); 104 dprintk(KERN_NOTICE PFX "Sending Authentication Request to %s failed (this shouldn't happen, wait for the timeout).\n",
105 print_mac(mac2, net->bssid));
103 else 106 else
104 dprintk(KERN_NOTICE PFX "Sent Authentication Request to "MAC_FMT".\n", MAC_ARG(net->bssid)); 107 dprintk(KERN_NOTICE PFX "Sent Authentication Request to %s.\n", print_mac(mac2, net->bssid));
105 return; 108 return;
106 } 109 }
107 110
108 printkl(KERN_WARNING PFX "Authentication timed out with "MAC_FMT"\n", MAC_ARG(net->bssid)); 111 printkl(KERN_WARNING PFX "Authentication timed out with %s\n", print_mac(mac2, net->bssid));
109 /* Remove this item from the queue */ 112 /* Remove this item from the queue */
110 spin_lock_irqsave(&mac->lock, flags); 113 spin_lock_irqsave(&mac->lock, flags);
111 net->authenticating = 0; 114 net->authenticating = 0;
@@ -142,6 +145,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
142 struct ieee80211softmac_network *net = NULL; 145 struct ieee80211softmac_network *net = NULL;
143 unsigned long flags; 146 unsigned long flags;
144 u8 * data; 147 u8 * data;
148 DECLARE_MAC_BUF(mac2);
145 149
146 if (unlikely(!mac->running)) 150 if (unlikely(!mac->running))
147 return -ENODEV; 151 return -ENODEV;
@@ -161,7 +165,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
161 /* Make sure that we've got an auth queue item for this request */ 165 /* Make sure that we've got an auth queue item for this request */
162 if(aq == NULL) 166 if(aq == NULL)
163 { 167 {
164 dprintkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but no queue item exists.\n", MAC_ARG(auth->header.addr2)); 168 dprintkl(KERN_DEBUG PFX "Authentication response received from %s but no queue item exists.\n", print_mac(mac2, auth->header.addr2));
165 /* Error #? */ 169 /* Error #? */
166 return -1; 170 return -1;
167 } 171 }
@@ -169,7 +173,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
169 /* Check for out of order authentication */ 173 /* Check for out of order authentication */
170 if(!net->authenticating) 174 if(!net->authenticating)
171 { 175 {
172 dprintkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but did not request authentication.\n",MAC_ARG(auth->header.addr2)); 176 dprintkl(KERN_DEBUG PFX "Authentication response received from %s but did not request authentication.\n",print_mac(mac2, auth->header.addr2));
173 return -1; 177 return -1;
174 } 178 }
175 179
@@ -187,7 +191,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
187 spin_unlock_irqrestore(&mac->lock, flags); 191 spin_unlock_irqrestore(&mac->lock, flags);
188 192
189 /* Send event */ 193 /* Send event */
190 printkl(KERN_NOTICE PFX "Open Authentication completed with "MAC_FMT"\n", MAC_ARG(net->bssid)); 194 printkl(KERN_NOTICE PFX "Open Authentication completed with %s\n", print_mac(mac2, net->bssid));
191 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net); 195 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net);
192 break; 196 break;
193 default: 197 default:
@@ -197,8 +201,8 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
197 net->authenticating = 0; 201 net->authenticating = 0;
198 spin_unlock_irqrestore(&mac->lock, flags); 202 spin_unlock_irqrestore(&mac->lock, flags);
199 203
200 printkl(KERN_NOTICE PFX "Open Authentication with "MAC_FMT" failed, error code: %i\n", 204 printkl(KERN_NOTICE PFX "Open Authentication with %s failed, error code: %i\n",
201 MAC_ARG(net->bssid), le16_to_cpup(&auth->status)); 205 print_mac(mac2, net->bssid), le16_to_cpup(&auth->status));
202 /* Count the error? */ 206 /* Count the error? */
203 break; 207 break;
204 } 208 }
@@ -253,13 +257,13 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
253 net->authenticating = 0; 257 net->authenticating = 0;
254 net->authenticated = 1; 258 net->authenticated = 1;
255 spin_unlock_irqrestore(&mac->lock, flags); 259 spin_unlock_irqrestore(&mac->lock, flags);
256 printkl(KERN_NOTICE PFX "Shared Key Authentication completed with "MAC_FMT"\n", 260 printkl(KERN_NOTICE PFX "Shared Key Authentication completed with %s\n",
257 MAC_ARG(net->bssid)); 261 print_mac(mac2, net->bssid));
258 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net); 262 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net);
259 break; 263 break;
260 default: 264 default:
261 printkl(KERN_NOTICE PFX "Shared Key Authentication with "MAC_FMT" failed, error code: %i\n", 265 printkl(KERN_NOTICE PFX "Shared Key Authentication with %s failed, error code: %i\n",
262 MAC_ARG(net->bssid), le16_to_cpup(&auth->status)); 266 print_mac(mac2, net->bssid), le16_to_cpup(&auth->status));
263 /* Lock and reset flags */ 267 /* Lock and reset flags */
264 spin_lock_irqsave(&mac->lock, flags); 268 spin_lock_irqsave(&mac->lock, flags);
265 net->authenticating = 0; 269 net->authenticating = 0;
@@ -375,6 +379,7 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de
375 379
376 struct ieee80211softmac_network *net = NULL; 380 struct ieee80211softmac_network *net = NULL;
377 struct ieee80211softmac_device *mac = ieee80211_priv(dev); 381 struct ieee80211softmac_device *mac = ieee80211_priv(dev);
382 DECLARE_MAC_BUF(mac2);
378 383
379 if (unlikely(!mac->running)) 384 if (unlikely(!mac->running))
380 return -ENODEV; 385 return -ENODEV;
@@ -387,8 +392,8 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de
387 net = ieee80211softmac_get_network_by_bssid(mac, deauth->header.addr2); 392 net = ieee80211softmac_get_network_by_bssid(mac, deauth->header.addr2);
388 393
389 if (net == NULL) { 394 if (net == NULL) {
390 dprintkl(KERN_DEBUG PFX "Received deauthentication packet from "MAC_FMT", but that network is unknown.\n", 395 dprintkl(KERN_DEBUG PFX "Received deauthentication packet from %s, but that network is unknown.\n",
391 MAC_ARG(deauth->header.addr2)); 396 print_mac(mac2, deauth->header.addr2));
392 return 0; 397 return 0;
393 } 398 }
394 399