aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_shared/socket_global.h
blob: 2b7025e90250c9f56df3aed54ecb4705313c8583 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2015, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */

#ifndef __SOCKET_GLOBAL_H_INCLUDED__
#define __SOCKET_GLOBAL_H_INCLUDED__

#include "stream_buffer.h"

/* define the socket port direction */
typedef enum {
	SOCKET_PORT_DIRECTION_NULL,
	SOCKET_PORT_DIRECTION_IN,
	SOCKET_PORT_DIRECTION_OUT
} socket_port_direction_t;

/* pointer to the port's callout function */
typedef void (*socket_port_callout_fp)(void);
typedef struct socket_port_s socket_port_t;
typedef struct socket_s socket_t;

/* data structure of the socket port */
struct socket_port_s {
	unsigned				channel;	/* the port entity */
	socket_port_direction_t direction;	/* the port direction */
	socket_port_callout_fp	callout;	/* the port callout function */

	socket_t				*socket;	/* point to the socket */

	struct {
		unsigned data;
	} buf;								/* the buffer at the port */
};

/* data structure of the socket */
struct socket_s {
	socket_port_t	*in;	/* the in-direction port */
	socket_port_t	*out;	/* the out-direction port */
	stream_buffer_t	buf;	/* the buffer between in-ports and out-ports */
};

#endif /* __SOCKET_GLOBAL_H_INCLUDED__ */