From: Peter Maydell <peter.maydell@linaro.org>
To: Nabih Estefan <nabihestefan@google.com>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, kfting@nuvoton.com,
wuhaotsh@google.com, jasowang@redhat.com,
avi.fishman@nuvoton.com, kwliu@nuvoton.com,
tomer.maimon@nuvoton.com, Hila.Miranda-Kuzi@nuvoton.com
Subject: Re: [PATCH v12 03/10] hw/misc: Add qtest for NPCM7xx PCI Mailbox
Date: Sat, 13 Jan 2024 12:27:33 +0000 [thread overview]
Message-ID: <CAFEAcA9RAYK+GMQP5b18+Yfx5QXViZYmLW301+XrPfT4m++-7A@mail.gmail.com> (raw)
In-Reply-To: <20240110234232.4116804-4-nabihestefan@google.com>
On Wed, 10 Jan 2024 at 23:42, Nabih Estefan <nabihestefan@google.com> wrote:
>
> From: Hao Wu <wuhaotsh@google.com>
>
> This patches adds a qtest for NPCM7XX PCI Mailbox module.
> It sends read and write requests to the module, and verifies that
> the module contains the correct data after the requests.
>
> Change-Id: I2e1dbaecf8be9ec7eab55cb54f7fdeb0715b8275
> Signed-off-by: Hao Wu <wuhaotsh@google.com>
> Signed-off-by: Nabih Estefan <nabihestefan@google.com>
> Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
> +/*
> + * Create a local TCP socket with any port, then save off the port we got.
> + */
> +static in_port_t open_socket(void)
This needs to be 'int', to avoid a compilation failure under
Windows, which doesn't define the in_port_t type.
> +{
> + struct sockaddr_in myaddr;
> + socklen_t addrlen;
> +
> + myaddr.sin_family = AF_INET;
> + myaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
> + myaddr.sin_port = 0;
> + sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
> + g_assert(sock != -1);
> + g_assert(bind(sock, (struct sockaddr *) &myaddr, sizeof(myaddr)) != -1);
> + addrlen = sizeof(myaddr);
> + g_assert(getsockname(sock, (struct sockaddr *) &myaddr , &addrlen) != -1);
> + g_assert(listen(sock, 1) != -1);
> + return ntohs(myaddr.sin_port);
> +}
thanks
-- PMM
next prev parent reply other threads:[~2024-01-13 12:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 23:42 [PATCH v12 00/10] Implementation of NPI Mailbox and GMAC Networking Module Nabih Estefan
2024-01-10 23:42 ` [PATCH v12 01/10] hw/misc: Add Nuvoton's PCI Mailbox Module Nabih Estefan
2024-01-13 12:27 ` Peter Maydell
2024-01-10 23:42 ` [PATCH v12 02/10] hw/arm: Add PCI mailbox module to Nuvoton SoC Nabih Estefan
2024-01-10 23:42 ` [PATCH v12 03/10] hw/misc: Add qtest for NPCM7xx PCI Mailbox Nabih Estefan
2024-01-13 12:27 ` Peter Maydell [this message]
2024-01-10 23:42 ` [PATCH v12 04/10] hw/net: Add NPCMXXX GMAC device Nabih Estefan
2024-01-13 12:27 ` Peter Maydell
2024-01-10 23:42 ` [PATCH v12 05/10] hw/arm: Add GMAC devices to NPCM7XX SoC Nabih Estefan
2024-01-10 23:42 ` [PATCH v12 06/10] tests/qtest: Creating qtest for GMAC Module Nabih Estefan
2024-01-10 23:42 ` [PATCH v12 07/10] include/hw/net: General GMAC Implementation Nabih Estefan
2024-01-10 23:42 ` [PATCH v12 08/10] hw/net: GMAC Rx Implementation Nabih Estefan
2024-01-13 12:27 ` Peter Maydell
2024-01-10 23:42 ` [PATCH v12 09/10] hw/net: GMAC Tx Implementation Nabih Estefan
2024-01-10 23:42 ` [PATCH v12 10/10] tests/qtest: Adding PCS Module test to GMAC Qtest Nabih Estefan
2024-01-13 12:27 ` [PATCH v12 00/10] Implementation of NPI Mailbox and GMAC Networking Module Peter Maydell
2024-01-18 12:20 ` Peter Maydell
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=CAFEAcA9RAYK+GMQP5b18+Yfx5QXViZYmLW301+XrPfT4m++-7A@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=Hila.Miranda-Kuzi@nuvoton.com \
--cc=avi.fishman@nuvoton.com \
--cc=jasowang@redhat.com \
--cc=kfting@nuvoton.com \
--cc=kwliu@nuvoton.com \
--cc=nabihestefan@google.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=tomer.maimon@nuvoton.com \
--cc=wuhaotsh@google.com \
/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).