From patchwork Sat Feb 10 22:22:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vibhav Pant X-Patchwork-Id: 20212 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1676378dyd; Sat, 10 Feb 2024 14:22:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXn9hyAFA6bfqZQ+WKcxOAXVn5JU221cTLMfbxDwfgeG35Mx2EUCIo5f+go0Svb1xX2lQjC5U0HQe7hP5tQPCRrmhg09g== X-Google-Smtp-Source: AGHT+IH+QLlU9Nc5LpeGk05yI6AOXvApv28jXabEBZcZ9ZKB2gUbBejUoXqNTO204o2jKWn/Bwsh X-Received: by 2002:a0c:cd03:0:b0:68c:cb3f:aa3b with SMTP id b3-20020a0ccd03000000b0068ccb3faa3bmr3947271qvm.32.1707603773284; Sat, 10 Feb 2024 14:22:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707603773; cv=pass; d=google.com; s=arc-20160816; b=nn8TBvS9Xrp1jl9ECoKRhUBDqRQLTk6T3faBiZvMFPEbgRuBeoFST3FPN+wo9b+sgw CtlsEB6lATG8vimLqUh+MOFiMi3ccQJMAWa+LHCeZFrVNBXWJSSY1kiMODhe3VSD+SgI 83N+4FfJBQEW3kP3NdoD00yDhrCYHSz7UxYPp/PUtWWSshH3B/IaPcaSuBwxcfGHqX2t mXXE+nlj2iqcWMMzq3DevmggkcdhO6ubsx6FgNKjamxZoxptAKIFavA1pqqPJB7p1d+R Bb+Vxp7ZQ10I6kBG3iUobo2KpKTJzlkE/AGPW+Cxu9Fa48bJVBYQTEi+5WoqKvnIhw67 wPDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=MarbRK7Kns5sgM2Go9562DLMjofwzOLRXaHhWg6F2Rk=; fh=E7gYmhCSPxrJHNz7JwP3wK1Jtg1vjrknkQ914rBAW78=; b=0Pdlo4VOhTEFOH7CX7EwtLSgY49RykU7vfSWmLlmV0NXK9TINWDolzYEDROTsAE15V YCfUJSbR+gsQ32qOwG7C29Xhtmy7UX62zl0glIlqg+LzAuDivWjtVQKZZdQN4muSvcfV +30ywNs6zIcbTL1lYbKwcA0FdBDpO/8HPXh3qVV0/OvSgLBm+7Mt5mzdmzIwO41Q3Qa9 dVuBV4ByeEBpuEf39/z0KC3KF7uI1cmuKyYYLelk1W75/TwSKzIYEkIDgsv6t/ipBRoy yof2U4PP6WoW0830n+prdnTc1ahIr+TXSQ6413w/erMIZyjmv0uIMFDNQkQNETnRIQaW 3qLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="LqUJDNV/"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-60570-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60570-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCUDvGrzw+B7omdYlX55kJE5QVzt1zLkx0eYoe9pEAe8mqon4VeJQt3mPWByXC6QWcSGe37g3V3+m6K3+tPO6COWKTDc7A== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iw14-20020a0562140f2e00b0068ccd97eaa0si5042910qvb.584.2024.02.10.14.22.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 14:22:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60570-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="LqUJDNV/"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-60570-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60570-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 16EC91C2168D for ; Sat, 10 Feb 2024 22:22:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F7215FF05; Sat, 10 Feb 2024 22:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LqUJDNV/" Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CD525D468; Sat, 10 Feb 2024 22:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707603757; cv=none; b=SbrgHSqkq2S8ueA9wf+56KMz7NvQV1jc5FDiaE6Uohc2pLR2zCdgRt7gpXNO4VfVEKR0wljM/PHuyk9fZvZNvMuJCsG3Bkzil0dpbE61O6aYvrA3v/cEk+IyfhwVRPk+Wu8rzGwRJieX1NwEzuvI4QLVs8OCVWdypEYa/WbP9OQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707603757; c=relaxed/simple; bh=yoOf1EJL98pLcGdr1ZyQ7ynGkZ/o1xuvDT4fSKSj/g8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kQhRJPeRY+SVkI3IjCUgOfoIYfmpvscLUt7spvRdK+nRQ5egCZlGg/kKQYXNgTAdOyKFUKBJnH3mQA5QK7O73vpFWJyLXKt5otKCHhvZ5i/UQH0bRGQ2Zb6ZiPgmE77305oQky8LtfIn4UXu0NENr830OADf6XHzSS1WltubYt0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LqUJDNV/; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-33b748b419eso255663f8f.2; Sat, 10 Feb 2024 14:22:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707603754; x=1708208554; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MarbRK7Kns5sgM2Go9562DLMjofwzOLRXaHhWg6F2Rk=; b=LqUJDNV/QuK/Mkc14tc9Io27uGg23yx4iDflPNvLxRDRWdVCPBTg1BhI7OWwztsiZM gYAZl+i/RD/r0dTtGnShJnAb1YeiUnD3qiAUT/CpS3m2bGdko35Hvzirmc/UypaSwLYt bYidn6rBOhYxWxvc2KH2+B8/NvxRGITCVutELO3kWD2Xo5gljSnEMktZD2PL9Teg3YR6 S+xz93qMntZw8rafjmgIxMLMAL+nUTmyov0Ma+ox2gRwcTqcifJwOuNDlejao9pTckC+ Abz7TGyVS0w8O7V3SwbJ4sqhWpT+j6VwrzpHjX+tzGIFtGFTfBhDMoFPf8BMnyWwCmUy 6MLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707603754; x=1708208554; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MarbRK7Kns5sgM2Go9562DLMjofwzOLRXaHhWg6F2Rk=; b=rlzuMYyecN+nFUe2G3gKk/yIcRp8iKgfkZFDdJUsnPx5TDuepXzVcBnxnXrxst80OC Q0L0g+T8obCC4NzYptDI+c/lSjeKGCYaagib1iDRztIOPuW2anc7TfyhR0Qy0B5QLyKi DTIqnBVqfc9FvpSWtcrB0WzVjBqbY77R3l5P+Fm6WjMnUUMYr5fRcU0I5Bc10EKZ7PDB GPpnGceiP92tN3FTQUnNN188YZ+2HbckpSUQGbLvSK3iEnCXs48RLuCBlDPbDwH8vp2D 17scnvaYP/FUxScqMbzDd/dqXD+6nzzxBNcXneqxD8vrW75ps5gtvji+lURw/Wet/mXC AXxA== X-Forwarded-Encrypted: i=1; AJvYcCVuo5lEU97YEtWbLN4dgWTcqwJLo16HbHWBKueT+zER3v2RsNq6tpqKsIBjoMbokNMTYc42MRpSdF8GY4okgddDDgM1u1931j6dOQom X-Gm-Message-State: AOJu0YwGYBZL/Oy6EGud+Gi7L9D3CYVG7EI0I8dVpFmRixIH/kddXMQR j+9/Gt4yg7N/lwPH5nGC9zknUayxo/WwaJdFJwZcNQRd2ezwG1qHoI8LcWRCnGM= X-Received: by 2002:a5d:5405:0:b0:33b:1575:bcd1 with SMTP id g5-20020a5d5405000000b0033b1575bcd1mr1986953wrv.5.1707603753446; Sat, 10 Feb 2024 14:22:33 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWORU51LQtllh2Fd+Qgg7oP+0F0gxhvperX/84tFxCSkFvuIKmVAsl5V/Kb82g+l3AjYBc/pwsoueHYmk8rrO+qdZQlSIZM3fBzGzXieJY+8dWEkp5tQ8tRmH0lu/k/EfV44/OrAQjpQipEnCcwkqqjyZnWWM+LJMc= Received: from vibhavp-mega.lan ([2401:4900:1c0a:39ad:8621:c30e:70c4:e9ea]) by smtp.gmail.com with ESMTPSA id l21-20020adfa395000000b0033b3ceda5dbsm2827164wrb.44.2024.02.10.14.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 14:22:32 -0800 (PST) From: Vibhav Pant To: linux-bluetooth@vger.kernel.org Cc: marcel@holtmann.org, johan.hedberg@gmail.com, linux-kernel@vger.kernel.org, Vibhav Pant Subject: [PATCH 0/1] Bluetooth: mgmt: Add command for getting device IO capabilities. Date: Sun, 11 Feb 2024 03:52:25 +0530 Message-ID: <20240210222226.890031-1-vibhavp@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790552334171515374 X-GMAIL-MSGID: 1790552334171515374 The following patch adds a new command to the bluetooth management interface, GET_DEVICE_IO_CAPABILITY. The command allows userspace to get the IO capability, and the authentication methods supported by a connected device. The command is necessary in order to implement parts of the Win32 Bluetooth API in the Wine, specifically the following two structs: * BLUETOOTH_AUTHENTICATION_CALLBACK_PARAMS, which provides IO and auth capabilities info for an incoming authentication request from a device. * BTH_DEVICE_INFO, which contains flags indicating whether the device supports Simple Secure Pairing and MITM protection. The former is supported through BlueZ's "LegacyPairing" property. Because the Wine API are implemented on top of BlueZ, I'll also be providing a corresponding patch that uses the newly added management command to expose the capabilities through new properties in the org.bluez.Device1 interface. Thanks, Vibhav Vibhav Pant (1): Bluetooth: mgmt: Add command for getting device IO capabilities. include/net/bluetooth/mgmt.h | 19 ++++++++ net/bluetooth/mgmt.c | 89 ++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+)