summaryrefslogtreecommitdiffstats
path: root/net/nfc/llcp_core.c
diff options
context:
space:
mode:
authorSamuel Ortiz2013-06-03 12:10:04 +0200
committerSamuel Ortiz2013-06-14 13:45:10 +0200
commit4ca546e5545b7345b69e9331ecd53a1e4c6f7fe1 (patch)
tree49c01f7c212d7a764887f3dd2c69ed5376ffcd46 /net/nfc/llcp_core.c
parentNFC: llcp: Set the LLC Link Management well known service bit (diff)
downloadkernel-qcow2-linux-4ca546e5545b7345b69e9331ecd53a1e4c6f7fe1.tar.gz
kernel-qcow2-linux-4ca546e5545b7345b69e9331ecd53a1e4c6f7fe1.tar.xz
kernel-qcow2-linux-4ca546e5545b7345b69e9331ecd53a1e4c6f7fe1.zip
NFC: llcp: Fix the well known services endianness
The WKS (Well Known Services) bitmask should be transmitted in big endian order. Picky implementations will refuse to establish an LLCP link when the WKS bit 0 is not set to 1. The vast majority of implementations out there are not that picky though... Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/llcp_core.c')
-rw-r--r--net/nfc/llcp_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/nfc/llcp_core.c b/net/nfc/llcp_core.c
index d45bcbbc9f78..81cd3416c7d4 100644
--- a/net/nfc/llcp_core.c
+++ b/net/nfc/llcp_core.c
@@ -537,6 +537,7 @@ static int nfc_llcp_build_gb(struct nfc_llcp_local *local)
u8 *lto_tlv, lto_length;
u8 *wks_tlv, wks_length;
u8 *miux_tlv, miux_length;
+ __be16 wks = cpu_to_be16(local->local_wks);
u8 gb_len = 0;
int ret = 0;
@@ -549,8 +550,7 @@ static int nfc_llcp_build_gb(struct nfc_llcp_local *local)
gb_len += lto_length;
pr_debug("Local wks 0x%lx\n", local->local_wks);
- wks_tlv = nfc_llcp_build_tlv(LLCP_TLV_WKS, (u8 *)&local->local_wks, 2,
- &wks_length);
+ wks_tlv = nfc_llcp_build_tlv(LLCP_TLV_WKS, (u8 *)&wks, 2, &wks_length);
gb_len += wks_length;
miux_tlv = nfc_llcp_build_tlv(LLCP_TLV_MIUX, (u8 *)&local->miux, 0,