Skip to contentSkip to conversation

the long-awaited bitrate/channel API update

PATCH In review Johannes Berg 3 participants 9 messages Jan 24, 2008 – Jan 29, 2008

Subsystems (4)
lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

cover the long-awaited bitrate/channel API update

Having just rebased my patch on top of the new fixes Reinette posted (thanks!) that were previously a show-stopper for iwlwifi, here's now finally the submission of these two patches.

There will undoubtedly be bugs in this as I don't have the necessary hardware to test, and I'm sure people will disagree with the regulatory control change. I think we all agree, however, that the new API is better and that the regulatory control configuration should be within the new API. I will continue to work in this area but I hope that with this patch in other people can help out as well, both fixing bugs and fixing the small regulatory control regressions.

Since I know 1/2 won't make it to the list, here's the URL:
http://johannes.sipsolutions.net/patches/kernel/all/2008-01-24-18%3a41/018-cfg80211-channel-and-bitrate-api.patch

johannes

author maintainer
#1 lore raw

PATCH 1/2 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.

---
Changes:
v1..v3: <untracked>
v4: fix bugs in iwl4965
v5: rebase on top of new Intel patches
v6: rebase on top of new Intel patches (again)

 drivers/net/wireless/adm8211.c               |   80 ++--
 drivers/net/wireless/adm8211.h               |   65 ---
 drivers/net/wireless/b43/b43.h               |    5 
 drivers/net/wireless/b43/main.c              |  119 +++----
 drivers/net/wireless/b43/sysfs.c             |   89 -----
 drivers/net/wireless/b43/xmit.c              |   81 ++--
 drivers/net/wireless/b43legacy/b43legacy.h   |    4 
 drivers/net/wireless/b43legacy/main.c        |  161 ++++-----
 drivers/net/wireless/b43legacy/xmit.c        |   64 +--
 drivers/net/wireless/iwlwifi/iwl-3945-rs.c   |   80 ++--
 drivers/net/wireless/iwlwifi/iwl-3945.c      |   35 --
 drivers/net/wireless/iwlwifi/iwl-3945.h      |   13 
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c   |   82 ++--
 drivers/net/wireless/iwlwifi/iwl-4965.c      |   43 +-
 drivers/net/wireless/iwlwifi/iwl-4965.h      |   16 
 drivers/net/wireless/iwlwifi/iwl3945-base.c  |  445 +++++++--------------------
 drivers/net/wireless/iwlwifi/iwl4965-base.c  |  438 ++++++--------------------
 drivers/net/wireless/p54.h                   |    4 
 drivers/net/wireless/p54common.c             |   74 ++--
 drivers/net/wireless/p54common.h             |   75 ----
 drivers/net/wireless/rt2x00/rt2x00.h         |   11 
 drivers/net/wireless/rt2x00/rt2x00config.c   |   33 --
 drivers/net/wireless/rt2x00/rt2x00dev.c      |  151 +++------
 drivers/net/wireless/rt2x00/rt61pci.c        |   23 -
 drivers/net/wireless/rt2x00/rt73usb.c        |   23 -
 drivers/net/wireless/rtl8180.h               |    2 
 drivers/net/wireless/rtl8180_dev.c           |   93 +++--
 drivers/net/wireless/rtl8180_grf5101.c       |    5 
 drivers/net/wireless/rtl8180_max2820.c       |    5 
 drivers/net/wireless/rtl8180_rtl8225.c       |   15 
 drivers/net/wireless/rtl8180_sa2400.c        |    5 
 drivers/net/wireless/rtl8187.h               |    2 
 drivers/net/wireless/rtl8187_dev.c           |   82 +++-
 drivers/net/wireless/rtl8187_rtl8225.c       |   15 
 drivers/net/wireless/rtl818x.h               |   70 ----
 drivers/net/wireless/zd1211rw/zd_chip.c      |   15 
 drivers/net/wireless/zd1211rw/zd_ieee80211.c |   11 
 drivers/net/wireless/zd1211rw/zd_mac.c       |  168 ++++------
 drivers/net/wireless/zd1211rw/zd_mac.h       |    2 
 include/net/mac80211.h                       |  197 ++---------
 include/net/wireless.h                       |  168 ++++++++++
 net/mac80211/Makefile                        |    1 
 net/mac80211/cfg.c                           |   11 
 net/mac80211/debugfs.c                       |   47 --
 net/mac80211/debugfs_sta.c                   |   18 -
 net/mac80211/ieee80211.c                     |  112 ++----
 net/mac80211/ieee80211_i.h                   |   63 ---
 net/mac80211/ieee80211_iface.c               |    2 
 net/mac80211/ieee80211_ioctl.c               |  127 ++++---
 net/mac80211/ieee80211_rate.c                |   15 
 net/mac80211/ieee80211_rate.h                |   28 -
 net/mac80211/ieee80211_sta.c                 |  384 ++++++++++++-----------
 net/mac80211/rc80211_pid_algo.c              |   76 ++--
 net/mac80211/rc80211_simple.c                |   66 +---
 net/mac80211/regdomain.c                     |  152 ---------
 net/mac80211/rx.c                            |   82 ++--
 net/mac80211/sta_info.c                      |   24 -
 net/mac80211/sta_info.h                      |   10 
 net/mac80211/tx.c                            |  162 ++++++---
 net/mac80211/util.c                          |  142 +-------
 net/wireless/Makefile                        |    2 
 net/wireless/core.c                          |   41 ++
 net/wireless/core.h                          |    3 
 net/wireless/reg.c                           |  153 +++++++++
 net/wireless/util.c                          |   98 +++++
 65 files changed, 2115 insertions(+), 2773 deletions(-)
include/net/mac80211.h +34 -163
@@ -69,95 +69,6 @@
  * not do so then mac80211 may add this under certain circumstances.
  */
 
-#define IEEE80211_CHAN_W_SCAN 0x00000001
-#define IEEE80211_CHAN_W_ACTIVE_SCAN 0x00000002
-#define IEEE80211_CHAN_W_IBSS 0x00000004
-
-/* Channel information structure. Low-level driver is expected to fill in chan,
- * freq, and val fields. Other fields will be filled in by 80211.o based on
- * hostapd information and low-level driver does not need to use them. The
- * limits for each channel will be provided in 'struct ieee80211_conf' when
- * configuring the low-level driver with hw->config callback. If a device has
- * a default regulatory domain, IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED
- * can be set to let the driver configure all fields */
-struct ieee80211_channel {
-	short chan; /* channel number (IEEE 802.11) */
-	short freq; /* frequency in MHz */
-	int val; /* hw specific value for the channel */
-	int flag; /* flag for hostapd use (IEEE80211_CHAN_*) */
-	unsigned char power_level;
-	unsigned char antenna_max;
-};
-
-#define IEEE80211_RATE_ERP 0x00000001
-#define IEEE80211_RATE_BASIC 0x00000002
-#define IEEE80211_RATE_PREAMBLE2 0x00000004
-#define IEEE80211_RATE_SUPPORTED 0x00000010
-#define IEEE80211_RATE_OFDM 0x00000020
-#define IEEE80211_RATE_CCK 0x00000040
-#define IEEE80211_RATE_MANDATORY 0x00000100
-
-#define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2)
-#define IEEE80211_RATE_MODULATION(f) \
-	(f & (IEEE80211_RATE_CCK | IEEE80211_RATE_OFDM))
-
-/* Low-level driver should set PREAMBLE2, OFDM and CCK flags.
- * BASIC, SUPPORTED, ERP, and MANDATORY flags are set in 80211.o based on the
- * configuration. */
-struct ieee80211_rate {
-	int rate; /* rate in 100 kbps */
-	int val; /* hw specific value for the rate */
-	int flags; /* IEEE80211_RATE_ flags */
-	int val2; /* hw specific value for the rate when using short preamble
-		   * (only when IEEE80211_RATE_PREAMBLE2 flag is set, i.e., for
-		   * 2, 5.5, and 11 Mbps) */
-	signed char min_rssi_ack;
-	unsigned char min_rssi_ack_delta;
-
-	/* following fields are set by 80211.o and need not be filled by the
-	 * low-level driver */
-	int rate_inv; /* inverse of the rate (LCM(all rates) / rate) for
-		       * optimizing channel utilization estimates */
-};
-
-/**
- * enum ieee80211_phymode - PHY modes
- *
- * @MODE_IEEE80211A: 5GHz as defined by 802.11a/802.11h
- * @MODE_IEEE80211B: 2.4 GHz as defined by 802.11b
- * @MODE_IEEE80211G: 2.4 GHz as defined by 802.11g (with OFDM),
- *	backwards compatible with 11b mode
- * @NUM_IEEE80211_MODES: internal
- */
-enum ieee80211_phymode {
-	MODE_IEEE80211A,
-	MODE_IEEE80211B,
-	MODE_IEEE80211G,
-
-	/* keep last */
-	NUM_IEEE80211_MODES
-};
-
-/**
- * struct ieee80211_ht_info - describing STA's HT capabilities
- *
- * This structure describes most essential parameters needed
- * to describe 802.11n HT capabilities for an STA.
- *
- * @ht_supported: is HT supported by STA, 0: no, 1: yes
- * @cap: HT capabilities map as described in 802.11n spec
- * @ampdu_factor: Maximum A-MPDU length factor
- * @ampdu_density: Minimum A-MPDU spacing
- * @supp_mcs_set: Supported MCS set as described in 802.11n spec
- */
-struct ieee80211_ht_info {
-	u8 ht_supported;
-	u16 cap; /* use IEEE80211_HT_CAP_ */
-	u8 ampdu_factor;
-	u8 ampdu_density;
-	u8 supp_mcs_set[16];
-};
-
 /**
  * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
  *
@@ -175,30 +86,6 @@ struct ieee80211_ht_bss_info {
 };
 
 /**
- * struct ieee80211_hw_mode - PHY mode definition
- *
- * This structure describes the capabilities supported by the device
- * in a single PHY mode.
- *
- * @list: internal
- * @channels: pointer to array of supported channels
- * @rates: pointer to array of supported bitrates
- * @mode: the PHY mode for this definition
- * @num_channels: number of supported channels
- * @num_rates: number of supported bitrates
- * @ht_info: PHY's 802.11n HT abilities for this mode
- */
-struct ieee80211_hw_mode {
-	struct list_head list;
-	struct ieee80211_channel *channels;
-	struct ieee80211_rate *rates;
-	enum ieee80211_phymode mode;
-	int num_channels;
-	int num_rates;
-	struct ieee80211_ht_info ht_info;
-};
-
-/**
  * struct ieee80211_tx_queue_params - transmit queue configuration
  *
  * The information provided in this structure is required for QoS
@@ -318,11 +205,13 @@ struct ieee80211_bss_conf {
 
 struct ieee80211_tx_control {
 	struct ieee80211_vif *vif;
-	int tx_rate; /* Transmit rate, given as the hw specific value for the
-		      * rate (from struct ieee80211_rate) */
-	int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw
-			   * specific value for the rate (from
-			   * struct ieee80211_rate) */
+	struct ieee80211_rate *tx_rate;
+
+	/* Transmit rate for RTS/CTS frame */
+	struct ieee80211_rate *rts_cts_rate;
+
+	/* retry rate for the last retries */
+	struct ieee80211_rate *alt_retry_rate;
 
 #define IEEE80211_TXCTL_REQ_TX_STATUS	(1<<0)/* request TX status callback for
 						* this frame */
