Search Linux Wireless

[PATCH v2 44/50] wilc1000: don't allocate tx_buffer when zero-copy is available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If a driver supports zero-copy transmit transfers, there is no need to
have a transmit buffer.

Signed-off-by: David Mosberger-Tang <davidm@xxxxxxxxxx>
---
 drivers/net/wireless/microchip/wilc1000/wlan.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
index d96a7e2a0bd59..d46d6e8122c8d 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.c
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
@@ -1604,12 +1604,12 @@ int wilc_wlan_init(struct net_device *dev)
 
 	init_q_limits(wilc);
 
-	if (!wilc->tx_buffer)
+	if (!wilc->hif_func->hif_sk_buffs_tx && !wilc->tx_buffer) {
 		wilc->tx_buffer = kmalloc(WILC_TX_BUFF_SIZE, GFP_KERNEL);
-
-	if (!wilc->tx_buffer) {
-		ret = -ENOBUFS;
-		goto fail;
+		if (!wilc->tx_buffer) {
+			ret = -ENOBUFS;
+			goto fail;
+		}
 	}
 
 	if (!wilc->rx_buffer)
-- 
2.25.1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux