Project : madwifi
Revision : 2753
Author : benoit
Date : 2007-10-16 23:46:05 +0200 (Tue, 16 Oct 2007)
Log Message :
Code refactoring. Use new macros. No functionnal change
Affected Files:
* madwifi/branches/madwifi-dfs/net80211/ieee80211.c updated
Modified: madwifi/branches/madwifi-dfs/net80211/ieee80211.c
===================================================================
--- madwifi/branches/madwifi-dfs/net80211/ieee80211.c 2007-10-16 21:43:24 UTC
(rev 2752)
+++ madwifi/branches/madwifi-dfs/net80211/ieee80211.c 2007-10-16 21:46:05 UTC
(rev 2753)
@@ -788,10 +788,10 @@
struct ieee80211vap *vap;
/* Get an AP mode VAP */
- vap = TAILQ_FIRST(&ic->ic_vaps);
- while ((vap != NULL) && (vap->iv_state != IEEE80211_S_RUN) &&
- (vap->iv_ic != ic)) {
- vap = TAILQ_NEXT(vap, iv_next);
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+ if (vap->iv_state == IEEE80211_S_RUN) {
+ break;
+ }
}
if (vap == NULL) {
@@ -799,16 +799,18 @@
* No running VAP was found, check
* if any one is scanning.
*/
- vap = TAILQ_FIRST(&ic->ic_vaps);
- while ((vap != NULL) && (vap->iv_state != IEEE80211_S_SCAN) &&
- (vap->iv_ic != ic)) {
- vap = TAILQ_NEXT(vap, iv_next);
+
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
+ if (vap->iv_state == IEEE80211_S_SCAN) {
+ break;
+ }
}
+
/*
* No running/scanning VAP was found, so they're all in
* INIT state, no channel change needed
*/
- if (!vap)
+ if (vap==NULL)
return;
/* Is it really Scanning */
/* XXX: Race condition? */
@@ -869,8 +871,7 @@
do_gettimeofday(&tv);
if_printf(dev, "Radar found on channel %d (%d MHz) -- Time:
%ld.%06ld\n", ichan->ic_ieee, ichan->ic_freq, tv.tv_sec, tv.tv_usec);
- if (ic->ic_opmode == IEEE80211_M_HOSTAP ||
- ic->ic_opmode == IEEE80211_M_IBSS ) {
+ if (IEEE80211_IS_MODE_DFS_MASTER(ic->ic_opmode)) {
/* Mark the channel in the ic_chan list */
if (ic->ic_flags_ext & IEEE80211_FEXT_MARKDFS) {
if_printf(dev, "Marking channel %d (%d MHz) in ic_chan
list -- Time: %ld.%06ld\n", ichan->ic_ieee, ichan->ic_freq, tv.tv_sec,
tv.tv_usec);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
|