blob: 10f3d7d163340ff77133a6cda2498b17c4f46bbd [file] [log] [blame]
/*
<:copyright-BRCM:2016:DUAL/GPL:standard
Broadcom Proprietary and Confidential.(c) 2016 Broadcom
All Rights Reserved
Unless you and Broadcom execute a separate written software license
agreement governing use of this software, this software is licensed
to you under the terms of the GNU General Public License version 2
(the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php,
with the following added to such license:
As a special exception, the copyright holders of this software give
you permission to link this software with independent modules, and
to copy and distribute the resulting executable under terms of your
choice, provided that you also meet, for each linked independent
module, the terms and conditions of the license of that module.
An independent module is a module which is not derived from this
software. The special exception does not apply to any modifications
of the software.
Not withstanding the above, under no circumstances may you combine
this software in any way with any other Broadcom software provided
under a license other than the GPL, without Broadcom's express prior
written consent.
:>
*/
/*
* bcmtr_inband.h - Inband host-maple communication interface
*/
#ifndef _BCMTR_INBAND_H_
#define _BCMTR_INBAND_H_
/** Initialize in-band transport driver
* \returns: 0 in case of success or error code < 0
*/
bcmos_errno bcmtr_ib_init(void);
/** Cleanup in-band transport driver
* \returns: 0 in case of success or error code < 0
*/
void bcmtr_ib_exit(void);
/** Connect
* \param[in] device Maple device index
* \param[in] ip_address Maple IP address
* \param[in] udp_port Maple UDP port
* \returns: 0 in case of success or error code < 0
*/
bcmos_errno bcmtr_ib_connect(uint8_t device, bcmos_ipv4_address ip_address, uint16_t udp_port);
/** Disconnect. All buffers are released
* \param[in] device Maple device index
* \returns: 0 in case of success or error code < 0
*/
bcmos_errno bcmtr_ib_disconnect(uint8_t device);
/** Send packet to device via in-band interface
* \param[in] device Mapole device index
* \param[in] channel Logical channel
* \param[in] buf Buffer to be transmitted
* \returns: 0 in case of success or error code < 0
*/
bcmos_errno bcmtr_ib_send(uint8_t device, uint8_t channel, bcmos_buf *buf);
/* Receive packet from device */
bcmos_errno bcmtr_ib_receive(uint32_t device, uint8_t *channel, bcmos_buf **buf);
#endif /* _BCMTR_INBAND_H_ */