* Re: Bluetooth regression with headphones
From: Gustavo Padovan @ 2011-09-29 20:01 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Linux Kernel Mailing List, linux-bluetooth, linux-wireless,
Keith Packard, Waldemar Rymarkiewicz, Luiz Augusto von Dentz,
Ilia Kolomisnky
In-Reply-To: <4E84AF39.7090205@goop.org>
Hi Jeremy,
* Jeremy Fitzhardinge <jeremy@goop.org> [2011-09-29 10:47:37 -0700]:
> 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
>
>
> I tried to bisect this with inconclusive results.
>
> Firstly, it was all working fine up until 13d39315 "Bluetooth: Map
> sec_level to link key requirements". This had a couple of known bugs
> fixed with 6fdf658c "Bluetooth: Fix L2CAP security check" and 33060542
> "Bluetooth: Fix L2CAP connection establishment". When I cherry-picked
> just those onto 13d39315 it all seems to work well again.
>
> However, after that, it regresses again, and reconnection gets pretty
> unreliable. From bisection of a linearized history of the net/bluetooth
> changes, it appears that 60b83f57 "Bluetooth: Ignore key unauthenticated
> for high security" is at least part of the problem, and when I revert it
> from the bluetooth branch it seems to help; but when I revert it from an
> overall v3.1 linux.git head, it doesn't, so perhaps something else in
> there is also causing a problem.
>
> It seems clear that all the new stricter enforcement of security stuff
> is upsetting my headphone's reconnection, but I've reached the limit of
> how much I can diagnose this without some pointers, because I don't
> really know anything about bluetooth.
>
> How can I help fix this?
Can you send me the hcidump logs of both the working and not working
scenarios? It helps a lot find issues.
Gustavo
^ permalink raw reply
* re: carl9170 AP mode stops working in 3.0.x
From: Damian Lesiuk @ 2011-09-29 20:34 UTC (permalink / raw)
To: linux-wireless
I have the same issue.
hostapd log:
http://pastebin.com/raw.php?i=23uxgBre
For me it's like 15-30 minutes. After that I can't connect to that
network but I can see it.
Only hostapd restart helps.
I tried older hostapd and 1.9.4 fw and it's the same.
I'm using Arch Linux with 3.0.4 kernel.
>
> Good day!
> I've been using TL-WN821Nv2 dongle as AP for a year or so. I'm using
> linux x86_64 desktop + hostapd. After upgrading to linux
> 3.0/compat-wireless-3.0-1/2, my AP started freezing after a while
> (Maybe several minutes or so).
> What I've tried so far:
> 1) switching hostapd in b/g mode.
> 2) checked /sys/.../power/autosuspend and various power-saving
> features. (Seems to be unsupported by my device anyway)
> 3) upgrading to firmware-1.9.4 + latest compat-wireless version.
>
> Sometimes restarting hostapd helps, sometimes not. I don't see any
> relevant error messages or something suspicious in logs. (Tried
> raising hostapd logs to maximum verbosity)
> The last good configuration was 2.6.39-r3 + compat-wireless-stable-39.1
>
> How could I help you find/debug this problem? I saw other complaint on
> the mail list and I guess it's similar issue.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: carl9170 AP mode stops working in 3.0.x
From: Damian Lesiuk @ 2011-09-29 20:35 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <CAGxArmeAH5K1ESVA79YYcUEueTB1zqcZZXTxvkUeKUG1Mjhd+Q@mail.gmail.com>
How can I help you fix it?
It's very important for me.
2011/9/29 Damian Lesiuk <ja@lesiuk.net>:
> I have the same issue.
>
> hostapd log:
> http://pastebin.com/raw.php?i=23uxgBre
>
> For me it's like 15-30 minutes. After that I can't connect to that
> network but I can see it.
> Only hostapd restart helps.
>
> I tried older hostapd and 1.9.4 fw and it's the same.
>
> I'm using Arch Linux with 3.0.4 kernel.
>
>>
>> Good day!
>> I've been using TL-WN821Nv2 dongle as AP for a year or so. I'm using
>> linux x86_64 desktop + hostapd. After upgrading to linux
>> 3.0/compat-wireless-3.0-1/2, my AP started freezing after a while
>> (Maybe several minutes or so).
>> What I've tried so far:
>> 1) switching hostapd in b/g mode.
>> 2) checked /sys/.../power/autosuspend and various power-saving
>> features. (Seems to be unsupported by my device anyway)
>> 3) upgrading to firmware-1.9.4 + latest compat-wireless version.
>>
>> Sometimes restarting hostapd helps, sometimes not. I don't see any
>> relevant error messages or something suspicious in logs. (Tried
>> raising hostapd logs to maximum verbosity)
>> The last good configuration was 2.6.39-r3 + compat-wireless-stable-39.1
>>
>> How could I help you find/debug this problem? I saw other complaint on
>> the mail list and I guess it's similar issue.
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to majordomo@xxxxxxxxxxxxxxx
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH 1/1] rfkill: add module option to become inactive.
From: Henrique de Moraes Holschuh @ 2011-09-29 21:56 UTC (permalink / raw)
To: Johannes Berg; +Cc: Andrew V. Stepanov, davem, linville, linux-wireless
In-Reply-To: <1317124813.4082.29.camel@jlt3.sipsolutions.net>
On Tue, 27 Sep 2011, Johannes Berg wrote:
> > This patch give ability disable rfkill sub-system by means to pass
> > special module parameter.
>
> Because the platform driver is doing the wrong thing.
Hmm? Is it?
> > Example from real life. Some company want to make inactive rfkill
> > SW+HW buttons on some company notebooks.
> > For this, you advise to recompile kernel.
>
> No, you need to fix the thinkpad driver.
Eh, I can certainly blacklist platform rfkill support for the x201i on the
grounds that it is a piece of crap, since a hardware button that does it in
software is clearly el-cheap-o land that does not belong to something that
dares call itself a ThinkPad X-series. But I am not sure this is the best
way to go about it. It will cause that switch to become useless, for one.
I can map it to a soft rfkill button, which seems to be more in line with
the real truth behind it. But this is very weird, the EC used to even kick
bluetooth out of the USB bus when that switch was enabled...
dmidecode dump, please. And I'd really appreciate a _full_ report of the
issue and behaviour of the rfkill hw button on the x201i, please send it to
ibm-acpi-devel@lists.sourceforge.net, and we can take the thread there.
I'd ask it to be done through bugzilla.kernel.org, but that's still down.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply
* [PATCH v3 20/25] staging: brcm80211: convert endianess before handling the frame
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
The received frame from the device is in little-endian order and
converted in the receive path. However, the phy code was doing
the rssi calculation with packet in LE order. This has been changed
to do the le_to_cpu conversion before doing the rssi computation
and further receive processing.
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/main.c | 27 ++++++++++-----------
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 6 ++--
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 8 +++---
3 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index ef96358..1a7d005 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -813,11 +813,23 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
wlc_rxhdr = (struct brcms_d11rxhdr *) p->data;
rxh = (struct d11rxhdr *)p->data;
+ /* fixup rx header endianness */
+ rxh->RxFrameSize = le16_to_cpu(rxh->RxFrameSize);
+ rxh->PhyRxStatus_0 = le16_to_cpu(rxh->PhyRxStatus_0);
+ rxh->PhyRxStatus_1 = le16_to_cpu(rxh->PhyRxStatus_1);
+ rxh->PhyRxStatus_2 = le16_to_cpu(rxh->PhyRxStatus_2);
+ rxh->PhyRxStatus_3 = le16_to_cpu(rxh->PhyRxStatus_3);
+ rxh->PhyRxStatus_4 = le16_to_cpu(rxh->PhyRxStatus_4);
+ rxh->PhyRxStatus_5 = le16_to_cpu(rxh->PhyRxStatus_5);
+ rxh->RxStatus1 = le16_to_cpu(rxh->RxStatus1);
+ rxh->RxStatus2 = le16_to_cpu(rxh->RxStatus2);
+ rxh->RxTSFTime = le16_to_cpu(rxh->RxTSFTime);
+ rxh->RxChan = le16_to_cpu(rxh->RxChan);
+
/*
* compute the RSSI from d11rxhdr and record it in wlc_rxd11hr
*/
wlc_rxhdr->rssi = wlc_phy_rssi_compute(wlc_hw->band->pi, rxh);
-
brcms_c_recv(wlc_hw->wlc, p);
}
@@ -8289,19 +8301,6 @@ void brcms_c_recv(struct brcms_c_info *wlc, struct sk_buff *p)
/* strip off rxhdr */
skb_pull(p, BRCMS_HWRXOFF);
- /* fixup rx header endianness */
- rxh->RxFrameSize = le16_to_cpu(rxh->RxFrameSize);
- rxh->PhyRxStatus_0 = le16_to_cpu(rxh->PhyRxStatus_0);
- rxh->PhyRxStatus_1 = le16_to_cpu(rxh->PhyRxStatus_1);
- rxh->PhyRxStatus_2 = le16_to_cpu(rxh->PhyRxStatus_2);
- rxh->PhyRxStatus_3 = le16_to_cpu(rxh->PhyRxStatus_3);
- rxh->PhyRxStatus_4 = le16_to_cpu(rxh->PhyRxStatus_4);
- rxh->PhyRxStatus_5 = le16_to_cpu(rxh->PhyRxStatus_5);
- rxh->RxStatus1 = le16_to_cpu(rxh->RxStatus1);
- rxh->RxStatus2 = le16_to_cpu(rxh->RxStatus2);
- rxh->RxTSFTime = le16_to_cpu(rxh->RxTSFTime);
- rxh->RxChan = le16_to_cpu(rxh->RxChan);
-
/* MAC inserts 2 pad bytes for a4 headers or QoS or A-MSDU subframes */
if (rxh->RxStatus1 & RXS_PBPRES) {
if (p->len < 2) {
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index c359a10..f9702c0 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -2613,18 +2613,18 @@ void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_cmplx_pwr_dB, u8 core)
int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
struct d11rxhdr *rxh)
{
- int rssi = le16_to_cpu(rxh->PhyRxStatus_1) & PRXS1_JSSI_MASK;
+ int rssi = rxh->PhyRxStatus_1 & PRXS1_JSSI_MASK;
uint radioid = pih->radioid;
struct brcms_phy *pi = (struct brcms_phy *) pih;
if ((pi->sh->corerev >= 11)
- && !(le16_to_cpu(rxh->RxStatus2) & RXS_PHYRXST_VALID)) {
+ && !(rxh->RxStatus2 & RXS_PHYRXST_VALID)) {
rssi = BRCMS_RSSI_INVALID;
goto end;
}
if (ISLCNPHY(pi)) {
- u8 gidx = (le16_to_cpu(rxh->PhyRxStatus_2) & 0xFC00) >> 10;
+ u8 gidx = (rxh->PhyRxStatus_2 & 0xFC00) >> 10;
struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
if (rssi > 127)
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index ff8b1d8..a34d292 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -23115,16 +23115,16 @@ wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct d11rxhdr *rxh)
s16 phyRx0_l, phyRx2_l;
rxpwr = 0;
- rxpwr0 = le16_to_cpu(rxh->PhyRxStatus_1) & PRXS1_nphy_PWR0_MASK;
- rxpwr1 = (le16_to_cpu(rxh->PhyRxStatus_1) & PRXS1_nphy_PWR1_MASK) >> 8;
+ rxpwr0 = rxh->PhyRxStatus_1 & PRXS1_nphy_PWR0_MASK;
+ rxpwr1 = (rxh->PhyRxStatus_1 & PRXS1_nphy_PWR1_MASK) >> 8;
if (rxpwr0 > 127)
rxpwr0 -= 256;
if (rxpwr1 > 127)
rxpwr1 -= 256;
- phyRx0_l = le16_to_cpu(rxh->PhyRxStatus_0) & 0x00ff;
- phyRx2_l = le16_to_cpu(rxh->PhyRxStatus_2) & 0x00ff;
+ phyRx0_l = rxh->PhyRxStatus_0 & 0x00ff;
+ phyRx2_l = rxh->PhyRxStatus_2 & 0x00ff;
if (phyRx2_l > 127)
phyRx2_l -= 256;
--
1.7.1
^ permalink raw reply related
* [PATCH v3 13/25] staging: brcm80211: remove unnecessary mac80211 callbacks
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
Several callback were implemented without executing any further
function calls into the driver. Review feedback indicated that
these could be removed.
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 61 ----------------------
1 files changed, 0 insertions(+), 61 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 9bd4b83..11ba061 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -580,12 +580,6 @@ brcms_ops_configure_filter(struct ieee80211_hw *hw,
return;
}
-static int
-brcms_ops_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set)
-{
- return 0;
-}
-
static void brcms_ops_sw_scan_start(struct ieee80211_hw *hw)
{
struct brcms_info *wl = hw->priv;
@@ -604,42 +598,6 @@ static void brcms_ops_sw_scan_complete(struct ieee80211_hw *hw)
return;
}
-static void brcms_ops_set_tsf(struct ieee80211_hw *hw, u64 tsf)
-{
- wiphy_err(hw->wiphy, "%s: Enter\n", __func__);
- return;
-}
-
-static int
-brcms_ops_get_stats(struct ieee80211_hw *hw,
- struct ieee80211_low_level_stats *stats)
-{
- struct brcms_info *wl = hw->priv;
- struct wl_cnt *cnt;
-
- LOCK(wl);
- cnt = wl->pub->_cnt;
- stats->dot11ACKFailureCount = 0;
- stats->dot11RTSFailureCount = 0;
- stats->dot11FCSErrorCount = 0;
- stats->dot11RTSSuccessCount = 0;
- UNLOCK(wl);
- return 0;
-}
-
-static void
-brcms_ops_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- enum sta_notify_cmd cmd, struct ieee80211_sta *sta)
-{
- switch (cmd) {
- default:
- wiphy_err(hw->wiphy, "%s: Unknown cmd = %d\n", __func__,
- cmd);
- break;
- }
- return;
-}
-
static int
brcms_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params)
@@ -653,12 +611,6 @@ brcms_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
return 0;
}
-static u64 brcms_ops_get_tsf(struct ieee80211_hw *hw)
-{
- wiphy_err(hw->wiphy, "%s: Enter\n", __func__);
- return 0;
-}
-
static int
brcms_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
@@ -698,13 +650,6 @@ brcms_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
}
static int
-brcms_ops_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- struct ieee80211_sta *sta)
-{
- return 0;
-}
-
-static int
brcms_ops_ampdu_action(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
enum ieee80211_ampdu_mlme_action action,
@@ -800,16 +745,10 @@ static const struct ieee80211_ops brcms_ops = {
.config = brcms_ops_config,
.bss_info_changed = brcms_ops_bss_info_changed,
.configure_filter = brcms_ops_configure_filter,
- .set_tim = brcms_ops_set_tim,
.sw_scan_start = brcms_ops_sw_scan_start,
.sw_scan_complete = brcms_ops_sw_scan_complete,
- .set_tsf = brcms_ops_set_tsf,
- .get_stats = brcms_ops_get_stats,
- .sta_notify = brcms_ops_sta_notify,
.conf_tx = brcms_ops_conf_tx,
- .get_tsf = brcms_ops_get_tsf,
.sta_add = brcms_ops_sta_add,
- .sta_remove = brcms_ops_sta_remove,
.ampdu_action = brcms_ops_ampdu_action,
.rfkill_poll = brcms_ops_rfkill_poll,
.flush = brcms_ops_flush,
--
1.7.1
^ permalink raw reply related
* [PATCH v3 03/25] staging: brcm80211: deleted unused array of bss configurations in softmac
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Roland Vossen <rvossen@broadcom.com>
List always had one element. Converted the array to a scalar.
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 | 139 +++++++++-------------------
drivers/staging/brcm80211/brcmsmac/main.h | 2 +-
drivers/staging/brcm80211/brcmsmac/types.h | 5 -
3 files changed, 43 insertions(+), 103 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index d160212..138f63b 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -342,15 +342,6 @@ static u16 frametype(u32 rspec, u8 mimoframe)
/* Starting corerev for the fifo size table */
#define XMTFIFOTBL_STARTREV 20
-/* iterate through all valid bsscfg entries */
-#define FOREACH_BSS(wlc, idx, cfg) \
- for (idx = 0; (int) idx < BRCMS_MAXBSSCFG; idx++) { \
- cfg = (wlc)->bsscfg[idx]; \
- if (!cfg) \
- continue;
-/* close marker for iterator code block */
-#define END_FOREACH_BSS() }
-
/* currently the best mechanism for determining SIFS is the band in use */
static u16 get_sifs(struct brcms_band *band)
{
@@ -3278,8 +3269,7 @@ static void brcms_b_antsel_set(struct brcms_hardware *wlc_hw, u32 antsel_avail)
*/
bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
{
- int idx;
- struct brcms_bss_cfg *cfg;
+ struct brcms_bss_cfg *cfg = wlc->bsscfg;
/* disallow PS when one of the following global conditions meets */
if (!wlc->pub->associated)
@@ -3289,19 +3279,16 @@ bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
if (wlc->monitor)
return false;
- for (idx = 0; idx < BRCMS_MAXBSSCFG; idx++) {
- cfg = wlc->bsscfg[idx];
- if (cfg && cfg->associated) {
- /*
- * disallow PS when one of the following
- * bsscfg specific conditions meets
- */
- if (!cfg->BSS)
- return false;
+ if (cfg->associated) {
+ /*
+ * disallow PS when one of the following
+ * bsscfg specific conditions meets
+ */
+ if (!cfg->BSS)
+ return false;
- if (!cfg->dtim_programmed)
- return false;
- }
+ if (!cfg->dtim_programmed)
+ return false;
}
return true;
@@ -3779,8 +3766,6 @@ void brcms_c_init(struct brcms_c_info *wlc)
{
struct d11regs *regs;
u16 chanspec;
- int i;
- struct brcms_bss_cfg *bsscfg;
bool mute = false;
BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);
@@ -3806,32 +3791,24 @@ void brcms_c_init(struct brcms_c_info *wlc)
brcms_c_reprate_init(wlc);
/* write ethernet address to core */
- FOREACH_BSS(wlc, i, bsscfg)
- brcms_c_set_mac(bsscfg);
- brcms_c_set_bssid(bsscfg);
- END_FOREACH_BSS()
+ brcms_c_set_mac(wlc->bsscfg);
+ brcms_c_set_bssid(wlc->bsscfg);
/* Update tsf_cfprep if associated and up */
- if (wlc->pub->associated) {
- FOREACH_BSS(wlc, i, bsscfg)
- if (bsscfg->up) {
- u32 bi;
+ if (wlc->pub->associated && wlc->bsscfg->up) {
+ u32 bi;
- /* get beacon period and convert to uS */
- bi = bsscfg->current_bss->beacon_period << 10;
- /*
- * update since init path would reset
- * to default value
- */
- W_REG(®s->tsf_cfprep,
- (bi << CFPREP_CBI_SHIFT));
-
- /* Update maccontrol PM related bits */
- brcms_c_set_ps_ctrl(wlc);
+ /* get beacon period and convert to uS */
+ bi = wlc->bsscfg->current_bss->beacon_period << 10;
+ /*
+ * update since init path would reset
+ * to default value
+ */
+ W_REG(®s->tsf_cfprep,
+ (bi << CFPREP_CBI_SHIFT));
- break;
- }
- END_FOREACH_BSS()
+ /* Update maccontrol PM related bits */
+ brcms_c_set_ps_ctrl(wlc);
}
brcms_c_bandinit_ordered(wlc, chanspec);
@@ -4021,26 +3998,13 @@ void brcms_c_switch_shortslot(struct brcms_c_info *wlc, bool shortslot)
brcms_b_set_shortslot(wlc->hw, shortslot);
}
-/*
- * propagate home chanspec to all bsscfgs in
- * case bsscfg->current_bss->chanspec is referenced
- */
void brcms_c_set_home_chanspec(struct brcms_c_info *wlc, u16 chanspec)
{
if (wlc->home_chanspec != chanspec) {
- int idx;
- struct brcms_bss_cfg *cfg;
-
wlc->home_chanspec = chanspec;
- FOREACH_BSS(wlc, idx, cfg)
- if (!cfg->associated)
- continue;
-
- cfg->current_bss->chanspec = chanspec;
- END_FOREACH_BSS()
-
-
+ if (wlc->bsscfg->associated)
+ wlc->bsscfg->current_bss->chanspec = chanspec;
}
}
@@ -4092,8 +4056,7 @@ brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, u16 chanspec,
static void brcms_c_setband(struct brcms_c_info *wlc,
uint bandunit)
{
- int idx;
- struct brcms_bss_cfg *cfg;
+ struct brcms_bss_cfg *cfg = wlc->bsscfg;
wlc->band = wlc->bandstate[bandunit];
@@ -4101,11 +4064,9 @@ static void brcms_c_setband(struct brcms_c_info *wlc,
return;
/* wait for at least one beacon before entering sleeping state */
- for (idx = 0; idx < BRCMS_MAXBSSCFG; idx++) {
- cfg = wlc->bsscfg[idx];
- if (cfg && cfg->associated)
- cfg->PMawakebcn = true;
- }
+ if (cfg->associated)
+ cfg->PMawakebcn = true;
+
brcms_c_set_ps_ctrl(wlc);
/* band-specific initializations */
@@ -5427,7 +5388,7 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
goto fail;
}
- wlc->bsscfg[0] = wlc->cfg;
+ wlc->bsscfg = wlc->cfg;
wlc->cfg->_idx = 0;
wlc->cfg->wlc = wlc;
@@ -5840,19 +5801,15 @@ int brcms_c_up(struct brcms_c_info *wlc)
if (status == -ENOMEDIUM) {
if (!mboolisset
(wlc->pub->radio_disabled, WL_RADIO_HW_DISABLE)) {
- int idx;
- struct brcms_bss_cfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg = wlc->bsscfg;
mboolset(wlc->pub->radio_disabled,
WL_RADIO_HW_DISABLE);
- FOREACH_BSS(wlc, idx, bsscfg)
- if (!bsscfg->enable || !bsscfg->BSS)
- continue;
- wiphy_err(wlc->wiphy, "wl%d.%d: up"
+ if (bsscfg->enable && bsscfg->BSS)
+ wiphy_err(wlc->wiphy, "wl%d: up"
": rfdisable -> "
"bsscfg_disable()\n",
- wlc->pub->unit, idx);
- END_FOREACH_BSS()
+ wlc->pub->unit);
}
}
}
@@ -8993,14 +8950,10 @@ void brcms_c_bss_update_beacon(struct brcms_c_info *wlc,
*/
void brcms_c_update_beacon(struct brcms_c_info *wlc)
{
- int idx;
- struct brcms_bss_cfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg = wlc->bsscfg;
- /* update AP or IBSS beacons */
- FOREACH_BSS(wlc, idx, bsscfg)
- if (bsscfg->up && !bsscfg->BSS)
- brcms_c_bss_update_beacon(wlc, bsscfg);
- END_FOREACH_BSS()
+ if (bsscfg->up && !bsscfg->BSS)
+ brcms_c_bss_update_beacon(wlc, bsscfg);
}
/* Write ssid into shared memory */
@@ -9020,14 +8973,11 @@ void brcms_c_shm_ssid_upd(struct brcms_c_info *wlc, struct brcms_bss_cfg *cfg)
void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend)
{
- int idx;
- struct brcms_bss_cfg *bsscfg;
+ struct brcms_bss_cfg *bsscfg = wlc->bsscfg;
/* update AP or IBSS probe responses */
- FOREACH_BSS(wlc, idx, bsscfg)
- if (bsscfg->up && !bsscfg->BSS)
- brcms_c_bss_update_probe_resp(wlc, bsscfg, suspend);
- END_FOREACH_BSS()
+ if (bsscfg->up && !bsscfg->BSS)
+ brcms_c_bss_update_probe_resp(wlc, bsscfg, suspend);
}
void
@@ -9105,12 +9055,7 @@ int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu, uint *fifop)
/* init tx reported rate mechanism */
void brcms_c_reprate_init(struct brcms_c_info *wlc)
{
- int i;
- struct brcms_bss_cfg *bsscfg;
-
- FOREACH_BSS(wlc, i, bsscfg)
- brcms_c_bsscfg_reprate_init(bsscfg);
- END_FOREACH_BSS()
+ brcms_c_bsscfg_reprate_init(wlc->bsscfg);
}
/* per bsscfg init tx reported rate mechanism */
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 1572e46..ede4aef 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -564,7 +564,7 @@ struct brcms_c_info {
u16 tx_prec_map;
u16 fifo2prec_map[NFIFO];
- struct brcms_bss_cfg *bsscfg[BRCMS_MAXBSSCFG];
+ struct brcms_bss_cfg *bsscfg;
struct brcms_bss_cfg *cfg;
/* tx queue */
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index ace210c..415ab8b 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -244,11 +244,6 @@
* ********************************************************************
*/
-/* NetBSD also needs to keep track of this */
-
-/* max # BSS configs */
-#define BRCMS_MAXBSSCFG (1)
-
#define BCMMSG(dev, fmt, args...) \
do { \
if (brcm_msg_level & LOG_TRACE_VAL) \
--
1.7.1
^ permalink raw reply related
* [PATCH v3 07/25] staging: brcm80211: removed unused softmac workaround
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Roland Vossen <rvossen@broadcom.com>
WAR16165 is only used on older PCI chips, the driver does not support
these chips.
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/aiutils.c | 9 -------
drivers/staging/brcm80211/brcmsmac/aiutils.h | 2 -
drivers/staging/brcm80211/brcmsmac/d11.h | 3 +-
drivers/staging/brcm80211/brcmsmac/main.c | 31 --------------------------
drivers/staging/brcm80211/brcmsmac/main.h | 5 ----
5 files changed, 1 insertions(+), 49 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.c b/drivers/staging/brcm80211/brcmsmac/aiutils.c
index d05c4ba..790fdce 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.c
@@ -1852,15 +1852,6 @@ int ai_devpath(struct si_pub *sih, char *path, int size)
return 0;
}
-bool ai_pci_war16165(struct si_pub *sih)
-{
- struct si_info *sii;
-
- sii = (struct si_info *)sih;
-
- return PCI(sii) && (sih->buscorerev <= 10);
-}
-
void ai_pci_up(struct si_pub *sih)
{
struct si_info *sii;
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.h b/drivers/staging/brcm80211/brcmsmac/aiutils.h
index a776945..3917192 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.h
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.h
@@ -322,8 +322,6 @@ extern void ai_write_wrap_reg(struct si_pub *sih, u32 offset, u32 val);
extern struct si_pub *ai_attach(void *regs, struct pci_dev *sdh, char **vars,
uint *varsz);
extern void ai_detach(struct si_pub *sih);
-extern bool ai_pci_war16165(struct si_pub *sih);
-
extern uint ai_coreid(struct si_pub *sih);
extern uint ai_corerev(struct si_pub *sih);
extern uint ai_corereg(struct si_pub *sih, uint coreidx, uint regoff, uint mask,
diff --git a/drivers/staging/brcm80211/brcmsmac/d11.h b/drivers/staging/brcm80211/brcmsmac/d11.h
index 14e60a5..cbb574a 100644
--- a/drivers/staging/brcm80211/brcmsmac/d11.h
+++ b/drivers/staging/brcm80211/brcmsmac/d11.h
@@ -1330,8 +1330,7 @@ struct shm_acparams {
#define MHF1_FORCEFASTCLK 0x0400
/* Flags in M_HOST_FLAGS2 */
-/* PR16165WAR : Enable ucode PCI slow clock WAR */
-#define MHF2_PCISLOWCLKWAR 0x0008
+
/* Flush BCMC FIFO immediately */
#define MHF2_TXBCMC_NOW 0x0040
/* Enable ucode/hw power control */
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 4d5c842..3ec952c 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -829,19 +829,6 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
return n >= bound_limit;
}
-static void brcms_c_war16165(struct brcms_c_info *wlc, bool tx)
-{
- if (tx) {
- /* the post-increment is used in STAY_AWAKE macro */
- if (wlc->txpend16165war++ == 0)
- brcms_c_set_ps_ctrl(wlc);
- } else {
- wlc->txpend16165war--;
- if (wlc->txpend16165war == 0)
- brcms_c_set_ps_ctrl(wlc);
- }
-}
-
/* process an individual struct tx_status */
static bool
brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
@@ -879,8 +866,6 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
}
p = dma_getnexttxp(wlc->hw->di[queue], DMA_RANGE_TRANSMITTED);
- if (wlc->war16165)
- brcms_c_war16165(wlc, false);
if (p == NULL)
goto fatal;
@@ -3109,8 +3094,6 @@ static void brcms_c_flushqueues(struct brcms_c_info *wlc)
struct brcms_hardware *wlc_hw = wlc->hw;
uint i;
- wlc->txpend16165war = 0;
-
/* free any posted tx packets */
for (i = 0; i < NFIFO; i++)
if (wlc_hw->di[i]) {
@@ -3532,9 +3515,6 @@ static void brcms_b_coreinit(struct brcms_c_info *wlc)
AND_REG(®s->ifs_ctl, 0x0FFF);
W_REG(®s->ifs_aifsn, EDCF_AIFSN_MIN);
- /* dma initializations */
- wlc->txpend16165war = 0;
-
/* init the tx dma engines */
for (i = 0; i < NFIFO; i++) {
if (wlc_hw->di[i])
@@ -4832,9 +4812,6 @@ static int brcms_b_attach(struct brcms_c_info *wlc, u16 vendor, u16 device,
if (wlc_hw->boardflags & BFL_NOPLLDOWN)
brcms_b_pllreq(wlc_hw, true, BRCMS_PLLREQ_SHARED);
- if (ai_pci_war16165(wlc_hw->sih))
- wlc->war16165 = true;
-
/* check device id(srom, nvram etc.) to set bands */
if (wlc_hw->deviceid == BCM43224_D11N_ID ||
wlc_hw->deviceid == BCM43224_D11N_ID_VEN1)
@@ -5833,10 +5810,6 @@ int brcms_c_up(struct brcms_c_info *wlc)
/* Set EDCF hostflags */
brcms_c_mhf(wlc, MHF1, MHF1_EDCF, MHF1_EDCF, BRCM_BAND_ALL);
- if (wlc->war16165)
- brcms_c_mhf(wlc, MHF2, MHF2_PCISLOWCLKWAR, MHF2_PCISLOWCLKWAR,
- BRCM_BAND_ALL);
-
brcms_init(wlc->wl);
wlc->pub->up = true;
@@ -7816,10 +7789,6 @@ brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p,
if (fifo == TX_BCMC_FIFO)
frameid = le16_to_cpu(txh->TxFrameID);
- if (wlc->war16165)
- brcms_c_war16165(wlc, true);
-
-
/*
* Bump up pending count for if not using rpc. If rpc is
* used, this will be handled in brcms_b_txfifo()
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index d6de9c3..717843a 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -416,8 +416,6 @@ struct brcms_txq_info {
* band: pointer to active per-band state.
* corestate: per-core state (one per hw core).
* bandstate: per-band state (one per phy/radio).
- * war16165: PCI slow clock 16165 war flag.
- * txpend16165war: PCI slow clock 16165 war flag.
* qvalid: DirFrmQValid and BcMcFrmQValid.
* ampdu: ampdu module handler.
* asi: antsel module handler.
@@ -508,9 +506,6 @@ struct brcms_c_info {
struct brcms_core *corestate;
struct brcms_band *bandstate[MAXBANDS];
- bool war16165;
- uint txpend16165war;
-
/* packet queue */
uint qvalid;
--
1.7.1
^ permalink raw reply related
* [PATCH v3 04/25] staging: brcm80211: removed redundant wlc->cfg struct member
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-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 v3 01/25] staging: brcm80211: remove uncoditional code blocks from brcmsmac
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
Using a block statement to scope function variables is not
common in linux kernel development. Browsed through the brcmsmac
to remove those.
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/main.c | 9 +--
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 31 +++----
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 106 ++++++++++------------
3 files changed, 63 insertions(+), 83 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 2c9ac6d..d6b43ff 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -5076,7 +5076,7 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
{
struct brcms_c_info *wlc;
uint err = 0;
- uint j;
+ uint i, j;
struct brcms_pub *pub;
uint n_disabled;
@@ -5149,11 +5149,8 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
wlc->stf->hw_rxchain);
/* pull up some info resulting from the low attach */
- {
- int i;
- for (i = 0; i < NFIFO; i++)
- wlc->core->txavail[i] = wlc->hw->txavail[i];
- }
+ for (i = 0; i < NFIFO; i++)
+ wlc->core->txavail[i] = wlc->hw->txavail[i];
brcms_b_hw_etheraddr(wlc->hw, wlc->perm_etheraddr);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 196a595..a26c682 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -1199,12 +1199,7 @@ static bool wlc_phy_cal_txpower_recalc_sw(struct brcms_phy *pi)
void wlc_phy_switch_radio(struct brcms_phy_pub *pih, bool on)
{
struct brcms_phy *pi = (struct brcms_phy *) pih;
-
- {
- uint mc;
-
- mc = R_REG(&pi->regs->maccontrol);
- }
+ (void)R_REG(&pi->regs->maccontrol);
if (ISNPHY(pi)) {
wlc_phy_switch_radio_nphy(pi, on);
@@ -1696,26 +1691,22 @@ void wlc_phy_txpower_recalc_target(struct brcms_phy *pi)
band,
rate);
- {
-
- wlc_phy_txpower_sromlimit((struct brcms_phy_pub *) pi,
- target_chan,
- &mintxpwr, &maxtxpwr, rate);
+ wlc_phy_txpower_sromlimit((struct brcms_phy_pub *) pi,
+ target_chan,
+ &mintxpwr, &maxtxpwr, rate);
- maxtxpwr = min(maxtxpwr, pi->txpwr_limit[rate]);
+ maxtxpwr = min(maxtxpwr, pi->txpwr_limit[rate]);
- maxtxpwr =
- (maxtxpwr > pactrl) ? (maxtxpwr - pactrl) : 0;
+ maxtxpwr = (maxtxpwr > pactrl) ? (maxtxpwr - pactrl) : 0;
- maxtxpwr = (maxtxpwr > 6) ? (maxtxpwr - 6) : 0;
+ maxtxpwr = (maxtxpwr > 6) ? (maxtxpwr - 6) : 0;
- maxtxpwr = min(maxtxpwr, tx_pwr_target[rate]);
+ maxtxpwr = min(maxtxpwr, tx_pwr_target[rate]);
- if (pi->txpwr_percent <= 100)
- maxtxpwr = (maxtxpwr * pi->txpwr_percent) / 100;
+ if (pi->txpwr_percent <= 100)
+ maxtxpwr = (maxtxpwr * pi->txpwr_percent) / 100;
- tx_pwr_target[rate] = max(maxtxpwr, mintxpwr);
- }
+ tx_pwr_target[rate] = max(maxtxpwr, mintxpwr);
tx_pwr_target[rate] =
min(tx_pwr_target[rate], pi->txpwr_env_limit[rate]);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index 46661b8..fdcea56 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -69,6 +69,14 @@
#define LCN_TEMPSENSE_OFFSET 80812
#define LCN_TEMPSENSE_DEN 2647
+#define LCN_BW_LMT 200
+#define LCN_CUR_LMT 1250
+#define LCN_MULT 1
+#define LCN_VCO_DIV 30
+#define LCN_OFFSET 680
+#define LCN_FACT 490
+#define LCN_CUR_DIV 2640
+
#define LCNPHY_txgainctrlovrval1_pagain_ovr_val1_SHIFT \
(0 + 8)
#define LCNPHY_txgainctrlovrval1_pagain_ovr_val1_MASK \
@@ -1054,21 +1062,17 @@ static int wlc_lcnphy_calc_floor(s16 coeff_x, int type)
static void
wlc_lcnphy_get_tx_gain(struct brcms_phy *pi, struct lcnphy_txgains *gains)
{
- u16 dac_gain;
+ u16 dac_gain, rfgain0, rfgain1;
dac_gain = read_phy_reg(pi, 0x439) >> 0;
gains->dac_gain = (dac_gain & 0x380) >> 7;
- {
- u16 rfgain0, rfgain1;
-
- rfgain0 = (read_phy_reg(pi, 0x4b5) & (0xffff << 0)) >> 0;
- rfgain1 = (read_phy_reg(pi, 0x4fb) & (0x7fff << 0)) >> 0;
+ rfgain0 = (read_phy_reg(pi, 0x4b5) & (0xffff << 0)) >> 0;
+ rfgain1 = (read_phy_reg(pi, 0x4fb) & (0x7fff << 0)) >> 0;
- gains->gm_gain = rfgain0 & 0xff;
- gains->pga_gain = (rfgain0 >> 8) & 0xff;
- gains->pad_gain = rfgain1 & 0xff;
- }
+ gains->gm_gain = rfgain0 & 0xff;
+ gains->pga_gain = (rfgain0 >> 8) & 0xff;
+ gains->pad_gain = rfgain1 & 0xff;
}
@@ -1634,6 +1638,9 @@ wlc_lcnphy_radio_2064_channel_tune_4313(struct brcms_phy *pi, u8 channel)
u32 div_int, div_frac, fvco3, fpfd, fref3, fcal_div;
u16 loop_bw, d30, setCount;
+ u8 h29, h28_ten, e30, h30_ten, cp_current;
+ u16 g30, d28;
+
ci = &chan_info_2064_lcnphy[0];
rfpll_doubler = 1;
@@ -1746,27 +1753,18 @@ wlc_lcnphy_radio_2064_channel_tune_4313(struct brcms_phy *pi, u8 channel)
write_radio_reg(pi, RADIO_2064_REG042, 0xA3);
write_radio_reg(pi, RADIO_2064_REG043, 0x0C);
- {
- u8 h29, h23, c28, d29, h28_ten, e30, h30_ten, cp_current;
- u16 c29, c38, c30, g30, d28;
- c29 = loop_bw;
- d29 = 200;
- c38 = 1250;
- h29 = d29 / c29;
- h23 = 1;
- c28 = 30;
- d28 = (((PLL_2064_HIGH_END_KVCO - PLL_2064_LOW_END_KVCO) *
- (fvco3 / 2 - PLL_2064_LOW_END_VCO)) /
- (PLL_2064_HIGH_END_VCO - PLL_2064_LOW_END_VCO))
- + PLL_2064_LOW_END_KVCO;
- h28_ten = (d28 * 10) / c28;
- c30 = 2640;
- e30 = (d30 - 680) / 490;
- g30 = 680 + (e30 * 490);
- h30_ten = (g30 * 10) / c30;
- cp_current = ((c38 * h29 * h23 * 100) / h28_ten) / h30_ten;
- mod_radio_reg(pi, RADIO_2064_REG03C, 0x3f, cp_current);
- }
+ h29 = LCN_BW_LMT / loop_bw;
+ d28 = (((PLL_2064_HIGH_END_KVCO - PLL_2064_LOW_END_KVCO) *
+ (fvco3 / 2 - PLL_2064_LOW_END_VCO)) /
+ (PLL_2064_HIGH_END_VCO - PLL_2064_LOW_END_VCO))
+ + PLL_2064_LOW_END_KVCO;
+ h28_ten = (d28 * 10) / LCN_VCO_DIV;
+ e30 = (d30 - LCN_OFFSET) / LCN_FACT;
+ g30 = LCN_OFFSET + (e30 * LCN_FACT);
+ h30_ten = (g30 * 10) / LCN_CUR_DIV;
+ cp_current = ((LCN_CUR_LMT * h29 * LCN_MULT * 100) / h28_ten) / h30_ten;
+ mod_radio_reg(pi, RADIO_2064_REG03C, 0x3f, cp_current);
+
if (channel >= 1 && channel <= 5)
write_radio_reg(pi, RADIO_2064_REG03C, 0x8);
else
@@ -4838,18 +4836,13 @@ static bool wlc_phy_txpwr_srom_read_lcnphy(struct brcms_phy *pi)
pi_lcn->lcnphy_rssi_vc = (u8) PHY_GETINTVAR(pi, "rssismc2g");
pi_lcn->lcnphy_rssi_gs = (u8) PHY_GETINTVAR(pi, "rssisav2g");
- {
- pi_lcn->lcnphy_rssi_vf_lowtemp = pi_lcn->lcnphy_rssi_vf;
- pi_lcn->lcnphy_rssi_vc_lowtemp = pi_lcn->lcnphy_rssi_vc;
- pi_lcn->lcnphy_rssi_gs_lowtemp = pi_lcn->lcnphy_rssi_gs;
-
- pi_lcn->lcnphy_rssi_vf_hightemp =
- pi_lcn->lcnphy_rssi_vf;
- pi_lcn->lcnphy_rssi_vc_hightemp =
- pi_lcn->lcnphy_rssi_vc;
- pi_lcn->lcnphy_rssi_gs_hightemp =
- pi_lcn->lcnphy_rssi_gs;
- }
+ pi_lcn->lcnphy_rssi_vf_lowtemp = pi_lcn->lcnphy_rssi_vf;
+ pi_lcn->lcnphy_rssi_vc_lowtemp = pi_lcn->lcnphy_rssi_vc;
+ pi_lcn->lcnphy_rssi_gs_lowtemp = pi_lcn->lcnphy_rssi_gs;
+
+ pi_lcn->lcnphy_rssi_vf_hightemp = pi_lcn->lcnphy_rssi_vf;
+ pi_lcn->lcnphy_rssi_vc_hightemp = pi_lcn->lcnphy_rssi_vc;
+ pi_lcn->lcnphy_rssi_gs_hightemp = pi_lcn->lcnphy_rssi_gs;
txpwr = (s8) PHY_GETINTVAR(pi, "maxp2ga0");
pi->tx_srom_max_2g = txpwr;
@@ -5098,6 +5091,8 @@ s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index)
s32 log_val, gain_mismatch, desired_gain, input_power_offset_db,
input_power_db;
s32 received_power, temperature;
+ u32 power;
+ u32 msb1, msb2, val1, val2, diff1, diff2;
uint freq;
struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy;
@@ -5107,20 +5102,17 @@ s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index)
nominal_power_db = read_phy_reg(pi, 0x425) >> 8;
- {
- u32 power = (received_power * 16);
- u32 msb1, msb2, val1, val2, diff1, diff2;
- msb1 = ffs(power) - 1;
- msb2 = msb1 + 1;
- val1 = 1 << msb1;
- val2 = 1 << msb2;
- diff1 = (power - val1);
- diff2 = (val2 - power);
- if (diff1 < diff2)
- log_val = msb1;
- else
- log_val = msb2;
- }
+ power = (received_power * 16);
+ msb1 = ffs(power) - 1;
+ msb2 = msb1 + 1;
+ val1 = 1 << msb1;
+ val2 = 1 << msb2;
+ diff1 = (power - val1);
+ diff2 = (val2 - power);
+ if (diff1 < diff2)
+ log_val = msb1;
+ else
+ log_val = msb2;
log_val = log_val * 3;
--
1.7.1
^ permalink raw reply related
* [PATCH v3 02/25] staging: brcm80211: removed unused argument from softmac functions
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Roland Vossen <rvossen@broadcom.com>
Parameter 's2' was unused. Affected function was only used internally
to main.c and has been made static and moved above its callers.
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/main.c | 380 ++++++++++++++---------------
drivers/staging/brcm80211/brcmsmac/main.h | 2 -
2 files changed, 188 insertions(+), 194 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index d6b43ff..d160212 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -830,9 +830,193 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
return n >= bound_limit;
}
+static void brcms_c_war16165(struct brcms_c_info *wlc, bool tx)
+{
+ if (tx) {
+ /* the post-increment is used in STAY_AWAKE macro */
+ if (wlc->txpend16165war++ == 0)
+ brcms_c_set_ps_ctrl(wlc);
+ } else {
+ wlc->txpend16165war--;
+ if (wlc->txpend16165war == 0)
+ brcms_c_set_ps_ctrl(wlc);
+ }
+}
+
+/* process an individual struct tx_status */
static bool
-brcms_b_dotxstatus(struct brcms_hardware *wlc_hw, struct tx_status *txs,
- u32 s2)
+brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
+{
+ struct sk_buff *p;
+ uint queue;
+ struct d11txh *txh;
+ struct scb *scb = NULL;
+ bool free_pdu;
+ int tx_rts, tx_frame_count, tx_rts_count;
+ uint totlen, supr_status;
+ bool lastframe;
+ struct ieee80211_hdr *h;
+ u16 mcl;
+ struct ieee80211_tx_info *tx_info;
+ struct ieee80211_tx_rate *txrate;
+ int i;
+
+ /* discard intermediate indications for ucode with one legitimate case:
+ * e.g. if "useRTS" is set. ucode did a successful rts/cts exchange,
+ * but the subsequent tx of DATA failed. so it will start rts/cts
+ * from the beginning (resetting the rts transmission count)
+ */
+ if (!(txs->status & TX_STATUS_AMPDU)
+ && (txs->status & TX_STATUS_INTERMEDIATE)) {
+ wiphy_err(wlc->wiphy, "%s: INTERMEDIATE but not AMPDU\n",
+ __func__);
+ return false;
+ }
+
+ queue = txs->frameid & TXFID_QUEUE_MASK;
+ if (queue >= NFIFO) {
+ p = NULL;
+ goto fatal;
+ }
+
+ p = dma_getnexttxp(wlc->hw->di[queue], DMA_RANGE_TRANSMITTED);
+ if (wlc->war16165)
+ brcms_c_war16165(wlc, false);
+ if (p == NULL)
+ goto fatal;
+
+ txh = (struct d11txh *) (p->data);
+ mcl = le16_to_cpu(txh->MacTxControlLow);
+
+ if (txs->phyerr) {
+ if (brcm_msg_level & LOG_ERROR_VAL) {
+ wiphy_err(wlc->wiphy, "phyerr 0x%x, rate 0x%x\n",
+ txs->phyerr, txh->MainRates);
+ brcms_c_print_txdesc(txh);
+ }
+ brcms_c_print_txstatus(txs);
+ }
+
+ if (txs->frameid != cpu_to_le16(txh->TxFrameID))
+ goto fatal;
+ tx_info = IEEE80211_SKB_CB(p);
+ h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
+
+ if (tx_info->control.sta)
+ scb = (struct scb *)tx_info->control.sta->drv_priv;
+
+ if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
+ brcms_c_ampdu_dotxstatus(wlc->ampdu, scb, p, txs);
+ return false;
+ }
+
+ supr_status = txs->status & TX_STATUS_SUPR_MASK;
+ if (supr_status == TX_STATUS_SUPR_BADCH)
+ BCMMSG(wlc->wiphy,
+ "%s: Pkt tx suppressed, possibly channel %d\n",
+ __func__, CHSPEC_CHANNEL(wlc->default_bss->chanspec));
+
+ tx_rts = cpu_to_le16(txh->MacTxControlLow) & TXC_SENDRTS;
+ tx_frame_count =
+ (txs->status & TX_STATUS_FRM_RTX_MASK) >> TX_STATUS_FRM_RTX_SHIFT;
+ tx_rts_count =
+ (txs->status & TX_STATUS_RTS_RTX_MASK) >> TX_STATUS_RTS_RTX_SHIFT;
+
+ lastframe = !ieee80211_has_morefrags(h->frame_control);
+
+ if (!lastframe) {
+ wiphy_err(wlc->wiphy, "Not last frame!\n");
+ } else {
+ /*
+ * Set information to be consumed by Minstrel ht.
+ *
+ * The "fallback limit" is the number of tx attempts a given
+ * MPDU is sent at the "primary" rate. Tx attempts beyond that
+ * limit are sent at the "secondary" rate.
+ * A 'short frame' does not exceed RTS treshold.
+ */
+ u16 sfbl, /* Short Frame Rate Fallback Limit */
+ lfbl, /* Long Frame Rate Fallback Limit */
+ fbl;
+
+ if (queue < AC_COUNT) {
+ sfbl = GFIELD(wlc->wme_retries[wme_fifo2ac[queue]],
+ EDCF_SFB);
+ lfbl = GFIELD(wlc->wme_retries[wme_fifo2ac[queue]],
+ EDCF_LFB);
+ } else {
+ sfbl = wlc->SFBL;
+ lfbl = wlc->LFBL;
+ }
+
+ txrate = tx_info->status.rates;
+ if (txrate[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
+ fbl = lfbl;
+ else
+ fbl = sfbl;
+
+ ieee80211_tx_info_clear_status(tx_info);
+
+ if ((tx_frame_count > fbl) && (txrate[1].idx >= 0)) {
+ /*
+ * rate selection requested a fallback rate
+ * and we used it
+ */
+ txrate[0].count = fbl;
+ txrate[1].count = tx_frame_count - fbl;
+ } else {
+ /*
+ * rate selection did not request fallback rate, or
+ * we didn't need it
+ */
+ txrate[0].count = tx_frame_count;
+ /*
+ * rc80211_minstrel.c:minstrel_tx_status() expects
+ * unused rates to be marked with idx = -1
+ */
+ txrate[1].idx = -1;
+ txrate[1].count = 0;
+ }
+
+ /* clear the rest of the rates */
+ for (i = 2; i < IEEE80211_TX_MAX_RATES; i++) {
+ txrate[i].idx = -1;
+ txrate[i].count = 0;
+ }
+
+ if (txs->status & TX_STATUS_ACK_RCV)
+ tx_info->flags |= IEEE80211_TX_STAT_ACK;
+ }
+
+ totlen = brcmu_pkttotlen(p);
+ free_pdu = true;
+
+ brcms_c_txfifo_complete(wlc, queue, 1);
+
+ if (lastframe) {
+ p->next = NULL;
+ p->prev = NULL;
+ /* remove PLCP & Broadcom tx descriptor header */
+ skb_pull(p, D11_PHY_HDR_LEN);
+ skb_pull(p, D11_TXH_LEN);
+ ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, p);
+ } else {
+ wiphy_err(wlc->wiphy, "%s: Not last frame => not calling "
+ "tx_status\n", __func__);
+ }
+
+ return false;
+
+ fatal:
+ if (p)
+ brcmu_pkt_buf_free_skb(p);
+
+ return true;
+
+}
+
+static bool
+brcms_b_dotxstatus(struct brcms_hardware *wlc_hw, struct tx_status *txs)
{
/* discard intermediate indications for ucode with one legitimate case:
* e.g. if "useRTS" is set. ucode did a successful rts/cts exchange,
@@ -843,7 +1027,7 @@ brcms_b_dotxstatus(struct brcms_hardware *wlc_hw, struct tx_status *txs,
&& (txs->status & TX_STATUS_INTERMEDIATE))
return false;
- return brcms_c_dotxstatus(wlc_hw->wlc, txs, s2);
+ return brcms_c_dotxstatus(wlc_hw->wlc, txs);
}
/* process tx completion events in BMAC
@@ -885,7 +1069,7 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
txs->phyerr = (s2 & TXS_PTX_MASK) >> TXS_PTX_SHIFT;
txs->lasttxtime = 0;
- *fatal = brcms_b_dotxstatus(wlc_hw, txs, s2);
+ *fatal = brcms_b_dotxstatus(wlc_hw, txs);
/* !give others some time to run! */
if (++n >= max_tx_num)
@@ -7654,19 +7838,6 @@ void brcms_c_send_q(struct brcms_c_info *wlc)
in_send_q = false;
}
-static void brcms_c_war16165(struct brcms_c_info *wlc, bool tx)
-{
- if (tx) {
- /* the post-increment is used in STAY_AWAKE macro */
- if (wlc->txpend16165war++ == 0)
- brcms_c_set_ps_ctrl(wlc);
- } else {
- wlc->txpend16165war--;
- if (wlc->txpend16165war == 0)
- brcms_c_set_ps_ctrl(wlc);
- }
-}
-
void
brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p,
bool commit, s8 txpktpend)
@@ -7978,181 +8149,6 @@ void brcms_c_tbtt(struct brcms_c_info *wlc)
wlc->qvalid |= MCMD_DIRFRMQVAL;
}
-/* process an individual struct tx_status */
-bool
-brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs, u32 frm_tx2)
-{
- struct sk_buff *p;
- uint queue;
- struct d11txh *txh;
- struct scb *scb = NULL;
- bool free_pdu;
- int tx_rts, tx_frame_count, tx_rts_count;
- uint totlen, supr_status;
- bool lastframe;
- struct ieee80211_hdr *h;
- u16 mcl;
- struct ieee80211_tx_info *tx_info;
- struct ieee80211_tx_rate *txrate;
- int i;
-
- /* Compiler reference to avoid unused variable warning */
- (void)(frm_tx2);
-
- /* discard intermediate indications for ucode with one legitimate case:
- * e.g. if "useRTS" is set. ucode did a successful rts/cts exchange,
- * but the subsequent tx of DATA failed. so it will start rts/cts
- * from the beginning (resetting the rts transmission count)
- */
- if (!(txs->status & TX_STATUS_AMPDU)
- && (txs->status & TX_STATUS_INTERMEDIATE)) {
- wiphy_err(wlc->wiphy, "%s: INTERMEDIATE but not AMPDU\n",
- __func__);
- return false;
- }
-
- queue = txs->frameid & TXFID_QUEUE_MASK;
- if (queue >= NFIFO) {
- p = NULL;
- goto fatal;
- }
-
- p = dma_getnexttxp(wlc->hw->di[queue], DMA_RANGE_TRANSMITTED);
- if (wlc->war16165)
- brcms_c_war16165(wlc, false);
- if (p == NULL)
- goto fatal;
-
- txh = (struct d11txh *) (p->data);
- mcl = le16_to_cpu(txh->MacTxControlLow);
-
- if (txs->phyerr) {
- if (brcm_msg_level & LOG_ERROR_VAL) {
- wiphy_err(wlc->wiphy, "phyerr 0x%x, rate 0x%x\n",
- txs->phyerr, txh->MainRates);
- brcms_c_print_txdesc(txh);
- }
- brcms_c_print_txstatus(txs);
- }
-
- if (txs->frameid != cpu_to_le16(txh->TxFrameID))
- goto fatal;
- tx_info = IEEE80211_SKB_CB(p);
- h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
-
- if (tx_info->control.sta)
- scb = (struct scb *)tx_info->control.sta->drv_priv;
-
- if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
- brcms_c_ampdu_dotxstatus(wlc->ampdu, scb, p, txs);
- return false;
- }
-
- supr_status = txs->status & TX_STATUS_SUPR_MASK;
- if (supr_status == TX_STATUS_SUPR_BADCH)
- BCMMSG(wlc->wiphy,
- "%s: Pkt tx suppressed, possibly channel %d\n",
- __func__, CHSPEC_CHANNEL(wlc->default_bss->chanspec));
-
- tx_rts = cpu_to_le16(txh->MacTxControlLow) & TXC_SENDRTS;
- tx_frame_count =
- (txs->status & TX_STATUS_FRM_RTX_MASK) >> TX_STATUS_FRM_RTX_SHIFT;
- tx_rts_count =
- (txs->status & TX_STATUS_RTS_RTX_MASK) >> TX_STATUS_RTS_RTX_SHIFT;
-
- lastframe = !ieee80211_has_morefrags(h->frame_control);
-
- if (!lastframe) {
- wiphy_err(wlc->wiphy, "Not last frame!\n");
- } else {
- /*
- * Set information to be consumed by Minstrel ht.
- *
- * The "fallback limit" is the number of tx attempts a given
- * MPDU is sent at the "primary" rate. Tx attempts beyond that
- * limit are sent at the "secondary" rate.
- * A 'short frame' does not exceed RTS treshold.
- */
- u16 sfbl, /* Short Frame Rate Fallback Limit */
- lfbl, /* Long Frame Rate Fallback Limit */
- fbl;
-
- if (queue < AC_COUNT) {
- sfbl = GFIELD(wlc->wme_retries[wme_fifo2ac[queue]],
- EDCF_SFB);
- lfbl = GFIELD(wlc->wme_retries[wme_fifo2ac[queue]],
- EDCF_LFB);
- } else {
- sfbl = wlc->SFBL;
- lfbl = wlc->LFBL;
- }
-
- txrate = tx_info->status.rates;
- if (txrate[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
- fbl = lfbl;
- else
- fbl = sfbl;
-
- ieee80211_tx_info_clear_status(tx_info);
-
- if ((tx_frame_count > fbl) && (txrate[1].idx >= 0)) {
- /*
- * rate selection requested a fallback rate
- * and we used it
- */
- txrate[0].count = fbl;
- txrate[1].count = tx_frame_count - fbl;
- } else {
- /*
- * rate selection did not request fallback rate, or
- * we didn't need it
- */
- txrate[0].count = tx_frame_count;
- /*
- * rc80211_minstrel.c:minstrel_tx_status() expects
- * unused rates to be marked with idx = -1
- */
- txrate[1].idx = -1;
- txrate[1].count = 0;
- }
-
- /* clear the rest of the rates */
- for (i = 2; i < IEEE80211_TX_MAX_RATES; i++) {
- txrate[i].idx = -1;
- txrate[i].count = 0;
- }
-
- if (txs->status & TX_STATUS_ACK_RCV)
- tx_info->flags |= IEEE80211_TX_STAT_ACK;
- }
-
- totlen = brcmu_pkttotlen(p);
- free_pdu = true;
-
- brcms_c_txfifo_complete(wlc, queue, 1);
-
- if (lastframe) {
- p->next = NULL;
- p->prev = NULL;
- /* remove PLCP & Broadcom tx descriptor header */
- skb_pull(p, D11_PHY_HDR_LEN);
- skb_pull(p, D11_TXH_LEN);
- ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, p);
- } else {
- wiphy_err(wlc->wiphy, "%s: Not last frame => not calling "
- "tx_status\n", __func__);
- }
-
- return false;
-
- fatal:
- if (p)
- brcmu_pkt_buf_free_skb(p);
-
- return true;
-
-}
-
void
brcms_c_txfifo_complete(struct brcms_c_info *wlc, uint fifo, s8 txpktpend)
{
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index aa0bf03..1572e46 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -702,8 +702,6 @@ struct brcms_bss_cfg {
extern void brcms_c_fatal_error(struct brcms_c_info *wlc);
extern void brcms_b_rpc_watchdog(struct brcms_c_info *wlc);
extern void brcms_c_recv(struct brcms_c_info *wlc, struct sk_buff *p);
-extern bool brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs,
- u32 frm_tx2);
extern void brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo,
struct sk_buff *p,
bool commit, s8 txpktpend);
--
1.7.1
^ permalink raw reply related
* [PATCH v3 10/25] staging: brcm80211: remove unused function si_pmu_ilp_clock()
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
The function is not used in the driver and has been removed.
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/pmu.c | 22 ----------------------
drivers/staging/brcm80211/brcmsmac/pmu.h | 1 -
2 files changed, 0 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/pmu.c b/drivers/staging/brcm80211/brcmsmac/pmu.c
index 61ba373..6d4cd9f 100644
--- a/drivers/staging/brcm80211/brcmsmac/pmu.c
+++ b/drivers/staging/brcm80211/brcmsmac/pmu.c
@@ -202,28 +202,6 @@ si_pmu_spuravoid_pllupdate(struct si_pub *sih, struct chipcregs *cc,
W_REG(&cc->pmucontrol, tmp);
}
-u32 si_pmu_ilp_clock(struct si_pub *sih)
-{
- static u32 ilpcycles_per_sec;
-
- if (!(sih->cccaps & CC_CAP_PMU))
- return ILP_CLOCK;
-
- if (ilpcycles_per_sec == 0) {
- u32 start, end, delta;
- u32 origidx = ai_coreidx(sih);
- struct chipcregs *cc = ai_setcoreidx(sih, SI_CC_IDX);
- start = R_REG(&cc->pmutimer);
- mdelay(ILP_CALC_DUR);
- end = R_REG(&cc->pmutimer);
- delta = end - start;
- ilpcycles_per_sec = delta * (1000 / ILP_CALC_DUR);
- ai_setcoreidx(sih, origidx);
- }
-
- return ilpcycles_per_sec;
-}
-
u16 si_pmu_fast_pwrup_delay(struct si_pub *sih)
{
uint delay = PMU_MAX_TRANSITION_DLY;
diff --git a/drivers/staging/brcm80211/brcmsmac/pmu.h b/drivers/staging/brcm80211/brcmsmac/pmu.h
index 2917e6f..3a08c62 100644
--- a/drivers/staging/brcm80211/brcmsmac/pmu.h
+++ b/drivers/staging/brcm80211/brcmsmac/pmu.h
@@ -24,7 +24,6 @@ extern u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
extern void si_pmu_sprom_enable(struct si_pub *sih, bool enable);
extern u32 si_pmu_chipcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val);
extern u32 si_pmu_regcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val);
-extern u32 si_pmu_ilp_clock(struct si_pub *sih);
extern u32 si_pmu_alp_clock(struct si_pub *sih);
extern void si_pmu_pllupd(struct si_pub *sih);
extern void si_pmu_spuravoid(struct si_pub *sih, u8 spuravoid);
--
1.7.1
^ permalink raw reply related
* [PATCH v3 00/25] staging: brcm80211: 8th reaction for mainline patch #2
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317145530-18839-1-git-send-email-frankyl@broadcom.com>
Code clean up for softmac.
This patch series is in order to replace the following one:
Message-ID: <1317145530-18839-1-git-send-email-frankyl@broadcom.com>
V2:
* Rework some patches based on the comments from community
V3:
* Fix patch misorder of V2
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 (12):
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: 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 v3 05/25] staging: brcm80211: removed global var from aiutils.c
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Roland Vossen <rvossen@broadcom.com>
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/aiutils.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.c b/drivers/staging/brcm80211/brcmsmac/aiutils.c
index b7b0bdf..d05c4ba 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.c
@@ -477,9 +477,6 @@ struct aidmp {
u32 componentid3; /* 0xffc */
};
-/* global kernel resource */
-static struct si_info ksii;
-
/* EROM parsing */
static u32
@@ -1216,8 +1213,7 @@ void ai_detach(struct si_pub *sih)
pcicore_deinit(sii->pch);
sii->pch = NULL;
- if (sii != &ksii)
- kfree(sii);
+ kfree(sii);
}
/* register driver interrupt disabling and restoring callback functions */
--
1.7.1
^ permalink raw reply related
* [PATCH v3 25/25] staging: brcm80211: declared global vars in softmac phy as const
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
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 | 2 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 6 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 60 +++++++++++----------
3 files changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index f31ebe2..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},
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index bada928..a87e392 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -558,7 +558,7 @@ struct chan_info_2064_lcnphy {
u8 rxrf_rxrf_spare1;
};
-static struct chan_info_2064_lcnphy chan_info_2064_lcnphy[] = {
+static const struct chan_info_2064_lcnphy chan_info_2064_lcnphy[] = {
{1, 2412, 0x0B, 0x0A, 0x00, 0x07, 0x0A, 0x88, 0x88, 0x80},
{2, 2417, 0x0B, 0x0A, 0x00, 0x07, 0x0A, 0x88, 0x88, 0x80},
{3, 2422, 0x0B, 0x0A, 0x00, 0x07, 0x0A, 0x88, 0x88, 0x80},
@@ -575,7 +575,7 @@ static struct chan_info_2064_lcnphy chan_info_2064_lcnphy[] = {
{14, 2484, 0x0B, 0x0A, 0x00, 0x07, 0x0A, 0x88, 0x88, 0x80},
};
-static struct lcnphy_radio_regs lcnphy_radio_regs_2064[] = {
+static const struct lcnphy_radio_regs lcnphy_radio_regs_2064[] = {
{0x00, 0, 0, 0, 0},
{0x01, 0x64, 0x64, 0, 0},
{0x02, 0x20, 0x20, 0, 0},
@@ -4489,7 +4489,7 @@ static void wlc_lcnphy_rc_cal(struct brcms_phy *pi)
static void wlc_radio_2064_init(struct brcms_phy *pi)
{
u32 i;
- struct lcnphy_radio_regs *lcnphyregs = NULL;
+ const struct lcnphy_radio_regs *lcnphyregs = NULL;
lcnphyregs = lcnphy_radio_regs_2064;
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index a34d292..93ac12f 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -443,7 +443,7 @@ struct nphy_sfo_cfg {
u16 PHY_BW6;
};
-static struct chan_info_nphy_2055 chan_info_nphy_2055[] = {
+static const struct chan_info_nphy_2055 chan_info_nphy_2055[] = {
{
184, 4920, 3280, 0x71, 0x01, 0xEC, 0x0F, 0xFF, 0x01, 0x04, 0x0A,
0x00, 0x8F, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0x0F, 0x8F, 0xFF, 0x00, 0x0F,
@@ -942,7 +942,7 @@ static struct chan_info_nphy_2055 chan_info_nphy_2055[] = {
0x01, 0x80, 0x3E6, 0x3E2, 0x3DE, 0x41B, 0x41F, 0x424}
};
-static struct chan_info_nphy_radio205x chan_info_nphyrev3_2056[] = {
+static const struct chan_info_nphy_radio205x chan_info_nphyrev3_2056[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xff, 0x00, 0x08, 0x00, 0x7f,
@@ -1565,7 +1565,7 @@ static struct chan_info_nphy_radio205x chan_info_nphyrev3_2056[] = {
0x0f, 0x00, 0x0d, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};
-static struct chan_info_nphy_radio205x chan_info_nphyrev4_2056_A1[] = {
+static const struct chan_info_nphy_radio205x chan_info_nphyrev4_2056_A1[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xff, 0x00, 0x0e, 0x00, 0x7f,
@@ -2188,7 +2188,7 @@ static struct chan_info_nphy_radio205x chan_info_nphyrev4_2056_A1[] = {
0x0f, 0x00, 0x0e, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};
-static struct chan_info_nphy_radio205x chan_info_nphyrev5_2056v5[] = {
+static const struct chan_info_nphy_radio205x chan_info_nphyrev5_2056v5[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xff, 0x00, 0x0b, 0x00, 0x70,
@@ -2811,7 +2811,7 @@ static struct chan_info_nphy_radio205x chan_info_nphyrev5_2056v5[] = {
0x0d, 0x00, 0x08, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};
-static struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v6[] = {
+static const struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v6[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xfe, 0x00, 0x09, 0x00, 0x77,
@@ -3434,7 +3434,7 @@ static struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v6[] = {
0x09, 0x00, 0x09, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};
-static struct chan_info_nphy_radio205x chan_info_nphyrev5n6_2056v7[] = {
+static const struct chan_info_nphy_radio205x chan_info_nphyrev5n6_2056v7[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xff, 0x00, 0x0b, 0x00, 0x70,
@@ -4057,7 +4057,7 @@ static struct chan_info_nphy_radio205x chan_info_nphyrev5n6_2056v7[] = {
0x0d, 0x00, 0x08, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};
-static struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v8[] = {
+static const struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v8[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x04, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xfe, 0x00, 0x09, 0x00, 0x77,
@@ -4680,7 +4680,7 @@ static struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v8[] = {
0x09, 0x00, 0x09, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};
-static struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v11[] = {
+static const struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v11[] = {
{
184, 4920, 0xff, 0x01, 0x01, 0x01, 0xec, 0x05, 0x05, 0x02, 0x0c, 0x01,
0x00, 0x00, 0x00, 0x8f, 0x0f, 0x00, 0xff, 0xfe, 0x00, 0x09, 0x00, 0x77,
@@ -5303,7 +5303,7 @@ static struct chan_info_nphy_radio205x chan_info_nphyrev6_2056v11[] = {
0x09, 0x00, 0x09, 0x03e6, 0x03e2, 0x03de, 0x041b, 0x041f, 0x0424}
};
-static struct chan_info_nphy_radio2057 chan_info_nphyrev7_2057_rev4[] = {
+static const struct chan_info_nphy_radio2057 chan_info_nphyrev7_2057_rev4[] = {
{
184, 4920, 0x68, 0x16, 0x10, 0x0c, 0x0c, 0x0c, 0x30, 0xec, 0x01, 0x0f,
0x00, 0x0f, 0x00, 0xff, 0x00, 0x00, 0x0f, 0x0f, 0xf3, 0x00, 0xef, 0x00,
@@ -6166,7 +6166,8 @@ static struct chan_info_nphy_radio2057 chan_info_nphyrev7_2057_rev4[] = {
0x0424}
};
-static struct chan_info_nphy_radio2057_rev5 chan_info_nphyrev8_2057_rev5[] = {
+static const struct chan_info_nphy_radio2057_rev5
+chan_info_nphyrev8_2057_rev5[] = {
{
1, 2412, 0x48, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x6c, 0x09, 0x0d,
0x08, 0x0e, 0x61, 0x03, 0xff, 0x61, 0x03, 0xff, 0x03c9, 0x03c5, 0x03c1,
@@ -6225,7 +6226,8 @@ static struct chan_info_nphy_radio2057_rev5 chan_info_nphyrev8_2057_rev5[] = {
0x041b, 0x041f, 0x0424}
};
-static struct chan_info_nphy_radio2057_rev5 chan_info_nphyrev9_2057_rev5v1[] = {
+static const struct chan_info_nphy_radio2057_rev5
+chan_info_nphyrev9_2057_rev5v1[] = {
{
1, 2412, 0x48, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x6c, 0x09, 0x0d,
0x08, 0x0e, 0x61, 0x03, 0xff, 0x61, 0x03, 0xff, 0x03c9, 0x03c5, 0x03c1,
@@ -6284,7 +6286,7 @@ static struct chan_info_nphy_radio2057_rev5 chan_info_nphyrev9_2057_rev5v1[] = {
0x041b, 0x041f, 0x0424}
};
-static struct chan_info_nphy_radio2057 chan_info_nphyrev8_2057_rev7[] = {
+static const struct chan_info_nphy_radio2057 chan_info_nphyrev8_2057_rev7[] = {
{
184, 4920, 0x68, 0x16, 0x10, 0x0c, 0x0c, 0x0c, 0x30, 0xec, 0x01, 0x0f,
0x00, 0x0f, 0x00, 0xff, 0x00, 0xd3, 0x0f, 0x0f, 0xd3, 0x00, 0xff, 0x00,
@@ -7025,7 +7027,7 @@ static struct chan_info_nphy_radio2057 chan_info_nphyrev8_2057_rev7[] = {
0x0424}
};
-static struct chan_info_nphy_radio2057 chan_info_nphyrev8_2057_rev8[] = {
+static const struct chan_info_nphy_radio2057 chan_info_nphyrev8_2057_rev8[] = {
{
186, 4930, 0x6b, 0x16, 0x10, 0x0c, 0x0c, 0x0c, 0x30, 0xed, 0x01, 0x0f,
0x00, 0x0f, 0x00, 0xff, 0x00, 0xd3, 0x0f, 0x0f, 0xd3, 0x00, 0xff, 0x00,
@@ -20387,15 +20389,15 @@ void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on)
static bool
wlc_phy_chan2freq_nphy(struct brcms_phy *pi, uint channel, int *f,
- struct chan_info_nphy_radio2057 **t0,
- struct chan_info_nphy_radio205x **t1,
- struct chan_info_nphy_radio2057_rev5 **t2,
- struct chan_info_nphy_2055 **t3)
+ const struct chan_info_nphy_radio2057 **t0,
+ const struct chan_info_nphy_radio205x **t1,
+ const struct chan_info_nphy_radio2057_rev5 **t2,
+ const struct chan_info_nphy_2055 **t3)
{
uint i;
- struct chan_info_nphy_radio2057 *chan_info_tbl_p_0 = NULL;
- struct chan_info_nphy_radio205x *chan_info_tbl_p_1 = NULL;
- struct chan_info_nphy_radio2057_rev5 *chan_info_tbl_p_2 = NULL;
+ const struct chan_info_nphy_radio2057 *chan_info_tbl_p_0 = NULL;
+ const struct chan_info_nphy_radio205x *chan_info_tbl_p_1 = NULL;
+ const struct chan_info_nphy_radio2057_rev5 *chan_info_tbl_p_2 = NULL;
u32 tbl_len = 0;
int freq = 0;
@@ -20550,10 +20552,10 @@ fail:
u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint channel)
{
int freq;
- struct chan_info_nphy_radio2057 *t0 = NULL;
- struct chan_info_nphy_radio205x *t1 = NULL;
- struct chan_info_nphy_radio2057_rev5 *t2 = NULL;
- struct chan_info_nphy_2055 *t3 = NULL;
+ const struct chan_info_nphy_radio2057 *t0 = NULL;
+ const struct chan_info_nphy_radio205x *t1 = NULL;
+ const struct chan_info_nphy_radio2057_rev5 *t2 = NULL;
+ const struct chan_info_nphy_2055 *t3 = NULL;
if (channel == 0)
channel = CHSPEC_CHANNEL(pi->radio_chanspec);
@@ -20573,7 +20575,7 @@ u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint channel)
static void
wlc_phy_chanspec_radio2055_setup(struct brcms_phy *pi,
- struct chan_info_nphy_2055 *ci)
+ const struct chan_info_nphy_2055 *ci)
{
write_radio_reg(pi, RADIO_2055_PLL_REF, ci->RF_pll_ref);
@@ -21294,10 +21296,10 @@ wlc_phy_chanspec_nphy_setup(struct brcms_phy *pi, u16 chanspec,
void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, u16 chanspec)
{
int freq;
- struct chan_info_nphy_radio2057 *t0 = NULL;
- struct chan_info_nphy_radio205x *t1 = NULL;
- struct chan_info_nphy_radio2057_rev5 *t2 = NULL;
- struct chan_info_nphy_2055 *t3 = NULL;
+ const struct chan_info_nphy_radio2057 *t0 = NULL;
+ const struct chan_info_nphy_radio205x *t1 = NULL;
+ const struct chan_info_nphy_radio2057_rev5 *t2 = NULL;
+ const struct chan_info_nphy_2055 *t3 = NULL;
if (!wlc_phy_chan2freq_nphy
(pi, CHSPEC_CHANNEL(chanspec), &freq, &t0, &t1, &t2, &t3))
--
1.7.1
^ permalink raw reply related
* [PATCH v3 09/25] staging: brcm80211: use fragment number provided in transmit frame
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
In the transmit path the field seq_ctrl is filled in, but the fragment
number was not properly determined.
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 074e16f..dfd67de 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -7100,7 +7100,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
scb->seqnum[p->priority]++;
/* extract fragment number from frame first */
- seq = le16_to_cpu(seq) & FRAGNUM_MASK;
+ seq = le16_to_cpu(h->seq_ctrl) & FRAGNUM_MASK;
seq |= (scb->seqnum[p->priority] << SEQNUM_SHIFT);
h->seq_ctrl = cpu_to_le16(seq);
--
1.7.1
^ permalink raw reply related
* [PATCH v3 22/25] staging: brcm80211: move rssi computation to place we need it
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
The rssi computation was done upon getting the frame from the
queue, but the value is needed when filling in the receive status
data for mac80211. The call to wlc_phy_rssi_compute() has been
deferred.
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/main.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 3e39407..bdc0611 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -828,11 +828,6 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
rxh->RxTSFTime = le16_to_cpu(rxh_le->RxTSFTime);
rxh->RxChan = le16_to_cpu(rxh_le->RxChan);
- /*
- * compute the RSSI from d11rxhdr and record it in wlc_rxd11hr
- */
- wlc_rxhdr->rssi = (s8)wlc_phy_rssi_compute(wlc_hw->band->pi,
- rxh);
brcms_c_recv(wlc_hw->wlc, p);
}
@@ -8172,7 +8167,7 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
rx_status->freq = ieee80211_dsss_chan_to_freq(channel);
}
- rx_status->signal = wlc_rxh->rssi;
+ rx_status->signal = wlc_phy_rssi_compute(wlc->hw->band->pi, rxh);
/* noise */
/* qual */
--
1.7.1
^ permalink raw reply related
* [PATCH v3 15/25] staging: brcm80211: removed global var global_scb from softmac
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Roland Vossen <rvossen@broadcom.com>
Global variables are undesirable unless they are read only. Removed by
instead using an already defined Station Control Block variable in a
per-device structure.
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/ampdu.c | 6 +++---
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 19 ++++---------------
drivers/staging/brcm80211/brcmsmac/main.c | 21 +++++++++++++--------
drivers/staging/brcm80211/brcmsmac/main.h | 4 ++++
drivers/staging/brcm80211/brcmsmac/pub.h | 1 -
5 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.c b/drivers/staging/brcm80211/brcmsmac/ampdu.c
index b94d60c..e29c62e 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.c
@@ -314,7 +314,7 @@ static void brcms_c_scb_ampdu_update_config(struct ampdu_info *ampdu,
static void brcms_c_scb_ampdu_update_config_all(struct ampdu_info *ampdu)
{
- brcms_c_scb_ampdu_update_config(ampdu, ampdu->wlc->pub->global_scb);
+ brcms_c_scb_ampdu_update_config(ampdu, &du->wlc->pri_scb);
}
static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
@@ -482,7 +482,7 @@ brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
struct scb_ampdu *scb_ampdu;
struct scb_ampdu_tid_ini *ini;
struct ampdu_info *ampdu = wlc->ampdu;
- struct scb *scb = wlc->pub->global_scb;
+ struct scb *scb = &wlc->pri_scb;
scb_ampdu = &scb->scb_ampdu;
if (!ampdu->ini_enable[tid]) {
@@ -542,7 +542,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_txq_info *qi,
f = ampdu->fifo_tb + prio2fifo[tid];
- scb = wlc->pub->global_scb;
+ scb = &wlc->pri_scb;
scb_ampdu = &scb->scb_ampdu;
ini = &scb_ampdu->ini[tid];
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index d5d0d9e..1c45687 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -616,25 +616,14 @@ static int
brcms_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
- struct scb *scb;
-
- int i;
struct brcms_info *wl = hw->priv;
+ struct scb *scb = &wl->wlc->pri_scb;
- /* Init the scb */
- scb = (struct scb *)sta->drv_priv;
- memset(scb, 0, sizeof(struct scb));
- for (i = 0; i < NUMPRIO; i++)
- scb->seqctl[i] = 0xFFFF;
- scb->seqctl_nonqos = 0xFFFF;
- scb->magic = SCB_MAGIC;
+ brcms_c_init_scb(scb);
- wl->pub->global_scb = scb;
wl->pub->global_ampdu = &(scb->scb_ampdu);
wl->pub->global_ampdu->scb = scb;
wl->pub->global_ampdu->max_pdu = 16;
- brcmu_pktq_init(&scb->scb_ampdu.txq, AMPDU_MAX_SCB_TID,
- AMPDU_MAX_SCB_TID * PKTQ_LEN_DEFAULT);
sta->ht_cap.ht_supported = true;
sta->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
@@ -657,8 +646,8 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, u16 tid, u16 *ssn,
u8 buf_size)
{
- struct scb *scb = (struct scb *)sta->drv_priv;
struct brcms_info *wl = hw->priv;
+ struct scb *scb = &wl->wlc->pri_scb;
int status;
if (WARN_ON(scb->magic != SCB_MAGIC))
@@ -1038,7 +1027,7 @@ static int ieee_hw_init(struct ieee80211_hw *hw)
hw->rate_control_algorithm = "minstrel_ht";
- hw->sta_data_size = sizeof(struct scb);
+ hw->sta_data_size = 0;
return ieee_hw_rate_init(hw);
}
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index a3c0157..7a14ab9 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -882,7 +882,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
if (tx_info->control.sta)
- scb = (struct scb *)tx_info->control.sta->drv_priv;
+ scb = &wlc->pri_scb;
if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
brcms_c_ampdu_dotxstatus(wlc->ampdu, scb, p, txs);
@@ -3331,14 +3331,21 @@ static u16 brcms_c_init_chanspec(struct brcms_c_info *wlc)
return chanspec;
}
-static struct scb global_scb;
-
-static void brcms_c_init_scb(struct brcms_c_info *wlc, struct scb *scb)
+void brcms_c_init_scb(struct scb *scb)
{
int i;
+
+ memset(scb, 0, sizeof(struct scb));
scb->flags = SCB_WMECAP | SCB_HTCAP;
- for (i = 0; i < NUMPRIO; i++)
+ for (i = 0; i < NUMPRIO; i++) {
scb->seqnum[i] = 0;
+ scb->seqctl[i] = 0xFFFF;
+ }
+
+ scb->seqctl_nonqos = 0xFFFF;
+ scb->magic = SCB_MAGIC;
+ brcmu_pktq_init(&scb->scb_ampdu.txq, AMPDU_MAX_SCB_TID,
+ AMPDU_MAX_SCB_TID * PKTQ_LEN_DEFAULT);
}
/* d11 core init
@@ -3799,8 +3806,6 @@ void brcms_c_init(struct brcms_c_info *wlc)
brcms_c_bandinit_ordered(wlc, chanspec);
- brcms_c_init_scb(wlc, &global_scb);
-
/* init probe response timeout */
brcms_c_write_shm(wlc, M_PRS_MAXTIME, wlc->prb_resp_timeout);
@@ -7684,7 +7689,7 @@ void brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
{
u8 prio;
uint fifo;
- struct scb *scb = &global_scb;
+ struct scb *scb = &wlc->pri_scb;
struct ieee80211_hdr *d11_header = (struct ieee80211_hdr *)(sdu->data);
/*
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 9e12a14..47665da 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -22,6 +22,7 @@
#include <brcmu_utils.h>
#include "types.h"
#include "d11.h"
+#include "scb.h"
#define INVCHANNEL 255 /* invalid channel */
@@ -483,6 +484,7 @@ struct brcms_txq_info {
* tx_duty_cycle_cck: maximum allowed duty cycle for CCK.
* pkt_queue: txq for transmit packets.
* wiphy:
+ * pri_scb: primary Station Control Block
*/
struct brcms_c_info {
struct brcms_pub *pub;
@@ -610,6 +612,7 @@ struct brcms_c_info {
struct brcms_txq_info *pkt_queue;
struct wiphy *wiphy;
+ struct scb pri_scb;
};
/* antsel module specific state */
@@ -864,5 +867,6 @@ extern void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
extern void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
extern void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw,
u8 stf_mode);
+extern void brcms_c_init_scb(struct scb *scb);
#endif /* _BRCM_MAIN_H_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/pub.h b/drivers/staging/brcm80211/brcmsmac/pub.h
index 9670309..b69833e 100644
--- a/drivers/staging/brcm80211/brcmsmac/pub.h
+++ b/drivers/staging/brcm80211/brcmsmac/pub.h
@@ -144,7 +144,6 @@ struct brcms_bss_info {
struct brcms_pub {
struct brcms_c_info *wlc;
struct ieee80211_hw *ieee_hw;
- struct scb *global_scb;
struct scb_ampdu *global_ampdu;
uint mac80211_state;
uint unit; /* device instance number */
--
1.7.1
^ permalink raw reply related
* [PATCH v3 08/25] staging: brcm80211: remove ht_cap field from brcms_c_info structure
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
The field ht_cap was typed ieee80211_ht_cap from ieee80211.h. This
contained little endian annotated field cap_info resulting in sparse
endian warnings. It turned out the driver was setting the field, but
it was actually never used. Therefore it has been removed.
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/main.c | 23 -----------------------
drivers/staging/brcm80211/brcmsmac/main.h | 2 --
drivers/staging/brcm80211/brcmsmac/stf.c | 9 ---------
3 files changed, 0 insertions(+), 34 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 3ec952c..074e16f 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -325,11 +325,6 @@ static u16 frametype(u32 rspec, u8 mimoframe)
*/
#define SSID_FMT_BUF_LEN ((4 * IEEE80211_MAX_SSID_LEN) + 1)
-/* defaults for the HT (MIMO) bss */
-#define HT_CAP (IEEE80211_HT_CAP_SM_PS |\
- IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_GRN_FLD |\
- IEEE80211_HT_CAP_MAX_AMSDU | IEEE80211_HT_CAP_DSSSCCK40)
-
/*
* The following table lists the buffer memory allocated to xmt fifos in HW.
* the size is in units of 256bytes(one block), total size is HW dependent
@@ -4213,13 +4208,6 @@ void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, int val)
static void brcms_c_ht_update_sgi_rx(struct brcms_c_info *wlc, int val)
{
- wlc->ht_cap.cap_info &= ~(IEEE80211_HT_CAP_SGI_20 |
- IEEE80211_HT_CAP_SGI_40);
- wlc->ht_cap.cap_info |= (val & BRCMS_N_SGI_20) ?
- IEEE80211_HT_CAP_SGI_20 : 0;
- wlc->ht_cap.cap_info |= (val & BRCMS_N_SGI_40) ?
- IEEE80211_HT_CAP_SGI_40 : 0;
-
if (wlc->pub->up) {
brcms_c_update_beacon(wlc);
brcms_c_update_probe_resp(wlc, true);
@@ -4230,10 +4218,6 @@ static void brcms_c_ht_update_ldpc(struct brcms_c_info *wlc, s8 val)
{
wlc->stf->ldpc = val;
- wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_LDPC_CODING;
- if (wlc->stf->ldpc != OFF)
- wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_LDPC_CODING;
-
if (wlc->pub->up) {
brcms_c_update_beacon(wlc);
brcms_c_update_probe_resp(wlc, true);
@@ -5376,8 +5360,6 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
wlc->bsscfg->wlc = wlc;
wlc->mimoft = FT_HT;
- wlc->ht_cap.cap_info = HT_CAP;
-
wlc->mimo_40txbw = AUTO;
wlc->ofdm_40txbw = AUTO;
wlc->cck_40txbw = AUTO;
@@ -5403,15 +5385,10 @@ brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
if (n_disabled & WLFEATURE_DISABLE_11N_STBC_TX) {
wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = OFF;
wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = OFF;
- wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
}
if (n_disabled & WLFEATURE_DISABLE_11N_STBC_RX)
brcms_c_stf_stbc_rx_set(wlc, HT_CAP_RX_STBC_NO);
- /* apply the GF override from nvram conf */
- if (n_disabled & WLFEATURE_DISABLE_11N_GF)
- wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_GRN_FLD;
-
/* initialize radio_mpc_disable according to wlc->mpc */
brcms_c_radio_mpc_upd(wlc);
brcms_b_antsel_set(wlc->hw, wlc->asi->antsel_avail);
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 717843a..8760d7e 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -456,7 +456,6 @@ struct brcms_txq_info {
* cck_40txbw: 11N, cck tx b/w override when in 40MHZ mode.
* ofdm_40txbw: 11N, ofdm tx b/w override when in 40MHZ mode.
* mimo_40txbw: 11N, mimo tx b/w override when in 40MHZ mode.
- * ht_cap: HT CAP IE being advertised by this node.
* default_bss: configured BSS parameters.
* mc_fid_counter: BC/MC FIFO frame ID counter.
* country_default: saved country for leaving 802.11d auto-country mode.
@@ -570,7 +569,6 @@ struct brcms_c_info {
s8 cck_40txbw;
s8 ofdm_40txbw;
s8 mimo_40txbw;
- struct ieee80211_ht_cap ht_cap;
struct brcms_bss_info *default_bss;
diff --git a/drivers/staging/brcm80211/brcmsmac/stf.c b/drivers/staging/brcm80211/brcmsmac/stf.c
index 91b53a5..c77bab2 100644
--- a/drivers/staging/brcm80211/brcmsmac/stf.c
+++ b/drivers/staging/brcm80211/brcmsmac/stf.c
@@ -53,9 +53,6 @@ static void brcms_c_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val)
return;
}
- wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_RX_STBC;
- wlc->ht_cap.cap_info |= (val << IEEE80211_HT_CAP_RX_STBC_SHIFT);
-
if (wlc->pub->up) {
brcms_c_update_beacon(wlc);
brcms_c_update_probe_resp(wlc, true);
@@ -140,12 +137,6 @@ static bool brcms_c_stf_stbc_tx_set(struct brcms_c_info *wlc, s32 int_val)
if ((int_val == ON) && (wlc->stf->txstreams == 1))
return false;
- if ((int_val == OFF) || (wlc->stf->txstreams == 1)
- || !BRCMS_STBC_CAP_PHY(wlc))
- wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
- else
- wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_TX_STBC;
-
wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = (s8) int_val;
wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = (s8) int_val;
--
1.7.1
^ permalink raw reply related
* [PATCH v3 23/25] staging: brcm80211: use d11rxhdr structure in brcms_c_recover_tsf64()
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
All information needed for this function is available in the d11rxhdr
structure. This is the last place where the brcms_d11rxhdr structure
so it can be removed.
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/d11.h | 17 -----------------
drivers/staging/brcm80211/brcmsmac/main.c | 9 +++------
drivers/staging/brcm80211/brcmsmac/types.h | 1 -
3 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/d11.h b/drivers/staging/brcm80211/brcmsmac/d11.h
index 1f05e8a..ed51616 100644
--- a/drivers/staging/brcm80211/brcmsmac/d11.h
+++ b/drivers/staging/brcm80211/brcmsmac/d11.h
@@ -1407,23 +1407,6 @@ struct d11rxhdr {
u16 RxStatus2;
u16 RxTSFTime;
u16 RxChan;
-};
-
-/*
- * rxhdr: received frame header data
- * rssi: rssi computed by PHY
- * rxpwr0: obsoleted, place holder for legacy ROM code. use rxpwr[]
- * rxpwr1: obsoleted, place holder for legacy ROM code. use rxpwr[]
- * do_rssi_ma: do per-pkt sampling for per-antenna ma in HIGH
- * rxpwr: rssi for supported antennas
- */
-struct brcms_d11rxhdr {
- struct d11rxhdr rxh_cpu;
- s8 rssi;
- s8 rxpwr0;
- s8 rxpwr1;
- s8 do_rssi_ma;
- s8 rxpwr[WL_RSSI_ANT_MAX];
} __packed;
/* PhyRxStatus_0: */
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index bdc0611..4f79a42 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -783,7 +783,6 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
struct sk_buff *tail = NULL;
uint n = 0;
uint bound_limit = bound ? RXBND : -1;
- struct brcms_d11rxhdr *wlc_rxhdr = NULL;
BCMMSG(wlc_hw->wlc->wiphy, "wl%d\n", wlc_hw->unit);
/* gather received frames */
@@ -813,7 +812,6 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
rxh_le = (struct d11rxhdr_le *)p->data;
rxh = (struct d11rxhdr *)p->data;
- wlc_rxhdr = (struct brcms_d11rxhdr *) p->data;
/* fixup rx header endianness */
rxh->RxFrameSize = le16_to_cpu(rxh_le->RxFrameSize);
@@ -8117,7 +8115,7 @@ brcms_b_read_tsf(struct brcms_hardware *wlc_hw, u32 *tsf_l_ptr,
* are used. Finally, the tsf_h is read from the tsf register.
*/
static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
- struct brcms_d11rxhdr *rxh)
+ struct d11rxhdr *rxh)
{
u32 tsf_h, tsf_l;
u16 rx_tsf_0_15, rx_tsf_16_31;
@@ -8125,7 +8123,7 @@ static u64 brcms_c_recover_tsf64(struct brcms_c_info *wlc,
brcms_b_read_tsf(wlc->hw, &tsf_l, &tsf_h);
rx_tsf_16_31 = (u16)(tsf_l >> 16);
- rx_tsf_0_15 = rxh->rxh_cpu.RxTSFTime;
+ rx_tsf_0_15 = rxh->RxTSFTime;
/*
* a greater tsf time indicates the low 16 bits of
@@ -8145,14 +8143,13 @@ prep_mac80211_status(struct brcms_c_info *wlc, struct d11rxhdr *rxh,
struct sk_buff *p,
struct ieee80211_rx_status *rx_status)
{
- struct brcms_d11rxhdr *wlc_rxh = (struct brcms_d11rxhdr *) rxh;
int preamble;
int channel;
u32 rspec;
unsigned char *plcp;
/* fill in TSF and flag its presence */
- rx_status->mactime = brcms_c_recover_tsf64(wlc, wlc_rxh);
+ rx_status->mactime = brcms_c_recover_tsf64(wlc, rxh);
rx_status->flag |= RX_FLAG_MACTIME_MPDU;
channel = BRCMS_CHAN_CHANNEL(rxh->RxChan);
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index 415ab8b..23969fe 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -336,7 +336,6 @@ struct dma_pub;
struct si_pub;
struct tx_status;
struct d11rxhdr;
-struct brcms_d11rxhdr;
struct txpwr_limits;
/* iovar structure */
--
1.7.1
^ permalink raw reply related
* [PATCH v3 14/25] staging: brcm80211: removed band related global vars from softmac
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Roland Vossen <rvossen@broadcom.com>
Global variables are undesirable unless they are read only. Variables are
now maintained in a device specific structure.
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/mac80211_if.c | 29 +++++++++++++---------
drivers/staging/brcm80211/brcmsmac/main.h | 1 +
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 11ba061..d5d0d9e 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -31,6 +31,7 @@
#include "pub.h"
#include "ucode_loader.h"
#include "mac80211_if.h"
+#include "main.h"
#define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */
@@ -225,7 +226,7 @@ static struct ieee80211_rate legacy_ratetable[] = {
RATE(540, 0),
};
-static struct ieee80211_supported_band brcms_band_2GHz_nphy = {
+static const struct ieee80211_supported_band brcms_band_2GHz_nphy_template = {
.band = IEEE80211_BAND_2GHZ,
.channels = brcms_2ghz_chantable,
.n_channels = ARRAY_SIZE(brcms_2ghz_chantable),
@@ -247,7 +248,7 @@ static struct ieee80211_supported_band brcms_band_2GHz_nphy = {
}
};
-static struct ieee80211_supported_band brcms_band_5GHz_nphy = {
+static const struct ieee80211_supported_band brcms_band_5GHz_nphy_template = {
.band = IEEE80211_BAND_5GHZ,
.channels = brcms_5ghz_nphy_chantable,
.n_channels = ARRAY_SIZE(brcms_5ghz_nphy_chantable),
@@ -981,22 +982,24 @@ static irqreturn_t brcms_isr(int irq, void *dev_id)
static int ieee_hw_rate_init(struct ieee80211_hw *hw)
{
struct brcms_info *wl = hw->priv;
- int has_5g;
+ struct brcms_c_info *wlc = wl->wlc;
+ struct ieee80211_supported_band *band;
+ int has_5g = 0;
u16 phy_type;
- has_5g = 0;
-
hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL;
hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
phy_type = brcms_c_get_phy_type(wl->wlc, 0);
if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN) {
+ band = &wlc->bandstate[BAND_2G_INDEX]->band;
+ *band = brcms_band_2GHz_nphy_template;
if (phy_type == PHY_TYPE_LCN) {
/* Single stream */
- brcms_band_2GHz_nphy.ht_cap.mcs.rx_mask[1] = 0;
- brcms_band_2GHz_nphy.ht_cap.mcs.rx_highest = 72;
+ band->ht_cap.mcs.rx_mask[1] = 0;
+ band->ht_cap.mcs.rx_highest = 72;
}
- hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &brcms_band_2GHz_nphy;
+ hw->wiphy->bands[IEEE80211_BAND_2GHZ] = band;
} else {
return -EPERM;
}
@@ -1004,11 +1007,13 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw)
/* Assume all bands use the same phy. True for 11n devices. */
if (wl->pub->_nbands > 1) {
has_5g++;
- if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN)
- hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
- &brcms_band_5GHz_nphy;
- else
+ if (phy_type == PHY_TYPE_N || phy_type == PHY_TYPE_LCN) {
+ band = &wlc->bandstate[BAND_5G_INDEX]->band;
+ *band = brcms_band_5GHz_nphy_template;
+ hw->wiphy->bands[IEEE80211_BAND_5GHZ] = band;
+ } else {
return -EPERM;
+ }
}
return 0;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/main.h b/drivers/staging/brcm80211/brcmsmac/main.h
index 8760d7e..9e12a14 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.h
+++ b/drivers/staging/brcm80211/brcmsmac/main.h
@@ -281,6 +281,7 @@ struct brcms_band {
u16 CWmin; /* minimum size of contention window, in unit of aSlotTime */
u16 CWmax; /* maximum size of contention window, in unit of aSlotTime */
+ struct ieee80211_supported_band band;
};
/* module control blocks */
--
1.7.1
^ permalink raw reply related
* [PATCH v3 19/25] staging: brcm80211: change interface for common rssi compute function
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
The function wlc_phy_rssi_compute() now uses d11rxhdr struct as
purely input parameter and returns the computed rssi value.
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/main.c | 4 +++-
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 7 +++----
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h | 4 ++--
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index e34b511..ef96358 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -806,15 +806,17 @@ brcms_b_recv(struct brcms_hardware *wlc_hw, uint fifo, bool bound)
/* process each frame */
while ((p = head) != NULL) {
+ struct d11rxhdr *rxh;
head = head->prev;
p->prev = NULL;
wlc_rxhdr = (struct brcms_d11rxhdr *) p->data;
+ rxh = (struct d11rxhdr *)p->data;
/*
* compute the RSSI from d11rxhdr and record it in wlc_rxd11hr
*/
- wlc_phy_rssi_compute(wlc_hw->band->pi, wlc_rxhdr);
+ wlc_rxhdr->rssi = wlc_phy_rssi_compute(wlc_hw->band->pi, rxh);
brcms_c_recv(wlc_hw->wlc, p);
}
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 8025247..c359a10 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -2610,10 +2610,9 @@ void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_cmplx_pwr_dB, u8 core)
}
}
-void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
- struct brcms_d11rxhdr *wlc_rxhdr)
+int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
+ struct d11rxhdr *rxh)
{
- struct d11rxhdr *rxh = &wlc_rxhdr->rxhdr;
int rssi = le16_to_cpu(rxh->PhyRxStatus_1) & PRXS1_JSSI_MASK;
uint radioid = pih->radioid;
struct brcms_phy *pi = (struct brcms_phy *) pih;
@@ -2650,7 +2649,7 @@ void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
}
end:
- wlc_rxhdr->rssi = (s8) rssi;
+ return rssi;
}
void wlc_phy_freqtrack_start(struct brcms_phy_pub *pih)
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
index 1dbfaa3..39c3c22 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
@@ -212,8 +212,8 @@ extern void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi,
extern u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
extern void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
-extern void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
- struct brcms_d11rxhdr *wlc_rxhdr);
+extern int wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
+ struct d11rxhdr *rxh);
extern void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
extern void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
extern bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
--
1.7.1
^ permalink raw reply related
* [PATCH v3 18/25] staging: brcm80211: changing interface to n-phy rssi compute function
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Arend van Spriel <arend@broadcom.com>
The function wlc_phy_rssi_compute_nphy() was called with pointer to
brcms_d11rxhdr structure in which it filled in the received power
per antenna. However, these are not used further in the driver so
it only needs the d11rxhdr structure as input for rssi calculation.
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 2 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h | 2 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 7 +------
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index a26c682..8025247 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -2646,7 +2646,7 @@ void wlc_phy_rssi_compute(struct brcms_phy_pub *pih,
rssi -= 256;
} else if (radioid == BCM2055_ID || radioid == BCM2056_ID
|| radioid == BCM2057_ID) {
- rssi = wlc_phy_rssi_compute_nphy(pi, wlc_rxhdr);
+ rssi = wlc_phy_rssi_compute_nphy(pi, rxh);
}
end:
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
index b94117b..8ce0159 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
@@ -1183,7 +1183,7 @@ extern void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
extern void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
extern int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi,
- struct brcms_d11rxhdr *wlc_rxh);
+ struct d11rxhdr *rxh);
#define NPHY_TESTPATTERN_BPHY_EVM 0
#define NPHY_TESTPATTERN_BPHY_RFCS 1
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index 58645d2..ff8b1d8 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -23109,9 +23109,8 @@ void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi)
}
int
-wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct brcms_d11rxhdr *wlc_rxh)
+wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct d11rxhdr *rxh)
{
- struct d11rxhdr *rxh = &wlc_rxh->rxhdr;
s16 rxpwr, rxpwr0, rxpwr1;
s16 phyRx0_l, phyRx2_l;
@@ -23134,10 +23133,6 @@ wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct brcms_d11rxhdr *wlc_rxh)
rxpwr1 = phyRx2_l;
}
- wlc_rxh->rxpwr[0] = (s8) rxpwr0;
- wlc_rxh->rxpwr[1] = (s8) rxpwr1;
- wlc_rxh->do_rssi_ma = 0;
-
if (pi->sh->rssi_mode == RSSI_ANT_MERGE_MAX)
rxpwr = (rxpwr0 > rxpwr1) ? rxpwr0 : rxpwr1;
else if (pi->sh->rssi_mode == RSSI_ANT_MERGE_MIN)
--
1.7.1
^ permalink raw reply related
* [PATCH v3 17/25] staging: brcm80211: removed global variable in softmac otp
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-1-git-send-email-frankyl@broadcom.com>
From: Roland Vossen <rvossen@broadcom.com>
Placed variable on the stack instead and deleted unused functions.
Softmac was tested to function properly with multiple adapters in one
system.
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/otp.c | 143 ++++--------------------------
drivers/staging/brcm80211/brcmsmac/otp.h | 8 --
2 files changed, 18 insertions(+), 133 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/otp.c b/drivers/staging/brcm80211/brcmsmac/otp.c
index 06cb575..f15e8be 100644
--- a/drivers/staging/brcm80211/brcmsmac/otp.c
+++ b/drivers/staging/brcm80211/brcmsmac/otp.c
@@ -67,15 +67,13 @@
/* Fixed size subregions sizes in words */
#define OTPGU_CI_SZ 2
+struct otpinfo;
+
/* OTP function struct */
struct otp_fn_s {
- int (*size)(struct otpinfo *oi);
- u16 (*read_bit)(struct otpinfo *oi, struct chipcregs *cc, uint off);
- struct otpinfo *(*init)(struct si_pub *sih);
+ int (*init)(struct si_pub *sih, struct otpinfo *oi);
int (*read_region)(struct otpinfo *oi, int region, u16 *data,
uint *wlen);
- int (*nvread)(struct otpinfo *oi, char *data, uint *len);
- int (*status)(struct otpinfo *oi);
};
struct otpinfo {
@@ -99,21 +97,6 @@ struct otpinfo {
int otpgu_base; /* offset to General Use Region */
};
-static struct otpinfo otpinfo;
-
-/*
- * IPX OTP Code
- *
- * Exported functions:
- * ipxotp_status()
- * ipxotp_size()
- * ipxotp_init()
- * ipxotp_read_bit()
- * ipxotp_read_region()
- * ipxotp_nvread()
- *
- */
-
/* OTP layout */
/* CC revs 21, 24 and 27 OTP General Use Region word offset */
#define REVA4_OTPGU_BASE 12
@@ -149,51 +132,11 @@ static struct otpinfo otpinfo;
#define OTP4315_SWREG_SZ 178 /* 178 bytes */
#define OTP_SZ_FU_144 (144/8) /* 144 bits */
-static int ipxotp_status(struct otpinfo *oi)
-{
- return (int)(oi->status);
-}
-
-/* Return size in bytes */
-static int ipxotp_size(struct otpinfo *oi)
-{
- return (int)oi->wsize * 2;
-}
-
static u16 ipxotp_otpr(struct otpinfo *oi, struct chipcregs *cc, uint wn)
{
return R_REG(&cc->sromotp[wn]);
}
-static u16 ipxotp_read_bit(struct otpinfo *oi, struct chipcregs *cc, uint off)
-{
- uint k, row, col;
- u32 otpp, st;
-
- row = off / oi->cols;
- col = off % oi->cols;
-
- otpp = OTPP_START_BUSY |
- ((OTPPOC_READ << OTPP_OC_SHIFT) & OTPP_OC_MASK) |
- ((row << OTPP_ROW_SHIFT) & OTPP_ROW_MASK) |
- ((col << OTPP_COL_SHIFT) & OTPP_COL_MASK);
- W_REG(&cc->otpprog, otpp);
-
- for (k = 0;
- ((st = R_REG(&cc->otpprog)) & OTPP_START_BUSY)
- && (k < OTPP_TRIES); k++)
- ;
- if (k >= OTPP_TRIES)
- return 0xffff;
-
- if (st & OTPP_READERR)
- return 0xffff;
-
- st = (st & OTPP_VALUE_MASK) >> OTPP_VALUE_SHIFT;
-
- return (int)st;
-}
-
/*
* Calculate max HW/SW region byte size by subtracting fuse region
* and checksum size, osizew is oi->wsize (OTP size - GU size) in words
@@ -294,28 +237,24 @@ static void _ipxotp_init(struct otpinfo *oi, struct chipcregs *cc)
oi->flim = oi->wsize;
}
-static struct otpinfo *ipxotp_init(struct si_pub *sih)
+static int ipxotp_init(struct si_pub *sih, struct otpinfo *oi)
{
uint idx;
struct chipcregs *cc;
- struct otpinfo *oi;
/* Make sure we're running IPX OTP */
if (!OTPTYPE_IPX(sih->ccrev))
- return NULL;
+ return -EBADE;
/* Make sure OTP is not disabled */
if (ai_is_otp_disabled(sih))
- return NULL;
-
- /* OTP is always powered */
- oi = &otpinfo;
+ return -EBADE;
/* Check for otp size */
switch ((sih->cccaps & CC_CAP_OTPSIZE) >> CC_CAP_OTPSIZE_SHIFT) {
case 0:
/* Nothing there */
- return NULL;
+ return -EBADE;
case 1: /* 32x64 */
oi->rows = 32;
oi->cols = 64;
@@ -338,7 +277,7 @@ static struct otpinfo *ipxotp_init(struct si_pub *sih)
break;
default:
/* Don't know the geometry */
- return NULL;
+ return -EBADE;
}
/* Retrieve OTP region info */
@@ -349,7 +288,7 @@ static struct otpinfo *ipxotp_init(struct si_pub *sih)
ai_setcoreidx(sih, idx);
- return oi;
+ return 0;
}
static int
@@ -437,56 +376,16 @@ ipxotp_read_region(struct otpinfo *oi, int region, u16 *data, uint *wlen)
return 0;
}
-static int ipxotp_nvread(struct otpinfo *oi, char *data, uint *len)
-{
- return -ENOTSUPP;
-}
-
static const struct otp_fn_s ipxotp_fn = {
- (int (*)(struct otpinfo *)) ipxotp_size,
- (u16 (*)(struct otpinfo *, struct chipcregs *, uint)) ipxotp_read_bit,
-
- (struct otpinfo *(*)(struct si_pub *)) ipxotp_init,
+ (int (*)(struct si_pub *, struct otpinfo *)) ipxotp_init,
(int (*)(struct otpinfo *, int, u16 *, uint *)) ipxotp_read_region,
- (int (*)(struct otpinfo *, char *, uint *)) ipxotp_nvread,
-
- (int (*)(struct otpinfo *)) ipxotp_status
};
-/*
- * otp_status()
- * otp_size()
- * otp_read_bit()
- * otp_init()
- * otp_read_region()
- * otp_nvread()
- */
-
-int otp_status(struct otpinfo *oi)
+static int otp_init(struct si_pub *sih, struct otpinfo *oi)
{
- return oi->fn->status(oi);
-}
-
-int otp_size(struct otpinfo *oi)
-{
- return oi->fn->size(oi);
-}
-u16 otp_read_bit(struct otpinfo *oi, uint offset)
-{
- uint idx = ai_coreidx(oi->sih);
- struct chipcregs *cc = ai_setcoreidx(oi->sih, SI_CC_IDX);
- u16 readBit = (u16) oi->fn->read_bit(oi, cc, offset);
- ai_setcoreidx(oi->sih, idx);
- return readBit;
-}
+ int ret;
-struct otpinfo *otp_init(struct si_pub *sih)
-{
- struct otpinfo *oi;
- struct otpinfo *ret = NULL;
-
- oi = &otpinfo;
memset(oi, 0, sizeof(struct otpinfo));
oi->ccrev = sih->ccrev;
@@ -495,18 +394,19 @@ struct otpinfo *otp_init(struct si_pub *sih)
oi->fn = &ipxotp_fn;
if (oi->fn == NULL)
- return NULL;
+ return -EBADE;
oi->sih = sih;
- ret = (oi->fn->init) (sih);
+ ret = (oi->fn->init) (sih, oi);
return ret;
}
int
otp_read_region(struct si_pub *sih, int region, u16 *data, uint *wlen) {
- struct otpinfo *oi;
+ struct otpinfo otpinfo;
+ struct otpinfo *oi = &otpinfo;
int err = 0;
if (ai_is_otp_disabled(sih)) {
@@ -514,19 +414,12 @@ otp_read_region(struct si_pub *sih, int region, u16 *data, uint *wlen) {
goto out;
}
- oi = otp_init(sih);
- if (oi == NULL) {
- err = -EBADE;
+ err = otp_init(sih, oi);
+ if (err)
goto out;
- }
err = ((oi)->fn->read_region)(oi, region, data, wlen);
out:
return err;
}
-
-int otp_nvread(struct otpinfo *oi, char *data, uint *len)
-{
- return oi->fn->nvread(oi, data, len);
-}
diff --git a/drivers/staging/brcm80211/brcmsmac/otp.h b/drivers/staging/brcm80211/brcmsmac/otp.h
index bf2f76f..6b6d31c 100644
--- a/drivers/staging/brcm80211/brcmsmac/otp.h
+++ b/drivers/staging/brcm80211/brcmsmac/otp.h
@@ -30,15 +30,7 @@
/* OTP Size */
#define OTP_SZ_MAX (6144/8) /* maximum bytes in one CIS */
-struct otpinfo;
-
-/* Exported functions */
-extern int otp_status(struct otpinfo *oi);
-extern int otp_size(struct otpinfo *oi);
-extern u16 otp_read_bit(struct otpinfo *oi, uint offset);
-extern struct otpinfo *otp_init(struct si_pub *sih);
extern int otp_read_region(struct si_pub *sih, int region, u16 *data,
uint *wlen);
-extern int otp_nvread(struct otpinfo *oi, char *data, uint *len);
#endif /* _BRCM_OTP_H_ */
--
1.7.1
^ permalink raw reply related
* [PATCH v3 11/25] staging: brcm80211: make device initializer table for wme constant
From: Franky Lin @ 2011-09-29 22:34 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-wireless
In-Reply-To: <1317335676-3424-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
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox