Patchwork [22/77] usbnet: convert catc device to net_device_ops

login
register
mail settings
Submitter stephen hemminger
Date March 21, 2009, 5:35 a.m.
Message ID <20090321053714.207963951@vyatta.com>
Download mbox | patch
Permalink /patch/24855/
State Accepted
Delegated to: David Miller
Headers show

Comments

stephen hemminger - March 21, 2009, 5:35 a.m.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
David Brownell - March 21, 2009, 9:01 a.m.
On Friday 20 March 2009, Stephen Hemminger wrote:
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

OK by me, but I cc'd Vojtech who was the last maintainer of this code.


> --- a/drivers/net/usb/catc.c	2009-03-20 12:10:10.851651580 -0700
> +++ b/drivers/net/usb/catc.c	2009-03-20 12:10:23.060839265 -0700
> @@ -743,6 +743,18 @@ static int catc_stop(struct net_device *
>  	return 0;
>  }
>  
> +static const struct net_device_ops catc_netdev_ops = {
> +	.ndo_open		= catc_open,
> +	.ndo_stop		= catc_stop,
> +	.ndo_start_xmit		= catc_start_xmit,
> +
> +	.ndo_tx_timeout		= catc_tx_timeout,
> +	.ndo_set_multicast_list = catc_set_multicast_list,
> +	.ndo_change_mtu		= eth_change_mtu,
> +	.ndo_set_mac_address 	= eth_mac_addr,
> +	.ndo_validate_addr	= eth_validate_addr,
> +};
> +
>  /*
>   * USB probe, disconnect.
>   */
> @@ -767,12 +779,8 @@ static int catc_probe(struct usb_interfa
>  
>  	catc = netdev_priv(netdev);
>  
> -	netdev->open = catc_open;
> -	netdev->hard_start_xmit = catc_hard_start_xmit;
> -	netdev->stop = catc_stop;
> -	netdev->tx_timeout = catc_tx_timeout;
> +	netdev->netdev_ops = &catc_netdev_ops;
>  	netdev->watchdog_timeo = TX_TIMEOUT;
> -	netdev->set_multicast_list = catc_set_multicast_list;
>  	SET_ETHTOOL_OPS(netdev, &ops);
>  
>  	catc->usbdev = usbdev;
> 
> -- 
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiri Pirko - March 21, 2009, 10:17 a.m.
Sat, Mar 21, 2009 at 06:35:49AM CET, shemminger@vyatta.com wrote:
>Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
>--- a/drivers/net/usb/catc.c	2009-03-20 12:10:10.851651580 -0700
>+++ b/drivers/net/usb/catc.c	2009-03-20 12:10:23.060839265 -0700
>@@ -743,6 +743,18 @@ static int catc_stop(struct net_device *
> 	return 0;
> }
> 
>+static const struct net_device_ops catc_netdev_ops = {
>+	.ndo_open		= catc_open,
>+	.ndo_stop		= catc_stop,
>+	.ndo_start_xmit		= catc_start_xmit,
                                  ^^^^^^^^^^^^^^^
Shouldn't be here catc_hard_start_xmit() instead? Cannot find catc_start_xmit()
anywhere in the code...
>+
>+	.ndo_tx_timeout		= catc_tx_timeout,
>+	.ndo_set_multicast_list = catc_set_multicast_list,
>+	.ndo_change_mtu		= eth_change_mtu,
>+	.ndo_set_mac_address 	= eth_mac_addr,
>+	.ndo_validate_addr	= eth_validate_addr,
>+};
>+
> /*
>  * USB probe, disconnect.
>  */
>@@ -767,12 +779,8 @@ static int catc_probe(struct usb_interfa
> 
> 	catc = netdev_priv(netdev);
> 
>-	netdev->open = catc_open;
>-	netdev->hard_start_xmit = catc_hard_start_xmit;
>-	netdev->stop = catc_stop;
>-	netdev->tx_timeout = catc_tx_timeout;
>+	netdev->netdev_ops = &catc_netdev_ops;
> 	netdev->watchdog_timeo = TX_TIMEOUT;
>-	netdev->set_multicast_list = catc_set_multicast_list;
> 	SET_ETHTOOL_OPS(netdev, &ops);
> 
> 	catc->usbdev = usbdev;
>
>-- 
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Vojtech Pavlik - March 21, 2009, 1:02 p.m.
On Sat, Mar 21, 2009 at 02:01:14AM -0700, David Brownell wrote:
> On Friday 20 March 2009, Stephen Hemminger wrote:
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> OK by me, but I cc'd Vojtech who was the last maintainer of this code.

OK by me, too.

> 
> 
> > --- a/drivers/net/usb/catc.c	2009-03-20 12:10:10.851651580 -0700
> > +++ b/drivers/net/usb/catc.c	2009-03-20 12:10:23.060839265 -0700
> > @@ -743,6 +743,18 @@ static int catc_stop(struct net_device *
> >  	return 0;
> >  }
> >  
> > +static const struct net_device_ops catc_netdev_ops = {
> > +	.ndo_open		= catc_open,
> > +	.ndo_stop		= catc_stop,
> > +	.ndo_start_xmit		= catc_start_xmit,
> > +
> > +	.ndo_tx_timeout		= catc_tx_timeout,
> > +	.ndo_set_multicast_list = catc_set_multicast_list,
> > +	.ndo_change_mtu		= eth_change_mtu,
> > +	.ndo_set_mac_address 	= eth_mac_addr,
> > +	.ndo_validate_addr	= eth_validate_addr,
> > +};
> > +
> >  /*
> >   * USB probe, disconnect.
> >   */
> > @@ -767,12 +779,8 @@ static int catc_probe(struct usb_interfa
> >  
> >  	catc = netdev_priv(netdev);
> >  
> > -	netdev->open = catc_open;
> > -	netdev->hard_start_xmit = catc_hard_start_xmit;
> > -	netdev->stop = catc_stop;
> > -	netdev->tx_timeout = catc_tx_timeout;
> > +	netdev->netdev_ops = &catc_netdev_ops;
> >  	netdev->watchdog_timeo = TX_TIMEOUT;
> > -	netdev->set_multicast_list = catc_set_multicast_list;
> >  	SET_ETHTOOL_OPS(netdev, &ops);
> >  
> >  	catc->usbdev = usbdev;
> > 
> > -- 
> > 
> > 
> 
>
David Miller - March 22, 2009, 2:40 a.m.
From: Jiri Pirko <jpirko@redhat.com>
Date: Sat, 21 Mar 2009 11:17:29 +0100

> Sat, Mar 21, 2009 at 06:35:49AM CET, shemminger@vyatta.com wrote:
> >Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> >--- a/drivers/net/usb/catc.c	2009-03-20 12:10:10.851651580 -0700
> >+++ b/drivers/net/usb/catc.c	2009-03-20 12:10:23.060839265 -0700
> >@@ -743,6 +743,18 @@ static int catc_stop(struct net_device *
> > 	return 0;
> > }
> > 
> >+static const struct net_device_ops catc_netdev_ops = {
> >+	.ndo_open		= catc_open,
> >+	.ndo_stop		= catc_stop,
> >+	.ndo_start_xmit		= catc_start_xmit,
>                                   ^^^^^^^^^^^^^^^
> Shouldn't be here catc_hard_start_xmit() instead? Cannot find catc_start_xmit()
> anywhere in the code...

It gets renamed to catc_start_xmit() in the previous patch in this
series, #21.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - March 22, 2009, 2:45 a.m.
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 20 Mar 2009 22:35:49 -0700

> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- a/drivers/net/usb/catc.c	2009-03-20 12:10:10.851651580 -0700
+++ b/drivers/net/usb/catc.c	2009-03-20 12:10:23.060839265 -0700
@@ -743,6 +743,18 @@  static int catc_stop(struct net_device *
 	return 0;
 }
 
+static const struct net_device_ops catc_netdev_ops = {
+	.ndo_open		= catc_open,
+	.ndo_stop		= catc_stop,
+	.ndo_start_xmit		= catc_start_xmit,
+
+	.ndo_tx_timeout		= catc_tx_timeout,
+	.ndo_set_multicast_list = catc_set_multicast_list,
+	.ndo_change_mtu		= eth_change_mtu,
+	.ndo_set_mac_address 	= eth_mac_addr,
+	.ndo_validate_addr	= eth_validate_addr,
+};
+
 /*
  * USB probe, disconnect.
  */
@@ -767,12 +779,8 @@  static int catc_probe(struct usb_interfa
 
 	catc = netdev_priv(netdev);
 
-	netdev->open = catc_open;
-	netdev->hard_start_xmit = catc_hard_start_xmit;
-	netdev->stop = catc_stop;
-	netdev->tx_timeout = catc_tx_timeout;
+	netdev->netdev_ops = &catc_netdev_ops;
 	netdev->watchdog_timeo = TX_TIMEOUT;
-	netdev->set_multicast_list = catc_set_multicast_list;
 	SET_ETHTOOL_OPS(netdev, &ops);
 
 	catc->usbdev = usbdev;