NFC: Add MIUX to the local LLCP general bytes
authorSamuel Ortiz <sameo@linux.intel.com>
Tue, 10 Apr 2012 17:43:19 +0000 (19:43 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 12 Apr 2012 19:10:44 +0000 (15:10 -0400)
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/nfc/llcp/llcp.c

index 2cf01e642566f275c0df84472a24b9e5b7b7b22c..31a05e55619f2d9f379a77950bce1eeef724dfc3 100644 (file)
@@ -307,6 +307,8 @@ static int nfc_llcp_build_gb(struct nfc_llcp_local *local)
        u8 *gb_cur, *version_tlv, version, version_length;
        u8 *lto_tlv, lto, lto_length;
        u8 *wks_tlv, wks_length;
+       u8 *miux_tlv, miux_length;
+       __be16 miux;
        u8 gb_len = 0;
 
        version = LLCP_VERSION_11;
@@ -324,6 +326,11 @@ static int nfc_llcp_build_gb(struct nfc_llcp_local *local)
                                     &wks_length);
        gb_len += wks_length;
 
+       miux = cpu_to_be16(LLCP_MAX_MIUX);
+       miux_tlv = nfc_llcp_build_tlv(LLCP_TLV_MIUX, (u8 *)&miux, 0,
+                                     &miux_length);
+       gb_len += miux_length;
+
        gb_len += ARRAY_SIZE(llcp_magic);
 
        if (gb_len > NFC_MAX_GT_LEN) {
@@ -345,6 +352,9 @@ static int nfc_llcp_build_gb(struct nfc_llcp_local *local)
        memcpy(gb_cur, wks_tlv, wks_length);
        gb_cur += wks_length;
 
+       memcpy(gb_cur, miux_tlv, miux_length);
+       gb_cur += miux_length;
+
        kfree(version_tlv);
        kfree(lto_tlv);