Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: pull request: wireless 2011-09-27
From: David Miller @ 2011-09-28  2:43 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20110927210031.GA2471@tuxdriver.com>

From: "John W. Linville" <linville@tuxdriver.com>
Date: Tue, 27 Sep 2011 17:00:31 -0400

> Here is another last (?) batch of fixes intended for 3.1.  Included is a
> scanning-related regression fix that avoids a potential crash, a buffer
> overflow fix in cfg80211, an fix for an uninitialized variable in
> rtlwifi, a fix for a DMA-related WARNING in ath9k, a fix for a DMA hang
> in ath9k, and two iwlegacy fixes backported from prior iwlagn fixes, one
> for avoiding interruptible waits and another for avoiding a command
> queue timeout.
> 
> Please let me know if there are problems!

Pulled, thanks John.

^ permalink raw reply

* Re: Bluetooth regression with headphones
From: Jeremy Fitzhardinge @ 2011-09-27 18:03 UTC (permalink / raw)
  To: padovan
  Cc: Linux Kernel Mailing List, linux-bluetooth, linux-wireless,
	Keith Packard
In-Reply-To: <4E73CFEF.5000509@goop.org>

Ping?

On 09/16/2011 03:38 PM, Jeremy Fitzhardinge wrote:
> On 09/16/2011 03:33 PM, Jeremy Fitzhardinge wrote:
>> On 09/12/2011 06:33 PM, Jeremy Fitzhardinge wrote:
>>> Hi all,
>>>
>>> I reported a regression in connecting my Nokia BH-905i headphones in
>>> June this year (https://lkml.org/lkml/2011/6/23/770), which was the same
>>> problem Keith Packard reported in https://lkml.org/lkml/2011/6/9/63.  
>>> It was briefly fixed in
>>> git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-2.6.git.
>>>
>>> Unfortunately it regressed again by the time of the linux-3.0 release,
>>> to something with similar symptoms: the headphones won't reliably
>>> connect to my laptop unless I freshly re-pair them.  However, unlike the
>>> original bug, they will very occasionally connect normally, though I
>>> don't know why.
>>>
>>> This behaviour has been consistent since 3.0 up until the current
>>> 3.1-rc6 kernel.
>>>
>>> What further information can I provide?  How can I help debug this?
>> I turned on debugging by running "bluetoothd -n -d", and got the
>> following when trying to connect my headphones:
>>
>> Sep 16 15:30:47 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: HEADSET_STATE_DISCONNECTED -> HEADSET_STATE_CONNECTING
>> Sep 16 15:30:47 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>> Sep 16 15:30:47 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:remote_features_information() hci0 status 0
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:remote_name_information() hci0 status 0
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_channel() Discovered Handsfree service on channel 1
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:rfcomm_connect() /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: Connecting to 00:0B:E4:A6:6C:0D channel 1
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() hci0 dba 00:0B:E4:A6:6C:0D
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() kernel auth requirements = 0x04
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() Matching key found
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() link key type 0x04
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:auth_complete() hci0 status 0
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_bonding_process_complete() status=00
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>> Sep 16 15:30:48 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_bonding_process_complete() no pending auth request
>> Sep 16 15:30:50 saboo bluetoothd[22025]: bluetoothd[22025]: Permission denied (13)
>> Sep 16 15:30:50 saboo bluetoothd[22025]: Permission denied (13)
>> Sep 16 15:30:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: HEADSET_STATE_CONNECTING -> HEADSET_STATE_DISCONNECTED
>> Sep 16 15:30:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
>>
> And I get this when I successfully re-pair and connect the headphones:
>
> Sep 16 15:36:30 saboo bluetoothd[22025]: Discovery session 0x7f1059478630 with :1.326 activated
> Sep 16 15:36:30 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_start_inquiry() hci0 length 8 periodic 1
> Sep 16 15:36:30 saboo bluetoothd[22025]: bluetoothd[22025]: Discovery session 0x7f1059478630 with :1.326 activated
> Sep 16 15:36:30 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:session_ref() 0x7f1059478630: ref=1
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:session_unref() 0x7f1059478630: ref=0
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:session_remove() Discovery session 0x7f1059478630 with :1.326 deactivated
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:session_remove() Stopping discovery
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_stop_inquiry() hci0
> Sep 16 15:36:35 saboo bluetoothd[22025]: Stopping discovery
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: Stopping discovery
> Sep 16 15:36:35 saboo bluetoothd[22025]: Inquiry Failed with status 0x12
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: Inquiry Failed with status 0x12
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_create_device() 00:0B:E4:A6:6C:0D
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:device_create() Creating device /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_ref() 0x7f105947ef70: ref=1
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:bonding_request_new() Requesting bonding for 00:0B:E4:A6:6C:0D
> Sep 16 15:36:35 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:bonding_request_new() Temporary agent registered for 00:0B:E4:A6:6C:0D at :1.326:/org/bluez/agent/wizard
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:remote_features_information() hci0 status 0
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:remote_name_information() hci0 status 0
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() hci0 dba 00:0B:E4:A6:6C:0D
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() kernel auth requirements = 0x03
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_request() Matching key not found
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:io_capa_request() hci0 IO capability request for 00:0B:E4:A6:6C:0D
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_get_auth_info() hci0 dba 00:0B:E4:A6:6C:0D
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_get_io_cap() initial authentication requirement is 0x03
> Sep 16 15:36:42 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_get_io_cap() final authentication requirement is 0x03
> Sep 16 15:36:44 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:io_capa_response() hci0 IO capability response from 00:0B:E4:A6:6C:0D
> Sep 16 15:36:44 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:user_confirm_request() hci0
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_get_auth_info() hci0 dba 00:0B:E4:A6:6C:0D
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() confirm IO capabilities are 0x01
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() confirm authentication requirement is 0x03
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() remote IO capabilities are 0x03
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() remote authentication requirement is 0x02
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_user_confirm() auto accept of confirmation
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_confirm_reply() hci0 dba 00:0B:E4:A6:6C:0D success 1
> Sep 16 15:36:46 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:device_request_authentication() Requesting agent authentication for 00:0B:E4:A6:6C:0D
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:simple_pairing_complete() hci0 status 0
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_simple_pairing_complete() status=00
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:link_key_notify() hci0 dba 00:0B:E4:A6:6C:0D type 4
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:hciops_get_auth_info() hci0 dba 00:0B:E4:A6:6C:0D
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_link_key_notify() key type 0x04 old key type 0xff new key type 0x04
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_link_key_notify() local auth 0x03 and remote auth 0x02
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_link_key_notify() storing link key of type 0x04
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: plugins/hciops.c:auth_complete() hci0 status 0
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/event.c:btd_event_bonding_process_complete() status=00
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_ref() 0x7f105947ef70: ref=2
> Sep 16 15:36:49 saboo bluetoothd[22025]: bluetoothd[22025]: src/agent.c:agent_release() Releasing agent :1.326, /org/bluez/agent/wizard
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:device_probe_drivers() Probing drivers for 00:0B:E4:A6:6C:0D
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: serial/manager.c:serial_probe() path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: 0000111e-0000-1000-8000-00805f9b34fb
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: serial/port.c:create_serial_device() Registered interface org.bluez.Serial on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: serial/manager.c:serial_probe() path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: 00001108-0000-1000-8000-00805f9b34fb
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: input/manager.c:headset_probe() path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_ref() 0x7f105947ef70: ref=3
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: input/device.c:input_device_new() Registered interface org.bluez.Input on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/adapter.c:adapter_get_device() 00:0B:E4:A6:6C:0D
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_ref() 0x7f105947ef70: ref=4
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/device.c:audio_device_register() Registered interface org.bluez.Audio on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found Headset record
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_init() Registered interface org.bluez.Headset on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found Handsfree record
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found Audio Sink
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:sink_init() Registered interface org.bluez.AudioSink on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found AV Target
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:control_init() Registered interface org.bluez.Control on path /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/manager.c:handle_uuid() Found AV Remote
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: src/device.c:btd_device_unref() 0x7f105947ef70: ref=3
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: HEADSET_STATE_DISCONNECTED -> HEADSET_STATE_CONNECTING
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_channel() Discovered Handsfree service on channel 1
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:rfcomm_connect() /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: Connecting to 00:0B:E4:A6:6C:0D channel 1
> Sep 16 15:36:50 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_connect_cb() /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: Connected to 00:0B:E4:A6:6C:0D
> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+BRSF=25
> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:print_hf_features() HFP HF features: "EC and/or NR function" "Voice recognition activation" "Remote volume control"
> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+CIND=?
> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+CIND?
> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+CMER=3, 0, 0, 1
> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:event_reporting() Event reporting (CMER): mode=3, ind=1
> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:hfp_slc_complete() HFP Service Level Connection established
> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/telephony.c:telephony_device_connected() telephony-dummy: device 0x7f1059492390 connected
> Sep 16 15:36:51 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:headset_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: HEADSET_STATE_CONNECTING -> HEADSET_STATE_CONNECTED
> Sep 16 15:36:52 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+VGS=10
> Sep 16 15:36:52 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+VGM=10
> Sep 16 15:36:52 saboo bluetoothd[22025]: Badly formated or unrecognized command: AT+CSRSF=1,1,1,1,1,7
> Sep 16 15:36:52 saboo bluetoothd[22025]: bluetoothd[22025]: audio/headset.c:handle_event() Received AT+CSRSF=1,1,1,1,1,7
> Sep 16 15:36:52 saboo bluetoothd[22025]: bluetoothd[22025]: Badly formated or unrecognized command: AT+CSRSF=1,1,1,1,1,7
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_ref() 0x7f105947b330: ref=2
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_ref() 0x7f105947b330: ref=3
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:sink_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: SINK_STATE_DISCONNECTED -> SINK_STATE_CONNECTING
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_unref() 0x7f105947b330: ref=2
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_connect_cb() AVDTP: connected signaling channel to 00:0B:E4:A6:6C:0D
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_connect_cb() AVDTP imtu=672, omtu=895
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:avctp_set_state() AVCTP Connecting
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() DISCOVER request succeeded
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_discover_resp() seid 1 type 1 media 0 in use 0
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_discover_resp() seid 2 type 1 media 0 in use 0
> Sep 16 15:36:53 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_discover_resp() seid 4 type 1 media 0 in use 0
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() GET_CAPABILITIES request succeeded
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_get_capabilities_resp() seid 1 type 1 media 0
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() GET_CAPABILITIES request succeeded
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_get_capabilities_resp() seid 2 type 1 media 0
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() GET_CAPABILITIES request succeeded
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_get_capabilities_resp() seid 4 type 1 media 0
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:discovery_complete() Discovery complete
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_ref() 0x7f105947b330: ref=3
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_ref() 0x7f105947e3f0: ref=1
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:a2dp_config() a2dp_config: selected SEP 0x7f1059476ad0
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_ref() 0x7f105947e3f0: ref=2
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_set_configuration() 0x7f105947b330: int_seid=1, acp_seid=1
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_unref() 0x7f105947e3f0: ref=1
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() SET_CONFIGURATION request succeeded
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setconf_cfm() Source 0x7f1059476ad0: Set_Configuration_Cfm
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_sep_set_state() stream state changed: IDLE -> CONFIGURED
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:avctp_connect_cb() AVCTP: connected to 00:0B:E4:A6:6C:0D
> Sep 16 15:36:54 saboo kernel: [93473.952314] input: 00:0B:E4:A6:6C:0D as /devices/virtual/input/input31
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:init_uinput() AVRCP: uinput initialized for 00:0B:E4:A6:6C:0D
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/control.c:avctp_set_state() AVCTP Connected
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() OPEN request succeeded
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_connect_cb() AVDTP: connected transport channel to 00:0B:E4:A6:6C:0D
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:handle_transport_connect() sk 29, omtu 895, send buffer size 63488
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:open_cfm() Source 0x7f1059476ad0: Open_Cfm
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:stream_setup_complete() Stream successfully created
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_unref() 0x7f105947e3f0: ref=0
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_free() 0x7f105947e3f0
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_unref() 0x7f105947b330: ref=2
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_sep_set_state() stream state changed: CONFIGURED -> OPEN
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:sink_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: SINK_STATE_CONNECTING -> SINK_STATE_CONNECTED
> Sep 16 15:36:54 saboo bluetoothd[22025]: bluetoothd[22025]: audio/unix.c:server_cb() Accepted new client connection on unix socket (fd=30)
> Sep 16 15:36:54 saboo rsyslogd-2177: imuxsock begins to drop messages from pid 22025 due to rate-limiting
> Sep 16 22:36:54 saboo rtkit-daemon[1543]: Successfully made thread 22178 of process 1866 (/usr/bin/pulseaudio) owned by '500' RT at priority 5.
> Sep 16 15:36:55 saboo rsyslogd-2177: imuxsock lost 52 messages from pid 22025 due to rate-limiting
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:session_cb()
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_parse_resp() START request succeeded
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:start_cfm() Source 0x7f1059476ad0: Start_Cfm
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/unix.c:unix_ipc_sendmsg() Audio API: BT_RESPONSE -> BT_START_STREAM
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/unix.c:unix_ipc_sendmsg() Audio API: BT_RESPONSE -> BT_NEW_STREAM
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_unref() 0x7f105947e3f0: ref=0
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/a2dp.c:setup_free() 0x7f105947e3f0
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_unref() 0x7f105947b330: ref=3
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/avdtp.c:avdtp_sep_set_state() stream state changed: OPEN -> STREAMING
> Sep 16 15:36:55 saboo bluetoothd[22025]: bluetoothd[22025]: audio/sink.c:sink_set_state() State changed /org/bluez/22025/hci0/dev_00_0B_E4_A6_6C_0D: SINK_STATE_CONNECTED -> SINK_STATE_PLAYING
>
> Thanks,
> 	J
>


^ permalink raw reply

* Re: Channel type negotiation – HT support for mesh
From: Javier Cardona @ 2011-09-28  0:14 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ashok Nagarajan, thomas, devel, Sidharth Thakur, linux-wireless
In-Reply-To: <CAB=NE6U-=6UZfMvtv5Z77PcRbZCmXrbveM4N0mzcqXAR0QtTAQ@mail.gmail.com>

Luis,

On Tue, Sep 27, 2011 at 4:29 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> (...)
> A while back we had heard 802.11s support will *not* support
> aggregation, Javier, did the spec go out like that?

No it did not.  HT support (and aggregation) was a relatively late
addition to the draft and we never got to implement it.
But the spec assumes it is doable.  For A-MSDU aggregation, the Mesh
Control header should go on the first fragment.  I don't see anything
special required to support A-MPDU aggregation in mesh.

> Why was aggregation thought to not be possible with 802.11s?
> I can't see why right now.

Probably because when we had that conversation, HT support was not yet
specified in the draft?  Not sure.

> If we want to do comparable throughput tests for HT rates
> with Mesh we'd need to setup an AP with aggregation disabled, and the
> same WMM parameters.

OK

Thanks!

Javier

-- 
Javier Cardona
cozybit Inc.
http://www.cozybit.com

^ permalink raw reply

* Re: Channel type negotiation – HT support for mesh
From: Luis R. Rodriguez @ 2011-09-27 23:29 UTC (permalink / raw)
  To: Ashok Nagarajan, thomas
  Cc: devel, Javier Cardona, Sidharth Thakur, linux-wireless
In-Reply-To: <CAB=NE6USxp0rGPP2NFkThCFzpSccZ7WUF7AfxJ=3js5Ph5D82g@mail.gmail.com>

On Tue, Sep 27, 2011 at 3:39 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
> On Tue, Sep 27, 2011 at 1:49 AM, Ashok Nagarajan <anagar6@uic.edu> wrote:
>> In our previous conversation, Thomas was mentioning about very low
>> 802.11n rate and we din't have a clear reason for such low 11n rate!
>
> This may be WMM not being configured which is required for 802.11n, if
> you disable WMM on the AP <--> STA setup you may see the same poor
> performance.

So this is due to the fact that 802.11e which WMM requires is the
component of the spec that adds BlockAck support and therefore
Aggregation. You'll achieve higher throughput once you support
aggregation. I just reviewed with Thomas how we'd go about setting WMM
parameters and it seems we want to do this in cfg80211 at set channel.
This also bring up the question for IBSS as well and what to do when
your peer has different WMM parameters, this is not something you deal
with with infrastructure mode.

For now I would go with using default WMM parameters which the spec
does specify for both IBSS and Mesh and not peering up unless your
peer also beacons those same parameters. Later we can figure out how
we want to handle differences, maybe go with the minimum? The
difficulty with converging to values is although likely possible you
can also end up with races with different nodes on your network trying
to sych up with the same values.

For example, for IBSS we've already learned that if you do not want an
IBSS merge split you want to ensure to use the same SSID and BSSID. I
cannot be sure right now that any sort of similar splits may happen
with WMM / HT settings but just want to put that thought out there
before we support it. If we only support peering up with peers with
the same WMM capabilities at least we will not introduce issues, only
limitations with peers which can later be addressed if it addresses
properly all known mismatch issues.

Thomas is now looking at adding the WMM stuff for Mesh, the same will
be required for IBSS HT support.

A while back we had heard 802.11s support will *not* support
aggregation, Javier, did the spec go out like that? Why was
aggregation thought to not be possible with 802.11s? I can't see why
right now. If we want to do comparable throughput tests for HT rates
with Mesh we'd need to setup an AP with aggregation disabled, and the
same WMM parameters.

  Luis

^ permalink raw reply

* Re: [PATCH -next] rtlwifi: rtl8192c: Add includes of export.h
From: Paul Gortmaker @ 2011-09-27 22:58 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless, linux-kernel, linux-next, sfr, akpm
In-Reply-To: <4e7a6393.eQ0IEnMVbVlQIbx0%Larry.Finger@lwfinger.net>

On 11-09-21 06:22 PM, Larry Finger wrote:
> With the split of include/linux/module.h into two parts, several files in
> drivers rtlwifi and rtl8192c need to include the new file.
> 
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
> 
> Paul,
> 
> At Randy Dunlap's suggestion, I am sending this to you in hopes that
> I can save you some time. I think I found all the routines that will have
> a problem, but as these patches do not compile, I cannot be sure.

Hi Larry -- thanks for the patch, but...

> 
> Larry
> ---
> 
> Index: wireless-testing-new/drivers/net/wireless/rtlwifi/base.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/base.c
> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/base.c
> @@ -30,6 +30,7 @@
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>  
>  #include <linux/ip.h>
> +#include <linux/export.h>

This one needs module.h (which it has in my current tree) because it
calls module_init and module_exit.  All the other ones in your patch
match what I have in tree already though, so that is a good double
check to have.  There are some other ones that I found through many
randconfig builds that aren't in your patch. Here is the current list
in my tree:

~/git/module.h/linux-2.6.git$ git diff ^v3.1-rc6  HEAD drivers/net/wireless/rtlwifi |diffstat
 base.c                |    1 +
 cam.c                 |    1 +
 efuse.c               |    1 +
 pci.c                 |    1 +
 ps.c                  |    1 +
 rtl8192c/dm_common.c  |    1 +
 rtl8192c/fw_common.c  |    1 +
 rtl8192c/main.c       |    1 +
 rtl8192c/phy_common.c |    1 +
 rtl8192ce/sw.c        |    1 +
 rtl8192cu/sw.c        |    1 +
 rtl8192de/sw.c        |    1 +
 rtl8192se/sw.c        |    1 +
 usb.c                 |    1 +
 14 files changed, 14 insertions(+)

Thanks,
Paul.
 
>  #include "wifi.h"
>  #include "rc.h"
>  #include "base.h"
> Index: wireless-testing-new/drivers/net/wireless/rtlwifi/cam.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/cam.c
> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/cam.c
> @@ -29,6 +29,8 @@
>  
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>  
> +#include <linux/export.h>

Have this already.

> +
>  #include "wifi.h"
>  #include "cam.h"
>  
> Index: wireless-testing-new/drivers/net/wireless/rtlwifi/efuse.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/efuse.c
> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/efuse.c
> @@ -27,6 +27,8 @@
>   *
>   *****************************************************************************/
>  
> +#include <linux/export.h>
> +
>  #include "wifi.h"
>  #include "efuse.h"
>  
> Index: wireless-testing-new/drivers/net/wireless/rtlwifi/pci.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/pci.c
> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/pci.c
> @@ -27,6 +27,8 @@
>   *
>   *****************************************************************************/
>  
> +#include <linux/export.h>
> +
>  #include "core.h"
>  #include "wifi.h"
>  #include "pci.h"
> Index: wireless-testing-new/drivers/net/wireless/rtlwifi/ps.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/ps.c
> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/ps.c
> @@ -27,6 +27,8 @@
>   *
>   *****************************************************************************/
>  
> +#include <linux/export.h>
> +
>  #include "wifi.h"
>  #include "base.h"
>  #include "ps.h"
> Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
> @@ -27,6 +27,8 @@
>   *
>   *****************************************************************************/
>  
> +#include <linux/export.h>
> +
>  #include "dm_common.h"
>  #include "phy_common.h"
>  #include "../pci.h"
> Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
> @@ -30,6 +30,8 @@
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>  
>  #include <linux/firmware.h>
> +#include <linux/export.h>
> +
>  #include "../wifi.h"
>  #include "../pci.h"
>  #include "../base.h"
> Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c
> @@ -27,6 +27,8 @@
>   *
>   *****************************************************************************/
>  
> +#include <linux/export.h>
> +
>  #include "../wifi.h"
>  #include "../rtl8192ce/reg.h"
>  #include "../rtl8192ce/def.h"
> Index: wireless-testing-new/drivers/net/wireless/rtlwifi/usb.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/usb.c
> +++ wireless-testing-new/drivers/net/wireless/rtlwifi/usb.c
> @@ -28,6 +28,8 @@
>  #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>  
>  #include <linux/usb.h>
> +#include <linux/export.h>
> +
>  #include "core.h"
>  #include "wifi.h"
>  #include "usb.h"

^ permalink raw reply

* Re: ath9k: irq storm after suspend/resume
From: Clemens Buchacher @ 2011-09-27 21:42 UTC (permalink / raw)
  To: Mohammed Shafi; +Cc: linux-wireless, beta992
In-Reply-To: <CAD2nsn1+WVaLR_TR37Z6YRCFnQH1hJkSOri=nxc8Ff3pa9N8dw@mail.gmail.com>

Hello Mohammed,

On Mon, Sep 26, 2011 at 02:54:18PM +0530, Mohammed Shafi wrote:
> 
> is the issue still seen? any improvement with the attached patch..

I still have the issue. No change with current wl-testing plus your
patch.

Below dmesg output of:

 modprobe ath9k debug=0x0000fffb
 echo mem >/sys/power/state
 # resume

Clemens

---
[   27.575562] ath9k 0000:02:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
[   27.577970] ath9k 0000:02:00.0: setting latency timer to 64
[   27.581405] ath: UNDEFINED -> AWAKE
[   27.581469] ath: serialize_regmode is 0
[   27.626195] ath: Eeprom VER: 14, REV: 13
[   27.626199] ath: Initialize ANI
[   27.626203] ath: Enable MIB counters
[   27.626240] ath: Setup TX queue: 9
[   27.626243] ath: Set queue properties for: 9
[   27.626248] ath: Setup TX queue: 8
[   27.626251] ath: Set queue properties for: 8
[   27.626255] ath: Set queue properties for: 8
[   27.626259] ath: Reset TX queue: 8
[   27.626286] ath: tx ok 0x0 err 0x0 desc 0x100 eol 0x100 urn 0x0
[   27.626290] ath: Setup TX queue: 0
[   27.626293] ath: Set queue properties for: 0
[   27.626297] ath: Setup TX queue: 1
[   27.626300] ath: Set queue properties for: 1
[   27.626304] ath: Setup TX queue: 2
[   27.626307] ath: Set queue properties for: 2
[   27.626310] ath: Setup TX queue: 3
[   27.626313] ath: Set queue properties for: 3
[   27.627816] ath: TX streams 1, RX streams: 1
[   27.627819] ath: EEPROM regdomain: 0x60
[   27.627822] ath: EEPROM indicates we should expect a direct regpair map
[   27.627828] ath: Country alpha2 being used: 00
[   27.627830] ath: Regpair used: 0x60
[   27.627838] ath: tx DMA: 512 buffers 1 desc/buf
[   27.627857] ath: tx DMA map: ffff88006f250000 (54600) -> 6f250000 (54600)
[   27.627891] ath: beacon DMA: 4 buffers 1 desc/buf
[   27.627897] ath: beacon DMA map: ffff88007198d000 (416) -> 7198d000 (416)
[   27.627902] ath: cachelsz 64 rxbufsize 1926
[   27.627906] ath: rx DMA: 512 buffers 1 desc/buf
[   27.627924] ath: rx DMA map: ffff88006f2b0000 (54600) -> 6f2b0000 (54600)
[   27.629650] ieee80211 phy1: Selected rate control algorithm 'ath9k_rate_control'
[   27.630460] Registered led device: ath9k-phy1
[   27.630475] ieee80211 phy1: Atheros AR9285 Rev:2 mem=0xffffc90021ba0000, irq=17
[   43.855411] PM: Syncing filesystems ... done.
[   43.948410] PM: Preparing system for mem sleep
[   43.949937] Freezing user space processes ... (elapsed 0.01 seconds) done.
[   43.963254] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
[   43.976527] PM: Entering mem sleep
[   43.976595] Suspending console(s) (use no_console_suspend to debug)
[   43.977193] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[   43.989161] jmb38x_ms 0000:06:00.3: PCI INT B disabled
[   43.989194] sdhci-pci 0000:06:00.0: PCI INT B disabled
[   43.989232] ath: AWAKE -> FULL-SLEEP
[   43.998370] sd 0:0:0:0: [sda] Stopping disk
[   44.196369] snd_hda_intel 0000:00:1b.0: PCI INT A disabled
[   44.608701] PM: suspend of devices complete after 633.019 msecs
[   44.609142] jme 0000:06:00.5: PME# enabled
[   44.609152] jme 0000:06:00.5: wake-up capability enabled by ACPI
[   44.648588] PM: late suspend of devices complete after 39.960 msecs
[   44.648748] ACPI: Preparing to enter system sleep state S3
[   44.951903] PM: Saving platform NVS memory
[   44.952780] Disabling non-boot CPUs ...
[   44.955081] CPU 1 is now offline
[   45.057696] CPU 2 is now offline
[   45.160822] CPU 3 is now offline
[   45.161227] Extended CMOS year: 2000
[   45.161461] ACPI: Low-level resume complete
[   45.161521] PM: Restoring platform NVS memory
[   45.161951] Extended CMOS year: 2000
[   45.161974] Enabling non-boot CPUs ...
[   45.162070] Booting Node 0 Processor 1 APIC 0x4
[   45.162071] smpboot cpu 1: start_ip = 96000
[   45.173166] Calibrating delay loop (skipped) already calibrated this CPU
[   45.193433] NMI watchdog enabled, takes one hw-pmu counter.
[   45.193554] CPU1 is up
[   45.193622] Booting Node 0 Processor 2 APIC 0x1
[   45.193623] smpboot cpu 2: start_ip = 96000
[   45.194742] Switched to NOHz mode on CPU #1
[   45.204719] Calibrating delay loop (skipped) already calibrated this CPU
[   45.225042] NMI watchdog enabled, takes one hw-pmu counter.
[   45.225176] CPU2 is up
[   45.225257] Booting Node 0 Processor 3 APIC 0x5
[   45.225259] smpboot cpu 3: start_ip = 96000
[   45.228010] Switched to NOHz mode on CPU #2
[   45.236352] Calibrating delay loop (skipped) already calibrated this CPU
[   45.256763] NMI watchdog enabled, takes one hw-pmu counter.
[   45.256925] CPU3 is up
[   45.258831] Switched to NOHz mode on CPU #3
[   45.259072] ACPI: Waking up from system sleep state S3
[   45.580717] intel ips 0000:00:1f.6: MCP limit exceeded: Avg temp 20253, limit 9000
[   45.658244] i915 0000:00:02.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
[   45.658253] i915 0000:00:02.0: restoring config space at offset 0x1 (was 0x900007, writing 0x900407)
[   45.658277] mei 0000:00:16.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
[   45.658296] mei 0000:00:16.0: restoring config space at offset 0x4 (was 0x4, writing 0xd540a004)
[   45.658304] mei 0000:00:16.0: restoring config space at offset 0x1 (was 0x180000, writing 0x180006)
[   45.658332] pci 0000:00:1a.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
[   45.658350] pci 0000:00:1a.0: restoring config space at offset 0x4 (was 0x0, writing 0xd5408000)
[   45.658358] pci 0000:00:1a.0: restoring config space at offset 0x1 (was 0x2900000, writing 0x2900006)
[   45.658391] snd_hda_intel 0000:00:1b.0: restoring config space at offset 0xf (was 0x100, writing 0x105)
[   45.658410] snd_hda_intel 0000:00:1b.0: restoring config space at offset 0x4 (was 0x4, writing 0xd5400004)
[   45.658415] snd_hda_intel 0000:00:1b.0: restoring config space at offset 0x3 (was 0x0, writing 0x10)
[   45.658421] snd_hda_intel 0000:00:1b.0: restoring config space at offset 0x1 (was 0x100004, writing 0x100002)
[   45.658455] pcieport 0000:00:1c.0: restoring config space at offset 0xf (was 0x100, writing 0x10010b)
[   45.658467] pcieport 0000:00:1c.0: restoring config space at offset 0x9 (was 0x1fff1, writing 0x7c717c61)
[   45.658479] pcieport 0000:00:1c.0: restoring config space at offset 0x3 (was 0x810000, writing 0x810010)
[   45.658485] pcieport 0000:00:1c.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100407)
[   45.658538] pcieport 0000:00:1c.1: restoring config space at offset 0xf (was 0x200, writing 0x100203)
[   45.658550] pcieport 0000:00:1c.1: restoring config space at offset 0x9 (was 0x1fff1, writing 0x7c517c41)
[   45.658561] pcieport 0000:00:1c.1: restoring config space at offset 0x3 (was 0x810000, writing 0x810010)
[   45.658568] pcieport 0000:00:1c.1: restoring config space at offset 0x1 (was 0x100000, writing 0x100407)
[   45.658620] pcieport 0000:00:1c.2: restoring config space at offset 0xf (was 0x300, writing 0x100304)
[   45.658632] pcieport 0000:00:1c.2: restoring config space at offset 0x9 (was 0x1fff1, writing 0x7c317c21)
[   45.658643] pcieport 0000:00:1c.2: restoring config space at offset 0x3 (was 0x810000, writing 0x810010)
[   45.658650] pcieport 0000:00:1c.2: restoring config space at offset 0x1 (was 0x100000, writing 0x100407)
[   45.658703] pcieport 0000:00:1c.5: restoring config space at offset 0xf (was 0x200, writing 0x100203)
[   45.658714] pcieport 0000:00:1c.5: restoring config space at offset 0x9 (was 0x1fff1, writing 0x7c117c01)
[   45.658726] pcieport 0000:00:1c.5: restoring config space at offset 0x3 (was 0x810000, writing 0x810010)
[   45.658732] pcieport 0000:00:1c.5: restoring config space at offset 0x1 (was 0x100000, writing 0x100407)
[   45.658780] pci 0000:00:1d.0: restoring config space at offset 0xf (was 0x100, writing 0x10a)
[   45.658799] pci 0000:00:1d.0: restoring config space at offset 0x4 (was 0x0, writing 0xd5407000)
[   45.658807] pci 0000:00:1d.0: restoring config space at offset 0x1 (was 0x2900000, writing 0x2900006)
[   45.658831] pci 0000:00:1e.0: restoring config space at offset 0xf (was 0x0, writing 0x100000)
[   45.658930] ahci 0000:00:1f.2: restoring config space at offset 0x1 (was 0x2b00007, writing 0x2b00407)
[   45.659017] intel ips 0000:00:1f.6: restoring config space at offset 0x1 (was 0x100400, writing 0x100406)
[   45.659057] ath9k 0000:02:00.0: restoring config space at offset 0xf (was 0x1ff, writing 0x103)
[   45.659077] ath9k 0000:02:00.0: restoring config space at offset 0x4 (was 0x4, writing 0xd2c00004)
[   45.659082] ath9k 0000:02:00.0: restoring config space at offset 0x3 (was 0x0, writing 0x10)
[   45.659088] ath9k 0000:02:00.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
[   45.659129] sdhci-pci 0000:06:00.0: restoring config space at offset 0xf (was 0x2ff, writing 0x204)
[   45.659157] sdhci-pci 0000:06:00.0: restoring config space at offset 0x4 (was 0x0, writing 0xd0407000)
[   45.659163] sdhci-pci 0000:06:00.0: restoring config space at offset 0x3 (was 0x800000, writing 0x800010)
[   45.659172] sdhci-pci 0000:06:00.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
[   45.659218] pci 0000:06:00.2: restoring config space at offset 0xf (was 0x2ff, writing 0x204)
[   45.659246] pci 0000:06:00.2: restoring config space at offset 0x4 (was 0x0, writing 0xd0406000)
[   45.659253] pci 0000:06:00.2: restoring config space at offset 0x3 (was 0x800000, writing 0x800010)
[   45.659262] pci 0000:06:00.2: restoring config space at offset 0x1 (was 0x100000, writing 0x100003)
[   45.659308] jmb38x_ms 0000:06:00.3: restoring config space at offset 0xf (was 0x2ff, writing 0x204)
[   45.659336] jmb38x_ms 0000:06:00.3: restoring config space at offset 0x4 (was 0x0, writing 0xd0405000)
[   45.659342] jmb38x_ms 0000:06:00.3: restoring config space at offset 0x3 (was 0x800000, writing 0x800010)
[   45.659351] jmb38x_ms 0000:06:00.3: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
[   45.659397] pci 0000:06:00.4: restoring config space at offset 0xf (was 0x2ff, writing 0x204)
[   45.659425] pci 0000:06:00.4: restoring config space at offset 0x4 (was 0x0, writing 0xd0404000)
[   45.659431] pci 0000:06:00.4: restoring config space at offset 0x3 (was 0x800000, writing 0x800010)
[   45.659441] pci 0000:06:00.4: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
[   45.659487] jme 0000:06:00.5: restoring config space at offset 0xf (was 0x100, writing 0x103)
[   45.659508] jme 0000:06:00.5: restoring config space at offset 0x7 (was 0x1, writing 0xa001)
[   45.659520] jme 0000:06:00.5: restoring config space at offset 0x4 (was 0x0, writing 0xd0400000)
[   45.659526] jme 0000:06:00.5: restoring config space at offset 0x3 (was 0x800000, writing 0x800010)
[   45.659535] jme 0000:06:00.5: restoring config space at offset 0x1 (was 0x100000, writing 0x100007)
[   45.659759] PM: early resume of devices complete after 1.603 msecs
[   45.659979] i915 0000:00:02.0: setting latency timer to 64
[   45.659996] snd_hda_intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
[   45.660003] snd_hda_intel 0000:00:1b.0: setting latency timer to 64
[   45.660050] snd_hda_intel 0000:00:1b.0: irq 45 for MSI/MSI-X
[   45.660126] pci 0000:00:1e.0: setting latency timer to 64
[   45.660144] ahci 0000:00:1f.2: setting latency timer to 64
[   45.660211] ath: FULL-SLEEP -> AWAKE
[   45.663932] sdhci-pci 0000:06:00.0: PCI INT B -> GSI 18 (level, low) -> IRQ 18
[   45.663974] sdhci-pci 0000:06:00.0: setting latency timer to 64
[   45.664037] jmb38x_ms 0000:06:00.3: PCI INT B -> GSI 18 (level, low) -> IRQ 18
[   45.664051] jmb38x_ms 0000:06:00.3: setting latency timer to 64
[   45.664113] jme 0000:06:00.5: wake-up capability disabled by ACPI
[   45.664124] jme 0000:06:00.5: PME# disabled
[   45.664503] ath: disable IER
[   45.664521] ath: Disable MIB counters
[   45.664560] ath: disable IER
[   45.664575] ath: 0x30 => 0x30
[   45.664576] ath: new IMR 0x30
[   45.664672] sd 0:0:0:0: [sda] Starting disk
[   45.667161] ath: Getting spur idx:0 is2Ghz:1 val:8000
[   45.668810] ath: Reset TX queue: 0
[   45.668813] ath: tx ok 0x0 err 0x0 desc 0x101 eol 0x101 urn 0x0
[   45.668815] ath: Reset TX queue: 1
[   45.668817] ath: tx ok 0x0 err 0x0 desc 0x103 eol 0x103 urn 0x0
[   45.668819] ath: Reset TX queue: 2
[   45.668821] ath: tx ok 0x0 err 0x0 desc 0x107 eol 0x107 urn 0x0
[   45.668823] ath: Reset TX queue: 3
[   45.668825] ath: tx ok 0x0 err 0x0 desc 0x10f eol 0x10f urn 0x0
[   45.668827] ath: Reset TXQ, inactive queue: 4
[   45.668828] ath: Reset TXQ, inactive queue: 5
[   45.668830] ath: Reset TXQ, inactive queue: 6
[   45.668831] ath: Reset TXQ, inactive queue: 7
[   45.668832] ath: Reset TX queue: 8
[   45.668842] ath: tx ok 0x0 err 0x0 desc 0x10f eol 0x10f urn 0x0
[   45.668844] ath: Reset TX queue: 9
[   45.668854] ath: tx ok 0x0 err 0x0 desc 0x10f eol 0x10f urn 0x0
[   45.668861] ath: ah->misc_mode 0x4
[   45.670264] ath: Running PA Calibration
[   45.670963] ath: enabling ADC Gain Calibration.
[   45.670964] ath: enabling ADC DC Calibration.
[   45.670965] ath: enabling IQ Calibration.
[   45.670969] ath: starting ADC Gain Calibration
[   45.671139] ath: AWAKE -> FULL-SLEEP
[   45.679552] Extended CMOS year: 2000
[   45.983193] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[   45.985133] ata2.00: ACPI cmd ef/10:06:00:00:00:a0 (SET FEATURES) succeeded
[   45.985136] ata2.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
[   45.988885] ata2.00: ACPI cmd ef/10:06:00:00:00:a0 (SET FEATURES) succeeded
[   45.988889] ata2.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
[   45.989852] ata6: SATA link down (SStatus 0 SControl 300)
[   45.990375] ata2.00: configured for UDMA/100
[   46.120272] irq 17: nobody cared (try booting with the "irqpoll" option)
[   46.120275] Pid: 0, comm: swapper Tainted: G         C  3.1.0-rc7-wl-ARCH3.1.0-rc7-ath9k-debug #2
[   46.120277] Call Trace:
[   46.120280]  <IRQ>  [<ffffffff810c68bd>] __report_bad_irq+0x3d/0xe0
[   46.120290]  [<ffffffff810c6cfd>] note_interrupt+0x14d/0x210
[   46.120293]  [<ffffffff810c4c39>] handle_irq_event_percpu+0xc9/0x2a0
[   46.120296]  [<ffffffff810c4e58>] handle_irq_event+0x48/0x70
[   46.120299]  [<ffffffff810c763a>] handle_fasteoi_irq+0x5a/0xe0
[   46.120303]  [<ffffffff81016982>] handle_irq+0x22/0x40
[   46.120308]  [<ffffffff813ec09a>] do_IRQ+0x5a/0xe0
[   46.120312]  [<ffffffff813e8cee>] common_interrupt+0x6e/0x6e
[   46.120313]  <EOI>  [<ffffffff8131234a>] ? poll_idle+0x3a/0x80
[   46.120319]  [<ffffffff81312323>] ? poll_idle+0x13/0x80
[   46.120321]  [<ffffffff813126f6>] cpuidle_idle_call+0xc6/0x350
[   46.120324]  [<ffffffff81013229>] cpu_idle+0xc9/0x120
[   46.120328]  [<ffffffff813c64e7>] rest_init+0x9b/0xa4
[   46.120330]  [<ffffffff8174dc15>] start_kernel+0x3bf/0x3cc
[   46.120333]  [<ffffffff8174d347>] x86_64_start_reservations+0x132/0x136
[   46.120336]  [<ffffffff8174d140>] ? early_idt_handlers+0x140/0x140
[   46.120338]  [<ffffffff8174d44d>] x86_64_start_kernel+0x102/0x111
[   46.120340] handlers:
[   46.120344] [<ffffffffa053c020>] ath_isr
[   46.120345] Disabling IRQ #17
[   48.371839] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[   48.479286] ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[   48.479457] ata1.00: ACPI cmd ef/10:06:00:00:00:a0 (SET FEATURES) succeeded
[   48.479463] ata1.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
[   48.516626] ata1.00: ACPI cmd f5/00:00:00:00:00:a0 (SECURITY FREEZE LOCK) filtered out
[   48.516804] ata1.00: ACPI cmd ef/10:06:00:00:00:a0 (SET FEATURES) succeeded
[   48.516809] ata1.00: ACPI cmd ef/10:03:00:00:00:a0 (SET FEATURES) filtered out
[   48.518731] ata1.00: configured for UDMA/133
[   48.526624] ath: FULL-SLEEP -> AWAKE
[   48.530116] ath: ah->misc_mode 0x4
[   48.530142] ath: AWAKE -> FULL-SLEEP
[   48.530172] PM: resume of devices complete after 2875.994 msecs
[   48.530607] PM: Finishing wakeup.
[   48.530608] Restarting tasks ... done.
[   48.533504] video LNXVIDEO:02: Restoring backlight state

^ permalink raw reply

* Re: 答复: 答复: 答复: RTL8192SE and 802.11n problem
From: Stefan Zwanenburg @ 2011-09-27 22:25 UTC (permalink / raw)
  To: Larry Finger; +Cc: 'Chaoming_Li', linux-wireless
In-Reply-To: <4E823976.2090407@lwfinger.net>

On 09/27/2011 11:00 PM, Larry Finger wrote:
> I have to go now, but if no one describes what we are seeing, I'll
> review the 802.11n specs and get back to you tomorrow.
>
> Larry
I've taken a quick peek at the specs, and I'm afraid I can't be of any
help there (I found out — again — I have great respect for you guys for
reading those documents!). However, something just dawned on me, and I'm
not sure if it is at all relevant here, but somehow, my NIC seems to be
getting all kinds of different MAC addresses assigned (apparently
randomly). I just checked my "persistent net" udev rules file (mind you,
this file is automatically amended whenever a new NIC appears on my
system), and there are 26(!) different rules for just my wireless
interface, all with different MAC addresses.
As you may have noticed from my dump of the association process, the MAC
address in use is one with a vendor ID for some "Azurewave" interface.
There are quite a few in the rules file for Realtek interfaces, but the
one I mostly get is for an Azurewave vendor ID.

I just tried setting a different MAC address (using ifconfig wlan0 hw
ether 00:e0:4c:81:82:58) however it didn't change anything about my no
802.11n link situation (as I expected). So perhaps this little tidbit
should be ignored for now.

I just thought I'd let you know, in case this isn't a known problem.

Regards,
Stefan Zwanenburg

^ permalink raw reply

* Re: [PATCH 4/5] nl80211/mac80211: allow adding TDLS peers as stations
From: Arik Nemtsov @ 2011-09-27 21:24 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Kalyan C Gaddam
In-Reply-To: <1317124553.4082.26.camel@jlt3.sipsolutions.net>

On Tue, Sep 27, 2011 at 14:55, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Mon, 2011-09-26 at 13:54 +0300, Arik Nemtsov wrote:
>
>> @@ -811,6 +817,11 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
>>
>>       sta_apply_parameters(local, sta, params);
>>
>> +     if (!(wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS) &&
>> +         (sta->flags & WLAN_STA_TDLS_PEER)) {
>> +             return -ENOTSUPP;
>> +     }
>
> I think this should maybe also make sure that the interface is in
> station mode? Otherwise it could get somewhat confusing. Also changes to
> the TDLS flag probably shouldn't be allowed.

Sure. I'll add some more guards.

>
> And this code might also be better in cfg80211, although this is only
> with external management, right?

