]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[efi] Use casts rather than virt_to_bus() for UNDI buffer addresses
authorMichael Brown <mcb30@ipxe.org>
Sun, 15 Nov 2020 23:33:52 +0000 (23:33 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sun, 15 Nov 2020 23:36:17 +0000 (23:36 +0000)
For a software UNDI, the addresses in PXE_CPB_TRANSMIT.FrameAddr and
PXE_CPB_RECEIVE.BufferAddr are host addresses, not bus addresses.

Remove the spurious (and no-op) use of virt_to_bus() and replace with
a cast via intptr_t.

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

index 8f4fbee182cf9a70aee1840d499f0f93b6430ecd..b9f34650eaf174c34bdda46b99877d2990afc9b5 100644 (file)
@@ -975,7 +975,7 @@ static int nii_transmit ( struct net_device *netdev,
 
        /* Construct parameter block */
        memset ( &cpb, 0, sizeof ( cpb ) );
-       cpb.FrameAddr = virt_to_bus ( iobuf->data );
+       cpb.FrameAddr = ( ( intptr_t ) iobuf->data );
        cpb.DataLen = iob_len ( iobuf );
 
        /* Transmit packet */
@@ -1043,7 +1043,7 @@ static void nii_poll_rx ( struct net_device *netdev ) {
 
                /* Construct parameter block */
                memset ( &cpb, 0, sizeof ( cpb ) );
-               cpb.BufferAddr = virt_to_bus ( nii->rxbuf->data );
+               cpb.BufferAddr = ( ( intptr_t ) nii->rxbuf->data );
                cpb.BufferLen = iob_tailroom ( nii->rxbuf );
 
                /* Issue command */