diff options
Diffstat (limited to 'drivers/net/gianfar_ethtool.c')
-rw-r--r-- | drivers/net/gianfar_ethtool.c | 52 |
1 files changed, 1 insertions, 51 deletions
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 | } |