summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/MII/mii.c8
-rw-r--r--libs/NCSI/ncsi.c16
-rw-r--r--libs/Network/tx.c6
-rw-r--r--libs/printf/em100_putchar.c6
4 files changed, 16 insertions, 20 deletions
diff --git a/libs/MII/mii.c b/libs/MII/mii.c
index 5048fbe..bcdd861 100644
--- a/libs/MII/mii.c
+++ b/libs/MII/mii.c
@@ -168,7 +168,7 @@ static int32_t MII_readShadowRegister18(volatile DEVICE_t *device, uint8_t phy,
shadow_select.r16 = 0;
shadow_select.bits.ShadowRegisterReadSelector = shadow_reg;
shadow_select.bits.ShadowRegisterSelector = 7;
- if(MII_writeRegisterInternal(device, phy, (mii_reg_t)0x18, shadow_select.r16))
+ if (MII_writeRegisterInternal(device, phy, (mii_reg_t)0x18, shadow_select.r16))
{
return MII_readRegisterInternal(device, phy, (mii_reg_t)0x18);
}
@@ -231,7 +231,7 @@ static bool MII_writeShadowRegister18(volatile DEVICE_t *device, uint8_t phy, mi
shadow_select.r16 = 0;
shadow_select.bits.ShadowRegisterReadSelector = shadow_reg;
shadow_select.bits.ShadowRegisterSelector = 7;
- if(MII_writeRegisterInternal(device, phy, (mii_reg_t)REG_MII_AUXILIARY_CONTROL, shadow_select.r16))
+ if (MII_writeRegisterInternal(device, phy, (mii_reg_t)REG_MII_AUXILIARY_CONTROL, shadow_select.r16))
{
RegMIIMiscellaneousControl_t write_data;
write_data.r16 = data;
@@ -256,7 +256,7 @@ static bool MII_writeShadowRegister1C(volatile DEVICE_t *device, uint8_t phy, mi
RegMIICabletronLed_t shadow_select;
shadow_select.r16 = 0;
shadow_select.bits.ShadowRegisterSelector = shadow_reg;
- if(MII_writeRegisterInternal(device, phy, (mii_reg_t)REG_MII_CABLETRON_LED, shadow_select.r16))
+ if (MII_writeRegisterInternal(device, phy, (mii_reg_t)REG_MII_CABLETRON_LED, shadow_select.r16))
{
RegMIICabletronLed_t write_data;
write_data.r16 = data;
@@ -300,7 +300,7 @@ int32_t MII_getBlock(volatile DEVICE_t *device, uint8_t phy)
bool MII_reset(volatile DEVICE_t *device, uint8_t phy)
{
// Set MII_REG_CONTROL to RESET; wait until RESET bit clears.
- if(MII_writeRegister(device, phy, (mii_reg_t)REG_MII_CONTROL, MII_CONTROL_RESET_MASK))
+ if (MII_writeRegister(device, phy, (mii_reg_t)REG_MII_CONTROL, MII_CONTROL_RESET_MASK))
{
do
{
diff --git a/libs/NCSI/ncsi.c b/libs/NCSI/ncsi.c
index e0f2113..e34957e 100644
--- a/libs/NCSI/ncsi.c
+++ b/libs/NCSI/ncsi.c
@@ -51,14 +51,12 @@
#include <Network.h>
#include <types.h>
-#include <MII.h>
-
#ifdef CXX_SIMULATOR
#include <stdio.h>
#else
#include <printf.h>
#endif
-#define debug(...) printf(__VA_ARGS__)
+#define debug(...) printf(__VA_ARGS__)
#define NUM_CHANNELS 1
#define MAX_CHANNELS 4
@@ -474,7 +472,7 @@ static void getVersionID(NetworkFrame_t *frame)
{
int ch = frame->controlPacket.ChannelID & CHANNEL_ID_MASK;
NetworkPort_t *port = gPackageState.port[ch];
- DEVICE_t* device = (DEVICE_t*)port->device;
+ DEVICE_t *device = (DEVICE_t *)port->device;
uint32_t packetSize = MAX(sizeof(gVersionFrame.version), ETHERNET_FRAME_MIN - 4);
gVersionFrame.version.ChannelID = ch;
@@ -491,7 +489,6 @@ static void getVersionID(NetworkFrame_t *frame)
NCSI_TxPacket(gVersionFrame.words, packetSize);
}
-
static void enableVLANHandler(NetworkFrame_t *frame)
{
// TODO
@@ -516,7 +513,6 @@ static void setVLANFilter(NetworkFrame_t *frame)
sendNCSIResponse(frame->controlPacket.InstanceID, frame->controlPacket.ChannelID, frame->controlPacket.ControlPacketType,
NCSI_RESPONSE_CODE_COMMAND_COMPLETE, NCSI_REASON_CODE_NONE);
-
}
static void setMACAddressHandler(NetworkFrame_t *frame)
@@ -591,7 +587,7 @@ ncsi_handler_t gNCSIHandlers[] = {
void handleNCSIFrame(NetworkFrame_t *frame)
{
uint8_t package = frame->controlPacket.ChannelID >> PACKAGE_ID_SHIFT;
- if(package != 0)
+ if (package != 0)
{
// debug("Ignoring command to package %d\n", package);
@@ -615,8 +611,8 @@ void handleNCSIFrame(NetworkFrame_t *frame)
sendNCSIResponse(frame->controlPacket.InstanceID, frame->controlPacket.ChannelID, frame->controlPacket.ControlPacketType,
NCSI_RESPONSE_CODE_COMMAND_FAILED, NCSI_REASON_CODE_INVALID_PAYLOAD_LENGTH);
}
- else if((handler->packageCommand && ch == CHANNEL_ID_PACKAGE) || // Package commands are always accepted.
- (handler->ignoreInit && ch < gPackageState.numChannels))
+ else if ((handler->packageCommand && ch == CHANNEL_ID_PACKAGE) || // Package commands are always accepted.
+ (handler->ignoreInit && ch < gPackageState.numChannels))
{
// Package command. Must handle.
debug("[%x] packageCommand/ignore init channel: %d\n", command, ch);
@@ -756,7 +752,7 @@ void NCSI_init(void)
{
resetChannel(i);
}
- SHM.SegSig.r32 = 0;// (1 << command);
+ SHM.SegSig.r32 = 0; // (1 << command);
}
void NCSI_handlePassthrough(void)
diff --git a/libs/Network/tx.c b/libs/Network/tx.c
index e1d79b8..42231d6 100644
--- a/libs/Network/tx.c
+++ b/libs/Network/tx.c
@@ -414,7 +414,7 @@ bool Network_TX_transmitPassthroughPacket(uint32_t length, NetworkPort_t *port)
int32_t tail;
int32_t first = tail = Network_TX_allocateBlock(port);
- if(first < 0)
+ if (first < 0)
{
// Unable to allocate block.
drainPassthroughBytes(length);
@@ -429,7 +429,7 @@ bool Network_TX_transmitPassthroughPacket(uint32_t length, NetworkPort_t *port)
if (blocks > 1)
{
next_block = Network_TX_allocateBlock(port);
- if(next_block < 0)
+ if (next_block < 0)
{
drainPassthroughBytes(length);
return false;
@@ -446,7 +446,7 @@ bool Network_TX_transmitPassthroughPacket(uint32_t length, NetworkPort_t *port)
if (blocks)
{
next_block = Network_TX_allocateBlock(port);
- if(next_block < 0)
+ if (next_block < 0)
{
drainPassthroughBytes(length);
return false;
diff --git a/libs/printf/em100_putchar.c b/libs/printf/em100_putchar.c
index b16f250..a898708 100644
--- a/libs/printf/em100_putchar.c
+++ b/libs/printf/em100_putchar.c
@@ -42,18 +42,18 @@
/// @endcond
////////////////////////////////////////////////////////////////////////////////
-#include <printf.h>
#include <EM100.h>
+#include <printf.h>
void em100_putchar(char character)
{
NVRam_EM100_putchar(character);
}
-void em100_puts(const char* string)
+void em100_puts(const char *string)
{
- while(*string != 0)
+ while (*string != 0)
{
NVRam_EM100_putchar(*string);
string++;
OpenPOWER on IntegriCloud