author | max <max> | 2003-02-07 17:17:35 (UTC) |
---|---|---|
committer | max <max> | 2003-02-07 17:17:35 (UTC) |
commit | 014608882b23343473c5d0e7dca3ea09cf02dcfb (patch) (unidiff) | |
tree | 90eac99cbb0faca581cc9b5cc37a9fd460548050 /noncore/net/wellenreiter/libwellenreiter/source | |
parent | a14c5974339f5beef433754d52c952cb99834619 (diff) | |
download | opie-014608882b23343473c5d0e7dca3ea09cf02dcfb.zip opie-014608882b23343473c5d0e7dca3ea09cf02dcfb.tar.gz opie-014608882b23343473c5d0e7dca3ea09cf02dcfb.tar.bz2 |
Chanswitch
Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc index 697d182..0c23922 100644 --- a/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc +++ b/noncore/net/wellenreiter/libwellenreiter/source/cardmode.cc | |||
@@ -70,12 +70,16 @@ int card_into_monitormode (pcap_t **orighandle, char *device, int cardtype) | |||
70 | snprintf(lucentcmd, sizeof(lucentcmd) - 1, "$(which iwpriv) %s monitor 2 %d", device, 1); | 70 | snprintf(lucentcmd, sizeof(lucentcmd) - 1, "$(which iwpriv) %s monitor 2 %d", device, 1); |
71 | if (system(lucentcmd) != 0) | 71 | if (system(lucentcmd) != 0) |
72 | { | 72 | { |
73 | wl_logerr("Could not set %s in raw mode, check cardtype", device); | 73 | wl_logerr("Could not set %s in raw mode, check cardtype", device); |
74 | return 0; | 74 | return 0; |
75 | } | 75 | } |
76 | else | ||
77 | { | ||
78 | wl_loginfo("Successfully set %s into raw mode",device); | ||
79 | } | ||
76 | } | 80 | } |
77 | 81 | ||
78 | /* Setting the promiscous and up flag to the interface */ | 82 | /* Setting the promiscous and up flag to the interface */ |
79 | if (!card_check_rfmon_datalink(device)) | 83 | if (!card_check_rfmon_datalink(device)) |
80 | { | 84 | { |
81 | wl_logerr("Cannot set interface to rfmon mode"); | 85 | wl_logerr("Cannot set interface to rfmon mode"); |
@@ -153,35 +157,36 @@ int card_set_promisc_up (const char *device) | |||
153 | } | 157 | } |
154 | } | 158 | } |
155 | 159 | ||
156 | /* Set channel (Wireless frequency) of the device */ | 160 | /* Set channel (Wireless frequency) of the device */ |
157 | int card_set_channel (const char *device, int channel, int cardtype) | 161 | int card_set_channel (const char *device, int channel, int cardtype) |
158 | { | 162 | { |
159 | |||
160 | if (cardtype == CARD_TYPE_CISCO) | 163 | if (cardtype == CARD_TYPE_CISCO) |
161 | { | 164 | { |
162 | /* Cisco cards don't need channelswitching */ | 165 | /* Cisco cards don't need channelswitching */ |
163 | return 1; | 166 | return 1; |
164 | } | 167 | } |
165 | /* If it is a lucent orinocco card */ | 168 | /* If it is a lucent orinocco card */ |
166 | else if (cardtype == CARD_TYPE_ORINOCCO) | 169 | else if (cardtype == CARD_TYPE_ORINOCCO) |
167 | { | 170 | { |
168 | char lucentreset[63]; | 171 | char lucentreset[63]; |
169 | char lucentcmd[62]; | 172 | char lucentcmd[62]; |
170 | snprintf(lucentreset, sizeof(lucentreset) -1,"$(which iwpriv) %s card_reset", device); | 173 | snprintf(lucentreset, sizeof(lucentreset) -1,"$(which iwpriv) %s force_reset", device); |
171 | if (system(lucentreset) != 0) | 174 | if (system(lucentreset) != 0) |
172 | { | 175 | { |
173 | wl_logerr("Could not reset the card %s",device); | 176 | wl_logerr("Could not reset the card %s",device); |
174 | return 0; | 177 | return 0; |
175 | } | 178 | } |
176 | snprintf(lucentcmd, sizeof(lucentcmd) - 1, "$(which iwpriv) %s monitor 2 %d", device, channel); | 179 | snprintf(lucentcmd, sizeof(lucentcmd) - 1, "$(which iwpriv) %s monitor 2 %d", device, channel); |
177 | if (system(lucentcmd) != 0) | 180 | if (system(lucentcmd) != 0) |
178 | { | 181 | { |
179 | wl_logerr("Could not set %s in raw mode, check cardtype", device); | 182 | wl_logerr("Could not set %s in raw mode, check cardtype", device); |
180 | return 0; | 183 | return 0; |
181 | } | 184 | } |
185 | wl_loginfo("Channel %d set on interface %s",channel,device); | ||
186 | return 1; | ||
182 | } | 187 | } |
183 | 188 | ||
184 | /* For undefined situations */ | 189 | /* For undefined situations */ |
185 | return 0; | 190 | return 0; |
186 | } | 191 | } |
187 | 192 | ||