|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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(); } |
![]() |
| Viewing: Dev Shed Forums > System Administration > Networking Help > Ioctl() and wlan pcmcia |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|