SunQuest
           Networking Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationNetworking Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 15th, 2004, 05:15 AM
Custer Custer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 Custer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ioctl() and wlan pcmcia

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.
On the other hand, iwpriv returnes "no private ioctls". Does that meen I have to get a new driver for my Linksys WPC11 ver. 3 - I'm using the standard driver in suse 9.0 (kernel 2.4.21-144)?


\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 With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationNetworking Help > Ioctl() and wlan pcmcia


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway