diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2014-05-27 07:45:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-05-29 13:10:28 -0400 |
commit | d87bac1b26e81192d7264a73ea11324be80b493c (patch) | |
tree | fed88d4acf9e558183b9e2e1f94f05524b652fb4 | |
parent | 60ccc107c9b9fb732fdee1f76bb2dad44f0e1798 (diff) |
wil6210: limit MTU
Obey 802.11 spec that defines max. data size 7920 bytes
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/wil6210/netdev.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c index fdcaeb820e75..106b6dcb773a 100644 --- a/drivers/net/wireless/ath/wil6210/netdev.c +++ b/drivers/net/wireless/ath/wil6210/netdev.c | |||
@@ -32,12 +32,26 @@ static int wil_stop(struct net_device *ndev) | |||
32 | return wil_down(wil); | 32 | return wil_down(wil); |
33 | } | 33 | } |
34 | 34 | ||
35 | static int wil_change_mtu(struct net_device *ndev, int new_mtu) | ||
36 | { | ||
37 | struct wil6210_priv *wil = ndev_to_wil(ndev); | ||
38 | |||
39 | if (new_mtu < 68 || new_mtu > IEEE80211_MAX_DATA_LEN_DMG) | ||
40 | return -EINVAL; | ||
41 | |||
42 | wil_dbg_misc(wil, "change MTU %d -> %d\n", ndev->mtu, new_mtu); | ||
43 | ndev->mtu = new_mtu; | ||
44 | |||
45 | return 0; | ||
46 | } | ||
47 | |||
35 | static const struct net_device_ops wil_netdev_ops = { | 48 | static const struct net_device_ops wil_netdev_ops = { |
36 | .ndo_open = wil_open, | 49 | .ndo_open = wil_open, |
37 | .ndo_stop = wil_stop, | 50 | .ndo_stop = wil_stop, |
38 | .ndo_start_xmit = wil_start_xmit, | 51 | .ndo_start_xmit = wil_start_xmit, |
39 | .ndo_set_mac_address = eth_mac_addr, | 52 | .ndo_set_mac_address = eth_mac_addr, |
40 | .ndo_validate_addr = eth_validate_addr, | 53 | .ndo_validate_addr = eth_validate_addr, |
54 | .ndo_change_mtu = wil_change_mtu, | ||
41 | }; | 55 | }; |
42 | 56 | ||
43 | static int wil6210_netdev_poll_rx(struct napi_struct *napi, int budget) | 57 | static int wil6210_netdev_poll_rx(struct napi_struct *napi, int budget) |