OpenWrt Forum Archive

Topic: please help build modificed for TDMA driver ath9k

The content of this topic has been archived on 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

RT-WiFi v0.1

RT-WiFi driver v0.1. RT-WiFi driver is built on top of the ath9k driver in backports driver collection. This release v0.1 is based on backports driver v3.13.2. This version of RT-WiFi driver, we implement basic TDMA features with static TDMA link schedule based on our RTSS 2013 paper. Please go through the following user guide before you use this driver.

i download source of barrier breaker and write makefile in package/rtwifi/Makefile


include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
export KERNELDIR:=$(LINUX_DIR)

PKG_NAME:=rtwifi
PKG_VERSION:=0.1

PKG_SOURCE_URL:=(local host web server)
PKG_SOURCE:=1.tar.gz
PKG_MD5SUM:=602190cb1ccaa3c0302afb701f52aa1b
PKG_CAT:=zcat
PKGARCH:=mips

include $(INCLUDE_DIR)/package.mk

define KernelPackage/rtwifi
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=A library that talks to Apple devices.
#  DEFAULT:=y
endef

define Build/Configure

endef

define Build/InstallDev

endef

define KernelPackage/rtwifi/install

endef

$(eval $(call KernelPackage,rtwifi))

and compille with

make package/rtwifi/install V=s

but building stop with error

Error: -march=mips32r2 is not compatible with the selected ABI
/home/botto/openwrt/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/rtwifi-0.1/compat/main.c:1:0: error: '-march=mips32r2' is not compatible with the selected ABI
 #include <linux/module.h>

please help compilling this package sources and user guide can download from cs@utexas@edu/users/cps/rt-wifi@html
how to change arch easy or this release code oriented writed for x86-64 arch?

(Last edited by tiuman5 on 2 Jun 2017, 15:09)

Oh, it's good to support TDMA. But where i can get the source package?

b21500 wrote:

Oh, it's good to support TDMA. But where i can get the source package?

cs@utexas@edu/users/cps/rt-wifi@html


where @ = .

zloop wrote:

I think the following should enable ath10k but I get only a Kernel Oops on TP-Link with supposedly "rare" AR1A hardware

1. enable ath10k
in your trunk folder there is package/kernel/mac80211/Makefile

Patch it with the ath10k enable patch from the mailing list:

2. update mac80211 (compat-wireless) to backports (same project new name)

PKG_VERSION:=20130802
PKG_RELEASE:=1
PKG_SOURCE_URL:=(URL kernel org)/pub/linux/kernel/projects/backports/2013/08/02
PKG_SHA1SUM:=d8ca2b9405ec81c171470f60f526d10e841e74ebc526b1938350ea8f9871084e

PKG_SOURCE:=backports-$(PKG_VERSION).tar.bz2
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1

and a line with "echo" in Build/prepare to the new name (backports instead of compat)

3. refresh patches of mac80211

make prepare
make package/kernel/mac80211/prepare V=s QUILT=1
cd build_dir/target .../linux.../backports-20130802/
quilt series
# delete 2 large pending work patches - less fixes for other wireless drivers 
# but you want to test ath10k anyway
quilt delete 300- ...

# repeat / use following 3 commands until all patches are working or 
# delete some patches for drivers not used in your image
quilt push
quilt refresh
# remove an applied patch
quilt pop

4. maybe integrate hw revision test
patch from ath10k mailing list:

# if you are at the end of quilt series - name patch f. ex. 900-ath10k_hw_id.patch
quilt import <path>/900-ath10k_hw_id.patch
# patch is in patches dir
quilt push
quilt refresh

5. update packages: atm you only have a modified build_dir

# in openwrt buildroot
make package/kernel/mac80211/update

After that you should build your image.
atm you have to manually load the kernel modules (insmod ath10k_core, insmod ath10k_pci )

i begin doing all my modification with backport 3.13.2 with help this tutorial.
but i get last error /net/wireless/cfg80211.ko is missing
what i not might fix

install -d -m0755 /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-kmod-cfg80211/lib/wifi /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-kmod-cfg80211/lib/netifd/wireless
install -m0644 ./files/lib/wifi/mac80211.sh /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-kmod-cfg80211/lib/wifi
install -m0755 ./files/lib/netifd/wireless/mac80211.sh /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-kmod-cfg80211/lib/netifd/wireless
SHELL= /home/botto/openwrtOLD/staging_dir/host/bin/flock /home/botto/openwrtOLD/tmp/.root-copy.flock -c 'cp -fpR /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-kmod-cfg80211/. /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/'
rm -rf /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/tmp-kmod-cfg80211
touch /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/root-ar71xx/stamp/.kmod-cfg80211_installed
if [ -f /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/mac80211.default.install.clean ]; then rm -f /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/mac80211.default.install /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/mac80211.default.install.clean; fi; echo "kmod-cfg80211" >> /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/mac80211.default.install
mkdir -p /home/botto/openwrtOLD/bin/ar71xx/packages /home/botto/openwrtOLD/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/backports-3.13.2-1/ipkg-ar71xx/kmod-mac80211/CONTROL /home/botto/openwrtOLD/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo
ERROR: module '/home/botto/openwrtOLD/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/backports-3.13.2-1/net/mac80211/mac80211.ko' is missing.
make[2]: *** [/home/botto/openwrtOLD/bin/ar71xx/packages/base/kmod-mac80211_3.10.49+3.13.2-1-1_ar71xx.ipk] Error 1
make[2]: Leaving directory `/home/botto/openwrtOLD/package/kernel/mac80211'
make[1]: *** [package/kernel/mac80211/install] Error 2
make[1]: Leaving directory `/home/botto/openwrtOLD'
make: *** [package/kernel/mac80211/install] Ошибка 2

(Last edited by tiuman5 on 10 Jun 2017, 15:07)

today i cross compile the backport-3.12.8-1 with the help this tutorial "wiki@openwrt@org/doc/devel/crosscompile"
sudo make CC=~/openwrtOLD/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-gcc LD=~/openwrtOLD/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-ld ARCH=mips
and replace /usr/src/linux-headers-generic_3.3.3 with  build_dir/target.../linux-ar7xxx_generic/linux-3.x.x
when compilling running i see warning "mips-openwrt-linux-uclibc-gcc: warning: environment variable 'STAGING_DIR' not defined"  lots of.
but i right exporting this STAGIND_DIR with right path. and see echo $STAGING_DIR path to toolchain dir.

when make the finish and i get the files:

ath.ko
ath9k.ko
ath9k_common.ko
ath9k_hw.ko
cfg80211.ko
mac80211.ko
I replace this files with files located /lib/modules/3.x.x/ in router.
After reboot wifi not work.
in logread i see "PHY for wifi device radio0 not found"
and i cd /sys/class/ieee80211/
but this folder has been a empty....................

after this i using patchs from packege/kernel/mac80211 on backports. and deleting failed patchs.
no result all the same

(Last edited by tiuman5 on 18 Jun 2017, 17:16)

What a pity. It failed to run on openwrt.

The discussion might have continued from here.