# 10.2 Atheros wireless AR9227 PCI problem



## hanzer (Aug 31, 2015)

I have a TL-WN751ND in a 10.2 system that seems to be having some problems. Basic info:

`pciconf -lv`

```
ath0@pci0:1:9:0:  class=0x028000 card=0x0301168c chip=0x002d168c rev=0x01 hdr=0x00
  vendor  = 'Atheros Communications Inc.'
  device  = 'AR9227 Wireless Network Adapter'
  class  = network
```
`ifconfig | grep -B3 -i wireless`

```
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
  ether c4:e9:84:91:9c:20
  nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
  media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng
--
  ether c4:e9:84:91:9c:20
  inet 192.168.49.179 netmask 0xfffffc00 broadcast 192.168.51.255
  nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
  media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
```
`ifconfig wlan0 list caps`

```
drivercaps=4f85ed01<STA,IBSS,HOSTAP,AHDEMO,TXPMGT,SHSLOT,SHPREAMBLE,MONITOR,MBSS,WPA1,WPA2,BURST,WME,WDS,TXFRAG>
cryptocaps=1f<WEP,TKIP,AES,AES_CCM,TKIPMIC>
htcaps=7016e<CHWIDTH40,SHORTGI20,SHORTGI40>
```
And `dmesg` spews reports like:

```
ath0: ath_rate_tx_complete: ts_rate=27 ts_finaltsi=0
ath0: bad series0 hwrate 0x1b, tries 1 ts_status 0x0
ath0: bad series0 hwrate 0x81, tries 2 ts_status 0x0
ath0: bad series0 hwrate 0x81, tries 2 ts_status 0x0
ath0: bad series0 hwrate 0x81, tries 2 ts_status 0x0
ath0: ath_rate_tx_complete: ts_rate=27 ts_finaltsi=0
ath0: bad series0 hwrate 0x1b, tries 3 ts_status 0x0
ath0: ath_rate_tx_complete: ts_rate=27 ts_finaltsi=0
ath0: bad series0 hwrate 0x1b, tries 1 ts_status 0x0
ath0: bb hang detected (0x4), resetting
```
I am considering a different driver - 11.5.1.1. Using Windows® NDIS Drivers 

*Any advice, suggestions, or war stories would be very welcome and appreciated!*


----------



## hanzer (Sep 1, 2015)

*Progress Update*

I got the WindowsXP 32-bit driver files from the manufacturer's website.

`root@insomnia:~/ath_ndis # ls`

```
athw.sys  netathw.inf  netathwx.cat
```
The first attempt at `ndisgen /root/ath_ndis/netathw.inf /root/ath_ndis/athw.sys`, resulted in:

```
==================================================================
  ------------------ Windows(r) driver converter -------------------
  ==================================================================

  Driver file conversion

  The script will now try to convert the .INF and .SYS files
  using the ndiscvt(1) utility. This utility can handle most
  .INF files; however, occasionally it can fail to parse some files
  due to subtle syntax issues: the .INF syntax is very complex,
  and the Windows(r) parser will sometimes allow files with small
  syntax errors to be processed correctly which ndiscvt(1) will
  not. If the conversion fails, you may have to edit the .INF
  file by hand to remove the offending lines.

  Press enter to try converting the files now:
ndiscvt: line 3488: : syntax error.
CONVERSION FAILED
```
The file, /root/ath_ndis/netathw.inf, is 3488 lines and the last few lines looked like this:

```
3484 ^M
  3485 Atheros_Disk  = "Driver Disk"^M
  3486 ATHER.Service.DispName  = "Wireless PCI Adapter Driver Service"^M
  3487 ATHER.DeviceDesc.0300T  = "TP-LINK 300Mbps Wireless N Adapter"^M
  3488 ATHER.DeviceDesc.0301T  = "TP-LINK 150Mbps Wireless N Adapter"
```
I tried `pkg install unix2dos` then `dos2unix netathw.inf` to cleanup the line endings then attempted the conversion again with the same results - _"3488: : syntax error_". Next, I tried adding a newline to end of last line in the file (line 3488). *That worked.*

