All of lore.kernel.org
 help / color / mirror / Atom feed
* support for USB network devices without MDIO to report speed
@ 2021-01-07 11:35 Oliver Neukum
  2021-01-07 11:35 ` [PATCH 1/3] usbnet: specify naming of usbnet_set/get_link_ksettings Oliver Neukum
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Oliver Neukum @ 2021-01-07 11:35 UTC (permalink / raw)
  To: netdev, davem, roland

The assumption that a USB network devices would contain an MDIO
accessible to the host is true only for a subset of genuine
ethernet devices. It is not true for class devices like NCM.
Hence an implementation purely internal to usbnet is needed.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] usbnet: specify naming of usbnet_set/get_link_ksettings
  2021-01-07 11:35 support for USB network devices without MDIO to report speed Oliver Neukum
@ 2021-01-07 11:35 ` Oliver Neukum
  2021-01-07 17:45   ` Andrew Lunn
  2021-01-07 19:29   ` Jakub Kicinski
  2021-01-07 11:35 ` [PATCH 2/3] usbnet: add method for reporting speed without MDIO Oliver Neukum
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Oliver Neukum @ 2021-01-07 11:35 UTC (permalink / raw)
  To: netdev, davem, roland; +Cc: Oliver Neukum

The old generic functions assume that the devices includes
an MDIO interface. This is true only for genuine ethernet.
Devices with a higher level of abstraction or based on different
technologies do not have it. So in preparation for
supporting that, we rename the old functions to something specific.

Signed-off-by : Oliver Neukum <oneukum@suse.com>
Tested-by: Roland Dreier <roland@kernel.org>
---
 drivers/net/usb/asix_devices.c | 12 ++++++------
 drivers/net/usb/cdc_ncm.c      |  4 ++--
 drivers/net/usb/dm9601.c       |  4 ++--
 drivers/net/usb/mcs7830.c      |  4 ++--
 drivers/net/usb/sierra_net.c   |  4 ++--
 drivers/net/usb/smsc75xx.c     |  4 ++--
 drivers/net/usb/sr9700.c       |  4 ++--
 drivers/net/usb/sr9800.c       |  4 ++--
 drivers/net/usb/usbnet.c       | 15 +++++++++------
 include/linux/usb/usbnet.h     |  4 ++--
 10 files changed, 31 insertions(+), 28 deletions(-)

diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index 6e13d8165852..f5006890873d 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -125,8 +125,8 @@ static const struct ethtool_ops ax88172_ethtool_ops = {
 	.get_eeprom		= asix_get_eeprom,
 	.set_eeprom		= asix_set_eeprom,
 	.nway_reset		= usbnet_nway_reset,
-	.get_link_ksettings	= usbnet_get_link_ksettings,
-	.set_link_ksettings	= usbnet_set_link_ksettings,
+	.get_link_ksettings	= usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings	= usbnet_set_link_ksettings_mdio,
 };
 
 static void ax88172_set_multicast(struct net_device *net)
@@ -291,8 +291,8 @@ static const struct ethtool_ops ax88772_ethtool_ops = {
 	.get_eeprom		= asix_get_eeprom,
 	.set_eeprom		= asix_set_eeprom,
 	.nway_reset		= usbnet_nway_reset,
-	.get_link_ksettings	= usbnet_get_link_ksettings,
-	.set_link_ksettings	= usbnet_set_link_ksettings,
+	.get_link_ksettings	= usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings	= usbnet_set_link_ksettings_mdio,
 };
 
 static int ax88772_link_reset(struct usbnet *dev)
@@ -782,8 +782,8 @@ static const struct ethtool_ops ax88178_ethtool_ops = {
 	.get_eeprom		= asix_get_eeprom,
 	.set_eeprom		= asix_set_eeprom,
 	.nway_reset		= usbnet_nway_reset,
-	.get_link_ksettings	= usbnet_get_link_ksettings,
-	.set_link_ksettings	= usbnet_set_link_ksettings,
+	.get_link_ksettings	= usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings	= usbnet_set_link_ksettings_mdio,
 };
 
 static int marvell_phy_init(struct usbnet *dev)
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 3b816a4731f2..3f90b2840b9c 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -142,8 +142,8 @@ static const struct ethtool_ops cdc_ncm_ethtool_ops = {
 	.get_sset_count    = cdc_ncm_get_sset_count,
 	.get_strings       = cdc_ncm_get_strings,
 	.get_ethtool_stats = cdc_ncm_get_ethtool_stats,
-	.get_link_ksettings      = usbnet_get_link_ksettings,
-	.set_link_ksettings      = usbnet_set_link_ksettings,
+	.get_link_ksettings      = usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings      = usbnet_set_link_ksettings_mdio,
 };
 
 static u32 cdc_ncm_check_rx_max(struct usbnet *dev, u32 new_rx)
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index b5d2ac55a874..9065aa13540b 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -282,8 +282,8 @@ static const struct ethtool_ops dm9601_ethtool_ops = {
 	.get_eeprom_len	= dm9601_get_eeprom_len,
 	.get_eeprom	= dm9601_get_eeprom,
 	.nway_reset	= usbnet_nway_reset,
-	.get_link_ksettings	= usbnet_get_link_ksettings,
-	.set_link_ksettings	= usbnet_set_link_ksettings,
+	.get_link_ksettings	= usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings	= usbnet_set_link_ksettings_mdio,
 };
 
 static void dm9601_set_multicast(struct net_device *net)
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index fc512b780d15..c52f52b1e619 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -452,8 +452,8 @@ static const struct ethtool_ops mcs7830_ethtool_ops = {
 	.get_msglevel		= usbnet_get_msglevel,
 	.set_msglevel		= usbnet_set_msglevel,
 	.nway_reset		= usbnet_nway_reset,
-	.get_link_ksettings	= usbnet_get_link_ksettings,
-	.set_link_ksettings	= usbnet_set_link_ksettings,
+	.get_link_ksettings	= usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings	= usbnet_set_link_ksettings_mdio,
 };
 
 static const struct net_device_ops mcs7830_netdev_ops = {
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index 55a244eca5ca..cbab5c9f19b8 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -629,8 +629,8 @@ static const struct ethtool_ops sierra_net_ethtool_ops = {
 	.get_msglevel = usbnet_get_msglevel,
 	.set_msglevel = usbnet_set_msglevel,
 	.nway_reset = usbnet_nway_reset,
-	.get_link_ksettings = usbnet_get_link_ksettings,
-	.set_link_ksettings = usbnet_set_link_ksettings,
+	.get_link_ksettings = usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings = usbnet_set_link_ksettings_mdio,
 };
 
 static int sierra_net_get_fw_attr(struct usbnet *dev, u16 *datap)
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 4353b370249f..e4c6c7f3c69b 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -741,8 +741,8 @@ static const struct ethtool_ops smsc75xx_ethtool_ops = {
 	.set_eeprom	= smsc75xx_ethtool_set_eeprom,
 	.get_wol	= smsc75xx_ethtool_get_wol,
 	.set_wol	= smsc75xx_ethtool_set_wol,
-	.get_link_ksettings	= usbnet_get_link_ksettings,
-	.set_link_ksettings	= usbnet_set_link_ksettings,
+	.get_link_ksettings	= usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings	= usbnet_set_link_ksettings_mdio,
 };
 
 static int smsc75xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c
index 878557ad03ad..e552ab95ced2 100644
--- a/drivers/net/usb/sr9700.c
+++ b/drivers/net/usb/sr9700.c
@@ -250,8 +250,8 @@ static const struct ethtool_ops sr9700_ethtool_ops = {
 	.get_eeprom_len	= sr9700_get_eeprom_len,
 	.get_eeprom	= sr9700_get_eeprom,
 	.nway_reset	= usbnet_nway_reset,
-	.get_link_ksettings	= usbnet_get_link_ksettings,
-	.set_link_ksettings	= usbnet_set_link_ksettings,
+	.get_link_ksettings	= usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings	= usbnet_set_link_ksettings_mdio,
 };
 
 static void sr9700_set_multicast(struct net_device *netdev)
diff --git a/drivers/net/usb/sr9800.c b/drivers/net/usb/sr9800.c
index da56735d7755..b466d53047c5 100644
--- a/drivers/net/usb/sr9800.c
+++ b/drivers/net/usb/sr9800.c
@@ -527,8 +527,8 @@ static const struct ethtool_ops sr9800_ethtool_ops = {
 	.get_eeprom_len	= sr_get_eeprom_len,
 	.get_eeprom	= sr_get_eeprom,
 	.nway_reset	= usbnet_nway_reset,
-	.get_link_ksettings	= usbnet_get_link_ksettings,
-	.set_link_ksettings	= usbnet_set_link_ksettings,
+	.get_link_ksettings	= usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings	= usbnet_set_link_ksettings_mdio,
 };
 
 static int sr9800_link_reset(struct usbnet *dev)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 1447da1d5729..e2ca88259b05 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -944,7 +944,10 @@ EXPORT_SYMBOL_GPL(usbnet_open);
  * they'll probably want to use this base set.
  */
 
-int usbnet_get_link_ksettings(struct net_device *net,
+/* These methods are written on the assumption that the device
+ * uses MII
+ */
+int usbnet_get_link_ksettings_mdio(struct net_device *net,
 			      struct ethtool_link_ksettings *cmd)
 {
 	struct usbnet *dev = netdev_priv(net);
@@ -956,9 +959,9 @@ int usbnet_get_link_ksettings(struct net_device *net,
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(usbnet_get_link_ksettings);
+EXPORT_SYMBOL_GPL(usbnet_get_link_ksettings_mdio);
 
-int usbnet_set_link_ksettings(struct net_device *net,
+int usbnet_set_link_ksettings_mdio(struct net_device *net,
 			      const struct ethtool_link_ksettings *cmd)
 {
 	struct usbnet *dev = netdev_priv(net);
@@ -978,7 +981,7 @@ int usbnet_set_link_ksettings(struct net_device *net,
 
 	return retval;
 }
-EXPORT_SYMBOL_GPL(usbnet_set_link_ksettings);
+EXPORT_SYMBOL_GPL(usbnet_set_link_ksettings_mdio);
 
 u32 usbnet_get_link (struct net_device *net)
 {
@@ -1043,8 +1046,8 @@ static const struct ethtool_ops usbnet_ethtool_ops = {
 	.get_msglevel		= usbnet_get_msglevel,
 	.set_msglevel		= usbnet_set_msglevel,
 	.get_ts_info		= ethtool_op_get_ts_info,
-	.get_link_ksettings	= usbnet_get_link_ksettings,
-	.set_link_ksettings	= usbnet_set_link_ksettings,
+	.get_link_ksettings	= usbnet_get_link_ksettings_mdio,
+	.set_link_ksettings	= usbnet_set_link_ksettings_mdio,
 };
 
 /*-------------------------------------------------------------------------*/
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 88a7673894d5..407469ee224f 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -265,9 +265,9 @@ extern void usbnet_pause_rx(struct usbnet *);
 extern void usbnet_resume_rx(struct usbnet *);
 extern void usbnet_purge_paused_rxq(struct usbnet *);
 
-extern int usbnet_get_link_ksettings(struct net_device *net,
+extern int usbnet_get_link_ksettings_mdio(struct net_device *net,
 				     struct ethtool_link_ksettings *cmd);
-extern int usbnet_set_link_ksettings(struct net_device *net,
+extern int usbnet_set_link_ksettings_mdio(struct net_device *net,
 				     const struct ethtool_link_ksettings *cmd);
 extern u32 usbnet_get_link(struct net_device *net);
 extern u32 usbnet_get_msglevel(struct net_device *);
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] usbnet: add method for reporting speed without MDIO
  2021-01-07 11:35 support for USB network devices without MDIO to report speed Oliver Neukum
  2021-01-07 11:35 ` [PATCH 1/3] usbnet: specify naming of usbnet_set/get_link_ksettings Oliver Neukum
