diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-11-29 17:35:32 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-11-29 17:35:32 +0000 |
commit | 3f8c09fde198a3680a5de0628c0cfbaf7f4d3abb (patch) | |
tree | 82bcacf1e19f79dc6d7f7fbaec59429f5dcce67c /os | |
parent | 2302385ec3a02d811f40f479ad8dc3433dd16c9e (diff) | |
download | ChibiOS-3f8c09fde198a3680a5de0628c0cfbaf7f4d3abb.tar.gz ChibiOS-3f8c09fde198a3680a5de0628c0cfbaf7f4d3abb.tar.bz2 ChibiOS-3f8c09fde198a3680a5de0628c0cfbaf7f4d3abb.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1361 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/include/mii.h | 34 | ||||
-rw-r--r-- | os/hal/platforms/AT91SAM7/at91sam7_mii.c (renamed from os/hal/platforms/AT91SAM7/mii_lld.c) | 13 | ||||
-rw-r--r-- | os/hal/platforms/AT91SAM7/at91sam7_mii.h (renamed from os/hal/platforms/AT91SAM7/mii_lld.h) | 16 | ||||
-rw-r--r-- | os/hal/platforms/AT91SAM7/mac_lld.c | 2 | ||||
-rw-r--r-- | os/hal/platforms/AT91SAM7/platform.mk | 2 | ||||
-rw-r--r-- | os/hal/src/mii.c | 37 |
6 files changed, 19 insertions, 85 deletions
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 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 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 <http://www.gnu.org/licenses/>.
-*/
-
-/**
- * @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.
- */
-
-/** @} */
|