/* * Copyright (c) 2012 Neratec Solutions AG * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/** * get_dfs_domain_radar_types() - get radar types for a given DFS domain * @region: regulatory DFS region * * Return value: radar_types ptr on success, NULL if DFS domain is not supported
*/ staticconststruct radar_types *
get_dfs_domain_radar_types(enum nl80211_dfs_regions region)
{
u32 i; for (i = 0; i < ARRAY_SIZE(dfs_domains); i++) { if (dfs_domains[i]->region == region) return dfs_domains[i];
} return NULL;
}
/** * struct channel_detector - detector elements for a DFS channel * @head: list_head * @freq: frequency for this channel detector in MHz * @detectors: array of dynamically created detector elements for this freq * * Channel detectors are required to provide multi-channel DFS detection, e.g. * to support off-channel scanning. A pattern detector has a list of channels * radar pulses have been reported for in the past.
*/ struct channel_detector { struct list_head head;
u16 freq; struct pri_detector *detectors[];
};
/* channel_detector_reset() - reset detector lines for a given channel */ staticvoid channel_detector_reset(struct dfs_pattern_detector *dpd, struct channel_detector *cd)
{
u32 i; if (cd == NULL) return; for (i = 0; i < dpd->num_radar_types; i++)
cd->detectors[i]->reset(cd->detectors[i], dpd->last_pulse_ts);
}
/* * pulses received for a non-supported or un-initialized * domain are treated as detected radars for fail-safety
*/ if (dpd->region == NL80211_DFS_UNSET) returntrue;
cd = channel_detector_get(dpd, event->freq); if (cd == NULL) returnfalse;
/* reset detector on time stamp wraparound, caused by TSF reset */ if (event->ts < dpd->last_pulse_ts)
dpd_reset(dpd);
dpd->last_pulse_ts = event->ts;
/* do type individual pattern matching */ for (i = 0; i < dpd->num_radar_types; i++) { struct pri_detector *pd = cd->detectors[i]; struct pri_sequence *ps = pd->add_pulse(pd, event); if (ps != NULL) { if (rs != NULL)
memcpy(rs, pd->rs, sizeof(*rs));
ath_dbg(dpd->common, DFS, "DFS: radar found on freq=%d: id=%d, pri=%d, " "count=%d, count_false=%d\n",
event->freq, pd->rs->type_id,
ps->pri, ps->count, ps->count_falses);
pd->reset(pd, dpd->last_pulse_ts); returntrue;
}
} returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.