Commit a5b9f41c authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

skge: implement set_phys_id

Implement set_phys_id led control on SysKonnect board.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 74e532ff
...@@ -786,28 +786,27 @@ static void skge_led(struct skge_port *skge, enum led_mode mode) ...@@ -786,28 +786,27 @@ static void skge_led(struct skge_port *skge, enum led_mode mode)
} }
/* blink LED's for finding board */ /* blink LED's for finding board */
static int skge_phys_id(struct net_device *dev, u32 data) static int skge_set_phys_id(struct net_device *dev,
enum ethtool_phys_id_state state)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = netdev_priv(dev);
unsigned long ms;
enum led_mode mode = LED_MODE_TST;
if (!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) switch (state) {
ms = jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT / HZ) * 1000; case ETHTOOL_ID_ACTIVE:
else return -EINVAL;
ms = data * 1000;
while (ms > 0) { case ETHTOOL_ID_ON:
skge_led(skge, mode); skge_led(skge, LED_MODE_TST);
mode ^= LED_MODE_TST; break;
if (msleep_interruptible(BLINK_MS)) case ETHTOOL_ID_OFF:
break; skge_led(skge, LED_MODE_OFF);
ms -= BLINK_MS; break;
}
/* back to regular LED state */ case ETHTOOL_ID_INACTIVE:
skge_led(skge, netif_running(dev) ? LED_MODE_ON : LED_MODE_OFF); /* back to regular LED state */
skge_led(skge, netif_running(dev) ? LED_MODE_ON : LED_MODE_OFF);
}
return 0; return 0;
} }
...@@ -930,7 +929,7 @@ static const struct ethtool_ops skge_ethtool_ops = { ...@@ -930,7 +929,7 @@ static const struct ethtool_ops skge_ethtool_ops = {
.get_rx_csum = skge_get_rx_csum, .get_rx_csum = skge_get_rx_csum,
.set_rx_csum = skge_set_rx_csum, .set_rx_csum = skge_set_rx_csum,
.get_strings = skge_get_strings, .get_strings = skge_get_strings,
.phys_id = skge_phys_id, .set_phys_id = skge_set_phys_id,
.get_sset_count = skge_get_sset_count, .get_sset_count = skge_get_sset_count,
.get_ethtool_stats = skge_get_ethtool_stats, .get_ethtool_stats = skge_get_ethtool_stats,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment