Commit Graph

426388 Commits

Author SHA1 Message Date
Mark A. Greer 9d9304b321 NFC: trf7970a: Add ISO/IEC 15693 and Type 5 tag Support
Add support for ISO/IEC 15693 RF technology and Type 5 tags.
Note that Type 5 tags used to be referred to as Type V tags.

CC: Erick Macias <emacias@ti.com>
CC: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-03-11 00:47:09 +01:00
Mark A. Greer 8006289108 NFC: trf7970a: Add support for Type 4A Tags
Add support for Type 4A Tags which includes
supporting the underlying ISO/IEC 14443-A
protocol.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-03-11 00:47:08 +01:00
Mark A. Greer 165063f1da NFC: trf7970a: Add driver with ISO/IEC 14443 Type 2 Tag Support
Add a driver for the Texas Instruments TRF7970a RFID/NFC/15693
transceiver.  The driver currently supports ISO/IEC 14443 Type 2
tags only (MIFARE Ultralight and Ultralight C but not Classic).

CC: Erick Macias <emacias@ti.com>
CC: Felipe Balbi <balbi@ti.com>
Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-03-11 00:46:55 +01:00
Mark A. Greer ceeee42d85 NFC: digital: Rename Type V tags to Type 5 tags
According to the latest draft specification from
the NFC-V committee, ISO/IEC 15693 tags will be
referred to as "Type 5" tags and not "Type V"
tags anymore.  Make the code reflect the new
terminology.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-03-11 00:40:59 +01:00
Axel Lin 0b51fc5633 NFC: Use LIST_HEAD() at appropriate places
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-23 23:34:09 +01:00
Axel Lin 4f913d4631 NFC: digital: Use matching_[im|tm]_protocols to check with NFC protocols masks
This ensures we won't add polling function to the table of polling technologies
for non-supported protocols.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-23 23:34:09 +01:00
Axel Lin 156cef80f2 NFC: Use list_for_each_entry in nfc_find_se()
nfc_find_se() does not modify any list entry while iterating the list.
So use list_for_each_entry instead of list_for_each_entry_safe.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-23 23:32:18 +01:00
Axel Lin 99968e0616 NFC: pn533: Convert to use USB_DEVICE macro
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-23 23:32:18 +01:00
Axel Lin 4aa7ed02f5 NFC: port100: Convert to use USB_DEVICE macro
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-23 23:32:18 +01:00
Axel Lin 9bec44bf0b NFC: NCI: Use reinit_completion() at appropriate places
Calling init_completion() once is enough.
Then use reinit_completion() instead in __nci_request() and nci_spi_send().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-23 23:32:18 +01:00
Thierry Escande 6ea7398d00 NFC: digital: Fix a possible memory leak
This fixes a memory leak issue that may occur if data sending fails in
initiator mode. The data_exch structure was not released in case of
error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:55 +01:00
Thierry Escande 564af14e36 NFC: digital: Add missing break in switch statement
There was a missing break making the digital stack configured for
ISO1443 target instead of ISO15693.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:55 +01:00
Thierry Escande 2a26f9a2c1 NFC: port100: Add support for type 4A tag platform
This adds support for ISO-DEP protocol over NFC-A rf technology. The
port100 already supports NFC-A and ATS request and response for type 4A
tags are handled at digital level. This patch adds NFC_PROTO_ISO14443
to the supported protocols and an entry for framing configuration which
is the same as NFC-A standard frame with CRC handling.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:54 +01:00
Thierry Escande c813007f9f NFC: digital: Add ISO-DEP support for data exchange
When a type 4A target is activated, this change adds the ISO-DEP SoD
when sending frames and removes it when receiving responses. Chaining
is not supported so sent frames are rejected if they exceed remote FSC
bytes.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:54 +01:00
Thierry Escande 12e3d241e4 NFC: digital: Add poll support for type 4A tag platform
This adds support for ATS request and response handling for type 4A tag
activation.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:54 +01:00
Thierry Escande d3815ea95c NFC: port100: Fix possible buffer overflow
The arrays for protocols and rf techs must define a number of entries
corresponding to their maximum possible index values.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:54 +01:00
Arron Wang f1dd56fdc4 NFC: pn544: i2c: Support PN544 C3 secure firmware download
PN544 C3 firmwares already contain the command frames to be sent, but as
they may exceed the i2c maximum payload, we need to fragment them into
secure chunks and send them through the secure write command.

Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:54 +01:00
Arron Wang 971d63cff6 NFC: pn544: Pass hardware variant information when downloading firmware
Different pn544 hardware variant may use different commands to download
new firmwares. The C2 does a regular firmware download while the C3 uses
a more secure protocol.
As a consequence we need to pass the hardware variant from the HCI SW
version command reply down to the pn544 i2c layer, in order to use the
right protocol at run time.

Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:54 +01:00
Mark A. Greer f5f6872ed2 NFC: Add netlink support for ISO/IEC 15693
Add ISO/IEC 15693 support by having netlink push the
1-byte DSFID and 8-byte UID tag information upstream.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:53 +01:00
Mark A. Greer a381d48286 NFC: digital: Add Digital Layer support for ISO/IEC 15693
Add support for ISO/IEC 15693 to the digital layer.  The code
currently uses single-slot anticollision only since the digital
layer infrastructure only supports one tag per adapter (making
it pointless to do 16-slot anticollision).

The code uses two new framing types:
'NFC_DIGITAL_FRAMING_ISO15693_INVENTORY' and
'NFC_DIGITAL_FRAMING_ISO15693_TVT'.  The former is used to
tell the driver to prepare for an Inventory command and the
ensuing anticollision sequence.  The latter is used to tell
the driver that the anticollision sequence is over and to
prepare for non-inventory commands.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:53 +01:00
Mark A. Greer e487e4dc2e NFC: Add ISO/IEC 15693 header definitions
Add the header definitions required by upcoming
patches that add support for ISO/IEC 15693.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-02-16 23:49:53 +01:00
Stephen Rothwell 35582ad9d3 Staging: rtl8812ae: remove modules field of rate_control_ops
This has been removed in further work.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:23:23 -05:00
Pontus Fuchs 908628db14 wcn36xx: Update dtim period before starting BSS
The dtim period sent to FW was 0 because the dtim period
was never set. This caused an incorrect dtim count to be sent in
beacons.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:18 -05:00
Pontus Fuchs 82cad2a0b0 wcn36xx: Track dpu signature per sta
This fixes problems seen with multiple softap clients and reconnecting
softap clients.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:17 -05:00
Pontus Fuchs 2ba0b46175 wcn36xx: Rename wcn36xx_vif.ucast_dpu_signature to self_ucast_dpu_sign
This is more line with the names of the other members

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:17 -05:00
Pontus Fuchs f2ed5d2499 wcn36xx: Add support for 3680
3680 has a few registers on other addresses.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:17 -05:00
Pontus Fuchs 2be6636a96 wcn36xx: Print FW capabilities
After fw caps exchange, print the FW's capabilities.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:17 -05:00
Pontus Fuchs 4bda7faf61 wcn36xx: Cache nv to avoid request_firmware on resume path
If wowlan if off mac80211 will stop / start the driver on suspend /
resume. This causes problems on resume since request_firmware is called
from start. Fix this by caching the nv.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:17 -05:00
Pontus Fuchs 546c505bdc wcn36xx: Wait longer for SMD commands to complete
On some wcnss firmwares the start command can take up to 300ms to
complete. Currently there is a 200ms timeout for SMD command to
complete which causes the start to fail.

Increase the timeout to 500ms. Also improve debug information
regarding SMD command completion time.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:17 -05:00
Pontus Fuchs c951da4615 wcn36xx: Improve feature caps exchange
* Response format is not in the canonical format.
  wcn36xx_smd_rsp_status_check cannot be used.

* Save the FW caps in wcn36xx struct for later use.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:17 -05:00
Pontus Fuchs 08762322c3 wcn36xx: Fix copy paste error hal_exit_bmps -> hal_keep_alive
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:17 -05:00
Arik Nemtsov 6b27fe5167 wlcore: add support for STA CSA with chan contexts
TI wl12xx/wl18xx cards support channel switch via a driver specific
switch_channel op while operating with channel contexts.

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-13 15:20:16 -05:00
Eliad Peller d881fa2c50 wlcore: enable beacon filtering only after receiving a beacon
Enabling beacon filtering before receving a beacon
might result in not having a beacon at all for the
current connected AP, which prevents the station
from entering power-save.

Replace the current approach (of starting beacon
filtering on init) and configure beacon filering
only after bss_conf->dtimper is set (which means
mac80211 already parsed a beacon).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:16 -05:00
Yaniv Machani 5b07d97a38 wlcore: increase timeout to 5000 msecs
dfs configuration command might take longer than
the current timeout. increase it to 5 seconds.

Signed-off-by: Yaniv Machani <yanivma@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:16 -05:00
Arik Nemtsov 1ede950073 wlcore: decrease warning verbosity during recovery
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-13 15:20:16 -05:00
Eliad Peller 41ed1a787c wlcore: consider multiple APs when checking active_link_count
Each AP has its own global and broadcast links, so when
checking for active sta count (according to the active_link_count)
we must take them all into account.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:16 -05:00
Eliad Peller bf4e5f1ac0 wlcore: don't handle unsetting of default wep key
mac80211 unsets the default wep key on disassoc.
The fw doesn't support this notification, so simply
ignore it.

