* [RFC 00/11] mac80211 updates
@ 2007-08-23 16:45 Johannes Berg
2007-08-23 16:45 ` [RFC 01/11] mac80211: renumber and document the hardware flags Johannes Berg
` (10 more replies)
0 siblings, 11 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
Some more RFC patches, mostly RFC because they probably
apply only on top of the other RFC patches not because I
think there's something wrong with them. Feel free to
cherry-pick those that you think appropriate.
johannes
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 01/11] mac80211: renumber and document the hardware flags
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-23 16:45 ` [RFC 02/11] mac80211: document a lot more Johannes Berg
` (9 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
Currently, hardware flags that drivers must set are not
documented well enough. Fix this.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/mac80211.h | 101 ++++++++++++++++++++++++++-----------------------
1 file changed, 55 insertions(+), 46 deletions(-)
--- wireless-dev.orig/include/net/mac80211.h 2007-08-23 18:26:15.941897709 +0200
+++ wireless-dev/include/net/mac80211.h 2007-08-23 18:26:17.191897709 +0200
@@ -507,6 +507,61 @@ typedef enum set_key_cmd {
SET_KEY, DISABLE_KEY,
} set_key_cmd;
+
+/**
+ * enum ieee80211_hw_flags - hardware flags
+ *
+ * These flags are used to indicate hardware capabilities to
+ * the stack. Generally, flags here should have their meaning
+ * done in a way that the simplest hardware doesn't need setting
+ * any particular flags. There are some exceptions to this rule,
+ * however, so you are advised to review these flags carefully.
+ *
+ * @IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE:
+ * The device only needs to be supplied with a beacon template.
+ * If you need the host to generate each beacon then don't use
+ * this flag and call ieee80211_beacon_get() when you need the
+ * next beacon frame. Note that if you set this flag, you must
+ * implement the set_tim() callback for powersave mode to work
+ * properly.
+ * This flag is only relevant for access-point mode.
+ *
+ * @IEEE80211_HW_RX_INCLUDES_FCS:
+ * Indicates that received frames passed to the stack include
+ * the FCS at the end.
+ *
+ * @IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING:
+ * Some wireless LAN chipsets buffer broadcast/multicast frames
+ * for power saving stations in the hardware/firmware and others
+ * rely on the host system for such buffering. This option is used
+ * to configure the IEEE 802.11 upper layer to buffer broadcast and
+ * multicast frames when there are power saving stations so that
+ * the driver can fetch them with ieee80211_get_buffered_bc(). Note
+ * that not setting this flag works properly only when the
+ * %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_MULTICAST_FILTER:
+ * Device has multicast filters, i.e. it can filter based on the
+ * multicast address. If this flag is clear, then %FIF_ALLMULTI
+ * will be enabled instead of passing multicast addresses when
+ * multicast addresses are added.
+ *
+ * @IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED:
+ * Channels are already configured to the default regulatory domain
+ * specified in the device's EEPROM
+ *
+ * @IEEE80211_HW_SUPPORT_HT_MODE: The device capable of supporting 11n.
+ */
+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_MULTICAST_FILTER = 1<<3,
+ IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED = 1<<4,
+ IEEE80211_HW_SUPPORT_HT_MODE = 1<<5,
+};
+
/**
* struct ieee80211_hw - hardware information and state
* TODO: move documentation into kernel-doc format
@@ -530,52 +585,6 @@ struct ieee80211_hw {
/* The rest is information about your hardware */
- /* TODO: frame_type 802.11/802.3, sw_encryption requirements */
-
-/* hole at 0 */
-
- /*
- * The device only needs to be supplied with a beacon template.
- * If you need the host to generate each beacon then don't use
- * this flag and use ieee80211_beacon_get().
- */
-#define IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE (1<<1)
-
-/* hole at 2 */
-
- /* Whether RX frames passed to ieee80211_rx() include FCS in the end */
-#define IEEE80211_HW_RX_INCLUDES_FCS (1<<3)
-
- /* Some wireless LAN chipsets buffer broadcast/multicast frames for
- * power saving stations in the hardware/firmware and others rely on
- * the host system for such buffering. This option is used to
- * configure the IEEE 802.11 upper layer to buffer broadcast/multicast
- * frames when there are power saving stations so that low-level driver
- * can fetch them with ieee80211_get_buffered_bc(). */
-#define IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING (1<<4)
-
-/* hole at 5 */
-
-/* hole at 6 */
-
-/* hole at 7 */
-
-/* hole at 8 */
-
- /*
- * Device has multicast filters.
- */
-#define IEEE80211_HW_MULTICAST_FILTER (1<<9)
-
-/* hole at 10 */
-
- /* Channels are already configured to the default regulatory domain
- * specified in the device's EEPROM */
-#define IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED (1<<11)
-
- /* The device capable of supporting 11n */
-#define IEEE80211_HW_SUPPORT_HT_MODE (1<<15)
-
u32 flags; /* hardware flags defined above */
/* Set to the size of a needed device specific skb headroom for TX skbs. */
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 02/11] mac80211: document a lot more
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
2007-08-23 16:45 ` [RFC 01/11] mac80211: renumber and document the hardware flags Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-23 16:45 ` [RFC 03/11] wireless networking: move frame inline functions to generic header Johannes Berg
` (8 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
This patch adds a lot more documentation (in kernel-doc format)
to include/net/mac80211.h
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/mac80211.h | 850 ++++++++++++++++++++++++++++++-------------------
1 file changed, 525 insertions(+), 325 deletions(-)
--- wireless-dev.orig/include/net/mac80211.h 2007-08-23 17:21:31.331897709 +0200
+++ wireless-dev/include/net/mac80211.h 2007-08-23 18:22:33.281897709 +0200
@@ -22,29 +22,51 @@
#include <net/wireless.h>
#include <net/cfg80211.h>
-/* Note! Only ieee80211_tx_status_irqsafe() and ieee80211_rx_irqsafe() can be
+/**
+ * DOC: Introduction
+ *
+ * mac80211 is the Linux stack for 802.11 hardware that implements
+ * only partial functionality in hard- or firmware. This document
+ * defines the interface between mac80211 and low-level hardware
+ * drivers.
+ */
+
+/**
+ * DOC: Calling mac80211 from interrupts
+ *
+ * Only ieee80211_tx_status_irqsafe() and ieee80211_rx_irqsafe() can be
* called in hardware interrupt context. The low-level driver must not call any
* other functions in hardware interrupt context. If there is a need for such
* call, the low-level driver should first ACK the interrupt and perform the
- * IEEE 802.11 code call after this, e.g., from a scheduled tasklet (in
- * software interrupt context).
+ * IEEE 802.11 code call after this, e.g. from a scheduled workqueue function.
+ */
+
+/**
+ * DOC: Warning
+ *
+ * If you're reading this document and not the header file itself, it will
+ * be incomplete because not all documentation has been converted yet.
*/
-/*
- * Frame format used when passing frame between low-level hardware drivers
- * and IEEE 802.11 driver the same as used in the wireless media, i.e.,
- * buffers start with IEEE 802.11 header and include the same octets that
- * are sent over air.
- *
- * If hardware uses IEEE 802.3 headers (and perform 802.3 <-> 802.11
- * conversion in firmware), upper layer 802.11 code needs to be changed to
- * support this.
- *
- * If the receive frame format is not the same as the real frame sent
- * on the wireless media (e.g., due to padding etc.), upper layer 802.11 code
- * could be updated to provide support for such format assuming this would
- * optimize the performance, e.g., by removing need to re-allocation and
- * copying of the data.
+/**
+ * DOC: Frame format
+ *
+ * As a general rule, when frames are passed between mac80211 and the driver,
+ * they start with the IEEE 802.11 header and include the same octets that are
+ * sent over the air except for the FCS which should be calculated by the
+ * hardware.
+ *
+ * There are, however, various exceptions to this rule for advanced features:
+ *
+ * The first exception is for hardware encryption and decryption offload
+ * where the IV/ICV may or may not be generated in hardware.
+ *
+ * Secondly, when the hardware handles fragmentation, the frame handed to
+ * the driver from mac80211 is the MSDU, not the MPDU.
+ *
+ * Finally, for received frames, the driver is able to indicate that it has
+ * filled a radiotap header and put that in front of the frame; if it does
+ * not do so then mac80211 may add this under certain circumstances.
*/
#define IEEE80211_CHAN_W_SCAN 0x00000001
@@ -386,7 +408,7 @@ enum ieee80211_if_types {
*/
struct ieee80211_if_init_conf {
int if_id;
- int type;
+ enum ieee80211_if_types type;
void *mac_addr;
};
@@ -564,388 +586,457 @@ enum ieee80211_hw_flags {
/**
* struct ieee80211_hw - hardware information and state
- * TODO: move documentation into kernel-doc format
+ *
+ * This structure contains the configuration and hardware
+ * information for an 802.11 PHY.
+ *
+ * @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().
+ *
+ * @conf: &struct ieee80211_conf, device configuration, don't use.
+ *
+ * @workqueue: single threaded workqueue available for driver use,
+ * allocated by mac80211 on registration and flushed on
+ * unregistration.
+ *
+ * @priv: pointer to private area that was allocated for driver use
+ * along with this structure.
+ *
+ * @flags: hardware flags, see &enum ieee80211_hw_flags.
+ *
+ * @extra_tx_headroom: headroom to reserve in each transmit skb
+ * for use by the driver (e.g. for transmit headers.)
+ *
+ * @channel_change_time: time (in microseconds) it takes to change channels.
+ *
+ * @max_rssi: Maximum value for ssi in RX information, use
+ * negative numbers for dBm and 0 to indicate no support.
+ *
+ * @max_signal: like @max_rssi, but for the signal value.
+ *
+ * @max_noise: like @max_rssi, but for the noise value.
+ *
+ * @queues: number of available hardware transmit queues for
+ * data packets. WMM/QoS requires at least four.
*/
struct ieee80211_hw {
- /* points to the cfg80211 wiphy for this piece. Note
- * that you must fill in the perm_addr and dev fields
- * of this structure, use the macros provided below. */
- struct wiphy *wiphy;
-
- /* assigned by mac80211, don't write */
struct ieee80211_conf conf;
-
- /* Single thread workqueue available for driver use
- * Allocated by mac80211 on registration */
+ struct wiphy *wiphy;
struct workqueue_struct *workqueue;
-
- /* Pointer to the private area that was
- * allocated with this struct for you. */
void *priv;
-
- /* The rest is information about your hardware */
-
- u32 flags; /* hardware flags defined above */
-
- /* Set to the size of a needed device specific skb headroom for TX skbs. */
+ u32 flags;
unsigned int extra_tx_headroom;
-
- /* This is the time in us to change channels
- */
int channel_change_time;
- /* Maximum values for various statistics.
- * Leave at 0 to indicate no support. Use negative numbers for dBm. */
+ u8 queues;
s8 max_rssi;
s8 max_signal;
s8 max_noise;
-
- /* Number of available hardware TX queues for data packets.
- * WMM requires at least four queues. */
- int queues;
};
+/**
+ * SET_IEEE80211_DEV - set device for 802.11 hardware
+ *
+ * @hw: the &struct ieee80211_hw to set the device for
+ * @dev: the &struct device of this 802.11 device
+ */
static inline void SET_IEEE80211_DEV(struct ieee80211_hw *hw, struct device *dev)
{
set_wiphy_dev(hw->wiphy, dev);
}
+/**
+ * SET_IEEE80211_PERM_ADDR - set the permanenet MAC address for 802.11 hardware
+ *
+ * @hw: the &struct ieee80211_hw to set the MAC address for
+ * @addr: the address to set
+ */
static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
{
memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
}
-/*
- * flags for change_filter_flags()
+/**
+ * DOC: Hardware crypto acceleration
+ *
+ * mac80211 is capable of taking advantage of many hardware
+ * acceleration designs for encryption and decryption operations.
*
- * Note that e.g. if PROMISC_IN_BSS is unset then
- * you should still do MAC address filtering if
- * possible even if OTHER_BSS is set to indicate
- * no BSSID filtering should be done.
- */
-/*
- * promiscuous mode within your BSS,
- * think of the BSS as your network segment and then this corresponds
- * to the regular ethernet device promiscuous mode
- */
-#define FIF_PROMISC_IN_BSS 0x01
-/* show all multicast frames */
-#define FIF_ALLMULTI 0x02
-/* show frames with failed FCS, but set RX_FLAG_FAILED_FCS_CRC for them */
-#define FIF_FCSFAIL 0x04
-/* show frames with failed PLCP CRC, but set RX_FLAG_FAILED_PLCP_CRC for them */
-#define FIF_PLCPFAIL 0x08
-/*
- * This flag is set during scanning to indicate to the hardware
- * that it should not filter beacons or probe responses by BSSID.
- */
-#define FIF_BCN_PRBRESP_PROMISC 0x10
-/*
- * show control frames, if PROMISC_IN_BSS is not set then
- * only those addressed to this station
- */
-#define FIF_CONTROL 0x20
-/* show frames from other BSSes */
-#define FIF_OTHER_BSS 0x40
-
-/* Configuration block used by the low-level driver to tell the 802.11 code
- * about supported hardware features and to pass function pointers to callback
- * functions. */
+ * The set_key() callback in the &struct ieee80211_ops for a given
+ * device is called to enable hardware acceleration of encryption and
+ * decryption. The callback takes an @address parameter that will be
+ * the broadcast address for default keys, the other station's hardware
+ * address for individual keys or the zero address for keys that will
+ * be used only for transmission.
+ * Multiple transmission keys with the same key index may be used when
+ * VLANs are configured for an access point.
+ *
+ * The @local_address parameter will always be set to our own address,
+ * this is only relevant if you support multiple local addresses.
+ *
+ * When transmitting, the TX control data will use the @hw_key_idx
+ * selected by the driver by modifying the &struct ieee80211_key_conf
+ * pointed to by the @key parameter to the set_key() function.
+ *
+ * If you support multiple MAC addresses but only hardware acceleration
+ * based on the transmitter address, you should keep a list of all
+ * keys that are currently enabled (use the key conf's driver_keylist
+ * member) and call ieee80211_key_removed() for all keys that you had
+ * to remove.
+ * Note that you should only do that if you're unable to use the key
+ * for transmission afterwards, if you only disabled it for reception
+ * you should not call ieee80211_key_removed() because that will also
+ * remove the key for transmission.
+ *
+ * The set_key() call for the %SET_KEY command should return 0 if
+ * the key is now in use, -%EOPNOTSUPP or -%ENOSPC if it couldn't be
+ * added; if it returns 0 then hw_key_idx must be assigned to something
+ * other than %HW_KEY_IDX_INVALID. When the cmd is %DISABLE_KEY then
+ * it must succeed.
+ *
+ * Note that it is permissible to not decrypt a frame even if a key
+ * for it has been uploaded to hardware, the stack will not make any
+ * decision based on whether a key has been uploaded or not but rather
+ * based on the receive flags.
+ *
+ * The &struct ieee80211_key_conf structure pointed to by the @key
+ * parameter is guaranteed to be valid until another call to set_key()
+ * removes it or until the driver calls ieee80211_key_removed(), it can
+ * especially be used as a cookie to differentiate transmit-only keys
+ * since multiple such keys may be present.
+ */
+
+/**
+ * DOC: Frame filtering
+ *
+ * mac80211 requires to see many management frames for proper
+ * operation, and users may want to see many more frames when
+ * in monitor mode. However, for best CPU usage and power consumption,
+ * having as few frames as possible percolate through the stack is
+ * desirable. Hence, the hardware should filter as much as possible.
+ *
+ * To achieve this, mac80211 uses filter flags (see below) to tell
+ * the driver's configure_filter() function which frames should be
+ * passed to mac80211 and which should be filtered out.
+ *
+ * If the device is capable of filtering for multicast addresses,
+ * you should set the %IEEE80211_HW_MULTICAST_FILTER flag in the
+ * hardware description.
+ *
+ * The configure_filter() callback is invoked with the parameters
+ * @multi_count telling how many multicast addresses are enabled,
+ * @changed_flags telling which flags were changed, and @total_flags
+ * telling the new flag state.
+ *
+ * Due to the places that configure_filter() can be called from,
+ * it is possible that it is called with -1 as the @multi_count.
+ * In that case, the multicast list should not be changed. Otherwise,
+ * call ieee80211_get_mc_list_item() to get the multicast addresses
+ * to let through.
+ *
+ * All unsupported flags in @total_flags must be cleared, i.e. you
+ * should clear all bits except those you honoured.
+ */
+
+/**
+ * enum ieee80211_filter_flags - hardware filter flags
+ *
+ * These flags determine what the filter in hardware should be
+ * programmed to let through and what should not be passed to the
+ * stack. It is always safe to pass more frames than requested,
+ * but this has negative impact on power consumption.
+ *
+ * @FIF_PROMISC_IN_BSS: promiscuous mode within your BSS,
+ * think of the BSS as your network segment and then this corresponds
+ * to the regular ethernet device promiscuous mode.
+ *
+ * @FIF_ALLMULTI: pass all multicast frames, this is used if requested
+ * by the user or if the hardware is not capable of filtering by
+ * multicast address.
+ *
+ * @FIF_FCSFAIL: pass frames with failed FCS (but you need to set the
+ * %RX_FLAG_FAILED_FCS_CRC for them)
+ *
+ * @FIF_PLCPFAIL: pass frames with failed PLCP CRC (but you need to set
+ * the %RX_FLAG_FAILED_PLCP_CRC for them
+ *
+ * @FIF_BCN_PRBRESP_PROMISC: This flag is set during scanning to indicate
+ * to the hardware that it should not filter beacons or probe responses
+ * by BSSID. Filtering them can greatly reduce the amount of processing
+ * mac80211 needs to do and the amount of CPU wakeups, so you should
+ * honour this flag if possible.
+ *
+ * @FIF_CONTROL: pass control frames, if PROMISC_IN_BSS is not set then
+ * only those addressed to this station
+ *
+ * @FIF_OTHER_BSS: pass frames destined to other BSSes
+ */
+enum ieee80211_filter_flags {
+ FIF_PROMISC_IN_BSS = 1<<0,
+ FIF_ALLMULTI = 1<<1,
+ FIF_FCSFAIL = 1<<2,
+ FIF_PLCPFAIL = 1<<3,
+ FIF_BCN_PRBRESP_PROMISC = 1<<4,
+ FIF_CONTROL = 1<<5,
+ FIF_OTHER_BSS = 1<<6,
+};
+
+/**
+ * enum ieee80211_erp_change_flags - erp change flags
+ *
+ * These flags are used with the erp_ie_changed() callback in
+ * &struct ieee80211_ops to indicate which parameter(s) changed.
+ * @IEEE80211_ERP_CHANGE_PROTECTION: protection changed
+ * @IEEE80211_ERP_CHANGE_PREAMBLE: barker preamble mode changed
+ */
+enum ieee80211_erp_change_flags {
+ IEEE80211_ERP_CHANGE_PROTECTION = 1<<0,
+ IEEE80211_ERP_CHANGE_PREAMBLE = 1<<1,
+};
+
+
+/**
+ * struct ieee80211_ops - callbacks from mac80211 to the driver
+ *
+ * This structure contains various callbacks that the driver may
+ * handle or, in some cases, must handle, for example to configure
+ * the hardware to a new channel or to transmit a frame.
+ *
+ * @tx: Handler that 802.11 module calls for each transmitted frame.
+ * skb contains the buffer starting from the IEEE 802.11 header.
+ * The low-level driver should send the frame out based on
+ * configuration in the TX control data. Must be implemented and
+ * atomic.
+ *
+ * @start: Called before the first netdevice attached to the hardware
+ * is enabled. This should turn on the hardware and must turn on
+ * frame reception (for possibly enabled monitor interfaces.)
+ * Returns negative error codes, these may be seen in userspace,
+ * or zero.
+ * When the device is started it should not have a MAC address
+ * to avoid acknowledging frames before a non-monitor device
+ * is added.
+ * Must be implemented.
+ *
+ * @stop: Called after last netdevice attached to the hardware
+ * is disabled. This should turn off the hardware (at least
+ * it must turn off frame reception.)
+ * May be called right after add_interface if that rejects
+ * an interface.
+ * Must be implemented.
+ *
+ * @add_interface: Called when a netdevice attached to the hardware is
+ * enabled. Because it is not called for monitor mode devices, @open
+ * and @stop must be implemented.
+ * The driver should perform any initialization it needs before
+ * the device can be enabled. The initial configuration for the
+ * interface is given in the conf parameter.
+ * The callback may refuse to add an interface by returning a
+ * negative error code (which will be seen in userspace.)
+ * Must be implemented.
+ *
+ * @remove_interface: Notifies a driver that an interface is going down.
+ * The @stop callback is called after this if it is the last interface
+ * and no monitor interfaces are present.
+ * When all interfaces are removed, the MAC address in the hardware
+ * must be cleared so the device no longer acknowledges packets,
+ * the mac_addr member of the conf structure is, however, set to the
+ * MAC address of the device going away.
+ * Hence, this callback must be implemented.
+ *
+ * @config: Handler for configuration requests. IEEE 802.11 code calls this
+ * function to change hardware configuration, e.g., channel.
+ *
+ * @config_interface: Handler for configuration requests related to interfaces
+ * (e.g. BSSID changes.)
+ *
+ * @configure_filter: Configure the device's RX filter.
+ * See the section "Frame filtering" for more information.
+ * This callback must be implemented and atomic (due to running
+ * under the tx lock.)
+ *
+ * @set_tim: Set TIM bit. If the hardware/firmware takes care of beacon
+ * generation (that is, %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is set)
+ * mac80211 calls this function when a TIM bit must be set or cleared
+ * for a given AID. Must be atomic.
+ *
+ * @set_key: See the section "Hardware crypto acceleration"
+ * This callback can sleep, and is only called between add_interface
+ * and remove_interface calls, i.e. while the interface with the
+ * given local_address is enabled.
+ *
+ * @set_ieee8021x: Enable/disable IEEE 802.1X. This item requests wlan card
+ * to pass unencrypted EAPOL-Key frames even when encryption is
+ * configured. If the wlan card does not require such a configuration,
+ * this function pointer can be set to NULL.
+ * @set_port_auth: Set port authorization state (IEEE 802.1X PAE) to be
+ * authorized (@authorized=1) or unauthorized (=0). This function can be
+ * used if the wlan hardware or low-level driver implements PAE.
+ * mac80211 will filter frames based on authorization state in any case,
+ * so this function pointer can be NULL if low-level driver does not
+ * require event notification about port state changes.
+ *
+ * @hw_scan: Ask the hardware to service the scan request, no need to start
+ * the scan state machine in stack.
+ *
+ * @get_stats: return low-level statistics
+ *
+ * @set_privacy_invoked: For devices that generate their own beacons and probe
+ * response or association responses this updates the state of privacy_invoked
+ * returns 0 for success or an error number.
+ *
+ * @get_sequence_counter: For devices that have internal sequence counters this
+ * callback allows mac80211 to access the current value of a counter.
+ * This callback seems not well-defined, tell us if you need it.
+ *
+ * @set_rts_threshold: Configuration of RTS threshold (if device needs it)
+ *
+ * @set_frag_threshold: Configuration of fragmentation threshold. Assign this if
+ * the device does fragmentation by itself; if this method is assigned then
+ * the stack will not do fragmentation.
+ *
+ * @set_retry_limit: Configuration of retry limits (if device needs it)
+ *
+ * @sta_table_notification: Number of STAs in STA table notification. Must
+ * be atomic.
+ *
+ * @erp_ie_changed: Handle ERP IE change notifications. Must be atomic.
+ *
+ * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
+ * bursting) for a hardware TX queue. The @queue parameter uses the
+ * %IEEE80211_TX_QUEUE_* constants. Must be atomic.
+ *
+ * @get_tx_stats: Get statistics of the current TX queue status. This is used
+ * to get number of currently queued packets (queue length), maximum queue
+ * size (limit), and total number of packets sent using each TX queue
+ * (count). This information is used for WMM to find out which TX
+ * queues have room for more packets and by hostapd to provide
+ * statistics about the current queueing state to external programs.
+ *
+ * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
+ * this is only used for IBSS mode debugging and, as such, is not a
+ * required function. Must be atomic.
+ *
+ * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize
+ * with other STAs in the IBSS. This is only used in IBSS mode. This
+ * function is optional if the firmware/hardware takes full care of
+ * TSF synchronization.
+ *
+ * @handle_ba_action: Call low level driver with 11n Block Ack action
+ *
+ * @conf_ht: Configure HT parameters.
+ *
+ * @get_ht_capab: Get HT capabilities from the device
+ *
+ * @beacon_update: Setup beacon data for IBSS beacons. Unlike access point,
+ * IBSS uses a fixed beacon frame which is configured using this
+ * function. This handler is required only for IBSS mode.
+ *
+ * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
+ * This is needed only for IBSS mode and the result of this function is
+ * used to determine whether to reply to Probe Requests.
+ */
struct ieee80211_ops {
- /* Handler that 802.11 module calls for each transmitted frame.
- * skb contains the buffer starting from the IEEE 802.11 header.
- * The low-level driver should send the frame out based on
- * configuration in the TX control data.
- * Must be atomic. */
int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ieee80211_tx_control *control);
-
- /*
- * Called before the first netdevice attached to the hardware
- * is enabled. This should turn on the hardware and must turn on
- * frame reception (for possibly enabled monitor interfaces.)
- * Returns negative error codes, these may be seen in userspace,
- * or zero.
- * When the device is started it should not have a MAC address
- * to avoid acknowledging frames before a non-monitor device
- * is added.
- *
- * Must be implemented.
- */
int (*start)(struct ieee80211_hw *hw);
-
- /*
- * Called after last netdevice attached to the hardware
- * is disabled. This should turn off the hardware (at least
- * it must turn off frame reception.)
- * May be called right after add_interface if that rejects
- * an interface.
- *
- * Must be implemented.
- */
void (*stop)(struct ieee80211_hw *hw);
-
- /*
- * Called when a netdevice attached to the hardware is enabled.
- * Because it is not called for monitor mode devices, open()
- * and stop() must be implemented.
- * The driver should perform any initialization it needs before
- * the device can be enabled. The initial configuration for the
- * interface is given in the conf parameter.
- *
- * Must be implemented.
- */
int (*add_interface)(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf);
-
- /*
- * Notifies a driver that an interface is going down. The stop() handler
- * is called after this if it is the last interface and no monitor
- * interfaces are present.
- * When all interfaces are removed, the MAC address in the hardware
- * must be cleared so the device no longer acknowledges packets,
- * the mac_addr member of the conf structure is, however, set to the
- * MAC address of the device going away.
- *
- * Hence, this callback must be implemented.
- */
void (*remove_interface)(struct ieee80211_hw *hw,
struct ieee80211_if_init_conf *conf);
-
- /* Handler for configuration requests. IEEE 802.11 code calls this
- * function to change hardware configuration, e.g., channel. */
int (*config)(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
-
- /* Handler for configuration requests related to interfaces (e.g.
- * BSSID). */
int (*config_interface)(struct ieee80211_hw *hw,
int if_id, struct ieee80211_if_conf *conf);
-
- /*
- * Configure the device's RX filter.
- *
- * The multi_count parameter tells how many multicast addresses are
- * enabled. Use ieee80211_get_mc_list_item() to get the items.
- * It will be -1 if the IEEE80211_HW_MULTICAST_FILTER flag is not
- * included in the features or if the multicast list hasn't changed
- * since the last call, otherwise the number of multicast addresses.
- *
- * NOTE: If the count is -1 then you may not call
- * ieee80211_get_mc_list_item() from this function!
- *
- * NOTE: The count currently doesn't take into account duplicate
- * addresses from different virtual interfaces!
- *
- * All unsupported flags in 'total_flags' must be cleared,
- * clear all bits except those you honoured.
- *
- * Must be atomic due to running under the tx lock.
- *
- * This callback is must be implemented.
- */
void (*configure_filter)(struct ieee80211_hw *hw, int multi_count,
unsigned int changed_flags,
unsigned int *total_flags);
-
- /* Set TIM bit handler. If the hardware/firmware takes care of beacon
- * generation, IEEE 802.11 code uses this function to tell the
- * low-level to set (or clear if set==0) TIM bit for the given aid. If
- * host system is used to generate beacons, this handler is not used
- * and low-level driver should set it to NULL.
- * Must be atomic. */
int (*set_tim)(struct ieee80211_hw *hw, int aid, int set);
-
- /*
- * Set encryption key.
- *
- * This is called to enable hardware acceleration of encryption and
- * decryption. The address will be the broadcast address for default
- * keys, the other station's hardware address for individual keys or
- * the zero address for keys that will be used only for transmission.
- *
- * The local_address parameter will always be set to our own address,
- * this is only relevant if you support multiple local addresses.
- *
- * When transmitting, the TX control data will use the hw_key_idx
- * selected by the low-level driver.
- *
- * If you support multiple MAC addresses but only hardware acceleration
- * based on the transmitter address, you should keep a list of all
- * keys that are currently enabled (use the key conf's driver_keylist
- * member) and call ieee80211_key_removed() for all keys that you had
- * to remove.
- * Note that you should only do that if you're unable to use the key
- * for transmission afterwards, if you only disabled it for reception
- * you should not call ieee80211_key_removed() because that will also
- * remove the key for transmission.
- *
- * Return 0 if the key is now in use, -EOPNOTSUPP or -ENOSPC if it
- * couldn't be added; if you return 0 then hw_key_idx must be
- * assigned to something other than HW_KEY_IDX_INVALID. When the cmd
- * is DISABLE_KEY then it must succeed.
- *
- * Note that it is permissible to not decrypt a frame even if a key
- * for it has been uploaded to hardware, the stack will not make any
- * decision based on whether a key has been uploaded or not but rather
- * based on the receive flags.
- *
- * This callback can sleep, and is only called between add_interface
- * and remove_interface calls, i.e. while the interface with the
- * given local_address is enabled.
- *
- * The ieee80211_key_conf structure pointed to by the key parameter
- * is guaranteed to be valid until another call to set_key removes
- * it or until the driver calls ieee80211_key_removed(), it can
- * especially be used as a cookie to differentiate transmit-only keys
- * since multiple such keys may be present.
- */
int (*set_key)(struct ieee80211_hw *hw, set_key_cmd cmd,
const u8 *local_address, const u8 *address,
struct ieee80211_key_conf *key);
-
- /* Enable/disable IEEE 802.1X. This item requests wlan card to pass
- * unencrypted EAPOL-Key frames even when encryption is configured.
- * If the wlan card does not require such a configuration, this
- * function pointer can be set to NULL. */
int (*set_ieee8021x)(struct ieee80211_hw *hw, int use_ieee8021x);
-
- /* Set port authorization state (IEEE 802.1X PAE) to be authorized
- * (authorized=1) or unauthorized (authorized=0). This function can be
- * used if the wlan hardware or low-level driver implements PAE.
- * 80211.o module will anyway filter frames based on authorization
- * state, so this function pointer can be NULL if low-level driver does
- * not require event notification about port state changes. */
int (*set_port_auth)(struct ieee80211_hw *hw, u8 *addr,
int authorized);
-
- /* Ask the hardware to service the scan request, no need to start
- * the scan state machine in stack. */
int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len);
-
- /* return low-level statistics */
int (*get_stats)(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats);
-
- /* For devices that generate their own beacons and probe response
- * or association responses this updates the state of privacy_invoked
- * returns 0 for success or an error number */
int (*set_privacy_invoked)(struct ieee80211_hw *hw,
int privacy_invoked);
-
- /* For devices that have internal sequence counters, allow 802.11
- * code to access the current value of a counter */
int (*get_sequence_counter)(struct ieee80211_hw *hw,
u8* addr, u8 keyidx, u8 txrx,
u32* iv32, u16* iv16);
-
- /* Configuration of RTS threshold (if device needs it) */
int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
-
- /* Configuration of fragmentation threshold.
- * Assign this if the device does fragmentation by itself,
- * if this method is assigned then the stack will not do
- * fragmentation. */
int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
-
- /* Configuration of retry limits (if device needs it) */
int (*set_retry_limit)(struct ieee80211_hw *hw,
u32 short_retry, u32 long_retr);
-
- /* Number of STAs in STA table notification (NULL = disabled).
- * Must be atomic. */
void (*sta_table_notification)(struct ieee80211_hw *hw,
int num_sta);
-
- /* Handle ERP IE change notifications. Must be atomic. */
void (*erp_ie_changed)(struct ieee80211_hw *hw, u8 changes,
int cts_protection, int preamble);
-
- /* Flags for the erp_ie_changed changes parameter */
-#define IEEE80211_ERP_CHANGE_PROTECTION (1<<0) /* protection flag changed */
-#define IEEE80211_ERP_CHANGE_PREAMBLE (1<<1) /* barker preamble mode changed */
-
- /* Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
- * bursting) for a hardware TX queue.
- * queue = IEEE80211_TX_QUEUE_*.
- * Must be atomic. */
int (*conf_tx)(struct ieee80211_hw *hw, int queue,
const struct ieee80211_tx_queue_params *params);
-
- /* Get statistics of the current TX queue status. This is used to get
- * number of currently queued packets (queue length), maximum queue
- * size (limit), and total number of packets sent using each TX queue
- * (count). This information is used for WMM to find out which TX
- * queues have room for more packets and by hostapd to provide
- * statistics about the current queueing state to external programs. */
int (*get_tx_stats)(struct ieee80211_hw *hw,
struct ieee80211_tx_queue_stats *stats);
-
- /* Get the current TSF timer value from firmware/hardware. Currently,
- * this is only used for IBSS mode debugging and, as such, is not a
- * required function.
- * Must be atomic. */
u64 (*get_tsf)(struct ieee80211_hw *hw);
-
- /* Reset the TSF timer and allow firmware/hardware to synchronize with
- * other STAs in the IBSS. This is only used in IBSS mode. This
- * function is optional if the firmware/hardware takes full care of
- * TSF synchronization. */
void (*reset_tsf)(struct ieee80211_hw *hw);
#ifdef CONFIG_MAC80211_HT
- /* Call low level driver with 11n Block Ack action */
int (*handle_ba_action)(struct ieee80211_hw *hw,
struct ieee80211_mgmt *mgmt);
-
- /* Configure ht parameters. */
int (*conf_ht)(struct ieee80211_hw *hw,
struct ieee80211_ht_capability *ht_cap_param,
struct ieee80211_ht_additional_info *ht_extra_param);
-
- /* Get ht capabilities from the device */
void (*get_ht_capab)(struct ieee80211_hw *hw,
struct ieee80211_ht_capability *ht_cap_param);
-
#endif /* CONFIG_MAC80211_HT */
- /* Setup beacon data for IBSS beacons. Unlike access point (Master),
- * IBSS uses a fixed beacon frame which is configured using this
- * function. This handler is required only for IBSS mode. */
int (*beacon_update)(struct ieee80211_hw *hw,
struct sk_buff *skb,
struct ieee80211_tx_control *control);
-
- /* Determine whether the last IBSS beacon was sent by us. This is
- * needed only for IBSS mode and the result of this function is used to
- * determine whether to reply to Probe Requests. */
int (*tx_last_beacon)(struct ieee80211_hw *hw);
};
-/* Allocate a new hardware device. This must be called once for each
- * hardware device. The returned pointer must be used to refer to this
- * device when calling other functions. 802.11 code allocates a private data
- * area for the low-level driver. The size of this area is given as
- * priv_data_len.
+/**
+ * ieee80211_alloc_hw - Allocate a new hardware device
+ *
+ * This must be called once for each hardware device. The returned pointer
+ * must be used to refer to this device when calling other functions.
+ * mac80211 allocates a private data area for the driver pointed to by
+ * @priv in &struct ieee80211_hw, the size of this area is given as
+ * @priv_data_len.
+ *
+ * @priv_data_len: length of private data
+ * @ops: callbacks for this device
*/
struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
const struct ieee80211_ops *ops);
-/* Register hardware device to the IEEE 802.11 code and kernel. Low-level
- * drivers must call this function before using any other IEEE 802.11
- * function except ieee80211_register_hwmode. */
+/**
+ * ieee80211_register_hw - Register hardware device
+ *
+ * You must call this function before any other functions
+ * except ieee80211_register_hwmode.
+ *
+ * @hw: the device to register as returned by ieee80211_alloc_hw()
+ */
int ieee80211_register_hw(struct ieee80211_hw *hw);
-/* driver can use this and ieee80211_get_rx_led_name to get the
- * name of the registered LEDs after ieee80211_register_hw
- * was called.
- * This is useful to set the default trigger on the LED class
- * device that your driver should export for each LED the device
- * has, that way the default behaviour will be as expected but
- * the user can still change it/turn off the LED etc.
- */
#ifdef CONFIG_MAC80211_LEDS
extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw);
extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw);
#endif
+/**
+ * ieee80211_get_tx_led_name - get name of TX LED
+ *
+ * mac80211 creates a transmit LED trigger for each wireless hardware
+ * that can be used to drive LEDs if your driver registers a LED device.
+ * This function returns the name (or %NULL if not configured for LEDs)
+ * of the trigger so you can automatically link the LED device.
+ *
+ * @hw: the hardware to get the LED trigger name for
+ */
static inline char *ieee80211_get_tx_led_name(struct ieee80211_hw *hw)
{
#ifdef CONFIG_MAC80211_LEDS
@@ -955,6 +1046,16 @@ static inline char *ieee80211_get_tx_led
#endif
}
+/**
+ * ieee80211_get_rx_led_name - get name of RX LED
+ *
+ * mac80211 creates a receive LED trigger for each wireless hardware
+ * that can be used to drive LEDs if your driver registers a LED device.
+ * This function returns the name (or %NULL if not configured for LEDs)
+ * of the trigger so you can automatically link the LED device.
+ *
+ * @hw: the hardware to get the LED trigger name for
+ */
static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw)
{
#ifdef CONFIG_MAC80211_LEDS
@@ -968,29 +1069,80 @@ static inline char *ieee80211_get_rx_led
int ieee80211_register_hwmode(struct ieee80211_hw *hw,
struct ieee80211_hw_mode *mode);
-/* Unregister a hardware device. This function instructs 802.11 code to free
- * allocated resources and unregister netdevices from the kernel. */
+/**
+ * ieee80211_unregister_hw - Unregister a hardware device
+ *
+ * This function instructs mac80211 to free allocated resources
+ * and unregister netdevices from the networking subsystem.
+ *
+ * @hw: the hardware to unregister
+ */
void ieee80211_unregister_hw(struct ieee80211_hw *hw);
-/* Free everything that was allocated including private data of a driver. */
+/**
+ * ieee80211_free_hw - free hardware descriptor
+ *
+ * This function frees everything that was allocated, including the
+ * private data for the driver. You must call ieee80211_unregister_hw()
+ * before calling this function
+ *
+ * @hw: the hardware to free
+ */
void ieee80211_free_hw(struct ieee80211_hw *hw);
-/* Receive frame callback function. The low-level driver uses this function to
- * send received frames to the IEEE 802.11 code. Receive buffer (skb) must
- * start with IEEE 802.11 header. */
+/* trick to avoid symbol clashes with the ieee80211 subsystem */
void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ieee80211_rx_status *status);
+
+/**
+ * ieee80211_rx - receive frame
+ *
+ * Use this function to hand received frames to mac80211. The receive
+ * buffer in @skb must start with an IEEE 802.11 header or a radiotap
+ * header if %RX_FLAG_RADIOTAP is set in the @status flags.
+ *
+ * This function may not be called in IRQ context.
+ *
+ * @hw: the hardware this frame came in on
+ * @skb: the buffer to receive, owned by mac80211 after this call
+ * @status: status of this frame; the status pointer need not be valid
+ * after this function returns
+ */
+static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
+ struct ieee80211_rx_status *status)
+{
+ __ieee80211_rx(hw, skb, status);
+}
+
+/**
+ * ieee80211_rx_irqsafe - receive frame
+ *
+ * Like ieee80211_rx() but can be called in IRQ context
+ * (internally defers to a workqueue.)
+ *
+ * @hw: the hardware this frame came in on
+ * @skb: the buffer to receive, owned by mac80211 after this call
+ * @status: status of this frame; the status pointer need not be valid
+ * after this function returns and is not freed by mac80211,
+ * it is recommended that it points to a stack area
+ */
void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
struct sk_buff *skb,
struct ieee80211_rx_status *status);
-/* Transmit status callback function. The low-level driver must call this
- * function to report transmit status for all the TX frames that had
- * req_tx_status set in the transmit control fields. In addition, this should
- * be called at least for all unicast frames to provide information for TX rate
- * control algorithm. In order to maintain all statistics, this function is
- * recommended to be called after each frame, including multicast/broadcast, is
- * sent. */
+/**
+ * ieee80211_tx_status - transmit status callback
+ *
+ * Call this function for all transmitted frames after they have been
+ * transmitted. It is permissible to not call this function for
+ * multicast frames but this can affect statistics.
+ *
+ * @hw: the hardware the frame was transmitted by
+ * @skb: the frame that was transmitted, owned by mac80211 after this call
+ * @status: status information for this frame; the status pointer need not
+ * be valid after this function returns and is not freed by mac80211,
+ * it is recommended that it points to a stack area
+ */
void ieee80211_tx_status(struct ieee80211_hw *hw,
struct sk_buff *skb,
struct ieee80211_tx_status *status);
@@ -1122,14 +1274,26 @@ struct sk_buff *
ieee80211_get_buffered_bc(struct ieee80211_hw *hw, int if_id,
struct ieee80211_tx_control *control);
-/* Given an sk_buff with a raw 802.11 header at the data pointer this function
+/**
+ * ieee80211_get_hdrlen_from_skb - get header length from data
+ *
+ * Given an skb with a raw 802.11 header at the data pointer this function
* returns the 802.11 header length in bytes (not including encryption
* headers). If the data in the sk_buff is too short to contain a valid 802.11
* header the function returns 0.
+ *
+ * @skb: the frame
*/
int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
-/* Like ieee80211_get_hdrlen_from_skb() but takes a FC in CPU order. */
+/**
+ * ieee80211_get_hdrlen - get header length from frame control
+ *
+ * This function returns the 802.11 header length in bytes (not including
+ * encryption headers.)
+ *
+ * @fc: the frame control field (in CPU endianness)
+ */
int ieee80211_get_hdrlen(u16 fc);
/**
@@ -1205,10 +1369,28 @@ ieee80211_get_mc_list_item(struct ieee80
*/
void ieee80211_key_removed(struct ieee80211_key_conf *keyconf);
-/* called by driver to notify scan status completed */
+/**
+ * ieee80211_scan_completed - completed hardware scan
+ *
+ * When hardware scan offload is used (i.e. the hw_scan() callback is
+ * assigned) this function needs to be called by the driver to notify
+ * mac80211 that the scan finished.
+ *
+ * @hw: the hardware that finished the scan
+ */
void ieee80211_scan_completed(struct ieee80211_hw *hw);
-/* return a pointer to the source address (SA) */
+/**
+ * ieee80211_get_SA - get pointer to SA
+ *
+ * Given an 802.11 frame, this function returns the offset
+ * to the source address (SA). It does not verify that the
+ * header is long enough to contain the address, and the
+ * header must be long enough to contain the frame control
+ * field.
+ *
+ * @hdr: the frame
+ */
static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr)
{
u8 *raw = (u8 *) hdr;
@@ -1223,7 +1405,17 @@ static inline u8 *ieee80211_get_SA(struc
return hdr->addr2;
}
-/* return a pointer to the destination address (DA) */
+/**
+ * ieee80211_get_DA - get pointer to DA
+ *
+ * Given an 802.11 frame, this function returns the offset
+ * to the destination address (DA). It does not verify that
+ * the header is long enough to contain the address, and the
+ * header must be long enough to contain the frame control
+ * field.
+ *
+ * @hdr: the frame
+ */
static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
{
u8 *raw = (u8 *) hdr;
@@ -1234,6 +1426,14 @@ static inline u8 *ieee80211_get_DA(struc
return hdr->addr1;
}
+/**
+ * ieee80211_get_morefrag - determine whether the MOREFRAGS bit is set
+ *
+ * This function determines whether the "more fragments" bit is set
+ * in the frame.
+ *
+ * @hdr: the frame
+ */
static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr)
{
return (le16_to_cpu(hdr->frame_control) &
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 03/11] wireless networking: move frame inline functions to generic header
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
2007-08-23 16:45 ` [RFC 01/11] mac80211: renumber and document the hardware flags Johannes Berg
2007-08-23 16:45 ` [RFC 02/11] mac80211: document a lot more Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-23 16:45 ` [RFC 04/11] mac80211: yet more documentation Johannes Berg
` (7 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
These inlines are generally useful, not just with mac80211.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/linux/ieee80211.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++
include/net/mac80211.h | 60 ----------------------------------------------
2 files changed, 60 insertions(+), 60 deletions(-)
--- wireless-dev.orig/include/linux/ieee80211.h 2007-08-23 18:22:33.251897709 +0200
+++ wireless-dev/include/linux/ieee80211.h 2007-08-23 18:23:22.721897709 +0200
@@ -581,4 +581,64 @@ enum wifi_oui_stype_wmm {
WIFI_OUI_STYPE_WMM_TSPEC = 2,
};
+/**
+ * ieee80211_get_SA - get pointer to SA
+ *
+ * Given an 802.11 frame, this function returns the offset
+ * to the source address (SA). It does not verify that the
+ * header is long enough to contain the address, and the
+ * header must be long enough to contain the frame control
+ * field.
+ *
+ * @hdr: the frame
+ */
+static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr)
+{
+ u8 *raw = (u8 *) hdr;
+ u8 tofrom = (*(raw+1)) & 3; /* get the TODS and FROMDS bits */
+
+ switch (tofrom) {
+ case 2:
+ return hdr->addr3;
+ case 3:
+ return hdr->addr4;
+ }
+ return hdr->addr2;
+}
+
+/**
+ * ieee80211_get_DA - get pointer to DA
+ *
+ * Given an 802.11 frame, this function returns the offset
+ * to the destination address (DA). It does not verify that
+ * the header is long enough to contain the address, and the
+ * header must be long enough to contain the frame control
+ * field.
+ *
+ * @hdr: the frame
+ */
+static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
+{
+ u8 *raw = (u8 *) hdr;
+ u8 to_ds = (*(raw+1)) & 1; /* get the TODS bit */
+
+ if (to_ds)
+ return hdr->addr3;
+ return hdr->addr1;
+}
+
+/**
+ * ieee80211_get_morefrag - determine whether the MOREFRAGS bit is set
+ *
+ * This function determines whether the "more fragments" bit is set
+ * in the frame.
+ *
+ * @hdr: the frame
+ */
+static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr)
+{
+ return (le16_to_cpu(hdr->frame_control) &
+ IEEE80211_FCTL_MOREFRAGS) != 0;
+}
+
#endif /* IEEE80211_H */
--- wireless-dev.orig/include/net/mac80211.h 2007-08-23 18:22:33.281897709 +0200
+++ wireless-dev/include/net/mac80211.h 2007-08-23 18:23:22.731897709 +0200
@@ -1380,66 +1380,6 @@ void ieee80211_key_removed(struct ieee80
*/
void ieee80211_scan_completed(struct ieee80211_hw *hw);
-/**
- * ieee80211_get_SA - get pointer to SA
- *
- * Given an 802.11 frame, this function returns the offset
- * to the source address (SA). It does not verify that the
- * header is long enough to contain the address, and the
- * header must be long enough to contain the frame control
- * field.
- *
- * @hdr: the frame
- */
-static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr)
-{
- u8 *raw = (u8 *) hdr;
- u8 tofrom = (*(raw+1)) & 3; /* get the TODS and FROMDS bits */
-
- switch (tofrom) {
- case 2:
- return hdr->addr3;
- case 3:
- return hdr->addr4;
- }
- return hdr->addr2;
-}
-
-/**
- * ieee80211_get_DA - get pointer to DA
- *
- * Given an 802.11 frame, this function returns the offset
- * to the destination address (DA). It does not verify that
- * the header is long enough to contain the address, and the
- * header must be long enough to contain the frame control
- * field.
- *
- * @hdr: the frame
- */
-static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
-{
- u8 *raw = (u8 *) hdr;
- u8 to_ds = (*(raw+1)) & 1; /* get the TODS bit */
-
- if (to_ds)
- return hdr->addr3;
- return hdr->addr1;
-}
-
-/**
- * ieee80211_get_morefrag - determine whether the MOREFRAGS bit is set
- *
- * This function determines whether the "more fragments" bit is set
- * in the frame.
- *
- * @hdr: the frame
- */
-static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr)
-{
- return (le16_to_cpu(hdr->frame_control) &
- IEEE80211_FCTL_MOREFRAGS) != 0;
-}
-
#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC_ARG(x) ((u8*)(x))[0], ((u8*)(x))[1], ((u8*)(x))[2], \
((u8*)(x))[3], ((u8*)(x))[4], ((u8*)(x))[5]
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 04/11] mac80211: yet more documentation
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
` (2 preceding siblings ...)
2007-08-23 16:45 ` [RFC 03/11] wireless networking: move frame inline functions to generic header Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-23 16:45 ` [RFC 05/11] mac80211: remove tx info sw_retry_attempt member Johannes Berg
` (6 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/mac80211.h | 209 ++++++++++++++++++++++++++++++++++++-------------
1 file changed, 156 insertions(+), 53 deletions(-)
--- wireless-dev.orig/include/net/mac80211.h 2007-08-23 18:38:39.231897709 +0200
+++ wireless-dev/include/net/mac80211.h 2007-08-23 18:38:41.511897709 +0200
@@ -121,44 +121,100 @@ struct ieee80211_rate {
* optimizing channel utilization estimates */
};
-/* 802.11g is backwards-compatible with 802.11b, so a wlan card can
- * actually be both in 11b and 11g modes at the same time. */
-enum {
- MODE_IEEE80211A, /* IEEE 802.11a */
- MODE_IEEE80211B, /* IEEE 802.11b only */
- MODE_ATHEROS_TURBO, /* Atheros Turbo mode (2x.11a at 5 GHz) */
- MODE_IEEE80211G, /* IEEE 802.11g (and 802.11b compatibility) */
- MODE_ATHEROS_TURBOG, /* Atheros Turbo mode (2x.11g at 2.4 GHz) */
+/**
+ * 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
+ * @MODE_ATHEROS_TURBO: Atheros Turbo mode in 5 GHz
+ * @MODE_ATHEROS_TURBOG: Atheros Turbo mode in 2.4 GHz
+ * @NUM_IEEE80211_MODES: internal
+ */
+enum ieee80211_phymode {
+ MODE_IEEE80211A,
+ MODE_IEEE80211B,
+ MODE_ATHEROS_TURBO,
+ MODE_IEEE80211G,
+ MODE_ATHEROS_TURBOG,
/* keep last */
NUM_IEEE80211_MODES
};
+/**
+ * struct ieee80211_hw_mode - PHY mode definition
+ *
+ * This structure describes the capabilities supported by the device
+ * in a single PHY mode.
+ *
+ * @mode: the PHY mode for this definition
+ * @num_channels: number of supported channels
+ * @channels: pointer to array of supported channels
+ * @num_rates: number of supported bitrates
+ * @rates: pointer to array of supported bitrates
+ * @list: internal
+ */
struct ieee80211_hw_mode {
- int mode; /* MODE_IEEE80211... */
- int num_channels; /* Number of channels (below) */
- struct ieee80211_channel *channels; /* Array of supported channels */
- int num_rates; /* Number of rates (below) */
- struct ieee80211_rate *rates; /* Array of supported rates */
-
- struct list_head list; /* Internal, don't touch */
+ struct list_head list;
+ struct ieee80211_channel *channels;
+ struct ieee80211_rate *rates;
+ enum ieee80211_phymode mode;
+ int num_channels;
+ int num_rates;
};
+/**
+ * struct ieee80211_tx_queue_params - transmit queue configuration
+ *
+ * The information provided in this structure is required for QoS
+ * transmit queue configuration.
+ *
+ * @aifs: arbitration interface space [0..255, -1: use default]
+ * @cw_min: minimum contention window [will be a value of the form
+ * 2^n-1 in the range 1..1023; 0: use default]
+ * @cw_max: maximum contention window [like @cw_min]
+ * @burst_time: maximum burst time in units of 0.1ms, 0 meaning disabled
+ */
struct ieee80211_tx_queue_params {
- int aifs; /* 0 .. 255; -1 = use default */
- int cw_min; /* 2^n-1: 1, 3, 7, .. , 1023; 0 = use default */
- int cw_max; /* 2^n-1: 1, 3, 7, .. , 1023; 0 = use default */
- int burst_time; /* maximum burst time in 0.1 ms (i.e., 10 = 1 ms);
- * 0 = disabled */
+ int aifs;
+ int cw_min;
+ int cw_max;
+ int burst_time;
};
+/**
+ * struct ieee80211_tx_queue_stats_data - transmit queue statistics
+ *
+ * @len: number of packets in queue
+ * @limit: queue length limit
+ * @count: number of frames sent
+ */
struct ieee80211_tx_queue_stats_data {
- unsigned int len; /* num packets in queue */
- unsigned int limit; /* queue len (soft) limit */
- unsigned int count; /* total num frames sent */
+ unsigned int len;
+ unsigned int limit;
+ unsigned int count;
};
-enum {
+/**
+ * enum ieee80211_tx_queue - transmit queue number
+ *
+ * These constants are used with some callbacks that take a
+ * queue number to set parameters for a queue.
+ *
+ * @IEEE80211_TX_QUEUE_DATA0: data queue 0
+ * @IEEE80211_TX_QUEUE_DATA1: data queue 1
+ * @IEEE80211_TX_QUEUE_DATA2: data queue 2
+ * @IEEE80211_TX_QUEUE_DATA3: data queue 3
+ * @IEEE80211_TX_QUEUE_DATA4: data queue 4
+ * @IEEE80211_TX_QUEUE_SVP: ??
+ * @NUM_TX_DATA_QUEUES: number of data queues
+ * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
+ * sent after a beacon
+ * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
+ */
+enum ieee80211_tx_queue {
IEEE80211_TX_QUEUE_DATA0,
IEEE80211_TX_QUEUE_DATA1,
IEEE80211_TX_QUEUE_DATA2,
@@ -295,7 +351,7 @@ struct ieee80211_rx_status {
u64 mactime;
int freq;
int channel;
- int phymode;
+ enum ieee80211_phymode phymode;
int ssi;
int signal;
int noise;
@@ -304,25 +360,67 @@ struct ieee80211_rx_status {
int flag;
};
-/* Transmit status. The low-level driver should provide this information
- * (the subset supported by hardware) to the 802.11 code for each transmit
- * frame. */
+/**
+ * enum ieee80211_tx_status_flags - transmit status flags
+ *
+ * Status flags to indicate various transmit conditions.
+ *
+ * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted
+ * because the destination STA was in powersave mode.
+ *
+ * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged
+ */
+enum ieee80211_tx_status_flags {
+ IEEE80211_TX_STATUS_TX_FILTERED = 1<<0,
+ IEEE80211_TX_STATUS_ACK = 1<<1,
+};
+
+/**
+ * struct ieee80211_tx_status - transmit status
+ *
+ * As much information as possible should be provided for each transmitted
+ * frame with ieee80211_tx_status().
+ *
+ * @control: a copy of the &struct ieee80211_tx_control passed to the driver
+ * in the tx() callback.
+ *
+ * @flags: transmit status flags, defined above
+ *
+ * @ack_signal: signal strength of the ACK frame
+ *
+ * @excessive_retries: set to 1 if the frame was retried many times
+ * but not acknowledged
+ *
+ * @retry_count: number of retries
+ *
+ * @queue_length: ?? REMOVE
+ * @queue_number: ?? REMOVE
+ */
struct ieee80211_tx_status {
- /* copied ieee80211_tx_control structure */
struct ieee80211_tx_control control;
-
-#define IEEE80211_TX_STATUS_TX_FILTERED (1<<0)
-#define IEEE80211_TX_STATUS_ACK (1<<1) /* whether the TX frame was ACKed */
- u32 flags; /* tx staus flags defined above */
-
- int ack_signal; /* measured signal strength of the ACK frame */
- int excessive_retries;
- int retry_count;
-
- int queue_length; /* information about TX queue */
+ u8 flags;
+ bool excessive_retries;
+ u8 retry_count;
+ int ack_signal;
+ int queue_length;
int queue_number;
};
+/**
+ * enum ieee80211_conf_flags - configuration flags
+ *
+ * Flags to define PHY configuration options
+ *
+ * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
+ * @IEEE80211_CONF_SSID_HIDDEN: do not broadcast the SSID [make per-if option]
+ * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
+ *
+ */
+enum ieee80211_conf_flags {
+ IEEE80211_CONF_SHORT_SLOT_TIME = 1<<0,
+ IEEE80211_CONF_SSID_HIDDEN = 1<<1,
+ IEEE80211_CONF_RADIOTAP = 1<<2,
+};
/**
* struct ieee80211_conf - configuration of the device
@@ -330,32 +428,37 @@ struct ieee80211_tx_status {
* This struct indicates how the driver shall configure the hardware.
*
* @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
+ * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
+ * 1/2: antenna 0/1
+ * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
*/
struct ieee80211_conf {
int channel; /* IEEE 802.11 channel number */
int freq; /* MHz */
int channel_val; /* hw specific value for the channel */
- int phymode; /* MODE_IEEE80211A, .. */
+ enum ieee80211_phymode phymode;
struct ieee80211_channel *chan;
struct ieee80211_hw_mode *mode;
unsigned int regulatory_domain;
int radio_enabled;
int beacon_int;
-
-#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<0) /* use IEEE 802.11g Short Slot
- * Time */
-#define IEEE80211_CONF_SSID_HIDDEN (1<<1) /* do not broadcast the ssid */
-#define IEEE80211_CONF_RADIOTAP (1<<2) /* use radiotap if supported
- check this bit at RX time */
- u32 flags; /* configuration flags defined above */
-
- u8 power_level; /* transmit power limit for current
- * regulatory domain; in dBm */
- u8 antenna_max; /* maximum antenna gain */
-
- /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */
+ u32 flags;
+ u8 power_level;
+ u8 antenna_max;
u8 antenna_sel_tx;
u8 antenna_sel_rx;
};
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 05/11] mac80211: remove tx info sw_retry_attempt member
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
` (3 preceding siblings ...)
2007-08-23 16:45 ` [RFC 04/11] mac80211: yet more documentation Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-23 16:45 ` [RFC 06/11] mac80211: remove HW_KEY_IDX_INVALID Johannes Berg
` (5 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
This is unused.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/mac80211.h | 3 ---
1 file changed, 3 deletions(-)
--- wireless-dev.orig/include/net/mac80211.h 2007-08-23 18:38:41.511897709 +0200
+++ wireless-dev/include/net/mac80211.h 2007-08-23 18:38:42.511897709 +0200
@@ -288,9 +288,6 @@ struct ieee80211_tx_control {
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 */
- u8 sw_retry_attempt; /* number of times hw has tried to
- * transmit frame (not incl. hw retries) */
-
struct ieee80211_rate *rate; /* internal 80211.o rate */
struct ieee80211_rate *rts_rate; /* internal 80211.o rate
* for RTS/CTS */
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 06/11] mac80211: remove HW_KEY_IDX_INVALID
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
` (4 preceding siblings ...)
2007-08-23 16:45 ` [RFC 05/11] mac80211: remove tx info sw_retry_attempt member Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-23 21:01 ` Michael Buesch
2007-08-23 16:45 ` [RFC 07/11] mac80211: print out wiphy name instead of master device Johannes Berg
` (4 subsequent siblings)
10 siblings, 1 reply; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
This patch makes the mac80211/driver interface rely only on the
IEEE80211_TXCTL_DO_NOT_ENCRYPT flag to signal to the driver whether
a frame should be encrypted or not, since mac80211 internally no
longer relies on HW_KEY_IDX_INVALID either this removes it, changes
the key index to be an integer in all places and makes the full
range of the value available to drivers.
---
include/net/mac80211.h | 15 +++++++--------
net/mac80211/key.c | 5 -----
net/mac80211/tx.c | 7 +++----
net/mac80211/wpa.c | 8 ++++----
4 files changed, 14 insertions(+), 21 deletions(-)
--- wireless-dev.orig/include/net/mac80211.h 2007-08-23 18:38:42.511897709 +0200
+++ wireless-dev/include/net/mac80211.h 2007-08-23 18:38:43.161897709 +0200
@@ -245,7 +245,6 @@ struct ieee80211_low_level_stats {
/* Transmit control fields. This data structure is passed to low-level driver
* with each TX frame. The low-level driver is responsible for configuring
* the hardware to use given values (depending on what is supported). */
-#define HW_KEY_IDX_INVALID -1
struct ieee80211_tx_control {
int tx_rate; /* Transmit rate, given as the hw specific value for the
@@ -277,13 +276,13 @@ struct ieee80211_tx_control {
* long retry value */
u32 flags; /* tx control flags defined
* above */
+ int key_idx; /* keyidx from hw->set_key(), undefined if
+ * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */
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 */
- s8 key_idx; /* HW_KEY_IDX_INVALID = do not encrypt,
- * other values: keyidx from hw->set_key() */
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;
@@ -594,8 +593,7 @@ enum ieee80211_key_flags {
*
* @hw_key_idx: To be set by the driver, this is the key index the driver
* wants to be given when a frame is transmitted and needs to be
- * encrypted in hardware. It defaults to %HW_KEY_IDX_INVALID which
- * the driver may not use.
+ * encrypted in hardware.
* @alg: The key algorithm.
* @driver_keylist: for use by the driver
* @flags: key flags, see &enum ieee80211_key_flags.
@@ -791,9 +789,10 @@ static inline void SET_IEEE80211_PERM_AD
*
* The set_key() call for the %SET_KEY command should return 0 if
* the key is now in use, -%EOPNOTSUPP or -%ENOSPC if it couldn't be
- * added; if it returns 0 then hw_key_idx must be assigned to something
- * other than %HW_KEY_IDX_INVALID. When the cmd is %DISABLE_KEY then
- * it must succeed.
+ * added; if it returns 0 then hw_key_idx must be assigned to the key
+ * index the driver would like to get in the tx() call.
+ *
+ * When the cmd is %DISABLE_KEY then it must succeed.
*
* Note that it is permissible to not decrypt a frame even if a key
* for it has been uploaded to hardware, the stack will not make any
--- wireless-dev.orig/net/mac80211/key.c 2007-08-23 18:38:38.701897709 +0200
+++ wireless-dev/net/mac80211/key.c 2007-08-23 18:38:43.161897709 +0200
@@ -69,8 +69,6 @@ static void ieee80211_key_enable_hw_acce
key->sdata->dev->dev_addr, addr,
&key->conf);
- WARN_ON(!ret && (key->conf.hw_key_idx == HW_KEY_IDX_INVALID));
-
if (!ret)
key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
@@ -105,7 +103,6 @@ static void ieee80211_key_disable_hw_acc
key->conf.keyidx, MAC_ARG(addr), ret);
key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
- key->conf.hw_key_idx = HW_KEY_IDX_INVALID;
}
/*
@@ -122,7 +119,6 @@ void ieee80211_key_removed(struct ieee80
return;
key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
- key->conf.hw_key_idx = HW_KEY_IDX_INVALID;
}
struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata,
@@ -144,7 +140,6 @@ struct ieee80211_key *ieee80211_key_allo
* Default to software encryption; we'll later upload the
* key to the hardware if possible.
*/
- key->conf.hw_key_idx = HW_KEY_IDX_INVALID;
key->conf.flags = 0;
key->flags = 0;
--- wireless-dev.orig/net/mac80211/wpa.c 2007-08-23 18:38:38.751897709 +0200
+++ wireless-dev/net/mac80211/wpa.c 2007-08-23 18:38:43.161897709 +0200
@@ -136,7 +136,7 @@ ieee80211_tx_h_michael_mic_add(struct ie
printk(KERN_INFO "%s: WPA testing - corrupting TX Michael MIC "
"for STA " MAC_FMT "\n",
tx->dev->name, MAC_ARG(tx->sta->addr));
- tx->u.tx.control->key_idx = HW_KEY_IDX_INVALID;
+ tx->u.tx.control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
tx->sta->wpa_trigger &= ~WPA_TRIGGER_FAIL_TX_MIC;
tx->wpa_test = 1;
mic[0]++;
@@ -144,7 +144,7 @@ ieee80211_tx_h_michael_mic_add(struct ie
tx->local->wpa_trigger & WPA_TRIGGER_FAIL_TX_MIC) {
printk(KERN_INFO "%s: WPA testing - corrupting TX Michael MIC "
"for Group Key\n", tx->dev->name);
- tx->u.tx.control->key_idx = HW_KEY_IDX_INVALID;
+ tx->u.tx.control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
tx->local->wpa_trigger &= ~WPA_TRIGGER_FAIL_TX_MIC;
tx->wpa_test = 1;
mic[0]++;
@@ -398,7 +398,7 @@ ieee80211_tx_h_tkip_encrypt(struct ieee8
printk(KERN_INFO "%s: WPA testing - corrupting TX TKIP ICV "
"for STA " MAC_FMT "\n",
tx->dev->name, MAC_ARG(tx->sta->addr));
- tx->u.tx.control->key_idx = HW_KEY_IDX_INVALID;
+ tx->u.tx.control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
tx->sta->wpa_trigger &= ~WPA_TRIGGER_FAIL_TX_ICV;
skb->data[skb->len - 1]++;
} else if (!tx->u.tx.unicast &&
@@ -406,7 +406,7 @@ ieee80211_tx_h_tkip_encrypt(struct ieee8
printk(KERN_INFO "%s: WPA testing - corrupting TX TKIP ICV "
"for Group Key\n",
tx->dev->name);
- tx->u.tx.control->key_idx = HW_KEY_IDX_INVALID;
+ tx->u.tx.control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
tx->local->wpa_trigger &= ~WPA_TRIGGER_FAIL_TX_ICV;
skb->data[skb->len - 1]++;
}
--- wireless-dev.orig/net/mac80211/tx.c 2007-08-23 18:38:38.791897709 +0200
+++ wireless-dev/net/mac80211/tx.c 2007-08-23 18:38:43.161897709 +0200
@@ -425,8 +425,6 @@ ieee80211_tx_h_ps_buf(struct ieee80211_t
static ieee80211_txrx_result
ieee80211_tx_h_select_key(struct ieee80211_txrx_data *tx)
{
- tx->u.tx.control->key_idx = HW_KEY_IDX_INVALID;
-
if (unlikely(tx->u.tx.control->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT))
tx->key = NULL;
else if (tx->sta && tx->sta->key)
@@ -437,8 +435,10 @@ ieee80211_tx_h_select_key(struct ieee802
!(tx->sdata->eapol && ieee80211_is_eapol(tx->skb))) {
I802_DEBUG_INC(tx->local->tx_handlers_drop_unencrypted);
return TXRX_DROP;
- } else
+ } else {
tx->key = NULL;
+ tx->u.tx.control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
+ }
if (tx->key) {
tx->key->tx_rx_count++;
@@ -827,7 +827,6 @@ __ieee80211_parse_tx_radiotap(
*/
control->retry_limit = 1; /* no retry */
- control->key_idx = HW_KEY_IDX_INVALID;
control->flags &= ~(IEEE80211_TXCTL_USE_RTS_CTS |
IEEE80211_TXCTL_USE_CTS_PROTECT);
control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT |
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 07/11] mac80211: print out wiphy name instead of master device
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
` (5 preceding siblings ...)
2007-08-23 16:45 ` [RFC 06/11] mac80211: remove HW_KEY_IDX_INVALID Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-23 16:45 ` [RFC 08/11] mac80211: ignore key index on pairwise key (WEP only) Johannes Berg
` (3 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
This makes mac80211 print out the wiphy name instead of the
master device name where appropriate.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/ieee80211.c | 14 +++++++-------
net/mac80211/ieee80211_rate.c | 4 ++--
net/mac80211/ieee80211_sta.c | 2 +-
net/mac80211/rx.c | 3 ++-
net/mac80211/sta_info.c | 4 ++--
net/mac80211/tx.c | 9 +++++----
6 files changed, 19 insertions(+), 17 deletions(-)
--- wireless-dev.orig/net/mac80211/ieee80211.c 2007-08-23 18:38:38.211897709 +0200
+++ wireless-dev/net/mac80211/ieee80211.c 2007-08-23 18:38:43.831897709 +0200
@@ -864,7 +864,7 @@ static void ieee80211_tasklet_handler(un
break;
default: /* should never get here! */
printk(KERN_ERR "%s: Unknown message type (%d)\n",
- local->mdev->name, skb->pkt_type);
+ wiphy_name(local->hw.wiphy), skb->pkt_type);
dev_kfree_skb(skb);
break;
}
@@ -949,7 +949,7 @@ void ieee80211_tx_status(struct ieee8021
if (!status) {
printk(KERN_ERR
"%s: ieee80211_tx_status called with NULL status\n",
- local->mdev->name);
+ wiphy_name(local->hw.wiphy));
dev_kfree_skb(skb);
return;
}
@@ -1006,7 +1006,7 @@ void ieee80211_tx_status(struct ieee8021
printk(KERN_DEBUG "%s: dropped TX "
"filtered frame queue_len=%d "
"PS=%d @%lu\n",
- local->mdev->name,
+ wiphy_name(local->hw.wiphy),
skb_queue_len(
&sta->tx_filtered),
!!(sta->flags & WLAN_STA_PS),
@@ -1331,7 +1331,7 @@ int ieee80211_register_hw(struct ieee802
result = ieee80211_init_rate_ctrl_alg(local, NULL);
if (result < 0) {
printk(KERN_DEBUG "%s: Failed to initialize rate control "
- "algorithm\n", local->mdev->name);
+ "algorithm\n", wiphy_name(local->hw.wiphy));
goto fail_rate;
}
@@ -1339,7 +1339,7 @@ int ieee80211_register_hw(struct ieee802
if (result < 0) {
printk(KERN_DEBUG "%s: Failed to initialize wep\n",
- local->mdev->name);
+ wiphy_name(local->hw.wiphy));
goto fail_wep;
}
@@ -1350,7 +1350,7 @@ int ieee80211_register_hw(struct ieee802
IEEE80211_IF_TYPE_STA);
if (result)
printk(KERN_WARNING "%s: Failed to add default virtual iface\n",
- local->mdev->name);
+ wiphy_name(local->hw.wiphy));
local->reg_state = IEEE80211_DEV_REGISTERED;
rtnl_unlock();
@@ -1450,7 +1450,7 @@ void ieee80211_unregister_hw(struct ieee
if (skb_queue_len(&local->skb_queue)
|| skb_queue_len(&local->skb_queue_unreliable))
printk(KERN_WARNING "%s: skb_queue not empty\n",
- local->mdev->name);
+ wiphy_name(local->hw.wiphy));
skb_queue_purge(&local->skb_queue);
skb_queue_purge(&local->skb_queue_unreliable);
--- wireless-dev.orig/net/mac80211/ieee80211_rate.c 2007-08-23 18:38:38.251897709 +0200
+++ wireless-dev/net/mac80211/ieee80211_rate.c 2007-08-23 18:38:43.831897709 +0200
@@ -152,7 +152,7 @@ int ieee80211_init_rate_ctrl_alg(struct
ref = rate_control_alloc(name, local);
if (!ref) {
printk(KERN_WARNING "%s: Failed to select rate control "
- "algorithm\n", local->mdev->name);
+ "algorithm\n", wiphy_name(local->hw.wiphy));
return -ENOENT;
}
@@ -164,7 +164,7 @@ int ieee80211_init_rate_ctrl_alg(struct
}
printk(KERN_DEBUG "%s: Selected rate control "
- "algorithm '%s'\n", local->mdev->name,
+ "algorithm '%s'\n", wiphy_name(local->hw.wiphy),
ref->ops->name);
--- wireless-dev.orig/net/mac80211/ieee80211_sta.c 2007-08-23 18:38:38.271897709 +0200
+++ wireless-dev/net/mac80211/ieee80211_sta.c 2007-08-23 18:38:43.841897709 +0200
@@ -4027,7 +4027,7 @@ struct sta_info * ieee80211_ibss_add_sta
}
printk(KERN_DEBUG "%s: Adding new IBSS station " MAC_FMT " (dev=%s)\n",
- local->mdev->name, MAC_ARG(addr), dev->name);
+ wiphy_name(local->hw.wiphy), MAC_ARG(addr), dev->name);
sta = sta_info_add(local, dev, addr, GFP_ATOMIC);
if (!sta)
--- wireless-dev.orig/net/mac80211/rx.c 2007-08-23 18:38:38.321897709 +0200
+++ wireless-dev/net/mac80211/rx.c 2007-08-23 18:38:43.841897709 +0200
@@ -1605,7 +1605,8 @@ void __ieee80211_rx(struct ieee80211_hw
if (net_ratelimit())
printk(KERN_DEBUG "%s: failed to copy "
"multicast frame for %s",
- local->mdev->name, prev->dev->name);
+ wiphy_name(local->hw.wiphy),
+ prev->dev->name);
continue;
}
rx.skb = skb_new;
--- wireless-dev.orig/net/mac80211/sta_info.c 2007-08-23 18:38:38.361897709 +0200
+++ wireless-dev/net/mac80211/sta_info.c 2007-08-23 18:38:43.851897709 +0200
@@ -191,7 +191,7 @@ struct sta_info * sta_info_add(struct ie
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: Added STA " MAC_FMT "\n",
- local->mdev->name, MAC_ARG(addr));
+ wiphy_name(local->hw.wiphy), MAC_ARG(addr));
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
#ifdef CONFIG_MAC80211_DEBUGFS
@@ -250,7 +250,7 @@ void sta_info_free(struct sta_info *sta)
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
printk(KERN_DEBUG "%s: Removed STA " MAC_FMT "\n",
- local->mdev->name, MAC_ARG(sta->addr));
+ wiphy_name(local->hw.wiphy), MAC_ARG(sta->addr));
#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
ieee80211_key_free(sta->key);
--- wireless-dev.orig/net/mac80211/tx.c 2007-08-23 18:38:43.161897709 +0200
+++ wireless-dev/net/mac80211/tx.c 2007-08-23 18:38:43.861897709 +0200
@@ -318,7 +318,7 @@ static void purge_old_ps_buffers(struct
local->total_ps_buffered = total;
printk(KERN_DEBUG "%s: PS buffers full - purged %d frames\n",
- local->mdev->name, purged);
+ wiphy_name(local->hw.wiphy), purged);
}
static inline ieee80211_txrx_result
@@ -1030,7 +1030,8 @@ static int __ieee80211_tx(struct ieee802
return IEEE80211_TX_AGAIN;
}
if (skb) {
- ieee80211_dump_frame(local->mdev->name, "TX to low-level driver", skb);
+ ieee80211_dump_frame(wiphy_name(local->hw.wiphy),
+ "TX to low-level driver", skb);
ret = local->ops->tx(local_to_hw(local), skb, control);
if (ret)
return IEEE80211_TX_AGAIN;
@@ -1058,7 +1059,7 @@ static int __ieee80211_tx(struct ieee802
~IEEE80211_TXCTL_RATE_CTRL_PROBE;
}
- ieee80211_dump_frame(local->mdev->name,
+ ieee80211_dump_frame(wiphy_name(local->hw.wiphy),
"TX to low-level driver",
tx->u.tx.extra_frag[i]);
ret = local->ops->tx(local_to_hw(local),
@@ -1761,7 +1762,7 @@ struct sk_buff *ieee80211_beacon_get(str
if (!rate) {
if (net_ratelimit()) {
printk(KERN_DEBUG "%s: ieee80211_beacon_get: no rate "
- "found\n", local->mdev->name);
+ "found\n", wiphy_name(local->hw.wiphy));
}
dev_kfree_skb(skb);
return NULL;
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 08/11] mac80211: ignore key index on pairwise key (WEP only)
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
` (6 preceding siblings ...)
2007-08-23 16:45 ` [RFC 07/11] mac80211: print out wiphy name instead of master device Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-23 16:45 ` [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes Johannes Berg
` (2 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless; +Cc: Volker Braun
Work-around for broken APs that use a non-zero key index for WEP
pairwise keys. With this patch, WEP encryption only is exempt from
providing a zero key index.
Signed-off-by: Volker Braun <volker.braun@physik.hu-berlin.de>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/ieee80211_ioctl.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c 2007-08-23 18:38:37.961897709 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c 2007-08-23 18:38:44.581897709 +0200
@@ -385,17 +385,23 @@ static int ieee80211_set_encryption(stru
sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ if (idx < 0 || idx >= NUM_DEFAULT_KEYS) {
+ printk(KERN_DEBUG "%s: set_encrypt - invalid idx=%d\n",
+ dev->name, idx);
+ return -EINVAL;
+ }
+
if (is_broadcast_ether_addr(sta_addr)) {
sta = NULL;
- if (idx >= NUM_DEFAULT_KEYS) {
- printk(KERN_DEBUG "%s: set_encrypt - invalid idx=%d\n",
- dev->name, idx);
- return -EINVAL;
- }
key = sdata->keys[idx];
} else {
set_tx_key = 0;
- if (idx != 0) {
+ /*
+ * According to the standard, the key index of a pairwise
+ * key must be zero. However, some AP are broken when it
+ * comes to WEP key indices, so we work around this.
+ */
+ if (idx != 0 && alg != ALG_WEP) {
printk(KERN_DEBUG "%s: set_encrypt - non-zero idx for "
"individual key\n", dev->name);
return -EINVAL;
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
` (7 preceding siblings ...)
2007-08-23 16:45 ` [RFC 08/11] mac80211: ignore key index on pairwise key (WEP only) Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-24 0:37 ` [RFC 09/11 v2] " Johannes Berg
2007-08-24 8:00 ` [RFC 09/11] " Zhu Yi
2007-08-23 16:45 ` [RFC 10/11] mac80211: fix warnings introduced by the doc patches Johannes Berg
2007-08-23 16:45 ` [RFC 11/11] mac80211 maintainership Johannes Berg
10 siblings, 2 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless; +Cc: Zhu Yi
This patch removes all mention of the atheros turbo modes that
can't possibly work properly anyway since in some places we don't
check for them when we should.
I have no idea what the iwlwifi drivers were doing with these but
it can't possibly have been correct.
Cc: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
drivers/net/wireless/iwl-4965-rs.c | 18 ++++++------------
drivers/net/wireless/iwl-4965.c | 12 ++++--------
drivers/net/wireless/iwl-base.c | 36 +++++++-----------------------------
drivers/net/wireless/iwl-channel.h | 6 ++----
include/net/mac80211.h | 7 +------
net/mac80211/debugfs.c | 2 --
net/mac80211/ieee80211.c | 4 ----
net/mac80211/ieee80211_common.h | 2 --
net/mac80211/ieee80211_ioctl.c | 9 ---------
net/mac80211/ieee80211_sta.c | 33 +++------------------------------
net/mac80211/regdomain.c | 6 ------
net/mac80211/rx.c | 2 --
net/mac80211/tx.c | 2 --
net/mac80211/util.c | 11 +----------
14 files changed, 24 insertions(+), 126 deletions(-)
--- wireless-dev.orig/include/net/mac80211.h 2007-08-23 18:38:43.161897709 +0200
+++ wireless-dev/include/net/mac80211.h 2007-08-23 18:38:45.151897709 +0200
@@ -95,14 +95,13 @@ struct ieee80211_channel {
#define IEEE80211_RATE_SUPPORTED 0x00000010
#define IEEE80211_RATE_OFDM 0x00000020
#define IEEE80211_RATE_CCK 0x00000040
-#define IEEE80211_RATE_TURBO 0x00000080
#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, CCK, and TURBO flags.
+/* 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 {
@@ -128,16 +127,12 @@ struct ieee80211_rate {
* @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
- * @MODE_ATHEROS_TURBO: Atheros Turbo mode in 5 GHz
- * @MODE_ATHEROS_TURBOG: Atheros Turbo mode in 2.4 GHz
* @NUM_IEEE80211_MODES: internal
*/
enum ieee80211_phymode {
MODE_IEEE80211A,
MODE_IEEE80211B,
- MODE_ATHEROS_TURBO,
MODE_IEEE80211G,
- MODE_ATHEROS_TURBOG,
/* keep last */
NUM_IEEE80211_MODES
--- wireless-dev.orig/net/mac80211/debugfs.c 2007-08-23 18:38:37.221897709 +0200
+++ wireless-dev/net/mac80211/debugfs.c 2007-08-23 18:38:45.151897709 +0200
@@ -38,8 +38,6 @@ static const char *ieee80211_mode_str(in
return "IEEE 802.11b";
case MODE_IEEE80211G:
return "IEEE 802.11g";
- case MODE_ATHEROS_TURBO:
- return "Atheros Turbo (5 GHz)";
default:
return "UNKNOWN";
}
--- wireless-dev.orig/net/mac80211/ieee80211.c 2007-08-23 18:38:43.831897709 +0200
+++ wireless-dev/net/mac80211/ieee80211.c 2007-08-23 18:38:45.151897709 +0200
@@ -176,10 +176,6 @@ ieee80211_fill_frame_info(struct ieee802
case MODE_IEEE80211G:
fi->phytype = htonl(ieee80211_phytype_pbcc_dot11_g);
break;
- case MODE_ATHEROS_TURBO:
- fi->phytype =
- htonl(ieee80211_phytype_dsss_dot11_turbo);
- break;
default:
fi->phytype = htonl(0xAAAAAAAA);
break;
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c 2007-08-23 18:38:44.581897709 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c 2007-08-23 18:38:45.161897709 +0200
@@ -251,9 +251,6 @@ static int ieee80211_ioctl_add_sta(struc
mode = local->oper_hw_mode;
for (i = 0; i < sizeof(param->u.add_sta.supp_rates); i++) {
int rate = (param->u.add_sta.supp_rates[i] & 0x7f) * 5;
- if (mode->mode == MODE_ATHEROS_TURBO ||
- mode->mode == MODE_ATHEROS_TURBOG)
- rate *= 2;
for (j = 0; j < mode->num_rates; j++) {
if (mode->rates[j].rate == rate)
rates |= BIT(j);
@@ -1012,9 +1009,6 @@ static int ieee80211_ioctl_giwname(struc
case MODE_IEEE80211G:
strcpy(name, "IEEE 802.11g");
break;
- case MODE_ATHEROS_TURBO:
- strcpy(name, "5GHz Turbo");
- break;
default:
strcpy(name, "IEEE 802.11");
break;
@@ -1467,9 +1461,6 @@ static int ieee80211_ioctl_siwrate(struc
struct ieee80211_rate *rates = &mode->rates[i];
int this_rate = rates->rate;
- if (mode->mode == MODE_ATHEROS_TURBO ||
- mode->mode == MODE_ATHEROS_TURBOG)
- this_rate *= 2;
if (target_rate == this_rate) {
sdata->bss->max_ratectrl_rateidx = i;
if (rate->fixed)
--- wireless-dev.orig/net/mac80211/ieee80211_sta.c 2007-08-23 18:38:43.841897709 +0200
+++ wireless-dev/net/mac80211/ieee80211_sta.c 2007-08-23 18:38:45.161897709 +0200
@@ -651,8 +651,6 @@ static void ieee80211_send_assoc(struct
*pos++ = len;
for (i = 0; i < len; i++) {
int rate = mode->rates[i].rate;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate /= 2;
*pos++ = (u8) (rate / 5);
}
@@ -662,8 +660,6 @@ static void ieee80211_send_assoc(struct
*pos++ = mode->num_rates - len;
for (i = len; i < mode->num_rates; i++) {
int rate = mode->rates[i].rate;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate /= 2;
*pos++ = (u8) (rate / 5);
}
}
@@ -1047,10 +1043,7 @@ void ieee80211_send_dls_req(struct net_d
pos = skb_put(skb, 1);
supp_rates[1]++;
}
- if (local->hw.conf.phymode == MODE_ATHEROS_TURBO)
- *pos = rate->rate / 10;
- else
- *pos = rate->rate / 5;
+ *pos = rate->rate / 5;
}
ieee80211_sta_tx(dev, skb, 0);
@@ -1120,10 +1113,7 @@ static void ieee80211_send_dls_resp(stru
pos = skb_put(skb, 1);
supp_rates[1]++;
}
- if (local->hw.conf.phymode == MODE_ATHEROS_TURBO)
- *pos = rate->rate / 10;
- else
- *pos = rate->rate / 5;
+ *pos = rate->rate / 5;
}
ieee80211_sta_tx(dev, skb, 0);
@@ -1331,10 +1321,7 @@ static void ieee80211_send_probe_req(str
pos = skb_put(skb, 1);
supp_rates[1]++;
}
- if (mode->mode == MODE_ATHEROS_TURBO)
- *pos = rate->rate / 10;
- else
- *pos = rate->rate / 5;
+ *pos = rate->rate / 5;
}
ieee80211_sta_tx(dev, skb, 0);
@@ -1728,16 +1715,12 @@ static void ieee80211_rx_mgmt_assoc_resp
mode = local->oper_hw_mode;
for (i = 0; i < elems.supp_rates_len; i++) {
int rate = (elems.supp_rates[i] & 0x7f) * 5;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate *= 2;
for (j = 0; j < mode->num_rates; j++)
if (mode->rates[j].rate == rate)
rates |= BIT(j);
}
for (i = 0; i < elems.ext_supp_rates_len; i++) {
int rate = (elems.ext_supp_rates[i] & 0x7f) * 5;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate *= 2;
for (j = 0; j < mode->num_rates; j++)
if (mode->rates[j].rate == rate)
rates |= BIT(j);
@@ -1913,8 +1896,6 @@ static void sta_process_dls_req(struct n
else if (elems.ext_supp_rates)
rate = elems.ext_supp_rates[i - elems.supp_rates_len];
rate = 5 * (rate & 0x7f);
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate *= 2;
for (j = 0; j < num_rates; j++)
if (rates[j].rate == rate)
supp_rates |= BIT(j);
@@ -1987,8 +1968,6 @@ static void sta_process_dls_resp(struct
else if (elems.ext_supp_rates)
rate = elems.ext_supp_rates[i - elems.supp_rates_len];
rate = 5 * (rate & 0x7f);
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate *= 2;
for (j = 0; j < num_rates; j++)
if (rates[j].rate == rate)
supp_rates |= BIT(j);
@@ -2225,8 +2204,6 @@ static void ieee80211_rx_bss_info(struct
rate = elems.ext_supp_rates
[i - elems.supp_rates_len];
own_rate = 5 * (rate & 0x7f);
- if (mode->mode == MODE_ATHEROS_TURBO)
- own_rate *= 2;
for (j = 0; j < num_rates; j++)
if (rates[j].rate == own_rate)
supp_rates |= BIT(j);
@@ -3277,8 +3254,6 @@ static int ieee80211_sta_join_ibss(struc
mode = local->oper_hw_mode;
for (i = 0; i < bss->supp_rates_len; i++) {
int bitrate = (bss->supp_rates[i] & 0x7f) * 5;
- if (mode->mode == MODE_ATHEROS_TURBO)
- bitrate *= 2;
for (j = 0; j < mode->num_rates; j++)
if (mode->rates[j].rate == bitrate)
rates |= BIT(j);
@@ -3351,8 +3326,6 @@ static int ieee80211_sta_create_ibss(str
pos = bss->supp_rates;
for (i = 0; i < mode->num_rates; i++) {
int rate = mode->rates[i].rate;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate /= 2;
*pos++ = (u8) (rate / 5);
}
--- wireless-dev.orig/net/mac80211/regdomain.c 2007-08-23 18:38:37.421897709 +0200
+++ wireless-dev/net/mac80211/regdomain.c 2007-08-23 18:38:45.161897709 +0200
@@ -82,12 +82,6 @@ static void ieee80211_unmask_channel(int
chan->flag = 0;
- if (ieee80211_regdom == 64 &&
- (mode == MODE_ATHEROS_TURBO || mode == MODE_ATHEROS_TURBOG)) {
- /* Do not allow Turbo modes in Japan. */
- return;
- }
-
for (i = 0; channel_range[i].start_freq; i++) {
const struct ieee80211_channel_range *r = &channel_range[i];
if (r->start_freq <= chan->freq && r->end_freq >= chan->freq) {
--- wireless-dev.orig/net/mac80211/rx.c 2007-08-23 18:38:43.841897709 +0200
+++ wireless-dev/net/mac80211/rx.c 2007-08-23 18:38:45.171897709 +0200
@@ -100,8 +100,6 @@ ieee80211_rx_h_load_stats(struct ieee802
* 1 usec = 1/8 * (1080 / 10) = 13.5 */
if (mode->mode == MODE_IEEE80211A ||
- mode->mode == MODE_ATHEROS_TURBO ||
- mode->mode == MODE_ATHEROS_TURBOG ||
(mode->mode == MODE_IEEE80211G &&
rate->flags & IEEE80211_RATE_ERP))
hdrtime = CHAN_UTIL_HDR_SHORT;
--- wireless-dev.orig/net/mac80211/tx.c 2007-08-23 18:38:43.861897709 +0200
+++ wireless-dev/net/mac80211/tx.c 2007-08-23 18:38:45.171897709 +0200
@@ -738,8 +738,6 @@ ieee80211_tx_h_load_stats(struct ieee802
* 1 usec = 1/8 * (1080 / 10) = 13.5 */
if (mode->mode == MODE_IEEE80211A ||
- mode->mode == MODE_ATHEROS_TURBO ||
- mode->mode == MODE_ATHEROS_TURBOG ||
(mode->mode == MODE_IEEE80211G &&
tx->u.tx.rate->flags & IEEE80211_RATE_ERP))
hdrtime = CHAN_UTIL_HDR_SHORT;
--- wireless-dev.orig/net/mac80211/util.c 2007-08-23 18:38:37.551897709 +0200
+++ wireless-dev/net/mac80211/util.c 2007-08-23 18:38:45.171897709 +0200
@@ -92,11 +92,6 @@ void ieee80211_prepare_rates(struct ieee
if (rate->rate == 10 || rate->rate == 20)
rate->flags |= IEEE80211_RATE_BASIC;
break;
- case MODE_ATHEROS_TURBO:
- if (rate->rate == 120 || rate->rate == 240 ||
- rate->rate == 480)
- rate->flags |= IEEE80211_RATE_BASIC;
- break;
case MODE_IEEE80211G:
if (rate->rate == 10 || rate->rate == 20 ||
rate->rate == 55 || rate->rate == 110)
@@ -115,8 +110,6 @@ void ieee80211_prepare_rates(struct ieee
if (rate->rate == 10)
rate->flags |= IEEE80211_RATE_MANDATORY;
break;
- case MODE_ATHEROS_TURBO:
- break;
case MODE_IEEE80211G:
if (rate->rate == 10 || rate->rate == 20 ||
rate->rate == 55 || rate->rate == 110 ||
@@ -272,8 +265,7 @@ int ieee80211_frame_duration(struct ieee
* DIV_ROUND_UP() operations.
*/
- if (local->hw.conf.phymode == MODE_IEEE80211A || erp ||
- local->hw.conf.phymode == MODE_ATHEROS_TURBO) {
+ if (local->hw.conf.phymode == MODE_IEEE80211A || erp) {
/*
* OFDM:
*
@@ -287,7 +279,6 @@ int ieee80211_frame_duration(struct ieee
* 802.11g - 19.8.4: aSIFSTime = 10 usec +
* signal ext = 6 usec
*/
- /* FIX: Atheros Turbo may have different (shorter) duration? */
dur = 16; /* SIFS + signal ext */
dur += 16; /* 17.3.2.3: T_PREAMBLE = 16 usec */
dur += 4; /* 17.3.2.3: T_SIGNAL = 4 usec */
--- wireless-dev.orig/drivers/net/wireless/iwl-base.c 2007-08-23 18:38:37.621897709 +0200
+++ wireless-dev/drivers/net/wireless/iwl-base.c 2007-08-23 18:38:45.181897709 +0200
@@ -974,8 +974,7 @@ static int iwl_set_rxon_channel(struct i
return 0;
priv->staging_rxon.channel = cpu_to_le16(channel);
- if ((phymode == MODE_IEEE80211A) ||
- (phymode == MODE_ATHEROS_TURBO))
+ if (phymode == MODE_IEEE80211A)
priv->staging_rxon.flags &= ~RXON_FLG_BAND_24G_MSK;
else
priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK;
@@ -2567,8 +2566,7 @@ static int iwl_set_rxon_hwcrypto(struct
static void iwl_set_flags_for_phymode(struct iwl_priv *priv, u8 phymode)
{
- if ((phymode == MODE_IEEE80211A) ||
- (phymode == MODE_ATHEROS_TURBO)) {
+ if (phymode == MODE_IEEE80211A) {
priv->staging_rxon.flags &=
~(RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK
| RXON_FLG_CCK_MSK);
@@ -3113,8 +3111,7 @@ static void iwl_set_rate(struct iwl_priv
priv->active_rate_basic = 0;
IWL_DEBUG_RATE("Setting rates for 802.11%c\n",
- ((hw->mode == MODE_IEEE80211A) ||
- (hw->mode == MODE_ATHEROS_TURBO)) ?
+ hw->mode == MODE_IEEE80211A ?
'a' : ((hw->mode == MODE_IEEE80211B) ? 'b' : 'g'));
for (i = 0; i < hw->num_rates; i++) {
@@ -5443,7 +5440,6 @@ const struct iwl_channel_info *iwl_get_c
int i;
switch (phymode) {
- case MODE_ATHEROS_TURBO:
case MODE_IEEE80211A:
for (i = 14; i < priv->channel_count; i++) {
if (priv->channel_info[i].channel == channel)
@@ -5453,7 +5449,6 @@ const struct iwl_channel_info *iwl_get_c
case MODE_IEEE80211B:
case MODE_IEEE80211G:
- case MODE_ATHEROS_TURBOG:
if (channel >= 1 && channel <= 14)
return &priv->channel_info[channel - 1];
break;
@@ -5638,8 +5633,7 @@ static int iwl_init_channel_map(struct i
static inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv, int phymode)
{
- if ((phymode == MODE_IEEE80211A) ||
- (phymode == MODE_ATHEROS_TURBO))
+ if (phymode == MODE_IEEE80211A)
return IWL_ACTIVE_DWELL_TIME_52;
else
return IWL_ACTIVE_DWELL_TIME_24;
@@ -5648,8 +5642,7 @@ static inline u16 iwl_get_active_dwell_t
static u16 iwl_get_passive_dwell_time(struct iwl_priv *priv, int phymode)
{
u16 active = iwl_get_active_dwell_time(priv, phymode);
- u16 passive = ((phymode != MODE_IEEE80211A) &&
- (phymode != MODE_ATHEROS_TURBO)) ?
+ u16 passive = (phymode != MODE_IEEE80211A) ?
IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 :
IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52;
@@ -5730,8 +5723,7 @@ static int iwl_get_channels_for_scan(str
/* scan_pwr_info->tpc.dsp_atten; */
/*scan_pwr_info->tpc.tx_gain; */
- if ((phymode == MODE_IEEE80211A) ||
- (phymode == MODE_ATHEROS_TURBO))
+ if (phymode == MODE_IEEE80211A)
scan_ch->tpc.tx_gain = ((1 << 5) | (3 << 3)) | 3;
else {
scan_ch->tpc.tx_gain = ((1 << 5) | (5 << 3));
@@ -5883,19 +5875,6 @@ static int iwl_init_geos(struct iwl_priv
modes[G].num_rates = 12; /* OFDM & CCK */
modes[G].num_channels = 0;
-#if IWL == 4965
- modes[G_11N].mode = MODE_ATHEROS_TURBOG;
- modes[G_11N].channels = channels;
- modes[G_11N].num_rates = 13; /* OFDM & CCK */
- modes[G_11N].rates = rates;
- modes[G_11N].num_channels = 0;
-
- modes[A_11N].mode = MODE_ATHEROS_TURBO;
- modes[A_11N].channels = &channels[ARRAY_SIZE(iwl_eeprom_band_1)];
- modes[A_11N].rates = &rates[4];
- modes[A_11N].num_rates = 9; /* just OFDM */
- modes[A_11N].num_channels = 0;
-#endif
priv->ieee_channels = channels;
priv->ieee_rates = rates;
@@ -8353,8 +8332,7 @@ static void iwl_mac_get_ht_capab(struct
use_wide_channel = 0;
/* no fat tx allowed on 2.4GHZ */
- if ((priv->phymode != MODE_IEEE80211A) &&
- (priv->phymode != MODE_ATHEROS_TURBO))
+ if (priv->phymode != MODE_IEEE80211A)
use_wide_channel = 0;
iwl_set_ht_capab(hw, ht_cap, use_wide_channel);
--- wireless-dev.orig/drivers/net/wireless/iwl-channel.h 2007-08-23 18:38:37.671897709 +0200
+++ wireless-dev/drivers/net/wireless/iwl-channel.h 2007-08-23 18:38:45.181897709 +0200
@@ -136,15 +136,13 @@ static inline int is_channel_radar(const
static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info)
{
- return ((ch_info->phymode == MODE_IEEE80211A) ||
- (ch_info->phymode == MODE_ATHEROS_TURBO)) ? 1 : 0;
+ return ch_info->phymode == MODE_IEEE80211A;
}
static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info)
{
return ((ch_info->phymode == MODE_IEEE80211B) ||
- (ch_info->phymode == MODE_IEEE80211G) ||
- (ch_info->phymode == MODE_ATHEROS_TURBOG)) ? 1 : 0;
+ (ch_info->phymode == MODE_IEEE80211G));
}
static inline int is_channel_passive(const struct iwl_channel_info *ch)
--- wireless-dev.orig/net/mac80211/ieee80211_common.h 2007-08-23 18:38:37.601897709 +0200
+++ wireless-dev/net/mac80211/ieee80211_common.h 2007-08-23 18:38:45.191897709 +0200
@@ -73,8 +73,6 @@ enum ieee80211_phytype {
ieee80211_phytype_ofdm_dot11_g = 6,
ieee80211_phytype_pbcc_dot11_g = 7,
ieee80211_phytype_ofdm_dot11_a = 8,
- ieee80211_phytype_dsss_dot11_turbog = 255,
- ieee80211_phytype_dsss_dot11_turbo = 256,
};
enum ieee80211_ssi_type {
--- wireless-dev.orig/drivers/net/wireless/iwl-4965.c 2007-08-23 18:38:37.701897709 +0200
+++ wireless-dev/drivers/net/wireless/iwl-4965.c 2007-08-23 18:38:45.191897709 +0200
@@ -2558,8 +2558,7 @@ int iwl_hw_reg_send_txpower(struct iwl_p
}
band = ((priv->phymode == MODE_IEEE80211B) ||
- (priv->phymode == MODE_IEEE80211G) ||
- (priv->phymode == MODE_ATHEROS_TURBOG)) ? 1 : 0;
+ (priv->phymode == MODE_IEEE80211G));
is_fat = is_fat_channel(priv->active_rxon.flags);
@@ -2591,8 +2590,7 @@ int iwl_hw_channel_switch(struct iwl_pri
const struct iwl_channel_info *ch_info;
band = ((priv->phymode == MODE_IEEE80211B) ||
- (priv->phymode == MODE_IEEE80211G) ||
- (priv->phymode == MODE_ATHEROS_TURBOG)) ? 1 : 0;
+ (priv->phymode == MODE_IEEE80211G));
ch_info = iwl_get_channel_info(priv, priv->phymode, channel);
@@ -4367,8 +4365,7 @@ void iwl4965_add_station(struct iwl_priv
* all the way to 1M in IEEE order and then spin on IEEE */
if (is_ap)
r = IWL_RATE_54M_INDEX;
- else if ((priv->phymode == MODE_IEEE80211A) ||
- (priv->phymode == MODE_ATHEROS_TURBO))
+ else if (priv->phymode == MODE_IEEE80211A)
r = IWL_RATE_6M_INDEX;
else
r = IWL_RATE_1M_INDEX;
@@ -4432,8 +4429,7 @@ static u8 iwl_is_fat_tx_allowed(struct i
return 0;
/* no fat tx allowed on 2.4GHZ */
- if ((priv->phymode != MODE_IEEE80211A) &&
- (priv->phymode != MODE_ATHEROS_TURBO))
+ if (priv->phymode != MODE_IEEE80211A)
return 0;
return (iwl_is_channel_extension(priv, priv->phymode,
ht_info->control_chan,
--- wireless-dev.orig/drivers/net/wireless/iwl-4965-rs.c 2007-08-23 18:38:37.761897709 +0200
+++ wireless-dev/drivers/net/wireless/iwl-4965-rs.c 2007-08-23 18:38:45.191897709 +0200
@@ -376,8 +376,7 @@ static int rs_get_tbl_info_from_mcs(cons
tbl->lq_type = LQ_NONE;
else {
- if ((phymode == MODE_ATHEROS_TURBO) ||
- (phymode == MODE_IEEE80211A))
+ if (phymode == MODE_IEEE80211A)
tbl->lq_type = LQ_A;
else
tbl->lq_type = LQ_G;
@@ -554,8 +553,7 @@ static int rs_get_lower_rate(struct iwl_
if (!is_legacy(tbl->lq_type) && (!ht_possible || !scale_index)) {
switch_to_legacy = 1;
scale_index = rs_ht_to_legacy[scale_index];
- if ((lq_data->phymode == MODE_IEEE80211A) ||
- (lq_data->phymode == MODE_ATHEROS_TURBO))
+ if (lq_data->phymode == MODE_IEEE80211A)
tbl->lq_type = LQ_A;
else
tbl->lq_type = LQ_G;
@@ -572,8 +570,7 @@ static int rs_get_lower_rate(struct iwl_
/* mask with station rate restriction */
if (is_legacy(tbl->lq_type)) {
- if ((lq_data->phymode == (u8) MODE_IEEE80211A) ||
- (lq_data->phymode == (u8) MODE_ATHEROS_TURBO))
+ if (lq_data->phymode == (u8) MODE_IEEE80211A)
rate_mask = (u16)(rate_mask &
(sta->supp_rates << IWL_FIRST_OFDM_RATE));
else
@@ -1411,8 +1408,7 @@ static void rs_rate_scale_perform(struct
/* mask with station rate restriction */
if (is_legacy(tbl->lq_type)) {
- if ((lq_data->phymode == (u8) MODE_IEEE80211A) ||
- (lq_data->phymode == (u8) MODE_ATHEROS_TURBO))
+ if (lq_data->phymode == (u8) MODE_IEEE80211A)
rate_scale_index_msk = (u16) (rate_mask &
(sta->supp_rates << IWL_FIRST_OFDM_RATE));
else
@@ -1657,8 +1653,7 @@ out:
/* sta->txrate is an index to A mode rates which start
* at IWL_FIRST_OFDM_RATE
*/
- if ((lq_data->phymode == (u8) MODE_IEEE80211A) ||
- (lq_data->phymode == (u8) MODE_ATHEROS_TURBO))
+ if (lq_data->phymode == (u8) MODE_IEEE80211A)
sta->txrate = i - IWL_FIRST_OFDM_RATE;
return;
@@ -1881,8 +1876,7 @@ static void rs_rate_init(void *priv_rate
/* For MODE_IEEE80211A mode cck rate are at end
* rate table
*/
- if ((local->hw.conf.phymode == MODE_IEEE80211A) ||
- (local->hw.conf.phymode == MODE_ATHEROS_TURBO))
+ if (local->hw.conf.phymode == MODE_IEEE80211A)
sta->last_txrate += IWL_FIRST_OFDM_RATE;
crl->is_dup = priv->is_dup;
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 10/11] mac80211: fix warnings introduced by the doc patches
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
` (8 preceding siblings ...)
2007-08-23 16:45 ` [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
2007-08-23 16:45 ` [RFC 11/11] mac80211 maintainership Johannes Berg
10 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
This fixes a warning about NUM_IEEE80211_MODES missing
in a switch statement. Intentionally do not add a default
case so we get warnings at these places if we need to add
new modes.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/util.c | 6 ++++++
1 file changed, 6 insertions(+)
--- wireless-dev.orig/net/mac80211/util.c 2007-08-23 18:40:37.441897709 +0200
+++ wireless-dev/net/mac80211/util.c 2007-08-23 18:41:09.941897709 +0200
@@ -97,6 +97,9 @@ void ieee80211_prepare_rates(struct ieee
rate->rate == 55 || rate->rate == 110)
rate->flags |= IEEE80211_RATE_BASIC;
break;
+ case NUM_IEEE80211_MODES:
+ /* not useful */
+ break;
}
/* Set ERP and MANDATORY flags based on phymode */
@@ -117,6 +120,9 @@ void ieee80211_prepare_rates(struct ieee
rate->rate == 240)
rate->flags |= IEEE80211_RATE_MANDATORY;
break;
+ case NUM_IEEE80211_MODES:
+ /* not useful */
+ break;
}
if (ieee80211_is_erp_rate(mode->mode, rate->rate))
rate->flags |= IEEE80211_RATE_ERP;
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 11/11] mac80211 maintainership
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
` (9 preceding siblings ...)
2007-08-23 16:45 ` [RFC 10/11] mac80211: fix warnings introduced by the doc patches Johannes Berg
@ 2007-08-23 16:45 ` Johannes Berg
10 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-23 16:45 UTC (permalink / raw)
To: linux-wireless
This patch adds myself to the maintainer list for mac80211 and
changes the git tree URL to John's tree since Jiri doesn't seem
to be around any more.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
MAINTAINERS | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- wireless-dev.orig/MAINTAINERS 2007-08-23 18:38:36.901897709 +0200
+++ wireless-dev/MAINTAINERS 2007-08-23 18:38:46.241897709 +0200
@@ -2443,9 +2443,11 @@ P: Jiri Benc
M: jbenc@suse.cz
P: Michael Wu
M: flamingice@sourmilk.net
+P: Johannes Berg
+M: johannes@sipsolutions.net
L: linux-wireless@vger.kernel.org
W: http://linuxwireless.org/
-T: git kernel.org:/pub/scm/linux/kernel/git/jbenc/mac80211.git
+T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-dev.git (mac80211 branch)
S: Maintained
MACVLAN DRIVER
--
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC 06/11] mac80211: remove HW_KEY_IDX_INVALID
2007-08-23 16:45 ` [RFC 06/11] mac80211: remove HW_KEY_IDX_INVALID Johannes Berg
@ 2007-08-23 21:01 ` Michael Buesch
2007-08-24 10:09 ` Johannes Berg
0 siblings, 1 reply; 19+ messages in thread
From: Michael Buesch @ 2007-08-23 21:01 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On Thursday 23 August 2007 18:45:07 Johannes Berg wrote:
> longer relies on HW_KEY_IDX_INVALID either this removes it, changes
> the key index to be an integer in all places and makes the full
> range of the value available to drivers.
Why's that needed? It increases the tx control struct size,
which is created and destroyed with every packet.
Isn't 127 keys enough? If not, probably do a s16. But I think
an int if overkill.
--
Greetings Michael.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [RFC 09/11 v2] mac80211, iwlwifi: remove atheros turbo modes
2007-08-23 16:45 ` [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes Johannes Berg
@ 2007-08-24 0:37 ` Johannes Berg
2007-08-24 8:00 ` [RFC 09/11] " Zhu Yi
1 sibling, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-24 0:37 UTC (permalink / raw)
To: linux-wireless; +Cc: Zhu Yi
Awesome. The ioctl interface is tied to the internal definitions and the
machine locks up when you change these. Uh huh. I don't even want to
think about what happens if you make a silly programming mistake in
hostapd. New patch attached that at least doesn't kill the machine in
the normal case.
johannes
From: Johannes Berg <johannes@sipsolutions.net>
Subject: [PATCH] mac80211, iwlwifi: remove atheros turbo modes
This patch removes all mention of the atheros turbo modes that
can't possibly work properly anyway since in some places we don't
check for them when we should.
I have no idea what the iwlwifi drivers were doing with these but
it can't possibly have been correct.
Cc: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
drivers/net/wireless/iwl-4965-rs.c | 18 +++--------
drivers/net/wireless/iwl-4965.c | 12 ++-----
drivers/net/wireless/iwl-base.c | 36 ++++------------------
drivers/net/wireless/iwl-channel.h | 6 +--
include/net/mac80211.h | 7 ----
net/mac80211/debugfs.c | 2 -
net/mac80211/ieee80211.c | 4 --
net/mac80211/ieee80211_common.h | 2 -
net/mac80211/ieee80211_ioctl.c | 60 +++++++++++++++++++++++++++----------
net/mac80211/ieee80211_sta.c | 33 +-------------------
net/mac80211/regdomain.c | 6 ---
net/mac80211/rx.c | 2 -
net/mac80211/tx.c | 2 -
net/mac80211/util.c | 11 ------
14 files changed, 69 insertions(+), 132 deletions(-)
--- wireless-dev.orig/include/net/mac80211.h 2007-08-24 02:34:25.609427796 +0200
+++ wireless-dev/include/net/mac80211.h 2007-08-24 02:34:25.739427796 +0200
@@ -95,14 +95,13 @@ struct ieee80211_channel {
#define IEEE80211_RATE_SUPPORTED 0x00000010
#define IEEE80211_RATE_OFDM 0x00000020
#define IEEE80211_RATE_CCK 0x00000040
-#define IEEE80211_RATE_TURBO 0x00000080
#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, CCK, and TURBO flags.
+/* 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 {
@@ -128,16 +127,12 @@ struct ieee80211_rate {
* @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
- * @MODE_ATHEROS_TURBO: Atheros Turbo mode in 5 GHz
- * @MODE_ATHEROS_TURBOG: Atheros Turbo mode in 2.4 GHz
* @NUM_IEEE80211_MODES: internal
*/
enum ieee80211_phymode {
MODE_IEEE80211A,
MODE_IEEE80211B,
- MODE_ATHEROS_TURBO,
MODE_IEEE80211G,
- MODE_ATHEROS_TURBOG,
/* keep last */
NUM_IEEE80211_MODES
--- wireless-dev.orig/net/mac80211/debugfs.c 2007-08-24 02:34:24.129427796 +0200
+++ wireless-dev/net/mac80211/debugfs.c 2007-08-24 02:34:25.739427796 +0200
@@ -38,8 +38,6 @@ static const char *ieee80211_mode_str(in
return "IEEE 802.11b";
case MODE_IEEE80211G:
return "IEEE 802.11g";
- case MODE_ATHEROS_TURBO:
- return "Atheros Turbo (5 GHz)";
default:
return "UNKNOWN";
}
--- wireless-dev.orig/net/mac80211/ieee80211.c 2007-08-24 02:34:25.659427796 +0200
+++ wireless-dev/net/mac80211/ieee80211.c 2007-08-24 02:34:25.749427796 +0200
@@ -176,10 +176,6 @@ ieee80211_fill_frame_info(struct ieee802
case MODE_IEEE80211G:
fi->phytype = htonl(ieee80211_phytype_pbcc_dot11_g);
break;
- case MODE_ATHEROS_TURBO:
- fi->phytype =
- htonl(ieee80211_phytype_dsss_dot11_turbo);
- break;
default:
fi->phytype = htonl(0xAAAAAAAA);
break;
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c 2007-08-24 02:34:25.709427796 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c 2007-08-24 02:34:25.749427796 +0200
@@ -27,6 +27,40 @@
#include "aes_ccm.h"
+/*
+ * Wow. This ioctl interface is such crap, it's tied
+ * to internal definitions. I hope it dies soon.
+ */
+static int mode_to_hostapd_mode(enum ieee80211_phymode mode)
+{
+ switch (mode) {
+ case MODE_IEEE80211A:
+ return 0;
+ case MODE_IEEE80211B:
+ return 1;
+ case MODE_IEEE80211G:
+ return 3;
+ case NUM_IEEE80211_MODES:
+ WARN_ON(1);
+ break;
+ }
+ WARN_ON(1);
+ return -1;
+}
+
+static enum ieee80211_phymode hostapd_mode_to_mode(int hostapd_mode)
+{
+ switch (hostapd_mode) {
+ case 0:
+ return MODE_IEEE80211A;
+ case 1:
+ return MODE_IEEE80211B;
+ case 3:
+ return MODE_IEEE80211G;
+ }
+ return NUM_IEEE80211_MODES;
+}
+
static int ieee80211_ioctl_set_beacon(struct net_device *dev,
struct prism2_hostapd_param *param,
int param_len,
@@ -124,7 +158,7 @@ static int ieee80211_ioctl_get_hw_featur
left -= sizeof(*hdr) + clen + rlen;
hdr = (struct hostapd_ioctl_hw_modes_hdr *) pos;
- hdr->mode = mode->mode;
+ hdr->mode = mode_to_hostapd_mode(mode->mode);
hdr->num_channels = mode->num_channels;
hdr->num_rates = mode->num_rates;
@@ -251,9 +285,6 @@ static int ieee80211_ioctl_add_sta(struc
mode = local->oper_hw_mode;
for (i = 0; i < sizeof(param->u.add_sta.supp_rates); i++) {
int rate = (param->u.add_sta.supp_rates[i] & 0x7f) * 5;
- if (mode->mode == MODE_ATHEROS_TURBO ||
- mode->mode == MODE_ATHEROS_TURBOG)
- rate *= 2;
for (j = 0; j < mode->num_rates; j++) {
if (mode->rates[j].rate == rate)
rates |= BIT(j);
@@ -622,10 +653,14 @@ static int ieee80211_ioctl_set_rate_sets
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
u16 *pos = (u16 *) param->u.set_rate_sets.data;
int left = param_len - ((u8 *) pos - (u8 *) param);
- int i, mode, num_supp, num_basic, *supp, *basic, *prev;
+ int i, num_supp, num_basic, *supp, *basic, *prev;
+ enum ieee80211_phymode mode;
struct ieee80211_hw_mode *hw_mode;
- mode = param->u.set_rate_sets.mode;
+ mode = hostapd_mode_to_mode(param->u.set_rate_sets.mode);
+ if (mode == NUM_IEEE80211_MODES)
+ return -EINVAL;
+
num_supp = param->u.set_rate_sets.num_supported_rates;
num_basic = param->u.set_rate_sets.num_basic_rates;
@@ -884,7 +919,8 @@ static int ieee80211_ioctl_set_channel_f
int i;
list_for_each_entry(mode, &local->modes_list, list) {
- if (mode->mode == param->u.set_channel_flag.mode)
+ if (mode_to_hostapd_mode(mode->mode) ==
+ param->u.set_channel_flag.mode)
goto found;
}
return -ENOENT;
@@ -1012,9 +1048,6 @@ static int ieee80211_ioctl_giwname(struc
case MODE_IEEE80211G:
strcpy(name, "IEEE 802.11g");
break;
- case MODE_ATHEROS_TURBO:
- strcpy(name, "5GHz Turbo");
- break;
default:
strcpy(name, "IEEE 802.11");
break;
@@ -1068,7 +1101,7 @@ static int ieee80211_ioctl_giwrange(stru
list_for_each_entry(mode, &local->modes_list, list) {
int i = 0;
- if (!(local->enabled_modes & (1 << mode->mode)) ||
+ if (!(local->enabled_modes & (1 << mode_to_hostapd_mode(mode->mode))) ||
(local->hw_modes & local->enabled_modes &
(1 << MODE_IEEE80211G) && mode->mode == MODE_IEEE80211B))
continue;
@@ -1467,9 +1500,6 @@ static int ieee80211_ioctl_siwrate(struc
struct ieee80211_rate *rates = &mode->rates[i];
int this_rate = rates->rate;
- if (mode->mode == MODE_ATHEROS_TURBO ||
- mode->mode == MODE_ATHEROS_TURBOG)
- this_rate *= 2;
if (target_rate == this_rate) {
sdata->bss->max_ratectrl_rateidx = i;
if (rate->fixed)
@@ -1731,7 +1761,7 @@ static int ieee80211_ioctl_prism2_param(
break;
case PRISM2_PARAM_NEXT_MODE:
- local->next_mode = value;
+ local->next_mode = hostapd_mode_to_mode(value);
break;
case PRISM2_PARAM_BROADCAST_SSID:
--- wireless-dev.orig/net/mac80211/ieee80211_sta.c 2007-08-24 02:34:25.659427796 +0200
+++ wireless-dev/net/mac80211/ieee80211_sta.c 2007-08-24 02:34:25.759427796 +0200
@@ -651,8 +651,6 @@ static void ieee80211_send_assoc(struct
*pos++ = len;
for (i = 0; i < len; i++) {
int rate = mode->rates[i].rate;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate /= 2;
*pos++ = (u8) (rate / 5);
}
@@ -662,8 +660,6 @@ static void ieee80211_send_assoc(struct
*pos++ = mode->num_rates - len;
for (i = len; i < mode->num_rates; i++) {
int rate = mode->rates[i].rate;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate /= 2;
*pos++ = (u8) (rate / 5);
}
}
@@ -1047,10 +1043,7 @@ void ieee80211_send_dls_req(struct net_d
pos = skb_put(skb, 1);
supp_rates[1]++;
}
- if (local->hw.conf.phymode == MODE_ATHEROS_TURBO)
- *pos = rate->rate / 10;
- else
- *pos = rate->rate / 5;
+ *pos = rate->rate / 5;
}
ieee80211_sta_tx(dev, skb, 0);
@@ -1120,10 +1113,7 @@ static void ieee80211_send_dls_resp(stru
pos = skb_put(skb, 1);
supp_rates[1]++;
}
- if (local->hw.conf.phymode == MODE_ATHEROS_TURBO)
- *pos = rate->rate / 10;
- else
- *pos = rate->rate / 5;
+ *pos = rate->rate / 5;
}
ieee80211_sta_tx(dev, skb, 0);
@@ -1331,10 +1321,7 @@ static void ieee80211_send_probe_req(str
pos = skb_put(skb, 1);
supp_rates[1]++;
}
- if (mode->mode == MODE_ATHEROS_TURBO)
- *pos = rate->rate / 10;
- else
- *pos = rate->rate / 5;
+ *pos = rate->rate / 5;
}
ieee80211_sta_tx(dev, skb, 0);
@@ -1728,16 +1715,12 @@ static void ieee80211_rx_mgmt_assoc_resp
mode = local->oper_hw_mode;
for (i = 0; i < elems.supp_rates_len; i++) {
int rate = (elems.supp_rates[i] & 0x7f) * 5;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate *= 2;
for (j = 0; j < mode->num_rates; j++)
if (mode->rates[j].rate == rate)
rates |= BIT(j);
}
for (i = 0; i < elems.ext_supp_rates_len; i++) {
int rate = (elems.ext_supp_rates[i] & 0x7f) * 5;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate *= 2;
for (j = 0; j < mode->num_rates; j++)
if (mode->rates[j].rate == rate)
rates |= BIT(j);
@@ -1913,8 +1896,6 @@ static void sta_process_dls_req(struct n
else if (elems.ext_supp_rates)
rate = elems.ext_supp_rates[i - elems.supp_rates_len];
rate = 5 * (rate & 0x7f);
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate *= 2;
for (j = 0; j < num_rates; j++)
if (rates[j].rate == rate)
supp_rates |= BIT(j);
@@ -1987,8 +1968,6 @@ static void sta_process_dls_resp(struct
else if (elems.ext_supp_rates)
rate = elems.ext_supp_rates[i - elems.supp_rates_len];
rate = 5 * (rate & 0x7f);
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate *= 2;
for (j = 0; j < num_rates; j++)
if (rates[j].rate == rate)
supp_rates |= BIT(j);
@@ -2225,8 +2204,6 @@ static void ieee80211_rx_bss_info(struct
rate = elems.ext_supp_rates
[i - elems.supp_rates_len];
own_rate = 5 * (rate & 0x7f);
- if (mode->mode == MODE_ATHEROS_TURBO)
- own_rate *= 2;
for (j = 0; j < num_rates; j++)
if (rates[j].rate == own_rate)
supp_rates |= BIT(j);
@@ -3277,8 +3254,6 @@ static int ieee80211_sta_join_ibss(struc
mode = local->oper_hw_mode;
for (i = 0; i < bss->supp_rates_len; i++) {
int bitrate = (bss->supp_rates[i] & 0x7f) * 5;
- if (mode->mode == MODE_ATHEROS_TURBO)
- bitrate *= 2;
for (j = 0; j < mode->num_rates; j++)
if (mode->rates[j].rate == bitrate)
rates |= BIT(j);
@@ -3351,8 +3326,6 @@ static int ieee80211_sta_create_ibss(str
pos = bss->supp_rates;
for (i = 0; i < mode->num_rates; i++) {
int rate = mode->rates[i].rate;
- if (mode->mode == MODE_ATHEROS_TURBO)
- rate /= 2;
*pos++ = (u8) (rate / 5);
}
--- wireless-dev.orig/net/mac80211/regdomain.c 2007-08-24 02:32:05.129427796 +0200
+++ wireless-dev/net/mac80211/regdomain.c 2007-08-24 02:34:25.759427796 +0200
@@ -82,12 +82,6 @@ static void ieee80211_unmask_channel(int
chan->flag = 0;
- if (ieee80211_regdom == 64 &&
- (mode == MODE_ATHEROS_TURBO || mode == MODE_ATHEROS_TURBOG)) {
- /* Do not allow Turbo modes in Japan. */
- return;
- }
-
for (i = 0; channel_range[i].start_freq; i++) {
const struct ieee80211_channel_range *r = &channel_range[i];
if (r->start_freq <= chan->freq && r->end_freq >= chan->freq) {
--- wireless-dev.orig/net/mac80211/rx.c 2007-08-24 02:34:25.659427796 +0200
+++ wireless-dev/net/mac80211/rx.c 2007-08-24 02:34:25.769427796 +0200
@@ -100,8 +100,6 @@ ieee80211_rx_h_load_stats(struct ieee802
* 1 usec = 1/8 * (1080 / 10) = 13.5 */
if (mode->mode == MODE_IEEE80211A ||
- mode->mode == MODE_ATHEROS_TURBO ||
- mode->mode == MODE_ATHEROS_TURBOG ||
(mode->mode == MODE_IEEE80211G &&
rate->flags & IEEE80211_RATE_ERP))
hdrtime = CHAN_UTIL_HDR_SHORT;
--- wireless-dev.orig/net/mac80211/tx.c 2007-08-24 02:34:25.669427796 +0200
+++ wireless-dev/net/mac80211/tx.c 2007-08-24 02:34:25.769427796 +0200
@@ -738,8 +738,6 @@ ieee80211_tx_h_load_stats(struct ieee802
* 1 usec = 1/8 * (1080 / 10) = 13.5 */
if (mode->mode == MODE_IEEE80211A ||
- mode->mode == MODE_ATHEROS_TURBO ||
- mode->mode == MODE_ATHEROS_TURBOG ||
(mode->mode == MODE_IEEE80211G &&
tx->u.tx.rate->flags & IEEE80211_RATE_ERP))
hdrtime = CHAN_UTIL_HDR_SHORT;
--- wireless-dev.orig/net/mac80211/util.c 2007-08-24 02:32:05.219427796 +0200
+++ wireless-dev/net/mac80211/util.c 2007-08-24 02:36:03.819427796 +0200
@@ -92,11 +92,6 @@ void ieee80211_prepare_rates(struct ieee
if (rate->rate == 10 || rate->rate == 20)
rate->flags |= IEEE80211_RATE_BASIC;
break;
- case MODE_ATHEROS_TURBO:
- if (rate->rate == 120 || rate->rate == 240 ||
- rate->rate == 480)
- rate->flags |= IEEE80211_RATE_BASIC;
- break;
case MODE_IEEE80211G:
if (rate->rate == 10 || rate->rate == 20 ||
rate->rate == 55 || rate->rate == 110)
@@ -115,8 +110,6 @@ void ieee80211_prepare_rates(struct ieee
if (rate->rate == 10)
rate->flags |= IEEE80211_RATE_MANDATORY;
break;
- case MODE_ATHEROS_TURBO:
- break;
case MODE_IEEE80211G:
if (rate->rate == 10 || rate->rate == 20 ||
rate->rate == 55 || rate->rate == 110 ||
@@ -272,8 +265,7 @@ int ieee80211_frame_duration(struct ieee
* DIV_ROUND_UP() operations.
*/
- if (local->hw.conf.phymode == MODE_IEEE80211A || erp ||
- local->hw.conf.phymode == MODE_ATHEROS_TURBO) {
+ if (local->hw.conf.phymode == MODE_IEEE80211A || erp) {
/*
* OFDM:
*
@@ -287,7 +279,6 @@ int ieee80211_frame_duration(struct ieee
* 802.11g - 19.8.4: aSIFSTime = 10 usec +
* signal ext = 6 usec
*/
- /* FIX: Atheros Turbo may have different (shorter) duration? */
dur = 16; /* SIFS + signal ext */
dur += 16; /* 17.3.2.3: T_PREAMBLE = 16 usec */
dur += 4; /* 17.3.2.3: T_SIGNAL = 4 usec */
--- wireless-dev.orig/drivers/net/wireless/iwl-base.c 2007-08-24 02:34:25.099427796 +0200
+++ wireless-dev/drivers/net/wireless/iwl-base.c 2007-08-24 02:34:25.799427796 +0200
@@ -974,8 +974,7 @@ static int iwl_set_rxon_channel(struct i
return 0;
priv->staging_rxon.channel = cpu_to_le16(channel);
- if ((phymode == MODE_IEEE80211A) ||
- (phymode == MODE_ATHEROS_TURBO))
+ if (phymode == MODE_IEEE80211A)
priv->staging_rxon.flags &= ~RXON_FLG_BAND_24G_MSK;
else
priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK;
@@ -2567,8 +2566,7 @@ static int iwl_set_rxon_hwcrypto(struct
static void iwl_set_flags_for_phymode(struct iwl_priv *priv, u8 phymode)
{
- if ((phymode == MODE_IEEE80211A) ||
- (phymode == MODE_ATHEROS_TURBO)) {
+ if (phymode == MODE_IEEE80211A) {
priv->staging_rxon.flags &=
~(RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK
| RXON_FLG_CCK_MSK);
@@ -3113,8 +3111,7 @@ static void iwl_set_rate(struct iwl_priv
priv->active_rate_basic = 0;
IWL_DEBUG_RATE("Setting rates for 802.11%c\n",
- ((hw->mode == MODE_IEEE80211A) ||
- (hw->mode == MODE_ATHEROS_TURBO)) ?
+ hw->mode == MODE_IEEE80211A ?
'a' : ((hw->mode == MODE_IEEE80211B) ? 'b' : 'g'));
for (i = 0; i < hw->num_rates; i++) {
@@ -5443,7 +5440,6 @@ const struct iwl_channel_info *iwl_get_c
int i;
switch (phymode) {
- case MODE_ATHEROS_TURBO:
case MODE_IEEE80211A:
for (i = 14; i < priv->channel_count; i++) {
if (priv->channel_info[i].channel == channel)
@@ -5453,7 +5449,6 @@ const struct iwl_channel_info *iwl_get_c
case MODE_IEEE80211B:
case MODE_IEEE80211G:
- case MODE_ATHEROS_TURBOG:
if (channel >= 1 && channel <= 14)
return &priv->channel_info[channel - 1];
break;
@@ -5638,8 +5633,7 @@ static int iwl_init_channel_map(struct i
static inline u16 iwl_get_active_dwell_time(struct iwl_priv *priv, int phymode)
{
- if ((phymode == MODE_IEEE80211A) ||
- (phymode == MODE_ATHEROS_TURBO))
+ if (phymode == MODE_IEEE80211A)
return IWL_ACTIVE_DWELL_TIME_52;
else
return IWL_ACTIVE_DWELL_TIME_24;
@@ -5648,8 +5642,7 @@ static inline u16 iwl_get_active_dwell_t
static u16 iwl_get_passive_dwell_time(struct iwl_priv *priv, int phymode)
{
u16 active = iwl_get_active_dwell_time(priv, phymode);
- u16 passive = ((phymode != MODE_IEEE80211A) &&
- (phymode != MODE_ATHEROS_TURBO)) ?
+ u16 passive = (phymode != MODE_IEEE80211A) ?
IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_24 :
IWL_PASSIVE_DWELL_BASE + IWL_PASSIVE_DWELL_TIME_52;
@@ -5730,8 +5723,7 @@ static int iwl_get_channels_for_scan(str
/* scan_pwr_info->tpc.dsp_atten; */
/*scan_pwr_info->tpc.tx_gain; */
- if ((phymode == MODE_IEEE80211A) ||
- (phymode == MODE_ATHEROS_TURBO))
+ if (phymode == MODE_IEEE80211A)
scan_ch->tpc.tx_gain = ((1 << 5) | (3 << 3)) | 3;
else {
scan_ch->tpc.tx_gain = ((1 << 5) | (5 << 3));
@@ -5883,19 +5875,6 @@ static int iwl_init_geos(struct iwl_priv
modes[G].num_rates = 12; /* OFDM & CCK */
modes[G].num_channels = 0;
-#if IWL == 4965
- modes[G_11N].mode = MODE_ATHEROS_TURBOG;
- modes[G_11N].channels = channels;
- modes[G_11N].num_rates = 13; /* OFDM & CCK */
- modes[G_11N].rates = rates;
- modes[G_11N].num_channels = 0;
-
- modes[A_11N].mode = MODE_ATHEROS_TURBO;
- modes[A_11N].channels = &channels[ARRAY_SIZE(iwl_eeprom_band_1)];
- modes[A_11N].rates = &rates[4];
- modes[A_11N].num_rates = 9; /* just OFDM */
- modes[A_11N].num_channels = 0;
-#endif
priv->ieee_channels = channels;
priv->ieee_rates = rates;
@@ -8353,8 +8332,7 @@ static void iwl_mac_get_ht_capab(struct
use_wide_channel = 0;
/* no fat tx allowed on 2.4GHZ */
- if ((priv->phymode != MODE_IEEE80211A) &&
- (priv->phymode != MODE_ATHEROS_TURBO))
+ if (priv->phymode != MODE_IEEE80211A)
use_wide_channel = 0;
iwl_set_ht_capab(hw, ht_cap, use_wide_channel);
--- wireless-dev.orig/drivers/net/wireless/iwl-channel.h 2007-08-24 02:32:05.339427796 +0200
+++ wireless-dev/drivers/net/wireless/iwl-channel.h 2007-08-24 02:34:25.799427796 +0200
@@ -136,15 +136,13 @@ static inline int is_channel_radar(const
static inline u8 is_channel_a_band(const struct iwl_channel_info *ch_info)
{
- return ((ch_info->phymode == MODE_IEEE80211A) ||
- (ch_info->phymode == MODE_ATHEROS_TURBO)) ? 1 : 0;
+ return ch_info->phymode == MODE_IEEE80211A;
}
static inline u8 is_channel_bg_band(const struct iwl_channel_info *ch_info)
{
return ((ch_info->phymode == MODE_IEEE80211B) ||
- (ch_info->phymode == MODE_IEEE80211G) ||
- (ch_info->phymode == MODE_ATHEROS_TURBOG)) ? 1 : 0;
+ (ch_info->phymode == MODE_IEEE80211G));
}
static inline int is_channel_passive(const struct iwl_channel_info *ch)
--- wireless-dev.orig/net/mac80211/ieee80211_common.h 2007-08-24 02:34:23.879427796 +0200
+++ wireless-dev/net/mac80211/ieee80211_common.h 2007-08-24 02:34:25.799427796 +0200
@@ -73,8 +73,6 @@ enum ieee80211_phytype {
ieee80211_phytype_ofdm_dot11_g = 6,
ieee80211_phytype_pbcc_dot11_g = 7,
ieee80211_phytype_ofdm_dot11_a = 8,
- ieee80211_phytype_dsss_dot11_turbog = 255,
- ieee80211_phytype_dsss_dot11_turbo = 256,
};
enum ieee80211_ssi_type {
--- wireless-dev.orig/drivers/net/wireless/iwl-4965.c 2007-08-24 02:32:05.379427796 +0200
+++ wireless-dev/drivers/net/wireless/iwl-4965.c 2007-08-24 02:34:25.809427796 +0200
@@ -2558,8 +2558,7 @@ int iwl_hw_reg_send_txpower(struct iwl_p
}
band = ((priv->phymode == MODE_IEEE80211B) ||
- (priv->phymode == MODE_IEEE80211G) ||
- (priv->phymode == MODE_ATHEROS_TURBOG)) ? 1 : 0;
+ (priv->phymode == MODE_IEEE80211G));
is_fat = is_fat_channel(priv->active_rxon.flags);
@@ -2591,8 +2590,7 @@ int iwl_hw_channel_switch(struct iwl_pri
const struct iwl_channel_info *ch_info;
band = ((priv->phymode == MODE_IEEE80211B) ||
- (priv->phymode == MODE_IEEE80211G) ||
- (priv->phymode == MODE_ATHEROS_TURBOG)) ? 1 : 0;
+ (priv->phymode == MODE_IEEE80211G));
ch_info = iwl_get_channel_info(priv, priv->phymode, channel);
@@ -4367,8 +4365,7 @@ void iwl4965_add_station(struct iwl_priv
* all the way to 1M in IEEE order and then spin on IEEE */
if (is_ap)
r = IWL_RATE_54M_INDEX;
- else if ((priv->phymode == MODE_IEEE80211A) ||
- (priv->phymode == MODE_ATHEROS_TURBO))
+ else if (priv->phymode == MODE_IEEE80211A)
r = IWL_RATE_6M_INDEX;
else
r = IWL_RATE_1M_INDEX;
@@ -4432,8 +4429,7 @@ static u8 iwl_is_fat_tx_allowed(struct i
return 0;
/* no fat tx allowed on 2.4GHZ */
- if ((priv->phymode != MODE_IEEE80211A) &&
- (priv->phymode != MODE_ATHEROS_TURBO))
+ if (priv->phymode != MODE_IEEE80211A)
return 0;
return (iwl_is_channel_extension(priv, priv->phymode,
ht_info->control_chan,
--- wireless-dev.orig/drivers/net/wireless/iwl-4965-rs.c 2007-08-24 02:34:24.099427796 +0200
+++ wireless-dev/drivers/net/wireless/iwl-4965-rs.c 2007-08-24 02:34:25.809427796 +0200
@@ -376,8 +376,7 @@ static int rs_get_tbl_info_from_mcs(cons
tbl->lq_type = LQ_NONE;
else {
- if ((phymode == MODE_ATHEROS_TURBO) ||
- (phymode == MODE_IEEE80211A))
+ if (phymode == MODE_IEEE80211A)
tbl->lq_type = LQ_A;
else
tbl->lq_type = LQ_G;
@@ -554,8 +553,7 @@ static int rs_get_lower_rate(struct iwl_
if (!is_legacy(tbl->lq_type) && (!ht_possible || !scale_index)) {
switch_to_legacy = 1;
scale_index = rs_ht_to_legacy[scale_index];
- if ((lq_data->phymode == MODE_IEEE80211A) ||
- (lq_data->phymode == MODE_ATHEROS_TURBO))
+ if (lq_data->phymode == MODE_IEEE80211A)
tbl->lq_type = LQ_A;
else
tbl->lq_type = LQ_G;
@@ -572,8 +570,7 @@ static int rs_get_lower_rate(struct iwl_
/* mask with station rate restriction */
if (is_legacy(tbl->lq_type)) {
- if ((lq_data->phymode == (u8) MODE_IEEE80211A) ||
- (lq_data->phymode == (u8) MODE_ATHEROS_TURBO))
+ if (lq_data->phymode == (u8) MODE_IEEE80211A)
rate_mask = (u16)(rate_mask &
(sta->supp_rates << IWL_FIRST_OFDM_RATE));
else
@@ -1411,8 +1408,7 @@ static void rs_rate_scale_perform(struct
/* mask with station rate restriction */
if (is_legacy(tbl->lq_type)) {
- if ((lq_data->phymode == (u8) MODE_IEEE80211A) ||
- (lq_data->phymode == (u8) MODE_ATHEROS_TURBO))
+ if (lq_data->phymode == (u8) MODE_IEEE80211A)
rate_scale_index_msk = (u16) (rate_mask &
(sta->supp_rates << IWL_FIRST_OFDM_RATE));
else
@@ -1657,8 +1653,7 @@ out:
/* sta->txrate is an index to A mode rates which start
* at IWL_FIRST_OFDM_RATE
*/
- if ((lq_data->phymode == (u8) MODE_IEEE80211A) ||
- (lq_data->phymode == (u8) MODE_ATHEROS_TURBO))
+ if (lq_data->phymode == (u8) MODE_IEEE80211A)
sta->txrate = i - IWL_FIRST_OFDM_RATE;
return;
@@ -1881,8 +1876,7 @@ static void rs_rate_init(void *priv_rate
/* For MODE_IEEE80211A mode cck rate are at end
* rate table
*/
- if ((local->hw.conf.phymode == MODE_IEEE80211A) ||
- (local->hw.conf.phymode == MODE_ATHEROS_TURBO))
+ if (local->hw.conf.phymode == MODE_IEEE80211A)
sta->last_txrate += IWL_FIRST_OFDM_RATE;
crl->is_dup = priv->is_dup;
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes
2007-08-23 16:45 ` [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes Johannes Berg
2007-08-24 0:37 ` [RFC 09/11 v2] " Johannes Berg
@ 2007-08-24 8:00 ` Zhu Yi
2007-08-24 10:09 ` Johannes Berg
1 sibling, 1 reply; 19+ messages in thread
From: Zhu Yi @ 2007-08-24 8:00 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On Thu, 2007-08-23 at 18:45 +0200, Johannes Berg wrote:
> This patch removes all mention of the atheros turbo modes that
> can't possibly work properly anyway since in some places we don't
> check for them when we should.
>
> I have no idea what the iwlwifi drivers were doing with these but
> it can't possibly have been correct.
>
> Cc: Zhu Yi <yi.zhu@intel.com>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
ACK. iwlwifi doesn't support turbo mode. The code was there for
completeness. I agree with the removal.
Thanks,
-yi
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC 06/11] mac80211: remove HW_KEY_IDX_INVALID
2007-08-23 21:01 ` Michael Buesch
@ 2007-08-24 10:09 ` Johannes Berg
0 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-24 10:09 UTC (permalink / raw)
To: Michael Buesch; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 626 bytes --]
On Thu, 2007-08-23 at 23:01 +0200, Michael Buesch wrote:
> On Thursday 23 August 2007 18:45:07 Johannes Berg wrote:
> > longer relies on HW_KEY_IDX_INVALID either this removes it, changes
> > the key index to be an integer in all places and makes the full
> > range of the value available to drivers.
>
> Why's that needed? It increases the tx control struct size,
> which is created and destroyed with every packet.
> Isn't 127 keys enough? If not, probably do a s16. But I think
> an int if overkill.
Ah, but it's an int in the key_conf structure. I'm fine with making it a
u8 in both places too.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes
2007-08-24 8:00 ` [RFC 09/11] " Zhu Yi
@ 2007-08-24 10:09 ` Johannes Berg
2007-08-27 0:47 ` Zhu Yi
0 siblings, 1 reply; 19+ messages in thread
From: Johannes Berg @ 2007-08-24 10:09 UTC (permalink / raw)
To: Zhu Yi; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
On Fri, 2007-08-24 at 16:00 +0800, Zhu Yi wrote:
> ACK. iwlwifi doesn't support turbo mode. The code was there for
> completeness. I agree with the removal.
Good. I noticed another problems with this patch that I'll be fixing,
but I am still curious why you define channels with turbo that are named
11N or such?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes
2007-08-24 10:09 ` Johannes Berg
@ 2007-08-27 0:47 ` Zhu Yi
2007-08-27 10:49 ` Johannes Berg
0 siblings, 1 reply; 19+ messages in thread
From: Zhu Yi @ 2007-08-27 0:47 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On Fri, 2007-08-24 at 12:09 +0200, Johannes Berg wrote:
> Good. I noticed another problems with this patch that I'll be fixing,
> but I am still curious why you define channels with turbo that are
> named 11N or such?
We used to "borrow" the TURBO mode to distinguish between normal G mode
and 11N G mode (same for A and 11N A). We are now switching to different
approach (add ht_info to mac80211 for 11N), so it is not needed any
more. I'll submit a new patch to reflesh the change together with some
other changes we made for the driver during this period.
Thanks,
-yi
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes
2007-08-27 0:47 ` Zhu Yi
@ 2007-08-27 10:49 ` Johannes Berg
0 siblings, 0 replies; 19+ messages in thread
From: Johannes Berg @ 2007-08-27 10:49 UTC (permalink / raw)
To: Zhu Yi; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
On Mon, 2007-08-27 at 08:47 +0800, Zhu Yi wrote:
> We used to "borrow" the TURBO mode to distinguish between normal G mode
> and 11N G mode (same for A and 11N A). We are now switching to different
> approach (add ht_info to mac80211 for 11N), so it is not needed any
> more. I'll submit a new patch to reflesh the change together with some
> other changes we made for the driver during this period.
Great, thanks.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2007-08-27 10:48 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-23 16:45 [RFC 00/11] mac80211 updates Johannes Berg
2007-08-23 16:45 ` [RFC 01/11] mac80211: renumber and document the hardware flags Johannes Berg
2007-08-23 16:45 ` [RFC 02/11] mac80211: document a lot more Johannes Berg
2007-08-23 16:45 ` [RFC 03/11] wireless networking: move frame inline functions to generic header Johannes Berg
2007-08-23 16:45 ` [RFC 04/11] mac80211: yet more documentation Johannes Berg
2007-08-23 16:45 ` [RFC 05/11] mac80211: remove tx info sw_retry_attempt member Johannes Berg
2007-08-23 16:45 ` [RFC 06/11] mac80211: remove HW_KEY_IDX_INVALID Johannes Berg
2007-08-23 21:01 ` Michael Buesch
2007-08-24 10:09 ` Johannes Berg
2007-08-23 16:45 ` [RFC 07/11] mac80211: print out wiphy name instead of master device Johannes Berg
2007-08-23 16:45 ` [RFC 08/11] mac80211: ignore key index on pairwise key (WEP only) Johannes Berg
2007-08-23 16:45 ` [RFC 09/11] mac80211, iwlwifi: remove atheros turbo modes Johannes Berg
2007-08-24 0:37 ` [RFC 09/11 v2] " Johannes Berg
2007-08-24 8:00 ` [RFC 09/11] " Zhu Yi
2007-08-24 10:09 ` Johannes Berg
2007-08-27 0:47 ` Zhu Yi
2007-08-27 10:49 ` Johannes Berg
2007-08-23 16:45 ` [RFC 10/11] mac80211: fix warnings introduced by the doc patches Johannes Berg
2007-08-23 16:45 ` [RFC 11/11] mac80211 maintainership Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).