diff options
author | Ping-Ke Shih <pkshih@realtek.com> | 2017-11-13 12:39:34 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2017-12-07 16:14:51 +0300 |
commit | dc9682a0cca5018a64eefe1630f204fe4fbfebcc (patch) | |
tree | 48af7c9c05b6476ec867627d81ef4b669410f7d2 /drivers/net/wireless/realtek/rtlwifi/pci.h | |
parent | fb9829e90dcd5365c45478629e45075560ea8644 (diff) | |
download | linux-dc9682a0cca5018a64eefe1630f204fe4fbfebcc.tar.xz |
rtlwifi: fix the wrong size to calculate fifo space
Give correct fifo size to calculate fifo space. Fortunately, the values of
RTL_PCI_MAX_RX_COUNT and TX_DESC_NUM_92E are the same in old code, so it
still works.
Signed-off-by: Steven Ting <steventing@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/pci.h')
-rw-r--r-- | drivers/net/wireless/realtek/rtlwifi/pci.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.h b/drivers/net/wireless/realtek/rtlwifi/pci.h index e7d070e8da2d..ed5de1218bd9 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.h +++ b/drivers/net/wireless/realtek/rtlwifi/pci.h @@ -320,10 +320,10 @@ static inline void pci_write32_async(struct rtl_priv *rtlpriv, writel(val, (u8 __iomem *)rtlpriv->io.pci_mem_start + addr); } -static inline u16 calc_fifo_space(u16 rp, u16 wp) +static inline u16 calc_fifo_space(u16 rp, u16 wp, u16 size) { if (rp <= wp) - return RTL_PCI_MAX_RX_COUNT - 1 + rp - wp; + return size - 1 + rp - wp; return rp - wp - 1; } |