summaryrefslogtreecommitdiff
authormax <max>2003-02-12 01:05:29 (UTC)
committer max <max>2003-02-12 01:05:29 (UTC)
commit8072f9767faaf606c5bb0c6dd936ff895a9d189c (patch) (unidiff)
tree7861b276122d12d94c814c808b7352b85ac10fcb
parentc7fe028f53eb676c9ce619840c0d0a4603a9301f (diff)
downloadopie-8072f9767faaf606c5bb0c6dd936ff895a9d189c.zip
opie-8072f9767faaf606c5bb0c6dd936ff895a9d189c.tar.gz
opie-8072f9767faaf606c5bb0c6dd936ff895a9d189c.tar.bz2
MAXCHANNEL dynamic detection
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/daemon/source/daemon.cc13
1 files changed, 11 insertions, 2 deletions
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
@@ -161,21 +161,30 @@ usage(void)
161 "\t\t\t\tLUCENT\t= 4\n"); 161 "\t\t\t\tLUCENT\t= 4\n");
162 exit(EXIT_FAILURE); 162 exit(EXIT_FAILURE);
163} 163}
164 164
165void * 165void *
166channel_switcher(void *cardtypeptr) 166channel_switcher(void *cardtypeptr)
167{ 167{
168 wl_cardtype_t *cardtype; 168 wl_cardtype_t *cardtype;
169 int maxchan=0;
169 int channel=1; 170 int channel=1;
170
171 /* Get card info struct */ 171 /* Get card info struct */
172 cardtype = (wl_cardtype_t *)cardtypeptr; 172 cardtype = (wl_cardtype_t *)cardtypeptr;
173 173 /* Get from the wireless extension the amount of available channels
174 this prevents a fail in switching on us cards */
175 maxchan = card_detect_channels(cardtype->iface);
176
177 if (maxchan < MAXCHANNEL)
178 {
179 #undef MAXCHANNEL
180 #define MAXCHANNEL maxchan
181 }
182
174 while(1) 183 while(1)
175 { 184 {
176 185
177 /* If channel bigger than maxchannel, set to 1 */ 186 /* If channel bigger than maxchannel, set to 1 */
178 if(channel > MAXCHANNEL) 187 if(channel > MAXCHANNEL)
179 channel=1; 188 channel=1;
180 189
181 /* Set channel */ 190 /* Set channel */