summarylogtreecommitdiffstats
path: root/linux-5.10.patch
blob: 73904df9a3845c5503eea061df9a9dff1fe59615 (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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
diff --git a/core/efuse/rtw_efuse.c b/core/efuse/rtw_efuse.c
index 5d3f80a..062c51f 100644
--- a/core/efuse/rtw_efuse.c
+++ b/core/efuse/rtw_efuse.c
@@ -1329,7 +1329,9 @@ void Rtw_Hal_ReadMACAddrFromFile(PADAPTER padapter)
 {
 	u32 i;
 	struct file *fp;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	mm_segment_t fs;
+#endif
 	u8 source_addr[18];
 	loff_t pos = 0;
 	u32 curtime = rtw_get_current_time();
@@ -1347,8 +1349,10 @@ void Rtw_Hal_ReadMACAddrFromFile(PADAPTER padapter)
 		pEEPROM->bloadmac_fail_flag = _TRUE;
 		DBG_871X("Error, wifi mac address file doesn't exist.\n");
 	} else {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 		fs = get_fs();
 		set_fs(KERNEL_DS);
+#endif
 
 		DBG_871X("wifi mac address:\n");
 		vfs_read(fp, source_addr, 18, &pos);
@@ -1371,7 +1375,9 @@ void Rtw_Hal_ReadMACAddrFromFile(PADAPTER padapter)
 			DBG_871X("%02x \n", pEEPROM->mac_addr[i]);
 		}
 		DBG_871X("\n");
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 		set_fs(fs);
+#endif
 		pEEPROM->bloadmac_fail_flag = _FALSE;
 		filp_close(fp, NULL);
 	}
@@ -1397,7 +1403,9 @@ u32 Rtw_Hal_readPGDataFromConfigFile(PADAPTER	padapter)
 {
 	u32 i;
 	struct file *fp;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	mm_segment_t fs;
+#endif
 	u8 temp[3];
 	loff_t pos = 0;
 	EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
@@ -1413,8 +1421,10 @@ u32 Rtw_Hal_readPGDataFromConfigFile(PADAPTER	padapter)
 		return _FAIL;
 	}
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	fs = get_fs();
 	set_fs(KERNEL_DS);
+#endif
 
 	DBG_871X("Efuse configure file:\n");
 	for (i=0; i< EFUSE_MAP_SIZE  ; i++) {
@@ -1424,7 +1434,9 @@ u32 Rtw_Hal_readPGDataFromConfigFile(PADAPTER	padapter)
 		DBG_871X("%02X \n", PROMContent[i]);
 	}
 	DBG_871X("\n");
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	set_fs(fs);
+#endif
 
 	filp_close(fp, NULL);
 	
diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c
index f8e3f60..f2cd923 100644
--- a/core/rtw_wlan_util.c
+++ b/core/rtw_wlan_util.c
@@ -3657,7 +3657,9 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t* ssid,
 
 	int i = 0;
 	struct file *fp;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	mm_segment_t fs;
+#endif
 	loff_t pos = 0;
 	u8 *source = NULL;
 	long len = 0;
@@ -3690,8 +3692,10 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t* ssid,
 		return 0;
 	}
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	fs = get_fs();
 	set_fs(KERNEL_DS);
+#endif
 
 	source = rtw_zmalloc(2048);
 
@@ -3701,7 +3705,9 @@ int rtw_dev_nlo_info_set(struct pno_nlo_info *nlo_info, pno_ssid_t* ssid,
 		rtw_mfree(source, 2048);
 	}
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	set_fs(fs);
+#endif
 	filp_close(fp, NULL);
 
 	DBG_871X("-%s-\n", __func__);
