summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/interface.h
blob: 907b6341665c3edc84835584cf77d6618880e254 (plain) (blame)
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
/*
 * Greybus interfaces
 *
 * Copyright 2014 Google Inc.
 *
 * Released under the GPLv2 only.
 */

#ifndef __INTERFACE_H
#define __INTERFACE_H

#include <linux/list.h>

struct gb_interface {
	struct gb_module	*gmod;
	u8			id;
	u8			device_id;
	struct list_head	connections;

	struct list_head	links;	/* module->interfaces */
};

struct gb_interface *gb_interface_create(struct gb_module *gmod, u8 module_id);
void gb_interface_destroy(struct gb_interface *interface);

struct gb_interface *gb_interface_find(struct gb_module *gmod, u8 interface_id);

int gb_interface_connections_init(struct gb_interface *interface);
void gb_interface_connections_exit(struct gb_interface *interface);

#endif /* __INTERFACE_H */