Changeset 49

Show
Ignore:
Timestamp:
03/15/03 19:32:07 (9 years ago)
Author:
sam
Message:

Replicated Change 83 by sam@borg_greg on 2003/03/04 17:47:34<<<

o must #ifdef wireless extensions on CONFIG_NET_WIRELESS, not

WIRELESS_EXT; this was causing sizeof(struct ieee80211com) to
be different in the driver because it didn't include <wireless.h>

o eliminate the mgt queue and send mgt frames directly using new

ic_mgtstart method that replaces ic_start; this is more consistent
with Linux style

o remove locking in slow timeout tasklet; it caused recursive locking

when inactivity timer caused deauthentication of node (recursive
path followed when sending management frame requires node lookup)

o manage netdevice queue start/stop entirely in ieee80211_new_state

based on S_RUN state

o change locking to use spin_lock_irq/spin_unlock_irq

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cvs-import/trunk/wlan/if_ieee80211.h

    r45 r49  
    4040#include <sys/queue.h> 
    4141#include "if_media.h" 
     42#ifdef CONFIG_NET_WIRELESS 
     43#include <linux/wireless.h> 
     44#endif 
    4245 
    4346#define IEEE80211_ADDR_LEN                      6 
     
    543546        struct timer_list       ic_slowtimo;    /* if watchdog timer */ 
    544547        void                    (*ic_watchdog)(struct net_device *); 
    545         void                    (*ic_start)(struct net_device *); 
     548        int                     (*ic_mgtstart)(struct sk_buff *, 
     549                                        struct net_device *); 
    546550        int                     (*ic_init)(struct net_device *); 
    547551        void                    (*ic_recv_mgmt[16])(struct ieee80211com *, 
     
    559563        u_char                  ic_chan_active[roundup(IEEE80211_CHAN_MAX, NBBY)]; 
    560564        u_char                  ic_chan_scan[roundup(IEEE80211_CHAN_MAX,NBBY)]; 
    561         struct sk_buff_head     ic_mgtq;        /* management frame tx q */ 
    562565        u_int32_t               ic_flags;       /* state flags */ 
    563566        u_int32_t               ic_caps;        /* capabilities */ 
     
    596599        struct proc_dir_entry   *ic_proc;       /* /proc/net/wlan%d */ 
    597600#endif 
    598 #ifdef WIRELESS_EXT 
     601#ifdef CONFIG_NET_WIRELESS 
    599602        struct iw_statistics    ic_iwstats;     /* wireless statistics block */ 
    600603#endif 
    601604}; 
    602 #define IEEE80211_LOCK(_ic)     spin_lock(&(_ic)->ic_lock) 
    603 #define IEEE80211_UNLOCK(_ic)   spin_unlock(&(_ic)->ic_lock) 
     605#define IEEE80211_LOCK(_ic)     spin_lock_irq(&(_ic)->ic_lock) 
     606#define IEEE80211_UNLOCK(_ic)   spin_unlock_irq(&(_ic)->ic_lock) 
    604607 
    605608#define IEEE80211_SEND_MGMT(ic,ni,type,arg)     do {                          \ 
  • cvs-import/trunk/wlan/if_ieee80211subr.c

    r45 r49  
    4444#include <linux/skbuff.h> 
    4545#include <linux/netdevice.h> 
    46 #include <linux/wireless.h> 
    4746#include <linux/random.h> 
    4847 
     
    118117static  void ieee80211_proc_remove(struct ieee80211com *); 
    119118#endif /* CONFIG_PROC_FS */ 
    120 #ifdef WIRELESS_EXT 
     119#ifdef CONFIG_NET_WIRELESS 
    121120extern  struct iw_statistics *ieee80211_iw_getstats(struct net_device *); 
    122121extern  const struct iw_handler_def ieee80211_iw_handler_def; 
     
    148147        dev->get_stats = ieee80211_getstats; 
    149148        dev->do_ioctl = ieee80211_ioctl; 
    150 #ifdef WIRELESS_EXT 
     149#ifdef CONFIG_NET_WIRELESS 
    151150        dev->get_wireless_stats = ieee80211_iw_getstats; 
    152151        dev->wireless_handlers =  
    153152                (struct iw_handler_def *) &ieee80211_iw_handler_def; 
    154 #endif /* WIRELESS_EXT */ 
     153#endif /* CONFIG_NET_WIRELESS */ 
    155154        if (register_netdev(&ic->ic_dev)) { 
    156155                printk(KERN_WARNING "%s: unable to register device\n", 
     
    250249                ic->ic_lintval = 100;           /* default sleep */ 
    251250        TAILQ_INIT(&ic->ic_node); 
    252         skb_queue_head_init(&ic->ic_mgtq); 
    253251 
    254252        /* initialize management frame handlers */ 
     
    307305        IEEE80211_LOCK(ic); 
    308306        del_timer(&ic->ic_slowtimo); 
    309         skb_queue_purge(&ic->ic_mgtq); 
    310307        if (ic->ic_wep_ctx != NULL) { 
    311308                kfree(ic->ic_wep_ctx); 
     
    326323 * Once a second "slow timeout" a la the BSD ifnet timer. 
    327324 */ 
    328 static void 
     325void 
    329326ieee80211_slowtimo(unsigned long arg) 
    330327{ 
    331328        struct ieee80211com *ic = (struct ieee80211com *) arg; 
    332329 
    333         IEEE80211_LOCK(ic); 
    334330        if (ic->ic_timer && --ic->ic_timer == 0) 
    335331                if (ic->ic_watchdog) 
    336332                        (*ic->ic_watchdog)(&ic->ic_dev); 
     333 
    337334        ic->ic_slowtimo.expires = jiffies + HZ;         /* once a second */ 
    338335        add_timer(&ic->ic_slowtimo); 
    339         IEEE80211_UNLOCK(ic); 
    340336} 
    341337 
     
    809805                            ieee80211_chan2ieee(ic, ni->ni_chan)); 
    810806        } 
    811         skb_queue_tail(&ic->ic_mgtq, skb); 
    812807        ic->ic_timer = 1; 
    813         (*ic->ic_start)(dev); 
     808        (void) (*ic->ic_mgtstart)(skb, dev); 
    814809        return 0; 
    815810} 
     
    10301025{ 
    10311026        struct ieee80211com *ic = (void *)dev; 
    1032         struct ieee80211_node *ni, *nextbs; 
    10331027 
    10341028        if (ic->ic_mgt_timer) { 
     
    10381032        if (ic->ic_inact_timer) { 
    10391033                if (--ic->ic_inact_timer == 0) { 
     1034                        struct ieee80211_node *ni, *nextbs; 
     1035 
    10401036                        for (ni = TAILQ_FIRST(&ic->ic_node); ni != NULL; ) { 
    10411037                                if (++ni->ni_inact <= IEEE80211_INACT_MAX) { 
     
    23202316                case IEEE80211_S_SCAN: 
    23212317                        ic->ic_mgt_timer = 0; 
    2322                         skb_queue_purge(&ic->ic_mgtq); 
    23232318                        if (ic->ic_wep_ctx != NULL) { 
    23242319                                kfree(ic->ic_wep_ctx); 
     
    24582453                        ic->ic_bss.ni_txrate = ic->ic_bss.ni_nrate - 1; 
    24592454                        ic->ic_mgt_timer = 0; 
    2460                         (*ic->ic_start)(dev); 
    2461                         break; 
    2462                 } 
    2463                 break; 
    2464         } 
     2455                        break; 
     2456                } 
     2457                break; 
     2458        } 
     2459        /* 
     2460         * Start/stop xmit queue. 
     2461         */ 
     2462        if (nstate == IEEE80211_S_RUN) 
     2463                netif_start_queue(dev);         /* XXX netif_wake_queue? */ 
     2464        else if (ostate == IEEE80211_S_RUN) 
     2465                netif_stop_queue(dev); 
    24652466        return 0; 
    24662467}