| Johannes Berg | 3cd7920 | 2012-03-09 17:25:33 +0100 | [diff] [blame] | 1 | # | 
|  | 2 | # This outlines the Linux authentication/association and | 
|  | 3 | # deauthentication/disassociation flows. | 
|  | 4 | # | 
|  | 5 | # This can be converted into a diagram using the service | 
|  | 6 | # at http://www.websequencediagrams.com/ | 
|  | 7 | # | 
|  | 8 |  | 
|  | 9 | participant userspace | 
|  | 10 | participant mac80211 | 
|  | 11 | participant driver | 
|  | 12 |  | 
|  | 13 | alt authentication needed (not FT) | 
|  | 14 | userspace->mac80211: authenticate | 
|  | 15 |  | 
|  | 16 | alt authenticated/authenticating already | 
| Yegor Yefremov | 6d430c2 | 2012-03-13 10:57:51 +0100 | [diff] [blame] | 17 | mac80211->driver: sta_state(AP, not-exists) | 
| Johannes Berg | 3cd7920 | 2012-03-09 17:25:33 +0100 | [diff] [blame] | 18 | mac80211->driver: bss_info_changed(clear BSSID) | 
|  | 19 | else associated | 
|  | 20 | note over mac80211,driver | 
|  | 21 | like deauth/disassoc, without sending the | 
|  | 22 | BA session stop & deauth/disassoc frames | 
|  | 23 | end note | 
|  | 24 | end | 
|  | 25 |  | 
|  | 26 | mac80211->driver: config(channel, non-HT) | 
|  | 27 | mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap) | 
|  | 28 | mac80211->driver: sta_state(AP, exists) | 
|  | 29 |  | 
|  | 30 | alt no probe request data known | 
|  | 31 | mac80211->driver: TX directed probe request | 
|  | 32 | driver->mac80211: RX probe response | 
|  | 33 | end | 
|  | 34 |  | 
|  | 35 | mac80211->driver: TX auth frame | 
|  | 36 | driver->mac80211: RX auth frame | 
|  | 37 |  | 
|  | 38 | alt WEP shared key auth | 
|  | 39 | mac80211->driver: TX auth frame | 
|  | 40 | driver->mac80211: RX auth frame | 
|  | 41 | end | 
|  | 42 |  | 
|  | 43 | mac80211->driver: sta_state(AP, authenticated) | 
|  | 44 | mac80211->userspace: RX auth frame | 
|  | 45 |  | 
|  | 46 | end | 
|  | 47 |  | 
|  | 48 | userspace->mac80211: associate | 
|  | 49 | alt authenticated or associated | 
|  | 50 | note over mac80211,driver: cleanup like for authenticate | 
|  | 51 | end | 
|  | 52 |  | 
|  | 53 | alt not previously authenticated (FT) | 
|  | 54 | mac80211->driver: config(channel, non-HT) | 
|  | 55 | mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap) | 
|  | 56 | mac80211->driver: sta_state(AP, exists) | 
|  | 57 | mac80211->driver: sta_state(AP, authenticated) | 
|  | 58 | end | 
|  | 59 | mac80211->driver: TX assoc | 
|  | 60 | driver->mac80211: RX assoc response | 
|  | 61 | note over mac80211: init rate control | 
|  | 62 | mac80211->driver: sta_state(AP, associated) | 
|  | 63 |  | 
|  | 64 | alt not using WPA | 
|  | 65 | mac80211->driver: sta_state(AP, authorized) | 
|  | 66 | end | 
|  | 67 |  | 
|  | 68 | mac80211->driver: set up QoS parameters | 
|  | 69 |  | 
|  | 70 | alt is HT channel | 
|  | 71 | mac80211->driver: config(channel, HT params) | 
|  | 72 | end | 
|  | 73 |  | 
|  | 74 | mac80211->driver: bss_info_changed(QoS, HT, associated with AID) | 
|  | 75 | mac80211->userspace: associated | 
|  | 76 |  | 
|  | 77 | note left of userspace: associated now | 
|  | 78 |  | 
|  | 79 | alt using WPA | 
|  | 80 | note over userspace | 
|  | 81 | do 4-way-handshake | 
|  | 82 | (data frames) | 
|  | 83 | end note | 
|  | 84 | userspace->mac80211: authorized | 
|  | 85 | mac80211->driver: sta_state(AP, authorized) | 
|  | 86 | end | 
|  | 87 |  | 
|  | 88 | userspace->mac80211: deauthenticate/disassociate | 
|  | 89 | mac80211->driver: stop BA sessions | 
|  | 90 | mac80211->driver: TX deauth/disassoc | 
|  | 91 | mac80211->driver: flush frames | 
|  | 92 | mac80211->driver: sta_state(AP,associated) | 
|  | 93 | mac80211->driver: sta_state(AP,authenticated) | 
| Yegor Yefremov | 6d430c2 | 2012-03-13 10:57:51 +0100 | [diff] [blame] | 94 | mac80211->driver: sta_state(AP,exists) | 
|  | 95 | mac80211->driver: sta_state(AP,not-exists) | 
| Johannes Berg | 3cd7920 | 2012-03-09 17:25:33 +0100 | [diff] [blame] | 96 | mac80211->driver: turn off powersave | 
|  | 97 | mac80211->driver: bss_info_changed(clear BSSID, not associated, no QoS, ...) | 
|  | 98 | mac80211->driver: config(non-HT channel type) | 
|  | 99 | mac80211->userspace: disconnected |