# Atheros wifi and kernel panic



## t4z3v4r3d (Dec 4, 2010)

Hi , I've an unknown problem by My BSD BOX and Wifi card .
The trouble is here : when i want to connect to this machine by wifi connection as client ,
My BSD goes to panic page and .... so on .
I checked :
/etc/regdomain.xml :  OK
dhcpd conf :
	
	



```
option domain-name "winkiller";
option domain-name-servers winkiller;
option subnet-mask 255.255.255.0;

default-lease-time 3600;
max-lease-time 86400;
ddns-update-style none;

  subnet 192.168.0.0 netmask 255.255.255.240 {
  range 192.168.0.2 192.168.0.15;
  option routers 192.168.0.1;
}

host mobile {
  hardware ethernet my-client-mac;
  fixed-address 192.168.0.7;
}
```

my BSD box kernel : 8.1 stable 

how can i trace the problem ? and what is the solution ?

sorry for my bad English 
Thanks


----------



## t4z3v4r3d (Dec 5, 2010)

any reply ? anyone can guess  anything ?

This is my Problem!

http://86.109.59.18/20101205_001.jpg


----------



## richardpl (Dec 5, 2010)

You will get better response if you post textdump output instead of image. Also it is better to ask this kind of question on one of mailing lists.


----------



## t4z3v4r3d (Dec 5, 2010)

Response ? text ? dump from what when the machine goes to panic  ? can you tell me ? I wanna know this how to.
Yes u right  . I'm trying to find it out in Google ! but i found no solution yet ....
Here is the forums of FreeBSD  OK ? where i should ask my BSD's Questions ? hum ?
But thank you 
Sorry for my bad English.


----------



## Alt (Dec 5, 2010)

You should show ifconfig and rc.conf
P.S. And you should clean your monitor xD


----------



## t4z3v4r3d (Dec 6, 2010)

```
rc.conf

#################################################
##### RC.CONF EDITED ############################
#################################################
keymap="us.iso"
linux_enable="YES"

ifconfig_rl0="inet              192.168.12.1    netmask 255.255.255.0 media auto"
ifconfig_rl0_alias0="inet       192.168.10.20   netmask 255.255.255.0 media auto"
ifconfig_sk0="inet              192.168.100.1   netmask 255.255.255.0 media auto"
#ifconfig_sk0_alias0="inet      192.168.1.33    netmask 255.255.255.0 media auto"

############################################################################
#ifconfig_sk0_alias1="inet 192.168.178.3 netmask 255.255.255.0 media auto"
#ifconfig_sk0_alias2="inet 192.168.1.23 netmask 255.255.255.0 media auto"
#ifconfig_em1="inet 192.168.100.20 netmask 255.255.255.0 media auto"
###########################################################################
ivpv6_enable="NO"
defaultrouter="192.168.100.120"
hostname="t4yt4n"
compat4x_enbale="YES"
compat5x_enable="YES"
fsck_y_enable="YES"
clear_tmp_enable="YES"
sendmail_enable="NONE"
#apache_enable="YES"
#qmail_enable="YES"
#spamd_enable="YES"
#clamd_enable="YES"
svscan_enable="YES"
#################################################
gateway_enable="YES"
natd_enable="YES"
natd_interface="sk0"
natd_flags="-dynamic -m"
named_enable="YES"
firewall_enable="YES"
firewall_type="open"
firewall_script="/etc/ipfw.rules"
firewall_logging="YES"
sshd_enable="YES"
#firewall_script="/root/run-nat.sh"
#mysql_enable="YES"
################## CLUSTER  #####################
#distccd_enable="YES"
#distccd_flags="-a 192.168.100.0/8 -a 127.0.0.0/8 --user distcc --daemon -P /var/run/distccd.pid"
condor_enable="YES"
#################################################
#################################################
#### K3B ########################################
#dbus_enable="YES"
#polkitd_enable="YES"
hald_enable="YES"
#################################################
saver="daemon"
rotorouter_enable=YES
router="/sbin/routed"          
router_flags="-q" 
# added by xorg-libraries port
local_startup="/usr/local/etc/rc.d"
##################################################
nfs_client_enable="YES"
nfs_client_flags="-n 4" 
##################################################
devd_enable="YES"
#########################################################
#$  JAILER Script Add by t4z3v4r3d $"FreeBSD 6.4-RELEASE-p7" v 0.1
#########################################################
#jail_enable="YES"
#jail_set_hostname_allow="NO"
#jail_list="www"
#jail_ns_hostname="ns.example.org"
#jail_ns_ip="192.168.3.17"
#jail_ns_rootdir="/usr/jailes/ns"
#jail_ns_devfs_enable="YES"
#jail_mail_hostname="mail.example.org"
#jail_mail_ip="192.168.3.18"
#jail_mail_rootdir="/usr/jailes/mail"
#jail_mail_devfs_enable="YES"
#jail_www_hostname="www.example.org"
#jail_www_ip="192.168.10.22"
#jail_www_rootdir="/usr/jailes/www"
#jail_www_devfs_enable="YES"
############################################################
### STORAGE ON MY BSDBOX ###################################
############################################################
fusefs_enable="YES"
devfs_system_ruleset="localrules"
```


```
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:02:
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11b <adhoc>
        status: running
fwe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 02:0f:
        ch 1 dma -1
fwip0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        lladdr 0.f.ea.
sk0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80009<RXCSUM,VLAN_MTU,LINKSTATE>
        ether 00:0f:
        inet 192.168.100.1 netmask 0xffffff00 broadcast 192.168.100.255
        media: Ethernet autoselect (1000baseT <full-duplex,flag0,flag1>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6 
        inet6 ::1 prefixlen 128 
        inet 127.0.0.1 netmask 0xff000000 
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
ipfw0: flags=8801<UP,SIMPLEX,MULTICAST> metric 0 mtu 65536
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:02:
        inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
        media: IEEE 802.11 Wireless Ethernet autoselect <adhoc> (autoselect <adhoc>)
        status: no carrier
        ssid t4yt4n channel 13 (2472 MHz 11b)
        regdomain 55 indoor ecm authmode OPEN privacy OFF txpower 20
        scanvalid 60 wme burst bintval 0
```



```
/usr/local/etc/rc.d/xw.sh 
if [ "$1" = "start" ];then

       ifconfig wlan0 destroy  2>/dev/null
       killall -9 dhcpd        2>/dev/null

       ifconfig wlan0 create wlandev ath0 wlanmode adhoc 
       ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid t4yt4n

       sleep 2
       dhcpd wlan0

fi
```


----------



## bschmidt (Dec 7, 2010)

t4z3v4r3d said:
			
		

> any reply ? anyone can guess  anything ?
> 
> This is my Problem!
> 
> http://86.109.59.18/20101205_001.jpg



Ah.. guess I've seen that one before. Just to make sure, can you do

```
# kgdb /boot/kernel/wlan.ko.symbols
kgdb> list *(adhoc_input+0x9eb)
```
and post the result please?


----------



## t4z3v4r3d (Dec 7, 2010)

Hi , Thank you for reply!
look :



