Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Expose Peak USB device id in sysfs via phys_port_name.
@ 2021-07-21 12:40 Andre Naujoks
  2021-07-21 12:52 ` Pavel Skripkin
  2021-07-21 12:59 ` [PATCH v2] " Andre Naujoks
  0 siblings, 2 replies; 6+ messages in thread
From: Andre Naujoks @ 2021-07-21 12:40 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Jakub Kicinski, Stephane Grosjean, Vincent Mailhol,
	Gustavo A. R. Silva, Colin Ian King, Pavel Skripkin,
	Andre Naujoks, linux-can, netdev, linux-kernel

The Peak USB CAN adapters can be assigned a device id via the Peak
provided tools (pcan-settings). This id can currently not be set by the
upstream kernel drivers, but some devices expose this id already.

The id can be used for consistent naming of CAN interfaces regardless of
order of attachment or recognition on the system. The classical CAN Peak
USB adapters expose this id via bcdDevice (combined with another value)
on USB-level in the sysfs tree and this value is then available in
ID_REVISION from udev. This is not a feasible approach, when a single
USB device offers more than one CAN-interface, like e.g. the PCAN-USB
Pro FD devices.

This patch exposes those ids via the, up to now unused, netdevice sysfs
attribute phys_port_name as a simple decimal ASCII representation of the
id. phys_port_id was not used, since the default print functions from
net/core/net-sysfs.c output a hex-encoded binary value, which is
overkill for a one-byte device id, like this one.
---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index e8f43ed90b72..f6cbb01a58cc 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -408,6 +408,21 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
 	return NETDEV_TX_OK;
 }
 
