Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mdio.h File Reference
#include <uapi/linux/mdio.h>

Go to the source code of this file.

Data Structures

struct  mdio_if_info
 

Macros

#define MDIO_PRTAD_NONE   (-1)
 
#define MDIO_DEVAD_NONE   (-1)
 
#define MDIO_SUPPORTS_C22   1
 
#define MDIO_SUPPORTS_C45   2
 
#define MDIO_EMULATE_C22   4
 

Functions

int mdio45_probe (struct mdio_if_info *mdio, int prtad)
 
int mdio_set_flag (const struct mdio_if_info *mdio, int prtad, int devad, u16 addr, int mask, bool sense)
 
int mdio45_links_ok (const struct mdio_if_info *mdio, u32 mmds)
 
int mdio45_nway_restart (const struct mdio_if_info *mdio)
 
void mdio45_ethtool_gset_npage (const struct mdio_if_info *mdio, struct ethtool_cmd *ecmd, u32 npage_adv, u32 npage_lpa)
 
void mdio45_ethtool_spauseparam_an (const struct mdio_if_info *mdio, const struct ethtool_pauseparam *ecmd)
 
int mdio_mii_ioctl (const struct mdio_if_info *mdio, struct mii_ioctl_data *mii_data, int cmd)
 

Macro Definition Documentation

#define MDIO_DEVAD_NONE   (-1)

Definition at line 57 of file mdio.h.

#define MDIO_EMULATE_C22   4

Definition at line 60 of file mdio.h.

#define MDIO_PRTAD_NONE   (-1)

Definition at line 56 of file mdio.h.

#define MDIO_SUPPORTS_C22   1

Definition at line 58 of file mdio.h.

#define MDIO_SUPPORTS_C45   2

Definition at line 59 of file mdio.h.

Function Documentation

void mdio45_ethtool_gset_npage ( const struct mdio_if_info mdio,
struct ethtool_cmd ecmd,
u32  npage_adv,
u32  npage_lpa 
)

mdio45_ethtool_gset_npage - get settings for ETHTOOL_GSET : MDIO interface : Ethtool request structure : Modes currently advertised on next pages : Modes advertised by link partner on next pages

The parameter is expected to have been cleared before calling mdio45_ethtool_gset_npage().

Since the CSRs for auto-negotiation using next pages are not fully standardised, this function does not attempt to decode them. The caller must pass them in.

Definition at line 186 of file mdio.c.

void mdio45_ethtool_spauseparam_an ( const struct mdio_if_info mdio,
const struct ethtool_pauseparam ecmd 
)

mdio45_ethtool_spauseparam_an - set auto-negotiated pause parameters : MDIO interface : Ethtool request structure

This function assumes that the PHY has an auto-negotiation MMD. It will enable and disable advertising of flow control as appropriate.

Definition at line 352 of file mdio.c.

int mdio45_links_ok ( const struct mdio_if_info mdio,
u32  mmd_mask 
)

mdio_link_ok - is link status up/OK : MDIO interface : Mask for MMDs to check

Returns 1 if the PHY reports link status up/OK, 0 otherwise. is normally ->mmds, but if loopback is enabled the MMDs being bypassed should be excluded from the mask.

Definition at line 97 of file mdio.c.

int mdio45_nway_restart ( const struct mdio_if_info mdio)

mdio45_nway_restart - restart auto-negotiation for this interface : MDIO interface

Returns 0 on success, negative on error.

Definition at line 140 of file mdio.c.

int mdio45_probe ( struct mdio_if_info mdio,
int  prtad 
)

mdio45_probe - probe for an MDIO (clause 45) device : MDIO interface : Expected PHY address

This sets and in the MDIO interface if successful. Returns 0 on success, negative on error.

Definition at line 29 of file mdio.c.

int mdio_mii_ioctl ( const struct mdio_if_info mdio,
struct mii_ioctl_data mii_data,
int  cmd 
)

mdio_mii_ioctl - MII ioctl interface for MDIO (clause 22 or 45) PHYs : MDIO interface : MII ioctl data structure : MII ioctl command

Returns 0 on success, negative on error.

Definition at line 380 of file mdio.c.

int mdio_set_flag ( const struct mdio_if_info mdio,
int  prtad,
int  devad,
u16  addr,
int  mask,
bool  sense 
)

mdio_set_flag - set or clear flag in an MDIO register : MDIO interface : PHY address : MMD address : Register address : Mask for flag (single bit set) : New value of flag

This debounces changes: it does not write the register if the flag already has the proper value. Returns 0 on success, negative on error.

Definition at line 69 of file mdio.c.