From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.53 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796312063; b=dpz5FQ479XrkVQbfyFb/JdQBSbUGfjcnZsG9I+Hm5P3fW6dhAYlpKHixQ6fnZcU8ywuu qa/nw7YJAKXPppcFS4biFQnF7as8AJHtGpS1q1Of0H2Nv6W394I4MWpvyHBjilDXJ9Y16 01cIA+h6jXj0HkoDynsuCq6rL1xSotZ3IO18EnxxauJ4HtJOtIewqKbMhuT/ra3lgzkKl M98PRoxrgvTn8x0Xo/QSgq7kcM5DaZys3yUI3CRLkK9rOHWE3Hq6AlThCQ2ASNPMWH0AQ oLXpulVA0boz30vwSXSIvBa7x3CebBjcAnlwQWaJctVUf70NpJAnrwZjnDiZZMo/5XA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796312063; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=wCvfnXyYPzCH/KGEq3CVoeDuU/HetBHpyZ4OaBwLrjI=; b=Dp9KQ11M+VkU7LNbz0olywcSjoyAmYuAbapYwqRRy7VJzTtrtppUlbwwRoviVCS4RmRe TToDEqem12M058zFHDvu6Ske84cfxhDrfbjLFiPEvebJ+o+V6tAK9qEaQ5YCJq8oU70VL emXdtXD4KwuxxDgBqvw9V+5Ej153VdpdrN8RWRjDy2Mzmg2gBL1BUI1GmcTej99sMAWG3 tOtADu5DgkcIXYQcTPT2LzlO05azbiHftz2DFYW5QAZl7C8VM9H/oz3uTEP6wlS5vUTak 9eGEprq2KNQw9QgkhANVnnlFq16KsTzPwjM21aJi2peyUwZ2xvdzLnLvwQ8ccxoR9TA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=googlemail.com; spf=pass smtp.mailfrom=googlemail.com; dkim=pass header.d=googlemail.com header.i=@googlemail.com header.a=rsa-sha256 header.s=20260707 header.b=gMMprRzA; arc=none smtp.remote-ip=209.85.221.53 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22D56606A322 for ; Thu, 3 Dec 2026 15:34:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 22D56606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=googlemail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.a=rsa-sha256 header.s=20260707 header.b=gMMprRzA Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-491f34b4e0fso6466573f8f.2 for ; Thu, 03 Dec 2026 07:34:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20260707; t=1796312061; x=1796916861; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wCvfnXyYPzCH/KGEq3CVoeDuU/HetBHpyZ4OaBwLrjI=; b=gMMprRzAcQ1JG64lG8zNDRhKJA7gYKlTd1xv1uXo047VqTC/AiqSiuIai5859rz/uN FPSmDOb0eBntbGyCP7ftQWcVNr2oEOmBWh17PE20TlVMBBMb4WnL1bSqY/T+YeOYhmwU RflqdlM7NvHafTEZtOq91wdczJWQ3DKLUnL/KHCdvRVuaUNiSEUBE/44VIECZv35f2lE +WpH/85c4JplsGDGoQtLRt/Z2AsoPSXjhmvv0r7e/DWrgk7IzDUNaXMve+32UZPbeZJS AjI4wtLHS95s1xAM7vpmO7tQhWxZVaOY/OBka0wcead+tiiaj/q0m1eNS3GueKYNt4aG PZfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796312061; x=1796916861; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=wCvfnXyYPzCH/KGEq3CVoeDuU/HetBHpyZ4OaBwLrjI=; b=WRm3bsn1Aqyje5b1AQeF4b3mdrIAPlOIMU3/2tWkoBwCEWX5bI70QOBjl5sQjCnHSt /z64ez9C1yOTq30q/SAydg9juzZET/GpPjv35ILAOtIyYEQGoJ1p9Sf00cc3dqEH4y/D lYv62zh+xyZSU7MJ36EhJ21jtCvRkqxQdqfBnoFT7at7Mq8KQvuqOM2o2TcpZjvLYv7d fhHl6pWExc1D7ZV95ziBCCVGcX95f0Hx4KVFT0VQ8/3hVFNGeY98ukUUcEHTbQ2/ltap bjq5O1uhVBWK8sCtu28jO9ZkR+cHPRm/pqW0j3OKlf2qg6eNR393Jp+JNfNnFd8RsoR6 OAyw== X-Gm-Message-State: APuU4Z8ngWxZNQwtzXFfTZoScmO0o6qNSojeKe4iSFom09phsdRmNWao 6s6z5j2tb+64JyIk2EnGIUz48TCdM9X3nmcgPEtEfmo5xcamncchnmUjvB6FLWoW X-Gm-Gg: AZFdTZc07TD211fPig1nqGo6hZzuHHfRpOW/VosqqFh/rBL89z2AHrOdayMzSImHNNZ 8mT4NaioSpvd2FA8rt9uDvnTFiMF4gXMRDreBIuQHxcvVLhRKrvZ/TCRnEm0+pREAsffs+8ZoGJ RKdeTK5uAafqABlBge7zw08wfc367JSUUH6lucjDllMPQ7YTPDdF3CPtn4k9aOqr6da+M1VquQ4 UT5Adja6bcba03pcjhpwKs15mAC4mcLlhpgvrZYrf29W3dEzFsY6/D+NfRGlnjBIPFSEI1lXyGK MPXSOb3tJC09+s7RWktHSPYm626iyKJ0+rwnU3Fv3ADH6cGajgtBhv8nSfl7jFhThUFvzDuayLM HR6bxNtoiF2shkU5OnpbGvU1sqnP0vyZCbYGmMPVUV3c88PqxppMpohbQ2pU308HMoPBIrwJl9y TpcaVpiYXXQ1A4dZ+f581v3CHK4riG2Xf/u0cU3hSOJVhtGhNJuus8UEyS2ZJIU7QMCWTJNVgKM uPJMckIMJ2PdfSZBgsyWnQunOIeic3Htnz5orEzIjReksS18haeGrbfNw+SPGsHpZhUHmFJSPT6 FUcRSi5cmR/rf2HUYW/1RT0eh1sg+HcBlUWnG3oFZ88uiOYQ+7NoByI++A== X-Received: by 2002:a05:6000:18a7:b0:4a6:5c06:2865 with SMTP id ffacd0b85a97d-4abb130f5cemr84774624f8f.30.1796312061321; Thu, 03 Dec 2026 07:34:21 -0800 (PST) Received: from sp8 (213-146-237-228.ptr.skytron.de. [213.146.237.228]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab65cb42absm83352896f8f.1.2026.12.03.07.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 07:34:20 -0800 (PST) From: Sebastian To: linux-bluetooth@vger.kernel.org Cc: Sebastian Subject: [PATCH v3 0/6] Accept HoG Report Map longer than 512 octets Date: Thu, 3 Dec 2026 16:34:02 +0100 Message-ID: <20261203153408.31769-1-seb.witt@googlemail.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: References: X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since 5.88, HID over GATT devices with a Report Map longer than 512 octets no longer work: the Report Map is truncated, the kernel fails to parse it and no input device is created. Several keyboards and touchpads are affected, see https://github.com/bluez/bluez/issues/2814. Mine, an Inateck KB05113, sends 637 octets. As discussed, accepting them is now controlled by a LongReportMap option in a new [Input] section of main.conf, enabled by default and disabled when Testing is, so the limit is enforced for qualification. shared/hog itself keeps reading at most 512 octets unless told otherwise with bt_hog_set_long_report_map. The default depends on Testing as set from main.conf or with -T, also when there is no main.conf. I took [Input] to mean a new section of main.conf, like [AVRCP], rather than one in input.conf; I can move it there if you prefer. This series was developed with the help of Claude, an AI assistant. v2: - Add the LongReportMap option to [Input] in main.conf - Keep the 512 octet limit by default in shared/hog, add bt_hog_set_long_report_map - Rebase on master v3: - Refuse long reads starting beyond the maximum length, as the length appended would otherwise underflow - Apply the default depending on Testing without main.conf too - Add tests for long reads in unit/test-gatt and for long Report Maps in unit/test-hog - Use static const char * const for input_options - Use Closes: for the GitHub issue - Drop non-standard trailers flagged by checkpatch Sebastian (6): shared/gatt-client: Add bt_gatt_client_read_long_value_max_len main.conf: Add LongReportMap option to [Input] shared/hog: Add bt_hog_set_long_report_map input/hog: Accept Report Map longer than 512 octets unit/test-gatt: Add tests for long reads beyond 512 octets unit/test-hog: Add tests for long Report Map profiles/input/hog.c | 8 +++- src/btd.h | 5 +++ src/main.c | 26 ++++++++++- src/main.conf | 7 +++ src/shared/gatt-client.c | 46 +++++++++++++++++-- src/shared/gatt-client.h | 7 +++ src/shared/hog.c | 43 ++++++++++++++++-- src/shared/hog.h | 5 +++ unit/test-gatt.c | 96 ++++++++++++++++++++++++++++++++++++++++ unit/test-hog.c | 79 ++++++++++++++++++++++++++++++++- 10 files changed, 310 insertions(+), 12 deletions(-) -- 2.56.1