diff mbox series

[v2,6/8] rmnet: Implement rmnet_del_interfaces

Message ID 20241119171832.1119-6-denkenz@gmail.com (mailing list archive)
State Accepted
Commit 982aa444b98e04fd29cad681a7067cbe5a33a489
Headers show
Series [v2,1/8] rmnet: Add skeleton | expand

Commit Message

Denis Kenzior Nov. 19, 2024, 5:18 p.m. UTC
Add implementation for rmnet_del_interfaces.  This method will remove
the interfaces based on the passed in struct rmnet_ifinfo array.
---
 src/rmnet.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/rmnet.c b/src/rmnet.c
index 4309f8e61ccc..adbe605effdb 100644
--- a/src/rmnet.c
+++ b/src/rmnet.c
@@ -149,7 +149,18 @@  int rmnet_get_interfaces(uint32_t parent_ifindex, unsigned int n_interfaces,
 int rmnet_del_interfaces(unsigned int n_interfaces,
 					const struct rmnet_ifinfo *interfaces)
 {
-	return -ENOTSUP;
+	struct rmnet_request *req;
+
+	if (!n_interfaces || n_interfaces > MAX_MUX_IDS)
+		return -EINVAL;
+
+	req = __rmnet_del_request_new(n_interfaces, interfaces);
+	l_queue_push_tail(request_q, req);
+
+	if (l_queue_length(request_q) == 1 && !dump_id)
+		rmnet_start_next_request();
+
+	return 0;
 }
 
 int rmnet_cancel(int id)