diff options
author | Loic Poulain <loic.poulain@linaro.org> | 2021-01-28 14:47:22 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-01-29 19:41:59 -0800 |
commit | e6ec3ccd4eb2b3b9cf0a4127cf00fae602570a52 (patch) | |
tree | 99906a26a1e57639390b5f9cf9a44be4ed3f5962 /drivers/net/mhi_net.c | |
parent | 2bca263cdab1a3e0fce54bc2bdf1885c0cfe3195 (diff) | |
download | lwn-e6ec3ccd4eb2b3b9cf0a4127cf00fae602570a52.tar.gz lwn-e6ec3ccd4eb2b3b9cf0a4127cf00fae602570a52.zip |
net: mhi: Get RX queue size from MHI core
The RX queue size can be determined at runtime by retrieving the
number of available transfer descriptors.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/mhi_net.c')
-rw-r--r-- | drivers/net/mhi_net.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/mhi_net.c b/drivers/net/mhi_net.c index a5a214d29849..abdd2baa312a 100644 --- a/drivers/net/mhi_net.c +++ b/drivers/net/mhi_net.c @@ -273,9 +273,6 @@ static int mhi_net_probe(struct mhi_device *mhi_dev, SET_NETDEV_DEV(ndev, &mhi_dev->dev); SET_NETDEV_DEVTYPE(ndev, &wwan_type); - /* All MHI net channels have 128 ring elements (at least for now) */ - mhi_netdev->rx_queue_sz = 128; - INIT_DELAYED_WORK(&mhi_netdev->rx_refill, mhi_net_rx_refill_work); u64_stats_init(&mhi_netdev->stats.rx_syncp); u64_stats_init(&mhi_netdev->stats.tx_syncp); @@ -285,6 +282,9 @@ static int mhi_net_probe(struct mhi_device *mhi_dev, if (err) goto out_err; + /* Number of transfer descriptors determines size of the queue */ + mhi_netdev->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE); + err = register_netdev(ndev); if (err) goto out_err; |