Card states:
wlandev->open means card is up and running
wlandev->hw_unavailable means either card has been ejected, or card is
not initialized yet.
wlandev->ifup
firmware status needs to be tracked, too (since we should NOT call
firmware commands if it isn't loaded).

About locking:
Read http://www.de.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/index.html to understand what you're supposed to change in the driver how.
This document says that you should always test locking using both CONFIG_SMP
and CONFIG_PREEMPT (to catch problems).
NOTE that you not only need to care about PC-internal locking, but also
about race condition free operation between PC and WLAN card CPU!!
(make sure to alter those and ONLY those state flags at the EXACT place
they're supposed to be altered!)

802.11 power save mode (only used when STA or AP):
Can be configured via ACX100_RID_POWER_MGMT config
(ActivatePowerSaveMode()). This function should probably be moved to
ihw.c, though.
If we configure the card to enter power save mode, the firmware will
send a NULL frame to the AP to inform it about that
(the firmware sends us a failure information message in case NULL frame sending
fails).
The NULL data frame template must have been configured in this case! (we don't seem to do this yet, see acx100_init_packet_templates())
If NULL frame fails, then we're supposed to try to enter power save mode
again.
A STA should configure the NULL data frame and set the power management
options. When ACX is an AP, it should use the BSS specific power
management command instead.

WEP:

  ACX100:
    ACX100_IE_WEP_OPTIONS (0x0007) / ACX100_RID_WEP_OPTIONS_LEN (0x03):
      ACX100-specific cmd. Sets WEP options: cache size, max. key length,
      decrypt options.
  
    ACX100_IE_DOT11_WEP_DEFAULT_KEY_WRITE (0x1007) / ACX100_IE_DOT11_WEP_DEFAULT_KEY_LEN (0x09):
    Dot11 cmd (outdated???).
  
    ACX1xx_IE_DOT11_WEP_DEFAULT_KEY_SET (0x1010) / ACX1xx_IE_DOT11_WEP_DEFAULT_KEY_SET_LEN (0x20):
    Dot11 cmd. add or remove default key, key length, # of default key (0 - 3), key string
  
  ACX111:
    ACX100_CMD_WEP_MGMT (0x0c):
	Sets up the 4 default keys.
	
    ACX1xx_IE_DOT11_WEP_DEFAULT_KEY_SET (0x1010):
        Choose default key to set as current key used for Tx.

WPA:
Sascha Sommer wrote in an email:
----
Hi,

I actually wanted to send a patch for at least find out a bit more about it,
but my laptop broke so I will have to get it repaired first.
Anyway if someone wants to work on this meanwhile:
The key settings (dumped from ndiswrapper) for ie_dot11WEPDefaultKey struct
seem to be

setting key 0, len 32
cmd_type 0x000c, cmd_status 0x0000 [Idle]
action 1 keySize 32 type 11 index 3 defaultKeyNum 0
setting key 2, len 32
cmd_type 0x000c, cmd_status 0x0000 [Idle]
action 1 keySize 32 type 10 index 3 defaultKeyNum 2
setting key 1, len 32
cmd_type 0x000c, cmd_status 0x0000 [Idle]
action 1 keySize 32 type 10 index 3 defaultKeyNum 1

You also need to change the wpa_supplicant supplied key to match the ndis
spec:

                /* wpa_supplicant gives us the Michael MIC RX/TX keys in
                 * different order than NDIS spec, so swap the order here. */
                memcpy(ndis_key.key, key, 16);
                memcpy(ndis_key.key + 16, key + 24, 8);
                memcpy(ndis_key.key + 24, key + 16, 8);

No idea what is need otherwise, apart from writting a wpa_supplicant driver
and fixing the scan ioctl.

Regards,

Sascha
----


Endianness:
Since the card CPU is little-endian, we need to do endianness
conversion on all big-endian architectures.
Conversion involves all places where we're talking to the card
hardware, minus I/O port access (those macros do endianness swapping
themselves already). Use cpu_to_le16() and similar macros for
endianness correction.
