* Virtual STA support
From: Jorge Luis Méndez @ 2009-06-24 16:08 UTC (permalink / raw)
To: linux-wireless
Hi,
I'm looking into support of one physical device to connect to multiple
AP (work as a STA for multiple infrastructure networks). I came across
this Jan'09 post
(http://article.gmane.org/gmane.linux.kernel.wireless.general/27329)
in which it is mentioned that work is being done for ath9k. A few
posts later it is mentioned that for ath5k there was work being done
(http://article.gmane.org/gmane.linux.kernel.wireless.general/27385).
Any updates about this particular feature? Is still being worked on?.
Thank you in advance for any information or pointers provided.
^ permalink raw reply
* rt2500usb bug with latest version
From: Viktor Ilijašić @ 2009-06-24 15:58 UTC (permalink / raw)
To: linux-wireless
Hi all.
When I dl and build the latest version of compat-wireless
(compat-wireless-2009-06-24.tar.bz2) i cannot use my Edimax
EW-7318USg.
Here is a link to the product:
http://www.edimax.com/en/produce_detail.php?pd_id=8&pl1_id=1&pl2_id=44
Here is some info about when it's NOT working... Way down below is
some info when it IS working.
$ uname -a
Linux kinderei 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03
UTC 2009 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 9.04
Release: 9.04
Codename: jaunty
$ sudo lsusb -vv
Bus 001 Device 014: ID 148f:2573 Ralink Technology, Corp. RT2501USB
Wireless Adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x148f Ralink Technology, Corp.
idProduct 0x2573 RT2501USB Wireless Adapter
bcdDevice 0.01
iManufacturer 1 Ralink
iProduct 2 802.11 bg WLAN
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 300mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
$ modinfo rt2500usb
filename:
/lib/modules/2.6.28-11-generic/updates/drivers/net/wireless/rt2x00/rt2500usb.ko
license: GPL
description: Ralink RT2500 USB Wireless LAN driver.
version: 2.3.0
author: http://rt2x00.serialmonkey.com
srcversion: CEDBE01EDCE98BE5C45278B
alias: usb:v5A57p0260d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0F88p3012d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0EB0p9020d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0769p11F3d*dc*dsc*dp*ic*isc*ip*
alias: usb:v114Bp0110d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0707pEE13d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0681p3C06d*dc*dsc*dp*ic*isc*ip*
alias: usb:v079Bp004Bd*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp9020d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp2573d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp2570d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp1706d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6869d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6865d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6861d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p0097d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p008Bd*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p0067d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p0066d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p005Ed*dc*dsc*dp*ic*isc*ip*
alias: usb:v06F8pE000d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1044p8007d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1044p8001d*dc*dsc*dp*ic*isc*ip*
alias: usb:v2001p3C00d*dc*dsc*dp*ic*isc*ip*
alias: usb:v14B2p3C02d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1371p9022d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p001Ad*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p0011d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p000Dd*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp705Ad*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp7051d*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp7050d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0B05p1707d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0B05p1706d*dc*dsc*dp*ic*isc*ip*
depends: rt2x00lib,rt2x00usb
vermagic: 2.6.28-11-generic SMP mod_unload modversions
parm: nohwcrypt:Disable hardware encryption. (bool)
$ modinfo rt73usb
filename:
/lib/modules/2.6.28-11-generic/updates/drivers/net/wireless/rt2x00/rt73usb.ko
license: GPL
firmware: rt73.bin
description: Ralink RT73 USB Wireless LAN driver.
version: 2.3.0
author: http://rt2x00.serialmonkey.com
srcversion: EBA867FCDE5EB3C2521072C
alias: usb:v0586p3415d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0CDEp001Cd*dc*dsc*dp*ic*isc*ip*
alias: usb:v2019pAB50d*dc*dsc*dp*ic*isc*ip*
alias: usb:v2019pAB01d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0471p200Ad*dc*dsc*dp*ic*isc*ip*
alias: usb:v6933p5001d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0769p31F3d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DF6p9712d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DF6p90ACd*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DF6p002Fd*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DF6p0027d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DF6p0024d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1740p7100d*dc*dsc*dp*ic*isc*ip*
alias: usb:v04E8p4471d*dc*dsc*dp*ic*isc*ip*
alias: usb:v18E8p6238d*dc*dsc*dp*ic*isc*ip*
alias: usb:v18E8p6229d*dc*dsc*dp*ic*isc*ip*
alias: usb:v18E8p6196d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp2671d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp2573d*dc*dsc*dp*ic*isc*ip*
alias: usb:v04BBp093Dd*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0pA874d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0pA861d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6874d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6877d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p0028d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p0023d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p0020d*dc*dsc*dp*ic*isc*ip*
alias: usb:v06F8pE020d*dc*dsc*dp*ic*isc*ip*
alias: usb:v06F8pE010d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1472p0009d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1044p800Ad*dc*dsc*dp*ic*isc*ip*
alias: usb:v1044p8008d*dc*dsc*dp*ic*isc*ip*
alias: usb:v15A9p0004d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1740p3701d*dc*dsc*dp*ic*isc*ip*
alias: usb:v7392p7618d*dc*dsc*dp*ic*isc*ip*
alias: usb:v7392p7318d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07D1p3C07d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07D1p3C06d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07D1p3C04d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07D1p3C03d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07AAp002Ed*dc*dsc*dp*ic*isc*ip*
alias: usb:v14B2p3C22d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1371p9032d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1371p9022d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p0119d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p0116d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p00F4d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p00D8d*dc*dsc*dp*ic*isc*ip*
alias: usb:v08DDp0120d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1631pC019d*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp905Cd*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp905Bd*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp705Ad*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp7050d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0B05p1724d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0B05p1723d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1690p0722d*dc*dsc*dp*ic*isc*ip*
alias: usb:v18C5p0002d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0EB0p9021d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp9021d*dc*dsc*dp*ic*isc*ip*
alias: usb:v14B2p3C10d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07B8pB21Fd*dc*dsc*dp*ic*isc*ip*
alias: usb:v07B8pB21Ed*dc*dsc*dp*ic*isc*ip*
alias: usb:v07B8pB21Dd*dc*dsc*dp*ic*isc*ip*
alias: usb:v07B8pB21Cd*dc*dsc*dp*ic*isc*ip*
alias: usb:v07B8pB21Bd*dc*dsc*dp*ic*isc*ip*
depends: rt2x00lib,rt2x00usb,crc-itu-t
vermagic: 2.6.28-11-generic SMP mod_unload modversions
parm: nohwcrypt:Disable hardware encryption. (bool)
$ tail -f /var/log/syslog
Jun 24 17:27:19 kinderei kernel: [12554.745026] usb 1-5: new high
speed USB device using ehci_hcd and address 13
Jun 24 17:27:20 kinderei kernel: [12555.028920] usb 1-5: configuration
#1 chosen from 1 choice
Jun 24 17:27:20 kinderei kernel: [12555.109078] cfg80211: Calling CRDA
to update world regulatory domain
Jun 24 17:27:20 kinderei kernel: [12555.129181] cfg80211: World
regulatory domain updated:
Jun 24 17:27:20 kinderei kernel: [12555.129184] ^I(start_freq -
end_freq @ bandwidth), (max_antenna_gain, max_eirp)
Jun 24 17:27:20 kinderei kernel: [12555.129185] ^I(2402000 KHz -
2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
Jun 24 17:27:20 kinderei kernel: [12555.129186] ^I(2457000 KHz -
2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
Jun 24 17:27:20 kinderei kernel: [12555.129187] ^I(2474000 KHz -
2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
Jun 24 17:27:20 kinderei kernel: [12555.129188] ^I(5170000 KHz -
5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
Jun 24 17:27:20 kinderei kernel: [12555.129189] ^I(5735000 KHz -
5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
Jun 24 17:27:20 kinderei kernel: [12555.248175] phy0: Selected rate
control algorithm 'minstrel'
Jun 24 17:27:20 kinderei kernel: [12555.249044] Registered led device:
rt2500usb-phy0::radio
Jun 24 17:27:20 kinderei kernel: [12555.249052] Registered led device:
rt2500usb-phy0::quality
Jun 24 17:27:20 kinderei kernel: [12555.249494] usbcore: registered
new interface driver rt2500usb
Jun 24 17:27:20 kinderei kernel: [12555.253453] usbcore: registered
new interface driver rt73usb
Jun 24 17:27:20 kinderei kernel: [12555.268332] udev: renamed network
interface wlan0 to wlan1
Jun 24 17:27:20 kinderei nm-system-settings: SCPlugin-Ifupdown:
device added (udi: /org/freedesktop/Hal/devices/net_00_xx_xx_xx_xx_xx,
iface: wlan1): not well known
Jun 24 17:27:20 kinderei NetworkManager: <info> (wlan1): driver
supports SSID scans (scan_capa 0x01).
Jun 24 17:27:20 kinderei NetworkManager: <info> (wlan1): new 802.11
WiFi device (driver: 'rt2500usb')
Jun 24 17:27:20 kinderei NetworkManager: <info> (wlan1): exported as
/org/freedesktop/Hal/devices/net_xx_xx_xx_xx_xx_xx
Jun 24 17:27:25 kinderei NetworkManager: <info> (wlan1): device state
change: 1 -> 2
Jun 24 17:27:25 kinderei NetworkManager: <info> (wlan1): bringing up device.
Jun 24 17:27:25 kinderei NetworkManager: <info> (wlan1): preparing device.
Jun 24 17:27:25 kinderei NetworkManager: <info> (wlan1): deactivating
device (reason: 2).
Jun 24 17:27:25 kinderei NetworkManager: <info> (wlan1): device state
change: 2 -> 3
Jun 24 17:27:25 kinderei kernel: [12560.060050] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 3
(-16).
Jun 24 17:27:25 kinderei kernel: [12560.060053] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 4
(-5).
Jun 24 17:27:25 kinderei kernel: [12560.060280] ADDRCONF(NETDEV_UP):
wlan1: link is not ready
Jun 24 17:27:25 kinderei NetworkManager: <info> (wlan1): supplicant
interface state: starting -> ready
Jun 24 17:27:25 kinderei kernel: [12560.290227] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 3
(-16).
Jun 24 17:27:25 kinderei kernel: [12560.290229] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 4
(-5).
Jun 24 17:27:25 kinderei kernel: [12560.500043] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 3
(-16).
Jun 24 17:27:25 kinderei kernel: [12560.500045] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 4
(-5).
Jun 24 17:27:25 kinderei kernel: [12560.684035] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 3
(-16).
Jun 24 17:27:25 kinderei kernel: [12560.684038] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 4
(-5).
Jun 24 17:27:26 kinderei kernel: [12560.873183] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 3
(-16).
Jun 24 17:27:26 kinderei kernel: [12560.873186] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 4
(-5).
Jun 24 17:27:26 kinderei kernel: [12561.057035] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 3
(-16).
Jun 24 17:27:26 kinderei kernel: [12561.057037] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 4
(-5).
<cut> <!-- this goes on as long as i leave the device plugged in... -->
Jun 24 17:28:58 kinderei kernel: [12653.045093] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 3
(-16).
Jun 24 17:28:58 kinderei kernel: [12653.045096] phy0 ->
rt2500usb_set_device_state: Error - Device failed to enter state 4
(-5).
Jun 24 17:29:06 kinderei kernel: [12661.761764] usb 1-5: USB
disconnect, address 13
Jun 24 17:29:06 kinderei kernel: [12661.761972] phy0 ->
rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for
offset 0x0428 with error -19.
Jun 24 17:29:06 kinderei kernel: [12661.761974] phy0 ->
rt2x00usb_vendor_request: Error - Vendor Request 0x06 failed for
offset 0x0428 with error -19.
Jun 24 17:29:06 kinderei kernel: [12661.761985] phy0 ->
rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for
offset 0x0428 with error -19.
Jun 24 17:29:06 kinderei kernel: [12661.761987] phy0 ->
rt2x00usb_vendor_request: Error - Vendor Request 0x06 failed for
offset 0x0428 with error -19.
Jun 24 17:29:06 kinderei nm-system-settings: SCPlugin-Ifupdown:
devices removed (udi:
/org/freedesktop/Hal/devices/net_00_xx_xx_xx_xx_xx)
Jun 24 17:29:06 kinderei NetworkManager: <info> (wlan1): now unmanaged
Jun 24 17:29:06 kinderei NetworkManager: <info> (wlan1): device state
change: 3 -> 1
Jun 24 17:29:06 kinderei NetworkManager: <info> (wlan1): cleaning up...
However, when I do
$ sudo make unload
$ sudo make uninstall
$ sudo make unload # for good measure
then plug the device in, everything seems to work (with a pinch of
salt). I didn't test it extensively because I have other devices that
i KNOW work so I didnt test it thoroughly.
"Default" ubuntu modules kick in and no errors reported, connection
establishes, NM doing it's job, pinging, surfing, everything seems
normal. Here they are:
$ modinfo rt73usb
filename:
/lib/modules/2.6.28-11-generic/kernel/drivers/net/wireless/rt2x00/rt73usb.ko
license: GPL
firmware: rt73.bin
description: Ralink RT73 USB Wireless LAN driver.
version: 2.2.1
author: http://rt2x00.serialmonkey.com
srcversion: 06392C23FAB17454A308DBE
alias: usb:v2019pAB50d*dc*dsc*dp*ic*isc*ip*
alias: usb:v2019pAB01d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0769p31F3d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DF6p90ACd*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DF6p9712d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1740p7100d*dc*dsc*dp*ic*isc*ip*
alias: usb:v18E8p6238d*dc*dsc*dp*ic*isc*ip*
alias: usb:v18E8p6229d*dc*dsc*dp*ic*isc*ip*
alias: usb:v18E8p6196d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp2671d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp2573d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0pA874d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0pA861d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6874d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6877d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p0028d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p0023d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p0020d*dc*dsc*dp*ic*isc*ip*
alias: usb:v06F8pE020d*dc*dsc*dp*ic*isc*ip*
alias: usb:v06F8pE010d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1472p0009d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1044p800Ad*dc*dsc*dp*ic*isc*ip*
alias: usb:v1044p8008d*dc*dsc*dp*ic*isc*ip*
alias: usb:v15A9p0004d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07D1p3C07d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07D1p3C06d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07D1p3C04d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07D1p3C03d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07AAp002Ed*dc*dsc*dp*ic*isc*ip*
alias: usb:v14B2p3C22d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1371p9032d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1371p9022d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p00F4d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1631pC019d*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp905Cd*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp905Bd*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp705Ad*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp7050d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0B05p1724d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0B05p1723d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1690p0722d*dc*dsc*dp*ic*isc*ip*
alias: usb:v07B8pB21Dd*dc*dsc*dp*ic*isc*ip*
depends: rt2x00lib,rt2x00usb,crc-itu-t
vermagic: 2.6.28-11-generic SMP mod_unload modversions
parm: nohwcrypt:Disable hardware encryption. (bool)
$ modinfo rt2500usb
filename:
/lib/modules/2.6.28-11-generic/kernel/drivers/net/wireless/rt2x00/rt2500usb.ko
license: GPL
description: Ralink RT2500 USB Wireless LAN driver.
version: 2.2.1
author: http://rt2x00.serialmonkey.com
srcversion: CF8DEA0313F8F3D3C52C8DC
alias: usb:v5A57p0260d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0EB0p9020d*dc*dsc*dp*ic*isc*ip*
alias: usb:v114Bp0110d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0707pEE13d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0681p3C06d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp9020d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp2573d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp2570d*dc*dsc*dp*ic*isc*ip*
alias: usb:v148Fp1706d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6869d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6865d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0DB0p6861d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p0097d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p008Bd*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p0067d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p0066d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0411p005Ed*dc*dsc*dp*ic*isc*ip*
alias: usb:v06F8pE000d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1044p8007d*dc*dsc*dp*ic*isc*ip*
alias: usb:v1044p8001d*dc*dsc*dp*ic*isc*ip*
alias: usb:v2001p3C00d*dc*dsc*dp*ic*isc*ip*
alias: usb:v14B2p3C02d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p001Ad*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p0011d*dc*dsc*dp*ic*isc*ip*
alias: usb:v13B1p000Dd*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp705Ad*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp7051d*dc*dsc*dp*ic*isc*ip*
alias: usb:v050Dp7050d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0B05p1707d*dc*dsc*dp*ic*isc*ip*
alias: usb:v0B05p1706d*dc*dsc*dp*ic*isc*ip*
depends: rt2x00lib,rt2x00usb
vermagic: 2.6.28-11-generic SMP mod_unload modversions
I tried installing compat-wireless and then manually deleting rt2x00
folder with modules, running depmod, and using the card like that,
but, of course, I cannot do that because incompatibilities between
different versions of modules and mac80211 and cfg80211 prevent the
thing from working.
I'd appreciate any ideas, help, bugfixii or something else that might
enable me to use ALL my cards with latest version of compat-wireless.
BTW, I have 4 usb cards at my disposal that I can test with, but this
one is the one with external connector that is travelling with my
laptop, so... I prefer this one at the moment. :)
I realize that I didnt post syslog when I use the card with default
modules, but I think it's irrelevant ATM, correct me if I'm wrong.
I'm open for testing patches and changes.
Viktor
--
Don't let people drive you crazy when you know it's in walking distance.
^ permalink raw reply
* Re: [RFC 01/11] cfg80211: connect/disconnect API
From: Samuel Ortiz @ 2009-06-24 15:30 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <20090624120808.469913150@sipsolutions.net>
Hi Johannes,
On Wed, Jun 24, 2009 at 05:07:46AM -0700, Johannes Berg wrote:
> From: Samuel Ortiz <sameo@linux.intel.com>
>
> This patch introduces the cfg80211 connect/disconnect API.
> The goal here is to run the AUTH and ASSOC steps in one call.
> This is needed for some fullmac cards that run both steps
> directly from the target, after the host driver sends a
> connect command.
With this API, we should now be able to support the iwconfig key restricted
stuff, with a patch like that:
---
net/wireless/wext-compat.c | 5 +++++
1 file changed, 5 insertions(+)
Index: iwm-2.6/net/wireless/wext-compat.c
===================================================================
--- iwm-2.6.orig/net/wireless/wext-compat.c 2009-06-24 17:25:37.000000000 +0200
+++ iwm-2.6/net/wireless/wext-compat.c 2009-06-24 17:25:41.000000000 +0200
@@ -555,6 +555,11 @@ int cfg80211_wext_siwencode(struct net_d
return err;
}
+ if (erq->flags & IW_ENCODE_RESTRICTED)
+ wdev->wext.connect.auth_type = NL80211_AUTHTYPE_SHARED_KEY;
+ else
+ wdev->wext.connect.auth_type = NL80211_AUTHTYPE_OPEN_SYSTEM;
+
memset(¶ms, 0, sizeof(params));
params.key = keybuf;
params.key_len = erq->length;
--
Intel Open Source Technology Centre
http://oss.intel.com/
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply
* Re: [PATCH] iwmc3200wifi: add Kconfig help
From: Matthew Wilcox @ 2009-06-24 14:12 UTC (permalink / raw)
To: Samuel Ortiz; +Cc: linville, Zhu, Yi, linux-wireless
In-Reply-To: <20090624140721.GA3427@sortiz.org>
On Wed, Jun 24, 2009 at 04:07:22PM +0200, Samuel Ortiz wrote:
>
> We're missing a Kconfig help for the iwmc3200wifi driver.
Thanks!
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ permalink raw reply
* [PATCH] iwmc3200wifi: add Kconfig help
From: Samuel Ortiz @ 2009-06-24 14:07 UTC (permalink / raw)
To: linville; +Cc: Matthew Wilcox, Zhu, Yi, linux-wireless
We're missing a Kconfig help for the iwmc3200wifi driver.
Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
--
drivers/net/wireless/iwmc3200wifi/Kconfig | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/iwmc3200wifi/Kconfig b/drivers/net/wireless/iwmc3200wifi/Kconfig
index 1eccb6d..030401d 100644
--- a/drivers/net/wireless/iwmc3200wifi/Kconfig
+++ b/drivers/net/wireless/iwmc3200wifi/Kconfig
@@ -4,6 +4,15 @@ config IWM
depends on CFG80211
select WIRELESS_EXT
select FW_LOADER
+ help
+ The Intel Wireless Multicomm 3200 hardware is a combo
+ card with GPS, Bluetooth, WiMax and 802.11 radios. It
+ runs over SDIO and is typically found on Moorestown
+ based platform. This driver takes care of the 802.11
+ part, which is a fullmac one.
+
+ If you choose to build it as a module, it'll be called
+ iwmc3200wifi.ko.
config IWM_DEBUG
bool "Enable full debugging output in iwmc3200wifi"
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply related
* Re: [PATCH 09/10] cfq-iosched: Uses its own open-coded rcu_barrier.
From: Paul E. McKenney @ 2009-06-24 14:05 UTC (permalink / raw)
To: Jens Axboe
Cc: Jesper Dangaard Brouer, David S. Miller, netdev, linux-kernel,
dougthompson, bluesmoke-devel, Patrick McHardy,
christine.caulfield, Trond.Myklebust, linux-wireless, johannes,
yoshfuji, shemminger, linux-nfs, bfields, neilb, linux-ext4,
tytso, adilger, netfilter-devel
In-Reply-To: <20090624064236.GE31415@kernel.dk>
On Wed, Jun 24, 2009 at 08:42:37AM +0200, Jens Axboe wrote:
> On Tue, Jun 23 2009, Jesper Dangaard Brouer wrote:
> > This module cfq-iosched, has discovered the value of waiting for
> > call_rcu() completion, but its has its own open-coded implementation
> > of rcu_barrier(), which I don't think is 'strong' enough.
> >
> > This patch only leaves a comment for the maintainers to consider.
>
> We need a stronger primitive and rcu_barrier(), since we also need to
> wait for the rcu calls to even be scheduled. So I don't think the below
> can be improved, it's already fine.
It is indeed important to first prevent new call_rcu() instances from
being invoked, and only then invoke rcu_barrier().
Thanx, Paul
> > Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
> > ---
> >
> > block/cfq-iosched.c | 6 ++++++
> > 1 files changed, 6 insertions(+), 0 deletions(-)
> >
> > diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> > index 833ec18..c15555b 100644
> > --- a/block/cfq-iosched.c
> > +++ b/block/cfq-iosched.c
> > @@ -2657,6 +2657,12 @@ static void __exit cfq_exit(void)
> > /*
> > * this also protects us from entering cfq_slab_kill() with
> > * pending RCU callbacks
> > + *
> > + * hawk@comx.dk 2009-06-18: Maintainer please consider using
> > + * rcu_barrier() instead of this open-coded wait for
> > + * completion implementation. I think it provides a better
> > + * guarantee that all CPUs are finished, although
> > + * elv_ioc_count_read() do consider all CPUs.
> > */
> > if (elv_ioc_count_read(ioc_count))
> > wait_for_completion(&all_gone);
> >
>
> --
> Jens Axboe
>
^ permalink raw reply
* Re: [PATCH v2 10/10] nf_conntrack: Use rcu_barrier() and fix kmem_cache_create flags
From: Patrick McHardy @ 2009-06-24 13:58 UTC (permalink / raw)
To: jdb
Cc: David S. Miller, Paul E. McKenney, netdev, linux-kernel,
dougthompson, bluesmoke-devel, axboe, christine.caulfield,
Trond.Myklebust, linux-wireless, johannes, yoshfuji, shemminger,
linux-nfs, bfields, neilb, linux-ext4, tytso, adilger,
netfilter-devel
In-Reply-To: <1245836409.6695.35.camel@localhost.localdomain>
Jesper Dangaard Brouer wrote:
> Adjusting SLAB_DESTROY_BY_RCU flags.
>
> kmem_cache_create("nf_conntrack", ...) does not need the
> SLAB_DESTROY_BY_RCU flag.
It does need it. We're using it instead of call_rcu() for conntracks.
> But the
> kmem_cache_create("nf_conntrack_expect", ...) should use the
> SLAB_DESTROY_BY_RCU flag, because it uses a call_rcu() callback to
> invoke kmem_cache_free().
No, using call_rcu() means we don't need SLAB_DESTROY_BY_RCU.
Please see the note in include/linux/slab.h.
> RCU barriers, rcu_barrier(), is inserted two places.
>
> In nf_conntrack_expect.c nf_conntrack_expect_fini() before the
> kmem_cache_destroy(), even though the use of the SLAB_DESTROY_BY_RCU
> flag, because slub does not (currently) handle rcu sync correctly.
I think that should be fixed in slub then.
> And in nf_conntrack_extend.c nf_ct_extend_unregister(), inorder to
> wait for completion of callbacks to __nf_ct_ext_free_rcu(), which is
> invoked by __nf_ct_ext_add(). It might be more efficient to call
> rcu_barrier() in nf_conntrack_core.c nf_conntrack_cleanup_net(), but
> thats make it more difficult to read the code (as the callback code
> in located in nf_conntrack_extend.c).
This one looks fine.
> diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
> index 5f72b94..438ce84 100644
> --- a/net/netfilter/nf_conntrack_core.c
> +++ b/net/netfilter/nf_conntrack_core.c
> @@ -1242,7 +1242,7 @@ static int nf_conntrack_init_init_net(void)
>
> nf_conntrack_cachep = kmem_cache_create("nf_conntrack",
> sizeof(struct nf_conn),
> - 0, SLAB_DESTROY_BY_RCU, NULL);
> + 0, 0, NULL);
> if (!nf_conntrack_cachep) {
> printk(KERN_ERR "Unable to create nf_conn slab cache\n");
> ret = -ENOMEM;
> diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
> index afde8f9..56227c2 100644
> --- a/net/netfilter/nf_conntrack_expect.c
> +++ b/net/netfilter/nf_conntrack_expect.c
> @@ -593,7 +593,7 @@ int nf_conntrack_expect_init(struct net *net)
> if (net_eq(net, &init_net)) {
> nf_ct_expect_cachep = kmem_cache_create("nf_conntrack_expect",
> sizeof(struct nf_conntrack_expect),
> - 0, 0, NULL);
> + 0, SLAB_DESTROY_BY_RCU, NULL);
> if (!nf_ct_expect_cachep)
> goto err2;
> }
> @@ -617,8 +617,15 @@ err1:
> void nf_conntrack_expect_fini(struct net *net)
> {
> exp_proc_remove(net);
> - if (net_eq(net, &init_net))
> + if (net_eq(net, &init_net)) {
> + /* hawk@comx.dk 2009-06-24: The rcu_barrier() can be
> + * removed once the sl*b allocators has been fixed
> + * regarding handling the SLAB_DESTROY_BY_RCU flag
> + * correctly.
> + */
> + rcu_barrier(); /* Wait for call_rcu() before destroy */
> kmem_cache_destroy(nf_ct_expect_cachep);
> + }
> nf_ct_free_hashtable(net->ct.expect_hash, net->ct.expect_vmalloc,
> nf_ct_expect_hsize);
> }
> diff --git a/net/netfilter/nf_conntrack_extend.c b/net/netfilter/nf_conntrack_extend.c
> index 4b2c769..fef95be 100644
> --- a/net/netfilter/nf_conntrack_extend.c
> +++ b/net/netfilter/nf_conntrack_extend.c
> @@ -186,6 +186,6 @@ void nf_ct_extend_unregister(struct nf_ct_ext_type *type)
> rcu_assign_pointer(nf_ct_ext_types[type->id], NULL);
> update_alloc_size(type);
> mutex_unlock(&nf_ct_ext_type_mutex);
> - synchronize_rcu();
> + rcu_barrier(); /* Wait for completion of call_rcu()'s */
> }
> EXPORT_SYMBOL_GPL(nf_ct_extend_unregister);
>
^ permalink raw reply
* [PATCH] ath9k: Fix leak in tx descriptor
From: Vasanthakumar Thiagarajan @ 2009-06-24 13:28 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Luis.Rodriguez, Jouni.Malinen, ath9k-devel
When we reclaim the tx desc, we always assume that the
last desc is a holding desc, which is not true, and skip it.
If the tx queue is drained during channel change, internal
reset and etc, the last descriptor may not be the holding
descriptor and we fail to reclaim them. This results in the
following two issues.
1. Tx stuck - We drop all the frames coming from upper layer
due to shortage in tx desc.
2. Crash - If we fail to reclaim a tx descriptor, we miss to
update the tx BA window with the seq number of the frame
associated to that desc, which, at some point, result in
the following crash due to an assert failure in ath_tx_addto_baw().
This patch fixes these two issues.
kernel BUG at ../drivers/net/wireless/ath/ath9k/xmit.c:180!
[155064.304164] invalid opcode: 0000 [#1] SMP
Call Trace:
[<fbc6d83b>] ? ath9k_tx+0xeb/0x160 [ath9k]
[<fbbc9591>] ipv6? __ieee80211_tx+0x41/0x120 [mac80211]
[<fbbcb5ae>] ? aes_i586ieee80211_master_start_xmit+0x28e/0x560 [mac80211]
[<c037e501>] aes_generic? _spin_lock_irqsave+0x31/0x40
[<c02f347b>] ? dev_hard_start_xmit+0x16b/0x1c0
[<c03058b5>] ? __qdisc_run+0x1b5/0x200
[<fbbcda5a>] ? af_packetieee80211_select_queue+0xa/0x100 [mac80211]
[<c02f53b7>] ? i915dev_queue_xmit+0x2e7/0x3f0
[<fbbc9b49>] ? ieee80211_subif_start_xmit+0x369/0x7a0 [mac80211]
[<c031bc35>] ? ip_output+0x55/0xb0
[<c02e0188>] ? show_memcpy_count+0x18/0x60
[<c02eb186>] ? __kfree_skb+0x36/0x90
[<c02f2202>] ? binfmt_miscdev_queue_xmit_nit+0xd2/0x110
[<c02f347b>] ? dev_hard_start_xmit+0x16b/0x1c0
[<c03058b5>] ? __qdisc_run+0x1b5/0x200
[<c033bca7>] ? scoarp_create+0x57/0x2a0
[<c02f53b7>] ? bridgedev_queue_xmit+0x2e7/0x3f0
[<c03034a0>] ? eth_header+0x0/0xc0
[<c033b95f>] stp? arp_xmit+0x5f/0x70
[<c033bf4f>] ? arp_send+0x5f/0x70
[<c033c8f5>] bnep? arp_solicit+0x105/0x210
[<c02fa5aa>] ? neigh_timer_handler+0x19a/0x390
[<c013bf88>] ? run_timer_softirq+0x138/0x210
[<c02fa410>] ? ppdevneigh_timer_handler+0x0/0x390
[<c02fa410>] ? neigh_timer_handler+0x0/0x390
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
drivers/net/wireless/ath/ath9k/xmit.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index c140f81..5de9878 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -347,7 +347,14 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
}
if (bf_next == NULL) {
- INIT_LIST_HEAD(&bf_head);
+ /*
+ * Make sure the last desc is reclaimed if it
+ * not a holding desc.
+ */
+ if (!bf_last->bf_stale)
+ list_move_tail(&bf->list, &bf_head);
+ else
+ INIT_LIST_HEAD(&bf_head);
} else {
ASSERT(!list_empty(bf_q));
list_move_tail(&bf->list, &bf_head);
--
1.5.5.1
^ permalink raw reply related
* [PATCH 0/7] ATH9K Bug fixes
From: Senthil Balasubramanian @ 2009-06-24 13:29 UTC (permalink / raw)
To: linville
Cc: Jouni.Malinen, Luis.Rodriguez, linux-wireless,
Senthil Balasubramanian
John,
Oops.. I haven't put the subject properly in my earlier e-mail. Sorry! for the confusion.
Senthil
^ permalink raw reply
* [PATCH 7/7] ath9k: Handle different TX and RX streams properly.
From: Senthil Balasubramanian @ 2009-06-24 13:26 UTC (permalink / raw)
To: linville
Cc: Jouni.Malinen, Luis.Rodriguez, linux-wireless,
Senthil Balasubramanian
In-Reply-To: <1245850002-26351-7-git-send-email-senthilkumar@atheros.com>
This patch fixes an issue when the TX and RX streams are different.
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
---
drivers/net/wireless/ath/ath9k/main.c | 26 ++++++++++++++------------
1 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index b7d5305..c327dc7 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -890,6 +890,7 @@ static void setup_ht_cap(struct ath_softc *sc,
{
#define ATH9K_HT_CAP_MAXRXAMPDU_65536 0x3 /* 2 ^ 16 */
#define ATH9K_HT_CAP_MPDUDENSITY_8 0x6 /* 8 usec */
+ u8 tx_streams, rx_streams;
ht_info->ht_supported = true;
ht_info->cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
@@ -902,21 +903,22 @@ static void setup_ht_cap(struct ath_softc *sc,
/* set up supported mcs set */
memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
+ tx_streams = !(sc->tx_chainmask & (sc->tx_chainmask - 1)) ? 1 : 2;
+ rx_streams = !(sc->rx_chainmask & (sc->rx_chainmask - 1)) ? 1 : 2;
- switch(sc->rx_chainmask) {
- case 1:
- ht_info->mcs.rx_mask[0] = 0xff;
- break;
- case 3:
- case 5:
- case 7:
- default:
- ht_info->mcs.rx_mask[0] = 0xff;
- ht_info->mcs.rx_mask[1] = 0xff;
- break;
+ if (tx_streams != rx_streams) {
+ DPRINTF(sc, ATH_DBG_CONFIG, "TX streams %d, RX streams: %d\n",
+ tx_streams, rx_streams);
+ ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF;
+ ht_info->mcs.tx_params |= ((tx_streams - 1) <<
+ IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT);
}
- ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
+ ht_info->mcs.rx_mask[0] = 0xff;
+ if (rx_streams >= 2)
+ ht_info->mcs.rx_mask[1] = 0xff;
+
+ ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED;
}
static void ath9k_bss_assoc_info(struct ath_softc *sc,
--
1.6.0.4
^ permalink raw reply related
* [PATCH 6/7] ath9k: race condition in SCANNING state check during ANI calibration
From: Senthil Balasubramanian @ 2009-06-24 13:26 UTC (permalink / raw)
To: linville
Cc: Jouni.Malinen, Luis.Rodriguez, linux-wireless,
Senthil Balasubramanian
In-Reply-To: <1245850002-26351-6-git-send-email-senthilkumar@atheros.com>
ANI calibration shouldn't be done when we are not on our home channel.
This is already verified. However, it is racy. Fix this by proper
spin locks.
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 1 +
drivers/net/wireless/ath/ath9k/main.c | 11 +++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index a86e384..8de4b86 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -563,6 +563,7 @@ struct ath_softc {
int irq;
spinlock_t sc_resetlock;
spinlock_t sc_serial_rw;
+ spinlock_t ani_lock;
struct mutex mutex;
u8 curbssid[ETH_ALEN];
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 81de792..b7d5305 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -342,6 +342,7 @@ static void ath_ani_calibrate(unsigned long data)
* don't calibrate when we're scanning.
* we are most likely not on our home channel.
*/
+ spin_lock(&sc->ani_lock);
if (sc->sc_flags & SC_OP_SCANNING)
goto set_timer;
@@ -405,6 +406,7 @@ static void ath_ani_calibrate(unsigned long data)
ath9k_ps_restore(sc);
set_timer:
+ spin_unlock(&sc->ani_lock);
/*
* Set timer interval based on previous results.
* The interval must be the shortest necessary to satisfy ANI,
@@ -1312,6 +1314,7 @@ static int ath_init(u16 devid, struct ath_softc *sc)
spin_lock_init(&sc->wiphy_lock);
spin_lock_init(&sc->sc_resetlock);
spin_lock_init(&sc->sc_serial_rw);
+ spin_lock_init(&sc->ani_lock);
mutex_init(&sc->mutex);
tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet,
@@ -2686,9 +2689,9 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
aphy->state = ATH_WIPHY_SCAN;
ath9k_wiphy_pause_all_forced(sc, aphy);
- mutex_lock(&sc->mutex);
+ spin_lock_bh(&sc->ani_lock);
sc->sc_flags |= SC_OP_SCANNING;
- mutex_unlock(&sc->mutex);
+ spin_unlock_bh(&sc->ani_lock);
}
static void ath9k_sw_scan_complete(struct ieee80211_hw *hw)
@@ -2696,11 +2699,11 @@ static void ath9k_sw_scan_complete(struct ieee80211_hw *hw)
struct ath_wiphy *aphy = hw->priv;
struct ath_softc *sc = aphy->sc;
- mutex_lock(&sc->mutex);
+ spin_lock_bh(&sc->ani_lock);
aphy->state = ATH_WIPHY_ACTIVE;
sc->sc_flags &= ~SC_OP_SCANNING;
sc->sc_flags |= SC_OP_FULL_RESET;
- mutex_unlock(&sc->mutex);
+ spin_unlock_bh(&sc->ani_lock);
}
struct ieee80211_ops ath9k_ops = {
--
1.6.0.4
^ permalink raw reply related
* [PATCH 5/7] ath9k: stop ani when the STA gets disconnected.
From: Senthil Balasubramanian @ 2009-06-24 13:26 UTC (permalink / raw)
To: linville
Cc: Jouni.Malinen, Luis.Rodriguez, linux-wireless,
Senthil Balasubramanian
In-Reply-To: <1245850002-26351-5-git-send-email-senthilkumar@atheros.com>
ANI is not required when the STA is disconnected. So stop it and enable
ANI for adhoc and monitor mode.
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
---
drivers/net/wireless/ath/ath9k/main.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index a977f80..81de792 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -950,6 +950,8 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
} else {
DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info DISASSOC\n");
sc->curaid = 0;
+ /* Stop ANI */
+ del_timer_sync(&sc->ani.timer);
}
}
@@ -2197,7 +2199,9 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
ath9k_hw_set_interrupts(sc->sc_ah, sc->imask);
- if (conf->type == NL80211_IFTYPE_AP)
+ if (conf->type == NL80211_IFTYPE_AP ||
+ conf->type == NL80211_IFTYPE_ADHOC ||
+ conf->type == NL80211_IFTYPE_MONITOR)
ath_start_ani(sc);
out:
--
1.6.0.4
^ permalink raw reply related
* [PATCH 4/7] ath9k: remove unnecessary STATION mode check.
From: Senthil Balasubramanian @ 2009-06-24 13:26 UTC (permalink / raw)
To: linville
Cc: Jouni.Malinen, Luis.Rodriguez, linux-wireless,
Senthil Balasubramanian
In-Reply-To: <1245850002-26351-4-git-send-email-senthilkumar@atheros.com>
Remove unncessary STATION mode check in ath9k_bss_assoc_info() as
it is called only for STATION mode.
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
---
drivers/net/wireless/ath/ath9k/main.c | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 66d2190..a977f80 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -921,24 +921,21 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf)
{
- struct ath_vif *avp = (void *)vif->drv_priv;
if (bss_conf->assoc) {
DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info ASSOC %d, bssid: %pM\n",
bss_conf->aid, sc->curbssid);
/* New association, store aid */
- if (avp->av_opmode == NL80211_IFTYPE_STATION) {
- sc->curaid = bss_conf->aid;
- ath9k_hw_write_associd(sc);
+ sc->curaid = bss_conf->aid;
+ ath9k_hw_write_associd(sc);
- /*
- * Request a re-configuration of Beacon related timers
- * on the receipt of the first Beacon frame (i.e.,
- * after time sync with the AP).
- */
- sc->sc_flags |= SC_OP_BEACON_SYNC;
- }
+ /*
+ * Request a re-configuration of Beacon related timers
+ * on the receipt of the first Beacon frame (i.e.,
+ * after time sync with the AP).
+ */
+ sc->sc_flags |= SC_OP_BEACON_SYNC;
/* Configure the beacon */
ath_beacon_config(sc, vif);
--
1.6.0.4
^ permalink raw reply related
* [PATCH 3/7] ath9k: Fix TX hang issue with Atheros chipsets
From: Senthil Balasubramanian @ 2009-06-24 13:26 UTC (permalink / raw)
To: linville
Cc: Jouni.Malinen, Luis.Rodriguez, linux-wireless,
Senthil Balasubramanian, Vasanthakumar Thiagarajan
In-Reply-To: <1245850002-26351-3-git-send-email-senthilkumar@atheros.com>
The hardware doesn't generate interrupts in some cases and so work
around this by monitoring the TX status periodically and reset the
chip if required.
This behavior of the hardware not generating the TX interrupts can
be noticed through ath9k debugfs interrupt statistics when heavy
traffic is being sent from STA to AP. One can easily see this behavior
when the STA is transmitting at a higher rates. The interrupt statistics
in the debugfs interface clearly shows that only RX interrupts alone
being generated and TX being stuck.
TX should be monitored through a timer and reset the chip only when
frames are queued to the hardware but TX interrupts are not generated
for the same even after one second. Also, we shouldn't remove holding
descriptor from AC queue if it happens to be the only descriptor and
schedule TX aggregation regarless of queue depth as it improves
scheduling of AMPDUs from software to hardware queue.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 4 ++
drivers/net/wireless/ath/ath9k/main.c | 3 ++
drivers/net/wireless/ath/ath9k/xmit.c | 57 ++++++++++++++++++++++++--------
3 files changed, 50 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 6fa72b8..a86e384 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -230,6 +230,8 @@ void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd,
#define ATH_DS_TX_BA(_ds) ((_ds)->ds_us.tx.ts_flags & ATH9K_TX_BA)
#define ATH_AN_2_TID(_an, _tidno) (&(_an)->tid[(_tidno)])
+#define ATH_TX_COMPLETE_POLL_INT 1000
+
enum ATH_AGGR_STATUS {
ATH_AGGR_DONE,
ATH_AGGR_BAW_CLOSED,
@@ -245,6 +247,7 @@ struct ath_txq {
u8 axq_aggr_depth;
u32 axq_totalqueued;
bool stopped;
+ bool axq_tx_inprogress;
struct ath_buf *axq_linkbuf;
/* first desc of the last descriptor that contains CTS */
@@ -609,6 +612,7 @@ struct ath_softc {
#endif
struct ath_bus_ops *bus_ops;
struct ath_beacon_config cur_beacon_conf;
+ struct delayed_work tx_complete_work;
};
struct ath_wiphy {
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index f2bbc28..66d2190 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1256,6 +1256,7 @@ void ath_detach(struct ath_softc *sc)
ath_deinit_leds(sc);
cancel_work_sync(&sc->chan_work);
cancel_delayed_work_sync(&sc->wiphy_work);
+ cancel_delayed_work_sync(&sc->tx_complete_work);
for (i = 0; i < sc->num_sec_wiphy; i++) {
struct ath_wiphy *aphy = sc->sec_wiphy[i];
@@ -1974,6 +1975,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
ieee80211_wake_queues(hw);
+ queue_delayed_work(sc->hw->workqueue, &sc->tx_complete_work, 0);
+
mutex_unlock:
mutex_unlock(&sc->mutex);
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index c140f81..6b32b40 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -850,6 +850,7 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype)
txq->axq_aggr_depth = 0;
txq->axq_totalqueued = 0;
txq->axq_linkbuf = NULL;
+ txq->axq_tx_inprogress = false;
sc->tx.txqsetup |= 1<<qnum;
}
return &sc->tx.txq[qnum];
@@ -1016,6 +1017,10 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx)
ath_tx_complete_buf(sc, bf, &bf_head, 0, 0);
}
+ spin_lock_bh(&txq->axq_lock);
+ txq->axq_tx_inprogress = false;
+ spin_unlock_bh(&txq->axq_lock);
+
/* flush any pending frames if aggregation is enabled */
if (sc->sc_flags & SC_OP_TXAGGR) {
if (!retry_tx) {
@@ -1096,8 +1101,7 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
if (tid->paused)
continue;
- if ((txq->axq_depth % 2) == 0)
- ath_tx_sched_aggr(sc, txq, tid);
+ ath_tx_sched_aggr(sc, txq, tid);
/*
* add tid to round-robin queue if more frames
@@ -1940,19 +1944,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
if (bf->bf_stale) {
bf_held = bf;
if (list_is_last(&bf_held->list, &txq->axq_q)) {
- txq->axq_link = NULL;
- txq->axq_linkbuf = NULL;
spin_unlock_bh(&txq->axq_lock);
-
- /*
- * The holding descriptor is the last
- * descriptor in queue. It's safe to remove
- * the last holding descriptor in BH context.
- */
- spin_lock_bh(&sc->tx.txbuflock);
- list_move_tail(&bf_held->list, &sc->tx.txbuf);
- spin_unlock_bh(&sc->tx.txbuflock);
-
break;
} else {
bf = list_entry(bf_held->list.next,
@@ -1989,6 +1981,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
txq->axq_aggr_depth--;
txok = (ds->ds_txstat.ts_status == 0);
+ txq->axq_tx_inprogress = false;
spin_unlock_bh(&txq->axq_lock);
if (bf_held) {
@@ -2022,6 +2015,40 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
}
}
+void ath_tx_complete_poll_work(struct work_struct *work)
+{
+ struct ath_softc *sc = container_of(work, struct ath_softc,
+ tx_complete_work.work);
+ struct ath_txq *txq;
+ int i;
+ bool needreset = false;
+
+ for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
+ if (ATH_TXQ_SETUP(sc, i)) {
+ txq = &sc->tx.txq[i];
+ spin_lock_bh(&txq->axq_lock);
+ if (txq->axq_depth) {
+ if (txq->axq_tx_inprogress) {
+ needreset = true;
+ spin_unlock_bh(&txq->axq_lock);
+ break;
+ } else {
+ txq->axq_tx_inprogress = true;
+ }
+ }
+ spin_unlock_bh(&txq->axq_lock);
+ }
+
+ if (needreset) {
+ DPRINTF(sc, ATH_DBG_RESET, "tx hung, resetting the chip\n");
+ ath_reset(sc, false);
+ }
+
+ queue_delayed_work(sc->hw->workqueue, &sc->tx_complete_work,
+ msecs_to_jiffies(ATH_TX_COMPLETE_POLL_INT));
+}
+
+
void ath_tx_tasklet(struct ath_softc *sc)
{
@@ -2062,6 +2089,8 @@ int ath_tx_init(struct ath_softc *sc, int nbufs)
goto err;
}
+ INIT_DELAYED_WORK(&sc->tx_complete_work, ath_tx_complete_poll_work);
+
err:
if (error != 0)
ath_tx_cleanup(sc);
--
1.6.0.4
^ permalink raw reply related
* [PATCH 2/7] ath9k: RX stucks during heavy traffic in HT40 mode.
From: Senthil Balasubramanian @ 2009-06-24 13:26 UTC (permalink / raw)
To: linville
Cc: Jouni.Malinen, Luis.Rodriguez, linux-wireless,
Senthil Balasubramanian
In-Reply-To: <1245850002-26351-2-git-send-email-senthilkumar@atheros.com>
Running iperf along with p2p traffic on both TX and RX side then
stop one side, then stop the other side, then start it up again,
eventually the STA gets into a mode that it can not pass data at
all.
A hardware workaround for invalid RSSI can make FIFO write pointer
to jump over read pointer, causing RX data corruption and repeated
DMA. Both TX and RX works fine when the workaround is disabled.
To replace the original hardware work around, software looks for
frames with post delimiter CRC error and mark the RSSI invalid so
that the upperlayer will not use the RSSI associated with this
frame. So disable the hardware workaround by updating the appropriate
registers.
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
---
drivers/net/wireless/ath/ath9k/eeprom.c | 20 +++++++++++-
drivers/net/wireless/ath/ath9k/initvals.h | 47 +++++++++++++++-------------
drivers/net/wireless/ath/ath9k/mac.c | 30 ++++++++++++++----
3 files changed, 67 insertions(+), 30 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
index a2fda70..5035420 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
@@ -1208,6 +1208,19 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah,
pModal->xatten2Margin[0]);
REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
AR_PHY_GAIN_2GHZ_XATTEN2_DB, pModal->xatten2Db[0]);
+
+ /* Set the block 1 value to block 0 value */
+ REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000,
+ AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN,
+ pModal->bswMargin[0]);
+ REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000,
+ AR_PHY_GAIN_2GHZ_XATTEN1_DB, pModal->bswAtten[0]);
+ REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000,
+ AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN,
+ pModal->xatten2Margin[0]);
+ REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + 0x1000,
+ AR_PHY_GAIN_2GHZ_XATTEN2_DB,
+ pModal->xatten2Db[0]);
}
REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset,
@@ -1215,6 +1228,11 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah,
REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset,
AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]);
+ REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000,
+ AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal);
+ REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000,
+ AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]);
+
if (AR_SREV_9285_11(ah))
REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14));
}
@@ -1239,7 +1257,7 @@ static void ath9k_hw_4k_set_board_values(struct ath_hw *ah,
ath9k_hw_4k_set_gain(ah, pModal, eep, txRxAttenLocal, 0);
/* Initialize Ant Diversity settings from EEPROM */
- if (pModal->version == 3) {
+ if (pModal->version >= 3) {
ant_div_control1 = ((pModal->ob_234 >> 12) & 0xf);
ant_div_control2 = ((pModal->db1_234 >> 12) & 0xf);
regVal = REG_READ(ah, 0x99ac);
diff --git a/drivers/net/wireless/ath/ath9k/initvals.h b/drivers/net/wireless/ath/ath9k/initvals.h
index e2f0a34..f67a2a9 100644
--- a/drivers/net/wireless/ath/ath9k/initvals.h
+++ b/drivers/net/wireless/ath/ath9k/initvals.h
@@ -2782,7 +2782,7 @@ static const u32 ar9280Common_9280_2[][2] = {
{ 0x00008338, 0x00ff0000 },
{ 0x0000833c, 0x00000000 },
{ 0x00008340, 0x000107ff },
- { 0x00008344, 0x00581043 },
+ { 0x00008344, 0x00481043 },
{ 0x00009808, 0x00000000 },
{ 0x0000980c, 0xafa68e30 },
{ 0x00009810, 0xfd14e000 },
@@ -3439,7 +3439,7 @@ static const u32 ar9280PciePhy_clkreq_always_on_L1_9280[][2] = {
{0x00004044, 0x00000000 },
};
-/* AR9285 */
+/* AR9285 Revsion 10*/
static const u_int32_t ar9285Modes_9285[][6] = {
{ 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
{ 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
@@ -3955,7 +3955,7 @@ static const u_int32_t ar9285Common_9285[][2] = {
{ 0x00008338, 0x00000000 },
{ 0x0000833c, 0x00000000 },
{ 0x00008340, 0x00010380 },
- { 0x00008344, 0x00581043 },
+ { 0x00008344, 0x00481043 },
{ 0x00009808, 0x00000000 },
{ 0x0000980c, 0xafe68e30 },
{ 0x00009810, 0xfd14e000 },
@@ -4121,8 +4121,9 @@ static const u_int32_t ar9285PciePhy_clkreq_off_L1_9285[][2] = {
{0x00004044, 0x00000000 },
};
-/* AR9285 v1_2 PCI Register Writes. Created: 03/04/09 */
+/* AR9285 v1_2 PCI Register Writes. Created: 04/13/09 */
static const u_int32_t ar9285Modes_9285_1_2[][6] = {
+ /* Address 5G-HT20 5G-HT40 2G-HT40 2G-HT20 Turbo */
{ 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
{ 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
{ 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 },
@@ -4139,6 +4140,7 @@ static const u_int32_t ar9285Modes_9285_1_2[][6] = {
{ 0x00009840, 0x206a012e, 0x206a012e, 0x206a012e, 0x206a012e, 0x206a012e },
{ 0x00009844, 0x0372161e, 0x0372161e, 0x03721620, 0x03721620, 0x037216a0 },
{ 0x00009848, 0x00001066, 0x00001066, 0x00001053, 0x00001053, 0x00001059 },
+ { 0x0000a848, 0x00001066, 0x00001066, 0x00001053, 0x00001053, 0x00001059 },
{ 0x00009850, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2, 0x6d4000e2 },
{ 0x00009858, 0x7ec84d2e, 0x7ec84d2e, 0x7ec84d2e, 0x7ec84d2e, 0x7ec84d2e },
{ 0x0000985c, 0x3139605e, 0x3139605e, 0x3137605e, 0x3137605e, 0x3139605e },
@@ -4419,6 +4421,7 @@ static const u_int32_t ar9285Modes_9285_1_2[][6] = {
{ 0x0000abfc, 0x00000000, 0x00000000, 0x000eb7db, 0x000eb7db, 0x00000000 },
{ 0x0000a204, 0x00000004, 0x00000004, 0x00000004, 0x00000004, 0x00000004 },
{ 0x0000a20c, 0x00000014, 0x00000014, 0x0001f000, 0x0001f000, 0x0001f000 },
+ { 0x0000b20c, 0x00000014, 0x00000014, 0x0001f000, 0x0001f000, 0x0001f000 },
{ 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a },
{ 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 },
{ 0x0000a250, 0x0004f000, 0x0004f000, 0x0004a000, 0x0004a000, 0x0004a000 },
@@ -4618,7 +4621,7 @@ static const u_int32_t ar9285Common_9285_1_2[][2] = {
{ 0x00008338, 0x00ff0000 },
{ 0x0000833c, 0x00000000 },
{ 0x00008340, 0x00010380 },
- { 0x00008344, 0x00581043 },
+ { 0x00008344, 0x00481043 },
{ 0x00009808, 0x00000000 },
{ 0x0000980c, 0xafe68e30 },
{ 0x00009810, 0xfd14e000 },
@@ -4752,18 +4755,18 @@ static const u_int32_t ar9285Common_9285_1_2[][2] = {
static const u_int32_t ar9285Modes_high_power_tx_gain_9285_1_2[][6] = {
/* Address 5G-HT20 5G-HT40 2G-HT40 2G-HT20 Turbo */
{ 0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
- { 0x0000a304, 0x00000000, 0x00000000, 0x00005200, 0x00005200, 0x00000000 },
- { 0x0000a308, 0x00000000, 0x00000000, 0x00007201, 0x00007201, 0x00000000 },
+ { 0x0000a304, 0x00000000, 0x00000000, 0x00006200, 0x00006200, 0x00000000 },
+ { 0x0000a308, 0x00000000, 0x00000000, 0x00008201, 0x00008201, 0x00000000 },
{ 0x0000a30c, 0x00000000, 0x00000000, 0x0000b240, 0x0000b240, 0x00000000 },
{ 0x0000a310, 0x00000000, 0x00000000, 0x0000d241, 0x0000d241, 0x00000000 },
- { 0x0000a314, 0x00000000, 0x00000000, 0x0000f440, 0x0000f440, 0x00000000 },
- { 0x0000a318, 0x00000000, 0x00000000, 0x00014640, 0x00014640, 0x00000000 },
- { 0x0000a31c, 0x00000000, 0x00000000, 0x00018680, 0x00018680, 0x00000000 },
- { 0x0000a320, 0x00000000, 0x00000000, 0x00019841, 0x00019841, 0x00000000 },
- { 0x0000a324, 0x00000000, 0x00000000, 0x0001ca40, 0x0001ca40, 0x00000000 },
- { 0x0000a328, 0x00000000, 0x00000000, 0x0001fa80, 0x0001fa80, 0x00000000 },
- { 0x0000a32c, 0x00000000, 0x00000000, 0x00023ac0, 0x00023ac0, 0x00000000 },
- { 0x0000a330, 0x00000000, 0x00000000, 0x0002ab40, 0x0002ab40, 0x00000000 },
+ { 0x0000a314, 0x00000000, 0x00000000, 0x0000f600, 0x0000f600, 0x00000000 },
+ { 0x0000a318, 0x00000000, 0x00000000, 0x00012800, 0x00012800, 0x00000000 },
+ { 0x0000a31c, 0x00000000, 0x00000000, 0x00016802, 0x00016802, 0x00000000 },
+ { 0x0000a320, 0x00000000, 0x00000000, 0x0001b805, 0x0001b805, 0x00000000 },
+ { 0x0000a324, 0x00000000, 0x00000000, 0x00021a80, 0x00021a80, 0x00000000 },
+ { 0x0000a328, 0x00000000, 0x00000000, 0x00028b00, 0x00028b00, 0x00000000 },
+ { 0x0000a32c, 0x00000000, 0x00000000, 0x0002ab40, 0x0002ab40, 0x00000000 },
+ { 0x0000a330, 0x00000000, 0x00000000, 0x0002cd80, 0x0002cd80, 0x00000000 },
{ 0x0000a334, 0x00000000, 0x00000000, 0x00033d82, 0x00033d82, 0x00000000 },
{ 0x0000a338, 0x0003891e, 0x0003891e, 0x0003891e, 0x0003891e, 0x00000000 },
{ 0x0000a33c, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x00000000 },
@@ -4776,13 +4779,13 @@ static const u_int32_t ar9285Modes_high_power_tx_gain_9285_1_2[][6] = {
{ 0x00007838, 0xfac68803, 0xfac68803, 0xfac68803, 0xfac68803, 0xfac68803 },
{ 0x0000786c, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe },
{ 0x00007820, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00 },
- { 0x0000a274, 0x0a22a652, 0x0a22a652, 0x0a21a652, 0x0a21a652, 0x0a22a652 },
- { 0x0000a278, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce },
- { 0x0000a27c, 0x050701ce, 0x050701ce, 0x050701ce, 0x050701ce, 0x050701ce },
- { 0x0000a394, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce },
- { 0x0000a398, 0x000001ce, 0x000001ce, 0x000001ce, 0x000001ce, 0x000001ce },
- { 0x0000a3dc, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce, 0x1ce739ce },
- { 0x0000a3e0, 0x000001ce, 0x000001ce, 0x000001ce, 0x000001ce, 0x000001ce },
+ { 0x0000a274, 0x0a22a652, 0x0a22a652, 0x0a216652, 0x0a216652, 0x0a22a652 },
+ { 0x0000a278, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7 },
+ { 0x0000a27c, 0x050380e7, 0x050380e7, 0x050380e7, 0x050380e7, 0x050380e7 },
+ { 0x0000a394, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7 },
+ { 0x0000a398, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7 },
+ { 0x0000a3dc, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7 },
+ { 0x0000a3e0, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7 },
};
static const u_int32_t ar9285Modes_original_tx_gain_9285_1_2[][6] = {
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 8ae4ec2..6f923e3 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -825,13 +825,29 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds,
ds->ds_rxstat.rs_datalen = ads.ds_rxstatus1 & AR_DataLen;
ds->ds_rxstat.rs_tstamp = ads.AR_RcvTimestamp;
- ds->ds_rxstat.rs_rssi = MS(ads.ds_rxstatus4, AR_RxRSSICombined);
- ds->ds_rxstat.rs_rssi_ctl0 = MS(ads.ds_rxstatus0, AR_RxRSSIAnt00);
- ds->ds_rxstat.rs_rssi_ctl1 = MS(ads.ds_rxstatus0, AR_RxRSSIAnt01);
- ds->ds_rxstat.rs_rssi_ctl2 = MS(ads.ds_rxstatus0, AR_RxRSSIAnt02);
- ds->ds_rxstat.rs_rssi_ext0 = MS(ads.ds_rxstatus4, AR_RxRSSIAnt10);
- ds->ds_rxstat.rs_rssi_ext1 = MS(ads.ds_rxstatus4, AR_RxRSSIAnt11);
- ds->ds_rxstat.rs_rssi_ext2 = MS(ads.ds_rxstatus4, AR_RxRSSIAnt12);
+ if (ads.ds_rxstatus8 & AR_PostDelimCRCErr) {
+ ds->ds_rxstat.rs_rssi = ATH9K_RSSI_BAD;
+ ds->ds_rxstat.rs_rssi_ctl0 = ATH9K_RSSI_BAD;
+ ds->ds_rxstat.rs_rssi_ctl1 = ATH9K_RSSI_BAD;
+ ds->ds_rxstat.rs_rssi_ctl2 = ATH9K_RSSI_BAD;
+ ds->ds_rxstat.rs_rssi_ext0 = ATH9K_RSSI_BAD;
+ ds->ds_rxstat.rs_rssi_ext1 = ATH9K_RSSI_BAD;
+ ds->ds_rxstat.rs_rssi_ext2 = ATH9K_RSSI_BAD;
+ } else {
+ ds->ds_rxstat.rs_rssi = MS(ads.ds_rxstatus4, AR_RxRSSICombined);
+ ds->ds_rxstat.rs_rssi_ctl0 = MS(ads.ds_rxstatus0,
+ AR_RxRSSIAnt00);
+ ds->ds_rxstat.rs_rssi_ctl1 = MS(ads.ds_rxstatus0,
+ AR_RxRSSIAnt01);
+ ds->ds_rxstat.rs_rssi_ctl2 = MS(ads.ds_rxstatus0,
+ AR_RxRSSIAnt02);
+ ds->ds_rxstat.rs_rssi_ext0 = MS(ads.ds_rxstatus4,
+ AR_RxRSSIAnt10);
+ ds->ds_rxstat.rs_rssi_ext1 = MS(ads.ds_rxstatus4,
+ AR_RxRSSIAnt11);
+ ds->ds_rxstat.rs_rssi_ext2 = MS(ads.ds_rxstatus4,
+ AR_RxRSSIAnt12);
+ }
if (ads.ds_rxstatus8 & AR_RxKeyIdxValid)
ds->ds_rxstat.rs_keyix = MS(ads.ds_rxstatus8, AR_KeyIdx);
else
--
1.6.0.4
^ permalink raw reply related
* [PATCH 1/7] ath9k: Manipulate and report the correct RSSI
From: Senthil Balasubramanian @ 2009-06-24 13:26 UTC (permalink / raw)
To: linville
Cc: Jouni.Malinen, Luis.Rodriguez, linux-wireless,
Senthil Balasubramanian, Vasanthakumar Thiagarajan
In-Reply-To: <1245850002-26351-1-git-send-email-senthilkumar@atheros.com>
RSSI reported by the RX descriptor requires little manipulation.
Manipulate and report the correct RSSI to the stack. This will
fix the improper signal levels reported by iwconfig iw dev wlanX
station dump. Also the Link Quality reported seems to be varying
(falls to zero also sometimes) when iperf is run from STA to AP.
Also use the default noise floor for now as the one reported
during the caliberation seems to be wrong.
The Signal and Link Quality before this patch (taken while TX is
in progress from STA to AP)
09:59:13.285428037 Link Quality=29/70 Signal level=-81 dBm
09:59:13.410660084 Link Quality=20/70 Signal level=-90 dBm
09:59:13.586864392 Link Quality=21/70 Signal level=-89 dBm
09:59:13.710296281 Link Quality=21/70 Signal level=-89 dBm
09:59:13.821683064 Link Quality=25/70 Signal level=-85 dBm
09:59:13.933402989 Link Quality=24/70 Signal level=-86 dBm
09:59:14.045839276 Link Quality=26/70 Signal level=-84 dBm
09:59:14.193926673 Link Quality=23/70 Signal level=-87 dBm
09:59:14.306230262 Link Quality=31/70 Signal level=-79 dBm
09:59:14.419459667 Link Quality=26/70 Signal level=-84 dBm
09:59:14.530711167 Link Quality=37/70 Signal level=-73 dBm
09:59:14.642593962 Link Quality=29/70 Signal level=-81 dBm
09:59:14.754361169 Link Quality=21/70 Signal level=-89 dBm
09:59:14.866217355 Link Quality=21/70 Signal level=-89 dBm
09:59:14.976963623 Link Quality=28/70 Signal level=-82 dBm
09:59:15.089149809 Link Quality=26/70 Signal level=-84 dBm
09:59:15.205039887 Link Quality=27/70 Signal level=-83 dBm
09:59:15.316368003 Link Quality=23/70 Signal level=-87 dBm
09:59:15.427684036 Link Quality=36/70 Signal level=-74 dBm
09:59:15.539756380 Link Quality=21/70 Signal level=-89 dBm
09:59:15.650549093 Link Quality=22/70 Signal level=-88 dBm
09:59:15.761171672 Link Quality=32/70 Signal level=-78 dBm
09:59:15.872793750 Link Quality=23/70 Signal level=-87 dBm
09:59:15.984421694 Link Quality=22/70 Signal level=-88 dBm
09:59:16.097315093 Link Quality=21/70 Signal level=-89 dBm
The link quality and signal level after this patch (take while
TX is in progress from STA to AP)
17:21:25.627848091 Link Quality=65/70 Signal level=-45 dBm
17:21:25.762805607 Link Quality=65/70 Signal level=-45 dBm
17:21:25.875521888 Link Quality=66/70 Signal level=-44 dBm
17:21:25.987468448 Link Quality=66/70 Signal level=-44 dBm
17:21:26.100628151 Link Quality=66/70 Signal level=-44 dBm
17:21:26.213129671 Link Quality=66/70 Signal level=-44 dBm
17:21:26.324923070 Link Quality=65/70 Signal level=-45 dBm
17:21:26.436831357 Link Quality=65/70 Signal level=-45 dBm
17:21:26.610356973 Link Quality=65/70 Signal level=-45 dBm
17:21:26.723340047 Link Quality=65/70 Signal level=-45 dBm
17:21:26.835715293 Link Quality=64/70 Signal level=-46 dBm
17:21:26.949542748 Link Quality=64/70 Signal level=-46 dBm
17:21:27.062261613 Link Quality=65/70 Signal level=-45 dBm
17:21:27.174511563 Link Quality=64/70 Signal level=-46 dBm
17:21:27.287616232 Link Quality=64/70 Signal level=-46 dBm
17:21:27.400598119 Link Quality=64/70 Signal level=-46 dBm
17:21:27.511381404 Link Quality=64/70 Signal level=-46 dBm
17:21:27.624530421 Link Quality=65/70 Signal level=-45 dBm
17:21:27.737807109 Link Quality=64/70 Signal level=-46 dBm
17:21:27.850861352 Link Quality=65/70 Signal level=-45 dBm
17:21:27.963369436 Link Quality=64/70 Signal level=-46 dBm
17:21:28.076582289 Link Quality=64/70 Signal level=-46 dBm
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 16 ++++++++++++++++
drivers/net/wireless/ath/ath9k/calib.c | 13 ++++++++++---
drivers/net/wireless/ath/ath9k/calib.h | 4 +++-
drivers/net/wireless/ath/ath9k/main.c | 1 +
drivers/net/wireless/ath/ath9k/recv.c | 25 ++++++++++++++++++++++++-
5 files changed, 54 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 7425a1f..6fa72b8 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -295,12 +295,28 @@ struct ath_tx_control {
#define ATH_TX_XRETRY 0x02
#define ATH_TX_BAR 0x04
+#define ATH_RSSI_LPF_LEN 10
+#define RSSI_LPF_THRESHOLD -20
+#define ATH9K_RSSI_BAD 0x80
+#define ATH_RSSI_EP_MULTIPLIER (1<<7)
+#define ATH_EP_MUL(x, mul) ((x) * (mul))
+#define ATH_RSSI_IN(x) (ATH_EP_MUL((x), ATH_RSSI_EP_MULTIPLIER))
+#define ATH_LPF_RSSI(x, y, len) \
+ ((x != ATH_RSSI_DUMMY_MARKER) ? (((x) * ((len) - 1) + (y)) / (len)) : (y))
+#define ATH_RSSI_LPF(x, y) do { \
+ if ((y) >= RSSI_LPF_THRESHOLD) \
+ x = ATH_LPF_RSSI((x), ATH_RSSI_IN((y)), ATH_RSSI_LPF_LEN); \
+} while (0)
+#define ATH_EP_RND(x, mul) \
+ ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
+
struct ath_node {
struct ath_softc *an_sc;
struct ath_atx_tid tid[WME_NUM_TID];
struct ath_atx_ac ac[WME_NUM_AC];
u16 maxampdu;
u8 mpdudensity;
+ int last_rssi;
};
struct ath_tx {
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
index a32d7e7..1f0c5fe 100644
--- a/drivers/net/wireless/ath/ath9k/calib.c
+++ b/drivers/net/wireless/ath/ath9k/calib.c
@@ -691,15 +691,22 @@ int16_t ath9k_hw_getnf(struct ath_hw *ah,
void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah)
{
int i, j;
+ s16 noise_floor;
+
+ if (AR_SREV_9280(ah))
+ noise_floor = AR_PHY_CCA_MAX_AR9280_GOOD_VALUE;
+ else if (AR_SREV_9285(ah))
+ noise_floor = AR_PHY_CCA_MAX_AR9285_GOOD_VALUE;
+ else
+ noise_floor = AR_PHY_CCA_MAX_AR5416_GOOD_VALUE;
for (i = 0; i < NUM_NF_READINGS; i++) {
ah->nfCalHist[i].currIndex = 0;
- ah->nfCalHist[i].privNF = AR_PHY_CCA_MAX_GOOD_VALUE;
+ ah->nfCalHist[i].privNF = noise_floor;
ah->nfCalHist[i].invalidNFcount =
AR_PHY_CCA_FILTERWINDOW_LENGTH;
for (j = 0; j < ATH9K_NF_CAL_HIST_MAX; j++) {
- ah->nfCalHist[i].nfCalBuffer[j] =
- AR_PHY_CCA_MAX_GOOD_VALUE;
+ ah->nfCalHist[i].nfCalBuffer[j] = noise_floor;
}
}
}
diff --git a/drivers/net/wireless/ath/ath9k/calib.h b/drivers/net/wireless/ath/ath9k/calib.h
index fe5367f..547e697 100644
--- a/drivers/net/wireless/ath/ath9k/calib.h
+++ b/drivers/net/wireless/ath/ath9k/calib.h
@@ -25,7 +25,9 @@ extern const struct ath9k_percal_data adc_dc_cal_multi_sample;
extern const struct ath9k_percal_data adc_dc_cal_single_sample;
extern const struct ath9k_percal_data adc_init_dc_cal;
-#define AR_PHY_CCA_MAX_GOOD_VALUE -85
+#define AR_PHY_CCA_MAX_AR5416_GOOD_VALUE -85
+#define AR_PHY_CCA_MAX_AR9280_GOOD_VALUE -112
+#define AR_PHY_CCA_MAX_AR9285_GOOD_VALUE -118
#define AR_PHY_CCA_MAX_HIGH_VALUE -62
#define AR_PHY_CCA_MIN_BAD_VALUE -140
#define AR_PHY_CCA_FILTERWINDOW_LENGTH_INIT 3
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 66a6c1f..f2bbc28 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -463,6 +463,7 @@ static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta)
an->maxampdu = 1 << (IEEE80211_HTCAP_MAXRXAMPDU_FACTOR +
sta->ht_cap.ampdu_factor);
an->mpdudensity = parse_mpdudensity(sta->ht_cap.ampdu_density);
+ an->last_rssi = ATH_RSSI_DUMMY_MARKER;
}
}
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 2b2872b..214c4bb 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -145,6 +145,10 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
u8 ratecode;
__le16 fc;
struct ieee80211_hw *hw;
+ struct ieee80211_sta *sta;
+ struct ath_node *an;
+ int last_rssi = ATH_RSSI_DUMMY_MARKER;
+
hdr = (struct ieee80211_hdr *)skb->data;
fc = hdr->frame_control;
@@ -229,11 +233,30 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds,
}
}
+ rcu_read_lock();
+ sta = ieee80211_find_sta(sc->hw, hdr->addr2);
+ if (sta) {
+ an = (struct ath_node *) sta->drv_priv;
+ if (ds->ds_rxstat.rs_rssi != ATH9K_RSSI_BAD &&
+ !ds->ds_rxstat.rs_moreaggr)
+ ATH_RSSI_LPF(an->last_rssi, ds->ds_rxstat.rs_rssi);
+ last_rssi = an->last_rssi;
+ }
+ rcu_read_unlock();
+
+ if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
+ ds->ds_rxstat.rs_rssi = ATH_EP_RND(last_rssi,
+ ATH_RSSI_EP_MULTIPLIER);
+ if (ds->ds_rxstat.rs_rssi < 0)
+ ds->ds_rxstat.rs_rssi = 0;
+ else if (ds->ds_rxstat.rs_rssi > 127)
+ ds->ds_rxstat.rs_rssi = 127;
+
rx_status->mactime = ath_extend_tsf(sc, ds->ds_rxstat.rs_tstamp);
rx_status->band = hw->conf.channel->band;
rx_status->freq = hw->conf.channel->center_freq;
rx_status->noise = sc->ani.noise_floor;
- rx_status->signal = rx_status->noise + ds->ds_rxstat.rs_rssi;
+ rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + ds->ds_rxstat.rs_rssi;
rx_status->antenna = ds->ds_rxstat.rs_antenna;
/* at 45 you will be able to use MCS 15 reliably. A more elaborate
--
1.6.0.4
^ permalink raw reply related
* [PATCH 0/7] *** SUBJECT HERE ***
From: Senthil Balasubramanian @ 2009-06-24 13:26 UTC (permalink / raw)
To: linville
Cc: Jouni.Malinen, Luis.Rodriguez, linux-wireless,
Senthil Balasubramanian
John,
I have updated the commit logs as requested by you and also
rebased & reorganized my earlier series on the TIP of wireless-testing.
It would be great if the following patches can make it for 2.6.31.
ath9k: Manipulate and report the correct RSSI
ath9k: RX stucks during heavy traffic in HT40 mode.
ath9k: Fix TX hang issue with Atheros chipsets
Senthil
Senthil Balasubramanian (7):
ath9k: Manipulate and report the correct RSSI
ath9k: RX stucks during heavy traffic in HT40 mode.
ath9k: Fix TX hang issue with Atheros chipsets
ath9k: remove unnecessary STATION mode check.
ath9k: stop ani when the STA gets disconnected.
ath9k: race condition in SCANNING state check during ANI calibration
ath9k: Handle different TX and RX streams properly.
drivers/net/wireless/ath/ath9k/ath9k.h | 21 +++++++++
drivers/net/wireless/ath/ath9k/calib.c | 13 ++++-
drivers/net/wireless/ath/ath9k/calib.h | 4 +-
drivers/net/wireless/ath/ath9k/eeprom.c | 20 ++++++++-
drivers/net/wireless/ath/ath9k/initvals.h | 47 +++++++++++----------
drivers/net/wireless/ath/ath9k/mac.c | 30 ++++++++++---
drivers/net/wireless/ath/ath9k/main.c | 66 ++++++++++++++++------------
drivers/net/wireless/ath/ath9k/recv.c | 25 ++++++++++-
drivers/net/wireless/ath/ath9k/xmit.c | 57 +++++++++++++++++++------
9 files changed, 206 insertions(+), 77 deletions(-)
^ permalink raw reply
* [RFC 11/11] cfg80211: self-contained wext handling
From: Johannes Berg @ 2009-06-24 12:07 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <20090624120745.239294066@sipsolutions.net>
Finally! This is what you've all been waiting for!
This patch makes cfg80211 take care of wext emulation
_completely_ by itself, the driver doesn't even need
to use the handlers and create a handler struct etc.
any more, all handled by cfg80211. This means we can
also clean up mac80211's Kconfig and make it possible
to build mac80211 w/o WEXT now!
WEXT IS DEAD.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/cfg80211.h | 103 ------------------
net/mac80211/Kconfig | 1
net/mac80211/Makefile | 1
net/mac80211/ieee80211_i.h | 4
net/mac80211/iface.c | 1
net/mac80211/scan.c | 1
net/mac80211/wext.c | 98 -----------------
net/wireless/core.c | 2
net/wireless/scan.c | 3
net/wireless/wext-compat.c | 257 +++++++++++++++++++++++++--------------------
net/wireless/wext-compat.h | 14 ++
net/wireless/wext-sme.c | 2
12 files changed, 164 insertions(+), 323 deletions(-)
--- wireless-testing.orig/net/mac80211/wext.c 2009-06-24 13:54:10.000000000 +0200
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright 2002-2005, Instant802 Networks, Inc.
- * Copyright 2005-2006, Devicescape Software, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/netdevice.h>
-#include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/skbuff.h>
-#include <linux/etherdevice.h>
-#include <linux/if_arp.h>
-#include <linux/wireless.h>
-#include <net/iw_handler.h>
-#include <asm/uaccess.h>
-
-#include <net/mac80211.h>
-#include "ieee80211_i.h"
-#include "led.h"
-#include "rate.h"
-#include "wpa.h"
-#include "aes_ccm.h"
-
-
-
-/* Structures to export the Wireless Handlers */
-
-static const iw_handler ieee80211_handler[] =
-{
- (iw_handler) NULL, /* SIOCSIWCOMMIT */
- (iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
- (iw_handler) NULL, /* SIOCSIWNWID */
- (iw_handler) NULL, /* SIOCGIWNWID */
- (iw_handler) cfg80211_wext_siwfreq, /* SIOCSIWFREQ */
- (iw_handler) cfg80211_wext_giwfreq, /* SIOCGIWFREQ */
- (iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
- (iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
- (iw_handler) NULL, /* SIOCSIWSENS */
- (iw_handler) NULL, /* SIOCGIWSENS */
- (iw_handler) NULL /* not used */, /* SIOCSIWRANGE */
- (iw_handler) cfg80211_wext_giwrange, /* SIOCGIWRANGE */
- (iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
- (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
- (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
- (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
- (iw_handler) NULL, /* SIOCSIWSPY */
- (iw_handler) NULL, /* SIOCGIWSPY */
- (iw_handler) NULL, /* SIOCSIWTHRSPY */
- (iw_handler) NULL, /* SIOCGIWTHRSPY */
- (iw_handler) cfg80211_wext_siwap, /* SIOCSIWAP */
- (iw_handler) cfg80211_wext_giwap, /* SIOCGIWAP */
- (iw_handler) cfg80211_wext_siwmlme, /* SIOCSIWMLME */
- (iw_handler) NULL, /* SIOCGIWAPLIST */
- (iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
- (iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
- (iw_handler) cfg80211_wext_siwessid, /* SIOCSIWESSID */
- (iw_handler) cfg80211_wext_giwessid, /* SIOCGIWESSID */
- (iw_handler) NULL, /* SIOCSIWNICKN */
- (iw_handler) NULL, /* SIOCGIWNICKN */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) cfg80211_wext_siwrate, /* SIOCSIWRATE */
- (iw_handler) cfg80211_wext_giwrate, /* SIOCGIWRATE */
- (iw_handler) cfg80211_wext_siwrts, /* SIOCSIWRTS */
- (iw_handler) cfg80211_wext_giwrts, /* SIOCGIWRTS */
- (iw_handler) cfg80211_wext_siwfrag, /* SIOCSIWFRAG */
- (iw_handler) cfg80211_wext_giwfrag, /* SIOCGIWFRAG */
- (iw_handler) cfg80211_wext_siwtxpower, /* SIOCSIWTXPOW */
- (iw_handler) cfg80211_wext_giwtxpower, /* SIOCGIWTXPOW */
- (iw_handler) cfg80211_wext_siwretry, /* SIOCSIWRETRY */
- (iw_handler) cfg80211_wext_giwretry, /* SIOCGIWRETRY */
- (iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */
- (iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */
- (iw_handler) cfg80211_wext_siwpower, /* SIOCSIWPOWER */
- (iw_handler) cfg80211_wext_giwpower, /* SIOCGIWPOWER */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) cfg80211_wext_siwgenie, /* SIOCSIWGENIE */
- (iw_handler) NULL, /* SIOCGIWGENIE */
- (iw_handler) cfg80211_wext_siwauth, /* SIOCSIWAUTH */
- (iw_handler) cfg80211_wext_giwauth, /* SIOCGIWAUTH */
- (iw_handler) cfg80211_wext_siwencodeext, /* SIOCSIWENCODEEXT */
- (iw_handler) NULL, /* SIOCGIWENCODEEXT */
- (iw_handler) NULL, /* SIOCSIWPMKSA */
- (iw_handler) NULL, /* -- hole -- */
-};
-
-const struct iw_handler_def ieee80211_iw_handler_def =
-{
- .num_standard = ARRAY_SIZE(ieee80211_handler),
- .standard = (iw_handler *) ieee80211_handler,
- .get_wireless_stats = cfg80211_wireless_stats,
-};
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-06-24 13:54:11.000000000 +0200
@@ -17,9 +17,9 @@
#include "wext-compat.h"
#include "core.h"
-int cfg80211_wext_giwname(struct net_device *dev,
- struct iw_request_info *info,
- char *name, char *extra)
+static int cfg80211_wext_giwname(struct net_device *dev,
+ struct iw_request_info *info,
+ char *name, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct ieee80211_supported_band *sband;
@@ -59,10 +59,10 @@ int cfg80211_wext_giwname(struct net_dev
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwname);
-int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
- u32 *mode, char *extra)
+static int cfg80211_wext_siwmode(struct net_device *dev,
+ struct iw_request_info *info,
+ u32 *mode, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev;
@@ -110,10 +110,10 @@ int cfg80211_wext_siwmode(struct net_dev
return ret;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwmode);
-int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
- u32 *mode, char *extra)
+static int cfg80211_wext_giwmode(struct net_device *dev,
+ struct iw_request_info *info,
+ u32 *mode, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -145,12 +145,11 @@ int cfg80211_wext_giwmode(struct net_dev
}
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwmode);
-int cfg80211_wext_giwrange(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *extra)
+static int cfg80211_wext_giwrange(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct iw_range *range = (struct iw_range *) extra;
@@ -260,8 +259,6 @@ int cfg80211_wext_giwrange(struct net_de
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwrange);
-
/**
* cfg80211_wext_freq - get wext frequency for non-"auto"
@@ -303,9 +300,9 @@ struct ieee80211_channel *cfg80211_wext_
return chan;
}
-int cfg80211_wext_siwrts(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rts, char *extra)
+static int cfg80211_wext_siwrts(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *rts, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -326,11 +323,10 @@ int cfg80211_wext_siwrts(struct net_devi
return err;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwrts);
-int cfg80211_wext_giwrts(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rts, char *extra)
+static int cfg80211_wext_giwrts(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *rts, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -340,11 +336,10 @@ int cfg80211_wext_giwrts(struct net_devi
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwrts);
-int cfg80211_wext_siwfrag(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *frag, char *extra)
+static int cfg80211_wext_siwfrag(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *frag, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -367,11 +362,10 @@ int cfg80211_wext_siwfrag(struct net_dev
return err;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwfrag);
-int cfg80211_wext_giwfrag(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *frag, char *extra)
+static int cfg80211_wext_giwfrag(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *frag, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -381,11 +375,10 @@ int cfg80211_wext_giwfrag(struct net_dev
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwfrag);
-int cfg80211_wext_siwretry(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *retry, char *extra)
+static int cfg80211_wext_siwretry(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *retry, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -422,11 +415,10 @@ int cfg80211_wext_siwretry(struct net_de
return err;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwretry);
-int cfg80211_wext_giwretry(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *retry, char *extra)
+static int cfg80211_wext_giwretry(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *retry, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -452,7 +444,6 @@ int cfg80211_wext_giwretry(struct net_de
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwretry);
static int cfg80211_set_encryption(struct cfg80211_registered_device *rdev,
struct net_device *dev, const u8 *addr,
@@ -519,9 +510,9 @@ static int cfg80211_set_encryption(struc
}
}
-int cfg80211_wext_siwencode(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *erq, char *keybuf)
+static int cfg80211_wext_siwencode(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *erq, char *keybuf)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -569,11 +560,10 @@ int cfg80211_wext_siwencode(struct net_d
wdev->wext.default_key == -1,
idx, ¶ms);
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwencode);
-int cfg80211_wext_siwencodeext(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *erq, char *extra)
+static int cfg80211_wext_siwencodeext(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *erq, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -655,7 +645,6 @@ int cfg80211_wext_siwencodeext(struct ne
ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY,
idx, ¶ms);
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwencodeext);
struct giwencode_cookie {
size_t buflen;
@@ -675,9 +664,9 @@ static void giwencode_get_key_cb(void *c
memcpy(data->keybuf, params->key, data->buflen);
}
-int cfg80211_wext_giwencode(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *erq, char *keybuf)
+static int cfg80211_wext_giwencode(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *erq, char *keybuf)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -718,11 +707,10 @@ int cfg80211_wext_giwencode(struct net_d
return err;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwencode);
-int cfg80211_wext_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
+static int cfg80211_wext_siwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -748,11 +736,10 @@ int cfg80211_wext_siwfreq(struct net_dev
return 0;
}
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwfreq);
-int cfg80211_wext_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
+static int cfg80211_wext_giwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -770,11 +757,10 @@ int cfg80211_wext_giwfreq(struct net_dev
return 0;
}
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwfreq);
-int cfg80211_wext_siwtxpower(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *data, char *extra)
+static int cfg80211_wext_siwtxpower(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *data, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -823,11 +809,10 @@ int cfg80211_wext_siwtxpower(struct net_
return rdev->ops->set_tx_power(wdev->wiphy, type, dbm);;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwtxpower);
-int cfg80211_wext_giwtxpower(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *data, char *extra)
+static int cfg80211_wext_giwtxpower(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *data, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -853,11 +838,10 @@ int cfg80211_wext_giwtxpower(struct net_
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwtxpower);
-int cfg80211_wext_siwauth(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *data, char *extra)
+static int cfg80211_wext_siwauth(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *data, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
int ret;
@@ -889,21 +873,19 @@ int cfg80211_wext_siwauth(struct net_dev
return ret;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwauth);
-int cfg80211_wext_giwauth(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *data, char *extra)
+static int cfg80211_wext_giwauth(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *data, char *extra)
{
/* XXX: what do we need? */
return -EOPNOTSUPP;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwauth);
-int cfg80211_wext_siwpower(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *wrq, char *extra)
+static int cfg80211_wext_siwpower(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *wrq, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -947,11 +929,10 @@ int cfg80211_wext_siwpower(struct net_de
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwpower);
-int cfg80211_wext_giwpower(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *wrq, char *extra)
+static int cfg80211_wext_giwpower(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *wrq, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -959,7 +940,6 @@ int cfg80211_wext_giwpower(struct net_de
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwpower);
static int cfg80211_wds_wext_siwap(struct net_device *dev,
struct iw_request_info *info,
@@ -1004,11 +984,10 @@ static int cfg80211_wds_wext_giwap(struc
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wds_wext_giwap);
-int cfg80211_wext_siwrate(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rate, char *extra)
+static int cfg80211_wext_siwrate(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *rate, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -1018,11 +997,10 @@ int cfg80211_wext_siwrate(struct net_dev
return rdev->ops->set_bitrate(wdev->wiphy, dev, rate);
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwrate);
-int cfg80211_wext_giwrate(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rate, char *extra)
+static int cfg80211_wext_giwrate(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *rate, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -1032,10 +1010,9 @@ int cfg80211_wext_giwrate(struct net_dev
return rdev->ops->get_bitrate(wdev->wiphy, dev, rate);
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwrate);
/* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */
-struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
+static struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -1102,11 +1079,10 @@ struct iw_statistics *cfg80211_wireless_
return &wstats;
}
-EXPORT_SYMBOL_GPL(cfg80211_wireless_stats);
-int cfg80211_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
+static int cfg80211_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -1121,11 +1097,10 @@ int cfg80211_wext_siwap(struct net_devic
return -EOPNOTSUPP;
}
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwap);
-int cfg80211_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
+static int cfg80211_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -1140,11 +1115,10 @@ int cfg80211_wext_giwap(struct net_devic
return -EOPNOTSUPP;
}
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwap);
-int cfg80211_wext_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid)
+static int cfg80211_wext_siwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -1157,11 +1131,10 @@ int cfg80211_wext_siwessid(struct net_de
return -EOPNOTSUPP;
}
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwessid);
-int cfg80211_wext_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid)
+static int cfg80211_wext_giwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -1174,4 +1147,68 @@ int cfg80211_wext_giwessid(struct net_de
return -EOPNOTSUPP;
}
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwessid);
+
+static const iw_handler ieee80211_handler[] = {
+ (iw_handler) NULL, /* SIOCSIWCOMMIT */
+ (iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
+ (iw_handler) NULL, /* SIOCSIWNWID */
+ (iw_handler) NULL, /* SIOCGIWNWID */
+ (iw_handler) cfg80211_wext_siwfreq, /* SIOCSIWFREQ */
+ (iw_handler) cfg80211_wext_giwfreq, /* SIOCGIWFREQ */
+ (iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
+ (iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
+ (iw_handler) NULL, /* SIOCSIWSENS */
+ (iw_handler) NULL, /* SIOCGIWSENS */
+ (iw_handler) NULL /* not used */, /* SIOCSIWRANGE */
+ (iw_handler) cfg80211_wext_giwrange, /* SIOCGIWRANGE */
+ (iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
+ (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
+ (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
+ (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
+ (iw_handler) NULL, /* SIOCSIWSPY */
+ (iw_handler) NULL, /* SIOCGIWSPY */
+ (iw_handler) NULL, /* SIOCSIWTHRSPY */
+ (iw_handler) NULL, /* SIOCGIWTHRSPY */
+ (iw_handler) cfg80211_wext_siwap, /* SIOCSIWAP */
+ (iw_handler) cfg80211_wext_giwap, /* SIOCGIWAP */
+ (iw_handler) cfg80211_wext_siwmlme, /* SIOCSIWMLME */
+ (iw_handler) NULL, /* SIOCGIWAPLIST */
+ (iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
+ (iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
+ (iw_handler) cfg80211_wext_siwessid, /* SIOCSIWESSID */
+ (iw_handler) cfg80211_wext_giwessid, /* SIOCGIWESSID */
+ (iw_handler) NULL, /* SIOCSIWNICKN */
+ (iw_handler) NULL, /* SIOCGIWNICKN */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) cfg80211_wext_siwrate, /* SIOCSIWRATE */
+ (iw_handler) cfg80211_wext_giwrate, /* SIOCGIWRATE */
+ (iw_handler) cfg80211_wext_siwrts, /* SIOCSIWRTS */
+ (iw_handler) cfg80211_wext_giwrts, /* SIOCGIWRTS */
+ (iw_handler) cfg80211_wext_siwfrag, /* SIOCSIWFRAG */
+ (iw_handler) cfg80211_wext_giwfrag, /* SIOCGIWFRAG */
+ (iw_handler) cfg80211_wext_siwtxpower, /* SIOCSIWTXPOW */
+ (iw_handler) cfg80211_wext_giwtxpower, /* SIOCGIWTXPOW */
+ (iw_handler) cfg80211_wext_siwretry, /* SIOCSIWRETRY */
+ (iw_handler) cfg80211_wext_giwretry, /* SIOCGIWRETRY */
+ (iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */
+ (iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */
+ (iw_handler) cfg80211_wext_siwpower, /* SIOCSIWPOWER */
+ (iw_handler) cfg80211_wext_giwpower, /* SIOCGIWPOWER */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) cfg80211_wext_siwgenie, /* SIOCSIWGENIE */
+ (iw_handler) NULL, /* SIOCGIWGENIE */
+ (iw_handler) cfg80211_wext_siwauth, /* SIOCSIWAUTH */
+ (iw_handler) cfg80211_wext_giwauth, /* SIOCGIWAUTH */
+ (iw_handler) cfg80211_wext_siwencodeext, /* SIOCSIWENCODEEXT */
+ (iw_handler) NULL, /* SIOCGIWENCODEEXT */
+ (iw_handler) NULL, /* SIOCSIWPMKSA */
+ (iw_handler) NULL, /* -- hole -- */
+};
+
+const struct iw_handler_def cfg80211_wext_handler = {
+ .num_standard = ARRAY_SIZE(ieee80211_handler),
+ .standard = (iw_handler *) ieee80211_handler,
+ .get_wireless_stats = cfg80211_wireless_stats,
+};
--- wireless-testing.orig/net/wireless/wext-compat.h 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.h 2009-06-24 13:54:11.000000000 +0200
@@ -38,8 +38,22 @@ int cfg80211_mgd_wext_siwessid(struct ne
int cfg80211_mgd_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid);
+int cfg80211_wext_siwgenie(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *extra);
+int cfg80211_wext_siwmlme(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *extra);
+
+int cfg80211_wext_siwscan(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra);
+int cfg80211_wext_giwscan(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *extra);
struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
struct iw_freq *freq);
+extern const struct iw_handler_def cfg80211_wext_handler;
#endif /* __WEXT_COMPAT */
--- wireless-testing.orig/net/mac80211/Kconfig 2009-06-24 13:54:07.000000000 +0200
+++ wireless-testing/net/mac80211/Kconfig 2009-06-24 13:54:11.000000000 +0200
@@ -6,7 +6,6 @@ config MAC80211
select CRYPTO_ARC4
select CRYPTO_AES
select CRC32
- select WIRELESS_EXT
---help---
This option enables the hardware independent IEEE 802.11
networking stack.
--- wireless-testing.orig/net/mac80211/Makefile 2009-06-24 13:48:25.000000000 +0200
+++ wireless-testing/net/mac80211/Makefile 2009-06-24 13:54:11.000000000 +0200
@@ -3,7 +3,6 @@ obj-$(CONFIG_MAC80211) += mac80211.o
# mac80211 objects
mac80211-y := \
main.o \
- wext.o \
sta_info.o \
wep.o \
wpa.o \
--- wireless-testing.orig/net/mac80211/scan.c 2009-06-24 13:48:25.000000000 +0200
+++ wireless-testing/net/mac80211/scan.c 2009-06-24 13:54:11.000000000 +0200
@@ -18,7 +18,6 @@
#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <net/mac80211.h>
-#include <net/iw_handler.h>
#include "ieee80211_i.h"
#include "driver-ops.h"
--- wireless-testing.orig/net/mac80211/ieee80211_i.h 2009-06-24 13:54:04.000000000 +0200
+++ wireless-testing/net/mac80211/ieee80211_i.h 2009-06-24 13:54:11.000000000 +0200
@@ -24,7 +24,6 @@
#include <linux/spinlock.h>
#include <linux/etherdevice.h>
#include <net/cfg80211.h>
-#include <net/iw_handler.h>
#include <net/mac80211.h>
#include "key.h"
#include "sta_info.h"
@@ -935,9 +934,6 @@ void ieee80211_bss_info_change_notify(st
void ieee80211_configure_filter(struct ieee80211_local *local);
u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata);
-/* wireless extensions */
-extern const struct iw_handler_def ieee80211_iw_handler_def;
-
/* STA code */
void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata);
ieee80211_rx_result ieee80211_sta_rx_mgmt(struct ieee80211_sub_if_data *sdata,
--- wireless-testing.orig/net/mac80211/iface.c 2009-06-24 13:53:16.000000000 +0200
+++ wireless-testing/net/mac80211/iface.c 2009-06-24 13:54:11.000000000 +0200
@@ -694,7 +694,6 @@ static void ieee80211_if_setup(struct ne
{
ether_setup(dev);
dev->netdev_ops = &ieee80211_dataif_ops;
- dev->wireless_handlers = &ieee80211_iw_handler_def;
dev->destructor = free_netdev;
}
--- wireless-testing.orig/net/wireless/scan.c 2009-06-24 13:54:06.000000000 +0200
+++ wireless-testing/net/wireless/scan.c 2009-06-24 13:54:11.000000000 +0200
@@ -14,6 +14,7 @@
#include <net/iw_handler.h>
#include "core.h"
#include "nl80211.h"
+#include "wext-compat.h"
#define IEEE80211_SCAN_RESULT_EXPIRE (10 * HZ)
@@ -661,7 +662,6 @@ int cfg80211_wext_siwscan(struct net_dev
cfg80211_put_dev(rdev);
return err;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwscan);
static void ieee80211_scan_add_ies(struct iw_request_info *info,
struct cfg80211_bss *bss,
@@ -970,5 +970,4 @@ int cfg80211_wext_giwscan(struct net_dev
cfg80211_put_dev(rdev);
return res;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_giwscan);
#endif
--- wireless-testing.orig/net/wireless/core.c 2009-06-24 13:54:07.000000000 +0200
+++ wireless-testing/net/wireless/core.c 2009-06-24 13:54:11.000000000 +0200
@@ -19,6 +19,7 @@
#include "core.h"
#include "sysfs.h"
#include "debugfs.h"
+#include "wext-compat.h"
/* name for sysfs, %d is appended */
#define PHY_NAME "phy"
@@ -552,6 +553,7 @@ static int cfg80211_netdev_notifier_call
wdev->sme_state = CFG80211_SME_IDLE;
mutex_unlock(&rdev->devlist_mtx);
#ifdef CONFIG_WIRELESS_EXT
+ dev->wireless_handlers = &cfg80211_wext_handler;
wdev->wext.default_key = -1;
wdev->wext.default_mgmt_key = -1;
wdev->wext.ps = CONFIG_CFG80211_DEFAULT_PS_VALUE;
--- wireless-testing.orig/include/net/cfg80211.h 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-06-24 13:54:11.000000000 +0200
@@ -1500,109 +1500,6 @@ extern int freq_reg_info(struct wiphy *w
const struct ieee80211_reg_rule **reg_rule);
/*
- * Temporary wext handlers & helper functions
- *
- * In the future cfg80211 will simply assign the entire wext handler
- * structure to netdevs it manages, but we're not there yet.
- */
-int cfg80211_wext_giwname(struct net_device *dev,
- struct iw_request_info *info,
- char *name, char *extra);
-int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
- u32 *mode, char *extra);
-int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
- u32 *mode, char *extra);
-int cfg80211_wext_siwscan(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra);
-int cfg80211_wext_giwscan(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *extra);
-int cfg80211_wext_siwmlme(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *extra);
-int cfg80211_wext_giwrange(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *extra);
-int cfg80211_wext_siwgenie(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *extra);
-int cfg80211_wext_siwauth(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *data, char *extra);
-int cfg80211_wext_giwauth(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *data, char *extra);
-
-int cfg80211_wext_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
-int cfg80211_wext_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
-int cfg80211_wext_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
-int cfg80211_wext_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
-int cfg80211_wext_siwrate(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rate, char *extra);
-int cfg80211_wext_giwrate(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rate, char *extra);
-
-int cfg80211_wext_siwrts(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rts, char *extra);
-int cfg80211_wext_giwrts(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rts, char *extra);
-int cfg80211_wext_siwfrag(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *frag, char *extra);
-int cfg80211_wext_giwfrag(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *frag, char *extra);
-int cfg80211_wext_siwretry(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *retry, char *extra);
-int cfg80211_wext_giwretry(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *retry, char *extra);
-int cfg80211_wext_siwencodeext(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *erq, char *extra);
-int cfg80211_wext_siwencode(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *erq, char *keybuf);
-int cfg80211_wext_giwencode(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *erq, char *keybuf);
-int cfg80211_wext_siwtxpower(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *data, char *keybuf);
-int cfg80211_wext_giwtxpower(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *data, char *keybuf);
-struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev);
-
-int cfg80211_wext_siwpower(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *wrq, char *extra);
-int cfg80211_wext_giwpower(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *wrq, char *extra);
-
-int cfg80211_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
-int cfg80211_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
-
-/*
* callbacks for asynchronous cfg80211 methods, notification
* functions and BSS handling helpers
*/
--- wireless-testing.orig/net/wireless/wext-sme.c 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/net/wireless/wext-sme.c 2009-06-24 13:54:11.000000000 +0200
@@ -278,7 +278,6 @@ int cfg80211_wext_siwgenie(struct net_de
/* userspace better not think we'll reconnect */
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwgenie);
int cfg80211_wext_siwmlme(struct net_device *dev,
struct iw_request_info *info,
@@ -308,4 +307,3 @@ int cfg80211_wext_siwmlme(struct net_dev
return -EOPNOTSUPP;
}
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_siwmlme);
--
^ permalink raw reply
* [RFC 10/11] cfg80211: combine IWESSID handlers
From: Johannes Berg @ 2009-06-24 12:07 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <20090624120745.239294066@sipsolutions.net>
Since we now have handlers IWESSID for all modes, we can
combine them into one.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/cfg80211.h | 20 ++++++--------------
net/mac80211/wext.c | 35 ++---------------------------------
net/wireless/ibss.c | 4 ----
net/wireless/wext-compat.c | 34 ++++++++++++++++++++++++++++++++++
net/wireless/wext-compat.h | 12 ++++++++++++
net/wireless/wext-sme.c | 4 ----
6 files changed, 54 insertions(+), 55 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-06-24 13:54:10.000000000 +0200
@@ -1524,19 +1524,6 @@ int cfg80211_wext_siwmlme(struct net_dev
int cfg80211_wext_giwrange(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra);
-int cfg80211_ibss_wext_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
-int cfg80211_ibss_wext_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
-
-int cfg80211_mgd_wext_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
-int cfg80211_mgd_wext_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid);
int cfg80211_wext_siwgenie(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra);
@@ -1553,7 +1540,12 @@ int cfg80211_wext_siwfreq(struct net_dev
int cfg80211_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra);
-
+int cfg80211_wext_siwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
+int cfg80211_wext_giwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
int cfg80211_wext_siwrate(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *rate, char *extra);
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-06-24 13:54:10.000000000 +0200
@@ -1141,3 +1141,37 @@ int cfg80211_wext_giwap(struct net_devic
}
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwap);
+
+int cfg80211_wext_siwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwessid);
+
+int cfg80211_wext_giwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_giwessid);
--- wireless-testing.orig/net/wireless/wext-compat.h 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.h 2009-06-24 13:54:10.000000000 +0200
@@ -13,6 +13,12 @@ int cfg80211_ibss_wext_siwap(struct net_
int cfg80211_ibss_wext_giwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra);
+int cfg80211_ibss_wext_siwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
+int cfg80211_ibss_wext_giwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
struct iw_request_info *info,
@@ -26,6 +32,12 @@ int cfg80211_mgd_wext_siwap(struct net_d
int cfg80211_mgd_wext_giwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra);
+int cfg80211_mgd_wext_siwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
+int cfg80211_mgd_wext_giwessid(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *ssid);
struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
struct iw_freq *freq);
--- wireless-testing.orig/net/mac80211/wext.c 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-06-24 13:54:10.000000000 +0200
@@ -27,37 +27,6 @@
#include "aes_ccm.h"
-static int ieee80211_ioctl_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
- else if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
-
- return -EOPNOTSUPP;
-}
-
-
-static int ieee80211_ioctl_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *ssid)
-{
- struct ieee80211_sub_if_data *sdata;
-
- sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
- else if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
-
- return -EOPNOTSUPP;
-}
-
/* Structures to export the Wireless Handlers */
@@ -89,8 +58,8 @@ static const iw_handler ieee80211_handle
(iw_handler) NULL, /* SIOCGIWAPLIST */
(iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
(iw_handler) cfg80211_wext_giwscan, /* SIOCGIWSCAN */
- (iw_handler) ieee80211_ioctl_siwessid, /* SIOCSIWESSID */
- (iw_handler) ieee80211_ioctl_giwessid, /* SIOCGIWESSID */
+ (iw_handler) cfg80211_wext_siwessid, /* SIOCSIWESSID */
+ (iw_handler) cfg80211_wext_giwessid, /* SIOCGIWESSID */
(iw_handler) NULL, /* SIOCSIWNICKN */
(iw_handler) NULL, /* SIOCGIWNICKN */
(iw_handler) NULL, /* -- hole -- */
--- wireless-testing.orig/net/wireless/wext-sme.c 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/net/wireless/wext-sme.c 2009-06-24 13:54:10.000000000 +0200
@@ -145,8 +145,6 @@ int cfg80211_mgd_wext_siwessid(struct ne
return cfg80211_mgd_wext_connect(wiphy_to_dev(wdev->wiphy), wdev);
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_siwessid);
int cfg80211_mgd_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
@@ -173,8 +171,6 @@ int cfg80211_mgd_wext_giwessid(struct ne
return 0;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_giwessid);
int cfg80211_mgd_wext_siwap(struct net_device *dev,
struct iw_request_info *info,
--- wireless-testing.orig/net/wireless/ibss.c 2009-06-24 13:54:10.000000000 +0200
+++ wireless-testing/net/wireless/ibss.c 2009-06-24 13:54:10.000000000 +0200
@@ -257,8 +257,6 @@ int cfg80211_ibss_wext_siwessid(struct n
return cfg80211_ibss_wext_join(wiphy_to_dev(wdev->wiphy), wdev);
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_siwessid);
int cfg80211_ibss_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
@@ -284,8 +282,6 @@ int cfg80211_ibss_wext_giwessid(struct n
return 0;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_giwessid);
int cfg80211_ibss_wext_siwap(struct net_device *dev,
struct iw_request_info *info,
--
^ permalink raw reply
* [RFC 09/11] cfg80211: combine IWAP handlers
From: Johannes Berg @ 2009-06-24 12:07 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <20090624120745.239294066@sipsolutions.net>
Since we now have IWAP handlers for all modes, we can
combine them into one.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/cfg80211.h | 24 +++++----------------
net/mac80211/wext.c | 41 +-----------------------------------
net/wireless/ibss.c | 4 ---
net/wireless/wext-compat.c | 51 ++++++++++++++++++++++++++++++++++++++-------
net/wireless/wext-compat.h | 12 ++++++++++
net/wireless/wext-sme.c | 4 ---
6 files changed, 64 insertions(+), 72 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2009-06-24 13:54:09.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-06-24 13:54:10.000000000 +0200
@@ -1530,12 +1530,6 @@ int cfg80211_ibss_wext_siwessid(struct n
int cfg80211_ibss_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid);
-int cfg80211_ibss_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
-int cfg80211_ibss_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
int cfg80211_mgd_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
@@ -1543,12 +1537,6 @@ int cfg80211_mgd_wext_siwessid(struct ne
int cfg80211_mgd_wext_giwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid);
-int cfg80211_mgd_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
-int cfg80211_mgd_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra);
int cfg80211_wext_siwgenie(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra);
@@ -1615,12 +1603,12 @@ int cfg80211_wext_giwpower(struct net_de
struct iw_request_info *info,
struct iw_param *wrq, char *extra);
-int cfg80211_wds_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *addr, char *extra);
-int cfg80211_wds_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *addr, char *extra);
+int cfg80211_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
+int cfg80211_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
/*
* callbacks for asynchronous cfg80211 methods, notification
--- wireless-testing.orig/net/mac80211/wext.c 2009-06-24 13:54:09.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-06-24 13:54:10.000000000 +0200
@@ -59,43 +59,6 @@ static int ieee80211_ioctl_giwessid(stru
}
-static int ieee80211_ioctl_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_siwap(dev, info, ap_addr, extra);
-
- if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra);
-
- if (sdata->vif.type == NL80211_IFTYPE_WDS)
- return cfg80211_wds_wext_siwap(dev, info, ap_addr, extra);
- return -EOPNOTSUPP;
-}
-
-
-static int ieee80211_ioctl_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_giwap(dev, info, ap_addr, extra);
-
- if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra);
-
- if (sdata->vif.type == NL80211_IFTYPE_WDS)
- return cfg80211_wds_wext_giwap(dev, info, ap_addr, extra);
-
- return -EOPNOTSUPP;
-}
-
-
/* Structures to export the Wireless Handlers */
static const iw_handler ieee80211_handler[] =
@@ -120,8 +83,8 @@ static const iw_handler ieee80211_handle
(iw_handler) NULL, /* SIOCGIWSPY */
(iw_handler) NULL, /* SIOCSIWTHRSPY */
(iw_handler) NULL, /* SIOCGIWTHRSPY */
- (iw_handler) ieee80211_ioctl_siwap, /* SIOCSIWAP */
- (iw_handler) ieee80211_ioctl_giwap, /* SIOCGIWAP */
+ (iw_handler) cfg80211_wext_siwap, /* SIOCSIWAP */
+ (iw_handler) cfg80211_wext_giwap, /* SIOCGIWAP */
(iw_handler) cfg80211_wext_siwmlme, /* SIOCSIWMLME */
(iw_handler) NULL, /* SIOCGIWAPLIST */
(iw_handler) cfg80211_wext_siwscan, /* SIOCSIWSCAN */
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-06-24 13:54:09.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-06-24 13:54:10.000000000 +0200
@@ -961,9 +961,9 @@ int cfg80211_wext_giwpower(struct net_de
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwpower);
-int cfg80211_wds_wext_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *addr, char *extra)
+static int cfg80211_wds_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *addr, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
@@ -989,11 +989,10 @@ int cfg80211_wds_wext_siwap(struct net_d
return 0;
}
-EXPORT_SYMBOL_GPL(cfg80211_wds_wext_siwap);
-int cfg80211_wds_wext_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *addr, char *extra)
+static int cfg80211_wds_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *addr, char *extra)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
@@ -1104,3 +1103,41 @@ struct iw_statistics *cfg80211_wireless_
return &wstats;
}
EXPORT_SYMBOL_GPL(cfg80211_wireless_stats);
+
+int cfg80211_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_siwap(dev, info, ap_addr, extra);
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra);
+ case NL80211_IFTYPE_WDS:
+ return cfg80211_wds_wext_siwap(dev, info, ap_addr, extra);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwap);
+
+int cfg80211_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_giwap(dev, info, ap_addr, extra);
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra);
+ case NL80211_IFTYPE_WDS:
+ return cfg80211_wds_wext_giwap(dev, info, ap_addr, extra);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_giwap);
--- wireless-testing.orig/net/wireless/wext-compat.h 2009-06-24 13:54:09.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.h 2009-06-24 13:54:10.000000000 +0200
@@ -7,6 +7,12 @@ int cfg80211_ibss_wext_siwfreq(struct ne
int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra);
+int cfg80211_ibss_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
+int cfg80211_ibss_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
struct iw_request_info *info,
@@ -14,6 +20,12 @@ int cfg80211_mgd_wext_siwfreq(struct net
int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra);
+int cfg80211_mgd_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
+int cfg80211_mgd_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *ap_addr, char *extra);
struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
struct iw_freq *freq);
--- wireless-testing.orig/net/wireless/ibss.c 2009-06-24 13:54:09.000000000 +0200
+++ wireless-testing/net/wireless/ibss.c 2009-06-24 13:54:10.000000000 +0200
@@ -333,8 +333,6 @@ int cfg80211_ibss_wext_siwap(struct net_
return cfg80211_ibss_wext_join(wiphy_to_dev(wdev->wiphy), wdev);
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_siwap);
int cfg80211_ibss_wext_giwap(struct net_device *dev,
struct iw_request_info *info,
@@ -354,6 +352,4 @@ int cfg80211_ibss_wext_giwap(struct net_
memcpy(ap_addr->sa_data, wdev->wext.ibss.bssid, ETH_ALEN);
return 0;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_giwap);
#endif
--- wireless-testing.orig/net/wireless/wext-sme.c 2009-06-24 13:54:09.000000000 +0200
+++ wireless-testing/net/wireless/wext-sme.c 2009-06-24 13:54:10.000000000 +0200
@@ -220,8 +220,6 @@ int cfg80211_mgd_wext_siwap(struct net_d
return cfg80211_mgd_wext_connect(wiphy_to_dev(wdev->wiphy), wdev);
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_siwap);
int cfg80211_mgd_wext_giwap(struct net_device *dev,
struct iw_request_info *info,
@@ -242,8 +240,6 @@ int cfg80211_mgd_wext_giwap(struct net_d
return 0;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_giwap);
int cfg80211_wext_siwgenie(struct net_device *dev,
struct iw_request_info *info,
--
^ permalink raw reply
* [RFC 08/11] cfg80211: combine iwfreq implementations
From: Johannes Berg @ 2009-06-24 12:07 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <20090624120745.239294066@sipsolutions.net>
Until now we implemented iwfreq for managed mode, we
needed to keep the implementations separate, but now
that we have all versions implemented we can combine
them and export just one handler.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/cfg80211.h | 20 +++--------
net/mac80211/wext.c | 76 +--------------------------------------------
net/wireless/core.h | 3 +
net/wireless/ibss.c | 5 --
net/wireless/nl80211.c | 2 +
net/wireless/wext-compat.c | 54 +++++++++++++++++++++++++++++++
net/wireless/wext-compat.h | 21 ++++++++++++
net/wireless/wext-sme.c | 5 --
8 files changed, 89 insertions(+), 97 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2009-06-24 13:54:09.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-06-24 13:54:09.000000000 +0200
@@ -1524,12 +1524,6 @@ int cfg80211_wext_siwmlme(struct net_dev
int cfg80211_wext_giwrange(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra);
-int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
-int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
int cfg80211_ibss_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid);
@@ -1543,12 +1537,6 @@ int cfg80211_ibss_wext_giwap(struct net_
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra);
-int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
-int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra);
int cfg80211_mgd_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid);
@@ -1571,8 +1559,12 @@ int cfg80211_wext_giwauth(struct net_dev
struct iw_request_info *info,
struct iw_param *data, char *extra);
-struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
- struct iw_freq *freq);
+int cfg80211_wext_siwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+int cfg80211_wext_giwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
int cfg80211_wext_siwrate(struct net_device *dev,
struct iw_request_info *info,
--- wireless-testing.orig/net/mac80211/wext.c 2009-06-24 13:54:09.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-06-24 13:54:09.000000000 +0200
@@ -27,78 +27,6 @@
#include "aes_ccm.h"
-static int ieee80211_ioctl_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- struct ieee80211_local *local = sdata->local;
- struct ieee80211_channel *chan;
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_siwfreq(dev, info, freq, extra);
- else if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_siwfreq(dev, info, freq, extra);
-
- /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */
- if (freq->e == 0) {
- if (freq->m < 0) {
- if (sdata->vif.type == NL80211_IFTYPE_STATION)
- sdata->u.mgd.flags |=
- IEEE80211_STA_AUTO_CHANNEL_SEL;
- return 0;
- } else
- chan = ieee80211_get_channel(local->hw.wiphy,
- ieee80211_channel_to_frequency(freq->m));
- } else {
- int i, div = 1000000;
- for (i = 0; i < freq->e; i++)
- div /= 10;
- if (div <= 0)
- return -EINVAL;
- chan = ieee80211_get_channel(local->hw.wiphy, freq->m / div);
- }
-
- if (!chan)
- return -EINVAL;
-
- if (chan->flags & IEEE80211_CHAN_DISABLED)
- return -EINVAL;
-
- /*
- * no change except maybe auto -> fixed, ignore the HT
- * setting so you can fix a channel you're on already
- */
- if (local->oper_channel == chan)
- return 0;
-
- local->oper_channel = chan;
- local->oper_channel_type = NL80211_CHAN_NO_HT;
- ieee80211_hw_config(local, 0);
-
- return 0;
-}
-
-
-static int ieee80211_ioctl_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
-{
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
- return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
- else if (sdata->vif.type == NL80211_IFTYPE_STATION)
- return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
-
- freq->m = local->oper_channel->center_freq;
- freq->e = 6;
-
- return 0;
-}
-
-
static int ieee80211_ioctl_siwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *ssid)
@@ -176,8 +104,8 @@ static const iw_handler ieee80211_handle
(iw_handler) cfg80211_wext_giwname, /* SIOCGIWNAME */
(iw_handler) NULL, /* SIOCSIWNWID */
(iw_handler) NULL, /* SIOCGIWNWID */
- (iw_handler) ieee80211_ioctl_siwfreq, /* SIOCSIWFREQ */
- (iw_handler) ieee80211_ioctl_giwfreq, /* SIOCGIWFREQ */
+ (iw_handler) cfg80211_wext_siwfreq, /* SIOCSIWFREQ */
+ (iw_handler) cfg80211_wext_giwfreq, /* SIOCGIWFREQ */
(iw_handler) cfg80211_wext_siwmode, /* SIOCSIWMODE */
(iw_handler) cfg80211_wext_giwmode, /* SIOCGIWMODE */
(iw_handler) NULL, /* SIOCSIWSENS */
--- wireless-testing.orig/net/wireless/ibss.c 2009-06-24 13:54:05.000000000 +0200
+++ wireless-testing/net/wireless/ibss.c 2009-06-24 13:54:09.000000000 +0200
@@ -7,6 +7,7 @@
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <net/cfg80211.h>
+#include "wext-compat.h"
#include "nl80211.h"
@@ -197,8 +198,6 @@ int cfg80211_ibss_wext_siwfreq(struct ne
return cfg80211_ibss_wext_join(wiphy_to_dev(wdev->wiphy), wdev);
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_siwfreq);
int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
@@ -225,8 +224,6 @@ int cfg80211_ibss_wext_giwfreq(struct ne
/* no channel if not joining */
return -EINVAL;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_giwfreq);
int cfg80211_ibss_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ wireless-testing/net/wireless/wext-compat.h 2009-06-24 13:54:09.000000000 +0200
@@ -0,0 +1,21 @@
+#ifndef __WEXT_COMPAT
+#define __WEXT_COMPAT
+
+int cfg80211_ibss_wext_siwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+int cfg80211_ibss_wext_giwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+
+int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra);
+
+struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
+ struct iw_freq *freq);
+
+#endif /* __WEXT_COMPAT */
--- wireless-testing.orig/net/wireless/wext-sme.c 2009-06-24 13:54:06.000000000 +0200
+++ wireless-testing/net/wireless/wext-sme.c 2009-06-24 13:54:09.000000000 +0200
@@ -8,6 +8,7 @@
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include <net/cfg80211.h>
+#include "wext-compat.h"
#include "nl80211.h"
static int cfg80211_mgd_wext_connect(struct cfg80211_registered_device *rdev,
@@ -78,8 +79,6 @@ int cfg80211_mgd_wext_siwfreq(struct net
return cfg80211_mgd_wext_connect(wiphy_to_dev(wdev->wiphy), wdev);
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_siwfreq);
int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
@@ -106,8 +105,6 @@ int cfg80211_mgd_wext_giwfreq(struct net
/* no channel if not joining */
return -EINVAL;
}
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_giwfreq);
int cfg80211_mgd_wext_siwessid(struct net_device *dev,
struct iw_request_info *info,
--- wireless-testing.orig/net/wireless/core.h 2009-06-24 13:54:06.000000000 +0200
+++ wireless-testing/net/wireless/core.h 2009-06-24 13:54:09.000000000 +0200
@@ -60,6 +60,9 @@ struct cfg80211_registered_device {
struct work_struct conn_work;
+ /* current channel */
+ struct ieee80211_channel *channel;
+
#ifdef CONFIG_CFG80211_DEBUGFS
/* Debugfs entries */
struct wiphy_debugfsdentries {
--- wireless-testing.orig/net/wireless/nl80211.c 2009-06-24 13:54:06.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2009-06-24 13:54:09.000000000 +0200
@@ -559,6 +559,8 @@ static int nl80211_set_wiphy(struct sk_b
channel_type);
if (result)
goto bad_res;
+
+ rdev->channel = chan;
}
changed = 0;
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-06-24 13:54:09.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-06-24 13:54:09.000000000 +0200
@@ -14,6 +14,7 @@
#include <linux/etherdevice.h>
#include <net/iw_handler.h>
#include <net/cfg80211.h>
+#include "wext-compat.h"
#include "core.h"
int cfg80211_wext_giwname(struct net_device *dev,
@@ -301,7 +302,6 @@ struct ieee80211_channel *cfg80211_wext_
return ERR_PTR(-EINVAL);
return chan;
}
-EXPORT_SYMBOL_GPL(cfg80211_wext_freq);
int cfg80211_wext_siwrts(struct net_device *dev,
struct iw_request_info *info,
@@ -720,6 +720,58 @@ int cfg80211_wext_giwencode(struct net_d
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwencode);
+int cfg80211_wext_siwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+ struct ieee80211_channel *chan;
+ int err;
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_siwfreq(dev, info, freq, extra);
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_siwfreq(dev, info, freq, extra);
+ default:
+ chan = cfg80211_wext_freq(wdev->wiphy, freq);
+ if (!chan)
+ return -EINVAL;
+ if (IS_ERR(chan))
+ return PTR_ERR(chan);
+ err = rdev->ops->set_channel(wdev->wiphy, chan,
+ NL80211_CHAN_NO_HT);
+ if (err)
+ return err;
+ rdev->channel = chan;
+ return 0;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwfreq);
+
+int cfg80211_wext_giwfreq(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_freq *freq, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_STATION:
+ return cfg80211_mgd_wext_giwfreq(dev, info, freq, extra);
+ case NL80211_IFTYPE_ADHOC:
+ return cfg80211_ibss_wext_giwfreq(dev, info, freq, extra);
+ default:
+ if (!rdev->channel)
+ return -EINVAL;
+ freq->m = rdev->channel->center_freq;
+ freq->e = 6;
+ return 0;
+ }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_giwfreq);
+
int cfg80211_wext_siwtxpower(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *data, char *extra)
--
^ permalink raw reply
* [RFC 07/11] cfg80211: implement get_wireless_stats
From: Johannes Berg @ 2009-06-24 12:07 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <20090624120745.239294066@sipsolutions.net>
With just a new method to get the current channel noise,
we can implement wireless stats in cfg80211. We also
make the handler return NULL if we have no information,
which is possible thanks to the recent wext change.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/cfg80211.h | 3 +
net/mac80211/cfg.c | 27 +++++++++++++++++
net/mac80211/wext.c | 69 --------------------------------------------
net/wireless/wext-compat.c | 70 +++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 101 insertions(+), 68 deletions(-)
--- wireless-testing.orig/net/mac80211/wext.c 2009-06-24 13:54:08.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-06-24 13:54:09.000000000 +0200
@@ -168,73 +168,6 @@ static int ieee80211_ioctl_giwap(struct
}
-/* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */
-static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev)
-{
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- struct iw_statistics *wstats = &local->wstats;
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- struct sta_info *sta = NULL;
-
- rcu_read_lock();
-
- if (sdata->vif.type == NL80211_IFTYPE_STATION)
- sta = sta_info_get(local, sdata->u.mgd.bssid);
-
- if (!sta) {
- wstats->discard.fragment = 0;
- wstats->discard.misc = 0;
- wstats->qual.qual = 0;
- wstats->qual.level = 0;
- wstats->qual.noise = 0;
- wstats->qual.updated = IW_QUAL_ALL_INVALID;
- } else {
- wstats->qual.updated = 0;
- /*
- * mirror what cfg80211 does for iwrange/scan results,
- * otherwise userspace gets confused.
- */
- if (local->hw.flags & (IEEE80211_HW_SIGNAL_UNSPEC |
- IEEE80211_HW_SIGNAL_DBM)) {
- wstats->qual.updated |= IW_QUAL_LEVEL_UPDATED;
- wstats->qual.updated |= IW_QUAL_QUAL_UPDATED;
- } else {
- wstats->qual.updated |= IW_QUAL_LEVEL_INVALID;
- wstats->qual.updated |= IW_QUAL_QUAL_INVALID;
- }
-
- if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC) {
- wstats->qual.level = sta->last_signal;
- wstats->qual.qual = sta->last_signal;
- } else if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) {
- int sig = sta->last_signal;
-
- wstats->qual.updated |= IW_QUAL_DBM;
- wstats->qual.level = sig;
- if (sig < -110)
- sig = -110;
- else if (sig > -40)
- sig = -40;
- wstats->qual.qual = sig + 110;
- }
-
- if (local->hw.flags & IEEE80211_HW_NOISE_DBM) {
- /*
- * This assumes that if driver reports noise, it also
- * reports signal in dBm.
- */
- wstats->qual.noise = sta->last_noise;
- wstats->qual.updated |= IW_QUAL_NOISE_UPDATED;
- } else {
- wstats->qual.updated |= IW_QUAL_NOISE_INVALID;
- }
- }
-
- rcu_read_unlock();
-
- return wstats;
-}
-
/* Structures to export the Wireless Handlers */
static const iw_handler ieee80211_handler[] =
@@ -301,5 +234,5 @@ const struct iw_handler_def ieee80211_iw
{
.num_standard = ARRAY_SIZE(ieee80211_handler),
.standard = (iw_handler *) ieee80211_handler,
- .get_wireless_stats = ieee80211_get_wireless_stats,
+ .get_wireless_stats = cfg80211_wireless_stats,
};
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-06-24 13:54:08.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-06-24 13:54:09.000000000 +0200
@@ -982,3 +982,73 @@ int cfg80211_wext_giwrate(struct net_dev
return rdev->ops->get_bitrate(wdev->wiphy, dev, rate);
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwrate);
+
+/* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */
+struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+ /* we are under RTNL - globally locked - so can use static structs */
+ static struct iw_statistics wstats;
+ static struct station_info sinfo;
+ u8 *addr;
+
+ if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION)
+ return NULL;
+
+ if (!rdev->ops->get_station)
+ return NULL;
+
+ addr = wdev->wext.connect.bssid;
+ if (!addr)
+ return NULL;
+
+ if (rdev->ops->get_station(&rdev->wiphy, dev, addr, &sinfo))
+ return NULL;
+
+ memset(&wstats, 0, sizeof(wstats));
+
+ switch (rdev->wiphy.signal_type) {
+ case CFG80211_SIGNAL_TYPE_MBM:
+ if (sinfo.filled & STATION_INFO_SIGNAL) {
+ int sig = sinfo.signal;
+ wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED;
+ wstats.qual.updated |= IW_QUAL_QUAL_UPDATED;
+ wstats.qual.updated |= IW_QUAL_DBM;
+ wstats.qual.level = sig;
+ if (sig < -110)
+ sig = -110;
+ else if (sig > -40)
+ sig = -40;
+ wstats.qual.qual = sig + 110;
+ break;
+ }
+ case CFG80211_SIGNAL_TYPE_UNSPEC:
+ if (sinfo.filled & STATION_INFO_SIGNAL) {
+ wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED;
+ wstats.qual.updated |= IW_QUAL_QUAL_UPDATED;
+ wstats.qual.level = sinfo.signal;
+ wstats.qual.qual = sinfo.signal;
+ break;
+ }
+ default:
+ wstats.qual.updated |= IW_QUAL_LEVEL_INVALID;
+ wstats.qual.updated |= IW_QUAL_QUAL_INVALID;
+ }
+
+ /*
+ * This assumes that if the driver does dBm, it also
+ * reports the noise in dBm...
+ */
+ if (rdev->ops->get_noise) {
+ int noise;
+ if (rdev->ops->get_noise(wdev->wiphy, dev, &noise)) {
+ wstats.qual.noise = noise;
+ wstats.qual.updated |= IW_QUAL_NOISE_INVALID;
+ } else
+ wstats.qual.updated |= IW_QUAL_NOISE_UPDATED;
+ }
+
+ return &wstats;
+}
+EXPORT_SYMBOL_GPL(cfg80211_wireless_stats);
--- wireless-testing.orig/include/net/cfg80211.h 2009-06-24 13:54:08.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-06-24 13:54:09.000000000 +0200
@@ -1010,6 +1010,8 @@ struct cfg80211_ops {
struct iw_param *rate);
int (*get_bitrate)(struct wiphy *wiphy, struct net_device *dev,
struct iw_param *rate);
+ int (*get_noise)(struct wiphy *wiphy, struct net_device *dev,
+ int *noise);
};
/*
@@ -1612,6 +1614,7 @@ int cfg80211_wext_siwtxpower(struct net_
int cfg80211_wext_giwtxpower(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *data, char *keybuf);
+struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev);
int cfg80211_wext_siwpower(struct net_device *dev,
struct iw_request_info *info,
--- wireless-testing.orig/net/mac80211/cfg.c 2009-06-24 13:54:08.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2009-06-24 13:54:09.000000000 +0200
@@ -381,6 +381,32 @@ static void sta_set_sinfo(struct sta_inf
}
}
+static int ieee80211_get_noise(struct wiphy *wiphy, struct net_device *dev,
+ int *noise)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ struct sta_info *sta;
+ int err = -EINVAL;
+
+ /* XXX: this is all wrong */
+
+ if (!(local->hw.flags & IEEE80211_HW_NOISE_DBM))
+ return -EOPNOTSUPP;
+
+ if (sdata->vif.type != NL80211_IFTYPE_STATION)
+ return -EOPNOTSUPP;
+
+ rcu_read_lock();
+ sta = sta_info_get(local, sdata->u.mgd.bssid);
+ if (sta) {
+ *noise = sta->last_noise;
+ err = 0;
+ }
+ rcu_read_unlock();
+
+ return err;
+}
static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
int idx, u8 *mac, struct station_info *sinfo)
@@ -1528,4 +1554,5 @@ struct cfg80211_ops mac80211_config_ops
.set_power_mgmt = ieee80211_set_power_mgmt,
.set_bitrate = ieee80211_set_bitrate,
.get_bitrate = ieee80211_get_bitrate,
+ .get_noise = ieee80211_get_noise,
};
--
^ permalink raw reply
* [RFC 06/11] cfg80211: implement IWRATE
From: Johannes Berg @ 2009-06-24 12:07 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <20090624120745.239294066@sipsolutions.net>
For now, let's implement that using a very hackish way:
simply mirror the wext API in the cfg80211 API. This
will have to be changed later when we implement proper
bitrate API.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/cfg80211.h | 11 ++++++
net/mac80211/cfg.c | 73 +++++++++++++++++++++++++++++++++++++++++++
net/mac80211/wext.c | 76 +--------------------------------------------
net/wireless/wext-compat.c | 28 ++++++++++++++++
4 files changed, 114 insertions(+), 74 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2009-06-24 13:54:08.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-06-24 13:54:08.000000000 +0200
@@ -1006,6 +1006,10 @@ struct cfg80211_ops {
/* some temporary stuff to finish wext */
int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
bool enabled, int timeout);
+ int (*set_bitrate)(struct wiphy *wiphy, struct net_device *dev,
+ struct iw_param *rate);
+ int (*get_bitrate)(struct wiphy *wiphy, struct net_device *dev,
+ struct iw_param *rate);
};
/*
@@ -1568,6 +1572,13 @@ int cfg80211_wext_giwauth(struct net_dev
struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
struct iw_freq *freq);
+int cfg80211_wext_siwrate(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *rate, char *extra);
+int cfg80211_wext_giwrate(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *rate, char *extra);
+
int cfg80211_wext_siwrts(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *rts, char *extra);
--- wireless-testing.orig/net/mac80211/cfg.c 2009-06-24 13:54:08.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2009-06-24 13:54:08.000000000 +0200
@@ -1411,6 +1411,77 @@ static int ieee80211_set_power_mgmt(stru
return 0;
}
+static int ieee80211_set_bitrate(struct wiphy *wiphy,
+ struct net_device *dev,
+ struct iw_param *rate)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ int i, err = -EINVAL;
+ u32 target_rate = rate->value / 100000;
+ struct ieee80211_supported_band *sband;
+
+ sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
+
+ /* target_rate = -1, rate->fixed = 0 means auto only, so use all rates
+ * target_rate = X, rate->fixed = 1 means only rate X
+ * target_rate = X, rate->fixed = 0 means all rates <= X */
+ sdata->max_ratectrl_rateidx = -1;
+ sdata->force_unicast_rateidx = -1;
+ if (rate->value < 0)
+ return 0;
+
+ for (i=0; i< sband->n_bitrates; i++) {
+ struct ieee80211_rate *brate = &sband->bitrates[i];
+ int this_rate = brate->bitrate;
+
+ if (target_rate == this_rate) {
+ sdata->max_ratectrl_rateidx = i;
+ if (rate->fixed)
+ sdata->force_unicast_rateidx = i;
+ err = 0;
+ break;
+ }
+ }
+
+ return err;
+}
+
+static int ieee80211_get_bitrate(struct wiphy *wiphy,
+ struct net_device *dev,
+ struct iw_param *rate)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ struct sta_info *sta;
+ struct ieee80211_supported_band *sband;
+
+ sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+
+ if (sdata->vif.type != NL80211_IFTYPE_STATION)
+ return -EOPNOTSUPP;
+
+ sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
+
+ rcu_read_lock();
+
+ sta = sta_info_get(local, sdata->u.mgd.bssid);
+
+ if (sta && !(sta->last_tx_rate.flags & IEEE80211_TX_RC_MCS))
+ rate->value = sband->bitrates[sta->last_tx_rate.idx].bitrate;
+ else
+ rate->value = 0;
+
+ rcu_read_unlock();
+
+ if (!sta)
+ return -ENODEV;
+
+ rate->value *= 100000;
+
+ return 0;
+}
+
struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -1455,4 +1526,6 @@ struct cfg80211_ops mac80211_config_ops
.set_wds_peer = ieee80211_set_wds_peer,
.rfkill_poll = ieee80211_rfkill_poll,
.set_power_mgmt = ieee80211_set_power_mgmt,
+ .set_bitrate = ieee80211_set_bitrate,
+ .get_bitrate = ieee80211_get_bitrate,
};
--- wireless-testing.orig/net/mac80211/wext.c 2009-06-24 13:54:08.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-06-24 13:54:08.000000000 +0200
@@ -168,78 +168,6 @@ static int ieee80211_ioctl_giwap(struct
}
-static int ieee80211_ioctl_siwrate(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rate, char *extra)
-{
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- int i, err = -EINVAL;
- u32 target_rate = rate->value / 100000;
- struct ieee80211_sub_if_data *sdata;
- struct ieee80211_supported_band *sband;
-
- sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
-
- /* target_rate = -1, rate->fixed = 0 means auto only, so use all rates
- * target_rate = X, rate->fixed = 1 means only rate X
- * target_rate = X, rate->fixed = 0 means all rates <= X */
- sdata->max_ratectrl_rateidx = -1;
- sdata->force_unicast_rateidx = -1;
- if (rate->value < 0)
- return 0;
-
- for (i=0; i< sband->n_bitrates; i++) {
- struct ieee80211_rate *brate = &sband->bitrates[i];
- int this_rate = brate->bitrate;
-
- if (target_rate == this_rate) {
- sdata->max_ratectrl_rateidx = i;
- if (rate->fixed)
- sdata->force_unicast_rateidx = i;
- err = 0;
- break;
- }
- }
- return err;
-}
-
-static int ieee80211_ioctl_giwrate(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rate, char *extra)
-{
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- struct sta_info *sta;
- struct ieee80211_sub_if_data *sdata;
- struct ieee80211_supported_band *sband;
-
- sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- if (sdata->vif.type != NL80211_IFTYPE_STATION)
- return -EOPNOTSUPP;
-
- sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
-
- rcu_read_lock();
-
- sta = sta_info_get(local, sdata->u.mgd.bssid);
-
- if (sta && !(sta->last_tx_rate.flags & IEEE80211_TX_RC_MCS))
- rate->value = sband->bitrates[sta->last_tx_rate.idx].bitrate;
- else
- rate->value = 0;
-
- rcu_read_unlock();
-
- if (!sta)
- return -ENODEV;
-
- rate->value *= 100000;
-
- return 0;
-}
-
/* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */
static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev)
{
@@ -343,8 +271,8 @@ static const iw_handler ieee80211_handle
(iw_handler) NULL, /* SIOCGIWNICKN */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
- (iw_handler) ieee80211_ioctl_siwrate, /* SIOCSIWRATE */
- (iw_handler) ieee80211_ioctl_giwrate, /* SIOCGIWRATE */
+ (iw_handler) cfg80211_wext_siwrate, /* SIOCSIWRATE */
+ (iw_handler) cfg80211_wext_giwrate, /* SIOCGIWRATE */
(iw_handler) cfg80211_wext_siwrts, /* SIOCSIWRTS */
(iw_handler) cfg80211_wext_giwrts, /* SIOCGIWRTS */
(iw_handler) cfg80211_wext_siwfrag, /* SIOCSIWFRAG */
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-06-24 13:54:08.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-06-24 13:54:08.000000000 +0200
@@ -954,3 +954,31 @@ int cfg80211_wds_wext_giwap(struct net_d
return 0;
}
EXPORT_SYMBOL_GPL(cfg80211_wds_wext_giwap);
+
+int cfg80211_wext_siwrate(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *rate, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+
+ if (!rdev->ops->set_bitrate)
+ return -EOPNOTSUPP;
+
+ return rdev->ops->set_bitrate(wdev->wiphy, dev, rate);
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwrate);
+
+int cfg80211_wext_giwrate(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *rate, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+
+ if (!rdev->ops->get_bitrate)
+ return -EOPNOTSUPP;
+
+ return rdev->ops->get_bitrate(wdev->wiphy, dev, rate);
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_giwrate);
--
^ permalink raw reply
* [RFC 05/11] cfg80211: implement IWAP for WDS
From: Johannes Berg @ 2009-06-24 12:07 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <20090624120745.239294066@sipsolutions.net>
This implements siocsiwap/giwap for WDS mode.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
include/net/cfg80211.h | 10 +++++++++
net/mac80211/cfg.c | 11 ++++++++++
net/mac80211/wext.c | 26 +++----------------------
net/wireless/wext-compat.c | 46 +++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 71 insertions(+), 22 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2009-06-24 13:54:07.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-06-24 13:54:08.000000000 +0200
@@ -998,6 +998,9 @@ struct cfg80211_ops {
enum tx_power_setting type, int dbm);
int (*get_tx_power)(struct wiphy *wiphy, int *dbm);
+ int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
+ u8 *addr);
+
void (*rfkill_poll)(struct wiphy *wiphy);
/* some temporary stuff to finish wext */
@@ -1606,6 +1609,13 @@ int cfg80211_wext_giwpower(struct net_de
struct iw_request_info *info,
struct iw_param *wrq, char *extra);
+int cfg80211_wds_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *addr, char *extra);
+int cfg80211_wds_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *addr, char *extra);
+
/*
* callbacks for asynchronous cfg80211 methods, notification
* functions and BSS handling helpers
--- wireless-testing.orig/net/mac80211/wext.c 2009-06-24 13:54:07.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-06-24 13:54:08.000000000 +0200
@@ -143,23 +143,8 @@ static int ieee80211_ioctl_siwap(struct
if (sdata->vif.type == NL80211_IFTYPE_STATION)
return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra);
- if (sdata->vif.type == NL80211_IFTYPE_WDS) {
- /*
- * If it is necessary to update the WDS peer address
- * while the interface is running, then we need to do
- * more work here, namely if it is running we need to
- * add a new and remove the old STA entry, this is
- * normally handled by _open() and _stop().
- */
- if (netif_running(dev))
- return -EBUSY;
-
- memcpy(&sdata->u.wds.remote_addr, (u8 *) &ap_addr->sa_data,
- ETH_ALEN);
-
- return 0;
- }
-
+ if (sdata->vif.type == NL80211_IFTYPE_WDS)
+ return cfg80211_wds_wext_siwap(dev, info, ap_addr, extra);
return -EOPNOTSUPP;
}
@@ -176,11 +161,8 @@ static int ieee80211_ioctl_giwap(struct
if (sdata->vif.type == NL80211_IFTYPE_STATION)
return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra);
- if (sdata->vif.type == NL80211_IFTYPE_WDS) {
- ap_addr->sa_family = ARPHRD_ETHER;
- memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN);
- return 0;
- }
+ if (sdata->vif.type == NL80211_IFTYPE_WDS)
+ return cfg80211_wds_wext_giwap(dev, info, ap_addr, extra);
return -EOPNOTSUPP;
}
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-06-24 13:54:07.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-06-24 13:54:08.000000000 +0200
@@ -908,3 +908,49 @@ int cfg80211_wext_giwpower(struct net_de
return 0;
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwpower);
+
+int cfg80211_wds_wext_siwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *addr, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+ int err;
+
+ if (WARN_ON(wdev->iftype != NL80211_IFTYPE_WDS))
+ return -EINVAL;
+
+ if (addr->sa_family != ARPHRD_ETHER)
+ return -EINVAL;
+
+ if (netif_running(dev))
+ return -EBUSY;
+
+ if (!rdev->ops->set_wds_peer)
+ return -EOPNOTSUPP;
+
+ err = rdev->ops->set_wds_peer(wdev->wiphy, dev, (u8 *) &addr->sa_data);
+ if (err)
+ return err;
+
+ memcpy(&wdev->wext.bssid, (u8 *) &addr->sa_data, ETH_ALEN);
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(cfg80211_wds_wext_siwap);
+
+int cfg80211_wds_wext_giwap(struct net_device *dev,
+ struct iw_request_info *info,
+ struct sockaddr *addr, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ if (WARN_ON(wdev->iftype != NL80211_IFTYPE_WDS))
+ return -EINVAL;
+
+ addr->sa_family = ARPHRD_ETHER;
+ memcpy(&addr->sa_data, wdev->wext.bssid, ETH_ALEN);
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(cfg80211_wds_wext_giwap);
--- wireless-testing.orig/net/mac80211/cfg.c 2009-06-24 13:54:07.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2009-06-24 13:54:08.000000000 +0200
@@ -1369,6 +1369,16 @@ static int ieee80211_get_tx_power(struct
return 0;
}
+static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev,
+ u8 *addr)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+
+ memcpy(&sdata->u.wds.remote_addr, addr, ETH_ALEN);
+
+ return 0;
+}
+
static void ieee80211_rfkill_poll(struct wiphy *wiphy)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
@@ -1442,6 +1452,7 @@ struct cfg80211_ops mac80211_config_ops
.set_wiphy_params = ieee80211_set_wiphy_params,
.set_tx_power = ieee80211_set_tx_power,
.get_tx_power = ieee80211_get_tx_power,
+ .set_wds_peer = ieee80211_set_wds_peer,
.rfkill_poll = ieee80211_rfkill_poll,
.set_power_mgmt = ieee80211_set_power_mgmt,
};
--
^ permalink raw reply
* [RFC 04/11] cfg80211: implement iwpower
From: Johannes Berg @ 2009-06-24 12:07 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <20090624120745.239294066@sipsolutions.net>
Just on/off and timeout, and with a hacky cfg80211 method
until we figure out what we want, though this is probably
sufficient as we want to use pm_qos for wifi everywhere.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
drivers/net/wireless/iwmc3200wifi/cfg80211.c | 22 ++++++++
drivers/net/wireless/iwmc3200wifi/wext.c | 47 ------------------
include/net/cfg80211.h | 13 +++++
net/mac80211/Kconfig | 16 ------
net/mac80211/cfg.c | 26 ++++++++++
net/mac80211/mlme.c | 5 -
net/mac80211/wext.c | 70 ---------------------------
net/wireless/Kconfig | 16 ++++++
net/wireless/core.c | 11 +++-
net/wireless/wext-compat.c | 60 +++++++++++++++++++++++
10 files changed, 151 insertions(+), 135 deletions(-)
--- wireless-testing.orig/include/net/cfg80211.h 2009-06-24 13:54:06.000000000 +0200
+++ wireless-testing/include/net/cfg80211.h 2009-06-24 13:54:07.000000000 +0200
@@ -999,6 +999,10 @@ struct cfg80211_ops {
int (*get_tx_power)(struct wiphy *wiphy, int *dbm);
void (*rfkill_poll)(struct wiphy *wiphy);
+
+ /* some temporary stuff to finish wext */
+ int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev,
+ bool enabled, int timeout);
};
/*
@@ -1249,6 +1253,8 @@ struct wireless_dev {
u8 bssid[ETH_ALEN];
u8 ssid[IEEE80211_MAX_SSID_LEN];
s8 default_key, default_mgmt_key;
+ bool ps;
+ int ps_timeout;
} wext;
#endif
};
@@ -1593,6 +1599,13 @@ int cfg80211_wext_giwtxpower(struct net_
struct iw_request_info *info,
union iwreq_data *data, char *keybuf);
+int cfg80211_wext_siwpower(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *wrq, char *extra);
+int cfg80211_wext_giwpower(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *wrq, char *extra);
+
/*
* callbacks for asynchronous cfg80211 methods, notification
* functions and BSS handling helpers
--- wireless-testing.orig/net/mac80211/Kconfig 2009-06-24 13:53:12.000000000 +0200
+++ wireless-testing/net/mac80211/Kconfig 2009-06-24 13:54:07.000000000 +0200
@@ -14,22 +14,6 @@ config MAC80211
comment "CFG80211 needs to be enabled for MAC80211"
depends on CFG80211=n
-config MAC80211_DEFAULT_PS
- bool "enable powersave by default"
- depends on MAC80211
- default y
- help
- This option enables powersave mode by default.
-
- If this causes your applications to misbehave you should fix your
- applications instead -- they need to register their network
- latency requirement, see Documentation/power/pm_qos_interface.txt.
-
-config MAC80211_DEFAULT_PS_VALUE
- int
- default 1 if MAC80211_DEFAULT_PS
- default 0
-
menu "Rate control algorithm selection"
depends on MAC80211 != n
--- wireless-testing.orig/net/mac80211/wext.c 2009-06-24 13:54:06.000000000 +0200
+++ wireless-testing/net/mac80211/wext.c 2009-06-24 13:54:07.000000000 +0200
@@ -258,72 +258,6 @@ static int ieee80211_ioctl_giwrate(struc
return 0;
}
-static int ieee80211_ioctl_siwpower(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *wrq,
- char *extra)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
- struct ieee80211_conf *conf = &local->hw.conf;
- int timeout = 0;
- bool ps;
-
- if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS))
- return -EOPNOTSUPP;
-
- if (sdata->vif.type != NL80211_IFTYPE_STATION)
- return -EINVAL;
-
- if (wrq->disabled) {
- ps = false;
- timeout = 0;
- goto set;
- }
-
- switch (wrq->flags & IW_POWER_MODE) {
- case IW_POWER_ON: /* If not specified */
- case IW_POWER_MODE: /* If set all mask */
- case IW_POWER_ALL_R: /* If explicitely state all */
- ps = true;
- break;
- default: /* Otherwise we ignore */
- return -EINVAL;
- }
-
- if (wrq->flags & ~(IW_POWER_MODE | IW_POWER_TIMEOUT))
- return -EINVAL;
-
- if (wrq->flags & IW_POWER_TIMEOUT)
- timeout = wrq->value / 1000;
-
- set:
- if (ps == sdata->u.mgd.powersave && timeout == conf->dynamic_ps_timeout)
- return 0;
-
- sdata->u.mgd.powersave = ps;
- conf->dynamic_ps_timeout = timeout;
-
- if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)
- ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
-
- ieee80211_recalc_ps(local, -1);
-
- return 0;
-}
-
-static int ieee80211_ioctl_giwpower(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu,
- char *extra)
-{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
- wrqu->power.disabled = !sdata->u.mgd.powersave;
-
- return 0;
-}
-
/* Get wireless statistics. Called by /proc/net/wireless and by SIOCGIWSTATS */
static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev)
{
@@ -439,8 +373,8 @@ static const iw_handler ieee80211_handle
(iw_handler) cfg80211_wext_giwretry, /* SIOCGIWRETRY */
(iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */
(iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */
- (iw_handler) ieee80211_ioctl_siwpower, /* SIOCSIWPOWER */
- (iw_handler) ieee80211_ioctl_giwpower, /* SIOCGIWPOWER */
+ (iw_handler) cfg80211_wext_siwpower, /* SIOCSIWPOWER */
+ (iw_handler) cfg80211_wext_giwpower, /* SIOCGIWPOWER */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) cfg80211_wext_siwgenie, /* SIOCSIWGENIE */
--- wireless-testing.orig/net/wireless/Kconfig 2009-06-24 13:54:03.000000000 +0200
+++ wireless-testing/net/wireless/Kconfig 2009-06-24 13:54:07.000000000 +0200
@@ -11,6 +11,22 @@ config CFG80211_REG_DEBUG
If unsure, say N.
+config CFG80211_DEFAULT_PS
+ bool "enable powersave by default"
+ depends on CFG80211
+ default y
+ help
+ This option enables powersave mode by default.
+
+ If this causes your applications to misbehave you should fix your
+ applications instead -- they need to register their network
+ latency requirement, see Documentation/power/pm_qos_interface.txt.
+
+config CFG80211_DEFAULT_PS_VALUE
+ int
+ default 1 if CFG80211_DEFAULT_PS
+ default 0
+
config CFG80211_DEBUGFS
bool "cfg80211 DebugFS entries"
depends on CFG80211 && DEBUG_FS
--- wireless-testing.orig/net/wireless/core.c 2009-06-24 13:54:06.000000000 +0200
+++ wireless-testing/net/wireless/core.c 2009-06-24 13:54:07.000000000 +0200
@@ -550,11 +550,20 @@ static int cfg80211_netdev_notifier_call
}
wdev->netdev = dev;
wdev->sme_state = CFG80211_SME_IDLE;
+ mutex_unlock(&rdev->devlist_mtx);
#ifdef CONFIG_WIRELESS_EXT
wdev->wext.default_key = -1;
wdev->wext.default_mgmt_key = -1;
+ wdev->wext.ps = CONFIG_CFG80211_DEFAULT_PS_VALUE;
+ wdev->wext.ps_timeout = 500;
+ if (rdev->ops->set_power_mgmt)
+ if (rdev->ops->set_power_mgmt(wdev->wiphy, dev,
+ wdev->wext.ps,
+ wdev->wext.ps_timeout)) {
+ /* assume this means it's off */
+ wdev->wext.ps = false;
+ }
#endif
- mutex_unlock(&rdev->devlist_mtx);
break;
case NETDEV_GOING_DOWN:
if (!wdev->ssid_len)
--- wireless-testing.orig/net/wireless/wext-compat.c 2009-06-24 13:54:06.000000000 +0200
+++ wireless-testing/net/wireless/wext-compat.c 2009-06-24 13:54:07.000000000 +0200
@@ -848,3 +848,63 @@ int cfg80211_wext_giwauth(struct net_dev
return -EOPNOTSUPP;
}
EXPORT_SYMBOL_GPL(cfg80211_wext_giwauth);
+
+int cfg80211_wext_siwpower(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *wrq, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+ bool ps = wdev->wext.ps;
+ int timeout = wdev->wext.ps_timeout;
+ int err;
+
+ if (wdev->iftype != NL80211_IFTYPE_STATION)
+ return -EINVAL;
+
+ if (!rdev->ops->set_power_mgmt)
+ return -EOPNOTSUPP;
+
+ if (wrq->disabled) {
+ ps = false;
+ } else {
+ switch (wrq->flags & IW_POWER_MODE) {
+ case IW_POWER_ON: /* If not specified */
+ case IW_POWER_MODE: /* If set all mask */
+ case IW_POWER_ALL_R: /* If explicitely state all */
+ ps = true;
+ break;
+ default: /* Otherwise we ignore */
+ return -EINVAL;
+ }
+
+ if (wrq->flags & ~(IW_POWER_MODE | IW_POWER_TIMEOUT))
+ return -EINVAL;
+
+ if (wrq->flags & IW_POWER_TIMEOUT)
+ timeout = wrq->value / 1000;
+ }
+
+ err = rdev->ops->set_power_mgmt(wdev->wiphy, dev, ps, timeout);
+ if (err)
+ return err;
+
+ wdev->wext.ps = ps;
+ wdev->wext.ps_timeout = timeout;
+
+ return 0;
+
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwpower);
+
+int cfg80211_wext_giwpower(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *wrq, char *extra)
+{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+ wrq->disabled = !wdev->wext.ps;
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_giwpower);
--- wireless-testing.orig/net/mac80211/cfg.c 2009-06-24 13:53:12.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2009-06-24 13:54:07.000000000 +0200
@@ -1376,6 +1376,31 @@ static void ieee80211_rfkill_poll(struct
drv_rfkill_poll(local);
}
+static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
+ bool enabled, int timeout)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ struct ieee80211_conf *conf = &local->hw.conf;
+
+ if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS))
+ return -EOPNOTSUPP;
+
+ if (enabled == sdata->u.mgd.powersave &&
+ timeout == conf->dynamic_ps_timeout)
+ return 0;
+
+ sdata->u.mgd.powersave = enabled;
+ conf->dynamic_ps_timeout = timeout;
+
+ if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)
+ ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
+
+ ieee80211_recalc_ps(local, -1);
+
+ return 0;
+}
+
struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -1418,4 +1443,5 @@ struct cfg80211_ops mac80211_config_ops
.set_tx_power = ieee80211_set_tx_power,
.get_tx_power = ieee80211_get_tx_power,
.rfkill_poll = ieee80211_rfkill_poll,
+ .set_power_mgmt = ieee80211_set_power_mgmt,
};
--- wireless-testing.orig/net/mac80211/mlme.c 2009-06-24 13:54:06.000000000 +0200
+++ wireless-testing/net/mac80211/mlme.c 2009-06-24 13:54:07.000000000 +0200
@@ -2354,11 +2354,6 @@ void ieee80211_sta_setup_sdata(struct ie
ifmgd->flags |= IEEE80211_STA_WMM_ENABLED;
hw_flags = sdata->local->hw.flags;
-
- if (hw_flags & IEEE80211_HW_SUPPORTS_PS) {
- ifmgd->powersave = CONFIG_MAC80211_DEFAULT_PS_VALUE;
- sdata->local->hw.conf.dynamic_ps_timeout = 500;
- }
}
/* configuration hooks */
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/cfg80211.c 2009-06-24 13:53:12.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/cfg80211.c 2009-06-24 13:54:07.000000000 +0200
@@ -522,6 +522,27 @@ static int iwm_cfg80211_get_txpower(stru
return 0;
}
+static int iwm_cfg80211_set_power_mgmt(struct wiphy *wiphy,
+ struct net_device *dev,
+ bool enabled, int timeout)
+{
+ struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
+ u32 power_index;
+
+ if (enabled)
+ power_index = IWM_POWER_INDEX_DEFAULT;
+ else
+ power_index = IWM_POWER_INDEX_MIN;
+
+ if (power_index == iwm->conf.power_index)
+ return 0;
+
+ iwm->conf.power_index = power_index;
+
+ return iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
+ CFG_POWER_INDEX, iwm->conf.power_index);
+}
+
static struct cfg80211_ops iwm_cfg80211_ops = {
.change_virtual_intf = iwm_cfg80211_change_iface,
.add_key = iwm_cfg80211_add_key,
@@ -534,6 +555,7 @@ static struct cfg80211_ops iwm_cfg80211_
.leave_ibss = iwm_cfg80211_leave_ibss,
.set_tx_power = iwm_cfg80211_set_txpower,
.get_tx_power = iwm_cfg80211_get_txpower,
+ .set_power_mgmt = iwm_cfg80211_set_power_mgmt,
};
struct wireless_dev *iwm_wdev_alloc(int sizeof_bus, struct device *dev)
--- wireless-testing.orig/drivers/net/wireless/iwmc3200wifi/wext.c 2009-06-24 13:53:12.000000000 +0200
+++ wireless-testing/drivers/net/wireless/iwmc3200wifi/wext.c 2009-06-24 13:54:07.000000000 +0200
@@ -238,49 +238,6 @@ static int iwm_set_wpa_version(struct iw
return 0;
}
-static int iwm_wext_siwpower(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *wrq, char *extra)
-{
- struct iwm_priv *iwm = ndev_to_iwm(dev);
- u32 power_index;
-
- if (wrq->disabled) {
- power_index = IWM_POWER_INDEX_MIN;
- goto set;
- } else
- power_index = IWM_POWER_INDEX_DEFAULT;
-
- switch (wrq->flags & IW_POWER_MODE) {
- case IW_POWER_ON:
- case IW_POWER_MODE:
- case IW_POWER_ALL_R:
- break;
- default:
- return -EINVAL;
- }
-
- set:
- if (power_index == iwm->conf.power_index)
- return 0;
-
- iwm->conf.power_index = power_index;
-
- return iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
- CFG_POWER_INDEX, iwm->conf.power_index);
-}
-
-static int iwm_wext_giwpower(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct iwm_priv *iwm = ndev_to_iwm(dev);
-
- wrqu->power.disabled = (iwm->conf.power_index == IWM_POWER_INDEX_MIN);
-
- return 0;
-}
-
static int iwm_set_key_mgt(struct iwm_priv *iwm, u8 key_mgt)
{
u8 *auth_type = &iwm->umac_profile->sec.auth_type;
@@ -458,8 +415,8 @@ static const iw_handler iwm_handlers[] =
(iw_handler) NULL, /* SIOCGIWRETRY */
(iw_handler) cfg80211_wext_siwencode, /* SIOCSIWENCODE */
(iw_handler) cfg80211_wext_giwencode, /* SIOCGIWENCODE */
- (iw_handler) iwm_wext_siwpower, /* SIOCSIWPOWER */
- (iw_handler) iwm_wext_giwpower, /* SIOCGIWPOWER */
+ (iw_handler) cfg80211_wext_siwpower, /* SIOCSIWPOWER */
+ (iw_handler) cfg80211_wext_giwpower, /* SIOCGIWPOWER */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* SIOCSIWGENIE */
--
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox