Merge commit 'origin/master' into next
[pandora-kernel.git] / drivers / net / wireless / b43 / b43.h
index a53c378..f580c28 100644 (file)
 #define B43_MMIO_IFSCTL                        0x688 /* Interframe space control */
 #define  B43_MMIO_IFSCTL_USE_EDCF      0x0004
 #define B43_MMIO_POWERUP_DELAY         0x6A8
+#define B43_MMIO_BTCOEX_CTL            0x6B4 /* Bluetooth Coexistence Control */
+#define B43_MMIO_BTCOEX_STAT           0x6B6 /* Bluetooth Coexistence Status */
+#define B43_MMIO_BTCOEX_TXCTL          0x6B8 /* Bluetooth Coexistence Transmit Control */
 
 /* SPROM boardflags_lo values */
 #define B43_BFL_BTCOEXIST              0x0001  /* implements Bluetooth coexistance */
@@ -160,6 +163,7 @@ enum {
 #define B43_SHM_SH_WLCOREREV           0x0016  /* 802.11 core revision */
 #define B43_SHM_SH_PCTLWDPOS           0x0008
 #define B43_SHM_SH_RXPADOFF            0x0034  /* RX Padding data offset (PIO only) */
+#define B43_SHM_SH_FWCAPA              0x0042  /* Firmware capabilities (Opensource firmware only) */
 #define B43_SHM_SH_PHYVER              0x0050  /* PHY version */
 #define B43_SHM_SH_PHYTYPE             0x0052  /* PHY type */
 #define B43_SHM_SH_ANTSWAP             0x005C  /* Antenna swap threshold */
@@ -294,6 +298,10 @@ enum {
 #define B43_HF_MLADVW          0x001000000000ULL /* N PHY ML ADV workaround (rev >= 13 only) */
 #define B43_HF_PR45960W                0x080000000000ULL /* PR 45960 workaround (rev >= 13 only) */
 
+/* Firmware capabilities field in SHM (Opensource firmware only) */
+#define B43_FWCAPA_HWCRYPTO    0x0001
+#define B43_FWCAPA_QOS         0x0002
+
 /* MacFilter offsets. */
 #define B43_MACFILTER_SELF             0x0000
 #define B43_MACFILTER_BSSID            0x0003
@@ -547,9 +555,6 @@ struct b43_noise_calculation {
 
 struct b43_stats {
        u8 link_noise;
-       /* Store the last TX/RX times here for updating the leds. */
-       unsigned long last_tx;
-       unsigned long last_rx;
 };
 
 struct b43_key {
@@ -596,6 +601,13 @@ struct b43_wl {
        /* Pointer to the ieee80211 hardware data structure */
        struct ieee80211_hw *hw;
 
+       /* The number of queues that were registered with the mac80211 subsystem
+        * initially. This is a backup copy of hw->queues in case hw->queues has
+        * to be dynamically lowered at runtime (Firmware does not support QoS).
+        * hw->queues has to be restored to the original value before unregistering
+        * from the mac80211 subsystem. */
+       u16 mac80211_initially_registered_queues;
+
        struct mutex mutex;
        spinlock_t irq_lock;
        /* R/W lock for data transmission.
@@ -625,12 +637,11 @@ struct b43_wl {
        /* Stats about the wireless interface */
        struct ieee80211_low_level_stats ieee_stats;
 
+#ifdef CONFIG_B43_HWRNG
        struct hwrng rng;
-       u8 rng_initialized;
+       bool rng_initialized;
        char rng_name[30 + 1];
-
-       /* The RF-kill button */
-       struct b43_rfkill rfkill;
+#endif /* CONFIG_B43_HWRNG */
 
        /* List of all wireless devices on this chip */
        struct list_head devlist;
@@ -655,10 +666,39 @@ struct b43_wl {
        struct work_struct txpower_adjust_work;
 };
 
+/* The type of the firmware file. */
+enum b43_firmware_file_type {
+       B43_FWTYPE_PROPRIETARY,
+       B43_FWTYPE_OPENSOURCE,
+       B43_NR_FWTYPES,
+};
+
+/* Context data for fetching firmware. */
+struct b43_request_fw_context {
+       /* The device we are requesting the fw for. */
+       struct b43_wldev *dev;
+       /* The type of firmware to request. */
+       enum b43_firmware_file_type req_type;
+       /* Error messages for each firmware type. */
+       char errors[B43_NR_FWTYPES][128];
+       /* Temporary buffer for storing the firmware name. */
+       char fwname[64];
+       /* A fatal error occured while requesting. Firmware reqest
+        * can not continue, as any other reqest will also fail. */
+       int fatal_failure;
+};
+
 /* In-memory representation of a cached microcode file. */
 struct b43_firmware_file {
        const char *filename;
        const struct firmware *data;
+       /* Type of the firmware file name. Note that this does only indicate
+        * the type by the firmware name. NOT the file contents.
+        * If you want to check for proprietary vs opensource, use (struct b43_firmware)->opensource
+        * instead! The (struct b43_firmware)->opensource flag is derived from the actual firmware
+        * binary code, not just the filename.
+        */
+       enum b43_firmware_file_type type;
 };
 
 /* Pointers to the firmware data and meta information about it. */
@@ -677,7 +717,8 @@ struct b43_firmware {
        /* Firmware patchlevel */
        u16 patch;
 
-       /* Set to true, if we are using an opensource firmware. */
+       /* Set to true, if we are using an opensource firmware.
+        * Use this to check for proprietary vs opensource. */
        bool opensource;
        /* Set to true, if the core needs a PCM firmware, but
         * we failed to load one. This is always false for
@@ -720,6 +761,8 @@ struct b43_wldev {
        bool dfq_valid;         /* Directed frame queue valid (IBSS PS mode, ATIM) */
        bool radio_hw_enable;   /* saved state of radio hardware enabled state */
        bool suspend_in_progress;       /* TRUE, if we are in a suspend/resume cycle */
+       bool qos_enabled;               /* TRUE, if QoS is used. */
+       bool hwcrypto_enabled;          /* TRUE, if HW crypto acceleration is enabled. */
 
        /* PHY/Radio device. */
        struct b43_phy phy;
@@ -746,8 +789,8 @@ struct b43_wldev {
        /* Reason code of the last interrupt. */
        u32 irq_reason;
        u32 dma_reason[6];
-       /* saved irq enable/disable state bitfield. */
-       u32 irq_savedstate;
+       /* The currently active generic-interrupt mask. */
+       u32 irq_mask;
        /* Link Quality calculation context. */
        struct b43_noise_calculation noisecalc;
        /* if > 0 MAC is suspended. if == 0 MAC is enabled. */
@@ -848,12 +891,9 @@ void b43err(struct b43_wl *wl, const char *fmt, ...)
     __attribute__ ((format(printf, 2, 3)));
 void b43warn(struct b43_wl *wl, const char *fmt, ...)
     __attribute__ ((format(printf, 2, 3)));
-#if B43_DEBUG
 void b43dbg(struct b43_wl *wl, const char *fmt, ...)
     __attribute__ ((format(printf, 2, 3)));
-#else /* DEBUG */
-# define b43dbg(wl, fmt...) do { /* nothing */ } while (0)
-#endif /* DEBUG */
+
 
 /* A WARN_ON variant that vanishes when b43 debugging is disabled.
  * This _also_ evaluates the arg with debugging disabled. */