From: Hayes Wang <hayeswang@realtek.com>
To: <netdev@vger.kernel.org>
Cc: <nic_swsd@realtek.com>, <linux-kernel@vger.kernel.org>,
<linux-usb@vger.kernel.org>, Hayes Wang <hayeswang@realtek.com>
Subject: [PATCH net-next 2/6] r8152: add u1u2_enable for rtl_ops
Date: Mon, 27 Jun 2016 13:07:41 +0800 [thread overview]
Message-ID: <1394712342-15778-186-Taiwan-albertk@realtek.com> (raw)
In-Reply-To: <1394712342-15778-184-Taiwan-albertk@realtek.com>
Add u1u2_enable() for rtl_ops.
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
drivers/net/usb/r8152.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index b253003..f51d799 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -620,6 +620,7 @@ struct r8152 {
int (*eee_set)(struct r8152 *, struct ethtool_eee *);
bool (*in_nway)(struct r8152 *);
void (*aldps_enable)(struct r8152 *tp, bool enable);
+ void (*u1u2_enable)(struct r8152 *tp, bool enable);
void (*hw_phy_cfg)(struct r8152 *);
} rtl_ops;
@@ -2408,7 +2409,7 @@ static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable)
if (enable) {
u32 ocp_data;
- r8153_u1u2en(tp, false);
+ tp->rtl_ops.u1u2_enable(tp, false);
r8153_u2p3en(tp, false);
__rtl_set_wol(tp, WAKE_ANY);
@@ -2423,7 +2424,7 @@ static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable)
} else {
__rtl_set_wol(tp, tp->saved_wolopts);
r8153_u2p3en(tp, true);
- r8153_u1u2en(tp, true);
+ tp->rtl_ops.u1u2_enable(tp, true);
}
}
@@ -2922,12 +2923,12 @@ static void rtl8153_up(struct r8152 *tp)
if (test_bit(RTL8152_UNPLUG, &tp->flags))
return;
- r8153_u1u2en(tp, false);
+ tp->rtl_ops.u1u2_enable(tp, false);
tp->rtl_ops.aldps_enable(tp, false);
r8153_first_init(tp);
tp->rtl_ops.aldps_enable(tp, true);
r8153_u2p3en(tp, true);
- r8153_u1u2en(tp, true);
+ tp->rtl_ops.u1u2_enable(tp, true);
usb_enable_lpm(tp->udev);
}
@@ -2938,7 +2939,7 @@ static void rtl8153_down(struct r8152 *tp)
return;
}
- r8153_u1u2en(tp, false);
+ tp->rtl_ops.u1u2_enable(tp, false);
r8153_u2p3en(tp, false);
r8153_power_cut_en(tp, false);
tp->rtl_ops.aldps_enable(tp, false);
@@ -4142,6 +4143,7 @@ static int rtl_ops_init(struct r8152 *tp)
ops->eee_set = r8152_set_eee;
ops->in_nway = rtl8152_in_nway;
ops->aldps_enable = r8152_aldps_en;
+ ops->u1u2_enable = r8153_u1u2en;
ops->hw_phy_cfg = r8152b_hw_phy_cfg;
break;
@@ -4159,6 +4161,7 @@ static int rtl_ops_init(struct r8152 *tp)
ops->eee_set = r8153_set_eee;
ops->in_nway = rtl8153_in_nway;
ops->aldps_enable = r8153_aldps_en;
+ ops->u1u2_enable = r8153_u1u2en;
ops->hw_phy_cfg = r8153_hw_phy_cfg;
break;
--
2.4.11
next prev parent reply other threads:[~2016-06-27 6:07 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-27 5:07 [PATCH net-next 0/6] r8152: support new chips Hayes Wang
2016-06-27 5:07 ` [PATCH net-next 1/6] r8152: add aldps_enable for rtl_ops Hayes Wang
2016-06-27 5:07 ` Hayes Wang [this message]
2016-06-27 5:07 ` [PATCH net-next 3/6] r8152: add power_cut_en " Hayes Wang
2016-06-27 5:07 ` [PATCH net-next 4/6] r8152: support the new chip 8050 Hayes Wang
2016-06-27 5:07 ` [PATCH net-next 5/6] r8152: support RTL8153B Hayes Wang
2016-06-27 5:07 ` [PATCH net-next 6/6] r8152: add byte_enable for ocp_read_word function Hayes Wang
2016-06-27 10:57 ` Sergei Shtylyov
2016-06-28 2:45 ` [PATCH net-next v2 0/6] r8152: support new chips Hayes Wang
2016-06-28 2:45 ` [PATCH net-next v2 1/6] r8152: add aldps_enable for rtl_ops Hayes Wang
2016-06-28 2:45 ` [PATCH net-next v2 2/6] r8152: add u1u2_enable " Hayes Wang
2016-06-28 2:45 ` [PATCH net-next v2 3/6] r8152: add power_cut_en " Hayes Wang
2016-06-28 2:45 ` [PATCH net-next v2 4/6] r8152: support the new chip 8050 Hayes Wang
2016-06-28 2:45 ` [PATCH net-next v2 5/6] r8152: support RTL8153B Hayes Wang
2016-06-28 2:45 ` [PATCH net-next v2 6/6] r8152: add byte_enable for ocp_read_word function Hayes Wang
2016-06-28 12:28 ` [PATCH net-next v3 0/7] r8152: support new chips Hayes Wang
2016-06-28 12:28 ` [PATCH net-next v3 1/7] r8152: add aldps_enable for rtl_ops Hayes Wang
2016-06-28 12:28 ` [PATCH net-next v3 2/7] r8152: add u1u2_enable " Hayes Wang
2016-06-28 12:28 ` [PATCH net-next v3 3/7] r8152: add power_cut_en " Hayes Wang
2016-06-28 12:28 ` [PATCH net-next v3 4/7] r8152: add u2p3_enable " Hayes Wang
2016-06-28 12:28 ` [PATCH net-next v3 5/7] r8152: support the new chip 8050 Hayes Wang
2016-06-28 12:28 ` [PATCH net-next v3 6/7] r8152: support RTL8153B Hayes Wang
2016-06-28 12:28 ` [PATCH net-next v3 7/7] r8152: add byte_enable for ocp_read_word function Hayes Wang
2016-06-29 3:34 ` [PATCH net-next v3 0/7] r8152: support new chips Hayes Wang
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=1394712342-15778-186-Taiwan-albertk@realtek.com \
--to=hayeswang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.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).