mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 14:30:58 +07:00
NFC: Clear LLCP SDPs whan MAC goes down
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
98b3ac1b98
commit
b9a76f1d3c
@ -97,6 +97,17 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local)
|
||||
mutex_unlock(&local->socket_lock);
|
||||
}
|
||||
|
||||
static void nfc_llcp_clear_sdp(struct nfc_llcp_local *local)
|
||||
{
|
||||
mutex_lock(&local->sdp_lock);
|
||||
|
||||
local->local_wks = 0;
|
||||
local->local_sdp = 0;
|
||||
local->local_sap = 0;
|
||||
|
||||
mutex_unlock(&local->sdp_lock);
|
||||
}
|
||||
|
||||
static void nfc_llcp_timeout_work(struct work_struct *work)
|
||||
{
|
||||
struct nfc_llcp_local *local = container_of(work, struct nfc_llcp_local,
|
||||
@ -857,6 +868,8 @@ void nfc_llcp_mac_is_down(struct nfc_dev *dev)
|
||||
if (local == NULL)
|
||||
return;
|
||||
|
||||
nfc_llcp_clear_sdp(local);
|
||||
|
||||
/* Close and purge all existing sockets */
|
||||
nfc_llcp_socket_release(local);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user