Skip to content

Commit

Permalink
[skel] Remove MII interface
Browse files Browse the repository at this point in the history
Most drivers do not utilise an MII interface, since the link state is
typically available directly from a memory-mapped register.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jan 14, 2018
1 parent 2fb70e8 commit 3292026
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
58 changes: 0 additions & 58 deletions src/drivers/net/skeleton.c
Expand Up @@ -34,7 +34,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/iobuf.h>
#include <ipxe/malloc.h>
#include <ipxe/pci.h>
#include <ipxe/mii.h>
#include "skeleton.h"

/** @file
Expand All @@ -43,54 +42,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*
*/

/******************************************************************************
*
* MII interface
*
******************************************************************************
*/

/**
* Read from MII register
*
* @v mii MII interface
* @v reg Register address
* @ret value Data read, or negative error
*/
static int skeleton_mii_read ( struct mii_interface *mii, unsigned int reg ) {
struct skeleton_nic *skel =
container_of ( mii, struct skeleton_nic, mii );

DBGC ( skel, "SKELETON %p does not yet support MII read\n", skel );
( void ) reg;
return -ENOTSUP;
}

/**
* Write to MII register
*
* @v mii MII interface
* @v reg Register address
* @v data Data to write
* @ret rc Return status code
*/
static int skeleton_mii_write ( struct mii_interface *mii, unsigned int reg,
unsigned int data) {
struct skeleton_nic *skel =
container_of ( mii, struct skeleton_nic, mii );

DBGC ( skel, "SKELETON %p does not yet support MII write\n", skel );
( void ) reg;
( void ) data;
return -ENOTSUP;
}

/** Skeleton MII operations */
static struct mii_operations skeleton_mii_operations = {
.read = skeleton_mii_read,
.write = skeleton_mii_write,
};

/******************************************************************************
*
* Device reset
Expand Down Expand Up @@ -254,14 +205,6 @@ static int skeleton_probe ( struct pci_device *pci ) {
if ( ( rc = skeleton_reset ( skel ) ) != 0 )
goto err_reset;

/* Initialise and reset MII interface */
mii_init ( &skel->mii, &skeleton_mii_operations );
if ( ( rc = mii_reset ( &skel->mii ) ) != 0 ) {
DBGC ( skel, "SKELETON %p could not reset MII: %s\n",
skel, strerror ( rc ) );
goto err_mii_reset;
}

/* Register network device */
if ( ( rc = register_netdev ( netdev ) ) != 0 )
goto err_register_netdev;
Expand All @@ -273,7 +216,6 @@ static int skeleton_probe ( struct pci_device *pci ) {

unregister_netdev ( netdev );
err_register_netdev:
err_mii_reset:
skeleton_reset ( skel );
err_reset:
iounmap ( skel->regs );
Expand Down
2 changes: 0 additions & 2 deletions src/drivers/net/skeleton.h
Expand Up @@ -16,8 +16,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
struct skeleton_nic {
/** Registers */
void *regs;
/** MII interface */
struct mii_interface mii;
};

#endif /* _SKELETON_H */

0 comments on commit 3292026

Please sign in to comment.