```
root@ t4yt4n ~ # kgdb /boot/kernel/wlan.ko.symbols
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...No struct type named linker_file.
No struct type named linker_file.
No struct type named linker_file.
No symbol "linker_path" in current context.
No symbol "linker_files" in current context.
No symbol "linker_kernel_file" in current context.
No symbol "calltrap" in current context.
No struct type named linker_file.
No struct type named linker_file.
No struct type named linker_file.
No symbol "linker_path" in current context.
No symbol "linker_files" in current context.
No symbol "linker_kernel_file" in current context.
No symbol "calltrap" in current context.

(kgdb) list *(adhoc_input+0x9eb)
0x350fb is in adhoc_input (/usr/src/sys/modules/wlan/../../net80211/ieee80211_adhoc.c:413).
408                     ni->ni_noise = nf;
409                     if (HAS_SEQ(type)) {
410                             uint8_t tid = ieee80211_gettid(wh);
411                             if (IEEE80211_QOS_HAS_SEQ(wh) &&
412                                 TID_TO_WME_AC(tid) >= WME_AC_VI)
413                                     ic->ic_wme.wme_hipri_traffic++;
414                             rxseq = le16toh(*(uint16_t *)wh->i_seq);
415                             if ((ni->ni_flags & IEEE80211_NODE_HT) == 0 &&
416                                 (wh->i_fc[1] & IEEE80211_FC1_RETRY) &&
417                                 SEQ_LEQ(rxseq, ni->ni_rxseqs[tid])) {
```


and it has been enabled in GENERIC Config that i'm using.

```
device          ath             # Atheros pci/cardbus NIC's
```


----------



## bschmidt (Dec 7, 2010)

Uhm, sorry, I guess you also have wlan build into the kernel and not as module, so the correct commands would be:

```
# kgdb /boot/kernel/kernel.symbols
kgdb> list *(adhoc_input+0x9eb)
```


----------



## t4z3v4r3d (Dec 8, 2010)

```
0xc0977c7b is in adhoc_input (/usr/src/sys/net80211/ieee80211_adhoc.c:639).
634                             IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
635                                 wh, NULL, "%s", "WEP set but not permitted");
636                             vap->iv_stats.is_rx_mgtdiscard++; /* XXX */
637                             goto out;
638                     }
639                     vap->iv_recv_mgmt(ni, m, subtype, rssi, nf);
640                     goto out;
641
642             case IEEE80211_FC0_TYPE_CTL:
643                     vap->iv_stats.is_rx_ctl++;
```


----------



## t4z3v4r3d (Dec 10, 2010)

No way ?
!: Sometimes this works but only after 5-6 times enabling and disabling wlan device ! .


----------



## bschmidt (Dec 10, 2010)

I tried to reproduce this but I'm not able to. So, I assume you can reproduce this, can you add `# wlandebug 0xffffffff` into the script you are using right after the `# ifconfig wlan0 create ..` line and reproduce the issue? This would help me get a better clue about what's going on.

FYI, I don't see how it can break in line 639, that code is pretty safe there and any variable is used before.. so, I guess some other command is breaking your use case.


----------



## t4z3v4r3d (Dec 11, 2010)

Thank you I'll try it.


----------



## t4z3v4r3d (Dec 11, 2010)

This is result of tail -f messages 


```
root@ t4yt4n ~ # wlandebug 0xffffffff
net.wlan.0.debug: 0xffffffff<11n,debug,dumppkts,crypto,input,xrate,elemid,node,assoc,auth,scan,output,state,power
,hwmp,dot1xsm,radius,raddump,mesh,wpa,acl,wme,superg,doth,inact,roam,rate,action,wds,ioctl,tdma>
root@ t4yt4n ~ # dchpd wlan0
```

I founded this lines of FBSD sources wich is similar to this error :

http://fxr.googlebit.com/source/sys/net80211/ieee80211_node.c?v=8-CURRENT#L1877
http://fxr.googlebit.com/source/sys/net80211/ieee80211_node.c?v=8-CURRENT#L2086




