summaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_common.c
diff options
context:
space:
mode:
authorLinus Torvalds2009-04-16 16:41:56 +0200
committerLinus Torvalds2009-04-16 16:41:56 +0200
commitcd97824994042b809493807ea644ba26c0c23290 (patch)
tree705d9d069130330d4d9d2a23cd9ff99ec8187f28 /drivers/net/ixgbe/ixgbe_common.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 (diff)
parentphylib: Fix delay argument of schedule_delayed_work (diff)
downloadkernel-qcow2-linux-cd97824994042b809493807ea644ba26c0c23290.tar.gz
kernel-qcow2-linux-cd97824994042b809493807ea644ba26c0c23290.tar.xz
kernel-qcow2-linux-cd97824994042b809493807ea644ba26c0c23290.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (64 commits) phylib: Fix delay argument of schedule_delayed_work NET/ixgbe: Fix powering off during shutdown NET/e1000e: Fix powering off during shutdown NET/e1000: Fix powering off during shutdown packet: avoid warnings when high-order page allocation fails gianfar: stop send queue before resetting gianfar myr10ge: again fix lro_gen_skb() alignment declance: convert to net_device_ops bfin_mac: convert to net_device_ops au1000: convert to net_device_ops atarilance: convert to net_device_ops a2065: convert to net_device_ops ixgbe: update real_num_tx_queues on changing num_rx_queues ixgbe: fix tx queue index Revert "rose: zero length frame filtering in af_rose.c" sfc: Use correct macro to set event bitfield sfc: Match calls to netif_napi_add() and netif_napi_del() bonding: Remove debug printk e1000/e1000: fix compile warning ehea: Fix incomplete conversion to net_device_ops ...
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_common.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_common.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 63ab6671d08e..5567519676d5 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -2071,3 +2071,58 @@ s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval)
return 0;
}
+
+/**
+ * ixgbe_blink_led_start_generic - Blink LED based on index.
+ * @hw: pointer to hardware structure
+ * @index: led number to blink
+ **/
+s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index)
+{
+ ixgbe_link_speed speed = 0;
+ bool link_up = 0;
+ u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
+ u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
+
+ /*
+ * Link must be up to auto-blink the LEDs;
+ * Force it if link is down.
+ */
+ hw->mac.ops.check_link(hw, &speed, &link_up, false);
+
+ if (!link_up) {
+ autoc_reg |= IXGBE_AUTOC_FLU;
+ IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
+ msleep(10);
+ }
+
+ led_reg &= ~IXGBE_LED_MODE_MASK(index);
+ led_reg |= IXGBE_LED_BLINK(index);
+ IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
+ IXGBE_WRITE_FLUSH(hw);
+
+ return 0;
+}
+
+/**
+ * ixgbe_blink_led_stop_generic - Stop blinking LED based on index.
+ * @hw: pointer to hardware structure
+ * @index: led number to stop blinking
+ **/
+s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index)
+{
+ u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
+ u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
+
+ autoc_reg &= ~IXGBE_AUTOC_FLU;
+ autoc_reg |= IXGBE_AUTOC_AN_RESTART;
+ IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
+
+ led_reg &= ~IXGBE_LED_MODE_MASK(index);
+ led_reg &= ~IXGBE_LED_BLINK(index);
+ led_reg |= IXGBE_LED_LINK_ACTIVE << IXGBE_LED_MODE_SHIFT(index);
+ IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
+ IXGBE_WRITE_FLUSH(hw);
+
+ return 0;
+}