From 8072f9767faaf606c5bb0c6dd936ff895a9d189c Mon Sep 17 00:00:00 2001 From: max Date: Wed, 12 Feb 2003 01:05:29 +0000 Subject: MAXCHANNEL dynamic detection --- diff --git a/noncore/net/wellenreiter/daemon/source/daemon.cc b/noncore/net/wellenreiter/daemon/source/daemon.cc index 46a50ed..d77d987 100644 --- a/noncore/net/wellenreiter/daemon/source/daemon.cc +++ b/noncore/net/wellenreiter/daemon/source/daemon.cc @@ -166,11 +166,20 @@ void * channel_switcher(void *cardtypeptr) { wl_cardtype_t *cardtype; + int maxchan=0; int channel=1; - /* Get card info struct */ cardtype = (wl_cardtype_t *)cardtypeptr; - + /* Get from the wireless extension the amount of available channels + this prevents a fail in switching on us cards */ + maxchan = card_detect_channels(cardtype->iface); + + if (maxchan < MAXCHANNEL) + { + #undef MAXCHANNEL + #define MAXCHANNEL maxchan + } + while(1) { -- cgit v0.9.0.2