Search Linux Wireless

ath5k: ath5k_pci_probe(): weirdo code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

that 2GHz/5GHz radio information code in ath5k_pci_probe() in 2.6.31-rc6 source
seems VERY weird.
ah_radio_5ghz_revision/ah_radio_2ghz_revision conditional evaluation seems
completely bonkered in several places, unless something is escaping on
me.
Then also at this place, why is there no
else
{
  WARN_ONCE(...); // Huh. Unknown/unhandled/impossible revision combo
}
branch at the end? (or something less incinerating)
I've had my few lessons about defensive programming...
(and applying such stuff liberally in this entire driver wouldn't hurt either)


The

        if (!sc->ah->ah_single_chip) {
                /* Single chip radio (!RF5111) */

part seemed weird logic, too, but I then thought that this code section
is perhaps _intended_ to be skipped in this case, to simply not log anything
for single-chip radios
(but the comment above would be very insufficient/confusing if that is
the case, and if the entire weird section is _actually_ correct as it stands
then even lots more rectifying comments about this strange evaluation
being correct are missing).

Could anyone enlighten me?
So far it looks like a large part of this code is buggy, but I could be
wrong.



BTW, I'm currently on 2.6.31-rc6 on Aspire One, with even more ath5k problems
than before, connection is dying every couple minutes, extended to every
couple dozen minutes if I force rate 1M
(but it looks like "[Bug #13948] ath5k broken after suspend-to-ram"
http://lkml.org/lkml/2009/8/19/468 is hopefully covering these issues already).
And I do have CONFIG..._PS (powersave) enabled by default...
And I do make liberal use of suspend-to-ram, as should everyone.

Thanks,

Andreas Mohr
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux