All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] frame-xchg: Add no-cck-rate flag only for P2P interfaces
@ 2020-09-29 16:37 Andrew Zaborowski
  2020-09-29 16:37 ` [PATCH 2/6] frame-xchg: Cancel NL80211_CMD_FRAME commands when interrupted Andrew Zaborowski
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Andrew Zaborowski @ 2020-09-29 16:37 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 3063 bytes --]

We want to use this flag only on the interfaces with one of the three
P2P iftypes so set the flag automatically depending on the iftype from
the last 'config' notification.
---
 src/frame-xchg.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/frame-xchg.c b/src/frame-xchg.c
index 2ea8504a..d26e0c54 100644
--- a/src/frame-xchg.c
+++ b/src/frame-xchg.c
@@ -115,6 +115,7 @@ struct frame_xchg_data {
 	unsigned int resp_timeout;
 	unsigned int retries_on_ack;
 	struct wiphy_radio_work_item work;
+	bool no_cck_rates;
 };
 
 struct frame_xchg_watch_data {
@@ -951,10 +952,13 @@ static bool frame_xchg_tx_retry(struct wiphy_radio_work_item *item)
 	l_genl_msg_append_attr(msg, NL80211_ATTR_WDEV, 8, &fx->wdev_id);
 	l_genl_msg_append_attr(msg, NL80211_ATTR_WIPHY_FREQ, 4, &fx->freq);
 	l_genl_msg_append_attr(msg, NL80211_ATTR_OFFCHANNEL_TX_OK, 0, NULL);
-	l_genl_msg_append_attr(msg, NL80211_ATTR_TX_NO_CCK_RATE, 0, NULL);
 	l_genl_msg_append_attr(msg, NL80211_ATTR_FRAME,
 				fx->tx_mpdu_len, fx->tx_mpdu);
 
+	if (fx->no_cck_rates)
+		l_genl_msg_append_attr(msg, NL80211_ATTR_TX_NO_CCK_RATE, 0,
+					NULL);
+
 	if (duration)
 		l_genl_msg_append_attr(msg, NL80211_ATTR_DURATION, 4,
 					&duration);
@@ -1102,6 +1106,14 @@ static const struct wiphy_radio_work_item_ops work_ops = {
 	.destroy = frame_xchg_destroy,
 };
 
+static bool frame_xchg_wdev_match(const void *a, const void *b)
+{
+	const struct wdev_info *wdev = a;
+	const uint64_t *id = b;
+
+	return wdev->id == *id;
+}
+
 uint32_t frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
 			unsigned int retry_interval, unsigned int resp_timeout,
 			unsigned int retries_on_ack, uint32_t group_id,
@@ -1112,6 +1124,7 @@ uint32_t frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
 	size_t frame_len;
 	struct iovec *iov;
 	uint8_t *ptr;
+	struct wdev_info *wdev;
 
 	for (frame_len = 0, iov = frame; iov->iov_base; iov++)
 		frame_len += iov->iov_len;
@@ -1150,6 +1163,12 @@ uint32_t frame_xchg_startv(uint64_t wdev_id, struct iovec *frame, uint32_t freq,
 	for (iov = frame; iov->iov_base; ptr += iov->iov_len, iov++)
 		memcpy(ptr, iov->iov_base, iov->iov_len);
 
+	wdev = l_queue_find(wdevs, frame_xchg_wdev_match, &wdev_id);
+	fx->no_cck_rates = wdev &&
+		(wdev->iftype == NL80211_IFTYPE_P2P_DEVICE ||
+		 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT ||
+		 wdev->iftype == NL80211_IFTYPE_P2P_GO);
+
 	/*
 	 * Subscribe to the response frames now instead of in the ACK
 	 * callback to save ourselves race condition considerations.
@@ -1265,14 +1284,6 @@ static void frame_xchg_mlme_notify(struct l_genl_msg *msg, void *user_data)
 	}
 }
 
-static bool frame_xchg_wdev_match(const void *a, const void *b)
-{
-	const struct wdev_info *wdev = a;
-	const uint64_t *id = b;
-
-	return wdev->id == *id;
-}
-
 static void frame_xchg_config_notify(struct l_genl_msg *msg, void *user_data)
 {
 	uint64_t wdev_id;
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2020-09-30 20:41 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 16:37 [PATCH 1/6] frame-xchg: Add no-cck-rate flag only for P2P interfaces Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 2/6] frame-xchg: Cancel NL80211_CMD_FRAME commands when interrupted Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 3/6] wscutil: Fix subcategory string lookup Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 4/6] scan: Drop unused frequency list parsing Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 5/6] p2p: Fix adding peers from Probe Request info Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 6/6] p2p: Respond to Probe Requests when in discovery Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 1/8] test-runner: Reserve radios for wpa_supplicant Andrew Zaborowski
2020-09-29 17:14   ` James Prestwood
2020-09-29 23:29     ` Andrew Zaborowski
2020-09-30 15:56       ` James Prestwood
2020-09-30 20:34         ` Andrew Zaborowski
2020-09-30 20:41           ` James Prestwood
2020-09-29 16:37 ` [PATCH 2/8] test-runner: Enable --p2p when creating interfaces Andrew Zaborowski
2020-09-29 18:21   ` Denis Kenzior
2020-09-29 16:37 ` [PATCH 3/8] test-runner: Add flags for DHCP and TLS verbose output Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 4/8] test-runner: Make hwsim medium optional Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 5/8] autotests: Basic P2P python API Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 6/8] autotests: Add basic wpa_supplicant P2P python wrapper Andrew Zaborowski
2020-09-30 15:58   ` James Prestwood
2020-09-30 20:38     ` Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 7/8] autotests: Move some variables from IWD class to instance Andrew Zaborowski
2020-09-29 16:37 ` [PATCH 8/8] autotests: Add testP2P Andrew Zaborowski
2020-09-29 18:15 ` [PATCH 1/6] frame-xchg: Add no-cck-rate flag only for P2P interfaces Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.