mirror of
https://github.com/ipxe/ipxe
synced 2026-02-28 03:11:18 +03:00
[uaccess] Remove trivial uses of userptr_t
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <ipxe/uaccess.h>
|
#include <ipxe/uaccess.h>
|
||||||
#include <ipxe/settings.h>
|
#include <ipxe/settings.h>
|
||||||
|
|
||||||
@@ -47,12 +48,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|||||||
* @ret len Length of setting data, or negative error
|
* @ret len Length of setting data, or negative error
|
||||||
*/
|
*/
|
||||||
static int vram_fetch ( void *data, size_t len ) {
|
static int vram_fetch ( void *data, size_t len ) {
|
||||||
userptr_t vram = phys_to_virt ( VRAM_BASE );
|
const void *vram = phys_to_virt ( VRAM_BASE );
|
||||||
|
|
||||||
/* Copy video RAM */
|
/* Copy video RAM */
|
||||||
if ( len > VRAM_LEN )
|
if ( len > VRAM_LEN )
|
||||||
len = VRAM_LEN;
|
len = VRAM_LEN;
|
||||||
copy_from_user ( data, vram, 0, len );
|
memcpy ( data, vram, len );
|
||||||
|
|
||||||
return VRAM_LEN;
|
return VRAM_LEN;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const char *pxe_cmdline;
|
|||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
static int pxe_exec ( struct image *image ) {
|
static int pxe_exec ( struct image *image ) {
|
||||||
userptr_t buffer = real_to_virt ( 0, 0x7c00 );
|
void *buffer = real_to_virt ( 0, 0x7c00 );
|
||||||
struct net_device *netdev;
|
struct net_device *netdev;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ real_to_virt ( unsigned int segment, unsigned int offset ) {
|
|||||||
static inline __always_inline void
|
static inline __always_inline void
|
||||||
copy_to_real ( unsigned int dest_seg, unsigned int dest_off,
|
copy_to_real ( unsigned int dest_seg, unsigned int dest_off,
|
||||||
void *src, size_t n ) {
|
void *src, size_t n ) {
|
||||||
copy_to_user ( real_to_virt ( dest_seg, dest_off ), 0, src, n );
|
memcpy ( real_to_virt ( dest_seg, dest_off ), src, n );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,7 +101,7 @@ copy_to_real ( unsigned int dest_seg, unsigned int dest_off,
|
|||||||
static inline __always_inline void
|
static inline __always_inline void
|
||||||
copy_from_real ( void *dest, unsigned int src_seg,
|
copy_from_real ( void *dest, unsigned int src_seg,
|
||||||
unsigned int src_off, size_t n ) {
|
unsigned int src_off, size_t n ) {
|
||||||
copy_from_user ( dest, real_to_virt ( src_seg, src_off ), 0, n );
|
memcpy ( dest, real_to_virt ( src_seg, src_off ), n );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
#include <ipxe/dhcp.h>
|
#include <ipxe/dhcp.h>
|
||||||
#include <ipxe/fakedhcp.h>
|
#include <ipxe/fakedhcp.h>
|
||||||
#include <ipxe/device.h>
|
#include <ipxe/device.h>
|
||||||
@@ -184,7 +183,7 @@ pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO *get_cached_info ) {
|
|||||||
union pxe_cached_info *info;
|
union pxe_cached_info *info;
|
||||||
unsigned int idx;
|
unsigned int idx;
|
||||||
size_t len;
|
size_t len;
|
||||||
userptr_t buffer;
|
void *buffer;
|
||||||
|
|
||||||
DBGC ( &pxe_netdev, "PXENV_GET_CACHED_INFO %s to %04x:%04x+%x",
|
DBGC ( &pxe_netdev, "PXENV_GET_CACHED_INFO %s to %04x:%04x+%x",
|
||||||
pxenv_get_cached_info_name ( get_cached_info->PacketType ),
|
pxenv_get_cached_info_name ( get_cached_info->PacketType ),
|
||||||
@@ -245,7 +244,7 @@ pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO *get_cached_info ) {
|
|||||||
DBGC ( &pxe_netdev, " buffer may be too short" );
|
DBGC ( &pxe_netdev, " buffer may be too short" );
|
||||||
buffer = real_to_virt ( get_cached_info->Buffer.segment,
|
buffer = real_to_virt ( get_cached_info->Buffer.segment,
|
||||||
get_cached_info->Buffer.offset );
|
get_cached_info->Buffer.offset );
|
||||||
copy_to_user ( buffer, 0, info, len );
|
memcpy ( buffer, info, len );
|
||||||
get_cached_info->BufferSize = len;
|
get_cached_info->BufferSize = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
#include <ipxe/in.h>
|
#include <ipxe/in.h>
|
||||||
#include <ipxe/tftp.h>
|
#include <ipxe/tftp.h>
|
||||||
#include <ipxe/iobuf.h>
|
#include <ipxe/iobuf.h>
|
||||||
@@ -49,7 +48,7 @@ struct pxe_tftp_connection {
|
|||||||
/** Data transfer interface */
|
/** Data transfer interface */
|
||||||
struct interface xfer;
|
struct interface xfer;
|
||||||
/** Data buffer */
|
/** Data buffer */
|
||||||
userptr_t buffer;
|
void *buffer;
|
||||||
/** Size of data buffer */
|
/** Size of data buffer */
|
||||||
size_t size;
|
size_t size;
|
||||||
/** Starting offset of data buffer */
|
/** Starting offset of data buffer */
|
||||||
@@ -121,9 +120,8 @@ static int pxe_tftp_xfer_deliver ( struct pxe_tftp_connection *pxe_tftp,
|
|||||||
( pxe_tftp->start + pxe_tftp->size ) );
|
( pxe_tftp->start + pxe_tftp->size ) );
|
||||||
rc = -ENOBUFS;
|
rc = -ENOBUFS;
|
||||||
} else {
|
} else {
|
||||||
copy_to_user ( pxe_tftp->buffer,
|
memcpy ( ( pxe_tftp->buffer + pxe_tftp->offset -
|
||||||
( pxe_tftp->offset - pxe_tftp->start ),
|
pxe_tftp->start ), iobuf->data, len );
|
||||||
iobuf->data, len );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate new buffer position */
|
/* Calculate new buffer position */
|
||||||
@@ -385,7 +383,7 @@ static PXENV_EXIT_t pxenv_tftp_read ( struct s_PXENV_TFTP_READ *tftp_read ) {
|
|||||||
while ( ( ( rc = pxe_tftp.rc ) == -EINPROGRESS ) &&
|
while ( ( ( rc = pxe_tftp.rc ) == -EINPROGRESS ) &&
|
||||||
( pxe_tftp.offset == pxe_tftp.start ) )
|
( pxe_tftp.offset == pxe_tftp.start ) )
|
||||||
step();
|
step();
|
||||||
pxe_tftp.buffer = UNULL;
|
pxe_tftp.buffer = NULL;
|
||||||
tftp_read->BufferSize = ( pxe_tftp.offset - pxe_tftp.start );
|
tftp_read->BufferSize = ( pxe_tftp.offset - pxe_tftp.start );
|
||||||
tftp_read->PacketNumber = ++pxe_tftp.blkidx;
|
tftp_read->PacketNumber = ++pxe_tftp.blkidx;
|
||||||
|
|
||||||
@@ -496,7 +494,7 @@ PXENV_EXIT_t pxenv_tftp_read_file ( struct s_PXENV_TFTP_READ_FILE
|
|||||||
pxe_tftp.size = tftp_read_file->BufferSize;
|
pxe_tftp.size = tftp_read_file->BufferSize;
|
||||||
while ( ( rc = pxe_tftp.rc ) == -EINPROGRESS )
|
while ( ( rc = pxe_tftp.rc ) == -EINPROGRESS )
|
||||||
step();
|
step();
|
||||||
pxe_tftp.buffer = UNULL;
|
pxe_tftp.buffer = NULL;
|
||||||
tftp_read_file->BufferSize = pxe_tftp.max_offset;
|
tftp_read_file->BufferSize = pxe_tftp.max_offset;
|
||||||
|
|
||||||
/* Close TFTP file */
|
/* Close TFTP file */
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include <ipxe/iobuf.h>
|
#include <ipxe/iobuf.h>
|
||||||
#include <ipxe/xfer.h>
|
#include <ipxe/xfer.h>
|
||||||
#include <ipxe/udp.h>
|
#include <ipxe/udp.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
#include <ipxe/process.h>
|
#include <ipxe/process.h>
|
||||||
#include <ipxe/netdevice.h>
|
#include <ipxe/netdevice.h>
|
||||||
#include <ipxe/malloc.h>
|
#include <ipxe/malloc.h>
|
||||||
@@ -296,7 +295,7 @@ pxenv_udp_write ( struct s_PXENV_UDP_WRITE *pxenv_udp_write ) {
|
|||||||
};
|
};
|
||||||
size_t len;
|
size_t len;
|
||||||
struct io_buffer *iobuf;
|
struct io_buffer *iobuf;
|
||||||
userptr_t buffer;
|
const void *buffer;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
DBG ( "PXENV_UDP_WRITE" );
|
DBG ( "PXENV_UDP_WRITE" );
|
||||||
@@ -330,7 +329,7 @@ pxenv_udp_write ( struct s_PXENV_UDP_WRITE *pxenv_udp_write ) {
|
|||||||
}
|
}
|
||||||
buffer = real_to_virt ( pxenv_udp_write->buffer.segment,
|
buffer = real_to_virt ( pxenv_udp_write->buffer.segment,
|
||||||
pxenv_udp_write->buffer.offset );
|
pxenv_udp_write->buffer.offset );
|
||||||
copy_from_user ( iob_put ( iobuf, len ), buffer, 0, len );
|
memcpy ( iob_put ( iobuf, len ), buffer, len );
|
||||||
|
|
||||||
DBG ( " %04x:%04x+%x %d->%s:%d\n", pxenv_udp_write->buffer.segment,
|
DBG ( " %04x:%04x+%x %d->%s:%d\n", pxenv_udp_write->buffer.segment,
|
||||||
pxenv_udp_write->buffer.offset, pxenv_udp_write->buffer_size,
|
pxenv_udp_write->buffer.offset, pxenv_udp_write->buffer_size,
|
||||||
@@ -400,7 +399,7 @@ static PXENV_EXIT_t pxenv_udp_read ( struct s_PXENV_UDP_READ *pxenv_udp_read ) {
|
|||||||
struct pxe_udp_pseudo_header *pshdr;
|
struct pxe_udp_pseudo_header *pshdr;
|
||||||
uint16_t d_port_wanted = pxenv_udp_read->d_port;
|
uint16_t d_port_wanted = pxenv_udp_read->d_port;
|
||||||
uint16_t d_port;
|
uint16_t d_port;
|
||||||
userptr_t buffer;
|
void *buffer;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
/* Try receiving a packet, if the queue is empty */
|
/* Try receiving a packet, if the queue is empty */
|
||||||
@@ -443,7 +442,7 @@ static PXENV_EXIT_t pxenv_udp_read ( struct s_PXENV_UDP_READ *pxenv_udp_read ) {
|
|||||||
len = iob_len ( iobuf );
|
len = iob_len ( iobuf );
|
||||||
if ( len > pxenv_udp_read->buffer_size )
|
if ( len > pxenv_udp_read->buffer_size )
|
||||||
len = pxenv_udp_read->buffer_size;
|
len = pxenv_udp_read->buffer_size;
|
||||||
copy_to_user ( buffer, 0, iobuf->data, len );
|
memcpy ( buffer, iobuf->data, len );
|
||||||
pxenv_udp_read->buffer_size = len;
|
pxenv_udp_read->buffer_size = len;
|
||||||
|
|
||||||
/* Fill in source/dest information */
|
/* Fill in source/dest information */
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ static int cachedhcp_apply ( struct cached_dhcp_packet *cache,
|
|||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
int cachedhcp_record ( struct cached_dhcp_packet *cache, unsigned int vlan,
|
int cachedhcp_record ( struct cached_dhcp_packet *cache, unsigned int vlan,
|
||||||
userptr_t data, size_t max_len ) {
|
const void *data, size_t max_len ) {
|
||||||
struct dhcp_packet *dhcppkt;
|
struct dhcp_packet *dhcppkt;
|
||||||
struct dhcp_packet *tmp;
|
struct dhcp_packet *tmp;
|
||||||
struct dhcphdr *dhcphdr;
|
struct dhcphdr *dhcphdr;
|
||||||
@@ -216,7 +216,7 @@ int cachedhcp_record ( struct cached_dhcp_packet *cache, unsigned int vlan,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
dhcphdr = ( ( ( void * ) dhcppkt ) + sizeof ( *dhcppkt ) );
|
dhcphdr = ( ( ( void * ) dhcppkt ) + sizeof ( *dhcppkt ) );
|
||||||
copy_from_user ( dhcphdr, data, 0, max_len );
|
memcpy ( dhcphdr, data, max_len );
|
||||||
dhcppkt_init ( dhcppkt, dhcphdr, max_len );
|
dhcppkt_init ( dhcppkt, dhcphdr, max_len );
|
||||||
|
|
||||||
/* Shrink packet to required length. If reallocation fails,
|
/* Shrink packet to required length. If reallocation fails,
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ static void * dma_op_umalloc ( struct dma_device *dma,
|
|||||||
struct dma_operations *op = dma->op;
|
struct dma_operations *op = dma->op;
|
||||||
|
|
||||||
if ( ! op )
|
if ( ! op )
|
||||||
return UNULL;
|
return NULL;
|
||||||
return op->umalloc ( dma, map, len, align );
|
return op->umalloc ( dma, map, len, align );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1037,7 +1037,7 @@ static int fdt_urealloc ( struct fdt *fdt, size_t len ) {
|
|||||||
assert ( len >= fdt->used );
|
assert ( len >= fdt->used );
|
||||||
|
|
||||||
/* Attempt reallocation */
|
/* Attempt reallocation */
|
||||||
new = urealloc ( virt_to_user ( fdt->raw ), len );
|
new = urealloc ( fdt->raw, len );
|
||||||
if ( ! new ) {
|
if ( ! new ) {
|
||||||
DBGC ( fdt, "FDT could not reallocate from +%#04zx to "
|
DBGC ( fdt, "FDT could not reallocate from +%#04zx to "
|
||||||
"+%#04zx\n", fdt->len, len );
|
"+%#04zx\n", fdt->len, len );
|
||||||
@@ -1129,7 +1129,7 @@ int fdt_create ( struct fdt_header **hdr, const char *cmdline ) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_bootargs:
|
err_bootargs:
|
||||||
ufree ( virt_to_user ( fdt.raw ) );
|
ufree ( fdt.raw );
|
||||||
err_alloc:
|
err_alloc:
|
||||||
err_image:
|
err_image:
|
||||||
return rc;
|
return rc;
|
||||||
@@ -1143,7 +1143,7 @@ int fdt_create ( struct fdt_header **hdr, const char *cmdline ) {
|
|||||||
void fdt_remove ( struct fdt_header *hdr ) {
|
void fdt_remove ( struct fdt_header *hdr ) {
|
||||||
|
|
||||||
/* Free modifiable copy */
|
/* Free modifiable copy */
|
||||||
ufree ( virt_to_user ( hdr ) );
|
ufree ( hdr );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Drag in objects via fdt_describe() */
|
/* Drag in objects via fdt_describe() */
|
||||||
|
|||||||
@@ -2119,7 +2119,7 @@ static void arbel_stop_firmware ( struct arbel *arbel ) {
|
|||||||
DBGC ( arbel, "Arbel %p FATAL could not stop firmware: %s\n",
|
DBGC ( arbel, "Arbel %p FATAL could not stop firmware: %s\n",
|
||||||
arbel, strerror ( rc ) );
|
arbel, strerror ( rc ) );
|
||||||
/* Leak memory and return; at least we avoid corruption */
|
/* Leak memory and return; at least we avoid corruption */
|
||||||
arbel->firmware_area = UNULL;
|
arbel->firmware_area = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
#include <ipxe/ib_packet.h>
|
#include <ipxe/ib_packet.h>
|
||||||
#include "mlx_bitops.h"
|
#include "mlx_bitops.h"
|
||||||
#include "MT25218_PRM.h"
|
#include "MT25218_PRM.h"
|
||||||
@@ -492,7 +491,7 @@ struct arbel {
|
|||||||
* final teardown, in order to avoid memory map changes at
|
* final teardown, in order to avoid memory map changes at
|
||||||
* runtime.
|
* runtime.
|
||||||
*/
|
*/
|
||||||
userptr_t firmware_area;
|
void *firmware_area;
|
||||||
/** ICM size */
|
/** ICM size */
|
||||||
size_t icm_len;
|
size_t icm_len;
|
||||||
/** ICM AUX size */
|
/** ICM AUX size */
|
||||||
@@ -503,7 +502,7 @@ struct arbel {
|
|||||||
* final teardown, in order to avoid memory map changes at
|
* final teardown, in order to avoid memory map changes at
|
||||||
* runtime.
|
* runtime.
|
||||||
*/
|
*/
|
||||||
userptr_t icm;
|
void *icm;
|
||||||
/** Offset within ICM of doorbell records */
|
/** Offset within ICM of doorbell records */
|
||||||
size_t db_rec_offset;
|
size_t db_rec_offset;
|
||||||
/** Doorbell records */
|
/** Doorbell records */
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
|||||||
|
|
||||||
struct golan_page {
|
struct golan_page {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
userptr_t addr;
|
void *addr;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void golan_free_fw_areas ( struct golan *golan ) {
|
static void golan_free_fw_areas ( struct golan *golan ) {
|
||||||
@@ -61,7 +61,7 @@ static void golan_free_fw_areas ( struct golan *golan ) {
|
|||||||
for (i = 0; i < GOLAN_FW_AREAS_NUM; i++) {
|
for (i = 0; i < GOLAN_FW_AREAS_NUM; i++) {
|
||||||
if ( golan->fw_areas[i].area ) {
|
if ( golan->fw_areas[i].area ) {
|
||||||
ufree ( golan->fw_areas[i].area );
|
ufree ( golan->fw_areas[i].area );
|
||||||
golan->fw_areas[i].area = UNULL;
|
golan->fw_areas[i].area = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ static int golan_init_fw_areas ( struct golan *golan ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < GOLAN_FW_AREAS_NUM; i++)
|
for (i = 0; i < GOLAN_FW_AREAS_NUM; i++)
|
||||||
golan->fw_areas[i].area = UNULL;
|
golan->fw_areas[i].area = NULL;
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
@@ -448,12 +448,12 @@ static inline int golan_provide_pages ( struct golan *golan , uint32_t pages
|
|||||||
int size_ibox = 0;
|
int size_ibox = 0;
|
||||||
int size_obox = 0;
|
int size_obox = 0;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
userptr_t next_page_addr = UNULL;
|
void *next_page_addr = NULL;
|
||||||
|
|
||||||
DBGC(golan, "%s\n", __FUNCTION__);
|
DBGC(golan, "%s\n", __FUNCTION__);
|
||||||
if ( ! fw_area->area ) {
|
if ( ! fw_area->area ) {
|
||||||
fw_area->area = umalloc ( GOLAN_PAGE_SIZE * pages );
|
fw_area->area = umalloc ( GOLAN_PAGE_SIZE * pages );
|
||||||
if ( fw_area->area == UNULL ) {
|
if ( fw_area->area == NULL ) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
DBGC (golan ,"Failed to allocated %d pages \n",pages);
|
DBGC (golan ,"Failed to allocated %d pages \n",pages);
|
||||||
goto err_golan_alloc_fw_area;
|
goto err_golan_alloc_fw_area;
|
||||||
@@ -467,7 +467,7 @@ static inline int golan_provide_pages ( struct golan *golan , uint32_t pages
|
|||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
struct golan_cmd_layout *cmd;
|
struct golan_cmd_layout *cmd;
|
||||||
struct golan_manage_pages_inbox *in;
|
struct golan_manage_pages_inbox *in;
|
||||||
userptr_t addr = 0;
|
void *addr = NULL;
|
||||||
|
|
||||||
mailbox = GET_INBOX(golan, MEM_MBOX);
|
mailbox = GET_INBOX(golan, MEM_MBOX);
|
||||||
size_ibox = sizeof(struct golan_manage_pages_inbox) + (pas_num * GOLAN_PAS_SIZE);
|
size_ibox = sizeof(struct golan_manage_pages_inbox) + (pas_num * GOLAN_PAS_SIZE);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ struct golan_firmware_area {
|
|||||||
* final teardown, in order to avoid memory map changes at
|
* final teardown, in order to avoid memory map changes at
|
||||||
* runtime.
|
* runtime.
|
||||||
*/
|
*/
|
||||||
userptr_t area;
|
void *area;
|
||||||
};
|
};
|
||||||
/* Queue Pair */
|
/* Queue Pair */
|
||||||
#define GOLAN_SEND_WQE_BB_SIZE 64
|
#define GOLAN_SEND_WQE_BB_SIZE 64
|
||||||
|
|||||||
@@ -2422,7 +2422,7 @@ static void hermon_stop_firmware ( struct hermon *hermon ) {
|
|||||||
DBGC ( hermon, "Hermon %p FATAL could not stop firmware: %s\n",
|
DBGC ( hermon, "Hermon %p FATAL could not stop firmware: %s\n",
|
||||||
hermon, strerror ( rc ) );
|
hermon, strerror ( rc ) );
|
||||||
/* Leak memory and return; at least we avoid corruption */
|
/* Leak memory and return; at least we avoid corruption */
|
||||||
hermon->firmware_area = UNULL;
|
hermon->firmware_area = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
FILE_LICENCE ( GPL2_OR_LATER );
|
FILE_LICENCE ( GPL2_OR_LATER );
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
#include <ipxe/ib_packet.h>
|
#include <ipxe/ib_packet.h>
|
||||||
#include <ipxe/bofm.h>
|
#include <ipxe/bofm.h>
|
||||||
#include <ipxe/nvsvpd.h>
|
#include <ipxe/nvsvpd.h>
|
||||||
@@ -887,7 +886,7 @@ struct hermon {
|
|||||||
* final teardown, in order to avoid memory map changes at
|
* final teardown, in order to avoid memory map changes at
|
||||||
* runtime.
|
* runtime.
|
||||||
*/
|
*/
|
||||||
userptr_t firmware_area;
|
void *firmware_area;
|
||||||
/** ICM map */
|
/** ICM map */
|
||||||
struct hermon_icm_map icm_map[HERMON_ICM_NUM_REGIONS];
|
struct hermon_icm_map icm_map[HERMON_ICM_NUM_REGIONS];
|
||||||
/** ICM size */
|
/** ICM size */
|
||||||
@@ -900,7 +899,7 @@ struct hermon {
|
|||||||
* final teardown, in order to avoid memory map changes at
|
* final teardown, in order to avoid memory map changes at
|
||||||
* runtime.
|
* runtime.
|
||||||
*/
|
*/
|
||||||
userptr_t icm;
|
void *icm;
|
||||||
|
|
||||||
/** Event queue */
|
/** Event queue */
|
||||||
struct hermon_event_queue eq;
|
struct hermon_event_queue eq;
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ struct nii_nic {
|
|||||||
size_t mtu;
|
size_t mtu;
|
||||||
|
|
||||||
/** Hardware transmit/receive buffer */
|
/** Hardware transmit/receive buffer */
|
||||||
userptr_t buffer;
|
void *buffer;
|
||||||
/** Hardware transmit/receive buffer length */
|
/** Hardware transmit/receive buffer length */
|
||||||
size_t buffer_len;
|
size_t buffer_len;
|
||||||
|
|
||||||
|
|||||||
@@ -622,7 +622,7 @@ static int netvsc_buffer_copy ( struct vmbus_xfer_pages *pages, void *data,
|
|||||||
return -ERANGE;
|
return -ERANGE;
|
||||||
|
|
||||||
/* Copy data from buffer */
|
/* Copy data from buffer */
|
||||||
copy_from_user ( data, buffer->data, offset, len );
|
memcpy ( data, ( buffer->data + offset ), len );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -305,7 +305,7 @@ struct netvsc_buffer {
|
|||||||
/** Buffer length */
|
/** Buffer length */
|
||||||
size_t len;
|
size_t len;
|
||||||
/** Buffer */
|
/** Buffer */
|
||||||
userptr_t data;
|
void *data;
|
||||||
/** GPADL ID */
|
/** GPADL ID */
|
||||||
unsigned int gpadl;
|
unsigned int gpadl;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ipxe/pci.h>
|
#include <ipxe/pci.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
#include <ipxe/usb.h>
|
#include <ipxe/usb.h>
|
||||||
|
|
||||||
/** Minimum alignment required for data structures
|
/** Minimum alignment required for data structures
|
||||||
@@ -1054,7 +1053,7 @@ struct xhci_scratchpad {
|
|||||||
/** Number of page-sized scratchpad buffers */
|
/** Number of page-sized scratchpad buffers */
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
/** Scratchpad buffer area */
|
/** Scratchpad buffer area */
|
||||||
userptr_t buffer;
|
void *buffer;
|
||||||
/** Buffer DMA mapping */
|
/** Buffer DMA mapping */
|
||||||
struct dma_mapping buffer_map;
|
struct dma_mapping buffer_map;
|
||||||
/** Scratchpad array */
|
/** Scratchpad array */
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ struct errortab segment_errors[] __errortab = {
|
|||||||
* @v memsz Size of the segment
|
* @v memsz Size of the segment
|
||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
int prep_segment ( userptr_t segment, size_t filesz, size_t memsz ) {
|
int prep_segment ( void *segment, size_t filesz, size_t memsz ) {
|
||||||
struct memory_map memmap;
|
struct memory_map memmap;
|
||||||
physaddr_t start = virt_to_phys ( segment );
|
physaddr_t start = virt_to_phys ( segment );
|
||||||
physaddr_t mid = ( start + filesz );
|
physaddr_t mid = ( start + filesz );
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
|
|
||||||
struct net_device;
|
struct net_device;
|
||||||
struct cached_dhcp_packet;
|
struct cached_dhcp_packet;
|
||||||
@@ -20,7 +19,7 @@ extern struct cached_dhcp_packet cached_proxydhcp;
|
|||||||
extern struct cached_dhcp_packet cached_pxebs;
|
extern struct cached_dhcp_packet cached_pxebs;
|
||||||
|
|
||||||
extern int cachedhcp_record ( struct cached_dhcp_packet *cache,
|
extern int cachedhcp_record ( struct cached_dhcp_packet *cache,
|
||||||
unsigned int vlan, userptr_t data,
|
unsigned int vlan, const void *data,
|
||||||
size_t max_len );
|
size_t max_len );
|
||||||
extern void cachedhcp_recycle ( struct net_device *netdev );
|
extern void cachedhcp_recycle ( struct net_device *netdev );
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
FILE_LICENCE ( GPL2_OR_LATER );
|
FILE_LICENCE ( GPL2_OR_LATER );
|
||||||
|
|
||||||
#include <ipxe/uaccess.h>
|
extern int linux_sysfs_read ( const char *filename, void **data );
|
||||||
|
|
||||||
extern int linux_sysfs_read ( const char *filename, userptr_t *data );
|
|
||||||
|
|
||||||
#endif /* _IPXE_LINUX_SYSFS_H */
|
#endif /* _IPXE_LINUX_SYSFS_H */
|
||||||
|
|||||||
@@ -10,8 +10,7 @@
|
|||||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
|
|
||||||
extern size_t largest_memblock ( userptr_t *start );
|
extern size_t largest_memblock ( void **start );
|
||||||
|
|
||||||
#endif /* _IPXE_MEMBLOCK_H */
|
#endif /* _IPXE_MEMBLOCK_H */
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
|
|
||||||
#include <ipxe/uaccess.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
extern int prep_segment ( userptr_t segment, size_t filesz, size_t memsz );
|
extern int prep_segment ( void *segment, size_t filesz, size_t memsz );
|
||||||
|
|
||||||
#endif /* _IPXE_SEGMENT_H */
|
#endif /* _IPXE_SEGMENT_H */
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|||||||
#include <ipxe/uuid.h>
|
#include <ipxe/uuid.h>
|
||||||
#include <ipxe/device.h>
|
#include <ipxe/device.h>
|
||||||
#include <ipxe/tables.h>
|
#include <ipxe/tables.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
#include <ipxe/iobuf.h>
|
#include <ipxe/iobuf.h>
|
||||||
#include <ipxe/hyperv.h>
|
#include <ipxe/hyperv.h>
|
||||||
|
|
||||||
@@ -634,7 +633,7 @@ vmbus_gpadl_is_obsolete ( unsigned int gpadl ) {
|
|||||||
return ( gpadl <= vmbus_obsolete_gpadl );
|
return ( gpadl <= vmbus_obsolete_gpadl );
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int vmbus_establish_gpadl ( struct vmbus_device *vmdev, userptr_t data,
|
extern int vmbus_establish_gpadl ( struct vmbus_device *vmdev, void *data,
|
||||||
size_t len );
|
size_t len );
|
||||||
extern int vmbus_gpadl_teardown ( struct vmbus_device *vmdev,
|
extern int vmbus_gpadl_teardown ( struct vmbus_device *vmdev,
|
||||||
unsigned int gpadl );
|
unsigned int gpadl );
|
||||||
|
|||||||
@@ -110,8 +110,7 @@ static int efi_block_rw ( struct san_device *sandev, uint64_t lba,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read from / write to block device */
|
/* Read from / write to block device */
|
||||||
if ( ( rc = sandev_rw ( sandev, lba, count,
|
if ( ( rc = sandev_rw ( sandev, lba, count, data ) ) != 0 ) {
|
||||||
virt_to_user ( data ) ) ) != 0 ) {
|
|
||||||
DBGC ( sandev->drive, "EFIBLK %#02x I/O failed: %s\n",
|
DBGC ( sandev->drive, "EFIBLK %#02x I/O failed: %s\n",
|
||||||
sandev->drive, strerror ( rc ) );
|
sandev->drive, strerror ( rc ) );
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
@@ -284,8 +284,7 @@ static int efi_bofm_start ( struct efi_device *efidev ) {
|
|||||||
efi_handle_name ( device ) );
|
efi_handle_name ( device ) );
|
||||||
DBGC2_HD ( device, bofmtab2, bofmtab2->Parameters.Length );
|
DBGC2_HD ( device, bofmtab2, bofmtab2->Parameters.Length );
|
||||||
}
|
}
|
||||||
bofmrc = bofm ( virt_to_user ( bofmtab2 ? bofmtab2 : bofmtab ),
|
bofmrc = bofm ( ( bofmtab2 ? bofmtab2 : bofmtab ), &efipci.pci );
|
||||||
&efipci.pci );
|
|
||||||
DBGC ( device, "EFIBOFM %s status %08x\n",
|
DBGC ( device, "EFIBOFM %s status %08x\n",
|
||||||
efi_handle_name ( device ), bofmrc );
|
efi_handle_name ( device ), bofmrc );
|
||||||
DBGC2 ( device, "EFIBOFM %s version 1 after processing:\n",
|
DBGC2 ( device, "EFIBOFM %s version 1 after processing:\n",
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ int efi_cachedhcp_record ( EFI_HANDLE device,
|
|||||||
|
|
||||||
/* Record DHCPACK, if present */
|
/* Record DHCPACK, if present */
|
||||||
if ( mode->DhcpAckReceived &&
|
if ( mode->DhcpAckReceived &&
|
||||||
( ( rc = cachedhcp_record ( &cached_dhcpack, vlan,
|
( ( rc = cachedhcp_record ( &cached_dhcpack, vlan, &mode->DhcpAck,
|
||||||
virt_to_user ( &mode->DhcpAck ),
|
|
||||||
sizeof ( mode->DhcpAck ) ) ) != 0 ) ) {
|
sizeof ( mode->DhcpAck ) ) ) != 0 ) ) {
|
||||||
DBGC ( device, "EFI %s could not record DHCPACK: %s\n",
|
DBGC ( device, "EFI %s could not record DHCPACK: %s\n",
|
||||||
efi_handle_name ( device ), strerror ( rc ) );
|
efi_handle_name ( device ), strerror ( rc ) );
|
||||||
@@ -83,7 +82,7 @@ int efi_cachedhcp_record ( EFI_HANDLE device,
|
|||||||
/* Record ProxyDHCPOFFER, if present */
|
/* Record ProxyDHCPOFFER, if present */
|
||||||
if ( mode->ProxyOfferReceived &&
|
if ( mode->ProxyOfferReceived &&
|
||||||
( ( rc = cachedhcp_record ( &cached_proxydhcp, vlan,
|
( ( rc = cachedhcp_record ( &cached_proxydhcp, vlan,
|
||||||
virt_to_user ( &mode->ProxyOffer ),
|
&mode->ProxyOffer,
|
||||||
sizeof ( mode->ProxyOffer ) ) ) != 0)){
|
sizeof ( mode->ProxyOffer ) ) ) != 0)){
|
||||||
DBGC ( device, "EFI %s could not record ProxyDHCPOFFER: %s\n",
|
DBGC ( device, "EFI %s could not record ProxyDHCPOFFER: %s\n",
|
||||||
efi_handle_name ( device ), strerror ( rc ) );
|
efi_handle_name ( device ), strerror ( rc ) );
|
||||||
@@ -92,9 +91,8 @@ int efi_cachedhcp_record ( EFI_HANDLE device,
|
|||||||
|
|
||||||
/* Record PxeBSACK, if present */
|
/* Record PxeBSACK, if present */
|
||||||
if ( mode->PxeReplyReceived &&
|
if ( mode->PxeReplyReceived &&
|
||||||
( ( rc = cachedhcp_record ( &cached_pxebs, vlan,
|
( ( rc = cachedhcp_record ( &cached_pxebs, vlan, &mode->PxeReply,
|
||||||
virt_to_user ( &mode->PxeReply ),
|
sizeof ( mode->PxeReply ) ) ) != 0 )){
|
||||||
sizeof ( mode->PxeReply ) ) ) != 0)){
|
|
||||||
DBGC ( device, "EFI %s could not record PXEBSACK: %s\n",
|
DBGC ( device, "EFI %s could not record PXEBSACK: %s\n",
|
||||||
efi_handle_name ( device ), strerror ( rc ) );
|
efi_handle_name ( device ), strerror ( rc ) );
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
@@ -177,12 +177,12 @@ static size_t efi_file_len ( struct efi_file *file ) {
|
|||||||
* Read chunk of EFI file
|
* Read chunk of EFI file
|
||||||
*
|
*
|
||||||
* @v reader EFI file reader
|
* @v reader EFI file reader
|
||||||
* @v data Input data, or UNULL to zero-fill
|
* @v data Input data, or NULL to zero-fill
|
||||||
* @v len Length of input data
|
* @v len Length of input data
|
||||||
* @ret len Length of output data
|
* @ret len Length of output data
|
||||||
*/
|
*/
|
||||||
static size_t efi_file_read_chunk ( struct efi_file_reader *reader,
|
static size_t efi_file_read_chunk ( struct efi_file_reader *reader,
|
||||||
userptr_t data, size_t len ) {
|
const void *data, size_t len ) {
|
||||||
struct efi_file *file = reader->file;
|
struct efi_file *file = reader->file;
|
||||||
size_t offset;
|
size_t offset;
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ static size_t efi_file_read_chunk ( struct efi_file_reader *reader,
|
|||||||
|
|
||||||
/* Copy or zero output data */
|
/* Copy or zero output data */
|
||||||
if ( data ) {
|
if ( data ) {
|
||||||
copy_from_user ( reader->data, data, offset, len );
|
memcpy ( reader->data, ( data + offset ), len );
|
||||||
} else {
|
} else {
|
||||||
memset ( reader->data, 0, len );
|
memset ( reader->data, 0, len );
|
||||||
}
|
}
|
||||||
@@ -262,7 +262,7 @@ static size_t efi_file_read_initrd ( struct efi_file_reader *reader ) {
|
|||||||
efi_file_name ( file ), reader->pos,
|
efi_file_name ( file ), reader->pos,
|
||||||
( reader->pos + pad_len ) );
|
( reader->pos + pad_len ) );
|
||||||
}
|
}
|
||||||
len += efi_file_read_chunk ( reader, UNULL, pad_len );
|
len += efi_file_read_chunk ( reader, NULL, pad_len );
|
||||||
|
|
||||||
/* Read CPIO header(s), if applicable */
|
/* Read CPIO header(s), if applicable */
|
||||||
name = cpio_name ( image );
|
name = cpio_name ( image );
|
||||||
@@ -274,13 +274,10 @@ static size_t efi_file_read_initrd ( struct efi_file_reader *reader ) {
|
|||||||
efi_file_name ( file ), reader->pos,
|
efi_file_name ( file ), reader->pos,
|
||||||
( reader->pos + cpio_len + pad_len ),
|
( reader->pos + cpio_len + pad_len ),
|
||||||
image->name );
|
image->name );
|
||||||
len += efi_file_read_chunk ( reader,
|
len += efi_file_read_chunk ( reader, &cpio,
|
||||||
virt_to_user ( &cpio ),
|
|
||||||
sizeof ( cpio ) );
|
sizeof ( cpio ) );
|
||||||
len += efi_file_read_chunk ( reader,
|
len += efi_file_read_chunk ( reader, name, name_len );
|
||||||
virt_to_user ( name ),
|
len += efi_file_read_chunk ( reader, NULL, pad_len );
|
||||||
name_len );
|
|
||||||
len += efi_file_read_chunk ( reader, UNULL, pad_len );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read file data */
|
/* Read file data */
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ static int vmbus_negotiate_version ( struct hv_hypervisor *hv ) {
|
|||||||
* @v len Length of data buffer
|
* @v len Length of data buffer
|
||||||
* @ret gpadl GPADL ID, or negative error
|
* @ret gpadl GPADL ID, or negative error
|
||||||
*/
|
*/
|
||||||
int vmbus_establish_gpadl ( struct vmbus_device *vmdev, userptr_t data,
|
int vmbus_establish_gpadl ( struct vmbus_device *vmdev, void *data,
|
||||||
size_t len ) {
|
size_t len ) {
|
||||||
struct hv_hypervisor *hv = vmdev->hv;
|
struct hv_hypervisor *hv = vmdev->hv;
|
||||||
struct vmbus *vmbus = hv->vmbus;
|
struct vmbus *vmbus = hv->vmbus;
|
||||||
@@ -442,7 +442,7 @@ int vmbus_open ( struct vmbus_device *vmdev,
|
|||||||
memset ( ring, 0, len );
|
memset ( ring, 0, len );
|
||||||
|
|
||||||
/* Establish GPADL for ring buffer */
|
/* Establish GPADL for ring buffer */
|
||||||
gpadl = vmbus_establish_gpadl ( vmdev, virt_to_user ( ring ), len );
|
gpadl = vmbus_establish_gpadl ( vmdev, ring, len );
|
||||||
if ( gpadl < 0 ) {
|
if ( gpadl < 0 ) {
|
||||||
rc = gpadl;
|
rc = gpadl;
|
||||||
goto err_establish;
|
goto err_establish;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ipxe/linux_api.h>
|
#include <ipxe/linux_api.h>
|
||||||
#include <ipxe/linux_sysfs.h>
|
#include <ipxe/linux_sysfs.h>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
FILE_LICENCE ( GPL2_OR_LATER );
|
FILE_LICENCE ( GPL2_OR_LATER );
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <ipxe/linux_api.h>
|
#include <ipxe/linux_api.h>
|
||||||
#include <ipxe/linux_sysfs.h>
|
#include <ipxe/linux_sysfs.h>
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
|||||||
* @v data Data to fill in
|
* @v data Data to fill in
|
||||||
* @ret len Length read, or negative error
|
* @ret len Length read, or negative error
|
||||||
*/
|
*/
|
||||||
int linux_sysfs_read ( const char *filename, userptr_t *data ) {
|
int linux_sysfs_read ( const char *filename, void **data ) {
|
||||||
userptr_t tmp;
|
void *tmp;
|
||||||
ssize_t read;
|
ssize_t read;
|
||||||
size_t len;
|
size_t len;
|
||||||
int fd;
|
int fd;
|
||||||
@@ -59,7 +59,7 @@ int linux_sysfs_read ( const char *filename, userptr_t *data ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read file */
|
/* Read file */
|
||||||
for ( *data = UNULL, len = 0 ; ; len += read ) {
|
for ( *data = NULL, len = 0 ; ; len += read ) {
|
||||||
|
|
||||||
/* (Re)allocate space */
|
/* (Re)allocate space */
|
||||||
tmp = urealloc ( *data, ( len + LINUX_SYSFS_BLKSIZE ) );
|
tmp = urealloc ( *data, ( len + LINUX_SYSFS_BLKSIZE ) );
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ipxe/uaccess.h>
|
|
||||||
#include <ipxe/init.h>
|
#include <ipxe/init.h>
|
||||||
#include <ipxe/pci.h>
|
#include <ipxe/pci.h>
|
||||||
#include <ipxe/ethernet.h>
|
#include <ipxe/ethernet.h>
|
||||||
@@ -111,7 +110,7 @@ void bofm_test ( struct pci_device *pci ) {
|
|||||||
printf ( "BOFMTEST performing harvest\n" );
|
printf ( "BOFMTEST performing harvest\n" );
|
||||||
bofmtab_harvest.en.busdevfn = pci->busdevfn;
|
bofmtab_harvest.en.busdevfn = pci->busdevfn;
|
||||||
DBG_HDA ( 0, &bofmtab_harvest, sizeof ( bofmtab_harvest ) );
|
DBG_HDA ( 0, &bofmtab_harvest, sizeof ( bofmtab_harvest ) );
|
||||||
bofmrc = bofm ( virt_to_user ( &bofmtab_harvest ), pci );
|
bofmrc = bofm ( &bofmtab_harvest, pci );
|
||||||
printf ( "BOFMTEST harvest result %08x\n", bofmrc );
|
printf ( "BOFMTEST harvest result %08x\n", bofmrc );
|
||||||
if ( bofmtab_harvest.en.options & BOFM_EN_HVST ) {
|
if ( bofmtab_harvest.en.options & BOFM_EN_HVST ) {
|
||||||
printf ( "BOFMTEST harvested MAC address %s\n",
|
printf ( "BOFMTEST harvested MAC address %s\n",
|
||||||
@@ -125,7 +124,7 @@ void bofm_test ( struct pci_device *pci ) {
|
|||||||
printf ( "BOFMTEST performing update\n" );
|
printf ( "BOFMTEST performing update\n" );
|
||||||
bofmtab_update.en.busdevfn = pci->busdevfn;
|
bofmtab_update.en.busdevfn = pci->busdevfn;
|
||||||
DBG_HDA ( 0, &bofmtab_update, sizeof ( bofmtab_update ) );
|
DBG_HDA ( 0, &bofmtab_update, sizeof ( bofmtab_update ) );
|
||||||
bofmrc = bofm ( virt_to_user ( &bofmtab_update ), pci );
|
bofmrc = bofm ( &bofmtab_update, pci );
|
||||||
printf ( "BOFMTEST update result %08x\n", bofmrc );
|
printf ( "BOFMTEST update result %08x\n", bofmrc );
|
||||||
if ( bofmtab_update.en.options & BOFM_EN_CSM_SUCCESS ) {
|
if ( bofmtab_update.en.options & BOFM_EN_CSM_SUCCESS ) {
|
||||||
printf ( "BOFMTEST updated MAC address to %s\n",
|
printf ( "BOFMTEST updated MAC address to %s\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user