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