Changeset 49
- Timestamp:
- 03/15/03 19:32:07 (6 years ago)
- Files:
-
- cvs-import/trunk/wlan/if_ieee80211.h (modified) (4 diffs)
- cvs-import/trunk/wlan/if_ieee80211subr.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cvs-import/trunk/wlan/if_ieee80211.h
r45 r49 40 40 #include <sys/queue.h> 41 41 #include "if_media.h" 42 #ifdef CONFIG_NET_WIRELESS 43 #include <linux/wireless.h> 44 #endif 42 45 43 46 #define IEEE80211_ADDR_LEN 6 … … 543 546 struct timer_list ic_slowtimo; /* if watchdog timer */ 544 547 void (*ic_watchdog)(struct net_device *); 545 void (*ic_start)(struct net_device *); 548 int (*ic_mgtstart)(struct sk_buff *, 549 struct net_device *); 546 550 int (*ic_init)(struct net_device *); 547 551 void (*ic_recv_mgmt[16])(struct ieee80211com *, … … 559 563 u_char ic_chan_active[roundup(IEEE80211_CHAN_MAX, NBBY)]; 560 564 u_char ic_chan_scan[roundup(IEEE80211_CHAN_MAX,NBBY)]; 561 struct sk_buff_head ic_mgtq; /* management frame tx q */562 565 u_int32_t ic_flags; /* state flags */ 563 566 u_int32_t ic_caps; /* capabilities */ … … 596 599 struct proc_dir_entry *ic_proc; /* /proc/net/wlan%d */ 597 600 #endif 598 #ifdef WIRELESS_EXT601 #ifdef CONFIG_NET_WIRELESS 599 602 struct iw_statistics ic_iwstats; /* wireless statistics block */ 600 603 #endif 601 604 }; 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) 604 607 605 608 #define IEEE80211_SEND_MGMT(ic,ni,type,arg) do { \ cvs-import/trunk/wlan/if_ieee80211subr.c
r45 r49 44 44 #include <linux/skbuff.h> 45 45 #include <linux/netdevice.h> 46 #include <linux/wireless.h>47 46 #include <linux/random.h> 48 47 … … 118 117 static void ieee80211_proc_remove(struct ieee80211com *); 119 118 #endif /* CONFIG_PROC_FS */ 120 #ifdef WIRELESS_EXT119 #ifdef CONFIG_NET_WIRELESS 121 120 extern struct iw_statistics *ieee80211_iw_getstats(struct net_device *); 122 121 extern const struct iw_handler_def ieee80211_iw_handler_def; … … 148 147 dev->get_stats = ieee80211_getstats; 149 148 dev->do_ioctl = ieee80211_ioctl; 150 #ifdef WIRELESS_EXT149 #ifdef CONFIG_NET_WIRELESS 151 150 dev->get_wireless_stats = ieee80211_iw_getstats; 152 151 dev->wireless_handlers = 153 152 (struct iw_handler_def *) &ieee80211_iw_handler_def; 154 #endif /* WIRELESS_EXT*/153 #endif /* CONFIG_NET_WIRELESS */ 155 154 if (register_netdev(&ic->ic_dev)) { 156 155 printk(KERN_WARNING "%s: unable to register device\n", … … 250 249 ic->ic_lintval = 100; /* default sleep */ 251 250 TAILQ_INIT(&ic->ic_node); 252 skb_queue_head_init(&ic->ic_mgtq);253 251 254 252 /* initialize management frame handlers */ … … 307 305 IEEE80211_LOCK(ic); 308 306 del_timer(&ic->ic_slowtimo); 309 skb_queue_purge(&ic->ic_mgtq);310 307 if (ic->ic_wep_ctx != NULL) { 311 308 kfree(ic->ic_wep_ctx); … … 326 323 * Once a second "slow timeout" a la the BSD ifnet timer. 327 324 */ 328 staticvoid325 void 329 326 ieee80211_slowtimo(unsigned long arg) 330 327 { 331 328 struct ieee80211com *ic = (struct ieee80211com *) arg; 332 329 333 IEEE80211_LOCK(ic);334 330 if (ic->ic_timer && --ic->ic_timer == 0) 335 331 if (ic->ic_watchdog) 336 332 (*ic->ic_watchdog)(&ic->ic_dev); 333 337 334 ic->ic_slowtimo.expires = jiffies + HZ; /* once a second */ 338 335 add_timer(&ic->ic_slowtimo); 339 IEEE80211_UNLOCK(ic);340 336 } 341 337 … … 809 805 ieee80211_chan2ieee(ic, ni->ni_chan)); 810 806 } 811 skb_queue_tail(&ic->ic_mgtq, skb);812 807 ic->ic_timer = 1; 813 ( *ic->ic_start)(dev);808 (void) (*ic->ic_mgtstart)(skb, dev); 814 809 return 0; 815 810 } … … 1030 1025 { 1031 1026 struct ieee80211com *ic = (void *)dev; 1032 struct ieee80211_node *ni, *nextbs;1033 1027 1034 1028 if (ic->ic_mgt_timer) { … … 1038 1032 if (ic->ic_inact_timer) { 1039 1033 if (--ic->ic_inact_timer == 0) { 1034 struct ieee80211_node *ni, *nextbs; 1035 1040 1036 for (ni = TAILQ_FIRST(&ic->ic_node); ni != NULL; ) { 1041 1037 if (++ni->ni_inact <= IEEE80211_INACT_MAX) { … … 2320 2316 case IEEE80211_S_SCAN: 2321 2317 ic->ic_mgt_timer = 0; 2322 skb_queue_purge(&ic->ic_mgtq);2323 2318 if (ic->ic_wep_ctx != NULL) { 2324 2319 kfree(ic->ic_wep_ctx); … … 2458 2453 ic->ic_bss.ni_txrate = ic->ic_bss.ni_nrate - 1; 2459 2454 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); 2465 2466 return 0; 2466 2467 }
