rt2x00: rt2800pci: move RX control handler functions to the rt2800mmio module
Move the functions into a separate module, in order to make those usable from other modules. Also move the RX descriptor related defines from rt2800pci.h into rt2800mmio.h Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
d10b7547d5
commit
9732497d4d
@@ -627,61 +627,6 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* RX control handlers
|
||||
*/
|
||||
static void rt2800mmio_fill_rxdone(struct queue_entry *entry,
|
||||
struct rxdone_entry_desc *rxdesc)
|
||||
{
|
||||
struct queue_entry_priv_mmio *entry_priv = entry->priv_data;
|
||||
__le32 *rxd = entry_priv->desc;
|
||||
u32 word;
|
||||
|
||||
rt2x00_desc_read(rxd, 3, &word);
|
||||
|
||||
if (rt2x00_get_field32(word, RXD_W3_CRC_ERROR))
|
||||
rxdesc->flags |= RX_FLAG_FAILED_FCS_CRC;
|
||||
|
||||
/*
|
||||
* Unfortunately we don't know the cipher type used during
|
||||
* decryption. This prevents us from correct providing
|
||||
* correct statistics through debugfs.
|
||||
*/
|
||||
rxdesc->cipher_status = rt2x00_get_field32(word, RXD_W3_CIPHER_ERROR);
|
||||
|
||||
if (rt2x00_get_field32(word, RXD_W3_DECRYPTED)) {
|
||||
/*
|
||||
* Hardware has stripped IV/EIV data from 802.11 frame during
|
||||
* decryption. Unfortunately the descriptor doesn't contain
|
||||
* any fields with the EIV/IV data either, so they can't
|
||||
* be restored by rt2x00lib.
|
||||
*/
|
||||
rxdesc->flags |= RX_FLAG_IV_STRIPPED;
|
||||
|
||||
/*
|
||||
* The hardware has already checked the Michael Mic and has
|
||||
* stripped it from the frame. Signal this to mac80211.
|
||||
*/
|
||||
rxdesc->flags |= RX_FLAG_MMIC_STRIPPED;
|
||||
|
||||
if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS)
|
||||
rxdesc->flags |= RX_FLAG_DECRYPTED;
|
||||
else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC)
|
||||
rxdesc->flags |= RX_FLAG_MMIC_ERROR;
|
||||
}
|
||||
|
||||
if (rt2x00_get_field32(word, RXD_W3_MY_BSS))
|
||||
rxdesc->dev_flags |= RXDONE_MY_BSS;
|
||||
|
||||
if (rt2x00_get_field32(word, RXD_W3_L2PAD))
|
||||
rxdesc->dev_flags |= RXDONE_L2PAD;
|
||||
|
||||
/*
|
||||
* Process the RXWI structure that is at the start of the buffer.
|
||||
*/
|
||||
rt2800_process_rxwi(entry, rxdesc);
|
||||
}
|
||||
|
||||
/*
|
||||
* Interrupt functions.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user