Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1008255pxv; Thu, 1 Jul 2021 14:47:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3Z/zAbxVj55Zn9iHPL7AdF9Lx+dQYmR7EvcRjtFJwWjfLMaW1SpSmc/xY8TQrOXRaX2aG X-Received: by 2002:a05:6402:4308:: with SMTP id m8mr2476625edc.237.1625176037112; Thu, 01 Jul 2021 14:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625176037; cv=none; d=google.com; s=arc-20160816; b=sw1Sz/uMxHVQQChs3kDETMwXSMbh2vmxU+E43bSpN37iYLEfJdo1iX0LaeMllZofUZ Ku22jcMGwhv6A5FWz78uWGYFdewq68RVBQsoANsOtZyA7jb7KPtTnxG4cl7Kuv58vhEu jRUU67wOiGxbTqFTlNDXGjYy8hAR2YmK/fDprhCSIlBA8yQXrXE+MDoRAcZYlFE3J/7D Dl/MKSV/Qsy5qZVoS27iyBR0aM/qxbSP5M+o8yOtG7/Hws7sadgudl5Bsa0wFfqkcfjN DrNvQhI0kOaZXtl/NM3mjigGI1ZMcmRQbiYhFkPjigoQ32UVgzwFWh2jdJCf2oa8c/6G NARA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=urRC5WkmIZ5OA6xMcYQBYED0UF2XOszVMkXOm4qFtEY=; b=sDT7DAUYWmea+CUgBeiwTUukl0VO6b1nwqm8GcO5w8lb7FqEB2sCZpjhWQyDKB0SoG Ro59H7/A0e9eAVs0SimrEsyczzi0bAh1aZ2UuYUe7wgUpbsb8ab5yKngXZUm83fpycTX jEC8Db7BiB51AA9yNPlFUH1KHOc0nZD+zTPGe2aMB7rT16g8nvSRLHDsqeL0EI70hGHB jUNJwx9QtkSIi5LMVJbeCWaoGdsfN7Rv27pHaVkztoM1YxoViV/KsDk6kIM4WMfdA1Sy 7PHksoGEbctl9J1w5ojmztmET2KmXEE0hrNWDaTc0jVt81nT14ThH4oad7bxVXW+9Yno Mw9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jtoObubA; 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 gn42si1287981ejc.717.2021.07.01.14.46.54; Thu, 01 Jul 2021 14:47:17 -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=jtoObubA; 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 S233916AbhGAVql (ORCPT + 99 others); Thu, 1 Jul 2021 17:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbhGAVql (ORCPT ); Thu, 1 Jul 2021 17:46:41 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62FFFC061762 for ; Thu, 1 Jul 2021 14:44:09 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id g19so13159684ybe.11 for ; Thu, 01 Jul 2021 14:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=urRC5WkmIZ5OA6xMcYQBYED0UF2XOszVMkXOm4qFtEY=; b=jtoObubATZCPxJCkocbw6x02z89Bd2q1I/6UgYHYpF3/c3rNZZ50KBb4jKueWDm6PV hNebDCB8Jhy2O+7XtsK3iHUyJbJdLQv4uqxGeFKyofPMn0EMCW35w08tgYarxOmtih2D rjfhwxFvgP3qjNEZGJmihBU7DH7TuRxr0NMM7jk7KHAhhE6azN+/54kJvCAdsD/ca4Z5 80BjKnTRiPIyg6KkVVOaeyu2HaQle2PxyMeErAY0H6KiHzISlPOfhIWjyE7vc1zNvCeO FAgDrJnvv3M071OsBO6BqMg2LQdMqGOEAI+Lmhe8Z2EhLBGZtiWR8F6oj9fIBjE/0aKb OISg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=urRC5WkmIZ5OA6xMcYQBYED0UF2XOszVMkXOm4qFtEY=; b=mg8fxhLcKQ+pjeg074GvYxPVPNs4A49CjVvISXTTnvN9+BzcZ5N/MLQn/d1doiG2ke joQjqFjc8oMl3rAmSBQRtiQW3weNN663SUrNwdb7UkkZec/XZH/GXMQ3ubtO5o17kp3E TkNNUg21xN8DagZ4VEvzeGFbiVGW6i63XQFtWpkpsIP5L7vplNr0ErDN9WMrlu8vQ6Wp 032h9G9PAaC3+6XgZrMN5rATSGCQTmPJ3UpKMJamwujYs3myUmnZ2SkmC/kP3lP+gY9n duqRo9NAvH0m2cs+HG5mMF5VMFQE6TlSvgWRf2wC/bDXxBJpP2AfMeaTvyu9ZBsqRXHs piqw== X-Gm-Message-State: AOAM531D9vjCLpxmklANjIa8qb3OiwJvUVxUOdbHf3m4PEUckNOL1NRp l68x/6xw4zMP+KLpgRSRWeFNUQ9EcQt6ApkhJNU= X-Received: by 2002:a25:be02:: with SMTP id h2mr2694958ybk.91.1625175848584; Thu, 01 Jul 2021 14:44:08 -0700 (PDT) MIME-Version: 1.0 References: <20210626063010.152987-1-hj.tedd.an@gmail.com> In-Reply-To: <20210626063010.152987-1-hj.tedd.an@gmail.com> From: Luiz Augusto von Dentz Date: Thu, 1 Jul 2021 14:43:57 -0700 Message-ID: Subject: Re: [RFC BlueZ PATCH v4 1/3] emulator/btdev: Update the white list and resolving list size To: Tedd Ho-Jeong An Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Tedd, On Fri, Jun 25, 2021 at 11:31 PM Tedd Ho-Jeong An wrote: > > 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 90457a5aa..202fc7996 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)) > @@ -3402,7 +3402,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)); > > @@ -3687,7 +3692,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 This one I think we need to rework somehow, the idea is that we have this lists set dynamically in order to test the HCI error so Id have some function limit the amount of instances that can be used instead of reporting a wrong number like this. -- Luiz Augusto von Dentz