From: hayeswang <hayeswang@realtek.com>
To: "'Francois Romieu'" <romieu@fr.zoreil.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v2 net-next 2/2] r8169: support RTL8168G
Date: Fri, 6 Jul 2012 15:57:09 +0800 [thread overview]
Message-ID: <43E32504589B47B9846C4E9DAF98BF60@realtek.com.tw> (raw)
In-Reply-To: <20120704220458.GA1621@electric-eye.fr.zoreil.com>
[-- Attachment #1: Type: text/plain, Size: 642 bytes --]
Francois Romieu [romieu@fr.zoreil.com]
[...]
>
> Any objection against merging it with the patch below ?
>
> - more BUG() avoidance
> - save Joe P. some work
> - remove useless parenthesis
> - fix r8168g_mdio_write (if (reg_addr == 0x1f) { if (reg_addr == 0) snafu)
> -> Please check this one.
That is fine.
> - long declarations before short ones
> - avoid unbounded loops
> - use a descriptive name for the 0xe8de value in rtl_hw_init_8168g.
> -> Please suggest something better than "PLOP"
I have no idea about naming 0xe8de. Our hardware engineers don't release any
datasheet about it. It seems to be related with oob settings.
[-- Attachment #2: fix.patch --]
[-- Type: application/octet-stream, Size: 1656 bytes --]
Fix some code.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/ethernet/realtek/r8169.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index c37aed9..1d7d6f0 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3392,7 +3392,7 @@ static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp)
};
/* patch code for GPHY reset */
- for (i = 0; ARRAY_SIZE(mac_ocp_patch); i++)
+ for (i = 0; i < ARRAY_SIZE(mac_ocp_patch); i++)
r8168_mac_ocp_write(tp, 0xf800 + 2*i, mac_ocp_patch[i]);
r8168_mac_ocp_write(tp, 0xfc26, 0x8000);
r8168_mac_ocp_write(tp, 0xfc28, 0x0075);
@@ -6764,6 +6764,7 @@ static void __devinit rtl_hw_init_8168g(struct rtl8169_private *tp)
u32 data;
int i;
+ tp->ocp_base = OCP_STD_PHY_BASE;
RTL_W32(MISC, RTL_R32(MISC) | RXDV_GATED_EN);
for (i = 0; i < RTL_LOOP_MAX; i++) {
@@ -6782,15 +6783,15 @@ static void __devinit rtl_hw_init_8168g(struct rtl8169_private *tp)
msleep(1);
RTL_W8(MCU, RTL_R8(MCU) & ~NOW_IS_OOB);
- data = r8168_mac_ocp_read(ioaddr, PLOP);
+ data = r8168_mac_ocp_read(tp, PLOP);
data &= ~(1 << 14);
- r8168_mac_ocp_write(ioaddr, PLOP, data);
+ r8168_mac_ocp_write(tp, PLOP, data);
rtl_mcu_wait_list_ready(ioaddr);
- data = r8168_mac_ocp_read(ioaddr, PLOP);
+ data = r8168_mac_ocp_read(tp, PLOP);
data |= (1 << 15);
- r8168_mac_ocp_write(ioaddr, PLOP, data);
+ r8168_mac_ocp_write(tp, PLOP, data);
rtl_mcu_wait_list_ready(ioaddr);
}
--
1.7.10.2
next prev parent reply other threads:[~2012-07-06 7:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-29 10:34 [PATCH net-next 1/2] r8169: support RTL8106E Hayes Wang
2012-06-29 10:34 ` [PATCH net-next 2/2] r8169: support RTL8168G Hayes Wang
2012-06-29 13:51 ` Francois Romieu
2012-07-02 7:27 ` hayeswang
2012-06-29 13:50 ` [PATCH net-next 1/2] r8169: support RTL8106E Francois Romieu
2012-07-02 9:23 ` [PATCH v2 " Hayes Wang
2012-07-02 9:23 ` [PATCH v2 net-next 2/2] r8169: support RTL8168G Hayes Wang
2012-07-04 22:04 ` Francois Romieu
2012-07-05 0:51 ` Joe Perches
2012-07-06 15:20 ` Francois Romieu
2012-07-06 15:37 ` Joe Perches
2012-07-06 7:57 ` hayeswang [this message]
2012-07-06 15:20 ` Francois Romieu
2012-07-03 11:01 ` [PATCH v2 net-next 1/2] r8169: support RTL8106E Francois Romieu
2012-07-04 9:02 ` hayeswang
2012-07-09 6:48 ` [PATCH " David Miller
2012-07-09 10:12 ` Francois Romieu
2012-07-09 21:10 ` David Miller
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=43E32504589B47B9846C4E9DAF98BF60@realtek.com.tw \
--to=hayeswang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.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
all inboxes | Powered by JetHome®