summaryrefslogtreecommitdiff
path: root/auth22-internal.h
blob: 80d95a7ab1058d48bacfda67526d1abb985549e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
 *
 * Samsung DisplayPort driver.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef __EXYNOS_HDCP2_AUTH_INTERNAL_H__
#define __EXYNOS_HDCP2_AUTH_INTERNAL_H__

#include <linux/device.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/mutex.h>
#include <linux/module.h>

#define HDCP_LINK_TYPE_DP      1

static char *hdcp_link_st_str[] = {
	"ST_INIT",
	"ST_H0_NO_RX_ATTACHED",
	"ST_H1_TX_LOW_VALUE_CONTENT",
	"ST_A0_DETERMINE_RX_HDCP_CAP",
	"ST_A1_EXCHANGE_MASTER_KEY",
	"ST_A2_LOCALITY_CHECK",
	"ST_A3_EXCHANGE_SESSION_KEY",
	"ST_A4_TEST_REPEATER",
	"ST_A5_AUTHENTICATED",
	"ST_A6_WAIT_RECEIVER_ID_LIST",
	"ST_A7_VERIFY_RECEIVER_ID_LIST",
	"ST_A8_SEND_RECEIVER_ID_LIST_ACK",
	"ST_A9_CONTENT_STREAM_MGT",
	"ST_END",
	NULL
};

typedef enum hdcp_tx_hdcp_link_state {
	LINK_ST_INIT = 0,
	LINK_ST_H0_NO_RX_ATTACHED,
	LINK_ST_H1_TX_LOW_VALUE_CONTENT,
	LINK_ST_A0_DETERMINE_RX_HDCP_CAP,
	LINK_ST_A1_EXCHANGE_MASTER_KEY,
	LINK_ST_A2_LOCALITY_CHECK,
	LINK_ST_A3_EXCHANGE_SESSION_KEY,
	LINK_ST_A4_TEST_REPEATER,
	LINK_ST_A5_AUTHENTICATED,
	LINK_ST_A6_WAIT_RECEIVER_ID_LIST,
	LINK_ST_A7_VERIFY_RECEIVER_ID_LIST,
	LINK_ST_A8_SEND_RECEIVER_ID_LIST_ACK,
	LINK_ST_A9_CONTENT_STREAM_MGT,
	LINK_ST_END
} hdcp_tx_hdcp_link_state;

#define UPDATE_LINK_STATE(link, st)             do { \
        hdcp_info("HDCP Link: %s -> %s\n", hdcp_link_st_str[link->state], hdcp_link_st_str[st]); \
        link->state = st; \
        } while (0)

struct hdcp_link_data {
	uint32_t state;
	bool is_repeater;
	bool is_aborted;
	bool is_stored_km;
	bool pairing_ready;
	bool hprime_ready;
	bool rp_ready;
};

int auth22_exchange_master_key(struct hdcp_link_data *lk);
int auth22_locality_check(struct hdcp_link_data *lk);
int auth22_exchange_session_key(struct hdcp_link_data *lk);
int auth22_wait_for_receiver_id_list(struct hdcp_link_data *lk);
int auth22_verify_receiver_id_list(struct hdcp_link_data *lk);
int auth22_stream_manage(struct hdcp_link_data *lk);

#endif