Blame lib/a2mp.h

Packit 34410b
/*
Packit 34410b
 *
Packit 34410b
 *  BlueZ - Bluetooth protocol stack for Linux
Packit 34410b
 *
Packit 34410b
 *  Copyright (C) 2012  Intel Corporation. All rights reserved.
Packit 34410b
 *  Copyright (c) 2012  Code Aurora Forum. All rights reserved.
Packit 34410b
 *
Packit 34410b
 *  This program is free software; you can redistribute it and/or modify
Packit 34410b
 *  it under the terms of the GNU General Public License as published by
Packit 34410b
 *  the Free Software Foundation; either version 2 of the License, or
Packit 34410b
 *  (at your option) any later version.
Packit 34410b
 *
Packit 34410b
 *  This program is distributed in the hope that it will be useful,
Packit 34410b
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 34410b
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 34410b
 *  GNU General Public License for more details.
Packit 34410b
 *
Packit 34410b
 *  You should have received a copy of the GNU General Public License
Packit 34410b
 *  along with this program; if not, write to the Free Software
Packit 34410b
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
Packit 34410b
 *
Packit 34410b
 */
Packit 34410b
Packit 34410b
#ifndef __A2MP_H
Packit 34410b
#define __A2MP_H
Packit 34410b
Packit 34410b
#ifdef __cplusplus
Packit 34410b
extern "C" {
Packit 34410b
#endif
Packit 34410b
Packit 34410b
/* A2MP Protocol */
Packit 34410b
Packit 34410b
/* A2MP command codes */
Packit 34410b
Packit 34410b
#define A2MP_COMMAND_REJ	0x01
Packit 34410b
#define A2MP_DISCOVER_REQ	0x02
Packit 34410b
#define A2MP_DISCOVER_RSP	0x03
Packit 34410b
#define A2MP_CHANGE_NOTIFY	0x04
Packit 34410b
#define A2MP_CHANGE_RSP		0x05
Packit 34410b
#define A2MP_INFO_REQ		0x06
Packit 34410b
#define A2MP_INFO_RSP		0x07
Packit 34410b
#define A2MP_ASSOC_REQ		0x08
Packit 34410b
#define A2MP_ASSOC_RSP		0x09
Packit 34410b
#define A2MP_CREATE_REQ		0x0a
Packit 34410b
#define A2MP_CREATE_RSP		0x0b
Packit 34410b
#define A2MP_DISCONN_REQ	0x0c
Packit 34410b
#define A2MP_DISCONN_RSP	0x0d
Packit 34410b
Packit 34410b
struct a2mp_hdr {
Packit 34410b
	uint8_t		code;
Packit 34410b
	uint8_t		ident;
Packit 34410b
	uint16_t	len;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
#define A2MP_HDR_SIZE 4
Packit 34410b
Packit 34410b
struct a2mp_command_rej {
Packit 34410b
	uint16_t	reason;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_discover_req {
Packit 34410b
	uint16_t	mtu;
Packit 34410b
	uint16_t	mask;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_ctrl {
Packit 34410b
	uint8_t		id;
Packit 34410b
	uint8_t		type;
Packit 34410b
	uint8_t		status;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_discover_rsp {
Packit 34410b
	uint16_t	mtu;
Packit 34410b
	uint16_t	mask;
Packit 34410b
	struct a2mp_ctrl ctrl_list[0];
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_info_req {
Packit 34410b
	uint8_t		id;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_info_rsp {
Packit 34410b
	uint8_t		id;
Packit 34410b
	uint8_t		status;
Packit 34410b
	uint32_t	total_bw;
Packit 34410b
	uint32_t	max_bw;
Packit 34410b
	uint32_t	min_latency;
Packit 34410b
	uint16_t	pal_caps;
Packit 34410b
	uint16_t	assoc_size;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_assoc_req {
Packit 34410b
	uint8_t		id;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_assoc_rsp {
Packit 34410b
	uint8_t		id;
Packit 34410b
	uint8_t		status;
Packit 34410b
	uint8_t		assoc_data[0];
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_create_req {
Packit 34410b
	uint8_t		local_id;
Packit 34410b
	uint8_t		remote_id;
Packit 34410b
	uint8_t		assoc_data[0];
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_create_rsp {
Packit 34410b
	uint8_t		local_id;
Packit 34410b
	uint8_t		remote_id;
Packit 34410b
	uint8_t		status;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_disconn_req {
Packit 34410b
	uint8_t		local_id;
Packit 34410b
	uint8_t		remote_id;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
struct a2mp_disconn_rsp {
Packit 34410b
	uint8_t		local_id;
Packit 34410b
	uint8_t		remote_id;
Packit 34410b
	uint8_t		status;
Packit 34410b
} __attribute__ ((packed));
Packit 34410b
Packit 34410b
#define A2MP_COMMAND_NOT_RECOGNIZED 0x0000
Packit 34410b
Packit 34410b
/* AMP controller status */
Packit 34410b
#define AMP_CTRL_POWERED_DOWN		0x00
Packit 34410b
#define AMP_CTRL_BLUETOOTH_ONLY		0x01
Packit 34410b
#define AMP_CTRL_NO_CAPACITY		0x02
Packit 34410b
#define AMP_CTRL_LOW_CAPACITY		0x03
Packit 34410b
#define AMP_CTRL_MEDIUM_CAPACITY	0x04
Packit 34410b
#define AMP_CTRL_HIGH_CAPACITY		0x05
Packit 34410b
#define AMP_CTRL_FULL_CAPACITY		0x06
Packit 34410b
Packit 34410b
/* A2MP response status */
Packit 34410b
#define A2MP_STATUS_SUCCESS				0x00
Packit 34410b
#define A2MP_STATUS_INVALID_CTRL_ID			0x01
Packit 34410b
#define A2MP_STATUS_UNABLE_START_LINK_CREATION		0x02
Packit 34410b
#define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS		0x02
Packit 34410b
#define A2MP_STATUS_COLLISION_OCCURED			0x03
Packit 34410b
#define A2MP_STATUS_DISCONN_REQ_RECVD			0x04
Packit 34410b
#define A2MP_STATUS_PHYS_LINK_EXISTS			0x05
Packit 34410b
#define A2MP_STATUS_SECURITY_VIOLATION			0x06
Packit 34410b
Packit 34410b
#ifdef __cplusplus
Packit 34410b
}
Packit 34410b
#endif
Packit 34410b
Packit 34410b
#endif /* __A2MP_H */