Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4590d812 authored by Vladimir Kondratiev's avatar Vladimir Kondratiev Committed by Kalle Valo
Browse files

wil6210: consider SNAP header in MTU calculations



When encapsulating 802.3 frames into the 802.11 ones,
8-byte SNAP header added to save ethtype. SNAP is part of
the frame body, thus should be counted in MSDU. So,
MTU = MSDU - SNAP

Signed-off-by: default avatarVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent c44690a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -53,7 +53,7 @@ static int mtu_max_set(const char *val, const struct kernel_param *kp)
	if (ret)
	if (ret)
		return ret;
		return ret;


	if (mtu_max < 68 || mtu_max > IEEE80211_MAX_DATA_LEN_DMG)
	if (mtu_max < 68 || mtu_max > WIL_MAX_ETH_MTU)
		ret = -EINVAL;
		ret = -EINVAL;


	return ret;
	return ret;
+4 −0
Original line number Original line Diff line number Diff line
@@ -77,6 +77,10 @@ static inline u32 wil_mtu2macbuf(u32 mtu)
	return ALIGN(mtu + WIL_MAX_MPDU_OVERHEAD, 8);
	return ALIGN(mtu + WIL_MAX_MPDU_OVERHEAD, 8);
}
}


/* MTU for Ethernet need to take into account 8-byte SNAP header
 * to be added when encapsulating Ethernet frame into 802.11
 */
#define WIL_MAX_ETH_MTU		(IEEE80211_MAX_DATA_LEN_DMG - 8)
/* Max supported by wil6210 value for interrupt threshold is 5sec. */
/* Max supported by wil6210 value for interrupt threshold is 5sec. */
#define WIL6210_ITR_TRSH_MAX (5000000)
#define WIL6210_ITR_TRSH_MAX (5000000)
#define WIL6210_ITR_TRSH_DEFAULT	(300) /* usec */
#define WIL6210_ITR_TRSH_DEFAULT	(300) /* usec */