On Thu, 4 Sep 2025 13:10:58 +1000 Wilfred Mallawa <wilfred.opensou...@gmail.com> wrote:
> From: Wilfred Mallawa <wilfred.mall...@wdc.com> > > SPDM maybe used over different transports, such as PCIe Data Object > Exchange (DoE) or Storage amongst others. This patch Odd line wrap. I'd also drop the 'amongst others' as 'such as' already suggests there are others so t those extra words add no meaning. > specifies such types as an enum with a qdev property definition such that > a user input transport type (string) can be mapped directly into the > respective SPDM transport enum for internal use. > > Signed-off-by: Wilfred Mallawa <wilfred.mall...@wdc.com> Trivial comment below. > diff --git a/include/system/spdm-socket.h b/include/system/spdm-socket.h > index 6c2cb7b926..8fb5f7cf40 100644 > --- a/include/system/spdm-socket.h > +++ b/include/system/spdm-socket.h > @@ -110,12 +110,25 @@ typedef struct { > #define SPDM_SOCKET_COMMAND_UNKOWN 0xFFFF > #define SPDM_SOCKET_COMMAND_TEST 0xDEAD > > -#define SPDM_SOCKET_TRANSPORT_TYPE_MCTP 0x01 > -#define SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE 0x02 > -#define SPDM_SOCKET_TRANSPORT_TYPE_SCSI 0x03 > -#define SPDM_SOCKET_TRANSPORT_TYPE_NVME 0x04 > - > #define SPDM_SOCKET_MAX_MESSAGE_BUFFER_SIZE 0x1200 > #define SPDM_SOCKET_MAX_MSG_STATUS_LEN 0x02 > > +typedef enum SpdmTransportType { > + SPDM_SOCKET_TRANSPORT_TYPE_UNSPEC = 0, > + SPDM_SOCKET_TRANSPORT_TYPE_MCTP, > + SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE, > + SPDM_SOCKET_TRANSPORT_TYPE_SCSI, > + SPDM_SOCKET_TRANSPORT_TYPE_NVME, > + SPDM_SOCKET_TRANSPORT_TYPE_MAX, Given it will always be last element and I assume isn't a spec thing as such, but just a useful terminating entry, I'd drop that trailing comma. > +} SpdmTransportType; > + > +extern const PropertyInfo qdev_prop_spdm_trans; > + > +#define DEFINE_PROP_SPDM_TRANS(_name, _state, _field, _default) \ > + DEFINE_PROP_UNSIGNED(_name, _state, _field, _default, \ > + qdev_prop_spdm_trans, SpdmTransportType) > +#define DEFINE_PROP_SPDM_TRANS_NODEFAULT(_name, _state, _field) \ > + DEFINE_PROP_SPDM_TRANS(_name, _state, _field, \ > + SPDM_SOCKET_TRANSPORT_TYPE_UNSPEC) > + > #endif