diff options
author | Sritej Velaga <sritej.velaga@qlogic.com> | 2010-10-04 00:20:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-05 01:46:52 -0400 |
commit | 0bd9e6a964d86a19f54a9ba31168a37d64e451d1 (patch) | |
tree | 7c2c35cb539201e59a5f955a39d21af6b195a44e /drivers/net/qlcnic | |
parent | aef3d898276e046bfa877cd20b8ee269b85161cd (diff) |
qlcnic: set mtu lower limit
Setting mtu < 68 is not supported.
Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 1 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_hw.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 9d80171a1fbf..42a288348aca 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -95,6 +95,7 @@ | |||
95 | #define FIRST_PAGE_GROUP_END 0x100000 | 95 | #define FIRST_PAGE_GROUP_END 0x100000 |
96 | 96 | ||
97 | #define P3_MAX_MTU (9600) | 97 | #define P3_MAX_MTU (9600) |
98 | #define P3_MIN_MTU (68) | ||
98 | #define QLCNIC_MAX_ETHERHDR 32 /* This contains some padding */ | 99 | #define QLCNIC_MAX_ETHERHDR 32 /* This contains some padding */ |
99 | 100 | ||
100 | #define QLCNIC_P3_RX_BUF_MAX_LEN (QLCNIC_MAX_ETHERHDR + ETH_DATA_LEN) | 101 | #define QLCNIC_P3_RX_BUF_MAX_LEN (QLCNIC_MAX_ETHERHDR + ETH_DATA_LEN) |
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c index 712cfabc2825..9d3e16dbd043 100644 --- a/drivers/net/qlcnic/qlcnic_hw.c +++ b/drivers/net/qlcnic/qlcnic_hw.c | |||
@@ -758,9 +758,9 @@ int qlcnic_change_mtu(struct net_device *netdev, int mtu) | |||
758 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 758 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
759 | int rc = 0; | 759 | int rc = 0; |
760 | 760 | ||
761 | if (mtu > P3_MAX_MTU) { | 761 | if (mtu < P3_MIN_MTU || mtu > P3_MAX_MTU) { |
762 | dev_err(&adapter->netdev->dev, "mtu > %d bytes unsupported\n", | 762 | dev_err(&adapter->netdev->dev, "%d bytes < mtu < %d bytes" |
763 | P3_MAX_MTU); | 763 | " not supported\n", P3_MAX_MTU, P3_MIN_MTU); |
764 | return -EINVAL; | 764 | return -EINVAL; |
765 | } | 765 | } |
766 | 766 | ||