brcmsmac: extend xmtfifo_sz array

The xmtfifo_sz array contains the queue sizes for the different core
revs. This array missed the sizes for the core rev 17 and 28. This
patch extends the array to also include these sizes and adds a warning
if no queue size is stored in the array for the given core rev.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Hauke Mehrtens 2012-07-02 20:15:51 +02:00 коммит произвёл John W. Linville
Родитель c9d6afc91d
Коммит 093cd33497
1 изменённых файлов: 19 добавлений и 1 удалений

Просмотреть файл

@ -269,7 +269,7 @@ struct brcms_c_bit_desc {
*/ */
/* Starting corerev for the fifo size table */ /* Starting corerev for the fifo size table */
#define XMTFIFOTBL_STARTREV 20 #define XMTFIFOTBL_STARTREV 17
struct d11init { struct d11init {
__le16 addr; __le16 addr;
@ -333,6 +333,12 @@ const u8 wlc_prio2prec_map[] = {
}; };
static const u16 xmtfifo_sz[][NFIFO] = { static const u16 xmtfifo_sz[][NFIFO] = {
/* corerev 17: 5120, 49152, 49152, 5376, 4352, 1280 */
{20, 192, 192, 21, 17, 5},
/* corerev 18: */
{0, 0, 0, 0, 0, 0},
/* corerev 19: */
{0, 0, 0, 0, 0, 0},
/* corerev 20: 5120, 49152, 49152, 5376, 4352, 1280 */ /* corerev 20: 5120, 49152, 49152, 5376, 4352, 1280 */
{20, 192, 192, 21, 17, 5}, {20, 192, 192, 21, 17, 5},
/* corerev 21: 2304, 14848, 5632, 3584, 3584, 1280 */ /* corerev 21: 2304, 14848, 5632, 3584, 3584, 1280 */
@ -343,6 +349,14 @@ static const u16 xmtfifo_sz[][NFIFO] = {
{20, 192, 192, 21, 17, 5}, {20, 192, 192, 21, 17, 5},
/* corerev 24: 2304, 14848, 5632, 3584, 3584, 1280 */ /* corerev 24: 2304, 14848, 5632, 3584, 3584, 1280 */
{9, 58, 22, 14, 14, 5}, {9, 58, 22, 14, 14, 5},
/* corerev 25: */
{0, 0, 0, 0, 0, 0},
/* corerev 26: */
{0, 0, 0, 0, 0, 0},
/* corerev 27: */
{0, 0, 0, 0, 0, 0},
/* corerev 28: 2304, 14848, 5632, 3584, 3584, 1280 */
{9, 58, 22, 14, 14, 5},
}; };
#ifdef DEBUG #ifdef DEBUG
@ -4596,8 +4610,12 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
wlc_hw->machwcap_backup = wlc_hw->machwcap; wlc_hw->machwcap_backup = wlc_hw->machwcap;
/* init tx fifo size */ /* init tx fifo size */
WARN_ON((wlc_hw->corerev - XMTFIFOTBL_STARTREV) < 0 ||
(wlc_hw->corerev - XMTFIFOTBL_STARTREV) >
ARRAY_SIZE(xmtfifo_sz));
wlc_hw->xmtfifo_sz = wlc_hw->xmtfifo_sz =
xmtfifo_sz[(wlc_hw->corerev - XMTFIFOTBL_STARTREV)]; xmtfifo_sz[(wlc_hw->corerev - XMTFIFOTBL_STARTREV)];
WARN_ON(!wlc_hw->xmtfifo_sz[0]);
/* Get a phy for this band */ /* Get a phy for this band */
wlc_hw->band->pi = wlc_hw->band->pi =