Skip to content

Commit

Permalink
Update smap.c
Browse files Browse the repository at this point in the history
  • Loading branch information
israpps committed Aug 14, 2023
1 parent 68dc8a5 commit fd48a3f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions iop/network/smap/src/smap.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static int DisplayHelpMessage(void)
static inline void RestartAutoNegotiation(volatile u8 *emac3_regbase, u16 bmsr)
{
if (EnableVerboseOutput)
DEBUG_PRINTF("SMAP: restarting auto nego (BMCR=0x%x, BMSR=0x%x)\n", _smap_read_phy(emac3_regbase, SMAP_DsPHYTER_BMCR), bmsr);
DEBUG_PRINTF("restarting auto nego (BMCR=0x%x, BMSR=0x%x)\n", _smap_read_phy(emac3_regbase, SMAP_DsPHYTER_BMCR), bmsr);
_smap_write_phy(emac3_regbase, SMAP_DsPHYTER_BMCR, SMAP_PHY_BMCR_ANEN | SMAP_PHY_BMCR_RSAN);
}

Expand All @@ -154,12 +154,12 @@ static int InitPHY(struct SmapDriverData *SmapDrivPrivData)

LinkSpeed100M = 0;
if (EnableVerboseOutput != 0)
DEBUG_PRINTF("SMAP: Resetting PHY\n");
DEBUG_PRINTF("Resetting PHY\n");

_smap_write_phy(SmapDrivPrivData->emac3_regbase, SMAP_DsPHYTER_BMCR, SMAP_PHY_BMCR_RST);
for (i = 0; _smap_read_phy(SmapDrivPrivData->emac3_regbase, SMAP_DsPHYTER_BMCR) & SMAP_PHY_BMCR_RST; i++) {
if (i <= 0) {
DEBUG_PRINTF("SMAP: PHY reset error\n");
DEBUG_PRINTF("PHY reset error\n");
return -1;
}
if (SmapDrivPrivData->NetDevStopFlag)
Expand All @@ -170,7 +170,7 @@ static int InitPHY(struct SmapDriverData *SmapDrivPrivData)

if (!EnableAutoNegotiation) {
if (EnableVerboseOutput != 0)
DEBUG_PRINTF("SMAP: no auto mode (conf=0x%x)\n", SmapConfiguration);
DEBUG_PRINTF("no auto mode (conf=0x%x)\n", SmapConfiguration);

LinkSpeed100M = 0 < (SmapConfiguration & 0x180); /* Toggles between SMAP_PHY_BMCR_10M and SMAP_PHY_BMCR_100M. */
value = LinkSpeed100M << 13;
Expand All @@ -179,7 +179,7 @@ static int InitPHY(struct SmapDriverData *SmapDrivPrivData)
_smap_write_phy(SmapDrivPrivData->emac3_regbase, SMAP_DsPHYTER_BMCR, value);

WaitLink:
DEBUG_PRINTF("SMAP: Waiting Valid Link for %dMbps\n", LinkSpeed100M ? 100 : 10);
DEBUG_PRINTF("Waiting Valid Link for %dMbps\n", LinkSpeed100M ? 100 : 10);

i = 0;
while (1) {
Expand Down

0 comments on commit fd48a3f

Please sign in to comment.