From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: linux-wireless@vger.kernel.org, Ivo van Doorn <ivdoorn@gmail.com>,
linux-kernel@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [PATCH 10/41] rt2800pci: add rt2800_register_[read,write]() wrappers
Date: Fri, 6 Nov 2009 17:13:15 +0100 [thread overview]
Message-ID: <200911061713.15898.bzolnier@gmail.com> (raw)
In-Reply-To: <14add3d10911041116q1bb293a9hbd6c5361d59fe588@mail.gmail.com>
On Wednesday 04 November 2009 20:16:26 Gertjan van Wingerde wrote:
> On Wed, Nov 4, 2009 at 6:33 PM, Bartlomiej Zolnierkiewicz
> <bzolnier@gmail.com> wrote:
> > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > Subject: [PATCH] rt2800pci: add rt2800_register_[read,write]() wrappers
> >
> > Part of preparations for later code unification.
> >
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > ---
> > drivers/net/wireless/rt2x00/rt2800pci.c | 479 ++++++++++++++++----------------
> > drivers/net/wireless/rt2x00/rt2800pci.h | 21 +
> > 2 files changed, 261 insertions(+), 239 deletions(-)
> >
> > Index: b/drivers/net/wireless/rt2x00/rt2800pci.c
> > ===================================================================
> > --- a/drivers/net/wireless/rt2x00/rt2800pci.c
> > +++ b/drivers/net/wireless/rt2x00/rt2800pci.c
> > @@ -57,7 +57,7 @@ MODULE_PARM_DESC(nohwcrypt, "Disable har
> > /*
> > * Register access.
> > * All access to the CSR registers will go through the methods
> > - * rt2x00pci_register_read and rt2x00pci_register_write.
> > + * rt2800_register_read and rt2800_register_write.
> > * BBP and RF register require indirect register access,
> > * and use the CSR registers BBPCSR and RFCSR to achieve this.
> > * These indirect registers work with busy bits,
> > @@ -66,6 +66,7 @@ MODULE_PARM_DESC(nohwcrypt, "Disable har
> > * between each attampt. When the busy bit is still set at that time,
> > * the access attempt is considered to have failed,
> > * and we will print an error.
> > + * The _lock versions must be used if you already hold the csr_mutex
> > */
> > #define WAIT_FOR_BBP(__dev, __reg) \
> > rt2x00pci_regbusy_read((__dev), BBP_CSR_CFG, BBP_CSR_CFG_BUSY, (__reg))
>
> The change to the _lock variant seems a bit odd. See below.
>
> <snip>
>
> > Index: b/drivers/net/wireless/rt2x00/rt2800pci.h
> > ===================================================================
> > --- a/drivers/net/wireless/rt2x00/rt2800pci.h
> > +++ b/drivers/net/wireless/rt2x00/rt2800pci.h
> > @@ -27,6 +27,27 @@
> > #ifndef RT2800PCI_H
> > #define RT2800PCI_H
> >
> > +static inline void rt2800_register_read(struct rt2x00_dev *rt2x00dev,
> > + const unsigned int offset,
> > + u32 *value)
> > +{
> > + rt2x00pci_register_read(rt2x00dev, offset, value);
> > +}
> > +
> > +static inline void rt2800_register_write(struct rt2x00_dev *rt2x00dev,
> > + const unsigned int offset,
> > + u32 value)
> > +{
> > + rt2x00pci_register_write(rt2x00dev, offset, value);
> > +}
> > +
> > +static inline void rt2800_register_write_lock(struct rt2x00_dev *rt2x00dev,
> > + const unsigned int offset,
> > + u32 value)
> > +{
> > + rt2x00pci_register_write(rt2x00dev, offset, value);
> > +}
> > +
> > /*
> > * RF chip defines.
> > *
>
> Can we add a comment to the _lock variant explaining that this one
> technically isn't
> needed, but is present for alignment purposes with rt2800usb?
I couldn't come with the good comment for it so I just went for
the minimal one in patch #25 (which removed all quoted above inlines):
+static const struct rt2800_ops rt2800pci_rt2800_ops = {
+ .register_read = rt2x00pci_register_read,
+ .register_write = rt2x00pci_register_write,
+ .register_write_lock = rt2x00pci_register_write, /* same for PCI */
+
+ .register_multiread = rt2x00pci_register_multiread,
+ .register_multiwrite = rt2x00pci_register_multiwrite,
+
+ .regbusy_read = rt2x00pci_regbusy_read,
+};
but it certainly can be expanded if somebody has a better idea how
the comment should look like.
--
Bartlomiej Zolnierkiewicz
next prev parent reply other threads:[~2009-11-06 18:17 UTC|newest]
Thread overview: 143+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-04 17:31 [PATCH 00/41] rewritten rt2800 drivers Bartlomiej Zolnierkiewicz
2009-11-04 17:31 ` [PATCH 01/41] rt2800usb: make Kconfig help entry more helpful Bartlomiej Zolnierkiewicz
2009-11-04 18:22 ` Gertjan van Wingerde
2009-11-05 18:40 ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 02/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 18:26 ` Gertjan van Wingerde
2009-11-06 16:13 ` Bartlomiej Zolnierkiewicz
2009-11-06 19:53 ` Gertjan van Wingerde
2009-11-05 18:41 ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 03/41] rt2800usb: fix rt2800usb_rfcsr_read() Bartlomiej Zolnierkiewicz
2009-11-04 18:28 ` Gertjan van Wingerde
2009-11-05 18:41 ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 04/41] rt2800pci: fix crypto in TX frame Bartlomiej Zolnierkiewicz
2009-11-04 18:30 ` Gertjan van Wingerde
2009-11-05 18:41 ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 05/41] rt2800pci: fix comment about register access Bartlomiej Zolnierkiewicz
2009-11-04 18:34 ` Gertjan van Wingerde
2009-11-05 18:41 ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 06/41] rt2800pci: fix comment about IV/EIV fields Bartlomiej Zolnierkiewicz
2009-11-04 18:36 ` Gertjan van Wingerde
2009-11-05 18:41 ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 07/41] rt2x00: fix rt2x00usb_register_read() comment Bartlomiej Zolnierkiewicz
2009-11-04 18:43 ` Gertjan van Wingerde
2009-11-05 18:42 ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 08/41] rt2800usb: use rt2x00usb_register_multiwrite() to set key entries Bartlomiej Zolnierkiewicz
2009-11-04 18:44 ` Gertjan van Wingerde
2009-11-05 18:42 ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 09/41] rt2800usb: add rt2800_register_[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:08 ` Gertjan van Wingerde
2009-11-05 18:44 ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 10/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:16 ` Gertjan van Wingerde
2009-11-06 16:13 ` Bartlomiej Zolnierkiewicz [this message]
2009-11-06 19:55 ` Gertjan van Wingerde
2009-11-05 18:45 ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 11/41] rt2800usb: add rt2800_register_multi[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:18 ` Gertjan van Wingerde
2009-11-05 18:46 ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 12/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:20 ` Gertjan van Wingerde
2009-11-05 18:47 ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 13/41] rt2800usb: add rt2800_regbusy_read() wrapper Bartlomiej Zolnierkiewicz
2009-11-04 19:21 ` Gertjan van Wingerde
2009-11-05 18:49 ` Ivo van Doorn
2009-11-06 16:23 ` Bartlomiej Zolnierkiewicz
2009-11-06 18:20 ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 14/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:24 ` Gertjan van Wingerde
2009-11-05 18:49 ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 15/41] rt2800usb: add rt2800_bbp_[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:30 ` Gertjan van Wingerde
2009-11-05 18:50 ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 16/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:31 ` Gertjan van Wingerde
2009-11-05 18:50 ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 17/41] rt2800usb: add rt2800_rfcsr_[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:34 ` Gertjan van Wingerde
2009-11-05 18:50 ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 18/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:44 ` Gertjan van Wingerde
2009-11-05 18:50 ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 19/41] rt2800usb: add rt2800_rf_[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:46 ` Gertjan van Wingerde
2009-11-05 18:51 ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 20/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:47 ` Gertjan van Wingerde
2009-11-05 18:51 ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 21/41] rt2800usb: add rt2800_mcu_request() wrapper Bartlomiej Zolnierkiewicz
2009-11-04 19:48 ` Gertjan van Wingerde
2009-11-05 18:51 ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 22/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 20:21 ` Gertjan van Wingerde
2009-11-05 18:52 ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 23/41] rt2x00: add driver private field to struct rt2x00_dev Bartlomiej Zolnierkiewicz
2009-11-04 19:55 ` Gertjan van Wingerde
2009-11-05 18:52 ` Ivo van Doorn
2009-11-05 18:57 ` Ivo van Doorn
2009-11-06 16:27 ` Bartlomiej Zolnierkiewicz
2009-11-06 18:22 ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 24/41] rt2800usb: convert to use struct rt2800_ops methods Bartlomiej Zolnierkiewicz
2009-11-04 20:22 ` Gertjan van Wingerde
2009-11-05 18:53 ` Ivo van Doorn
2009-11-05 18:57 ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 25/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:56 ` Gertjan van Wingerde
2009-11-05 18:57 ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 26/41] rt2x00: fix rt2x00usb_register_multiwrite() arguments Bartlomiej Zolnierkiewicz
2009-11-04 19:59 ` Gertjan van Wingerde
2009-11-05 18:58 ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 27/41] rt2x00: fix rt2x00usb_regbusy_read() arguments Bartlomiej Zolnierkiewicz
2009-11-04 20:01 ` Gertjan van Wingerde
2009-11-05 18:59 ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 28/41] rt2x00: fix rt2x00pci_register_multi[read,write]() arguments Bartlomiej Zolnierkiewicz
2009-11-04 20:04 ` Gertjan van Wingerde
2009-11-05 18:59 ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 29/41] rt2800: add rt2800lib.h Bartlomiej Zolnierkiewicz
2009-11-04 20:09 ` Gertjan van Wingerde
2009-11-05 19:00 ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 30/41] rt2800usb: fix comments in rt2800usb.h Bartlomiej Zolnierkiewicz
2009-11-04 20:12 ` Gertjan van Wingerde
2009-11-05 19:01 ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 31/41] rt2800usb: add RXINFO_DESC_SIZE definition Bartlomiej Zolnierkiewicz
2009-11-05 19:02 ` Ivo van Doorn
2009-11-05 20:33 ` Gertjan van Wingerde
2009-11-04 17:35 ` [PATCH 32/41] rt2800: fix duplication in header files Bartlomiej Zolnierkiewicz
2009-11-05 19:04 ` Ivo van Doorn
2009-11-05 20:37 ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 33/41] rt2800: fix comments in rt2800.h Bartlomiej Zolnierkiewicz
2009-11-05 19:05 ` Ivo van Doorn
2009-11-05 20:38 ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 34/41] rt2x00: add support for different chipset interfaces Bartlomiej Zolnierkiewicz
2009-11-05 19:06 ` Ivo van Doorn
2009-11-05 20:39 ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 35/41] rt2800: prepare for rt2800lib addition Bartlomiej Zolnierkiewicz
2009-11-05 19:07 ` Ivo van Doorn
2009-11-05 20:43 ` Gertjan van Wingerde
2009-11-06 18:24 ` Ivo van Doorn
2009-11-04 17:36 ` [PATCH 36/41] rt2800: add rt2800lib (part one) Bartlomiej Zolnierkiewicz
2009-11-05 19:09 ` Ivo van Doorn
2009-11-05 20:44 ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 37/41] rt2x00: remove needless ifdefs from rt2x00leds.h Bartlomiej Zolnierkiewicz
2009-11-05 19:09 ` Ivo van Doorn
2009-11-05 20:45 ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 38/41] rt2800: add rt2800lib (part two) Bartlomiej Zolnierkiewicz
2009-11-05 19:10 ` Ivo van Doorn
2009-11-05 20:50 ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 39/41] rt2x00: move REGISTER_BUSY_* definitions to rt2x00.h Bartlomiej Zolnierkiewicz
2009-11-05 19:10 ` Ivo van Doorn
2009-11-05 20:51 ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 40/41] rt2800: add rt2800lib (part three) Bartlomiej Zolnierkiewicz
2009-11-05 19:11 ` Ivo van Doorn
2009-11-05 20:56 ` Gertjan van Wingerde
2009-11-04 17:37 ` [PATCH 41/41] rt2800: add rt2800lib (part four) Bartlomiej Zolnierkiewicz
2009-11-05 19:12 ` Ivo van Doorn
2009-11-05 20:57 ` Gertjan van Wingerde
2009-11-04 20:19 ` [PATCH 00/41] rewritten rt2800 drivers Gertjan van Wingerde
2009-11-04 22:55 ` Julian Calaby
2009-11-06 18:15 ` Bartlomiej Zolnierkiewicz
2009-11-05 20:59 ` Gertjan van Wingerde
2009-11-05 21:06 ` Luis R. Rodriguez
2009-11-05 21:17 ` Gertjan van Wingerde
2009-11-06 16:28 ` Bartlomiej Zolnierkiewicz
2009-11-06 19:56 ` 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=200911061713.15898.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=gwingerde@gmail.com \
--cc=ivdoorn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).