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

Commit b44d25f2 authored by Mayank Rana's avatar Mayank Rana
Browse files

USB: android: Fix network device name for NCM and ECM functions



Currently NCM and ECM related network interface name is passed as
"ncm%%d" and "ecm%%d" to register_netdev() API which considers this
as invalid which fails NCM or ECM based USB composition switch.
register_netdev() API is expecting network interface name as
"<ifacename>%d" to assign network interface ID with it. Hence fix
this issue by replacing "ncm%%d" and "ecm%%d" to "ncm%d" and "ecm%d".

CRs-Fixed: 841934
Change-Id: I85bd553f6be9d0648a066bece3f810e94a645f71
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent b755738d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1054,7 +1054,7 @@ ncm_function_bind_config(struct android_usb_function *f,
		ncm->ethaddr[3], ncm->ethaddr[4], ncm->ethaddr[5]);

	ncm_opts = container_of(ncm->fi, struct f_ncm_opts, func_inst);
	strlcpy(ncm_opts->net->name, "ncm%%d", sizeof(ncm_opts->net->name));
	strlcpy(ncm_opts->net->name, "ncm%d", sizeof(ncm_opts->net->name));

	gether_set_qmult(ncm_opts->net, qmult);
	if (!gether_set_host_addr(ncm_opts->net, host_addr))
@@ -2429,7 +2429,7 @@ static int ecm_function_bind_config(struct android_usb_function *f,
		ecm->ethaddr[3], ecm->ethaddr[4], ecm->ethaddr[5]);

	ecm_opts = container_of(ecm->fi, struct f_ecm_opts, func_inst);
	strlcpy(ecm_opts->net->name, "ecm%%d", sizeof(ecm_opts->net->name));
	strlcpy(ecm_opts->net->name, "ecm%d", sizeof(ecm_opts->net->name));
	gether_set_qmult(ecm_opts->net, qmult);
	if (!gether_set_host_addr(ecm_opts->net, host_addr))
		pr_info("using host ethernet address: %s", host_addr);