diff mbox series

[6/8] rmnet: Implement rmnet_del_interfaces

Message ID 20241115220053.49613-6-denkenz@gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/8] rmnet: Add skeleton | expand

Commit Message

Denis Kenzior Nov. 15, 2024, 10 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 bb5a2ed1805b..ed2fc6bcfdfd 100644
--- a/src/rmnet.c
+++ b/src/rmnet.c
@@ -148,7 +148,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)