Commit 64265651 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

[NET] IEEE80211: Fix whitespace errors.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 03d52d7c
...@@ -97,7 +97,7 @@ static int prism2_wep_build_iv(struct sk_buff *skb, int hdr_len, ...@@ -97,7 +97,7 @@ static int prism2_wep_build_iv(struct sk_buff *skb, int hdr_len,
struct prism2_wep_data *wep = priv; struct prism2_wep_data *wep = priv;
u32 klen, len; u32 klen, len;
u8 *pos; u8 *pos;
if (skb_headroom(skb) < 4 || skb->len < hdr_len) if (skb_headroom(skb) < 4 || skb->len < hdr_len)
return -1; return -1;
...@@ -146,17 +146,17 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) ...@@ -146,17 +146,17 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
/* other checks are in prism2_wep_build_iv */ /* other checks are in prism2_wep_build_iv */
if (skb_tailroom(skb) < 4) if (skb_tailroom(skb) < 4)
return -1; return -1;
/* add the IV to the frame */ /* add the IV to the frame */
if (prism2_wep_build_iv(skb, hdr_len, NULL, 0, priv)) if (prism2_wep_build_iv(skb, hdr_len, NULL, 0, priv))
return -1; return -1;
/* Copy the IV into the first 3 bytes of the key */ /* Copy the IV into the first 3 bytes of the key */
memcpy(key, skb->data + hdr_len, 3); memcpy(key, skb->data + hdr_len, 3);
/* Copy rest of the WEP key (the secret part) */ /* Copy rest of the WEP key (the secret part) */
memcpy(key + 3, wep->key, wep->key_len); memcpy(key + 3, wep->key, wep->key_len);
len = skb->len - hdr_len - 4; len = skb->len - hdr_len - 4;
pos = skb->data + hdr_len + 4; pos = skb->data + hdr_len + 4;
klen = 3 + wep->key_len; klen = 3 + wep->key_len;
......
...@@ -663,7 +663,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -663,7 +663,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
* any security data (IV, ICV, etc) that was left behind */ * any security data (IV, ICV, etc) that was left behind */
if (!can_be_decrypted && (fc & IEEE80211_FCTL_PROTECTED) && if (!can_be_decrypted && (fc & IEEE80211_FCTL_PROTECTED) &&
ieee->host_strip_iv_icv) { ieee->host_strip_iv_icv) {
int trimlen = 0; int trimlen = 0;
/* Top two-bits of byte 3 are the key index */ /* Top two-bits of byte 3 are the key index */
if (skb->len >= hdrlen + 3) if (skb->len >= hdrlen + 3)
...@@ -852,7 +852,7 @@ void ieee80211_rx_any(struct ieee80211_device *ieee, ...@@ -852,7 +852,7 @@ void ieee80211_rx_any(struct ieee80211_device *ieee,
if ((fc & IEEE80211_FCTL_VERS) != 0) if ((fc & IEEE80211_FCTL_VERS) != 0)
goto drop_free; goto drop_free;
switch (fc & IEEE80211_FCTL_FTYPE) { switch (fc & IEEE80211_FCTL_FTYPE) {
case IEEE80211_FTYPE_MGMT: case IEEE80211_FTYPE_MGMT:
if (skb->len < sizeof(struct ieee80211_hdr_3addr)) if (skb->len < sizeof(struct ieee80211_hdr_3addr))
...@@ -1489,7 +1489,7 @@ static void update_network(struct ieee80211_network *dst, ...@@ -1489,7 +1489,7 @@ static void update_network(struct ieee80211_network *dst,
/* We only update the statistics if they were created by receiving /* We only update the statistics if they were created by receiving
* the network information on the actual channel the network is on. * the network information on the actual channel the network is on.
* *
* This keeps beacons received on neighbor channels from bringing * This keeps beacons received on neighbor channels from bringing
* down the signal level of an AP. */ * down the signal level of an AP. */
if (dst->channel == src->stats.received_channel) if (dst->channel == src->stats.received_channel)
......
...@@ -54,7 +54,7 @@ Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | Frame | fcs | ...@@ -54,7 +54,7 @@ Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | Frame | fcs |
| | tion | (BSSID) | | | ence | data | | | | tion | (BSSID) | | | ence | data | |
`--------------------------------------------------| |------' `--------------------------------------------------| |------'
Total: 28 non-data bytes `----.----' Total: 28 non-data bytes `----.----'
| |
.- 'Frame data' expands, if WEP enabled, to <----------' .- 'Frame data' expands, if WEP enabled, to <----------'
| |
V V
...@@ -64,8 +64,8 @@ Bytes | 4 | 0-2296 | 4 | ...@@ -64,8 +64,8 @@ Bytes | 4 | 0-2296 | 4 |
Desc. | IV | Encrypted | ICV | Desc. | IV | Encrypted | ICV |
| | Packet | | | | Packet | |
`-----| |-----' `-----| |-----'
`-----.-----' `-----.-----'
| |
.- 'Encrypted Packet' expands to .- 'Encrypted Packet' expands to
| |
V V
......
...@@ -754,7 +754,7 @@ int ieee80211_wx_set_auth(struct net_device *dev, ...@@ -754,7 +754,7 @@ int ieee80211_wx_set_auth(struct net_device *dev,
int err = 0; int err = 0;
spin_lock_irqsave(&ieee->lock, flags); spin_lock_irqsave(&ieee->lock, flags);
switch (wrqu->param.flags & IW_AUTH_INDEX) { switch (wrqu->param.flags & IW_AUTH_INDEX) {
case IW_AUTH_WPA_VERSION: case IW_AUTH_WPA_VERSION:
case IW_AUTH_CIPHER_PAIRWISE: case IW_AUTH_CIPHER_PAIRWISE:
...@@ -799,7 +799,7 @@ int ieee80211_wx_get_auth(struct net_device *dev, ...@@ -799,7 +799,7 @@ int ieee80211_wx_get_auth(struct net_device *dev,
int err = 0; int err = 0;
spin_lock_irqsave(&ieee->lock, flags); spin_lock_irqsave(&ieee->lock, flags);
switch (wrqu->param.flags & IW_AUTH_INDEX) { switch (wrqu->param.flags & IW_AUTH_INDEX) {
case IW_AUTH_WPA_VERSION: case IW_AUTH_WPA_VERSION:
case IW_AUTH_CIPHER_PAIRWISE: case IW_AUTH_CIPHER_PAIRWISE:
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* Overview * Overview
* *
* Before you can associate, you have to authenticate. * Before you can associate, you have to authenticate.
* *
*/ */
/* Sends out an association request to the desired AP */ /* Sends out an association request to the desired AP */
...@@ -41,10 +41,10 @@ ieee80211softmac_assoc(struct ieee80211softmac_device *mac, struct ieee80211soft ...@@ -41,10 +41,10 @@ ieee80211softmac_assoc(struct ieee80211softmac_device *mac, struct ieee80211soft
/* Switch to correct channel for this network */ /* Switch to correct channel for this network */
mac->set_channel(mac->dev, net->channel); mac->set_channel(mac->dev, net->channel);
/* Send association request */ /* Send association request */
ieee80211softmac_send_mgt_frame(mac, net, IEEE80211_STYPE_ASSOC_REQ, 0); ieee80211softmac_send_mgt_frame(mac, net, IEEE80211_STYPE_ASSOC_REQ, 0);
dprintk(KERN_INFO PFX "sent association request!\n"); dprintk(KERN_INFO PFX "sent association request!\n");
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
...@@ -153,7 +153,7 @@ network_matches_request(struct ieee80211softmac_device *mac, struct ieee80211_ne ...@@ -153,7 +153,7 @@ network_matches_request(struct ieee80211softmac_device *mac, struct ieee80211_ne
} }
/* if 'ANY' network requested, take any that doesn't have privacy enabled */ /* if 'ANY' network requested, take any that doesn't have privacy enabled */
if (mac->associnfo.req_essid.len == 0 if (mac->associnfo.req_essid.len == 0
&& !(net->capability & WLAN_CAPABILITY_PRIVACY)) && !(net->capability & WLAN_CAPABILITY_PRIVACY))
return 1; return 1;
if (net->ssid_len != mac->associnfo.req_essid.len) if (net->ssid_len != mac->associnfo.req_essid.len)
...@@ -212,8 +212,8 @@ ieee80211softmac_assoc_work(struct work_struct *work) ...@@ -212,8 +212,8 @@ ieee80211softmac_assoc_work(struct work_struct *work)
/* try to find the requested network in our list, if we found one already */ /* try to find the requested network in our list, if we found one already */
if (bssvalid || mac->associnfo.bssfixed) if (bssvalid || mac->associnfo.bssfixed)
found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid); found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid);
/* Search the ieee80211 networks for this network if we didn't find it by bssid, /* Search the ieee80211 networks for this network if we didn't find it by bssid,
* but only if we've scanned at least once (to get a better list of networks to * but only if we've scanned at least once (to get a better list of networks to
* select from). If we have not scanned before, the !found logic below will be * select from). If we have not scanned before, the !found logic below will be
...@@ -265,7 +265,7 @@ ieee80211softmac_assoc_work(struct work_struct *work) ...@@ -265,7 +265,7 @@ ieee80211softmac_assoc_work(struct work_struct *work)
if (mac->associnfo.scan_retry > 0) { if (mac->associnfo.scan_retry > 0) {
mac->associnfo.scan_retry--; mac->associnfo.scan_retry--;
/* We know of no such network. Let's scan. /* We know of no such network. Let's scan.
* NB: this also happens if we had no memory to copy the network info... * NB: this also happens if we had no memory to copy the network info...
* Maybe we can hope to have more memory after scanning finishes ;) * Maybe we can hope to have more memory after scanning finishes ;)
*/ */
...@@ -353,7 +353,7 @@ ieee80211softmac_associated(struct ieee80211softmac_device *mac, ...@@ -353,7 +353,7 @@ ieee80211softmac_associated(struct ieee80211softmac_device *mac,
mac->set_bssid_filter(mac->dev, net->bssid); mac->set_bssid_filter(mac->dev, net->bssid);
memcpy(mac->ieee->bssid, net->bssid, ETH_ALEN); memcpy(mac->ieee->bssid, net->bssid, ETH_ALEN);
netif_carrier_on(mac->dev); netif_carrier_on(mac->dev);
mac->association_id = le16_to_cpup(&resp->aid); mac->association_id = le16_to_cpup(&resp->aid);
} }
...@@ -374,7 +374,7 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev, ...@@ -374,7 +374,7 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev,
if (unlikely(!mac->running)) if (unlikely(!mac->running))
return -ENODEV; return -ENODEV;
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
if (!mac->associnfo.associating) { if (!mac->associnfo.associating) {
...@@ -426,7 +426,7 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev, ...@@ -426,7 +426,7 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev,
mac->associnfo.associated = 0; mac->associnfo.associated = 0;
ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED, network); ieee80211softmac_call_events_locked(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED, network);
} }
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
return 0; return 0;
} }
......
...@@ -30,12 +30,12 @@ static void ieee80211softmac_auth_queue(struct work_struct *work); ...@@ -30,12 +30,12 @@ static void ieee80211softmac_auth_queue(struct work_struct *work);
/* Queues an auth request to the desired AP */ /* Queues an auth request to the desired AP */
int int
ieee80211softmac_auth_req(struct ieee80211softmac_device *mac, ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,
struct ieee80211softmac_network *net) struct ieee80211softmac_network *net)
{ {
struct ieee80211softmac_auth_queue_item *auth; struct ieee80211softmac_auth_queue_item *auth;
unsigned long flags; unsigned long flags;
if (net->authenticating || net->authenticated) if (net->authenticating || net->authenticated)
return 0; return 0;
net->authenticating = 1; net->authenticating = 1;
...@@ -55,7 +55,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac, ...@@ -55,7 +55,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,
auth->retry = IEEE80211SOFTMAC_AUTH_RETRY_LIMIT; auth->retry = IEEE80211SOFTMAC_AUTH_RETRY_LIMIT;
auth->state = IEEE80211SOFTMAC_AUTH_OPEN_REQUEST; auth->state = IEEE80211SOFTMAC_AUTH_OPEN_REQUEST;
INIT_DELAYED_WORK(&auth->work, ieee80211softmac_auth_queue); INIT_DELAYED_WORK(&auth->work, ieee80211softmac_auth_queue);
/* Lock (for list) */ /* Lock (for list) */
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
...@@ -63,7 +63,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac, ...@@ -63,7 +63,7 @@ ieee80211softmac_auth_req(struct ieee80211softmac_device *mac,
list_add_tail(&auth->list, &mac->auth_queue); list_add_tail(&auth->list, &mac->auth_queue);
schedule_delayed_work(&auth->work, 0); schedule_delayed_work(&auth->work, 0);
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
return 0; return 0;
} }
...@@ -85,7 +85,7 @@ ieee80211softmac_auth_queue(struct work_struct *work) ...@@ -85,7 +85,7 @@ ieee80211softmac_auth_queue(struct work_struct *work)
if(auth->retry > 0) { if(auth->retry > 0) {
/* Switch to correct channel for this network */ /* Switch to correct channel for this network */
mac->set_channel(mac->dev, net->channel); mac->set_channel(mac->dev, net->channel);
/* Lock and set flags */ /* Lock and set flags */
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
if (unlikely(!mac->running)) { if (unlikely(!mac->running)) {
...@@ -130,11 +130,11 @@ ieee80211softmac_auth_challenge_response(struct work_struct *work) ...@@ -130,11 +130,11 @@ ieee80211softmac_auth_challenge_response(struct work_struct *work)
} }
/* Handle the auth response from the AP /* Handle the auth response from the AP
* This should be registered with ieee80211 as handle_auth * This should be registered with ieee80211 as handle_auth
*/ */
int int
ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
{ {
struct list_head *list_ptr; struct list_head *list_ptr;
struct ieee80211softmac_device *mac = ieee80211_priv(dev); struct ieee80211softmac_device *mac = ieee80211_priv(dev);
...@@ -142,7 +142,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) ...@@ -142,7 +142,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
struct ieee80211softmac_network *net = NULL; struct ieee80211softmac_network *net = NULL;
unsigned long flags; unsigned long flags;
u8 * data; u8 * data;
if (unlikely(!mac->running)) if (unlikely(!mac->running))
return -ENODEV; return -ENODEV;
...@@ -157,15 +157,15 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) ...@@ -157,15 +157,15 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
aq = NULL; aq = NULL;
} }
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
/* Make sure that we've got an auth queue item for this request */ /* Make sure that we've got an auth queue item for this request */
if(aq == NULL) if(aq == NULL)
{ {
dprintkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but no queue item exists.\n", MAC_ARG(auth->header.addr2)); dprintkl(KERN_DEBUG PFX "Authentication response received from "MAC_FMT" but no queue item exists.\n", MAC_ARG(auth->header.addr2));
/* Error #? */ /* Error #? */
return -1; return -1;
} }
/* Check for out of order authentication */ /* Check for out of order authentication */
if(!net->authenticating) if(!net->authenticating)
{ {
...@@ -182,10 +182,10 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) ...@@ -182,10 +182,10 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
case WLAN_STATUS_SUCCESS: case WLAN_STATUS_SUCCESS:
/* Update the status to Authenticated */ /* Update the status to Authenticated */
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
net->authenticating = 0; net->authenticating = 0;
net->authenticated = 1; net->authenticated = 1;
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
/* Send event */ /* Send event */
printkl(KERN_NOTICE PFX "Open Authentication completed with "MAC_FMT"\n", MAC_ARG(net->bssid)); printkl(KERN_NOTICE PFX "Open Authentication completed with "MAC_FMT"\n", MAC_ARG(net->bssid));
ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net); ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net);
...@@ -196,8 +196,8 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) ...@@ -196,8 +196,8 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
net->authenticated = 0; net->authenticated = 0;
net->authenticating = 0; net->authenticating = 0;
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
printkl(KERN_NOTICE PFX "Open Authentication with "MAC_FMT" failed, error code: %i\n", printkl(KERN_NOTICE PFX "Open Authentication with "MAC_FMT" failed, error code: %i\n",
MAC_ARG(net->bssid), le16_to_cpup(&auth->status)); MAC_ARG(net->bssid), le16_to_cpup(&auth->status));
/* Count the error? */ /* Count the error? */
break; break;
...@@ -212,11 +212,11 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) ...@@ -212,11 +212,11 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
data = (u8 *)auth->info_element; data = (u8 *)auth->info_element;
if (*data++ != MFIE_TYPE_CHALLENGE) { if (*data++ != MFIE_TYPE_CHALLENGE) {
printkl(KERN_NOTICE PFX "Shared Key Authentication failed due to a missing challenge.\n"); printkl(KERN_NOTICE PFX "Shared Key Authentication failed due to a missing challenge.\n");
break; break;
} }
/* Save the challenge */ /* Save the challenge */
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
net->challenge_len = *data++; net->challenge_len = *data++;
if (net->challenge_len > WLAN_AUTH_CHALLENGE_LEN) if (net->challenge_len > WLAN_AUTH_CHALLENGE_LEN)
net->challenge_len = WLAN_AUTH_CHALLENGE_LEN; net->challenge_len = WLAN_AUTH_CHALLENGE_LEN;
kfree(net->challenge); kfree(net->challenge);
...@@ -229,7 +229,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) ...@@ -229,7 +229,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
break; break;
} }
aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE; aq->state = IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE;
/* We reuse the work struct from the auth request here. /* We reuse the work struct from the auth request here.
* It is safe to do so as each one is per-request, and * It is safe to do so as each one is per-request, and
...@@ -248,22 +248,22 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) ...@@ -248,22 +248,22 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
/* Check the status code of the response */ /* Check the status code of the response */
switch(auth->status) { switch(auth->status) {
case WLAN_STATUS_SUCCESS: case WLAN_STATUS_SUCCESS:
/* Update the status to Authenticated */ /* Update the status to Authenticated */
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
net->authenticating = 0; net->authenticating = 0;
net->authenticated = 1; net->authenticated = 1;
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
printkl(KERN_NOTICE PFX "Shared Key Authentication completed with "MAC_FMT"\n", printkl(KERN_NOTICE PFX "Shared Key Authentication completed with "MAC_FMT"\n",
MAC_ARG(net->bssid)); MAC_ARG(net->bssid));
ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net); ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, net);
break; break;
default: default:
printkl(KERN_NOTICE PFX "Shared Key Authentication with "MAC_FMT" failed, error code: %i\n", printkl(KERN_NOTICE PFX "Shared Key Authentication with "MAC_FMT" failed, error code: %i\n",
MAC_ARG(net->bssid), le16_to_cpup(&auth->status)); MAC_ARG(net->bssid), le16_to_cpup(&auth->status));
/* Lock and reset flags */ /* Lock and reset flags */
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
net->authenticating = 0; net->authenticating = 0;
net->authenticated = 0; net->authenticated = 0;
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
/* Count the error? */ /* Count the error? */
break; break;
...@@ -277,7 +277,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) ...@@ -277,7 +277,7 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth)
goto free_aq; goto free_aq;
break; break;
default: default:
/* ERROR */ /* ERROR */
goto free_aq; goto free_aq;
break; break;
} }
...@@ -313,7 +313,7 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac, ...@@ -313,7 +313,7 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac,
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
net->authenticating = 0; net->authenticating = 0;
net->authenticated = 0; net->authenticated = 0;
/* Find correct auth queue item, if it exists */ /* Find correct auth queue item, if it exists */
list_for_each(list_ptr, &mac->auth_queue) { list_for_each(list_ptr, &mac->auth_queue) {
aq = list_entry(list_ptr, struct ieee80211softmac_auth_queue_item, list); aq = list_entry(list_ptr, struct ieee80211softmac_auth_queue_item, list);
...@@ -322,7 +322,7 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac, ...@@ -322,7 +322,7 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac,
else else
aq = NULL; aq = NULL;
} }
/* Cancel pending work */ /* Cancel pending work */
if(aq != NULL) if(aq != NULL)
/* Not entirely safe? What about running work? */ /* Not entirely safe? What about running work? */
...@@ -333,7 +333,7 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac, ...@@ -333,7 +333,7 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac,
if(net->challenge != NULL) if(net->challenge != NULL)
kfree(net->challenge); kfree(net->challenge);
kfree(net); kfree(net);
/* can't transmit data right now... */ /* can't transmit data right now... */
netif_carrier_off(mac->dev); netif_carrier_off(mac->dev);
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
...@@ -341,15 +341,15 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac, ...@@ -341,15 +341,15 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac,
ieee80211softmac_try_reassoc(mac); ieee80211softmac_try_reassoc(mac);
} }
/* /*
* Sends a deauth request to the desired AP * Sends a deauth request to the desired AP
*/ */
int int
ieee80211softmac_deauth_req(struct ieee80211softmac_device *mac, ieee80211softmac_deauth_req(struct ieee80211softmac_device *mac,
struct ieee80211softmac_network *net, int reason) struct ieee80211softmac_network *net, int reason)
{ {
int ret; int ret;
/* Make sure the network is authenticated */ /* Make sure the network is authenticated */
if (!net->authenticated) if (!net->authenticated)
{ {
...@@ -357,25 +357,25 @@ ieee80211softmac_deauth_req(struct ieee80211softmac_device *mac, ...@@ -357,25 +357,25 @@ ieee80211softmac_deauth_req(struct ieee80211softmac_device *mac,
/* Error okay? */ /* Error okay? */
return -EPERM; return -EPERM;
} }
/* Send the de-auth packet */ /* Send the de-auth packet */
if((ret = ieee80211softmac_send_mgt_frame(mac, net, IEEE80211_STYPE_DEAUTH, reason))) if((ret = ieee80211softmac_send_mgt_frame(mac, net, IEEE80211_STYPE_DEAUTH, reason)))
return ret; return ret;
ieee80211softmac_deauth_from_net(mac, net); ieee80211softmac_deauth_from_net(mac, net);
return 0; return 0;
} }
/* /*
* This should be registered with ieee80211 as handle_deauth * This should be registered with ieee80211 as handle_deauth
*/ */
int int
ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *deauth) ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *deauth)
{ {
struct ieee80211softmac_network *net = NULL; struct ieee80211softmac_network *net = NULL;
struct ieee80211softmac_device *mac = ieee80211_priv(dev); struct ieee80211softmac_device *mac = ieee80211_priv(dev);
if (unlikely(!mac->running)) if (unlikely(!mac->running))
return -ENODEV; return -ENODEV;
...@@ -385,7 +385,7 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de ...@@ -385,7 +385,7 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de
} }
net = ieee80211softmac_get_network_by_bssid(mac, deauth->header.addr2); net = ieee80211softmac_get_network_by_bssid(mac, deauth->header.addr2);
if (net == NULL) { if (net == NULL) {
dprintkl(KERN_DEBUG PFX "Received deauthentication packet from "MAC_FMT", but that network is unknown.\n", dprintkl(KERN_DEBUG PFX "Received deauthentication packet from "MAC_FMT", but that network is unknown.\n",
MAC_ARG(deauth->header.addr2)); MAC_ARG(deauth->header.addr2));
......
...@@ -79,7 +79,7 @@ ieee80211softmac_notify_callback(struct work_struct *work) ...@@ -79,7 +79,7 @@ ieee80211softmac_notify_callback(struct work_struct *work)
container_of(work, struct ieee80211softmac_event, work.work); container_of(work, struct ieee80211softmac_event, work.work);
struct ieee80211softmac_event event = *pevent; struct ieee80211softmac_event event = *pevent;
kfree(pevent); kfree(pevent);
event.fun(event.mac->dev, event.event_type, event.context); event.fun(event.mac->dev, event.event_type, event.context);
} }
...@@ -92,14 +92,14 @@ ieee80211softmac_notify_internal(struct ieee80211softmac_device *mac, ...@@ -92,14 +92,14 @@ ieee80211softmac_notify_internal(struct ieee80211softmac_device *mac,
if (event < -1 || event > IEEE80211SOFTMAC_EVENT_LAST) if (event < -1 || event > IEEE80211SOFTMAC_EVENT_LAST)
return -ENOSYS; return -ENOSYS;
if (!fun) if (!fun)
return -EINVAL; return -EINVAL;
eventptr = kmalloc(sizeof(struct ieee80211softmac_event), gfp_mask); eventptr = kmalloc(sizeof(struct ieee80211softmac_event), gfp_mask);
if (!eventptr) if (!eventptr)
return -ENOMEM; return -ENOMEM;
eventptr->event_type = event; eventptr->event_type = event;
INIT_DELAYED_WORK(&eventptr->work, ieee80211softmac_notify_callback); INIT_DELAYED_WORK(&eventptr->work, ieee80211softmac_notify_callback);
eventptr->fun = fun; eventptr->fun = fun;
...@@ -122,7 +122,7 @@ ieee80211softmac_notify_gfp(struct net_device *dev, ...@@ -122,7 +122,7 @@ ieee80211softmac_notify_gfp(struct net_device *dev,
if (event < 0 || event > IEEE80211SOFTMAC_EVENT_LAST) if (event < 0 || event > IEEE80211SOFTMAC_EVENT_LAST)
return -ENOSYS; return -ENOSYS;
return ieee80211softmac_notify_internal(mac, event, NULL, fun, context, gfp_mask); return ieee80211softmac_notify_internal(mac, event, NULL, fun, context, gfp_mask);
} }
EXPORT_SYMBOL_GPL(ieee80211softmac_notify_gfp); EXPORT_SYMBOL_GPL(ieee80211softmac_notify_gfp);
...@@ -133,7 +133,7 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve ...@@ -133,7 +133,7 @@ ieee80211softmac_call_events_locked(struct ieee80211softmac_device *mac, int eve
{ {
struct ieee80211softmac_event *eventptr, *tmp; struct ieee80211softmac_event *eventptr, *tmp;
struct ieee80211softmac_network *network; struct ieee80211softmac_network *network;
if (event >= 0) { if (event >= 0) {
union iwreq_data wrqu; union iwreq_data wrqu;
int we_event; int we_event;
......
/* /*
* Some parts based on code from net80211 * Some parts based on code from net80211
* Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2001 Atsushi Onoe
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#include "ieee80211softmac_priv.h" #include "ieee80211softmac_priv.h"
/* Helper functions for inserting data into the frames */ /* Helper functions for inserting data into the frames */
/* /*
* Adds an ESSID element to the frame * Adds an ESSID element to the frame
* *
*/ */
...@@ -53,7 +53,7 @@ ieee80211softmac_add_essid(u8 *dst, struct ieee80211softmac_essid *essid) ...@@ -53,7 +53,7 @@ ieee80211softmac_add_essid(u8 *dst, struct ieee80211softmac_essid *essid)
*dst++ = 0; *dst++ = 0;
return dst; return dst;
} }
} }
/* Adds Supported Rates and if required Extended Rates Information Element /* Adds Supported Rates and if required Extended Rates Information Element
* to the frame, ASSUMES WE HAVE A SORTED LIST OF RATES */ * to the frame, ASSUMES WE HAVE A SORTED LIST OF RATES */
...@@ -81,18 +81,18 @@ ieee80211softmac_frame_add_rates(u8 *dst, const struct ieee80211softmac_ratesinf ...@@ -81,18 +81,18 @@ ieee80211softmac_frame_add_rates(u8 *dst, const struct ieee80211softmac_ratesinf
memcpy(dst, r->rates + cck_len, ofdm_len); memcpy(dst, r->rates + cck_len, ofdm_len);
dst += ofdm_len; dst += ofdm_len;
} }
} }
return dst; return dst;
} }
/* Allocate a management frame */ /* Allocate a management frame */
static u8 * static u8 *
ieee80211softmac_alloc_mgt(u32 size) ieee80211softmac_alloc_mgt(u32 size)
{ {
u8 * data; u8 * data;
/* Add the header and FCS to the size */ /* Add the header and FCS to the size */
size = size + IEEE80211_3ADDR_LEN; size = size + IEEE80211_3ADDR_LEN;
if(size > IEEE80211_DATA_LEN) if(size > IEEE80211_DATA_LEN)
return NULL; return NULL;
/* Allocate the frame */ /* Allocate the frame */
...@@ -103,13 +103,13 @@ ieee80211softmac_alloc_mgt(u32 size) ...@@ -103,13 +103,13 @@ ieee80211softmac_alloc_mgt(u32 size)
/* /*
* Add a 2 Address Header * Add a 2 Address Header
*/ */
static void static void
ieee80211softmac_hdr_2addr(struct ieee80211softmac_device *mac, ieee80211softmac_hdr_2addr(struct ieee80211softmac_device *mac,
struct ieee80211_hdr_2addr *header, u32 type, u8 *dest) struct ieee80211_hdr_2addr *header, u32 type, u8 *dest)
{ {
/* Fill in the frame control flags */ /* Fill in the frame control flags */
header->frame_ctl = cpu_to_le16(type); header->frame_ctl = cpu_to_le16(type);
/* Control packets always have WEP turned off */ /* Control packets always have WEP turned off */
if(type > IEEE80211_STYPE_CFENDACK && type < IEEE80211_STYPE_PSPOLL) if(type > IEEE80211_STYPE_CFENDACK && type < IEEE80211_STYPE_PSPOLL)
header->frame_ctl |= mac->ieee->sec.level ? cpu_to_le16(IEEE80211_FCTL_PROTECTED) : 0; header->frame_ctl |= mac->ieee->sec.level ? cpu_to_le16(IEEE80211_FCTL_PROTECTED) : 0;
...@@ -130,13 +130,13 @@ ieee80211softmac_hdr_2addr(struct ieee80211softmac_device *mac, ...@@ -130,13 +130,13 @@ ieee80211softmac_hdr_2addr(struct ieee80211softmac_device *mac,
/* Add a 3 Address Header */ /* Add a 3 Address Header */
static void static void
ieee80211softmac_hdr_3addr(struct ieee80211softmac_device *mac, ieee80211softmac_hdr_3addr(struct ieee80211softmac_device *mac,
struct ieee80211_hdr_3addr *header, u32 type, u8 *dest, u8 *bssid) struct ieee80211_hdr_3addr *header, u32 type, u8 *dest, u8 *bssid)
{ {
/* This is common with 2addr, so use that instead */ /* This is common with 2addr, so use that instead */
ieee80211softmac_hdr_2addr(mac, (struct ieee80211_hdr_2addr *)header, type, dest); ieee80211softmac_hdr_2addr(mac, (struct ieee80211_hdr_2addr *)header, type, dest);
/* Fill in the BSS ID */ /* Fill in the BSS ID */
if(bssid == NULL) if(bssid == NULL)
memset(header->addr3, 0xFF, ETH_ALEN); memset(header->addr3, 0xFF, ETH_ALEN);
...@@ -201,11 +201,11 @@ ieee80211softmac_capabilities(struct ieee80211softmac_device *mac, ...@@ -201,11 +201,11 @@ ieee80211softmac_capabilities(struct ieee80211softmac_device *mac,
/***************************************************************************** /*****************************************************************************
* Create Management packets * Create Management packets
*****************************************************************************/ *****************************************************************************/
/* Creates an association request packet */ /* Creates an association request packet */
static u32 static u32
ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt, ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt,
struct ieee80211softmac_device *mac, struct ieee80211softmac_network *net) struct ieee80211softmac_device *mac, struct ieee80211softmac_network *net)
{ {
u8 *data; u8 *data;
...@@ -233,7 +233,7 @@ ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt, ...@@ -233,7 +233,7 @@ ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt,
/* Fill in Listen Interval (?) */ /* Fill in Listen Interval (?) */
(*pkt)->listen_interval = cpu_to_le16(10); (*pkt)->listen_interval = cpu_to_le16(10);
data = (u8 *)(*pkt)->info_element; data = (u8 *)(*pkt)->info_element;
/* Add SSID */ /* Add SSID */
data = ieee80211softmac_add_essid(data, &net->essid); data = ieee80211softmac_add_essid(data, &net->essid);
...@@ -250,7 +250,7 @@ ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt, ...@@ -250,7 +250,7 @@ ieee80211softmac_assoc_req(struct ieee80211_assoc_request **pkt,
/* Create a reassociation request packet */ /* Create a reassociation request packet */
static u32 static u32
ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt, ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt,
struct ieee80211softmac_device *mac, struct ieee80211softmac_network *net) struct ieee80211softmac_device *mac, struct ieee80211softmac_network *net)
{ {
u8 *data; u8 *data;
...@@ -263,9 +263,9 @@ ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt, ...@@ -263,9 +263,9 @@ ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt,
/* Rates IE */ /* Rates IE */
1 + 1 + IEEE80211SOFTMAC_MAX_RATES_LEN + 1 + 1 + IEEE80211SOFTMAC_MAX_RATES_LEN +
/* Extended Rates IE */ /* Extended Rates IE */
1 + 1 + IEEE80211SOFTMAC_MAX_EX_RATES_LEN 1 + 1 + IEEE80211SOFTMAC_MAX_EX_RATES_LEN
/* Other IE's? */ /* Other IE's? */
); );
if (unlikely((*pkt) == NULL)) if (unlikely((*pkt) == NULL))
return 0; return 0;
ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_REASSOC_REQ, net->bssid, net->bssid); ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_REASSOC_REQ, net->bssid, net->bssid);
...@@ -277,10 +277,10 @@ ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt, ...@@ -277,10 +277,10 @@ ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt,
(*pkt)->listen_interval = cpu_to_le16(10); (*pkt)->listen_interval = cpu_to_le16(10);
/* Fill in the current AP MAC */ /* Fill in the current AP MAC */
memcpy((*pkt)->current_ap, mac->ieee->bssid, ETH_ALEN); memcpy((*pkt)->current_ap, mac->ieee->bssid, ETH_ALEN);
data = (u8 *)(*pkt)->info_element; data = (u8 *)(*pkt)->info_element;
/* Add SSID */ /* Add SSID */
data = ieee80211softmac_add_essid(data, &net->essid); data = ieee80211softmac_add_essid(data, &net->essid);
/* Add Rates */ /* Add Rates */
data = ieee80211softmac_frame_add_rates(data, &mac->ratesinfo); data = ieee80211softmac_frame_add_rates(data, &mac->ratesinfo);
/* Return packet size */ /* Return packet size */
...@@ -289,7 +289,7 @@ ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt, ...@@ -289,7 +289,7 @@ ieee80211softmac_reassoc_req(struct ieee80211_reassoc_request **pkt,
/* Create an authentication packet */ /* Create an authentication packet */
static u32 static u32
ieee80211softmac_auth(struct ieee80211_auth **pkt, ieee80211softmac_auth(struct ieee80211_auth **pkt,
struct ieee80211softmac_device *mac, struct ieee80211softmac_network *net, struct ieee80211softmac_device *mac, struct ieee80211softmac_network *net,
u16 transaction, u16 status, int *encrypt_mpdu) u16 transaction, u16 status, int *encrypt_mpdu)
{ {
...@@ -309,20 +309,20 @@ ieee80211softmac_auth(struct ieee80211_auth **pkt, ...@@ -309,20 +309,20 @@ ieee80211softmac_auth(struct ieee80211_auth **pkt,
if (unlikely((*pkt) == NULL)) if (unlikely((*pkt) == NULL))
return 0; return 0;
ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_AUTH, net->bssid, net->bssid); ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_AUTH, net->bssid, net->bssid);
/* Algorithm */ /* Algorithm */
(*pkt)->algorithm = cpu_to_le16(auth_mode); (*pkt)->algorithm = cpu_to_le16(auth_mode);
/* Transaction */ /* Transaction */
(*pkt)->transaction = cpu_to_le16(transaction); (*pkt)->transaction = cpu_to_le16(transaction);
/* Status */ /* Status */
(*pkt)->status = cpu_to_le16(status); (*pkt)->status = cpu_to_le16(status);
data = (u8 *)(*pkt)->info_element; data = (u8 *)(*pkt)->info_element;
/* Challenge Text */ /* Challenge Text */
if (is_shared_response) { if (is_shared_response) {
*data = MFIE_TYPE_CHALLENGE; *data = MFIE_TYPE_CHALLENGE;
data++; data++;
/* Copy the challenge in */ /* Copy the challenge in */
*data = net->challenge_len; *data = net->challenge_len;
data++; data++;
...@@ -360,7 +360,7 @@ static u32 ...@@ -360,7 +360,7 @@ static u32
ieee80211softmac_probe_req(struct ieee80211_probe_request **pkt, ieee80211softmac_probe_req(struct ieee80211_probe_request **pkt,
struct ieee80211softmac_device *mac, struct ieee80211softmac_essid *essid) struct ieee80211softmac_device *mac, struct ieee80211softmac_essid *essid)
{ {
u8 *data; u8 *data;
/* Allocate Packet */ /* Allocate Packet */
(*pkt) = (struct ieee80211_probe_request *)ieee80211softmac_alloc_mgt( (*pkt) = (struct ieee80211_probe_request *)ieee80211softmac_alloc_mgt(
/* SSID of requested network */ /* SSID of requested network */
...@@ -368,12 +368,12 @@ ieee80211softmac_probe_req(struct ieee80211_probe_request **pkt, ...@@ -368,12 +368,12 @@ ieee80211softmac_probe_req(struct ieee80211_probe_request **pkt,
/* Rates IE */ /* Rates IE */
1 + 1 + IEEE80211SOFTMAC_MAX_RATES_LEN + 1 + 1 + IEEE80211SOFTMAC_MAX_RATES_LEN +
/* Extended Rates IE */ /* Extended Rates IE */
1 + 1 + IEEE80211SOFTMAC_MAX_EX_RATES_LEN 1 + 1 + IEEE80211SOFTMAC_MAX_EX_RATES_LEN
); );
if (unlikely((*pkt) == NULL)) if (unlikely((*pkt) == NULL))
return 0; return 0;
ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_PROBE_REQ, NULL, NULL); ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_PROBE_REQ, NULL, NULL);
data = (u8 *)(*pkt)->info_element; data = (u8 *)(*pkt)->info_element;
/* Add ESSID (can be NULL) */ /* Add ESSID (can be NULL) */
data = ieee80211softmac_add_essid(data, essid); data = ieee80211softmac_add_essid(data, essid);
...@@ -401,7 +401,7 @@ ieee80211softmac_probe_resp(struct ieee80211_probe_response **pkt, ...@@ -401,7 +401,7 @@ ieee80211softmac_probe_resp(struct ieee80211_probe_response **pkt,
2 + /* DS Parameter Set */ 2 + /* DS Parameter Set */
8 + /* CF Parameter Set */ 8 + /* CF Parameter Set */
4 /* IBSS Parameter Set */ 4 /* IBSS Parameter Set */
); );
if (unlikely((*pkt) == NULL)) if (unlikely((*pkt) == NULL))
return 0; return 0;
ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_PROBE_RESP, net->bssid, net->bssid); ieee80211softmac_hdr_3addr(mac, &((*pkt)->header), IEEE80211_STYPE_PROBE_RESP, net->bssid, net->bssid);
...@@ -445,15 +445,15 @@ ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac, ...@@ -445,15 +445,15 @@ ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac,
pkt_size = ieee80211softmac_probe_resp((struct ieee80211_probe_response **)(&pkt), mac, (struct ieee80211softmac_network *)ptrarg); pkt_size = ieee80211softmac_probe_resp((struct ieee80211_probe_response **)(&pkt), mac, (struct ieee80211softmac_network *)ptrarg);
break; break;
default: default:
printkl(KERN_DEBUG PFX "Unsupported Management Frame type: %i\n", type); printkl(KERN_DEBUG PFX "Unsupported Management Frame type: %i\n", type);
return -EINVAL; return -EINVAL;
}; };
if(pkt_size == 0 || pkt == NULL) { if(pkt_size == 0 || pkt == NULL) {
printkl(KERN_DEBUG PFX "Error, packet is nonexistant or 0 length\n"); printkl(KERN_DEBUG PFX "Error, packet is nonexistant or 0 length\n");
return -ENOMEM; return -ENOMEM;
} }
/* Send the packet to the ieee80211 layer for tx */ /* Send the packet to the ieee80211 layer for tx */
/* we defined softmac->mgmt_xmit for this. Should we keep it /* we defined softmac->mgmt_xmit for this. Should we keep it
* as it is (that means we'd need to wrap this into a txb), * as it is (that means we'd need to wrap this into a txb),
......
...@@ -32,19 +32,19 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv) ...@@ -32,19 +32,19 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
{ {
struct ieee80211softmac_device *softmac; struct ieee80211softmac_device *softmac;
struct net_device *dev; struct net_device *dev;
dev = alloc_ieee80211(sizeof(struct ieee80211softmac_device) + sizeof_priv); dev = alloc_ieee80211(sizeof(struct ieee80211softmac_device) + sizeof_priv);
softmac = ieee80211_priv(dev); softmac = ieee80211_priv(dev);
softmac->dev = dev; softmac->dev = dev;
softmac->ieee = netdev_priv(dev); softmac->ieee = netdev_priv(dev);
spin_lock_init(&softmac->lock); spin_lock_init(&softmac->lock);
softmac->ieee->handle_auth = ieee80211softmac_auth_resp; softmac->ieee->handle_auth = ieee80211softmac_auth_resp;
softmac->ieee->handle_deauth = ieee80211softmac_deauth_resp; softmac->ieee->handle_deauth = ieee80211softmac_deauth_resp;
softmac->ieee->handle_assoc_response = ieee80211softmac_handle_assoc_response; softmac->ieee->handle_assoc_response = ieee80211softmac_handle_assoc_response;
softmac->ieee->handle_reassoc_request = ieee80211softmac_handle_reassoc_req; softmac->ieee->handle_reassoc_request = ieee80211softmac_handle_reassoc_req;
softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc; softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc;
softmac->ieee->handle_beacon = ieee80211softmac_handle_beacon; softmac->ieee->handle_beacon = ieee80211softmac_handle_beacon;
softmac->scaninfo = NULL; softmac->scaninfo = NULL;
softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT; softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;
...@@ -66,37 +66,37 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv) ...@@ -66,37 +66,37 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv)
/* to start with, we can't send anything ... */ /* to start with, we can't send anything ... */
netif_carrier_off(dev); netif_carrier_off(dev);
return dev; return dev;
} }
EXPORT_SYMBOL_GPL(alloc_ieee80211softmac); EXPORT_SYMBOL_GPL(alloc_ieee80211softmac);
/* Clears the pending work queue items, stops all scans, etc. */ /* Clears the pending work queue items, stops all scans, etc. */
void void
ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm) ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm)
{ {
unsigned long flags; unsigned long flags;
struct ieee80211softmac_event *eventptr, *eventtmp; struct ieee80211softmac_event *eventptr, *eventtmp;
struct ieee80211softmac_auth_queue_item *authptr, *authtmp; struct ieee80211softmac_auth_queue_item *authptr, *authtmp;
struct ieee80211softmac_network *netptr, *nettmp; struct ieee80211softmac_network *netptr, *nettmp;
ieee80211softmac_stop_scan(sm); ieee80211softmac_stop_scan(sm);
ieee80211softmac_wait_for_scan(sm); ieee80211softmac_wait_for_scan(sm);
spin_lock_irqsave(&sm->lock, flags); spin_lock_irqsave(&sm->lock, flags);
sm->running = 0; sm->running = 0;
/* Free all pending assoc work items */ /* Free all pending assoc work items */
cancel_delayed_work(&sm->associnfo.work); cancel_delayed_work(&sm->associnfo.work);
/* Free all pending scan work items */ /* Free all pending scan work items */
if(sm->scaninfo != NULL) if(sm->scaninfo != NULL)
cancel_delayed_work(&sm->scaninfo->softmac_scan); cancel_delayed_work(&sm->scaninfo->softmac_scan);
/* Free all pending auth work items */ /* Free all pending auth work items */
list_for_each_entry(authptr, &sm->auth_queue, list) list_for_each_entry(authptr, &sm->auth_queue, list)
cancel_delayed_work(&authptr->work); cancel_delayed_work(&authptr->work);
/* delete all pending event calls and work items */ /* delete all pending event calls and work items */
list_for_each_entry_safe(eventptr, eventtmp, &sm->events, list) list_for_each_entry_safe(eventptr, eventtmp, &sm->events, list)
cancel_delayed_work(&eventptr->work); cancel_delayed_work(&eventptr->work);
...@@ -111,13 +111,13 @@ ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm) ...@@ -111,13 +111,13 @@ ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm)
list_del(&authptr->list); list_del(&authptr->list);
kfree(authptr); kfree(authptr);
} }
/* delete all pending event calls and work items */ /* delete all pending event calls and work items */
list_for_each_entry_safe(eventptr, eventtmp, &sm->events, list) { list_for_each_entry_safe(eventptr, eventtmp, &sm->events, list) {
list_del(&eventptr->list); list_del(&eventptr->list);
kfree(eventptr); kfree(eventptr);
} }
/* Free all networks */ /* Free all networks */
list_for_each_entry_safe(netptr, nettmp, &sm->network_list, list) { list_for_each_entry_safe(netptr, nettmp, &sm->network_list, list) {
ieee80211softmac_del_network_locked(sm, netptr); ieee80211softmac_del_network_locked(sm, netptr);
...@@ -133,7 +133,7 @@ EXPORT_SYMBOL_GPL(ieee80211softmac_clear_pending_work); ...@@ -133,7 +133,7 @@ EXPORT_SYMBOL_GPL(ieee80211softmac_clear_pending_work);
void free_ieee80211softmac(struct net_device *dev) void free_ieee80211softmac(struct net_device *dev)
{ {
struct ieee80211softmac_device *sm = ieee80211_priv(dev); struct ieee80211softmac_device *sm = ieee80211_priv(dev);
ieee80211softmac_clear_pending_work(sm); ieee80211softmac_clear_pending_work(sm);
kfree(sm->scaninfo); kfree(sm->scaninfo);
kfree(sm->wpa.IE); kfree(sm->wpa.IE);
free_ieee80211(dev); free_ieee80211(dev);
...@@ -208,9 +208,9 @@ EXPORT_SYMBOL_GPL(ieee80211softmac_highest_supported_rate); ...@@ -208,9 +208,9 @@ EXPORT_SYMBOL_GPL(ieee80211softmac_highest_supported_rate);
void ieee80211softmac_process_erp(struct ieee80211softmac_device *mac, void ieee80211softmac_process_erp(struct ieee80211softmac_device *mac,
u8 erp_value) u8 erp_value)
{ {
int use_protection; int use_protection;
int short_preamble; int short_preamble;
u32 changes = 0; u32 changes = 0;
/* Barker preamble mode */ /* Barker preamble mode */
short_preamble = ((erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0 short_preamble = ((erp_value & WLAN_ERP_BARKER_PREAMBLE) == 0
...@@ -269,7 +269,7 @@ void ieee80211softmac_init_bss(struct ieee80211softmac_device *mac) ...@@ -269,7 +269,7 @@ void ieee80211softmac_init_bss(struct ieee80211softmac_device *mac)
rates, so 801.11g devices start off at 11M for now. People rates, so 801.11g devices start off at 11M for now. People
can manually change it if they really need to, but 11M is can manually change it if they really need to, but 11M is
more reliable. Note similar logic in more reliable. Note similar logic in
ieee80211softmac_wx_set_rate() */ ieee80211softmac_wx_set_rate() */
if (ieee->modulation & IEEE80211_CCK_MODULATION) { if (ieee->modulation & IEEE80211_CCK_MODULATION) {
txrates->user_rate = IEEE80211_CCK_RATE_11MB; txrates->user_rate = IEEE80211_CCK_RATE_11MB;
} else if (ieee->modulation & IEEE80211_OFDM_MODULATION) { } else if (ieee->modulation & IEEE80211_OFDM_MODULATION) {
...@@ -332,7 +332,7 @@ void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates) ...@@ -332,7 +332,7 @@ void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates)
{ {
struct ieee80211softmac_device *mac = ieee80211_priv(dev); struct ieee80211softmac_device *mac = ieee80211_priv(dev);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
memcpy(mac->ratesinfo.rates, rates, count); memcpy(mac->ratesinfo.rates, rates, count);
mac->ratesinfo.count = count; mac->ratesinfo.count = count;
...@@ -344,7 +344,7 @@ static u8 raise_rate(struct ieee80211softmac_device *mac, u8 rate) ...@@ -344,7 +344,7 @@ static u8 raise_rate(struct ieee80211softmac_device *mac, u8 rate)
{ {
int i; int i;
struct ieee80211softmac_ratesinfo *ri = &mac->ratesinfo; struct ieee80211softmac_ratesinfo *ri = &mac->ratesinfo;
for (i=0; i<ri->count-1; i++) { for (i=0; i<ri->count-1; i++) {
if (ri->rates[i] == rate) if (ri->rates[i] == rate)
return ri->rates[i+1]; return ri->rates[i+1];
...@@ -357,7 +357,7 @@ u8 ieee80211softmac_lower_rate_delta(struct ieee80211softmac_device *mac, u8 rat ...@@ -357,7 +357,7 @@ u8 ieee80211softmac_lower_rate_delta(struct ieee80211softmac_device *mac, u8 rat
{ {
int i; int i;
struct ieee80211softmac_ratesinfo *ri = &mac->ratesinfo; struct ieee80211softmac_ratesinfo *ri = &mac->ratesinfo;
for (i=delta; i<ri->count; i++) { for (i=delta; i<ri->count; i++) {
if (ri->rates[i] == rate) if (ri->rates[i] == rate)
return ri->rates[i-delta]; return ri->rates[i-delta];
...@@ -438,7 +438,7 @@ ieee80211softmac_create_network(struct ieee80211softmac_device *mac, ...@@ -438,7 +438,7 @@ ieee80211softmac_create_network(struct ieee80211softmac_device *mac,
softnet->channel = net->channel; softnet->channel = net->channel;
softnet->essid.len = net->ssid_len; softnet->essid.len = net->ssid_len;
memcpy(softnet->essid.data, net->ssid, softnet->essid.len); memcpy(softnet->essid.data, net->ssid, softnet->essid.len);
/* copy rates over */ /* copy rates over */
softnet->supported_rates.count = net->rates_len; softnet->supported_rates.count = net->rates_len;
memcpy(&softnet->supported_rates.rates[0], net->rates, net->rates_len); memcpy(&softnet->supported_rates.rates[0], net->rates, net->rates_len);
...@@ -529,7 +529,7 @@ ieee80211softmac_get_network_by_bssid(struct ieee80211softmac_device *mac, ...@@ -529,7 +529,7 @@ ieee80211softmac_get_network_by_bssid(struct ieee80211softmac_device *mac,
{ {
unsigned long flags; unsigned long flags;
struct ieee80211softmac_network *softmac_net; struct ieee80211softmac_network *softmac_net;
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
softmac_net = ieee80211softmac_get_network_by_bssid_locked(mac, bssid); softmac_net = ieee80211softmac_get_network_by_bssid_locked(mac, bssid);
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
...@@ -556,13 +556,13 @@ ieee80211softmac_get_network_by_essid_locked(struct ieee80211softmac_device *mac ...@@ -556,13 +556,13 @@ ieee80211softmac_get_network_by_essid_locked(struct ieee80211softmac_device *mac
/* Get a network from the list by ESSID with locking */ /* Get a network from the list by ESSID with locking */
struct ieee80211softmac_network * struct ieee80211softmac_network *
ieee80211softmac_get_network_by_essid(struct ieee80211softmac_device *mac, ieee80211softmac_get_network_by_essid(struct ieee80211softmac_device *mac,
struct ieee80211softmac_essid *essid) struct ieee80211softmac_essid *essid)
{ {
unsigned long flags; unsigned long flags;
struct ieee80211softmac_network *softmac_net = NULL; struct ieee80211softmac_network *softmac_net = NULL;
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
softmac_net = ieee80211softmac_get_network_by_essid_locked(mac, essid); softmac_net = ieee80211softmac_get_network_by_essid_locked(mac, essid);
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
return softmac_net; return softmac_net;
} }
......
...@@ -130,7 +130,7 @@ static inline u8 get_fallback_rate(struct ieee80211softmac_device *mac, u8 rate) ...@@ -130,7 +130,7 @@ static inline u8 get_fallback_rate(struct ieee80211softmac_device *mac, u8 rate)
{ {
return ieee80211softmac_lower_rate_delta(mac, rate, 2); return ieee80211softmac_lower_rate_delta(mac, rate, 2);
} }
/*** prototypes from _io.c */ /*** prototypes from _io.c */
int ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac, int ieee80211softmac_send_mgt_frame(struct ieee80211softmac_device *mac,
...@@ -156,7 +156,7 @@ int ieee80211softmac_handle_assoc_response(struct net_device * dev, ...@@ -156,7 +156,7 @@ int ieee80211softmac_handle_assoc_response(struct net_device * dev,
int ieee80211softmac_handle_disassoc(struct net_device * dev, int ieee80211softmac_handle_disassoc(struct net_device * dev,
struct ieee80211_disassoc * disassoc); struct ieee80211_disassoc * disassoc);
int ieee80211softmac_handle_reassoc_req(struct net_device * dev, int ieee80211softmac_handle_reassoc_req(struct net_device * dev,
struct ieee80211_reassoc_request * reassoc); struct ieee80211_reassoc_request * reassoc);
void ieee80211softmac_assoc_timeout(struct work_struct *work); void ieee80211softmac_assoc_timeout(struct work_struct *work);
void ieee80211softmac_send_disassoc_req(struct ieee80211softmac_device *mac, u16 reason); void ieee80211softmac_send_disassoc_req(struct ieee80211softmac_device *mac, u16 reason);
void ieee80211softmac_disassoc(struct ieee80211softmac_device *mac); void ieee80211softmac_disassoc(struct ieee80211softmac_device *mac);
...@@ -164,15 +164,15 @@ void ieee80211softmac_disassoc(struct ieee80211softmac_device *mac); ...@@ -164,15 +164,15 @@ void ieee80211softmac_disassoc(struct ieee80211softmac_device *mac);
/* some helper functions */ /* some helper functions */
static inline int ieee80211softmac_scan_handlers_check_self(struct ieee80211softmac_device *sm) static inline int ieee80211softmac_scan_handlers_check_self(struct ieee80211softmac_device *sm)
{ {
return (sm->start_scan == ieee80211softmac_start_scan_implementation) && return (sm->start_scan == ieee80211softmac_start_scan_implementation) &&
(sm->stop_scan == ieee80211softmac_stop_scan_implementation) && (sm->stop_scan == ieee80211softmac_stop_scan_implementation) &&
(sm->wait_for_scan == ieee80211softmac_wait_for_scan_implementation); (sm->wait_for_scan == ieee80211softmac_wait_for_scan_implementation);
} }
static inline int ieee80211softmac_scan_sanity_check(struct ieee80211softmac_device *sm) static inline int ieee80211softmac_scan_sanity_check(struct ieee80211softmac_device *sm)
{ {
return ((sm->start_scan != ieee80211softmac_start_scan_implementation) && return ((sm->start_scan != ieee80211softmac_start_scan_implementation) &&
(sm->stop_scan != ieee80211softmac_stop_scan_implementation) && (sm->stop_scan != ieee80211softmac_stop_scan_implementation) &&
(sm->wait_for_scan != ieee80211softmac_wait_for_scan_implementation) (sm->wait_for_scan != ieee80211softmac_wait_for_scan_implementation)
) || ieee80211softmac_scan_handlers_check_self(sm); ) || ieee80211softmac_scan_handlers_check_self(sm);
} }
......
...@@ -62,12 +62,12 @@ ieee80211softmac_stop_scan(struct ieee80211softmac_device *sm) ...@@ -62,12 +62,12 @@ ieee80211softmac_stop_scan(struct ieee80211softmac_device *sm)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&sm->lock, flags); spin_lock_irqsave(&sm->lock, flags);
if (!sm->scanning) { if (!sm->scanning) {
spin_unlock_irqrestore(&sm->lock, flags); spin_unlock_irqrestore(&sm->lock, flags);
return; return;
} }
spin_unlock_irqrestore(&sm->lock, flags); spin_unlock_irqrestore(&sm->lock, flags);
sm->stop_scan(sm->dev); sm->stop_scan(sm->dev);
} }
...@@ -78,12 +78,12 @@ ieee80211softmac_wait_for_scan(struct ieee80211softmac_device *sm) ...@@ -78,12 +78,12 @@ ieee80211softmac_wait_for_scan(struct ieee80211softmac_device *sm)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&sm->lock, flags); spin_lock_irqsave(&sm->lock, flags);
if (!sm->scanning) { if (!sm->scanning) {
spin_unlock_irqrestore(&sm->lock, flags); spin_unlock_irqrestore(&sm->lock, flags);
return; return;
} }
spin_unlock_irqrestore(&sm->lock, flags); spin_unlock_irqrestore(&sm->lock, flags);
sm->wait_for_scan(sm->dev); sm->wait_for_scan(sm->dev);
} }
...@@ -158,14 +158,14 @@ int ieee80211softmac_start_scan_implementation(struct net_device *dev) ...@@ -158,14 +158,14 @@ int ieee80211softmac_start_scan_implementation(struct net_device *dev)
{ {
struct ieee80211softmac_device *sm = ieee80211_priv(dev); struct ieee80211softmac_device *sm = ieee80211_priv(dev);
unsigned long flags; unsigned long flags;
if (!(dev->flags & IFF_UP)) if (!(dev->flags & IFF_UP))
return -ENODEV; return -ENODEV;
assert(ieee80211softmac_scan_handlers_check_self(sm)); assert(ieee80211softmac_scan_handlers_check_self(sm));
if (!ieee80211softmac_scan_handlers_check_self(sm)) if (!ieee80211softmac_scan_handlers_check_self(sm))
return -EINVAL; return -EINVAL;
spin_lock_irqsave(&sm->lock, flags); spin_lock_irqsave(&sm->lock, flags);
/* it looks like we need to hold the lock here /* it looks like we need to hold the lock here
* to make sure we don't allocate two of these... */ * to make sure we don't allocate two of these... */
...@@ -241,7 +241,7 @@ void ieee80211softmac_scan_finished(struct ieee80211softmac_device *sm) ...@@ -241,7 +241,7 @@ void ieee80211softmac_scan_finished(struct ieee80211softmac_device *sm)
spin_lock_irqsave(&sm->lock, flags); spin_lock_irqsave(&sm->lock, flags);
sm->scanning = 0; sm->scanning = 0;
spin_unlock_irqrestore(&sm->lock, flags); spin_unlock_irqrestore(&sm->lock, flags);
if (sm->associnfo.bssvalid) { if (sm->associnfo.bssvalid) {
struct ieee80211softmac_network *net; struct ieee80211softmac_network *net;
......
...@@ -142,14 +142,14 @@ ieee80211softmac_wx_get_essid(struct net_device *net_dev, ...@@ -142,14 +142,14 @@ ieee80211softmac_wx_get_essid(struct net_device *net_dev,
/* If all fails, return ANY (empty) */ /* If all fails, return ANY (empty) */
data->essid.length = 0; data->essid.length = 0;
data->essid.flags = 0; /* active */ data->essid.flags = 0; /* active */
/* If we have a statically configured ESSID then return it */ /* If we have a statically configured ESSID then return it */
if (sm->associnfo.static_essid) { if (sm->associnfo.static_essid) {
data->essid.length = sm->associnfo.req_essid.len; data->essid.length = sm->associnfo.req_essid.len;
data->essid.flags = 1; /* active */ data->essid.flags = 1; /* active */
memcpy(extra, sm->associnfo.req_essid.data, sm->associnfo.req_essid.len); memcpy(extra, sm->associnfo.req_essid.data, sm->associnfo.req_essid.len);
} }
/* If we're associating/associated, return that */ /* If we're associating/associated, return that */
if (sm->associnfo.associated || sm->associnfo.associating) { if (sm->associnfo.associated || sm->associnfo.associating) {
data->essid.length = sm->associnfo.associate_essid.len; data->essid.length = sm->associnfo.associate_essid.len;
...@@ -181,7 +181,7 @@ ieee80211softmac_wx_set_rate(struct net_device *net_dev, ...@@ -181,7 +181,7 @@ ieee80211softmac_wx_set_rate(struct net_device *net_dev,
rates, so 801.11g devices start off at 11M for now. People rates, so 801.11g devices start off at 11M for now. People
can manually change it if they really need to, but 11M is can manually change it if they really need to, but 11M is
more reliable. Note similar logic in more reliable. Note similar logic in
ieee80211softmac_wx_set_rate() */ ieee80211softmac_wx_set_rate() */
if (ieee->modulation & IEEE80211_CCK_MODULATION) if (ieee->modulation & IEEE80211_CCK_MODULATION)
in_rate = 11000000; in_rate = 11000000;
else else
...@@ -247,7 +247,7 @@ ieee80211softmac_wx_set_rate(struct net_device *net_dev, ...@@ -247,7 +247,7 @@ ieee80211softmac_wx_set_rate(struct net_device *net_dev,
ieee80211softmac_recalc_txrates(mac); ieee80211softmac_recalc_txrates(mac);
err = 0; err = 0;
out_unlock: out_unlock:
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
out: out:
return err; return err;
...@@ -366,7 +366,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev, ...@@ -366,7 +366,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
} else if (is_zero_ether_addr(data->ap_addr.sa_data)) { } else if (is_zero_ether_addr(data->ap_addr.sa_data)) {
/* the bssid we have is no longer fixed */ /* the bssid we have is no longer fixed */
mac->associnfo.bssfixed = 0; mac->associnfo.bssfixed = 0;
} else { } else {
if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) { if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) {
if (mac->associnfo.associating || mac->associnfo.associated) { if (mac->associnfo.associating || mac->associnfo.associated) {
/* bssid unchanged and associated or associating - just return */ /* bssid unchanged and associated or associating - just return */
...@@ -380,7 +380,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev, ...@@ -380,7 +380,7 @@ ieee80211softmac_wx_set_wap(struct net_device *net_dev,
mac->associnfo.bssfixed = 1; mac->associnfo.bssfixed = 1;
/* queue associate if new bssid or (old one again and not associated) */ /* queue associate if new bssid or (old one again and not associated) */
schedule_delayed_work(&mac->associnfo.work, 0); schedule_delayed_work(&mac->associnfo.work, 0);
} }
out: out:
mutex_unlock(&mac->associnfo.mutex); mutex_unlock(&mac->associnfo.mutex);
...@@ -437,7 +437,7 @@ ieee80211softmac_wx_set_genie(struct net_device *dev, ...@@ -437,7 +437,7 @@ ieee80211softmac_wx_set_genie(struct net_device *dev,
mac->wpa.IEbuflen = 0; mac->wpa.IEbuflen = 0;
} }
out: out:
spin_unlock_irqrestore(&mac->lock, flags); spin_unlock_irqrestore(&mac->lock, flags);
mutex_unlock(&mac->associnfo.mutex); mutex_unlock(&mac->associnfo.mutex);
...@@ -458,9 +458,9 @@ ieee80211softmac_wx_get_genie(struct net_device *dev, ...@@ -458,9 +458,9 @@ ieee80211softmac_wx_get_genie(struct net_device *dev,
mutex_lock(&mac->associnfo.mutex); mutex_lock(&mac->associnfo.mutex);
spin_lock_irqsave(&mac->lock, flags); spin_lock_irqsave(&mac->lock, flags);
wrqu->data.length = 0; wrqu->data.length = 0;
if (mac->wpa.IE && mac->wpa.IElen) { if (mac->wpa.IE && mac->wpa.IElen) {
wrqu->data.length = mac->wpa.IElen; wrqu->data.length = mac->wpa.IElen;
if (mac->wpa.IElen <= space) if (mac->wpa.IElen <= space)
......
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