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

Previous thread: [PATCH 45/77] x25_asy: convert to internal net_device_stats by Stephen Hemminger on Friday, March 20, 2009 - 10:36 pm. (2 messages)

Next thread: [PATCH 39/77] pcnet: convert driver to net_device_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:36 pm. (2 messages)
From: Stephen Hemminger
Date: Friday, March 20, 2009 - 10:36 pm

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

--- 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!! */

-- 

--

From: David Brownell
Date: Saturday, March 21, 2009 - 2:23 am

From: David Miller
Date: Saturday, March 21, 2009 - 8:01 pm

From: Stephen Hemminger <shemminger@vyatta.com>

Applied.
--

Previous thread: [PATCH 45/77] x25_asy: convert to internal net_device_stats by Stephen Hemminger on Friday, March 20, 2009 - 10:36 pm. (2 messages)

Next thread: [PATCH 39/77] pcnet: convert driver to net_device_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:36 pm. (2 messages)