aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/chelsio/cphy.h6
-rw-r--r--drivers/net/chelsio/mv88e1xxx.c5
-rw-r--r--drivers/net/chelsio/mv88x201x.c4
-rw-r--r--drivers/net/chelsio/my3126.c4
-rw-r--r--drivers/net/chelsio/subr.c5
5 files changed, 13 insertions, 11 deletions
diff --git a/drivers/net/chelsio/cphy.h b/drivers/net/chelsio/cphy.h
index 8b5165a5af3f..1f095a9fc739 100644
--- a/drivers/net/chelsio/cphy.h
+++ b/drivers/net/chelsio/cphy.h
@@ -137,10 +137,11 @@ static inline int simple_mdio_write(struct cphy *cphy, int reg,
137} 137}
138 138
139/* Convenience initializer */ 139/* Convenience initializer */
140static inline void cphy_init(struct cphy *phy, adapter_t *adapter, 140static inline void cphy_init(struct cphy *phy, struct net_device *dev,
141 int phy_addr, struct cphy_ops *phy_ops, 141 int phy_addr, struct cphy_ops *phy_ops,
142 const struct mdio_ops *mdio_ops) 142 const struct mdio_ops *mdio_ops)
143{ 143{
144 struct adapter *adapter = netdev_priv(dev);
144 phy->adapter = adapter; 145 phy->adapter = adapter;
145 phy->ops = phy_ops; 146 phy->ops = phy_ops;
146 if (mdio_ops) { 147 if (mdio_ops) {
@@ -150,12 +151,13 @@ static inline void cphy_init(struct cphy *phy, adapter_t *adapter,
150 phy->mdio.mdio_read = mdio_ops->read; 151 phy->mdio.mdio_read = mdio_ops->read;
151 phy->mdio.mdio_write = mdio_ops->write; 152 phy->mdio.mdio_write = mdio_ops->write;
152 } 153 }
154 phy->mdio.dev = dev;
153} 155}
154 156
155/* Operations of the PHY-instance factory */ 157/* Operations of the PHY-instance factory */
156struct gphy { 158struct gphy {
157 /* Construct a PHY instance with the given PHY address */ 159 /* Construct a PHY instance with the given PHY address */
158 struct cphy *(*create)(adapter_t *adapter, int phy_addr, 160 struct cphy *(*create)(struct net_device *dev, int phy_addr,
159 const struct mdio_ops *mdio_ops); 161 const struct mdio_ops *mdio_ops);
160 162
161 /* 163 /*
diff --git a/drivers/net/chelsio/mv88e1xxx.c b/drivers/net/chelsio/mv88e1xxx.c
index 0632be0d6494..809047a99e96 100644
--- a/drivers/net/chelsio/mv88e1xxx.c
+++ b/drivers/net/chelsio/mv88e1xxx.c
@@ -353,15 +353,16 @@ static struct cphy_ops mv88e1xxx_ops = {
353 .get_link_status = mv88e1xxx_get_link_status, 353 .get_link_status = mv88e1xxx_get_link_status,
354}; 354};
355 355
356static struct cphy *mv88e1xxx_phy_create(adapter_t *adapter, int phy_addr, 356static struct cphy *mv88e1xxx_phy_create(struct net_device *dev, int phy_addr,
357 const struct mdio_ops *mdio_ops) 357 const struct mdio_ops *mdio_ops)
358{ 358{
359 struct adapter *adapter = netdev_priv(dev);
359 struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL); 360 struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);
360 361
361 if (!cphy) 362 if (!cphy)
362 return NULL; 363 return NULL;
363 364
364 cphy_init(cphy, adapter, phy_addr, &mv88e1xxx_ops, mdio_ops); 365 cphy_init(cphy, dev, phy_addr, &mv88e1xxx_ops, mdio_ops);
365 366
366 /* Configure particular PHY's to run in a different mode. */ 367 /* Configure particular PHY's to run in a different mode. */
367 if ((board_info(adapter)->caps & SUPPORTED_TP) && 368 if ((board_info(adapter)->caps & SUPPORTED_TP) &&
diff --git a/drivers/net/chelsio/mv88x201x.c b/drivers/net/chelsio/mv88x201x.c
index d50907bf2ebd..f7136b2fd1e5 100644
--- a/drivers/net/chelsio/mv88x201x.c
+++ b/drivers/net/chelsio/mv88x201x.c
@@ -209,7 +209,7 @@ static struct cphy_ops mv88x201x_ops = {
209 MDIO_DEVS_PHYXS | MDIO_DEVS_WIS), 209 MDIO_DEVS_PHYXS | MDIO_DEVS_WIS),
210}; 210};
211 211
212static struct cphy *mv88x201x_phy_create(adapter_t *adapter, int phy_addr, 212static struct cphy *mv88x201x_phy_create(struct net_device *dev, int phy_addr,
213 const struct mdio_ops *mdio_ops) 213 const struct mdio_ops *mdio_ops)
214{ 214{
215 u32 val; 215 u32 val;
@@ -218,7 +218,7 @@ static struct cphy *mv88x201x_phy_create(adapter_t *adapter, int phy_addr,
218 if (!cphy) 218 if (!cphy)
219 return NULL; 219 return NULL;
220 220
221 cphy_init(cphy, adapter, phy_addr, &mv88x201x_ops, mdio_ops); 221 cphy_init(cphy, dev, phy_addr, &mv88x201x_ops, mdio_ops);
222 222
223 /* Commands the PHY to enable XFP's clock. */ 223 /* Commands the PHY to enable XFP's clock. */
224 cphy_mdio_read(cphy, MDIO_MMD_PCS, 0x8300, &val); 224 cphy_mdio_read(cphy, MDIO_MMD_PCS, 0x8300, &val);
diff --git a/drivers/net/chelsio/my3126.c b/drivers/net/chelsio/my3126.c
index 977c7e08b0e0..4c6028512d10 100644
--- a/drivers/net/chelsio/my3126.c
+++ b/drivers/net/chelsio/my3126.c
@@ -167,7 +167,7 @@ static struct cphy_ops my3126_ops = {
167 MDIO_DEVS_PHYXS), 167 MDIO_DEVS_PHYXS),
168}; 168};
169 169
170static struct cphy *my3126_phy_create(adapter_t *adapter, 170static struct cphy *my3126_phy_create(struct net_device *dev,
171 int phy_addr, const struct mdio_ops *mdio_ops) 171 int phy_addr, const struct mdio_ops *mdio_ops)
172{ 172{
173 struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL); 173 struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL);
@@ -175,7 +175,7 @@ static struct cphy *my3126_phy_create(adapter_t *adapter,
175 if (!cphy) 175 if (!cphy)
176 return NULL; 176 return NULL;
177 177
178 cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops); 178 cphy_init(cphy, dev, phy_addr, &my3126_ops, mdio_ops);
179 INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll); 179 INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll);
180 cphy->bmsr = 0; 180 cphy->bmsr = 0;
181 181
diff --git a/drivers/net/chelsio/subr.c b/drivers/net/chelsio/subr.c
index 2564312b3056..17720c6e5bfe 100644
--- a/drivers/net/chelsio/subr.c
+++ b/drivers/net/chelsio/subr.c
@@ -1135,14 +1135,13 @@ int __devinit t1_init_sw_modules(adapter_t *adapter,
1135 struct cmac *mac; 1135 struct cmac *mac;
1136 int phy_addr = bi->mdio_phybaseaddr + i; 1136 int phy_addr = bi->mdio_phybaseaddr + i;
1137 1137
1138 adapter->port[i].phy = bi->gphy->create(adapter, phy_addr, 1138 adapter->port[i].phy = bi->gphy->create(adapter->port[i].dev,
1139 bi->mdio_ops); 1139 phy_addr, bi->mdio_ops);
1140 if (!adapter->port[i].phy) { 1140 if (!adapter->port[i].phy) {
1141 CH_ERR("%s: PHY %d initialization failed\n", 1141 CH_ERR("%s: PHY %d initialization failed\n",
1142 adapter->name, i); 1142 adapter->name, i);
1143 goto error; 1143 goto error;
1144 } 1144 }
1145 adapter->port[i].phy->mdio.dev = adapter->port[i].dev;
1146 1145
1147 adapter->port[i].mac = mac = bi->gmac->create(adapter, i); 1146 adapter->port[i].mac = mac = bi->gmac->create(adapter, i);
1148 if (!mac) { 1147 if (!mac) {