Skip to content

Commit 031f5c5

Browse files
dnlplmgregkh
authored andcommitted
net: wwan: mhi_wwan_mbim: use correct mux_id for multiplexing
[ Upstream commit 501fe52 ] Recent Qualcomm chipsets like SDX72/75 require MBIM sessionId mapping to muxId in the range (0x70-0x8F) for the PCIe tethered use. This has been partially addressed by the referenced commit, mapping the default data call to muxId = 112, but the multiplexed data calls scenario was not properly considered, mapping sessionId = 1 to muxId 1, while it should have been 113. Fix this by moving the session_id assignment logic to mhi_mbim_newlink, in order to map sessionId = n to muxId = n + WDS_BIND_MUX_DATA_PORT_MUX_ID. Fixes: 65bc58c ("net: wwan: mhi: make default data link id configurable") Signed-off-by: Daniele Palmas <[email protected]> Reviewed-by: Loic Poulain <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 4f0fcdb commit 031f5c5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/net/wwan/mhi_wwan_mbim.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,8 @@ static int mhi_mbim_newlink(void *ctxt, struct net_device *ndev, u32 if_id,
550550
struct mhi_mbim_link *link = wwan_netdev_drvpriv(ndev);
551551
struct mhi_mbim_context *mbim = ctxt;
552552

553-
link->session = if_id;
554553
link->mbim = mbim;
554+
link->session = mhi_mbim_get_link_mux_id(link->mbim->mdev->mhi_cntrl) + if_id;
555555
link->ndev = ndev;
556556
u64_stats_init(&link->rx_syncp);
557557
u64_stats_init(&link->tx_syncp);
@@ -607,7 +607,7 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
607607
{
608608
struct mhi_controller *cntrl = mhi_dev->mhi_cntrl;
609609
struct mhi_mbim_context *mbim;
610-
int err, link_id;
610+
int err;
611611

612612
mbim = devm_kzalloc(&mhi_dev->dev, sizeof(*mbim), GFP_KERNEL);
613613
if (!mbim)
@@ -628,11 +628,8 @@ static int mhi_mbim_probe(struct mhi_device *mhi_dev, const struct mhi_device_id
628628
/* Number of transfer descriptors determines size of the queue */
629629
mbim->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE);
630630

631-
/* Get the corresponding mux_id from mhi */
632-
link_id = mhi_mbim_get_link_mux_id(cntrl);
633-
634631
/* Register wwan link ops with MHI controller representing WWAN instance */
635-
return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, link_id);
632+
return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, 0);
636633
}
637634

638635
static void mhi_mbim_remove(struct mhi_device *mhi_dev)

0 commit comments

Comments
 (0)