net: ipa: modem: add missing SET_NETDEV_DEV() for proper sysfs links
authorStephan Gerhold <stephan@gerhold.net>
Wed, 6 Jan 2021 10:07:55 +0000 (11:07 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 Jan 2021 02:45:35 +0000 (18:45 -0800)
At the moment it is quite hard to identify the network interface
provided by IPA in userspace components: The network interface is
created as virtual device, without any link to the IPA device.
The interface name ("rmnet_ipa%d") is the only indication that the
network interface belongs to IPA, but this is not very reliable.

Add SET_NETDEV_DEV() to associate the network interface with the
IPA parent device. This allows userspace services like ModemManager
to properly identify that this network interface is provided by IPA
and belongs to the modem.

Cc: Alex Elder <elder@kernel.org>
Fixes: a646d6ec9098 ("soc: qcom: ipa: modem and microcontroller")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Link: https://lore.kernel.org/r/20210106100755.56800-1-stephan@gerhold.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_modem.c

index e34fe2d77324eb658aa302d99a1454a22a1f2600..9b08eb8239846300ffe50359dc435bc7d5c87b15 100644 (file)
@@ -216,6 +216,7 @@ int ipa_modem_start(struct ipa *ipa)
        ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]->netdev = netdev;
        ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]->netdev = netdev;
 
+       SET_NETDEV_DEV(netdev, &ipa->pdev->dev);
        priv = netdev_priv(netdev);
        priv->ipa = ipa;