Commit 5bb4eea0 authored by M Chetan Kumar's avatar M Chetan Kumar Committed by David S. Miller

net: wwan: iosm: correct link-id handling

Link ID to be kept intact with MBIM session ID
Ex: ID 0 should be associated to MBIM session ID 0.
Reported-by: default avatarLoic Poulain <loic.poulain@linaro.org>
Signed-off-by: default avatarM Chetan Kumar <m.chetan.kumar@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3bcfc0a2
...@@ -24,7 +24,7 @@ int ipc_imem_sys_wwan_open(struct iosm_imem *ipc_imem, int if_id) ...@@ -24,7 +24,7 @@ int ipc_imem_sys_wwan_open(struct iosm_imem *ipc_imem, int if_id)
return -EIO; return -EIO;
} }
return ipc_mux_open_session(ipc_imem->mux, if_id - 1); return ipc_mux_open_session(ipc_imem->mux, if_id);
} }
/* Release a net link to CP. */ /* Release a net link to CP. */
...@@ -33,7 +33,7 @@ void ipc_imem_sys_wwan_close(struct iosm_imem *ipc_imem, int if_id, ...@@ -33,7 +33,7 @@ void ipc_imem_sys_wwan_close(struct iosm_imem *ipc_imem, int if_id,
{ {
if (ipc_imem->mux && if_id >= IP_MUX_SESSION_START && if (ipc_imem->mux && if_id >= IP_MUX_SESSION_START &&
if_id <= IP_MUX_SESSION_END) if_id <= IP_MUX_SESSION_END)
ipc_mux_close_session(ipc_imem->mux, if_id - 1); ipc_mux_close_session(ipc_imem->mux, if_id);
} }
/* Tasklet call to do uplink transfer. */ /* Tasklet call to do uplink transfer. */
...@@ -76,7 +76,7 @@ int ipc_imem_sys_wwan_transmit(struct iosm_imem *ipc_imem, ...@@ -76,7 +76,7 @@ int ipc_imem_sys_wwan_transmit(struct iosm_imem *ipc_imem,
} }
/* Route the UL packet through IP MUX Layer */ /* Route the UL packet through IP MUX Layer */
ret = ipc_mux_ul_trigger_encode(ipc_imem->mux, if_id - 1, skb); ret = ipc_mux_ul_trigger_encode(ipc_imem->mux, if_id, skb);
out: out:
return ret; return ret;
} }
......
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
#define BOOT_CHECK_DEFAULT_TIMEOUT 400 #define BOOT_CHECK_DEFAULT_TIMEOUT 400
/* IP MUX channel range */ /* IP MUX channel range */
#define IP_MUX_SESSION_START 1 #define IP_MUX_SESSION_START 0
#define IP_MUX_SESSION_END 8 #define IP_MUX_SESSION_END 7
/* Default IP MUX channel */ /* Default IP MUX channel */
#define IP_MUX_SESSION_DEFAULT 1 #define IP_MUX_SESSION_DEFAULT 0
/** /**
* ipc_imem_sys_port_open - Open a port link to CP. * ipc_imem_sys_port_open - Open a port link to CP.
......
...@@ -288,7 +288,7 @@ static int ipc_mux_net_receive(struct iosm_mux *ipc_mux, int if_id, ...@@ -288,7 +288,7 @@ static int ipc_mux_net_receive(struct iosm_mux *ipc_mux, int if_id,
/* Pass the packet to the netif layer. */ /* Pass the packet to the netif layer. */
dest_skb->priority = service_class; dest_skb->priority = service_class;
return ipc_wwan_receive(wwan, dest_skb, false, if_id + 1); return ipc_wwan_receive(wwan, dest_skb, false, if_id);
} }
/* Decode Flow Credit Table in the block */ /* Decode Flow Credit Table in the block */
......
...@@ -252,8 +252,8 @@ int ipc_wwan_receive(struct iosm_wwan *ipc_wwan, struct sk_buff *skb_arg, ...@@ -252,8 +252,8 @@ int ipc_wwan_receive(struct iosm_wwan *ipc_wwan, struct sk_buff *skb_arg,
skb->pkt_type = PACKET_HOST; skb->pkt_type = PACKET_HOST;
if (if_id < (IP_MUX_SESSION_START - 1) || if (if_id < IP_MUX_SESSION_START ||
if_id > (IP_MUX_SESSION_END - 1)) { if_id > IP_MUX_SESSION_END) {
ret = -EINVAL; ret = -EINVAL;
goto free; goto free;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment