From c4e4982fa923190e04e28d53004072b8d0344be6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 16 Jan 2019 22:35:15 +0100 Subject: [PATCH] mt7603: set IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN The hardware cannot report accurate tx A-MPDU length information, so tell rate control to ignore it. Improves tx rate selection Signed-off-by: Felix Fietkau --- mt7603/Makefile | 8 ++++++++ mt7603/init.c | 1 + 2 files changed, 9 insertions(+) diff --git a/mt7603/Makefile b/mt7603/Makefile index 15c0931a..ab95a080 100644 --- a/mt7603/Makefile +++ b/mt7603/Makefile @@ -1,3 +1,11 @@ +CHECK_CC_ENUM_FLAGS = $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) +check-cc-enum = $(call try-run, echo "int v = $(1);" | $(CC) -Werror $(CHECK_CC_ENUM_FLAGS) $(2) -c -x c - -o "$$TMP",y,n) + +# backwards compatibility hack +ifeq ($(call check-cc-enum,IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN,-include net/mac80211.h),n) + EXTRA_CFLAGS += -DIEEE80211_HW_TX_STATUS_NO_AMPDU_LEN=IEEE80211_HW_REPORTS_TX_ACK_STATUS +endif + obj-m := mt7603e.o mt7603e-y := \ diff --git a/mt7603/init.c b/mt7603/init.c index 45a793f4..d633aa47 100644 --- a/mt7603/init.c +++ b/mt7603/init.c @@ -566,6 +566,7 @@ int mt7603_register_device(struct mt7603_dev *dev) wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); ieee80211_hw_set(hw, SUPPORTS_REORDERING_BUFFER); + ieee80211_hw_set(hw, TX_STATUS_NO_AMPDU_LEN); /* init led callbacks */ dev->mt76.led_cdev.brightness_set = mt7603_led_set_brightness;