There's a similar check in cfg80211 code, in nl80211_new_station().

>
>> --- a/net/wireless/nl80211.c
>> +++ b/net/wireless/nl80211.c
>> @@ -2521,18 +2521,18 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
>> -             if (params.sta_flags_mask & ~BIT(NL80211_STA_FLAG_AUTHORIZED))
>> +             if (params.sta_flags_mask &
>> +                             ~(BIT(NL80211_STA_FLAG_AUTHORIZED) |
>> +                               BIT(NL80211_STA_FLAG_TDLS_PEER)))
>
> Why is the TDLS flag allowed to change?

I'll add some more TDLS specific guards in set_station as well.

>
>
>> +     /*
>> +      * Managed stations can only add TDLS peers, and only when the
>> +      * wiphy supports it.
>> +      */
>> +     if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_STATION &&
>> +         (!(params.sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER)) ||
>> +          !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_TDLS)))
>>               return -EINVAL;
>
> If the device does full TDLS by itself I don't think we should be
> allowed to add/remove stations?

Fair point. I'll add a EXTERNAL_SETUP check here.

>
> Maybe you need to describe the command sequences a little bit somewhere.
> I'm getting a bad feeling about adding stations without supported rates,
> and this is only when we have external management etc.
>
> Part of your argument for having the frame sending etc. in the kernel
> was that then it's more like managed mode, but all the manual station
> handling is very much unlike that.
>
> I'm beginning to think that maybe it should be handled through the TDLS
> operations instead, more implicitly?
>

As discussed on IRC, the added station is convenient for implementing
the TDLS Tx-lock during link setup. Stations are (almost)
automatically purged when disassociating, thereby clearing TDLS state.
It's also already part of the mac80211 Tx path, so no need to add
other elements.

Adding a station with no supported rates is a bit strange, but it is
clearly flagged as a TDLS peer sta and checks are in place in the Tx
path to prevent abuse.

Arik

^ permalink raw reply

* pull request: wireless 2011-09-27
From: John W. Linville @ 2011-09-27 21:00 UTC (permalink / raw)
  To: davem; +Cc: linux-wireless, netdev, linux-kernel

Dave,

Here is another last (?) batch of fixes intended for 3.1.  Included is a
scanning-related regression fix that avoids a potential crash, a buffer
overflow fix in cfg80211, an fix for an uninitialized variable in
rtlwifi, a fix for a DMA-related WARNING in ath9k, a fix for a DMA hang
in ath9k, and two iwlegacy fixes backported from prior iwlagn fixes, one
for avoiding interruptible waits and another for avoiding a command
queue timeout.

Please let me know if there are problems!

Thanks,

John

---

The following changes since commit d93dc5c4478c1fd5de85a3e8aece9aad7bbae044:

  Linux 3.1-rc7 (2011-09-21 16:58:15 -0700)

are available in the git repository at:
  git://git.infradead.org/users/linville/wireless.git for-davem

Johannes Berg (1):
      iwlagn: fix dangling scan request

John W. Linville (1):
      Merge branch 'master' of git://git.infradead.org/users/linville/wireless into for-davem

Jouni Malinen (1):
      cfg80211: Fix validation of AKM suites

Larry Finger (1):
      rtlwifi: rtl8192cu: Fix unitialized struct

Mohammed Shafi Shajakhan (1):
      ath9k: Fix a dma warning/memory leak

Rajkumar Manoharan (1):
      ath9k_hw: Fix Rx DMA stuck for AR9003 chips

Stanislaw Gruszka (2):
      iwlegacy: fix command queue timeout
      iwlegacy: do not use interruptible waits

 .../net/wireless/ath/ath9k/ar9003_2p2_initvals.h   |    2 +-
 drivers/net/wireless/ath/ath9k/recv.c              |   10 ++++++-
 drivers/net/wireless/iwlegacy/iwl-core.c           |    4 +-
 drivers/net/wireless/iwlegacy/iwl-hcmd.c           |    2 +-
 drivers/net/wireless/iwlegacy/iwl-tx.c             |    4 ++-
 drivers/net/wireless/iwlegacy/iwl3945-base.c       |    8 ++--
 drivers/net/wireless/iwlegacy/iwl4965-base.c       |   10 +++---
 drivers/net/wireless/iwlwifi/iwl-scan.c            |   30 ++++++++++---------
 drivers/net/wireless/rtlwifi/usb.c                 |    1 +
 net/wireless/nl80211.c                             |    5 ++-
 10 files changed, 46 insertions(+), 30 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
index 2339728..3e69c63 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
@@ -1514,7 +1514,7 @@ static const u32 ar9300_2p2_mac_core[][2] = {
 	{0x00008258, 0x00000000},
 	{0x0000825c, 0x40000000},
 	{0x00008260, 0x00080922},
-	{0x00008264, 0x9bc00010},
+	{0x00008264, 0x9d400010},
 	{0x00008268, 0xffffffff},
 	{0x0000826c, 0x0000ffff},
 	{0x00008270, 0x00000000},
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 9a48501..4c21f8c 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -205,14 +205,22 @@ static void ath_rx_remove_buffer(struct ath_softc *sc,
 
 static void ath_rx_edma_cleanup(struct ath_softc *sc)
 {
+	struct ath_hw *ah = sc->sc_ah;
+	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath_buf *bf;
 
 	ath_rx_remove_buffer(sc, ATH9K_RX_QUEUE_LP);
 	ath_rx_remove_buffer(sc, ATH9K_RX_QUEUE_HP);
 
 	list_for_each_entry(bf, &sc->rx.rxbuf, list) {
-		if (bf->bf_mpdu)
+		if (bf->bf_mpdu) {
+			dma_unmap_single(sc->dev, bf->bf_buf_addr,
+					common->rx_bufsize,
+					DMA_BIDIRECTIONAL);
 			dev_kfree_skb_any(bf->bf_mpdu);
+			bf->bf_buf_addr = 0;
+			bf->bf_mpdu = NULL;
+		}
 	}
 
 	INIT_LIST_HEAD(&sc->rx.rxbuf);
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c
index 35cd253..e5971fe 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.c
+++ b/drivers/net/wireless/iwlegacy/iwl-core.c
@@ -937,7 +937,7 @@ void iwl_legacy_irq_handle_error(struct iwl_priv *priv)
 					&priv->contexts[IWL_RXON_CTX_BSS]);
 #endif
 
-	wake_up_interruptible(&priv->wait_command_queue);
+	wake_up(&priv->wait_command_queue);
 
 	/* Keep the restart process from trying to send host
 	 * commands by clearing the INIT status bit */
@@ -1746,7 +1746,7 @@ int iwl_legacy_force_reset(struct iwl_priv *priv, bool external)
 
 	/* Set the FW error flag -- cleared on iwl_down */
 	set_bit(STATUS_FW_ERROR, &priv->status);
-	wake_up_interruptible(&priv->wait_command_queue);
+	wake_up(&priv->wait_command_queue);
 	/*
 	 * Keep the restart process from trying to send host
 	 * commands by clearing the INIT status bit
diff --git a/drivers/net/wireless/iwlegacy/iwl-hcmd.c b/drivers/net/wireless/iwlegacy/iwl-hcmd.c
index 62b4b09..ce1fc9f 100644
--- a/drivers/net/wireless/iwlegacy/iwl-hcmd.c
+++ b/drivers/net/wireless/iwlegacy/iwl-hcmd.c
@@ -167,7 +167,7 @@ int iwl_legacy_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 		goto out;
 	}
 
-	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
+	ret = wait_event_timeout(priv->wait_command_queue,
 			!test_bit(STATUS_HCMD_ACTIVE, &priv->status),
 			HOST_COMPLETE_TIMEOUT);
 	if (!ret) {
diff --git a/drivers/net/wireless/iwlegacy/iwl-tx.c b/drivers/net/wireless/iwlegacy/iwl-tx.c
index 4fff995..ef9e268 100644
--- a/drivers/net/wireless/iwlegacy/iwl-tx.c
+++ b/drivers/net/wireless/iwlegacy/iwl-tx.c
@@ -625,6 +625,8 @@ iwl_legacy_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
 	cmd = txq->cmd[cmd_index];
 	meta = &txq->meta[cmd_index];
 
+	txq->time_stamp = jiffies;
+
 	pci_unmap_single(priv->pci_dev,
 			 dma_unmap_addr(meta, mapping),
 			 dma_unmap_len(meta, len),
@@ -645,7 +647,7 @@ iwl_legacy_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
 		clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
 		IWL_DEBUG_INFO(priv, "Clearing HCMD_ACTIVE for command %s\n",
 			       iwl_legacy_get_cmd_string(cmd->hdr.cmd));
-		wake_up_interruptible(&priv->wait_command_queue);
+		wake_up(&priv->wait_command_queue);
 	}
 
 	/* Mark as unmapped */
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
index 795826a..66ee1562 100644
--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
@@ -841,7 +841,7 @@ static void iwl3945_rx_card_state_notif(struct iwl_priv *priv,
 		wiphy_rfkill_set_hw_state(priv->hw->wiphy,
 				test_bit(STATUS_RF_KILL_HW, &priv->status));
 	else
-		wake_up_interruptible(&priv->wait_command_queue);
+		wake_up(&priv->wait_command_queue);
 }
 
 /**
@@ -2269,7 +2269,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
 	iwl3945_reg_txpower_periodic(priv);
 
 	IWL_DEBUG_INFO(priv, "ALIVE processing complete.\n");
-	wake_up_interruptible(&priv->wait_command_queue);
+	wake_up(&priv->wait_command_queue);
 
 	return;
 
@@ -2300,7 +2300,7 @@ static void __iwl3945_down(struct iwl_priv *priv)
 	iwl_legacy_clear_driver_stations(priv);
 
 	/* Unblock any waiting calls */
-	wake_up_interruptible_all(&priv->wait_command_queue);
+	wake_up_all(&priv->wait_command_queue);
 
 	/* Wipe out the EXIT_PENDING status bit if we are not actually
 	 * exiting the module */
@@ -2853,7 +2853,7 @@ static int iwl3945_mac_start(struct ieee80211_hw *hw)
 
 	/* Wait for START_ALIVE from ucode. Otherwise callbacks from
 	 * mac80211 will not be run successfully. */
-	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
+	ret = wait_event_timeout(priv->wait_command_queue,
 			test_bit(STATUS_READY, &priv->status),
 			UCODE_READY_TIMEOUT);
 	if (!ret) {
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c
index 1433466..aa0c253 100644
--- a/drivers/net/wireless/iwlegacy/iwl4965-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c
@@ -576,7 +576,7 @@ static void iwl4965_rx_card_state_notif(struct iwl_priv *priv,
 		wiphy_rfkill_set_hw_state(priv->hw->wiphy,
 			test_bit(STATUS_RF_KILL_HW, &priv->status));
 	else
-		wake_up_interruptible(&priv->wait_command_queue);
+		wake_up(&priv->wait_command_queue);
 }
 
 /**
@@ -926,7 +926,7 @@ static void iwl4965_irq_tasklet(struct iwl_priv *priv)
 		handled |= CSR_INT_BIT_FH_TX;
 		/* Wake up uCode load routine, now that load is complete */
 		priv->ucode_write_complete = 1;
-		wake_up_interruptible(&priv->wait_command_queue);
+		wake_up(&priv->wait_command_queue);
 	}
 
 	if (inta & ~handled) {
@@ -1795,7 +1795,7 @@ static void iwl4965_alive_start(struct iwl_priv *priv)
 	iwl4965_rf_kill_ct_config(priv);
 
 	IWL_DEBUG_INFO(priv, "ALIVE processing complete.\n");
-	wake_up_interruptible(&priv->wait_command_queue);
+	wake_up(&priv->wait_command_queue);
 
 	iwl_legacy_power_update_mode(priv, true);
 	IWL_DEBUG_INFO(priv, "Updated power mode\n");
@@ -1828,7 +1828,7 @@ static void __iwl4965_down(struct iwl_priv *priv)
 	iwl_legacy_clear_driver_stations(priv);
 
 	/* Unblock any waiting calls */
-	wake_up_interruptible_all(&priv->wait_command_queue);
+	wake_up_all(&priv->wait_command_queue);
 
 	/* Wipe out the EXIT_PENDING status bit if we are not actually
 	 * exiting the module */
@@ -2266,7 +2266,7 @@ int iwl4965_mac_start(struct ieee80211_hw *hw)
 
 	/* Wait for START_ALIVE from Run Time ucode. Otherwise callbacks from
 	 * mac80211 will not be run successfully. */
-	ret = wait_event_interruptible_timeout(priv->wait_command_queue,
+	ret = wait_event_timeout(priv->wait_command_queue,
 			test_bit(STATUS_READY, &priv->status),
 			UCODE_READY_TIMEOUT);
 	if (!ret) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index dd6937e..77e528f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -405,31 +405,33 @@ int iwl_mac_hw_scan(struct ieee80211_hw *hw,
 
 	mutex_lock(&priv->mutex);
 
-	if (test_bit(STATUS_SCANNING, &priv->status) &&
-	    priv->scan_type != IWL_SCAN_NORMAL) {
-		IWL_DEBUG_SCAN(priv, "Scan already in progress.\n");
-		ret = -EAGAIN;
-		goto out_unlock;
-	}
-
-	/* mac80211 will only ask for one band at a time */
-	priv->scan_request = req;
-	priv->scan_vif = vif;
-
 	/*
 	 * If an internal scan is in progress, just set
 	 * up the scan_request as per above.
 	 */
 	if (priv->scan_type != IWL_SCAN_NORMAL) {
-		IWL_DEBUG_SCAN(priv, "SCAN request during internal scan\n");
+		IWL_DEBUG_SCAN(priv,
+			       "SCAN request during internal scan - defer\n");
+		priv->scan_request = req;
+		priv->scan_vif = vif;
 		ret = 0;
-	} else
+	} else {
+		priv->scan_request = req;
+		priv->scan_vif = vif;
+		/*
+		 * mac80211 will only ask for one band at a time
+		 * so using channels[0] here is ok
+		 */
 		ret = iwl_scan_initiate(priv, vif, IWL_SCAN_NORMAL,
 					req->channels[0]->band);
+		if (ret) {
+			priv->scan_request = NULL;
+			priv->scan_vif = NULL;
+		}
+	}
 
 	IWL_DEBUG_MAC80211(priv, "leave\n");
 
-out_unlock:
 	mutex_unlock(&priv->mutex);
 
 	return ret;
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 8b1cef0..4bf3cf4 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -863,6 +863,7 @@ static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw, struct sk_buff *skb,
 	u8 tid = 0;
 	u16 seq_number = 0;
 
+	memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc));
 	if (ieee80211_is_auth(fc)) {
 		RT_TRACE(rtlpriv, COMP_SEND, DBG_DMESG, ("MAC80211_LINKING\n"));
 		rtl_ips_nic_on(hw);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e83e7fe..ea40d54 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4113,9 +4113,12 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
 		if (len % sizeof(u32))
 			return -EINVAL;
 
+		if (settings->n_akm_suites > NL80211_MAX_NR_AKM_SUITES)
+			return -EINVAL;
+
 		memcpy(settings->akm_suites, data, len);
 
-		for (i = 0; i < settings->n_ciphers_pairwise; i++)
+		for (i = 0; i < settings->n_akm_suites; i++)
 			if (!nl80211_valid_akm_suite(settings->akm_suites[i]))
 				return -EINVAL;
 	}
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply related

* Re: [PATCH 3/5] mac80211: handle TDLS high-level commands and frames
From: Arik Nemtsov @ 2011-09-27 21:12 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Kalyan C Gaddam
In-Reply-To: <1317124207.4082.20.camel@jlt3.sipsolutions.net>

On Tue, Sep 27, 2011 at 14:50, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Mon, 2011-09-26 at 13:54 +0300, Arik Nemtsov wrote:
>
>> +/*
>> + * TDLS capabililites to be enabled in the 5th byte of the
>> + * @WLAN_EID_EXT_CAPABILITY information element
>> + */
>> +#define WLAN_EXT_CAPA_TDLS_ENABLED   BIT(5)
>> +#define WLAN_EXT_CAPA_TDLS_PROHIBITED        BIT(6)
>
> Would it be useful to have the IE declared as a struct somewhere?

It's really just a bit-mask, and a variable length one as it is. But
I'll change the name to make it more palatable. Something like
WLAN_EXT_CAPA5_TDLS_ENABLED :)

>
>
>> +static int
>> +ieee80211_prep_tdls_encap_data(struct wiphy *wiphy, struct net_device *dev,
>> +                            u8 *peer, u8 action_code, u8 dialog_token,
>> +                            u16 status_code, struct sk_buff *skb)
>
> All the code addition here makes me wonder if it'd be useful to move it
> into a new tdls.c file and just call the right hooks from cfg.c? the cfg
> file is pretty large already ... tdls wouldn't be huge, but still might
> make sense?

As discussed on IRC, this code is pretty much stateless, and it's not
a lot of code. We agreed we can keep it in cfg.c for now.

Arik

^ permalink raw reply

* Re: [PATCH v2 24/26] staging: brcm80211: declared global vars in softmac phy as const
From: Arend van Spriel @ 2011-09-27 21:10 UTC (permalink / raw)
  To: Larry Finger
  Cc: Franky (Zhenhui) Lin, gregkh@suse.de,
	devel@linuxdriverproject.org, linux-wireless@vger.kernel.org
In-Reply-To: <4E82175A.7020504@lwfinger.net>

On 09/27/2011 08:35 PM, Larry Finger wrote:
> On 09/27/2011 12:45 PM, Franky Lin wrote:
>> From: Roland Vossen<rvossen@broadcom.com>
>>
>> Global variables are undesirable unless they are read only.
>>
>> Reported-by: Johannes Berg<johannes@sipsolutions.net>
>> Reviewed-by: Pieter-Paul Giesberts<pieterpg@broadcom.com>
>> Reviewed-by: Arend van Spriel<arend@broadcom.com>
>> Signed-off-by: Franky Lin<frankyl@broadcom.com>
>> ---
>>    drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c   |   16 +-----
>>    drivers/staging/brcm80211/brcmsmac/phy/phy_int.h   |   23 --------
>>    drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c   |    6 +-
>>    drivers/staging/brcm80211/brcmsmac/phy/phy_n.c     |   60 ++++++++++----------
>>    .../staging/brcm80211/brcmsmac/phy/phytbl_lcn.c    |    2 +-
>>    5 files changed, 36 insertions(+), 71 deletions(-)
>>
>> diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
>> index f9702c0..5b81480 100644
>> --- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
>> +++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
>> @@ -52,7 +52,7 @@ struct chan_info_basic {
>>    	u16 freq;
>>    };
>>
>> -static struct chan_info_basic chan_info_all[] = {
>> +static const struct chan_info_basic chan_info_all[] = {
>>    	{1, 2412},
>>    	{2, 2417},
>>    	{3, 2422},
> What are you doing?  You make this change here in patch 24, then undo it in #25,
> and redo it in #26! Are you guys actually thinking about what you are doing?

We reordered the patches a little to move the ones we got feedback about 
at the end for rework. My bet is that you see rebase at work although I 
agree this is pretty tricky. I am glad the net result is that the const 
qualifier is added. There was some thinking involved in what we did 
today ;-)

> This needs to be fixed. In addition, the next time you submit this patch bomb,
> change from V2 to V3. That is the standard way to handle resubmissions that are
> addressing comments, not by increasing some extra counter in the 00/XX cover
> patch. The VX notation helps the maintainer keep track of the patches as he
> knows to drop all the V2 ones when V3 arrives. Maintainers are precious and must
> be treated very carefully.

And here we were thinking we would have learned all tricks about 
submitting patches in our staging year ;-)

So to be sure I have it right: Only the cover letter should say: [PATCH 
v2 00/20] with the same headline as the orignal. Or should each patch 
say [PATCH v2 xx/20] even when there are 26 patches?

> Larry

It would not have hurt if the cover letter of this series would indicate 
it replaces the previous series by refering to its message-id. Would 
that be an alternative approach or just a good addition.

Gr. AvS


^ permalink raw reply

* Re: [PATCH 2/5] mac80211: standardize adding supported rates IEs
From: Arik Nemtsov @ 2011-09-27 21:08 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Kalyan C Gaddam
In-Reply-To: <1317123991.4082.17.camel@jlt3.sipsolutions.net>

On Tue, Sep 27, 2011 at 14:46, Johannes Berg <johannes@sipsolutions.net> wrote:
>> +EXPORT_SYMBOL(ieee80211_add_srates_ie);
>
>> +EXPORT_SYMBOL(ieee80211_add_ext_srates_ie);
>
> You shouldn't export these.
>
>> \ No newline at end of file
>
> And it's a good idea to have "\n" be the last character of the file :)
>

Will do.

Arik

^ permalink raw reply

* Re: 答复: 答复: 答复: RTL8192SE and 802.11n problem
From: Larry Finger @ 2011-09-27 21:00 UTC (permalink / raw)
  To: Stefan Zwanenburg; +Cc: 'Chaoming_Li', linux-wireless
In-Reply-To: <4E820130.7080801@gmail.com>

On 09/27/2011 12:00 PM, Stefan Zwanenburg wrote:
> I've sent the below mail quite some time ago to Larry Finger and Chaoming Li,
> but am now unsure if it has actually arrived. Also, I thought maybe I'm not
> getting a response because of the fact I didn't CC the mailing list (which I
> didn't because of the attachment; I thought that would be frowned upon).
> Now, I don't want to come across as impatient, but it would mean a lot to me if
> the source of the problem were to be found.
>
> My sincerest apologies if attachments don't belong on the mailing list, and/or
> if this message is a duplicate!
>
> Stefan Zwanenburg
>
> -------- Original Message --------
> Subject: 	Re: 答复: 答复: 答复: RTL8192SE and 802.11n problem
> Date: 	Mon, 19 Sep 2011 23:06:23 +0200
> From: 	Stefan Zwanenburg <stefanhetzwaantje@gmail.com>
> To: 	李朝明 <chaoming_li@realsil.com.cn>
> CC: 	'Larry Finger' <Larry.Finger@lwfinger.net>
>
>
>
> On 09/19/2011 10:04 PM, Stefan Zwanenburg wrote:
>>  On 09/19/2011 06:41 AM, 李朝明 wrote:
>>>  Dear Sir:
>>>
>>>  	Yes, sniffer can help, Could you help to catch the authentication
>>>  and association packet and send it to me。
>>>
>>>  Best Regards,
>>>  lizhaoming
>>>
>>  Find below the output of wpa_supplicant with the -ddd switch. If that is
>>  not the information you required (ie: you need even rawer logging or
>>  somesuch), please tell me what I need to do, or where I might find the
>>  information to do what I need to do.
> So I got some help on how to sniff the association process. Please find
> attached a dump of said process.

Sorry to not answer earlier. I was busy and I also hoped that Chaoming would 
handle this part.

I did a dump of the authentication and association process with my RTL8191SE and 
my AP. For both systems, the authentication packets are identical, as are the 
association request and response. The capability flags are identical.

This is where the two sequences differ: My AP sends an action frame with

No.     Time        Source                Destination           Protocol Info
       9 0.010970    Netgear_be:2b:44      RealtekS_72:02:18     IEEE 802.11 
Action, SN=2120, FN=0, Flags=........

Frame 9: 33 bytes on wire (264 bits), 33 bytes captured (264 bits)
     Arrival Time: Sep 27, 2011 14:47:33.529328000 CDT
     Epoch Time: 1317152853.529328000 seconds
     [Time delta from previous captured frame: 0.004135000 seconds]
     [Time delta from previous displayed frame: 0.004135000 seconds]
     [Time since reference or first frame: 0.010970000 seconds]
     Frame Number: 9
     Frame Length: 33 bytes (264 bits)
     Capture Length: 33 bytes (264 bits)
     [Frame is marked: False]
     [Frame is ignored: False]
     [Protocols in frame: wlan]
IEEE 802.11 Action, Flags: ........
     Type/Subtype: Action (0x0d)
     Frame Control: 0x00D0 (Normal)
         Version: 0
         Type: Management frame (0)
         Subtype: 13
         Flags: 0x0
     Duration: 314
     Destination address: RealtekS_72:02:18 (00:e0:4c:72:02:18)
     Source address: Netgear_be:2b:44 (c0:3f:0e:be:2b:44)
     BSS Id: Netgear_be:2b:44 (c0:3f:0e:be:2b:44)
     Fragment number: 0
     Sequence number: 2120
IEEE 802.11 wireless LAN management frame
     Fixed parameters
         Action: 0x03
             Category code: Block Ack (3)
             Action code: Add Block Ack Request (0x00)
             Dialog token: 0xee
             Block Ack Parameters: 0x1002
                 .... .... .... ...0 = A-MSDUs: Not Permitted
                 .... .... .... ..1. = Block Ack Policy: Immediate Block Ack
                 ..00 00.. = Traffic Identifier: 0x00
                 0001 0000 00.. .... = Number of Buffers (1 Buffer = 2304 Bytes): 64
             Block Ack Timeout: 0x0000
             Block Ack Starting Sequence Control (SSC): 0x0000

Your AP does not send such a packet. My STA responds with an ACK and another 
action frame:

No.     Time        Source                Destination           Protocol Info
      11 0.025115    RealtekS_72:02:18     Netgear_be:2b:44      IEEE 802.11 
Action, SN=28, FN=0, Flags=........

Frame 11: 33 bytes on wire (264 bits), 33 bytes captured (264 bits)
     Arrival Time: Sep 27, 2011 14:47:33.543473000 CDT
     Epoch Time: 1317152853.543473000 seconds
     [Time delta from previous captured frame: 0.013897000 seconds]
     [Time delta from previous displayed frame: 0.013897000 seconds]
     [Time since reference or first frame: 0.025115000 seconds]
     Frame Number: 11
     Frame Length: 33 bytes (264 bits)
     Capture Length: 33 bytes (264 bits)
     [Frame is marked: False]
     [Frame is ignored: False]
     [Protocols in frame: wlan]
IEEE 802.11 Action, Flags: ........
     Type/Subtype: Action (0x0d)
     Frame Control: 0x00D0 (Normal)
         Version: 0
         Type: Management frame (0)
         Subtype: 13
         Flags: 0x0
     Duration: 0
     Destination address: Netgear_be:2b:44 (c0:3f:0e:be:2b:44)
     Source address: RealtekS_72:02:18 (00:e0:4c:72:02:18)
     BSS Id: Netgear_be:2b:44 (c0:3f:0e:be:2b:44)
     Fragment number: 0
     Sequence number: 28
IEEE 802.11 wireless LAN management frame
     Fixed parameters
         Action: 0x03
             Category code: Block Ack (3)
             Action code: Add Block Ack Response (0x01)
             Dialog token: 0xee
             Status code: Successful (0x0000)
             Block Ack Parameters: 0x1002
                 .... .... .... ...0 = A-MSDUs: Not Permitted
                 .... .... .... ..1. = Block Ack Policy: Immediate Block Ack
                 ..00 00.. = Traffic Identifier: 0x00
                 0001 0000 00.. .... = Number of Buffers (1 Buffer = 2304 Bytes): 64
             Block Ack Timeout: 0x0000

This packet is followed by a Block Ack in both directions and then the EAPOL 1/4 
is sent.

I'm not familiar enough to know the significance of these differences, but I'm 
guessing that they may be the source of your problem.

I have to go now, but if no one describes what we are seeing, I'll review the 
802.11n specs and get back to you tomorrow.

Larry



^ permalink raw reply

* Re: [RFC 04/15] mac80211: split PS buffers into ACs
From: Luis R. Rodriguez @ 2011-09-27 20:51 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <20110922154849.648785480@sipsolutions.net>

On Thu, Sep 22, 2011 at 8:47 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
>  void sta_info_recalc_tim(struct sta_info *sta)
>  {
>        struct ieee80211_local *local = sta->local;
>        struct ieee80211_if_ap *bss = sta->sdata->bss;
>        unsigned long flags;
> -       bool have_data;
> +       bool indicate_tim = false;
> +       u8 ignore_for_tim = sta->sta.uapsd_queues;
> +       int ac;
>
>        /* No need to do anything if the driver does all */
>        if (local->hw.flags & IEEE80211_HW_AP_LINK_PS)
>                return;
>
> -       have_data = test_sta_flags(sta, WLAN_STA_PS_DRIVER_BUF) ||
> -                   !skb_queue_empty(&sta->tx_filtered) ||
> -                   !skb_queue_empty(&sta->ps_tx_buf);
> +       /*
> +        * If all ACs are delivery-enabled then we should build
> +        * the TIM bit for all ACs anyway; if only some are then
> +        * we ignore those and build the TIM bit using only the
> +        * non-enabled ones.
> +        */

As per the documentation uapsd_queues is the "bitmap of queues
configured for uapsd". As I read this we are ignoring setting the TIM
for the STA if an AC queue was marked as uapsd-enabled but had
buffered frames for it, so we'd only set the TIM if we had at least
one AC queue that did not have uapsd enabled and had buffered frames
pending. Is that accurate?

  Luis

^ permalink raw reply

* [PATCH] ath6kl: silence "invalid rate" warning
From: Kalle Valo @ 2011-09-27 20:33 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

For some reason firmware is sending invalid rates when we try to
query current bitrate from ath6kl_get_station() and a warning is issued:

[ 3810.415720] ath6kl: invalid rate: 1935633515
[ 3811.105493] ath6kl: invalid rate: 1935633515
[ 3811.556063] ath6kl: invalid rate: 1935633515

As the warning happens way too often, convert the warning to a debug
message once we have a proper fix. But to make it easy to follow
how often the problem appears, add a debugfs to print
various statistics about workarounds and make this issue the first WAR.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath6kl/cfg80211.c |    4 ++
 drivers/net/wireless/ath/ath6kl/core.h     |    4 ++
 drivers/net/wireless/ath/ath6kl/debug.c    |   48 ++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath6kl/debug.h    |    9 +++++
 4 files changed, 64 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index c84f53d..8d9fbd4 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1365,7 +1365,9 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev,
 		sinfo->txrate.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH;
 		sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS;
 	} else {
-		ath6kl_warn("invalid rate: %d\n", rate);
+		ath6kl_dbg(ATH6KL_DBG_WLAN_CFG,
+			   "invalid rate from stats: %d\n", rate);
+		ath6kl_debug_war(ar, ATH6KL_WAR_INVALID_RATE);
 		return 0;
 	}
 
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index 9ecf22b..6d8a484 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -525,6 +525,10 @@ struct ath6kl {
 		unsigned int dbgfs_diag_reg;
 		u32 diag_reg_addr_wr;
 		u32 diag_reg_val_wr;
+
+		struct {
+			unsigned int invalid_rate;
+		} war_stats;
 	} debug;
 #endif /* CONFIG_ATH6KL_DEBUG */
 };
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index 4fc83cc..5237369 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -192,6 +192,51 @@ static int ath6kl_debugfs_open(struct inode *inode, struct file *file)
 	return 0;
 }
 
