aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-01-24 13:38:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:19:32 -0500
commit8318d78a44d49ac1edf2bdec7299de3617c4232e (patch)
treed434634418edd7399737801615d247be06616fdd /net/mac80211/ieee80211_i.h
parent10b6b80145cc93887dd8aab99bfffa375e9add31 (diff)
cfg80211 API for channels/bitrates, mac80211 and driver conversion
This patch creates new cfg80211 wiphy API for channel and bitrate registration and converts mac80211 and drivers to the new API. The old mac80211 API is completely ripped out. All drivers (except ath5k) are updated to the new API, in many cases I expect that optimisations can be done. Along with the regulatory code I've also ripped out the IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED flag, I believe it to be unnecessary if the hardware simply gives us whatever channels it wants to support and we then enable/disable them as required, which is pretty much required for travelling. Additionally, the patch adds proper "basic" rate handling for STA mode interface, AP mode interface will have to have new API added to allow userspace to set the basic rate set, currently it'll be empty... However, the basic rate handling will need to be moved to the BSS conf stuff. I do expect there to be bugs in this, especially wrt. transmit power handling where I'm basically clueless about how it should work. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h63
1 files changed, 13 insertions, 50 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 9d09ba8cc02b..54eea5f24474 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -79,8 +79,7 @@ struct ieee80211_sta_bss {
79 u8 ssid[IEEE80211_MAX_SSID_LEN]; 79 u8 ssid[IEEE80211_MAX_SSID_LEN];
80 size_t ssid_len; 80 size_t ssid_len;
81 u16 capability; /* host byte order */ 81 u16 capability; /* host byte order */
82 int hw_mode; 82 enum ieee80211_band band;
83 int channel;
84 int freq; 83 int freq;
85 int rssi, signal, noise; 84 int rssi, signal, noise;
86 u8 *wpa_ie; 85 u8 *wpa_ie;
@@ -136,13 +135,12 @@ struct ieee80211_txrx_data {
136 union { 135 union {
137 struct { 136 struct {
138 struct ieee80211_tx_control *control; 137 struct ieee80211_tx_control *control;
139 struct ieee80211_hw_mode *mode; 138 struct ieee80211_channel *channel;
140 struct ieee80211_rate *rate; 139 struct ieee80211_rate *rate;
141 /* use this rate (if set) for last fragment; rate can 140 /* use this rate (if set) for last fragment; rate can
142 * be set to lower rate for the first fragments, e.g., 141 * be set to lower rate for the first fragments, e.g.,
143 * when using CTS protection with IEEE 802.11g. */ 142 * when using CTS protection with IEEE 802.11g. */
144 struct ieee80211_rate *last_frag_rate; 143 struct ieee80211_rate *last_frag_rate;
145 int last_frag_hwrate;
146 144
147 /* Extra fragments (in addition to the first fragment 145 /* Extra fragments (in addition to the first fragment
148 * in skb) */ 146 * in skb) */
@@ -151,6 +149,7 @@ struct ieee80211_txrx_data {
151 } tx; 149 } tx;
152 struct { 150 struct {
153 struct ieee80211_rx_status *status; 151 struct ieee80211_rx_status *status;
152 struct ieee80211_rate *rate;
154 int sent_ps_buffered; 153 int sent_ps_buffered;
155 int queue; 154 int queue;
156 int load; 155 int load;
@@ -179,8 +178,6 @@ struct ieee80211_tx_stored_packet {
179 struct sk_buff *skb; 178 struct sk_buff *skb;
180 int num_extra_frag; 179 int num_extra_frag;
181 struct sk_buff **extra_frag; 180 struct sk_buff **extra_frag;
182 int last_frag_rateidx;
183 int last_frag_hwrate;
184 struct ieee80211_rate *last_frag_rate; 181 struct ieee80211_rate *last_frag_rate;
185 unsigned int last_frag_rate_ctrl_probe; 182 unsigned int last_frag_rate_ctrl_probe;
186}; 183};
@@ -283,7 +280,7 @@ struct ieee80211_if_sta {
283 280
284 unsigned long ibss_join_req; 281 unsigned long ibss_join_req;
285 struct sk_buff *probe_resp; /* ProbeResp template for IBSS */ 282 struct sk_buff *probe_resp; /* ProbeResp template for IBSS */
286 u32 supp_rates_bits; 283 u32 supp_rates_bits[IEEE80211_NUM_BANDS];
287 284
288 int wmm_last_param_set; 285 int wmm_last_param_set;
289}; 286};
@@ -293,6 +290,7 @@ struct ieee80211_if_sta {
293#define IEEE80211_SDATA_ALLMULTI BIT(0) 290#define IEEE80211_SDATA_ALLMULTI BIT(0)
294#define IEEE80211_SDATA_PROMISC BIT(1) 291#define IEEE80211_SDATA_PROMISC BIT(1)
295#define IEEE80211_SDATA_USERSPACE_MLME BIT(2) 292#define IEEE80211_SDATA_USERSPACE_MLME BIT(2)
293#define IEEE80211_SDATA_OPERATING_GMODE BIT(3)
296struct ieee80211_sub_if_data { 294struct ieee80211_sub_if_data {
297 struct list_head list; 295 struct list_head list;
298 296
@@ -313,6 +311,11 @@ struct ieee80211_sub_if_data {
313 */ 311 */
314 int ieee802_1x_pac; 312 int ieee802_1x_pac;
315 313
314 /*
315 * basic rates of this AP or the AP we're associated to
316 */
317 u64 basic_rates;
318
316 u16 sequence; 319 u16 sequence;
317 320
318 /* Fragment table for host-based reassembly */ 321 /* Fragment table for host-based reassembly */
@@ -420,9 +423,6 @@ struct ieee80211_local {
420 423
421 const struct ieee80211_ops *ops; 424 const struct ieee80211_ops *ops;
422 425
423 /* List of registered struct ieee80211_hw_mode */
424 struct list_head modes_list;
425
426 struct net_device *mdev; /* wmaster# - "master" 802.11 device */ 426 struct net_device *mdev; /* wmaster# - "master" 802.11 device */
427 int open_count; 427 int open_count;
428 int monitors; 428 int monitors;
@@ -462,11 +462,6 @@ struct ieee80211_local {
462 462
463 struct rate_control_ref *rate_ctrl; 463 struct rate_control_ref *rate_ctrl;
464 464
465 /* Supported and basic rate filters for different modes. These are
466 * pointers to -1 terminated lists and rates in 100 kbps units. */
467 int *supp_rates[NUM_IEEE80211_MODES];
468 int *basic_rates[NUM_IEEE80211_MODES];
469
470 int rts_threshold; 465 int rts_threshold;
471 int fragmentation_threshold; 466 int fragmentation_threshold;
472 int short_retry_limit; /* dot11ShortRetryLimit */ 467 int short_retry_limit; /* dot11ShortRetryLimit */
@@ -488,12 +483,13 @@ struct ieee80211_local {
488 bool sta_sw_scanning; 483 bool sta_sw_scanning;
489 bool sta_hw_scanning; 484 bool sta_hw_scanning;
490 int scan_channel_idx; 485 int scan_channel_idx;
486 enum ieee80211_band scan_band;
487
491 enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state; 488 enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
492 unsigned long last_scan_completed; 489 unsigned long last_scan_completed;
493 struct delayed_work scan_work; 490 struct delayed_work scan_work;
494 struct net_device *scan_dev; 491 struct net_device *scan_dev;
495 struct ieee80211_channel *oper_channel, *scan_channel; 492 struct ieee80211_channel *oper_channel, *scan_channel;
496 struct ieee80211_hw_mode *oper_hw_mode, *scan_hw_mode;
497 u8 scan_ssid[IEEE80211_MAX_SSID_LEN]; 493 u8 scan_ssid[IEEE80211_MAX_SSID_LEN];
498 size_t scan_ssid_len; 494 size_t scan_ssid_len;
499 struct list_head sta_bss_list; 495 struct list_head sta_bss_list;
@@ -562,14 +558,8 @@ struct ieee80211_local {
562 int wifi_wme_noack_test; 558 int wifi_wme_noack_test;
563 unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */ 559 unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
564 560
565 unsigned int enabled_modes; /* bitfield of allowed modes;
566 * (1 << MODE_*) */
567 unsigned int hw_modes; /* bitfield of supported hardware modes;
568 * (1 << MODE_*) */
569
570#ifdef CONFIG_MAC80211_DEBUGFS 561#ifdef CONFIG_MAC80211_DEBUGFS
571 struct local_debugfsdentries { 562 struct local_debugfsdentries {
572 struct dentry *channel;
573 struct dentry *frequency; 563 struct dentry *frequency;
574 struct dentry *antenna_sel_tx; 564 struct dentry *antenna_sel_tx;
575 struct dentry *antenna_sel_rx; 565 struct dentry *antenna_sel_rx;
@@ -579,9 +569,7 @@ struct ieee80211_local {
579 struct dentry *short_retry_limit; 569 struct dentry *short_retry_limit;
580 struct dentry *long_retry_limit; 570 struct dentry *long_retry_limit;
581 struct dentry *total_ps_buffered; 571 struct dentry *total_ps_buffered;
582 struct dentry *mode;
583 struct dentry *wep_iv; 572 struct dentry *wep_iv;
584 struct dentry *modes;
585 struct dentry *statistics; 573 struct dentry *statistics;
586 struct local_debugfsdentries_statsdentries { 574 struct local_debugfsdentries_statsdentries {
587 struct dentry *transmitted_fragment_count; 575 struct dentry *transmitted_fragment_count;
@@ -692,23 +680,6 @@ static inline void bss_tim_clear(struct ieee80211_local *local,
692 read_unlock_bh(&local->sta_lock); 680 read_unlock_bh(&local->sta_lock);
693} 681}
694 682
695/**
696 * ieee80211_is_erp_rate - Check if a rate is an ERP rate
697 * @phymode: The PHY-mode for this rate (MODE_IEEE80211...)
698 * @rate: Transmission rate to check, in 100 kbps
699 *
700 * Check if a given rate is an Extended Rate PHY (ERP) rate.
701 */
702static inline int ieee80211_is_erp_rate(int phymode, int rate)
703{
704 if (phymode == MODE_IEEE80211G) {
705 if (rate != 10 && rate != 20 &&
706 rate != 55 && rate != 110)
707 return 1;
708 }
709 return 0;
710}
711
712static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr) 683static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
713{ 684{
714 return compare_ether_addr(raddr, addr) == 0 || 685 return compare_ether_addr(raddr, addr) == 0 ||
@@ -720,13 +691,9 @@ static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
720int ieee80211_hw_config(struct ieee80211_local *local); 691int ieee80211_hw_config(struct ieee80211_local *local);
721int ieee80211_if_config(struct net_device *dev); 692int ieee80211_if_config(struct net_device *dev);
722int ieee80211_if_config_beacon(struct net_device *dev); 693int ieee80211_if_config_beacon(struct net_device *dev);
723void ieee80211_prepare_rates(struct ieee80211_local *local,
724 struct ieee80211_hw_mode *mode);
725void ieee80211_tx_set_iswep(struct ieee80211_txrx_data *tx); 694void ieee80211_tx_set_iswep(struct ieee80211_txrx_data *tx);
726int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr); 695int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr);
727void ieee80211_if_setup(struct net_device *dev); 696void ieee80211_if_setup(struct net_device *dev);
728struct ieee80211_rate *ieee80211_get_rate(struct ieee80211_local *local,
729 int phymode, int hwrate);
730int ieee80211_hw_config_ht(struct ieee80211_local *local, int enable_ht, 697int ieee80211_hw_config_ht(struct ieee80211_local *local, int enable_ht,
731 struct ieee80211_ht_info *req_ht_cap, 698 struct ieee80211_ht_info *req_ht_cap,
732 struct ieee80211_ht_bss_info *req_bss_cap); 699 struct ieee80211_ht_bss_info *req_bss_cap);
@@ -757,7 +724,7 @@ extern const struct iw_handler_def ieee80211_iw_handler_def;
757/* ieee80211_ioctl.c */ 724/* ieee80211_ioctl.c */
758int ieee80211_set_compression(struct ieee80211_local *local, 725int ieee80211_set_compression(struct ieee80211_local *local,
759 struct net_device *dev, struct sta_info *sta); 726 struct net_device *dev, struct sta_info *sta);
760int ieee80211_set_channel(struct ieee80211_local *local, int channel, int freq); 727int ieee80211_set_freq(struct ieee80211_local *local, int freq);
761/* ieee80211_sta.c */ 728/* ieee80211_sta.c */
762void ieee80211_sta_timer(unsigned long data); 729void ieee80211_sta_timer(unsigned long data);
763void ieee80211_sta_work(struct work_struct *work); 730void ieee80211_sta_work(struct work_struct *work);
@@ -810,10 +777,6 @@ int ieee80211_if_remove(struct net_device *dev, const char *name, int id);
810void ieee80211_if_free(struct net_device *dev); 777void ieee80211_if_free(struct net_device *dev);
811void ieee80211_if_sdata_init(struct ieee80211_sub_if_data *sdata); 778void ieee80211_if_sdata_init(struct ieee80211_sub_if_data *sdata);
812 779
813/* regdomain.c */
814void ieee80211_regdomain_init(void);
815void ieee80211_set_default_regdomain(struct ieee80211_hw_mode *mode);
816
817/* rx handling */ 780/* rx handling */
818extern ieee80211_rx_handler ieee80211_rx_handlers[]; 781extern ieee80211_rx_handler ieee80211_rx_handlers[];
819 782