Atheros Continued.

Pat Suwalski pat at
Fri Jun 25 21:38:37 PDT 2004

I decided to take another evening for hal/ath debugging.

Again, very unusual results, as can be seen in the pasted in gdb excerpt 
from mii_get_rate(). The ->udi field goes crazy for no good reason, and 
that it what ultimately causes the program to crash.

There is some sort of memory corruption in mii_get_link(). I know this, 
because if I return right after the first mdio_read, everything is well. 
On the other hand, if I comment out the second mdio_read, it will crash 
because the next line is there. This has been successfully iteratively 
tested by commenting out successive lines.

While I could not come to any conclusions whatsoever, commenting out the 
call to mii_get_link() solves all problems in terms of crashes.

My suspicions lie in the ioctl() calls within mdio_read, which cause the 

[E] linux/net_class_device.c:132 mdio_read() : SIOCGMIIREG on ath0 
failed: Invalid argument

That whole function is suspicious and not documented. The way it 
accesses data[] seems potentially dangerous. The ways it uses 
new_ioctl_nums is cryptic. However that function pokes at my card might 
be what's causing a cascade to prevent other io reads from working later 
and then weird detrimental effects throughout.

I'm wondering if the 'right' thing to do at this point isn't to actually 
blacklist ath* from entering mii_get_link(). :(



(gdb) print *d
$6 = {parent = {g_type_instance = {g_class = 0x0}, ref_count = 0, qdata 
= 0x1}, udi = 0x0, properties = 0x0}
(gdb) n
162             if (ioctl (sockfd, 0x8947, &ifr) >= 0)
164             else if (ioctl (sockfd, SIOCDEVPRIVATE, &ifr) >= 0)
167                     HAL_ERROR (("SIOCGMIIPHY on %s failed: %s",
[E] linux/net_class_device.c:168 mii_get_rate() : SIOCGMIIPHY on 
failed: No such device
169                     close (sockfd);
198             close (sockfd);
199     }
(gdb) print *d
$7 = {parent = {g_type_instance = {g_class = 0x5f69696d}, ref_count = 
1601463655, qdata = 0x65746172}, udi = 0x72724500 <Address 0x72724500 
out of bounds>,
   properties = 0x7220726f}

hal mailing list
hal at

More information about the Hal mailing list