@@ -341,6 +230,7 @@ struct ieee80211_tx_control {
 #define IEEE80211_TXCTL_REQUEUE		(1<<7)
 #define IEEE80211_TXCTL_FIRST_FRAGMENT	(1<<8) /* this is a first fragment of
 						* the frame */
+#define IEEE80211_TXCTL_SHORT_PREAMBLE	(1<<9)
 #define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10) /* this frame should be send
 						  * using the through
 						  * set_retry_limit configured
@@ -355,20 +245,11 @@ struct ieee80211_tx_control {
 	u8 retry_limit;		/* 1 = only first attempt, 2 = one retry, ..
 				 * This could be used when set_retry_limit
 				 * is not implemented by the driver */
-	u8 power_level;		/* per-packet transmit power level, in dBm */
 	u8 antenna_sel_tx; 	/* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */
 	u8 icv_len;		/* length of the ICV/MIC field in octets */
 	u8 iv_len;		/* length of the IV field in octets */
 	u8 queue;		/* hardware queue to use for this frame;
 				 * 0 = highest, hw->queues-1 = lowest */
-	struct ieee80211_rate *rate;		/* internal 80211.o rate */
-	struct ieee80211_rate *rts_rate;	/* internal 80211.o rate
-						 * for RTS/CTS */
-	int alt_retry_rate; /* retry rate for the last retries, given as the
-			     * hw specific value for the rate (from
-			     * struct ieee80211_rate). To be used to limit
-			     * packet dropping when probing higher rates, if hw
-			     * supports multiple retry rates. -1 = not used */
 	int type;	/* internal */
 };
 
@@ -411,26 +292,24 @@ enum mac80211_rx_flags {
  * supported by hardware) to the 802.11 code with each received
  * frame.
  * @mactime: MAC timestamp as defined by 802.11
+ * @band: the active band when this frame was received
  * @freq: frequency the radio was tuned to when receiving this frame, in MHz
- * @channel: channel the radio was tuned to
- * @phymode: active PHY mode
  * @ssi: signal strength when receiving this frame
  * @signal: used as 'qual' in statistics reporting
  * @noise: PHY noise when receiving this frame
  * @antenna: antenna used
- * @rate: data rate
+ * @rate_idx: index of data rate into band's supported rates
  * @flag: %RX_FLAG_*
  */
 struct ieee80211_rx_status {
 	u64 mactime;
+	enum ieee80211_band band;
 	int freq;
-	int channel;
-	enum ieee80211_phymode phymode;
 	int ssi;
 	int signal;
 	int noise;
 	int antenna;
-	int rate;
+	int rate_idx;
 	int flag;
 };
 
@@ -502,41 +381,30 @@ enum ieee80211_conf_flags {
  *
  * @radio_enabled: when zero, driver is required to switch off the radio.
  *	TODO make a flag
- * @channel: IEEE 802.11 channel number
- * @freq: frequency in MHz
- * @channel_val: hardware specific channel value for the channel
- * @phymode: PHY mode to activate (REMOVE)
- * @chan: channel to switch to, pointer to the channel information
- * @mode: pointer to mode definition
- * @regulatory_domain: ??
  * @beacon_int: beacon interval (TODO make interface config)
  * @flags: configuration flags defined above
- * @power_level: transmit power limit for current regulatory domain in dBm
- * @antenna_max: maximum antenna gain
+ * @power_level: requested transmit power (in dBm)
+ * @max_antenna_gain: maximum antenna gain (in dBi)
  * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
  *	1/2: antenna 0/1
  * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
  * @ht_conf: describes current self configuration of 802.11n HT capabilies
  * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
+ * @channel: the channel to tune to
  */
 struct ieee80211_conf {
-	int channel;			/* IEEE 802.11 channel number */
-	int freq;			/* MHz */
-	int channel_val;		/* hw specific value for the channel */
-
-	enum ieee80211_phymode phymode;
-	struct ieee80211_channel *chan;
-	struct ieee80211_hw_mode *mode;
 	unsigned int regulatory_domain;
 	int radio_enabled;
 
 	int beacon_int;
 	u32 flags;
-	u8 power_level;
-	u8 antenna_max;
+	int power_level;
+	int max_antenna_gain;
 	u8 antenna_sel_tx;
 	u8 antenna_sel_rx;
 
+	struct ieee80211_channel *channel;
+
 	struct ieee80211_ht_info ht_conf;
 	struct ieee80211_ht_bss_info ht_bss_conf;
 };
@@ -757,15 +625,19 @@ enum sta_notify_cmd {
  *	%IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because
  *	otherwise the stack will not know when the DTIM beacon was sent.
  *
- * @IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED:
- *	Channels are already configured to the default regulatory domain
- *	specified in the device's EEPROM
+ * @IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE:
+ *	Hardware is not capable of short slot operation on the 2.4 GHz band.
+ *
+ * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE:
+ *	Hardware is not capable of receiving frames with short preamble on
+ *	the 2.4 GHz band.
  */
 enum ieee80211_hw_flags {
 	IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE		= 1<<0,
 	IEEE80211_HW_RX_INCLUDES_FCS			= 1<<1,
 	IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING	= 1<<2,
-	IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED	= 1<<3,
+	IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE		= 1<<3,
+	IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE	= 1<<4,
 };
 
 /**
@@ -777,7 +649,8 @@ enum ieee80211_hw_flags {
  * @wiphy: This points to the &struct wiphy allocated for this
  *	802.11 PHY. You must fill in the @perm_addr and @dev
  *	members of this structure using SET_IEEE80211_DEV()
- *	and SET_IEEE80211_PERM_ADDR().
+ *	and SET_IEEE80211_PERM_ADDR(). Additionally, all supported
+ *	bands (with channels, bitrates) are registered here.
  *
  * @conf: &struct ieee80211_conf, device configuration, don't use.
  *
@@ -1051,7 +924,9 @@ enum ieee80211_ampdu_mlme_action {
  *	given local_address is enabled.
  *
  * @hw_scan: Ask the hardware to service the scan request, no need to start
- *	the scan state machine in stack.
+ *	the scan state machine in stack. The scan must honour the channel
+ *	configuration done by the regulatory agent in the wiphy's registered
+ *	bands.
  *
  * @get_stats: return low-level statistics
  *
@@ -1272,10 +1147,6 @@ static inline char *ieee80211_get_radio_
 #endif
 }
 
-/* Register a new hardware PHYMODE capability to the stack. */
-int ieee80211_register_hwmode(struct ieee80211_hw *hw,
-			      struct ieee80211_hw_mode *mode);
-
 /**
  * ieee80211_unregister_hw - Unregister a hardware device
  *
@@ -1449,7 +1320,7 @@ __le16 ieee80211_ctstoself_duration(stru
  * @hw: pointer obtained from ieee80211_alloc_hw().
  * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
  * @frame_len: the length of the frame.
- * @rate: the rate (in 100kbps) at which the frame is going to be transmitted.
+ * @rate: the rate at which the frame is going to be transmitted.
  *
  * Calculate the duration field of some generic frame, given its
  * length and transmission rate (in 100kbps).
@@ -1457,7 +1328,7 @@ __le16 ieee80211_ctstoself_duration(stru
 __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
 					struct ieee80211_vif *vif,
 					size_t frame_len,
-					int rate);
+					struct ieee80211_rate *rate);
 
 /**
  * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames
include/net/wireless.h +168 -0

184 lines not on this page · raw message

net/mac80211/ieee80211_i.h +13 -50

175 lines not on this page · raw message

net/mac80211/util.c +22 -120

195 lines not on this page · raw message

net/mac80211/ieee80211.c +40 -72

183 lines not on this page · raw message

net/mac80211/ieee80211_ioctl.c +66 -61

235 lines not on this page · raw message

net/mac80211/ieee80211_rate.h +16 -12
@@ -18,6 +18,7 @@
 #include "ieee80211_i.h"
 #include "sta_info.h"
 
+/* TODO: kdoc */
 struct rate_selection {
 	/* Selected transmission rate */
 	struct ieee80211_rate *rate;
@@ -34,7 +35,8 @@ struct rate_control_ops {
 			  struct sk_buff *skb,
 			  struct ieee80211_tx_status *status);
 	void (*get_rate)(void *priv, struct net_device *dev,
-			 struct ieee80211_hw_mode *mode, struct sk_buff *skb,
+			 struct ieee80211_supported_band *band,
+			 struct sk_buff *skb,
 			 struct rate_selection *sel);
 	void (*rate_init)(void *priv, void *priv_sta,
 			  struct ieee80211_local *local, struct sta_info *sta);
@@ -66,7 +68,8 @@ void ieee80211_rate_control_unregister(s
 struct rate_control_ref *rate_control_alloc(const char *name,
 					    struct ieee80211_local *local);
 void rate_control_get_rate(struct net_device *dev,
-			   struct ieee80211_hw_mode *mode, struct sk_buff *skb,
+			   struct ieee80211_supported_band *sband,
+			   struct sk_buff *skb,
 			   struct rate_selection *sel);
 struct rate_control_ref *rate_control_get(struct rate_control_ref *ref);
 void rate_control_put(struct rate_control_ref *ref);
@@ -127,23 +130,23 @@ static inline void rate_control_remove_s
 #endif
 }
 
-static inline int
-rate_supported(struct sta_info *sta, struct ieee80211_hw_mode *mode, int index)
+static inline int rate_supported(struct sta_info *sta,
+				 enum ieee80211_band band,
+				 int index)
 {
-	return (sta == NULL || sta->supp_rates & BIT(index)) &&
-	       (mode->rates[index].flags & IEEE80211_RATE_SUPPORTED);
+	return (sta == NULL || sta->supp_rates[band] & BIT(index));
 }
 
 static inline int
-rate_lowest_index(struct ieee80211_local *local, struct ieee80211_hw_mode *mode,
+rate_lowest_index(struct ieee80211_local *local,
+		  struct ieee80211_supported_band *sband,
 		  struct sta_info *sta)
 {
 	int i;
 
-	for (i = 0; i < mode->num_rates; i++) {
-		if (rate_supported(sta, mode, i))
+	for (i = 0; i < sband->n_bitrates; i++)
+		if (rate_supported(sta, sband->band, i))
 			return i;
-	}
 
 	/* warn when we cannot find a rate. */
 	WARN_ON(1);
@@ -152,10 +155,11 @@ rate_lowest_index(struct ieee80211_local
 }
 
 static inline struct ieee80211_rate *
-rate_lowest(struct ieee80211_local *local, struct ieee80211_hw_mode *mode,
+rate_lowest(struct ieee80211_local *local,
+	    struct ieee80211_supported_band *sband,
 	    struct sta_info *sta)
 {
-	return &mode->rates[rate_lowest_index(local, mode, sta)];
+	return &sband->bitrates[rate_lowest_index(local, sband, sta)];
 }
 
 
net/mac80211/ieee80211_sta.c +208 -176

780 lines not on this page · raw message

net/mac80211/sta_info.c +0 -24
@@ -74,30 +74,6 @@ struct sta_info *sta_info_get(struct iee
 }
 EXPORT_SYMBOL(sta_info_get);
 
-int sta_info_min_txrate_get(struct ieee80211_local *local)
-{
-	struct sta_info *sta;
-	struct ieee80211_hw_mode *mode;
-	int min_txrate = 9999999;
-	int i;
-
-	read_lock_bh(&local->sta_lock);
-	mode = local->oper_hw_mode;
-	for (i = 0; i < STA_HASH_SIZE; i++) {
-		sta = local->sta_hash[i];
-		while (sta) {
-			if (sta->txrate < min_txrate)
-				min_txrate = sta->txrate;
-			sta = sta->hnext;
-		}
-	}
-	read_unlock_bh(&local->sta_lock);
-	if (min_txrate == 9999999)
-		min_txrate = 0;
-
-	return mode->rates[min_txrate].rate;
-}
-
 
 static void sta_info_release(struct kref *kref)
 {
net/mac80211/Makefile +0 -1
@@ -19,7 +19,6 @@ mac80211-y := \
 	ieee80211_iface.o \
 	ieee80211_rate.o \
 	michael.o \
-	regdomain.o \
 	tkip.o \
 	aes_ccm.o \
 	cfg.o \
net/mac80211/regdomain.c deleted +0 -152

152 lines not on this page · raw message

net/mac80211/rx.c +47 -35

177 lines not on this page · raw message

net/mac80211/tx.c +101 -61

357 lines not on this page · raw message

net/mac80211/debugfs.c +1 -46

92 lines not on this page · raw message

net/mac80211/debugfs_sta.c +0 -18
@@ -33,22 +33,6 @@ static ssize_t sta_ ##name## _read(struc
 #define STA_READ_LU(name, field) STA_READ(name, 20, field, "%lu\n")
 #define STA_READ_S(name, field) STA_READ(name, 20, field, "%s\n")
 
-#define STA_READ_RATE(name, field)					\
-static ssize_t sta_##name##_read(struct file *file,			\
-				 char __user *userbuf,			\
-				 size_t count, loff_t *ppos)		\
-{									\
-	struct sta_info *sta = file->private_data;			\
-	struct ieee80211_local *local = wdev_priv(sta->dev->ieee80211_ptr);\
-	struct ieee80211_hw_mode *mode = local->oper_hw_mode;		\
-	char buf[20];							\
-	int res = scnprintf(buf, sizeof(buf), "%d\n",			\
-			    (sta->field >= 0 &&				\
-			    sta->field < mode->num_rates) ?		\
-			    mode->rates[sta->field].rate : -1);		\
-	return simple_read_from_buffer(userbuf, count, ppos, buf, res);	\
-}
-
 #define STA_OPS(name)							\
 static const struct file_operations sta_ ##name## _ops = {		\
 	.read = sta_##name##_read,					\
@@ -70,8 +54,6 @@ STA_FILE(rx_fragments, rx_fragments, LU)
 STA_FILE(rx_dropped, rx_dropped, LU);
 STA_FILE(tx_fragments, tx_fragments, LU);
 STA_FILE(tx_filtered, tx_filtered_count, LU);
-STA_FILE(txrate, txrate, RATE);
-STA_FILE(last_txrate, last_txrate, RATE);
 STA_FILE(tx_retry_failed, tx_retry_failed, LU);
 STA_FILE(tx_retry_count, tx_retry_count, LU);
 STA_FILE(last_rssi, last_rssi, D);
net/mac80211/rc80211_simple.c +29 -37

18 lines not on this page · raw message

net/wireless/core.c +41 -0

41 lines not on this page · raw message

drivers/net/wireless/b43/b43.h +0 -5

Lines of this file are not shown. View the raw message.

drivers/net/wireless/b43/main.c +60 -59

119 lines not on this page · raw message

drivers/net/wireless/b43/xmit.c +44 -37

81 lines not on this page · raw message

net/wireless/Makefile +1 -1

Lines of this file are not shown. View the raw message.

drivers/net/wireless/b43/sysfs.c +1 -88

89 lines not on this page · raw message

net/wireless/core.h +3 -0

Lines of this file are not shown. View the raw message.

net/wireless/util.c new file +98 -0

98 lines not on this page · raw message

net/mac80211/cfg.c +6 -5

Lines of this file are not shown. View the raw message.

net/mac80211/rc80211_pid_algo.c +41 -35

76 lines not on this page · raw message

net/mac80211/ieee80211_rate.c +8 -7

Lines of this file are not shown. View the raw message.

net/mac80211/sta_info.h +5 -5

Lines of this file are not shown. View the raw message.

net/mac80211/ieee80211_iface.c +2 -0

Lines of this file are not shown. View the raw message.

net/wireless/reg.c new file +153 -0

153 lines not on this page · raw message

drivers/net/wireless/adm8211.c +45 -35

80 lines not on this page · raw message

drivers/net/wireless/adm8211.h +7 -58

65 lines not on this page · raw message

drivers/net/wireless/p54.h +0 -4

Lines of this file are not shown. View the raw message.

drivers/net/wireless/p54common.c +48 -26

74 lines not on this page · raw message

drivers/net/wireless/p54common.h +0 -75

75 lines not on this page · raw message

drivers/net/wireless/b43legacy/b43legacy.h +0 -4

Lines of this file are not shown. View the raw message.

drivers/net/wireless/b43legacy/main.c +71 -90

161 lines not on this page · raw message

drivers/net/wireless/b43legacy/xmit.c +31 -33

64 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-3945-rs.c +40 -40

80 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-3945.c +16 -19

Lines of this file are not shown. View the raw message.

drivers/net/wireless/iwlwifi/iwl-3945.h +6 -7

Lines of this file are not shown. View the raw message.

drivers/net/wireless/iwlwifi/iwl3945-base.c +124 -321

445 lines not on this page · raw message

drivers/net/wireless/rtl8180.h +1 -1

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rtl8180_dev.c +62 -31

93 lines not on this page · raw message

drivers/net/wireless/rtl818x.h +0 -70

70 lines not on this page · raw message

drivers/net/wireless/rtl8180_grf5101.c +3 -2

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rtl8180_max2820.c +3 -2

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rtl8180_rtl8225.c +8 -7

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rtl8180_sa2400.c +3 -2

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rtl8187.h +1 -1

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rtl8187_dev.c +56 -26

82 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-4965.h +8 -8

Lines of this file are not shown. View the raw message.

drivers/net/wireless/iwlwifi/iwl4965-base.c +113 -325

438 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-4965-rs.c +43 -39

82 lines not on this page · raw message

drivers/net/wireless/iwlwifi/iwl-4965.c +21 -22

43 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00.h +6 -5

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rt2x00/rt2x00dev.c +60 -91

151 lines not on this page · raw message

drivers/net/wireless/rt2x00/rt2x00config.c +15 -18

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rt2x00/rt61pci.c +12 -11

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rt2x00/rt73usb.c +12 -11

Lines of this file are not shown. View the raw message.

drivers/net/wireless/zd1211rw/zd_chip.c +5 -10

Lines of this file are not shown. View the raw message.

drivers/net/wireless/zd1211rw/zd_ieee80211.c +4 -7

Lines of this file are not shown. View the raw message.

drivers/net/wireless/zd1211rw/zd_mac.c +74 -94

168 lines not on this page · raw message

drivers/net/wireless/zd1211rw/zd_mac.h +1 -1

Lines of this file are not shown. View the raw message.

drivers/net/wireless/rtl8187_rtl8225.c +8 -7

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#2 lore raw

Re: [PATCH 1/2] cfg80211 API for channels/bitrates, mac80211 and driver conversion

Quoted 12 lines · Johannes Berg

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.

Quoted 8 lines

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.

True, total havoc

Quoted 5 lines

---
Changes:

v1..v3: <untracked>
v4:     fix bugs in iwl4965

Also inserting few, actually drawing it unusable. You are lucky we like you here :)
The question is how we handle this?. Do you want to resubmit this huge patch or we fix it somehow over it...

Tomas

Quoted 1 line
#3 lore raw

Re: [PATCH 1/2] cfg80211 API for channels/bitrates, mac80211 and driver conversion

Quoted 3 lines · Tomas Winkler
Quoted 2 lines · Johannes Berg

This patch creates new cfg80211 wiphy API for channel and bitrate registration and converts mac80211 and drivers to the new API. The

<snip>

Quoted 11 lines
Quoted 2 lines

I do expect there to be bugs in this, especially wrt. transmit power handling where I'm basically clueless about how it should work.

True, total havoc

Quoted 5 lines

---
Changes:

v1..v3: <untracked>
v4:     fix bugs in iwl4965
Quoted 4 lines

Also inserting few, actually drawing it unusable. You are lucky we like you here :)
The question is how we handle this?. Do you want to resubmit this huge patch or we fix it somehow over it...

I think I'm going to hold this back from Dave for 2.6.25. It might be better if we can fix any known problems with this patch before re-merging it for pre-2.6.26 development.

John

Signature · 2 lines
John W. Linville
[email protected]
#4 lore raw

Re: [PATCH 1/2] cfg80211 API for channels/bitrates, mac80211 and driver conversion

Quoted 18 lines · John W. Linville
Quoted 3 lines · Tomas Winkler
Quoted 2 lines · Johannes Berg

This patch creates new cfg80211 wiphy API for channel and bitrate registration and converts mac80211 and drivers to the new API. The

<snip>

Quoted 11 lines
Quoted 2 lines

I do expect there to be bugs in this, especially wrt. transmit power handling where I'm basically clueless about how it should work.

True, total havoc

Quoted 5 lines

---
Changes:

v1..v3: <untracked>
v4:     fix bugs in iwl4965
Quoted 9 lines
Quoted 4 lines

Also inserting few, actually drawing it unusable. You are lucky we like you here :)
The question is how we handle this?. Do you want to resubmit this huge patch or we fix it somehow over it...

I think I'm going to hold this back from Dave for 2.6.25. It might be better if we can fix any known problems with this patch before re-merging it for pre-2.6.26 development.

So will you branch it publicly in wireless-2.6 or we do it on mailing list? I have some patches for iwl4965 to make HT compile again but after Pandora's box has opened so I stopped to try? I will send them out.
What is the window left for 2.6.25? I'm just worried about cfg80211 general progress.
Thanks
Tomas

Quoted 5 lines

John
--
John W. Linville
[email protected]

#5 lore raw

Re: [PATCH 1/2] cfg80211 API for channels/bitrates, mac80211 and driver conversion

Quoted 7 lines · Tomas Winkler
Quoted 4 lines · John W. Linville

I think I'm going to hold this back from Dave for 2.6.25. It might be better if we can fix any known problems with this patch before re-merging it for pre-2.6.26 development.

Quoted 6 lines

So will you branch it publicly in wireless-2.6 or we do it on mailing list? I have some patches for iwl4965 to make HT compile again but after Pandora's box has opened so I stopped to try? I will send them out.
What is the window left for 2.6.25? I'm just worried about cfg80211 general progress.

The development window for 2.6.25 is closed.

The API change will remaind in wireless-2.6 throughout the 2.6.26 development cycle. Please send any fixes for breakage caused by this patch ASAP.

Thanks,

John

Signature · 2 lines
John W. Linville
[email protected]
author maintainer
#6 lore raw

Re: [PATCH 1/2] cfg80211 API for channels/bitrates, mac80211 and driver conversion

In reply to Tomas Winkler
Quoted 5 lines

Also inserting few, actually drawing it unusable. You are lucky we like you here :)
The question is how we handle this?. Do you want to resubmit this huge patch or we fix it somehow over it...

Can you point out any bugs? It works with my iwl4965 card (and the fix for the unfortunate bug for the scanning problem).

johannes

#7 lore raw

Re: [PATCH 1/2] cfg80211 API for channels/bitrates, mac80211 and driver conversion

Quoted 9 lines · Johannes Berg
Quoted 5 lines

Also inserting few, actually drawing it unusable. You are lucky we like you here :)
The question is how we handle this?. Do you want to resubmit this huge patch or we fix it somehow over it...

Can you point out any bugs? It works with my iwl4965 card (and the fix for the unfortunate bug for the scanning problem).

1. As I wait box we lost scanning in A mode, we have WARN_ON(1) on every RX packet now because of invalid rate
2. There are few sparse bugs if you run it - don't remember exactly
3. HT doesn't compile bug this I want to fix over HT AGG patches
4. Few problems in code I spotted but there are probably many For example in RX path
rate_idx = iwl4965_hw_get_rate(

				le32_to_cpu(rx_start->rate_n_flags)),

This is wrong
1. the le_to_cpu is redundant (it's aleardy done in hw)
2. it will give you rate in plcp format and not the index

I rather do better review of this... first I want to put this patch above HT agg patches

Thanks
Tomas

Quoted 2 lines

johannes

author maintainer
#8 lore raw

PATCH 2/2 nl80211: export hardware bitrate/channel capabilities

In reply to Johannes Berg

This makes nl80211 export the hardware bitrate/channel capabilities as registered in a wiphy.

---
 include/linux/nl80211.h |   64 +++++++++++++++++++++++++++++++++++++++++
 net/wireless/nl80211.c  |   74 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 138 insertions(+)
include/linux/nl80211.h +64 -0
@@ -161,6 +161,9 @@ enum nl80211_commands {
  *	given for %NL80211_CMD_GET_STATION, nested attribute containing
  *	info as possible, see &enum nl80211_sta_stats.
  *
+ * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
+ *	consisting of a nested array.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -195,6 +198,8 @@ enum nl80211_attrs {
 	NL80211_ATTR_STA_VLAN,
 	NL80211_ATTR_STA_STATS,
 
+	NL80211_ATTR_WIPHY_BANDS,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -280,4 +285,63 @@ enum nl80211_sta_stats {
 	NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1
 };
 
+/**
+ * enum nl80211_band_attr - band attributes
+ * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
+ * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
+ *	an array of nested frequency attributes
+ * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
+ *	an array of nested bitrate attributes
+ */
+enum nl80211_band_attr {
+	__NL80211_BAND_ATTR_INVALID,
+	NL80211_BAND_ATTR_FREQS,
+	NL80211_BAND_ATTR_RATES,
+
+	/* keep last */
+	__NL80211_BAND_ATTR_AFTER_LAST,
+	NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_frequency_attr - frequency attributes
+ * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
+ * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
+ *	regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
+ *	permitted on this channel in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
+ *	on this channel in current regulatory domain.
+ * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
+ *	on this channel in current regulatory domain.
+ */
+enum nl80211_frequency_attr {
+	__NL80211_FREQUENCY_ATTR_INVALID,
+	NL80211_FREQUENCY_ATTR_FREQ,
+	NL80211_FREQUENCY_ATTR_DISABLED,
+	NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
+	NL80211_FREQUENCY_ATTR_NO_IBSS,
+	NL80211_FREQUENCY_ATTR_RADAR,
+
+	/* keep last */
+	__NL80211_FREQUENCY_ATTR_AFTER_LAST,
+	NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_bitrate_attr - bitrate attributes
+ * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
+ * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
+ *	in 2.4 GHz band.
+ */
+enum nl80211_bitrate_attr {
+	__NL80211_BITRATE_ATTR_INVALID,
+	NL80211_BITRATE_ATTR_RATE,
+	NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
+
+	/* keep last */
+	__NL80211_BITRATE_ATTR_AFTER_LAST,
+	NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
+};
+
 #endif /* __LINUX_NL80211_H */
net/wireless/nl80211.c +74 -0

86 lines not on this page · raw message