msm: ipc: Update server lookup operation to return complete information
QMI Server lookup returns only node_id and port_id. This information is
not sufficient when the QMI clients look for a specific instance of a
service. Hence the server lookup routine returns the instance ID along
with the server address information.
Change-Id: I644e6c8bb9dc3108c0198b7779ef277aa65f7bc5
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
diff --git a/arch/arm/mach-msm/ipc_socket.c b/arch/arm/mach-msm/ipc_socket.c
index d82ffe5..d3917f1 100644
--- a/arch/arm/mach-msm/ipc_socket.c
+++ b/arch/arm/mach-msm/ipc_socket.c
@@ -367,8 +367,8 @@
struct sock *sk = sock->sk;
struct msm_ipc_port *port_ptr;
struct server_lookup_args server_arg;
- struct msm_ipc_port_addr *port_addr = NULL;
- unsigned int n, port_addr_sz = 0;
+ struct msm_ipc_server_info *srv_info = NULL;
+ unsigned int n, srv_info_sz = 0;
int ret;
if (!sk)
@@ -409,33 +409,33 @@
break;
}
if (server_arg.num_entries_in_array) {
- port_addr_sz = server_arg.num_entries_in_array *
- sizeof(*port_addr);
- port_addr = kmalloc(port_addr_sz, GFP_KERNEL);
- if (!port_addr) {
+ srv_info_sz = server_arg.num_entries_in_array *
+ sizeof(*srv_info);
+ srv_info = kmalloc(srv_info_sz, GFP_KERNEL);
+ if (!srv_info) {
ret = -ENOMEM;
break;
}
}
ret = msm_ipc_router_lookup_server_name(&server_arg.port_name,
- port_addr, server_arg.num_entries_in_array,
+ srv_info, server_arg.num_entries_in_array,
server_arg.lookup_mask);
if (ret < 0) {
pr_err("%s: Server not found\n", __func__);
ret = -ENODEV;
- kfree(port_addr);
+ kfree(srv_info);
break;
}
server_arg.num_entries_found = ret;
ret = copy_to_user((void *)arg, &server_arg,
sizeof(server_arg));
- if (port_addr_sz) {
+ if (srv_info_sz) {
ret = copy_to_user((void *)(arg + sizeof(server_arg)),
- port_addr, port_addr_sz);
+ srv_info, srv_info_sz);
if (ret)
ret = -EFAULT;
- kfree(port_addr);
+ kfree(srv_info);
}
break;