diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 18:02:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:23 -0400 |
commit | 17741cdc264e4d768167766a252210e201c1519a (patch) | |
tree | 72c0e697af29a40c03bce002b529c3951d34a3b7 /include/net/mac80211.h | |
parent | 8aa21e6fd703cb3fed66ac07dcbcb861f00cf6d6 (diff) |
mac80211: share STA information with driver
This patch changes mac80211 to share some more data about
stations with drivers. Should help iwlwifi and ath9k when
they get around to updating, and might also help with
implementing rate control algorithms without internals.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 7f5ea55e00f5..5a6a029da4da 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -300,6 +300,9 @@ enum mac80211_tx_control_flags { | |||
300 | * (2) driver internal use (if applicable) | 300 | * (2) driver internal use (if applicable) |
301 | * (3) TX status information - driver tells mac80211 what happened | 301 | * (3) TX status information - driver tells mac80211 what happened |
302 | * | 302 | * |
303 | * The TX control's sta pointer is only valid during the ->tx call, | ||
304 | * it may be NULL. | ||
305 | * | ||
303 | * @flags: transmit info flags, defined above | 306 | * @flags: transmit info flags, defined above |
304 | * @band: TBD | 307 | * @band: TBD |
305 | * @tx_rate_idx: TBD | 308 | * @tx_rate_idx: TBD |
@@ -329,8 +332,8 @@ struct ieee80211_tx_info { | |||
329 | struct { | 332 | struct { |
330 | struct ieee80211_vif *vif; | 333 | struct ieee80211_vif *vif; |
331 | struct ieee80211_key_conf *hw_key; | 334 | struct ieee80211_key_conf *hw_key; |
335 | struct ieee80211_sta *sta; | ||
332 | unsigned long jiffies; | 336 | unsigned long jiffies; |
333 | u16 aid; | ||
334 | s8 rts_cts_rate_idx, alt_retry_rate_idx; | 337 | s8 rts_cts_rate_idx, alt_retry_rate_idx; |
335 | u8 retry_limit; | 338 | u8 retry_limit; |
336 | u8 icv_len; | 339 | u8 icv_len; |
@@ -652,6 +655,29 @@ enum set_key_cmd { | |||
652 | }; | 655 | }; |
653 | 656 | ||
654 | /** | 657 | /** |
658 | * struct ieee80211_sta - station table entry | ||
659 | * | ||
660 | * A station table entry represents a station we are possibly | ||
661 | * communicating with. Since stations are RCU-managed in | ||
662 | * mac80211, any ieee80211_sta pointer you get access to must | ||
663 | * either be protected by rcu_read_lock() explicitly or implicitly, | ||
664 | * or you must take good care to not use such a pointer after a | ||
665 | * call to your sta_notify callback that removed it. | ||
666 | * | ||
667 | * @addr: MAC address | ||
668 | * @aid: AID we assigned to the station if we're an AP | ||
669 | * @drv_priv: data area for driver use, will always be aligned to | ||
670 | * sizeof(void *), size is determined in hw information. | ||
671 | */ | ||
672 | struct ieee80211_sta { | ||
673 | u8 addr[ETH_ALEN]; | ||
674 | u16 aid; | ||
675 | |||
676 | /* must be last */ | ||
677 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | ||
678 | }; | ||
679 | |||
680 | /** | ||
655 | * enum sta_notify_cmd - sta notify command | 681 | * enum sta_notify_cmd - sta notify command |
656 | * | 682 | * |
657 | * Used with the sta_notify() callback in &struct ieee80211_ops, this | 683 | * Used with the sta_notify() callback in &struct ieee80211_ops, this |
@@ -795,6 +821,8 @@ enum ieee80211_hw_flags { | |||
795 | * | 821 | * |
796 | * @vif_data_size: size (in bytes) of the drv_priv data area | 822 | * @vif_data_size: size (in bytes) of the drv_priv data area |
797 | * within &struct ieee80211_vif. | 823 | * within &struct ieee80211_vif. |
824 | * @sta_data_size: size (in bytes) of the drv_priv data area | ||
825 | * within &struct ieee80211_sta. | ||
798 | */ | 826 | */ |
799 | struct ieee80211_hw { | 827 | struct ieee80211_hw { |
800 | struct ieee80211_conf conf; | 828 | struct ieee80211_conf conf; |
@@ -806,6 +834,7 @@ struct ieee80211_hw { | |||
806 | unsigned int extra_tx_headroom; | 834 | unsigned int extra_tx_headroom; |
807 | int channel_change_time; | 835 | int channel_change_time; |
808 | int vif_data_size; | 836 | int vif_data_size; |
837 | int sta_data_size; | ||
809 | u16 queues; | 838 | u16 queues; |
810 | u16 ampdu_queues; | 839 | u16 ampdu_queues; |
811 | u16 max_listen_interval; | 840 | u16 max_listen_interval; |
@@ -1089,7 +1118,7 @@ enum ieee80211_ampdu_mlme_action { | |||
1089 | * This callback must be implemented and atomic. | 1118 | * This callback must be implemented and atomic. |
1090 | * | 1119 | * |
1091 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit | 1120 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit |
1092 | * must be set or cleared for a given AID. Must be atomic. | 1121 | * must be set or cleared for a given STA. Must be atomic. |
1093 | * | 1122 | * |
1094 | * @set_key: See the section "Hardware crypto acceleration" | 1123 | * @set_key: See the section "Hardware crypto acceleration" |
1095 | * This callback can sleep, and is only called between add_interface | 1124 | * This callback can sleep, and is only called between add_interface |
@@ -1175,7 +1204,8 @@ struct ieee80211_ops { | |||
1175 | unsigned int changed_flags, | 1204 | unsigned int changed_flags, |
1176 | unsigned int *total_flags, | 1205 | unsigned int *total_flags, |
1177 | int mc_count, struct dev_addr_list *mc_list); | 1206 | int mc_count, struct dev_addr_list *mc_list); |
1178 | int (*set_tim)(struct ieee80211_hw *hw, int aid, int set); | 1207 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, |
1208 | bool set); | ||
1179 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 1209 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
1180 | const u8 *local_address, const u8 *address, | 1210 | const u8 *local_address, const u8 *address, |
1181 | struct ieee80211_key_conf *key); | 1211 | struct ieee80211_key_conf *key); |
@@ -1192,7 +1222,7 @@ struct ieee80211_ops { | |||
1192 | int (*set_retry_limit)(struct ieee80211_hw *hw, | 1222 | int (*set_retry_limit)(struct ieee80211_hw *hw, |
1193 | u32 short_retry, u32 long_retr); | 1223 | u32 short_retry, u32 long_retr); |
1194 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1224 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1195 | enum sta_notify_cmd, const u8 *addr); | 1225 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
1196 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, | 1226 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, |
1197 | const struct ieee80211_tx_queue_params *params); | 1227 | const struct ieee80211_tx_queue_params *params); |
1198 | int (*get_tx_stats)(struct ieee80211_hw *hw, | 1228 | int (*get_tx_stats)(struct ieee80211_hw *hw, |
@@ -1202,7 +1232,7 @@ struct ieee80211_ops { | |||
1202 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 1232 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
1203 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1233 | int (*ampdu_action)(struct ieee80211_hw *hw, |
1204 | enum ieee80211_ampdu_mlme_action action, | 1234 | enum ieee80211_ampdu_mlme_action action, |
1205 | const u8 *addr, u16 tid, u16 *ssn); | 1235 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
1206 | }; | 1236 | }; |
1207 | 1237 | ||
1208 | /** | 1238 | /** |
@@ -1752,4 +1782,17 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | |||
1752 | */ | 1782 | */ |
1753 | void ieee80211_notify_mac(struct ieee80211_hw *hw, | 1783 | void ieee80211_notify_mac(struct ieee80211_hw *hw, |
1754 | enum ieee80211_notification_types notif_type); | 1784 | enum ieee80211_notification_types notif_type); |
1785 | |||
1786 | /** | ||
1787 | * ieee80211_find_sta - find a station | ||
1788 | * | ||
1789 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
1790 | * @addr: station's address | ||
1791 | * | ||
1792 | * This function must be called under RCU lock and the | ||
1793 | * resulting pointer is only valid under RCU lock as well. | ||
1794 | */ | ||
1795 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, | ||
1796 | const u8 *addr); | ||
1797 | |||
1755 | #endif /* MAC80211_H */ | 1798 | #endif /* MAC80211_H */ |