summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown2017-09-05 11:48:41 +0200
committerMichael Brown2017-09-05 11:48:41 +0200
commit3ae70be5bab1f898efcac859b1b8e3418e0f4a4b (patch)
tree6e5e6345e79772d3c83c074abbc4f61899d70dd5 /src/drivers
parent[linux] Impose receive quota on tap driver (diff)
downloadipxe-3ae70be5bab1f898efcac859b1b8e3418e0f4a4b.tar.gz
ipxe-3ae70be5bab1f898efcac859b1b8e3418e0f4a4b.tar.xz
ipxe-3ae70be5bab1f898efcac859b1b8e3418e0f4a4b.zip
[efi] Raise TPL when calling UNDI entry point
The SnpDxe driver raises the task priority level to TPL_CALLBACK when calling the UNDI entry point. This does not appear to be a documented requirement, but we should probably match the behaviour of SnpDxe to minimise surprises to third party code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/net/efi/nii.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/drivers/net/efi/nii.c b/src/drivers/net/efi/nii.c
index 1c6980e6..1700b4bd 100644
--- a/src/drivers/net/efi/nii.c
+++ b/src/drivers/net/efi/nii.c
@@ -402,7 +402,9 @@ static EFIAPI VOID nii_block ( UINT64 unique_id, UINT32 acquire ) {
*/
static int nii_issue_cpb_db ( struct nii_nic *nii, unsigned int op, void *cpb,
size_t cpb_len, void *db, size_t db_len ) {
+ EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
PXE_CDB cdb;
+ UINTN tpl;
/* Prepare command descriptor block */
memset ( &cdb, 0, sizeof ( cdb ) );
@@ -414,6 +416,9 @@ static int nii_issue_cpb_db ( struct nii_nic *nii, unsigned int op, void *cpb,
cdb.DBsize = db_len;
cdb.IFnum = nii->nii->IfNum;
+ /* Raise task priority level */
+ tpl = bs->RaiseTPL ( TPL_CALLBACK );
+
/* Issue command */
DBGC2 ( nii, "NII %s issuing %02x:%04x ifnum %d%s%s\n",
nii->dev.name, cdb.OpCode, cdb.OpFlags, cdb.IFnum,
@@ -424,6 +429,9 @@ static int nii_issue_cpb_db ( struct nii_nic *nii, unsigned int op, void *cpb,
DBGC2_HD ( nii, db, db_len );
nii->issue ( ( intptr_t ) &cdb );
+ /* Restore task priority level */
+ bs->RestoreTPL ( tpl );
+
/* Check completion status */
if ( cdb.StatCode != PXE_STATCODE_SUCCESS )
return -cdb.StatCode;