Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/linville/wireless-next into for-davem

Conflicts:
	drivers/net/wireless/ath/ath9k/hw.c
  • Loading branch information
linvjw committed Mar 16, 2012
2 parents d5ddb4a + 3775265 commit 01a2829
Show file tree
Hide file tree
Showing 133 changed files with 4,047 additions and 3,621 deletions.
99 changes: 99 additions & 0 deletions Documentation/networking/mac80211-auth-assoc-deauth.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#
# This outlines the Linux authentication/association and
# deauthentication/disassociation flows.
#
# This can be converted into a diagram using the service
# at http://www.websequencediagrams.com/
#

participant userspace
participant mac80211
participant driver

alt authentication needed (not FT)
userspace->mac80211: authenticate

alt authenticated/authenticating already
mac80211->driver: sta_state(AP, not-exists)
mac80211->driver: bss_info_changed(clear BSSID)
else associated
note over mac80211,driver
like deauth/disassoc, without sending the
BA session stop & deauth/disassoc frames
end note
end

mac80211->driver: config(channel, non-HT)
mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
mac80211->driver: sta_state(AP, exists)

alt no probe request data known
mac80211->driver: TX directed probe request
driver->mac80211: RX probe response
end

mac80211->driver: TX auth frame
driver->mac80211: RX auth frame

alt WEP shared key auth
mac80211->driver: TX auth frame
driver->mac80211: RX auth frame
end

mac80211->driver: sta_state(AP, authenticated)
mac80211->userspace: RX auth frame

end

userspace->mac80211: associate
alt authenticated or associated
note over mac80211,driver: cleanup like for authenticate
end

alt not previously authenticated (FT)
mac80211->driver: config(channel, non-HT)
mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
mac80211->driver: sta_state(AP, exists)
mac80211->driver: sta_state(AP, authenticated)
end
mac80211->driver: TX assoc
driver->mac80211: RX assoc response
note over mac80211: init rate control
mac80211->driver: sta_state(AP, associated)

alt not using WPA
mac80211->driver: sta_state(AP, authorized)
end

mac80211->driver: set up QoS parameters

alt is HT channel
mac80211->driver: config(channel, HT params)
end

mac80211->driver: bss_info_changed(QoS, HT, associated with AID)
mac80211->userspace: associated

note left of userspace: associated now

alt using WPA
note over userspace
do 4-way-handshake
(data frames)
end note
userspace->mac80211: authorized
mac80211->driver: sta_state(AP, authorized)
end

userspace->mac80211: deauthenticate/disassociate
mac80211->driver: stop BA sessions
mac80211->driver: TX deauth/disassoc
mac80211->driver: flush frames
mac80211->driver: sta_state(AP,associated)
mac80211->driver: sta_state(AP,authenticated)
mac80211->driver: sta_state(AP,exists)
mac80211->driver: sta_state(AP,not-exists)
mac80211->driver: turn off powersave
mac80211->driver: bss_info_changed(clear BSSID, not associated, no QoS, ...)
mac80211->driver: config(non-HT channel type)
mac80211->userspace: disconnected
26 changes: 11 additions & 15 deletions drivers/net/wireless/ath/ath.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,28 +174,24 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry);
void ath_hw_cycle_counters_update(struct ath_common *common);
int32_t ath_hw_get_listen_time(struct ath_common *common);

extern __printf(2, 3) void ath_printk(const char *level, const char *fmt, ...);

