Re: [Qemu-devel] [RFC PATCH 29/34] net: add Hyper-V/VMBus network protocol definitions

2018-02-08 Thread Paolo Bonzini
On 07/02/2018 21:15, Roman Kagan wrote:
>> Hmm, these are a bit harder to unify with hw/usb/dev-network.c.  Still
>> not _that_ hard, just that the USB version has two fields for message
>> type/length at the beginning.
> This is my "fault".  At some point I got tired of this pattern so I
> factored out the header and the payload.  I'll reconsider with this
> unification in mind.

It's okay, we can also do it the other way round.

Paolo



Re: [Qemu-devel] [RFC PATCH 29/34] net: add Hyper-V/VMBus network protocol definitions

2018-02-07 Thread Roman Kagan
On Wed, Feb 07, 2018 at 01:00:14PM +0100, Paolo Bonzini wrote:
> On 06/02/2018 21:30, Roman Kagan wrote:
> > +/* NdisInitialize message */
> > +struct rndis_initialize_request {
> > +uint32_t req_id;
> > +uint32_t major_ver;
> > +uint32_t minor_ver;
> > +uint32_t max_xfer_size;
> > +};
> > +
> > +/* Response to NdisInitialize */
> > +struct rndis_initialize_complete {
> > +uint32_t req_id;
> > +uint32_t status;
> > +uint32_t major_ver;
> > +uint32_t minor_ver;
> > +uint32_t dev_flags;
> > +uint32_t medium;
> > +uint32_t max_pkt_per_msg;
> > +uint32_t max_xfer_size;
> > +uint32_t pkt_alignment_factor;
> > +uint32_t af_list_offset;
> > +uint32_t af_list_size;
> > +};
> > +
> > +/* Call manager devices only: Information about an address family */
> > +/* supported by the device is appended to the response to NdisInitialize. 
> > */
> > +struct rndis_co_address_family {
> > +uint32_t address_family;
> > +uint32_t major_ver;
> > +uint32_t minor_ver;
> > +};
> > +
> > +/* NdisHalt message */
> > +struct rndis_halt_request {
> > +uint32_t req_id;
> > +};
> > +
> > +/* NdisQueryRequest message */
> > +struct rndis_query_request {
> > +uint32_t req_id;
> > +uint32_t oid;
> > +uint32_t info_buflen;
> > +uint32_t info_buf_offset;
> > +uint32_t dev_vc_handle;
> > +};
> > +
> > +/* Response to NdisQueryRequest */
> > +struct rndis_query_complete {
> > +uint32_t req_id;
> > +uint32_t status;
> > +uint32_t info_buflen;
> > +uint32_t info_buf_offset;
> > +};
> > +
> > +/* NdisSetRequest message */
> > +struct rndis_set_request {
> > +uint32_t req_id;
> > +uint32_t oid;
> > +uint32_t info_buflen;
> > +uint32_t info_buf_offset;
> > +uint32_t dev_vc_handle;
> > +};
> > +
> > +/* Response to NdisSetRequest */
> > +struct rndis_set_complete {
> > +uint32_t req_id;
> > +uint32_t status;
> > +};
> > +
> > +/* NdisReset message */
> > +struct rndis_reset_request {
> > +uint32_t reserved;
> > +};
> > +
> > +/* Response to NdisReset */
> > +struct rndis_reset_complete {
> > +uint32_t status;
> > +uint32_t addressing_reset;
> > +};
> > +
> > +/* NdisMIndicateStatus message */
> > +struct rndis_indicate_status {
> > +uint32_t status;
> > +uint32_t status_buflen;
> > +uint32_t status_buf_offset;
> > +};
> > +
> > +/* Diagnostic information passed as the status buffer in */
> > +/* struct rndis_indicate_status messages signifying error conditions. */
> > +struct rndis_diagnostic_info {
> > +uint32_t diag_status;
> > +uint32_t error_offset;
> > +};
> > +
> > +/* NdisKeepAlive message */
> > +struct rndis_keepalive_request {
> > +uint32_t req_id;
> > +};
> > +
> > +/* Response to NdisKeepAlive */
> > +struct rndis_keepalive_complete {
> > +uint32_t req_id;
> > +uint32_t status;
> > +};
> > +
> 
> Hmm, these are a bit harder to unify with hw/usb/dev-network.c.  Still
> not _that_ hard, just that the USB version has two fields for message
> type/length at the beginning.

