openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

pktio.h (2613B)


      1 
      2 /*! \file pktio.h
      3  *
      4  * esw pktio module internal header file.
      5  * Include structure definitions and function declarations used by other modules.
      6  */
      7 /*
      8  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      9  * 
     10  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
     11  */
     12 #ifndef BCMI_ESW_PKTIO_H
     13 #define BCMI_ESW_PKTIO_H
     14 
     15 #ifdef INCLUDE_PKTIO
     16 
     17 extern int
     18 bcmi_esw_pktio_alloc(
     19     int unit,
     20     uint32 max_size,
     21     uint32 flags,
     22     bcm_pktio_pkt_t **packet);
     23 
     24 extern int
     25 bcmi_esw_pktio_claim(
     26     int unit,
     27     bcm_pktio_pkt_t *pkt,
     28     bcm_pktio_pkt_t **new_pkt);
     29 
     30 extern int
     31 bcmi_esw_pktio_cleanup(
     32     int unit);
     33 
     34 extern int
     35 bcmi_esw_pktio_free(
     36     int unit,
     37     bcm_pktio_pkt_t *packet);
     38 
     39 extern int
     40 bcmi_esw_pktio_init(
     41     int unit);
     42 
     43 extern int
     44 bcmi_esw_pktio_pkt_data_get(
     45     int unit,
     46     bcm_pktio_pkt_t *packet,
     47     void **data,
     48     uint32 *length);
     49 
     50 extern int
     51 bcmi_esw_pktio_pmd_fid_support_get(
     52     int unit,
     53     bcm_pktio_fid_support_t *support);
     54 
     55 extern int
     56 bcmi_esw_pktio_pmd_field_get(
     57     int unit,
     58     bcm_pktio_pkt_t *packet,
     59     bcm_pktio_pmd_type_t type,
     60     int fid,
     61     uint32 *val);
     62 
     63 extern int
     64 bcmi_esw_pktio_pmd_field_set(
     65     int unit,
     66     bcm_pktio_pkt_t *packet,
     67     bcm_pktio_pmd_type_t type,
     68     int fid,
     69     uint32 val);
     70 
     71 extern int
     72 bcmi_esw_pktio_pmd_reasons_get(
     73     int unit,
     74     bcm_pktio_pkt_t *packet,
     75     bcm_pktio_reasons_t *reasons);
     76 
     77 extern int
     78 bcmi_esw_pktio_pmd_set(
     79     int unit,
     80     bcm_pktio_pkt_t *packet,
     81     bcm_pktio_pmd_t *txpmd);
     82 
     83 extern int
     84 bcmi_esw_pktio_pull(
     85     int unit,
     86     bcm_pktio_pkt_t *packet,
     87     uint32 len,
     88     uint8 **data);
     89 
     90 extern int
     91 bcmi_esw_pktio_push(
     92     int unit,
     93     bcm_pktio_pkt_t *packet,
     94     uint32 len,
     95     uint8 **data);
     96 
     97 extern int
     98 bcmi_esw_pktio_put(
     99     int unit,
    100     bcm_pktio_pkt_t *packet,
    101     uint32 len,
    102     uint8 **data);
    103 
    104 extern int
    105 bcmi_esw_pktio_reserve(
    106     int unit,
    107     bcm_pktio_pkt_t *packet,
    108     uint32 len,
    109     uint8 **data);
    110 
    111 extern int
    112 bcmi_esw_pktio_rx_register(
    113     int unit,
    114     const char *name,
    115     bcm_pktio_rx_cb_f callback,
    116     uint8 priority,
    117     void *cookie,
    118     uint32 flags);
    119 
    120 extern int
    121 bcmi_esw_pktio_rx_unregister(
    122     int unit,
    123     bcm_pktio_rx_cb_f callback,
    124     uint8 priority);
    125 
    126 extern int
    127 bcmi_esw_pktio_trim(
    128     int unit,
    129     bcm_pktio_pkt_t *packet,
    130     uint32 len);
    131 
    132 extern int
    133 bcmi_esw_pktio_tx(
    134     int unit,
    135     bcm_pktio_pkt_t *packet);
    136 
    137 extern int
    138 bcmi_esw_pktio_rx_dump(
    139     int unit,
    140     bcm_pktio_pkt_t *packet,
    141     int flags);
    142 
    143 #endif /* INCLUDE_PKTIO */
    144 #endif /* BCMI_ESW_PKTIO_H */