Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -2
+2 -2
net/nfc/llcp_core.c
··· 537 537 u8 *lto_tlv, lto_length; 538 538 u8 *wks_tlv, wks_length; 539 539 u8 *miux_tlv, miux_length; 540 + __be16 wks = cpu_to_be16(local->local_wks); 540 541 u8 gb_len = 0; 541 542 int ret = 0; 542 543 ··· 550 549 gb_len += lto_length; 551 550 552 551 pr_debug("Local wks 0x%lx\n", local->local_wks); 553 - wks_tlv = nfc_llcp_build_tlv(LLCP_TLV_WKS, (u8 *)&local->local_wks, 2, 554 - &wks_length); 552 + wks_tlv = nfc_llcp_build_tlv(LLCP_TLV_WKS, (u8 *)&wks, 2, &wks_length); 555 553 gb_len += wks_length; 556 554 557 555 miux_tlv = nfc_llcp_build_tlv(LLCP_TLV_MIUX, (u8 *)&local->miux, 0,