Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
mdio.c File Reference
#include <linux/kernel.h>
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/ethtool.h>
#include <linux/mdio.h>
#include <linux/module.h>

Go to the source code of this file.

Functions

 MODULE_DESCRIPTION ("Generic support for MDIO-compatible transceivers")
 
 MODULE_AUTHOR ("Copyright 2006-2009 Solarflare Communications Inc.")
 
 MODULE_LICENSE ("GPL")
 
int mdio45_probe (struct mdio_if_info *mdio, int prtad)
 
 EXPORT_SYMBOL (mdio45_probe)
 
int mdio_set_flag (const struct mdio_if_info *mdio, int prtad, int devad, u16 addr, int mask, bool sense)
 
 EXPORT_SYMBOL (mdio_set_flag)
 
int mdio45_links_ok (const struct mdio_if_info *mdio, u32 mmd_mask)
 
 EXPORT_SYMBOL (mdio45_links_ok)
 
int mdio45_nway_restart (const struct mdio_if_info *mdio)
 
 EXPORT_SYMBOL (mdio45_nway_restart)
 
void mdio45_ethtool_gset_npage (const struct mdio_if_info *mdio, struct ethtool_cmd *ecmd, u32 npage_adv, u32 npage_lpa)
 
 EXPORT_SYMBOL (mdio45_ethtool_gset_npage)
 
void mdio45_ethtool_spauseparam_an (const struct mdio_if_info *mdio, const struct ethtool_pauseparam *ecmd)
 
 EXPORT_SYMBOL (mdio45_ethtool_spauseparam_an)
 
int mdio_mii_ioctl (const struct mdio_if_info *mdio, struct mii_ioctl_data *mii_data, int cmd)
 
 EXPORT_SYMBOL (mdio_mii_ioctl)
 

Function Documentation

EXPORT_SYMBOL ( mdio45_probe  )
EXPORT_SYMBOL ( mdio_set_flag  )
EXPORT_SYMBOL ( mdio45_links_ok  )
EXPORT_SYMBOL ( mdio45_nway_restart  )
EXPORT_SYMBOL ( mdio45_ethtool_gset_npage  )
EXPORT_SYMBOL ( mdio45_ethtool_spauseparam_an  )
EXPORT_SYMBOL ( mdio_mii_ioctl  )
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.

MODULE_AUTHOR ( "Copyright 2006-2009 Solarflare Communications Inc."  )
MODULE_DESCRIPTION ( "Generic support for MDIO-compatible transceivers )
MODULE_LICENSE ( "GPL"  )