]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/rt2x00/rt2x00.h
rt2x00: Update copyright statements.
[karo-tx-linux.git] / drivers / net / wireless / rt2x00 / rt2x00.h
index 196de8ab8153513e8ad1fbc538720b5490a461de..5a1b1612dcaa92b01d9b8fd1234e7002df3bcc47 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
@@ -144,6 +145,11 @@ struct avg_val {
        int avg_weight;
 };
 
+enum rt2x00_chip_intf {
+       RT2X00_CHIP_INTF_PCI,
+       RT2X00_CHIP_INTF_USB,
+};
+
 /*
  * Chipset identification
  * The chipset on the device is composed of a RT and RF chip.
@@ -169,6 +175,8 @@ struct rt2x00_chip {
 
        u16 rf;
        u32 rev;
+
+       enum rt2x00_chip_intf intf;
 };
 
 /*
@@ -305,13 +313,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.
         */
@@ -842,8 +843,22 @@ struct rt2x00_dev {
         * Firmware image.
         */
        const struct firmware *fw;
+
+       /*
+        * Driver specific data.
+        */
+       void *priv;
 };
 
+/*
+ * 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.
@@ -932,6 +947,28 @@ static inline bool rt2x00_check_rev(const struct rt2x00_chip *chipset,
        return ((chipset->rev & mask) == rev);
 }
 
+static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev,
+                                       enum rt2x00_chip_intf intf)
+{
+       rt2x00dev->chip.intf = intf;
+}
+
+static inline bool rt2x00_intf(const struct rt2x00_chip *chipset,
+                              enum rt2x00_chip_intf intf)
+{
+       return (chipset->intf == intf);
+}
+
+static inline bool rt2x00_intf_is_pci(struct rt2x00_dev *rt2x00dev)
+{
+       return rt2x00_intf(&rt2x00dev->chip, RT2X00_CHIP_INTF_PCI);
+}
+
+static inline bool rt2x00_intf_is_usb(struct rt2x00_dev *rt2x00dev)
+{
+       return rt2x00_intf(&rt2x00dev->chip, RT2X00_CHIP_INTF_USB);
+}
+
 /**
  * rt2x00queue_map_txskb - Map a skb into DMA for TX purposes.
  * @rt2x00dev: Pointer to &struct rt2x00_dev.