diff -Nru a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Aug 7 20:54:38 2003 +++ b/drivers/net/bonding/bond_main.c Thu Aug 7 20:54:38 2003 @@ -3330,10 +3330,10 @@ static struct net_device_stats *bond_get_stats(struct net_device *dev) { bonding_t *bond = dev->priv; - struct net_device_stats *stats = bond->stats, *sstats; + struct net_device_stats *stats = &(bond->stats), *sstats; slave_t *slave; - memset(bond->stats, 0, sizeof(struct net_device_stats)); + memset(stats, 0, sizeof(struct net_device_stats)); read_lock_bh(&bond->lock); @@ -3566,13 +3566,6 @@ /* initialize rwlocks */ rwlock_init(&bond->lock); rwlock_init(&bond->ptrlock); - - bond->stats = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL); - if (bond->stats == NULL) { - kfree(bond); - return -ENOMEM; - } - memset(bond->stats, 0, sizeof(struct net_device_stats)); bond->next = bond->prev = (slave_t *)bond; bond->current_slave = NULL; @@ -3603,7 +3596,6 @@ break; default: printk(KERN_ERR "Unknown bonding mode %d\n", bond_mode); - kfree(bond->stats); kfree(bond); return -EINVAL; } @@ -3654,7 +3646,6 @@ if (bond->bond_proc_dir == NULL) { printk(KERN_ERR "%s: Cannot init /proc/net/%s/\n", dev->name, dev->name); - kfree(bond->stats); kfree(bond); return -ENOMEM; } @@ -3665,7 +3656,6 @@ printk(KERN_ERR "%s: Cannot init /proc/net/%s/info\n", dev->name, dev->name); remove_proc_entry(dev->name, proc_net); - kfree(bond->stats); kfree(bond); return -ENOMEM; } @@ -4007,9 +3997,8 @@ remove_proc_entry(dev_bond->name, proc_net); #endif unregister_netdev(dev_bond); - kfree(bond->stats); kfree(dev_bond->priv); - + dev_bond->priv = NULL; dev_bond++; } diff -Nru a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Thu Aug 7 20:54:38 2003 +++ b/drivers/net/bonding/bonding.h Thu Aug 7 20:54:38 2003 @@ -99,7 +99,7 @@ rwlock_t ptrlock; struct timer_list mii_timer; struct timer_list arp_timer; - struct net_device_stats *stats; + struct net_device_stats stats; #ifdef CONFIG_PROC_FS struct proc_dir_entry *bond_proc_dir; struct proc_dir_entry *bond_proc_info_file; diff -Nru a/drivers/net/net_init.c b/drivers/net/net_init.c --- a/drivers/net/net_init.c Thu Aug 7 20:54:38 2003 +++ b/drivers/net/net_init.c Thu Aug 7 20:54:38 2003 @@ -71,7 +71,7 @@ */ -static struct net_device *alloc_netdev(int sizeof_priv, const char *mask, +struct net_device *alloc_netdev(int sizeof_priv, const char *mask, void (*setup)(struct net_device *)) { struct net_device *dev; @@ -97,6 +97,7 @@ return dev; } +EXPORT_SYMBOL(alloc_netdev); static struct net_device *init_alloc_dev(int sizeof_priv) { diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c --- a/drivers/net/wireless/airo.c Thu Aug 7 20:54:38 2003 +++ b/drivers/net/wireless/airo.c Thu Aug 7 20:54:38 2003 @@ -305,6 +305,7 @@ #define CMD_DEALLOCATETX 0x000c #define NOP 0x0010 #define CMD_WORKAROUND 0x0011 +#define CMD_ALLOCATEAUX 0x0020 #define CMD_ACCESS 0x0021 #define CMD_PCIBAP 0x0022 #define CMD_PCIAUX 0x0023 @@ -409,6 +410,7 @@ #define EV_ALLOC 0x08 #define EV_LINK 0x80 #define EV_AWAKE 0x100 +#define EV_TXCPY 0x400 #define EV_UNKNOWN 0x800 #define EV_MIC 0x1000 /* Message Integrity Check Interrupt */ #define STATUS_INTS ( EV_AWAKE | EV_LINK | EV_TXEXC | EV_TX | EV_RX | EV_MIC ) @@ -639,7 +641,7 @@ u16 SSIDlen; char SSID[32]; char apName[16]; - char bssid[4][ETH_ALEN]; + u8 bssid[4][ETH_ALEN]; u16 beaconPeriod; u16 dimPeriod; u16 atimDuration; @@ -1047,11 +1049,15 @@ struct iw_statistics wstats; // wireless stats unsigned long scan_timestamp; /* Time started to scan */ struct tq_struct event_task; +#if WIRELESS_EXT > 15 + struct iw_spy_data spy_data; +#else /* WIRELESS_EXT > 15 */ #ifdef WIRELESS_SPY int spy_number; u_char spy_address[IW_MAX_SPY][ETH_ALEN]; struct iw_quality spy_stat[IW_MAX_SPY]; #endif /* WIRELESS_SPY */ +#endif /* WIRELESS_EXT > 15 */ #endif /* WIRELESS_EXT */ /* MIC stuff */ mic_module mod[2]; @@ -1203,13 +1209,13 @@ ai->need_commit = 0; checkThrottle(ai); + cfgr = ai->config; + if ((cfgr.opmode & 0xFF) == MODE_STA_IBSS) ai->flags |= FLAG_ADHOC; else ai->flags &= ~FLAG_ADHOC; - cfgr = ai->config; - for(s = &cfgr.len; s <= &cfgr.rtsThres; s++) *s = cpu_to_le16(*s); for(s = &cfgr.shortRetryLimit; s <= &cfgr.radioType; s++) @@ -1608,13 +1614,10 @@ void stop_airo_card( struct net_device *dev, int freeres ) { struct airo_info *ai = dev->priv; - flush_scheduled_tasks(); disable_interrupts(ai); free_irq( dev->irq, dev ); - if (ai->flash) - kfree(ai->flash); - if (ai->rssi) - kfree(ai->rssi); + if (auto_wep) + del_timer_sync(&ai->timer); takedown_proc_entry( dev, ai ); if (ai->registered) { unregister_netdev( dev ); @@ -1625,7 +1628,11 @@ } ai->registered = 0; } - if (auto_wep) del_timer_sync(&ai->timer); + flush_scheduled_tasks(); + if (ai->flash) + kfree(ai->flash); + if (ai->rssi) + kfree(ai->rssi); if (freeres) { /* PCMCIA frees this stuff, so only for PCI and ISA */ release_region( dev->base_addr, 64 ); @@ -2386,7 +2393,7 @@ ai->config.opmode = adhoc ? MODE_STA_IBSS : MODE_STA_ESS; #ifdef MICSUPPORT - if ((cap_rid.len==sizeof(cap_rid)) && (cap_rid.extSoftCap&1)) { + if ((cap_rid.len>=sizeof(cap_rid)) && (cap_rid.extSoftCap&1)) { ai->config.opmode |= MODE_MIC; ai->flags |= FLAG_MIC_CAPABLE; micsetup(ai); @@ -5199,7 +5206,7 @@ & status_rid.bssid[i][2] & status_rid.bssid[i][3] & status_rid.bssid[i][4] - & status_rid.bssid[i][5])!=-1 && + & status_rid.bssid[i][5])!=0xff && (status_rid.bssid[i][0] | status_rid.bssid[i][1] | status_rid.bssid[i][2] @@ -5293,7 +5300,7 @@ capabilities = le16_to_cpu(list->cap); if(capabilities & (CAP_ESS | CAP_IBSS)) { if(capabilities & CAP_ESS) - iwe.u.mode = IW_MODE_INFRA; + iwe.u.mode = IW_MODE_MASTER; else iwe.u.mode = IW_MODE_ADHOC; current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_UINT_LEN); diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Thu Aug 7 20:54:38 2003 +++ b/include/linux/netdevice.h Thu Aug 7 20:54:38 2003 @@ -801,6 +801,8 @@ extern void fc_setup(struct net_device *dev); extern void fc_freedev(struct net_device *dev); /* Support for loadable net-drivers */ +extern struct net_device *alloc_netdev(int sizeof_priv, const char *name, + void (*setup)(struct net_device *)); extern int register_netdev(struct net_device *dev); extern void unregister_netdev(struct net_device *dev); /* Functions used for multicast support */