aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLior David <qca_liord@qca.qualcomm.com>2016-02-24 17:02:29 +0200
committerHamad Kadmany <hkadmany@codeaurora.org>2016-04-15 01:49:30 +0300
commit1f6d4daae72f8c663b3b6edee00e7298cfc2f5ed (patch)
tree83dcd6f47ecfe538157db329ed771a0bea79e753
parentca4a3cbee6e15cde469b171c2a9520a7389d13d3 (diff)
downloadandroid_external_wpa_supplicant_8-1f6d4daae72f8c663b3b6edee00e7298cfc2f5ed.tar.gz
android_external_wpa_supplicant_8-1f6d4daae72f8c663b3b6edee00e7298cfc2f5ed.tar.bz2
android_external_wpa_supplicant_8-1f6d4daae72f8c663b3b6edee00e7298cfc2f5ed.zip
P2P: Adjust service discovery maximum fragment size for 60 GHz
In the 60 GHz band, service discovery management frames are sent over the control PHY and have a smaller maximum frame size (IEEE Std 802.11ad-2012, 21.4.3.2). Fix the code to use sufficiently small fragment size when operating in the 60 GHz band. The 60 GHz fragment size (928) is derived from the maximum frame size for control PHY (1023) and subtracting 48 bytes of header size, and some spare so we do not reach frames with the absolute maximum size. Change-Id: I80ccbdc1a8a66e921a2da28f8ddb9487064f7dc0 Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Git-commit: e4a1469cecee8d21044fb6e97f85aa807f498b62 Git-repo: git://w1.fi/srv/git/hostap.git CRs-Fixed: 985990
-rw-r--r--src/p2p/p2p_sd.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/p2p/p2p_sd.c b/src/p2p/p2p_sd.c
index 1a2af04b..0979612c 100644
--- a/src/p2p/p2p_sd.c
+++ b/src/p2p/p2p_sd.c
@@ -417,9 +417,16 @@ void p2p_sd_response(struct p2p_data *p2p, int freq, const u8 *dst,
u8 dialog_token, const struct wpabuf *resp_tlvs)
{
struct wpabuf *resp;
+ size_t max_len;
+
+ /*
+ * In the 60 GHz, we have a smaller maximum frame length for management
+ * frames.
+ */
+ max_len = (freq > 56160) ? 928 : 1400;
/* TODO: fix the length limit to match with the maximum frame length */
- if (wpabuf_len(resp_tlvs) > 1400) {
+ if (wpabuf_len(resp_tlvs) > max_len) {
p2p_dbg(p2p, "SD response long enough to require fragmentation");
if (p2p->sd_resp) {
/*
@@ -606,7 +613,7 @@ void p2p_rx_gas_comeback_req(struct p2p_data *p2p, const u8 *sa,
{
struct wpabuf *resp;
u8 dialog_token;
- size_t frag_len;
+ size_t frag_len, max_len;
int more = 0;
wpa_hexdump(MSG_DEBUG, "P2P: RX GAS Comeback Request", data, len);
@@ -630,9 +637,14 @@ void p2p_rx_gas_comeback_req(struct p2p_data *p2p, const u8 *sa,
return;
}
+ /*
+ * In the 60 GHz, we have a smaller maximum frame length for management
+ * frames.
+ */
+ max_len = (rx_freq > 56160) ? 928 : 1400;
frag_len = wpabuf_len(p2p->sd_resp) - p2p->sd_resp_pos;
- if (frag_len > 1400) {
- frag_len = 1400;
+ if (frag_len > max_len) {
+ frag_len = max_len;
more = 1;
}
resp = p2p_build_gas_comeback_resp(dialog_token, WLAN_STATUS_SUCCESS,