Commit Graph

348250 Commits

Author SHA1 Message Date
Samuel Ortiz
a0f36536ac NFC: pn544: Use devm_kzalloc API
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:53 +01:00
Samuel Ortiz
234d4d6b10 NFC: pn544: Use module_i2c_driver
The pn544 init routine does nothing but adding the driver to the i2c bus.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:52 +01:00
Samuel Ortiz
aa74103071 NFC: pn544: Separate the core code and the i2c one into different modules
As we may need to support other physical layers, we can avoid linking the
core part into each and every pn544 module.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:52 +01:00
Eric Lapuyade
bf71ab8ba5 NFC: Add HCI quirks to support driver (non)standard implementations
Some chips diverge from the HCI spec in their implementation of standard
features. This adds a new quirks parameter to
nfc_hci_allocate_device() to let the driver indicate its divergence.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:51 +01:00
Eric Lapuyade
924d4a023e NFC: Fixed skb leak in tm_send() nfc and hci ops implementations
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:50 +01:00
Eric Lapuyade
40d06d3647 NFC: Changed event_received hci ops result semantic
Some chips use a standard HCI event code, destined to a proprietary
gate, with a different meaning. Therefore, the HCI driver must always
have a chance to intercept the event before standard processing is
attempted.
The new semantic specifies that the result value "1" means that the
driver doesn't especially handle the event. result <= 0 means it was
handled.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:49 +01:00
Eric Lapuyade
27c31191b3 NFC: Added error handling in event_received hci ops
There is no use to return an error if the caller doesn't get it.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:49 +01:00
Eric Lapuyade
f0c9103813 NFC: Fixed nfc core and hci unregistration and cleanup
When an adapter is removed, it will unregister itself from hci and/or
nfc core. In order to do that safely, work tasks must first be canceled
and prevented to be scheduled again, before the hci or nfc device can be
destroyed.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:48 +01:00
Julia Lawall
5f4d6214ef NFC: nfcwilink: Use devm_kzalloc
devm_kzalloc allocates memory that is released when a driver detaches.
This patch uses devm_kzalloc for data that is allocated in the probe
function of a platform device and is only freed in the remove function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:47 +01:00
Waldemar Rymarkiewicz
9e2d493e74 NFC: pn533: Introduce ops for frame logic
Encapsulate whole frame logic (tx/rx frame structure and size) inside
the ops structure to make the core driver generic for devices which
handle frames in non standard menner (different then pn533 spec say).

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:46 +01:00
Waldemar Rymarkiewicz
16f7541914 NFC: pn533: Remove unused dev->wq_in_frame
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:46 +01:00
Waldemar Rymarkiewicz
0c33d2626d NFC: pn533: Cleanup pn533_cmd_complete_t
'params' arg in pn533_cmd_complete_t definition has been deprecated and
currently is not in use (resp skb is pass in arg ptr), so remove it.

Also 'params_len' arg is used as a transfer status indicator, so simply
reword it appropriately.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:45 +01:00
Waldemar Rymarkiewicz
a5798094e9 NFC: pn533: Remove deprecated dev->out_frame buff
As it's not used anymore get rid of that buffer.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:44 +01:00
Waldemar Rymarkiewicz
e8f4053111 NFC: pn533: Use skb in __pn533_send_cmd_frame_asyn
__pn533_send_cmd_frame_async() should be frame type independent. So, don't
use pn533_frame type params and instead use skb for req and resp pointers.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:44 +01:00
Waldemar Rymarkiewicz
5b5a4437ae NFC: pn533: Don't use out_frame in pn533_send_ack
dev->out_frame buffer is much bigger for ACK frame needs. Use
local buffer instead.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:43 +01:00
Waldemar Rymarkiewicz
fcfafc7690 NFC: pn533: Cleanup debug messages
Remove debug messages which do not include valueable informations
in debug mode. Add some new ones for better tracking or reword when
if necessary.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:42 +01:00
Waldemar Rymarkiewicz
f8f991710b NFC: pn533: Fix urb->status handling
Fix text message to be more suitable for the error code and treat
ESHUTDOWN as an error not debug msg.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:41 +01:00
Waldemar Rymarkiewicz
89fb202567 NFC: pn533: Remove unused pn533_send_cmd_frame_asy
Remove obsolete send async api as it's no longer used. Remove
global dev->in_frame as well, as each packet is kept is a
seperate skb struct now, so that's not used anymore.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:41 +01:00
Waldemar Rymarkiewicz
b08e860355 NFC: pn533: Fix minor style issues
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:40 +01:00
Waldemar Rymarkiewicz
5d467742bc NFC: pn533: Fix open parenthesis alignment
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:39 +01:00
Waldemar Rymarkiewicz
37cf4fc6c9 NFC: pn533: Fix spacing issues
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:39 +01:00
Waldemar Rymarkiewicz
6ca55372bf NFC: pn533: Fix quoted strings split across lines
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:38 +01:00
Waldemar Rymarkiewicz
b5193e5da2 NFC: pn533: Remove frame logic from poll cmds
Remove frame logic from start_pool cb using the new iface
for async send.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:37 +01:00
Waldemar Rymarkiewicz
99e591be3d NFC: pn533: Dump tx and rx data in debug mode
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:36 +01:00
Waldemar Rymarkiewicz
b1e666f503 NFC: pn533: Del frame logic from Data Exchange cmd
Remove frame logic from transceive cb using new iface
for async send.

For pn533_wq_mi_recv() use pn533_send_cmd_direct_async which
sends the cmd directly to the hardware, skipping cmd queue.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:36 +01:00
Waldemar Rymarkiewicz
13003649b1 NFC: pn533: Del frame logic from InJumForDep cmd
Remove frame logic from InJmumpForDEP command using
the new iface for async send.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:35 +01:00
Waldemar Rymarkiewicz
e487882345 NFC: pn533: Del frame logic from TgGet/SetData cmd
Remove frame logic from TgSetData and TgGetData commands
using the new iface for async send.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:51:34 +01:00
Samuel Ortiz
1727cf9374 NFC: llcp: Fix Rx memory leak
The reference count bump on the llcp Rx path is leading to a memory leak
whenever we're not receiving an I frame.
We fix that by removing the refcount bump (drivers must not free their
received skb) and using it only in the I frame path, when the frame is
actually queued. In that case, the skb will only be freed when someone
fetches it from userspace. in all other cases, LLCP received frames will
be freed when leaving the Rx work queue.

Reported-by: Eric Lapuyade <eric.lapuyade@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:48:25 +01:00
Samuel Ortiz
2593c2c6ec NFC: llcp: Remove the tx backlog queue
Not only it was improperly use to queue backlogged RX skbuffs, but it was
also not processed at all.
If the socket receive queue is full we simply drop the incoming packets.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:31 +01:00
Waldemar Rymarkiewicz
cb950d9304 NFC: pn533: Remove pn533_send_cmd_frame_sync
Remove obsolate pn533_send_cmd_frame_sync() and use
previously added new iface for sync send.

The new interface require the use of individual skb for each
cmd which removes some memcpy calls and hides frame logic.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:30 +01:00
Waldemar Rymarkiewicz
d22b2db690 NFC: pn533: Add pn533_alloc_skb for req allocation
Allocate sk_buff for the request.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:30 +01:00
Waldemar Rymarkiewicz
94c5c1561d NFC: pn533: Add a new pn533_send_sync iface
It is intended to replace pn533_send_cmd_frame_sync() iface which
requires from the caller to create complete frame.

The new function constructs a complete frame itself and sends it out
in sync manner. This way frame logic is hidden from the caller.

pn533_send_cmd_sync() returns ERR_PTR in case of an error or a pointer
to valid response sk_buff otherwise. The pointer must be freed by the
caller when it's been consumed.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:29 +01:00
Waldemar Rymarkiewicz
15461aeb53 NFC: pn533: Add a new pn533_send_data_async iface
This iface is intended to be used with DEP transfers. It differs
from pn533_send_cmd_async() in the way the response skb is allocated.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:28 +01:00
Waldemar Rymarkiewicz
aada17ac70 NFC: pn533: Add a new pn533_send_cmd_async iface
This is intendend to replace pn533_send_cmd_frame_async() which
requires from the caller to create a complete frame.

The new function constructs a frame and sends it out which hides the
frame logic and avoid code duplication.

The caller has to allocate skb and put its payload there, and finally
provide the skb together with a complete cb to pn533_send_cmd_async().

Response skb is allocated by the core part and pass to the caller cb.
Next, the caller has to free it when is not needed anymore or pass it
up to the stack.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:28 +01:00
Waldemar Rymarkiewicz
d94ea4f545 NFC: pn533: Remove pointless flags param
__pn533_send_cmd_frame_async() is called when lock is held so GFP_KERNEL
flag will be always used. Thus, having extra param does not optimise the
code.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:27 +01:00
Waldemar Rymarkiewicz
b1bb290ac2 NFC: pn533: Add frame header length define
PN533_CMD_DATAEXCH_HEAD_LEN includes a frame header length which is not
seen at a glance. It can be missleading, so split it and define the
frame header length explicitly.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:26 +01:00
Waldemar Rymarkiewicz
a449ae1cbd NFC: pn533: Remove unused definitions
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:25 +01:00
Waldemar Rymarkiewicz
8d25ca7997 NFC: pn533: Remove in/out_maxlen as it is not used
in_maxlen and out_maxlen was replaced with PN533_NORMAL_FRAME_MAX_LEN

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:25 +01:00
Thierry Escande
2c2d45bdcb NFC: Add support for SO_TIMESTAMP LLCP socket option
Set timestamp in sent and received sk_buffs. timestamp is then put in
msghdr structure in llcp_sock_recvmsg().

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2013-01-10 00:44:24 +01:00
Simon Wunderlich
e93d083f42 ath9k: add spectral scan feature
Adds the spectral scan feature for ath9k. AR92xx and AR93xx chips
are supported for now. The spectral scan is triggered by configuring
a mode through a debugfs control file. Samples can be gathered via
another relay debugfs file.

Essentially, to try it out:

echo chanscan > /sys/kernel/debug/ieee80211/phy0/ath9k/spectral_scan_ctl
iw dev wlan0 scan
cat /sys/kernel/debug/ieee80211/phy0/ath9k/spectral_scan0 > samples
echo disable > /sys/kernel/debug/ieee80211/phy0/ath9k/spectral_scan_ctl

This feature is still experimental.

The special "chanscan" mode is used to perform spectral scan while
mac80211 is scanning for channels. To allow this,
sw_scan_start/complete() ops have been added.

The patch contains code snippets and information from Zefir Kurtisi and
information provided by Adrian Chadd and Felix Fietkau.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:12 -05:00
Sujith Manoharan
1a26cda8e0 ath9k_hw: Fix radio programming for AR9550
For AR9550, program the synth value based on the ref. clock.
The logic for AR9550 is similar to AR9330, but keep the code
separate since changes for AR9330 are required - which would be
done later.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:11 -05:00
Sujith Manoharan
2d7caefbaf ath9k_hw: Add TempCompensation feature for AR9550
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:11 -05:00
Sujith Manoharan
3a6a62fbc9 ath9k_hw: Update initvals for QCA955x
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:11 -05:00
Nishant Sarmukadam
4850b6d355 mwl8k: Wake up queues in mwl8k_start
If queues are stopped in mwl8k_stop,
these should be started in mwl8k_start

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Yogesh Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:11 -05:00
Yogesh Ashok Powar
0dd13a48a9 mwl8k: Delete ampdu streams with state AMPDU_STREAM_NEW in sta remove
When a station deauths, we do not delete the streams with state
AMPDU_STREAM_NEW and these remain created forever. Fix this issue by
removing such streams in the driver

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:11 -05:00
Nishant Sarmukadam
9b0b11fb1e mwl8k: Disable tx_wait completion
Whenever TX ring is drained, priv->tx_wait still points
to a valid completion. Making sure that it points to
NULL before returning from the  mwl8k_tx_wait_empty
check.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:10 -05:00
Sujith Manoharan
96da6fdd5a ath9k_hw: Use helper routines to simplify ar9003_hw_init_cal()
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:10 -05:00
Sujith Manoharan
dfcca60b88 ath9k_hw: Fix MCI init for AGC calibration
When AGC calibration is to be done, a GPM message with the
payload, MCI_GPM_WLAN_CAL_REQ has to be sent. Currently this falls
within the IQ-CAL code block which is incorrect. Fix this by using
a separate variable to decide when IQ-CAL is to be done separately
and call ar9003_mci_init_cal_req correctly.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:10 -05:00
Sujith Manoharan
4656b8f680 ath9k_hw: Do not enable IQ-CAL for half/quarter rates
IQ calibration doesn't complete and times out for half/quarter
rates, so skip it correctly.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:10 -05:00
Rafał Miłecki
72a525cbb8 ssb: add place for serial flash driver
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09 14:37:09 -05:00