summaryrefslogtreecommitdiff
path: root/drivers/net/mhi/net.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2021-06-22 10:01:17 -0700
committerDavid S. Miller <davem@davemloft.net>2021-06-22 10:01:17 -0700
commit78c235f9ea61ad636a032f2fb1f35ffbf7d02d7c (patch)
treeccb93be7cb9825b86d0156507a0827cbd875fcc5 /drivers/net/mhi/net.c
parent1a77de09b71fe522191b241cfc9fedb5ebab5c69 (diff)
parent699409240389c2994e5fa1cb7d7599129bc7cfdf (diff)
Merge branch 'wwan-link-creation-improvements'
Sergey Ryazanov says: ==================== net: WWAN link creation improvements This series is intended to make the WWAN network links management easier for WWAN device drivers. The series begins with adding support for network links creation to the WWAN HW simulator to facilitate code testing. Then there are a couple of changes that prepe the WWAN core code for further modifications. The following patches (4-6) simplify driver unregistering procedures by performing the created links cleanup in the WWAN core. 7th patch is to avoid the odd hold of a driver module. Next patches (8th and 9th) make it easier for drivers to create a network interface for a default data channel. Finally, 10th patch adds support for reporting of data link (aka channel aka context) id to make user aware which network interface is bound to which WWAN device data channel. All core changes have been tested with the HW simulator. The MHI and IOSM drivers were only compile tested as I have no access to this hardware. So the coresponding patches require ACK from the driver authors. Changelog: v1 -> v2: * rebased on top of latest net-next * patch that reworks the creation of mhi_net default netdev was dropped; as Loic explained, this network device has different purpose depending on a driver mode; Loic has a plan to rework the mhi_net driver, so we will defer the default netdev creation reworkings * add a new patch that creates a default network interface for IOSM modems * 7th, 8th, 10th patches have a minor updates (see the patches for details) ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mhi/net.c')
-rw-r--r--drivers/net/mhi/net.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/mhi/net.c b/drivers/net/mhi/net.c
index 6aa753387372..e60e38c1f09d 100644
--- a/drivers/net/mhi/net.c
+++ b/drivers/net/mhi/net.c
@@ -32,7 +32,7 @@ struct mhi_device_info {
static int mhi_ndo_open(struct net_device *ndev)
{
- struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
+ struct mhi_net_dev *mhi_netdev = wwan_netdev_drvpriv(ndev);
/* Feed the rx buffer pool */
schedule_delayed_work(&mhi_netdev->rx_refill, 0);
@@ -47,7 +47,7 @@ static int mhi_ndo_open(struct net_device *ndev)
static int mhi_ndo_stop(struct net_device *ndev)
{
- struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
+ struct mhi_net_dev *mhi_netdev = wwan_netdev_drvpriv(ndev);
netif_stop_queue(ndev);
netif_carrier_off(ndev);
@@ -58,7 +58,7 @@ static int mhi_ndo_stop(struct net_device *ndev)
static netdev_tx_t mhi_ndo_xmit(struct sk_buff *skb, struct net_device *ndev)
{
- struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
+ struct mhi_net_dev *mhi_netdev = wwan_netdev_drvpriv(ndev);
const struct mhi_net_proto *proto = mhi_netdev->proto;
struct mhi_device *mdev = mhi_netdev->mdev;
int err;
@@ -93,7 +93,7 @@ exit_drop:
static void mhi_ndo_get_stats64(struct net_device *ndev,
struct rtnl_link_stats64 *stats)
{
- struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
+ struct mhi_net_dev *mhi_netdev = wwan_netdev_drvpriv(ndev);
unsigned int start;
do {
@@ -322,7 +322,7 @@ static int mhi_net_newlink(void *ctxt, struct net_device *ndev, u32 if_id,
if (dev_get_drvdata(&mhi_dev->dev))
return -EBUSY;
- mhi_netdev = netdev_priv(ndev);
+ mhi_netdev = wwan_netdev_drvpriv(ndev);
dev_set_drvdata(&mhi_dev->dev, mhi_netdev);
mhi_netdev->ndev = ndev;
@@ -367,7 +367,7 @@ out_err:
static void mhi_net_dellink(void *ctxt, struct net_device *ndev,
struct list_head *head)
{
- struct mhi_net_dev *mhi_netdev = netdev_priv(ndev);
+ struct mhi_net_dev *mhi_netdev = wwan_netdev_drvpriv(ndev);
struct mhi_device *mhi_dev = ctxt;
if (head)
@@ -383,7 +383,6 @@ static void mhi_net_dellink(void *ctxt, struct net_device *ndev,
}
static const struct wwan_ops mhi_wwan_ops = {
- .owner = THIS_MODULE,
.priv_size = sizeof(struct mhi_net_dev),
.setup = mhi_net_setup,
.newlink = mhi_net_newlink,
@@ -398,7 +397,8 @@ static int mhi_net_probe(struct mhi_device *mhi_dev,
struct net_device *ndev;
int err;
- err = wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_wwan_ops, mhi_dev);
+ err = wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_wwan_ops, mhi_dev,
+ WWAN_NO_DEFAULT_LINK);
if (err)
return err;
@@ -436,7 +436,7 @@ static void mhi_net_remove(struct mhi_device *mhi_dev)
struct mhi_net_dev *mhi_netdev = dev_get_drvdata(&mhi_dev->dev);
struct mhi_controller *cntrl = mhi_dev->mhi_cntrl;
- /* rtnetlink takes care of removing remaining links */
+ /* WWAN core takes care of removing remaining links */
wwan_unregister_ops(&cntrl->mhi_dev->dev);
if (create_default_iface)