summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl18xx/main.c
Commit message (Collapse)AuthorAgeFilesLines
* wlcore/wl12xx/wl18xx: verify multi-role and single-role fw versionsLuciano Coelho2012-12-041-3/+5
| | | | | | | | Previously we were only checking the single-role firmware version. Now add code to check for the firmware versions separately for each firmware type. Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore/wl18xx/wl12xx: add recovery settings to confYair Shapira2012-12-041-0/+4
| | | | | | | | | | | | add support for recovery settings including bug_on_recovery and no_recovery options. These options can now be set using wl18xx-conf.bin file and wlconf tool. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore/wl18xx/wl12xx: separate channel count between chipsArik Nemtsov2012-12-041-0/+1
| | | | | | | | | 18xx chips are capable of staying on 2 channels at the same time. Introduce a chip-family specific parameter to set the number of channels in the interface-combinations published by the driver. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: use new set bandwidth command to adjusting channel BWArik Nemtsov2012-11-281-0/+38
| | | | | | | | | | 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>
* wlcore: configure dwell times according to scan typeEliad Peller2012-11-281-2/+2
| | | | | | | | | | | | | Allow configuring different dwell times to the different scan types (regular and scheduled). Add new configuration entry (dwell_time_dfs) to conf_scan_settings, in order to allow setting different values for normal scan and scheduled scan. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: make driver operational againEliad Peller2012-11-281-4/+0
| | | | | | | | we have done updating the driver to the new fw api, so make the driver operational again. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: add new reg-domain configuration commandVictor Goldenshtein2012-11-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* wlcore: update events enum/struct to new fw apiEliad Peller2012-11-271-2/+17
| | | | | | | | | | | | | | | | | 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>
* wlcore: update channel_switch/stop_channel_switch commandsEliad Peller2012-11-271-0/+2
| | | | | | | | | | | | | 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>
* wl18xx: increase MAX_CHANNELS_5GHZEliad Peller2012-11-271-0/+1
| | | | | | | | | | | | Some regdomains have more than 23 valid 5ghz channels, so 18xx's MAX_CHANNELS_5GHZ was increased to 32. Since now we have different max 5ghz channels values for wl12xx and wl18xx, add a new wl->max_channels_5ghz field, and use it for scan channels configuration. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: split 18xx and 12xx scan mechanismEliad Peller2012-11-271-1/+12
| | | | | | | | | | | | | | | | | | | | | | 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>
* wl18xx: change fw name and temporarily fail loadingEliad Peller2012-11-271-1/+5
| | | | | | | | | | | | | | | | | The new fw (8.5.0.0.28) is not backward compatible with older drivers. Use a new fw name (along with bumping the min fw version), and add some code to fail any boot attempt during the fw api alignment patches (as the driver is not functional in these transitional patches). This code will be removed after the api alignment will be done. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: protect wlcore_op_set_key with mutexEliad Peller2012-09-271-8/+0
| | | | | | | | | | | | | | | | | | | | | | | wlcore_op_set_key() calls wl18xx_set_key(), which in turn executes some of his function calls without acquiring wl->mutex and making sure the fw is awake. Adding mutex_lock()/ps_elp_wakeup() calls is not enough, as wl18xx_set_key() calls wl1271_tx_flush() which can't be called while the mutex is taken. Add the required calls to wlcore_op_set_key, but limit the queues_stop and flushing to the only encryption types in which a spare block might be needed (GEM and TKIP). [Arik - move state != ON check] Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wlcore: Refactor probeIdo Yariv2012-09-271-24/+35
| | | | | | | | | Move most of the device-specific probe functionality into setup(), a new op. By doing this, wlcore_probe will be the first to request a firmware from userspace, making it easier to load the NVS file asynchronously. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wl18xx: default to siso40 in 2.4ghz with a single antennaArik Nemtsov2012-09-271-2/+2
| | | | | | | | The driver used siso20 in this case for legacy reasons. Reported-by: Ido Reis <idor@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wlcore: Fix unbalanced interrupts enablementIdo Yariv2012-09-271-0/+7
| | | | | | | | | | The interrupt line is enabled by wl12xx_enable_interrupts and wl18xx_enable_interrupts, but it will not be disabled in all failure paths. Fix this. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wlcore/wl18xx: add phy_fw_version_str to debugfs driver_stateYair Shapira2012-09-271-0/+6
| | | | | | | | add phy_fw_version_str to debugfs driver_state file. information is taken during boot and stored in wl->chip.phy_fw_ver_str. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wl18xx: number_of_assembled_ant5 indicates if A band is enabledYair Shapira2012-09-271-5/+2
| | | | | | | | | | | | | | | | | | Use number_of_assembled_ant5 phy param to indicate if A band is enabled: if number_of_assembled_ant5 != 0 then it is enabled otherwise it is disabled. This aligns with phy implementation that uses this param both to indicate if band is active and the number of antennas. This parameter replaces enable_11a module param that was removed. User-Space applications can use wlconf and/or INI files to disable A band using this parameter. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wlcore/wl18xx/wl12xx: allow up to 3 mac addressesArik Nemtsov2012-09-271-0/+1
| | | | | | | | | Allow 3 native mac addresses on 18xx. On 12xx allow 2 native mac addresses and set the LAA bit to create a third mac address. This enabled operation with a separate group interface. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wlcore/wl18xx/wl12xx: aggregation buffer size setIgal Chernobelsky2012-09-271-1/+1
| | | | | | | | | | | | Aggregation buffer size is set separately per 18xx/12xx chip family. For 18xx aggragation buffer is set to 13 pages to utilize all the available tx/rx descriptors for aggregation. [Arik - remove redundant parts from the patch] Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wl18xx/wl12xx: defines for Tx/Rx descriptors numIgal Chernobelsky2012-09-271-2/+2
| | | | | | | Use defines for number of Tx/Rx descriptors. Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wl18xx: increase rx_ba_win_size to 32Ido Reis2012-09-271-1/+1
| | | | | | | The new FWs support a bigger BA window. Signed-off-by: Ido Reis <idor@ti.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wl18xx: update default phy configuration for pg2Ido Reis2012-09-271-14/+3
| | | | | | | | | | default switch configuration set to pg2 chips (rdl 1/2/3/4). removed hacks for specific board types. pg1.x boards are now supported only using module params or specific conf files. Signed-off-by: Ido Reis <idor@ti.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wl18xx: use module_platform_driverDevendra Naga2012-09-271-12/+1
| | | | | | | | | the driver's init and exit routines can be implemented with the module_platform_driver, as the init and exit code is same as that of the module_platform_driver Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
* wl18xx: remove duplicated include from main.cWei Yongjun2012-09-071-1/+0
| | | | | | | | | From: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Remove duplicated include. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl18xx: enable MIMO rates when connected as a MIMO STAArik Nemtsov2012-07-181-4/+12
| | | | | | | | Use this opportunity to consolidate the check for MIMO support into a separate function. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: disable calibrator based fem detectYair Shapira2012-07-181-0/+6
| | | | | | | | bip calibration is not required in wl18xx. Therefore we disable also auto fem (using calibrator fem detect) mode. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: add support for ht_mode in conf.hYair Shapira2012-07-181-26/+57
| | | | | | | | | | | | | | | | ht_mode added to wl18xx conf struct in order to support different modes from the configuration file, as well as module params, and by default (working without a conf file and/or no module params). the hack regarding conf.phy.low_band_component_type for each board is now explicitly handled after parsing module params. missing default values to wl18xx config added. fix string module params not to have defaults (so if empty, param can be taken from conf file). update conf version to 3. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Ido Reis <idor@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: alloc conf.phy memory to ensure alignemntArik Nemtsov2012-07-181-2/+10
| | | | | | | | We get DMA alignment trouble if the beginning of the conf.phy struct is not aligned to 4 bytes. Use kmemdup to ensure alignment. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: determine AP extra rates correctlyArik Nemtsov2012-07-101-5/+15
| | | | | | | | | | | Don't use the ht_mode module parameter for determining AP supported rates. We can rely on channel type, since HT40 won't be enabled if our HT cap doesn't support it. Enable MIMO only if there enough antennas, and rely on per-peer rate limitation to prevent IOPs. Signed-off-by: Arik Nemtsov <arik@wizery.com>
* wl12xx/wl18xx: use a dynamic PS timeout of 1.5secArik Nemtsov2012-07-101-1/+1
| | | | | | | | It seems some parties have bad user experience when smaller values are used. This should have little implications for power consumption, since traffic is bursty in nature. Signed-off-by: Arik Nemtsov <arik@wizery.com>
* wlcore/wl12xx/wl18xx: check min FW versionArik Nemtsov2012-07-101-0/+4
| | | | | | | | | | Refuse to boot if the FW version is too old. The minimum version is set per chip, with the option of setting it per PG in the future. When boot fails because of an old FW, display a helpful message. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: enable sched scan while connectedVictor Goldenshtein2012-07-101-0/+1
| | | | | | | | | | | | New wl12xx firmware supports scheduled scans also while connected. Stop blocking sched scan requests when connected and add a quirk to block in hardware that don't support it (currently wl18xx doesn't). This requires FW version 6/7.3.10.2.112 for single-role and 6/7.5.6.0.25 for multi-role. Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: deprecate PG1 supportLuciano Coelho2012-06-261-38/+7
| | | | | | | | | The new PG2 version of the chip has a few differences in terms of FW API if compared to PG1. PG1 is just a sample that shouldn't be used in real life, so to avoid having to handle both separately, mark the PG1 version as deprecated and bail out during probe. Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: Propagate errors from wl1271_raw_write32Ido Yariv2012-06-221-23/+63
| | | | | | | | | | Propagate errors from wl1271_raw_write32 and request for recovery when appropriate. Also rename prefixes of wlcore functions which their prototypes had to be changed. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: Propagate errors from wl1271_raw_read32Ido Yariv2012-06-221-32/+82
| | | | | | | | | | Propagate errors from wl1271_raw_read32. Since the read functions had no way of returning errors in-band, change their prototypes. Also rename prefixes of wlcore functions which their prototypes had to be changed. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: Propagate errors from wl1271_writeIdo Yariv2012-06-221-7/+12
| | | | | | | | | | Propagate errors from wl1271_write and request for recovery when appropriate. Also rename prefixes of wlcore functions which their prototypes had to be changed. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: use %zu for size_t arguments in printk callsLuciano Coelho2012-06-211-2/+2
| | | | | | | | | | | | | After 934b9d1e (wl18xx: avoid some -Wformat warnings) there was still a warning with (at least) ARM gcc version 4.4.1: drivers/net/wireless/ti/wl18xx/main.c: In function 'wl18xx_conf_init': drivers/net/wireless/ti/wl18xx/main.c:1026: warning: format '%ld' expects type 'long int', but argument 2 has type 'unsigned int' Fix this by using %zu for the both formats, since the fw->size and the macro (derived from sizeof()) are size_t. Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: split siso40 HT cap between 2Ghz and 5GhzArik Nemtsov2012-06-211-5/+19
| | | | | | | | Remove the cap IEEE80211_HT_CAP_DSSSCCK40 from the 5Ghz variant of the siso40 HT capabilities. It is meaningless in 5Ghz. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: sane defaults for HT capabilitiesArik Nemtsov2012-06-211-30/+33
| | | | | | | | | | | | | | | Introduce a default set of HT capabilities that are set according to the number of antennas on the board. Move the HT setting code down to allow the number of antennas to be set (and optionally overridden) before it. Remove the "mimo" HT option, since the default mode now enables MIMO is possible. Use this opportunity to add a helper function for setting HT capabilities and reduce the volume of the code a bit. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: explicitly remove the 5Ghz MIMO HT capArik Nemtsov2012-06-211-14/+3
| | | | | | | | The 18xx chip does not support MIMO in 5Ghz. Use the siso20 HT cap as fallback in 5Ghz when "mimo" is requested. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: set Tx align quirk for PG2Arik Nemtsov2012-06-211-1/+1
| | | | | | | | | Before patch b5d6d9b (wlcore/wl12xx/wl18xx: don't use TX align quirk for wl127x), this was automatically set for all platforms. As this should now be set explicitly, set it for PG2 as well. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: increase Rx descriptors for PG2Arik Nemtsov2012-06-211-1/+10
| | | | | | | | | | | New PG2 firmwares have additional Rx descriptors. Add a module parameter to manually set the number of Rx descriptors for older versions (PG1). We cannot discriminate based on chip-id, since this value must be set on probe. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore: allow setting sleep_auth before interface initArik Nemtsov2012-06-211-0/+1
| | | | | | | | | | | | | | | | Hold a value for sta_sleep_auth that is amenable to change by debugfs. When detecting a legal value in this variable on interface init, use it as an override value for sleep_auth. This makes debugging more intuitive using the debugfs value. Increment the conf version since we added an element to the conf structure. Note: An AP going up will always set sleep_auth to PSM_CAM. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: clean up phy module parametersArik Nemtsov2012-06-081-56/+56
| | | | | | | | | | | | Give all wl18xx phy module paramters -1 as a default value, indicating the paramter was not set. Add previous default values to the default 18xx priv conf structure. Remove the board_type field from wl18xx priv. The field with the same name inside the phy conf is good enough for our purposes. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: align wl18xx_conf_phy with FW variant and remove itArik Nemtsov2012-06-081-49/+3
| | | | | | | | | | | | wl18xx_conf_phy represents part of the FW native wl18xx_mac_and_phy_params structure. Remove it and replace the phy part of the wl18xx conf with the FW bound structure. This allows us to set/override all members. Increment the wlconf version to ensure compatibility with the new structure Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: allow FW-log by default for PG2.0Arik Nemtsov2012-06-081-1/+0
| | | | | | | This is supported by new FW versions (.88+). Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: read configuration structure from a binary fileLuciano Coelho2012-06-081-5/+63
| | | | | | | | | Instead of using the hardcoded configuration structure, try to read it from a "firmware" file called wl18xx-conf.bin. If the file doesn't exist, fall back to the hardcoded version. If the file exists but is illegal, bail out. Signed-off-by: Luciano Coelho <coelho@ti.com>
* wlcore/wl18xx/wl12xx: use u8 instead of bool for host_fast_wakeup_supportLuciano Coelho2012-06-081-1/+1
| | | | | | | | | The conf structure is going to be exported to a file, so we should use only well defined types. bool is not well defined and may vary from platform to platform, so change the host_fast_wakeup_support type to u8 instead. Signed-off-by: Luciano Coelho <coelho@ti.com>
* wl18xx: pad only last frame in aggregration buffer for PG2Ido Reis2012-06-071-2/+28
| | | | | | | | | | | | | | | | In PG2 only the last frame in the aggregate buffer should be aligned to the sdio block size. This frame's header msb should be set to 0, while in all the previous frames in the aggregation buffer, this bit should be set to 1. [Add a HW op for setting the frame ctrl bit only for 18xx. Other minor cleanups - Arik] [Make the pre_pkt_send operation optional -- Luca] Signed-off-by: Ido Reis <idor@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
OpenPOWER on IntegriCloud