[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/3] slirp/ncsi: add a "Get Parameters" respo
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/3] slirp/ncsi: add a "Get Parameters" response |
Date: |
Wed, 30 May 2018 12:23:31 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 05/30/2018 03:10 AM, Cédric Le Goater wrote:
> Command 0x17 'Get Parameters' is used to get configuration parameter
> values currently in effect on the controller and it is mandatory in
> the NS-CI specification.
>
> Provide a minimum response to exercise the kernel.
>
> Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>
> Changes since v1:
>
> - removed bogus MAC addr and initialized VLAN filters to zero.
>
> slirp/ncsi.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/slirp/ncsi.c b/slirp/ncsi.c
> index 02d0e9def3e8..7b3fff207ab3 100644
> --- a/slirp/ncsi.c
> +++ b/slirp/ncsi.c
> @@ -35,6 +35,20 @@ static int ncsi_rsp_handler_gls(struct ncsi_rsp_pkt_hdr
> *rnh)
> return 0;
> }
>
> +/* Get Parameters */
> +static int ncsi_rsp_handler_gp(struct ncsi_rsp_pkt_hdr *rnh)
> +{
> + struct ncsi_rsp_gp_pkt *rsp = (struct ncsi_rsp_gp_pkt *) rnh;
> +
> + /* no MAC address filters or VLAN filters on the channel */
> + rsp->mac_cnt = 0;
> + rsp->mac_enable = 0;
> + rsp->vlan_cnt = 0;
> + rsp->vlan_enable = 0;
> +
> + return 0;
> +}
> +
> static const struct ncsi_rsp_handler {
> unsigned char type;
> int payload;
> @@ -62,7 +76,7 @@ static const struct ncsi_rsp_handler {
> { NCSI_PKT_RSP_SNFC, 4, NULL },
> { NCSI_PKT_RSP_GVI, 40, NULL },
> { NCSI_PKT_RSP_GC, 32, ncsi_rsp_handler_gc },
> - { NCSI_PKT_RSP_GP, -1, NULL },
> + { NCSI_PKT_RSP_GP, 40, ncsi_rsp_handler_gp },
> { NCSI_PKT_RSP_GCPS, 172, NULL },
> { NCSI_PKT_RSP_GNS, 172, NULL },
> { NCSI_PKT_RSP_GNPTS, 172, NULL },
>