Shad Ansari | 2f7f9be | 2017-06-07 13:34:53 -0700 | [diff] [blame^] | 1 | /* |
| 2 | <:copyright-BRCM:2016:DUAL/GPL:standard |
| 3 | |
| 4 | Broadcom Proprietary and Confidential.(c) 2016 Broadcom |
| 5 | All Rights Reserved |
| 6 | |
| 7 | Unless you and Broadcom execute a separate written software license |
| 8 | agreement governing use of this software, this software is licensed |
| 9 | to you under the terms of the GNU General Public License version 2 |
| 10 | (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, |
| 11 | with the following added to such license: |
| 12 | |
| 13 | As a special exception, the copyright holders of this software give |
| 14 | you permission to link this software with independent modules, and |
| 15 | to copy and distribute the resulting executable under terms of your |
| 16 | choice, provided that you also meet, for each linked independent |
| 17 | module, the terms and conditions of the license of that module. |
| 18 | An independent module is a module which is not derived from this |
| 19 | software. The special exception does not apply to any modifications |
| 20 | of the software. |
| 21 | |
| 22 | Not withstanding the above, under no circumstances may you combine |
| 23 | this software in any way with any other Broadcom software provided |
| 24 | under a license other than the GPL, without Broadcom's express prior |
| 25 | written consent. |
| 26 | |
| 27 | :> |
| 28 | */ |
| 29 | |
| 30 | /* |
| 31 | * bcmtr_inband.h - Inband host-maple communication interface |
| 32 | */ |
| 33 | |
| 34 | #ifndef _BCMTR_INBAND_H_ |
| 35 | #define _BCMTR_INBAND_H_ |
| 36 | |
| 37 | |
| 38 | /** Initialize in-band transport driver |
| 39 | * \returns: 0 in case of success or error code < 0 |
| 40 | */ |
| 41 | bcmos_errno bcmtr_ib_init(void); |
| 42 | |
| 43 | |
| 44 | /** Cleanup in-band transport driver |
| 45 | * \returns: 0 in case of success or error code < 0 |
| 46 | */ |
| 47 | void bcmtr_ib_exit(void); |
| 48 | |
| 49 | /** Connect |
| 50 | * \param[in] device Maple device index |
| 51 | * \param[in] ip_address Maple IP address |
| 52 | * \param[in] udp_port Maple UDP port |
| 53 | * \returns: 0 in case of success or error code < 0 |
| 54 | */ |
| 55 | bcmos_errno bcmtr_ib_connect(uint8_t device, bcmos_ipv4_address ip_address, uint16_t udp_port); |
| 56 | |
| 57 | /** Disconnect. All buffers are released |
| 58 | * \param[in] device Maple device index |
| 59 | * \returns: 0 in case of success or error code < 0 |
| 60 | */ |
| 61 | bcmos_errno bcmtr_ib_disconnect(uint8_t device); |
| 62 | |
| 63 | /** Send packet to device via in-band interface |
| 64 | * \param[in] device Mapole device index |
| 65 | * \param[in] channel Logical channel |
| 66 | * \param[in] buf Buffer to be transmitted |
| 67 | * \returns: 0 in case of success or error code < 0 |
| 68 | */ |
| 69 | bcmos_errno bcmtr_ib_send(uint8_t device, uint8_t channel, bcmos_buf *buf); |
| 70 | |
| 71 | /* Receive packet from device */ |
| 72 | bcmos_errno bcmtr_ib_receive(uint32_t device, uint8_t *channel, bcmos_buf **buf); |
| 73 | |
| 74 | #endif /* _BCMTR_INBAND_H_ */ |