please choosego to mobile | Continue to access the PC version
Author: y52

Kali 2 @ H3 boards doesn't switch to monitor mode

[Copy link]

4

threads

1118

posts

9455

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9455
Published in 2016-4-5 05:33:40 | Show all floors
y52 replied at 2016-4-4 22:05
I didn't use git since it was not available as a package on my old Centos installation. Both git and ...

you should clone in this way:
  1. git clone https://github.com/rdm-dev/rtl8189ES_linux.git
  2. cd rtl8189ES_linux/
  3. git checkout 52ee6388111fbaf990ec60e93b086cafa6cc373a
Copy code


Makefile settings:
CONFIG_80211W - not sure, probably not needed
CONFIG_WIFI_MONITOR = y
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_SUN8I_W5P1 = y (actually, W5P1 and W3P1 are not appropriate, that's why you need to copy file in next step)

then copy platform_ARM_SUNnI_sdio.c from original kernel source (drivers/net/wireless/rtl8189es/platform) to platform folder. You don't need to enable anything to be build as a module.

H3 is ARCH_SUN8IW7.

You can build everything with just:
  1. make KSRC=<kernel header path>
Copy code

where <kernel header path> is path to kernel headers, obviously.

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-4-8 06:05:01 | Show all floors
Hello, your explanations were really helpful, but there is another problem:
platform_ARM_SUNnI_sdio.c exists only with the new GIT commit :

root@orangepiplus:/usr/src/rtl8189ES_linux# find / -name platform_ARM_SUNnI_sdio.c
/usr/src/rtl8189ES_linux/platform/platform_ARM_SUNnI_sdio.c

The distribution headers have only :
root@orangepiplus:/usr/src/linux-headers-3.4.110-sun8i/drivers/net/wireless/rtl8189es# ls -al
total 56
drwxr-xr-x  2 root root  4096 Apr  7 23:56 .
drwxr-xr-x 28 root root  4096 Mar  8 20:10 ..
-rwxr-xr-x  1 root root   110 Feb 26 10:41 Kconfig
-rwxr-xr-x  1 root root 41465 Feb 26 10:41 Makefile

Complete sources are not provided with the Armbian. Still need more of your prompts.
Thnks

4

threads

1118

posts

9455

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9455
Published in 2016-4-8 20:59:11 | Show all floors
Actually, complete kernel source is provided by Armbian (you can compile your own Armbian image), but not inside the distribution. You can find this file anywhere H3 kernel source is published, for example:
https://github.com/loboris/Orang ... rm_ARM_SUNnI_sdio.c

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-4-9 04:15:28 | Show all floors
Still have trouble with Git :
root@orangepiplus:/usr/src/temp/OrangePI-Kernel# git clone -n git://github.com/loboris/OrangePI-Kernel.git
Cloning into 'OrangePI-Kernel'...
remote: Counting objects: 45449, done.
remote: Total 45449 (delta 0), reused 0 (delta 0), pack-reused 45449
Receiving objects: 100% (45449/45449), 191.88 MiB | 198.00 KiB/s, done.
Resolving deltas: 100% (6224/6224), done.
Checking connectivity... done.

root@orangepiplus:/usr/src/temp/OrangePI-Kernel# cd OrangePI-Kernel/
root@orangepiplus:/usr/src/temp/OrangePI-Kernel/OrangePI-Kernel# git checkout platform_ARM_SUNnI_sdio.c
error: pathspec 'platform_ARM_SUNnI_sdio.c' did not match any file(s) known to git.


This doesn't work either:
root@orangepiplus:/usr/src/temp/OrangePI-Kernel/OrangePI-Kernel# git checkout linux-3.4/drivers/net/wireless/rtl8189es/platform/platform_ARM_SUNnI_sdio.c
error: pathspec 'linux-3.4/drivers/net/wireless/rtl8189es/platform/platform_ARM_SUNnI_sdio.c' did not match any file(s) known to git.

4

threads

1118

posts

9455

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9455
Published in 2016-4-9 05:40:49 | Show all floors
y52 replied at 2016-4-8 21:15
Still have trouble with Git :
root@orangepiplus:/usr/src/temp/OrangePI-Kernel# git clone -n git://gi ...

That wasn't meant to be the commit name. Just pull the repo (which you already did) and then search for the file I mentioned. Or you can visit the page in web browser and download it.

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-4-9 23:21:28 | Show all floors
I still need to practice more with Git to be able retrieving the single file from the repository. I was still unable doing it.
So I just copied the content from the web page to the file in the platform directory:

root@orangepiplus:/usr/src/rtl8189ES_linux# cd platform/
root@orangepiplus:/usr/src/rtl8189ES_linux/platform# ls -al
total 52
drwxr-xr-x 2 root root 4096 Apr  9 16:30 .
drwxr-xr-x 8 root root 4096 Apr  9 16:52 ..
-rw-r--r-- 1 root root 1582 Apr  7 23:41 platform_arm_act_sdio.c
-rw-r--r-- 1 root root 3834 Apr  7 23:41 platform_ARM_SUNnI_sdio.c                <<-- original with the driver sources
-rw-r--r-- 1 root root 3266 Apr  9 16:25 platform_ARM_SUNnI_sdio_loboris.c   <<-- copied from the Kernel sources
-rw-r--r-- 1 root root 2966 Apr  7 23:41 platform_ARM_SUNxI_sdio.c
-rw-r--r-- 1 root root 4246 Apr  7 23:41 platform_ARM_SUNxI_usb.c
-rw-r--r-- 1 root root 1803 Apr  7 23:41 platform_ARM_WMT_sdio.c
-rw-r--r-- 1 root root 1160 Apr  7 23:41 platform_ops.c
-rw-r--r-- 1 root root 1144 Apr  7 23:41 platform_ops.h
-rw-r--r-- 1 root root 1222 Apr  7 23:41 platform_RTK_DMP_usb.c
-rw-r--r-- 1 root root 2341 Apr  7 23:41 platform_sprd_sdio.c

root@orangepiplus:/usr/src/rtl8189ES_linux/platform# mv platform_ARM_SUNnI_sdio.c platform_ARM_SUNnI_sdio.c.from.rtl.driver.sources
root@orangepiplus:/usr/src/rtl8189ES_linux/platform# cp platform_ARM_SUNnI_sdio_loboris.c platform_ARM_SUNnI_sdio.c

Probably, all the efforts were not worth it. Despite the size difference between the platform_ARM_SUNnI_sdio_loboris.c and the one providede with the RTL driver platform_ARM_SUNnI_sdio.c, the content looks to be the same. So either of the files should fit.


The inability to build the driver lies somewhere else.

I added the line
CONFIG_PLATFORM_ARM_SUN8I = y               
to the rtl8189ES_linux / Makefile

1st I tried the suggested :
root@orangepiplus:/usr/src/rtl8189ES_linux# make KSRC=/usr/src/linux-headers-3.4.110-sun8i
make ARCH= CROSS_COMPILE= -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtl8189ES_linux  modules
make[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i'
Makefile:567: /usr/src/linux-headers-3.4.110-sun8i/arch//Makefile: No such file or directory
make[1]: *** No rule to make target '/usr/src/linux-headers-3.4.110-sun8i/arch//Makefile'.  Stop.
make[1]: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'
Makefile:1635: recipe for target 'modules' failed
make: *** [modules] Error 2
root@orangepiplus:/usr/src/rtl8189ES_linux#


Apparently the
ARCH=arm/mach-sunxi  is missing

So I completed the command line with the ARCH=arm/mach-sunxi :

root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm/mach-sunxi KSRC=/usr/src/linux-headers-3.4.110-sun8i
make ARCH=arm/mach-sunxi CROSS_COMPILE= -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtl8189ES_linux  modules
make[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i'
  CC [M]  /usr/src/rtl8189ES_linux/core/rtw_cmd.o
In file included from /usr/src/rtl8189ES_linux/include/basic_types.h:80:0,
                 from /usr/src/rtl8189ES_linux/include/drv_types.h:31,
                 from /usr/src/rtl8189ES_linux/core/rtw_cmd.c:22:
include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
#include <asm/types.h>
                       ^
compilation terminated.
scripts/Makefile.build:307: recipe for target '/usr/src/rtl8189ES_linux/core/rtw_cmd.o' failed
make[2]: *** [/usr/src/rtl8189ES_linux/core/rtw_cmd.o] Error 1
Makefile:1367: recipe for target '_module_/usr/src/rtl8189ES_linux' failed
make[1]: *** [_module_/usr/src/rtl8189ES_linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'
Makefile:1635: recipe for target 'modules' failed
make: *** [modules] Error 2


This is a persistent error :
asm/types.h: No such file or directory


root@orangepiplus:/usr/src/rtl8189ES_linux# find / -name types.h
/usr/include/c++/4.9/parallel/types.h
/usr/include/rpc/types.h
/usr/include/asm-generic/types.h
/usr/include/libnl3/netlink/types.h
/usr/include/libucsi/dvb/types.h
/usr/include/libucsi/mpeg/types.h
/usr/include/libucsi/types.h
/usr/include/libucsi/atsc/types.h
/usr/include/libesg/types.h
/usr/include/arm-linux-gnueabihf/bits/types.h
/usr/include/arm-linux-gnueabihf/asm/types.h
/usr/include/arm-linux-gnueabihf/sys/types.h
/usr/include/linux/types.h
/usr/src/linux-headers-3.4.110-sun8i/include/asm-generic/types.h
/usr/src/linux-headers-3.4.110-sun8i/include/rxrpc/types.h
/usr/src/linux-headers-3.4.110-sun8i/include/linux/sunrpc/types.h
/usr/src/linux-headers-3.4.110-sun8i/include/linux/ceph/types.h
/usr/src/linux-headers-3.4.110-sun8i/include/linux/types.h
/usr/src/linux-headers-3.4.110-sun8i/arch/arm/include/asm/types.h


I saw already the  asm/types.h missing while trying to build from the sources. What is it related with and how could it be fixed?

4

threads

1118

posts

9455

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9455
Published in 2016-4-10 00:01:48 | Show all floors
Nope, files are not the same. I checked them. There are some different defines which is very important. Just keep the loboris one and everything should be ok. BTW, you can't download just one file via git.

Try compiling with this:
  1. make ARCH=arm KSRC=/usr/src/linux-headers-3.4.110-sun8i
Copy code

e.g. no mach-sunxi

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-4-10 03:04:03 | Show all floors
It gives different results, but ends with the new errors:

root@orangepiplus:/usr/src/rtl8189ES_linux/platform# rm -f platform_ARM_SUNnI_sdio.c
root@orangepiplus:/usr/src/rtl8189ES_linux/platform# cp -a platform_ARM_SUNnI_sdio_loboris.c platform_arm_act_sdio.c
root@orangepiplus:/usr/src/rtl8189ES_linux/platform# cd ../
root@orangepiplus:/usr/src/rtl8189ES_linux#


root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm KSRC=/usr/src/linux-headers-3.4.110-sun8i
make ARCH=arm CROSS_COMPILE= -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtl8189ES_linux  modules
make[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i'
  CC [M]  /usr/src/rtl8189ES_linux/core/rtw_cmd.o
In file included from /usr/src/rtl8189ES_linux/include/drv_types.h:33:0,
                 from /usr/src/rtl8189ES_linux/core/rtw_cmd.c:22:
/usr/src/rtl8189ES_linux/include/rtw_byteorder.h:35:4: error: #error "Must be LITTLE/BIG Endian Host"
#  error "Must be LITTLE/BIG Endian Host"
    ^
In file included from /usr/src/rtl8189ES_linux/include/drv_types.h:111:0,
                 from /usr/src/rtl8189ES_linux/core/rtw_cmd.c:22:
/usr/src/rtl8189ES_linux/include/rtw_mlme_ext.h:1149:4: error: #error "Must be LITTLE or BIG Endian"
#  error "Must be LITTLE or BIG Endian"
    ^
In file included from /usr/src/rtl8189ES_linux/include/../hal/phydm/phydm_precomp.h:81:0,
                 from /usr/src/rtl8189ES_linux/include/hal_data.h:25,
                 from /usr/src/rtl8189ES_linux/core/rtw_cmd.c:23:
/usr/src/rtl8189ES_linux/include/../hal/phydm/phydm_hwconfig.h:47:7: warning: "ODM_ENDIAN_TYPE" is not defined [-Wundef]
  #if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
       ^
/usr/src/rtl8189ES_linux/include/../hal/phydm/phydm_hwconfig.h:73:6: warning: "ODM_ENDIAN_TYPE" is not defined [-Wundef]
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
      ^
/usr/src/rtl8189ES_linux/include/../hal/phydm/phydm_hwconfig.h:97:6: warning: "ODM_ENDIAN_TYPE" is not defined [-Wundef]
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
      ^
/usr/src/rtl8189ES_linux/include/../hal/phydm/phydm_hwconfig.h:110:6: warning: "ODM_ENDIAN_TYPE" is not defined [-Wundef]
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
      ^
/usr/src/rtl8189ES_linux/include/../hal/phydm/phydm_hwconfig.h:122:6: warning: "ODM_ENDIAN_TYPE" is not defined [-Wundef]
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
      ^
/usr/src/rtl8189ES_linux/include/../hal/phydm/phydm_hwconfig.h:141:6: warning: "ODM_ENDIAN_TYPE" is not defined [-Wundef]
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
      ^
/usr/src/rtl8189ES_linux/include/../hal/phydm/phydm_hwconfig.h:158:6: warning: "ODM_ENDIAN_TYPE" is not defined [-Wundef]
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
      ^
/usr/src/rtl8189ES_linux/include/../hal/phydm/phydm_hwconfig.h:169:6: warning: "ODM_ENDIAN_TYPE" is not defined [-Wundef]
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
      ^
In file included from /usr/src/rtl8189ES_linux/include/drv_types.h:65:0,
                 from /usr/src/rtl8189ES_linux/core/rtw_cmd.c:22:
/usr/src/rtl8189ES_linux/core/rtw_cmd.c: In function ‘rtw_cmd_thread’:
/usr/src/rtl8189ES_linux/core/rtw_cmd.c:673:59: error: ‘struct C2HEvent_Header’ has no member named ‘ID’
      ADPT_ARG(pcmd->padapter), pcmd->cmdcode, pc2h_evt_hdr->ID, cmd_process_time);
                                                           ^
/usr/src/rtl8189ES_linux/include/rtw_debug.h:254:26: note: in definition of macro ‘DBG_871X’
   _dbgdump(DRIVER_PREFIX __VA_ARGS__);\
                          ^
scripts/Makefile.build:307: recipe for target '/usr/src/rtl8189ES_linux/core/rtw_cmd.o' failed
make[2]: *** [/usr/src/rtl8189ES_linux/core/rtw_cmd.o] Error 1
Makefile:1367: recipe for target '_module_/usr/src/rtl8189ES_linux' failed
make[1]: *** [_module_/usr/src/rtl8189ES_linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'
Makefile:1635: recipe for target 'modules' failed
make: *** [modules] Error 2
root@orangepiplus:/usr/src/rtl8189ES_linux#

4

threads

1118

posts

9455

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9455
Published in 2016-4-10 16:08:32 | Show all floors
That shouldn't happen, because there is a define for that in Makefile. Can you upload Makefile somewhere so I can check it?

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-4-10 23:58:41 | Show all floors
I copied 2 files:
root@orangepiplus:/usr/src/rtl8189ES_linux# tar -cvzf rtl8189ES_build.files.tgz Makefile platform/platform_ARM_SUNnI_sdio_loboris.c

and shared it here:
https://drive.google.com/file/d/ ... DQ/view?usp=sharing

Probably you would find the reason and solution building it.
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list