+TCP: Fix spellings (#302)

* MISRA v5

* Add spelling corrections

* Update after Shubham's comments

* Actually fix the spelling
This commit is contained in:
Aniruddha Kanhere 2020-09-28 09:55:22 -07:00 committed by GitHub
parent ab70c1ce33
commit 6fb8b1fc33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 109 additions and 112 deletions

View file

@ -376,7 +376,7 @@ const TickType_t xShortTime = pdMS_TO_TICKS( 100UL );
if( ( xEndTime - xStartTime ) > xMaxTime )
{
/* Wated more than xMaxTime, return. */
/* Waited more than xMaxTime, return. */
xReturn = pdFALSE;
break;
}

View file

@ -53,8 +53,8 @@ extern "C" {
// IEEE defined Registers
#define GMII_BMCR 0x00 // Basic Control
#define GMII_BMSR 0x01 // Basic Status
#define GMII_PHYID1 0x02 // PHY Idendifier 1
#define GMII_PHYID2 0x03 // PHY Idendifier 2
#define GMII_PHYID1 0x02 // PHY Identifier 1
#define GMII_PHYID2 0x03 // PHY Identifier 2
#define GMII_ANAR 0x04 // Auto_Negotiation Advertisement
#define GMII_ANLPAR 0x05 // Auto_negotiation Link Partner Ability
#define GMII_ANER 0x06 // Auto-negotiation Expansion
@ -179,8 +179,8 @@ extern "C" {
#define GMII_EXTEND_CAPAB (1 << 0) // Extended Capability
// Bit definitions: GMII_PHYID1 0x02 PHY Idendifier 1
// Bit definitions: GMII_PHYID2 0x03 PHY Idendifier 2
// Bit definitions: GMII_PHYID1 0x02 PHY Identifier 1
// Bit definitions: GMII_PHYID2 0x03 PHY Identifier 2
#define GMII_LSB_MASK 0x3F
#define GMII_OUI_MSB 0x0022
#define GMII_OUI_LSB 0x05

View file

@ -427,7 +427,7 @@ void gmac_dev_init(Gmac* p_gmac, gmac_device_t* p_gmac_dev,
/*
* GMAC_DCFGR_TXCOEN: (GMAC_DCFGR) Transmitter Checksum Generation Offload Enable.
* Note: tha SAM4E does have RX checksum offloading
* Note: that SAM4E does have RX checksum offloading
* but TX checksum offloading has NOT been implemented.
*/
@ -649,7 +649,7 @@ uint32_t gmac_dev_write(gmac_device_t* p_gmac_dev, void *p_buffer,
if (p_buffer && ul_size) {
/* Driver manages the ring buffer */
/* Calculating the checksum here is faster than calculating it from the GMAC buffer
* because withing p_buffer, it is well aligned */
* because within p_buffer, it is well aligned */
#if( ipconfigZERO_COPY_TX_DRIVER != 0 )
{
/* Zero-copy... */
@ -859,7 +859,7 @@ void gmac_handler(gmac_device_t* p_gmac_dev)
if (ul_isr & GMAC_ISR_RCOMP)
ul_rsr |= GMAC_RSR_REC;
/* Invoke callbacks which can be useful to wake op a task */
/* Invoke callbacks which can be useful to wake up a task */
if (p_gmac_dev->func_rx_cb) {
p_gmac_dev->func_rx_cb(ul_rsr);
}

View file

@ -1223,7 +1223,7 @@ void gmac_handler(gmac_device_t* p_gmac_dev);
* #define ETHERNET_CONF_ETHADDR4 0xA0
* #define ETHERNET_CONF_ETHADDR5 0x02
* \endcode
* -# Define the IP address configration used in the application. When DHCP
* -# Define the IP address configuration used in the application. When DHCP
* is enabled, this configuration is not effected.
* - \code
* #define ETHERNET_CONF_IPADDR0 192

View file

@ -1242,7 +1242,7 @@ void gmac_handler(gmac_device_t* p_gmac_dev);
* #define ETHERNET_CONF_NET_MASK2 255
* #define ETHERNET_CONF_NET_MASK3 0
* \endcode
* -# Configure the PHY maintainance interface.
* -# Configure the PHY maintenance interface.
* - \code
* #define ETH_PHY_MODE GMAC_PHY_MII
* \endcode

View file

@ -622,7 +622,7 @@ uint32_t gmac_dev_read(gmac_device_t* p_gmac_dev, uint8_t* p_frame,
}
else
{
/* The driver couldn't not allocate a buffer to receive a packet.
/* The driver could not allocate a buffer to receive a packet.
Leave the current DMA buffer in place. */
}
}
@ -685,7 +685,7 @@ uint32_t gmac_dev_write(gmac_device_t* p_gmac_dev, void *p_buffer,
if (p_buffer && ul_size) {
/* Driver manages the ring buffer */
/* Calculating the checksum here is faster than calculating it from the GMAC buffer
* because withing p_buffer, it is well aligned */
* because within p_buffer, it is well aligned */
#if( ipconfigZERO_COPY_TX_DRIVER != 0 )
{
/* Zero-copy... */
@ -853,7 +853,7 @@ void gmac_handler(gmac_device_t* p_gmac_dev)
if (ul_isr & GMAC_ISR_RCOMP)
ul_rsr |= GMAC_RSR_REC;
/* Invoke callbacks which can be useful to wake op a task */
/* Invoke callbacks which can be useful to wake up a task */
xRxCallback( ul_rsr );
}

View file

@ -616,7 +616,7 @@ size_t xExpectedLength;
IPPacket_t *pxIPPacket;
pxIPPacket = ( IPPacket_t * ) pxDescriptor->pucEthernetBuffer;
/* Look at the actual length of the packet, translate it to a host-endial notation. */
/* Look at the actual length of the packet, translate it to a host-endian notation. */
xExpectedLength = sizeof( EthernetHeader_t ) + ( size_t ) FreeRTOS_htons( pxIPPacket->xIPHeader.usLength );
if( xExpectedLength == ( pxDescriptor->xDataLength + 4 ) )

View file

@ -133,7 +133,7 @@ BaseType_t xNetworkInterfaceInitialise( void )
BaseType_t xNetworkInterfaceOutput( NetworkBufferDescriptor_t * const pxDescriptor, BaseType_t xReleaseAfterSend )
{
uint8_t *buffer=NULL;
// FreeRTOS_printf(("<-- dataLength=%d\n",pxDescriptor->xDataLength));
if( pxDescriptor->xDataLength >= PACKET_BUFFER_SIZE )
{
FreeRTOS_printf(("TX buffer length %d over %d\n", pxDescriptor->xDataLength, PACKET_BUFFER_SIZE));
@ -272,7 +272,6 @@ static void prvEMACHandlerTask( void *pvParameters )
if( pxBufferDescriptor != NULL )
{
memcpy( pxBufferDescriptor->pucEthernetBuffer, buffer, dataLength );
// FreeRTOS_printf(("--> dataLength=%d\n",dataLength));
pxBufferDescriptor->xDataLength = dataLength;
} else {
numaker_eth_rx_next();

View file

@ -252,7 +252,7 @@ int numaker_eth_init(uint8_t *mac_addr)
init_tx_desc();
init_rx_desc();
numaker_set_mac_addr(mac_addr); // need to reconfigure hardware address 'cos we just RESET emc...
numaker_set_mac_addr(mac_addr); // need to reconfigure hardware address because we just RESET EMAC...
/* Configure the MAC interrupt enable register. */
@ -317,7 +317,7 @@ int numaker_eth_get_rx_buf(uint16_t *len, uint8_t **buf)
unsigned int cur_entry, status;
cur_entry = EMAC->CRXDSA;
if ((cur_entry == (uint32_t)cur_rx_desc_ptr) && (!(m_status & EMAC_INTSTS_RDUIF_Msk))) // cur_entry may equal to cur_rx_desc_ptr if RDU occures
if ((cur_entry == (uint32_t)cur_rx_desc_ptr) && (!(m_status & EMAC_INTSTS_RDUIF_Msk))) // cur_entry may equal to cur_rx_desc_ptr if RDU occurred
return -1;
status = cur_rx_desc_ptr->status1;

View file

@ -54,7 +54,7 @@
#define BMCR_FULLDPLX 0x0100 /* Full duplex */
#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
#define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */
#define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */
#define BMCR_PDOWN 0x0800 /* Power down the DP83840 */
#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */

View file

@ -453,7 +453,7 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB
/***********************************************************************************************************************
* Function Name: prvLinkStatusChange ()
* Description : Function will be called when the Link Status of the phy has changed ( see ether_callback.c )
* Arguments : xStatus : true when statyus has become high
* Arguments : xStatus : true when status has become high
* Return Value : void
**********************************************************************************************************************/
void prvLinkStatusChange( BaseType_t xStatus )

View file

@ -221,15 +221,15 @@ DMA TX descriptors. */
static SemaphoreHandle_t xTXDescriptorSemaphore = NULL;
/*
* Note: it is adviced to define both
* Note: it is advised to define both
*
* #define ipconfigZERO_COPY_RX_DRIVER 1
* #define ipconfigZERO_COPY_TX_DRIVER 1
*
* The method using memcpy is slower and probaly uses more RAM memory.
* The method using memcpy is slower and probably uses more RAM memory.
* The possibility is left in the code just for comparison.
*
* It is adviced to define ETH_TXBUFNB at least 4. Note that no
* It is advised to define ETH_TXBUFNB at least 4. Note that no
* TX buffers are allocated in a zero-copy driver.
*/
/* MAC buffers: ---------------------------------------------------------*/
@ -848,7 +848,7 @@ IPStackEvent_t xRxEvent;
if( xSendEventStructToIPTask( &xRxEvent, ( TickType_t ) 1000 ) != pdPASS )
{
/* The buffer could not be sent to the stack so must be released again.
This is a deferred handler taskr, not a real interrupt, so it is ok to
This is a deferred handler task, not a real interrupt, so it is ok to
use the task level function here. */
#if( ipconfigUSE_LINKED_RX_MESSAGES != 0 )
{
@ -891,7 +891,7 @@ uint8_t *pucBuffer;
while( ( pxDMARxDescriptor->Status & ETH_DMARXDESC_OWN ) == 0u )
{
BaseType_t xAccepted = pdTRUE;
/* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
/* Get the Frame Length of the received packet: subtract 4 bytes of the CRC */
xReceivedLength = ( ( pxDMARxDescriptor->Status & ETH_DMARXDESC_FL ) >> ETH_DMARXDESC_FRAMELENGTHSHIFT ) - 4;
pucBuffer = (uint8_t *) pxDMARxDescriptor->Buffer1Addr;
@ -909,7 +909,7 @@ uint8_t *pucBuffer;
if( ( pxDMARxDescriptor->Status & ( ETH_DMARXDESC_CE | ETH_DMARXDESC_IPV4HCE | ETH_DMARXDESC_FT ) ) != ETH_DMARXDESC_FT )
{
/* Not an Ethernet frame-type or a checmsum error. */
/* Not an Ethernet frame-type or a checksum error. */
xAccepted = pdFALSE;
}
else
@ -920,7 +920,7 @@ uint8_t *pucBuffer;
if( xAccepted != pdFALSE )
{
/* The packet wil be accepted, but check first if a new Network Buffer can
/* The packet will be accepted, but check first if a new Network Buffer can
be obtained. If not, the packet will still be dropped. */
pxNewDescriptor = pxGetNetworkBufferWithDescriptor( ETH_RX_BUF_SIZE, xDescriptorWaitTime );
@ -942,8 +942,8 @@ uint8_t *pucBuffer;
pxCurDescriptor = pxNewDescriptor;
if( pxNewDescriptor != NULL )
{
/* The packet is acepted and a new Network Buffer was created,
copy data to the Network Bufffer. */
/* The packet is accepted and a new Network Buffer was created,
copy data to the Network Buffer. */
memcpy( pxNewDescriptor->pucEthernetBuffer, pucBuffer, xReceivedLength );
}
}

View file

@ -651,7 +651,7 @@ static const char *prvRemoveSpaces( char *pcBuffer, int aBuflen, const char *pcM
{
char *pcTarget = pcBuffer;
/* Utility function used to formap messages being printed only. */
/* Utility function used to format messages being printed only. */
while( ( *pcMessage != 0 ) && ( pcTarget < ( pcBuffer + aBuflen - 1 ) ) )
{
*( pcTarget++ ) = *pcMessage;

View file

@ -320,7 +320,7 @@ IPStackEvent_t xRxEvent;
if( xSendEventStructToIPTask( &xRxEvent, ( TickType_t ) 1000 ) != pdPASS )
{
/* The buffer could not be sent to the stack so must be released again.
This is a deferred handler taskr, not a real interrupt, so it is ok to
This is a deferred handler task, not a real interrupt, so it is ok to
use the task level function here. */
#if( ipconfigUSE_LINKED_RX_MESSAGES != 0 )
{

View file

@ -481,7 +481,7 @@ const uint32_t ulHz_Per_MHz = 1000000UL;
if( ( xEndTime - xStartTime ) > xMaxTime )
{
/* Wated more than xMaxTime, return. */
/* Waited more than xMaxTime, return. */
xReturn = pdFALSE;
break;
}

View file

@ -84,12 +84,12 @@
#define REG_MAC_ADDR_5 (0x15) /* MARH */
#define REG_BUS_CLOCK_CTRL (0x20) /* OBCR */
#define BUS_CLOCK_166 (0x0004) /* 166 MHz on-chip bus clock (defaul is 125MHz) */
#define BUS_CLOCK_DIVIDEDBY_5 (0x0003) /* Bus clock devided by 5 */
#define BUS_CLOCK_DIVIDEDBY_3 (0x0002) /* Bus clock devided by 3 */
#define BUS_CLOCK_DIVIDEDBY_2 (0x0001) /* Bus clock devided by 2 */
#define BUS_CLOCK_DIVIDEDBY_1 (0x0000) /* Bus clock devided by 1 */
#define BUS_CLOCK_DIVIDED_MASK (0x0003) /* Bus clock devider mask */
#define BUS_CLOCK_166 (0x0004) /* 166 MHz on-chip bus clock (default is 125MHz) */
#define BUS_CLOCK_DIVIDEDBY_5 (0x0003) /* Bus clock divided by 5 */
#define BUS_CLOCK_DIVIDEDBY_3 (0x0002) /* Bus clock divided by 3 */
#define BUS_CLOCK_DIVIDEDBY_2 (0x0001) /* Bus clock divided by 2 */
#define BUS_CLOCK_DIVIDEDBY_1 (0x0000) /* Bus clock divided by 1 */
#define BUS_CLOCK_DIVIDED_MASK (0x0003) /* Bus clock divider mask */
#define BUS_SPEED_166_MHZ (0x0004) /* Set bus speed to 166 MHz */
#define BUS_SPEED_125_MHZ (0x0000) /* Set bus speed to 125 MHz */
@ -174,13 +174,13 @@
#define TX_CTRL_IP_CHECKSUM (0x0020) /* Enable IP frame checksum generation */
#define TX_CTRL_FLUSH_QUEUE (0x0010) /* Clear transmit queue, reset tx frame pointer */
#define TX_CTRL_FLOW_ENABLE (0x0008) /* Enable transmit flow control */
#define TX_CTRL_PAD_ENABLE (0x0004) /* Eanble adding a padding to a packet shorter than 64 bytes */
#define TX_CTRL_PAD_ENABLE (0x0004) /* Enable adding a padding to a packet shorter than 64 bytes */
#define TX_CTRL_CRC_ENABLE (0x0002) /* Enable adding a CRC to the end of transmit frame */
#define TX_CTRL_ENABLE (0x0001) /* Enable tranmsit */
#define TX_CTRL_ENABLE (0x0001) /* Enable transmit */
#define REG_TX_STATUS (0x72) /* TXSR */
#define TX_STAT_LATE_COL (0x2000) /* Tranmsit late collision occurs */
#define TX_STAT_MAX_COL (0x1000) /* Tranmsit maximum collision is reached */
#define TX_STAT_LATE_COL (0x2000) /* Transmit late collision occurs */
#define TX_STAT_MAX_COL (0x1000) /* Transmit maximum collision is reached */
#define TX_FRAME_ID_MASK (0x003F) /* Transmit frame ID mask */
#define TX_STAT_ERRORS ( TX_STAT_MAX_COL | TX_STAT_LATE_COL )
@ -191,7 +191,7 @@
#define RX_CTRL_IP_CHECKSUM (0x1000) /* Enable IP frame checksum verification */
#define RX_CTRL_MAC_FILTER (0x0800) /* Receive with address that pass MAC address filtering */
#define RX_CTRL_FLOW_ENABLE (0x0400) /* Enable receive flow control */
#define RX_CTRL_BAD_PACKET (0x0200) /* Eanble receive CRC error frames */
#define RX_CTRL_BAD_PACKET (0x0200) /* Enable receive CRC error frames */
#define RX_CTRL_MULTICAST (0x0100) /* Receive multicast frames that pass the CRC hash filtering */
#define RX_CTRL_BROADCAST (0x0080) /* Receive all the broadcast frames */
#define RX_CTRL_ALL_MULTICAST (0x0040) /* Receive all the multicast frames (including broadcast frames) */
@ -232,7 +232,7 @@
#define RX_PHY_ERROR (0x0010) /* Received frame has runt error */
#define RX_FRAME_ETHER (0x0008) /* Received frame is an Ethernet-type frame */
#define RX_TOO_LONG (0x0004) /* Received frame length exceeds max size 0f 2048 bytes */
#define RX_RUNT_ERROR (0x0002) /* Received frame was demaged by a collision */
#define RX_RUNT_ERROR (0x0002) /* Received frame was damaged by a collision */
#define RX_BAD_CRC (0x0001) /* Received frame has a CRC error */
#define RX_ERRORS ( RX_BAD_CRC | RX_TOO_LONG | RX_RUNT_ERROR | RX_PHY_ERROR | \
RX_ICMP_ERROR | RX_IP_ERROR | RX_TCP_ERROR | RX_UDP_ERROR )
@ -246,9 +246,9 @@
#define TXQ_ENQUEUE (0x0001) /* Enable enqueue tx frames one frame at a time */
#define REG_RXQ_CMD (0x82) /* RXQCR */
#define RXQ_STAT_TIME_INT (0x1000) /* RX interrupt is occured by timer duration */
#define RXQ_STAT_BYTE_CNT_INT (0x0800) /* RX interrupt is occured by byte count threshold */
#define RXQ_STAT_FRAME_CNT_INT (0x0400) /* RX interrupt is occured by frame count threshold */
#define RXQ_STAT_TIME_INT (0x1000) /* RX interrupt is occurred by timer duration */
#define RXQ_STAT_BYTE_CNT_INT (0x0800) /* RX interrupt is occurred by byte count threshold */
#define RXQ_STAT_FRAME_CNT_INT (0x0400) /* RX interrupt is occurred by frame count threshold */
#define RXQ_TWOBYTE_OFFSET (0x0200) /* Enable adding 2-byte before frame header for IP aligned with DWORD */
#define RXQ_TIME_INT (0x0080) /* Enable RX interrupt by timer duration */
#define RXQ_BYTE_CNT_INT (0x0040) /* Enable RX interrupt by byte count threshold */
@ -373,7 +373,7 @@
#define POWER_STATE_MASK (0x0003) /* Power management mode mask */
#define REG_WAKEUP_TIME (0xD6) /* GSWUTR */
#define WAKEUP_TIME (0xFF00) /* Min time (sec) wake-uo after detected energy */
#define WAKEUP_TIME (0xFF00) /* Min time (sec) wake-up after detected energy */
#define GOSLEEP_TIME (0x00FF) /* Min time (sec) before goto sleep when in energy mode */
/*
@ -457,7 +457,7 @@
#define REG_PORT_STATUS (0xF8) /* P1SR */
#define PORT_HP_MDIX (0x8000) /* Set PHY in HP auto MDI-X mode */
#define PORT_REVERSED_POLARITY (0x2000) /* Polarity is reversed */
#define PORT_RX_FLOW_CTRL (0x1000) /* Reeive flow control feature is active */
#define PORT_RX_FLOW_CTRL (0x1000) /* Receive flow control feature is active */
#define PORT_TX_FLOW_CTRL (0x0800) /* Transmit flow control feature is active */
#define PORT_STAT_SPEED_100MBIT (0x0400) /* Link is 100Mbps */
#define PORT_STAT_FULL_DUPLEX (0x0200) /* Link is full duplex mode */

View file

@ -35,7 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "NetworkBufferManagement.h"
#include "FreeRTOS_Stream_Buffer.h"
/* ======================== Standard Library inludes ======================== */
/* ======================== Standard Library includes ======================== */
#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
@ -652,7 +652,7 @@ int ret;
( void ) pvParam;
/* Disable signals to this thread since this is a Linux pthread to be able to
* printf and other blocking operations without being interruped and put in
* printf and other blocking operations without being interrupted and put in
* suspension mode by the linux port signals
*/
sigset_t set;
@ -689,7 +689,7 @@ const time_t xMaxMSToWait = 1000;
( void ) pvParam;
/* disable signals to avoid treating this thread as a FreeRTOS task and puting
/* disable signals to avoid treating this thread as a FreeRTOS task and putting
* it to sleep by the scheduler */
sigset_t set;
sigfillset( &set );
@ -833,7 +833,7 @@ static void prvInterruptSimulatorTask( void *pvParameters )
}
/*!
* @brief remove spacces from pcMessage into pcBuffer
* @brief remove spaces from pcMessage into pcBuffer
* @param [out] pcBuffer buffer to fill up
* @param [in] aBuflen length of pcBuffer
* @param [in] pcMessage original message
@ -845,7 +845,7 @@ static const char * prvRemoveSpaces( char *pcBuffer,
{
char *pcTarget = pcBuffer;
/* Utility function used to formap messages being printed only. */
/* Utility function used to format messages being printed only. */
while( ( *pcMessage != 0 ) && ( pcTarget < ( &pcBuffer[ aBuflen - 1 ] ) ) )
{
*( pcTarget++ ) = *pcMessage;

View file

@ -274,7 +274,7 @@
iptraceNETWORK_INTERFACE_TRANSMIT();
}
/* else same error occurred; this normally should not happen! But the buffer is left in there so it shold be freed! */
/* else same error occurred; this normally should not happen! But the buffer is left in there so it should be freed! */
/* The buffer has been sent so can be released. */
if( xReleaseAfterSend != pdFALSE )
@ -767,7 +767,7 @@
}
if( !pktSuccess )
{ /* smth went wrong; nothing sent to the */
{ /* something went wrong; nothing sent to the */
if( pxBufferDescriptor != 0 )
{
pxBufferDescriptor->pucEthernetBuffer = 0;

View file

@ -175,7 +175,7 @@
}
if( !pktSuccess )
{ /* smth went wrong; nothing sent to the */
{ /* something went wrong; nothing sent to the */
if( pxNetworkBuffer != NULL )
{
pxNetworkBuffer->pucEthernetBuffer = 0;