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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux