summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/atmel/atmel.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-10-20 14:51:11 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-20 14:51:11 -0400
commit9e58c5dc4be31f8cf3ff62d96f91c97af6f9d58e (patch)
tree620fee35d81bca34bc7c117ba4bc65ab28f360b0 /drivers/net/wireless/atmel/atmel.c
parent1a61a8f1776758acb5111785c8a1688394fa3a60 (diff)
parentb96f9afee4eb5229c80afa3d97ccf725fb1b89a6 (diff)
Merge branch 'MTU-core-range-checking-more'
Jarod Wilson says: ==================== net: use core MTU range checking everywhere This stack of patches should get absolutely everything in the kernel converted from doing their own MTU range checking to the core MTU range checking. This second spin includes alterations to hopefully fix all concerns raised with the first, as well as including some additional changes to drivers and infrastructure where I completely missed necessary updates. These have all been built through the 0-day build infrastructure via the (rebasing) master branch at https://github.com/jarodwilson/linux-muck, which at the time of the most recent compile across 147 configs, was based on net-next at commit 7b1536ef0aa0. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/atmel/atmel.c')
-rw-r--r--drivers/net/wireless/atmel/atmel.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/wireless/atmel/atmel.c b/drivers/net/wireless/atmel/atmel.c
index bf2e9a083c0c..eb92d5ab7a27 100644
--- a/drivers/net/wireless/atmel/atmel.c
+++ b/drivers/net/wireless/atmel/atmel.c
@@ -1295,14 +1295,6 @@ static struct iw_statistics *atmel_get_wireless_stats(struct net_device *dev)
return &priv->wstats;
}
-static int atmel_change_mtu(struct net_device *dev, int new_mtu)
-{
- if ((new_mtu < 68) || (new_mtu > 2312))
- return -EINVAL;
- dev->mtu = new_mtu;
- return 0;
-}
-
static int atmel_set_mac_address(struct net_device *dev, void *p)
{
struct sockaddr *addr = p;
@@ -1506,7 +1498,6 @@ static const struct file_operations atmel_proc_fops = {
static const struct net_device_ops atmel_netdev_ops = {
.ndo_open = atmel_open,
.ndo_stop = atmel_close,
- .ndo_change_mtu = atmel_change_mtu,
.ndo_set_mac_address = atmel_set_mac_address,
.ndo_start_xmit = start_tx,
.ndo_do_ioctl = atmel_ioctl,
@@ -1600,6 +1591,10 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
dev->irq = irq;
dev->base_addr = port;
+ /* MTU range: 68 - 2312 */
+ dev->min_mtu = 68;
+ dev->max_mtu = MAX_WIRELESS_BODY - ETH_FCS_LEN;
+
SET_NETDEV_DEV(dev, sys_dev);
if ((rc = request_irq(dev->irq, service_interrupt, IRQF_SHARED, dev->name, dev))) {