mirror of
https://github.com/chinawrj/rtl8812au
synced 2024-11-30 17:02:28 +00:00
Fix for 4.14.0 kernel
This commit is contained in:
parent
c6e7607eac
commit
65a6213446
@ -2566,7 +2566,11 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf)
|
|||||||
set_fs(KERNEL_DS);
|
set_fs(KERNEL_DS);
|
||||||
|
|
||||||
for (i = 0 ; i < HWSET_MAX_SIZE ; i++) {
|
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);
|
vfs_read(fp, temp, 2, &pos);
|
||||||
|
#endif
|
||||||
if (sscanf(temp, "%hhx", &buf[i]) != 1) {
|
if (sscanf(temp, "%hhx", &buf[i]) != 1) {
|
||||||
if (0)
|
if (0)
|
||||||
RTW_ERR("%s sscanf fail\n", __func__);
|
RTW_ERR("%s sscanf fail\n", __func__);
|
||||||
@ -2574,10 +2578,18 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf)
|
|||||||
}
|
}
|
||||||
if ((i % EFUSE_FILE_COLUMN_NUM) == (EFUSE_FILE_COLUMN_NUM - 1)) {
|
if ((i % EFUSE_FILE_COLUMN_NUM) == (EFUSE_FILE_COLUMN_NUM - 1)) {
|
||||||
/* Filter the lates space char. */
|
/* 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);
|
vfs_read(fp, temp, 1, &pos);
|
||||||
|
#endif
|
||||||
if (strchr(temp, ' ') == NULL) {
|
if (strchr(temp, ' ') == NULL) {
|
||||||
pos--;
|
pos--;
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||||
|
kernel_read(fp, temp, 2, &pos);
|
||||||
|
#else
|
||||||
vfs_read(fp, temp, 2, &pos);
|
vfs_read(fp, temp, 2, &pos);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pos += 1; /* Filter the space character */
|
pos += 1; /* Filter the space character */
|
||||||
@ -2634,7 +2646,11 @@ u32 rtw_read_macaddr_from_file(const char *path, u8 *buf)
|
|||||||
fs = get_fs();
|
fs = get_fs();
|
||||||
set_fs(KERNEL_DS);
|
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);
|
vfs_read(fp, source_addr, 18, &pos);
|
||||||
|
#endif
|
||||||
source_addr[17] = ':';
|
source_addr[17] = ':';
|
||||||
|
|
||||||
head = end = source_addr;
|
head = end = source_addr;
|
||||||
|
@ -4475,7 +4475,11 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t *ssid,
|
|||||||
source = rtw_zmalloc(2048);
|
source = rtw_zmalloc(2048);
|
||||||
|
|
||||||
if (source != NULL) {
|
if (source != NULL) {
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||||
|
len = kernel_read(fp, source, len, &pos);
|
||||||
|
#else
|
||||||
len = vfs_read(fp, source, len, &pos);
|
len = vfs_read(fp, source, len, &pos);
|
||||||
|
#endif
|
||||||
rtw_parse_cipher_list(nlo_info, source);
|
rtw_parse_cipher_list(nlo_info, source);
|
||||||
rtw_mfree(source, 2048);
|
rtw_mfree(source, 2048);
|
||||||
}
|
}
|
||||||
|
@ -1920,7 +1920,11 @@ static int readFile(struct file *fp, char *buf, int len)
|
|||||||
|
|
||||||
while (sum < len) {
|
while (sum < len) {
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||||
|
rlen = kernel_read(fp, buf + sum, len - sum, &fp->f_pos);
|
||||||
|
#else
|
||||||
rlen = __vfs_read(fp, buf + sum, len - sum, &fp->f_pos);
|
rlen = __vfs_read(fp, buf + sum, len - sum, &fp->f_pos);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
rlen = fp->f_op->read(fp, buf + sum, len - sum, &fp->f_pos);
|
rlen = fp->f_op->read(fp, buf + sum, len - sum, &fp->f_pos);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user