@ 2021-01-07 11:35 ` Oliver Neukum
  2021-01-07 19:27   ` Andrew Lunn
  2021-01-07 11:35 ` [PATCH 3/3] CDC-NCM: record speed in status method Oliver Neukum
  2021-01-07 19:32 ` support for USB network devices without MDIO to report speed Jakub Kicinski
  3 siblings, 1 reply; 9+ messages in thread
From: Oliver Neukum @ 2021-01-07 11:35 UTC (permalink / raw)
  To: netdev, davem, roland; +Cc: Oliver Neukum

The old method for reporting network speed upwards
assumed that a device uses MDIO and uses the generic phy
functions based on that.
Add a a primitive internal version not making the assumption
reporting back directly what the status operations record.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Tested-by: Roland Dreier <roland@kernel.org>
---
 drivers/net/usb/usbnet.c   | 23 +++++++++++++++++++++++
 include/linux/usb/usbnet.h |  4 ++++
 2 files changed, 27 insertions(+)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index e2ca88259b05..fe702ef32007 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -961,6 +961,27 @@ int usbnet_get_link_ksettings_mdio(struct net_device *net,
 }
 EXPORT_SYMBOL_GPL(usbnet_get_link_ksettings_mdio);
 
+int usbnet_get_link_ksettings_internal(struct net_device *net,
+					struct ethtool_link_ksettings *cmd)
+{
+	struct usbnet *dev = netdev_priv(net);
+
+	/* the assumption that speed is equal on tx and rx
+	 * is deeply engrained into the networking layer.
+	 * For wireless stuff it is not true.
+	 * We assume that rxspeed matters more.
+	 */
+	if (dev->rxspeed != -1)
+		cmd->base.speed = dev->rxspeed / 1000000;
+	else if (dev->txspeed != -1)
+		cmd->base.speed = dev->txspeed / 1000000;
+	else
+		cmd->base.speed = SPEED_UNKNOWN;
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(usbnet_get_link_ksettings_internal);
+
 int usbnet_set_link_ksettings_mdio(struct net_device *net,
 			      const struct ethtool_link_ksettings *cmd)
 {
@@ -1664,6 +1685,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 	dev->intf = udev;
 	dev->driver_info = info;
 	dev->driver_name = name;
+	dev->rxspeed = -1; /* unknown or handled by MII */
+	dev->txspeed = -1;
 
 	net->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
 	if (!net->tstats)
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 407469ee224f..6a3677c0f113 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -53,6 +53,8 @@ struct usbnet {
 	u32			hard_mtu;	/* count any extra framing */
 	size_t			rx_urb_size;	/* size for rx urbs */
 	struct mii_if_info	mii;
+	long			rxspeed;	/* if MII is not used */
+	long			txspeed;	/* if MII is not used */
 
 	/* various kinds of pending driver work */
 	struct sk_buff_head	rxq;
@@ -267,6 +269,8 @@ extern void usbnet_purge_paused_rxq(struct usbnet *);
 
 extern int usbnet_get_link_ksettings_mdio(struct net_device *net,
 				     struct ethtool_link_ksettings *cmd);
+extern int usbnet_get_link_ksettings_internal(struct net_device *net,
+					struct ethtool_link_ksettings *cmd);
 extern int usbnet_set_link_ksettings_mdio(struct net_device *net,
 				     const struct ethtool_link_ksettings *cmd);
 extern u32 usbnet_get_link(struct net_device *net);
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] CDC-NCM: record speed in status method
  2021-01-07 11:35 support for USB network devices without MDIO to report speed Oliver Neukum
  2021-01-07 11:35 ` [PATCH 1/3] usbnet: specify naming of usbnet_set/get_link_ksettings Oliver Neukum
  2021-01-07 11:35 ` [PATCH 2/3] usbnet: add method for reporting speed without MDIO Oliver Neukum
@ 2021-01-07 11:35 ` Oliver Neukum
  2021-01-07 19:32 ` support for USB network devices without MDIO to report speed Jakub Kicinski
  3 siblings, 0 replies; 9+ messages in thread
From: Oliver Neukum @ 2021-01-07 11:35 UTC (permalink / raw)
  To: netdev, davem, roland; +Cc: Oliver Neukum

The driver has a status method for receiving speed updates.
The framework, however, had support functions only for devices
that reported their speed upon an explicit query over a MDIO
interface.
CDC_NCM however gets direct notifications from the device.
As new support functions have become available, we shall now
record such notifications and tell the usbnet framework
to make direct use of them without going through the PHY layer.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Tested-by: Roland Dreier <roland@kernel.org>
---
 drivers/net/usb/cdc_ncm.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 3f90b2840b9c..50d3a4e6d445 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -142,7 +142,7 @@ static const struct ethtool_ops cdc_ncm_ethtool_ops = {
 	.get_sset_count    = cdc_ncm_get_sset_count,
 	.get_strings       = cdc_ncm_get_strings,
 	.get_ethtool_stats = cdc_ncm_get_ethtool_stats,
-	.get_link_ksettings      = usbnet_get_link_ksettings_mdio,
+	.get_link_ksettings      = usbnet_get_link_ksettings_internal,
 	.set_link_ksettings      = usbnet_set_link_ksettings_mdio,
 };
 
@@ -1823,21 +1823,8 @@ cdc_ncm_speed_change(struct usbnet *dev,
 	uint32_t rx_speed = le32_to_cpu(data->DLBitRRate);
 	uint32_t tx_speed = le32_to_cpu(data->ULBitRate);
 
-	/*
-	 * Currently the USB-NET API does not support reporting the actual
-	 * device speed. Do print it instead.
-	 */
-	if ((tx_speed > 1000000) && (rx_speed > 1000000)) {
-		netif_info(dev, link, dev->net,
-			   "%u mbit/s downlink %u mbit/s uplink\n",
-			   (unsigned int)(rx_speed / 1000000U),
-			   (unsigned int)(tx_speed / 1000000U));
-	} else {
-		netif_info(dev, link, dev->net,
-			   "%u kbit/s downlink %u kbit/s uplink\n",
-			   (unsigned int)(rx_speed / 1000U),
-			   (unsigned int)(tx_speed / 1000U));
-	}
+	dev->rxspeed = rx_speed;
+	dev->txspeed = tx_speed;
 }
 
 static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] usbnet: specify naming of usbnet_set/get_link_ksettings
  2021-01-07 11:35 ` [PATCH 1/3] usbnet: specify naming of usbnet_set/get_link_ksettings Oliver Neukum
@ 2021-01-07 17:45   ` Andrew Lunn
  2021-01-07 19:29   ` Jakub Kicinski
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2021-01-07 17:45 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: netdev, davem, roland

> -int usbnet_get_link_ksettings(struct net_device *net,
> +/* These methods are written on the assumption that the device
> + * uses MII
> + */
> +int usbnet_get_link_ksettings_mdio(struct net_device *net,
>  			      struct ethtool_link_ksettings *cmd)

Hi Oliver

I would prefer this was called usbnet_get_link_ksettings_mii, since
this is using the old mii framework, not phylib and mdio drivers.  I
believe there are some USB drivers which do use mdio drivers and
phylib, and we should try to avoid getting things confused.

	Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] usbnet: add method for reporting speed without MDIO
  2021-01-07 11:35 ` [PATCH 2/3] usbnet: add method for reporting speed without MDIO Oliver Neukum
@ 2021-01-07 19:27   ` Andrew Lunn
  2021-01-11 12:07     ` Oliver Neukum
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2021-01-07 19:27 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: netdev, davem, roland

On Thu, Jan 07, 2021 at 12:35:17PM +0100, Oliver Neukum wrote:

Hi Oliver

> +++ b/include/linux/usb/usbnet.h
> @@ -53,6 +53,8 @@ struct usbnet {
>  	u32			hard_mtu;	/* count any extra framing */
>  	size_t			rx_urb_size;	/* size for rx urbs */
>  	struct mii_if_info	mii;
> +	long			rxspeed;	/* if MII is not used */
> +	long			txspeed;	/* if MII is not used */

How generic is this really? I don't know USB networking, so i cannot
say for myself.

I'm wondering if these should be added to cdc_ncm_ctx, and
usbnet_get_link_ksettings_ncm function should be added?

Having said that, USB_CDC_NOTIFY_SPEED_CHANGE seems like it could also
use this. Should the patch set also handle that notification and set
usbnet->rxspeed and usbnet->txspeed? These would then be used in
multiple places and that would justify it being in struct usbnet.

       Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] usbnet: specify naming of usbnet_set/get_link_ksettings
  2021-01-07 11:35 ` [PATCH 1/3] usbnet: specify naming of usbnet_set/get_link_ksettings Oliver Neukum
  2021-01-07 17:45   ` Andrew Lunn
@ 2021-01-07 19:29   ` Jakub Kicinski
  1 sibling, 0 replies; 9+ messages in thread
From: Jakub Kicinski @ 2021-01-07 19:29 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: netdev, davem, roland

On Thu,  7 Jan 2021 12:35:16 +0100 Oliver Neukum wrote:
> Signed-off-by : Oliver Neukum <oneukum@suse.com>

Since seems like you may respin with Andrew's suggestion: nit - extra
space before :.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: support for USB network devices without MDIO to report speed
  2021-01-07 11:35 support for USB network devices without MDIO to report speed Oliver Neukum
                   ` (2 preceding siblings ...)
  2021-01-07 11:35 ` [PATCH 3/3] CDC-NCM: record speed in status method Oliver Neukum
@ 2021-01-07 19:32 ` Jakub Kicinski
  3 siblings, 0 replies; 9+ messages in thread
From: Jakub Kicinski @ 2021-01-07 19:32 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: netdev, davem, roland

On Thu,  7 Jan 2021 12:35:15 +0100 Oliver Neukum wrote:
> The assumption that a USB network devices would contain an MDIO
> accessible to the host is true only for a subset of genuine
> ethernet devices. It is not true for class devices like NCM.
> Hence an implementation purely internal to usbnet is needed.

Would you mind putting the standard prefix/tag on the cover letter
([PATCH 0/3])? It seems patchwork does not recognize the cover letter
otherwise.

Please keep checkpatch happy WRT alignment of continuation lines vs (

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] usbnet: add method for reporting speed without MDIO
  2021-01-07 19:27   ` Andrew Lunn
@ 2021-01-11 12:07     ` Oliver Neukum
  0 siblings, 0 replies; 9+ messages in thread
From: Oliver Neukum @ 2021-01-11 12:07 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, davem, roland

Am Donnerstag, den 07.01.2021, 20:27 +0100 schrieb Andrew Lunn:
> On Thu, Jan 07, 2021 at 12:35:17PM +0100, Oliver Neukum wrote:
> 
> Hi Oliver
> 
> > +++ b/include/linux/usb/usbnet.h
> > @@ -53,6 +53,8 @@ struct usbnet {
> >  	u32			hard_mtu;	/* count any extra framing */
> >  	size_t			rx_urb_size;	/* size for rx urbs */
> >  	struct mii_if_info	mii;
> > +	long			rxspeed;	/* if MII is not used */
> > +	long			txspeed;	/* if MII is not used */
> 
> How generic is this really? I don't know USB networking, so i cannot
> say for myself.
> 
> I'm wondering if these should be added to cdc_ncm_ctx, and
> usbnet_get_link_ksettings_ncm function should be added?
> 
> Having said that, USB_CDC_NOTIFY_SPEED_CHANGE seems like it could also
> use this. Should the patch set also handle that notification and set
> usbnet->rxspeed and usbnet->txspeed? These would then be used in
> multiple places and that would justify it being in struct usbnet.

Hi,

yes, everything that gets notification in CDC style should use this
mechanism.

	Regards
		Oliver



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-11 12:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 11:35 support for USB network devices without MDIO to report speed Oliver Neukum
2021-01-07 11:35 ` [PATCH 1/3] usbnet: specify naming of usbnet_set/get_link_ksettings Oliver Neukum
2021-01-07 17:45   ` Andrew Lunn
2021-01-07 19:29   ` Jakub Kicinski
2021-01-07 11:35 ` [PATCH 2/3] usbnet: add method for reporting speed without MDIO Oliver Neukum
2021-01-07 19:27   ` Andrew Lunn
2021-01-11 12:07     ` Oliver Neukum
2021-01-07 11:35 ` [PATCH 3/3] CDC-NCM: record speed in status method Oliver Neukum
2021-01-07 19:32 ` support for USB network devices without MDIO to report speed Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.