* ioctl for b43 driver
@ 2010-05-25 1:02 Huy Le
2010-05-25 1:08 ` Gábor Stefanik
0 siblings, 1 reply; 4+ messages in thread
From: Huy Le @ 2010-05-25 1:02 UTC (permalink / raw)
To: linux-wireless
Hi,
Currently I try aircrack-ng with b43 driver but it is fail at this
statement due to the following statement:
ioctl( fd, SIOCGIWFREQ, &wrq ) < 0
This happens because we do not have ioctl for b43 driver. I just want to
ask if there is any way to work around.
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: ioctl for b43 driver 2010-05-25 1:02 ioctl for b43 driver Huy Le @ 2010-05-25 1:08 ` Gábor Stefanik 2010-05-25 1:26 ` Gábor Stefanik 0 siblings, 1 reply; 4+ messages in thread From: Gábor Stefanik @ 2010-05-25 1:08 UTC (permalink / raw) To: Huy Le; +Cc: linux-wireless On Tue, May 25, 2010 at 3:02 AM, Huy Le <lehuy0406@gmail.com> wrote: > Hi, > > Currently I try aircrack-ng with b43 driver but it is fail at this statement > due to the following statement: > > ioctl( fd, SIOCGIWFREQ, &wrq ) < 0 > > This happens because we do not have ioctl for b43 driver. I just want to ask > if there is any way to work around. Confirmed with ath9k. Apparently rdev->channel is NULL for monitor interfaces. > > Thanks. > -- > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-) ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ioctl for b43 driver 2010-05-25 1:08 ` Gábor Stefanik @ 2010-05-25 1:26 ` Gábor Stefanik [not found] ` <4BFB36B9.8010706@gmail.com> 0 siblings, 1 reply; 4+ messages in thread From: Gábor Stefanik @ 2010-05-25 1:26 UTC (permalink / raw) To: Huy Le; +Cc: linux-wireless 2010/5/25 Gábor Stefanik <netrolller.3d@gmail.com>: > On Tue, May 25, 2010 at 3:02 AM, Huy Le <lehuy0406@gmail.com> wrote: >> Hi, >> >> Currently I try aircrack-ng with b43 driver but it is fail at this statement >> due to the following statement: >> >> ioctl( fd, SIOCGIWFREQ, &wrq ) < 0 >> >> This happens because we do not have ioctl for b43 driver. I just want to ask >> if there is any way to work around. > > Confirmed with ath9k. Apparently rdev->channel is NULL for monitor interfaces. I meant wdev->channel - it got changed recently. > >> >> Thanks. >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > > > > -- > Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-) > -- Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-) ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <4BFB36B9.8010706@gmail.com>]
* Re: ioctl for b43 driver [not found] ` <4BFB36B9.8010706@gmail.com> @ 2010-05-25 2:42 ` Gábor Stefanik 0 siblings, 0 replies; 4+ messages in thread From: Gábor Stefanik @ 2010-05-25 2:42 UTC (permalink / raw) To: Huy Le; +Cc: linux-wireless [-- Attachment #1: Type: text/plain, Size: 2094 bytes --] 2010/5/25 Huy Le <lehuy0406@gmail.com>: > On 05/24/2010 06:26 PM, Gábor Stefanik wrote: > > 2010/5/25 Gábor Stefanik <netrolller.3d@gmail.com>: > > > On Tue, May 25, 2010 at 3:02 AM, Huy Le <lehuy0406@gmail.com> wrote: > > > Hi, > > Currently I try aircrack-ng with b43 driver but it is fail at this statement > due to the following statement: > > ioctl( fd, SIOCGIWFREQ, &wrq ) < 0 > > This happens because we do not have ioctl for b43 driver. I just want to ask > if there is any way to work around. > > > Confirmed with ath9k. Apparently rdev->channel is NULL for monitor > interfaces. > > > I meant wdev->channel - it got changed recently. > > > > > > Thanks. > -- > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > > -- > Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-) > > > > > > Thanks for your respond. However, I can't get what you meant. I am trying > aircrack-ng and I found in the source of aircrack-ng that they call ioctl( > fd, SIOCGIWFREQ, &wrq ). But the driver of b43 doesn't support ioctl, so > this call is failed. Is there any solution for me? My wireless card is > BCM4312 [14e4:4315] > > Thanks. > Well, b43 supports ioctls using cfg80211, at least if cfg80211 wext compat support is enabled in the kernel configuration. The problem is something else - since the change from rdev->channel to wdev->channel, monitor interfaces do not have a valid channel pointer in either rdev or wdev. The same problem exists on ath9k and ath5k, and probably anything that uses mac80211. Attached is a C source for a test app that shows whether SIOCGIWFREQ completes successfully. Compile it using "gcc iwfreqtest.c -o iwfreqtest", the run as "iwfreqtest <name of interface>". It seems to consistently fail on monitor interfaces, and succeed on anything else. -- Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-) [-- Attachment #2: iwfreqtest.c --] [-- Type: application/octet-stream, Size: 999 bytes --] #include <sys/socket.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/time.h> #include <sys/stat.h> #include <netpacket/packet.h> #include <linux/if_ether.h> #include <linux/if.h> #include <linux/wireless.h> #include <netinet/in.h> #include <linux/if_tun.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <dirent.h> #include <sys/utsname.h> int main(int argc, char *argv[]) { int fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); struct iwreq wrq; int ret; if (fd < 0) { printf("Unable to open socket!\n"); return -1; } memset(&wrq, 0, sizeof(struct iwreq)); if (argc > 1) strncpy(wrq.ifr_name, argv[1], IFNAMSIZ); else strncpy(wrq.ifr_name, "mon0", IFNAMSIZ); ret = ioctl(fd, SIOCGIWFREQ, &wrq); printf("SIOCGIWFREQ returned %d with status code %d/%d\n", wrq.u.freq.m, ret, errno); close(fd); return 0; } ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-25 2:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25 1:02 ioctl for b43 driver Huy Le
2010-05-25 1:08 ` Gábor Stefanik
2010-05-25 1:26 ` Gábor Stefanik
[not found] ` <4BFB36B9.8010706@gmail.com>
2010-05-25 2:42 ` Gábor Stefanik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox