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_mpipe.h"
0017 
0018 struct alloc_buffer_stacks_param {
0019     unsigned int count;
0020     unsigned int first;
0021     unsigned int flags;
0022 };
0023 
0024 int gxio_mpipe_alloc_buffer_stacks(gxio_mpipe_context_t *context,
0025                    unsigned int count, unsigned int first,
0026                    unsigned int flags)
0027 {
0028     struct alloc_buffer_stacks_param temp;
0029     struct alloc_buffer_stacks_param *params = &temp;
0030 
0031     params->count = count;
0032     params->first = first;
0033     params->flags = flags;
0034 
0035     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0036                  sizeof(*params),
0037                  GXIO_MPIPE_OP_ALLOC_BUFFER_STACKS);
0038 }
0039 
0040 EXPORT_SYMBOL(gxio_mpipe_alloc_buffer_stacks);
0041 
0042 struct init_buffer_stack_aux_param {
0043     union iorpc_mem_buffer buffer;
0044     unsigned int stack;
0045     unsigned int buffer_size_enum;
0046 };
0047 
0048 int gxio_mpipe_init_buffer_stack_aux(gxio_mpipe_context_t *context,
0049                      void *mem_va, size_t mem_size,
0050                      unsigned int mem_flags, unsigned int stack,
0051                      unsigned int buffer_size_enum)
0052 {
0053     int __result;
0054     unsigned long long __cpa;
0055     pte_t __pte;
0056     struct init_buffer_stack_aux_param temp;
0057     struct init_buffer_stack_aux_param *params = &temp;
0058 
0059     __result = va_to_cpa_and_pte(mem_va, &__cpa, &__pte);
0060     if (__result != 0)
0061         return __result;
0062     params->buffer.kernel.cpa = __cpa;
0063     params->buffer.kernel.size = mem_size;
0064     params->buffer.kernel.pte = __pte;
0065     params->buffer.kernel.flags = mem_flags;
0066     params->stack = stack;
0067     params->buffer_size_enum = buffer_size_enum;
0068 
0069     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0070                  sizeof(*params),
0071                  GXIO_MPIPE_OP_INIT_BUFFER_STACK_AUX);
0072 }
0073 
0074 EXPORT_SYMBOL(gxio_mpipe_init_buffer_stack_aux);
0075 
0076 
0077 struct alloc_notif_rings_param {
0078     unsigned int count;
0079     unsigned int first;
0080     unsigned int flags;
0081 };
0082 
0083 int gxio_mpipe_alloc_notif_rings(gxio_mpipe_context_t *context,
0084                  unsigned int count, unsigned int first,
0085                  unsigned int flags)
0086 {
0087     struct alloc_notif_rings_param temp;
0088     struct alloc_notif_rings_param *params = &temp;
0089 
0090     params->count = count;
0091     params->first = first;
0092     params->flags = flags;
0093 
0094     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0095                  sizeof(*params), GXIO_MPIPE_OP_ALLOC_NOTIF_RINGS);
0096 }
0097 
0098 EXPORT_SYMBOL(gxio_mpipe_alloc_notif_rings);
0099 
0100 struct init_notif_ring_aux_param {
0101     union iorpc_mem_buffer buffer;
0102     unsigned int ring;
0103 };
0104 
0105 int gxio_mpipe_init_notif_ring_aux(gxio_mpipe_context_t *context, void *mem_va,
0106                    size_t mem_size, unsigned int mem_flags,
0107                    unsigned int ring)
0108 {
0109     int __result;
0110     unsigned long long __cpa;
0111     pte_t __pte;
0112     struct init_notif_ring_aux_param temp;
0113     struct init_notif_ring_aux_param *params = &temp;
0114 
0115     __result = va_to_cpa_and_pte(mem_va, &__cpa, &__pte);
0116     if (__result != 0)
0117         return __result;
0118     params->buffer.kernel.cpa = __cpa;
0119     params->buffer.kernel.size = mem_size;
0120     params->buffer.kernel.pte = __pte;
0121     params->buffer.kernel.flags = mem_flags;
0122     params->ring = ring;
0123 
0124     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0125                  sizeof(*params),
0126                  GXIO_MPIPE_OP_INIT_NOTIF_RING_AUX);
0127 }
0128 
0129 EXPORT_SYMBOL(gxio_mpipe_init_notif_ring_aux);
0130 
0131 struct request_notif_ring_interrupt_param {
0132     union iorpc_interrupt interrupt;
0133     unsigned int ring;
0134 };
0135 
0136 int gxio_mpipe_request_notif_ring_interrupt(gxio_mpipe_context_t *context,
0137                         int inter_x, int inter_y,
0138                         int inter_ipi, int inter_event,
0139                         unsigned int ring)
0140 {
0141     struct request_notif_ring_interrupt_param temp;
0142     struct request_notif_ring_interrupt_param *params = &temp;
0143 
0144     params->interrupt.kernel.x = inter_x;
0145     params->interrupt.kernel.y = inter_y;
0146     params->interrupt.kernel.ipi = inter_ipi;
0147     params->interrupt.kernel.event = inter_event;
0148     params->ring = ring;
0149 
0150     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0151                  sizeof(*params),
0152                  GXIO_MPIPE_OP_REQUEST_NOTIF_RING_INTERRUPT);
0153 }
0154 
0155 EXPORT_SYMBOL(gxio_mpipe_request_notif_ring_interrupt);
0156 
0157 struct enable_notif_ring_interrupt_param {
0158     unsigned int ring;
0159 };
0160 
0161 int gxio_mpipe_enable_notif_ring_interrupt(gxio_mpipe_context_t *context,
0162                        unsigned int ring)
0163 {
0164     struct enable_notif_ring_interrupt_param temp;
0165     struct enable_notif_ring_interrupt_param *params = &temp;
0166 
0167     params->ring = ring;
0168 
0169     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0170                  sizeof(*params),
0171                  GXIO_MPIPE_OP_ENABLE_NOTIF_RING_INTERRUPT);
0172 }
0173 
0174 EXPORT_SYMBOL(gxio_mpipe_enable_notif_ring_interrupt);
0175 
0176 struct alloc_notif_groups_param {
0177     unsigned int count;
0178     unsigned int first;
0179     unsigned int flags;
0180 };
0181 
0182 int gxio_mpipe_alloc_notif_groups(gxio_mpipe_context_t *context,
0183                   unsigned int count, unsigned int first,
0184                   unsigned int flags)
0185 {
0186     struct alloc_notif_groups_param temp;
0187     struct alloc_notif_groups_param *params = &temp;
0188 
0189     params->count = count;
0190     params->first = first;
0191     params->flags = flags;
0192 
0193     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0194                  sizeof(*params), GXIO_MPIPE_OP_ALLOC_NOTIF_GROUPS);
0195 }
0196 
0197 EXPORT_SYMBOL(gxio_mpipe_alloc_notif_groups);
0198 
0199 struct init_notif_group_param {
0200     unsigned int group;
0201     gxio_mpipe_notif_group_bits_t bits;
0202 };
0203 
0204 int gxio_mpipe_init_notif_group(gxio_mpipe_context_t *context,
0205                 unsigned int group,
0206                 gxio_mpipe_notif_group_bits_t bits)
0207 {
0208     struct init_notif_group_param temp;
0209     struct init_notif_group_param *params = &temp;
0210 
0211     params->group = group;
0212     params->bits = bits;
0213 
0214     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0215                  sizeof(*params), GXIO_MPIPE_OP_INIT_NOTIF_GROUP);
0216 }
0217 
0218 EXPORT_SYMBOL(gxio_mpipe_init_notif_group);
0219 
0220 struct alloc_buckets_param {
0221     unsigned int count;
0222     unsigned int first;
0223     unsigned int flags;
0224 };
0225 
0226 int gxio_mpipe_alloc_buckets(gxio_mpipe_context_t *context, unsigned int count,
0227                  unsigned int first, unsigned int flags)
0228 {
0229     struct alloc_buckets_param temp;
0230     struct alloc_buckets_param *params = &temp;
0231 
0232     params->count = count;
0233     params->first = first;
0234     params->flags = flags;
0235 
0236     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0237                  sizeof(*params), GXIO_MPIPE_OP_ALLOC_BUCKETS);
0238 }
0239 
0240 EXPORT_SYMBOL(gxio_mpipe_alloc_buckets);
0241 
0242 struct init_bucket_param {
0243     unsigned int bucket;
0244     MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info;
0245 };
0246 
0247 int gxio_mpipe_init_bucket(gxio_mpipe_context_t *context, unsigned int bucket,
0248                MPIPE_LBL_INIT_DAT_BSTS_TBL_t bucket_info)
0249 {
0250     struct init_bucket_param temp;
0251     struct init_bucket_param *params = &temp;
0252 
0253     params->bucket = bucket;
0254     params->bucket_info = bucket_info;
0255 
0256     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0257                  sizeof(*params), GXIO_MPIPE_OP_INIT_BUCKET);
0258 }
0259 
0260 EXPORT_SYMBOL(gxio_mpipe_init_bucket);
0261 
0262 struct alloc_edma_rings_param {
0263     unsigned int count;
0264     unsigned int first;
0265     unsigned int flags;
0266 };
0267 
0268 int gxio_mpipe_alloc_edma_rings(gxio_mpipe_context_t *context,
0269                 unsigned int count, unsigned int first,
0270                 unsigned int flags)
0271 {
0272     struct alloc_edma_rings_param temp;
0273     struct alloc_edma_rings_param *params = &temp;
0274 
0275     params->count = count;
0276     params->first = first;
0277     params->flags = flags;
0278 
0279     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0280                  sizeof(*params), GXIO_MPIPE_OP_ALLOC_EDMA_RINGS);
0281 }
0282 
0283 EXPORT_SYMBOL(gxio_mpipe_alloc_edma_rings);
0284 
0285 struct init_edma_ring_aux_param {
0286     union iorpc_mem_buffer buffer;
0287     unsigned int ring;
0288     unsigned int channel;
0289 };
0290 
0291 int gxio_mpipe_init_edma_ring_aux(gxio_mpipe_context_t *context, void *mem_va,
0292                   size_t mem_size, unsigned int mem_flags,
0293                   unsigned int ring, unsigned int channel)
0294 {
0295     int __result;
0296     unsigned long long __cpa;
0297     pte_t __pte;
0298     struct init_edma_ring_aux_param temp;
0299     struct init_edma_ring_aux_param *params = &temp;
0300 
0301     __result = va_to_cpa_and_pte(mem_va, &__cpa, &__pte);
0302     if (__result != 0)
0303         return __result;
0304     params->buffer.kernel.cpa = __cpa;
0305     params->buffer.kernel.size = mem_size;
0306     params->buffer.kernel.pte = __pte;
0307     params->buffer.kernel.flags = mem_flags;
0308     params->ring = ring;
0309     params->channel = channel;
0310 
0311     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0312                  sizeof(*params), GXIO_MPIPE_OP_INIT_EDMA_RING_AUX);
0313 }
0314 
0315 EXPORT_SYMBOL(gxio_mpipe_init_edma_ring_aux);
0316 
0317 
0318 int gxio_mpipe_commit_rules(gxio_mpipe_context_t *context, const void *blob,
0319                 size_t blob_size)
0320 {
0321     const void *params = blob;
0322 
0323     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params, blob_size,
0324                  GXIO_MPIPE_OP_COMMIT_RULES);
0325 }
0326 
0327 EXPORT_SYMBOL(gxio_mpipe_commit_rules);
0328 
0329 struct register_client_memory_param {
0330     unsigned int iotlb;
0331     HV_PTE pte;
0332     unsigned int flags;
0333 };
0334 
0335 int gxio_mpipe_register_client_memory(gxio_mpipe_context_t *context,
0336                       unsigned int iotlb, HV_PTE pte,
0337                       unsigned int flags)
0338 {
0339     struct register_client_memory_param temp;
0340     struct register_client_memory_param *params = &temp;
0341 
0342     params->iotlb = iotlb;
0343     params->pte = pte;
0344     params->flags = flags;
0345 
0346     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0347                  sizeof(*params),
0348                  GXIO_MPIPE_OP_REGISTER_CLIENT_MEMORY);
0349 }
0350 
0351 EXPORT_SYMBOL(gxio_mpipe_register_client_memory);
0352 
0353 struct link_open_aux_param {
0354     _gxio_mpipe_link_name_t name;
0355     unsigned int flags;
0356 };
0357 
0358 int gxio_mpipe_link_open_aux(gxio_mpipe_context_t *context,
0359                  _gxio_mpipe_link_name_t name, unsigned int flags)
0360 {
0361     struct link_open_aux_param temp;
0362     struct link_open_aux_param *params = &temp;
0363 
0364     params->name = name;
0365     params->flags = flags;
0366 
0367     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0368                  sizeof(*params), GXIO_MPIPE_OP_LINK_OPEN_AUX);
0369 }
0370 
0371 EXPORT_SYMBOL(gxio_mpipe_link_open_aux);
0372 
0373 struct link_close_aux_param {
0374     int mac;
0375 };
0376 
0377 int gxio_mpipe_link_close_aux(gxio_mpipe_context_t *context, int mac)
0378 {
0379     struct link_close_aux_param temp;
0380     struct link_close_aux_param *params = &temp;
0381 
0382     params->mac = mac;
0383 
0384     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0385                  sizeof(*params), GXIO_MPIPE_OP_LINK_CLOSE_AUX);
0386 }
0387 
0388 EXPORT_SYMBOL(gxio_mpipe_link_close_aux);
0389 
0390 struct link_set_attr_aux_param {
0391     int mac;
0392     uint32_t attr;
0393     int64_t val;
0394 };
0395 
0396 int gxio_mpipe_link_set_attr_aux(gxio_mpipe_context_t *context, int mac,
0397                  uint32_t attr, int64_t val)
0398 {
0399     struct link_set_attr_aux_param temp;
0400     struct link_set_attr_aux_param *params = &temp;
0401 
0402     params->mac = mac;
0403     params->attr = attr;
0404     params->val = val;
0405 
0406     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0407                  sizeof(*params), GXIO_MPIPE_OP_LINK_SET_ATTR_AUX);
0408 }
0409 
0410 EXPORT_SYMBOL(gxio_mpipe_link_set_attr_aux);
0411 
0412 struct get_timestamp_aux_param {
0413     uint64_t sec;
0414     uint64_t nsec;
0415     uint64_t cycles;
0416 };
0417 
0418 int gxio_mpipe_get_timestamp_aux(gxio_mpipe_context_t *context, uint64_t *sec,
0419                  uint64_t *nsec, uint64_t *cycles)
0420 {
0421     int __result;
0422     struct get_timestamp_aux_param temp;
0423     struct get_timestamp_aux_param *params = &temp;
0424 
0425     __result =
0426         hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
0427              GXIO_MPIPE_OP_GET_TIMESTAMP_AUX);
0428     *sec = params->sec;
0429     *nsec = params->nsec;
0430     *cycles = params->cycles;
0431 
0432     return __result;
0433 }
0434 
0435 EXPORT_SYMBOL(gxio_mpipe_get_timestamp_aux);
0436 
0437 struct set_timestamp_aux_param {
0438     uint64_t sec;
0439     uint64_t nsec;
0440     uint64_t cycles;
0441 };
0442 
0443 int gxio_mpipe_set_timestamp_aux(gxio_mpipe_context_t *context, uint64_t sec,
0444                  uint64_t nsec, uint64_t cycles)
0445 {
0446     struct set_timestamp_aux_param temp;
0447     struct set_timestamp_aux_param *params = &temp;
0448 
0449     params->sec = sec;
0450     params->nsec = nsec;
0451     params->cycles = cycles;
0452 
0453     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0454                  sizeof(*params), GXIO_MPIPE_OP_SET_TIMESTAMP_AUX);
0455 }
0456 
0457 EXPORT_SYMBOL(gxio_mpipe_set_timestamp_aux);
0458 
0459 struct adjust_timestamp_aux_param {
0460     int64_t nsec;
0461 };
0462 
0463 int gxio_mpipe_adjust_timestamp_aux(gxio_mpipe_context_t *context, int64_t nsec)
0464 {
0465     struct adjust_timestamp_aux_param temp;
0466     struct adjust_timestamp_aux_param *params = &temp;
0467 
0468     params->nsec = nsec;
0469 
0470     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0471                  sizeof(*params),
0472                  GXIO_MPIPE_OP_ADJUST_TIMESTAMP_AUX);
0473 }
0474 
0475 EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_aux);
0476 
0477 struct config_edma_ring_blks_param {
0478     unsigned int ering;
0479     unsigned int max_blks;
0480     unsigned int min_snf_blks;
0481     unsigned int db;
0482 };
0483 
0484 int gxio_mpipe_config_edma_ring_blks(gxio_mpipe_context_t *context,
0485                      unsigned int ering, unsigned int max_blks,
0486                      unsigned int min_snf_blks, unsigned int db)
0487 {
0488     struct config_edma_ring_blks_param temp;
0489     struct config_edma_ring_blks_param *params = &temp;
0490 
0491     params->ering = ering;
0492     params->max_blks = max_blks;
0493     params->min_snf_blks = min_snf_blks;
0494     params->db = db;
0495 
0496     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0497                  sizeof(*params),
0498                  GXIO_MPIPE_OP_CONFIG_EDMA_RING_BLKS);
0499 }
0500 
0501 EXPORT_SYMBOL(gxio_mpipe_config_edma_ring_blks);
0502 
0503 struct adjust_timestamp_freq_param {
0504     int32_t ppb;
0505 };
0506 
0507 int gxio_mpipe_adjust_timestamp_freq(gxio_mpipe_context_t *context, int32_t ppb)
0508 {
0509     struct adjust_timestamp_freq_param temp;
0510     struct adjust_timestamp_freq_param *params = &temp;
0511 
0512     params->ppb = ppb;
0513 
0514     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0515                  sizeof(*params),
0516                  GXIO_MPIPE_OP_ADJUST_TIMESTAMP_FREQ);
0517 }
0518 
0519 EXPORT_SYMBOL(gxio_mpipe_adjust_timestamp_freq);
0520 
0521 struct arm_pollfd_param {
0522     union iorpc_pollfd pollfd;
0523 };
0524 
0525 int gxio_mpipe_arm_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie)
0526 {
0527     struct arm_pollfd_param temp;
0528     struct arm_pollfd_param *params = &temp;
0529 
0530     params->pollfd.kernel.cookie = pollfd_cookie;
0531 
0532     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0533                  sizeof(*params), GXIO_MPIPE_OP_ARM_POLLFD);
0534 }
0535 
0536 EXPORT_SYMBOL(gxio_mpipe_arm_pollfd);
0537 
0538 struct close_pollfd_param {
0539     union iorpc_pollfd pollfd;
0540 };
0541 
0542 int gxio_mpipe_close_pollfd(gxio_mpipe_context_t *context, int pollfd_cookie)
0543 {
0544     struct close_pollfd_param temp;
0545     struct close_pollfd_param *params = &temp;
0546 
0547     params->pollfd.kernel.cookie = pollfd_cookie;
0548 
0549     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0550                  sizeof(*params), GXIO_MPIPE_OP_CLOSE_POLLFD);
0551 }
0552 
0553 EXPORT_SYMBOL(gxio_mpipe_close_pollfd);
0554 
0555 struct get_mmio_base_param {
0556     HV_PTE base;
0557 };
0558 
0559 int gxio_mpipe_get_mmio_base(gxio_mpipe_context_t *context, HV_PTE *base)
0560 {
0561     int __result;
0562     struct get_mmio_base_param temp;
0563     struct get_mmio_base_param *params = &temp;
0564 
0565     __result =
0566         hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
0567              GXIO_MPIPE_OP_GET_MMIO_BASE);
0568     *base = params->base;
0569 
0570     return __result;
0571 }
0572 
0573 EXPORT_SYMBOL(gxio_mpipe_get_mmio_base);
0574 
0575 struct check_mmio_offset_param {
0576     unsigned long offset;
0577     unsigned long size;
0578 };
0579 
0580 int gxio_mpipe_check_mmio_offset(gxio_mpipe_context_t *context,
0581                  unsigned long offset, unsigned long size)
0582 {
0583     struct check_mmio_offset_param temp;
0584     struct check_mmio_offset_param *params = &temp;
0585 
0586     params->offset = offset;
0587     params->size = size;
0588 
0589     return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
0590                  sizeof(*params), GXIO_MPIPE_OP_CHECK_MMIO_OFFSET);
0591 }
0592 
0593 EXPORT_SYMBOL(gxio_mpipe_check_mmio_offset);