diff --git a/hal/rtl8188e/usb/usb_halinit.c b/hal/rtl8188e/usb/usb_halinit.c
index 366b4bd..82571ca 100644
--- a/hal/rtl8188e/usb/usb_halinit.c
+++ b/hal/rtl8188e/usb/usb_halinit.c
@@ -2499,7 +2499,9 @@ static u32 Hal_readPGDataFromConfigFile(
 {
 	u32 i;
 	struct file *fp;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	mm_segment_t fs;
+#endif
 	u8 temp[3];
 	loff_t pos = 0;
 	EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
@@ -2515,8 +2517,10 @@ static u32 Hal_readPGDataFromConfigFile(
 		return _FAIL;
 	}
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	fs = get_fs();
 	set_fs(KERNEL_DS);
+#endif
 
 	DBG_871X("Efuse configure file:\n");
 	for (i=0; i<HWSET_MAX_SIZE_88E; i++) {
@@ -2526,7 +2530,9 @@ static u32 Hal_readPGDataFromConfigFile(
 		DBG_871X("%02X \n", PROMContent[i]);
 	}
 	DBG_871X("\n");
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	set_fs(fs);
+#endif
 
 	filp_close(fp, NULL);
 	
@@ -2542,7 +2548,9 @@ Hal_ReadMACAddrFromFile_8188EU(
 {
 	u32 i;
 	struct file *fp;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	mm_segment_t fs;
+#endif
 	u8 source_addr[18];
 	loff_t pos = 0;
 	u32 curtime = rtw_get_current_time();
@@ -2560,8 +2568,10 @@ Hal_ReadMACAddrFromFile_8188EU(
 		pEEPROM->bloadmac_fail_flag = _TRUE;
 		DBG_871X("Error, wifi mac address file doesn't exist.\n");
 	} else {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 		fs = get_fs();
 		set_fs(KERNEL_DS);
+#endif
 
 		DBG_871X("wifi mac address:\n");
 		vfs_read(fp, source_addr, 18, &pos);
@@ -2584,7 +2594,9 @@ Hal_ReadMACAddrFromFile_8188EU(
 			DBG_871X("%02x \n", pEEPROM->mac_addr[i]);
 		}
 		DBG_871X("\n");
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 		set_fs(fs);
+#endif
 		pEEPROM->bloadmac_fail_flag = _FALSE;
 		filp_close(fp, NULL);
 	}
diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c
index 8c21b7e..7d1ab56 100644
--- a/os_dep/osdep_service.c
+++ b/os_dep/osdep_service.c
@@ -1930,7 +1930,9 @@ static int isFileReadable(char *path)
 { 
 	struct file *fp;
 	int ret = 0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	mm_segment_t oldfs;
+#endif
 	char buf;
  
 	fp=filp_open(path, O_RDONLY, 0); 
@@ -1938,12 +1940,16 @@ static int isFileReadable(char *path)
 		ret = PTR_ERR(fp);
 	}
 	else {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 		oldfs = get_fs(); set_fs(KERNEL_DS);
+#endif
 		
 		if(1!=readFile(fp, &buf, 1))
 			ret = PTR_ERR(fp);
 		
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 		set_fs(oldfs);
+#endif
 		filp_close(fp,NULL);
 	}	
 	return ret;
@@ -1959,16 +1965,22 @@ static int isFileReadable(char *path)
 static int retriveFromFile(char *path, u8* buf, u32 sz)
 {
 	int ret =-1;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	mm_segment_t oldfs;
+#endif
 	struct file *fp;
 
 	if(path && buf) {
 		if( 0 == (ret=openFile(&fp,path, O_RDONLY, 0)) ){
 			DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 			oldfs = get_fs(); set_fs(KERNEL_DS);
+#endif
 			ret=readFile(fp, buf, sz);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 			set_fs(oldfs);
+#endif
 			closeFile(fp);
 			
 			DBG_871X("%s readFile, ret:%d\n",__FUNCTION__, ret);
@@ -1993,16 +2005,22 @@ static int retriveFromFile(char *path, u8* buf, u32 sz)
 static int storeToFile(char *path, u8* buf, u32 sz)
 {
 	int ret =0;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 	mm_segment_t oldfs;
+#endif
 	struct file *fp;
 	
 	if(path && buf) {
 		if( 0 == (ret=openFile(&fp, path, O_CREAT|O_WRONLY, 0666)) ) {
 			DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 			oldfs = get_fs(); set_fs(KERNEL_DS);
+#endif
 			ret=writeFile(fp, buf, sz);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0))
 			set_fs(oldfs);
+#endif
 			closeFile(fp);
 
 			DBG_871X("%s writeFile, ret:%d\n",__FUNCTION__, ret);