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
122
123
|
/**
* @brief User API definition header file for MB86 LSI Linux driver.
* @since 2009/01/08
* @note None
* @attention None
* <B><I>COPYRIGHT FUJITSU LIMITED 2009</I></B>
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
/****************************************************************************/
#ifndef __FMB_API_H__
#define __FMB_API_H__
#include "fmb.h"
/********************************************************/
/* LSI Core Parameter Table */
/********************************************************/
struct fmb_param_table {
unsigned long offset;
unsigned short mask;
unsigned short shift;
unsigned long valid;
};
struct fmb_param_head_table {
unsigned short id_up_16bit;
const struct fmb_param_table* second_table_addr;
unsigned long second_table_size;
};
/********************************************************/
/* ioctl External Function */
/********************************************************/
/**
* @brief ioctl() Command Function
* @param[in] priv_p hard private data pointer
* @param[in] cmd Command number from application
* @param[in,out] arg Argument from application
* @return 0 normal end
* @return -EFAULT user buffer(argp) access error
* @return -EINVAL invalid content of parameter
* @return -ETIMEDOUT timeout
* @return -ERESTARTSYS internal error
* @return -EAGAIN try again
* @note None
*/
int Fmb_api_ioctl(struct fmb_hard_private* fmb_hard_private_data_p,
unsigned int cmd,
unsigned long arg
);
/********************************************************/
/* systemcall basic API Function */
/********************************************************/
/**
* @brief Device Open Function
* @param[in] *ip Information in filesystem
* @param[in] *fp File pointer
* @return TBD
* @note None
* @attention None
*
int Fmb_api_open(struct inode* ip, struct file* fp);
*/
/**
* @brief Device Close Function
* @param[in] *ip Information in filesystem
* @param[in] *fp File pointer
* @return TBD
* @note None
* @attention None
int Fmb_api_release(struct inode* ip, struct file* fp);
*/
/**
* @brief Stream Receive Function from LSI.
* @param[in] *fmb_hard_private Hard private data
* @param[in] *fp File pointer
* @param[in,out] *buffp Data pointer
* @param[in] len Data length
* @param[in] *offset Object pointer
* @return TBD
* @note None
* @attention None
*/
ssize_t Fmb_api_read(struct fmb_hard_private* fmb_hard_private_data_p,
struct file* fill_p,
const char __user* buff_p,
size_t len,
loff_t* offset
);
/**
* @brief Stream Send Function to LSI.
* @param[in] *fmb_hard_private Hard private data
* @param[in] *fp File pointer
* @param[in,out] *buffp Data pointer
* @param[in] len Data length
* @param[in] *offset Object pointer
* @return TBD
* @note None
* @attention None
*/
ssize_t Fmb_api_write(struct fmb_hard_private* fmb_hard_private_data_p,
struct file* fill_p,
const char __user* buff_p,
size_t len,
loff_t* offset
);
#endif /* ifndef __FMB_API_H__ */
|