Re: [PATCH net-next 11/19] net: usb: aqc111: Add support for changing MTU

From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-10-06 16:56:03
Also in: linux-usb

+static int aqc111_change_mtu(struct net_device *net, int new_mtu)
+{
+	struct usbnet *dev = netdev_priv(net);
+	u16 reg16 = 0;
+	u8 buf[5];
+
+	if (new_mtu <= 0 || new_mtu > 16334) {
+		netdev_info(net, "Invalid MTU %d requested, hw max 16334",
+			    new_mtu);
+		return -EINVAL;
+	}
Please set net->min_mtu, and net->max_mtu, and the core should do this
checking for you. See dev_set_mtu_ext().

	 Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help