/*
 * Copyright (C) 2013 Apple Inc. All rights reserved.
 *
 * This document is the property of Apple Inc.
 * It is considered confidential and proprietary.
 *
 * This document may not be reproduced or transmitted in any form,
 * in whole or in part, without the express written permission of
 * Apple Inc.
 */
#ifndef THUNDERBOOT_PROTOCOL_H
#define THUNDERBOOT_PROTOCOL_H

#include "tbt_protocol.h"

#define THUNDERBOOT_LOGIN_REQUEST		(1)
#define THUNDERBOOT_LOGIN_RESPONSE		(2)
#define THUNDERBOOT_PING_REQUEST		(3)
#define THUNDERBOOT_PING_RESPONSE		(4)
#define THUNDERBOOT_IPIPE_REQUEST		(5)
#define THUNDERBOOT_IPIPE_RESPONSE		(6)
#define THUNDERBOOT_ERROR_RESPONSE		(255)

#define THUNDERBOOT_REQUEST_HEADER_LEN		(TBT_XD_REQUEST_HEADER_LEN + 16)
#define THUNDERBOOT_RESPONSE_HEADER_LEN		(THUNDERBOOT_REQUEST_HEADER_LEN)

#define THUNDERBOOT_DATA_REQUEST_HEADER_LEN	(THUNDERBOOT_REQUEST_HEADER_LEN + 4 + 4)
#define THUNDERBOOT_DATA_REQUEST_MAX_DATA	(TBT_CFG_MAX_HEADER_AND_PAYLOAD - THUNDERBOOT_DATA_REQUEST_HEADER_LEN)

#define THUNDERBOOT_SERIAL_REQUEST_HEADER_LEN	(THUNDERBOOT_REQUEST_HEADER_LEN + 4)
#define THUNDERBOOT_SERIAL_REQUEST_MAX_DATA	(TBT_CFG_MAX_HEADER_AND_PAYLOAD - THUNDERBOOT_SERIAL_REQUEST_HEADER_LEN)

#define THUNDERBOOT_IPIPE_REQUEST_HEADER_LEN	(THUNDERBOOT_REQUEST_HEADER_LEN)
#define THUNDERBOOT_IPIPE_REQUEST_MAX_DATA	(TBT_CFG_MAX_HEADER_AND_PAYLOAD - THUNDERBOOT_IPIPE_REQUEST_HEADER_LEN)

#define THUNDERBOOT_LOGIN_REQUEST_LEN		(THUNDERBOOT_REQUEST_HEADER_LEN + 16)

#define THUNDERBOOT_PING_REQUEST_LEN		(THUNDERBOOT_REQUEST_HEADER_LEN + 8)
#define THUNDERBOOT_PING_RESPONSE_LEN		(THUNDERBOOT_PING_REQUEST_LEN + 4 + 8)

#define THUNDERBOOT_STATUS_OK			(0)
#define THUNDERBOOT_STATUS_MALFORMED		(1)
#define THUNDERBOOT_STATUS_UNKNOWN_TYPE		(2)
#define THUNDERBOOT_STATUS_WRONG_MODE		(3)
#define THUNDERBOOT_STATUS_NOT_LOGGED_IN	(4)
#define THUNDERBOOT_STATUS_WRONG_UUID		(5)

#endif
