mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2025-12-08 07:14:03 +00:00
Add support for kernel 4.14 (#61)
* Add support for kernel 4.14 'vfs_read' is no longer exported (see kernel commit https://github.com/torvalds/linux/commit/bd8df82be6). Update .travis.yml with newer kernels
This commit is contained in:
committed by
Carlos Garcés
parent
2eb28be744
commit
49a0fb5020
@@ -1619,7 +1619,11 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf)
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
for (i = 0 ; i < HWSET_MAX_SIZE ; i++) {
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||
kernel_read(fp, temp, 2, &pos);
|
||||
#else
|
||||
vfs_read(fp, temp, 2, &pos);
|
||||
#endif
|
||||
if (sscanf(temp, "%hhx", &buf[i]) != 1) {
|
||||
if (0)
|
||||
DBG_871X_LEVEL(_drv_err_, "%s sscanf fail\n", __func__);
|
||||
@@ -1627,10 +1631,18 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf)
|
||||
}
|
||||
if ((i % EFUSE_FILE_COLUMN_NUM) == (EFUSE_FILE_COLUMN_NUM - 1)) {
|
||||
/* Filter the lates space char. */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||
kernel_read(fp, temp, 1, &pos);
|
||||
#else
|
||||
vfs_read(fp, temp, 1, &pos);
|
||||
#endif
|
||||
if (strchr(temp, ' ') == NULL) {
|
||||
pos--;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||
kernel_read(fp, temp, 2, &pos);
|
||||
#else
|
||||
vfs_read(fp, temp, 2, &pos);
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
pos += 1; /* Filter the space character */
|
||||
@@ -1687,7 +1699,11 @@ u32 rtw_read_macaddr_from_file(const char *path, u8 *buf)
|
||||
fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||
kernel_read(fp, source_addr, 18, &pos);
|
||||
#else
|
||||
vfs_read(fp, source_addr, 18, &pos);
|
||||
#endif
|
||||
source_addr[17] = ':';
|
||||
|
||||
head = end = source_addr;
|
||||
|
||||
Reference in New Issue
Block a user