Chris Metcalf | 4875f69 | 2012-04-06 16:38:03 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 Tilera Corporation. All Rights Reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation, version 2. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, but |
| 9 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or |
| 11 | * NON INFRINGEMENT. See the GNU General Public License for |
| 12 | * more details. |
| 13 | */ |
| 14 | |
| 15 | /* This file is machine-generated; DO NOT EDIT! */ |
| 16 | #include "gxio/iorpc_mpipe_info.h" |
| 17 | |
Chris Metcalf | f3286a3 | 2013-08-01 11:36:42 -0400 | [diff] [blame] | 18 | struct instance_aux_param { |
| 19 | _gxio_mpipe_link_name_t name; |
| 20 | }; |
| 21 | |
Chris Metcalf | 126eb08 | 2013-09-16 13:52:45 -0400 | [diff] [blame] | 22 | int gxio_mpipe_info_instance_aux(gxio_mpipe_info_context_t *context, |
Chris Metcalf | f3286a3 | 2013-08-01 11:36:42 -0400 | [diff] [blame] | 23 | _gxio_mpipe_link_name_t name) |
| 24 | { |
| 25 | struct instance_aux_param temp; |
| 26 | struct instance_aux_param *params = &temp; |
| 27 | |
| 28 | params->name = name; |
| 29 | |
| 30 | return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params, |
| 31 | sizeof(*params), GXIO_MPIPE_INFO_OP_INSTANCE_AUX); |
| 32 | } |
| 33 | |
| 34 | EXPORT_SYMBOL(gxio_mpipe_info_instance_aux); |
| 35 | |
Chris Metcalf | 4875f69 | 2012-04-06 16:38:03 -0400 | [diff] [blame] | 36 | struct enumerate_aux_param { |
| 37 | _gxio_mpipe_link_name_t name; |
| 38 | _gxio_mpipe_link_mac_t mac; |
| 39 | }; |
| 40 | |
Chris Metcalf | 126eb08 | 2013-09-16 13:52:45 -0400 | [diff] [blame] | 41 | int gxio_mpipe_info_enumerate_aux(gxio_mpipe_info_context_t *context, |
Chris Metcalf | 4875f69 | 2012-04-06 16:38:03 -0400 | [diff] [blame] | 42 | unsigned int idx, |
Chris Metcalf | 126eb08 | 2013-09-16 13:52:45 -0400 | [diff] [blame] | 43 | _gxio_mpipe_link_name_t *name, |
| 44 | _gxio_mpipe_link_mac_t *mac) |
Chris Metcalf | 4875f69 | 2012-04-06 16:38:03 -0400 | [diff] [blame] | 45 | { |
| 46 | int __result; |
| 47 | struct enumerate_aux_param temp; |
| 48 | struct enumerate_aux_param *params = &temp; |
| 49 | |
| 50 | __result = |
| 51 | hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params), |
Chris Metcalf | 126eb08 | 2013-09-16 13:52:45 -0400 | [diff] [blame] | 52 | (((uint64_t)idx << 32) | |
Chris Metcalf | 4875f69 | 2012-04-06 16:38:03 -0400 | [diff] [blame] | 53 | GXIO_MPIPE_INFO_OP_ENUMERATE_AUX)); |
| 54 | *name = params->name; |
| 55 | *mac = params->mac; |
| 56 | |
| 57 | return __result; |
| 58 | } |
| 59 | |
| 60 | EXPORT_SYMBOL(gxio_mpipe_info_enumerate_aux); |
| 61 | |
| 62 | struct get_mmio_base_param { |
| 63 | HV_PTE base; |
| 64 | }; |
| 65 | |
Chris Metcalf | 126eb08 | 2013-09-16 13:52:45 -0400 | [diff] [blame] | 66 | int gxio_mpipe_info_get_mmio_base(gxio_mpipe_info_context_t *context, |
Chris Metcalf | 4875f69 | 2012-04-06 16:38:03 -0400 | [diff] [blame] | 67 | HV_PTE *base) |
| 68 | { |
| 69 | int __result; |
| 70 | struct get_mmio_base_param temp; |
| 71 | struct get_mmio_base_param *params = &temp; |
| 72 | |
| 73 | __result = |
| 74 | hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params), |
| 75 | GXIO_MPIPE_INFO_OP_GET_MMIO_BASE); |
| 76 | *base = params->base; |
| 77 | |
| 78 | return __result; |
| 79 | } |
| 80 | |
| 81 | EXPORT_SYMBOL(gxio_mpipe_info_get_mmio_base); |
| 82 | |
| 83 | struct check_mmio_offset_param { |
| 84 | unsigned long offset; |
| 85 | unsigned long size; |
| 86 | }; |
| 87 | |
Chris Metcalf | 126eb08 | 2013-09-16 13:52:45 -0400 | [diff] [blame] | 88 | int gxio_mpipe_info_check_mmio_offset(gxio_mpipe_info_context_t *context, |
Chris Metcalf | 4875f69 | 2012-04-06 16:38:03 -0400 | [diff] [blame] | 89 | unsigned long offset, unsigned long size) |
| 90 | { |
| 91 | struct check_mmio_offset_param temp; |
| 92 | struct check_mmio_offset_param *params = &temp; |
| 93 | |
| 94 | params->offset = offset; |
| 95 | params->size = size; |
| 96 | |
| 97 | return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params, |
| 98 | sizeof(*params), |
| 99 | GXIO_MPIPE_INFO_OP_CHECK_MMIO_OFFSET); |
| 100 | } |
| 101 | |
| 102 | EXPORT_SYMBOL(gxio_mpipe_info_check_mmio_offset); |