linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Tedd Ho-Jeong An <hj.tedd.an@gmail.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [RFC BlueZ PATCH v4 1/3] emulator/btdev: Update the white list and resolving list size
Date: Thu, 1 Jul 2021 14:43:57 -0700	[thread overview]
Message-ID: <CABBYNZ+c+ic8gBRd6-wTK7z8yXsmJnf2X49OBkRNO97_1_4kFQ@mail.gmail.com> (raw)
In-Reply-To: <20210626063010.152987-1-hj.tedd.an@gmail.com>

Hi Tedd,

On Fri, Jun 25, 2021 at 11:31 PM Tedd Ho-Jeong An <hj.tedd.an@gmail.com> wrote:
>
> From: Tedd Ho-Jeong An <tedd.an@intel.com>
>
> 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

      parent reply	other threads:[~2021-07-01 21:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-26  6:30 [RFC BlueZ PATCH v4 1/3] emulator/btdev: Update the white list and resolving list size Tedd Ho-Jeong An
2021-06-26  6:30 ` [RFC BlueZ PATCH v4 2/3] emulator/btdev: clean up the queue before closing the test Tedd Ho-Jeong An
2021-07-01 21:28   ` Luiz Augusto von Dentz
2021-06-26  6:30 ` [RFC BlueZ PATCH v4 3/3] tools/mgmt-tester: Add LL Privacy test cases Tedd Ho-Jeong An
2021-06-26  7:08 ` [RFC,BlueZ,v4,1/3] emulator/btdev: Update the white list and resolving list size bluez.test.bot
2021-07-01 21:43 ` Luiz Augusto von Dentz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABBYNZ+c+ic8gBRd6-wTK7z8yXsmJnf2X49OBkRNO97_1_4kFQ@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=hj.tedd.an@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).