diff options
Diffstat (limited to 'src/drivers/infiniband')
| -rw-r--r-- | src/drivers/infiniband/arbel.c | 6 | ||||
| -rw-r--r-- | src/drivers/infiniband/arbel.h | 5 | ||||
| -rw-r--r-- | src/drivers/infiniband/flexboot_nodnic.c | 1 | ||||
| -rwxr-xr-x | src/drivers/infiniband/golan.c | 16 | ||||
| -rwxr-xr-x | src/drivers/infiniband/golan.h | 6 | ||||
| -rw-r--r-- | src/drivers/infiniband/hermon.c | 6 | ||||
| -rw-r--r-- | src/drivers/infiniband/hermon.h | 5 | ||||
| -rw-r--r-- | src/drivers/infiniband/linda.c | 1 | ||||
| -rw-r--r-- | src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c | 4 | ||||
| -rw-r--r-- | src/drivers/infiniband/mlx_utils_flexboot/src/mlx_memory_priv.c | 1 | ||||
| -rw-r--r-- | src/drivers/infiniband/qib7322.c | 1 |
11 files changed, 27 insertions, 25 deletions
diff --git a/src/drivers/infiniband/arbel.c b/src/drivers/infiniband/arbel.c index 8be06d93d..0789ea593 100644 --- a/src/drivers/infiniband/arbel.c +++ b/src/drivers/infiniband/arbel.c @@ -2079,7 +2079,7 @@ static int arbel_start_firmware ( struct arbel *arbel ) { } else { assert ( arbel->firmware_len == fw_len ); } - fw_base = user_to_phys ( arbel->firmware_area, 0 ); + fw_base = virt_to_phys ( arbel->firmware_area ); DBGC ( arbel, "Arbel %p firmware area at [%08lx,%08lx)\n", arbel, fw_base, ( fw_base + fw_len ) ); if ( ( rc = arbel_map_vpm ( arbel, arbel_cmd_map_fa, @@ -2119,7 +2119,7 @@ static void arbel_stop_firmware ( struct arbel *arbel ) { DBGC ( arbel, "Arbel %p FATAL could not stop firmware: %s\n", arbel, strerror ( rc ) ); /* Leak memory and return; at least we avoid corruption */ - arbel->firmware_area = UNULL; + arbel->firmware_area = NULL; return; } } @@ -2452,7 +2452,7 @@ static int arbel_alloc_icm ( struct arbel *arbel, assert ( arbel->icm_len == icm_len ); assert ( arbel->icm_aux_len == icm_aux_len ); } - icm_phys = user_to_phys ( arbel->icm, 0 ); + icm_phys = virt_to_phys ( arbel->icm ); /* Allocate doorbell UAR */ arbel->db_rec = malloc_phys ( ARBEL_PAGE_SIZE, ARBEL_PAGE_SIZE ); diff --git a/src/drivers/infiniband/arbel.h b/src/drivers/infiniband/arbel.h index 8a5a996a3..a31e59934 100644 --- a/src/drivers/infiniband/arbel.h +++ b/src/drivers/infiniband/arbel.h @@ -10,7 +10,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <stdint.h> -#include <ipxe/uaccess.h> #include <ipxe/ib_packet.h> #include "mlx_bitops.h" #include "MT25218_PRM.h" @@ -492,7 +491,7 @@ struct arbel { * final teardown, in order to avoid memory map changes at * runtime. */ - userptr_t firmware_area; + void *firmware_area; /** ICM size */ size_t icm_len; /** ICM AUX size */ @@ -503,7 +502,7 @@ struct arbel { * final teardown, in order to avoid memory map changes at * runtime. */ - userptr_t icm; + void *icm; /** Offset within ICM of doorbell records */ size_t db_rec_offset; /** Doorbell records */ diff --git a/src/drivers/infiniband/flexboot_nodnic.c b/src/drivers/infiniband/flexboot_nodnic.c index c6e19b955..a9e6fdd71 100644 --- a/src/drivers/infiniband/flexboot_nodnic.c +++ b/src/drivers/infiniband/flexboot_nodnic.c @@ -20,6 +20,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <stdio.h> +#include <string.h> #include <unistd.h> #include <errno.h> #include <ipxe/pci.h> diff --git a/src/drivers/infiniband/golan.c b/src/drivers/infiniband/golan.c index 68a7c4f5d..ffa78fabf 100755 --- a/src/drivers/infiniband/golan.c +++ b/src/drivers/infiniband/golan.c @@ -52,7 +52,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); struct golan_page { struct list_head list; - userptr_t addr; + void *addr; }; 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++) { if ( 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++) - golan->fw_areas[i].area = UNULL; + golan->fw_areas[i].area = NULL; return rc; @@ -448,12 +448,12 @@ static inline int golan_provide_pages ( struct golan *golan , uint32_t pages int size_ibox = 0; int size_obox = 0; int rc = 0; - userptr_t next_page_addr = UNULL; + void *next_page_addr = NULL; DBGC(golan, "%s\n", __FUNCTION__); if ( ! fw_area->area ) { fw_area->area = umalloc ( GOLAN_PAGE_SIZE * pages ); - if ( fw_area->area == UNULL ) { + if ( fw_area->area == NULL ) { rc = -ENOMEM; DBGC (golan ,"Failed to allocated %d pages \n",pages); 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; struct golan_cmd_layout *cmd; struct golan_manage_pages_inbox *in; - userptr_t addr = 0; + void *addr = NULL; mailbox = GET_INBOX(golan, MEM_MBOX); size_ibox = sizeof(struct golan_manage_pages_inbox) + (pas_num * GOLAN_PAS_SIZE); @@ -486,8 +486,8 @@ static inline int golan_provide_pages ( struct golan *golan , uint32_t pages for ( i = 0 , j = MANAGE_PAGES_PSA_OFFSET; i < pas_num; ++i ,++j, next_page_addr += GOLAN_PAGE_SIZE ) { addr = next_page_addr; - if (GOLAN_PAGE_MASK & user_to_phys(addr, 0)) { - DBGC (golan ,"Addr not Page alligned [%lx %lx]\n", user_to_phys(addr, 0), addr); + if (GOLAN_PAGE_MASK & virt_to_phys(addr)) { + DBGC (golan ,"Addr not Page alligned [%lx]\n", virt_to_phys(addr)); } mailbox->mblock.data[j] = USR_2_BE64_BUS(addr); } diff --git a/src/drivers/infiniband/golan.h b/src/drivers/infiniband/golan.h index 2fd06ecf0..8122f8d38 100755 --- a/src/drivers/infiniband/golan.h +++ b/src/drivers/infiniband/golan.h @@ -69,8 +69,8 @@ FILE_LICENCE ( GPL2_OR_LATER ); #define VIRT_2_BE64_BUS( addr ) cpu_to_be64(((unsigned long long )virt_to_bus(addr))) #define BE64_BUS_2_VIRT( addr ) bus_to_virt(be64_to_cpu(addr)) -#define USR_2_BE64_BUS( addr ) cpu_to_be64(((unsigned long long )user_to_phys(addr, 0))) -#define BE64_BUS_2_USR( addr ) be64_to_cpu(phys_to_user(addr)) +#define USR_2_BE64_BUS( addr ) cpu_to_be64(((unsigned long long )virt_to_phys(addr))) +#define BE64_BUS_2_USR( addr ) be64_to_cpu(phys_to_virt(addr)) #define GET_INBOX(golan, idx) (&(((struct mbox *)(golan->mboxes.inbox))[idx])) #define GET_OUTBOX(golan, idx) (&(((struct mbox *)(golan->mboxes.outbox))[idx])) @@ -121,7 +121,7 @@ struct golan_firmware_area { * final teardown, in order to avoid memory map changes at * runtime. */ - userptr_t area; + void *area; }; /* Queue Pair */ #define GOLAN_SEND_WQE_BB_SIZE 64 diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c index e5c3544fa..d25f4f011 100644 --- a/src/drivers/infiniband/hermon.c +++ b/src/drivers/infiniband/hermon.c @@ -2382,7 +2382,7 @@ static int hermon_start_firmware ( struct hermon *hermon ) { } else { assert ( hermon->firmware_len == fw_len ); } - fw_base = user_to_phys ( hermon->firmware_area, 0 ); + fw_base = virt_to_phys ( hermon->firmware_area ); DBGC ( hermon, "Hermon %p firmware area at physical [%08lx,%08lx)\n", hermon, fw_base, ( fw_base + fw_len ) ); if ( ( rc = hermon_map_vpm ( hermon, hermon_cmd_map_fa, @@ -2422,7 +2422,7 @@ static void hermon_stop_firmware ( struct hermon *hermon ) { DBGC ( hermon, "Hermon %p FATAL could not stop firmware: %s\n", hermon, strerror ( rc ) ); /* Leak memory and return; at least we avoid corruption */ - hermon->firmware_area = UNULL; + hermon->firmware_area = NULL; return; } } @@ -2752,7 +2752,7 @@ static int hermon_map_icm ( struct hermon *hermon, assert ( hermon->icm_len == icm_len ); assert ( hermon->icm_aux_len == icm_aux_len ); } - icm_phys = user_to_phys ( hermon->icm, 0 ); + icm_phys = virt_to_phys ( hermon->icm ); /* Map ICM auxiliary area */ DBGC ( hermon, "Hermon %p mapping ICM AUX => %08lx\n", diff --git a/src/drivers/infiniband/hermon.h b/src/drivers/infiniband/hermon.h index a952bbd81..be79ff9d0 100644 --- a/src/drivers/infiniband/hermon.h +++ b/src/drivers/infiniband/hermon.h @@ -10,7 +10,6 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <stdint.h> -#include <ipxe/uaccess.h> #include <ipxe/ib_packet.h> #include <ipxe/bofm.h> #include <ipxe/nvsvpd.h> @@ -887,7 +886,7 @@ struct hermon { * final teardown, in order to avoid memory map changes at * runtime. */ - userptr_t firmware_area; + void *firmware_area; /** ICM map */ struct hermon_icm_map icm_map[HERMON_ICM_NUM_REGIONS]; /** ICM size */ @@ -900,7 +899,7 @@ struct hermon { * final teardown, in order to avoid memory map changes at * runtime. */ - userptr_t icm; + void *icm; /** Event queue */ struct hermon_event_queue eq; diff --git a/src/drivers/infiniband/linda.c b/src/drivers/infiniband/linda.c index 0c8a043a1..2e2b469e4 100644 --- a/src/drivers/infiniband/linda.c +++ b/src/drivers/infiniband/linda.c @@ -25,6 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <stdint.h> #include <stdlib.h> +#include <string.h> #include <errno.h> #include <unistd.h> #include <assert.h> diff --git a/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c b/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c index 30c1e644e..0b257ed22 100644 --- a/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c +++ b/src/drivers/infiniband/mlx_utils/src/public/mlx_pci_gw.c @@ -32,7 +32,7 @@ mlx_status mlx_pci_gw_check_capability_id( IN mlx_utils *utils, IN mlx_uint8 cap_pointer, - OUT mlx_boolean *bool + OUT mlx_boolean *result ) { mlx_status status = MLX_SUCCESS; @@ -41,7 +41,7 @@ mlx_pci_gw_check_capability_id( status = mlx_pci_read(utils, MlxPciWidthUint8, offset, 1, &id); MLX_CHECK_STATUS(utils, status, read_err,"failed to read capability id"); - *bool = ( id == PCI_GW_CAPABILITY_ID ); + *result = ( id == PCI_GW_CAPABILITY_ID ); read_err: return status; } diff --git a/src/drivers/infiniband/mlx_utils_flexboot/src/mlx_memory_priv.c b/src/drivers/infiniband/mlx_utils_flexboot/src/mlx_memory_priv.c index e368d459b..b35c30dee 100644 --- a/src/drivers/infiniband/mlx_utils_flexboot/src/mlx_memory_priv.c +++ b/src/drivers/infiniband/mlx_utils_flexboot/src/mlx_memory_priv.c @@ -7,6 +7,7 @@ #include <ipxe/malloc.h> #include <stddef.h> +#include <string.h> #include <byteswap.h> #include <ipxe/io.h> #include "../../mlx_utils/include/private/mlx_memory_priv.h" diff --git a/src/drivers/infiniband/qib7322.c b/src/drivers/infiniband/qib7322.c index a011dafc1..a9e4566dc 100644 --- a/src/drivers/infiniband/qib7322.c +++ b/src/drivers/infiniband/qib7322.c @@ -25,6 +25,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <stdint.h> #include <stdlib.h> +#include <string.h> #include <errno.h> #include <unistd.h> #include <assert.h> |
