[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v12 03/10] hw/misc: Add qtest for NPCM7xx PCI Mailbox
From: |
Peter Maydell |
Subject: |
Re: [PATCH v12 03/10] hw/misc: Add qtest for NPCM7xx PCI Mailbox |
Date: |
Sat, 13 Jan 2024 12:27:33 +0000 |
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
- [PATCH v12 00/10] Implementation of NPI Mailbox and GMAC Networking Module, Nabih Estefan, 2024/01/10
- [PATCH v12 02/10] hw/arm: Add PCI mailbox module to Nuvoton SoC, Nabih Estefan, 2024/01/10
- [PATCH v12 03/10] hw/misc: Add qtest for NPCM7xx PCI Mailbox, Nabih Estefan, 2024/01/10
- Re: [PATCH v12 03/10] hw/misc: Add qtest for NPCM7xx PCI Mailbox,
Peter Maydell <=
- [PATCH v12 01/10] hw/misc: Add Nuvoton's PCI Mailbox Module, Nabih Estefan, 2024/01/10
- [PATCH v12 04/10] hw/net: Add NPCMXXX GMAC device, Nabih Estefan, 2024/01/10
- [PATCH v12 05/10] hw/arm: Add GMAC devices to NPCM7XX SoC, Nabih Estefan, 2024/01/10
- [PATCH v12 06/10] tests/qtest: Creating qtest for GMAC Module, Nabih Estefan, 2024/01/10
- [PATCH v12 07/10] include/hw/net: General GMAC Implementation, Nabih Estefan, 2024/01/10
- [PATCH v12 08/10] hw/net: GMAC Rx Implementation, Nabih Estefan, 2024/01/10
- [PATCH v12 10/10] tests/qtest: Adding PCS Module test to GMAC Qtest, Nabih Estefan, 2024/01/10