diff --git a/os/hal/include/mii.h b/os/hal/include/mii.h index a236c6dc3..c72a5f96d 100644 --- a/os/hal/include/mii.h +++ b/os/hal/include/mii.h @@ -32,9 +32,6 @@ #ifndef _MII_H_ #define _MII_H_ -#include "mac_lld.h" -#include "mii_lld.h" - /* * Generic MII registers. Note, not all registers are present on all PHY * devices and some extra registers may be present. @@ -185,36 +182,7 @@ #define MII_AM79C875_ID 0x00225540 #define MII_KS8721_ID 0x00221610 -/** - * @brief MII Driver initialization. - */ -#define miiInit() mii_lld_init() -/** - * Resets a MII device. - * - * @param[in] macp pointer to the @p MACDriver object - */ -#define miiReset(macp) mii_lld_reset(macp) - -/** - * @brief Reads a MII register. - * - * @param[in] macp pointer to the @p MACDriver object - * @param addr the register address - * @return The register value. - */ -#define miiGet(macp, addr) mii_lld_get(macp, addr) - -/** - * @brief Writes a MII register. - * - * @param[in] macp pointer to the @p MACDriver object - * @param addr the register address - * @param value the new register value - */ -#define miiPut(macp, addr, value) mii_lld_put(macp, addr, value) - -#endif /**< _MII_H_ */ +#endif /* _MII_H_ */ /** @} */ diff --git a/os/hal/platforms/AT91SAM7/mii_lld.c b/os/hal/platforms/AT91SAM7/at91sam7_mii.c similarity index 90% rename from os/hal/platforms/AT91SAM7/mii_lld.c rename to os/hal/platforms/AT91SAM7/at91sam7_mii.c index b21a349eb..2b7491e38 100644 --- a/os/hal/platforms/AT91SAM7/mii_lld.c +++ b/os/hal/platforms/AT91SAM7/at91sam7_mii.c @@ -18,7 +18,7 @@ */ /** - * @file AT91SAM7/mii_lld.c + * @file AT91SAM7/at91sam7_mii.c * @brief AT91SAM7 low level MII driver code * @addtogroup AT91SAM7_MII * @{ @@ -26,12 +26,13 @@ #include "ch.h" #include "hal.h" -#include "mii.h" + +#include "at91sam7_mii.h" /** * @brief Low level MII driver initialization. */ -void mii_lld_init(void) { +void miiInit(void) { } @@ -40,7 +41,7 @@ void mii_lld_init(void) { * * @param[in] macp pointer to the @p MACDriver object */ -void mii_lld_reset(MACDriver *macp) { +void miiReset(MACDriver *macp) { (void)macp; @@ -78,7 +79,7 @@ void mii_lld_reset(MACDriver *macp) { * @param addr the register address * @return The register value. */ -phyreg_t mii_lld_get(MACDriver *macp, phyaddr_t addr) { +phyreg_t miiGet(MACDriver *macp, phyaddr_t addr) { (void)macp; AT91C_BASE_EMAC->EMAC_MAN = (0b01 << 30) | /* SOF */ @@ -98,7 +99,7 @@ phyreg_t mii_lld_get(MACDriver *macp, phyaddr_t addr) { * @param addr the register address * @param value the new register value */ -void mii_lld_put(MACDriver *macp, phyaddr_t addr, phyreg_t value) { +void miiPut(MACDriver *macp, phyaddr_t addr, phyreg_t value) { (void)macp; AT91C_BASE_EMAC->EMAC_MAN = (0b01 << 30) | /* SOF */ diff --git a/os/hal/platforms/AT91SAM7/mii_lld.h b/os/hal/platforms/AT91SAM7/at91sam7_mii.h similarity index 89% rename from os/hal/platforms/AT91SAM7/mii_lld.h rename to os/hal/platforms/AT91SAM7/at91sam7_mii.h index 4e1bc4139..6db87e31c 100644 --- a/os/hal/platforms/AT91SAM7/mii_lld.h +++ b/os/hal/platforms/AT91SAM7/at91sam7_mii.h @@ -18,14 +18,14 @@ */ /** - * @file AT91SAM7/mii_lld.h + * @file AT91SAM7/at91sam7_mii.h * @brief AT91SAM7 low level MII driver header * @addtogroup AT91SAM7_MII * @{ */ -#ifndef _MII_LLD_H_ -#define _MII_LLD_H_ +#ifndef _AT91SAM7_MII_H_ +#define _AT91SAM7_MII_H_ /*===========================================================================*/ /* Driver pre-compile time settings. */ @@ -88,14 +88,14 @@ typedef uint8_t phyaddr_t; #ifdef __cplusplus extern "C" { #endif - void mii_lld_init(void); - void mii_lld_reset(MACDriver *macp); - phyreg_t mii_lld_get(MACDriver *macp, phyaddr_t addr); - void mii_lld_put(MACDriver *macp, phyaddr_t addr, phyreg_t value); + void miiInit(void); + void miiReset(MACDriver *macp); + phyreg_t miiGet(MACDriver *macp, phyaddr_t addr); + void miiPut(MACDriver *macp, phyaddr_t addr, phyreg_t value); #ifdef __cplusplus } #endif -#endif /* _MII_LLD_H_ */ +#endif /* _AT91SAM7_MII_H_ */ /** @} */ diff --git a/os/hal/platforms/AT91SAM7/mac_lld.c b/os/hal/platforms/AT91SAM7/mac_lld.c index 037502d94..6112a13ad 100644 --- a/os/hal/platforms/AT91SAM7/mac_lld.c +++ b/os/hal/platforms/AT91SAM7/mac_lld.c @@ -30,6 +30,8 @@ #include "hal.h" #include "mii.h" +#include "at91sam7_mii.h" + #if CH_HAL_USE_MAC || defined(__DOXYGEN__) /** diff --git a/os/hal/platforms/AT91SAM7/platform.mk b/os/hal/platforms/AT91SAM7/platform.mk index c3fc8c6fd..a6293dfdd 100644 --- a/os/hal/platforms/AT91SAM7/platform.mk +++ b/os/hal/platforms/AT91SAM7/platform.mk @@ -3,7 +3,7 @@ PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/AT91SAM7/hal_lld.c \ ${CHIBIOS}/os/hal/platforms/AT91SAM7/pal_lld.c \ ${CHIBIOS}/os/hal/platforms/AT91SAM7/serial_lld.c \ ${CHIBIOS}/os/hal/platforms/AT91SAM7/mac_lld.c \ - ${CHIBIOS}/os/hal/platforms/AT91SAM7/mii_lld.c \ + ${CHIBIOS}/os/hal/platforms/AT91SAM7/at91sam7_mii.c \ ${CHIBIOS}/os/hal/platforms/AT91SAM7/at91lib/aic.c # Required include directories diff --git a/os/hal/src/mii.c b/os/hal/src/mii.c deleted file mode 100644 index 4618ecbbb..000000000 --- a/os/hal/src/mii.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio. - - This file is part of ChibiOS/RT. - - ChibiOS/RT is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS/RT is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -/** - * @file mii.c - * @brief mii Driver code. - * @addtogroup MII - * @{ - */ - -#include "ch.h" -#include "mac.h" -#include "mii.h" - -/* - * Currently there is no code, everything is done in the header, you may - * omit this file from the project but this may change in future releases. - * The file is here because the driver's naming pattern. - */ - -/** @} */