```
Dec 11 17:25:01 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 19 inact_reload 20 nrates 12
Dec 11 17:25:16 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 18 inact_reload 20 nrates 12
Dec 11 17:25:31 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 17 inact_reload 20 nrates 12
Dec 11 17:25:46 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 16 inact_reload 20 nrates 12
Dec 11 17:26:01 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 15 inact_reload 20 nrates 12
Dec 11 17:26:16 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 14 inact_reload 20 nrates 12
Dec 11 17:26:31 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 13 inact_reload 20 nrates 12
Dec 11 17:26:46 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 12 inact_reload 20 nrates 12
Dec 11 17:27:01 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 11 inact_reload 20 nrates 12
Dec 11 17:27:16 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 10 inact_reload 20 nrates 12
Dec 11 17:27:31 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 9 inact_reload 20 nrates 12
Dec 11 17:27:46 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 8 inact_reload 20 nrates 12
Dec 11 17:28:01 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 7 inact_reload 20 nrates 12
Dec 11 17:28:16 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 6 inact_reload 20 nrates 12
Dec 11 17:28:31 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 5 inact_reload 20 nrates 12
Dec 11 17:28:46 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 4 inact_reload 20 nrates 12
Dec 11 17:29:01 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 3 inact_reload 20 nrates 12
Dec 11 17:29:16 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 2 inact_reload 20 nrates 12
Dec 11 17:29:31 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 1 inact_reload 20 nrates 12
Dec 11 17:29:46 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ieee80211_timeout_stations: inact 0 inact_reload 20 nrates 12
```


----------



## t4z3v4r3d (Dec 11, 2010)

This is last log! My machine 's HDD WAS crashed (for more than 30 times doing fsck automatically to load my BSD) and I have no any FreeBSD NOW!
SO why this trouble is in FreeBSD? What is the source? What is the problem?

Anyone can help me?



```
Dec 11 22:57:55 t4yt4n kernel: wlan0: [3c:f7:] recv probe req
Dec 11 22:57:55 t4yt4n kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc5e19000<00:02:6f:75:c4:de> refcnt 5
Dec 11 22:57:55 t4yt4n kernel: wlan0: send probe resp on channel 10 to 3c:f7:
Dec 11 22:57:55 t4yt4n kernel: wlan0: received probe_req from 3c:f7: rssi 51
Dec 11 22:57:55 t4yt4n kernel: wlan0: [3c:f7:] recv probe req
Dec 11 22:57:55 t4yt4n kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc5e19000<00:02:6f:75:c4:de> refcnt 6
Dec 11 22:57:55 t4yt4n kernel: wlan0: send probe resp on channel 10 to 3c:f7:
Dec 11 22:57:55 t4yt4n kernel: wlan0: received probe_req from 3c:f7: rssi 51
Dec 11 22:57:55 t4yt4n kernel: wlan0: [3c:f7:] recv probe req
Dec 11 22:57:55 t4yt4n kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc5e19000<00:02:6f:75:c4:de> refcnt 7
Dec 11 22:57:55 t4yt4n kernel: wlan0: send probe resp on channel 10 to 3c:f7:
Dec 11 22:57:55 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ath_rate_tx_complete: size 250 OK rate/try 0/1 no rates yet
Dec 11 22:57:55 t4yt4n last message repeated 2 times
Dec 11 22:57:55 t4yt4n kernel: wlan0: received probe_req from 3c:f7: rssi 44
Dec 11 22:57:55 t4yt4n kernel: wlan0: [3c:f7:] recv probe req
Dec 11 22:57:55 t4yt4n kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc5e19000<00:02:6f:75:c4:de> refcnt 5
Dec 11 22:57:55 t4yt4n kernel: wlan0: send probe resp on channel 10 to 3c:f7:
Dec 11 22:57:55 t4yt4n kernel: wlan0: [00:02:6f:75:c4:de] ath_rate_tx_complete: size 250 FAIL rate/try 0/5 no rates yet
```


----------



## bschmidt (Dec 12, 2010)

So, thanks for the logs. What I need to know is what is the _last_ message right before the panic? The messages above are all valid and expected output, nothing wrong there.


----------



## t4z3v4r3d (Dec 12, 2010)

These logs are my last logs ! and i have nothing else yet .... .Because my hard disk was crashed (hardware crash ) and i have no any hard disk to read logs .

Unfortunately  My wlan card is chiniz !!!! device 
this is the original  :pi-3601s


----------

