diff mbox

[33/77] usbnet: convert rndis driver to net_device_ops

Message ID 20090321053715.035583259@vyatta.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger March 21, 2009, 5:36 a.m. UTC
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Comments

David Brownell March 21, 2009, 9:23 a.m. UTC | #1
On Friday 20 March 2009, Stephen Hemminger wrote:
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Acked-by: David Brownell <dbrownell@users.sourceforge.net>


> --- a/drivers/net/usb/rndis_host.c	2009-03-20 12:18:22.041027638 -0700
> +++ b/drivers/net/usb/rndis_host.c	2009-03-20 12:27:20.541841282 -0700
> @@ -266,6 +266,16 @@ response_error:
>  	return -EDOM;
>  }
>  
> +/* same as usbnet_netdev_ops but MTU change not allowed */
> +static const struct net_device_ops rndis_netdev_ops = {
> +	.ndo_open		= usbnet_open,
> +	.ndo_stop		= usbnet_stop,
> +	.ndo_start_xmit		= usbnet_start_xmit,
> +	.ndo_tx_timeout		= usbnet_tx_timeout,
> +	.ndo_set_mac_address 	= eth_mac_addr,
> +	.ndo_validate_addr	= eth_validate_addr,
> +};
> +
>  int
>  generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
>  {
> @@ -327,7 +337,8 @@ generic_rndis_bind(struct usbnet *dev, s
>  	dev->rx_urb_size &= ~(dev->maxpacket - 1);
>  	u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size);
>  
> -	net->change_mtu = NULL;
> +	net->netdev_ops = &rndis_netdev_ops;
> +
>  	retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE);
>  	if (unlikely(retval < 0)) {
>  		/* it might not even be an RNDIS device!! */
> 
> -- 
> 
> 


--
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, 3:01 a.m. UTC | #2
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Fri, 20 Mar 2009 22:36:00 -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
diff mbox

Patch

--- a/drivers/net/usb/rndis_host.c	2009-03-20 12:18:22.041027638 -0700
+++ b/drivers/net/usb/rndis_host.c	2009-03-20 12:27:20.541841282 -0700
@@ -266,6 +266,16 @@  response_error:
 	return -EDOM;
 }
 
+/* same as usbnet_netdev_ops but MTU change not allowed */
+static const struct net_device_ops rndis_netdev_ops = {
+	.ndo_open		= usbnet_open,
+	.ndo_stop		= usbnet_stop,
+	.ndo_start_xmit		= usbnet_start_xmit,
+	.ndo_tx_timeout		= usbnet_tx_timeout,
+	.ndo_set_mac_address 	= eth_mac_addr,
+	.ndo_validate_addr	= eth_validate_addr,
+};
+
 int
 generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
 {
@@ -327,7 +337,8 @@  generic_rndis_bind(struct usbnet *dev, s
 	dev->rx_urb_size &= ~(dev->maxpacket - 1);
 	u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size);
 
-	net->change_mtu = NULL;
+	net->netdev_ops = &rndis_netdev_ops;
+
 	retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE);
 	if (unlikely(retval < 0)) {
 		/* it might not even be an RNDIS device!! */