diff options
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r-- | drivers/net/niu.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 32678b6c6b39..9e6330bc0531 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -6071,8 +6071,7 @@ static int niu_request_irq(struct niu *np) | |||
6071 | for (i = 0; i < np->num_ldg; i++) { | 6071 | for (i = 0; i < np->num_ldg; i++) { |
6072 | struct niu_ldg *lp = &np->ldg[i]; | 6072 | struct niu_ldg *lp = &np->ldg[i]; |
6073 | 6073 | ||
6074 | err = request_irq(lp->irq, niu_interrupt, | 6074 | err = request_irq(lp->irq, niu_interrupt, IRQF_SHARED, |
6075 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, | ||
6076 | np->irq_name[i], lp); | 6075 | np->irq_name[i], lp); |
6077 | if (err) | 6076 | if (err) |
6078 | goto out_free_irqs; | 6077 | goto out_free_irqs; |
@@ -7023,6 +7022,7 @@ static int niu_ethflow_to_class(int flow_type, u64 *class) | |||
7023 | case UDP_V4_FLOW: | 7022 | case UDP_V4_FLOW: |
7024 | *class = CLASS_CODE_UDP_IPV4; | 7023 | *class = CLASS_CODE_UDP_IPV4; |
7025 | break; | 7024 | break; |
7025 | case AH_ESP_V4_FLOW: | ||
7026 | case AH_V4_FLOW: | 7026 | case AH_V4_FLOW: |
7027 | case ESP_V4_FLOW: | 7027 | case ESP_V4_FLOW: |
7028 | *class = CLASS_CODE_AH_ESP_IPV4; | 7028 | *class = CLASS_CODE_AH_ESP_IPV4; |
@@ -7036,6 +7036,7 @@ static int niu_ethflow_to_class(int flow_type, u64 *class) | |||
7036 | case UDP_V6_FLOW: | 7036 | case UDP_V6_FLOW: |
7037 | *class = CLASS_CODE_UDP_IPV6; | 7037 | *class = CLASS_CODE_UDP_IPV6; |
7038 | break; | 7038 | break; |
7039 | case AH_ESP_V6_FLOW: | ||
7039 | case AH_V6_FLOW: | 7040 | case AH_V6_FLOW: |
7040 | case ESP_V6_FLOW: | 7041 | case ESP_V6_FLOW: |
7041 | *class = CLASS_CODE_AH_ESP_IPV6; | 7042 | *class = CLASS_CODE_AH_ESP_IPV6; |
@@ -7889,28 +7890,31 @@ static void niu_force_led(struct niu *np, int on) | |||
7889 | nw64_mac(reg, val); | 7890 | nw64_mac(reg, val); |
7890 | } | 7891 | } |
7891 | 7892 | ||
7892 | static int niu_phys_id(struct net_device *dev, u32 data) | 7893 | static int niu_set_phys_id(struct net_device *dev, |
7894 | enum ethtool_phys_id_state state) | ||
7895 | |||
7893 | { | 7896 | { |
7894 | struct niu *np = netdev_priv(dev); | 7897 | struct niu *np = netdev_priv(dev); |
7895 | u64 orig_led_state; | ||
7896 | int i; | ||
7897 | 7898 | ||
7898 | if (!netif_running(dev)) | 7899 | if (!netif_running(dev)) |
7899 | return -EAGAIN; | 7900 | return -EAGAIN; |
7900 | 7901 | ||
7901 | if (data == 0) | 7902 | switch (state) { |
7902 | data = 2; | 7903 | case ETHTOOL_ID_ACTIVE: |
7904 | np->orig_led_state = niu_led_state_save(np); | ||
7905 | return -EINVAL; | ||
7903 | 7906 | ||
7904 | orig_led_state = niu_led_state_save(np); | 7907 | case ETHTOOL_ID_ON: |
7905 | for (i = 0; i < (data * 2); i++) { | 7908 | niu_force_led(np, 1); |
7906 | int on = ((i % 2) == 0); | 7909 | break; |
7907 | 7910 | ||
7908 | niu_force_led(np, on); | 7911 | case ETHTOOL_ID_OFF: |
7912 | niu_force_led(np, 0); | ||
7913 | break; | ||
7909 | 7914 | ||
7910 | if (msleep_interruptible(500)) | 7915 | case ETHTOOL_ID_INACTIVE: |
7911 | break; | 7916 | niu_led_state_restore(np, np->orig_led_state); |
7912 | } | 7917 | } |
7913 | niu_led_state_restore(np, orig_led_state); | ||
7914 | 7918 | ||
7915 | return 0; | 7919 | return 0; |
7916 | } | 7920 | } |
@@ -7933,7 +7937,7 @@ static const struct ethtool_ops niu_ethtool_ops = { | |||
7933 | .get_strings = niu_get_strings, | 7937 | .get_strings = niu_get_strings, |
7934 | .get_sset_count = niu_get_sset_count, | 7938 | .get_sset_count = niu_get_sset_count, |
7935 | .get_ethtool_stats = niu_get_ethtool_stats, | 7939 | .get_ethtool_stats = niu_get_ethtool_stats, |
7936 | .phys_id = niu_phys_id, | 7940 | .set_phys_id = niu_set_phys_id, |
7937 | .get_rxnfc = niu_get_nfc, | 7941 | .get_rxnfc = niu_get_nfc, |
7938 | .set_rxnfc = niu_set_nfc, | 7942 | .set_rxnfc = niu_set_nfc, |
7939 | .set_flags = niu_set_flags, | 7943 | .set_flags = niu_set_flags, |