aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wlcore/cmd.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-06-16networking: make skb_push & __skb_push return void pointersJohannes Berg1-1/+1
It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) @@ expression SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - fn(SKB, LEN)[0] + *(u8 *)fn(SKB, LEN) Note that the last part there converts from push(...)[0] to the more idiomatic *(u8 *)push(...). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16networking: introduce and use skb_put_data()Johannes Berg1-2/+2
A common pattern with skb_put() is to just want to memcpy() some data into the new space, introduce skb_put_data() for this. An spatch similar to the one for skb_put_zero() converts many of the places using it: @@ identifier p, p2; expression len, skb, data; type t, t2; @@ ( -p = skb_put(skb, len); +p = skb_put_data(skb, data, len); | -p = (t)skb_put(skb, len); +p = skb_put_data(skb, data, len); ) ( p2 = (t2)p; -memcpy(p2, data, len); | -memcpy(p, data, len); ) @@ type t, t2; identifier p, p2; expression skb, data; @@ t *p; ... ( -p = skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); | -p = (t *)skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); ) ( p2 = (t2)p; -memcpy(p2, data, sizeof(*p)); | -memcpy(p, data, sizeof(*p)); ) @@ expression skb, len, data; @@ -memcpy(skb_put(skb, len), data, len); +skb_put_data(skb, data, len); (again, manually post-processed to retain some comments) Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16networking: convert many more places to skb_put_zero()Johannes Berg1-2/+1
There were many places that my previous spatch didn't find, as pointed out by yuan linyu in various patches. The following spatch found many more and also removes the now unnecessary casts: @@ identifier p, p2; expression len; expression skb; type t, t2; @@ ( -p = skb_put(skb, len); +p = skb_put_zero(skb, len); | -p = (t)skb_put(skb, len); +p = skb_put_zero(skb, len); ) ... when != p ( p2 = (t2)p; -memset(p2, 0, len); | -memset(p, 0, len); ) @@ type t, t2; identifier p, p2; expression skb; @@ t *p; ... ( -p = skb_put(skb, sizeof(t)); +p = skb_put_zero(skb, sizeof(t)); | -p = (t *)skb_put(skb, sizeof(t)); +p = skb_put_zero(skb, sizeof(t)); ) ... when != p ( p2 = (t2)p; -memset(p2, 0, sizeof(*p)); | -memset(p, 0, sizeof(*p)); ) @@ expression skb, len; @@ -memset(skb_put(skb, len), 0, len); +skb_put_zero(skb, len); Apply it to the tree (with one manual fixup to keep the comment in vxlan.c, which spatch removed.) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2016-07-18wlcore/wl18xx: mesh: added initial mesh support for wl8Maital Hahn1-5/+8
1. Added support for interface and role of mesh type. 2. Enabled enable/start of mesh-point role, and opening and closing a connection with a mesh peer. 3. Added multirole combination of mesh and ap under the same limits of dual ap mode. 4. Add support for 'sta_rc_update' opcode for mesh IF. The 'sta_rc_update' opcode is being used in mesh_plink.c. Add support in wlcore to handle this opcode correctly for mesh (as opposed to current implementation that handles STA only). 5. Bumped the firmware version to support new Mesh functionality Signed-off-by: Maital Hahn <maitalm@ti.com> Signed-off-by: Yaniv Machani <yanivma@ti.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-06-29wlcore: reconfigure sta rates on authorizationGuy Mishol1-0/+7
Since stations can now be added before association (NL80211_FEATURE_FULL_AP_CLIENT_STATE support), no supported rates are set when the station is added to the fw, resulting in fw recovery. Fix it by first configuring the AP basic rates as the station configured rates (when the station is first added to the driver), and after the station was authorized re-configure it, now with the actual supported rates. Signed-off-by: Guy Mishol <guym@ti.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-12cfg80211: remove enum ieee80211_bandJohannes Berg1-18/+18
This enum is already perfectly aliased to enum nl80211_band, and the only reason for it is that we get IEEE80211_NUM_BANDS out of it. There's no really good reason to not declare the number of bands in nl80211 though, so do that and remove the cfg80211 one. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-08-10wlcore: add p2p device supportEliad Peller1-10/+16
When starting a p2p mgmt interface, enable its device role. This allows us to keep the sta role disabled and scan on the dev role. In general, p2p management interfaces cannot send vif-specific commands to FW, as the vif role id is invalid. Only off-channel data and scans happen on this vif, so most ops are not relevant. If the vif is a p2p mgmt vif, block some mac80211 ops. Configure rate policies for p2p mgmt interface, as otherwise p2p packets come out with arbitrary rates. Since wpa_supplicant currently doesn't support standalone p2p device mode (without another attached managed interface), add p2p device to the allowed interface combinations without decreasing the allowed station count. Moreover, increase the station count in some cases, as AP mode usually starts as station interface, and the AP interface is now different from the p2p management one). Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-08-10wlcore: add generic_cfg_feature command definitionsEliad Peller1-0/+30
Add definitions and function prototypes for generic_cfg command. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-03wireless: Use eth_<foo>_addr instead of memsetJoe Perches1-2/+2
Use the built-in function instead of memset. Miscellanea: Add #include <linux/etherdevice.h> where appropriate Use ETH_ALEN instead of 6 Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-09wlcore: add dfs region to reg domain update cmdGuy Mishol1-0/+1
Add dfs region to the reg domain channel update command. Signed-off-by: Guy Mishol <guym@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09wlcore: allow using dfs channelsEliad Peller1-7/+9
Since we are going to support dfs channels, there is no reason to mark them as NO_IR (having the DFS flag is enough anyway). Additionally, when setting the regdomain configuration, enable usable dfs channels. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-09wl18xx: add radar detection implementationEliad Peller1-1/+2
Add support for CAC start/stop commands, and pass radar detection events from the fw to mac80211. Bump fw name (to wl18xx-fw-4.bin) and min fw version (to 8.9.*.*.11), and align event mailbox accordingly. Signed-off-by: Guy Mishol <guym@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-11-19mac80211: allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDRJohannes Berg1-1/+1
Allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR with software based scanning and generate a random MAC address for them for every scan request with the flag. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-11-11wlcore: make wlcore_cmd_send_failsafe() staticLuciano Coelho1-3/+4
The wlcore_cmd_send_failsafe() function is only called in the cmd.c file, where it is definde. Make it static. Additionally, move the EXPORT_SYMBOL macro for wl1271_cmd_send() to the right place. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-11wlcore: check minimum buffer size in some cmd_send functionsLuciano Coelho1-0/+6
Check for the minimum required buffer length in wlcore_cmd_send() and wlcore_cmd_configure_failsafe. This ensures that we will never try to use a buffer that is smaller than the required header. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15wlcore: user smaller sqn padding for GEMEliad Peller1-2/+5
On recovery, we increase the current seq num by WL1271_TX_SQN_POST_RECOVERY_PADDING in order to compensate for packets we might have missed during recovery. It seems that some GEM APs have issues when the gap is too big, so use a smaller padding in this case. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-07-15wlcore: save seq num only between recoveriesEliad Peller1-3/+2
We want seq num (freed_pkts) to be initialized on each new connection, but keep persistent between recoveries/suspends. Save the freed_pkts in the private block of the sta struct (we already do a similar thing for AP's stations). However, keep the old wlvif->total_freed_pkts in order to avoid too intrusive change. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-25mac80211: split sched scan IEsDavid Spinadel1-4/+7
Split sched scan IEs to band specific and not band specific blocks. Common IEs blocks may be sent to the FW once per command, instead of per band. This allows optimization of size of the command, which may be required by some drivers (eg. iwlmvm with newer firmware version). As this changes the mac80211 API, update all drivers to use the new version correctly, even if they don't (yet) make use of the split data. Signed-off-by: David Spinadel <david.spinadel@intel.com> Reviewed-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2014-02-13wlcore: decrease warning verbosity during recoveryArik Nemtsov1-2/+2
Silently ignore repetitive scheduling of recovery work and commands being passed to the bus when the HW is not available. This can happen many times during recovery and slow it down. It also spams the kernel logs. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13wl18xx: move to new firmware (wl18xx-fw-3.bin)Eliad Peller1-1/+4
Bump the min wl18xx fw version to 8.8.0.0.13 This fw is not backward compatible with older firmware (due to api changes), so use bump the firmware name as well. Some modifications were done to the driver-fw api in order to support multiple APs. Additionally, some of the consts (such as max stations, max links and max RX BA sessions) were changed. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13wlcore/wl12xx/wl18xx: configure num_links per-hwEliad Peller1-2/+2
Upcoming fw versions will have different max links support (according to the hw). Get ready for it by configuring wl->num_links per-hw, instead of using the const WL12XX_MAX_LINKS. However, continue using WLCORE_MAX_LINKS in order to simplify structs declarations (we use it in multiple bitmaps, and converting them to dynamic arrays is just cumbersome). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13wlcore/wl12xx/wl18xx: simplify fw_status handlingEliad Peller1-3/+8
Instead of splitting the fw_status into 2 and using some complex calculations, read the fw status and let each low-level driver (wl12xx/wl18xx) convert it into a common struct. This is required for the upcoming fw api changes, which break the current logic anyway. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-11-25cfg80211: consolidate passive-scan and no-ibss flagsLuis R. Rodriguez1-1/+1
These two flags are used for the same purpose, just combine them into a no-ir flag to annotate no initiating radiation is allowed. Old userspace sending either flag will have it treated as the no-ir flag. To be considerate to older userspace we also send both the no-ir flag and the old no-ibss flags. Newer userspace will have to be aware of older kernels. Update all places in the tree using these flags with the following semantic patch: @@ @@ -NL80211_RRF_PASSIVE_SCAN +NL80211_RRF_NO_IR @@ @@ -NL80211_RRF_NO_IBSS +NL80211_RRF_NO_IR @@ @@ -IEEE80211_CHAN_PASSIVE_SCAN +IEEE80211_CHAN_NO_IR @@ @@ -IEEE80211_CHAN_NO_IBSS +IEEE80211_CHAN_NO_IR @@ @@ -NL80211_RRF_NO_IR | NL80211_RRF_NO_IR +NL80211_RRF_NO_IR @@ @@ -IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_IR +IEEE80211_CHAN_NO_IR @@ @@ -(NL80211_RRF_NO_IR) +NL80211_RRF_NO_IR @@ @@ -(IEEE80211_CHAN_NO_IR) +IEEE80211_CHAN_NO_IR Along with some hand-optimisations in documentation, to remove duplicates and to fix some indentation. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> [do all the driver updates in one go] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-23wlcore: Allow stopping fw log in recoveryBarak Bercovitz1-1/+2
The FW panic log is read during recovery work. It has to be stopped properly before reading. otherwise, inconsistent data might be read which cause the driver to freeze. __wlcore_cmd_send has to work for the special case of CMD_STOP_FWLOGGER, while in recovery, in order to stop the fw log before it is read. Signed-off-by: Barak Bercovitz <barak@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2013-10-23wlcore: fix interrogate command lengthIgal Chernobelsky1-4/+5
Change interrogate command prototype to have command size and returned buffer length. This fixes the issue when command parameters are needed to be passed to FW in addition to acx header as in the case with get RSSI command, where role_id has to be passed. Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2013-09-30wlcore: clarify and fix regulatory domain bit translationEliad Peller1-21/+31
Channels 52-64 were mapped incorrectly. Refactor and document wlcore_get_reg_conf_ch_idx() in order to make it clear what's going on there. While on it, fix the return value check to consider 0 as a valid return value as well (indicates channel 1). Reported-by: Yaniv Machani <yanivma@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Ido Reis <idor@ti.com> Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2013-09-30wlcore: cleanup scan debug printsVictor Goldenshtein1-3/+3
Remove scan debug dumps which are rarely used. Make scan debug prints more clear and short. Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2013-03-25wlcore: AP-mode - recover security seq num for stationsArik Nemtsov1-1/+7
Save the sequence number of the broadcast AP link in the wlvif. For each connected station, save the sequence number in the drv_priv part of ieee80211_sta. Use the saved numbers on recovery/resume, with the obligatory increment on recovery. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2013-03-25wlcore: consolidate tx_seq handling on recoveryArik Nemtsov1-0/+26
Accumulate the total number of sent packets per-link to find out how far the encryption sequence number has progressed. Use this number as the initial security sequence number after recovery. This consolidates security sequence handling for both chip families, as we no longer have to rely on 12xx specific Tx completion. A fortunate side effect of this is correct management of seq numbers for AP roles and multi-role scenarios. When a link is removed we save the last seq number on a persistent part of the wlvif. This helps the data survive through recoveries/suspends, which also entail changes in the hlid of the link. This functionality is STA only currently. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2013-02-08wlcore: fix wrong remote rates when starting STA roleLuciano Coelho1-3/+5
In wl18xx, we use a new ACX command in order to set the remote supported rates, once we know it (ie. after association). The wl12xx firmware doesn't support changing the rates after the STA is started, so we need to use all supported rates. Commit 530abe19 (wlcore: add ACX_PEER_CAP command) broke that by using wlvif->rate_set when starting the STA role. Signed-off-by: Luciano Coelho <coelho@ti.com>
2013-01-18Merge branch 'wl12xx-next' into for-linvilleLuciano Coelho1-138/+281
Conflicts: drivers/net/wireless/ti/wl12xx/main.c drivers/net/wireless/ti/wlcore/wlcore.h
2012-12-11wlcore: use link count for single-STA-PSM optimizationArik Nemtsov1-0/+4
Only allow a PSM STA to congest FW memory when it is the single active link. Being a single STA doesn't imply a single link - there might be other links on other roles. [Changed WARN_ON to WARN_ON_ONCE -- Luca] Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-11wlcore: add ACX_PEER_CAP commandEliad Peller1-4/+3
ACX_PEER_CAP command is just ACX_PEER_HT_CAP, but allows configuring the peer's support rates as well. this is needed because we start the station role when the remote rates are not known yet. the two commands should be unified in future fw versions, but for now add a new set_peer_cap per-hw op, that will use ACX_PEER_CAP for 18xx, and ACX_PEER_HT_CAP for 12xx. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-05wlcore: track wlvif inside per-link structureArik Nemtsov1-0/+2
This allows us to pass only the link as a parameter to various functions and deduce the wlvif. Note that this member will be NULL for global links. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-05wlcore: initialize per-link FW freed blocks correctlyArik Nemtsov1-0/+4
When a link is allocated, sometimes the "freed packets" counter in FW is non zero, but we always assumed it is. This caused us to incorrectly account FW allocated blocks in some cases. When operating in AP mode, this bug caused some stations to never come back from PSM. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-05wlcore: consolidate free_link and always call itArik Nemtsov1-0/+5
Make sure free_link is always called when removing an interface. This ensures all skbs belonging to this interface are returned to mac80211. Otherwise these dangling skbs might crash the system on the next call to wl1271_tx_reset_link_queues(). This happens on recovery/stop or an unsuccessful Tx flush. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04wlcore: allow fw commands to failEliad Peller1-18/+67
Currently, each fw command/acx that return a status code different than CMD_STATUS_SUCCESS will trigger a recovery in the driver. However, it is a valid for some fw commands to fail (e.g. due to temporary lack of resources), so add new functions that allow passing bitmap of valid error return values. (make the current wl1271_cmd_send/wl1271_cmd_configure wrappers around the new functions, in order to avoid changing the whole driver) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04wlcore: mask out CCK rates when starting GOEliad Peller1-0/+2
mask out CCK rates from the AP's local rates when the interace is p2p interface (GO). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-30mac80211: remove probe response temporary buffer allocationJohannes Berg1-1/+3
Instead of allocating a temporary buffer to build IEs build them right into the SKB. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-11-28wlcore: use new set bandwidth command to adjusting channel BWArik Nemtsov1-0/+1
We support changing the channel BW when we started the STA role on a 40Mhz bandwidth. Otherwise a reconnection is required. Save the started channel width and use it when channel width updates arrive. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-28wlcore: add new reg-domain configuration commandVictor Goldenshtein1-0/+125
In 18xx the calibration process of the PHY Cortex domain requires to perform an active calibration of the channel before it can be used for transmission. To fulfill world wide regulatory restrictions, fw should be always synchronized/updated with current CRDA configuration. Add a new "CMD_DFS_CHANNEL_CONFIG" command to update the fw with current reg-domain, this command passes a bit map of channels that are allowed to be used for transmission. The driver shall update the fw during initialization and after each change in the current reg-domain configuration. The driver will save the channel number of incoming beacons during the scan process, as they might be a result of the passive scan on "IEEE80211_CHAN_PASSIVE_SCAN" channel and will update the fw accordingly once the scan is finished, the purpose of this is to be ready in case of the authentication request on one of these disabled (uncalibrated) channels. The new command requires to wait for the fw completion event "DFS_CHANNELS_CONFIG_COMPLETE_EVENT". No scan commands (including the sched scan) can be executed concurrently with the "CMD_DFS_CHANNEL_CONFIG", wl->mutex ensures that. [Arik - move reset of reg_ch_conf_last to safe place inside op_stop_locked] [Eliad - adjust to new event waiting api] Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: save session_id per-linkEliad Peller1-13/+17
A new session_id is generated on link allocation. it is saved in a global array and used later, on tx. The new fw api adds new bcast/global_session_id fields to start_role(ap) command, and a new session_id field to add_peer command. align the driver with it. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: pass wmm configuration to the fwEliad Peller1-1/+7
New fields were added to start_role(ap) and set_peer_state commands, so the fw will be able to know whether the sta/ap supports wmm (the fw uses it in order to choose the AC for some of its internally-generated frames) For sta, take this value right from bss_conf->qos. For ap, check for wmm support by looking for the WMM IE in the configured beacon. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: update events enum/struct to new fw apiEliad Peller1-37/+7
The event mailbox in wl18xx has a different (non-compatible) structure. Create common functions in wlcore to handle the events, and call them from the chip-specific event mailbox parsers. This way, each driver (wl12xx/wl18xx) extracts the event mailbox by itself according to its own structure, and then calls the common wlcore functions to handle it. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: update channel_switch/stop_channel_switch commandsEliad Peller1-37/+3
Some fields were added to the channel_switch and stop_channel_switch commands. Unfortunately, the new 18xx channel_switch struct is not backward compatible with the 12xx channel switch struct. Add a new channel_switch op to wlcore, and update the driver accordingly. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: split 18xx and 12xx scan mechanismEliad Peller1-5/+7
The scan APIs of 12xx and 18xx are totally different. Use some common functions as much as possible (e.g. for setting scan channels), but split scan.c into chip-specific scan.c files, each implementing its own scan mechanism. (in other words - move most of the current wlcore's scan.c into wl12xx, and implement a similar mechanism in 18xx, according to the new api) New wlcore ops are introduced in order to call the chip-specific scan functions. The template indices used for each scan (regular/scheduled) are also different between the chips, so set the correct indices used for each scan type after identifying the chip. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: configure the remote rates with our own ratesEliad Peller1-1/+6
With the new connection flow, start_sta is called before the remote rates where updated. Use our own supported rates instead to make sure we don't disable any potential rate (the rate policies will be updated later, but there is currently no way to update the remote rates) Signed-off-by: Eliad Peller <eliad@wizery.com> Reviewed-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: specify correct supported_ratesEliad Peller1-2/+10
The supported_rates field should contain all our supported rates, even if the remote peer doesn't support them. (rename CONF_TX_AP_ENABLED_RATES to CONF_TX_ENABLED_RATES, as we now use it for both ap and sta) Signed-off-by: Eliad Peller <eliad@wizery.com> Reviewed-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: implement .remain_on_channel() callbackEliad Peller1-25/+16
implement the reamin_on_channel() callback by starting a dev role (already associated with the current vif) on the requested channel/band. This channel is usually different from the channel of the sta role, so pass it to wl12xx_roc() as well, and notify mac80211 (async) when the fw is ready on the new channel. Now, in case of offchannel tx, we should use the dev role hlid, instead of the sta hlid. Signed-off-by: Eliad Peller <eliad@wizery.com> Reviewed-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-09-27wlcore: use dynamic keep-alive template idsEliad Peller1-1/+1
Currently, all the (station) roles use the same keep-alive template id (0). However, the klv template ids shouldn't be shared by different roles. Implement a simple klv_templates bitmap, and let each role allocate its own klv template id on role initialization. [Arik - remove invalidation of KLV template when getting into "idle". This is already handled in unjoin] Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>