sit: add IPv4 over IPv4 support
[linux-2.6-block.git] / include / linux / phy.h
CommitLineData
00db8189
AF
1/*
2 * include/linux/phy.h
3 *
4 * Framework and drivers for configuring and reading different PHYs
5 * Based on code in sungem_phy.c and gianfar_phy.c
6 *
7 * Author: Andy Fleming
8 *
9 * Copyright (c) 2004 Freescale Semiconductor, Inc.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 */
17
18#ifndef __PHY_H
19#define __PHY_H
20
21#include <linux/spinlock.h>
13df29f6
MR
22#include <linux/ethtool.h>
23#include <linux/mii.h>
24#include <linux/timer.h>
25#include <linux/workqueue.h>
8626d3b4 26#include <linux/mod_devicetable.h>
00db8189 27
60063497 28#include <linux/atomic.h>
0ac49527 29
00db8189
AF
30#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
31 SUPPORTED_10baseT_Full | \
32 SUPPORTED_100baseT_Half | \
33 SUPPORTED_100baseT_Full | \
34 SUPPORTED_Autoneg | \
35 SUPPORTED_TP | \
36 SUPPORTED_MII)
37
38#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \
39 SUPPORTED_1000baseT_Half | \
40 SUPPORTED_1000baseT_Full)
41
c5e38a94
AF
42/*
43 * Set phydev->irq to PHY_POLL if interrupts are not supported,
00db8189
AF
44 * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
45 * the attached driver handles the interrupt
46 */
47#define PHY_POLL -1
48#define PHY_IGNORE_INTERRUPT -2
49
50#define PHY_HAS_INTERRUPT 0x00000001
51#define PHY_HAS_MAGICANEG 0x00000002
4284b6a5 52#define PHY_IS_INTERNAL 0x00000004
00db8189 53
e8a2b6a4
AF
54/* Interface Mode definitions */
55typedef enum {
4157ef1b 56 PHY_INTERFACE_MODE_NA,
e8a2b6a4
AF
57 PHY_INTERFACE_MODE_MII,
58 PHY_INTERFACE_MODE_GMII,
59 PHY_INTERFACE_MODE_SGMII,
60 PHY_INTERFACE_MODE_TBI,
61 PHY_INTERFACE_MODE_RMII,
62 PHY_INTERFACE_MODE_RGMII,
a999589c 63 PHY_INTERFACE_MODE_RGMII_ID,
7d400a4c
KP
64 PHY_INTERFACE_MODE_RGMII_RXID,
65 PHY_INTERFACE_MODE_RGMII_TXID,
4157ef1b
SG
66 PHY_INTERFACE_MODE_RTBI,
67 PHY_INTERFACE_MODE_SMII,
e8a2b6a4
AF
68} phy_interface_t;
69
00db8189 70
e8a2b6a4 71#define PHY_INIT_TIMEOUT 100000
00db8189
AF
72#define PHY_STATE_TIME 1
73#define PHY_FORCE_TIMEOUT 10
74#define PHY_AN_TIMEOUT 10
75
e8a2b6a4 76#define PHY_MAX_ADDR 32
00db8189 77
a4d00f17 78/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
9d9326d3
AF
79#define PHY_ID_FMT "%s:%02x"
80
81/*
82 * Need to be a little smaller than phydev->dev.bus_id to leave room
83 * for the ":%02x"
84 */
8e401ecc 85#define MII_BUS_ID_SIZE (20 - 3)
a4d00f17 86
abf35df2
JG
87/* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit
88 IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. */
89#define MII_ADDR_C45 (1<<30)
90
313162d0
PG
91struct device;
92struct sk_buff;
93
c5e38a94
AF
94/*
95 * The Bus class for PHYs. Devices which provide access to
96 * PHYs should register using this structure
97 */
00db8189
AF
98struct mii_bus {
99 const char *name;
9d9326d3 100 char id[MII_BUS_ID_SIZE];
00db8189
AF
101 void *priv;
102 int (*read)(struct mii_bus *bus, int phy_id, int regnum);
103 int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);
104 int (*reset)(struct mii_bus *bus);
105
c5e38a94
AF
106 /*
107 * A lock to ensure that only one thing can read/write
108 * the MDIO bus at a time
109 */
35b5f6b1 110 struct mutex mdio_lock;
00db8189 111
18ee49dd 112 struct device *parent;
46abc021
LB
113 enum {
114 MDIOBUS_ALLOCATED = 1,
115 MDIOBUS_REGISTERED,
116 MDIOBUS_UNREGISTERED,
117 MDIOBUS_RELEASED,
118 } state;
119 struct device dev;
00db8189
AF
120
121 /* list of all PHYs on bus */
122 struct phy_device *phy_map[PHY_MAX_ADDR];
123
c6883996 124 /* PHY addresses to be ignored when probing */
f896424c
MP
125 u32 phy_mask;
126
c5e38a94
AF
127 /*
128 * Pointer to an array of interrupts, each PHY's
129 * interrupt at the index matching its address
130 */
00db8189
AF
131 int *irq;
132};
46abc021 133#define to_mii_bus(d) container_of(d, struct mii_bus, dev)
00db8189 134
eb8a54a7
TT
135struct mii_bus *mdiobus_alloc_size(size_t);
136static inline struct mii_bus *mdiobus_alloc(void)
137{
138 return mdiobus_alloc_size(0);
139}
140
2e888103
LB
141int mdiobus_register(struct mii_bus *bus);
142void mdiobus_unregister(struct mii_bus *bus);
143void mdiobus_free(struct mii_bus *bus);
144struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr);
abf35df2
JG
145int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
146int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
2e888103
LB
147
148
e8a2b6a4
AF
149#define PHY_INTERRUPT_DISABLED 0x0
150#define PHY_INTERRUPT_ENABLED 0x80000000
00db8189
AF
151
152/* PHY state machine states:
153 *
154 * DOWN: PHY device and driver are not ready for anything. probe
155 * should be called if and only if the PHY is in this state,
156 * given that the PHY device exists.
157 * - PHY driver probe function will, depending on the PHY, set
158 * the state to STARTING or READY
159 *
160 * STARTING: PHY device is coming up, and the ethernet driver is
161 * not ready. PHY drivers may set this in the probe function.
162 * If they do, they are responsible for making sure the state is
163 * eventually set to indicate whether the PHY is UP or READY,
164 * depending on the state when the PHY is done starting up.
165 * - PHY driver will set the state to READY
166 * - start will set the state to PENDING
167 *
168 * READY: PHY is ready to send and receive packets, but the
169 * controller is not. By default, PHYs which do not implement
170 * probe will be set to this state by phy_probe(). If the PHY
171 * driver knows the PHY is ready, and the PHY state is STARTING,
172 * then it sets this STATE.
173 * - start will set the state to UP
174 *
175 * PENDING: PHY device is coming up, but the ethernet driver is
176 * ready. phy_start will set this state if the PHY state is
177 * STARTING.
178 * - PHY driver will set the state to UP when the PHY is ready
179 *
180 * UP: The PHY and attached device are ready to do work.
181 * Interrupts should be started here.
182 * - timer moves to AN
183 *
184 * AN: The PHY is currently negotiating the link state. Link is
185 * therefore down for now. phy_timer will set this state when it
186 * detects the state is UP. config_aneg will set this state
187 * whenever called with phydev->autoneg set to AUTONEG_ENABLE.
188 * - If autonegotiation finishes, but there's no link, it sets
189 * the state to NOLINK.
190 * - If aneg finishes with link, it sets the state to RUNNING,
191 * and calls adjust_link
192 * - If autonegotiation did not finish after an arbitrary amount
193 * of time, autonegotiation should be tried again if the PHY
194 * supports "magic" autonegotiation (back to AN)
195 * - If it didn't finish, and no magic_aneg, move to FORCING.
196 *
197 * NOLINK: PHY is up, but not currently plugged in.
198 * - If the timer notes that the link comes back, we move to RUNNING
199 * - config_aneg moves to AN
200 * - phy_stop moves to HALTED
201 *
202 * FORCING: PHY is being configured with forced settings
203 * - if link is up, move to RUNNING
204 * - If link is down, we drop to the next highest setting, and
205 * retry (FORCING) after a timeout
206 * - phy_stop moves to HALTED
207 *
208 * RUNNING: PHY is currently up, running, and possibly sending
209 * and/or receiving packets
210 * - timer will set CHANGELINK if we're polling (this ensures the
211 * link state is polled every other cycle of this state machine,
212 * which makes it every other second)
213 * - irq will set CHANGELINK
214 * - config_aneg will set AN
215 * - phy_stop moves to HALTED
216 *
217 * CHANGELINK: PHY experienced a change in link state
218 * - timer moves to RUNNING if link
219 * - timer moves to NOLINK if the link is down
220 * - phy_stop moves to HALTED
221 *
222 * HALTED: PHY is up, but no polling or interrupts are done. Or
223 * PHY is in an error state.
224 *
225 * - phy_start moves to RESUMING
226 *
227 * RESUMING: PHY was halted, but now wants to run again.
228 * - If we are forcing, or aneg is done, timer moves to RUNNING
229 * - If aneg is not done, timer moves to AN
230 * - phy_stop moves to HALTED
231 */
232enum phy_state {
233 PHY_DOWN=0,
234 PHY_STARTING,
235 PHY_READY,
236 PHY_PENDING,
237 PHY_UP,
238 PHY_AN,
239 PHY_RUNNING,
240 PHY_NOLINK,
241 PHY_FORCING,
242 PHY_CHANGELINK,
243 PHY_HALTED,
244 PHY_RESUMING
245};
246
ac28b9f8
DD
247/**
248 * struct phy_c45_device_ids - 802.3-c45 Device Identifiers
249 * @devices_in_package: Bit vector of devices present.
250 * @device_ids: The device identifer for each present device.
251 */
252struct phy_c45_device_ids {
253 u32 devices_in_package;
254 u32 device_ids[8];
255};
c1f19b51 256
00db8189
AF
257/* phy_device: An instance of a PHY
258 *
259 * drv: Pointer to the driver for this PHY instance
260 * bus: Pointer to the bus this PHY is on
261 * dev: driver model device structure for this PHY
262 * phy_id: UID for this device found during discovery
ac28b9f8
DD
263 * c45_ids: 802.3-c45 Device Identifers if is_c45.
264 * is_c45: Set to true if this phy uses clause 45 addressing.
4284b6a5 265 * is_internal: Set to true if this phy is internal to a MAC.
00db8189
AF
266 * state: state of the PHY for management purposes
267 * dev_flags: Device-specific flags used by the PHY driver.
268 * addr: Bus address of PHY
269 * link_timeout: The number of timer firings to wait before the
270 * giving up on the current attempt at acquiring a link
271 * irq: IRQ number of the PHY's interrupt (-1 if none)
272 * phy_timer: The timer for handling the state machine
273 * phy_queue: A work_queue for the interrupt
274 * attached_dev: The attached enet driver's device instance ptr
275 * adjust_link: Callback for the enet controller to respond to
276 * changes in the link state.
277 * adjust_state: Callback for the enet driver to respond to
278 * changes in the state machine.
279 *
280 * speed, duplex, pause, supported, advertising, and
281 * autoneg are used like in mii_if_info
282 *
283 * interrupts currently only supports enabled or disabled,
284 * but could be changed in the future to support enabling
285 * and disabling specific interrupts
286 *
287 * Contains some infrastructure for polling and interrupt
288 * handling, as well as handling shifts in PHY hardware state
289 */
290struct phy_device {
291 /* Information about the PHY type */
292 /* And management functions */
293 struct phy_driver *drv;
294
295 struct mii_bus *bus;
296
297 struct device dev;
298
299 u32 phy_id;
300
ac28b9f8
DD
301 struct phy_c45_device_ids c45_ids;
302 bool is_c45;
4284b6a5 303 bool is_internal;
ac28b9f8 304
00db8189
AF
305 enum phy_state state;
306
307 u32 dev_flags;
308
e8a2b6a4
AF
309 phy_interface_t interface;
310
c6883996 311 /* Bus address of the PHY (0-31) */
00db8189
AF
312 int addr;
313
c5e38a94
AF
314 /*
315 * forced speed & duplex (no autoneg)
00db8189
AF
316 * partner speed & duplex & pause (autoneg)
317 */
318 int speed;
319 int duplex;
320 int pause;
321 int asym_pause;
322
323 /* The most recently read link state */
324 int link;
325
326 /* Enabled Interrupts */
327 u32 interrupts;
328
329 /* Union of PHY and Attached devices' supported modes */
330 /* See mii.h for more info */
331 u32 supported;
332 u32 advertising;
333
334 int autoneg;
335
336 int link_timeout;
337
c5e38a94
AF
338 /*
339 * Interrupt number for this PHY
340 * -1 means no interrupt
341 */
00db8189
AF
342 int irq;
343
344 /* private data pointer */
345 /* For use by PHYs to maintain extra state */
346 void *priv;
347
348 /* Interrupt and Polling infrastructure */
349 struct work_struct phy_queue;
a390d1f3 350 struct delayed_work state_queue;
0ac49527 351 atomic_t irq_disable;
00db8189 352
35b5f6b1 353 struct mutex lock;
00db8189
AF
354
355 struct net_device *attached_dev;
356
357 void (*adjust_link)(struct net_device *dev);
358
359 void (*adjust_state)(struct net_device *dev);
360};
361#define to_phy_device(d) container_of(d, struct phy_device, dev)
362
363/* struct phy_driver: Driver structure for a particular PHY type
364 *
365 * phy_id: The result of reading the UID registers of this PHY
366 * type, and ANDing them with the phy_id_mask. This driver
367 * only works for PHYs with IDs which match this field
368 * name: The friendly name of this PHY type
369 * phy_id_mask: Defines the important bits of the phy_id
370 * features: A list of features (speed, duplex, etc) supported
371 * by this PHY
372 * flags: A bitfield defining certain other features this PHY
373 * supports (like interrupts)
374 *
375 * The drivers must implement config_aneg and read_status. All
376 * other functions are optional. Note that none of these
377 * functions should be called from interrupt time. The goal is
378 * for the bus read/write functions to be able to block when the
379 * bus transaction is happening, and be freed up by an interrupt
380 * (The MPC85xx has this ability, though it is not currently
381 * supported in the driver).
382 */
383struct phy_driver {
384 u32 phy_id;
385 char *name;
386 unsigned int phy_id_mask;
387 u32 features;
388 u32 flags;
389
c5e38a94
AF
390 /*
391 * Called to initialize the PHY,
392 * including after a reset
393 */
00db8189
AF
394 int (*config_init)(struct phy_device *phydev);
395
c5e38a94
AF
396 /*
397 * Called during discovery. Used to set
398 * up device-specific structures, if any
399 */
00db8189
AF
400 int (*probe)(struct phy_device *phydev);
401
402 /* PHY Power Management */
403 int (*suspend)(struct phy_device *phydev);
404 int (*resume)(struct phy_device *phydev);
405
c5e38a94
AF
406 /*
407 * Configures the advertisement and resets
00db8189
AF
408 * autonegotiation if phydev->autoneg is on,
409 * forces the speed to the current settings in phydev
c5e38a94
AF
410 * if phydev->autoneg is off
411 */
00db8189
AF
412 int (*config_aneg)(struct phy_device *phydev);
413
414 /* Determines the negotiated speed and duplex */
415 int (*read_status)(struct phy_device *phydev);
416
417 /* Clears any pending interrupts */
418 int (*ack_interrupt)(struct phy_device *phydev);
419
420 /* Enables or disables interrupts */
421 int (*config_intr)(struct phy_device *phydev);
422
a8729eb3
AG
423 /*
424 * Checks if the PHY generated an interrupt.
425 * For multi-PHY devices with shared PHY interrupt pin
426 */
427 int (*did_interrupt)(struct phy_device *phydev);
428
00db8189
AF
429 /* Clears up any memory if needed */
430 void (*remove)(struct phy_device *phydev);
431
a30e2c18
DD
432 /* Returns true if this is a suitable driver for the given
433 * phydev. If NULL, matching is based on phy_id and
434 * phy_id_mask.
435 */
436 int (*match_phy_device)(struct phy_device *phydev);
437
c8f3a8c3
RC
438 /* Handles ethtool queries for hardware time stamping. */
439 int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti);
440
c1f19b51
RC
441 /* Handles SIOCSHWTSTAMP ioctl for hardware time stamping. */
442 int (*hwtstamp)(struct phy_device *phydev, struct ifreq *ifr);
443
444 /*
445 * Requests a Rx timestamp for 'skb'. If the skb is accepted,
446 * the phy driver promises to deliver it using netif_rx() as
447 * soon as a timestamp becomes available. One of the
448 * PTP_CLASS_ values is passed in 'type'. The function must
449 * return true if the skb is accepted for delivery.
450 */
451 bool (*rxtstamp)(struct phy_device *dev, struct sk_buff *skb, int type);
452
453 /*
454 * Requests a Tx timestamp for 'skb'. The phy driver promises
da92b194 455 * to deliver it using skb_complete_tx_timestamp() as soon as a
c1f19b51
RC
456 * timestamp becomes available. One of the PTP_CLASS_ values
457 * is passed in 'type'.
458 */
459 void (*txtstamp)(struct phy_device *dev, struct sk_buff *skb, int type);
460
42e836eb
MS
461 /* Some devices (e.g. qnap TS-119P II) require PHY register changes to
462 * enable Wake on LAN, so set_wol is provided to be called in the
463 * ethernet driver's set_wol function. */
464 int (*set_wol)(struct phy_device *dev, struct ethtool_wolinfo *wol);
465
466 /* See set_wol, but for checking whether Wake on LAN is enabled. */
467 void (*get_wol)(struct phy_device *dev, struct ethtool_wolinfo *wol);
468
00db8189
AF
469 struct device_driver driver;
470};
471#define to_phy_driver(d) container_of(d, struct phy_driver, driver)
472
f62220d3
AF
473#define PHY_ANY_ID "MATCH ANY PHY"
474#define PHY_ANY_UID 0xffffffff
475
476/* A Structure for boards to register fixups with the PHY Lib */
477struct phy_fixup {
478 struct list_head list;
8e401ecc 479 char bus_id[20];
f62220d3
AF
480 u32 phy_uid;
481 u32 phy_uid_mask;
482 int (*run)(struct phy_device *phydev);
483};
484
2e888103
LB
485/**
486 * phy_read - Convenience function for reading a given PHY register
487 * @phydev: the phy_device struct
488 * @regnum: register number to read
489 *
490 * NOTE: MUST NOT be called from interrupt context,
491 * because the bus read/write functions may wait for an interrupt
492 * to conclude the operation.
493 */
abf35df2 494static inline int phy_read(struct phy_device *phydev, u32 regnum)
2e888103
LB
495{
496 return mdiobus_read(phydev->bus, phydev->addr, regnum);
497}
498
499/**
500 * phy_write - Convenience function for writing a given PHY register
501 * @phydev: the phy_device struct
502 * @regnum: register number to write
503 * @val: value to write to @regnum
504 *
505 * NOTE: MUST NOT be called from interrupt context,
506 * because the bus read/write functions may wait for an interrupt
507 * to conclude the operation.
508 */
abf35df2 509static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
2e888103
LB
510{
511 return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
512}
513
2c7b4921
FF
514/**
515 * phy_interrupt_is_valid - Convenience function for testing a given PHY irq
516 * @phydev: the phy_device struct
517 *
518 * NOTE: must be kept in sync with addition/removal of PHY_POLL and
519 * PHY_IGNORE_INTERRUPT
520 */
521static inline bool phy_interrupt_is_valid(struct phy_device *phydev)
522{
523 return phydev->irq != PHY_POLL && phydev->irq != PHY_IGNORE_INTERRUPT;
524}
525
4284b6a5
FF
526/**
527 * phy_is_internal - Convenience function for testing if a PHY is internal
528 * @phydev: the phy_device struct
529 */
530static inline bool phy_is_internal(struct phy_device *phydev)
531{
532 return phydev->is_internal;
533}
534
ac28b9f8
DD
535struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
536 bool is_c45, struct phy_c45_device_ids *c45_ids);
537struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
4dea547f 538int phy_device_register(struct phy_device *phy);
2f5cb434 539int phy_init_hw(struct phy_device *phydev);
e1393456 540struct phy_device * phy_attach(struct net_device *dev,
f9a8f83b 541 const char *bus_id, phy_interface_t interface);
f8f76db1 542struct phy_device *phy_find_first(struct mii_bus *bus);
fa94f6d9 543int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
f9a8f83b 544 void (*handler)(struct net_device *),
fa94f6d9 545 phy_interface_t interface);
f62220d3 546struct phy_device * phy_connect(struct net_device *dev, const char *bus_id,
f9a8f83b 547 void (*handler)(struct net_device *),
e8a2b6a4 548 phy_interface_t interface);
e1393456
AF
549void phy_disconnect(struct phy_device *phydev);
550void phy_detach(struct phy_device *phydev);
551void phy_start(struct phy_device *phydev);
552void phy_stop(struct phy_device *phydev);
553int phy_start_aneg(struct phy_device *phydev);
554
e1393456 555int phy_stop_interrupts(struct phy_device *phydev);
00db8189
AF
556
557static inline int phy_read_status(struct phy_device *phydev) {
558 return phydev->drv->read_status(phydev);
559}
560
00db8189
AF
561int genphy_restart_aneg(struct phy_device *phydev);
562int genphy_config_aneg(struct phy_device *phydev);
563int genphy_update_link(struct phy_device *phydev);
564int genphy_read_status(struct phy_device *phydev);
0f0ca340
GC
565int genphy_suspend(struct phy_device *phydev);
566int genphy_resume(struct phy_device *phydev);
00db8189 567void phy_driver_unregister(struct phy_driver *drv);
d5bf9071 568void phy_drivers_unregister(struct phy_driver *drv, int n);
00db8189 569int phy_driver_register(struct phy_driver *new_driver);
d5bf9071 570int phy_drivers_register(struct phy_driver *new_driver, int n);
4f9c85a1 571void phy_state_machine(struct work_struct *work);
5ea94e76
FF
572void phy_change(struct work_struct *work);
573void phy_mac_interrupt(struct phy_device *phydev, int new_link);
00db8189
AF
574void phy_start_machine(struct phy_device *phydev,
575 void (*handler)(struct net_device *));
576void phy_stop_machine(struct phy_device *phydev);
577int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
578int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
579int phy_mii_ioctl(struct phy_device *phydev,
28b04113 580 struct ifreq *ifr, int cmd);
e1393456
AF
581int phy_start_interrupts(struct phy_device *phydev);
582void phy_print_status(struct phy_device *phydev);
6f4a7f41 583void phy_device_free(struct phy_device *phydev);
00db8189 584
f62220d3
AF
585int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
586 int (*run)(struct phy_device *));
587int phy_register_fixup_for_id(const char *bus_id,
588 int (*run)(struct phy_device *));
589int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
590 int (*run)(struct phy_device *));
591int phy_scan_fixups(struct phy_device *phydev);
592
a59a4d19
GC
593int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
594int phy_get_eee_err(struct phy_device *phydev);
595int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
596int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data);
42e836eb
MS
597int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
598void phy_ethtool_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
a59a4d19 599
9b9a8bfc
AF
600int __init mdio_bus_init(void);
601void mdio_bus_exit(void);
602
00db8189 603extern struct bus_type mdio_bus_type;
00db8189 604#endif /* __PHY_H */