GNU Linux-libre 4.14.332-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / hive_isp_css_shared / socket_global.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #ifndef __SOCKET_GLOBAL_H_INCLUDED__
16 #define __SOCKET_GLOBAL_H_INCLUDED__
17
18 #include "stream_buffer.h"
19
20 /* define the socket port direction */
21 typedef enum {
22         SOCKET_PORT_DIRECTION_NULL,
23         SOCKET_PORT_DIRECTION_IN,
24         SOCKET_PORT_DIRECTION_OUT
25 } socket_port_direction_t;
26
27 /* pointer to the port's callout function */
28 typedef void (*socket_port_callout_fp)(void);
29 typedef struct socket_port_s socket_port_t;
30 typedef struct socket_s socket_t;
31
32 /* data structure of the socket port */
33 struct socket_port_s {
34         unsigned                                channel;        /* the port entity */
35         socket_port_direction_t direction;      /* the port direction */
36         socket_port_callout_fp  callout;        /* the port callout function */
37
38         socket_t                                *socket;        /* point to the socket */
39
40         struct {
41                 unsigned data;
42         } buf;                                                          /* the buffer at the port */
43 };
44
45 /* data structure of the socket */
46 struct socket_s {
47         socket_port_t   *in;    /* the in-direction port */
48         socket_port_t   *out;   /* the out-direction port */
49         stream_buffer_t buf;    /* the buffer between in-ports and out-ports */
50 };
51
52 #endif /* __SOCKET_GLOBAL_H_INCLUDED__ */
53