aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2022-03-17 13:01:50 +0000
committerMichael Brown <mcb30@ipxe.org>2022-08-11 15:28:03 +0100
commitfaf26bf8b882a6d56cc76686e2f0f3b236541f9d (patch)
treeb2a496174820b13ee12ae65ee0cec00da49469fb
parentf0ea19b23858bfe59f7ee060aa640820d0f65087 (diff)
downloadipxe-faf26bf8b882a6d56cc76686e2f0f3b236541f9d.zip
ipxe-faf26bf8b882a6d56cc76686e2f0f3b236541f9d.tar.gz
ipxe-faf26bf8b882a6d56cc76686e2f0f3b236541f9d.tar.bz2
[intelxl] Allow expected admin queue command errors to be silenced
The "clear PXE mode" admin queue command will return an EEXIST error if the device is already in non-PXE mode, but there is no other admin queue command that can be used to determine whether the device has already been switched into non-PXE mode. Provide a mechanism to allow expected errors from a command to be silenced, to allow the "clear PXE mode" command to be cleanly used without needing to first check the GLLAN_RCTL_0 register value. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/drivers/net/intelxl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/drivers/net/intelxl.c b/src/drivers/net/intelxl.c
index 51e888a..c73285a 100644
--- a/src/drivers/net/intelxl.c
+++ b/src/drivers/net/intelxl.c
@@ -348,6 +348,7 @@ int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
union intelxl_admin_buffer *buf;
uint64_t address;
uint32_t cookie;
+ uint16_t silence;
unsigned int index;
unsigned int tail;
unsigned int i;
@@ -364,11 +365,14 @@ int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
DBGC2 ( intelxl, "/%#08x", le32_to_cpu ( cmd->cookie ) );
DBGC2 ( intelxl, ":\n" );
+ /* Allow expected errors to be silenced */
+ silence = cmd->ret;
+ cmd->ret = 0;
+
/* Sanity checks */
assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_DD ) ) );
assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_CMP ) ) );
assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_ERR ) ) );
- assert ( cmd->ret == 0 );
/* Populate data buffer address if applicable */
if ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_BUF ) ) {
@@ -419,8 +423,8 @@ int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
goto err;
}
- /* Check for errors */
- if ( cmd->ret != 0 ) {
+ /* Check for unexpected errors */
+ if ( ( cmd->ret != 0 ) && ( cmd->ret != silence ) ) {
DBGC ( intelxl, "INTELXL %p admin command %#x error "
"%d\n", intelxl, index,
le16_to_cpu ( cmd->ret ) );