```
==================================================================
  ------------------ Windows(r) driver converter -------------------
  ==================================================================

  Driver file conversion

  The script will now try to convert the .INF and .SYS files
  using the ndiscvt(1) utility. This utility can handle most
  .INF files; however, occasionally it can fail to parse some files
  due to subtle syntax issues: the .INF syntax is very complex,
  and the Windows(r) parser will sometimes allow files with small
  syntax errors to be processed correctly which ndiscvt(1) will
  not. If the conversion fails, you may have to edit the .INF
  file by hand to remove the offending lines.

  Press enter to try converting the files now:

  Conversion was successful.

  Press enter to continue...

  ==================================================================
  ------------------ Windows(r) driver converter -------------------
  ==================================================================

  Firmware file conversion

  If your driver uses additional firmware files, please list them
  below. When you're finished, just press enter to continue. (If your
  driver doesn't need any extra firmware files, just press enter
  to move to the next step.)

  > netathwx.cat

  Conversion was successful.

  Press enter to continue...

  ==================================================================
  ------------------ Windows(r) driver converter -------------------
  ==================================================================


  List of files converted firmware files:

  netathwx.cat.o

  Press enter to continue...

  ==================================================================
  ------------------ Windows(r) driver converter -------------------
  ==================================================================

  Kernel module generation


  The script will now try to generate the kernel driver module.
  This is the last step. Once this module is generated, you should
  be able to load it just like any other FreeBSD driver module.

  Press enter to compile the stub module and generate the driver
  module now:

  Generating Makefile... done.
  Building kernel module... done.
  Cleaning up... done.

  The file athw_sys.ko has been successfully generated.
  You can kldload this module to get started.

  Press return to exit.
```
Now the directory looks like this: `root@insomnia:~/ath_ndis # ls`

```
athw.sys  netathw.inf  netathwx.cat
athw_sys.ko*  netathw.inf.orig  netathwx.cat.ko*
```
The current status of the system looks like this:
`kldstat`

```
Id Refs Address  Size  Name
1  8 0xc0400000 13eb800  kernel
2  1 0xc568d000 3000  pflog.ko
3  1 0xc5bd6000 3b000  pf.ko
4  1 0xc5f69000 2000  green_saver.ko
```
`cat /boot/loader.conf`

```
if_ath_load="YES"
if_ath_pci_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
wlan_amrr_load="YES"
```
`grep ath /etc/rc.conf`

```
wlans_ath0="wlan0"  # wlan(4) interfaces for ath0 device
```
`grep wlan /etc/rc.conf`

```
wlans_ath0="wlan0"  # wlan(4) interfaces for ath0 device
ifconfig_wlan0="WPA DHCP"
```
Now I am regrouping and contemplating how to proceed. As always, advice, pointers, references, productive commentary, or any other camaraderie is most welcome!


----------



## hanzer (Sep 1, 2015)

*Status Update: Situation Blows*

The machine under test is my network gateway. I borrowed a friend's laptop to make this post.
I tried `kldload ndis` then `kldstat`:

```
Id Refs Address  Size  Name
 1  20 0xc0400000 13eb800  kernel
 2  1 0xc568d000 3000  pflog.ko
 3  1 0xc5bd6000 3b000  pf.ko
 4  1 0xc5f69000 2000  green_saver.ko
 5  1 0xc5ba6000 c000  if_ndis.ko
 6  1 0xc62a1000 1b000  ndis.ko
```
Seems okay.  So then:
`root@insomnia:~/ath_ndis # kldload ./athw_sys.ko`
`root@insomnia:~/ath_ndis # kldstat`

```
Id Refs Address  Size  Name
 1  25 0xc0400000 13eb800  kernel
 2  1 0xc568d000 3000  pflog.ko
 3  1 0xc5bd6000 3b000  pf.ko
 4  1 0xc5f69000 2000  green_saver.ko
 5  2 0xc5ba6000 c000  if_ndis.ko
 6  2 0xc62a1000 1b000  ndis.ko
 7  1 0xc62da000 18f000  athw_sys.ko
```
`dmesg | tail`

