From: Larry Finger <Larry.Finger@lwfinger.net>
To: andrea.merello@gmail.com
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Stefan Lippers-Hollmann <s.L-H@gmx.de>,
Dave Jones <davej@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux Wireless List <linux-wireless@vger.kernel.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Linux Driver Project <devel@linuxdriverproject.org>
Subject: Re: rtl8821ae.
Date: Tue, 04 Feb 2014 17:05:59 -0600 [thread overview]
Message-ID: <52F17257.8020303@lwfinger.net> (raw)
In-Reply-To: <CAN8YU5PzKE-6Y_651hSwwx1p2i682qi3TYibL5Bu0rBFOJv4cw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]
On 02/04/2014 01:57 PM, Andrea Merello wrote:
> Sorry, my fault.. you had already reported me the iowrite16 vs
> iowrite8 for anaparam3 issue, but I forgot to fix it :(
>
> If you are reasonably sure that a 16bits-wide write is OK on the
> rtl8187b hardware (In reference code I have here only 8bits are
> written), then I agree applying your fix, and I will leave unchanged
> my modifications.
> Otherwise, if you are unsure, I will revert thing in the common
> rtl818x struct (switching back to 8bit type) and I simply make a cast
> on rtl8187se, or I will use an union if possible, so the rtl8187b
> driver remains unchanged.
>
> On the other hand, for the remaining issues with changed names for
> bitfield (the XXXX_SHIFT), I wil vote to fix the rtl8187 driver:
> That names IMHO are wrong (misleading) and while fixing them should
> help avoid future confusion, the fix is trivial enough that I'm really
> confident not to broke anything.
>
> I had already sent a patch for it:
Somehow I missed this patch. Do you know if John Linville picked it up?
I'm not sure if the ANAPARAM3 register could handle a 16-bit write on an
RTL8187B. To be cautious, I wrote and have tested the attached patch using a
union. The patch includes a fix for an undefined symbol
(RTL818X_TX_CONF_HW_SEQNUM). With this patch my RTL8187SE and RTL8187B devices
both work.
Larry
[-- Attachment #2: fix_anaparam3 --]
[-- Type: text/plain, Size: 1686 bytes --]
Index: wireless-testing/drivers/net/wireless/rtl818x/rtl8187/dev.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ wireless-testing/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -592,7 +592,7 @@ static void rtl8187_set_anaparam(struct
rtl818x_iowrite32(priv, &priv->map->ANAPARAM, anaparam);
rtl818x_iowrite32(priv, &priv->map->ANAPARAM2, anaparam2);
if (priv->is_rtl8187b)
- rtl818x_iowrite8(priv, &priv->map->ANAPARAM3, anaparam3);
+ rtl818x_iowrite8(priv, &priv->map->ANAPARAM3A, anaparam3);
reg &= ~RTL818X_CONFIG3_ANAPARAM_WRITE;
rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg);
rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD,
@@ -949,7 +949,7 @@ static int rtl8187_start(struct ieee8021
rtl818x_iowrite8(priv, &priv->map->TX_AGC_CTL, reg);
rtl818x_iowrite32(priv, &priv->map->TX_CONF,
- RTL818X_TX_CONF_HW_SEQNUM |
+ RTL818X_TX_CONF_SW_SEQNUM |
RTL818X_TX_CONF_DISREQQSIZE |
(RETRY_COUNT << 8 /* short retry limit */) |
(RETRY_COUNT << 0 /* long retry limit */) |
Index: wireless-testing/drivers/net/wireless/rtl818x/rtl818x.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtl818x/rtl818x.h
+++ wireless-testing/drivers/net/wireless/rtl818x/rtl818x.h
@@ -309,7 +309,10 @@ struct rtl818x_csr {
__le32 RDSAR; /* 0xe4 */
__le16 TID_AC_MAP; /* 0xe8 */
u8 reserved_20[4];
- __le16 ANAPARAM3; /* 0xee */
+ union {
+ __le16 ANAPARAM3; /* 0xee */
+ u8 ANAPARAM3A; /* for rtl8187 */
+ };
#define AC_PARAM_TXOP_LIMIT_SHIFT 16
#define AC_PARAM_ECW_MAX_SHIFT 12
next prev parent reply other threads:[~2014-02-04 23:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <52ee2ee736e00_2c3211fc86c5851f@209.249.196.67.mail>
[not found] ` <20140202160512.GA4946@redhat.com>
2014-02-02 18:07 ` rtl8821ae Stefan Lippers-Hollmann
2014-02-02 19:36 ` rtl8821ae Malcolm Priestley
2014-02-03 17:05 ` rtl8821ae Larry Finger
2014-02-03 20:02 ` rtl8821ae Dan Carpenter
2014-02-03 20:12 ` rtl8821ae Dan Carpenter
2014-02-03 20:18 ` rtl8821ae Linus Torvalds
[not found] ` <CAN8YU5PJWqnaBN_oaZ-yZjV-s9oCkKPa4ebk-kNbhPSgpd3_wQ@mail.gmail.com>
2014-02-04 9:28 ` rtl8821ae Dan Carpenter
2014-02-04 14:41 ` rtl8821ae Andrea Merello
2014-02-04 15:42 ` rtl8821ae Larry Finger
2014-02-04 17:57 ` rtl8821ae Larry Finger
2014-02-04 19:57 ` rtl8821ae Andrea Merello
2014-02-04 23:05 ` Larry Finger [this message]
2014-02-05 10:52 ` rtl8821ae Andrea Merello
2014-02-05 12:34 ` rtl8821ae Dan Carpenter
2014-02-05 14:49 ` rtl8821ae Andrea Merello
2014-02-04 18:00 ` rtl8821ae Linus Torvalds
2014-02-03 20:19 ` rtl8821ae Greg KH
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=52F17257.8020303@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=andrea.merello@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=davej@redhat.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=s.L-H@gmx.de \
--cc=torvalds@linux-foundation.org \
/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).