mirror of https://github.com/proski/madwifi
Avoid kernel panic and returns 802.11b.
Merge from branches/madwifi-dfs@3649 git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@4078 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
parent
8c022a1869
commit
d7126f8393
|
@ -1578,11 +1578,19 @@ enum ieee80211_phymode
|
|||
ieee80211_chan2mode(const struct ieee80211_channel *chan)
|
||||
{
|
||||
/*
|
||||
* Callers should handle this case properly, rather than
|
||||
* just relying that this function returns a sane value.
|
||||
* XXX: Probably needs to be revised.
|
||||
* Callers should handle this case properly, rather than just relying
|
||||
* that this function returns a sane value. XXX: Probably needs to be
|
||||
* revised. chan is undefined if channel is 0 for instance and kernel
|
||||
* panic would happen when called by ieee80211_sta_join1() in IBSS
|
||||
* mode.
|
||||
*/
|
||||
KASSERT(chan != IEEE80211_CHAN_ANYC, ("channel not setup"));
|
||||
|
||||
if (chan == NULL ||
|
||||
chan == IEEE80211_CHAN_ANYC) {
|
||||
printk(KERN_ERR "%s: BUG channel not setup: %p\n",
|
||||
__func__, chan);
|
||||
return IEEE80211_MODE_11B;
|
||||
}
|
||||
|
||||
if (IEEE80211_IS_CHAN_108G(chan))
|
||||
return IEEE80211_MODE_TURBO_G;
|
||||
|
|
Loading…
Reference in New Issue