```
ath0: bad series0 hwrate 0x1b, tries 1 ts_status 0x0
ath0: ath_rate_tx_complete: ts_rate=27 ts_finaltsi=0
ath0: bad series0 hwrate 0x1b, tries 1 ts_status 0x0
ath0: bad series0 hwrate 0x81, tries 2 ts_status 0x0
ath0: bad series0 hwrate 0x81, tries 2 ts_status 0x0
no match for ZwOpenKey
no match for ZwDeleteKey
no match for ZwCreateKey
ath0: ath_rate_tx_complete: ts_rate=27 ts_finaltsi=0
ath0: bad series0 hwrate 0x1b, tries 1 ts_status 0x0
```
Most of that has been typical except for the _"no match for Zw*Key"_ messages. There was a second kernel module produced by the ndisgen(8) process, so:
`root@insomnia:~/ath_ndis # kldload ./netathwx.cat.ko`
`root@insomnia:~/ath_ndis # kldstat`

```
Id Refs Address  Size  Name
 1  26 0xc0400000 13eb800  kernel
 2  1 0xc568d000 3000  pflog.ko
 3  1 0xc5bd6000 3b000  pf.ko
 4  1 0xc5f69000 2000  green_saver.ko
 5  2 0xc5ba6000 c000  if_ndis.ko
 6  2 0xc62a1000 1b000  ndis.ko
 7  1 0xc62da000 18f000  athw_sys.ko
 8  1 0xc62c6000 3000  netathwx.cat.ko
```
Okay, now they're both loaded. No apparent errors so far. `/etc/rc.d/netif restart`

```
/etc/rc.d/netif: WARNING: wlan0 does not exist.  Skipped.
Stopping Network: lo0 ath0 re0 pflog0.
lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
  options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
  nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ath0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
  ether c4:e9:84:91:9c:20
  nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
  media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
  status: no carrier
re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
  options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
  ether 00:1e:2a:39:83:14
  nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
  media: Ethernet autoselect (1000baseT <full-duplex>)
  status: active
pflog0: flags=100<PROMISC> metric 0 mtu 33184
Starting wpa_supplicant.
/etc/rc.d/wpa_supplicant: WARNING: failed to start wpa_supplicant
Starting Network: lo0 ath0 re0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
  options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
  inet 127.0.0.1 netmask 0xff000000
  inet6 ::1 prefixlen 128
  inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
  nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
  ether c4:e9:84:91:9c:20
  nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
  media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
  status: associated
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
  options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
  ether 00:1e:2a:39:83:14
  inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
  nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
  media: Ethernet autoselect (none)
  status: no carrier
```
`dmesg | tail`

```
ifa_del_loopback_route: deletion failed: 48
wlan0: link state changed to DOWN
wlan0: Ethernet address: c4:e9:84:91:9c:20
re0: link state changed to DOWN
wlan0: link state changed to UP
ath0: ath_rate_tx_complete: ts_rate=27 ts_finaltsi=0
ath0: bad series0 hwrate 0x1b, tries 1 ts_status 0x0
ath0: ath_rate_tx_complete: ts_rate=27 ts_finaltsi=0
ath0: bad series0 hwrate 0x1b, tries 1 ts_status 0x0
re0: link state changed to UP
```
Okay, test connectivity: `ping -c1 www.google.com`

```
PING www.google.com (74.125.21.147): 56 data bytes
64 bytes from 74.125.21.147: icmp_seq=0 ttl=42 time=48.336 ms

--- www.google.com ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 48.336/48.336/48.336/0.000 ms
```
Good. `cat /var/log/messages`

