To support dynamic addition and removal of
me clients we add reference counter.
Update kdoc with locking requirements.
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
NFC internal structure cleaning was dropped by commit
commit 487056932d
Author: Tomas Winkler <[email protected]>
Date: Mon Feb 17 15:13:19 2014 +0200
mei: Remove all bus devices from the mei_dev list when stopping the MEI
When stopping the MEI, we should remove and potentially unregister
all bus devices queued on the mei_dev linked list.
We allocate nfc_dev and free it across the reset
so we do not keep it in dirty state
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Remove inclusion of linux/pci.h in mei layer
however we need to include the headers that before
got included implicitly from linux/pci.h.
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
For purpose of adding testing HW we would like
to get rid of pci dependency in generic mei code
This patch provides only straight forward changes
FW status and prob quirks need to be handled separately
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
fix style warning:
void function return statements are not generally useful
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
fix new style warning: Missing a blank line after declarations
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When handling dynamic clients there might be a race
scenario in which two me clients with the same me
address would be linked in the me clients list,
therefore we need to search by both uuid and me address.
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
For support of dynamic addition and removal of me clients
it is more convenient to use a list instead of static array
as is use now.
As the first step of the transition to the new data structure
we change the lookup function so it returns me client address
instead of an index.
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
1. Propagate ENOTTY to user space if the client is not present
in the system
2. Use ETIME consistently on timeouts
3. Return EIO on write failures
4. Return ENODEV on recoverable device failures such as resets
Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When stopping the MEI, we should remove and potentially unregister
all bus devices queued on the mei_dev linked list.
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
nfc_nfc_free unlink clients from the device list
and has to be called under mei mutex
Signed-off-by: Tomas Winkler <[email protected]>
Reviewed-by: Alexander Usyskin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Cancel each work properly and remove flash_work_queue.
Quoting documentation:
In most situations flushing the entire workqueue is overkill; you merely
need to know that a particular work item isn't queued and isn't running.
In such cases you should use cancel_delayed_work_sync() or
cancel_work_sync() instead.
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The flow may reach the err label without freeing cl and cl_info
cl and cl_info weren't assigned to ndev->cl and cl_info
so they weren't freed in mei_nfc_free called on error path
Cc: <[email protected]> # 3.10+
Cc: Samuel Ortiz <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The send ops for NFC builds the command header, updates the request id
and then waits for an ACK.
The recv ops check if it receives data or an ACK and in the latter case
wakes the send ops up.
The enable ops sends the NFC HECI connect command.
Signed-off-by: Samuel Ortiz <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
After building its bus name as a string based on its vendor id and radio
type, we can add it to the bus.
Signed-off-by: Samuel Ortiz <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
NFC ME device is exported through the MEI bus to be consumed by the
NFC subsystem.
NFC is represented by two mei clients: An info one and the actual
NFC one. In order to properly build the ME id we first need to retrieve
the firmware information from the info client and then disconnect from it.
Signed-off-by: Samuel Ortiz <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>