Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3970799pxj; Tue, 15 Jun 2021 12:31:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwow6CN68v4qGUiiXt8/KPwANLqTEvhsZcSh/tWCS7r0WBdeWdNJRlw2MoCVogmDnQENLS4 X-Received: by 2002:a02:9f05:: with SMTP id z5mr700318jal.63.1623785501025; Tue, 15 Jun 2021 12:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623785501; cv=none; d=google.com; s=arc-20160816; b=waOks2IVslVhqcdm8lDb1KvBzdWCB6WNAow0G9oBb3Ch7i09kxqUygW1RfYmDU16W9 ahRjkJxZMAbtxdXQNuDZ57L7RvfBE4Eoa+duWSRidsSVwQV7xBursy1wrEuXyo5MwJ3l jimtjU4sMpfA0PjFPdzFcsKpCBbGNNwnlAe6Cz1mYF0B/kiAUeSgjyGo2OfdAJmZLQV/ JAxylCWR5Vopk9INS9IiTTtVc0GhoXJ79ma0aACyXWjr8kJWWPi6mD97y74Sw9d+XK6x QTh89UK7kxRotsLQrJ4URsynHcj5NjXQvP/3hX+lDIgv0F4W5tUAb+w+/KU+HL2xLJEB 8xcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=GN1pbUfQd8Eh24sxWfvqaQUWvLSO0gMwqa1MI7/1idg=; b=R8oUUtyLV1lLwxTfWXie2/hQu1PE7iAaOkBrRxcuaEya/vpE4SbdfQeZ8C1SV4vo1W al7JG2Fr95BUyp3syZMknsWdKIjQ+JFC4gH/XfW0I9srRN0X+Vc6vHMqL/Kh8TfTb3r+ ieDGSR8rPaYH/0RMf5dDpp+5cy07k8u6Fcg4AiZPzApJn/1iAQGlJIWiBSkZriuQTUsO Xsm7zX/yN9kdnBfVXPmejUGD62pyeeqkEkVkKejoabRuxh7yNmbIaYUf43vPF8jZ+XOT ewwsGGrnwkHLVAYEjdzRBHQGB5V1UBypGCBwzrm2X2WYe9P7i3gQ74b9ZwoLHv/NYBN2 zpWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cjIGKSUD; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r5si7861299ilq.87.2021.06.15.12.31.27; Tue, 15 Jun 2021 12:31:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cjIGKSUD; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbhFOTcO (ORCPT + 99 others); Tue, 15 Jun 2021 15:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbhFOTcN (ORCPT ); Tue, 15 Jun 2021 15:32:13 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A1F6C061574 for ; Tue, 15 Jun 2021 12:30:09 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id 11so8986591plk.12 for ; Tue, 15 Jun 2021 12:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=GN1pbUfQd8Eh24sxWfvqaQUWvLSO0gMwqa1MI7/1idg=; b=cjIGKSUD/1fZqDuCXSMAKRU0N+TK9th9TOjzmYhDtyEpqdwLEsGVM6XrDt3LaBLTPr ZFQ8Nfv3TCHWAZpl4fS3KqMAIuys+p/0BwZCU7rt+6aWGj4QYZ/JDLsnCHNWY0baprr8 GCDi+wRkASSIuryGylLUDBq70jj6Ej4cFK5R3BPe0gcJV7Q3s/KjvDP476NpWWoDVMCp v9+rPC/YTimoMACKq/UNNDMccir/+1tFhhlgwvXtpFYVVPAqXJBREcd/uKHtl6E3DeYL wCWoTgbgV6mY1fw4nGMehbNKHymHFFvoHFxYVUu5vEioYxQ4XxQJYUpikg5GKbsgFfnM GQyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=GN1pbUfQd8Eh24sxWfvqaQUWvLSO0gMwqa1MI7/1idg=; b=cwJ29eF8kSxm8MSpJI1Vrx6Uw+/3VcODwM9APa5KH21YHI62O0N6DCd7gKMvH33WDd dt4QVef7VXl7JFAGkdGagwsqz1Pl0ub8tyVtSBRUbxbUGF9bdV6tGbhludFw3HC9ATFu DY7h9Kgep5XlgVXxSAKV7sZiSbp0d2c1e8a4B5w+SIKKIhaIWj5sDLhtZfiHWbgJF8Lv BOOB8g/wS5QWI1rXiyXfQzgH066fXkmr2WcGG6ilyJGmMLLr/XoPr07/JsaNet4rdgHh 9XwNf7vri1eYyNkyEsM1ROfDF18vKZF2qmkxOQakBtIAJWkeN/QmRzA4mTN/2DiT4BSt yBhg== X-Gm-Message-State: AOAM531/752i4wIoKvtMu22b8/2l4oHX1DMKfA4rYspXoe9oNoS4rhFD NfmK7/8ypUFvF3zJ/H0KiRtCy19Bgmc= X-Received: by 2002:a17:902:9a01:b029:11a:d4e:8f4 with SMTP id v1-20020a1709029a01b029011a0d4e08f4mr5337347plp.52.1623785408360; Tue, 15 Jun 2021 12:30:08 -0700 (PDT) Received: from han1-mobl3.hsd1.or.comcast.net ([2601:1c0:6a01:d830::512a]) by smtp.gmail.com with ESMTPSA id b129sm8613372pfg.19.2021.06.15.12.30.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 12:30:07 -0700 (PDT) From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Subject: [RFC BlueZ PATCH 1/2] emulator/btdev: Update the white list and resolving list size Date: Tue, 15 Jun 2021 12:30:06 -0700 Message-Id: <20210615193007.1854488-1-hj.tedd.an@gmail.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Tedd Ho-Jeong An This patch updates the white list and resolving list size to small number. Also, it update the size of white list and resolving list to 1 more than actual size when it is read via HCI read size commands. This is used to simulate the case when the list is out of space. Note that the read list size may not represent the current actual list size depends on the device vendor. --- emulator/btdev.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/emulator/btdev.c b/emulator/btdev.c index eba9f57f9..d8d6fbc8b 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -33,8 +33,8 @@ #include "monitor/bt.h" #include "btdev.h" -#define WL_SIZE 16 -#define RL_SIZE 16 +#define WL_SIZE 3 +#define RL_SIZE 3 #define CIS_SIZE 3 #define has_bredr(btdev) (!((btdev)->features[4] & 0x20)) @@ -3393,7 +3393,12 @@ static int cmd_read_wl_size(struct btdev *dev, const void *data, uint8_t len) struct bt_hci_rsp_le_read_white_list_size rsp; rsp.status = BT_HCI_ERR_SUCCESS; - rsp.size = WL_SIZE; + /* The size is not fixed and the actual list size can be different from + * the returned size here. + * In order to test such cases, return more than allocated size, and + * HCI Add device cmd will return the Memory Capacity Exceeded(0x07) + */ + rsp.size = WL_SIZE + 1; cmd_complete(dev, BT_HCI_CMD_LE_READ_WHITE_LIST_SIZE, &rsp, sizeof(rsp)); @@ -3678,7 +3683,12 @@ static int cmd_read_rl_size(struct btdev *dev, const void *data, uint8_t len) struct bt_hci_rsp_le_read_resolv_list_size rsp; rsp.status = BT_HCI_ERR_SUCCESS; - rsp.size = RL_SIZE; + /* The size is not fixed and the actual list size can be different from + * the returned size here. + * In order to test such cases, return more than allocated size, and + * HCI Add device cmd will return the Memory Capacity Exceeded(0x07) + */ + rsp.size = RL_SIZE + 1; cmd_complete(dev, BT_HCI_CMD_LE_READ_RESOLV_LIST_SIZE, &rsp, sizeof(rsp)); -- 2.26.3