* AP mode with ath5k/ath9k and hostapd 0.6.9 not working, probable bug found
From: Joerg Pommnitz @ 2009-10-22 12:45 UTC (permalink / raw)
To: linux-wireless; +Cc: hostapd list
[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]
Hello all,
the following is my analysis of the problem I encountered while trying to get
AP mode with ath5k/ath9k to work.
Software versions
=================
Kernel/drivers: wireless-testing tagged master-2009-10-16 (e.g. the latest as of today)
hostapd: 0.6.9
For comparison I used madwifi-0.9.4 with the same hostapd binary
Client: Windows Vista
Configuration
=============
The simplest possible hostapd configuration, no encryption:
interface=wlan0
driver=nl80211
ssid=mac80211ap
hw_mode=g
Observations
============
Initially I just couldn't connect to the ath5k/ath9k AP. To investigate the problem
I run a tcpdump trace on a different machine in monitoring mode. For comparison I
did an equivalent trace with an AP based on Madwifi-0.9.4.
Comparing the two traces I found two suspicious differences:
1) The Authentication Response and the Association Response frames from the ath9k AP
had a sequence number of 0 (zero) while the equivalent frames from Madwifi had
sequence numbers in sync with previous management frames. Both of these frames
were probably injected by hostapd which doesn't know the current sequence number,
right? Who should assign the correct one: mac80211 or the driver?
2) The Association Request (e.g. *FROM* the client) had the "Short Preamble" capability
bit set zo 0 (zero) despite the fact that it was advertising extended rates. I have
no idea why it did choose so. The equivalent frame from the Madwifi trace had the
"Short Preamble" flag set to 1 as expected.
Can anybody shed some light on the problems I found?
Attached are the traces for reference.
Thanks in advance
Joerg
[-- Attachment #2: association-ath9k.txt --]
[-- Type: text/plain, Size: 35339 bytes --]
No. Time Source Destination Protocol Info
378 20.059394 IntelCor_b5:fa:63 Compex_64:c7:d7 IEEE 802.11 Authentication,SN=995,FN=0
Frame 378 (60 bytes on wire, 60 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.682465000
[Time delta from previous packet: 0.014698000 seconds]
[Time since reference or first frame: 20.059394000 seconds]
Frame Number: 378
Packet Length: 60 bytes
Capture Length: 60 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679021676
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 11.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -51 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 45 dB
IEEE 802.11
Type/Subtype: Authentication (11)
Frame Control: 0x00B0 (Normal)
Version: 0
Type: Management frame (0)
Subtype: 11
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 213
Destination address: Compex_64:c7:d7 (00:80:48:64:c7:d7)
Source address: IntelCor_b5:fa:63 (00:13:e8:b5:fa:63)
BSS Id: Compex_64:c7:d7 (00:80:48:64:c7:d7)
Fragment number: 0
Sequence number: 995
Frame check sequence: 0x2f74d2b5 [correct]
[Good: True]
[Bad: False]
IEEE 802.11 wireless LAN management frame
Fixed parameters (6 bytes)
Authentication Algorithm: Open System (0)
Authentication SEQ: 0x0001
Status code: Successful (0x0000)
No. Time Source Destination Protocol Info
379 20.059604 IntelCor_b5:fa:63 (RA) IEEE 802.11 Acknowledgement
Frame 379 (38 bytes on wire, 38 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.682675000
[Time delta from previous packet: 0.000210000 seconds]
[Time since reference or first frame: 20.059604000 seconds]
Frame Number: 379
Packet Length: 38 bytes
Capture Length: 38 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679021886
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 11.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -45 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 51 dB
IEEE 802.11
Type/Subtype: Acknowledgement (29)
Frame Control: 0x00D4 (Normal)
Version: 0
Type: Control frame (1)
Subtype: 13
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 0
Receiver address: IntelCor_b5:fa:63 (00:13:e8:b5:fa:63)
No. Time Source Destination Protocol Info
380 20.060598 Compex_64:c7:d7 IntelCor_b5:fa:63 IEEE 802.11 Authentication,SN=0,FN=0
Frame 380 (60 bytes on wire, 60 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.683669000
[Time delta from previous packet: 0.000994000 seconds]
[Time since reference or first frame: 20.060598000 seconds]
Frame Number: 380
Packet Length: 60 bytes
Capture Length: 60 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679022878
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 1.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -45 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 51 dB
IEEE 802.11
Type/Subtype: Authentication (11)
Frame Control: 0x00B0 (Normal)
Version: 0
Type: Management frame (0)
Subtype: 11
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 314
Destination address: IntelCor_b5:fa:63 (00:13:e8:b5:fa:63)
Source address: Compex_64:c7:d7 (00:80:48:64:c7:d7)
BSS Id: Compex_64:c7:d7 (00:80:48:64:c7:d7)
Fragment number: 0
Sequence number: 0
Frame check sequence: 0xc283ddaa [correct]
[Good: True]
[Bad: False]
IEEE 802.11 wireless LAN management frame
Fixed parameters (6 bytes)
Authentication Algorithm: Open System (0)
Authentication SEQ: 0x0002
Status code: Successful (0x0000)
No. Time Source Destination Protocol Info
381 20.060908 Compex_64:c7:d7 (RA) IEEE 802.11 Acknowledgement
Frame 381 (38 bytes on wire, 38 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.683979000
[Time delta from previous packet: 0.000310000 seconds]
[Time since reference or first frame: 20.060908000 seconds]
Frame Number: 381
Packet Length: 38 bytes
Capture Length: 38 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679023190
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 1.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -51 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 45 dB
IEEE 802.11
Type/Subtype: Acknowledgement (29)
Frame Control: 0x00D4 (Normal)
Version: 0
Type: Control frame (1)
Subtype: 13
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 0
Receiver address: Compex_64:c7:d7 (00:80:48:64:c7:d7)
No. Time Source Destination Protocol Info
382 20.061417 IntelCor_b5:fa:63 Compex_64:c7:d7 IEEE 802.11 Association Request,SN=996,FN=0, SSID: "ath9kap"
Frame 382 (83 bytes on wire, 83 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.684488000
[Time delta from previous packet: 0.000509000 seconds]
[Time since reference or first frame: 20.061417000 seconds]
Frame Number: 382
Packet Length: 83 bytes
Capture Length: 83 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679023699
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 11.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -51 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 45 dB
IEEE 802.11
Type/Subtype: Association Request (0)
Frame Control: 0x0000 (Normal)
Version: 0
Type: Management frame (0)
Subtype: 0
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 213
Destination address: Compex_64:c7:d7 (00:80:48:64:c7:d7)
Source address: IntelCor_b5:fa:63 (00:13:e8:b5:fa:63)
BSS Id: Compex_64:c7:d7 (00:80:48:64:c7:d7)
Fragment number: 0
Sequence number: 996
Frame check sequence: 0x05e0fcbd [correct]
[Good: True]
[Bad: False]
IEEE 802.11 wireless LAN management frame
Fixed parameters (4 bytes)
Capability Information: 0x0401
.... .... .... ...1 = ESS capabilities: Transmitter is an AP
.... .... .... ..0. = IBSS status: Transmitter belongs to a BSS
.... ..0. .... 00.. = CFP participation capabilities: No point coordinator at AP (0x0000)
.... .... ...0 .... = Privacy: AP/STA cannot support WEP
.... .... ..0. .... = Short Preamble: Short preamble not allowed
.... .... .0.. .... = PBCC: PBCC modulation not allowed
.... .... 0... .... = Channel Agility: Channel agility not in use
.... ...0 .... .... = Spectrum Management: dot11SpectrumManagementRequired FALSE
.... .1.. .... .... = Short Slot Time: Short slot time in use
.... 0... .... .... = Automatic Power Save Delivery: apsd not implemented
..0. .... .... .... = DSSS-OFDM: DSSS-OFDM modulation not allowed
.0.. .... .... .... = Delayed Block Ack: delayed block ack not implented
0... .... .... .... = Immediate Block Ack: immediate block ack not implented
Listen Interval: 0x000a
Tagged parameters (25 bytes)
SSID parameter set: "ath9kap"
Tag Number: 0 (SSID parameter set)
Tag length: 7
Tag interpretation: ath9kap
Supported Rates: 1,0(B) 2,0(B) 5,5(B) 11,0(B) 6,0 9,0 12,0 18,0
Tag Number: 1 (Supported Rates)
Tag length: 8
Tag interpretation: Supported rates: 1,0(B) 2,0(B) 5,5(B) 11,0(B) 6,0 9,0 12,0 18,0 [Mbit/sec]
Extended Supported Rates: 24,0 36,0 48,0 54,0
Tag Number: 50 (Extended Supported Rates)
Tag length: 4
Tag interpretation: Supported rates: 24,0 36,0 48,0 54,0 [Mbit/sec]
No. Time Source Destination Protocol Info
383 20.061629 IntelCor_b5:fa:63 (RA) IEEE 802.11 Acknowledgement
Frame 383 (38 bytes on wire, 38 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.684700000
[Time delta from previous packet: 0.000212000 seconds]
[Time since reference or first frame: 20.061629000 seconds]
Frame Number: 383
Packet Length: 38 bytes
Capture Length: 38 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679023912
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 11.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -44 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 52 dB
IEEE 802.11
Type/Subtype: Acknowledgement (29)
Frame Control: 0x00D4 (Normal)
Version: 0
Type: Control frame (1)
Subtype: 13
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 0
Receiver address: IntelCor_b5:fa:63 (00:13:e8:b5:fa:63)
No. Time Source Destination Protocol Info
385 20.071316 Compex_64:c7:d7 IntelCor_b5:fa:63 IEEE 802.11 Association Response,SN=0,FN=0
Frame 385 (76 bytes on wire, 76 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.694387000
[Time delta from previous packet: 0.000986000 seconds]
[Time since reference or first frame: 20.071316000 seconds]
Frame Number: 385
Packet Length: 76 bytes
Capture Length: 76 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679033598
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 1.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -45 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 51 dB
IEEE 802.11
Type/Subtype: Association Response (1)
Frame Control: 0x0010 (Normal)
Version: 0
Type: Management frame (0)
Subtype: 1
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 314
Destination address: IntelCor_b5:fa:63 (00:13:e8:b5:fa:63)
Source address: Compex_64:c7:d7 (00:80:48:64:c7:d7)
BSS Id: Compex_64:c7:d7 (00:80:48:64:c7:d7)
Fragment number: 0
Sequence number: 0
Frame check sequence: 0x3df93a4f [correct]
[Good: True]
[Bad: False]
IEEE 802.11 wireless LAN management frame
Fixed parameters (6 bytes)
Capability Information: 0x0401
.... .... .... ...1 = ESS capabilities: Transmitter is an AP
.... .... .... ..0. = IBSS status: Transmitter belongs to a BSS
.... ..0. .... 00.. = CFP participation capabilities: No point coordinator at AP (0x0000)
.... .... ...0 .... = Privacy: AP/STA cannot support WEP
.... .... ..0. .... = Short Preamble: Short preamble not allowed
.... .... .0.. .... = PBCC: PBCC modulation not allowed
.... .... 0... .... = Channel Agility: Channel agility not in use
.... ...0 .... .... = Spectrum Management: dot11SpectrumManagementRequired FALSE
.... .1.. .... .... = Short Slot Time: Short slot time in use
.... 0... .... .... = Automatic Power Save Delivery: apsd not implemented
..0. .... .... .... = DSSS-OFDM: DSSS-OFDM modulation not allowed
.0.. .... .... .... = Delayed Block Ack: delayed block ack not implented
0... .... .... .... = Immediate Block Ack: immediate block ack not implented
Status code: Successful (0x0000)
Association ID: 0x0001
Tagged parameters (16 bytes)
Supported Rates: 1,0(B) 2,0(B) 5,5(B) 11,0(B) 6,0 9,0 12,0 18,0
Tag Number: 1 (Supported Rates)
Tag length: 8
Tag interpretation: Supported rates: 1,0(B) 2,0(B) 5,5(B) 11,0(B) 6,0 9,0 12,0 18,0 [Mbit/sec]
Extended Supported Rates: 24,0 36,0 48,0 54,0
Tag Number: 50 (Extended Supported Rates)
Tag length: 4
Tag interpretation: Supported rates: 24,0 36,0 48,0 54,0 [Mbit/sec]
No. Time Source Destination Protocol Info
386 20.071631 Compex_64:c7:d7 (RA) IEEE 802.11 Acknowledgement
Frame 386 (38 bytes on wire, 38 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.694702000
[Time delta from previous packet: 0.000315000 seconds]
[Time since reference or first frame: 20.071631000 seconds]
Frame Number: 386
Packet Length: 38 bytes
Capture Length: 38 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679033913
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 1.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -50 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 46 dB
IEEE 802.11
Type/Subtype: Acknowledgement (29)
Frame Control: 0x00D4 (Normal)
Version: 0
Type: Control frame (1)
Subtype: 13
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 0
Receiver address: Compex_64:c7:d7 (00:80:48:64:c7:d7)
No. Time Source Destination Protocol Info
389 20.264049 IntelCor_b5:fa:63 Compex_64:c7:d7 IEEE 802.11 Deauthentication,SN=997,FN=0
Frame 389 (56 bytes on wire, 56 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.887120000
[Time delta from previous packet: 0.000341000 seconds]
[Time since reference or first frame: 20.264049000 seconds]
Frame Number: 389
Packet Length: 56 bytes
Capture Length: 56 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679226330
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 11.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -49 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 47 dB
IEEE 802.11
Type/Subtype: Deauthentication (12)
Frame Control: 0x00C0 (Normal)
Version: 0
Type: Management frame (0)
Subtype: 12
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 213
Destination address: Compex_64:c7:d7 (00:80:48:64:c7:d7)
Source address: IntelCor_b5:fa:63 (00:13:e8:b5:fa:63)
BSS Id: Compex_64:c7:d7 (00:80:48:64:c7:d7)
Fragment number: 0
Sequence number: 997
Frame check sequence: 0x8bfd3c64 [correct]
[Good: True]
[Bad: False]
IEEE 802.11 wireless LAN management frame
Fixed parameters (2 bytes)
Reason code: Unspecified reason (0x0001)
No. Time Source Destination Protocol Info
390 20.264260 IntelCor_b5:fa:63 (RA) IEEE 802.11 Acknowledgement
Frame 390 (38 bytes on wire, 38 bytes captured)
Arrival Time: Oct 22, 2009 11:00:19.887331000
[Time delta from previous packet: 0.000211000 seconds]
[Time since reference or first frame: 20.264260000 seconds]
Frame Number: 390
Packet Length: 38 bytes
Capture Length: 38 bytes
[Frame is marked: True]
[Protocols in frame: radiotap:wlan]
Radiotap Header v0, Length 26
Header revision: 0
Header pad: 0
Header length: 26
Present flags: 0x0000186f
.... .... .... .... .... .... .... ...1 = TSFT: True
.... .... .... .... .... .... .... ..1. = Flags: True
.... .... .... .... .... .... .... .1.. = Rate: True
.... .... .... .... .... .... .... 1... = Channel: True
.... .... .... .... .... .... ...0 .... = FHSS: False
.... .... .... .... .... .... ..1. .... = DBM Antenna Signal: True
.... .... .... .... .... .... .1.. .... = DBM Antenna Noise: True
.... .... .... .... .... .... 0... .... = Lock Quality: False
.... .... .... .... .... ...0 .... .... = TX Attenuation: False
.... .... .... .... .... ..0. .... .... = DB TX Attenuation: False
.... .... .... .... .... .0.. .... .... = DBM TX Attenuation: False
.... .... .... .... .... 1... .... .... = Antenna: True
.... .... .... .... ...1 .... .... .... = DB Antenna Signal: True
.... .... .... .... ..0. .... .... .... = DB Antenna Noise: False
.... .... .... .... .0.. .... .... .... = FCS in header: False
0... .... .... .... .... .... .... .... = Ext: False
MAC timestamp: 127679226540
Flags: 0x12
.... ...0 = CFP: False
.... ..1. = Preamble: Short
.... .0.. = WEP: False
.... 0... = Fragmentation: False
...1 .... = FCS at end: True
..0. .... = Data Pad: False
Data Rate: 11.0 Mb/s
Channel: 12
Channel frequency: 2467
Channel type: 802.11g (0x0480)
SSI Signal: -44 dBm
SSI Noise: -96 dBm
Antenna: 1
SSI Signal: 52 dB
IEEE 802.11
Type/Subtype: Acknowledgement (29)
Frame Control: 0x00D4 (Normal)
Version: 0
Type: Control frame (1)
Subtype: 13
Flags: 0x0
DS status: Not leaving DS or network is operating in AD-HOC mode (To DS: 0 From DS: 0) (0x00)
.... .0.. = More Fragments: This is the last fragment
.... 0... = Retry: Frame is not being retransmitted
...0 .... = PWR MGT: STA will stay up
..0. .... = More Data: No data buffered
.0.. .... = Protected flag: Data is not protected
0... .... = Order flag: Not strictly ordered
Duration: 0
Receiver address: IntelCor_b5:fa:63 (00:13:e8:b5:fa:63)
^ permalink raw reply
* [PATCH] libertas: remove some references to IW_MODE_abc
From: Holger Schurig @ 2009-10-22 12:15 UTC (permalink / raw)
To: linux-wireless, John Linville, Dan Williams
[PATCH] libertas: remove some references to IW_MODE_abc
... in pursue to quaff the wide-spread references to WEXT constants.
When setting SNMP_MIB_OID_BSS_TYPE, wext.c can directly calculate the value
the firmware wants.
Reading of SNMP_MIB_OID_BSS_TYPE doesn't happen anywhere, so no need to
convert the firmware value into WEXT values anyway.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
--- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
+++ linux-wl/drivers/net/wireless/libertas/cmd.c
@@ -390,7 +390,7 @@
switch (oid) {
case SNMP_MIB_OID_BSS_TYPE:
cmd.bufsize = cpu_to_le16(sizeof(u8));
- cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1;
+ cmd.value[0] = val;
break;
case SNMP_MIB_OID_11D_ENABLE:
case SNMP_MIB_OID_FRAG_THRESHOLD:
@@ -443,13 +443,7 @@
switch (le16_to_cpu(cmd.bufsize)) {
case sizeof(u8):
- if (oid == SNMP_MIB_OID_BSS_TYPE) {
- if (cmd.value[0] == 2)
- *out_val = IW_MODE_ADHOC;
- else
- *out_val = IW_MODE_INFRA;
- } else
- *out_val = cmd.value[0];
+ *out_val = cmd.value[0];
break;
case sizeof(u16):
*out_val = le16_to_cpu(*((__le16 *)(&cmd.value)));
--- linux-wl.orig/drivers/net/wireless/libertas/assoc.c
+++ linux-wl/drivers/net/wireless/libertas/assoc.c
@@ -1567,7 +1567,8 @@
}
priv->mode = assoc_req->mode;
- ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, assoc_req->mode);
+ ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE,
+ assoc_req->mode == IW_MODE_ADHOC ? 2 : 1);
done:
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH] net: Adjust softirq raising in __napi_schedule
From: David Miller @ 2009-10-22 11:29 UTC (permalink / raw)
To: jarkao2
Cc: johannes, tilman, hidave.darkstar, linux-kernel, tglx,
linux-wireless, linux-ppp, netdev, paulus, mb, oliver
In-Reply-To: <20091021213947.GA12202@ami.dom.local>
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Wed, 21 Oct 2009 23:39:47 +0200
> I'm not sure I can understand your question. This patch is mainly to
> avoid using netif_rx()/netif_rx_ni() pair as a test of proper process
> context handling; IMHO there're better tools for this (lockdep,
> WARN_ON's).
Semantically I think your patch is correct, but I wonder about cost.
Something that is a simply per-cpu inline "or" operation is now a
function call and potentially mispredicted branch inside of
raise_softirq_irqoff().
And netif_rx() is indeed a fast path for tunnels and other users so
this does matter.
I like having people call things in the correct context the function
was built for, and thus we can avoiryd completely useless operations and
tests as we can now in netif_rx().
Makaing things general purpose costs something, and it costs too much
here for this critical routine, sorry.
I was just having a talk with Nick Piggin about these kinds of issues
today, too few people care about these ever encrouching tiny pieces
of bloat that slow the kernel down gradually over time, and I simply
won't stand for it when I notice it :-)
^ permalink raw reply
* [PATCH] zd1211rw: Fix TX status reporting in order to have proper rate control
From: Benoit PAPILLAULT @ 2009-10-22 10:04 UTC (permalink / raw)
To: zd1211-devs; +Cc: linux-wireless, Benoit PAPILLAULT
First, we reduce the number of hardware retries to 0 (ie 2 real retries
for each rate). Next, when we report the retries to mac80211, we always
report a retry count of 1 (it seems to be 2 in fact, but using 2 seems
to lead to wrong performance for some reason). We use a state machine to
determine the real fate of a packet based on the 802.11 ACK and what the
Zydas hardware is saying when a real retry occurs. The real retry rates
are encoded in a static array. It has been tested with both zd1211 and
zd1211b hardware. Of course, since the Zydas hardware is not reporting
retries accurately, we are just doing our best in order to get the best
performance (ie higher throughput).
Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr>
---
drivers/net/wireless/zd1211rw/zd_chip.c | 4 +-
drivers/net/wireless/zd1211rw/zd_chip.h | 18 +++-
drivers/net/wireless/zd1211rw/zd_mac.c | 204 +++++++++++++++++++++++++++---
drivers/net/wireless/zd1211rw/zd_mac.h | 25 ++++-
drivers/net/wireless/zd1211rw/zd_usb.c | 4 +-
5 files changed, 228 insertions(+), 27 deletions(-)
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
index 5e110a2..43b476d 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -755,7 +755,7 @@ static int hw_reset_phy(struct zd_chip *chip)
static int zd1211_hw_init_hmac(struct zd_chip *chip)
{
static const struct zd_ioreq32 ioreqs[] = {
- { CR_ZD1211_RETRY_MAX, 0x2 },
+ { CR_ZD1211_RETRY_MAX, ZD1211_RETRY_COUNT },
{ CR_RX_THRESHOLD, 0x000c0640 },
};
@@ -767,7 +767,7 @@ static int zd1211_hw_init_hmac(struct zd_chip *chip)
static int zd1211b_hw_init_hmac(struct zd_chip *chip)
{
static const struct zd_ioreq32 ioreqs[] = {
- { CR_ZD1211B_RETRY_MAX, 0x02020202 },
+ { CR_ZD1211B_RETRY_MAX, ZD1211B_RETRY_COUNT },
{ CR_ZD1211B_CWIN_MAX_MIN_AC0, 0x007f003f },
{ CR_ZD1211B_CWIN_MAX_MIN_AC1, 0x007f003f },
{ CR_ZD1211B_CWIN_MAX_MIN_AC2, 0x003f001f },
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.h b/drivers/net/wireless/zd1211rw/zd_chip.h
index 678c139..9fd8f35 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.h
+++ b/drivers/net/wireless/zd1211rw/zd_chip.h
@@ -642,13 +642,29 @@ enum {
#define CR_ZD1211B_TXOP CTL_REG(0x0b20)
#define CR_ZD1211B_RETRY_MAX CTL_REG(0x0b28)
+/* Value for CR_ZD1211_RETRY_MAX & CR_ZD1211B_RETRY_MAX. Vendor driver uses 2,
+ * we use 0. The first rate is tried (count+2), then all next rates are tried
+ * twice, until 1 Mbits is tried. */
+#define ZD1211_RETRY_COUNT 0
+#define ZD1211B_RETRY_COUNT \
+ (ZD1211_RETRY_COUNT << 0)| \
+ (ZD1211_RETRY_COUNT << 8)| \
+ (ZD1211_RETRY_COUNT << 16)| \
+ (ZD1211_RETRY_COUNT << 24)
+
/* Used to detect PLL lock */
#define UW2453_INTR_REG ((zd_addr_t)0x85c1)
#define CWIN_SIZE 0x007f043f
-#define HWINT_ENABLED 0x004f0000
+#define HWINT_ENABLED \
+ (INT_TX_COMPLETE_EN| \
+ INT_RX_COMPLETE_EN| \
+ INT_RETRY_FAIL_EN| \
+ INT_WAKEUP_EN| \
+ INT_CFG_NEXT_BCN_EN)
+
#define HWINT_DISABLED 0
#define E2P_PWR_INT_GUARD 8
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 6d66635..8ca85d8 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -88,6 +88,34 @@ static const struct ieee80211_rate zd_rates[] = {
.flags = 0 },
};
+/*
+ * Zydas retry rates table. Each line is listed in the same order as
+ * in zd_rates[] and contains all the rate used when a packet is sent
+ * starting with a given rates. Let's consider an example :
+ *
+ * "11 Mbits : 4, 3, 2, 1, 0" means :
+ * - packet is sent using 4 different rates
+ * - 1st rate is index 3 (ie 11 Mbits)
+ * - 2nd rate is index 2 (ie 5.5 Mbits)
+ * - 3rd rate is index 1 (ie 2 Mbits)
+ * - 4th rate is index 0 (ie 1 Mbits)
+ */
+
+static const struct tx_retry_rate zd_retry_rates[] = {
+ { /* 1 Mbits */ 1, { 0 }},
+ { /* 2 Mbits */ 2, { 1, 0 }},
+ { /* 5.5 Mbits */ 3, { 2, 1, 0 }},
+ { /* 11 Mbits */ 4, { 3, 2, 1, 0 }},
+ { /* 6 Mbits */ 5, { 4, 3, 2, 1, 0 }},
+ { /* 9 Mbits */ 6, { 5, 4, 3, 2, 1, 0}},
+ { /* 12 Mbits */ 5, { 6, 3, 2, 1, 0 }},
+ { /* 18 Mbits */ 6, { 7, 6, 3, 2, 1, 0 }},
+ { /* 24 Mbits */ 6, { 8, 6, 3, 2, 1, 0 }},
+ { /* 36 Mbits */ 7, { 9, 8, 6, 3, 2, 1, 0 }},
+ { /* 48 Mbits */ 8, {10, 9, 8, 6, 3, 2, 1, 0 }},
+ { /* 54 Mbits */ 9, {11, 10, 9, 8, 6, 3, 2, 1, 0 }}
+};
+
static const struct ieee80211_channel zd_channels[] = {
{ .center_freq = 2412, .hw_value = 1 },
{ .center_freq = 2417, .hw_value = 2 },
@@ -282,7 +310,7 @@ static void zd_op_stop(struct ieee80211_hw *hw)
}
/**
- * tx_status - reports tx status of a packet if required
+ * zd_mac_tx_status - reports tx status of a packet if required
* @hw - a &struct ieee80211_hw pointer
* @skb - a sk-buffer
* @flags: extra flags to set in the TX status info
@@ -295,15 +323,49 @@ static void zd_op_stop(struct ieee80211_hw *hw)
*
* If no status information has been requested, the skb is freed.
*/
-static void tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
- int ackssi, bool success)
+static void zd_mac_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
+ int ackssi, struct tx_status *tx_status)
{
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-
+ int i;
+ int success = 1, retry = 1;
+ int first_idx;
+ const struct tx_retry_rate *retries;
+
ieee80211_tx_info_clear_status(info);
- if (success)
+ if (tx_status) {
+ success = !tx_status->failure;
+ retry = tx_status->retry + success;
+ }
+
+ if (success) {
+ /* success */
info->flags |= IEEE80211_TX_STAT_ACK;
+ } else {
+ /* failure */
+ info->flags &= ~IEEE80211_TX_STAT_ACK;
+ }
+
+ first_idx = info->status.rates[0].idx;
+ ZD_ASSERT(0<=first_idx && first_idx<ARRAY_SIZE(zd_retry_rates));
+ retries = &zd_retry_rates[first_idx];
+ ZD_ASSERT(0<=retry && retry<=retries->count);
+
+ info->status.rates[0].idx = retries->rate[0];
+ info->status.rates[0].count = 1; // (retry > 1 ? 2 : 1);
+
+ for (i=1; i<IEEE80211_TX_MAX_RATES-1 && i<retry; i++) {
+ info->status.rates[i].idx = retries->rate[i];
+ info->status.rates[i].count = 1; // ((i==retry-1) && success ? 1:2);
+ }
+ for (; i<IEEE80211_TX_MAX_RATES && i<retry; i++) {
+ info->status.rates[i].idx = retries->rate[retry-1];
+ info->status.rates[i].count = 1; // (success ? 1:2);
+ }
+ if (i<IEEE80211_TX_MAX_RATES)
+ info->status.rates[i].idx = -1; /* terminate */
+
info->status.ack_signal = ackssi;
ieee80211_tx_status_irqsafe(hw, skb);
}
@@ -316,16 +378,79 @@ static void tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
* transferred. The first frame from the tx queue, will be selected and
* reported as error to the upper layers.
*/
-void zd_mac_tx_failed(struct ieee80211_hw *hw)
+void zd_mac_tx_failed(struct urb *urb)
{
- struct sk_buff_head *q = &zd_hw_mac(hw)->ack_wait_queue;
+ struct ieee80211_hw * hw = zd_usb_to_hw(urb->context);
+ struct zd_mac *mac = zd_hw_mac(hw);
+ struct sk_buff_head *q = &mac->ack_wait_queue;
struct sk_buff *skb;
+ struct tx_status *tx_status = (struct tx_status *)urb->transfer_buffer;
+ unsigned long flags;
+ int success = !tx_status->failure;
+ int retry = tx_status->retry + success;
+ int found = 0;
+ int i, position = 0;
- skb = skb_dequeue(q);
- if (skb == NULL)
- return;
+ q = &mac->ack_wait_queue;
+ spin_lock_irqsave(&q->lock, flags);
- tx_status(hw, skb, 0, 0);
+ skb_queue_walk(q, skb) {
+ struct ieee80211_hdr *tx_hdr;
+ struct ieee80211_tx_info *info;
+ int first_idx, final_idx;
+ const struct tx_retry_rate *retries;
+ u8 final_rate;
+
+ position ++;
+
+ /* if the hardware reports a failure and we had a 802.11 ACK
+ * pending, then we skip the first skb when searching for a
+ * matching frame */
+ if (tx_status->failure && mac->ack_pending &&
+ skb_queue_is_first(q, skb)) {
+ continue;
+ }
+
+ tx_hdr = (struct ieee80211_hdr *)skb->data;
+
+ /* we skip all frames not matching the reported destination */
+ if (unlikely(memcmp(tx_hdr->addr1, tx_status->mac, ETH_ALEN))) {
+ continue;
+ }
+
+ /* we skip all frames not matching the reported final rate */
+
+ info = IEEE80211_SKB_CB(skb);
+ first_idx = info->status.rates[0].idx;
+ ZD_ASSERT(0<=first_idx && first_idx<ARRAY_SIZE(zd_retry_rates));
+ retries = &zd_retry_rates[first_idx];
+ if (retry < 0 || retry > retries->count) {
+ continue;
+ }
+
+ ZD_ASSERT(0<=retry && retry<=retries->count);
+ final_idx = retries->rate[retry-1];
+ final_rate = zd_rates[final_idx].hw_value;
+
+ if (final_rate != tx_status->rate) {
+ continue;
+ }
+
+ found = 1;
+ break;
+ }
+
+ if (found) {
+ for (i=1; i<=position; i++) {
+ skb = __skb_dequeue(q);
+ zd_mac_tx_status(hw, skb,
+ mac->ack_pending ? mac->ack_signal : 0,
+ i == position ? tx_status : NULL);
+ mac->ack_pending = 0;
+ }
+ }
+
+ spin_unlock_irqrestore(&q->lock, flags);
}
/**
@@ -342,18 +467,27 @@ void zd_mac_tx_to_dev(struct sk_buff *skb, int error)
{
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_hw *hw = info->rate_driver_data[0];
+ struct zd_mac *mac = zd_hw_mac(hw);
+
+ ieee80211_tx_info_clear_status(info);
skb_pull(skb, sizeof(struct zd_ctrlset));
if (unlikely(error ||
(info->flags & IEEE80211_TX_CTL_NO_ACK))) {
- tx_status(hw, skb, 0, !error);
+ /*
+ * FIXME : do we need to fill in anything ?
+ */
+ ieee80211_tx_status_irqsafe(hw, skb);
} else {
- struct sk_buff_head *q =
- &zd_hw_mac(hw)->ack_wait_queue;
+ struct sk_buff_head *q = &mac->ack_wait_queue;
skb_queue_tail(q, skb);
- while (skb_queue_len(q) > ZD_MAC_MAX_ACK_WAITERS)
- zd_mac_tx_failed(hw);
+ while (skb_queue_len(q) > ZD_MAC_MAX_ACK_WAITERS) {
+ zd_mac_tx_status(hw, skb_dequeue(q),
+ mac->ack_pending ? mac->ack_signal : 0,
+ NULL);
+ mac->ack_pending = 0;
+ }
}
}
@@ -606,27 +740,47 @@ fail:
static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr,
struct ieee80211_rx_status *stats)
{
+ struct zd_mac *mac = zd_hw_mac(hw);
struct sk_buff *skb;
struct sk_buff_head *q;
unsigned long flags;
+ int found = 0;
+ int i, position = 0;
if (!ieee80211_is_ack(rx_hdr->frame_control))
return 0;
- q = &zd_hw_mac(hw)->ack_wait_queue;
+ q = &mac->ack_wait_queue;
spin_lock_irqsave(&q->lock, flags);
skb_queue_walk(q, skb) {
struct ieee80211_hdr *tx_hdr;
+ position ++;
+
+ if (mac->ack_pending && skb_queue_is_first(q, skb))
+ continue;
+
tx_hdr = (struct ieee80211_hdr *)skb->data;
if (likely(!memcmp(tx_hdr->addr2, rx_hdr->addr1, ETH_ALEN)))
{
- __skb_unlink(skb, q);
- tx_status(hw, skb, stats->signal, 1);
- goto out;
+ found = 1;
+ break;
}
}
-out:
+
+ if (found) {
+ for (i=1; i<position; i++) {
+ skb = __skb_dequeue(q);
+ zd_mac_tx_status(hw, skb,
+ mac->ack_pending ? mac->ack_signal : 0,
+ NULL);
+ mac->ack_pending = 0;
+ }
+
+ mac->ack_pending = 1;
+ mac->ack_signal = stats->signal;
+ }
+
spin_unlock_irqrestore(&q->lock, flags);
return 1;
}
@@ -709,6 +863,7 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)
skb_reserve(skb, 2);
}
+ /* FIXME : could we avoid this big memcpy ? */
memcpy(skb_put(skb, length), buffer, length);
memcpy(IEEE80211_SKB_RXCB(skb), &stats, sizeof(stats));
@@ -999,7 +1154,14 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
hw->queues = 1;
hw->extra_tx_headroom = sizeof(struct zd_ctrlset);
+ /*
+ * Tell mac80211 that we support multi rate retries
+ */
+ hw->max_rates = IEEE80211_TX_MAX_RATES;
+ hw->max_rate_tries = 18; /* 9 rates * 2 retries/rate */
+
skb_queue_head_init(&mac->ack_wait_queue);
+ mac->ack_pending = 0;
zd_chip_init(&mac->chip, hw, intf);
housekeeping_init(mac);
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h
index 7c27591..630c298 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.h
+++ b/drivers/net/wireless/zd1211rw/zd_mac.h
@@ -140,6 +140,21 @@ struct rx_status {
#define ZD_RX_CRC16_ERROR 0x40
#define ZD_RX_ERROR 0x80
+struct tx_retry_rate {
+ int count; /* number of valid element in rate[] array */
+ int rate[10]; /* retry rates, described by an index in zd_rates[] */
+};
+
+struct tx_status {
+ u8 type; /* must always be 0x01 : USB_INT_TYPE */
+ u8 id; /* must always be 0xa0 : USB_INT_ID_RETRY_FAILED */
+ u8 rate;
+ u8 pad;
+ u8 mac[ETH_ALEN];
+ u8 retry;
+ u8 failure;
+} __attribute__((packed));
+
enum mac_flags {
MAC_FIXED_CHANNEL = 0x01,
};
@@ -150,7 +165,7 @@ struct housekeeping {
#define ZD_MAC_STATS_BUFFER_SIZE 16
-#define ZD_MAC_MAX_ACK_WAITERS 10
+#define ZD_MAC_MAX_ACK_WAITERS 50
struct zd_mac {
struct zd_chip chip;
@@ -184,6 +199,12 @@ struct zd_mac {
/* whether to pass control frames to stack */
unsigned int pass_ctrl:1;
+
+ /* whether we have received a 802.11 ACK that is pending */
+ unsigned int ack_pending:1;
+
+ /* signal strength of the last 802.11 ACK received */
+ int ack_signal;
};
#define ZD_REGDOMAIN_FCC 0x10
@@ -279,7 +300,7 @@ int zd_mac_preinit_hw(struct ieee80211_hw *hw);
int zd_mac_init_hw(struct ieee80211_hw *hw);
int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length);
-void zd_mac_tx_failed(struct ieee80211_hw *hw);
+void zd_mac_tx_failed(struct urb *urb);
void zd_mac_tx_to_dev(struct sk_buff *skb, int error);
#ifdef DEBUG
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index 3868884..ddfaa73 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -419,7 +419,7 @@ static void int_urb_complete(struct urb *urb)
handle_regs_int(urb);
break;
case USB_INT_ID_RETRY_FAILED:
- zd_mac_tx_failed(zd_usb_to_hw(urb->context));
+ zd_mac_tx_failed(urb);
break;
default:
dev_dbg_f(urb_dev(urb), "error: urb %p unknown id %x\n", urb,
@@ -553,6 +553,8 @@ static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,
if (length < sizeof(struct rx_length_info)) {
/* It's not a complete packet anyhow. */
+ printk("%s: invalid, small RX packet : %d\n",
+ __func__, length);
return;
}
length_info = (struct rx_length_info *)
--
1.6.2.4
^ permalink raw reply related
* Re: [RFC] libertas: monster-patch to make CFG/WEXT configurable
From: Holger Schurig @ 2009-10-22 9:28 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-wireless
In-Reply-To: <1256150184.5010.45.camel@localhost.localdomain>
> For the mesh interface stuff, especially in tx/rx paths, would
> you mind not ifdefing that? Since with cfg80211,
> priv->mesh_dev will always be NULL, those checks will be just
> fine and you still don't have to care about mesh.
Sure, I'll do that.
I just thought that there's no need for priv->mesh_dev in the
cfg80211 case. Wouldn't mesh be activated by "iw dev XXX set
type mesh"? Then cfg80211_ops .change_intf() would be called.
Now that could either populate priv->mesh_dev ... or it could
change priv->dev. Not sure about what is better. But the answer
to this would tell us how to handle the mesh tx/rx paths.
cmdresp.c checks for priv->mesh_autostart_enabled. Is this
another "sitting-forever-in-OLPC" thingy? It's nowhere else
used and there's no code to set it.
> I'm sure that the bits for SNMP_MIB_OID_BSS_TYPE could also be
> converted to use lib80211 or cfg80211 values instead of WEXT
> ones; I just picked WEXT at the time because we had no cfg80211
> yet.
Good idea.
However, when I'm teaching cfg80211 about the SNMP-commands, I'll
use new-style commands anyway. I'd need them for RTS threshold
etc anyway.
BTW: I added the RX part of the monitor in my cfg80211
implementation. But for my CF card, I'm still stuck with firmware
5.0.16.p0. That doesn't support monitor mode. However, I also
have some USB stick around (got it from you!). Do you know which
firmware for this USB stick supports monitor?
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH] libertas: remove handling for CMD_802_11_LED_GPIO_CTRL
From: Holger Schurig @ 2009-10-22 7:53 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-wireless, John Linville
In-Reply-To: <1256149730.5010.39.camel@localhost.localdomain>
> It's actually used by the OLPC folks; but right now there's
> simply no mechanism to configure that ability via WEXT. Is
> there some way to do this via the kernel LED framework instead
> that libertas should be using?
They use it?
No one did bother to send a patch for the in-kernel Libertas
driver during the last year. Sigh.
Also, if they use it, they need a patch on top of what is now in
the kernel, because the current in-kernel libertas driver has no
code to issue the CMD_802_11_LED_GPIO_CTRL. That's why I removed
it in the first place.
It's O.K. for me to keep this code in (it doesn't harm), but a
better approach would be
a) use a new-style commands, a.k.a. lbs_cmd_with_response()
b) use the in-kernel LED support (as you said)
--
http://www.holgerschurig.de
^ permalink raw reply
* [PATCH] libertas spi: fix sparse errors
From: Holger Schurig @ 2009-10-22 7:49 UTC (permalink / raw)
To: linux-wireless, John Linville, Dan Williams
This fixes the following sparse warnings:
$ make modules SUBDIRS=drivers/net/wireless/libertas C=1 CF=-D__CHECK_ENDIAN__
make: Entering directory `/usr/src/linux-wl'
CHECK drivers/net/wireless/libertas/if_spi.c
drivers/net/wireless/libertas/if_spi.c:137:16: warning: incorrect type in initializer (different base types)
drivers/net/wireless/libertas/if_spi.c:137:16: expected unsigned short [unsigned] [usertype] reg_out
drivers/net/wireless/libertas/if_spi.c:137:16: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:191:16: warning: incorrect type in initializer (different base types)
drivers/net/wireless/libertas/if_spi.c:191:16: expected unsigned short [unsigned] [usertype] reg_out
drivers/net/wireless/libertas/if_spi.c:191:16: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:256:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:256:24: expected restricted __le32 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:256:24: got unsigned int *<noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Tested-by: Andrey Yurovsky <andrey@cozybit.com>
---
v2: fixed subject line, Andrey tested on a Blackfin machine
--- linux-wl.orig/drivers/net/wireless/libertas/if_spi.c
+++ linux-wl/drivers/net/wireless/libertas/if_spi.c
@@ -134,7 +134,7 @@
static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
{
int err = 0;
- u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
+ __le16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
struct spi_message m;
struct spi_transfer reg_trans;
struct spi_transfer data_trans;
@@ -166,7 +166,7 @@
static inline int spu_write_u16(struct if_spi_card *card, u16 reg, u16 val)
{
- u16 buff;
+ __le16 buff;
buff = cpu_to_le16(val);
return spu_write(card, reg, (u8 *)&buff, sizeof(u16));
@@ -188,7 +188,7 @@
{
unsigned int delay;
int err = 0;
- u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
+ __le16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
struct spi_message m;
struct spi_transfer reg_trans;
struct spi_transfer dummy_trans;
@@ -235,7 +235,7 @@
/* Read 16 bits from an SPI register */
static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val)
{
- u16 buf;
+ __le16 buf;
int ret;
ret = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
@@ -248,7 +248,7 @@
* The low 16 bits are read first. */
static int spu_read_u32(struct if_spi_card *card, u16 reg, u32 *val)
{
- u32 buf;
+ __le32 buf;
int err;
err = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH] libertas: remove unused lbs_cmd_802_11_inactivity_timeout()
From: Holger Schurig @ 2009-10-22 7:28 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-wireless, John Linville
In-Reply-To: <1256148756.5010.34.camel@localhost.localdomain>
> Pretty much like it sounds; it lets the device go to into
> powersave at user-specified interval after the last TX or RX,
> instead of having to wait one full beacon of inactivity.
Ok, nice.
But it could also have sounded like "report how long the card was
inactive", e.g. what "iw XXX link" can show.
Do you already have any idea about how to make those things like
TCP, inactivity etc available in NL80211/cfg80211 ?
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH] libertas: move mic failure event to wext.c
From: Holger Schurig @ 2009-10-22 7:21 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linux-wireless, John Linville, Dan Williams
In-Reply-To: <20091020085431.e26cce67.rdunlap@xenotime.net>
> argh. urgh. This file (or files) need to lose this
> non-kernel-doc function notation. Please.
Two things here:
* it's a copy and paste patch, so we move things just to another
place. This makes the cfg80211-patch less intrusive and also
makes the driver way smaller, once we don't compile WEXT in or
get rid of WEXT altogether. Normally for copy-and-paste patches
you shouldn't change other things.
* When I started with libertas, those comments where mostly
useful for me. I didn't care for /** or @, as I just read the
text. For me, those extra decorations have a less
negative "touch". The "positive" effect of having comments at
all did by far outweight the formatting.
For new code, I use a "normal" comment style, for example see
http://marc.info/?l=linux-wireless&m=125569942616188&w=2
So, if the comment style really annoys you, you could submit a
comment-reformat-patch.
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH] cfg80211: allow driver to signal noise level
From: Holger Schurig @ 2009-10-22 7:13 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
In-Reply-To: <1256080691.4475.8.camel@johannes.local>
On Wednesday 21 October 2009 01:18:11 Johannes Berg wrote:
> As discussed previously, noise is not a property of a station.
URL?
Should I aim for an "iw dev XXX show noise", e.g. try to
handle it as a property of the card? I could either add
an .get_noise() to cfg80211_ops, or better an .get_card_status()
with some bitmask of filled fields, like for the .get_station()
call. What would you prefer?
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [RFT 00/15] ath9k_hw ar9271 updates & AR5416 force bias
From: Luis R. Rodriguez @ 2009-10-22 3:42 UTC (permalink / raw)
To: linux-wireless, Sujith; +Cc: ath9k-devel, Luis R. Rodriguez
In-Reply-To: <1255934026-20686-1-git-send-email-lrodriguez@atheros.com>
On Mon, Oct 19, 2009 at 3:33 PM, Luis R. Rodriguez
<lrodriguez@atheros.com> wrote:
> This series started off to extend support for ar9271 on ath9k_hw
> but after review of the phy related code I noticed a fix for
> AR5416 was only partially being implemented and used for all
> chipsets. This series then adds the changes I've noticed so far
> required for ar9271 but also fixes and completes the orientation
> fix for AR5416 (force bias). Since I'm touching phy.c I also extend
> documentation for it.
>
> I don't have AR9285 cards with me but I do have an AR5416 cardbus
> card -- I'd appreciate it if someone can give this a test on AR9285
> but also more AR5416 cards -- this should help with TX on of AR5416
> and AR5418 on the 2.4 GHz band.
>
> Reports on issues or performance differences are greatly appreciated;
> the only issue I'd expect you'd see on non AR5416 hardware is a BUG_ON()
> which would be very obvious to notice and the performance enhancements
> should be seen on AR5416 for TX -- not yet sure exactly under what
> circumstances.
>
> Luis R. Rodriguez (15):
> ath9k_hw: modify the rf control register for ar9271 revision 1.0
> ath9k_hw: update register initialization/reset values for ar9271
> ath9k_hw: change the way we initialize the pll for ar9271
> ath9k_hw: start documenting 802.11n RF anlong front ends
> ath9k_hw: bail out early on ath9k_hw_init_rf()
> ath9k_hw: simplify rf attach and rename to
> ath9k_hw_rf_alloc_ext_banks()
> ath9k_hw: simplify ath9k_hw_rf_alloc_ext_banks()
> ath9k_hw: rename ath9k_hw_rf_free() to ath9k_hw_rf_free_ext_banks()
> ath9k_hw: make both analog channel change routines return int
> ath9k_hw: use a callback for frequency change
> ath9k_hw: order phy.c code and integrate spur mitigation
> ath9k_hw: make spur mitigation a callback
> ath9k_hw: remove unused modesIndex param from ath9k_hw_write_regs()
> ath9k_hw: Fix and complete force bias for AR5416
> ath9k_hw: make ath9k_phy_modify_rx_buffer() static
Omni-patch:
http://bombadil.infradead.org/~mcgrof/patches/all/all-2009-10-19.patch
Luis
^ permalink raw reply
* Re: Broadcom 4318 not working with bleeding edge kernels
From: Hin-Tak Leung @ 2009-10-21 22:37 UTC (permalink / raw)
To: Celejar; +Cc: Pavel Roskin, linux-wireless
In-Reply-To: <20091021173449.0a3ec80f.celejar@gmail.com>
On Wed, Oct 21, 2009 at 10:34 PM, Celejar <celejar@gmail.com> wrote:
> On Wed, 21 Oct 2009 11:29:17 -0400
> Pavel Roskin <proski@gnu.org> wrote:
>
>> On Tue, 2009-10-20 at 21:47 -0400, Celejar wrote:
>>
>> > Oct 17 19:44:19 localhost wpa_supplicant[3477]: Trying to associate
>> > with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz) Oct 17
>> > 19:44:19 localhost wpa_supplicant[3477]: Association request to the
>> > driver failed
>>
>> Since the message is from wpa_supplicant, it must be something between
>> wpa_supplicant and mac80211. I don't think any code in b43 is
>> involved.
>>
>> Perhaps you should include some information about wpa_supplicant, i.e.
>> its version and the command line. Please try the latest
>> wpa_supplicant. Please try both wext and nl80211 drivers. That would
>> help understand the extent of the problem.
>
> Version is 0.6.9, from the Debian package version 0.6.9.3. I don't
> know the exact command line, since I've been invoking it through the
> Debian ifupdown scripts. I haven't been specifying a backend, and the
> Debian documentation states that wext is used in that case.
'ps -lax -w -w' should show the full command line of currently running
processes. Read the documentation of ps.
also, have a look inside /var/log/wpa_supplicant.log (or wherever
Debian puts it) for the log.
> I have been playing with it some more, and it sometimes works, and
> sometimes doesn't. The only absolutely consistent pattern that I've
> seen is that (in my limited testing) it seems to always work right
> after unloading / reloading the driver (b43) (or a fresh boot).
>
> As I mentioned, I've been using the Debian ifupdown scripts. I have
> now tried running wpa_supplicant directly, and so far it has worked
> consistently, with a very minimal, mostly default config:
>
> 'wpa_supplicant -iwlan0 -c/wpa.conf'
>
> where wpa.conf contains:
>
> ctrl_interface=/var/run/wpa_supplicant
>
> network={
> ssid="my-ssid"
> psk="my passphrase"
> }
>
>
> So at this point, I guess the problem is something that I need to
> report to Debian, some sort of bugginess with their scripts. Thanks
> for the help ;)
>
> Celejar
> --
> mailmin.sourceforge.net - remote access via secure (OpenPGP) email
> ssuds.sourceforge.net - A Simple Sudoku Solver and Generator
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH] net: Adjust softirq raising in __napi_schedule
From: Jarek Poplawski @ 2009-10-21 21:39 UTC (permalink / raw)
To: Johannes Berg
Cc: Tilman Schmidt, David Miller, hidave.darkstar, linux-kernel, tglx,
linux-wireless, linux-ppp, netdev, paulus, Michael Buesch,
Oliver Hartkopp
In-Reply-To: <1256160330.12174.2.camel@johannes.local>
On Thu, Oct 22, 2009 at 06:25:30AM +0900, Johannes Berg wrote:
> On Wed, 2009-10-21 at 23:19 +0200, Jarek Poplawski wrote:
...
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -2728,7 +2728,7 @@ void __napi_schedule(struct napi_struct *n)
> >
> > local_irq_save(flags);
> > list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
> > - __raise_softirq_irqoff(NET_RX_SOFTIRQ);
> > + raise_softirq_irqoff(NET_RX_SOFTIRQ);
>
> This still doesn't make any sense.
>
> There may or may not be a lot of code that assumes that everything else
> is run with other tasklets disabled, and that it cannot be interrupted
> by a tasklet and thus create a race.
>
> Can you prove that is not the case, across the entire networking layer?
I'm not sure I can understand your question. This patch is mainly to
avoid using netif_rx()/netif_rx_ni() pair as a test of proper process
context handling; IMHO there're better tools for this (lockdep,
WARN_ON's).
Jarek P.
^ permalink raw reply
* Re: [PATCH] net: Adjust softirq raising in __napi_schedule
From: Tilman Schmidt @ 2009-10-21 21:37 UTC (permalink / raw)
To: Johannes Berg
Cc: Jarek Poplawski, David Miller, hidave.darkstar, linux-kernel,
tglx, linux-wireless, linux-ppp, netdev, paulus, Michael Buesch,
Oliver Hartkopp
In-Reply-To: <1256160330.12174.2.camel@johannes.local>
[-- Attachment #1: Type: text/plain, Size: 574 bytes --]
Johannes Berg schrieb:
> This still doesn't make any sense.
>
> There may or may not be a lot of code that assumes that everything else
> is run with other tasklets disabled, and that it cannot be interrupted
> by a tasklet and thus create a race.
>
> Can you prove that is not the case, across the entire networking layer?
So what's the solution you propose?
--
Tilman Schmidt E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
^ permalink raw reply
* Re: Broadcom 4318 not working with bleeding edge kernels
From: Celejar @ 2009-10-21 21:34 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linux-wireless
In-Reply-To: <1256138957.26054.4.camel@mj>
On Wed, 21 Oct 2009 11:29:17 -0400
Pavel Roskin <proski@gnu.org> wrote:
> On Tue, 2009-10-20 at 21:47 -0400, Celejar wrote:
>
> > Oct 17 19:44:19 localhost wpa_supplicant[3477]: Trying to associate
> > with 00:14:d1:3e:ff:30 (SSID='cranford' freq=2437 MHz) Oct 17
> > 19:44:19 localhost wpa_supplicant[3477]: Association request to the
> > driver failed
>
> Since the message is from wpa_supplicant, it must be something between
> wpa_supplicant and mac80211. I don't think any code in b43 is
> involved.
>
> Perhaps you should include some information about wpa_supplicant, i.e.
> its version and the command line. Please try the latest
> wpa_supplicant. Please try both wext and nl80211 drivers. That would
> help understand the extent of the problem.
Version is 0.6.9, from the Debian package version 0.6.9.3. I don't
know the exact command line, since I've been invoking it through the
Debian ifupdown scripts. I haven't been specifying a backend, and the
Debian documentation states that wext is used in that case.
I have been playing with it some more, and it sometimes works, and
sometimes doesn't. The only absolutely consistent pattern that I've
seen is that (in my limited testing) it seems to always work right
after unloading / reloading the driver (b43) (or a fresh boot).
As I mentioned, I've been using the Debian ifupdown scripts. I have
now tried running wpa_supplicant directly, and so far it has worked
consistently, with a very minimal, mostly default config:
'wpa_supplicant -iwlan0 -c/wpa.conf'
where wpa.conf contains:
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="my-ssid"
psk="my passphrase"
}
So at this point, I guess the problem is something that I need to
report to Debian, some sort of bugginess with their scripts. Thanks
for the help ;)
Celejar
--
mailmin.sourceforge.net - remote access via secure (OpenPGP) email
ssuds.sourceforge.net - A Simple Sudoku Solver and Generator
^ permalink raw reply
* Re: [PATCH] net: Adjust softirq raising in __napi_schedule
From: Johannes Berg @ 2009-10-21 21:25 UTC (permalink / raw)
To: Jarek Poplawski
Cc: Tilman Schmidt, David Miller, hidave.darkstar, linux-kernel, tglx,
linux-wireless, linux-ppp, netdev, paulus, Michael Buesch,
Oliver Hartkopp
In-Reply-To: <20091021211906.GA11401@ami.dom.local>
[-- Attachment #1: Type: text/plain, Size: 2238 bytes --]
On Wed, 2009-10-21 at 23:19 +0200, Jarek Poplawski wrote:
> On Wed, Oct 21, 2009 at 08:46:40PM +0200, Tilman Schmidt wrote:
> ...
> > I have tested your patch and I can confirm that it fixes the messages.
> > I have not noticed any ill effects.
>
> OK. So, in any case, here is this next variant/proposal.
>
> Thanks,
> Jarek P.
> ------------------------>
> net: Adjust softirq raising in __napi_schedule
>
> This patch changes __raise_softirq_irqoff() to raise_softirq_irqoff()
> in __napi_schedule() to enable proper softirq scheduling from process
> context. The main intent is to let use netif_rx() universally, and
> make netif_rx_ni() redundant.
>
> Currently using netif_rx() instead of netif_rx_ni() triggers:
> "NOHZ: local_softirq_pending 08" warnings, but additional cost of one
> "if" on the fast path doesn't seem to justify maintaining it
> separately.
>
> This patch is based on the analysis, suggestions and the original
> patch for mac80211 by: Michael Buesch <mb@bu3sch.de>
>
> Another patch calling netif_rx variants conditionally was done by:
> Oliver Hartkopp <oliver@hartkopp.net>
>
> Reported-by: Michael Buesch <mb@bu3sch.de>
> Reported-by: Oliver Hartkopp <oliver@hartkopp.net>
> Reported-by: Tilman Schmidt <tilman@imap.cc>
> Diagnosed-by: Michael Buesch <mb@bu3sch.de>
> Tested-by: Tilman Schmidt <tilman@imap.cc>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
> ---
>
> net/core/dev.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 28b0b9e..7fc4009 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2728,7 +2728,7 @@ void __napi_schedule(struct napi_struct *n)
>
> local_irq_save(flags);
> list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
> - __raise_softirq_irqoff(NET_RX_SOFTIRQ);
> + raise_softirq_irqoff(NET_RX_SOFTIRQ);
This still doesn't make any sense.
There may or may not be a lot of code that assumes that everything else
is run with other tasklets disabled, and that it cannot be interrupted
by a tasklet and thus create a race.
Can you prove that is not the case, across the entire networking layer?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* [PATCH] net: Adjust softirq raising in __napi_schedule
From: Jarek Poplawski @ 2009-10-21 21:19 UTC (permalink / raw)
To: Tilman Schmidt
Cc: David Miller, johannes, hidave.darkstar, linux-kernel, tglx,
linux-wireless, linux-ppp, netdev, paulus, Michael Buesch,
Oliver Hartkopp
In-Reply-To: <4ADF5710.4030505@imap.cc>
On Wed, Oct 21, 2009 at 08:46:40PM +0200, Tilman Schmidt wrote:
...
> I have tested your patch and I can confirm that it fixes the messages.
> I have not noticed any ill effects.
OK. So, in any case, here is this next variant/proposal.
Thanks,
Jarek P.
------------------------>
net: Adjust softirq raising in __napi_schedule
This patch changes __raise_softirq_irqoff() to raise_softirq_irqoff()
in __napi_schedule() to enable proper softirq scheduling from process
context. The main intent is to let use netif_rx() universally, and
make netif_rx_ni() redundant.
Currently using netif_rx() instead of netif_rx_ni() triggers:
"NOHZ: local_softirq_pending 08" warnings, but additional cost of one
"if" on the fast path doesn't seem to justify maintaining it
separately.
This patch is based on the analysis, suggestions and the original
patch for mac80211 by: Michael Buesch <mb@bu3sch.de>
Another patch calling netif_rx variants conditionally was done by:
Oliver Hartkopp <oliver@hartkopp.net>
Reported-by: Michael Buesch <mb@bu3sch.de>
Reported-by: Oliver Hartkopp <oliver@hartkopp.net>
Reported-by: Tilman Schmidt <tilman@imap.cc>
Diagnosed-by: Michael Buesch <mb@bu3sch.de>
Tested-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
---
net/core/dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 28b0b9e..7fc4009 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2728,7 +2728,7 @@ void __napi_schedule(struct napi_struct *n)
local_irq_save(flags);
list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
- __raise_softirq_irqoff(NET_RX_SOFTIRQ);
+ raise_softirq_irqoff(NET_RX_SOFTIRQ);
local_irq_restore(flags);
}
EXPORT_SYMBOL(__napi_schedule);
^ permalink raw reply related
* Re: TL-WN721N
From: Pavel Roskin @ 2009-10-21 20:23 UTC (permalink / raw)
To: Azhar; +Cc: linux-wireless
In-Reply-To: <loom.20091018T103209-571@post.gmane.org>
On Sun, 2009-10-18 at 08:33 +0000, Azhar wrote:
> ndiswrapper -l
>
> WARNING: All config files need .conf: /etc/modprobe.d/ndiswrapper, it will be
> ignored in a future release.
This has been fixed in the ndiswrapper subversion repository. Next
version of ndiswrapper will use /etc/modprobe.d/ndiswrapper.conf
--
Regards,
Pavel Roskin
^ permalink raw reply
* WARNING: at net/mac80211/rx.c:2488 ath_rx_tasklet+0x4a5/0x5ee [ath9k]()
From: Dominik D. Geyer @ 2009-10-21 19:48 UTC (permalink / raw)
To: linux-wireless
Just found this one in my logs. The system uses the bit older kernel
2.6.30-gentoo-r3 (with gentoo patches - I don't think it has an effect on this).
The wireless card uses the ath9k driver.
Maybe this issue is already fixed in newer kernel versions. I'm going to fetch
2.6.32.
------------[ cut here ]------------
WARNING: at net/mac80211/rx.c:2488 ath_rx_tasklet+0x4a5/0x5ee [ath9k]()
Hardware name: CN400-8237
Modules linked in: snd_pcm_oss snd_mixer_oss dm_crypt dm_mod padlock_aes via_rng vfat fat pppoe pppox ppp_generic slhc bridge stp llc w83627hf hwmon_vid w83697hf_wdt snd_via82xx snd_ac97_codec ac97_bus snd_pcm snd_timer snd_page_alloc snd_mpu401_uart ath9k snd_rawmidi snd led_class soundcore i2c_viapro via_rhine
Pid: 0, comm: swapper Not tainted 2.6.30-gentoo-r3-homeserver #8
Call Trace:
[<c01191fb>] ? warn_slowpath_common+0x41/0x71
[<c0119218>] ? warn_slowpath_common+0x5e/0x71
[<c0119235>] ? warn_slowpath_null+0xa/0xc
[<cf8ca4ba>] ? ath_rx_tasklet+0x4a5/0x5ee [ath9k]
[<cf8c7b6f>] ? ath9k_tasklet+0x31/0x55 [ath9k]
[<c011c833>] ? tasklet_action+0x3d/0x63
[<c011c659>] ? __do_softirq+0x4c/0xb5
[<c011c6e4>] ? do_softirq+0x22/0x26
[<c011c8e1>] ? irq_exit+0x25/0x4e
[<c0103fbf>] ? do_IRQ+0x53/0x64
[<c0102d69>] ? common_interrupt+0x29/0x30
[<c0107037>] ? default_idle+0x25/0x38
[<c0101aa8>] ? cpu_idle+0x23/0x3c
[<c04ba917>] ? start_kernel+0x23f/0x242
---[ end trace 52a130d663d9bfc8 ]---
^ permalink raw reply
* Re: NOHZ: local_softirq_pending 08
From: Tilman Schmidt @ 2009-10-21 18:46 UTC (permalink / raw)
To: Jarek Poplawski
Cc: David Miller, johannes, hidave.darkstar, linux-kernel, tglx,
linux-wireless, linux-ppp, netdev, paulus
In-Reply-To: <4AD76184.6030900@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2202 bytes --]
On 15.10.2009 19:53 Jarek Poplawski wrote:
> Jarek Poplawski wrote, On 10/15/2009 01:40 PM:
>
>> On 12-10-2009 13:25, Tilman Schmidt wrote:
>>> I have encountered the message in the subject during a test of
>>> the Gigaset CAPI driver, and would like to determine whether
>>> it's a bug in the driver, a bug somewhere else, or no bug at
>>> all. The test scenario was PPP over ISDN with pppd+capiplugin.
>>> In an alternative scenario, also PPP over ISDN but with
>>> smpppd+capidrv, the message did not occur.
I'm sorry, I had confused the two cases. The message occurs in
the smpppd+capidrv scenario, not with pppd+capiplugin.
>>> Johannes' answer pointed me to the netif_rx() function.
>>> The Gigaset driver itself doesn't call that function at all.
>>> In the scenario where I saw the message, it was the SYNC_PPP
>>> line discipline that did.
This analysis was therefore wrong. It would be the netif_rx()
call towards the end of isdn_ppp_push_higher() in
drivers/isdn/i4l/isdn_ppp.c L1177.
>> Anyway, I agree with Michael Buesch there is no reason to waste time
>> for tracking all netif_rx vs netif_rx_ni uses, and it seems we could
>> avoid it by using the "proper" version of raise_softirq_irqoff() in
>> __napi_schedule(). Could anybody try if I'm not wrong?
>>
>> net/core/dev.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 28b0b9e..7fc4009 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -2728,7 +2728,7 @@ void __napi_schedule(struct napi_struct *n)
>>
>> local_irq_save(flags);
>> list_add_tail(&n->poll_list, &__get_cpu_var(softnet_data).poll_list);
>> - __raise_softirq_irqoff(NET_RX_SOFTIRQ);
>> + raise_softirq_irqoff(NET_RX_SOFTIRQ);
>> local_irq_restore(flags);
>> }
>> EXPORT_SYMBOL(__napi_schedule);
I have tested your patch and I can confirm that it fixes the messages.
I have not noticed any ill effects.
Thanks,
Tilman
--
Tilman Schmidt E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]
^ permalink raw reply
* Re: [RFC] libertas: monster-patch to make CFG/WEXT configurable
From: Dan Williams @ 2009-10-21 18:39 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless
In-Reply-To: <1256150184.5010.45.camel@localhost.localdomain>
On Wed, 2009-10-21 at 11:36 -0700, Dan Williams wrote:
> On Mon, 2009-10-19 at 14:49 +0200, Holger Schurig wrote:
> > This is a monster patch that makes CFG80211/WEXT operation
> > configurable. My cfg80211-RFC/WIP-Patch would come on top of it,
> > but would then be quite small, e.g. almost only changed to
> > cfg.c/cfg.h.
> >
> > As there's no mesh/adhoc/monitor mode implemented in cfg80211-
> > mode, I added many, many #ifdef/#endif pairs. Maybe too many.
> > Is this too ugly? Or would this patch be applyable as-is ?
>
> For the mesh interface stuff, especially in tx/rx paths, would you mind
> not ifdefing that? Since with cfg80211, priv->mesh_dev will always be
> NULL, those checks will be just fine and you still don't have to care
> about mesh.
>
> I'm sure that the bits for SNMP_MIB_OID_BSS_TYPE could also be converted
> to use lib80211 or cfg80211 values instead of WEXT ones; I just picked
> WEXT at the time because we had no cfg80211 yet.
>
> Stuff like lbs_cmd_bt_access doesn't need to be ifdefed either, because
> it simply won't be called if the debugfs bits are disabled.
>
> I'm sure the WEXT-specific lbs_mac_event_disconnected bits could also be
> abstracted like you did with the IWAP stuff a few patches ago too.
I just saw the v2 patch from earlier that did this. Thanks.
> Basically, I don't mind having some ifdefs; but I think there are way
> too many in that patch. Not all the mesh stuff needs to be disabled
> just for cfg80211.
>
> > If the patch is perceived to be too ugly, I could create an
> > monitor.h/monitor.c file and singleout everything related to
> > monitoring in it, where monitor.h would resolv to dummy static
> > functions in the cfg80211-case ... at least as long as we don't
> > have monitor suppport in libertas+cfg80211. The same for mesh
> > support, e.g. here I could create a mesh.h/mesh.c and do the
> > same.
> >
> > Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
> >
> > --- linux-wl.orig/drivers/net/wireless/libertas/Kconfig
> > +++ linux-wl/drivers/net/wireless/libertas/Kconfig
> > @@ -37,3 +37,29 @@
> > depends on LIBERTAS
> > ---help---
> > Debugging support.
> > +
> > +choice
> > + prompt "interface to user-space"
> > + depends on LIBERTAS
> > + default LIBERTAS_WEXT
> > +
> > +config LIBERTAS_WEXT
> > + bool "WEXT"
> > + help
> > + This is the old Libertas code as it always used to be:
> > + configuration done via "iwconfig" or "wpa_supplicant -Dwext",
> > + associating via libertas-internal code. This is currently the only
> > + way to support:
> > +
> > + * AD-HOC
> > + * Libertas' MESH
> > + * Monitor interface ("rtap")
> > +
> > +config LIBERTAS_CFG80211
> > + bool "CFG80211"
> > + depends on EXPERIMENTAL
> > + help
> > + This is new new way of wireless: use cfg80211 for all, e.g.
> > + "iw" or "wpa_supplicant -Dnl80211".
> > +
> > +endchoice
> > --- linux-wl.orig/drivers/net/wireless/libertas/Makefile
> > +++ linux-wl/drivers/net/wireless/libertas/Makefile
> > @@ -1,15 +1,15 @@
> > -libertas-y += assoc.o
> > libertas-y += cfg.o
> > libertas-y += cmd.o
> > libertas-y += cmdresp.o
> > libertas-y += debugfs.o
> > -libertas-y += ethtool.o
> > libertas-y += main.o
> > -libertas-y += persistcfg.o
> > libertas-y += rx.o
> > -libertas-y += scan.o
> > libertas-y += tx.o
> > -libertas-y += wext.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += assoc.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += ethtool.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += persistcfg.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += scan.o
> > +libertas-$(CONFIG_LIBERTAS_WEXT) += wext.o
> >
> > usb8xxx-objs += if_usb.o
> > libertas_cs-objs += if_cs.o
> > --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> > +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> > @@ -3,7 +3,6 @@
> > * It prepares command and sends it to firmware when it is ready.
> > */
> >
> > -#include <net/iw_handler.h>
> > #include <net/lib80211.h>
> > #include <linux/kfifo.h>
> > #include <linux/sched.h>
> > @@ -184,6 +183,8 @@
> > memmove(priv->current_addr, cmd.permanentaddr, ETH_ALEN);
> >
> > memcpy(priv->dev->dev_addr, priv->current_addr, ETH_ALEN);
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > memcpy(priv->mesh_dev->dev_addr, priv->current_addr, ETH_ALEN);
> >
> > @@ -191,6 +192,7 @@
> > ret = -1;
> > goto out;
> > }
> > +#endif
> >
> > out:
> > lbs_deb_leave(LBS_DEB_CMD);
> > @@ -387,10 +389,12 @@
> > cmd.oid = cpu_to_le16((u16) oid);
> >
> > switch (oid) {
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > case SNMP_MIB_OID_BSS_TYPE:
> > cmd.bufsize = cpu_to_le16(sizeof(u8));
> > cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1;
> > break;
> > +#endif
> > case SNMP_MIB_OID_11D_ENABLE:
> > case SNMP_MIB_OID_FRAG_THRESHOLD:
> > case SNMP_MIB_OID_RTS_THRESHOLD:
> > @@ -442,12 +446,14 @@
> >
> > switch (le16_to_cpu(cmd.bufsize)) {
> > case sizeof(u8):
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (oid == SNMP_MIB_OID_BSS_TYPE) {
> > if (cmd.value[0] == 2)
> > *out_val = IW_MODE_ADHOC;
> > else
> > *out_val = IW_MODE_INFRA;
> > } else
> > +#endif
> > *out_val = cmd.value[0];
> > break;
> > case sizeof(u16):
> > @@ -702,6 +708,7 @@
> > return 0;
> > }
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
> > u16 cmd_action, void *pdata_buf)
> > {
> > @@ -868,6 +875,7 @@
> >
> > return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
> > }
> > +#endif
> >
> > static void lbs_queue_cmd(struct lbs_private *priv,
> > struct cmd_ctrl_node *cmdnode)
> > @@ -1155,10 +1163,6 @@
> > cmd_action, pdata_buf);
> > break;
> >
> > - case CMD_802_11_RSSI:
> > - ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> > - break;
> > -
> > case CMD_802_11_SET_AFC:
> > case CMD_802_11_GET_AFC:
> >
> > @@ -1184,6 +1188,11 @@
> > ret = 0;
> > break;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > + case CMD_802_11_RSSI:
> > + ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> > + break;
> > +
> > case CMD_BT_ACCESS:
> > ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
> > break;
> > @@ -1195,6 +1204,8 @@
> > case CMD_802_11_BEACON_CTRL:
> > ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action);
> > break;
> > +#endif
> > +
> > case CMD_802_11_DEEP_SLEEP:
> > cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
> > cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
> > @@ -1487,6 +1498,7 @@
> > * check if in power save mode, if yes, put the device back
> > * to PS mode
> > */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if ((priv->psmode != LBS802_11POWERMODECAM) &&
> > (priv->psstate == PS_STATE_FULL_POWER) &&
> > ((priv->connect_status == LBS_CONNECTED) ||
> > @@ -1508,6 +1520,9 @@
> > lbs_ps_sleep(priv, 0);
> > }
> > }
> > +#else
> > + /* TODO: we need to figure out what to do here in cfg80211-mode */
> > +#endif
> > }
> >
> > ret = 0;
> > --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> > +++ linux-wl/drivers/net/wireless/libertas/dev.h
> > @@ -6,8 +6,10 @@
> > #ifndef _LBS_DEV_H_
> > #define _LBS_DEV_H_
> >
> > +#include "defs.h"
> > #include "scan.h"
> > #include "assoc.h"
> > +#include "host.h"
> >
> >
> >
> > @@ -21,6 +23,9 @@
> > uint16_t sp_reserved;
> > };
> >
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +
> > /* Mesh statistics */
> > struct lbs_mesh_stats {
> > u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */
> > @@ -32,6 +37,8 @@
> > u32 drop_blind; /* Rx: Dropped by blinding table */
> > u32 tx_failed_cnt; /* Tx: Failed transmissions */
> > };
> > +#endif
> > +
> >
> > /** Private structure for the MV device */
> > struct lbs_private {
> > @@ -48,11 +55,11 @@
> > struct wireless_dev *wdev;
> >
> > /* Mesh */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > struct net_device *mesh_dev; /* Virtual device */
> > u32 mesh_connect_status;
> > struct lbs_mesh_stats mstats;
> > int mesh_open;
> > - int mesh_fw_ver;
> > int mesh_autostart_enabled;
> > uint16_t mesh_tlv;
> > u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
> > @@ -62,6 +69,7 @@
> > /* Monitor mode */
> > struct net_device *rtap_net_dev;
> > u32 monitormode;
> > +#endif
> >
> > /* Debugfs */
> > struct dentry *debugfs_dir;
> > @@ -103,6 +111,7 @@
> > int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
> >
> > /* Adapter info (from EEPROM) */
> > + int mesh_fw_ver;
> > u32 fwrelease;
> > u32 fwcapinfo;
> > u16 regioncode;
> > @@ -138,11 +147,13 @@
> > struct workqueue_struct *work_thread;
> >
> > /** Encryption stuff */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > struct lbs_802_11_security secinfo;
> > struct enc_key wpa_mcast_key;
> > struct enc_key wpa_unicast_key;
> > u8 wpa_ie[MAX_WPA_IE_LEN];
> > u8 wpa_ie_len;
> > +#endif
> > u16 wep_tx_keyidx;
> > struct enc_key wep_keys[4];
> >
> > @@ -163,6 +174,7 @@
> > spinlock_t driver_lock;
> >
> > /* NIC/link operation characteristics */
> > + u16 capability;
> > u16 mac_control;
> > u8 radio_on;
> > u8 channel;
> > @@ -174,6 +186,7 @@
> > struct delayed_work scan_work;
> > int scan_channel;
> > /* remember which channel was scanned last, != 0 if currently scanning */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
> > u8 scan_ssid_len;
> >
> > @@ -186,7 +199,6 @@
> > struct bss_descriptor *networks;
> > struct assoc_request * pending_assoc_req;
> > struct assoc_request * in_progress_assoc_req;
> > - u16 capability;
> > uint16_t enablehwauto;
> > uint16_t ratebitmap;
> >
> > @@ -211,6 +223,7 @@
> > u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
> > u16 nextSNRNF;
> > u16 numSNRNF;
> > +#endif
> > };
> >
> > extern struct cmd_confirm_sleep confirm_sleep;
> > --- linux-wl.orig/drivers/net/wireless/libertas/main.c
> > +++ linux-wl/drivers/net/wireless/libertas/main.c
> > @@ -13,7 +13,6 @@
> > #include <linux/kfifo.h>
> > #include <linux/stddef.h>
> > #include <linux/ieee80211.h>
> > -#include <net/iw_handler.h>
> > #include <net/cfg80211.h>
> >
> > #include "host.h"
> > @@ -98,6 +97,7 @@
> > * Attributes exported through sysfs
> > */
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief Get function for sysfs attribute anycast_mask
> > */
> > @@ -325,6 +325,8 @@
> > static struct attribute_group lbs_mesh_attr_group = {
> > .attrs = lbs_mesh_sysfs_entries,
> > };
> > +#endif
> > +
> >
> > /**
> > * @brief This function opens the ethX or mshX interface
> > @@ -341,6 +343,7 @@
> >
> > spin_lock_irq(&priv->driver_lock);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->monitormode) {
> > ret = -EBUSY;
> > goto out;
> > @@ -351,6 +354,9 @@
> > priv->mesh_connect_status = LBS_CONNECTED;
> > netif_carrier_on(dev);
> > } else {
> > +#else
> > + if (1) {
> > +#endif
> > priv->infra_open = 1;
> >
> > if (priv->connect_status == LBS_CONNECTED)
> > @@ -361,13 +367,16 @@
> >
> > if (!priv->tx_pending_len)
> > netif_wake_queue(dev);
> > - out:
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > + out:
> > +#endif
> > spin_unlock_irq(&priv->driver_lock);
> > lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> > return ret;
> > }
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief This function closes the mshX interface
> > *
> > @@ -383,7 +392,6 @@
> >
> > priv->mesh_open = 0;
> > priv->mesh_connect_status = LBS_DISCONNECTED;
> > -
> > netif_stop_queue(dev);
> > netif_carrier_off(dev);
> >
> > @@ -394,6 +402,7 @@
> > lbs_deb_leave(LBS_DEB_MESH);
> > return 0;
> > }
> > +#endif
> >
> > /**
> > * @brief This function closes the ethX interface
> > @@ -428,8 +437,10 @@
> >
> > dev->trans_start = jiffies;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->currenttxskb)
> > lbs_send_tx_feedback(priv, 0);
> > +#endif
> >
> > /* XX: Shouldn't we also call into the hw-specific driver
> > to kick it somehow? */
> > @@ -490,8 +501,10 @@
> >
> > memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN);
> > memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > memcpy(priv->mesh_dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> > +#endif
> >
> > done:
> > lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> > @@ -554,8 +567,10 @@
> > lbs_deb_enter(LBS_DEB_NET);
> >
> > dev_flags = priv->dev->flags;
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > dev_flags |= priv->mesh_dev->flags;
> > +#endif
> >
> > if (dev_flags & IFF_PROMISC) {
> > priv->mac_control |= CMD_ACT_MAC_PROMISCUOUS_ENABLE;
> > @@ -572,8 +587,10 @@
> >
> > /* Once for priv->dev, again for priv->mesh_dev if it exists */
> > nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->dev, 0);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (nr_addrs >= 0 && priv->mesh_dev)
> > nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->mesh_dev, nr_addrs);
> > +#endif
> > if (nr_addrs < 0)
> > goto do_allmulti;
> >
> > @@ -816,9 +833,11 @@
> > waiting for TX feedback */
> > if (priv->connect_status == LBS_CONNECTED)
> > netif_wake_queue(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev &&
> > priv->mesh_connect_status == LBS_CONNECTED)
> > netif_wake_queue(priv->mesh_dev);
> > +#endif
> > }
> > }
> > spin_unlock_irq(&priv->driver_lock);
> > @@ -838,8 +857,10 @@
> > lbs_deb_enter(LBS_DEB_FW);
> >
> > netif_device_detach(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > netif_device_detach(priv->mesh_dev);
> > +#endif
> >
> > priv->fw_ready = 0;
> > lbs_deb_leave(LBS_DEB_FW);
> > @@ -882,8 +903,10 @@
> > 0, 0, NULL);
> >
> > netif_device_attach(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > netif_device_attach(priv->mesh_dev);
> > +#endif
> >
> > lbs_deb_leave(LBS_DEB_FW);
> > }
> > @@ -1004,6 +1027,7 @@
> > return 0;
> > }
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static void lbs_sync_channel_worker(struct work_struct *work)
> > {
> > struct lbs_private *priv = container_of(work, struct lbs_private,
> > @@ -1014,15 +1038,19 @@
> > lbs_pr_info("Channel synchronization failed.");
> > lbs_deb_leave(LBS_DEB_MAIN);
> > }
> > -
> > +#endif
> >
> > static int lbs_init_adapter(struct lbs_private *priv)
> > {
> > + int ret = 0;
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > size_t bufsize;
> > - int i, ret = 0;
> > + int i;
> > +#endif
> >
> > lbs_deb_enter(LBS_DEB_MAIN);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /* Allocate buffer to store the BSSID list */
> > bufsize = MAX_NETWORK_COUNT * sizeof(struct bss_descriptor);
> > priv->networks = kzalloc(bufsize, GFP_KERNEL);
> > @@ -1039,17 +1067,18 @@
> > list_add_tail(&priv->networks[i].list,
> > &priv->network_free_list);
> > }
> > + priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> > + priv->mode = IW_MODE_INFRA;
> > + priv->enablehwauto = 1;
> > + priv->mesh_connect_status = LBS_DISCONNECTED;
> > +#endif
> >
> > memset(priv->current_addr, 0xff, ETH_ALEN);
> >
> > priv->connect_status = LBS_DISCONNECTED;
> > - priv->mesh_connect_status = LBS_DISCONNECTED;
> > - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> > - priv->mode = IW_MODE_INFRA;
> > priv->channel = DEFAULT_AD_HOC_CHANNEL;
> > priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON;
> > priv->radio_on = 1;
> > - priv->enablehwauto = 1;
> > priv->capability = WLAN_CAPABILITY_SHORT_PREAMBLE;
> > priv->psmode = LBS802_11POWERMODECAM;
> > priv->psstate = PS_STATE_FULL_POWER;
> > @@ -1103,8 +1132,10 @@
> > kfifo_free(priv->event_fifo);
> > del_timer(&priv->command_timer);
> > del_timer(&priv->auto_deepsleep_timer);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > kfree(priv->networks);
> > priv->networks = NULL;
> > +#endif
> >
> > lbs_deb_leave(LBS_DEB_MAIN);
> > }
> > @@ -1166,8 +1197,8 @@
> >
> > dev->netdev_ops = &lbs_netdev_ops;
> > dev->watchdog_timeo = 5 * HZ;
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > dev->ethtool_ops = &lbs_ethtool_ops;
> > -#ifdef WIRELESS_EXT
> > dev->wireless_handlers = &lbs_handler_def;
> > #endif
> > dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> > @@ -1177,11 +1208,8 @@
> >
> >
> > priv->card = card;
> > - priv->mesh_open = 0;
> > priv->infra_open = 0;
> >
> > -
> > - priv->rtap_net_dev = NULL;
> > strcpy(dev->name, "wlan%d");
> >
> > lbs_deb_thread("Starting main thread...\n");
> > @@ -1193,13 +1221,18 @@
> > }
> >
> > priv->work_thread = create_singlethread_workqueue("lbs_worker");
> > - INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> > - INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> > - INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
> > - INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > + priv->rtap_net_dev = NULL;
> >
> > sprintf(priv->mesh_ssid, "mesh");
> > priv->mesh_ssid_len = 4;
> > + priv->mesh_open = 0;
> > +
> > + INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> > + INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> > + INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> > +#endif
> > + INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
> >
> > priv->wol_criteria = 0xffffffff;
> > priv->wol_gpio = 0xff;
> > @@ -1231,13 +1264,15 @@
> >
> > lbs_deb_enter(LBS_DEB_MAIN);
> >
> > + dev = priv->dev;
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > lbs_remove_mesh(priv);
> > lbs_remove_rtap(priv);
> >
> > - dev = priv->dev;
> > -
> > cancel_delayed_work_sync(&priv->scan_work);
> > cancel_delayed_work_sync(&priv->assoc_work);
> > +#endif
> > cancel_work_sync(&priv->mcast_work);
> >
> > /* worker thread destruction blocks on the in-flight command which
> > @@ -1295,6 +1330,7 @@
> >
> > lbs_update_channel(priv);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /* Check mesh FW version and appropriately send the mesh start
> > * command
> > */
> > @@ -1342,6 +1378,7 @@
> > if (device_create_file(&dev->dev, &dev_attr_lbs_rtap))
> > lbs_pr_err("cannot register lbs_rtap attribute\n");
> > }
> > +#endif
> >
> > lbs_debugfs_init_one(priv, dev);
> >
> > @@ -1372,10 +1409,12 @@
> > netif_carrier_off(dev);
> >
> > lbs_debugfs_remove_one(priv);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_tlv) {
> > device_remove_file(&dev->dev, &dev_attr_lbs_mesh);
> > device_remove_file(&dev->dev, &dev_attr_lbs_rtap);
> > }
> > +#endif
> >
> > /* Delete the timeout of the currently processing command */
> > del_timer_sync(&priv->command_timer);
> > @@ -1408,6 +1447,7 @@
> > EXPORT_SYMBOL_GPL(lbs_stop_card);
> >
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static const struct net_device_ops mesh_netdev_ops = {
> > .ndo_open = lbs_dev_open,
> > .ndo_stop = lbs_mesh_stop,
> > @@ -1445,7 +1485,7 @@
> >
> > SET_NETDEV_DEV(priv->mesh_dev, priv->dev->dev.parent);
> >
> > -#ifdef WIRELESS_EXT
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def;
> > #endif
> > mesh_dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> > @@ -1496,6 +1536,7 @@
> > free_netdev(mesh_dev);
> > lbs_deb_leave(LBS_DEB_MESH);
> > }
> > +#endif
> >
> > void lbs_queue_event(struct lbs_private *priv, u32 event)
> > {
> > @@ -1556,6 +1597,7 @@
> > * rtap interface support fuctions
> > */
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static int lbs_rtap_open(struct net_device *dev)
> > {
> > /* Yes, _stop_ the queue. Because we don't support injection */
> > @@ -1632,6 +1674,7 @@
> > lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
> > return ret;
> > }
> > +#endif
> >
> > module_init(lbs_init_module);
> > module_exit(lbs_exit_module);
> > --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> > +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> > @@ -7,7 +7,6 @@
> > #include <linux/if_arp.h>
> > #include <linux/netdevice.h>
> > #include <asm/unaligned.h>
> > -#include <net/iw_handler.h>
> >
> > #include "host.h"
> > #include "decl.h"
> > @@ -27,13 +26,16 @@
> > */
> > void lbs_mac_event_disconnected(struct lbs_private *priv)
> > {
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > union iwreq_data wrqu;
> > +#endif
> >
> > if (priv->connect_status != LBS_CONNECTED)
> > return;
> >
> > lbs_deb_enter(LBS_DEB_ASSOC);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN);
> > wrqu.ap_addr.sa_family = ARPHRD_ETHER;
> >
> > @@ -44,6 +46,9 @@
> >
> > msleep_interruptible(1000);
> > wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
> > +#else
> > + /* TODO: find out what to do in the cfg80211 case */
> > +#endif
> >
> > /* report disconnect to upper layer */
> > netif_stop_queue(priv->dev);
> > @@ -55,6 +60,7 @@
> > priv->tx_pending_len = 0;
> >
> > /* reset SNR/NF/RSSI values */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > memset(priv->SNR, 0x00, sizeof(priv->SNR));
> > memset(priv->NF, 0x00, sizeof(priv->NF));
> > memset(priv->RSSI, 0x00, sizeof(priv->RSSI));
> > @@ -62,7 +68,6 @@
> > memset(priv->rawNF, 0x00, sizeof(priv->rawNF));
> > priv->nextSNRNF = 0;
> > priv->numSNRNF = 0;
> > - priv->connect_status = LBS_DISCONNECTED;
> >
> > /* Clear out associated SSID and BSSID since connection is
> > * no longer valid.
> > @@ -70,6 +75,9 @@
> > memset(&priv->curbssparams.bssid, 0, ETH_ALEN);
> > memset(&priv->curbssparams.ssid, 0, IEEE80211_MAX_SSID_LEN);
> > priv->curbssparams.ssid_len = 0;
> > +#endif
> > + priv->connect_status = LBS_DISCONNECTED;
> > +
> >
> > if (priv->psstate != PS_STATE_FULL_POWER) {
> > /* make firmware to exit PS mode */
> > @@ -88,9 +96,12 @@
> > */
> > static void handle_mic_failureevent(struct lbs_private *priv, u32 event)
> > {
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > char buf[50];
> > +#endif
> >
> > lbs_deb_enter(LBS_DEB_CMD);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > memset(buf, 0, sizeof(buf));
> >
> > sprintf(buf, "%s", "MLME-MICHAELMICFAILURE.indication ");
> > @@ -102,6 +113,7 @@
> > }
> >
> > lbs_send_iwevcustom_event(priv, buf);
> > +#endif
> > lbs_deb_leave(LBS_DEB_CMD);
> > }
> >
> > @@ -177,10 +189,6 @@
> > case CMD_RET(CMD_802_11_BEACON_STOP):
> > break;
> >
> > - case CMD_RET(CMD_802_11_RSSI):
> > - ret = lbs_ret_802_11_rssi(priv, resp);
> > - break;
> > -
> > case CMD_RET(CMD_802_11_TPC_CFG):
> > spin_lock_irqsave(&priv->driver_lock, flags);
> > memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
> > @@ -202,9 +210,16 @@
> > sizeof(resp->params.fwt));
> > spin_unlock_irqrestore(&priv->driver_lock, flags);
> > break;
> > +
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > + case CMD_RET(CMD_802_11_RSSI):
> > + ret = lbs_ret_802_11_rssi(priv, resp);
> > + break;
> > +
> > case CMD_RET(CMD_802_11_BEACON_CTRL):
> > ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
> > break;
> > +#endif
> >
> > default:
> > lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n",
> > @@ -297,9 +312,13 @@
> > * ad-hoc mode. It takes place in
> > * lbs_execute_next_command().
> > */
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mode == IW_MODE_ADHOC &&
> > action == CMD_SUBCMD_ENTER_PS)
> > priv->psmode = LBS802_11POWERMODECAM;
> > +#else
> > + /* TODO: we need to figure out what to do here in cfg80211-mode */
> > +#endif
> > } else if (action == CMD_SUBCMD_ENTER_PS) {
> > priv->needtowakeup = 0;
> > priv->psstate = PS_STATE_AWAKE;
> > @@ -516,6 +535,7 @@
> > lbs_pr_alert("EVENT: snr high\n");
> > break;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > case MACREG_INT_CODE_MESH_AUTO_STARTED:
> > /* Ignore spurious autostart events if autostart is disabled */
> > if (!priv->mesh_autostart_enabled) {
> > @@ -532,6 +552,7 @@
> > priv->mode = IW_MODE_ADHOC;
> > schedule_work(&priv->sync_channel);
> > break;
> > +#endif
> >
> > default:
> > lbs_pr_alert("EVENT: unknown event id %d\n", event);
> > --- linux-wl.orig/drivers/net/wireless/libertas/debugfs.c
> > +++ linux-wl/drivers/net/wireless/libertas/debugfs.c
> > @@ -4,7 +4,6 @@
> > #include <linux/delay.h>
> > #include <linux/mm.h>
> > #include <linux/string.h>
> > -#include <net/iw_handler.h>
> > #include <net/lib80211.h>
> >
> > #include "dev.h"
> > @@ -60,6 +59,7 @@
> > }
> >
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
> > size_t count, loff_t *ppos)
> > {
> > @@ -103,6 +103,7 @@
> > free_page(addr);
> > return res;
> > }
> > +#endif
> >
> > static ssize_t lbs_sleepparams_write(struct file *file,
> > const char __user *user_buf, size_t count,
> > @@ -722,8 +723,10 @@
> >
> > static const struct lbs_debugfs_files debugfs_files[] = {
> > { "info", 0444, FOPS(lbs_dev_info, write_file_dummy), },
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > { "getscantable", 0444, FOPS(lbs_getscantable,
> > write_file_dummy), },
> > +#endif
> > { "sleepparams", 0644, FOPS(lbs_sleepparams_read,
> > lbs_sleepparams_write), },
> > };
> > --- linux-wl.orig/drivers/net/wireless/libertas/rx.c
> > +++ linux-wl/drivers/net/wireless/libertas/rx.c
> > @@ -34,6 +34,7 @@
> > void *eth80211_hdr;
> > } __attribute__ ((packed));
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > static int process_rxed_802_11_packet(struct lbs_private *priv,
> > struct sk_buff *skb);
> >
> > @@ -129,6 +130,7 @@
> >
> > lbs_deb_leave(LBS_DEB_RX);
> > }
> > +#endif
> >
> > /**
> > * @brief This function processes received packet and forwards it
> > @@ -154,12 +156,15 @@
> >
> > skb->ip_summed = CHECKSUM_NONE;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->monitormode)
> > return process_rxed_802_11_packet(priv, skb);
> > +#endif
> >
> > p_rx_pd = (struct rxpd *) skb->data;
> > p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd +
> > le32_to_cpu(p_rx_pd->pkt_ptr));
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev) {
> > if (priv->mesh_fw_ver == MESH_FW_OLD) {
> > if (p_rx_pd->rx_control & RxPD_MESH_FRAME)
> > @@ -169,6 +174,7 @@
> > dev = priv->mesh_dev;
> > }
> > }
> > +#endif
> >
> > lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data,
> > min_t(unsigned int, skb->len, 100));
> > @@ -232,6 +238,7 @@
> > */
> > skb_pull(skb, hdrchop);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /* Take the data rate from the rxpd structure
> > * only if the rate is auto
> > */
> > @@ -239,6 +246,7 @@
> > priv->cur_rate = lbs_fw_index_to_data_rate(p_rx_pd->rx_rate);
> >
> > lbs_compute_rssi(priv, p_rx_pd);
> > +#endif
> >
> > lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
> > dev->stats.rx_bytes += skb->len;
> > @@ -257,6 +265,7 @@
> > }
> > EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief This function converts Tx/Rx rates from the Marvell WLAN format
> > * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s)
> > @@ -381,3 +390,4 @@
> > lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
> > return ret;
> > }
> > +#endif
> > --- linux-wl.orig/drivers/net/wireless/libertas/tx.c
> > +++ linux-wl/drivers/net/wireless/libertas/tx.c
> > @@ -12,6 +12,7 @@
> > #include "dev.h"
> > #include "wext.h"
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief This function converts Tx/Rx rates from IEEE80211_RADIOTAP_RATE
> > * units (500 Kb/s) into Marvell WLAN format (see Table 8 in Section 3.2.1)
> > @@ -49,6 +50,7 @@
> > }
> > return 0;
> > }
> > +#endif
> >
> > /**
> > * @brief This function checks the conditions and sends packet to IF
> > @@ -88,8 +90,10 @@
> >
> >
> > netif_stop_queue(priv->dev);
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->mesh_dev)
> > netif_stop_queue(priv->mesh_dev);
> > +#endif
> >
> > if (priv->tx_pending_len) {
> > /* This can happen if packets come in on the mesh and eth
> > @@ -111,6 +115,7 @@
> > p802x_hdr = skb->data;
> > pkt_len = skb->len;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (dev == priv->rtap_net_dev) {
> > struct tx_radiotap_hdr *rtap_hdr = (void *)skb->data;
> >
> > @@ -123,6 +128,9 @@
> >
> > /* copy destination address from 802.11 header */
> > memcpy(txpd->tx_dest_addr_high, p802x_hdr + 4, ETH_ALEN);
> > +#else
> > + if (0) {
> > +#endif
> > } else {
> > /* copy destination address from 802.3 header */
> > memcpy(txpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN);
> > @@ -131,12 +139,14 @@
> > txpd->tx_packet_length = cpu_to_le16(pkt_len);
> > txpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd));
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (dev == priv->mesh_dev) {
> > if (priv->mesh_fw_ver == MESH_FW_OLD)
> > txpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME);
> > else if (priv->mesh_fw_ver == MESH_FW_NEW)
> > txpd->u.bss.bss_num = MESH_IFACE_ID;
> > }
> > +#endif
> >
> > lbs_deb_hex(LBS_DEB_TX, "txpd", (u8 *) &txpd, sizeof(struct txpd));
> >
> > @@ -154,6 +164,7 @@
> >
> > dev->trans_start = jiffies;
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > if (priv->monitormode) {
> > /* Keep the skb to echo it back once Tx feedback is
> > received from FW */
> > @@ -161,6 +172,9 @@
> >
> > /* Keep the skb around for when we get feedback */
> > priv->currenttxskb = skb;
> > +#else
> > + if (0) {
> > +#endif
> > } else {
> > free:
> > dev_kfree_skb_any(skb);
> > @@ -173,6 +187,7 @@
> > return ret;
> > }
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /**
> > * @brief This function sends to the host the last transmitted packet,
> > * filling the radiotap headers with transmission information.
> > @@ -207,3 +222,4 @@
> > netif_wake_queue(priv->mesh_dev);
> > }
> > EXPORT_SYMBOL_GPL(lbs_send_tx_feedback);
> > +#endif
> > --- linux-wl.orig/drivers/net/wireless/libertas/if_usb.c
> > +++ linux-wl/drivers/net/wireless/libertas/if_usb.c
> > @@ -757,6 +757,7 @@
> > lbs_deb_usbd(&cardp->udev->dev, "**EVENT** 0x%X\n", event);
> > kfree_skb(skb);
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > /* Icky undocumented magic special case */
> > if (event & 0xffff0000) {
> > u32 trycount = (event & 0xffff0000) >> 16;
> > @@ -764,6 +765,7 @@
> > lbs_send_tx_feedback(priv, trycount);
> > } else
> > lbs_queue_event(priv, event & 0xFF);
> > +#endif
> > break;
> >
> > default:
> > --- linux-wl.orig/drivers/net/wireless/libertas/assoc.h
> > +++ linux-wl/drivers/net/wireless/libertas/assoc.h
> > @@ -3,6 +3,7 @@
> > #ifndef _LBS_ASSOC_H_
> > #define _LBS_ASSOC_H_
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> >
> > #include "defs.h"
> > #include "host.h"
> > @@ -152,4 +153,6 @@
> > int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
> > struct assoc_request *assoc);
> >
> > +#endif
> > +
> > #endif /* _LBS_ASSOC_H */
> > --- linux-wl.orig/drivers/net/wireless/libertas/scan.h
> > +++ linux-wl/drivers/net/wireless/libertas/scan.h
> > @@ -7,6 +7,8 @@
> > #ifndef _LBS_SCAN_H
> > #define _LBS_SCAN_H
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +
> > #include <net/iw_handler.h>
> >
> > struct lbs_private;
> > @@ -61,3 +63,5 @@
> > void lbs_scan_worker(struct work_struct *work);
> >
> > #endif
> > +
> > +#endif
> > --- linux-wl.orig/drivers/net/wireless/libertas/wext.h
> > +++ linux-wl/drivers/net/wireless/libertas/wext.h
> > @@ -4,9 +4,13 @@
> > #ifndef _LBS_WEXT_H_
> > #define _LBS_WEXT_H_
> >
> > +#ifdef CONFIG_LIBERTAS_WEXT
> > +
> > void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str);
> >
> > extern struct iw_handler_def lbs_handler_def;
> > extern struct iw_handler_def mesh_handler_def;
> >
> > #endif
> > +
> > +#endif
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [RFC] libertas: monster-patch to make CFG/WEXT configurable
From: Dan Williams @ 2009-10-21 18:36 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless
In-Reply-To: <200910191449.18915.hs4233@mail.mn-solutions.de>
On Mon, 2009-10-19 at 14:49 +0200, Holger Schurig wrote:
> This is a monster patch that makes CFG80211/WEXT operation
> configurable. My cfg80211-RFC/WIP-Patch would come on top of it,
> but would then be quite small, e.g. almost only changed to
> cfg.c/cfg.h.
>
> As there's no mesh/adhoc/monitor mode implemented in cfg80211-
> mode, I added many, many #ifdef/#endif pairs. Maybe too many.
> Is this too ugly? Or would this patch be applyable as-is ?
For the mesh interface stuff, especially in tx/rx paths, would you mind
not ifdefing that? Since with cfg80211, priv->mesh_dev will always be
NULL, those checks will be just fine and you still don't have to care
about mesh.
I'm sure that the bits for SNMP_MIB_OID_BSS_TYPE could also be converted
to use lib80211 or cfg80211 values instead of WEXT ones; I just picked
WEXT at the time because we had no cfg80211 yet.
Stuff like lbs_cmd_bt_access doesn't need to be ifdefed either, because
it simply won't be called if the debugfs bits are disabled.
I'm sure the WEXT-specific lbs_mac_event_disconnected bits could also be
abstracted like you did with the IWAP stuff a few patches ago too.
Basically, I don't mind having some ifdefs; but I think there are way
too many in that patch. Not all the mesh stuff needs to be disabled
just for cfg80211.
> If the patch is perceived to be too ugly, I could create an
> monitor.h/monitor.c file and singleout everything related to
> monitoring in it, where monitor.h would resolv to dummy static
> functions in the cfg80211-case ... at least as long as we don't
> have monitor suppport in libertas+cfg80211. The same for mesh
> support, e.g. here I could create a mesh.h/mesh.c and do the
> same.
>
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
>
> --- linux-wl.orig/drivers/net/wireless/libertas/Kconfig
> +++ linux-wl/drivers/net/wireless/libertas/Kconfig
> @@ -37,3 +37,29 @@
> depends on LIBERTAS
> ---help---
> Debugging support.
> +
> +choice
> + prompt "interface to user-space"
> + depends on LIBERTAS
> + default LIBERTAS_WEXT
> +
> +config LIBERTAS_WEXT
> + bool "WEXT"
> + help
> + This is the old Libertas code as it always used to be:
> + configuration done via "iwconfig" or "wpa_supplicant -Dwext",
> + associating via libertas-internal code. This is currently the only
> + way to support:
> +
> + * AD-HOC
> + * Libertas' MESH
> + * Monitor interface ("rtap")
> +
> +config LIBERTAS_CFG80211
> + bool "CFG80211"
> + depends on EXPERIMENTAL
> + help
> + This is new new way of wireless: use cfg80211 for all, e.g.
> + "iw" or "wpa_supplicant -Dnl80211".
> +
> +endchoice
> --- linux-wl.orig/drivers/net/wireless/libertas/Makefile
> +++ linux-wl/drivers/net/wireless/libertas/Makefile
> @@ -1,15 +1,15 @@
> -libertas-y += assoc.o
> libertas-y += cfg.o
> libertas-y += cmd.o
> libertas-y += cmdresp.o
> libertas-y += debugfs.o
> -libertas-y += ethtool.o
> libertas-y += main.o
> -libertas-y += persistcfg.o
> libertas-y += rx.o
> -libertas-y += scan.o
> libertas-y += tx.o
> -libertas-y += wext.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += assoc.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += ethtool.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += persistcfg.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += scan.o
> +libertas-$(CONFIG_LIBERTAS_WEXT) += wext.o
>
> usb8xxx-objs += if_usb.o
> libertas_cs-objs += if_cs.o
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -3,7 +3,6 @@
> * It prepares command and sends it to firmware when it is ready.
> */
>
> -#include <net/iw_handler.h>
> #include <net/lib80211.h>
> #include <linux/kfifo.h>
> #include <linux/sched.h>
> @@ -184,6 +183,8 @@
> memmove(priv->current_addr, cmd.permanentaddr, ETH_ALEN);
>
> memcpy(priv->dev->dev_addr, priv->current_addr, ETH_ALEN);
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> memcpy(priv->mesh_dev->dev_addr, priv->current_addr, ETH_ALEN);
>
> @@ -191,6 +192,7 @@
> ret = -1;
> goto out;
> }
> +#endif
>
> out:
> lbs_deb_leave(LBS_DEB_CMD);
> @@ -387,10 +389,12 @@
> cmd.oid = cpu_to_le16((u16) oid);
>
> switch (oid) {
> +#ifdef CONFIG_LIBERTAS_WEXT
> case SNMP_MIB_OID_BSS_TYPE:
> cmd.bufsize = cpu_to_le16(sizeof(u8));
> cmd.value[0] = (val == IW_MODE_ADHOC) ? 2 : 1;
> break;
> +#endif
> case SNMP_MIB_OID_11D_ENABLE:
> case SNMP_MIB_OID_FRAG_THRESHOLD:
> case SNMP_MIB_OID_RTS_THRESHOLD:
> @@ -442,12 +446,14 @@
>
> switch (le16_to_cpu(cmd.bufsize)) {
> case sizeof(u8):
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (oid == SNMP_MIB_OID_BSS_TYPE) {
> if (cmd.value[0] == 2)
> *out_val = IW_MODE_ADHOC;
> else
> *out_val = IW_MODE_INFRA;
> } else
> +#endif
> *out_val = cmd.value[0];
> break;
> case sizeof(u16):
> @@ -702,6 +708,7 @@
> return 0;
> }
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static int lbs_cmd_bt_access(struct cmd_ds_command *cmd,
> u16 cmd_action, void *pdata_buf)
> {
> @@ -868,6 +875,7 @@
>
> return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
> }
> +#endif
>
> static void lbs_queue_cmd(struct lbs_private *priv,
> struct cmd_ctrl_node *cmdnode)
> @@ -1155,10 +1163,6 @@
> cmd_action, pdata_buf);
> break;
>
> - case CMD_802_11_RSSI:
> - ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> - break;
> -
> case CMD_802_11_SET_AFC:
> case CMD_802_11_GET_AFC:
>
> @@ -1184,6 +1188,11 @@
> ret = 0;
> break;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> + case CMD_802_11_RSSI:
> + ret = lbs_cmd_802_11_rssi(priv, cmdptr);
> + break;
> +
> case CMD_BT_ACCESS:
> ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
> break;
> @@ -1195,6 +1204,8 @@
> case CMD_802_11_BEACON_CTRL:
> ret = lbs_cmd_bcn_ctrl(priv, cmdptr, cmd_action);
> break;
> +#endif
> +
> case CMD_802_11_DEEP_SLEEP:
> cmdptr->command = cpu_to_le16(CMD_802_11_DEEP_SLEEP);
> cmdptr->size = cpu_to_le16(sizeof(struct cmd_header));
> @@ -1487,6 +1498,7 @@
> * check if in power save mode, if yes, put the device back
> * to PS mode
> */
> +#ifdef CONFIG_LIBERTAS_WEXT
> if ((priv->psmode != LBS802_11POWERMODECAM) &&
> (priv->psstate == PS_STATE_FULL_POWER) &&
> ((priv->connect_status == LBS_CONNECTED) ||
> @@ -1508,6 +1520,9 @@
> lbs_ps_sleep(priv, 0);
> }
> }
> +#else
> + /* TODO: we need to figure out what to do here in cfg80211-mode */
> +#endif
> }
>
> ret = 0;
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -6,8 +6,10 @@
> #ifndef _LBS_DEV_H_
> #define _LBS_DEV_H_
>
> +#include "defs.h"
> #include "scan.h"
> #include "assoc.h"
> +#include "host.h"
>
>
>
> @@ -21,6 +23,9 @@
> uint16_t sp_reserved;
> };
>
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> +
> /* Mesh statistics */
> struct lbs_mesh_stats {
> u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */
> @@ -32,6 +37,8 @@
> u32 drop_blind; /* Rx: Dropped by blinding table */
> u32 tx_failed_cnt; /* Tx: Failed transmissions */
> };
> +#endif
> +
>
> /** Private structure for the MV device */
> struct lbs_private {
> @@ -48,11 +55,11 @@
> struct wireless_dev *wdev;
>
> /* Mesh */
> +#ifdef CONFIG_LIBERTAS_WEXT
> struct net_device *mesh_dev; /* Virtual device */
> u32 mesh_connect_status;
> struct lbs_mesh_stats mstats;
> int mesh_open;
> - int mesh_fw_ver;
> int mesh_autostart_enabled;
> uint16_t mesh_tlv;
> u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
> @@ -62,6 +69,7 @@
> /* Monitor mode */
> struct net_device *rtap_net_dev;
> u32 monitormode;
> +#endif
>
> /* Debugfs */
> struct dentry *debugfs_dir;
> @@ -103,6 +111,7 @@
> int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
>
> /* Adapter info (from EEPROM) */
> + int mesh_fw_ver;
> u32 fwrelease;
> u32 fwcapinfo;
> u16 regioncode;
> @@ -138,11 +147,13 @@
> struct workqueue_struct *work_thread;
>
> /** Encryption stuff */
> +#ifdef CONFIG_LIBERTAS_WEXT
> struct lbs_802_11_security secinfo;
> struct enc_key wpa_mcast_key;
> struct enc_key wpa_unicast_key;
> u8 wpa_ie[MAX_WPA_IE_LEN];
> u8 wpa_ie_len;
> +#endif
> u16 wep_tx_keyidx;
> struct enc_key wep_keys[4];
>
> @@ -163,6 +174,7 @@
> spinlock_t driver_lock;
>
> /* NIC/link operation characteristics */
> + u16 capability;
> u16 mac_control;
> u8 radio_on;
> u8 channel;
> @@ -174,6 +186,7 @@
> struct delayed_work scan_work;
> int scan_channel;
> /* remember which channel was scanned last, != 0 if currently scanning */
> +#ifdef CONFIG_LIBERTAS_WEXT
> u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
> u8 scan_ssid_len;
>
> @@ -186,7 +199,6 @@
> struct bss_descriptor *networks;
> struct assoc_request * pending_assoc_req;
> struct assoc_request * in_progress_assoc_req;
> - u16 capability;
> uint16_t enablehwauto;
> uint16_t ratebitmap;
>
> @@ -211,6 +223,7 @@
> u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
> u16 nextSNRNF;
> u16 numSNRNF;
> +#endif
> };
>
> extern struct cmd_confirm_sleep confirm_sleep;
> --- linux-wl.orig/drivers/net/wireless/libertas/main.c
> +++ linux-wl/drivers/net/wireless/libertas/main.c
> @@ -13,7 +13,6 @@
> #include <linux/kfifo.h>
> #include <linux/stddef.h>
> #include <linux/ieee80211.h>
> -#include <net/iw_handler.h>
> #include <net/cfg80211.h>
>
> #include "host.h"
> @@ -98,6 +97,7 @@
> * Attributes exported through sysfs
> */
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief Get function for sysfs attribute anycast_mask
> */
> @@ -325,6 +325,8 @@
> static struct attribute_group lbs_mesh_attr_group = {
> .attrs = lbs_mesh_sysfs_entries,
> };
> +#endif
> +
>
> /**
> * @brief This function opens the ethX or mshX interface
> @@ -341,6 +343,7 @@
>
> spin_lock_irq(&priv->driver_lock);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->monitormode) {
> ret = -EBUSY;
> goto out;
> @@ -351,6 +354,9 @@
> priv->mesh_connect_status = LBS_CONNECTED;
> netif_carrier_on(dev);
> } else {
> +#else
> + if (1) {
> +#endif
> priv->infra_open = 1;
>
> if (priv->connect_status == LBS_CONNECTED)
> @@ -361,13 +367,16 @@
>
> if (!priv->tx_pending_len)
> netif_wake_queue(dev);
> - out:
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> + out:
> +#endif
> spin_unlock_irq(&priv->driver_lock);
> lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> return ret;
> }
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief This function closes the mshX interface
> *
> @@ -383,7 +392,6 @@
>
> priv->mesh_open = 0;
> priv->mesh_connect_status = LBS_DISCONNECTED;
> -
> netif_stop_queue(dev);
> netif_carrier_off(dev);
>
> @@ -394,6 +402,7 @@
> lbs_deb_leave(LBS_DEB_MESH);
> return 0;
> }
> +#endif
>
> /**
> * @brief This function closes the ethX interface
> @@ -428,8 +437,10 @@
>
> dev->trans_start = jiffies;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->currenttxskb)
> lbs_send_tx_feedback(priv, 0);
> +#endif
>
> /* XX: Shouldn't we also call into the hw-specific driver
> to kick it somehow? */
> @@ -490,8 +501,10 @@
>
> memcpy(priv->current_addr, phwaddr->sa_data, ETH_ALEN);
> memcpy(dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> memcpy(priv->mesh_dev->dev_addr, phwaddr->sa_data, ETH_ALEN);
> +#endif
>
> done:
> lbs_deb_leave_args(LBS_DEB_NET, "ret %d", ret);
> @@ -554,8 +567,10 @@
> lbs_deb_enter(LBS_DEB_NET);
>
> dev_flags = priv->dev->flags;
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> dev_flags |= priv->mesh_dev->flags;
> +#endif
>
> if (dev_flags & IFF_PROMISC) {
> priv->mac_control |= CMD_ACT_MAC_PROMISCUOUS_ENABLE;
> @@ -572,8 +587,10 @@
>
> /* Once for priv->dev, again for priv->mesh_dev if it exists */
> nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->dev, 0);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (nr_addrs >= 0 && priv->mesh_dev)
> nr_addrs = lbs_add_mcast_addrs(&mcast_cmd, priv->mesh_dev, nr_addrs);
> +#endif
> if (nr_addrs < 0)
> goto do_allmulti;
>
> @@ -816,9 +833,11 @@
> waiting for TX feedback */
> if (priv->connect_status == LBS_CONNECTED)
> netif_wake_queue(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev &&
> priv->mesh_connect_status == LBS_CONNECTED)
> netif_wake_queue(priv->mesh_dev);
> +#endif
> }
> }
> spin_unlock_irq(&priv->driver_lock);
> @@ -838,8 +857,10 @@
> lbs_deb_enter(LBS_DEB_FW);
>
> netif_device_detach(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> netif_device_detach(priv->mesh_dev);
> +#endif
>
> priv->fw_ready = 0;
> lbs_deb_leave(LBS_DEB_FW);
> @@ -882,8 +903,10 @@
> 0, 0, NULL);
>
> netif_device_attach(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> netif_device_attach(priv->mesh_dev);
> +#endif
>
> lbs_deb_leave(LBS_DEB_FW);
> }
> @@ -1004,6 +1027,7 @@
> return 0;
> }
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static void lbs_sync_channel_worker(struct work_struct *work)
> {
> struct lbs_private *priv = container_of(work, struct lbs_private,
> @@ -1014,15 +1038,19 @@
> lbs_pr_info("Channel synchronization failed.");
> lbs_deb_leave(LBS_DEB_MAIN);
> }
> -
> +#endif
>
> static int lbs_init_adapter(struct lbs_private *priv)
> {
> + int ret = 0;
> +#ifdef CONFIG_LIBERTAS_WEXT
> size_t bufsize;
> - int i, ret = 0;
> + int i;
> +#endif
>
> lbs_deb_enter(LBS_DEB_MAIN);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /* Allocate buffer to store the BSSID list */
> bufsize = MAX_NETWORK_COUNT * sizeof(struct bss_descriptor);
> priv->networks = kzalloc(bufsize, GFP_KERNEL);
> @@ -1039,17 +1067,18 @@
> list_add_tail(&priv->networks[i].list,
> &priv->network_free_list);
> }
> + priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> + priv->mode = IW_MODE_INFRA;
> + priv->enablehwauto = 1;
> + priv->mesh_connect_status = LBS_DISCONNECTED;
> +#endif
>
> memset(priv->current_addr, 0xff, ETH_ALEN);
>
> priv->connect_status = LBS_DISCONNECTED;
> - priv->mesh_connect_status = LBS_DISCONNECTED;
> - priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
> - priv->mode = IW_MODE_INFRA;
> priv->channel = DEFAULT_AD_HOC_CHANNEL;
> priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON;
> priv->radio_on = 1;
> - priv->enablehwauto = 1;
> priv->capability = WLAN_CAPABILITY_SHORT_PREAMBLE;
> priv->psmode = LBS802_11POWERMODECAM;
> priv->psstate = PS_STATE_FULL_POWER;
> @@ -1103,8 +1132,10 @@
> kfifo_free(priv->event_fifo);
> del_timer(&priv->command_timer);
> del_timer(&priv->auto_deepsleep_timer);
> +#ifdef CONFIG_LIBERTAS_WEXT
> kfree(priv->networks);
> priv->networks = NULL;
> +#endif
>
> lbs_deb_leave(LBS_DEB_MAIN);
> }
> @@ -1166,8 +1197,8 @@
>
> dev->netdev_ops = &lbs_netdev_ops;
> dev->watchdog_timeo = 5 * HZ;
> +#ifdef CONFIG_LIBERTAS_WEXT
> dev->ethtool_ops = &lbs_ethtool_ops;
> -#ifdef WIRELESS_EXT
> dev->wireless_handlers = &lbs_handler_def;
> #endif
> dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> @@ -1177,11 +1208,8 @@
>
>
> priv->card = card;
> - priv->mesh_open = 0;
> priv->infra_open = 0;
>
> -
> - priv->rtap_net_dev = NULL;
> strcpy(dev->name, "wlan%d");
>
> lbs_deb_thread("Starting main thread...\n");
> @@ -1193,13 +1221,18 @@
> }
>
> priv->work_thread = create_singlethread_workqueue("lbs_worker");
> - INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> - INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> - INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
> - INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> +#ifdef CONFIG_LIBERTAS_WEXT
> + priv->rtap_net_dev = NULL;
>
> sprintf(priv->mesh_ssid, "mesh");
> priv->mesh_ssid_len = 4;
> + priv->mesh_open = 0;
> +
> + INIT_DELAYED_WORK(&priv->assoc_work, lbs_association_worker);
> + INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);
> + INIT_WORK(&priv->sync_channel, lbs_sync_channel_worker);
> +#endif
> + INIT_WORK(&priv->mcast_work, lbs_set_mcast_worker);
>
> priv->wol_criteria = 0xffffffff;
> priv->wol_gpio = 0xff;
> @@ -1231,13 +1264,15 @@
>
> lbs_deb_enter(LBS_DEB_MAIN);
>
> + dev = priv->dev;
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> lbs_remove_mesh(priv);
> lbs_remove_rtap(priv);
>
> - dev = priv->dev;
> -
> cancel_delayed_work_sync(&priv->scan_work);
> cancel_delayed_work_sync(&priv->assoc_work);
> +#endif
> cancel_work_sync(&priv->mcast_work);
>
> /* worker thread destruction blocks on the in-flight command which
> @@ -1295,6 +1330,7 @@
>
> lbs_update_channel(priv);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /* Check mesh FW version and appropriately send the mesh start
> * command
> */
> @@ -1342,6 +1378,7 @@
> if (device_create_file(&dev->dev, &dev_attr_lbs_rtap))
> lbs_pr_err("cannot register lbs_rtap attribute\n");
> }
> +#endif
>
> lbs_debugfs_init_one(priv, dev);
>
> @@ -1372,10 +1409,12 @@
> netif_carrier_off(dev);
>
> lbs_debugfs_remove_one(priv);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_tlv) {
> device_remove_file(&dev->dev, &dev_attr_lbs_mesh);
> device_remove_file(&dev->dev, &dev_attr_lbs_rtap);
> }
> +#endif
>
> /* Delete the timeout of the currently processing command */
> del_timer_sync(&priv->command_timer);
> @@ -1408,6 +1447,7 @@
> EXPORT_SYMBOL_GPL(lbs_stop_card);
>
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static const struct net_device_ops mesh_netdev_ops = {
> .ndo_open = lbs_dev_open,
> .ndo_stop = lbs_mesh_stop,
> @@ -1445,7 +1485,7 @@
>
> SET_NETDEV_DEV(priv->mesh_dev, priv->dev->dev.parent);
>
> -#ifdef WIRELESS_EXT
> +#ifdef CONFIG_LIBERTAS_WEXT
> mesh_dev->wireless_handlers = (struct iw_handler_def *)&mesh_handler_def;
> #endif
> mesh_dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
> @@ -1496,6 +1536,7 @@
> free_netdev(mesh_dev);
> lbs_deb_leave(LBS_DEB_MESH);
> }
> +#endif
>
> void lbs_queue_event(struct lbs_private *priv, u32 event)
> {
> @@ -1556,6 +1597,7 @@
> * rtap interface support fuctions
> */
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static int lbs_rtap_open(struct net_device *dev)
> {
> /* Yes, _stop_ the queue. Because we don't support injection */
> @@ -1632,6 +1674,7 @@
> lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
> return ret;
> }
> +#endif
>
> module_init(lbs_init_module);
> module_exit(lbs_exit_module);
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -7,7 +7,6 @@
> #include <linux/if_arp.h>
> #include <linux/netdevice.h>
> #include <asm/unaligned.h>
> -#include <net/iw_handler.h>
>
> #include "host.h"
> #include "decl.h"
> @@ -27,13 +26,16 @@
> */
> void lbs_mac_event_disconnected(struct lbs_private *priv)
> {
> +#ifdef CONFIG_LIBERTAS_WEXT
> union iwreq_data wrqu;
> +#endif
>
> if (priv->connect_status != LBS_CONNECTED)
> return;
>
> lbs_deb_enter(LBS_DEB_ASSOC);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN);
> wrqu.ap_addr.sa_family = ARPHRD_ETHER;
>
> @@ -44,6 +46,9 @@
>
> msleep_interruptible(1000);
> wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
> +#else
> + /* TODO: find out what to do in the cfg80211 case */
> +#endif
>
> /* report disconnect to upper layer */
> netif_stop_queue(priv->dev);
> @@ -55,6 +60,7 @@
> priv->tx_pending_len = 0;
>
> /* reset SNR/NF/RSSI values */
> +#ifdef CONFIG_LIBERTAS_WEXT
> memset(priv->SNR, 0x00, sizeof(priv->SNR));
> memset(priv->NF, 0x00, sizeof(priv->NF));
> memset(priv->RSSI, 0x00, sizeof(priv->RSSI));
> @@ -62,7 +68,6 @@
> memset(priv->rawNF, 0x00, sizeof(priv->rawNF));
> priv->nextSNRNF = 0;
> priv->numSNRNF = 0;
> - priv->connect_status = LBS_DISCONNECTED;
>
> /* Clear out associated SSID and BSSID since connection is
> * no longer valid.
> @@ -70,6 +75,9 @@
> memset(&priv->curbssparams.bssid, 0, ETH_ALEN);
> memset(&priv->curbssparams.ssid, 0, IEEE80211_MAX_SSID_LEN);
> priv->curbssparams.ssid_len = 0;
> +#endif
> + priv->connect_status = LBS_DISCONNECTED;
> +
>
> if (priv->psstate != PS_STATE_FULL_POWER) {
> /* make firmware to exit PS mode */
> @@ -88,9 +96,12 @@
> */
> static void handle_mic_failureevent(struct lbs_private *priv, u32 event)
> {
> +#ifdef CONFIG_LIBERTAS_WEXT
> char buf[50];
> +#endif
>
> lbs_deb_enter(LBS_DEB_CMD);
> +#ifdef CONFIG_LIBERTAS_WEXT
> memset(buf, 0, sizeof(buf));
>
> sprintf(buf, "%s", "MLME-MICHAELMICFAILURE.indication ");
> @@ -102,6 +113,7 @@
> }
>
> lbs_send_iwevcustom_event(priv, buf);
> +#endif
> lbs_deb_leave(LBS_DEB_CMD);
> }
>
> @@ -177,10 +189,6 @@
> case CMD_RET(CMD_802_11_BEACON_STOP):
> break;
>
> - case CMD_RET(CMD_802_11_RSSI):
> - ret = lbs_ret_802_11_rssi(priv, resp);
> - break;
> -
> case CMD_RET(CMD_802_11_TPC_CFG):
> spin_lock_irqsave(&priv->driver_lock, flags);
> memmove((void *)priv->cur_cmd->callback_arg, &resp->params.tpccfg,
> @@ -202,9 +210,16 @@
> sizeof(resp->params.fwt));
> spin_unlock_irqrestore(&priv->driver_lock, flags);
> break;
> +
> +#ifdef CONFIG_LIBERTAS_WEXT
> + case CMD_RET(CMD_802_11_RSSI):
> + ret = lbs_ret_802_11_rssi(priv, resp);
> + break;
> +
> case CMD_RET(CMD_802_11_BEACON_CTRL):
> ret = lbs_ret_802_11_bcn_ctrl(priv, resp);
> break;
> +#endif
>
> default:
> lbs_pr_err("CMD_RESP: unknown cmd response 0x%04x\n",
> @@ -297,9 +312,13 @@
> * ad-hoc mode. It takes place in
> * lbs_execute_next_command().
> */
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mode == IW_MODE_ADHOC &&
> action == CMD_SUBCMD_ENTER_PS)
> priv->psmode = LBS802_11POWERMODECAM;
> +#else
> + /* TODO: we need to figure out what to do here in cfg80211-mode */
> +#endif
> } else if (action == CMD_SUBCMD_ENTER_PS) {
> priv->needtowakeup = 0;
> priv->psstate = PS_STATE_AWAKE;
> @@ -516,6 +535,7 @@
> lbs_pr_alert("EVENT: snr high\n");
> break;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> case MACREG_INT_CODE_MESH_AUTO_STARTED:
> /* Ignore spurious autostart events if autostart is disabled */
> if (!priv->mesh_autostart_enabled) {
> @@ -532,6 +552,7 @@
> priv->mode = IW_MODE_ADHOC;
> schedule_work(&priv->sync_channel);
> break;
> +#endif
>
> default:
> lbs_pr_alert("EVENT: unknown event id %d\n", event);
> --- linux-wl.orig/drivers/net/wireless/libertas/debugfs.c
> +++ linux-wl/drivers/net/wireless/libertas/debugfs.c
> @@ -4,7 +4,6 @@
> #include <linux/delay.h>
> #include <linux/mm.h>
> #include <linux/string.h>
> -#include <net/iw_handler.h>
> #include <net/lib80211.h>
>
> #include "dev.h"
> @@ -60,6 +59,7 @@
> }
>
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
> size_t count, loff_t *ppos)
> {
> @@ -103,6 +103,7 @@
> free_page(addr);
> return res;
> }
> +#endif
>
> static ssize_t lbs_sleepparams_write(struct file *file,
> const char __user *user_buf, size_t count,
> @@ -722,8 +723,10 @@
>
> static const struct lbs_debugfs_files debugfs_files[] = {
> { "info", 0444, FOPS(lbs_dev_info, write_file_dummy), },
> +#ifdef CONFIG_LIBERTAS_WEXT
> { "getscantable", 0444, FOPS(lbs_getscantable,
> write_file_dummy), },
> +#endif
> { "sleepparams", 0644, FOPS(lbs_sleepparams_read,
> lbs_sleepparams_write), },
> };
> --- linux-wl.orig/drivers/net/wireless/libertas/rx.c
> +++ linux-wl/drivers/net/wireless/libertas/rx.c
> @@ -34,6 +34,7 @@
> void *eth80211_hdr;
> } __attribute__ ((packed));
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> static int process_rxed_802_11_packet(struct lbs_private *priv,
> struct sk_buff *skb);
>
> @@ -129,6 +130,7 @@
>
> lbs_deb_leave(LBS_DEB_RX);
> }
> +#endif
>
> /**
> * @brief This function processes received packet and forwards it
> @@ -154,12 +156,15 @@
>
> skb->ip_summed = CHECKSUM_NONE;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->monitormode)
> return process_rxed_802_11_packet(priv, skb);
> +#endif
>
> p_rx_pd = (struct rxpd *) skb->data;
> p_rx_pkt = (struct rxpackethdr *) ((u8 *)p_rx_pd +
> le32_to_cpu(p_rx_pd->pkt_ptr));
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev) {
> if (priv->mesh_fw_ver == MESH_FW_OLD) {
> if (p_rx_pd->rx_control & RxPD_MESH_FRAME)
> @@ -169,6 +174,7 @@
> dev = priv->mesh_dev;
> }
> }
> +#endif
>
> lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data,
> min_t(unsigned int, skb->len, 100));
> @@ -232,6 +238,7 @@
> */
> skb_pull(skb, hdrchop);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /* Take the data rate from the rxpd structure
> * only if the rate is auto
> */
> @@ -239,6 +246,7 @@
> priv->cur_rate = lbs_fw_index_to_data_rate(p_rx_pd->rx_rate);
>
> lbs_compute_rssi(priv, p_rx_pd);
> +#endif
>
> lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
> dev->stats.rx_bytes += skb->len;
> @@ -257,6 +265,7 @@
> }
> EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief This function converts Tx/Rx rates from the Marvell WLAN format
> * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s)
> @@ -381,3 +390,4 @@
> lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
> return ret;
> }
> +#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/tx.c
> +++ linux-wl/drivers/net/wireless/libertas/tx.c
> @@ -12,6 +12,7 @@
> #include "dev.h"
> #include "wext.h"
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief This function converts Tx/Rx rates from IEEE80211_RADIOTAP_RATE
> * units (500 Kb/s) into Marvell WLAN format (see Table 8 in Section 3.2.1)
> @@ -49,6 +50,7 @@
> }
> return 0;
> }
> +#endif
>
> /**
> * @brief This function checks the conditions and sends packet to IF
> @@ -88,8 +90,10 @@
>
>
> netif_stop_queue(priv->dev);
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->mesh_dev)
> netif_stop_queue(priv->mesh_dev);
> +#endif
>
> if (priv->tx_pending_len) {
> /* This can happen if packets come in on the mesh and eth
> @@ -111,6 +115,7 @@
> p802x_hdr = skb->data;
> pkt_len = skb->len;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (dev == priv->rtap_net_dev) {
> struct tx_radiotap_hdr *rtap_hdr = (void *)skb->data;
>
> @@ -123,6 +128,9 @@
>
> /* copy destination address from 802.11 header */
> memcpy(txpd->tx_dest_addr_high, p802x_hdr + 4, ETH_ALEN);
> +#else
> + if (0) {
> +#endif
> } else {
> /* copy destination address from 802.3 header */
> memcpy(txpd->tx_dest_addr_high, p802x_hdr, ETH_ALEN);
> @@ -131,12 +139,14 @@
> txpd->tx_packet_length = cpu_to_le16(pkt_len);
> txpd->tx_packet_location = cpu_to_le32(sizeof(struct txpd));
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (dev == priv->mesh_dev) {
> if (priv->mesh_fw_ver == MESH_FW_OLD)
> txpd->tx_control |= cpu_to_le32(TxPD_MESH_FRAME);
> else if (priv->mesh_fw_ver == MESH_FW_NEW)
> txpd->u.bss.bss_num = MESH_IFACE_ID;
> }
> +#endif
>
> lbs_deb_hex(LBS_DEB_TX, "txpd", (u8 *) &txpd, sizeof(struct txpd));
>
> @@ -154,6 +164,7 @@
>
> dev->trans_start = jiffies;
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> if (priv->monitormode) {
> /* Keep the skb to echo it back once Tx feedback is
> received from FW */
> @@ -161,6 +172,9 @@
>
> /* Keep the skb around for when we get feedback */
> priv->currenttxskb = skb;
> +#else
> + if (0) {
> +#endif
> } else {
> free:
> dev_kfree_skb_any(skb);
> @@ -173,6 +187,7 @@
> return ret;
> }
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /**
> * @brief This function sends to the host the last transmitted packet,
> * filling the radiotap headers with transmission information.
> @@ -207,3 +222,4 @@
> netif_wake_queue(priv->mesh_dev);
> }
> EXPORT_SYMBOL_GPL(lbs_send_tx_feedback);
> +#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/if_usb.c
> +++ linux-wl/drivers/net/wireless/libertas/if_usb.c
> @@ -757,6 +757,7 @@
> lbs_deb_usbd(&cardp->udev->dev, "**EVENT** 0x%X\n", event);
> kfree_skb(skb);
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> /* Icky undocumented magic special case */
> if (event & 0xffff0000) {
> u32 trycount = (event & 0xffff0000) >> 16;
> @@ -764,6 +765,7 @@
> lbs_send_tx_feedback(priv, trycount);
> } else
> lbs_queue_event(priv, event & 0xFF);
> +#endif
> break;
>
> default:
> --- linux-wl.orig/drivers/net/wireless/libertas/assoc.h
> +++ linux-wl/drivers/net/wireless/libertas/assoc.h
> @@ -3,6 +3,7 @@
> #ifndef _LBS_ASSOC_H_
> #define _LBS_ASSOC_H_
>
> +#ifdef CONFIG_LIBERTAS_WEXT
>
> #include "defs.h"
> #include "host.h"
> @@ -152,4 +153,6 @@
> int lbs_cmd_802_11_key_material(struct lbs_private *priv, uint16_t cmd_action,
> struct assoc_request *assoc);
>
> +#endif
> +
> #endif /* _LBS_ASSOC_H */
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.h
> +++ linux-wl/drivers/net/wireless/libertas/scan.h
> @@ -7,6 +7,8 @@
> #ifndef _LBS_SCAN_H
> #define _LBS_SCAN_H
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> +
> #include <net/iw_handler.h>
>
> struct lbs_private;
> @@ -61,3 +63,5 @@
> void lbs_scan_worker(struct work_struct *work);
>
> #endif
> +
> +#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/wext.h
> +++ linux-wl/drivers/net/wireless/libertas/wext.h
> @@ -4,9 +4,13 @@
> #ifndef _LBS_WEXT_H_
> #define _LBS_WEXT_H_
>
> +#ifdef CONFIG_LIBERTAS_WEXT
> +
> void lbs_send_iwevcustom_event(struct lbs_private *priv, s8 *str);
>
> extern struct iw_handler_def lbs_handler_def;
> extern struct iw_handler_def mesh_handler_def;
>
> #endif
> +
> +#endif
^ permalink raw reply
* Re: [PATCH] libertas: remove handling for CMD_802_11_LED_GPIO_CTRL
From: Dan Williams @ 2009-10-21 18:28 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910191331.20476.hs4233@mail.mn-solutions.de>
On Mon, 2009-10-19 at 13:31 +0200, Holger Schurig wrote:
> ... which just resided as an old-style command in cmd/cmdresp, but
> was nowhere useed. If we ever need it, we can re-add it as a newstyle
> command.
It's actually used by the OLPC folks; but right now there's simply no
mechanism to configure that ability via WEXT. Is there some way to do
this via the kernel LED framework instead that libertas should be
using?
Dan
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
>
> --- linux-wl.orig/drivers/net/wireless/libertas/cmd.c
> +++ linux-wl/drivers/net/wireless/libertas/cmd.c
> @@ -1181,29 +1181,6 @@
>
> ret = 0;
> break;
> - case CMD_802_11_LED_GPIO_CTRL:
> - {
> - struct mrvl_ie_ledgpio *gpio =
> - (struct mrvl_ie_ledgpio*)
> - cmdptr->params.ledgpio.data;
> -
> - memmove(&cmdptr->params.ledgpio,
> - pdata_buf,
> - sizeof(struct cmd_ds_802_11_led_ctrl));
> -
> - cmdptr->command =
> - cpu_to_le16(CMD_802_11_LED_GPIO_CTRL);
> -
> -#define ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN 8
> - cmdptr->size =
> - cpu_to_le16(le16_to_cpu(gpio->header.len)
> - + S_DS_GEN
> - + ACTION_NUMLED_TLVTYPE_LEN_FIELDS_LEN);
> - gpio->header.len = gpio->header.len;
> -
> - ret = 0;
> - break;
> - }
>
> case CMD_BT_ACCESS:
> ret = lbs_cmd_bt_access(cmdptr, cmd_action, pdata_buf);
> --- linux-wl.orig/drivers/net/wireless/libertas/cmdresp.c
> +++ linux-wl/drivers/net/wireless/libertas/cmdresp.c
> @@ -187,12 +187,6 @@
> sizeof(struct cmd_ds_802_11_tpc_cfg));
> spin_unlock_irqrestore(&priv->driver_lock, flags);
> break;
> - case CMD_RET(CMD_802_11_LED_GPIO_CTRL):
> - spin_lock_irqsave(&priv->driver_lock, flags);
> - memmove((void *)priv->cur_cmd->callback_arg, &resp->params.ledgpio,
> - sizeof(struct cmd_ds_802_11_led_ctrl));
> - spin_unlock_irqrestore(&priv->driver_lock, flags);
> - break;
>
> case CMD_RET(CMD_GET_TSF):
> spin_lock_irqsave(&priv->driver_lock, flags);
>
^ permalink raw reply
* Re: l
From: Andrey Yurovsky @ 2009-10-21 18:23 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, Dan Williams, John Linville
In-Reply-To: <200910201513.10880.hs4233@mail.mn-solutions.de>
On Tue, Oct 20, 2009 at 6:13 AM, Holger Schurig
<hs4233@mail.mn-solutions.de> wrote:
> [PATCH] libertas spi: fix sparse errors
>
> This fixes the following sparse warnings:
>
> $ make modules SUBDIRS=drivers/net/wireless/libertas C=1 CF=-D__CHECK_ENDIAN__
> make: Entering directory `/usr/src/linux-wl'
> CHECK drivers/net/wireless/libertas/if_spi.c
> drivers/net/wireless/libertas/if_spi.c:137:16: warning: incorrect type in initializer (different base types)
> drivers/net/wireless/libertas/if_spi.c:137:16: expected unsigned short [unsigned] [usertype] reg_out
> drivers/net/wireless/libertas/if_spi.c:137:16: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:191:16: warning: incorrect type in initializer (different base types)
> drivers/net/wireless/libertas/if_spi.c:191:16: expected unsigned short [unsigned] [usertype] reg_out
> drivers/net/wireless/libertas/if_spi.c:191:16: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:256:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:256:24: expected restricted __le32 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:256:24: got unsigned int *<noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
> drivers/net/wireless/libertas/if_spi.c:171:7: expected unsigned short [unsigned] [usertype] buff
> drivers/net/wireless/libertas/if_spi.c:171:7: got restricted __le16 [usertype] <noident>
> drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
> drivers/net/wireless/libertas/if_spi.c:243:24: expected restricted __le16 const [usertype] *p
> drivers/net/wireless/libertas/if_spi.c:243:24: got unsigned short *<noident>
>
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
>
> ---
>
> Andrey, can you test this?
>
> Dan, John: this is completely unrelated to my other libertas patches
>
> --- linux-wl.orig/drivers/net/wireless/libertas/if_spi.c
> +++ linux-wl/drivers/net/wireless/libertas/if_spi.c
> @@ -134,7 +134,7 @@
> static int spu_write(struct if_spi_card *card, u16 reg, const u8 *buf, int len)
> {
> int err = 0;
> - u16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
> + __le16 reg_out = cpu_to_le16(reg | IF_SPI_WRITE_OPERATION_MASK);
> struct spi_message m;
> struct spi_transfer reg_trans;
> struct spi_transfer data_trans;
> @@ -166,7 +166,7 @@
>
> static inline int spu_write_u16(struct if_spi_card *card, u16 reg, u16 val)
> {
> - u16 buff;
> + __le16 buff;
>
> buff = cpu_to_le16(val);
> return spu_write(card, reg, (u8 *)&buff, sizeof(u16));
> @@ -188,7 +188,7 @@
> {
> unsigned int delay;
> int err = 0;
> - u16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
> + __le16 reg_out = cpu_to_le16(reg | IF_SPI_READ_OPERATION_MASK);
> struct spi_message m;
> struct spi_transfer reg_trans;
> struct spi_transfer dummy_trans;
> @@ -235,7 +235,7 @@
> /* Read 16 bits from an SPI register */
> static inline int spu_read_u16(struct if_spi_card *card, u16 reg, u16 *val)
> {
> - u16 buf;
> + __le16 buf;
> int ret;
>
> ret = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
> @@ -248,7 +248,7 @@
> * The low 16 bits are read first. */
> static int spu_read_u32(struct if_spi_card *card, u16 reg, u32 *val)
> {
> - u32 buf;
> + __le32 buf;
> int err;
>
> err = spu_read(card, reg, (u8 *)&buf, sizeof(buf));
>
> --
> http://www.holgerschurig.de
>
Tested-by: Andrey Yurovsky <andrey@cozybit.com>
On a Blackfin (LE) machine. Also, please fix the subject line : )
^ permalink raw reply
* Re: [PATCH] libertas: remove unused 11d.h as well, priv->countryinfo
From: Dan Williams @ 2009-10-21 18:16 UTC (permalink / raw)
To: Holger Schurig; +Cc: linux-wireless, John Linville
In-Reply-To: <200910191014.05320.hs4233@mail.mn-solutions.de>
On Mon, 2009-10-19 at 10:14 +0200, Holger Schurig wrote:
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
> --- linux-wl.orig/drivers/net/wireless/libertas/11d.h
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -/**
> - * This header file contains data structures and
> - * function declarations of 802.11d
> - */
> -#ifndef _LBS_11D_
> -#define _LBS_11D_
> -
> -#include "types.h"
> -#include "defs.h"
> -
> -#define UNIVERSAL_REGION_CODE 0xff
> -
> -/** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr)
> - */
> -#define MRVDRV_MAX_SUBBAND_802_11D 83
> -
> -#define COUNTRY_CODE_LEN 3
> -#define MAX_NO_OF_CHAN 40
> -
> -struct cmd_ds_command;
> -
> -/** Data structure for Country IE*/
> -struct ieee_subbandset {
> - u8 firstchan;
> - u8 nrchan;
> - u8 maxtxpwr;
> -} __attribute__ ((packed));
> -
> -struct ieee_ie_country_info_set {
> - struct ieee_ie_header header;
> -
> - u8 countrycode[COUNTRY_CODE_LEN];
> - struct ieee_subbandset subband[1];
> -};
> -
> -struct ieee_ie_country_info_full_set {
> - struct ieee_ie_header header;
> -
> - u8 countrycode[COUNTRY_CODE_LEN];
> - struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
> -} __attribute__ ((packed));
> -
> -struct mrvl_ie_domain_param_set {
> - struct mrvl_ie_header header;
> -
> - u8 countrycode[COUNTRY_CODE_LEN];
> - struct ieee_subbandset subband[1];
> -} __attribute__ ((packed));
> -
> -struct cmd_ds_802_11d_domain_info {
> - __le16 action;
> - struct mrvl_ie_domain_param_set domain;
> -} __attribute__ ((packed));
> -
> -/** domain regulatory information */
> -struct lbs_802_11d_domain_reg {
> - /** country Code*/
> - u8 countrycode[COUNTRY_CODE_LEN];
> - /** No. of subband*/
> - u8 nr_subband;
> - struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
> -};
> -
> -struct chan_power_11d {
> - u8 chan;
> - u8 pwr;
> -} __attribute__ ((packed));
> -
> -struct parsed_region_chan_11d {
> - u8 band;
> - u8 region;
> - s8 countrycode[COUNTRY_CODE_LEN];
> - struct chan_power_11d chanpwr[MAX_NO_OF_CHAN];
> - u8 nr_chan;
> -} __attribute__ ((packed));
> -
> -struct region_code_mapping {
> - u8 region[COUNTRY_CODE_LEN];
> - u8 code;
> -};
> -
> -#endif
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h
> +++ linux-wl/drivers/net/wireless/libertas/dev.h
> @@ -360,8 +360,6 @@
> union ieee_phy_param_set phy;
> union ieee_ss_param_set ss;
>
> - struct ieee_ie_country_info_full_set countryinfo;
> -
> u8 wpa_ie[MAX_WPA_IE_LEN];
> size_t wpa_ie_len;
> u8 rsn_ie[MAX_WPA_IE_LEN];
> --- linux-wl.orig/drivers/net/wireless/libertas/host.h
> +++ linux-wl/drivers/net/wireless/libertas/host.h
> @@ -6,7 +6,8 @@
> #ifndef _LBS_HOST_H_
> #define _LBS_HOST_H_
>
> -#include "11d.h"
> +#include "types.h"
> +#include "defs.h"
>
> #define DEFAULT_AD_HOC_CHANNEL 6
>
> @@ -961,9 +962,6 @@
> struct cmd_ds_bbp_reg_access bbpreg;
> struct cmd_ds_rf_reg_access rfreg;
>
> - struct cmd_ds_802_11d_domain_info domaininfo;
> - struct cmd_ds_802_11d_domain_info domaininforesp;
> -
> struct cmd_ds_802_11_tpc_cfg tpccfg;
> struct cmd_ds_802_11_afc afc;
> struct cmd_ds_802_11_led_ctrl ledgpio;
> --- linux-wl.orig/drivers/net/wireless/libertas/scan.c
> +++ linux-wl/drivers/net/wireless/libertas/scan.c
> @@ -503,7 +503,6 @@
> struct ieee_ie_cf_param_set *cf;
> struct ieee_ie_ibss_param_set *ibss;
> DECLARE_SSID_BUF(ssid);
> - struct ieee_ie_country_info_set *pcountryinfo;
> uint8_t *pos, *end, *p;
> uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0;
> uint16_t beaconsize = 0;
> @@ -626,26 +625,6 @@
> lbs_deb_scan("got IBSS IE\n");
> break;
>
> - case WLAN_EID_COUNTRY:
> - pcountryinfo = (struct ieee_ie_country_info_set *) pos;
> - lbs_deb_scan("got COUNTRY IE\n");
> - if (pcountryinfo->header.len < sizeof(pcountryinfo->countrycode)
> - || pcountryinfo->header.len > 254) {
> - lbs_deb_scan("%s: 11D- Err CountryInfo len %d, min %zd, max 254\n",
> - __func__,
> - pcountryinfo->header.len,
> - sizeof(pcountryinfo->countrycode));
> - ret = -1;
> - goto done;
> - }
> -
> - memcpy(&bss->countryinfo, pcountryinfo,
> - pcountryinfo->header.len + 2);
> - lbs_deb_hex(LBS_DEB_SCAN, "process_bss: 11d countryinfo",
> - (uint8_t *) pcountryinfo,
> - (int) (pcountryinfo->header.len + 2));
> - break;
> -
> case WLAN_EID_EXT_SUPP_RATES:
> /* only process extended supported rate if data rate is
> * already found. Data rate IE should come before
>
^ 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