diff options
Diffstat (limited to 'drivers/net/chelsio/mv88e1xxx.c')
-rw-r--r-- | drivers/net/chelsio/mv88e1xxx.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/net/chelsio/mv88e1xxx.c b/drivers/net/chelsio/mv88e1xxx.c index 28ac93ff7c4f..5867e3b0a887 100644 --- a/drivers/net/chelsio/mv88e1xxx.c +++ b/drivers/net/chelsio/mv88e1xxx.c | |||
@@ -73,9 +73,8 @@ static int mv88e1xxx_interrupt_enable(struct cphy *cphy) | |||
73 | 73 | ||
74 | t1_tpi_read(cphy->adapter, A_ELMER0_INT_ENABLE, &elmer); | 74 | t1_tpi_read(cphy->adapter, A_ELMER0_INT_ENABLE, &elmer); |
75 | elmer |= ELMER0_GP_BIT1; | 75 | elmer |= ELMER0_GP_BIT1; |
76 | if (is_T2(cphy->adapter)) { | 76 | if (is_T2(cphy->adapter)) |
77 | elmer |= ELMER0_GP_BIT2|ELMER0_GP_BIT3|ELMER0_GP_BIT4; | 77 | elmer |= ELMER0_GP_BIT2 | ELMER0_GP_BIT3 | ELMER0_GP_BIT4; |
78 | } | ||
79 | t1_tpi_write(cphy->adapter, A_ELMER0_INT_ENABLE, elmer); | 78 | t1_tpi_write(cphy->adapter, A_ELMER0_INT_ENABLE, elmer); |
80 | } | 79 | } |
81 | return 0; | 80 | return 0; |
@@ -92,9 +91,8 @@ static int mv88e1xxx_interrupt_disable(struct cphy *cphy) | |||
92 | 91 | ||
93 | t1_tpi_read(cphy->adapter, A_ELMER0_INT_ENABLE, &elmer); | 92 | t1_tpi_read(cphy->adapter, A_ELMER0_INT_ENABLE, &elmer); |
94 | elmer &= ~ELMER0_GP_BIT1; | 93 | elmer &= ~ELMER0_GP_BIT1; |
95 | if (is_T2(cphy->adapter)) { | 94 | if (is_T2(cphy->adapter)) |
96 | elmer &= ~(ELMER0_GP_BIT2|ELMER0_GP_BIT3|ELMER0_GP_BIT4); | 95 | elmer &= ~(ELMER0_GP_BIT2|ELMER0_GP_BIT3|ELMER0_GP_BIT4); |
97 | } | ||
98 | t1_tpi_write(cphy->adapter, A_ELMER0_INT_ENABLE, elmer); | 96 | t1_tpi_write(cphy->adapter, A_ELMER0_INT_ENABLE, elmer); |
99 | } | 97 | } |
100 | return 0; | 98 | return 0; |
@@ -112,9 +110,8 @@ static int mv88e1xxx_interrupt_clear(struct cphy *cphy) | |||
112 | if (t1_is_asic(cphy->adapter)) { | 110 | if (t1_is_asic(cphy->adapter)) { |
113 | t1_tpi_read(cphy->adapter, A_ELMER0_INT_CAUSE, &elmer); | 111 | t1_tpi_read(cphy->adapter, A_ELMER0_INT_CAUSE, &elmer); |
114 | elmer |= ELMER0_GP_BIT1; | 112 | elmer |= ELMER0_GP_BIT1; |
115 | if (is_T2(cphy->adapter)) { | 113 | if (is_T2(cphy->adapter)) |
116 | elmer |= ELMER0_GP_BIT2|ELMER0_GP_BIT3|ELMER0_GP_BIT4; | 114 | elmer |= ELMER0_GP_BIT2|ELMER0_GP_BIT3|ELMER0_GP_BIT4; |
117 | } | ||
118 | t1_tpi_write(cphy->adapter, A_ELMER0_INT_CAUSE, elmer); | 115 | t1_tpi_write(cphy->adapter, A_ELMER0_INT_CAUSE, elmer); |
119 | } | 116 | } |
120 | return 0; | 117 | return 0; |
@@ -300,7 +297,7 @@ static int mv88e1xxx_interrupt_handler(struct cphy *cphy) | |||
300 | 297 | ||
301 | /* | 298 | /* |
302 | * Loop until cause reads zero. Need to handle bouncing interrupts. | 299 | * Loop until cause reads zero. Need to handle bouncing interrupts. |
303 | */ | 300 | */ |
304 | while (1) { | 301 | while (1) { |
305 | u32 cause; | 302 | u32 cause; |
306 | 303 | ||
@@ -308,15 +305,16 @@ static int mv88e1xxx_interrupt_handler(struct cphy *cphy) | |||
308 | MV88E1XXX_INTERRUPT_STATUS_REGISTER, | 305 | MV88E1XXX_INTERRUPT_STATUS_REGISTER, |
309 | &cause); | 306 | &cause); |
310 | cause &= INTR_ENABLE_MASK; | 307 | cause &= INTR_ENABLE_MASK; |
311 | if (!cause) break; | 308 | if (!cause) |
309 | break; | ||
312 | 310 | ||
313 | if (cause & MV88E1XXX_INTR_LINK_CHNG) { | 311 | if (cause & MV88E1XXX_INTR_LINK_CHNG) { |
314 | (void) simple_mdio_read(cphy, | 312 | (void) simple_mdio_read(cphy, |
315 | MV88E1XXX_SPECIFIC_STATUS_REGISTER, &status); | 313 | MV88E1XXX_SPECIFIC_STATUS_REGISTER, &status); |
316 | 314 | ||
317 | if (status & MV88E1XXX_INTR_LINK_CHNG) { | 315 | if (status & MV88E1XXX_INTR_LINK_CHNG) |
318 | cphy->state |= PHY_LINK_UP; | 316 | cphy->state |= PHY_LINK_UP; |
319 | } else { | 317 | else { |
320 | cphy->state &= ~PHY_LINK_UP; | 318 | cphy->state &= ~PHY_LINK_UP; |
321 | if (cphy->state & PHY_AUTONEG_EN) | 319 | if (cphy->state & PHY_AUTONEG_EN) |
322 | cphy->state &= ~PHY_AUTONEG_RDY; | 320 | cphy->state &= ~PHY_AUTONEG_RDY; |
@@ -360,7 +358,8 @@ static struct cphy *mv88e1xxx_phy_create(adapter_t *adapter, int phy_addr, | |||
360 | { | 358 | { |
361 | struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL); | 359 | struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL); |
362 | 360 | ||
363 | if (!cphy) return NULL; | 361 | if (!cphy) |
362 | return NULL; | ||
364 | 363 | ||
365 | cphy_init(cphy, adapter, phy_addr, &mv88e1xxx_ops, mdio_ops); | 364 | cphy_init(cphy, adapter, phy_addr, &mv88e1xxx_ops, mdio_ops); |
366 | 365 | ||
@@ -377,11 +376,11 @@ static struct cphy *mv88e1xxx_phy_create(adapter_t *adapter, int phy_addr, | |||
377 | } | 376 | } |
378 | (void) mv88e1xxx_downshift_set(cphy, 1); /* Enable downshift */ | 377 | (void) mv88e1xxx_downshift_set(cphy, 1); /* Enable downshift */ |
379 | 378 | ||
380 | /* LED */ | 379 | /* LED */ |
381 | if (is_T2(adapter)) { | 380 | if (is_T2(adapter)) { |
382 | (void) simple_mdio_write(cphy, | 381 | (void) simple_mdio_write(cphy, |
383 | MV88E1XXX_LED_CONTROL_REGISTER, 0x1); | 382 | MV88E1XXX_LED_CONTROL_REGISTER, 0x1); |
384 | } | 383 | } |
385 | 384 | ||
386 | return cphy; | 385 | return cphy; |
387 | } | 386 | } |