Skip to content

Commit 5bb4eea

Browse files
mchetankumardavem330
authored andcommitted
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: Loic Poulain <[email protected]> Signed-off-by: M Chetan Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3bcfc0a commit 5bb4eea

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

drivers/net/wwan/iosm/iosm_ipc_imem_ops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int ipc_imem_sys_wwan_open(struct iosm_imem *ipc_imem, int if_id)
2424
return -EIO;
2525
}
2626

27-
return ipc_mux_open_session(ipc_imem->mux, if_id - 1);
27+
return ipc_mux_open_session(ipc_imem->mux, if_id);
2828
}
2929

3030
/* Release a net link to CP. */
@@ -33,7 +33,7 @@ void ipc_imem_sys_wwan_close(struct iosm_imem *ipc_imem, int if_id,
3333
{
3434
if (ipc_imem->mux && if_id >= IP_MUX_SESSION_START &&
3535
if_id <= IP_MUX_SESSION_END)
36-
ipc_mux_close_session(ipc_imem->mux, if_id - 1);
36+
ipc_mux_close_session(ipc_imem->mux, if_id);
3737
}
3838

3939
/* Tasklet call to do uplink transfer. */
@@ -76,7 +76,7 @@ int ipc_imem_sys_wwan_transmit(struct iosm_imem *ipc_imem,
7676
}
7777

7878
/* Route the UL packet through IP MUX Layer */
79-
ret = ipc_mux_ul_trigger_encode(ipc_imem->mux, if_id - 1, skb);
79+
ret = ipc_mux_ul_trigger_encode(ipc_imem->mux, if_id, skb);
8080
out:
8181
return ret;
8282
}

drivers/net/wwan/iosm/iosm_ipc_imem_ops.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
#define BOOT_CHECK_DEFAULT_TIMEOUT 400
2828

2929
/* IP MUX channel range */
30-
#define IP_MUX_SESSION_START 1
31-
#define IP_MUX_SESSION_END 8
30+
#define IP_MUX_SESSION_START 0
31+
#define IP_MUX_SESSION_END 7
3232

3333
/* Default IP MUX channel */
34-
#define IP_MUX_SESSION_DEFAULT 1
34+
#define IP_MUX_SESSION_DEFAULT 0
3535

3636
/**
3737
* ipc_imem_sys_port_open - Open a port link to CP.

drivers/net/wwan/iosm/iosm_ipc_mux_codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int ipc_mux_net_receive(struct iosm_mux *ipc_mux, int if_id,
288288
/* Pass the packet to the netif layer. */
289289
dest_skb->priority = service_class;
290290

291-
return ipc_wwan_receive(wwan, dest_skb, false, if_id + 1);
291+
return ipc_wwan_receive(wwan, dest_skb, false, if_id);
292292
}
293293

294294
/* Decode Flow Credit Table in the block */

drivers/net/wwan/iosm/iosm_ipc_wwan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ int ipc_wwan_receive(struct iosm_wwan *ipc_wwan, struct sk_buff *skb_arg,
252252

253253
skb->pkt_type = PACKET_HOST;
254254

255-
if (if_id < (IP_MUX_SESSION_START - 1) ||
256-
if_id > (IP_MUX_SESSION_END - 1)) {
255+
if (if_id < IP_MUX_SESSION_START ||
256+
if_id > IP_MUX_SESSION_END) {
257257
ret = -EINVAL;
258258
goto free;
259259
}

0 commit comments

Comments
 (0)