rt2x00: rt2800lib: introduce rt2800_get_txwi_rxwi_size helper

The rt2800pci driver uses the same [RT]XWI size
for all chipsets, however some chips requires
different values.

The size of the [RT]XWI structures is a constant
value for a given chipset and it does not depend
on the underlying interface. Add a helper function
which returns the correct values for the actual
chipset and use the new helper both in the rt2800usb
and in the rt2800pci drivers. This ensures that both
drivers are using the correct values.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Gabor Juhos
2013-08-16 10:23:29 +02:00
committed by John W. Linville
parent d074e8d547
commit ae1b1c5dcd
4 changed files with 36 additions and 13 deletions

View File

@@ -521,6 +521,29 @@ void rt2800_disable_wpdma(struct rt2x00_dev *rt2x00dev)
}
EXPORT_SYMBOL_GPL(rt2800_disable_wpdma);
void rt2800_get_txwi_rxwi_size(struct rt2x00_dev *rt2x00dev,
unsigned short *txwi_size,
unsigned short *rxwi_size)
{
switch (rt2x00dev->chip.rt) {
case RT3593:
*txwi_size = TXWI_DESC_SIZE_4WORDS;
*rxwi_size = RXWI_DESC_SIZE_5WORDS;
break;
case RT5592:
*txwi_size = TXWI_DESC_SIZE_5WORDS;
*rxwi_size = RXWI_DESC_SIZE_6WORDS;
break;
default:
*txwi_size = TXWI_DESC_SIZE_4WORDS;
*rxwi_size = RXWI_DESC_SIZE_4WORDS;
break;
}
}
EXPORT_SYMBOL_GPL(rt2800_get_txwi_rxwi_size);
static bool rt2800_check_firmware_crc(const u8 *data, const size_t len)
{
u16 fw_crc;