diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-07 13:59:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-12-07 13:59:48 -0500 |
commit | 29ac0052ea454871273a1fc7ef09a97f3c214ee6 (patch) | |
tree | 40441a8ec1f34b508ae1cc4bb91f9fabad4889e9 /drivers | |
parent | f3656b9a2740ebdff123b30b6b806648c9f189f8 (diff) | |
parent | 4aa9cb320e8081fbaec0c10eb0e077c8ca4d1ad9 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[AF_RXRPC]: Add a missing goto
[VLAN]: Lost rtnl_unlock() in vlan_ioctl()
[SCTP]: Fix the bind_addr info during migration.
[SCTP]: Add bind hash locking to the migrate code
[IPV4]: Remove prototype of ip_rt_advice
[IPv4]: Reply net unreachable ICMP message
[IPv6] SNMP: Increment OutNoRoutes when connecting to unreachable network
[BRIDGE]: Section fix.
[NIU]: Fix link LED handling.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/niu.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 112ab079ce7d..abfc61c3a38c 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -1045,6 +1045,7 @@ static int niu_serdes_init(struct niu *np) | |||
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | static void niu_init_xif(struct niu *); | 1047 | static void niu_init_xif(struct niu *); |
1048 | static void niu_handle_led(struct niu *, int status); | ||
1048 | 1049 | ||
1049 | static int niu_link_status_common(struct niu *np, int link_up) | 1050 | static int niu_link_status_common(struct niu *np, int link_up) |
1050 | { | 1051 | { |
@@ -1066,11 +1067,15 @@ static int niu_link_status_common(struct niu *np, int link_up) | |||
1066 | 1067 | ||
1067 | spin_lock_irqsave(&np->lock, flags); | 1068 | spin_lock_irqsave(&np->lock, flags); |
1068 | niu_init_xif(np); | 1069 | niu_init_xif(np); |
1070 | niu_handle_led(np, 1); | ||
1069 | spin_unlock_irqrestore(&np->lock, flags); | 1071 | spin_unlock_irqrestore(&np->lock, flags); |
1070 | 1072 | ||
1071 | netif_carrier_on(dev); | 1073 | netif_carrier_on(dev); |
1072 | } else if (netif_carrier_ok(dev) && !link_up) { | 1074 | } else if (netif_carrier_ok(dev) && !link_up) { |
1073 | niuwarn(LINK, "%s: Link is down\n", dev->name); | 1075 | niuwarn(LINK, "%s: Link is down\n", dev->name); |
1076 | spin_lock_irqsave(&np->lock, flags); | ||
1077 | niu_handle_led(np, 0); | ||
1078 | spin_unlock_irqrestore(&np->lock, flags); | ||
1074 | netif_carrier_off(dev); | 1079 | netif_carrier_off(dev); |
1075 | } | 1080 | } |
1076 | 1081 | ||
@@ -3915,16 +3920,14 @@ static int niu_init_ipp(struct niu *np) | |||
3915 | return 0; | 3920 | return 0; |
3916 | } | 3921 | } |
3917 | 3922 | ||
3918 | static void niu_init_xif_xmac(struct niu *np) | 3923 | static void niu_handle_led(struct niu *np, int status) |
3919 | { | 3924 | { |
3920 | struct niu_link_config *lp = &np->link_config; | ||
3921 | u64 val; | 3925 | u64 val; |
3922 | |||
3923 | val = nr64_mac(XMAC_CONFIG); | 3926 | val = nr64_mac(XMAC_CONFIG); |
3924 | 3927 | ||
3925 | if ((np->flags & NIU_FLAGS_10G) != 0 && | 3928 | if ((np->flags & NIU_FLAGS_10G) != 0 && |
3926 | (np->flags & NIU_FLAGS_FIBER) != 0) { | 3929 | (np->flags & NIU_FLAGS_FIBER) != 0) { |
3927 | if (netif_carrier_ok(np->dev)) { | 3930 | if (status) { |
3928 | val |= XMAC_CONFIG_LED_POLARITY; | 3931 | val |= XMAC_CONFIG_LED_POLARITY; |
3929 | val &= ~XMAC_CONFIG_FORCE_LED_ON; | 3932 | val &= ~XMAC_CONFIG_FORCE_LED_ON; |
3930 | } else { | 3933 | } else { |
@@ -3933,6 +3936,15 @@ static void niu_init_xif_xmac(struct niu *np) | |||
3933 | } | 3936 | } |
3934 | } | 3937 | } |
3935 | 3938 | ||
3939 | nw64_mac(XMAC_CONFIG, val); | ||
3940 | } | ||
3941 | |||
3942 | static void niu_init_xif_xmac(struct niu *np) | ||
3943 | { | ||
3944 | struct niu_link_config *lp = &np->link_config; | ||
3945 | u64 val; | ||
3946 | |||
3947 | val = nr64_mac(XMAC_CONFIG); | ||
3936 | val &= ~XMAC_CONFIG_SEL_POR_CLK_SRC; | 3948 | val &= ~XMAC_CONFIG_SEL_POR_CLK_SRC; |
3937 | 3949 | ||
3938 | val |= XMAC_CONFIG_TX_OUTPUT_EN; | 3950 | val |= XMAC_CONFIG_TX_OUTPUT_EN; |
@@ -4776,6 +4788,8 @@ static int niu_close(struct net_device *dev) | |||
4776 | 4788 | ||
4777 | niu_free_channels(np); | 4789 | niu_free_channels(np); |
4778 | 4790 | ||
4791 | niu_handle_led(np, 0); | ||
4792 | |||
4779 | return 0; | 4793 | return 0; |
4780 | } | 4794 | } |
4781 | 4795 | ||