summaryrefslogtreecommitdiff
authormax <max>2003-02-11 00:29:37 (UTC)
committer max <max>2003-02-11 00:29:37 (UTC)
commitd426759d470699bd4320b23660f19dae639293d6 (patch) (unidiff)
treee9a0ff886e1b241d920e87ae3115594412a427e3
parent0af800b30845a0d3df8be9db5c11c06fd81386e7 (diff)
downloadopie-d426759d470699bd4320b23660f19dae639293d6.zip
opie-d426759d470699bd4320b23660f19dae639293d6.tar.gz
opie-d426759d470699bd4320b23660f19dae639293d6.tar.bz2
Wlan-ng chanswitch
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc18
1 files changed, 4 insertions, 14 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
index 29dcc75..8c94cb1 100644
--- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
+++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc
@@ -42,14 +42,15 @@ int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype)
42 fputs ("Mode: y",CISCO_CONFIG_FILE); 42 fputs ("Mode: y",CISCO_CONFIG_FILE);
43 fputs ("XmitPower: 1",CISCO_CONFIG_FILE); 43 fputs ("XmitPower: 1",CISCO_CONFIG_FILE);
44 fclose(CISCO_CONFIG_FILE); 44 fclose(CISCO_CONFIG_FILE);
45 } 45 }
46 else if (cardtype == CARD_TYPE_NG) 46 else if (cardtype == CARD_TYPE_NG)
47 { 47 {
48 char wlanngcmd[62]; 48 char wlanngcmd[80];
49 snprintf(wlanngcmd, sizeof(wlanngcmd) - 1, "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=true", device, 1); 49 snprintf(wlanngcmd, sizeof(wlanngcmd) - 1, "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=true", device, 1);
50 printf ("\n %s",wlanngcmd);
50 if (system(wlanngcmd) != 0) 51 if (system(wlanngcmd) != 0)
51 { 52 {
52 wl_logerr("Could not set %s in raw mode, check cardtype", device); 53 wl_logerr("Could not set %s in raw mode, check cardtype", device);
53 return 0; 54 return 0;
54 } 55 }
55 } 56 }
@@ -158,15 +159,15 @@ int card_set_promisc_up (const char *device)
158 } 159 }
159} 160}
160 161
161/* Set channel (Wireless frequency) of the device */ 162/* Set channel (Wireless frequency) of the device */
162int card_set_channel (const char *device, int channel, int cardtype) 163int card_set_channel (const char *device, int channel, int cardtype)
163{ 164{
164 if (cardtype == CARD_TYPE_CISCO) 165 if (cardtype == CARD_TYPE_CISCO || cardtype == CARD_TYPE_NG)
165 { 166 {
166 /* Cisco cards don't need channelswitching */ 167 /* Cisco and wlan-ng drivers don't need channelswitching */
167 return 1; 168 return 1;
168 } 169 }
169 /* If it is a lucent orinocco card */ 170 /* If it is a lucent orinocco card */
170 else if (cardtype == CARD_TYPE_ORINOCCO || cardtype == CARD_TYPE_HOSTAP) 171 else if (cardtype == CARD_TYPE_ORINOCCO || cardtype == CARD_TYPE_HOSTAP)
171 { 172 {
172 int fd; 173 int fd;
@@ -196,21 +197,10 @@ int card_set_channel (const char *device, int channel, int cardtype)
196 /* iocall does not work */ 197 /* iocall does not work */
197 close(fd); 198 close(fd);
198 wl_logerr("Could not set channel %d on %s, check cardtype",channel, device); 199 wl_logerr("Could not set channel %d on %s, check cardtype",channel, device);
199 return 0; 200 return 0;
200 } 201 }
201 } 202 }
202 else if (cardtype == CARD_TYPE_NG)
203 {
204 char wlanngcmd[62];
205 snprintf(wlanngcmd, sizeof(wlanngcmd) - 1, "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=true", device, channel);
206 if (system(wlanngcmd) != 0)
207 {
208 wl_logerr("Could not set channel %d on %s, check cardtype",channel, device);
209 return 0;
210 }
211
212 }
213 /* For undefined situations */ 203 /* For undefined situations */
214 return 0; 204 return 0;
215} 205}
216 206