Skip to content

Commit e818c48

Browse files
Modifed some source files for GR-MANGO.
Aligned with the astyle rule. Deleted old ARM5 check.
1 parent db3cec4 commit e818c48

File tree

141 files changed

+34010
-46064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+34010
-46064
lines changed

features/netsocket/emac-drivers/TARGET_RENESAS_EMAC/TARGET_RZ_A2XX/r_ether_rza2/r_ether_rza2_if.h

Lines changed: 56 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
/***********************************************************************************************************************
22
* DISCLAIMER
3-
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
4-
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
5-
* applicable laws, including copyright laws.
3+
* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
4+
* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
5+
* applicable laws, including copyright laws.
66
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
7-
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
8-
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
9-
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
10-
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
7+
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
8+
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
9+
* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
10+
* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
1111
* SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
12-
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
13-
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
12+
* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
13+
* this software. By using this software, you agree to the additional terms and conditions found by accessing the
1414
* following link:
15-
* http://www.renesas.com/disclaimer
15+
* http://www.renesas.com/disclaimer
1616
*
17-
* Copyright (C) 2018-2020 Renesas Electronics Corporation. All rights reserved.
17+
* Copyright (C) 2018-2020 Renesas Electronics Corporation. All rights reserved.
1818
***********************************************************************************************************************/
1919
/* Copyright (c) 2018-2020 Renesas Electronics Corporation.
2020
* SPDX-License-Identifier: Apache-2.0
@@ -39,15 +39,15 @@
3939

4040
/* Guards against multiple inclusion */
4141
#ifndef R_ETHER_RZA2_IF_H
42-
#define R_ETHER_RZA2_IF_H
42+
#define R_ETHER_RZA2_IF_H
4343

4444
/***********************************************************************************************************************
4545
Includes <System Includes> , "Project Includes"
4646
***********************************************************************************************************************/
47-
#include <stdint.h>
47+
#include <stdint.h>
4848

49-
#include "r_ether_rza2_config.h"
50-
#include "src/phy/phy.h"
49+
#include "r_ether_rza2_config.h"
50+
#include "src/phy/phy.h"
5151

5252
#ifdef __cplusplus
5353
extern "C" {
@@ -56,30 +56,29 @@ extern "C" {
5656
Macro definitions
5757
***********************************************************************************************************************/
5858
/* Version Number of API. */
59-
#define ETHER_RZA2_VERSION_MAJOR (1)
60-
#define ETHER_RZA2_VERSION_MINOR (0)
59+
#define ETHER_RZA2_VERSION_MAJOR (1)
60+
#define ETHER_RZA2_VERSION_MINOR (0)
6161

6262
/* When using the Read functions, ETHER_NO_DATA is the return value that indicates that no received data. */
63-
#define ETHER_NO_DATA (0)
63+
#define ETHER_NO_DATA (0)
6464

6565
/* The value of flag which indicates that the interrupt of Ethernet occur. */
66-
#define ETHER_FLAG_OFF (0)
67-
#define ETHER_FLAG_ON (1)
68-
#define ETHER_FLAG_ON_LINK_ON (3)
69-
#define ETHER_FLAG_ON_LINK_OFF (2)
66+
#define ETHER_FLAG_OFF (0)
67+
#define ETHER_FLAG_ON (1)
68+
#define ETHER_FLAG_ON_LINK_ON (3)
69+
#define ETHER_FLAG_ON_LINK_OFF (2)
7070

7171
/* Channel definition of Ethernet */
72-
#define ETHER_CHANNEL_0 (0)
73-
#define ETHER_CHANNEL_1 (1)
72+
#define ETHER_CHANNEL_0 (0)
73+
#define ETHER_CHANNEL_1 (1)
7474

75-
#define ETHER_CHANNEL_MAX (ETHER_CH0_EN + ETHER_CH1_EN)
75+
#define ETHER_CHANNEL_MAX (ETHER_CH0_EN + ETHER_CH1_EN)
7676

7777
/***********************************************************************************************************************
7878
Typedef definitions
7979
***********************************************************************************************************************/
8080
/* ETHER API error codes */
81-
typedef enum
82-
{
81+
typedef enum {
8382
ETHER_SUCCESS = 0, /* Processing completed successfully */
8483
ETHER_ERR_INVALID_PTR = -1, /* Value of the pointer is NULL */
8584
ETHER_ERR_INVALID_DATA = -2, /* Value of the argument is out of range */
@@ -95,32 +94,28 @@ typedef enum
9594
} ether_return_t;
9695

9796
/* Event code of callback function */
98-
typedef enum
99-
{
97+
typedef enum {
10098
ETHER_CB_EVENT_ID_WAKEON_LAN, /* Magic packet detection */
10199
ETHER_CB_EVENT_ID_LINK_ON, /* Link up detection */
102100
ETHER_CB_EVENT_ID_LINK_OFF, /* Link down detection */
103101
} ether_cb_event_t;
104102

105103
/* Structure of the callback function pointer */
106-
typedef struct
107-
{
108-
void (*pcb_func) (void *); /* Callback function pointer */
109-
void (*pcb_int_hnd) (void*); /* Interrupt handler function pointer */
104+
typedef struct {
105+
void (*pcb_func)(void *); /* Callback function pointer */
106+
void (*pcb_int_hnd)(void *); /* Interrupt handler function pointer */
110107
} ether_cb_t;
111108

112109
/* Structure to be used when decoding the argument of the callback function */
113-
typedef struct
114-
{
110+
typedef struct {
115111
uint32_t channel; /* ETHERC channel */
116112
ether_cb_event_t event_id; /* Event code for callback function */
117113
uint32_t status_ecsr; /* ETHERC status register for interrupt handler */
118114
uint32_t status_eesr; /* ETHERC/EDMAC status register for interrupt handler */
119115
} ether_cb_arg_t;
120116

121117
/* Parameters of the control function (1st argument) */
122-
typedef enum
123-
{
118+
typedef enum {
124119
CONTROL_SET_CALLBACK, /* Callback function registration */
125120
CONTROL_SET_PROMISCUOUS_MODE, /* Promiscuous mode setting */
126121
CONTROL_SET_INT_HANDLER, /* Interrupt handler function registration */
@@ -130,45 +125,39 @@ typedef enum
130125
CONTROL_BROADCASTFRAME_FILTER /* Broadcast frame filter setting*/
131126
} ether_cmd_t;
132127

133-
typedef enum
134-
{
128+
typedef enum {
135129
ETHER_PROMISCUOUS_OFF, /* ETHERC operates in standard mode */
136130
ETHER_PROMISCUOUS_ON /* ETHERC operates in promiscuous mode */
137131
} ether_promiscuous_bit_t;
138132

139-
typedef enum
140-
{
133+
typedef enum {
141134
ETHER_MC_FILTER_OFF, /* Multicast frame filter disable */
142135
ETHER_MC_FILTER_ON /* Multicast frame filter enable */
143136
} ether_mc_filter_t;
144137

145-
typedef struct
146-
{
138+
typedef struct {
147139
uint32_t channel; /* ETHERC channel */
148140
ether_promiscuous_bit_t bit; /* Promiscuous mode */
149141
} ether_promiscuous_t;
150142

151-
typedef struct
152-
{
143+
typedef struct {
153144
uint32_t channel; /* ETHERC channel */
154145
ether_mc_filter_t flag; /* Multicast frame filter */
155146
} ether_multicast_t;
156147

157-
typedef struct
158-
{
148+
typedef struct {
159149
uint32_t channel; /* ETHERC channel */
160150
uint32_t counter; /* Continuous reception number of Broadcast frame */
161151
} ether_broadcast_t;
162152

163153
/* Parameters of the control function (2nd argument) */
164-
typedef union
165-
{
154+
typedef union {
166155
ether_cb_t ether_callback; /* Callback function pointer */
167-
ether_promiscuous_t * p_ether_promiscuous; /* Promiscuous mode setting */
156+
ether_promiscuous_t *p_ether_promiscuous; /* Promiscuous mode setting */
168157
ether_cb_t ether_int_hnd; /* Interrupt handler function pointer */
169158
uint32_t channel; /* ETHERC channel number */
170-
ether_multicast_t * p_ether_multicast; /* Multicast frame filter setting */
171-
ether_broadcast_t * p_ether_broadcast; /* Broadcast frame filter setting */
159+
ether_multicast_t *p_ether_multicast; /* Multicast frame filter setting */
160+
ether_broadcast_t *p_ether_broadcast; /* Broadcast frame filter setting */
172161
} ether_param_t;
173162

174163
/***********************************************************************************************************************
@@ -178,21 +167,21 @@ typedef union
178167
/***********************************************************************************************************************
179168
Exported global functions (to be accessed by other files)
180169
***********************************************************************************************************************/
181-
extern void R_ETHER_Initial (void);
182-
extern ether_return_t R_ETHER_Open_ZC2 (uint32_t channel, const uint8_t mac_addr[], uint8_t pause);
183-
extern ether_return_t R_ETHER_Close_ZC2 (uint32_t channel);
184-
extern int32_t R_ETHER_Read (uint32_t channel, void *pbuf);
185-
extern int32_t R_ETHER_Read_ZC2 (uint32_t channel, void **pbuf);
186-
extern int32_t R_ETHER_Read_ZC2_BufRelease (uint32_t channel);
187-
extern ether_return_t R_ETHER_Write (uint32_t channel, void *pbuf, uint32_t len);
188-
extern ether_return_t R_ETHER_Write_ZC2_GetBuf (uint32_t channel, void **pbuf, uint16_t *pbuf_size);
189-
extern ether_return_t R_ETHER_Write_ZC2_SetBuf (uint32_t channel, const uint32_t len);
190-
extern ether_return_t R_ETHER_CheckLink_ZC (uint32_t channel);
191-
extern void R_ETHER_LinkProcess (uint32_t channel);
192-
extern ether_return_t R_ETHER_WakeOnLAN (uint32_t channel);
193-
extern ether_return_t R_ETHER_CheckWrite (uint32_t channel);
194-
extern ether_return_t R_ETHER_Control (ether_cmd_t const cmd, ether_param_t const control);
195-
extern uint32_t R_ETHER_GetVersion (void);
170+
extern void R_ETHER_Initial(void);
171+
extern ether_return_t R_ETHER_Open_ZC2(uint32_t channel, const uint8_t mac_addr[], uint8_t pause);
172+
extern ether_return_t R_ETHER_Close_ZC2(uint32_t channel);
173+
extern int32_t R_ETHER_Read(uint32_t channel, void *pbuf);
174+
extern int32_t R_ETHER_Read_ZC2(uint32_t channel, void **pbuf);
175+
extern int32_t R_ETHER_Read_ZC2_BufRelease(uint32_t channel);
176+
extern ether_return_t R_ETHER_Write(uint32_t channel, void *pbuf, uint32_t len);
177+
extern ether_return_t R_ETHER_Write_ZC2_GetBuf(uint32_t channel, void **pbuf, uint16_t *pbuf_size);
178+
extern ether_return_t R_ETHER_Write_ZC2_SetBuf(uint32_t channel, const uint32_t len);
179+
extern ether_return_t R_ETHER_CheckLink_ZC(uint32_t channel);
180+
extern void R_ETHER_LinkProcess(uint32_t channel);
181+
extern ether_return_t R_ETHER_WakeOnLAN(uint32_t channel);
182+
extern ether_return_t R_ETHER_CheckWrite(uint32_t channel);
183+
extern ether_return_t R_ETHER_Control(ether_cmd_t const cmd, ether_param_t const control);
184+
extern uint32_t R_ETHER_GetVersion(void);
196185

197186
#ifdef __cplusplus
198187
}

0 commit comments

Comments
 (0)