]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/rt2x00/rt2x00.h
rt2x00: Release rt2x00 2.1.4
[karo-tx-linux.git] / drivers / net / wireless / rt2x00 / rt2x00.h
index b0e4ea7c9dca64234da64d4410443602ffc121c5..dfd0af0e0a165fa70ca9e8815a19ffcc128ac0ab 100644 (file)
 #include <linux/skbuff.h>
 #include <linux/workqueue.h>
 #include <linux/firmware.h>
+#include <linux/leds.h>
 #include <linux/mutex.h>
 #include <linux/etherdevice.h>
 
 #include <net/mac80211.h>
 
 #include "rt2x00debug.h"
+#include "rt2x00leds.h"
 #include "rt2x00reg.h"
 #include "rt2x00queue.h"
 
 /*
  * Module information.
  */
-#define DRV_VERSION    "2.0.14"
+#define DRV_VERSION    "2.1.4"
 #define DRV_PROJECT    "http://rt2x00.serialmonkey.com"
 
 /*
@@ -382,7 +384,7 @@ struct rt2x00_intf {
         */
        unsigned int delayed_flags;
 #define DELAYED_UPDATE_BEACON          0x00000001
-#define DELAYED_CONFIG_PREAMBLE                0x00000002
+#define DELAYED_CONFIG_ERP             0x00000002
 };
 
 static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
@@ -390,30 +392,38 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
        return (struct rt2x00_intf *)vif->drv_priv;
 }
 
-/*
+/**
+ * struct hw_mode_spec: Hardware specifications structure
+ *
  * Details about the supported modes, rates and channels
  * of a particular chipset. This is used by rt2x00lib
  * to build the ieee80211_hw_mode array for mac80211.
+ *
+ * @supported_bands: Bitmask contained the supported bands (2.4GHz, 5.2GHz).
+ * @supported_rates: Rate types which are supported (CCK, OFDM).
+ * @num_channels: Number of supported channels. This is used as array size
+ *     for @tx_power_a, @tx_power_bg and @channels.
+ * channels: Device/chipset specific channel values (See &struct rf_channel).
+ * @tx_power_a: TX power values for all 5.2GHz channels (may be NULL).
+ * @tx_power_bg: TX power values for all 2.4GHz channels (may be NULL).
+ * @tx_power_default: Default TX power value to use when either
+ *     @tx_power_a or @tx_power_bg is missing.
  */
 struct hw_mode_spec {
-       /*
-        * Number of modes, rates and channels.
-        */
-       int num_modes;
-       int num_rates;
-       int num_channels;
+       unsigned int supported_bands;
+#define SUPPORT_BAND_2GHZ      0x00000001
+#define SUPPORT_BAND_5GHZ      0x00000002
+
+       unsigned int supported_rates;
+#define SUPPORT_RATE_CCK       0x00000001
+#define SUPPORT_RATE_OFDM      0x00000002
+
+       unsigned int num_channels;
+       const struct rf_channel *channels;
 
-       /*
-        * txpower values.
-        */
        const u8 *tx_power_a;
        const u8 *tx_power_bg;
        u8 tx_power_default;
-
-       /*
-        * Device/chipset specific value.
-        */
-       const struct rf_channel *channels;
 };
 
 /*
@@ -429,10 +439,10 @@ struct rt2x00lib_conf {
 
        struct antenna_setup ant;
 
-       int phymode;
+       enum ieee80211_band band;
 
-       int basic_rates;
-       int slot_time;
+       u32 basic_rates;
+       u32 slot_time;
 
        short sifs;
        short pifs;
@@ -440,6 +450,16 @@ struct rt2x00lib_conf {
        short eifs;
 };
 
+/*
+ * Configuration structure for erp settings.
+ */
+struct rt2x00lib_erp {
+       int short_preamble;
+
+       int ack_timeout;
+       int ack_consume_time;
+};
+
 /*
  * Configuration structure wrapper around the
  * rt2x00 interface configuration handler.
@@ -485,6 +505,7 @@ struct rt2x00lib_ops {
         */
        int (*probe_hw) (struct rt2x00_dev *rt2x00dev);
        char *(*get_firmware_name) (struct rt2x00_dev *rt2x00dev);
+       u16 (*get_firmware_crc) (void *data, const size_t len);
        int (*load_firmware) (struct rt2x00_dev *rt2x00dev, void *data,
                              const size_t len);
 
@@ -512,6 +533,8 @@ struct rt2x00lib_ops {
                            struct link_qual *qual);
        void (*reset_tuner) (struct rt2x00_dev *rt2x00dev);
        void (*link_tuner) (struct rt2x00_dev *rt2x00dev);
+       void (*led_brightness) (struct led_classdev *led_cdev,
+                               enum led_brightness brightness);
 
        /*
         * TX control handlers
@@ -545,10 +568,8 @@ struct rt2x00lib_ops {
 #define CONFIG_UPDATE_MAC              ( 1 << 2 )
 #define CONFIG_UPDATE_BSSID            ( 1 << 3 )
 
-       int (*config_preamble) (struct rt2x00_dev *rt2x00dev,
-                               const int short_preamble,
-                               const int ack_timeout,
-                               const int ack_consume_time);
+       int (*config_erp) (struct rt2x00_dev *rt2x00dev,
+                          struct rt2x00lib_erp *erp);
        void (*config) (struct rt2x00_dev *rt2x00dev,
                        struct rt2x00lib_conf *libconf,
                        const unsigned int flags);
@@ -601,8 +622,6 @@ enum rt2x00_flags {
         */
        DRIVER_SUPPORT_MIXED_INTERFACES,
        DRIVER_REQUIRE_FIRMWARE,
-       DRIVER_REQUIRE_FIRMWARE_CRC_ITU_T,
-       DRIVER_REQUIRE_FIRMWARE_CCITT,
        DRIVER_REQUIRE_BEACON_GUARD,
        DRIVER_REQUIRE_ATIM_QUEUE,
 
@@ -644,11 +663,8 @@ struct rt2x00_dev {
         * IEEE80211 control structure.
         */
        struct ieee80211_hw *hw;
-       struct ieee80211_hw_mode *hwmodes;
-       unsigned int curr_hwmode;
-#define HWMODE_B       0
-#define HWMODE_G       1
-#define HWMODE_A       2
+       struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
+       enum ieee80211_band curr_band;
 
        /*
         * rfkill structure for RF state switching support.
@@ -667,6 +683,19 @@ struct rt2x00_dev {
        struct rt2x00debug_intf *debugfs_intf;
 #endif /* CONFIG_RT2X00_LIB_DEBUGFS */
 
+       /*
+        * LED structure for changing the LED status
+        * by mac8011 or the kernel.
+        */
+#ifdef CONFIG_RT2X00_LIB_LEDS
+       unsigned int led_flags;
+       struct rt2x00_trigger trigger_qual;
+       struct rt2x00_led led_radio;
+       struct rt2x00_led led_assoc;
+       struct rt2x00_led led_qual;
+       u16 led_mcu_reg;
+#endif /* CONFIG_RT2X00_LIB_LEDS */
+
        /*
         * Device flags.
         * In these flags the current status and some
@@ -693,11 +722,13 @@ struct rt2x00_dev {
 
        /*
         * Register pointers
-        * csr_addr: Base register address. (PCI)
-        * csr_cache: CSR cache for usb_control_msg. (USB)
+        * csr.base: CSR base register address. (PCI)
+        * csr.cache: CSR cache for usb_control_msg. (USB)
         */
-       void __iomem *csr_addr;
-       void *csr_cache;
+       union csr {
+               void __iomem *base;
+               void *cache;
+       } csr;
 
        /*
         * Mutex to protect register accesses on USB devices.
@@ -758,16 +789,6 @@ struct rt2x00_dev {
         */
        u16 tx_power;
 
-       /*
-        * LED register (for rt61pci & rt73usb).
-        */
-       u16 led_reg;
-
-       /*
-        * Led mode (LED_MODE_*)
-        */
-       u8 led_mode;
-
        /*
         * Rssi <-> Dbm offset
         */