# HG changeset patch # User Joseph Jezak # Node ID a4cbba212036532e5670473be56d0458bd1fe7ee # Parent 7e98632fd19513b92a63ce7feefbd9123d8b367b Added state info to the networks being authenticated with. diff -r 7e98632fd195 -r a4cbba212036 ieee80211softmac_assoc.c --- a/ieee80211softmac_assoc.c Wed Nov 30 14:06:57 2005 +++ b/ieee80211softmac_assoc.c Wed Nov 30 14:15:25 2005 @@ -125,7 +125,7 @@ list_add(&found->list, &mac->network_list); } /* we found a network! authenticate (if necessary) and associate to it. */ - if (!(found->flags & NETWORK_IS_AUTHORIZED)) { + if (!(found->flags & NETWORK_IS_AUTHENTICATED)) { ieee80211softmac_notify(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED, &mac->associnfo.work); ieee80211softmac_auth_req(mac, found); } diff -r 7e98632fd195 -r a4cbba212036 ieee80211softmac_auth.c --- a/ieee80211softmac_auth.c Wed Nov 30 14:06:57 2005 +++ b/ieee80211softmac_auth.c Wed Nov 30 14:15:25 2005 @@ -10,7 +10,7 @@ struct ieee80211softmac_auth_queue_item *auth; int empty; - dprintk(PFX "Queueing Authorization Request to %X:%X:%X:%X:%X:%X\n", + dprintk(PFX "Queueing Authorization Request to %02x:%02x:%02x:%02x:%02x:%02x\n", net->bssid[0], net->bssid[1], net->bssid[2], net->bssid[3], net->bssid[4], net->bssid[5]); /* Queue the auth request */ @@ -51,7 +51,9 @@ mac = (struct ieee80211softmac_device *)data; auth = list_entry(mac->auth_queue.next, struct ieee80211softmac_auth_queue_item, list); if(auth->retry > 0) { - dprintk(PFX "Sending Authorization Request to %X:%X:%X:%X:%X:%X\n", + auth->net->flags &= ~IEEE80211_AUTHENTICATED; + auth->net->flags |= ~IEEE80211_AUTHENTICATING; + printkl(KERN_NOTICE PFX "Sending Authorization Request to %02x:%02x:%02x:%02x:%02x:%02x\n", auth->net->bssid[0], auth->net->bssid[1], auth->net->bssid[2], auth->net->bssid[3], auth->net->bssid[4], auth->net->bssid[5]); if(!ieee80211softmac_send_mgt_frame(mac, auth->net, IEEE80211_STYPE_AUTH, auth->state)) @@ -63,6 +65,13 @@ spin_unlock(&mac->lock); } } + if(!(auth->net->flags & IEEE80211_AUTHENTICATED)) { + auth->net->flags &= ~(IEEE80211_AUTHENTICATED | IEEE80211_AUTHENTICATING); + printkl(KERN_WARNING PFX "Authentication failed with %02x:%02x:%02x:%02x:%02x:%02x\n", + auth->net->bssid[0], auth->net->bssid[1], auth->net->bssid[2], + auth->net->bssid[3], auth->net->bssid[4], auth->net->bssid[5]); + } + /* Remove this item from the queue */ spin_lock(&mac->lock); /* shouldn't this be list_del(&auth->list) ?? */ @@ -91,16 +100,26 @@ switch(auth->algorithm) { case WLAN_AUTH_OPEN: /* Check the status code of the response */ + switch(auth->status) { case WLAN_STATUS_SUCCESS: /* Update the status to Authenticated (LOCK?) */ - aq->net->flags |= NETWORK_IS_AUTHORIZED; + aq->net->flags &= ~IEEE80211_AUTHENTICATING; + aq->net->flags |= NETWORK_IS_AUTHENTICATED; /* Send event */ + printkl(KERN_NOTICE PFX "Open Authentication completed with %02x:%02x:%02x:%02x:%02x:%02x\n", + aq->net->bssid[0], aq->net->bssid[1], aq->net->bssid[2], + aq->net->bssid[3], aq->net->bssid[4], aq->net->bssid[5]); ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_AUTHENTICATED); break; default: - /* ERROR */ - /* FIXME deal with not authenticated reasons */ + printkl(KERN_NOTICE PFX "Open Authentication with %02x:%02x:%02x:%02x:%02x:%02x failed, error code: %i\n", + aq->net->bssid[0], aq->net->bssid[1], aq->net->bssid[2], + aq->net->bssid[3], aq->net->bssid[4], aq->net->bssid[5], + auth->status); + aq->net->flags &= ~IEEE80211_AUTHENTICATED; + aq->net->flags |= ~IEEE80211_AUTHENTICATING; + /* Count the error? */ break; } goto free_aq; diff -r 7e98632fd195 -r a4cbba212036 ieee80211softmac_io.c --- a/ieee80211softmac_io.c Wed Nov 30 14:06:57 2005 +++ b/ieee80211softmac_io.c Wed Nov 30 14:15:25 2005 @@ -104,7 +104,7 @@ */ void ieee80211softmac_hdr_2addr(struct ieee80211softmac_device *mac, - struct ieee80211_hdr_3addr *header, u32 type, u8 *dest) + struct ieee80211_hdr_2addr *header, u32 type, u8 *dest) { /* Fill in the frame control flags */ header->frame_ctl = type; @@ -134,7 +134,7 @@ struct ieee80211_hdr_3addr *header, u32 type, u8 *dest, u8 *bssid) { /* This is common with 2addr, so use that instead */ - ieee80211softmac_add_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 */ if(bssid == NULL) @@ -409,7 +409,7 @@ /* Allocate Packet */ pkt = kmalloc(IEEE80211_2ADDR_LEN, GFP_ATOMIC); header_2addr = (struct ieee80211_hdr_2addr *)pkt; - ieee80211softmac_add_hdr_2addr(mac, header_2addr, type, net->bssid); + ieee80211softmac_hdr_2addr(mac, header_2addr, type, net->bssid); pkt_size = IEEE80211_2ADDR_LEN; break; default: diff -r 7e98632fd195 -r a4cbba212036 net/ieee80211softmac.h --- a/net/ieee80211softmac.h Wed Nov 30 14:06:57 2005 +++ b/net/ieee80211softmac.h Wed Nov 30 14:15:25 2005 @@ -166,10 +166,9 @@ /* NOTE: * These apply to the ieee80211_network->flags field * If additional flags are added to ieee80211, we'll have a problem - * FIXME: these should be named AUTHENTICATING/AUTHENTICATED? - */ -#define NETWORK_IS_AUTHORIZING (1<<6) -#define NETWORK_IS_AUTHORIZED (1<<7) + */ +#define NETWORK_IS_AUTHENTICATING (1<<6) +#define NETWORK_IS_AUTHENTICATED (1<<7) extern void ieee80211softmac_scan_finished(struct ieee80211softmac_device *sm);