```
Sep  1 16:06:16 insomnia kernel: ifa_del_loopback_route: deletion failed: 48
Sep  1 16:06:16 insomnia dhclient[406]: connection closed
Sep  1 16:06:16 insomnia dhclient[406]: exiting.
Sep  1 16:06:18 insomnia kernel: wlan0: link state changed to DOWN
Sep  1 16:06:18 insomnia hanzer: /etc/rc.d/netif: WARNING: wlan0 does not exist.  Skipped.
Sep  1 16:06:18 insomnia wpa_supplicant[274]: ioctl[SIOCS80211, op=20, val=0, arg_len=7]: Device not configured
Sep  1 16:06:18 insomnia last message repeated 3 times
Sep  1 16:06:18 insomnia wpa_supplicant[274]: ioctl[SIOCS80211, op=25, val=0, arg_len=0]: Device not configured
Sep  1 16:06:19 insomnia devd: Executing '/etc/pccard_ether wlan0 start'
Sep  1 16:06:19 insomnia wpa_supplicant[274]: ioctl[SIOCS80211, op=26, val=0, arg_len=0]: Operation not supported
Sep  1 16:06:19 insomnia kernel: wlan0: Ethernet address: c4:e9:84:91:9c:20
Sep  1 16:06:19 insomnia wpa_supplicant[274]: ioctl[SIOCS80211, op=26, val=0, arg_len=0]: Operation not supported
Sep  1 16:06:19 insomnia wpa_supplicant[274]: wlan0: CTRL-EVENT-TERMINATING
Sep  1 16:06:19 insomnia wpa_supplicant[1827]: Successfully initialized wpa_supplicant
Sep  1 16:06:19 insomnia wpa_supplicant[1829]: Successfully initialized wpa_supplicant
Sep  1 16:06:19 insomnia wpa_supplicant[1829]: ctrl_iface exists and seems to be in use - cannot override it
Sep  1 16:06:19 insomnia wpa_supplicant[1829]: Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Sep  1 16:06:19 insomnia wpa_supplicant[1829]: Failed to initialize control interface '/var/run/wpa_supplicant'. You may have another wpa_supplicant process already running or the file was left by an unclean termination of wpa_supplicant in which case you will need to manually remove this file before starting wpa_supplicant again.
Sep  1 16:06:19 insomnia wpa_supplicant[1829]: ioctl[SIOCS80211, op=26, val=0, arg_len=0]: Operation not supported
Sep  1 16:06:19 insomnia wpa_supplicant[1829]: ioctl[SIOCS80211, op=26, val=0, arg_len=0]: Operation not supported
Sep  1 16:06:19 insomnia hanzer: /etc/rc.d/wpa_supplicant: WARNING: failed to start wpa_supplicant
Sep  1 16:06:19 insomnia kernel: re0: link state changed to DOWN
Sep  1 16:06:21 insomnia wpa_supplicant[1830]: wlan0: Trying to associate with 20:b3:99:1c:02:48 (SSID='REDACTED' freq=2437 MHz)
Sep  1 16:06:21 insomnia wpa_supplicant[1830]: wlan0: Associated with 20:b3:99:1c:02:48
Sep  1 16:06:21 insomnia kernel: wlan0: link state changed to UP
Sep  1 16:06:21 insomnia devd: Executing '/etc/rc.d/dhclient quietstart wlan0'
Sep  1 16:06:21 insomnia dhclient[1978]: send_packet: No buffer space available
Sep  1 16:06:21 insomnia wpa_supplicant[1830]: wlan0: WPA: Key negotiation completed with 20:b3:99:1c:02:48 [PTK=CCMP GTK=CCMP]
Sep  1 16:06:21 insomnia kernel: ath0: ath_rate_tx_complete: ts_rate=27 ts_finaltsi=0
Sep  1 16:06:21 insomnia kernel: ath0: bad series0 hwrate 0x1b, tries 1 ts_status 0x0
Sep  1 16:06:21 insomnia wpa_supplicant[1830]: wlan0: CTRL-EVENT-CONNECTED - Connection to 20:b3:99:1c:02:48 completed [id=0 id_str=]
Sep  1 16:06:22 insomnia kernel: ath0: ath_rate_tx_complete: ts_rate=27 ts_finaltsi=0
Sep  1 16:06:22 insomnia kernel: ath0: bad series0 hwrate 0x1b, tries 1 ts_status 0x0
Sep  1 16:06:22 insomnia kernel: re0: link state changed to UP
Sep  1 16:06:26 insomnia dhclient: New IP Address (wlan0): 192.168.49.179
Sep  1 16:06:26 insomnia dhclient: New Subnet Mask (wlan0): 255.255.252.0
Sep  1 16:06:26 insomnia dhclient: New Broadcast Address (wlan0): 192.168.51.255
Sep  1 16:06:26 insomnia dhclient: New Routers (wlan0): 192.168.48.1
Sep  1 16:06:26 insomnia devd: Executing '/etc/rc.d/dhclient quietstart re0'
Sep  1 16:07:45 insomnia kernel: ath0: bad series0 hwrate 0x81, tries 2 ts_status 0x0
```
Maybe not great but it never was with this NIC. Moving forward: 
`root@insomnia:~/ath_ndis # cp *.ko /boot/modules/`
/boot/loader.conf

