Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
mdio_bus.c File Reference
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/unistd.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/of_device.h>
#include <linux/of_mdio.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/phy.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define MDIO_BUS_PM_OPS   NULL
 

Functions

struct mii_busmdiobus_alloc_size (size_t size)
 
 EXPORT_SYMBOL (mdiobus_alloc_size)
 
int mdiobus_register (struct mii_bus *bus)
 
 EXPORT_SYMBOL (mdiobus_register)
 
void mdiobus_unregister (struct mii_bus *bus)
 
 EXPORT_SYMBOL (mdiobus_unregister)
 
void mdiobus_free (struct mii_bus *bus)
 
 EXPORT_SYMBOL (mdiobus_free)
 
struct phy_devicemdiobus_scan (struct mii_bus *bus, int addr)
 
 EXPORT_SYMBOL (mdiobus_scan)
 
int mdiobus_read (struct mii_bus *bus, int addr, u32 regnum)
 
 EXPORT_SYMBOL (mdiobus_read)
 
int mdiobus_write (struct mii_bus *bus, int addr, u32 regnum, u16 val)
 
 EXPORT_SYMBOL (mdiobus_write)
 
 EXPORT_SYMBOL (mdio_bus_type)
 
int __init mdio_bus_init (void)
 
void mdio_bus_exit (void)
 

Variables

struct bus_type mdio_bus_type
 

Macro Definition Documentation

#define MDIO_BUS_PM_OPS   NULL

Definition at line 430 of file mdio_bus.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 17 of file mdio_bus.c.

Function Documentation

EXPORT_SYMBOL ( mdiobus_alloc_size  )
EXPORT_SYMBOL ( mdiobus_register  )
EXPORT_SYMBOL ( mdiobus_unregister  )
EXPORT_SYMBOL ( mdiobus_free  )
EXPORT_SYMBOL ( mdiobus_scan  )
EXPORT_SYMBOL ( mdiobus_read  )
EXPORT_SYMBOL ( mdiobus_write  )
EXPORT_SYMBOL ( mdio_bus_type  )
void mdio_bus_exit ( void  )

Definition at line 455 of file mdio_bus.c.

int __init mdio_bus_init ( void  )

Definition at line 441 of file mdio_bus.c.

struct mii_bus* mdiobus_alloc_size ( size_t  size)
read

mdiobus_alloc_size - allocate a mii_bus structure : extra amount of memory to allocate for private storage. If non-zero, then bus->priv is points to that memory.

Description: called by a bus driver to allocate an mii_bus structure to fill in.

Definition at line 52 of file mdio_bus.c.

void mdiobus_free ( struct mii_bus bus)

mdiobus_free - free a struct mii_bus : mii_bus to free

This function releases the reference to the underlying device object in the mii_bus. If this is the last reference, the mii_bus will be freed.

Definition at line 215 of file mdio_bus.c.

int mdiobus_read ( struct mii_bus bus,
int  addr,
u32  regnum 
)

mdiobus_read - Convenience function for reading a given MII mgmt register : the mii_bus struct : the phy address : register number to read

NOTE: MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation.

Definition at line 261 of file mdio_bus.c.

int mdiobus_register ( struct mii_bus bus)

mdiobus_register - bring up all the PHYs on a given bus and attach them to bus : target mii_bus

Description: Called by a bus driver to bring up all the PHYs on a given bus, and attach them to the bus.

Returns 0 on success or < 0 on error.

Definition at line 137 of file mdio_bus.c.

struct phy_device* mdiobus_scan ( struct mii_bus bus,
int  addr 
)
read

Definition at line 232 of file mdio_bus.c.

void mdiobus_unregister ( struct mii_bus bus)

Definition at line 191 of file mdio_bus.c.

int mdiobus_write ( struct mii_bus bus,
int  addr,
u32  regnum,
u16  val 
)

mdiobus_write - Convenience function for writing a given MII mgmt register : the mii_bus struct : the phy address : register number to write : value to write to

NOTE: MUST NOT be called from interrupt context, because the bus read/write functions may wait for an interrupt to conclude the operation.

Definition at line 286 of file mdio_bus.c.

Variable Documentation

struct bus_type mdio_bus_type
Initial value:
= {
.name = "mdio_bus",
.match = mdio_bus_match,
}

Definition at line 434 of file mdio_bus.c.