Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp887642imi; Fri, 22 Jul 2022 11:47:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vVC2oMPRRmXMGPnsxvffved2CcbPYahp94N3AWV4whMNmxv8u1GWyeB4x4UfLD87DNRXbk X-Received: by 2002:a05:6a00:1747:b0:52b:3208:40bd with SMTP id j7-20020a056a00174700b0052b320840bdmr1198466pfc.23.1658515645409; Fri, 22 Jul 2022 11:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658515645; cv=none; d=google.com; s=arc-20160816; b=M5jo3J3oNvDwaWWyomGDKkLc7FyWNc5G4bMKdLw1wyWEbgsIyPhLIzhjAdIeinp0IL MD5ZVPVSZJKw+h76ohQR/Itv6Nq960HQkBG/9on4QVhjB5li3hKZzPathf4YbmxxOU5z 9y1diC2AE4+AoaInylpRoLi1x/ANF6G6zzYCkq5ieQpVe8J3YWJSIR3eNNxw4qT2x4Q2 ZOtoqryXSc0IuT6RdLgZme4feVW1q7Qdsip/KHhm8qQWkaOkh5riQ3YG5ENMKCgkZu7O w5sqK+HmvqmxbSqilgWlsfOePo/qExa4DIXE3R/UtxSsaEZSOrU8iwKjT2X6lQvd9yLj AxgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=oBaauaBIZjrieTof2FGDg75mtCH/CB1KU2oTgxF56KE=; b=A75xP7l5fAM0Qe5kCWFDo+evhMIaB9FDWgDWAS0a8JZvbnufDaHKXIRZ1m1QsNCq/Z StNBxkPiPmVgziJIHORLK5snMvJQELfp7b0VBau7XMBPK37VY05Ifw3d8GJPT2Y6BlAk 2hUaIiW7cO8pHqGp5C4Iq6K6ZmcuObHcNkIpeOOf5aLUV0RwKDrP9FXb5BN7oZ4+2J6F zYPYLI0BQnjuakbhPuU45Uwku93AVwca3C1XuWIVk6VfIYPzUBCLlEwBuG/9U7EUEMvj XtGrjMsbCTMasyKm/A3hE28+EsZOf8YDFfYAwmEdXuqB6ty0hKq7MOQBQxUUdMosHvRr vdiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=n7ZISF7P; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 80-20020a621853000000b0052b41c0def7si6145018pfy.331.2022.07.22.11.47.11; Fri, 22 Jul 2022 11:47:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=n7ZISF7P; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236378AbiGVSpP (ORCPT + 99 others); Fri, 22 Jul 2022 14:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236415AbiGVSpG (ORCPT ); Fri, 22 Jul 2022 14:45:06 -0400 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3589D29A for ; Fri, 22 Jul 2022 11:45:05 -0700 (PDT) Received: by mail-pg1-x549.google.com with SMTP id f128-20020a636a86000000b0041a4b07b039so2665648pgc.5 for ; Fri, 22 Jul 2022 11:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=oBaauaBIZjrieTof2FGDg75mtCH/CB1KU2oTgxF56KE=; b=n7ZISF7P0c/oRx0sJ9WPdepLb4eJUQgpXQDXjgvo0KJX7kPA2r4EbdOFkQiIB4xYJA 48/3exbglFlVY+oXYsKQhXAjLm7FBbZ6HGC8+IcyekAk0G4e4zmzxDeEiJy/4ph3o29i tDgrMBmYM4RjvOU1sLPzKFktof2eMfBOhLK+dl96gSc03eucM06TF6ZbpQlzHr/9ejAY 8X24suFfsNBLHWN3bR5wjfKQtTVJMpRY8eS1+b/dV14p+lxfTcpJ5g4chbjao0aioYJB BqxUGP5yv8jwWiRFogKKlYEg32BDBVZ9Q9jW6R1No+fbmwZDfRNQdYfLyEOXuoFVvaYx dVgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=oBaauaBIZjrieTof2FGDg75mtCH/CB1KU2oTgxF56KE=; b=xVhuBplzRho9pnkR5MLeXrk6lhd97Odc2xgasmKN8//0R+AsJ9paK2aPV4ZV1ClIro F4JM5yKY8wGhQTQOncLMo90Lze95L7HAwR452eqeJj0iMITBJnQgAP9A8i3/pmGz32iu crmoa5QP31Eq3fXZX8XP6dvo2UhPvF1FLYlfOIkYZW321N8I+h8CYuFlIjEbmyHXpNGc 2SSVaYb8IV3K5dEZc51RCnYBQeZUZaDPK9yd4/Ez6V1w682oejzDAnlZhBE4NgRlqEh9 R2O0aSHHvzkZYmXxNAC1OrVnhmtVG2cAj61J8VCXaedwCHW8+hlbs42Lj4KR36YGnAGU tKzw== X-Gm-Message-State: AJIora+akpUJ/RpaiAspxOBTKAnM19ND9+AbjJmVhno/ye6jMxgliITi AVVdjjjpHjV8ZHA9OJAsYCkPqhJsZwYPZry1DcpgdgvE73nL5b7OAmsSacY/zGlZk7sK88GOWrd ATtgXtHGaYWRucAIS/riGiKTUZlgZmR/Wcc+N0FDTqvfwwaGxNmbaRZMfjZfuZ2EX8pk3oC992d +y X-Received: from jiangzp-glinux-dev.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:4c52]) (user=jiangzp job=sendgmr) by 2002:a17:903:230a:b0:16c:58a3:6395 with SMTP id d10-20020a170903230a00b0016c58a36395mr1135339plh.20.1658515504364; Fri, 22 Jul 2022 11:45:04 -0700 (PDT) Date: Fri, 22 Jul 2022 11:44:55 -0700 In-Reply-To: <20220722184455.3926696-1-jiangzp@google.com> Message-Id: <20220722114449.kernel.v1.1.Ifce963ae9c092b69c116736b57e5d3a40b776060@changeid> Mime-Version: 1.0 References: <20220722184455.3926696-1-jiangzp@google.com> X-Mailer: git-send-email 2.37.1.359.gd136c6c3e2-goog Subject: [kernel PATCH v1 1/1] Bluetooth: Return error if controller not support ll privacy From: Zhengping Jiang To: linux-bluetooth@vger.kernel.org, chromeos-bluetooth-upstreaming@chromium.org Cc: Zhengping Jiang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Johan Hedberg , Luiz Augusto von Dentz , Marcel Holtmann , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Return proper error message if the controller does not support ll privacy. Signed-off-by: Zhengping Jiang --- Changes in v1: - Return proper mgmt error if controller does not support ll privacy net/bluetooth/mgmt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index ef8371975c4eb..e5eb422d14464 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -4143,6 +4143,12 @@ static int set_rpa_resolution_func(struct sock *sk, struct hci_dev *hdev, MGMT_OP_SET_EXP_FEATURE, MGMT_STATUS_INVALID_INDEX); + /* Controller does not support LL privacy */ + if (!ll_privacy_capable(hdev)) + return mgmt_cmd_status(sk, hdev->id, + MGMT_OP_SET_EXP_FEATURE, + MGMT_STATUS_NOT_SUPPORTED); + /* Changes can only be made when controller is powered down */ if (hdev_is_powered(hdev)) return mgmt_cmd_status(sk, hdev->id, -- 2.37.1.359.gd136c6c3e2-goog