Commit 08ed5ef6 authored by Alexander Viro's avatar Alexander Viro Committed by Stephen Hemminger

[wireless airo] switched to sane allocation.

parent c8416949
...@@ -2105,10 +2105,8 @@ int wll_header_parse(struct sk_buff *skb, unsigned char *haddr) ...@@ -2105,10 +2105,8 @@ int wll_header_parse(struct sk_buff *skb, unsigned char *haddr)
return ETH_ALEN; return ETH_ALEN;
} }
static void wifi_setup(struct net_device *dev, struct net_device *ethdev) static void wifi_setup(struct net_device *dev)
{ {
struct airo_info *ai = ethdev->priv;
dev->priv = ai;
dev->hard_header = 0; dev->hard_header = 0;
dev->rebuild_header = 0; dev->rebuild_header = 0;
dev->hard_header_cache = 0; dev->hard_header_cache = 0;
...@@ -2128,14 +2126,11 @@ static void wifi_setup(struct net_device *dev, struct net_device *ethdev) ...@@ -2128,14 +2126,11 @@ static void wifi_setup(struct net_device *dev, struct net_device *ethdev)
dev->change_mtu = &airo_change_mtu; dev->change_mtu = &airo_change_mtu;
dev->open = &airo_open; dev->open = &airo_open;
dev->stop = &airo_close; dev->stop = &airo_close;
dev->irq = ethdev->irq;
dev->base_addr = ethdev->base_addr;
dev->type = ARPHRD_IEEE80211; dev->type = ARPHRD_IEEE80211;
dev->hard_header_len = ETH_HLEN; dev->hard_header_len = ETH_HLEN;
dev->mtu = 2312; dev->mtu = 2312;
dev->addr_len = ETH_ALEN; dev->addr_len = ETH_ALEN;
memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
dev->tx_queue_len = 100; dev->tx_queue_len = 100;
memset(dev->broadcast,0xFF, ETH_ALEN); memset(dev->broadcast,0xFF, ETH_ALEN);
...@@ -2147,17 +2142,17 @@ static struct net_device *init_wifidev(struct airo_info *ai, ...@@ -2147,17 +2142,17 @@ static struct net_device *init_wifidev(struct airo_info *ai,
struct net_device *ethdev) struct net_device *ethdev)
{ {
int err; int err;
struct net_device *dev = (struct net_device*)kmalloc(sizeof *dev,GFP_KERNEL); struct net_device *dev = alloc_netdev(0, "wifi%d", wifi_setup);
if (!dev) return 0; if (!dev)
memset(dev, 0, sizeof(*dev)); return NULL;
dev->priv = ethdev->priv;
strcpy(dev->name, "wifi%d"); dev->irq = ethdev->irq;
dev->priv = ai; dev->base_addr = ethdev->base_addr;
wifi_setup(dev, ethdev); memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
err = register_netdev(dev); err = register_netdev(dev);
if (err<0) { if (err<0) {
kfree(dev); free_netdev(dev);
return 0; return NULL;
} }
return dev; return dev;
} }
...@@ -2273,7 +2268,7 @@ struct net_device *init_airo_card( unsigned short irq, int port, int is_pcmcia ) ...@@ -2273,7 +2268,7 @@ struct net_device *init_airo_card( unsigned short irq, int port, int is_pcmcia )
kill_proc(ai->thr_pid, SIGTERM, 1); kill_proc(ai->thr_pid, SIGTERM, 1);
wait_for_completion(&ai->thr_exited); wait_for_completion(&ai->thr_exited);
err_out_free: err_out_free:
kfree(dev); free_netdev(dev);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment