summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/cmd.c
AgeCommit message (Collapse)Author
2011-12-20wl12xx: flush packets before stopping dev roleEliad Peller
During sta disconnection, a deauth packet is being queued to the dev role queue. However, the dev role is being stopped before the packet was sent. Flush the tx queue before stopping the dev role. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01wl12xx: Validate FEM index from ini file and FWPontus Fuchs
Check for out of bound FEM index to prevent reading beyond ini memory end. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Cc: stable@kernel.org Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08wl12xx: couple role_start_dev with rocEliad Peller
Device role is always started along with ROC. Couple them together by introducing new wl12xx_start_dev and wl12xx_stop_dev functions. By using these functions, we solve a bug that occured during channel switch - we started the dev role on one channel, and ROCed on a different one. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11wl12xx: move debugging definitions to a separate fileLuciano Coelho
Separate the debugging macros and other definitions to a new debug.h file. This is be needed because the sdio and spi modules don't need to depend on the wl12xx module anymore, but still need to include wl12xx.h. Currently they do depend on it, because of the debugging global that wl12xx exports. A future patch will remove this dependency. Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11wl12xx: replace all remaining wl->vif referencesEliad Peller
wl->vif is appropriate only when a single vif is being used. Instead, pass wlvif as parameter or iterate through all the vifs (e.g. when a global configuration was changed) Leave wl->vif only to determine whether a vif was already added (this check will be removed as well after both the driver and fw will support multiple vifs) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11wl12xx: add channel field to wlvifEliad Peller
add channel into the per-interface data. mac80211 configures some values (e.g. band, channel) globally, while we configure them per-interface. In order to make it easier to keep track of the configured value for each value while keeping sync with mac80211, save these values both globally and per-vif. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11wl12xx: add band field to wlvifEliad Peller
add band field into the per-interface data. mac80211 configures some values (e.g. band, channel) globally, while we configure them per-interface. In order to make it easier to keep track of the configured value for each value while keeping sync with mac80211, save these values both globally and per-vif. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11wl12xx: move bitrate_masks into wlvifEliad Peller
move bitrate_masks into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move ap_hlid_map into wlvif.apEliad Peller
Add wlvif->links_map bitmap to represent all the links allocated for this vif. AP vif also has a sta_hlid_map bitmap, which represents the links stations connected to it (sta_hlid_bitmap is a subset of wlvif->links_map, which itself is a subset of the global wl->links_map) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move beacon_int into wlvifEliad Peller
move beacon_int into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move dev_hlid into wlvifEliad Peller
move dev_hlid into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move session_counter into wlvifEliad Peller
move session_counter into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move ap_global_hlid and ap_bcast_hlid into wlvifEliad Peller
move ap_global_hlid and ap_bcast_hlid into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move sta_hlid into wlvifEliad Peller
move sta_hlid into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move dev_role_id into wlvifEliad Peller
move dev_role_id into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move role_id into wlvifEliad Peller
move role_id into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move ssid and ssid_len into wlvifEliad Peller
move ssid and ssid_len into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move bss_type into wlvifEliad Peller
move bss_type into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: replace wl->bssid with vif->bss_conf.bssidEliad Peller
Use the per-interface vif->bss_conf instead of the global wl->bssid. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move basic_rate into wlvifEliad Peller
move basic_rate into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: move rate_set into wlvifEliad Peller
move rate_set into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: define wl12xx_vifEliad Peller
Define a per-vif data struct. This struct holds all the vif-specifc data, which is currently being hold by the global wl struct. Start by moving the basic_rate_set field into it. NOTE: in order to make the patches a bit smaller, start by using wl->vif in some functions, instead of changing all the function prototypes at once. finally, wl->vif will be removed altogether. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: replace wl->mac_addr with vif->addrEliad Peller
The mac address of the interface already exists in vif->addr. Use it instead of wl->mac_addr. It seems that due to some fw bug, we still need to set nvs->mac to the actual mac addresss, otherwise the fw doesn't function well (e.g. can't get dhcp address). Thus, use wl->mac_addr for this purpose, and don't delete it yet. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: disable AP-mode-specific quirksEliad Peller
The current wl12xx fw (7.3.0.0.77) supports both STA and AP mode, and we no longer use AP-mode-specific quirks. WL12XX_QUIRK_END_OF_TRANSACTION is still used for certain HWs, while WL12XX_QUIRK_LPD_MODE is not used anymore. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07wl12xx: Add support for HW channel switchShahar Levi
The wl12xx FW supports HW channel switch. If we don't use it, sometimes the firmware gets confused when recalibrating to the new channel, causing RX problems. This commit adds HW channel switch support by implementing the channell_switch op. Signed-off-by: Shahar Levi <shahar_levi@ti.com> [added one comment, remove the tx_flush and rephrased the commit message] Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23wl12xx: implement set_bitrate_mask callbackEliad Peller
Save the configured bitrate, and use the min allowed rate as the basic rate (e.g. when scanning). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23wl12xx: AP mode - support hidden SSIDArik Nemtsov
If a hidden SSID is requested, generate a probe response template containing the real SSID. Depends on the patch "mac80211: add ssid config to bss information in AP-mode". Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14wl12xx: declare support for WIPHY_FLAG_AP_UAPSDEliad Peller
Declare support for uapsd when working as AP, and set psd_type and sp_len whan a station is being added. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14wl12xx: print acx idEliad Peller
Add id param to the acx debug print (on wl1271_cmd_configure) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: don't wait for disconnection eventEliad Peller
Sometimes the fw doesn't send the DISCONNECT_EVENT_COMPLETE_ID on station role stop, so don't wait for it. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: AP-mode - configure STA HT rates on joinArik Nemtsov
When a new STA joins the BSS, configure the HT rates it supports to the FW. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: add wl12xx_cmd_role_start_ibss()Eliad Peller
Add wl12xx_cmd_role_start_ibss() implementation and defintion. This function is used in order to start the IBSS role. Stopping the IBSS is done by using the same api as stop STA, so there is no need for a separate function. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: don't remove key if hlid was already deletedEliad Peller
If hlid was already removed, there is no need to remove its key (it might cause a fw crash, as the key is invalid). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: call wl12xx_cmd_set_peer_state() in AP modeEliad Peller
After adding a station, call wl12xx_cmd_set_peer_state(). This is required for 11n support. Change wl12xx_cmd_set_peer_state() prototype to get hlid as param. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: use dynamic hlids for AP-modeArik Nemtsov
Using hlid=0 in AP mode is a bug. Dynamically allocate HLIDs. Set the "first sta hlid" as 3. This will have to be changed when multiple vifs will be supported. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: fix session counterArik Nemtsov
Increment the session counter on every wl12xx_cmd_role_start_sta() command. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: replace dummy_join with ROC/CROC commandsEliad Peller
The ROC command asks the fw stay on the channel of the given hlid. it currently has 2 primary functions: 1. Allow tx/rx from the device role. In order to tx/rx packets while the stations is not associated (e.g. auth req/resp), the device role has to be used, along with ROC on its link. Keep the logic similiar to the one used in dummy_join. However, since we can't scan while we ROC, we add CROC before starting a scan, and ROC again (if needed) on scan complete. 2. Keeping the antenna for a specific link. We ROC until the connection was completed (after EAPOLs exchange) in order to prevent BT coex operations from taking the antenna and failing the connection (after this stage, psm can be used). During association, we ROC on the station role, and then CROC the device role, thus assuring being ROC during all the connection process. Delete the WL1271_FLAG_JOINED flag, and use a roc bitmap to indicate what roles are currently ROCed. Add wl12xx_roc/croc functions in order to wrap the roc/croc commands while taking care of the roc bitmap. The current ROC/CROC state-machine is a bit complicated. In the future we'll probably want to use wpa_supplicant to control the ROC during connection. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: add ROC/CROC commandsEliad Peller
Add structs and functions to support the ROC/CROC commands. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: add device role commandsEliad Peller
The device role is a special role used for rx and tx frames prior to association (as the STA role can get packets only from its associated bssid) Since this role is required for the sta association process, we enable it when a new sta interface is created. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: update commands & eventsEliad Peller
Change the commands and events according to the new fw api (fw >= 6/7.3.0.0.75). The main change is the replacement of JOIN/DISCONNECT commands, with ROLE_START/ROLE_STOP commands. The use of these commands should be preceded by the ROLE_ENABLE command (allocating role resources), and followed by the ROLE_DISABLE command (freeing role resources). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22wl12xx: remove rx filtering stuffEliad Peller
The new fw doesn't support rx_filtering configuration (as a stand-alone command. the rx filtering is done automatically according to the active role). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-08Merge branch 'for-linville' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx
2011-07-06Merge branch 'for-linville' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx
2011-07-05wl12xx: AP mode - support FW TX inactivity triggersArik Nemtsov
In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events. Both are reported to the upper layers as a TX failure in the offending stations. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05wl12xx: fix Tx security sequence number handlingOz Krakowski
Do not reset the security sequence number when issuing a join command or interface is removed. Instead, reset the counter only during the unjoin command. Added the notion of counter wrap-around to the LSB number in wl1271_tx_complete_packet. Added post recovery padding to adjust for potential security number progress during the recovery process by the firmware and avoid potential interop issues in encrypted networks. Signed-off-by: Oz Krakowski <ozk@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-29wl12xx: AP-mode - use mac80211 indication about STA WME supportArik Nemtsov
When adding a station, use the information given in the mac80211 populated ieee80211_sta structure to determine if it supports WME. Provide this information to the FW. This patch depends on "mac80211: propagate information about STA WME support down". Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-27wl12xx: Support routing FW logs to the hostIdo Yariv
A recently added feature to the firmware enables the driver to retrieve firmware logs via the host bus (SDIO or SPI). There are two modes of operation: 1. On-demand: The FW collects its log in an internal ring buffer. This buffer can later be read, for example, upon recovery. 2. Continuous: The FW pushes the FW logs as special packets in the RX path. Reading the internal ring buffer does not involve the FW. Thus, as long as the HW is not in ELP, it should be possible to read the logs, even if the FW crashes. A sysfs binary file named "fwlog" was added to support this feature, letting a monitor process read the FW messages. The log is transferred from the FW only when available, so the reading process might block. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: Avoid recovery while one is already in progressIdo Yariv
During recovery work commands sent to the FW could fail and schedule additional recovery work. Since the chip is going to be powered off, avoid recursive recoveries. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: Add Support for Low Power DRPw (LPD) ModeShahar Levi
The Low Power DRPw (LPD) mode contains several optimizations that designed to reduce power consumption. The purpose is to save current consumption in RX and Listen mode. LPD setting apply only for wl127x AP mode (not wl128x) Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: remove unused crc7 referencesEliad Peller
crc7 is used only in wl12xx_spi. Remove redundant crc7.h includes, and update Kconfig to select CRC7 only if WL12XX_SPI is being selected. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>