summaryrefslogtreecommitdiff
path: root/fuzz/usb_tcpm_v2_rev20_fuzz.c
blob: c4f57432ad2f3f51e3c399bc5eb9a250b1838712 (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
/* Copyright 2020 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 * Stubs needed for fuzz testing the USB TCPMv2 state machines.
 */

#include "charge_manager.h"
#include "mock/usb_mux_mock.h"
#include "usb_pd.h"

const struct svdm_response svdm_rsp = {
	.identity = NULL,
	.svids = NULL,
	.modes = NULL,
};

/* USB mux configuration */
const struct usb_mux_chain usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
	{
		.mux =
			&(const struct usb_mux){
				.driver = &mock_usb_mux_driver,
			},
	},
	{
		.mux =
			&(const struct usb_mux){
				.driver = &mock_usb_mux_driver,
			},
	}
};

int pd_check_vconn_swap(int port)
{
	return 1;
}