]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rtw88: main: Reserve 8 bytes of extra TX headroom for SDIO cards
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Wed, 5 Apr 2023 20:07:25 +0000 (22:07 +0200)
committerKalle Valo <kvalo@kernel.org>
Wed, 12 Apr 2023 12:51:09 +0000 (15:51 +0300)
For SDIO host controllers with DMA support the TX buffer physical memory
address need to be aligned at an 8-byte boundary. Reserve 8 bytes of
extra TX headroom so we can align the data without re-allocating the
transmit buffer.

While here, also remove the TODO comment regarding extra headroom for
USB and SDIO. For SDIO the extra headroom is now handled and for USB it
was not needed so far.

Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230405200729.632435-6-martin.blumenstingl@googlemail.com
drivers/net/wireless/realtek/rtw88/main.c

index cdc4703ead5fb43d9b09bcc40973a6689b00b25c..1cb553485cffc22a8e031f789aa35a2ceeccc59d 100644 (file)
@@ -2163,9 +2163,11 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
        int max_tx_headroom = 0;
        int ret;
 
-       /* TODO: USB & SDIO may need extra room? */
        max_tx_headroom = rtwdev->chip->tx_pkt_desc_sz;
 
+       if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_SDIO)
+               max_tx_headroom += RTW_SDIO_DATA_PTR_ALIGN;
+
        hw->extra_tx_headroom = max_tx_headroom;
        hw->queues = IEEE80211_NUM_ACS;
        hw->txq_data_size = sizeof(struct rtw_txq);