Hello,
I have a Soekris net6501-50 with an Atheros AR9380 (model AR5BXB112)
wireless card attached to a Mini PCI Express slot. When attempting to
`ifconfig athn0 scan`, or otherwise interact with the interface, I
trigger a panic. I’ve tried both with and without the athn firmware
installed via `fw_update`, and even tested the card in a PCI-E
adapter.
Here’s the panic line:
panic: kernel diagnostic assertion "pin < sc->ngpiopins" failed: file
"../../../../dev/ic/ar9003.c", line 514
I've included trace, ps, registers and objdump output below. Any help
would be appreciated!
Cheers,
Mark
`trace` output:
ddb> trace
Debugger(d09da499,f54bc948,d09b7298,f54bc948,0) at Debugger+0x4
panic(d09b7298,d0935a26,d0996d20,d099eec4,202) at panic+0x67
__assert(d0935a26,d099eec4,202,d0996d20,1) at __assert+0x2e
ar9003_gpio_write(d1f40000,ff,1,d1f40000,d1f40000) at ar9003_gpio_write+0xa2
athn_set_led(d1f40000,0,0,1,80) at athn_set_led+0x31
athn_led_init(d1f40000,7f,0,f54bc9ec,d0203009) at athn_led_init+0x35
athn_init(d1f40030,d0b21068,d6efb220,d2491200,d1f40030) at athn_init+0xe8
athn_ioctl(d1f40030,8020690c,d2491200,d0427410,d2491228) at athn_ioctl+0x1cc
in6_ifinit(d1f40030,d2491200,1,d03c6d49,d6cce2ac) at in6_ifinit+0xbe
in6_update_ifa(d1f40030,f54bcc10,0,0,0) at in6_update_ifa+0x292
in6_ifattach_linklocal(d1f40030,0,f54bcd7c,3c50,f8214ba2) at in6_ifattach_linkl
ocal+0x128
in6_ifattach(d1f40030,0,f54bcd7c,d03c78a5,f54bcd68) at in6_ifattach+0xdd
in6_if_up(d1f40030,d09bd23c,cfbd5000,3c02d003,80206910) at in6_if_up+0x13
if_up(d1f40030,0,0,3c02d003,d1cf9030) at if_up+0x6e
ifioctl(d6c8ec40,80206910,f54bce84,d6cded68,f54bcec8) at ifioctl+0xcdb
sys_ioctl(d6cded68,f54bcf64,f54bcf84,f54bcfa8,d6e59b00) at sys_ioctl+0x144
syscall() at syscall+0x214
--- syscall (number 10) ---
0x2:
`ps` output:
ddb> ps
PID PPID PGRP UID S FLAGS WAIT COMMAND
*20727 19085 20727 0 7 0x3 ifconfig
19085 7999 19085 0 3 0x8b pause zsh
7999 12432 7999 1000 3 0x8b pause zsh
12432 1 12432 1000 2 0 tmux
8775 3974 8775 1000 3 0x83 kqread tmux
3974 28811 3974 1000 3 0x8b pause zsh
28811 3693 3693 1000 3 0x90 select sshd
3693 9282 3693 0 3 0x92 poll sshd
19024 1 19024 0 3 0x83 ttyin getty
9267 1 9267 0 3 0x80 select cron
31441 1 31441 0 3 0x80 nanosleep watchdogd
2267 1 2267 601 3 0x90 kqread unbound
30127 1 30127 688 3 0x90 kqread dnscrypt-proxy
10904 1 10904 0 3 0xb0 select sendmail
4418 1 4418 77 3 0x90 poll dhcpd
9282 1 9282 0 3 0x80 select sshd
31370 21117 10004 83 3 0x90 poll ntpd
21117 10004 10004 83 3 0x90 poll ntpd
10004 1 10004 0 3 0x80 poll ntpd
14077 21793 21793 74 3 0x90 bpf pflogd
21793 1 21793 0 3 0x80 netio pflogd
7320 31362 31362 73 3 0x90 poll syslogd
31362 1 31362 0 3 0x80 netio syslogd
21221 0 0 0 3 0x4200 aiodoned aiodoned
23527 0 0 0 3 0x4200 syncer update
13509 0 0 0 3 0x4200 cleaner cleaner
25814 0 0 0 3 0x4200 reaper reaper
30850 0 0 0 3 0x4200 pgdaemon pagedaemon
30879 0 0 0 3 0x4200 bored crypto
11107 0 0 0 3 0x4200 pftm pfpurge
8157 0 0 0 3 0x4200 mmctsk sdmmc1
26366 0 0 0 3 0x4200 mmctsk sdmmc0
24641 0 0 0 3 0x4200 usbtsk usbtask
28718 0 0 0 3 0x4200 usbatsk usbatsk
16005 0 0 0 3 0x4200 bored sensors
21790 0 0 0 3 0x4200 bored systq
19530 0 0 0 3 0x4200 bored syswq
30656 0 0 0 3 0x40004200 idle0
25734 0 0 0 3 0x4200 kmalloc kmthread
1 0 1 0 3 0x82 wait init
0 -1 0 0 3 0x200 scheduler swapper
`show registers` output:
ddb> show registers
ds 0x10
es 0x10
fs 0x20
gs 0
edi 0xd09b7298 systq+0x1ae0
esi 0x100
ebp 0xf54bc8fc
ebx 0xf54bc948
edx 0x1
ecx 0xd0b2008c kprintf_mutex
eax 0x1
eip 0xd055fc74 Debugger+0x4
cs 0x8
eflags 0x202
esp 0xf54bc8fc
ss 0x10
Debugger+0x4: popl %ebp
`objdump` output:
/*
* Access to General Purpose Input/Output ports.
*/
int
ar9003_gpio_read(struct athn_softc *sc, int pin)
{
KASSERT(pin < sc->ngpiopins);
return (((AR_READ(sc, AR_GPIO_IN) & AR9300_GPIO_IN_VAL) &
(1 << pin)) != 0);
}
void
ar9003_gpio_write(struct athn_softc *sc, int pin, int set)
{
uint32_t reg;
KASSERT(pin < sc->ngpiopins);
reg = AR_READ(sc, AR_GPIO_IN_OUT);
if (set)
reg |= 1 << pin;
else
reg &= ~(1 << pin);
AR_WRITE(sc, AR_GPIO_IN_OUT, reg);
AR_WRITE_BARRIER(sc);
}