]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[intelxl] Allow admin cookie to hold extended opcode and return code
authorMichael Brown <mcb30@ipxe.org>
Wed, 24 Apr 2019 12:00:12 +0000 (13:00 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sat, 27 Apr 2019 19:25:59 +0000 (20:25 +0100)
The "send to PF" and "send to VF" admin queue descriptors (ab)use the
cookie field to hold the extended opcode and return code values.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/intelxl.c
src/drivers/net/intelxl.h

index a4dca5fb5d931859e9b3ac4a689fa3fae0fe7a58..1cf5cad4ba42f91b443379adddc5ad4eb394c538 100644 (file)
@@ -313,8 +313,11 @@ static int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
        tail = ( admin->index % INTELXL_ADMIN_NUM_DESC );
        cmd = &admin->desc[ index % INTELXL_ADMIN_NUM_DESC ];
        buf = &admin->buf[ index % INTELXL_ADMIN_NUM_DESC ];
-       DBGC2 ( intelxl, "INTELXL %p admin command %#x opcode %#04x:\n",
+       DBGC2 ( intelxl, "INTELXL %p admin command %#x opcode %#04x",
                intelxl, index, le16_to_cpu ( cmd->opcode ) );
+       if ( cmd->vopcode )
+               DBGC2 ( intelxl, "/%#08x", le32_to_cpu ( cmd->vopcode ) );
+       DBGC2 ( intelxl, ":\n" );
 
        /* Sanity checks */
        assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_DD ) ) );
@@ -329,8 +332,9 @@ static int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
                cmd->params.buffer.low = cpu_to_le32 ( address & 0xffffffffUL );
        }
 
-       /* Populate cookie */
-       cmd->cookie = cpu_to_le32 ( index );
+       /* Populate cookie, if not being (ab)used for VF opcode */
+       if ( ! cmd->vopcode )
+               cmd->cookie = cpu_to_le32 ( index );
 
        /* Record cookie */
        cookie = cmd->cookie;
index 0175c1f9d01fada9ecf9470be0f65345bd3c983e..5067b8074c2a288aff3e21ab6873a56cd7acebb5 100644 (file)
@@ -333,10 +333,15 @@ struct intelxl_admin_descriptor {
        uint16_t len;
        /** Return value */
        uint16_t ret;
-       /** Cookie */
-       uint32_t cookie;
-       /** Reserved */
-       uint32_t reserved;
+       /** Opaque cookie / VF opcode */
+       union {
+               /** Cookie */
+               uint32_t cookie;
+               /** VF opcode */
+               uint32_t vopcode;
+       };
+       /** VF return value */
+       int32_t vret;
        /** Parameters */
        union intelxl_admin_params params;
 } __attribute__ (( packed ));