[PATCH phosphor-host-ipmid] IPMI support for get and set lan

Patrick Williams patrick at stwcx.xyz
Sat Oct 31 06:27:34 AEDT 2015


On Thu, Oct 29, 2015 at 10:15:33PM -0500, OpenBMC Patches wrote:
> From: Adriana Kobylak <anoo at us.ibm.com>
> +struct get_lan_t {
> +    uint8_t rev_channel;
> +    uint8_t parameter;
> +    uint8_t parameter_set;
> +    uint8_t parameter_block;
> +}  __attribute__ ((packed));
> +
> +ipmi_ret_t ipmi_transport_get_lan(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
> +                              ipmi_request_t request, ipmi_response_t response,
> +                              ipmi_data_len_t data_len, ipmi_context_t context)
> +{
> +    ipmi_ret_t rc = IPMI_CC_OK;
> +    *data_len = 0;
> +
> +    const uint32_t current_revision = 0x11; // Current rev per IPMI Spec 2.0
> +    char syscmd[128];
> +    int revision = 0;
> +    int i = 0;
> +
> +    printf("IPMI GET_LAN\n");
> +
> +    get_lan_t *reqptr = (get_lan_t*) request;
> +
> +    revision = reqptr->rev_channel >> 8; // Revision is bit 7

How does this work?  reqptr->rev_channel is a uint8_t.  (x >> 8) is
always zero then.

> +    if (revision == 1)
> +    {
> +        // Only current revision was requested
> +        *data_len = sizeof(current_revision);
> +        memcpy(response, &current_revision, *data_len);
> +        return IPMI_CC_OK;
> +    }
> +
-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20151030/37b5e325/attachment.sig>


More information about the openbmc mailing list