diff options
Diffstat (limited to 'net/ieee80211/ieee80211_module.c')
-rw-r--r-- | net/ieee80211/ieee80211_module.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c index 13b1e5fff7e4..b1c6d1f717d9 100644 --- a/net/ieee80211/ieee80211_module.c +++ b/net/ieee80211/ieee80211_module.c | |||
@@ -67,7 +67,7 @@ static int ieee80211_networks_allocate(struct ieee80211_device *ieee) | |||
67 | return 0; | 67 | return 0; |
68 | 68 | ||
69 | ieee->networks = | 69 | ieee->networks = |
70 | kmalloc(MAX_NETWORK_COUNT * sizeof(struct ieee80211_network), | 70 | kzalloc(MAX_NETWORK_COUNT * sizeof(struct ieee80211_network), |
71 | GFP_KERNEL); | 71 | GFP_KERNEL); |
72 | if (!ieee->networks) { | 72 | if (!ieee->networks) { |
73 | printk(KERN_WARNING "%s: Out of memory allocating beacons\n", | 73 | printk(KERN_WARNING "%s: Out of memory allocating beacons\n", |
@@ -75,9 +75,6 @@ static int ieee80211_networks_allocate(struct ieee80211_device *ieee) | |||
75 | return -ENOMEM; | 75 | return -ENOMEM; |
76 | } | 76 | } |
77 | 77 | ||
78 | memset(ieee->networks, 0, | ||
79 | MAX_NETWORK_COUNT * sizeof(struct ieee80211_network)); | ||
80 | |||
81 | return 0; | 78 | return 0; |
82 | } | 79 | } |
83 | 80 | ||
@@ -118,6 +115,21 @@ static void ieee80211_networks_initialize(struct ieee80211_device *ieee) | |||
118 | &ieee->network_free_list); | 115 | &ieee->network_free_list); |
119 | } | 116 | } |
120 | 117 | ||
118 | static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) | ||
119 | { | ||
120 | if ((new_mtu < 68) || (new_mtu > IEEE80211_DATA_LEN)) | ||
121 | return -EINVAL; | ||
122 | dev->mtu = new_mtu; | ||
123 | return 0; | ||
124 | } | ||
125 | |||
126 | static struct net_device_stats *ieee80211_generic_get_stats( | ||
127 | struct net_device *dev) | ||
128 | { | ||
129 | struct ieee80211_device *ieee = netdev_priv(dev); | ||
130 | return &ieee->stats; | ||
131 | } | ||
132 | |||
121 | struct net_device *alloc_ieee80211(int sizeof_priv) | 133 | struct net_device *alloc_ieee80211(int sizeof_priv) |
122 | { | 134 | { |
123 | struct ieee80211_device *ieee; | 135 | struct ieee80211_device *ieee; |
@@ -133,6 +145,11 @@ struct net_device *alloc_ieee80211(int sizeof_priv) | |||
133 | } | 145 | } |
134 | ieee = netdev_priv(dev); | 146 | ieee = netdev_priv(dev); |
135 | dev->hard_start_xmit = ieee80211_xmit; | 147 | dev->hard_start_xmit = ieee80211_xmit; |
148 | dev->change_mtu = ieee80211_change_mtu; | ||
149 | |||
150 | /* Drivers are free to override this if the generic implementation | ||
151 | * does not meet their needs. */ | ||
152 | dev->get_stats = ieee80211_generic_get_stats; | ||
136 | 153 | ||
137 | ieee->dev = dev; | 154 | ieee->dev = dev; |
138 | 155 | ||