+void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war)
+{
+	switch (war) {
+	case ATH6KL_WAR_INVALID_RATE:
+		ar->debug.war_stats.invalid_rate++;
+		break;
+	}
+}
+
+static ssize_t read_file_war_stats(struct file *file, char __user *user_buf,
+				   size_t count, loff_t *ppos)
+{
+	struct ath6kl *ar = file->private_data;
+	char *buf;
+	unsigned int len = 0, buf_len = 1500;
+	ssize_t ret_cnt;
+
+	buf = kzalloc(buf_len, GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
+
+	len += scnprintf(buf + len, buf_len - len, "\n");
+	len += scnprintf(buf + len, buf_len - len, "%25s\n",
+			 "Workaround stats");
+	len += scnprintf(buf + len, buf_len - len, "%25s\n\n",
+			 "=================");
+	len += scnprintf(buf + len, buf_len - len, "%20s %10u\n",
+			 "Invalid rates", ar->debug.war_stats.invalid_rate);
+
+	if (WARN_ON(len > buf_len))
+		len = buf_len;
+
+	ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len);
+
+	kfree(buf);
+	return ret_cnt;
+}
+
+static const struct file_operations fops_war_stats = {
+	.read = read_file_war_stats,
+	.open = ath6kl_debugfs_open,
+	.owner = THIS_MODULE,
+	.llseek = default_llseek,
+};
+
 static void ath6kl_debug_fwlog_add(struct ath6kl *ar, const void *buf,
 				   size_t buf_len)
 {
@@ -873,6 +918,9 @@ int ath6kl_debug_init(struct ath6kl *ar)
 	debugfs_create_file("reg_write", S_IRUSR | S_IWUSR,
 			    ar->debugfs_phy, ar, &fops_diag_reg_write);
 
+	debugfs_create_file("war_stats", S_IRUSR, ar->debugfs_phy, ar,
+			    &fops_war_stats);
+
 	return 0;
 }
 
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 89bf8e1..91f4bc3 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -52,6 +52,10 @@ extern int ath6kl_printk(const char *level, const char *fmt, ...)
 
 #define AR_DBG_LVL_CHECK(mask)	(debug_mask & mask)
 
+enum ath6kl_war {
+	ATH6KL_WAR_INVALID_RATE,
+};
+
 #ifdef CONFIG_ATH6KL_DEBUG
 #define ath6kl_dbg(mask, fmt, ...)					\
 	({								\
@@ -79,6 +83,7 @@ void ath6kl_dump_registers(struct ath6kl_device *dev,
 			   struct ath6kl_irq_enable_reg *irq_en_reg);
 void dump_cred_dist_stats(struct htc_target *target);
 void ath6kl_debug_fwlog_event(struct ath6kl *ar, const void *buf, size_t len);
+void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war);
 int ath6kl_debug_init(struct ath6kl *ar);
 void ath6kl_debug_cleanup(struct ath6kl *ar);
 
@@ -110,6 +115,10 @@ static inline void ath6kl_debug_fwlog_event(struct ath6kl *ar,
 {
 }
 
+static inline void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war)
+{
+}
+
 static inline int ath6kl_debug_init(struct ath6kl *ar)
 {
 	return 0;


^ permalink raw reply related

* Re: [PATCHv2.1] wireless: at76c50x: use native hex_pack_byte() method
From: Pavel Roskin @ 2011-09-27 19:47 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: John W. Linville, linux-wireless
In-Reply-To: <3feae30d537a79c064495cc834f585192a1e636d.1317124866.git.andriy.shevchenko@linux.intel.com>

On Tue, 27 Sep 2011 15:01:49 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: "John W. Linville" <linville@tuxdriver.com>
> Cc: linux-wireless@vger.kernel.org
> Cc: netdev@vger.kernel.org
> ---
>  drivers/net/wireless/at76c50x-usb.c |   18 +++++++-----------
>  1 files changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/wireless/at76c50x-usb.c

...

> b/drivers/net/wireless/at76c50x-usb.c index 2986014..2dde5f6 100644
> -		*obuf++ = BIN2HEX(*ibuf >> 4);
> -		*obuf++ = BIN2HEX(*ibuf & 0xf);
> +		obuf = pack_hex_byte(obuf, *ibuf++);
>  		*obuf++ = '-';
> -		ibuf++;
>  	}
> -	*(--obuf) = '\0';
> +
> +	if (*obuf == '-')
> +		obuf--;

This will access uninitialized data and fail to strip the final "-" in
most cases.  The check for len being 0 was there for a reason.  Please
actually test your code.

NACK

By the way, I don't think it's necessary to copy linux-kernel and
netdev about a change affecting just a wireless driver.

-- 
Regards,
Pavel Roskin

^ permalink raw reply

* Compat-wireless release for 2011-09-27 is baked
From: Compat-wireless cronjob account @ 2011-09-27 19:05 UTC (permalink / raw)
  To: linux-wireless

>From git://github.com/sfrothwell/linux-next
 + a4edb65...6a98528 akpm-end   -> origin/akpm-end  (forced update)
   f9d81f6..858b181  akpm-start -> origin/akpm-start
 + 8164e8e...62c9781 master     -> origin/master  (forced update)
   f9d81f6..858b181  stable     -> origin/stable
 * [new tag]         next-20110927 -> next-20110927

compat-wireless code metrics

    812397 - Total upstream lines of code being pulled
      2397 - backport code changes
      2086 - backport code additions
       311 - backport code deletions
      8559 - backport from compat module
     10956 - total backport code
    1.3486 - % of code consists of backport work
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.7]

^ permalink raw reply

* [PATCH] cfg80211/mac80211: apply station uAPSD parameters selectively
From: Johannes Berg @ 2011-09-27 18:56 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Eliad Peller

From: Johannes Berg <johannes.berg@intel.com>

Currently, when hostapd sets the station as authorized
we also overwrite its uAPSD parameter. This obviously
leads to buggy behaviour (later, with my patches that
actually add uAPSD support). To fix this, only apply
those parameters if they were actually set in nl80211,
and to achieve that add a bitmap of things to apply.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
So it'd be possible to fix this much simpler by moving the code, but I'm
doing it like this for two reasons:

1) we might later want to implement TSPEC handling and allow them to
change
2) it adds the bitmap that others can build on in the future for other
parameters

 include/net/cfg80211.h |   12 ++++++++++++
 net/mac80211/cfg.c     |    6 ++++--
 net/wireless/nl80211.c |    2 ++
 3 files changed, 18 insertions(+), 2 deletions(-)

--- a/net/mac80211/cfg.c	2011-09-27 20:37:01.000000000 +0200
+++ b/net/mac80211/cfg.c	2011-09-27 20:37:55.000000000 +0200
@@ -714,8 +714,10 @@ static void sta_apply_parameters(struct
 	}
 	spin_unlock_irqrestore(&sta->flaglock, flags);
 
-	sta->sta.uapsd_queues = params->uapsd_queues;
-	sta->sta.max_sp = params->max_sp;
+	if (params->sta_modify_mask & STATION_PARAM_APPLY_UAPSD) {
+		sta->sta.uapsd_queues = params->uapsd_queues;
+		sta->sta.max_sp = params->max_sp;
+	}
 
 	/*
 	 * cfg80211 validates this (1-2007) and allows setting the AID
--- a/include/net/cfg80211.h	2011-09-27 20:37:00.000000000 +0200
+++ b/include/net/cfg80211.h	2011-09-27 20:37:55.000000000 +0200
@@ -424,6 +424,17 @@ enum plink_actions {
 };
 
 /**
+ * enum station_parameters_apply_mask - station parameter values to apply
+ * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
+ *
+ * Not all station parameters have in-band "no change" signalling,
+ * for those that don't these flags will are used.
+ */
+enum station_parameters_apply_mask {
+	STATION_PARAM_APPLY_UAPSD = BIT(0),
+};
+
+/**
  * struct station_parameters - station parameters
  *
  * Used to change and create a new station.
@@ -450,6 +461,7 @@ struct station_parameters {
 	u8 *supported_rates;
 	struct net_device *vlan;
 	u32 sta_flags_mask, sta_flags_set;
+	u32 sta_modify_mask;
 	int listen_interval;
 	u16 aid;
 	u8 supported_rates_len;
--- a/net/wireless/nl80211.c	2011-09-27 20:37:01.000000000 +0200
+++ b/net/wireless/nl80211.c	2011-09-27 20:37:55.000000000 +0200
@@ -2636,6 +2636,8 @@ static int nl80211_new_station(struct sk
 
 		if (params.max_sp & ~IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK)
 			return -EINVAL;
+
+		params.sta_modify_mask |= STATION_PARAM_APPLY_UAPSD;
 	}
 
 	if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&



^ permalink raw reply

* Re: [PATCH v2 24/26] staging: brcm80211: declared global vars in softmac phy as const
From: Larry Finger @ 2011-09-27 18:35 UTC (permalink / raw)
  To: Franky Lin; +Cc: gregkh, devel, linux-wireless
In-Reply-To: <1317145530-18839-25-git-send-email-frankyl@broadcom.com>

On 09/27/2011 12:45 PM, Franky Lin wrote:
> From: Roland Vossen<rvossen@broadcom.com>
>
> Global variables are undesirable unless they are read only.
>
> Reported-by: Johannes Berg<johannes@sipsolutions.net>
> Reviewed-by: Pieter-Paul Giesberts<pieterpg@broadcom.com>
> Reviewed-by: Arend van Spriel<arend@broadcom.com>
> Signed-off-by: Franky Lin<frankyl@broadcom.com>
> ---
>   drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c   |   16 +-----
>   drivers/staging/brcm80211/brcmsmac/phy/phy_int.h   |   23 --------
>   drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c   |    6 +-
>   drivers/staging/brcm80211/brcmsmac/phy/phy_n.c     |   60 ++++++++++----------
>   .../staging/brcm80211/brcmsmac/phy/phytbl_lcn.c    |    2 +-
>   5 files changed, 36 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
> index f9702c0..5b81480 100644
> --- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
> +++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
> @@ -52,7 +52,7 @@ struct chan_info_basic {
>   	u16 freq;
>   };
>
> -static struct chan_info_basic chan_info_all[] = {
> +static const struct chan_info_basic chan_info_all[] = {
>   	{1, 2412},
>   	{2, 2417},
>   	{3, 2422},

What are you doing?  You make this change here in patch 24, then undo it in #25, 
and redo it in #26! Are you guys actually thinking about what you are doing?

This needs to be fixed. In addition, the next time you submit this patch bomb, 
change from V2 to V3. That is the standard way to handle resubmissions that are 
addressing comments, not by increasing some extra counter in the 00/XX cover 
patch. The VX notation helps the maintainer keep track of the patches as he 
knows to drop all the V2 ones when V3 arrives. Maintainers are precious and must 
be treated very carefully.

Larry

^ permalink raw reply

* Re: [PATCH] ath6kl: allow firmware to override firmware patch address
From: Kalle Valo @ 2011-09-27 18:29 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless
In-Reply-To: <20110927080526.29124.97405.stgit@localhost6.localdomain6>

On 09/27/2011 11:05 AM, Kalle Valo wrote:
> In some firmware versions their patch address has changed. If the firmware
> provides one, use it to override the default address.

Applied.

Kalle

^ permalink raw reply

* Re: [PATCH] ath6kl: fix TCP corruption
From: Kalle Valo @ 2011-09-27 18:28 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless
In-Reply-To: <20110927080008.28000.50462.stgit@localhost6.localdomain6>

On 09/27/2011 11:00 AM, Kalle Valo wrote:
> From: Jouni Malinen <jouni@qca.qualcomm.com>
> 
> Commit 94e532d1a ("ath6kl: Fix system freeze under heavy data load")
> aligns the skb data without checking if the skb is cloned. Because of
> this ath6kl can corrupt the local TCP stack information that can result
> in TCP retransmission failing and TCP connections stalling.
> 
> To avoid the corruption we need to copy the skb. Now the alignment
> in ath6kl_htc_tx_buf_align() doesn't corrupt TCP packets anymore (and is
> not even used for the cloned skb's that got copied since the alignment
> of the data is handled at the copy time).

Applied.

Kalle

^ permalink raw reply

* [PATCH v2 11/26] staging: brcm80211: make device initializer table for wme constant
From: Franky Lin @ 2011-09-27 17:45 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317145530-18839-1-git-send-email-frankyl@broadcom.com>

From: Arend van Spriel <arend@broadcom.com>

For chip initialisation of the wme parameters a table is used, but
it was not marked as constant.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index dfd67de..a3c0157 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -4297,7 +4297,7 @@ void brcms_c_edcf_setparams(struct brcms_c_info *wlc, bool suspend)
 	int i_ac;
 	struct ieee80211_tx_queue_params txq_pars;
 	struct ieee80211_tx_queue_params *params = &txq_pars;
-	static struct edcf_acparam default_edcf_acparams[] = {
+	static const struct edcf_acparam default_edcf_acparams[] = {
 		 {EDCF_AC_BE_ACI_STA, EDCF_AC_BE_ECW_STA,
 		  cpu_to_le16(EDCF_AC_BE_TXOP_STA)},
 		 {EDCF_AC_BK_ACI_STA, EDCF_AC_BK_ECW_STA,
@@ -4307,7 +4307,7 @@ void brcms_c_edcf_setparams(struct brcms_c_info *wlc, bool suspend)
 		 {EDCF_AC_VO_ACI_STA, EDCF_AC_VO_ECW_STA,
 		  cpu_to_le16(EDCF_AC_VO_TXOP_STA)}
 	}; /* ucode needs these parameters during its initialization */
