rt2x00: Introduce RXDONE_SIGNAL_MASK mask
authorIvo van Doorn <ivdoorn@gmail.com>
Sat, 20 Dec 2008 09:59:55 +0000 (10:59 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 20:58:41 +0000 (15:58 -0500)
Improve error message reporting when a frame was received
with unknown rate. Instead of using the boolean check if
the frame is supposed to be a PLCP value or not, we should
add a new mask (RXDONE_SIGNAL_MASK) which returns the type
identification for a signal value (i.e. PLCP). At the moment
we only have 2 different types, but more will arrive when
support for 11n is added.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00dev.c
drivers/net/wireless/rt2x00/rt2x00queue.h

index c7bd212656dfed5dd87082cce059cbad53e6910c..12331b15fe797970faa2f300f589d659412875e7 100644 (file)
@@ -392,8 +392,8 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
 
        if (idx < 0) {
                WARNING(rt2x00dev, "Frame received with unrecognized signal,"
-                       "signal=0x%.2x, plcp=%d.\n", rxdesc.signal,
-                       !!(rxdesc.dev_flags & RXDONE_SIGNAL_PLCP));
+                       "signal=0x%.2x, type=%d.\n", rxdesc.signal,
+                       (rxdesc.dev_flags & RXDONE_SIGNAL_MASK));
                idx = 0;
        }
 
index 1bd1a952e42c3d6c5eaf376a210a30e7056abb40..98209d2e93af21b42fa23e8122261f98d2e8fb10 100644 (file)
@@ -157,6 +157,14 @@ enum rxdone_entry_desc_flags {
        RXDONE_CRYPTO_ICV = 1 << 4,
 };
 
+/**
+ * RXDONE_SIGNAL_MASK - Define to mask off all &rxdone_entry_desc_flags flags
+ * except for the RXDONE_SIGNAL_* flags. This is useful to convert the dev_flags
+ * from &rxdone_entry_desc to a signal value type.
+ */
+#define RXDONE_SIGNAL_MASK \
+       ( RXDONE_SIGNAL_PLCP | RXDONE_SIGNAL_BITRATE )
+
 /**
  * struct rxdone_entry_desc: RX Entry descriptor
  *