diff options
-rw-r--r-- | drivers/net/gianfar.h | 17 | ||||
-rw-r--r-- | drivers/net/gianfar_ethtool.c | 52 |
2 files changed, 1 insertions, 68 deletions
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index ec5d595ce2e2..57ee3b009d75 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
@@ -382,23 +382,6 @@ extern const char gfar_driver_version[]; | |||
382 | #define BD_LFLAG(flags) ((flags) << 16) | 382 | #define BD_LFLAG(flags) ((flags) << 16) |
383 | #define BD_LENGTH_MASK 0x0000ffff | 383 | #define BD_LENGTH_MASK 0x0000ffff |
384 | 384 | ||
385 | #define CLASS_CODE_UNRECOG 0x00 | ||
386 | #define CLASS_CODE_DUMMY1 0x01 | ||
387 | #define CLASS_CODE_ETHERTYPE1 0x02 | ||
388 | #define CLASS_CODE_ETHERTYPE2 0x03 | ||
389 | #define CLASS_CODE_USER_PROG1 0x04 | ||
390 | #define CLASS_CODE_USER_PROG2 0x05 | ||
391 | #define CLASS_CODE_USER_PROG3 0x06 | ||
392 | #define CLASS_CODE_USER_PROG4 0x07 | ||
393 | #define CLASS_CODE_TCP_IPV4 0x08 | ||
394 | #define CLASS_CODE_UDP_IPV4 0x09 | ||
395 | #define CLASS_CODE_AH_ESP_IPV4 0x0a | ||
396 | #define CLASS_CODE_SCTP_IPV4 0x0b | ||
397 | #define CLASS_CODE_TCP_IPV6 0x0c | ||
398 | #define CLASS_CODE_UDP_IPV6 0x0d | ||
399 | #define CLASS_CODE_AH_ESP_IPV6 0x0e | ||
400 | #define CLASS_CODE_SCTP_IPV6 0x0f | ||
401 | |||
402 | #define FPR_FILER_MASK 0xFFFFFFFF | 385 | #define FPR_FILER_MASK 0xFFFFFFFF |
403 | #define MAX_FILER_IDX 0xFF | 386 | #define MAX_FILER_IDX 0xFF |
404 | 387 | ||
diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c index 3bc8e276ba4d..0840590958dd 100644 --- a/drivers/net/gianfar_ethtool.c +++ b/drivers/net/gianfar_ethtool.c | |||
@@ -645,42 +645,6 @@ static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
645 | } | 645 | } |
646 | #endif | 646 | #endif |
647 | 647 | ||
648 | static int gfar_ethflow_to_class(int flow_type, u64 *class) | ||
649 | { | ||
650 | switch (flow_type) { | ||
651 | case TCP_V4_FLOW: | ||
652 | *class = CLASS_CODE_TCP_IPV4; | ||
653 | break; | ||
654 | case UDP_V4_FLOW: | ||
655 | *class = CLASS_CODE_UDP_IPV4; | ||
656 | break; | ||
657 | case AH_V4_FLOW: | ||
658 | case ESP_V4_FLOW: | ||
659 | *class = CLASS_CODE_AH_ESP_IPV4; | ||
660 | break; | ||
661 | case SCTP_V4_FLOW: | ||
662 | *class = CLASS_CODE_SCTP_IPV4; | ||
663 | break; | ||
664 | case TCP_V6_FLOW: | ||
665 | *class = CLASS_CODE_TCP_IPV6; | ||
666 | break; | ||
667 | case UDP_V6_FLOW: | ||
668 | *class = CLASS_CODE_UDP_IPV6; | ||
669 | break; | ||
670 | case AH_V6_FLOW: | ||
671 | case ESP_V6_FLOW: | ||
672 | *class = CLASS_CODE_AH_ESP_IPV6; | ||
673 | break; | ||
674 | case SCTP_V6_FLOW: | ||
675 | *class = CLASS_CODE_SCTP_IPV6; | ||
676 | break; | ||
677 | default: | ||
678 | return 0; | ||
679 | } | ||
680 | |||
681 | return 1; | ||
682 | } | ||
683 | |||
684 | static void ethflow_to_filer_rules (struct gfar_private *priv, u64 ethflow) | 648 | static void ethflow_to_filer_rules (struct gfar_private *priv, u64 ethflow) |
685 | { | 649 | { |
686 | u32 fcr = 0x0, fpr = FPR_FILER_MASK; | 650 | u32 fcr = 0x0, fpr = FPR_FILER_MASK; |
@@ -778,11 +742,6 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u | |||
778 | case UDP_V6_FLOW: | 742 | case UDP_V6_FLOW: |
779 | cmp_rqfpr = RQFPR_IPV6 |RQFPR_UDP; | 743 | cmp_rqfpr = RQFPR_IPV6 |RQFPR_UDP; |
780 | break; | 744 | break; |
781 | case IPV4_FLOW: | ||
782 | cmp_rqfpr = RQFPR_IPV4; | ||
783 | case IPV6_FLOW: | ||
784 | cmp_rqfpr = RQFPR_IPV6; | ||
785 | break; | ||
786 | default: | 745 | default: |
787 | printk(KERN_ERR "Right now this class is not supported\n"); | 746 | printk(KERN_ERR "Right now this class is not supported\n"); |
788 | return 0; | 747 | return 0; |
@@ -848,18 +807,9 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u | |||
848 | 807 | ||
849 | static int gfar_set_hash_opts(struct gfar_private *priv, struct ethtool_rxnfc *cmd) | 808 | static int gfar_set_hash_opts(struct gfar_private *priv, struct ethtool_rxnfc *cmd) |
850 | { | 809 | { |
851 | u64 class; | ||
852 | |||
853 | if (!gfar_ethflow_to_class(cmd->flow_type, &class)) | ||
854 | return -EINVAL; | ||
855 | |||
856 | if (class < CLASS_CODE_USER_PROG1 || | ||
857 | class > CLASS_CODE_SCTP_IPV6) | ||
858 | return -EINVAL; | ||
859 | |||
860 | /* write the filer rules here */ | 810 | /* write the filer rules here */ |
861 | if (!gfar_ethflow_to_filer_table(priv, cmd->data, cmd->flow_type)) | 811 | if (!gfar_ethflow_to_filer_table(priv, cmd->data, cmd->flow_type)) |
862 | return -1; | 812 | return -EINVAL; |
863 | 813 | ||
864 | return 0; | 814 | return 0; |
865 | } | 815 | } |