tsec: Clean up Broadcom PHY status parsing
- Remove unnecessary printing "Enet starting in <speed>/<duplex>" This same information is already printed during normal ethernet operation in the form "Speed: 1000, full duplex". - Add a check for link before determining link speed and duplex If there is no link, speed/duplex don't matter. This also removes the annoying and unneeded "Auto-neg error, defaulting to 10BT/HD" message that occurs when no link is detected. - Whitespace and line > 80 characters cleanup Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
46e91674fb
commit
27165b5c32
|
@ -488,45 +488,36 @@ uint mii_BCM54xx_wirespeed(uint mii_reg, struct tsec_private *priv)
|
||||||
*/
|
*/
|
||||||
uint mii_parse_BCM54xx_sr(uint mii_reg, struct tsec_private *priv)
|
uint mii_parse_BCM54xx_sr(uint mii_reg, struct tsec_private *priv)
|
||||||
{
|
{
|
||||||
|
/* If there is no link, speed and duplex don't matter */
|
||||||
|
if (!priv->link)
|
||||||
|
return 0;
|
||||||
|
|
||||||
switch((mii_reg & MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK) >> MIIM_BCM54xx_AUXSTATUS_LINKMODE_SHIFT){
|
switch ((mii_reg & MIIM_BCM54xx_AUXSTATUS_LINKMODE_MASK) >>
|
||||||
|
MIIM_BCM54xx_AUXSTATUS_LINKMODE_SHIFT) {
|
||||||
case 1:
|
case 1:
|
||||||
printf("Enet starting in 10BT/HD\n");
|
|
||||||
priv->duplexity = 0;
|
priv->duplexity = 0;
|
||||||
priv->speed = 10;
|
priv->speed = 10;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
printf("Enet starting in 10BT/FD\n");
|
|
||||||
priv->duplexity = 1;
|
priv->duplexity = 1;
|
||||||
priv->speed = 10;
|
priv->speed = 10;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
printf("Enet starting in 100BT/HD\n");
|
|
||||||
priv->duplexity = 0;
|
priv->duplexity = 0;
|
||||||
priv->speed = 100;
|
priv->speed = 100;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
printf("Enet starting in 100BT/FD\n");
|
|
||||||
priv->duplexity = 1;
|
priv->duplexity = 1;
|
||||||
priv->speed = 100;
|
priv->speed = 100;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
printf("Enet starting in 1000BT/HD\n");
|
|
||||||
priv->duplexity = 0;
|
priv->duplexity = 0;
|
||||||
priv->speed = 1000;
|
priv->speed = 1000;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
printf("Enet starting in 1000BT/FD\n");
|
|
||||||
priv->duplexity = 1;
|
priv->duplexity = 1;
|
||||||
priv->speed = 1000;
|
priv->speed = 1000;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("Auto-neg error, defaulting to 10BT/HD\n");
|
printf("Auto-neg error, defaulting to 10BT/HD\n");
|
||||||
priv->duplexity = 0;
|
priv->duplexity = 0;
|
||||||
|
|
Loading…
Reference in New Issue