]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/b43/b43.h
b43: Remove TX spinlock
[mv-sheeva.git] / drivers / net / wireless / b43 / b43.h
index f580c2812d91846d611c552295e9722fe09aa06f..1cd470d6e2da6a950bf04b45b9d47971bcd21baf 100644 (file)
 #define B43_BFL_BTCMOD                 0x4000  /* BFL_BTCOEXIST is given in alternate GPIOs */
 #define B43_BFL_ALTIQ                  0x8000  /* alternate I/Q settings */
 
+/* SPROM boardflags_hi values */
+#define B43_BFH_NOPA                   0x0001  /* has no PA */
+#define B43_BFH_RSSIINV                        0x0002  /* RSSI uses positive slope (not TSSI) */
+#define B43_BFH_PAREF                  0x0004  /* uses the PARef LDO */
+#define B43_BFH_3TSWITCH               0x0008  /* uses a triple throw switch shared
+                                                * with bluetooth */
+#define B43_BFH_PHASESHIFT             0x0010  /* can support phase shifter */
+#define B43_BFH_BUCKBOOST              0x0020  /* has buck/booster */
+#define B43_BFH_FEM_BT                 0x0040  /* has FEM and switch to share antenna
+                                                * with bluetooth */
+
 /* GPIO register offset, in both ChipCommon and PCI core. */
 #define B43_GPIO_CONTROL               0x6c
 
@@ -482,6 +493,10 @@ enum {
 
 /* Max size of a security key */
 #define B43_SEC_KEYSIZE                        16
+/* Max number of group keys */
+#define B43_NR_GROUP_KEYS              4
+/* Max number of pairwise keys */
+#define B43_NR_PAIRWISE_KEYS           50
 /* Security algorithms. */
 enum {
        B43_SEC_ALGO_NONE = 0,  /* unencrypted, as of TX header. */
@@ -601,6 +616,12 @@ struct b43_wl {
        /* Pointer to the ieee80211 hardware data structure */
        struct ieee80211_hw *hw;
 
+       /* Global driver mutex. Every operation must run with this mutex locked. */
+       struct mutex mutex;
+       /* Hard-IRQ spinlock. This lock protects things used in the hard-IRQ
+        * handler, only. This basically is just the IRQ mask register. */
+       spinlock_t hardirq_lock;
+
        /* 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).
@@ -608,8 +629,6 @@ struct b43_wl {
         * from the mac80211 subsystem. */
        u16 mac80211_initially_registered_queues;
 
-       struct mutex mutex;
-       spinlock_t irq_lock;
        /* R/W lock for data transmission.
         * Transmissions on 2+ queues can run concurrently, but somebody else
         * might sync with TX by write_lock_irqsave()'ing. */
@@ -628,7 +647,7 @@ struct b43_wl {
        u8 mac_addr[ETH_ALEN];
        /* Current BSSID */
        u8 bssid[ETH_ALEN];
-       /* Interface type. (IEEE80211_IF_TYPE_XXX) */
+       /* Interface type. (NL80211_IFTYPE_XXX) */
        int if_type;
        /* Is the card operating in AP, STA or IBSS mode? */
        bool operating;
@@ -648,9 +667,9 @@ struct b43_wl {
        u8 nr_devs;
 
        bool radiotap_enabled;
+       bool radio_enabled;
 
-       /* The beacon we are currently using (AP or IBSS mode).
-        * This beacon stuff is protected by the irq_lock. */
+       /* The beacon we are currently using (AP or IBSS mode). */
        struct sk_buff *current_beacon;
        bool beacon0_uploaded;
        bool beacon1_uploaded;
@@ -664,6 +683,11 @@ struct b43_wl {
         * This is scheduled when we determine that the actual TX output
         * power doesn't match what we want. */
        struct work_struct txpower_adjust_work;
+
+       /* Packet transmit work */
+       struct work_struct tx_work;
+       /* Queue of packets to be transmitted. */
+       struct sk_buff_head tx_queue;
 };
 
 /* The type of the firmware file. */
@@ -738,14 +762,6 @@ enum {
                smp_wmb();                                      \
                                        } while (0)
 
-/* XXX---   HOW LOCKING WORKS IN B43   ---XXX
- *
- * You should always acquire both, wl->mutex and wl->irq_lock unless:
- * - You don't need to acquire wl->irq_lock, if the interface is stopped.
- * - You don't need to acquire wl->mutex in the IRQ handler, IRQ tasklet
- *   and packet TX path (and _ONLY_ there.)
- */
-
 /* Data structure for one wireless device (802.11 core) */
 struct b43_wldev {
        struct ssb_device *dev;
@@ -791,14 +807,12 @@ struct b43_wldev {
        u32 dma_reason[6];
        /* 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. */
        int mac_suspended;
 
-       /* Interrupt Service Routine tasklet (bottom-half) */
-       struct tasklet_struct isr_tasklet;
-
        /* Periodic tasks */
        struct delayed_work periodic_work;
        unsigned int periodic_state;
@@ -807,8 +821,7 @@ struct b43_wldev {
 
        /* encryption/decryption */
        u16 ktp;                /* Key table pointer */
-       u8 max_nr_keys;
-       struct b43_key key[58];
+       struct b43_key key[B43_NR_GROUP_KEYS * 2 + B43_NR_PAIRWISE_KEYS];
 
        /* Firmware data */
        struct b43_firmware fw;
@@ -833,7 +846,7 @@ static inline struct b43_wldev *dev_to_b43_wldev(struct device *dev)
        return ssb_get_drvdata(ssb_dev);
 }
 
-/* Is the device operating in a specified mode (IEEE80211_IF_TYPE_XXX). */
+/* Is the device operating in a specified mode (NL80211_IFTYPE_XXX). */
 static inline int b43_is_mode(struct b43_wl *wl, int type)
 {
        return (wl->operating && wl->if_type == type);