summaryrefslogtreecommitdiff
path: root/hle/hle.h
blob: 984b58be84094064091a85a2b1d2e0b05501de65 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef HLE_H_
#define HLE_H_

/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    hle.h
 * \brief   Public functions
 * \ingroup « module »
 *
 * « long description »
 */

#include "hal/hle/defs.h"
#include "cl/cl.h"

/** forward declaration */
typedef struct hle_t hle_t;

/**
 * Initialize the HLE.
 * 
 * \param  cl  the convergence layer context.
 * \return  the hle context
 */
hle_t *hle_init (cl_t *cl);

/**
 * Unitialize the HLE.
 * 
 * \param  hle  the hle context.
 */
void hle_uninit (hle_t *hle);

/**
 * Send a data to the Convergence Layer to be sent over the PWL.
 * 
 * \param  hle  the hle context.
 * \param  buffer  the buffer containing the data to send.
 * \param  length  the data length
 */
void hle_data_send (hle_t *hle, u8 *buffer, uint length);

/**
 * Called by the Convergence layer when the data has been sent to the PWL.
 * This allows the HLE to know which buffer is newly available to be used or
 * give it back to the ARM. (the buffer is borrowed by the linux).
 * 
 * \param  hle  the hle context.
 * \param  buffer the buffer used to send the data.
 */
void hle_data_send_done (hle_t *hle, u8 *buffer);

/**
 * Receives a data from the Convergence layer.
 * 
 * \param  hle  the hle context.
 * \param  buffer  the buffer used to receive the data
 * \param  length  the length of the data received.
 */
void hle_data_recv (hle_t *hle, u8 *buffer, uint length);

/**
 * Provides a buffer to the CL in order to receive new MMEs from the CP.
 * 
 * \param  hle  the hle context.
 * \param  buffer  the buffer to provide to the CL.
 */
void hle_data_buffer_add (hle_t *hle, u8 *buffer);

/**
 * Send a MME to the Convergence Layer to be provide to the CP.
 * 
 * \param  hle  the hle context.
 * \param  buffer  the buffer containing the data to send.
 * \param  length  the data length
 */
void hle_mme_send (hle_t *hle, u8 *buffer, uint length);

/**
 * Called by the Convergence layer when the data has been sent to the CP.
 * This allows the HLE to know which buffer is newly available to be used or
 * give it back to the ARM. (the buffer is borrowed by the linux).
 * 
 * \param  hle  the hle context.
 * \param  buffer the buffer used to send the data.
 */
void hle_mme_send_done (hle_t *hle, u8 *buffer);

/**
 * Receives a data from the Convergence layer.
 * 
 * \param  hle  the hle context.
 * \param  buffer  the buffer used to receive the data
 * \param  length  the length of the data received.
 */
void hle_mme_recv (hle_t *hle, u8 *buffer, uint length);

/**
 * Provides a buffer to the CL in order to receive new MMEs from the CP.
 * 
 * \param  hle  the hle context.
 * \param  buffer  the buffer to provide to the CL.
 */
void hle_mme_buffer_add (hle_t *hle, u8 *buffer);

/**
 * Receives a message from the Linux.
 * 
 * \param  hle  the hle context.
 * \param  msg_buffer  the pointer of the buffer containing the messages to read
 * \param  length  the length of the messages in words.
 */
bool hle_ipmbox_recv (hle_t *ctx, u32 *msg_buffer, uint length);

#endif /*HLE_H_*/