diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-06-22 02:04:53 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-09 16:42:16 -0400 |
commit | b8e7a06d9cd4c0e778b1d12cef1ef414e0fb6d7e (patch) | |
tree | 556ed1c0cbdc5946893b6ad88bb6896d5e07044a /net/nfc | |
parent | 12e5bdfefa45ecacd22c519875d06113f95a26af (diff) | |
download | linux-b8e7a06d9cd4c0e778b1d12cef1ef414e0fb6d7e.tar.gz linux-b8e7a06d9cd4c0e778b1d12cef1ef414e0fb6d7e.tar.bz2 linux-b8e7a06d9cd4c0e778b1d12cef1ef414e0fb6d7e.zip |
NFC: Build LLCP general bytes upon request
Drivers will need them before starting a poll or when being activated
as targets. Mostly WKS can have changed between device registration and
then so we need to re-build the whole array.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/llcp/llcp.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c index eee4b9286f8d..6812b1e4f025 100644 --- a/net/nfc/llcp/llcp.c +++ b/net/nfc/llcp/llcp.c @@ -310,21 +310,6 @@ void nfc_llcp_put_ssap(struct nfc_llcp_local *local, u8 ssap) mutex_unlock(&local->sdp_lock); } -u8 *nfc_llcp_general_bytes(struct nfc_dev *dev, size_t *general_bytes_len) -{ - struct nfc_llcp_local *local; - - local = nfc_llcp_find_local(dev); - if (local == NULL) { - *general_bytes_len = 0; - return NULL; - } - - *general_bytes_len = local->gb_len; - - return local->gb; -} - static int nfc_llcp_build_gb(struct nfc_llcp_local *local) { u8 *gb_cur, *version_tlv, version, version_length; @@ -386,6 +371,23 @@ static int nfc_llcp_build_gb(struct nfc_llcp_local *local) return 0; } +u8 *nfc_llcp_general_bytes(struct nfc_dev *dev, size_t *general_bytes_len) +{ + struct nfc_llcp_local *local; + + local = nfc_llcp_find_local(dev); + if (local == NULL) { + *general_bytes_len = 0; + return NULL; + } + + nfc_llcp_build_gb(local); + + *general_bytes_len = local->gb_len; + + return local->gb; +} + int nfc_llcp_set_remote_gb(struct nfc_dev *dev, u8 *gb, u8 gb_len) { struct nfc_llcp_local *local = nfc_llcp_find_local(dev); |