0001 #
0002 # This outlines the Linux authentication/association and
0003 # deauthentication/disassociation flows.
0004 #
0005 # This can be converted into a diagram using the service
0006 # at http://www.websequencediagrams.com/
0007 #
0008
0009 participant userspace
0010 participant mac80211
0011 participant driver
0012
0013 alt authentication needed (not FT)
0014 userspace->mac80211: authenticate
0015
0016 alt authenticated/authenticating already
0017 mac80211->driver: sta_state(AP, not-exists)
0018 mac80211->driver: bss_info_changed(clear BSSID)
0019 else associated
0020 note over mac80211,driver
0021 like deauth/disassoc, without sending the
0022 BA session stop & deauth/disassoc frames
0023 end note
0024 end
0025
0026 mac80211->driver: config(channel, channel type)
0027 mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
0028 mac80211->driver: sta_state(AP, exists)
0029
0030 alt no probe request data known
0031 mac80211->driver: TX directed probe request
0032 driver->mac80211: RX probe response
0033 end
0034
0035 mac80211->driver: TX auth frame
0036 driver->mac80211: RX auth frame
0037
0038 alt WEP shared key auth
0039 mac80211->driver: TX auth frame
0040 driver->mac80211: RX auth frame
0041 end
0042
0043 mac80211->driver: sta_state(AP, authenticated)
0044 mac80211->userspace: RX auth frame
0045
0046 end
0047
0048 userspace->mac80211: associate
0049 alt authenticated or associated
0050 note over mac80211,driver: cleanup like for authenticate
0051 end
0052
0053 alt not previously authenticated (FT)
0054 mac80211->driver: config(channel, channel type)
0055 mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
0056 mac80211->driver: sta_state(AP, exists)
0057 mac80211->driver: sta_state(AP, authenticated)
0058 end
0059 mac80211->driver: TX assoc
0060 driver->mac80211: RX assoc response
0061 note over mac80211: init rate control
0062 mac80211->driver: sta_state(AP, associated)
0063
0064 alt not using WPA
0065 mac80211->driver: sta_state(AP, authorized)
0066 end
0067
0068 mac80211->driver: set up QoS parameters
0069
0070 mac80211->driver: bss_info_changed(QoS, HT, associated with AID)
0071 mac80211->userspace: associated
0072
0073 note left of userspace: associated now
0074
0075 alt using WPA
0076 note over userspace
0077 do 4-way-handshake
0078 (data frames)
0079 end note
0080 userspace->mac80211: authorized
0081 mac80211->driver: sta_state(AP, authorized)
0082 end
0083
0084 userspace->mac80211: deauthenticate/disassociate
0085 mac80211->driver: stop BA sessions
0086 mac80211->driver: TX deauth/disassoc
0087 mac80211->driver: flush frames
0088 mac80211->driver: sta_state(AP,associated)
0089 mac80211->driver: sta_state(AP,authenticated)
0090 mac80211->driver: sta_state(AP,exists)
0091 mac80211->driver: sta_state(AP,not-exists)
0092 mac80211->driver: turn off powersave
0093 mac80211->driver: bss_info_changed(clear BSSID, not associated, no QoS, ...)
0094 mac80211->driver: config(channel type to non-HT)
0095 mac80211->userspace: disconnected