struct queue_entry_priv_pci_rx *priv_rx = entry->priv_data;
u32 word0;
u32 word2;
+ u32 word3;
rt2x00_desc_read(priv_rx->desc, 0, &word0);
rt2x00_desc_read(priv_rx->desc, 2, &word2);
+ rt2x00_desc_read(priv_rx->desc, 3, &word3);
rxdesc->flags = 0;
if (rt2x00_get_field32(word0, RXD_W0_CRC_ERROR))
/*
* Obtain the status about this packet.
+ * The signal is the PLCP value.
*/
rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL);
- rxdesc->rssi = rt2x00_get_field32(word2, RXD_W2_RSSI) -
+ rxdesc->signal_plcp = 1;
+ rxdesc->rssi = rt2x00_get_field32(word2, RXD_W3_RSSI) -
entry->queue->rt2x00dev->rssi_offset;
rxdesc->ofdm = 0;
rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
* Word2
*/
#define RXD_W2_BUFFER_LENGTH FIELD32(0x0000ffff)
-#define RXD_W2_SIGNAL FIELD32(0x00ff0000)
-#define RXD_W2_RSSI FIELD32(0xff000000)
+#define RXD_W2_BBR0 FIELD32(0x00ff0000)
+#define RXD_W2_SIGNAL FIELD32(0xff000000)
/*
* Word3
*/
-#define RXD_W3_BBR2 FIELD32(0x000000ff)
+#define RXD_W3_RSSI FIELD32(0x000000ff)
#define RXD_W3_BBR3 FIELD32(0x0000ff00)
#define RXD_W3_BBR4 FIELD32(0x00ff0000)
#define RXD_W3_BBR5 FIELD32(0xff000000)
if (rt2x00_get_field32(word0, RXD_W0_PHYSICAL_ERROR))
rxdesc->flags |= RX_FLAG_FAILED_PLCP_CRC;
+ /*
+ * Obtain the status about this packet.
+ * When frame was received with an OFDM bitrate,
+ * the signal is the PLCP value. If it was received with
+ * a CCK bitrate the signal is the rate in 100kbit/s.
+ */
+ rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
rxdesc->signal = rt2x00_get_field32(word2, RXD_W2_SIGNAL);
+ rxdesc->signal_plcp = rxdesc->ofdm;
rxdesc->rssi = rt2x00_get_field32(word2, RXD_W2_RSSI) -
entry->queue->rt2x00dev->rssi_offset;
- rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
}
/*
* Obtain the status about this packet.
+ * When frame was received with an OFDM bitrate,
+ * the signal is the PLCP value. If it was received with
+ * a CCK bitrate the signal is the rate in 100kbit/s.
*/
+ rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL);
+ rxdesc->signal_plcp = rxdesc->ofdm;
rxdesc->rssi = rt2x00_get_field32(word1, RXD_W1_RSSI) -
entry->queue->rt2x00dev->rssi_offset;
- rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
int idx = -1;
u16 fc;
+ /*
+ * If the signal is the plcp value,
+ * we need to strip the preamble bit (0x08).
+ */
+ if (rxdesc->signal_plcp)
+ rxdesc->signal &= ~0x08;
+
/*
* Update RX statistics.
*/
for (i = 0; i < sband->n_bitrates; i++) {
rate = rt2x00_get_rate(sband->bitrates[i].hw_value);
- /*
- * When frame was received with an OFDM bitrate,
- * the signal is the PLCP value. If it was received with
- * a CCK bitrate the signal is the rate in 100kbit/s.
- */
- if ((rxdesc->ofdm && rate->plcp == rxdesc->signal) ||
- (!rxdesc->ofdm && rate->bitrate == rxdesc->signal)) {
+ if ((rxdesc->signal_plcp && rate->plcp == rxdesc->signal) ||
+ (!rxdesc->signal_plcp && rate->bitrate == rxdesc->signal)) {
idx = i;
break;
}
* Summary of information that has been read from the RX frame descriptor.
*
* @signal: Signal of the received frame.
+ * @signal_plcp: Does the signal field contain the plcp value,
+ * or does it contain the bitrate itself.
* @rssi: RSSI of the received frame.
* @ofdm: Was frame send with an OFDM rate.
* @size: Data size of the received frame.
*/
struct rxdone_entry_desc {
int signal;
+ int signal_plcp;
int rssi;
int ofdm;
int size;
/*
* Obtain the status about this packet.
+ * When frame was received with an OFDM bitrate,
+ * the signal is the PLCP value. If it was received with
+ * a CCK bitrate the signal is the rate in 100kbit/s.
*/
+ rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL);
+ rxdesc->signal_plcp = rxdesc->ofdm;
rxdesc->rssi = rt61pci_agc_to_rssi(entry->queue->rt2x00dev, word1);
- rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);
}
/*
* Obtain the status about this packet.
+ * When frame was received with an OFDM bitrate,
+ * the signal is the PLCP value. If it was received with
+ * a CCK bitrate the signal is the rate in 100kbit/s.
*/
+ rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
rxdesc->signal = rt2x00_get_field32(word1, RXD_W1_SIGNAL);
+ rxdesc->signal_plcp = rxdesc->ofdm;
rxdesc->rssi = rt73usb_agc_to_rssi(entry->queue->rt2x00dev, word1);
- rxdesc->ofdm = rt2x00_get_field32(word0, RXD_W0_OFDM);
rxdesc->size = rt2x00_get_field32(word0, RXD_W0_DATABYTE_COUNT);
rxdesc->my_bss = !!rt2x00_get_field32(word0, RXD_W0_MY_BSS);