netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] cdc_ether: use dev->intf to get interface information
@ 2020-07-15 15:53 Wxcafé
  2020-07-15 16:02 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Wxcafé @ 2020-07-15 15:53 UTC (permalink / raw)
  To: linux-usb; +Cc: Miguel Rodríguez Pérez, oliver, netdev

From 0d0f13077e02cf6b54f2a22eb2e5f7d97ac7ee97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel Rodr=C3=ADguez P=C3=A9rez? <miguel@det.uvigo.gal>
Date: Tue, 14 Jul 2020 18:02:10 -0400
Subject: [PATCH 1/4] cdc_ether: use dev->intf to get interface information

usbnet_cdc_update_filter was getting the interface number from the
usb_interface struct in cdc_state->control. However, cdc_ncm does
not initialize that structure in its bind function, but uses
cdc_ncm_cts instead. Getting intf directly from struct usbnet solves
the problem.

Signed-off-by: Miguel Rodríguez Pérez <miguel@det.uvigo.gal>
Signed-off-by: Wxcafé <wxcafe@wxcafe.net>
---
 drivers/net/usb/cdc_ether.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index a657943c9f01..2afe258e3648 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -65,8 +65,6 @@ static const u8 mbm_guid[16] = {
 
 static void usbnet_cdc_update_filter(struct usbnet *dev)
 {
-	struct cdc_state	*info = (void *) &dev->data;
-	struct usb_interface	*intf = info->control;
 	struct net_device	*net = dev->net;
 
 	u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED
@@ -86,7 +84,7 @@ static void usbnet_cdc_update_filter(struct usbnet *dev)
 			USB_CDC_SET_ETHERNET_PACKET_FILTER,
 			USB_TYPE_CLASS | USB_RECIP_INTERFACE,
 			cdc_filter,
-			intf->cur_altsetting->desc.bInterfaceNumber,
+			dev->intf->cur_altsetting->desc.bInterfaceNumber,
 			NULL,
 			0,
 			USB_CTRL_SET_TIMEOUT
-- 
2.27.0

-- 
Wxcafé <wxcafe@wxcafe.net>


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

* Re: [PATCH 1/4] cdc_ether: use dev->intf to get interface information
  2020-07-15 15:53 [PATCH 1/4] cdc_ether: use dev->intf to get interface information Wxcafé
@ 2020-07-15 16:02 ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2020-07-15 16:02 UTC (permalink / raw)
  To: Wxcafé; +Cc: linux-usb, Miguel Rodríguez Pérez, oliver, netdev

On Wed, Jul 15, 2020 at 11:53:39AM -0400, Wxcafé wrote:
> >From 0d0f13077e02cf6b54f2a22eb2e5f7d97ac7ee97 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Miguel Rodr=C3=ADguez P=C3=A9rez? <miguel@det.uvigo.gal>
> Date: Tue, 14 Jul 2020 18:02:10 -0400
> Subject: [PATCH 1/4] cdc_ether: use dev->intf to get interface information

That looks really odd in a changelog body :(

> 
> usbnet_cdc_update_filter was getting the interface number from the
> usb_interface struct in cdc_state->control. However, cdc_ncm does
> not initialize that structure in its bind function, but uses
> cdc_ncm_cts instead. Getting intf directly from struct usbnet solves
> the problem.
> 
> Signed-off-by: Miguel Rodríguez Pérez <miguel@det.uvigo.gal>
> Signed-off-by: Wxcafé <wxcafe@wxcafe.net>

As per the documentation, we need a "real name" for all signed-off-by.

Also, what has changed with this series from before?  Have you addressed
Oliver's objections?

thanks,

greg k-h

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

* [PATCH 1/4] cdc_ether: use dev->intf to get interface information
@ 2020-07-15  1:23 Wxcafé
  0 siblings, 0 replies; 3+ messages in thread
From: Wxcafé @ 2020-07-15  1:23 UTC (permalink / raw)
  To: linux-usb; +Cc: Miguel Rodríguez Pérez, oliver, netdev

usbnet_cdc_update_filter was getting the interface number from the
usb_interface struct in cdc_state->control. However, cdc_ncm does
not initialize that structure in its bind function, but uses
cdc_ncm_cts instead. Getting intf directly from struct usbnet solves
the problem.

Signed-off-by: Miguel Rodríguez Pérez <miguel@det.uvigo.gal>
---
 drivers/net/usb/cdc_ether.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index a657943c9f01..2afe258e3648 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -65,8 +65,6 @@ static const u8 mbm_guid[16] = {
 
 static void usbnet_cdc_update_filter(struct usbnet *dev)
 {
-	struct cdc_state	*info = (void *) &dev->data;
-	struct usb_interface	*intf = info->control;
 	struct net_device	*net = dev->net;
 
 	u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED
@@ -86,7 +84,7 @@ static void usbnet_cdc_update_filter(struct usbnet *dev)
 			USB_CDC_SET_ETHERNET_PACKET_FILTER,
 			USB_TYPE_CLASS | USB_RECIP_INTERFACE,
 			cdc_filter,
-			intf->cur_altsetting->desc.bInterfaceNumber,
+			dev->intf->cur_altsetting->desc.bInterfaceNumber,
 			NULL,
 			0,
 			USB_CTRL_SET_TIMEOUT
-- 
2.27.0


-- 
Wxcafé <wxcafe@wxcafe.net>


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

end of thread, other threads:[~2020-07-15 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 15:53 [PATCH 1/4] cdc_ether: use dev->intf to get interface information Wxcafé
2020-07-15 16:02 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2020-07-15  1:23 Wxcafé

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).