The actual flow actually triggers fw recovery in some
cases, as mac80211 unsets the default key only after
disassoc, when wlvif->sta.hlid, resulting in invalid
hlid being passed to the fw.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:16 -05:00
Arik Nemtsov bc566f9203 wlcore: wl18xx: allow CCK rates for AP mode
12xx chips allow only OFDM rates in AP mode for BT-Coex purposes. This
is no longer required in 18xx chips, starting with FW 8.6.0.0.8.

Update the min allowed FW version in 18xx to support this functionality.

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-13 15:20:16 -05:00
Barak Bercovitz 5a441f5ff7 wlcore: don't stop sched_scan on interface removal
Stopping sched scan on interface removal (during recovery)
is no longer needed, as sched scanning is automatically
restarted by mac80211.

Signed-off-by: Barak Bercovitz <barak@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:15 -05:00
Igal Chernobelsky 2a5ad92e27 wlcore: send EAPOL frames with voice priority
Send EAPOL frames with voice priority by setting (the new)
TX_HW_ATTR_EAPOL_FRAME bit in tx attribute.

Sending EAPOL with voice priority fixes re-key
timeout issues during heavy traffic.

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:15 -05:00
Eliad Peller 028e7243ac wl18xx: move to new firmware (wl18xx-fw-3.bin)
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-13 15:20:15 -05:00
Eliad Peller abf0b24912 wlcore/wl12xx/wl18xx: configure iface_combinations per-hw
Each hw supports a different iface combinations.
Define the supported combinations in each driver,
and save it in wl->iface_combinations.

Since each driver defines its own combinations now,
it can also define its max supported channels, so
we no longer need to save and set it explicitly
in wlcore.

Update wl18xx interface combinations to allow
multiple APs.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:15 -05:00
Eliad Peller 32f0fd5b70 wlcore/wl12xx/wl18xx: configure max_stations per-hw
Each hw supports a different max stations (connected to the
same ap). add a new wl->max_ap_stations and use it instead
of the current common AP_MAX_STATIONS.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:15 -05:00
Eliad Peller da08fdfaf0 wlcore/wl12xx/wl18xx: configure num_links per-hw
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-13 15:20:15 -05:00
Eliad Peller 75fb4df7f8 wlcore/wl12xx/wl18xx: simplify fw_status handling
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>
2014-02-13 15:20:15 -05:00
Arik Nemtsov 7a536265b0 wlcore: AP: don't start mac80211 PS on non-peer HLIDs
It seems the wl18xx FW sometimes sends spurious changes on the PSM state
of the broadcast HLID. This causes us to search for a station on a
non-peer link and fail, causing warnings in our log.

Prevent the driver from considering PSM changes for any non-peer HLIDs.

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-13 15:20:14 -05:00
Barak Bercovitz 51ae14d0ea wlcore: block read/writes to FW during ELP
When the chip is in ELP mode read/write to FW is invalid and may cause
the lower layers to get stuck. The reads/writes concerning ELP wakeup
are the exception here and are checked for. In addition to blocking the
IO, produce a warning.

Signed-off-by: Barak Bercovitz <barak@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:14 -05:00
Arik Nemtsov 9be86cf067 wlcore: cancel Tx watchdog on suspend and rearm on first Tx after
Sometimes a tx_flush during suspend fails, but the FW manages to flush
out the packets during the time when the host is supsended. Cancel
the Tx-watchdog on suspend to not cause a spurious recovery on resume
for that case. Set a flag to reinit the watchdog on the first Tx after
resume, so we'll still recover if the FW is not empty and there's
indeed a problem.

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-13 15:20:14 -05:00
Nadim Zubidat 02d0727ca3 wlcore: memset wl->rx_filter_enabled to zero after recovery
zero rx_filter_enabled array after recovery to avoid
cases were the driver will keep trying to clear a
filter which is not configured in FW.

Such case will cause consecutive recoveries due to
command execution failures.

While on it, convert rx_filter_enabled to bitmap,
to save some memory and make sparse happy (it
doesn't like sizeof(bool array)).

Signed-off-by: Nadim Zubidat <nadimz@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:14 -05:00
ZHAO Gang bb6bd25c08 b43: use kernel api to replace b43 specific helper function
Use ieee80211_channel_to_frequency() to replace b43_channel_to_freq_{2,5}ghz(),
and remove unused b43_freq_to_channel_{2,5}ghz().

Signed-off-by: ZHAO Gang <gamerh2o@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13 15:20:14 -05:00