rt2x00: Update copyright notice
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rt2x00 / rt2x00.h
index 4054e54606342443a6491e7f6ae708c96e481aa5..86e4624a63ea6036ffaccf6b965d8a57274bc548 100644 (file)
@@ -1,5 +1,5 @@
 /*
-       Copyright (C) 2004 - 2007 rt2x00 SourceForge Project
+       Copyright (C) 2004 - 2008 rt2x00 SourceForge Project
        <http://rt2x00.serialmonkey.com>
 
        This program is free software; you can redistribute it and/or modify
@@ -31,6 +31,8 @@
 #include <linux/skbuff.h>
 #include <linux/workqueue.h>
 #include <linux/firmware.h>
+#include <linux/mutex.h>
+#include <linux/etherdevice.h>
 
 #include <net/mac80211.h>
 
@@ -40,9 +42,8 @@
 
 /*
  * Module information.
- * DRV_NAME should be set within the individual module source files.
  */
-#define DRV_VERSION    "2.0.10"
+#define DRV_VERSION    "2.0.14"
 #define DRV_PROJECT    "http://rt2x00.serialmonkey.com"
 
 /*
@@ -55,7 +56,7 @@
 
 #define DEBUG_PRINTK_PROBE(__kernlvl, __lvl, __msg, __args...) \
        printk(__kernlvl "%s -> %s: %s - " __msg,               \
-              DRV_NAME, __FUNCTION__, __lvl, ##__args)
+              KBUILD_MODNAME, __FUNCTION__, __lvl, ##__args)
 
 #ifdef CONFIG_RT2X00_DEBUG
 #define DEBUG_PRINTK(__dev, __kernlvl, __lvl, __msg, __args...)        \
@@ -149,6 +150,12 @@ static inline int is_probe_resp(u16 fc)
                ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP));
 }
 
+static inline int is_beacon(u16 fc)
+{
+       return (((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) &&
+               ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_BEACON));
+}
+
 /*
  * Chipset identification
  * The chipset on the device is composed of a RT and RF chip.
@@ -365,14 +372,12 @@ struct interface {
         * to us by the 80211 stack, and is used to request
         * new beacons.
         */
-       int id;
+       struct ieee80211_vif *id;
 
        /*
         * Current working type (IEEE80211_IF_TYPE_*).
-        * When set to INVALID_INTERFACE, no interface is configured.
         */
        int type;
-#define INVALID_INTERFACE      IEEE80211_IF_TYPE_INVALID
 
        /*
         * MAC of the device.
@@ -383,11 +388,6 @@ struct interface {
         * BBSID of the AP to associate with.
         */
        u8 bssid[ETH_ALEN];
-
-       /*
-        * Store the packet filter mode for the current interface.
-        */
-       unsigned int filter;
 };
 
 static inline int is_interface_present(struct interface *intf)
@@ -473,6 +473,14 @@ struct rt2x00lib_ops {
        int (*initialize) (struct rt2x00_dev *rt2x00dev);
        void (*uninitialize) (struct rt2x00_dev *rt2x00dev);
 
+       /*
+        * Ring initialization handlers
+        */
+       void (*init_rxentry) (struct rt2x00_dev *rt2x00dev,
+                             struct data_entry *entry);
+       void (*init_txentry) (struct rt2x00_dev *rt2x00dev,
+                             struct data_entry *entry);
+
        /*
         * Radio control handlers.
         */
@@ -488,10 +496,8 @@ struct rt2x00lib_ops {
         * TX control handlers
         */
        void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev,
-                              struct data_desc *txd,
+                              struct sk_buff *skb,
                               struct txdata_entry_desc *desc,
-                              struct ieee80211_hdr *ieee80211hdr,
-                              unsigned int length,
                               struct ieee80211_tx_control *control);
        int (*write_tx_data) (struct rt2x00_dev *rt2x00dev,
                              struct data_ring *ring, struct sk_buff *skb,
@@ -623,7 +629,7 @@ struct rt2x00_dev {
         * required for deregistration of debugfs.
         */
 #ifdef CONFIG_RT2X00_LIB_DEBUGFS
-       const struct rt2x00debug_intf *debugfs_intf;
+       struct rt2x00debug_intf *debugfs_intf;
 #endif /* CONFIG_RT2X00_LIB_DEBUGFS */
 
        /*
@@ -658,6 +664,25 @@ struct rt2x00_dev {
        void __iomem *csr_addr;
        void *csr_cache;
 
+       /*
+        * Mutex to protect register accesses on USB devices.
+        * There are 2 reasons this is needed, one is to ensure
+        * use of the csr_cache (for USB devices) by one thread
+        * isn't corrupted by another thread trying to access it.
+        * The other is that access to BBP and RF registers
+        * require multiple BUS transactions and if another thread
+        * attempted to access one of those registers at the same
+        * time one of the writes could silently fail.
+        */
+       struct mutex usb_cache_mutex;
+
+       /*
+        * Current packet filter configuration for the device.
+        * This contains all currently active FIF_* flags send
+        * to us by mac80211 during configure_filter().
+        */
+       unsigned int packet_filter;
+
        /*
         * Interface configuration.
         */
@@ -782,13 +807,13 @@ struct rt2x00_dev {
  * Generic RF access.
  * The RF is being accessed by word index.
  */
-static inline void rt2x00_rf_read(const struct rt2x00_dev *rt2x00dev,
+static inline void rt2x00_rf_read(struct rt2x00_dev *rt2x00dev,
                                  const unsigned int word, u32 *data)
 {
        *data = rt2x00dev->rf[word];
 }
 
-static inline void rt2x00_rf_write(const struct rt2x00_dev *rt2x00dev,
+static inline void rt2x00_rf_write(struct rt2x00_dev *rt2x00dev,
                                   const unsigned int word, u32 data)
 {
        rt2x00dev->rf[word] = data;
@@ -798,19 +823,19 @@ static inline void rt2x00_rf_write(const struct rt2x00_dev *rt2x00dev,
  *  Generic EEPROM access.
  * The EEPROM is being accessed by word index.
  */
-static inline void *rt2x00_eeprom_addr(const struct rt2x00_dev *rt2x00dev,
+static inline void *rt2x00_eeprom_addr(struct rt2x00_dev *rt2x00dev,
                                       const unsigned int word)
 {
        return (void *)&rt2x00dev->eeprom[word];
 }
 
-static inline void rt2x00_eeprom_read(const struct rt2x00_dev *rt2x00dev,
+static inline void rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev,
                                      const unsigned int word, u16 *data)
 {
        *data = le16_to_cpu(rt2x00dev->eeprom[word]);
 }
 
-static inline void rt2x00_eeprom_write(const struct rt2x00_dev *rt2x00dev,
+static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev,
                                       const unsigned int word, u16 data)
 {
        rt2x00dev->eeprom[word] = cpu_to_le16(data);
@@ -889,9 +914,7 @@ void rt2x00lib_rxdone(struct data_entry *entry, struct sk_buff *skb,
  * TX descriptor initializer
  */
 void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev,
-                            struct data_desc *txd,
-                            struct ieee80211_hdr *ieee80211hdr,
-                            unsigned int length,
+                            struct sk_buff *skb,
                             struct ieee80211_tx_control *control);
 
 /*
@@ -906,14 +929,17 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
 void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
                                struct ieee80211_if_init_conf *conf);
 int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
-int rt2x00mac_config_interface(struct ieee80211_hw *hw, int if_id,
+int rt2x00mac_config_interface(struct ieee80211_hw *hw,
+                              struct ieee80211_vif *vif,
                               struct ieee80211_if_conf *conf);
 int rt2x00mac_get_stats(struct ieee80211_hw *hw,
                        struct ieee80211_low_level_stats *stats);
 int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw,
                           struct ieee80211_tx_queue_stats *stats);
-void rt2x00mac_erp_ie_changed(struct ieee80211_hw *hw, u8 changes,
-                             int cts_protection, int preamble);
+void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
+                               struct ieee80211_vif *vif,
+                               struct ieee80211_bss_conf *bss_conf,
+                               u32 changes);
 int rt2x00mac_conf_tx(struct ieee80211_hw *hw, int queue,
                      const struct ieee80211_tx_queue_params *params);