Back to home page

LXR

 
 

    


0001 /*
0002  * Copyright 2012 Tilera Corporation. All Rights Reserved.
0003  *
0004  *   This program is free software; you can redistribute it and/or
0005  *   modify it under the terms of the GNU General Public License
0006  *   as published by the Free Software Foundation, version 2.
0007  *
0008  *   This program is distributed in the hope that it will be useful, but
0009  *   WITHOUT ANY WARRANTY; without even the implied warranty of
0010  *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
0011  *   NON INFRINGEMENT.  See the GNU General Public License for
0012  *   more details.
0013  */
0014 
0015 /* This file is machine-generated; DO NOT EDIT! */
0016 #include "gxio/iorpc_trio.h"
0017 
0018 struct alloc_asids_param {
0019     unsigned int count;
0020     unsigned int first;
0021     unsigned int flags;
0022 };
0023 
0024 int gxio_trio_alloc_asids(gxio_trio_context_t *context, unsigned int count,
0025               unsigned int first, unsigned int flags)
0026 {
0027     struct alloc_asids_param temp;
0028     struct alloc_asids_param *params = &temp;
0029 
0030     params->count = count;
0031     params->first = first;
0032     params->flags = flags;
0033 
0034     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0035                  sizeof(*params), GXIO_TRIO_OP_ALLOC_ASIDS);
0036 }
0037 
0038 EXPORT_SYMBOL(gxio_trio_alloc_asids);
0039 
0040 
0041 struct alloc_memory_maps_param {
0042     unsigned int count;
0043     unsigned int first;
0044     unsigned int flags;
0045 };
0046 
0047 int gxio_trio_alloc_memory_maps(gxio_trio_context_t *context,
0048                 unsigned int count, unsigned int first,
0049                 unsigned int flags)
0050 {
0051     struct alloc_memory_maps_param temp;
0052     struct alloc_memory_maps_param *params = &temp;
0053 
0054     params->count = count;
0055     params->first = first;
0056     params->flags = flags;
0057 
0058     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0059                  sizeof(*params), GXIO_TRIO_OP_ALLOC_MEMORY_MAPS);
0060 }
0061 
0062 EXPORT_SYMBOL(gxio_trio_alloc_memory_maps);
0063 
0064 struct alloc_scatter_queues_param {
0065     unsigned int count;
0066     unsigned int first;
0067     unsigned int flags;
0068 };
0069 
0070 int gxio_trio_alloc_scatter_queues(gxio_trio_context_t *context,
0071                    unsigned int count, unsigned int first,
0072                    unsigned int flags)
0073 {
0074     struct alloc_scatter_queues_param temp;
0075     struct alloc_scatter_queues_param *params = &temp;
0076 
0077     params->count = count;
0078     params->first = first;
0079     params->flags = flags;
0080 
0081     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0082                  sizeof(*params),
0083                  GXIO_TRIO_OP_ALLOC_SCATTER_QUEUES);
0084 }
0085 
0086 EXPORT_SYMBOL(gxio_trio_alloc_scatter_queues);
0087 
0088 struct alloc_pio_regions_param {
0089     unsigned int count;
0090     unsigned int first;
0091     unsigned int flags;
0092 };
0093 
0094 int gxio_trio_alloc_pio_regions(gxio_trio_context_t *context,
0095                 unsigned int count, unsigned int first,
0096                 unsigned int flags)
0097 {
0098     struct alloc_pio_regions_param temp;
0099     struct alloc_pio_regions_param *params = &temp;
0100 
0101     params->count = count;
0102     params->first = first;
0103     params->flags = flags;
0104 
0105     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0106                  sizeof(*params), GXIO_TRIO_OP_ALLOC_PIO_REGIONS);
0107 }
0108 
0109 EXPORT_SYMBOL(gxio_trio_alloc_pio_regions);
0110 
0111 struct init_pio_region_aux_param {
0112     unsigned int pio_region;
0113     unsigned int mac;
0114     uint32_t bus_address_hi;
0115     unsigned int flags;
0116 };
0117 
0118 int gxio_trio_init_pio_region_aux(gxio_trio_context_t *context,
0119                   unsigned int pio_region, unsigned int mac,
0120                   uint32_t bus_address_hi, unsigned int flags)
0121 {
0122     struct init_pio_region_aux_param temp;
0123     struct init_pio_region_aux_param *params = &temp;
0124 
0125     params->pio_region = pio_region;
0126     params->mac = mac;
0127     params->bus_address_hi = bus_address_hi;
0128     params->flags = flags;
0129 
0130     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0131                  sizeof(*params), GXIO_TRIO_OP_INIT_PIO_REGION_AUX);
0132 }
0133 
0134 EXPORT_SYMBOL(gxio_trio_init_pio_region_aux);
0135 
0136 
0137 struct init_memory_map_mmu_aux_param {
0138     unsigned int map;
0139     unsigned long va;
0140     uint64_t size;
0141     unsigned int asid;
0142     unsigned int mac;
0143     uint64_t bus_address;
0144     unsigned int node;
0145     unsigned int order_mode;
0146 };
0147 
0148 int gxio_trio_init_memory_map_mmu_aux(gxio_trio_context_t *context,
0149                       unsigned int map, unsigned long va,
0150                       uint64_t size, unsigned int asid,
0151                       unsigned int mac, uint64_t bus_address,
0152                       unsigned int node,
0153                       unsigned int order_mode)
0154 {
0155     struct init_memory_map_mmu_aux_param temp;
0156     struct init_memory_map_mmu_aux_param *params = &temp;
0157 
0158     params->map = map;
0159     params->va = va;
0160     params->size = size;
0161     params->asid = asid;
0162     params->mac = mac;
0163     params->bus_address = bus_address;
0164     params->node = node;
0165     params->order_mode = order_mode;
0166 
0167     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0168                  sizeof(*params),
0169                  GXIO_TRIO_OP_INIT_MEMORY_MAP_MMU_AUX);
0170 }
0171 
0172 EXPORT_SYMBOL(gxio_trio_init_memory_map_mmu_aux);
0173 
0174 struct get_port_property_param {
0175     struct pcie_trio_ports_property trio_ports;
0176 };
0177 
0178 int gxio_trio_get_port_property(gxio_trio_context_t *context,
0179                 struct pcie_trio_ports_property *trio_ports)
0180 {
0181     int __result;
0182     struct get_port_property_param temp;
0183     struct get_port_property_param *params = &temp;
0184 
0185     __result =
0186         hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
0187              GXIO_TRIO_OP_GET_PORT_PROPERTY);
0188     *trio_ports = params->trio_ports;
0189 
0190     return __result;
0191 }
0192 
0193 EXPORT_SYMBOL(gxio_trio_get_port_property);
0194 
0195 struct config_legacy_intr_param {
0196     union iorpc_interrupt interrupt;
0197     unsigned int mac;
0198     unsigned int intx;
0199 };
0200 
0201 int gxio_trio_config_legacy_intr(gxio_trio_context_t *context, int inter_x,
0202                  int inter_y, int inter_ipi, int inter_event,
0203                  unsigned int mac, unsigned int intx)
0204 {
0205     struct config_legacy_intr_param temp;
0206     struct config_legacy_intr_param *params = &temp;
0207 
0208     params->interrupt.kernel.x = inter_x;
0209     params->interrupt.kernel.y = inter_y;
0210     params->interrupt.kernel.ipi = inter_ipi;
0211     params->interrupt.kernel.event = inter_event;
0212     params->mac = mac;
0213     params->intx = intx;
0214 
0215     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0216                  sizeof(*params), GXIO_TRIO_OP_CONFIG_LEGACY_INTR);
0217 }
0218 
0219 EXPORT_SYMBOL(gxio_trio_config_legacy_intr);
0220 
0221 struct config_msi_intr_param {
0222     union iorpc_interrupt interrupt;
0223     unsigned int mac;
0224     unsigned int mem_map;
0225     uint64_t mem_map_base;
0226     uint64_t mem_map_limit;
0227     unsigned int asid;
0228 };
0229 
0230 int gxio_trio_config_msi_intr(gxio_trio_context_t *context, int inter_x,
0231                   int inter_y, int inter_ipi, int inter_event,
0232                   unsigned int mac, unsigned int mem_map,
0233                   uint64_t mem_map_base, uint64_t mem_map_limit,
0234                   unsigned int asid)
0235 {
0236     struct config_msi_intr_param temp;
0237     struct config_msi_intr_param *params = &temp;
0238 
0239     params->interrupt.kernel.x = inter_x;
0240     params->interrupt.kernel.y = inter_y;
0241     params->interrupt.kernel.ipi = inter_ipi;
0242     params->interrupt.kernel.event = inter_event;
0243     params->mac = mac;
0244     params->mem_map = mem_map;
0245     params->mem_map_base = mem_map_base;
0246     params->mem_map_limit = mem_map_limit;
0247     params->asid = asid;
0248 
0249     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0250                  sizeof(*params), GXIO_TRIO_OP_CONFIG_MSI_INTR);
0251 }
0252 
0253 EXPORT_SYMBOL(gxio_trio_config_msi_intr);
0254 
0255 
0256 struct set_mps_mrs_param {
0257     uint16_t mps;
0258     uint16_t mrs;
0259     unsigned int mac;
0260 };
0261 
0262 int gxio_trio_set_mps_mrs(gxio_trio_context_t *context, uint16_t mps,
0263               uint16_t mrs, unsigned int mac)
0264 {
0265     struct set_mps_mrs_param temp;
0266     struct set_mps_mrs_param *params = &temp;
0267 
0268     params->mps = mps;
0269     params->mrs = mrs;
0270     params->mac = mac;
0271 
0272     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0273                  sizeof(*params), GXIO_TRIO_OP_SET_MPS_MRS);
0274 }
0275 
0276 EXPORT_SYMBOL(gxio_trio_set_mps_mrs);
0277 
0278 struct force_rc_link_up_param {
0279     unsigned int mac;
0280 };
0281 
0282 int gxio_trio_force_rc_link_up(gxio_trio_context_t *context, unsigned int mac)
0283 {
0284     struct force_rc_link_up_param temp;
0285     struct force_rc_link_up_param *params = &temp;
0286 
0287     params->mac = mac;
0288 
0289     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0290                  sizeof(*params), GXIO_TRIO_OP_FORCE_RC_LINK_UP);
0291 }
0292 
0293 EXPORT_SYMBOL(gxio_trio_force_rc_link_up);
0294 
0295 struct force_ep_link_up_param {
0296     unsigned int mac;
0297 };
0298 
0299 int gxio_trio_force_ep_link_up(gxio_trio_context_t *context, unsigned int mac)
0300 {
0301     struct force_ep_link_up_param temp;
0302     struct force_ep_link_up_param *params = &temp;
0303 
0304     params->mac = mac;
0305 
0306     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0307                  sizeof(*params), GXIO_TRIO_OP_FORCE_EP_LINK_UP);
0308 }
0309 
0310 EXPORT_SYMBOL(gxio_trio_force_ep_link_up);
0311 
0312 struct get_mmio_base_param {
0313     HV_PTE base;
0314 };
0315 
0316 int gxio_trio_get_mmio_base(gxio_trio_context_t *context, HV_PTE *base)
0317 {
0318     int __result;
0319     struct get_mmio_base_param temp;
0320     struct get_mmio_base_param *params = &temp;
0321 
0322     __result =
0323         hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
0324              GXIO_TRIO_OP_GET_MMIO_BASE);
0325     *base = params->base;
0326 
0327     return __result;
0328 }
0329 
0330 EXPORT_SYMBOL(gxio_trio_get_mmio_base);
0331 
0332 struct check_mmio_offset_param {
0333     unsigned long offset;
0334     unsigned long size;
0335 };
0336 
0337 int gxio_trio_check_mmio_offset(gxio_trio_context_t *context,
0338                 unsigned long offset, unsigned long size)
0339 {
0340     struct check_mmio_offset_param temp;
0341     struct check_mmio_offset_param *params = &temp;
0342 
0343     params->offset = offset;
0344     params->size = size;
0345 
0346     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0347                  sizeof(*params), GXIO_TRIO_OP_CHECK_MMIO_OFFSET);
0348 }
0349 
0350 EXPORT_SYMBOL(gxio_trio_check_mmio_offset);