#define _ath_printk(level, common, fmt, ...) \
do { \
__always_unused struct ath_common *unused = common; \
ath_printk(level, fmt, ##__VA_ARGS__); \
} while (0)
__printf(3, 4)
void ath_printk(const char *level, const struct ath_common *common,
const char *fmt, ...);

#define ath_emerg(common, fmt, ...) \
_ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__)
ath_printk(KERN_EMERG, common, fmt, ##__VA_ARGS__)
#define ath_alert(common, fmt, ...) \
_ath_printk(KERN_ALERT, common, fmt, ##__VA_ARGS__)
ath_printk(KERN_ALERT, common, fmt, ##__VA_ARGS__)
#define ath_crit(common, fmt, ...) \
_ath_printk(KERN_CRIT, common, fmt, ##__VA_ARGS__)
ath_printk(KERN_CRIT, common, fmt, ##__VA_ARGS__)
#define ath_err(common, fmt, ...) \
_ath_printk(KERN_ERR, common, fmt, ##__VA_ARGS__)
ath_printk(KERN_ERR, common, fmt, ##__VA_ARGS__)
#define ath_warn(common, fmt, ...) \
_ath_printk(KERN_WARNING, common, fmt, ##__VA_ARGS__)
ath_printk(KERN_WARNING, common, fmt, ##__VA_ARGS__)
#define ath_notice(common, fmt, ...) \
_ath_printk(KERN_NOTICE, common, fmt, ##__VA_ARGS__)
ath_printk(KERN_NOTICE, common, fmt, ##__VA_ARGS__)
#define ath_info(common, fmt, ...) \
_ath_printk(KERN_INFO, common, fmt, ##__VA_ARGS__)
ath_printk(KERN_INFO, common, fmt, ##__VA_ARGS__)

/**
* enum ath_debug_level - atheros wireless debug level
Expand Down Expand Up @@ -256,7 +252,7 @@ enum ATH_DEBUG {
#define ath_dbg(common, dbg_mask, fmt, ...) \
do { \
if ((common)->debug_mask & ATH_DBG_##dbg_mask) \
_ath_printk(KERN_DEBUG, common, fmt, ##__VA_ARGS__); \
ath_printk(KERN_DEBUG, common, fmt, ##__VA_ARGS__); \
} while (0)

#define ATH_DBG_WARN(foo, arg...) WARN(foo, arg)
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/ath6kl/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#------------------------------------------------------------------------------
# Copyright (c) 2004-2010 Atheros Communications Inc.
# Copyright (c) 2004-2011 Atheros Communications Inc.
# Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
# All rights reserved.
#
#
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/wireless/ath/ath6kl/bmi.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2004-2011 Atheros Communications Inc.
* Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -105,7 +106,7 @@ int ath6kl_bmi_get_target_info(struct ath6kl *ar,
}

ath6kl_dbg(ATH6KL_DBG_BMI, "target info (ver: 0x%x type: 0x%x)\n",
targ_info->version, targ_info->type);
targ_info->version, targ_info->type);

return 0;
}
Expand Down Expand Up @@ -192,7 +193,7 @@ int ath6kl_bmi_write(struct ath6kl *ar, u32 addr, u8 *buf, u32 len)
memset(ar->bmi.cmd_buf, 0, ar->bmi.max_data_size + header);

ath6kl_dbg(ATH6KL_DBG_BMI,
"bmi write memory: addr: 0x%x, len: %d\n", addr, len);
"bmi write memory: addr: 0x%x, len: %d\n", addr, len);

len_remain = len;
while (len_remain) {
Expand Down Expand Up @@ -434,7 +435,7 @@ int ath6kl_bmi_lz_data(struct ath6kl *ar, u8 *buf, u32 len)
memcpy(&(ar->bmi.cmd_buf[offset]), &tx_len, sizeof(tx_len));
offset += sizeof(tx_len);
memcpy(&(ar->bmi.cmd_buf[offset]), &buf[len - len_remain],
tx_len);
tx_len);
offset += tx_len;

ret = ath6kl_hif_bmi_write(ar, ar->bmi.cmd_buf, offset);
Expand Down
24 changes: 24 additions & 0 deletions drivers/net/wireless/ath/ath6kl/bmi.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2004-2011 Atheros Communications Inc.
* Copyright (c) 2011 Qualcomm Atheros, Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -222,6 +223,29 @@ struct ath6kl_bmi_target_info {
__le32 type; /* target type */
} __packed;

#define ath6kl_bmi_write_hi32(ar, item, val) \
({ \
u32 addr; \
__le32 v; \
\
addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
v = cpu_to_le32(val); \
ath6kl_bmi_write(ar, addr, (u8 *) &v, sizeof(v)); \
})

#define ath6kl_bmi_read_hi32(ar, item, val) \
({ \
u32 addr, *check_type = val; \
__le32 tmp; \
int ret; \
\
(void) (check_type == val); \
addr = ath6kl_get_hi_item_addr(ar, HI_ITEM(item)); \
ret = ath6kl_bmi_read(ar, addr, (u8 *) &tmp, 4); \
*val = le32_to_cpu(tmp); \
ret; \
})

int ath6kl_bmi_init(struct ath6kl *ar);
void ath6kl_bmi_cleanup(struct ath6kl *ar);
void ath6kl_bmi_reset(struct ath6kl *ar);
Expand Down
Loading

0 comments on commit 01a2829

Please sign in to comment.