mirror of
https://github.com/Mange/rtl8192eu-linux-driver
synced 2024-12-26 14:01:45 +00:00
Fix strnicmp not defined in Kernel >= 4.0
This particular fix is all over the internet, as patches posted on
mailing lists, package maintainer's mirrors, etc.
I don't know the full origin of it, but it works. It also makes sense. I
found a quote regarding it here:
http://comments.gmane.org/gmane.linux.drivers.driver-project.devel/71438
> [...] patched so it will compile against kernels that no longer
> provide the old procfs API and with calls to strnicmp() replaced with
> strncasecmp().
Here's an example of the patch in the wild:
9cf1f08f9a/8192cu-dkms/RTL8192CU-kernel-4.0.patch
Note that the sources mentioned above all talk about the more common
8192cu driver, but the change is the same as both drivers share the
majority of the code with each other.
<speculation>
I guess this is part of the reason why the hardware makers don't publish
updated drivers; they've copy-pasted it everywhere and patching them all
is a pain for them.
</speculation>
This commit is contained in:
parent
0c8b0caaaa
commit
6793baedf5
@ -337,7 +337,11 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
|
|||||||
{
|
{
|
||||||
int cmd_num;
|
int cmd_num;
|
||||||
for(cmd_num=0 ; cmd_num<ANDROID_WIFI_CMD_MAX; cmd_num++)
|
for(cmd_num=0 ; cmd_num<ANDROID_WIFI_CMD_MAX; cmd_num++)
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
|
||||||
|
if(!strncasecmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) )
|
||||||
|
#else
|
||||||
if(0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) )
|
if(0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) )
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
return cmd_num;
|
return cmd_num;
|
||||||
|
Loading…
Reference in New Issue
Block a user