-	struct edcf_acparam *edcf_acp = &default_edcf_acparams[0];
+	const struct edcf_acparam *edcf_acp = &default_edcf_acparams[0];
 
 	for (i_ac = 0; i_ac < AC_COUNT; i_ac++, edcf_acp++) {
 		/* find out which ac this set of params applies to */
-- 
1.7.1



^ permalink raw reply related

* [PATCH v2 04/26] staging: brcm80211: removed redundant wlc->cfg struct member
From: Franky Lin @ 2011-09-27 17:45 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317145530-18839-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

After initialization ('attach'), this struct member always pointed at
the same memory as wlc->bsscfg.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/main.c |   47 ++++++++++++----------------
 drivers/staging/brcm80211/brcmsmac/main.h |    1 -
 2 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 138f63b..ee9c322 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -486,7 +486,7 @@ static void brcms_c_detach_mfree(struct brcms_c_info *wlc)
 	if (wlc == NULL)
 		return;
 
-	brcms_c_bsscfg_mfree(wlc->cfg);
+	brcms_c_bsscfg_mfree(wlc->bsscfg);
 	kfree(wlc->pub);
 	kfree(wlc->modulecb);
 	kfree(wlc->default_bss);
@@ -577,8 +577,8 @@ brcms_c_attach_malloc(uint unit, uint *err, uint devid)
 		goto fail;
 	}
 
-	wlc->cfg = brcms_c_bsscfg_malloc(unit);
-	if (wlc->cfg == NULL) {
+	wlc->bsscfg = brcms_c_bsscfg_malloc(unit);
+	if (wlc->bsscfg == NULL) {
 		*err = 1011;
 		goto fail;
 	}
@@ -3943,14 +3943,13 @@ void brcms_c_set_ps_ctrl(struct brcms_c_info *wlc)
  * Write this BSS config's MAC address to core.
  * Updates RXE match engine.
  */
-int brcms_c_set_mac(struct brcms_bss_cfg *cfg)
+int brcms_c_set_mac(struct brcms_bss_cfg *bsscfg)
 {
 	int err = 0;
-	struct brcms_c_info *wlc = cfg->wlc;
+	struct brcms_c_info *wlc = bsscfg->wlc;
 
-	if (cfg == wlc->cfg)
-		/* enter the MAC addr into the RXE match registers */
-		brcms_c_set_addrmatch(wlc, RCM_MAC_OFFSET, cfg->cur_etheraddr);
+	/* enter the MAC addr into the RXE match registers */
+	brcms_c_set_addrmatch(wlc, RCM_MAC_OFFSET, bsscfg->cur_etheraddr);
 
 	brcms_c_ampdu_macaddr_upd(wlc);
 
@@ -3960,13 +3959,10 @@ int brcms_c_set_mac(struct brcms_bss_cfg *cfg)
 /* Write the BSS config's BSSID address to core (set_bssid in d11procs.tcl).
  * Updates RXE match engine.
  */
-void brcms_c_set_bssid(struct brcms_bss_cfg *cfg)
+void brcms_c_set_bssid(struct brcms_bss_cfg *bsscfg)
 {
-	struct brcms_c_info *wlc = cfg->wlc;
-
-	/* if primary config, we need to update BSSID in RXE match registers */
-	if (cfg == wlc->cfg)
-		brcms_c_set_addrmatch(wlc, RCM_BSSID_OFFSET, cfg->BSSID);
+	/* we need to update BSSID in RXE match registers */
+	brcms_c_set_addrmatch(bsscfg->wlc, RCM_BSSID_OFFSET, bsscfg->BSSID);
 }
 
 static void brcms_b_set_shortslot(struct brcms_hardware *wlc_hw, bool shortslot)
@@ -5388,9 +5384,8 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
 		goto fail;
 	}
 
-	wlc->bsscfg = wlc->cfg;
-	wlc->cfg->_idx = 0;
-	wlc->cfg->wlc = wlc;
+	wlc->bsscfg->_idx = 0;
+	wlc->bsscfg->wlc = wlc;
 
 	wlc->mimoft = FT_HT;
 	wlc->ht_cap.cap_info = HT_CAP;
@@ -6241,8 +6236,8 @@ static void brcms_c_ofdm_rateset_war(struct brcms_c_info *wlc)
 	u8 r;
 	bool war = false;
 
-	if (wlc->cfg->associated)
-		r = wlc->cfg->current_bss->rateset.rates[0];
+	if (wlc->bsscfg->associated)
+		r = wlc->bsscfg->current_bss->rateset.rates[0];
 	else
 		r = wlc->default_bss->rateset.rates[0];
 
@@ -6311,7 +6306,7 @@ void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
 	struct brcms_c_rateset *rs;
 
 	if (wlc->pub->associated)
-		rs = &wlc->cfg->current_bss->rateset;
+		rs = &wlc->bsscfg->current_bss->rateset;
 	else
 		rs = &wlc->default_bss->rateset;
 
@@ -6337,8 +6332,8 @@ int brcms_c_set_rateset(struct brcms_c_info *wlc, struct brcm_rateset *rs)
 	/* merge rateset coming in with the current mcsset */
 	if (wlc->pub->_n_enab & SUPPORT_11N) {
 		struct brcms_bss_info *mcsset_bss;
-		if (wlc->cfg->associated)
-			mcsset_bss = wlc->cfg->current_bss;
+		if (wlc->bsscfg->associated)
+			mcsset_bss = wlc->bsscfg->current_bss;
 		else
 			mcsset_bss = wlc->default_bss;
 		memcpy(internal_rs.mcs, &mcsset_bss->rateset.mcs[0],
@@ -8096,9 +8091,7 @@ brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, u32 rspec,
 
 void brcms_c_tbtt(struct brcms_c_info *wlc)
 {
-	struct brcms_bss_cfg *cfg = wlc->cfg;
-
-	if (!cfg->BSS)
+	if (!wlc->bsscfg->BSS)
 		/*
 		 * DirFrmQ is now valid...defer setting until end
 		 * of ATIM window
@@ -9144,7 +9137,7 @@ brcms_c_set_addrmatch(struct brcms_c_info *wlc, int match_reg_offset,
 {
 	brcms_b_set_addrmatch(wlc->hw, match_reg_offset, addr);
 	if (match_reg_offset == RCM_BSSID_OFFSET)
-		memcpy(wlc->cfg->BSSID, addr, ETH_ALEN);
+		memcpy(wlc->bsscfg->BSSID, addr, ETH_ALEN);
 }
 
 void brcms_c_pllreq(struct brcms_c_info *wlc, bool set, u32 req_bit)
@@ -9273,7 +9266,7 @@ void brcms_c_scan_stop(struct brcms_c_info *wlc)
 void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state)
 {
 	wlc->pub->associated = state;
-	wlc->cfg->associated = state;
+	wlc->bsscfg->associated = state;
 }
 
 /*
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index ede4aef..d6de9c3 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -565,7 +565,6 @@ struct brcms_c_info {
 	u16 fifo2prec_map[NFIFO];
 
 	struct brcms_bss_cfg *bsscfg;
-	struct brcms_bss_cfg *cfg;
 
 	/* tx queue */
 	struct brcms_txq_info *tx_queues;
-- 
1.7.1



^ permalink raw reply related

* [PATCH v2 00/26] staging: brcm80211: 8th reaction for mainline patch #2
From: Franky Lin @ 2011-09-27 17:45 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless

Code clean up for softmac.

V2:
* Rework some patches based on the comments from community

Arend van Spriel (13):
  staging: brcm80211: remove uncoditional code blocks from brcmsmac
  staging: brcm80211: remove ht_cap field from brcms_c_info structure
  staging: brcm80211: use fragment number provided in transmit frame
  staging: brcm80211: remove unused function si_pmu_ilp_clock()
  staging: brcm80211: make device initializer table for wme constant
  staging: brcm80211: remove dongle firmware related debug code
  staging: brcm80211: remove unnecessary mac80211 callbacks
  staging: brcm80211: changing interface to n-phy rssi compute function
  staging: brcm80211: change interface for common rssi compute function
  staging: brcm80211: convert endianess before handling the frame
  staging: brcm80211: use endian annotated structures in brcmsmac
  staging: brcm80211: move rssi computation to place we need it
  staging: brcm80211: use d11rxhdr structure in brcms_c_recover_tsf64()

Roland Vossen (13):
  staging: brcm80211: removed unused argument from softmac functions
  staging: brcm80211: deleted unused array of bss configurations in
    softmac
  staging: brcm80211: removed redundant wlc->cfg struct member
  staging: brcm80211: removed global var from aiutils.c
  staging: brcm80211: removed global vars in softmac ucode handling
  staging: brcm80211: removed unused softmac workaround
  staging: brcm80211: removed band related global vars from softmac
  staging: brcm80211: removed global var global_scb from softmac
  staging: brcm80211: various global var related changes in softmac
  staging: brcm80211: removed global variable in softmac otp
  staging: brcm80211: declared global vars in softmac phy as const
  staging: brcm80211: simple changes to softmac phy variables
  staging: brcm80211: declared global vars in softmac phy as const

 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c     |  259 +-------
 drivers/staging/brcm80211/brcmsmac/Makefile       |    3 +-
 drivers/staging/brcm80211/brcmsmac/aiutils.c      |   15 +-
 drivers/staging/brcm80211/brcmsmac/aiutils.h      |    2 -
 drivers/staging/brcm80211/brcmsmac/ampdu.c        |    6 +-
 drivers/staging/brcm80211/brcmsmac/d11.h          |   91 ++--
 drivers/staging/brcm80211/brcmsmac/dma.c          |   41 +-
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c  |  125 +---
 drivers/staging/brcm80211/brcmsmac/mac80211_if.h  |    3 +-
 drivers/staging/brcm80211/brcmsmac/main.c         |  747 +++++++++------------
 drivers/staging/brcm80211/brcmsmac/main.h         |   19 +-
 drivers/staging/brcm80211/brcmsmac/otp.c          |  147 +----
 drivers/staging/brcm80211/brcmsmac/otp.h          |    8 -
 drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c  |   62 +--
 drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h  |    4 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_int.h  |   25 +-
 drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c  |  112 ++--
 drivers/staging/brcm80211/brcmsmac/phy/phy_n.c    |   75 +--
 drivers/staging/brcm80211/brcmsmac/pmu.c          |   22 -
 drivers/staging/brcm80211/brcmsmac/pmu.h          |    1 -
 drivers/staging/brcm80211/brcmsmac/pub.h          |    1 -
 drivers/staging/brcm80211/brcmsmac/rate.h         |    1 -
 drivers/staging/brcm80211/brcmsmac/srom.c         |   19 +-
 drivers/staging/brcm80211/brcmsmac/stf.c          |    9 -
 drivers/staging/brcm80211/brcmsmac/types.h        |    6 -
 drivers/staging/brcm80211/brcmsmac/ucode_loader.c |  121 ++--
 drivers/staging/brcm80211/brcmsmac/ucode_loader.h |   46 +-
 27 files changed, 648 insertions(+), 1322 deletions(-)



^ permalink raw reply

* [PATCH v2 06/26] staging: brcm80211: removed global vars in softmac ucode handling
From: Franky Lin @ 2011-09-27 17:45 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317145530-18839-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Moved global vars into a per-device structure.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c  |    4 +-
 drivers/staging/brcm80211/brcmsmac/mac80211_if.h  |    3 +-
 drivers/staging/brcm80211/brcmsmac/main.c         |   27 ++++--
 drivers/staging/brcm80211/brcmsmac/ucode_loader.c |  121 ++++++++++-----------
 drivers/staging/brcm80211/brcmsmac/ucode_loader.h |   46 +++++----
 5 files changed, 106 insertions(+), 95 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 32d7abf..9bd4b83 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -894,7 +894,7 @@ static int brcms_request_fw(struct brcms_info *wl, struct pci_dev *pdev)
 		    wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr));
 	}
 	wl->fw.fw_cnt = i;
-	return brcms_ucode_data_init(wl);
+	return brcms_ucode_data_init(wl, &wl->ucode);
 }
 
 /*
@@ -925,7 +925,7 @@ static void brcms_free(struct brcms_info *wl)
 
 	/* free ucode data */
 	if (wl->fw.fw_cnt)
-		brcms_ucode_data_free();
+		brcms_ucode_data_free(&wl->ucode);
 	if (wl->irq)
 		free_irq(wl->irq, wl);
 
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
index 1eb36ed..2bdcd4c 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.h
@@ -19,7 +19,7 @@
 
 #include <linux/timer.h>
 #include <linux/interrupt.h>
-
+#include "ucode_loader.h"
 /*
  * Starting index for 5G rates in the
  * legacy rate table.
@@ -77,6 +77,7 @@ struct brcms_info {
 	bool resched;		/* dpc needs to be and is rescheduled */
 	struct brcms_firmware fw;
 	struct wiphy *wiphy;
