1
1
/*
2
- * Copyright (c) 2016-2018 ARM Limited
2
+ * Copyright (c) 2016-2019 Arm Limited
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -166,7 +166,6 @@ enum phy_reg_bctrl_reg_bits_t{
166
166
* \brief TX Command A bit definitions
167
167
*
168
168
*/
169
-
170
169
#define TX_CMD_DATA_START_OFFSET_BYTES_POS 16U
171
170
#define TX_CMD_DATA_START_OFFSET_BYTES_MASK 0x1FU
172
171
@@ -186,7 +185,19 @@ enum tx_command_a_bits_t{
186
185
*
187
186
*/
188
187
enum rx_fifo_status_bits_t {
189
- RX_FIFO_STATUS_ERROR_INDEX = 15U
188
+ RX_FIFO_STATUS_CRC_ERROR_INDEX = 1U ,
189
+ RX_FIFO_STATUS_DRIBBLING_BIT_INDEX = 2U ,
190
+ RX_FIFO_STATUS_MII_ERROR_INDEX = 3U ,
191
+ RX_FIFO_STATUS_REC_WD_TIMEOUT_INDEX = 4U ,
192
+ RX_FIFO_STATUS_FRAME_TYPE_INDEX = 5U ,
193
+ RX_FIFO_STATUS_COLLISION_SEEN_INDEX = 6U ,
194
+ RX_FIFO_STATUS_FRAME_TOO_LONG_INDEX = 7U ,
195
+ RX_FIFO_STATUS_MULTICAST_INDEX = 10U ,
196
+ RX_FIFO_STATUS_RUNT_FRAME_INDEX = 11U ,
197
+ RX_FIFO_STATUS_LENGTH_ERROR_INDEX = 12U ,
198
+ RX_FIFO_STATUS_BROADCAST_FRAME_INDEX = 13U ,
199
+ RX_FIFO_STATUS_ERROR_INDEX = 15U ,
200
+ RX_FIFO_STATUS_FILTERING_FAIL_INDEX = 30U ,
190
201
};
191
202
#define RX_FIFO_STATUS_PKT_LENGTH_POS 16U
192
203
#define RX_FIFO_STATUS_PKT_LENGTH_MASK 0x3FFFU
@@ -299,7 +310,7 @@ static void fill_tx_fifo(const struct smsc9220_eth_dev_t* dev,
299
310
data += remainder_bytes ;
300
311
301
312
while (size_bytes > 0 ) {
302
- /* Keep the same endianness in data than in the temp variable */
313
+ /* Keep the same endianness in data as in the temp variable */
303
314
tx_data_port_tmp_ptr [0 ] = data [0 ];
304
315
tx_data_port_tmp_ptr [1 ] = data [1 ];
305
316
tx_data_port_tmp_ptr [2 ] = data [2 ];
@@ -323,7 +334,7 @@ static void empty_rx_fifo(const struct smsc9220_eth_dev_t* dev,
323
334
size_bytes -= remainder_bytes ;
324
335
325
336
while (size_bytes > 0 ) {
326
- /* Keep the same endianness in data than in the temp variable */
337
+ /* Keep the same endianness in data as in the temp variable */
327
338
rx_data_port_tmp = register_map -> rx_data_port ;
328
339
data [0 ] = rx_data_port_tmp_ptr [0 ];
329
340
data [1 ] = rx_data_port_tmp_ptr [1 ];
@@ -740,7 +751,6 @@ int smsc9220_check_id(const struct smsc9220_eth_dev_t* dev)
740
751
return ((GET_BIT_FIELD (id , CHIP_ID_MASK , CHIP_ID_POS ) == CHIP_ID ) ? 0 : 1 );
741
752
}
742
753
743
-
744
754
void smsc9220_enable_interrupt (const struct smsc9220_eth_dev_t * dev ,
745
755
enum smsc9220_interrupt_source source )
746
756
{
@@ -817,7 +827,6 @@ enum smsc9220_error_t smsc9220_read_mac_address(
817
827
return SMSC9220_ERROR_PARAM ;
818
828
}
819
829
820
- /* Read current mac address. */
821
830
if (smsc9220_mac_regread (dev , SMSC9220_MAC_REG_OFFSET_ADDRH , & mac_high )) {
822
831
return SMSC9220_ERROR_INTERNAL ;
823
832
}
@@ -947,10 +956,7 @@ enum smsc9220_error_t smsc9220_send_by_chunks(
947
956
{
948
957
struct smsc9220_eth_reg_map_t * register_map =
949
958
(struct smsc9220_eth_reg_map_t * )dev -> cfg -> base ;
950
-
951
- /* signing this is the first segment of the packet to be sent */
952
959
bool is_first_segment = false;
953
- /* signing this is the last segment of the packet to be sent */
954
960
bool is_last_segment = false;
955
961
uint32_t txcmd_a , txcmd_b = 0 ;
956
962
uint32_t tx_buffer_free_space = 0 ;
@@ -1029,7 +1035,6 @@ uint32_t smsc9220_get_rxfifo_data_used_space(const struct
1029
1035
uint32_t smsc9220_receive_by_chunks (const struct smsc9220_eth_dev_t * dev ,
1030
1036
char * data , uint32_t dlen )
1031
1037
{
1032
-
1033
1038
uint32_t rxfifo_inf = 0 ;
1034
1039
uint32_t rxfifo_stat = 0 ;
1035
1040
uint32_t packet_length_byte = 0 ;
0 commit comments