```
netathwx.cat_load="YES"
athw_sys_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
wlan_amrr_load="YES"
```
`shutdown -r now`
This is where it really goes sideways. Boot halts with:

```
ndis0: NDIS API version: 5.1
NDIS: could not find file AW1012d.ini in linker list
NDIS: and no filesystems mounted yet, aborting NdisOpenFile()
NDIS: could not find file regAdd.txt in linker list
NDIS: and no filesystems mounted yet, aborting NdisOpenFile()
```
Same with an attempt to boot into single user mode. USB keyboard is unresponsive (I guess the USB subsystem doesn't come up before the hang).

So, uhm... *HELP! * The system is only three days old so it's not a huge problem but I would rather not begin again with a fresh install.


----------



## kpa (Sep 1, 2015)

The NDIS stuff is not something you should rely on if this is a system intended for real use as a network gateway. Get a separate access point if you can't find a supported wireless NIC that works reliably on FreeBSD using native drivers.


----------



## tobik@ (Sep 1, 2015)

ath(4) is compiled into the GENERIC kernel and attaches itself to your wireless card which means that the NDIS driver probably won't/can't work. Your options would be to either recompile the kernel, exclude ath(4) and try again, or buy another card.


----------



## hanzer (Sep 1, 2015)

kpa said:


> The NDIS stuff is not something you should rely on if this is a system intended for real use as a network gateway.


The handbook doesn't mention that it is experimental or unstable. It does say, _"FreeBSD provides “native” support for the Network Driver Interface Specification (NDIS)"_. If that is a misleading statement or in some other way lacks traction with reality then maybe the handbook maintainers can be notified. I'm willing to be a test case if an experienced user will help me explore the situation.

Alternatively, the ath(4) driver might be okay for this card with some tweaking and tuning. I chose the NDIS route as an exploration of the available technology. Both routes might be explored to completion before settling on a particular configuration (or giving up).



> Get a separate access point if you can't ...


I'm not sure if we understand each other. My gateway isn't configured/used as a wireless access point. Internet service is wireless, _wlan0_ NAT's for (_re0_) the rest of the LAN (wired). 



> ... find a supported wireless NIC that works reliably on FreeBSD using native drivers.


Maybe, as a last resort. Spending money to avoid a problem isn't a great tactic for progress, IMHO. But yeah, if it becomes boring or pointless, I might spend the $15 dollars and bail out.


----------



## hanzer (Sep 1, 2015)

tobik said:


> ath(4) is compiled into the GENERIC kernel and attaches itself to your wireless card which means that the NDIS driver probably won't/can't work. Your options would be to either recompile the kernel, exclude ath(4) and try again, or buy another card.



Aha! The Handbook is a bit misleading on this point (see 30.3.3.1. Kernel Configuration). I compiled the system from source last night but chose not to modify anything on this pass to minimize variables and unknowns. It would have been simple to remove ath(4) from the kernel configuration if I had suspected it was included in GENERIC. D'oh!

The question now is, how can I modify /boot/loader.conf on a system that won't boot? Hmm, can the install DVD be used as a live system? Oh snap! That might work. (Too much coffee again today).


----------



## ondra_knezour (Sep 1, 2015)

Maybe this method can be even easier than the live cd approach?


----------



## hanzer (Sep 2, 2015)

ondra_knezour said:


> Maybe this method can be even easier than the live cd approach?



Disco! Thanks, man. It was option 3 at the boot menu then:
`unload`
`load /boot/kernel/kernel`
`boot`

I removed the offending NDIS module loads from /boot/loader.conf  then `reboot` and all is good. 

I am *so* glad I don't have to rebuild everything from scratch to continue this experiment. Thanks, guys!


----------



## hanzer (Sep 3, 2015)

*Update: Attempt Two*

I compiled the system from source without anything Atheros in the kernel.
`hanzer@insomnia:/usr/src/sys/i386/conf % diff GENERIC INSOMNIA | grep "^>"`

```
> ident  INSOMNIA
> #device  ae  # Attansic/Atheros L2 FastEthernet
> #device  age  # Attansic/Atheros L1 Gigabit Ethernet
> #device  alc  # Atheros AR8131/AR8132 Ethernet
> #device  ale  # Atheros AR8121/AR8113/AR8114 Ethernet
> #device  ath  # Atheros NICs
> #device  ath_pci  # Atheros pci/cardbus glue
> #device  ath_hal  # pci/cardbus chip support
> #options  AH_SUPPORT_AR5416  # enable AR5416 tx/rx descriptors
> #options  AH_AR5416_INTERRUPT_MITIGATION # AR5416 interrupt mitigation
> #options  ATH_ENABLE_11N  # Enable 802.11n support for AR5416 and later
> #device  ath_rate_sample  # SampleRate tx rate control for ath
```
And recreated the NDIS modules from the WindowsXP driver files (just for good measure) as described earlier in this thread. The current state is:
`cat /boot/loader.conf`

```
#netathwx.cat_load="YES"
#athw_sys_load="YES"
if_ath_load="YES"
if_ath_pci_load="YES"
#wlan_wep_load="YES"
#wlan_ccmp_load="YES"
#wlan_tkip_load="YES"
#wlan_amrr_load="YES"
```
`kldstat`

```
Id Refs Address  Size  Name
 1  13 0xc0400000 12d5d40  kernel
 2  2 0xc16d6000 f0b14  if_ath.ko
 3  1 0xc17c7000 3844  if_ath_pci.ko
 4  1 0xc5a82000 3000  pflog.ko
 5  1 0xc5a86000 3b000  pf.ko
 6  1 0xc5da0000 2000  green_saver.ko
```
Now unload ath(4):
`kldunload if_ath.ko`
`kldunload if_ath_pci.ko`
`dmesg | tail`

```
wlan0: link state changed to DOWN
ath0: ath_descdma_cleanup: rx: mbuf should've been unmapped/freed!
ath0: detached
pci1: <network> at device 9.0 (no driver attached)
```
Okay, so far. Now load the ndis modules.
`kldload ndis` okay.
`kldload netathwx.cat.ko` okay.
`kldload athw_sys.ko` screen blanks and system hangs.

Reboot and repeat; trying a different load order this time:
`kldload ndis` okay.
`kldload athw_sys.ko` 
Console displays:

```
no match for ZwOpenKey
no match for ZwDeleteKey
no match for ZwCreateKey
ndis0: <TP-LINK 150Mbps Wireless N Adapter> mem 0xfdee000-0xfdeefff irq 17 at device 9.0 on pci1
ndis0: NDIS API version: 5.1
NDIS: open file /compat/ndis/AW1012d.ini failed: 2
NDIS: open file /compat/ndis/regAdd.txt failed: 2
```
And the system hangs. What fun!


----------



## mzs47 (Jun 20, 2016)

Hi, were you able to get this working? I have bought a device based on this chipset.


----------

