rk fb: mid not support uboot display hdmi, so wo identify box and mid at switch screen
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / esp8089 / esp_driver / esp_android.h
1 #ifndef _ESP_ANDROID_H
2 #define _ESP_ANDROID_H
3
4 #include <linux/version.h>
5 #include <linux/firmware.h>
6
7
8 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
9 #define GET_INODE_FROM_FILEP(filp) \
10     (filp)->f_path.dentry->d_inode
11 #else
12 #define GET_INODE_FROM_FILEP(filp) \
13     (filp)->f_dentry->d_inode
14 #endif
15
16 #define E_ROUND_UP(x, y)  ((((x) + ((y) - 1)) / (y)) * (y))
17
18 #ifdef ANDROID
19 int android_readwrite_file(const char *filename, char *rbuf, const char *wbuf, size_t length);
20
21 int android_request_firmware(const struct firmware **firmware_p, const char *name, struct device *device);
22
23 void android_release_firmware(const struct firmware *firmware);
24
25 #ifdef INIT_DATA_CONF
26 #define INIT_CONF_FILE "init_data.conf"
27 #endif /* def INIT_DATA_CONF */
28
29 #define CONF_ATTR_LEN 24
30 #define CONF_VAL_LEN 3
31 #define MAX_ATTR_NUM 24
32 #define MAX_FIX_ATTR_NUM 16
33 #define MAX_BUF_LEN ((CONF_ATTR_LEN + CONF_VAL_LEN + 2) * MAX_ATTR_NUM + 2)
34
35 struct esp_init_table_elem {
36         char attr[CONF_ATTR_LEN];
37         int offset;
38         short value;
39 };
40
41 int android_request_init_conf(void);
42 void fix_init_data(u8 *init_data_buf, int buf_size);
43 void show_init_buf(u8 *buf, int size);
44
45
46 #endif
47
48 #if defined(ANDROID) && defined(ESP_ANDROID_LOGGER)
49 extern int logger_write( const unsigned char prio,
50                          const char __kernel * const tag,
51                          const char __kernel * const fmt,
52                          ...);
53
54
55 #endif // ANDROID
56 #endif