mirror of https://github.com/ipxe/ipxe.git
[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>pull/697/head^2
parent
f0ea19b238
commit
faf26bf8b8
|
@ -348,6 +348,7 @@ int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
|
||||||
union intelxl_admin_buffer *buf;
|
union intelxl_admin_buffer *buf;
|
||||||
uint64_t address;
|
uint64_t address;
|
||||||
uint32_t cookie;
|
uint32_t cookie;
|
||||||
|
uint16_t silence;
|
||||||
unsigned int index;
|
unsigned int index;
|
||||||
unsigned int tail;
|
unsigned int tail;
|
||||||
unsigned int i;
|
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, "/%#08x", le32_to_cpu ( cmd->cookie ) );
|
||||||
DBGC2 ( intelxl, ":\n" );
|
DBGC2 ( intelxl, ":\n" );
|
||||||
|
|
||||||
|
/* Allow expected errors to be silenced */
|
||||||
|
silence = cmd->ret;
|
||||||
|
cmd->ret = 0;
|
||||||
|
|
||||||
/* Sanity checks */
|
/* Sanity checks */
|
||||||
assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_DD ) ) );
|
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_CMP ) ) );
|
||||||
assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_ERR ) ) );
|
assert ( ! ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_ERR ) ) );
|
||||||
assert ( cmd->ret == 0 );
|
|
||||||
|
|
||||||
/* Populate data buffer address if applicable */
|
/* Populate data buffer address if applicable */
|
||||||
if ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_BUF ) ) {
|
if ( cmd->flags & cpu_to_le16 ( INTELXL_ADMIN_FL_BUF ) ) {
|
||||||
|
@ -419,8 +423,8 @@ int intelxl_admin_command ( struct intelxl_nic *intelxl ) {
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for errors */
|
/* Check for unexpected errors */
|
||||||
if ( cmd->ret != 0 ) {
|
if ( ( cmd->ret != 0 ) && ( cmd->ret != silence ) ) {
|
||||||
DBGC ( intelxl, "INTELXL %p admin command %#x error "
|
DBGC ( intelxl, "INTELXL %p admin command %#x error "
|
||||||
"%d\n", intelxl, index,
|
"%d\n", intelxl, index,
|
||||||
le16_to_cpu ( cmd->ret ) );
|
le16_to_cpu ( cmd->ret ) );
|
||||||
|
|
Loading…
Reference in New Issue