瀏覽代碼

[intelxl] Allow admin cookie to hold extended opcode and return code

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>
tags/v1.20.1
Michael Brown 5 年之前
父節點
當前提交
17298d0121
共有 2 個文件被更改,包括 16 次插入7 次删除
  1. 7
    3
      src/drivers/net/intelxl.c
  2. 9
    4
      src/drivers/net/intelxl.h

+ 7
- 3
src/drivers/net/intelxl.c 查看文件

@@ -313,8 +313,11 @@ static int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
313 313
 	tail = ( admin->index % INTELXL_ADMIN_NUM_DESC );
314 314
 	cmd = &admin->desc[ index % INTELXL_ADMIN_NUM_DESC ];
315 315
 	buf = &admin->buf[ index % INTELXL_ADMIN_NUM_DESC ];
316
-	DBGC2 ( intelxl, "INTELXL %p admin command %#x opcode %#04x:\n",
316
+	DBGC2 ( intelxl, "INTELXL %p admin command %#x opcode %#04x",
317 317
 		intelxl, index, le16_to_cpu ( cmd->opcode ) );
318
+	if ( cmd->vopcode )
319
+		DBGC2 ( intelxl, "/%#08x", le32_to_cpu ( cmd->vopcode ) );
320
+	DBGC2 ( intelxl, ":\n" );
318 321
 
319 322
 	/* Sanity checks */
320 323
 	assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_DD ) ) );
@@ -329,8 +332,9 @@ static int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
329 332
 		cmd->params.buffer.low = cpu_to_le32 ( address & 0xffffffffUL );
330 333
 	}
331 334
 
332
-	/* Populate cookie */
333
-	cmd->cookie = cpu_to_le32 ( index );
335
+	/* Populate cookie, if not being (ab)used for VF opcode */
336
+	if ( ! cmd->vopcode )
337
+		cmd->cookie = cpu_to_le32 ( index );
334 338
 
335 339
 	/* Record cookie */
336 340
 	cookie = cmd->cookie;

+ 9
- 4
src/drivers/net/intelxl.h 查看文件

@@ -333,10 +333,15 @@ struct intelxl_admin_descriptor {
333 333
 	uint16_t len;
334 334
 	/** Return value */
335 335
 	uint16_t ret;
336
-	/** Cookie */
337
-	uint32_t cookie;
338
-	/** Reserved */
339
-	uint32_t reserved;
336
+	/** Opaque cookie / VF opcode */
337
+	union {
338
+		/** Cookie */
339
+		uint32_t cookie;
340
+		/** VF opcode */
341
+		uint32_t vopcode;
342
+	};
343
+	/** VF return value */
344
+	int32_t vret;
340 345
 	/** Parameters */
341 346
 	union intelxl_admin_params params;
342 347
 } __attribute__ (( packed ));

Loading…
取消
儲存