File: u_tcm.h

package info (click to toggle)
linux 6.12.63-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,675,632 kB
  • sloc: ansic: 25,912,022; asm: 269,631; sh: 136,601; python: 65,458; makefile: 55,710; perl: 37,753; xml: 19,284; cpp: 5,895; yacc: 4,927; lex: 2,939; awk: 1,594; sed: 28; ruby: 25
file content (47 lines) | stat: -rw-r--r-- 1,283 bytes parent folder | download | duplicates (25)
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
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * u_tcm.h
 *
 * Utility definitions for the tcm function
 *
 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com
 *
 * Author: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
 */

#ifndef U_TCM_H
#define U_TCM_H

#include <linux/usb/composite.h>

/**
 * @dependent: optional dependent module. Meant for legacy gadget.
 * If non-null its refcount will be increased when a tpg is created and
 * decreased when tpg is dropped.
 * @dep_lock: lock for dependent module operations.
 * @ready: true if the dependent module information is set.
 * @can_attach: true a function can be bound to gadget
 * @has_dep: true if there is a dependent module
 *
 */
struct f_tcm_opts {
	struct usb_function_instance	func_inst;
	struct module			*dependent;
	struct mutex			dep_lock;
	bool				ready;
	bool				can_attach;
	bool				has_dep;

	/*
	 * Callbacks to be removed when legacy tcm gadget disappears.
	 *
	 * If you use the new function registration interface
	 * programmatically, you MUST set these callbacks to
	 * something sensible (e.g. probe/remove the composite).
	 */
	int (*tcm_register_callback)(struct usb_function_instance *);
	void (*tcm_unregister_callback)(struct usb_function_instance *);
};

#endif /* U_TCM_H */