Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[safe/jmp/linux-2.6] / drivers / net / wireless / rt2x00 / rt2x00.h
index 1ddda72..dcfc8c2 100644 (file)
@@ -1,5 +1,6 @@
 /*
-       Copyright (C) 2004 - 2009 rt2x00 SourceForge Project
+       Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
+       Copyright (C) 2004 - 2009 Gertjan van Wingerde <gwingerde@gmail.com>
        <http://rt2x00.serialmonkey.com>
 
        This program is free software; you can redistribute it and/or modify
        (  ((unsigned long)((__skb)->data + (__header))) & 3 )
 
 /*
+ * Constants for extra TX headroom for alignment purposes.
+ */
+#define RT2X00_ALIGN_SIZE      4 /* Only whole frame needs alignment */
+#define RT2X00_L2PAD_SIZE      8 /* Both header & payload need alignment */
+
+/*
  * Standard timing and size defines.
  * These values should follow the ieee80211 specifications.
  */
@@ -171,6 +178,7 @@ struct rt2x00_chip {
 #define RT3052         0x3052  /* WSOC */
 #define RT3090         0x3090  /* 2.4GHz PCIe */
 #define RT2870         0x1600
+#define RT3070         0x1800
 
        u16 rf;
        u32 rev;
@@ -313,13 +321,6 @@ struct link {
        struct avg_val avg_rssi;
 
        /*
-        * Currently precalculated percentages of successful
-        * TX and RX frames.
-        */
-       int rx_percentage;
-       int tx_percentage;
-
-       /*
         * Work structure for scheduling periodic link tuning.
         */
        struct delayed_work work;
@@ -593,6 +594,7 @@ struct rt2x00_ops {
        const unsigned int eeprom_size;
        const unsigned int rf_size;
        const unsigned int tx_queues;
+       const unsigned int extra_tx_headroom;
        const struct data_queue_desc *rx;
        const struct data_queue_desc *tx;
        const struct data_queue_desc *bcn;
@@ -857,6 +859,15 @@ struct rt2x00_dev {
 };
 
 /*
+ * Register defines.
+ * Some registers require multiple attempts before success,
+ * in those cases REGISTER_BUSY_COUNT attempts should be
+ * taken with a REGISTER_BUSY_DELAY interval.
+ */
+#define REGISTER_BUSY_COUNT    5
+#define REGISTER_BUSY_DELAY    100
+
+/*
  * Generic RF access.
  * The RF is being accessed by word index.
  */
@@ -902,10 +913,6 @@ static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev,
 static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev,
                                   const u16 rt, const u16 rf, const u32 rev)
 {
-       INFO(rt2x00dev,
-            "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n",
-            rt, rf, rev);
-
        rt2x00dev->chip.rt = rt;
        rt2x00dev->chip.rf = rf;
        rt2x00dev->chip.rev = rev;
@@ -923,6 +930,13 @@ static inline void rt2x00_set_chip_rf(struct rt2x00_dev *rt2x00dev,
        rt2x00_set_chip(rt2x00dev, rt2x00dev->chip.rt, rf, rev);
 }
 
+static inline void rt2x00_print_chip(struct rt2x00_dev *rt2x00dev)
+{
+       INFO(rt2x00dev,
+            "Chipset detected - rt: %04x, rf: %04x, rev: %08x.\n",
+            rt2x00dev->chip.rt, rt2x00dev->chip.rf, rt2x00dev->chip.rev);
+}
+
 static inline char rt2x00_rt(const struct rt2x00_chip *chipset, const u16 chip)
 {
        return (chipset->rt == chip);