+static int peak_usb_ndo_get_phys_port_name(struct net_device *netdev,
+					   char *name, size_t len)
+{
+	const struct peak_usb_device *dev = netdev_priv(netdev);
+	int err;
+
+	err = snprintf(name, len, "%u", dev->device_number);
+
+	if (err >= len || err <= 0) {
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 /*
  * start the CAN interface.
  * Rx and Tx urbs are allocated here. Rx urbs are submitted here.
@@ -769,6 +784,7 @@ static const struct net_device_ops peak_usb_netdev_ops = {
 	.ndo_stop = peak_usb_ndo_stop,
 	.ndo_start_xmit = peak_usb_ndo_start_xmit,
 	.ndo_change_mtu = can_change_mtu,
+	.ndo_get_phys_port_name = peak_usb_ndo_get_phys_port_name,
 };
 
 /*
-- 
2.32.0


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

* Re: [PATCH] Expose Peak USB device id in sysfs via phys_port_name.
  2021-07-21 12:40 [PATCH] Expose Peak USB device id in sysfs via phys_port_name Andre Naujoks
@ 2021-07-21 12:52 ` Pavel Skripkin
  2021-07-21 12:59 ` [PATCH v2] " Andre Naujoks
  1 sibling, 0 replies; 6+ messages in thread
From: Pavel Skripkin @ 2021-07-21 12:52 UTC (permalink / raw)
  To: Andre Naujoks
  Cc: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Jakub Kicinski, Stephane Grosjean, Vincent Mailhol,
	Gustavo A. R. Silva, Colin Ian King, linux-can, netdev,
	linux-kernel

On Wed, 21 Jul 2021 14:40:47 +0200
Andre Naujoks <nautsch2@gmail.com> wrote:

> The Peak USB CAN adapters can be assigned a device id via the Peak
> provided tools (pcan-settings). This id can currently not be set by
> the upstream kernel drivers, but some devices expose this id already.
> 
> The id can be used for consistent naming of CAN interfaces regardless
> of order of attachment or recognition on the system. The classical
> CAN Peak USB adapters expose this id via bcdDevice (combined with
> another value) on USB-level in the sysfs tree and this value is then
> available in ID_REVISION from udev. This is not a feasible approach,
> when a single USB device offers more than one CAN-interface, like
> e.g. the PCAN-USB Pro FD devices.
> 
> This patch exposes those ids via the, up to now unused, netdevice
> sysfs attribute phys_port_name as a simple decimal ASCII
> representation of the id. phys_port_id was not used, since the
> default print functions from net/core/net-sysfs.c output a
> hex-encoded binary value, which is overkill for a one-byte device id,
> like this one.


Hi, Andre!

You should add Signed-off-by tag to the patch


With regards,
Pavel Skripkin

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

* [PATCH v2] Expose Peak USB device id in sysfs via phys_port_name.
  2021-07-21 12:40 [PATCH] Expose Peak USB device id in sysfs via phys_port_name Andre Naujoks
  2021-07-21 12:52 ` Pavel Skripkin
@ 2021-07-21 12:59 ` Andre Naujoks
  2021-07-21 13:29   ` Stéphane Grosjean
  1 sibling, 1 reply; 6+ messages in thread
From: Andre Naujoks @ 2021-07-21 12:59 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller,
	Jakub Kicinski, Stephane Grosjean, Vincent Mailhol,
	Gustavo A. R. Silva, Pavel Skripkin, Colin Ian King,
	Andre Naujoks, linux-can, netdev, linux-kernel

The Peak USB CAN adapters can be assigned a device id via the Peak
provided tools (pcan-settings). This id can currently not be set by the
upstream kernel drivers, but some devices expose this id already.

The id can be used for consistent naming of CAN interfaces regardless of
order of attachment or recognition on the system. The classical CAN Peak
USB adapters expose this id via bcdDevice (combined with another value)
on USB-level in the sysfs tree and this value is then available in
ID_REVISION from udev. This is not a feasible approach, when a single
USB device offers more than one CAN-interface, like e.g. the PCAN-USB
Pro FD devices.

This patch exposes those ids via the, up to now unused, netdevice sysfs
attribute phys_port_name as a simple decimal ASCII representation of the
id. phys_port_id was not used, since the default print functions from
net/core/net-sysfs.c output a hex-encoded binary value, which is
overkill for a one-byte device id, like this one.

Signed-off-by: Andre Naujoks <nautsch2@gmail.com>
---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index e8f43ed90b72..f6cbb01a58cc 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -408,6 +408,21 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
 	return NETDEV_TX_OK;
 }
 
+static int peak_usb_ndo_get_phys_port_name(struct net_device *netdev,
+					   char *name, size_t len)
+{
+	const struct peak_usb_device *dev = netdev_priv(netdev);
+	int err;
+
+	err = snprintf(name, len, "%u", dev->device_number);
+
+	if (err >= len || err <= 0) {
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
 /*
  * start the CAN interface.
  * Rx and Tx urbs are allocated here. Rx urbs are submitted here.
@@ -769,6 +784,7 @@ static const struct net_device_ops peak_usb_netdev_ops = {
 	.ndo_stop = peak_usb_ndo_stop,
 	.ndo_start_xmit = peak_usb_ndo_start_xmit,
 	.ndo_change_mtu = can_change_mtu,
+	.ndo_get_phys_port_name = peak_usb_ndo_get_phys_port_name,
 };
 
 /*
-- 
2.32.0


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

* RE: [PATCH v2] Expose Peak USB device id in sysfs via phys_port_name.
  2021-07-21 12:59 ` [PATCH v2] " Andre Naujoks
@ 2021-07-21 13:29   ` Stéphane Grosjean
  2021-07-21 13:39     ` Andre Naujoks
  0 siblings, 1 reply; 6+ messages in thread
From: Stéphane Grosjean @ 2021-07-21 13:29 UTC (permalink / raw)
  To: Andre Naujoks, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Jakub Kicinski, Vincent Mailhol,
	Gustavo A. R. Silva, Pavel Skripkin, Colin Ian King, linux-can,
	netdev, linux-kernel

Hi,

The display and the possibility to change this "device_number" is a current modification of the peak_usb driver. This modification will offer this possibility for all CAN - USB interfaces of PEAK-System.

However, it is planned to create new R/W entries for this (under /sys/class/net/canX/...) as is already the case in other USB - CAN interface drivers.

— Stéphane


De : Andre Naujoks <nautsch2@gmail.com>
Envoyé : mercredi 21 juillet 2021 14:59
À : Wolfgang Grandegger <wg@grandegger.com>; Marc Kleine-Budde <mkl@pengutronix.de>; David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Stéphane Grosjean <s.grosjean@peak-system.com>; Vincent Mailhol <mailhol.vincent@wanadoo.fr>; Gustavo A. R. Silva <gustavoars@kernel.org>; Pavel Skripkin <paskripkin@gmail.com>; Colin Ian King <colin.king@canonical.com>; Andre Naujoks <nautsch2@gmail.com>; linux-can@vger.kernel.org <linux-can@vger.kernel.org>; netdev@vger.kernel.org <netdev@vger.kernel.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
Objet : [PATCH v2] Expose Peak USB device id in sysfs via phys_port_name.

The Peak USB CAN adapters can be assigned a device id via the Peak
provided tools (pcan-settings). This id can currently not be set by the
upstream kernel drivers, but some devices expose this id already.

The id can be used for consistent naming of CAN interfaces regardless of
order of attachment or recognition on the system. The classical CAN Peak
USB adapters expose this id via bcdDevice (combined with another value)
on USB-level in the sysfs tree and this value is then available in
ID_REVISION from udev. This is not a feasible approach, when a single
USB device offers more than one CAN-interface, like e.g. the PCAN-USB
Pro FD devices.

This patch exposes those ids via the, up to now unused, netdevice sysfs
attribute phys_port_name as a simple decimal ASCII representation of the
id. phys_port_id was not used, since the default print functions from
net/core/net-sysfs.c output a hex-encoded binary value, which is
overkill for a one-byte device id, like this one.

Signed-off-by: Andre Naujoks <nautsch2@gmail.com>
---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index e8f43ed90b72..f6cbb01a58cc 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -408,6 +408,21 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
         return NETDEV_TX_OK;
 }

+static int peak_usb_ndo_get_phys_port_name(struct net_device *netdev,
+                                          char *name, size_t len)
+{
+       const struct peak_usb_device *dev = netdev_priv(netdev);
+       int err;
+
+       err = snprintf(name, len, "%u", dev->device_number);
+
+       if (err >= len || err <= 0) {
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
 /*
  * start the CAN interface.
  * Rx and Tx urbs are allocated here. Rx urbs are submitted here.
@@ -769,6 +784,7 @@ static const struct net_device_ops peak_usb_netdev_ops = {
         .ndo_stop = peak_usb_ndo_stop,
         .ndo_start_xmit = peak_usb_ndo_start_xmit,
         .ndo_change_mtu = can_change_mtu,
+       .ndo_get_phys_port_name = peak_usb_ndo_get_phys_port_name,
 };

 /*
--
2.32.0

--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt - HRB 9183
Geschaeftsfuehrung: Alexander Gach / Uwe Wilhelm
Unsere Datenschutzerklaerung mit wichtigen Hinweisen
zur Behandlung personenbezogener Daten finden Sie unter
www.peak-system.com/Datenschutz.483.0.html

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

* Re: [PATCH v2] Expose Peak USB device id in sysfs via phys_port_name.
  2021-07-21 13:29   ` Stéphane Grosjean
@ 2021-07-21 13:39     ` Andre Naujoks
       [not found]       ` <DBBPR03MB67952FE719401869BC8F1A77D6E59@DBBPR03MB6795.eurprd03.prod.outlook.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Andre Naujoks @ 2021-07-21 13:39 UTC (permalink / raw)
  To: Stéphane Grosjean, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Jakub Kicinski, Vincent Mailhol,
	Gustavo A. R. Silva, Pavel Skripkin, Colin Ian King, linux-can,
	netdev, linux-kernel

Am 21.07.21 um 15:29 schrieb Stéphane Grosjean:
> Hi,
> 
> The display and the possibility to change this "device_number" is a current modification of the peak_usb driver. This modification will offer this possibility for all CAN - USB interfaces of PEAK-System.

Hi.

By "current modification" you mean something not yet public? Do you have 
a time frame for when you are planning to make it public? I'd really 
like to use this :-)

> 
> However, it is planned to create new R/W entries for this (under /sys/class/net/canX/...) as is already the case in other USB - CAN interface drivers.

I'd be fine with that. I just chose something, that was already 
available and looked as if it made the most sense without breaking anything.

Thanks for the reply!
   Andre

> 
> — Stéphane
> 
> 
> De : Andre Naujoks <nautsch2@gmail.com>
> Envoyé : mercredi 21 juillet 2021 14:59
> À : Wolfgang Grandegger <wg@grandegger.com>; Marc Kleine-Budde <mkl@pengutronix.de>; David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Stéphane Grosjean <s.grosjean@peak-system.com>; Vincent Mailhol <mailhol.vincent@wanadoo.fr>; Gustavo A. R. Silva <gustavoars@kernel.org>; Pavel Skripkin <paskripkin@gmail.com>; Colin Ian King <colin.king@canonical.com>; Andre Naujoks <nautsch2@gmail.com>; linux-can@vger.kernel.org <linux-can@vger.kernel.org>; netdev@vger.kernel.org <netdev@vger.kernel.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
> Objet : [PATCH v2] Expose Peak USB device id in sysfs via phys_port_name.
> 
> The Peak USB CAN adapters can be assigned a device id via the Peak
> provided tools (pcan-settings). This id can currently not be set by the
> upstream kernel drivers, but some devices expose this id already.
> 
> The id can be used for consistent naming of CAN interfaces regardless of
> order of attachment or recognition on the system. The classical CAN Peak
> USB adapters expose this id via bcdDevice (combined with another value)
> on USB-level in the sysfs tree and this value is then available in
> ID_REVISION from udev. This is not a feasible approach, when a single
> USB device offers more than one CAN-interface, like e.g. the PCAN-USB
> Pro FD devices.
> 
> This patch exposes those ids via the, up to now unused, netdevice sysfs
> attribute phys_port_name as a simple decimal ASCII representation of the
> id. phys_port_id was not used, since the default print functions from
> net/core/net-sysfs.c output a hex-encoded binary value, which is
> overkill for a one-byte device id, like this one.
> 
> Signed-off-by: Andre Naujoks <nautsch2@gmail.com>
> ---
>   drivers/net/can/usb/peak_usb/pcan_usb_core.c | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
> index e8f43ed90b72..f6cbb01a58cc 100644
> --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
> +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
> @@ -408,6 +408,21 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
>           return NETDEV_TX_OK;
>   }
> 
> +static int peak_usb_ndo_get_phys_port_name(struct net_device *netdev,
> +                                          char *name, size_t len)
> +{
> +       const struct peak_usb_device *dev = netdev_priv(netdev);
> +       int err;
> +
> +       err = snprintf(name, len, "%u", dev->device_number);
> +
> +       if (err >= len || err <= 0) {
> +               return -EINVAL;
> +       }
> +
> +       return 0;
> +}
> +
>   /*
>    * start the CAN interface.
>    * Rx and Tx urbs are allocated here. Rx urbs are submitted here.
> @@ -769,6 +784,7 @@ static const struct net_device_ops peak_usb_netdev_ops = {
>           .ndo_stop = peak_usb_ndo_stop,
>           .ndo_start_xmit = peak_usb_ndo_start_xmit,
>           .ndo_change_mtu = can_change_mtu,
> +       .ndo_get_phys_port_name = peak_usb_ndo_get_phys_port_name,
>   };
> 
>   /*
> --
> 2.32.0
> 
> --
> PEAK-System Technik GmbH
> Sitz der Gesellschaft Darmstadt - HRB 9183
> Geschaeftsfuehrung: Alexander Gach / Uwe Wilhelm
> Unsere Datenschutzerklaerung mit wichtigen Hinweisen
> zur Behandlung personenbezogener Daten finden Sie unter
> www.peak-system.com/Datenschutz.483.0.html
> 


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

* Re: [PATCH v2] Expose Peak USB device id in sysfs via phys_port_name.
       [not found]       ` <DBBPR03MB67952FE719401869BC8F1A77D6E59@DBBPR03MB6795.eurprd03.prod.outlook.com>
@ 2021-07-23  7:33         ` Andre Naujoks
  0 siblings, 0 replies; 6+ messages in thread
From: Andre Naujoks @ 2021-07-23  7:33 UTC (permalink / raw)
  To: Stéphane Grosjean, linux-can, netdev, linux-kernel

Am 23.07.21 um 09:24 schrieb Stéphane Grosjean:
> Hi,
> 
> We plan to send the patches during the next month.

Thank you for the info! Sounds great. I'm looking forward to it.

Best Regards
   Andre

> 
> Regards,
> 
> — Stéphane
> 
> 
> ------------------------------------------------------------------------
> *De :* Andre Naujoks <nautsch2@gmail.com>
> *Envoyé :* mercredi 21 juillet 2021 15:39
> *À :* Stéphane Grosjean <s.grosjean@peak-system.com>; Wolfgang 
> Grandegger <wg@grandegger.com>; Marc Kleine-Budde <mkl@pengutronix.de>; 
> David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; 
> Vincent Mailhol <mailhol.vincent@wanadoo.fr>; Gustavo A. R. Silva 
> <gustavoars@kernel.org>; Pavel Skripkin <paskripkin@gmail.com>; Colin 
> Ian King <colin.king@canonical.com>; linux-can@vger.kernel.org 
> <linux-can@vger.kernel.org>; netdev@vger.kernel.org 
> <netdev@vger.kernel.org>; linux-kernel@vger.kernel.org 
> <linux-kernel@vger.kernel.org>
> *Objet :* Re: [PATCH v2] Expose Peak USB device id in sysfs via 
> phys_port_name.
> Am 21.07.21 um 15:29 schrieb Stéphane Grosjean:
>> Hi,
>> 
>> The display and the possibility to change this "device_number" is a current modification of the peak_usb driver. This modification will offer this possibility for all CAN - USB interfaces of PEAK-System.
> 
> Hi.
> 
> By "current modification" you mean something not yet public? Do you have
> a time frame for when you are planning to make it public? I'd really
> like to use this :-)
> 
>> 
>> However, it is planned to create new R/W entries for this (under /sys/class/net/canX/...) as is already the case in other USB - CAN interface drivers.
> 
> I'd be fine with that. I just chose something, that was already
> available and looked as if it made the most sense without breaking anything.
> 
> Thanks for the reply!
>     Andre
> 
>> 
>> — Stéphane
>> 
>> 
>> De : Andre Naujoks <nautsch2@gmail.com>
>> Envoyé : mercredi 21 juillet 2021 14:59
>> À : Wolfgang Grandegger <wg@grandegger.com>; Marc Kleine-Budde <mkl@pengutronix.de>; David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Stéphane Grosjean <s.grosjean@peak-system.com>; Vincent Mailhol <mailhol.vincent@wanadoo.fr>; Gustavo  A. R. Silva <gustavoars@kernel.org>; Pavel Skripkin 
> <paskripkin@gmail.com>; Colin Ian King <colin.king@canonical.com>; Andre 
> Naujoks <nautsch2@gmail.com>; linux-can@vger.kernel.org 
> <linux-can@vger.kernel.org>; netdev@vger.kernel.org 
> <netdev@vger.kernel.org>; linux-kernel@vger.kernel.org 
> <linux-kernel@vger.kernel.org>
>> Objet : [PATCH v2] Expose Peak USB device id in sysfs via phys_port_name.
>> 
>> The Peak USB CAN adapters can be assigned a device id via the Peak
>> provided tools (pcan-settings). This id can currently not be set by the
>> upstream kernel drivers, but some devices expose this id already.
>> 
>> The id can be used for consistent naming of CAN interfaces regardless of
>> order of attachment or recognition on the system. The classical CAN Peak
>> USB adapters expose this id via bcdDevice (combined with another value)
>> on USB-level in the sysfs tree and this value is then available in
>> ID_REVISION from udev. This is not a feasible approach, when a single
>> USB device offers more than one CAN-interface, like e.g. the PCAN-USB
>> Pro FD devices.
>> 
>> This patch exposes those ids via the, up to now unused, netdevice sysfs
>> attribute phys_port_name as a simple decimal ASCII representation of the
>> id. phys_port_id was not used, since the default print functions from
>> net/core/net-sysfs.c output a hex-encoded binary value, which is
>> overkill for a one-byte device id, like this one.
>> 
>> Signed-off-by: Andre Naujoks <nautsch2@gmail.com>
>> ---
>>   drivers/net/can/usb/peak_usb/pcan_usb_core.c | 16 ++++++++++++++++
>>   1 file changed, 16 insertions(+)
>> 
>> diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
>> index e8f43ed90b72..f6cbb01a58cc 100644
>> --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
>> +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
>> @@ -408,6 +408,21 @@ static netdev_tx_t peak_usb_ndo_start_xmit(struct sk_buff *skb,
>>           return NETDEV_TX_OK;
>>   }
>> 
>> +static int peak_usb_ndo_get_phys_port_name(struct net_device *netdev,
>> +                                          char *name, size_t len)
>> +{
>> +       const struct peak_usb_device *dev = netdev_priv(netdev);
>> +       int err;
>> +
>> +       err = snprintf(name, len, "%u", dev->device_number);
>> +
>> +       if (err >= len || err <= 0) {
>> +               return -EINVAL;
>> +       }
>> +
>> +       return 0;
>> +}
>> +
>>   /*
>>    * start the CAN interface.
>>    * Rx and Tx urbs are allocated here. Rx urbs are submitted here.
>> @@ -769,6 +784,7 @@ static const struct net_device_ops peak_usb_netdev_ops = {
>>           .ndo_stop = peak_usb_ndo_stop,
>>           .ndo_start_xmit = peak_usb_ndo_start_xmit,
>>           .ndo_change_mtu = can_change_mtu,
>> +       .ndo_get_phys_port_name = peak_usb_ndo_get_phys_port_name,
>>   };
>> 
>>   /*
>> --
>> 2.32.0
>> 
>> --
>> PEAK-System Technik GmbH
>> Sitz der Gesellschaft Darmstadt - HRB 9183
>> Geschaeftsfuehrung: Alexander Gach / Uwe Wilhelm
>> Unsere Datenschutzerklaerung mit wichtigen Hinweisen
>> zur Behandlung personenbezogener Daten finden Sie unter
>> www.peak-system.com/Datenschutz.483.0.html 
> <http://www.peak-system.com/Datenschutz.483.0.html>
>> 
> 
> 
> --
> PEAK-System Technik GmbH
> Sitz der Gesellschaft Darmstadt - HRB 9183
> Geschaeftsfuehrung: Alexander Gach / Uwe Wilhelm
> Unsere Datenschutzerklaerung mit wichtigen Hinweisen
> zur Behandlung personenbezogener Daten finden Sie unter
> www.peak-system.com/Datenschutz.483.0.html


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

end of thread, other threads:[~2021-07-23  7:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 12:40 [PATCH] Expose Peak USB device id in sysfs via phys_port_name Andre Naujoks
2021-07-21 12:52 ` Pavel Skripkin
2021-07-21 12:59 ` [PATCH v2] " Andre Naujoks
2021-07-21 13:29   ` Stéphane Grosjean
2021-07-21 13:39     ` Andre Naujoks
     [not found]       ` <DBBPR03MB67952FE719401869BC8F1A77D6E59@DBBPR03MB6795.eurprd03.prod.outlook.com>
2021-07-23  7:33         ` Andre Naujoks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).