LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 02-16-2004, 12:47 PM   #1
Custer
LQ Newbie
 
Registered: Feb 2004
Posts: 2

Rep: Reputation: 0
Ioctl() call fails


Hi

When I'm trying to use an ioctl()-call with a definition of the wireless extension (eg. SIOCGIWSTATS or SIOCGIWESSID) I allways get an errormessage saying "Operation not supported". But an outpout from /proc/net/wireless gives resonable results.
Furthermore, Iwpriv returns a list of private ioctls supported by my wavelan turbo 11Mb silver, so it doesn't seemt to be a driver problem?!

Anyone got an Idea what the pb is? Below is the code I use for testing.
\Henrik

//------------------ CODE ----------------------//
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <sys/ioctl.h>

struct iw_statistics stats;
static int skfd = 0;

int wlanStats()
{
struct iwreq wrq;
if(skfd == 0) {
if((skfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
perror("socket");
return -1;
}
}

wrq.u.data.pointer = (caddr_t) &stats;
wrq.u.data.length = 0;
wrq.u.data.flags = 1;
strncpy(wrq.ifr_name, "eth0", 16);

if(ioctl(skfd, SIOCGIWSTATS, &wrq) < 0) {
perror("iotcl call");
return -1;
}
return 0;
}

main() {
wlanStats();

}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wvdial failing on ioctl call as regular user mugwump84 Linux - Software 3 11-27-2005 01:01 PM
dm driver ioctl call tantrix Programming 0 05-16-2005 06:50 PM
What do you call your remote control? I call mine... RHLinuxGUY General 19 10-18-2004 06:23 AM
Sockets : Getaddrinfo call fails abrb220 Programming 2 06-06-2004 11:26 PM
Samba 2.2.7a fails to call add user script on Red Hat 9 DrFooMod2 Linux - Networking 4 07-17-2003 09:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 10:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration