example.c (1816B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * File: example.c 8 * Purpose: To provide an example on how to add customer-specific APIs 9 * by placing addtional code in the files in src/customer 10 * directory 11 */ 12 13 /* 14 * Here are the typical include files that might be needed 15 */ 16 17 /* 18 * Asserts really help making the code more robust and easy to debug 19 */ 20 #include <assert.h> 21 22 /* 23 * SAL makes it portable across many platforms. For the driver "add-ons" only 24 * the Core SAL is needed. 25 */ 26 #include <sal/core/libc.h> 27 28 /* 29 * If you plan to add some code to BCM shell or another high-level application 30 * you might need to use the Applications SAL 31 */ 32 #include <sal/appl/io.h> 33 #include <sal/appl/pci.h> 34 35 /* 36 * If you plan to access chips at the low-level, you might need to include 37 * the SOC API declarations. This, however might make your code incompatible 38 * with the future versions of BCM API 39 */ 40 #include <soc/register.h> 41 #include <soc/mem.h> 42 #include <soc/drv.h> 43 44 /* 45 * The best way to go is to add code written on top of the BCM API -- the 46 * best API you can find, anyways! 47 */ 48 #include <bcm/port.h> 49 #include <bcm/vlan.h> 50 #include <bcm/error.h> 51 #include <bcm/link.h> 52 53 /* 54 * And don't forget that you can place your own header files in the 55 * include/customer directory 56 */ 57 #include <customer/example.h> 58 59 /***************************************************************************/ 60 61 /* 62 * Function: example_bcm_ok 63 * Purpose: A placeholder 64 * Parameters: None 65 * Returns: BCM_E_NONE (always) 66 * 67 * Notes: Please, use your company name as a prefix. 68 */ 69 int 70 example_bcm(void) 71 { 72 return BCM_E_NONE; 73 }