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

Commit fd875f5d authored by Yuanyuan Liu's avatar Yuanyuan Liu
Browse files

cnss2: Re-send GENL package when failed at the first time



Re-send GENL package if it failed at the first time, which
increase the liability of GENL communication.

CRs-Fixed: 2572404
Change-Id: Ia706387acfa178e394da7917a44908548c4c08ce
Signed-off-by: default avatarYuanyuan Liu <yuanliu@codeaurora.org>
parent 6f0fe27e
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@

#include <linux/err.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <net/netlink.h>
#include <net/genetlink.h>

@@ -161,6 +162,7 @@ int cnss_genl_send_msg(void *buff, u8 type, char *file_name, u32 total_size)
	u32 seg_id = 0;
	u32 data_len = 0;
	u8 end = 0;
	u8 retry;

	cnss_pr_dbg("type: %u, total_size: %x\n", type, total_size);

@@ -171,8 +173,16 @@ int cnss_genl_send_msg(void *buff, u8 type, char *file_name, u32 total_size)
			data_len = remaining;
			end = 1;
		}

		for (retry = 0; retry < 2; retry++) {
			ret = cnss_genl_send_data(type, file_name, total_size,
					  seg_id, end, data_len, msg_buff);
						  seg_id, end, data_len,
						  msg_buff);
			if (ret >= 0)
				break;
			msleep(100);
		}

		if (ret < 0) {
			cnss_pr_err("fail to send genl data, ret %d\n", ret);
			return ret;