OpenNSL API Guide and Reference Manual
rx.h
Go to the documentation of this file.
1 
4 /*****************************************************************************
5  *
6  * (C) Copyright Broadcom Corporation 2013-2016
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  *
11  * You may obtain a copy of the License at
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  ***************************************************************************/
24 #ifndef __OPENNSL_RX_H__
25 #define __OPENNSL_RX_H__
26 
27 #include <opennsl/types.h>
28 #include <opennsl/pkt.h>
29 #include <opennsl/tx.h>
30 #include <opennsl/mirror.h>
31 
32 #define OPENNSL_RX_CHANNELS 4
33 #define OPENNSL_CMICX_RX_CHANNELS 8
35 #define OPENNSL_RCO_F_COS_ACCEPT(cos) (1 << (cos))
36 #define OPENNSL_RCO_F_ALL_COS 0x40000000
37 
38 typedef enum opennsl_rx_e {
43 } opennsl_rx_t;
44 /* __doxy_func_body_end__ */
45 
47  int unit,
48  opennsl_pkt_t *pkt,
49  void *cookie);
50 
51 typedef int (*opennsl_rx_alloc_f)(
52  int reserved1,
53  int reserved2,
54  uint32 reserved3,
55  void **reserved4);
56 
57 typedef int (*opennsl_rx_free_f)(
58  int reserved1,
59  void *reserved2);
60 
75 typedef struct opennsl_rx_chan_cfg_s {
76  int chains;
77  int rate_pps;
78  int flags;
81 /* __doxy_func_body_end__ */
82 
84 typedef struct opennsl_rx_cfg_s {
85  int pkt_size;
87  int global_pps;
89  int max_burst;
98  int *cpu_address;
101 /* __doxy_func_body_end__ */
102 
103 #define OPENNSL_RX_REASON_NAMES_INITIALIZER _SHR_RX_REASON_NAMES_INITIALIZER
104 
110 typedef enum opennsl_rx_reason_e {
310 /* __doxy_func_body_end__ */
311 
312 #if defined(VENDOR_BROADCOM)
313 #endif
314 #define OPENNSL_RX_REASON_GET(_reasons, _reason) \
315  _SHR_RX_REASON_GET(_reasons, _reason)
316 #define OPENNSL_RX_REASON_SET(_reasons, _reason) \
317  _SHR_RX_REASON_SET(_reasons, _reason)
318 #define OPENNSL_RX_REASON_CLEAR_ALL(_reasons) \
319  _SHR_RX_REASON_CLEAR_ALL(_reasons)
320 #ifndef OPENNSL_HIDE_DISPATCHABLE
321 
322 /***************************************************************************/
337 extern int opennsl_rx_cfg_init(
338  int unit) LIB_DLL_EXPORTED ;
339 
340 /***************************************************************************/
358 extern int opennsl_rx_start(
359  int unit,
361 
362 /***************************************************************************/
378 extern int opennsl_rx_stop(
379  int unit,
381 
382 /***************************************************************************/
399 extern int opennsl_rx_cfg_get(
400  int unit,
402 
403 /***************************************************************************/
412 extern int opennsl_rx_active(
413  int unit) LIB_DLL_EXPORTED ;
414 
415 /***************************************************************************/
425 extern int opennsl_rx_queue_max_get(
426  int unit,
428 
429 /***************************************************************************/
461 extern int opennsl_rx_register(
462  int unit,
463  const char *name,
464  opennsl_rx_cb_f callback,
465  uint8 priority,
466  void *cookie,
467  uint32 flags) LIB_DLL_EXPORTED ;
468 
469 /***************************************************************************/
498 extern int opennsl_rx_unregister(
499  int unit,
500  opennsl_rx_cb_f callback,
501  uint8 priority) LIB_DLL_EXPORTED ;
502 
503 #endif /* OPENNSL_HIDE_DISPATCHABLE */
504 
505 #ifndef OPENNSL_HIDE_DISPATCHABLE
506 
507 /***************************************************************************/
523 extern int opennsl_rx_reasons_get(
524  int unit,
526 
527 /***************************************************************************/
542 extern int opennsl_rx_free(
543  int unit,
544  void *pkt_data) LIB_DLL_EXPORTED ;
545 
546 #endif /* OPENNSL_HIDE_DISPATCHABLE */
547 
548 /***************************************************************************/
564 extern void opennsl_rx_cfg_t_init(
566 
567 #if defined(OPENNSL_RPC_SUPPORT) || defined(OPENNSL_RCPU_SUPPORT)
568 #endif
569 typedef enum opennsl_rx_control_e {
572 /* __doxy_func_body_end__ */
573 
574 #ifndef OPENNSL_HIDE_DISPATCHABLE
575 
576 /***************************************************************************/
594 extern int opennsl_rx_control_get(
595  int unit,
596  opennsl_rx_control_t type,
597  int *arg) LIB_DLL_EXPORTED ;
598 
599 /***************************************************************************/
617 extern int opennsl_rx_control_set(
618  int unit,
619  opennsl_rx_control_t type,
620  int arg) LIB_DLL_EXPORTED ;
621 
622 #endif /* OPENNSL_HIDE_DISPATCHABLE */
623 
624 #ifndef OPENNSL_HIDE_DISPATCHABLE
625 
626 #endif /* OPENNSL_HIDE_DISPATCHABLE */
627 
628 #include <opennsl/rxX.h>
629 #endif /* __OPENNSL_RX_H__ */
630