This is my "fault".  At some point I got tired of this pattern so I
factored out the header and the payload.  I'll reconsider with this
unification in mind.

Roman.



Re: [Qemu-devel] [RFC PATCH 29/34] net: add Hyper-V/VMBus network protocol definitions

2018-02-07 Thread Paolo Bonzini
On 06/02/2018 21:30, Roman Kagan wrote:
> +/* NdisInitialize message */
> +struct rndis_initialize_request {
> +uint32_t req_id;
> +uint32_t major_ver;
> +uint32_t minor_ver;
> +uint32_t max_xfer_size;
> +};
> +
> +/* Response to NdisInitialize */
> +struct rndis_initialize_complete {
> +uint32_t req_id;
> +uint32_t status;
> +uint32_t major_ver;
> +uint32_t minor_ver;
> +uint32_t dev_flags;
> +uint32_t medium;
> +uint32_t max_pkt_per_msg;
> +uint32_t max_xfer_size;
> +uint32_t pkt_alignment_factor;
> +uint32_t af_list_offset;
> +uint32_t af_list_size;
> +};
> +
> +/* Call manager devices only: Information about an address family */
> +/* supported by the device is appended to the response to NdisInitialize. */
> +struct rndis_co_address_family {
> +uint32_t address_family;
> +uint32_t major_ver;
> +uint32_t minor_ver;
> +};
> +
> +/* NdisHalt message */
> +struct rndis_halt_request {
> +uint32_t req_id;
> +};
> +
> +/* NdisQueryRequest message */
> +struct rndis_query_request {
> +uint32_t req_id;
> +uint32_t oid;
> +uint32_t info_buflen;
> +uint32_t info_buf_offset;
> +uint32_t dev_vc_handle;
> +};
> +
> +/* Response to NdisQueryRequest */
> +struct rndis_query_complete {
> +uint32_t req_id;
> +uint32_t status;
> +uint32_t info_buflen;
> +uint32_t info_buf_offset;
> +};
> +
> +/* NdisSetRequest message */
> +struct rndis_set_request {
> +uint32_t req_id;
> +uint32_t oid;
> +uint32_t info_buflen;
> +uint32_t info_buf_offset;
> +uint32_t dev_vc_handle;
> +};
> +
> +/* Response to NdisSetRequest */
> +struct rndis_set_complete {
> +uint32_t req_id;
> +uint32_t status;
> +};
> +
> +/* NdisReset message */
> +struct rndis_reset_request {
> +uint32_t reserved;
> +};
> +
> +/* Response to NdisReset */
> +struct rndis_reset_complete {
> +uint32_t status;
> +uint32_t addressing_reset;
> +};
> +
> +/* NdisMIndicateStatus message */
> +struct rndis_indicate_status {
> +uint32_t status;
> +uint32_t status_buflen;
> +uint32_t status_buf_offset;
> +};
> +
> +/* Diagnostic information passed as the status buffer in */
> +/* struct rndis_indicate_status messages signifying error conditions. */
> +struct rndis_diagnostic_info {
> +uint32_t diag_status;
> +uint32_t error_offset;
> +};
> +
> +/* NdisKeepAlive message */
> +struct rndis_keepalive_request {
> +uint32_t req_id;
> +};
> +
> +/* Response to NdisKeepAlive */
> +struct rndis_keepalive_complete {
> +uint32_t req_id;
> +uint32_t status;
> +};
> +

Hmm, these are a bit harder to unify with hw/usb/dev-network.c.  Still
not _that_ hard, just that the USB version has two fields for message
type/length at the beginning.  Probably worth it even if we keep two
versions of the core RNDIS code.

Paolo