OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help/Hints: API for accessing WLAN card directly on Zaurus?
dhns
post Mar 6 2004, 10:31 AM
Post #1





Group: Members
Posts: 699
Joined: 26-February 04
From: near Munich, Germany
Member No.: 2,043



I am searchin for any documentation on how to programmatically (C language) access the WLAN card to enable/disable, to read the list of networks, to select one, to specify the WEP key, to initiate an Ad-Hoc network, etc.

Now, I have found out that apparently the Zaurus uses a kernel extension to allow to access the WLAN card by a standardized way. It seems to be http://www.linux-wlan.com/linux-wlan/index.html

Is this correct? And where is the documentation of the API?

And then, there is Kismet using some ioctl calls to get/set the ESS-ID. Is there an API description available?

For the Camera, there is a PDF document from Sharp describing how to open() the decive and use read() and write() calls to set the modes and get the captured JPEGs. Is there something similar for the Zaurus?

And finally, it should be a method that is independent of the WLAN card (as long as it works with the original Sharp ROM 3.1x). Therefore, Wellenreiter does not seem to be the right starting point.

Any hints are very welcome!

--- Nikolaus hns@computer.org
Go to the top of the page
 
+Quote Post
dhns
post Mar 7 2004, 02:06 AM
Post #2





Group: Members
Posts: 699
Joined: 26-February 04
From: near Munich, Germany
Member No.: 2,043



Hi all,

By looking deeper into the Kismet Sources I have found that there is a header file linux/wireless.h using ioctl() - but no clear API description.

A rather general description of the wireless kernel extension is found at http://www.hpl.hp.com/personal/Jean_Tourri...Extensions.html

-- hns
Go to the top of the page
 
+Quote Post
dhns
post Mar 7 2004, 02:23 AM
Post #3





Group: Members
Posts: 699
Joined: 26-February 04
From: near Munich, Germany
Member No.: 2,043



Now, I have studied these documents and the iwconfig command (which is on the ROM 3.10) shows the card as eth0:

# iwconfig
lo no wireless extensions.
irda0 no wireless extensions.
usbd0 no wireless extensions.
eth0 no wireless extensions.

but with my SanDisk WLAN card, it doesn't find a wireless extension for eth0. When I unmount the card, the eth0 disappears so the interfaces list is correct.

But the card works when being configured through Qt. Any hints about the specific system interface used by Qt?

-- hns
SL-5500G, ROM 3.10, SanDisk WLAN, Pretec 256MB, PowerBook G4
Go to the top of the page
 
+Quote Post
Mickeyl
post Mar 7 2004, 05:13 AM
Post #4





Group: Members
Posts: 1,497
Joined: 12-November 03
From: Germany
Member No.: 907



QUOTE
I am searchin for any documentation on how to programmatically (C language) access the WLAN card to enable/disable, to read the list of networks, to select one, to specify the WEP key, to initiate an Ad-Hoc network, etc.

This is done via the ioctl interface. The full API reference is contained in <linux/wireless.h> - it may be a bit sparse but with experimenting and looking at the source code of the wireless tools you'll learn everything.
QUOTE
Now, I have found out that apparently the Zaurus uses a kernel extension to allow to access the WLAN card by a standardized way. It seems to be http://www.linux-wlan.com/linux-wlan/index.html

Ugh. Don't use wlan-ng - it uses a horribly bloated and non-standardized API. Stick with the Linux standard wireless extensions.

QUOTE
And then, there is Kismet using some ioctl calls to get/set the ESS-ID. Is there an API description available?

See linux/wireless.h. To set and get SSIDs use the ioctl SIOCGIWSSID and SIOGSIWSSID.

QUOTE
And finally, it should be a method that is independent of the WLAN card (as long as it works with the original Sharp ROM 3.1x). Therefore, Wellenreiter does not seem to be the right starting point.


To get the facts straight - the Sharp ROM is the one which is NOT using the standard. The Wellenreiter author doesn't support this attitude which is why you need a patched kernel for that.
Trust me, the wireless extensions _are_ the standard method for device independent wlan operations.
Go to the top of the page
 
+Quote Post
dhns
post Mar 7 2004, 10:04 AM
Post #5





Group: Members
Posts: 699
Joined: 26-February 04
From: near Munich, Germany
Member No.: 2,043



QUOTE
See linux/wireless.h. To set and get SSIDs use the ioctl SIOCGIWSSID and SIOGSIWSSID. 

To get the facts straight - the Sharp ROM is the one which is NOT using the standard. 
Trust me, the wireless extensions _are_ the standard method for device independent wlan operations.

Many thanks!

I have looked into linux/wireless.h and created some test code but on Sharp ROM 3.10 I get

CODE
ioctl(SIOCGIWESSID) failed (No such device)


When running iwconfig, all devices incl. my (Sandisk) WLAN eth0 are detected as "no wireless extension".

So, the question remains: how is Qtopia doing that? Which system calls are they using on ROM 3.10?

-- hns
Go to the top of the page
 
+Quote Post
Mickeyl
post Mar 7 2004, 10:07 AM
Post #6





Group: Members
Posts: 1,497
Joined: 12-November 03
From: Germany
Member No.: 907



Qtopia does it either by calling the wlan-ng-ctl command line utility or by editing wireless.opts and ejecting+reinserting the card.
Go to the top of the page
 
+Quote Post
dhns
post Mar 9 2004, 12:07 PM
Post #7





Group: Members
Posts: 699
Joined: 26-February 04
From: near Munich, Germany
Member No.: 2,043



QUOTE
Qtopia does it either by calling the wlan-ng-ctl command line utility

That's a good hint. I'll try to do the same. It abstracts a lot from specific system calls and might be a little more independent of ROM versions.
Go to the top of the page
 
+Quote Post
dhns
post Mar 10 2004, 11:48 AM
Post #8





Group: Members
Posts: 699
Joined: 26-February 04
From: near Munich, Germany
Member No.: 2,043



Ok, latest findings - for reference purposes (we shoud move this to the HowTo Wiki):

1. The standard Zaurus ROM 3.10 comes with two different driver models
a) wlanctl-ng (mostly for the Prism chipset cards)
cool.gif iwconfig (for others)

2. all WLAN scripts are in /home/etc/pcmcia
wlan-ng for wlanctl-ng
wlan-ng.conf
wlan-ng.opts
wireless for iwconfig
wireless.opts

3. /etc/wlan exists, but contains only one file ("shared") which appears not to be used
There are no /etc/wlan/wlancfg-ssid files

4. The WLAN card is the Interface "eth0"

5. The Network settings tool is /home/QtPalmtop/bin/netsetup

6. When Connecting to the network:
/sbin/cardctl is called

and

./wlan-ng start eth0

triggering ./network start eth0 and /sbin/dhcpcd eth0

7. The settings are stored by modifying the files
network.opts - BOOTP, DHCP, DNS, IP address, etc.
wlan-ng.opts - SSID, WEP-Key, ...

A scheme name is used to separate several different settings. It is the same in both .opts files.

8. When wlan-ng startup succeds, the DNS entries from network.opts are added to /etc/resolv.conf

----

So to write an applications that controls the WLAN device:

read network.opts and wlan-ng.opts to get the existing cards and drivers
let the user modify
update network.opts and wlan-ng.opts as required
call

/sbin/cardctl scheme <name-of-scheme-in-.opt-files>

-- hns
[/code]
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th October 2014 - 04:39 PM