aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2008-10-08 20:38:01 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-08 20:38:01 -0400
commit78e4689e908adc8334272756c32c9218d1967408 (patch)
tree7fdc979df5345b3b45ab2d5c46467ad3415800c1 /drivers/net/cxgb3
parent8c26376112fb4b8dfea42069b602c03d53366052 (diff)
cxgb3: allow for PHY reset status
First step towards overall PHY layering re-organization. Allow a status return when a PHY is reset. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r--drivers/net/cxgb3/ael1002.c20
-rw-r--r--drivers/net/cxgb3/common.h24
-rw-r--r--drivers/net/cxgb3/t3_hw.c15
-rw-r--r--drivers/net/cxgb3/vsc8211.c5
4 files changed, 37 insertions, 27 deletions
diff --git a/drivers/net/cxgb3/ael1002.c b/drivers/net/cxgb3/ael1002.c
index ee140e63ddc5..bf22e56429fb 100644
--- a/drivers/net/cxgb3/ael1002.c
+++ b/drivers/net/cxgb3/ael1002.c
@@ -119,11 +119,12 @@ static struct cphy_ops ael1002_ops = {
119 .power_down = ael1002_power_down, 119 .power_down = ael1002_power_down,
120}; 120};
121 121
122void t3_ael1002_phy_prep(struct cphy *phy, struct adapter *adapter, 122int t3_ael1002_phy_prep(struct cphy *phy, struct adapter *adapter,
123 int phy_addr, const struct mdio_ops *mdio_ops) 123 int phy_addr, const struct mdio_ops *mdio_ops)
124{ 124{
125 cphy_init(phy, adapter, phy_addr, &ael1002_ops, mdio_ops); 125 cphy_init(phy, adapter, phy_addr, &ael1002_ops, mdio_ops);
126 ael100x_txon(phy); 126 ael100x_txon(phy);
127 return 0;
127} 128}
128 129
129static int ael1006_reset(struct cphy *phy, int wait) 130static int ael1006_reset(struct cphy *phy, int wait)
@@ -174,11 +175,12 @@ static struct cphy_ops ael1006_ops = {
174 .power_down = ael1006_power_down, 175 .power_down = ael1006_power_down,
175}; 176};
176 177
177void t3_ael1006_phy_prep(struct cphy *phy, struct adapter *adapter, 178int t3_ael1006_phy_prep(struct cphy *phy, struct adapter *adapter,
178 int phy_addr, const struct mdio_ops *mdio_ops) 179 int phy_addr, const struct mdio_ops *mdio_ops)
179{ 180{
180 cphy_init(phy, adapter, phy_addr, &ael1006_ops, mdio_ops); 181 cphy_init(phy, adapter, phy_addr, &ael1006_ops, mdio_ops);
181 ael100x_txon(phy); 182 ael100x_txon(phy);
183 return 0;
182} 184}
183 185
184static struct cphy_ops qt2045_ops = { 186static struct cphy_ops qt2045_ops = {
@@ -191,8 +193,8 @@ static struct cphy_ops qt2045_ops = {
191 .power_down = ael1006_power_down, 193 .power_down = ael1006_power_down,
192}; 194};
193 195
194void t3_qt2045_phy_prep(struct cphy *phy, struct adapter *adapter, 196int t3_qt2045_phy_prep(struct cphy *phy, struct adapter *adapter,
195 int phy_addr, const struct mdio_ops *mdio_ops) 197 int phy_addr, const struct mdio_ops *mdio_ops)
196{ 198{
197 unsigned int stat; 199 unsigned int stat;
198 200
@@ -205,6 +207,7 @@ void t3_qt2045_phy_prep(struct cphy *phy, struct adapter *adapter,
205 if (!phy_addr && !mdio_read(phy, MDIO_DEV_PMA_PMD, MII_BMSR, &stat) && 207 if (!phy_addr && !mdio_read(phy, MDIO_DEV_PMA_PMD, MII_BMSR, &stat) &&
206 stat == 0xffff) 208 stat == 0xffff)
207 phy->addr = 1; 209 phy->addr = 1;
210 return 0;
208} 211}
209 212
210static int xaui_direct_reset(struct cphy *phy, int wait) 213static int xaui_direct_reset(struct cphy *phy, int wait)
@@ -250,8 +253,9 @@ static struct cphy_ops xaui_direct_ops = {
250 .power_down = xaui_direct_power_down, 253 .power_down = xaui_direct_power_down,
251}; 254};
252 255
253void t3_xaui_direct_phy_prep(struct cphy *phy, struct adapter *adapter, 256int t3_xaui_direct_phy_prep(struct cphy *phy, struct adapter *adapter,
254 int phy_addr, const struct mdio_ops *mdio_ops) 257 int phy_addr, const struct mdio_ops *mdio_ops)
255{ 258{
256 cphy_init(phy, adapter, phy_addr, &xaui_direct_ops, mdio_ops); 259 cphy_init(phy, adapter, phy_addr, &xaui_direct_ops, mdio_ops);
260 return 0;
257} 261}
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index ace6b58bae8e..78c10d3f0efa 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -203,8 +203,8 @@ struct adapter_info {
203}; 203};
204 204
205struct port_type_info { 205struct port_type_info {
206 void (*phy_prep)(struct cphy *phy, struct adapter *adapter, 206 int (*phy_prep)(struct cphy *phy, struct adapter *adapter,
207 int phy_addr, const struct mdio_ops *ops); 207 int phy_addr, const struct mdio_ops *ops);
208 unsigned int caps; 208 unsigned int caps;
209 const char *desc; 209 const char *desc;
210}; 210};
@@ -776,14 +776,14 @@ int t3_sge_read_rspq(struct adapter *adapter, unsigned int id, u32 data[4]);
776int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op, 776int t3_sge_cqcntxt_op(struct adapter *adapter, unsigned int id, unsigned int op,
777 unsigned int credits); 777 unsigned int credits);
778 778
779void t3_vsc8211_phy_prep(struct cphy *phy, struct adapter *adapter, 779int t3_vsc8211_phy_prep(struct cphy *phy, struct adapter *adapter,
780 int phy_addr, const struct mdio_ops *mdio_ops); 780 int phy_addr, const struct mdio_ops *mdio_ops);
781void t3_ael1002_phy_prep(struct cphy *phy, struct adapter *adapter, 781int t3_ael1002_phy_prep(struct cphy *phy, struct adapter *adapter,
782 int phy_addr, const struct mdio_ops *mdio_ops); 782 int phy_addr, const struct mdio_ops *mdio_ops);
783void t3_ael1006_phy_prep(struct cphy *phy, struct adapter *adapter, 783int t3_ael1006_phy_prep(struct cphy *phy, struct adapter *adapter,
784 int phy_addr, const struct mdio_ops *mdio_ops); 784 int phy_addr, const struct mdio_ops *mdio_ops);
785void t3_qt2045_phy_prep(struct cphy *phy, struct adapter *adapter, int phy_addr, 785int t3_qt2045_phy_prep(struct cphy *phy, struct adapter *adapter, int phy_addr,
786 const struct mdio_ops *mdio_ops); 786 const struct mdio_ops *mdio_ops);
787void t3_xaui_direct_phy_prep(struct cphy *phy, struct adapter *adapter, 787int t3_xaui_direct_phy_prep(struct cphy *phy, struct adapter *adapter,
788 int phy_addr, const struct mdio_ops *mdio_ops); 788 int phy_addr, const struct mdio_ops *mdio_ops);
789#endif /* __CHELSIO_COMMON_H */ 789#endif /* __CHELSIO_COMMON_H */
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 33470c79ac1c..fa0a4b4fb5cb 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -3626,8 +3626,11 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
3626 ++j; 3626 ++j;
3627 3627
3628 p->port_type = &port_types[adapter->params.vpd.port_type[j]]; 3628 p->port_type = &port_types[adapter->params.vpd.port_type[j]];
3629 p->port_type->phy_prep(&p->phy, adapter, ai->phy_base_addr + j, 3629 ret = p->port_type->phy_prep(&p->phy, adapter,
3630 ai->mdio_ops); 3630 ai->phy_base_addr + j,
3631 ai->mdio_ops);
3632 if (ret)
3633 return ret;
3631 mac_prep(&p->mac, adapter, j); 3634 mac_prep(&p->mac, adapter, j);
3632 ++j; 3635 ++j;
3633 3636
@@ -3674,9 +3677,11 @@ int t3_replay_prep_adapter(struct adapter *adapter)
3674 while (!adapter->params.vpd.port_type[j]) 3677 while (!adapter->params.vpd.port_type[j])
3675 ++j; 3678 ++j;
3676 3679
3677 p->port_type->phy_prep(&p->phy, adapter, ai->phy_base_addr + j, 3680 ret = p->port_type->phy_prep(&p->phy, adapter,
3678 ai->mdio_ops); 3681 ai->phy_base_addr + j,
3679 3682 ai->mdio_ops);
3683 if (ret)
3684 return ret;
3680 p->phy.ops->power_down(&p->phy, 1); 3685 p->phy.ops->power_down(&p->phy, 1);
3681 ++j; 3686 ++j;
3682 } 3687 }
diff --git a/drivers/net/cxgb3/vsc8211.c b/drivers/net/cxgb3/vsc8211.c
index eee4285b31be..8f1b0d3a27ed 100644
--- a/drivers/net/cxgb3/vsc8211.c
+++ b/drivers/net/cxgb3/vsc8211.c
@@ -221,8 +221,9 @@ static struct cphy_ops vsc8211_ops = {
221 .power_down = vsc8211_power_down, 221 .power_down = vsc8211_power_down,
222}; 222};
223 223
224void t3_vsc8211_phy_prep(struct cphy *phy, struct adapter *adapter, 224int t3_vsc8211_phy_prep(struct cphy *phy, struct adapter *adapter,
225 int phy_addr, const struct mdio_ops *mdio_ops) 225 int phy_addr, const struct mdio_ops *mdio_ops)
226{ 226{
227 cphy_init(phy, adapter, phy_addr, &vsc8211_ops, mdio_ops); 227 cphy_init(phy, adapter, phy_addr, &vsc8211_ops, mdio_ops);
228 return 0;
228} 229}