+	struct brcms_ucode ucode;
 };
 
 /* misc callbacks */
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index ee9c322..4d5c842 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -342,6 +342,12 @@ static u16 frametype(u32 rspec, u8 mimoframe)
 /* Starting corerev for the fifo size table */
 #define XMTFIFOTBL_STARTREV	20
 
+struct d11init {
+	u16 addr;
+	u16 size;
+	u32 value;
+};
+
 /* currently the best mechanism for determining SIFS is the band in use */
 static u16 get_sifs(struct brcms_band *band)
 {
@@ -349,6 +355,7 @@ static u16 get_sifs(struct brcms_band *band)
 				 BPHY_SIFS_TIME;
 }
 
+
 /*
  * Detect Card removed.
  * Even checking an sbconfig register read will not false trigger when the core
@@ -694,6 +701,7 @@ static void brcms_c_write_mhf(struct brcms_hardware *wlc_hw, u16 *mhfs)
 static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
 {
 	struct wiphy *wiphy = wlc_hw->wlc->wiphy;
+	struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode;
 
 	/* init microcode host flags */
 	brcms_c_write_mhf(wlc_hw, wlc_hw->band->mhfs);
@@ -701,7 +709,7 @@ static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
 	/* do band-specific ucode IHR, SHM, and SCR inits */
 	if (D11REV_IS(wlc_hw->corerev, 23)) {
 		if (BRCMS_ISNPHY(wlc_hw->band))
-			brcms_c_write_inits(wlc_hw, d11n0bsinitvals16);
+			brcms_c_write_inits(wlc_hw, ucode->d11n0bsinitvals16);
 		else
 			wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
 				  " %d\n", __func__, wlc_hw->unit,
@@ -710,7 +718,7 @@ static void brcms_c_ucode_bsinit(struct brcms_hardware *wlc_hw)
 		if (D11REV_IS(wlc_hw->corerev, 24)) {
 			if (BRCMS_ISLCNPHY(wlc_hw->band))
 				brcms_c_write_inits(wlc_hw,
-						    d11lcn0bsinitvals24);
+						    ucode->d11lcn0bsinitvals24);
 			else
 				wiphy_err(wiphy, "%s: wl%d: unsupported phy in"
 					  " core rev %d\n", __func__,
@@ -2457,6 +2465,8 @@ static void brcms_ucode_write(struct brcms_hardware *wlc_hw, const u32 ucode[],
 static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
 {
 	struct brcms_c_info *wlc;
+	struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode;
+
 	wlc = wlc_hw->wlc;
 
 	if (wlc_hw->ucode_loaded)
@@ -2464,8 +2474,8 @@ static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
 
 	if (D11REV_IS(wlc_hw->corerev, 23)) {
 		if (BRCMS_ISNPHY(wlc_hw->band)) {
-			brcms_ucode_write(wlc_hw, bcm43xx_16_mimo,
-					bcm43xx_16_mimosz);
+			brcms_ucode_write(wlc_hw, ucode->bcm43xx_16_mimo,
+					  ucode->bcm43xx_16_mimosz);
 			wlc_hw->ucode_loaded = true;
 		} else
 			wiphy_err(wlc->wiphy, "%s: wl%d: unsupported phy in "
@@ -2473,8 +2483,8 @@ static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
 				  __func__, wlc_hw->unit, wlc_hw->corerev);
 	} else if (D11REV_IS(wlc_hw->corerev, 24)) {
 		if (BRCMS_ISLCNPHY(wlc_hw->band)) {
-			brcms_ucode_write(wlc_hw, bcm43xx_24_lcn,
-					bcm43xx_24_lcnsz);
+			brcms_ucode_write(wlc_hw, ucode->bcm43xx_24_lcn,
+					  ucode->bcm43xx_24_lcnsz);
 			wlc_hw->ucode_loaded = true;
 		} else {
 			wiphy_err(wlc->wiphy, "%s: wl%d: unsupported phy in "
@@ -3372,6 +3382,7 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
 	int err = 0;
 	u16 buf[NFIFO];
 	struct wiphy *wiphy = wlc->wiphy;
+	struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode;
 
 	regs = wlc_hw->regs;
 
@@ -3404,14 +3415,14 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
 
 	if (D11REV_IS(wlc_hw->corerev, 23)) {
 		if (BRCMS_ISNPHY(wlc_hw->band))
-			brcms_c_write_inits(wlc_hw, d11n0initvals16);
+			brcms_c_write_inits(wlc_hw, ucode->d11n0initvals16);
 		else
 			wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
 				  " %d\n", __func__, wlc_hw->unit,
 				  wlc_hw->corerev);
 	} else if (D11REV_IS(wlc_hw->corerev, 24)) {
 		if (BRCMS_ISLCNPHY(wlc_hw->band))
-			brcms_c_write_inits(wlc_hw, d11lcn0initvals24);
+			brcms_c_write_inits(wlc_hw, ucode->d11lcn0initvals24);
 		else
 			wiphy_err(wiphy, "%s: wl%d: unsupported phy in corerev"
 				  " %d\n", __func__, wlc_hw->unit,
diff --git a/drivers/staging/brcm80211/brcmsmac/ucode_loader.c b/drivers/staging/brcm80211/brcmsmac/ucode_loader.c
index c14bce8..80e3ccf 100644
--- a/drivers/staging/brcm80211/brcmsmac/ucode_loader.c
+++ b/drivers/staging/brcm80211/brcmsmac/ucode_loader.c
@@ -37,80 +37,73 @@ enum {
 	D11UCODE_OVERSIGHT_BOMMINOR
 };
 
-struct d11init *d11lcn0bsinitvals24;
-struct d11init *d11lcn0initvals24;
-struct d11init *d11lcn1bsinitvals24;
-struct d11init *d11lcn1initvals24;
-struct d11init *d11lcn2bsinitvals24;
-struct d11init *d11lcn2initvals24;
-struct d11init *d11n0absinitvals16;
-struct d11init *d11n0bsinitvals16;
-struct d11init *d11n0initvals16;
-u32 *bcm43xx_16_mimo;
-u32 bcm43xx_16_mimosz;
-u32 *bcm43xx_24_lcn;
-u32 bcm43xx_24_lcnsz;
-
-static u32 *bcm43xx_bommajor;
-static u32 *bcm43xx_bomminor;
-
-int brcms_ucode_data_init(struct brcms_info *wl)
+int brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode)
 {
 	int rc;
+
 	rc = brcms_check_firmwares(wl);
 
 	rc = rc < 0 ? rc :
-		brcms_ucode_init_buf(wl, (void **)&d11lcn0bsinitvals24,
+		brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn0bsinitvals24,
 				     D11LCN0BSINITVALS24);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11lcn0initvals24,
-					     D11LCN0INITVALS24);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn0initvals24,
+				       D11LCN0INITVALS24);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn1bsinitvals24,
+				       D11LCN1BSINITVALS24);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn1initvals24,
+				       D11LCN1INITVALS24);
 	rc = rc < 0 ? rc :
-		brcms_ucode_init_buf(wl, (void **)&d11lcn1bsinitvals24,
-				     D11LCN1BSINITVALS24);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11lcn1initvals24,
-					     D11LCN1INITVALS24);
-	rc = rc < 0 ? rc :
-		brcms_ucode_init_buf(wl, (void **)&d11lcn2bsinitvals24,
+		brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn2bsinitvals24,
 				     D11LCN2BSINITVALS24);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11lcn2initvals24,
-					     D11LCN2INITVALS24);
-	rc = rc < 0 ? rc :
-		brcms_ucode_init_buf(wl, (void **)&d11n0absinitvals16,
-				     D11N0ABSINITVALS16);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11n0bsinitvals16,
-					     D11N0BSINITVALS16);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&d11n0initvals16,
-					     D11N0INITVALS16);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&bcm43xx_16_mimo,
-					     D11UCODE_OVERSIGHT16_MIMO);
-	rc = rc < 0 ? rc : brcms_ucode_init_uint(wl, &bcm43xx_16_mimosz,
-					      D11UCODE_OVERSIGHT16_MIMOSZ);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&bcm43xx_24_lcn,
-					     D11UCODE_OVERSIGHT24_LCN);
-	rc = rc < 0 ? rc : brcms_ucode_init_uint(wl, &bcm43xx_24_lcnsz,
-					      D11UCODE_OVERSIGHT24_LCNSZ);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&bcm43xx_bommajor,
-					     D11UCODE_OVERSIGHT_BOMMAJOR);
-	rc = rc < 0 ? rc : brcms_ucode_init_buf(wl, (void **)&bcm43xx_bomminor,
-					     D11UCODE_OVERSIGHT_BOMMINOR);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11lcn2initvals24,
+				       D11LCN2INITVALS24);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11n0absinitvals16,
+				       D11N0ABSINITVALS16);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11n0bsinitvals16,
+				       D11N0BSINITVALS16);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->d11n0initvals16,
+				       D11N0INITVALS16);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->bcm43xx_16_mimo,
+				       D11UCODE_OVERSIGHT16_MIMO);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_uint(wl, &ucode->bcm43xx_16_mimosz,
+					D11UCODE_OVERSIGHT16_MIMOSZ);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->bcm43xx_24_lcn,
+				       D11UCODE_OVERSIGHT24_LCN);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_uint(wl, &ucode->bcm43xx_24_lcnsz,
+					D11UCODE_OVERSIGHT24_LCNSZ);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->bcm43xx_bommajor,
+				       D11UCODE_OVERSIGHT_BOMMAJOR);
+	rc = rc < 0 ?
+	     rc : brcms_ucode_init_buf(wl, (void **)&ucode->bcm43xx_bomminor,
+				       D11UCODE_OVERSIGHT_BOMMINOR);
 	return rc;
 }
 
-void brcms_ucode_data_free(void)
+void brcms_ucode_data_free(struct brcms_ucode *ucode)
 {
-	brcms_ucode_free_buf((void *)d11lcn0bsinitvals24);
-	brcms_ucode_free_buf((void *)d11lcn0initvals24);
-	brcms_ucode_free_buf((void *)d11lcn1bsinitvals24);
-	brcms_ucode_free_buf((void *)d11lcn1initvals24);
-	brcms_ucode_free_buf((void *)d11lcn2bsinitvals24);
-	brcms_ucode_free_buf((void *)d11lcn2initvals24);
-	brcms_ucode_free_buf((void *)d11n0absinitvals16);
-	brcms_ucode_free_buf((void *)d11n0bsinitvals16);
-	brcms_ucode_free_buf((void *)d11n0initvals16);
-	brcms_ucode_free_buf((void *)bcm43xx_16_mimo);
-	brcms_ucode_free_buf((void *)bcm43xx_24_lcn);
-	brcms_ucode_free_buf((void *)bcm43xx_bommajor);
-	brcms_ucode_free_buf((void *)bcm43xx_bomminor);
-
-	return;
+	brcms_ucode_free_buf((void *)ucode->d11lcn0bsinitvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn0initvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn1bsinitvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn1initvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn2bsinitvals24);
+	brcms_ucode_free_buf((void *)ucode->d11lcn2initvals24);
+	brcms_ucode_free_buf((void *)ucode->d11n0absinitvals16);
+	brcms_ucode_free_buf((void *)ucode->d11n0bsinitvals16);
+	brcms_ucode_free_buf((void *)ucode->d11n0initvals16);
+	brcms_ucode_free_buf((void *)ucode->bcm43xx_16_mimo);
+	brcms_ucode_free_buf((void *)ucode->bcm43xx_24_lcn);
+	brcms_ucode_free_buf((void *)ucode->bcm43xx_bommajor);
+	brcms_ucode_free_buf((void *)ucode->bcm43xx_bomminor);
 }
diff --git a/drivers/staging/brcm80211/brcmsmac/ucode_loader.h b/drivers/staging/brcm80211/brcmsmac/ucode_loader.h
index ca53dec..438675a 100644
--- a/drivers/staging/brcm80211/brcmsmac/ucode_loader.h
+++ b/drivers/staging/brcm80211/brcmsmac/ucode_loader.h
@@ -13,6 +13,8 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+#ifndef	_BRCM_UCODE_H_
+#define	_BRCM_UCODE_H_
 
 #include "types.h"		/* forward structure declarations */
 
@@ -21,28 +23,30 @@
 
 #define UCODE_LOADER_API_VER 0
 
-struct d11init {
-	u16 addr;
-	u16 size;
-	u32 value;
+struct d11init;
+
+struct brcms_ucode {
+	struct d11init *d11lcn0bsinitvals24;
+	struct d11init *d11lcn0initvals24;
+	struct d11init *d11lcn1bsinitvals24;
+	struct d11init *d11lcn1initvals24;
+	struct d11init *d11lcn2bsinitvals24;
+	struct d11init *d11lcn2initvals24;
+	struct d11init *d11n0absinitvals16;
+	struct d11init *d11n0bsinitvals16;
+	struct d11init *d11n0initvals16;
+	u32 *bcm43xx_16_mimo;
+	u32 bcm43xx_16_mimosz;
+	u32 *bcm43xx_24_lcn;
+	u32 bcm43xx_24_lcnsz;
+	u32 *bcm43xx_bommajor;
+	u32 *bcm43xx_bomminor;
 };
 
-extern struct d11init *d11lcn0bsinitvals24;
-extern struct d11init *d11lcn0initvals24;
-extern struct d11init *d11lcn1bsinitvals24;
-extern struct d11init *d11lcn1initvals24;
-extern struct d11init *d11lcn2bsinitvals24;
-extern struct d11init *d11lcn2initvals24;
-extern struct d11init *d11n0absinitvals16;
-extern struct d11init *d11n0bsinitvals16;
-extern struct d11init *d11n0initvals16;
-extern u32 *bcm43xx_16_mimo;
-extern u32 bcm43xx_16_mimosz;
-extern u32 *bcm43xx_24_lcn;
-extern u32 bcm43xx_24_lcnsz;
-
-extern int brcms_ucode_data_init(struct brcms_info *wl);
-extern void brcms_ucode_data_free(void);
+extern int
+brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
+
+extern void brcms_ucode_data_free(struct brcms_ucode *ucode);
 
 extern int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf,
 				unsigned int idx);
@@ -50,3 +54,5 @@ extern int brcms_ucode_init_uint(struct brcms_info *wl, unsigned *data,
 			      unsigned int idx);
 extern void brcms_ucode_free_buf(void *);
 extern int  brcms_check_firmwares(struct brcms_info *wl);
+
+#endif	/* _BRCM_UCODE_H_ */
-- 
1.7.1



^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox