aboutsummaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp/llcp.h
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-06-25 15:46:28 +0200
committerJohn W. Linville <linville@tuxdriver.com>2012-07-09 16:42:19 -0400
commit8f50020ed9b81ba909ce9573f9d05263cdebf502 (patch)
tree19bd36d2e294dd5af9bbf6d885d5d994473a63b0 /net/nfc/llcp/llcp.h
parentNFC: Forbid SSAP binding to a not well known LLCP service (diff)
downloadlinux-dev-8f50020ed9b81ba909ce9573f9d05263cdebf502.tar.xz
linux-dev-8f50020ed9b81ba909ce9573f9d05263cdebf502.zip
NFC: LLCP late binding
With the LLCP 16 local SAPs we can potentially quickly run out of source SAPs for non well known services. With the so called late binding we will reserve an SAP only when we actually get a client connection for a local service. The SAP will be released once the last client is gone, leaving it available to other services. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to '')
-rw-r--r--net/nfc/llcp/llcp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/nfc/llcp/llcp.h b/net/nfc/llcp/llcp.h
index 374cc4779af4..83b8bba5a280 100644
--- a/net/nfc/llcp/llcp.h
+++ b/net/nfc/llcp/llcp.h
@@ -37,6 +37,7 @@ enum llcp_state {
#define LLCP_LOCAL_NUM_SAP 32
#define LLCP_LOCAL_SAP_OFFSET (LLCP_WKS_NUM_SAP + LLCP_SDP_NUM_SAP)
#define LLCP_MAX_SAP (LLCP_WKS_NUM_SAP + LLCP_SDP_NUM_SAP + LLCP_LOCAL_NUM_SAP)
+#define LLCP_SDP_UNBOUND (LLCP_MAX_SAP + 1)
struct nfc_llcp_sock;
@@ -69,6 +70,7 @@ struct nfc_llcp_local {
unsigned long local_wks; /* Well known services */
unsigned long local_sdp; /* Local services */
unsigned long local_sap; /* Local SAPs, not available for discovery */
+ atomic_t local_sdp_cnt[LLCP_SDP_NUM_SAP];
/* local */
u8 gb[NFC_MAX_GT_LEN];