All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julian Calaby <julian.calaby@gmail.com>
To: Ivo Van Doorn <ivdoorn@gmail.com>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: Re: [PATCH 4/9] rt2x00: Remove rt2800 version constants.
Date: Fri, 9 Apr 2010 17:00:14 +1000	[thread overview]
Message-ID: <h2t646765f41004090000o607f02al34df4b3556019a24@mail.gmail.com> (raw)
In-Reply-To: <k2ra32f33a41004082354y2bf33919y7f0f476b62612cf6@mail.gmail.com>

On Fri, Apr 9, 2010 at 16:54, Ivo Van Doorn <ivdoorn@gmail.com> wrote:
> On Fri, Apr 9, 2010 at 1:53 AM, Julian Calaby <julian.calaby@gmail.com> wrote:
>> On Fri, Apr 9, 2010 at 08:32, Ivo van Doorn <ivdoorn@gmail.com> wrote:
>>> On Thursday 08 April 2010, Gertjan van Wingerde wrote:
>>>> The rt2800 version constants are inconsistent, and the version number don't
>>>> mean a lot of things anyway. Use the literal values in the code instead of
>>>> some sort of fabricated version name macro.
>>>>
>>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>>
>>> Perhaps a more elegant way of using and defining needs to be found.
>>> But at least the defined show what the purpose for the values is
>>> rather then having magical values spread around the code.
>>
>> Maybe something like:
>>
>> #define RTDEV_IS_RT2883_R1(dev) (rt2x00_rt(dev, RT2883) && \
>>                                                   rt2x00_rev(dev) < 0x0300)
>
> I considered this as well, but we have many checks which either do
>    rt2x00_rev() < 0xffff
> but also
>    rt2x00_ref() == 0xffff

I assume that there are certain ranges of revisions that correspond to
certain chips with certain ... features. So, you could have:

#define RTDEV_IS_RT2883_R1(dev) (rt2x00_rt(dev, RT2883) && \
                                                  rt2x00_rev(dev) < 0x0300)

for the original chip, then

#define RTDEV_IS_RT2883_R2(dev) (rt2x00_rt(dev, RT2883) && \
                                                  rt2x00_rev(dev) >= 0x0300 && \
                                                  rt2x00_rev(dev) < 0x1000)

for the troubled second version and

#define RTDEV_IS_RT2883_R3(dev) (rt2x00_rt(dev, RT2883) && \
                                                  rt2x00_rev(dev) >= 0x1000)

as a catch all for newer chips.

Thanks,

-- 

Julian Calaby

Email: julian.calaby@gmail.com
.Plan: http://sites.google.com/site/juliancalaby/

  reply	other threads:[~2010-04-09  7:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-08 21:50 [PATCH 0/9] rt2x00: Align with vendor driver and add support for rt3070/rt3071/rt3090/rt3390 Gertjan van Wingerde
2010-04-08 21:50 ` [PATCH 1/9] rt2x00: Let RF chipset decide the RF channel switch method to use in rt2800 Gertjan van Wingerde
2010-04-08 22:17   ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 2/9] rt2x00: Update rt2800 register definitions towards latest definitions Gertjan van Wingerde
2010-04-08 22:17   ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 3/9] rt2x00: Align RT chipset definitions with vendor driver Gertjan van Wingerde
2010-04-08 22:28   ` Felix Fietkau
2010-04-09  5:10     ` Gertjan van Wingerde
2010-04-09  5:38       ` Gertjan van Wingerde
2010-04-09  7:42         ` Helmut Schaa
2010-04-09  5:43       ` Felix Fietkau
2010-04-09 11:32         ` Helmut Schaa
2010-04-09 11:52           ` Felix Fietkau
2010-04-09 12:23             ` Helmut Schaa
2010-04-09 12:26               ` Felix Fietkau
2010-04-09 12:30                 ` Luis Correia
2010-04-09 14:01                   ` Gabor Juhos
2010-04-09 12:32                 ` Helmut Schaa
2010-04-09 17:23                   ` Gertjan van Wingerde
2010-04-08 22:33   ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 4/9] rt2x00: Remove rt2800 version constants Gertjan van Wingerde
2010-04-08 22:32   ` Ivo van Doorn
2010-04-08 23:53     ` Julian Calaby
2010-04-09  6:54       ` Ivo Van Doorn
2010-04-09  7:00         ` Julian Calaby [this message]
2010-04-10  8:57           ` Gertjan van Wingerde
2010-04-10  9:16             ` Ivo van Doorn
2010-04-10 11:20             ` Julian Calaby
2010-04-09 21:53     ` [rt2x00-users] " Benoit PAPILLAULT
2010-04-10  8:57       ` Gertjan van Wingerde
2010-04-08 21:50 ` [PATCH 5/9] rt2x00: Align rt2800 register initialization with vendor driver Gertjan van Wingerde
2010-04-08 22:33   ` Ivo van Doorn
2010-04-10 19:14     ` Gertjan van Wingerde
2010-04-10 20:58       ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 6/9] rt2x00: Finish rt3070 support in rt2800 register initialization Gertjan van Wingerde
2010-04-08 22:33   ` Ivo van Doorn
2010-04-10 20:52     ` Gertjan van Wingerde
2010-04-08 21:50 ` [PATCH 7/9] rt2x00: Add rt3071 " Gertjan van Wingerde
2010-04-08 22:38   ` Ivo van Doorn
2010-04-10 21:30     ` Gertjan van Wingerde
2010-04-08 21:50 ` [PATCH 8/9] rt2x00: Add rt3090 " Gertjan van Wingerde
2010-04-08 22:39   ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 9/9] rt2x00: Add rt3390 " Gertjan van Wingerde
2010-04-08 22:39   ` Ivo van Doorn
2010-04-08 22:16 ` [PATCH 0/9] rt2x00: Align with vendor driver and add support for rt3070/rt3071/rt3090/rt3390 Ivo van Doorn
2010-04-10  9:01   ` Gertjan van Wingerde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=h2t646765f41004090000o607f02al34df4b3556019a24@mail.gmail.com \
    --to=julian.calaby@gmail.com \
    --cc=gwingerde@gmail.com \
    --cc=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.