From: Gabor Juhos Date: Wed, 04 Mar 2009 15:57:30 +0100 Subject: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices In-Reply-To: <18862.36931.112561.497768@gargle.gargle.HOWL> References: <1236103846-1672-1-git-send-email-juhosg@openwrt.org> <18862.1025.217829.656599@gargle.gargle.HOWL> <49AE851B.2070709@openwrt.org> <18862.36931.112561.497768@gargle.gargle.HOWL> Message-ID: <49AE96DA.9010208@openwrt.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org Sujith ?rta: > Gabor Juhos wrote: >>>> +#define AR_SREV_5416(_ah) \ >>>> + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \ >>>> + ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI)) >>>> +#define AR_SREV_5416_V20_OR_LATER(_ah) \ >>>> + (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \ >>>> + ((AR_SREV_5416(_ah)) && \ >>>> + ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))) >>>> +#define AR_SREV_5416_V22_OR_LATER(_ah) \ >>>> + (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \ >>>> + ((AR_SREV_5416(_ah)) && \ >>>> + ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))) >>>> + >>> Hm, the 5416_V1, 5416_V2 macros have to check 3 different HW (5416, 9100, 9160). >> I don't see any 5416_V1 macro here. The AR_SREV_5416 should check the silicon >> revision of the AR5416 cards only. But if we would be consistent, we should have >> a _V10_OR_LATER although i don't see where it would be useful. The _V20_OR_LATER >> and the _V22_OR_LATER macro I proposed above will cover the 9100 and 9160 chips. >> > > I meant the AR_SREV_5416_V20_OR_LATER and AR_SREV_5416_V22_OR_LATER macros. > Yes, the naming implies that they are meant for AR5416 chipsets only, but they > do handle AR9100 and AR9160 chipsets. > > The proposed macros don't have the AR9100 and AR9160 macVersion checks, no ? You are right, they don't have such version checks explicitly, but AR_SREV_VERSION_9100 > AR_SREV_VERSION_5416_PCIE and AR_SREV_VERSION_9160 > AR_SREV_VERSION_5416_PCIE Maybe this looks cleaner: #define AR_SREV_5416_V20_OR_LATER(_ah) \ (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100) || \ ((AR_SREV_5416(_ah)) && \ ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))) #define AR_SREV_5416_V22_OR_LATER(_ah) \ (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100) || \ ((AR_SREV_5416(_ah)) && \ ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))) or in this form: #define AR_SREV_5416_V20_OR_LATER(_ah) \ (((AR_SREV_5416(_ah)) && \ ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) || \ ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) #define AR_SREV_5416_V22_OR_LATER(_ah) \ (((AR_SREV_5416(_ah)) && \ ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) || \ ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)) Regards, Gabor