diff options
Diffstat (limited to 'drivers/net/hyperv/hyperv_net.h')
-rw-r--r-- | drivers/net/hyperv/hyperv_net.h | 145 |
1 files changed, 138 insertions, 7 deletions
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 39fc230f5c20..7d06b4959383 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h | |||
@@ -30,6 +30,7 @@ | |||
30 | 30 | ||
31 | /* Fwd declaration */ | 31 | /* Fwd declaration */ |
32 | struct hv_netvsc_packet; | 32 | struct hv_netvsc_packet; |
33 | struct ndis_tcp_ip_checksum_info; | ||
33 | 34 | ||
34 | /* Represent the xfer page packet which contains 1 or more netvsc packet */ | 35 | /* Represent the xfer page packet which contains 1 or more netvsc packet */ |
35 | struct xferpage_packet { | 36 | struct xferpage_packet { |
@@ -73,7 +74,7 @@ struct hv_netvsc_packet { | |||
73 | } completion; | 74 | } completion; |
74 | 75 | ||
75 | /* This points to the memory after page_buf */ | 76 | /* This points to the memory after page_buf */ |
76 | void *extension; | 77 | struct rndis_message *rndis_msg; |
77 | 78 | ||
78 | u32 total_data_buflen; | 79 | u32 total_data_buflen; |
79 | /* Points to the send/receive buffer where the ethernet frame is */ | 80 | /* Points to the send/receive buffer where the ethernet frame is */ |
@@ -117,7 +118,8 @@ int netvsc_send(struct hv_device *device, | |||
117 | void netvsc_linkstatus_callback(struct hv_device *device_obj, | 118 | void netvsc_linkstatus_callback(struct hv_device *device_obj, |
118 | unsigned int status); | 119 | unsigned int status); |
119 | int netvsc_recv_callback(struct hv_device *device_obj, | 120 | int netvsc_recv_callback(struct hv_device *device_obj, |
120 | struct hv_netvsc_packet *packet); | 121 | struct hv_netvsc_packet *packet, |
122 | struct ndis_tcp_ip_checksum_info *csum_info); | ||
121 | int rndis_filter_open(struct hv_device *dev); | 123 | int rndis_filter_open(struct hv_device *dev); |
122 | int rndis_filter_close(struct hv_device *dev); | 124 | int rndis_filter_close(struct hv_device *dev); |
123 | int rndis_filter_device_add(struct hv_device *dev, | 125 | int rndis_filter_device_add(struct hv_device *dev, |
@@ -126,11 +128,6 @@ void rndis_filter_device_remove(struct hv_device *dev); | |||
126 | int rndis_filter_receive(struct hv_device *dev, | 128 | int rndis_filter_receive(struct hv_device *dev, |
127 | struct hv_netvsc_packet *pkt); | 129 | struct hv_netvsc_packet *pkt); |
128 | 130 | ||
129 | |||
130 | |||
131 | int rndis_filter_send(struct hv_device *dev, | ||
132 | struct hv_netvsc_packet *pkt); | ||
133 | |||
134 | int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter); | 131 | int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter); |
135 | int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac); | 132 | int rndis_filter_set_device_mac(struct hv_device *hdev, char *mac); |
136 | 133 | ||
@@ -726,9 +723,133 @@ struct ndis_pkt_8021q_info { | |||
726 | }; | 723 | }; |
727 | }; | 724 | }; |
728 | 725 | ||
726 | struct ndis_oject_header { | ||
727 | u8 type; | ||
728 | u8 revision; | ||
729 | u16 size; | ||
730 | }; | ||
731 | |||
732 | #define NDIS_OBJECT_TYPE_DEFAULT 0x80 | ||
733 | #define NDIS_OFFLOAD_PARAMETERS_REVISION_3 3 | ||
734 | #define NDIS_OFFLOAD_PARAMETERS_NO_CHANGE 0 | ||
735 | #define NDIS_OFFLOAD_PARAMETERS_LSOV2_DISABLED 1 | ||
736 | #define NDIS_OFFLOAD_PARAMETERS_LSOV2_ENABLED 2 | ||
737 | #define NDIS_OFFLOAD_PARAMETERS_LSOV1_ENABLED 2 | ||
738 | #define NDIS_OFFLOAD_PARAMETERS_RSC_DISABLED 1 | ||
739 | #define NDIS_OFFLOAD_PARAMETERS_RSC_ENABLED 2 | ||
740 | #define NDIS_OFFLOAD_PARAMETERS_TX_RX_DISABLED 1 | ||
741 | #define NDIS_OFFLOAD_PARAMETERS_TX_ENABLED_RX_DISABLED 2 | ||
742 | #define NDIS_OFFLOAD_PARAMETERS_RX_ENABLED_TX_DISABLED 3 | ||
743 | #define NDIS_OFFLOAD_PARAMETERS_TX_RX_ENABLED 4 | ||
744 | |||
745 | #define NDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE 1 | ||
746 | #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV4 0 | ||
747 | #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV6 1 | ||
748 | |||
749 | /* | ||
750 | * New offload OIDs for NDIS 6 | ||
751 | */ | ||
752 | #define OID_TCP_OFFLOAD_CURRENT_CONFIG 0xFC01020B /* query only */ | ||
753 | #define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C /* set only */ | ||
754 | #define OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES 0xFC01020D/* query only */ | ||
755 | #define OID_TCP_CONNECTION_OFFLOAD_CURRENT_CONFIG 0xFC01020E /* query only */ | ||
756 | #define OID_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES 0xFC01020F /* query */ | ||
757 | #define OID_OFFLOAD_ENCAPSULATION 0x0101010A /* set/query */ | ||
758 | |||
759 | struct ndis_offload_params { | ||
760 | struct ndis_oject_header header; | ||
761 | u8 ip_v4_csum; | ||
762 | u8 tcp_ip_v4_csum; | ||
763 | u8 udp_ip_v4_csum; | ||
764 | u8 tcp_ip_v6_csum; | ||
765 | u8 udp_ip_v6_csum; | ||
766 | u8 lso_v1; | ||
767 | u8 ip_sec_v1; | ||
768 | u8 lso_v2_ipv4; | ||
769 | u8 lso_v2_ipv6; | ||
770 | u8 tcp_connection_ip_v4; | ||
771 | u8 tcp_connection_ip_v6; | ||
772 | u32 flags; | ||
773 | u8 ip_sec_v2; | ||
774 | u8 ip_sec_v2_ip_v4; | ||
775 | struct { | ||
776 | u8 rsc_ip_v4; | ||
777 | u8 rsc_ip_v6; | ||
778 | }; | ||
779 | struct { | ||
780 | u8 encapsulated_packet_task_offload; | ||
781 | u8 encapsulation_types; | ||
782 | }; | ||
783 | }; | ||
784 | |||
785 | struct ndis_tcp_ip_checksum_info { | ||
786 | union { | ||
787 | struct { | ||
788 | u32 is_ipv4:1; | ||
789 | u32 is_ipv6:1; | ||
790 | u32 tcp_checksum:1; | ||
791 | u32 udp_checksum:1; | ||
792 | u32 ip_header_checksum:1; | ||
793 | u32 reserved:11; | ||
794 | u32 tcp_header_offset:10; | ||
795 | } transmit; | ||
796 | struct { | ||
797 | u32 tcp_checksum_failed:1; | ||
798 | u32 udp_checksum_failed:1; | ||
799 | u32 ip_checksum_failed:1; | ||
800 | u32 tcp_checksum_succeeded:1; | ||
801 | u32 udp_checksum_succeeded:1; | ||
802 | u32 ip_checksum_succeeded:1; | ||
803 | u32 loopback:1; | ||
804 | u32 tcp_checksum_value_invalid:1; | ||
805 | u32 ip_checksum_value_invalid:1; | ||
806 | } receive; | ||
807 | u32 value; | ||
808 | }; | ||
809 | }; | ||
810 | |||
811 | struct ndis_tcp_lso_info { | ||
812 | union { | ||
813 | struct { | ||
814 | u32 unused:30; | ||
815 | u32 type:1; | ||
816 | u32 reserved2:1; | ||
817 | } transmit; | ||
818 | struct { | ||
819 | u32 mss:20; | ||
820 | u32 tcp_header_offset:10; | ||
821 | u32 type:1; | ||
822 | u32 reserved2:1; | ||
823 | } lso_v1_transmit; | ||
824 | struct { | ||
825 | u32 tcp_payload:30; | ||
826 | u32 type:1; | ||
827 | u32 reserved2:1; | ||
828 | } lso_v1_transmit_complete; | ||
829 | struct { | ||
830 | u32 mss:20; | ||
831 | u32 tcp_header_offset:10; | ||
832 | u32 type:1; | ||
833 | u32 ip_version:1; | ||
834 | } lso_v2_transmit; | ||
835 | struct { | ||
836 | u32 reserved:30; | ||
837 | u32 type:1; | ||
838 | u32 reserved2:1; | ||
839 | } lso_v2_transmit_complete; | ||
840 | u32 value; | ||
841 | }; | ||
842 | }; | ||
843 | |||
729 | #define NDIS_VLAN_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \ | 844 | #define NDIS_VLAN_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \ |
730 | sizeof(struct ndis_pkt_8021q_info)) | 845 | sizeof(struct ndis_pkt_8021q_info)) |
731 | 846 | ||
847 | #define NDIS_CSUM_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \ | ||
848 | sizeof(struct ndis_tcp_ip_checksum_info)) | ||
849 | |||
850 | #define NDIS_LSO_PPI_SIZE (sizeof(struct rndis_per_packet_info) + \ | ||
851 | sizeof(struct ndis_tcp_lso_info)) | ||
852 | |||
732 | /* Format of Information buffer passed in a SetRequest for the OID */ | 853 | /* Format of Information buffer passed in a SetRequest for the OID */ |
733 | /* OID_GEN_RNDIS_CONFIG_PARAMETER. */ | 854 | /* OID_GEN_RNDIS_CONFIG_PARAMETER. */ |
734 | struct rndis_config_parameter_info { | 855 | struct rndis_config_parameter_info { |
@@ -954,6 +1075,16 @@ struct rndis_message { | |||
954 | #define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400 | 1075 | #define NDIS_PACKET_TYPE_FUNCTIONAL 0x00000400 |
955 | #define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800 | 1076 | #define NDIS_PACKET_TYPE_MAC_FRAME 0x00000800 |
956 | 1077 | ||
1078 | #define INFO_IPV4 2 | ||
1079 | #define INFO_IPV6 4 | ||
1080 | #define INFO_TCP 2 | ||
1081 | #define INFO_UDP 4 | ||
1082 | |||
1083 | #define TRANSPORT_INFO_NOT_IP 0 | ||
1084 | #define TRANSPORT_INFO_IPV4_TCP ((INFO_IPV4 << 16) | INFO_TCP) | ||
1085 | #define TRANSPORT_INFO_IPV4_UDP ((INFO_IPV4 << 16) | INFO_UDP) | ||
1086 | #define TRANSPORT_INFO_IPV6_TCP ((INFO_IPV6 << 16) | INFO_TCP) | ||
1087 | #define TRANSPORT_INFO_IPV6_UDP ((INFO_IPV6 << 16) | INFO_UDP) | ||
957 | 1088 | ||
958 | 1089 | ||
959 | #endif /* _HYPERV_NET_H */ | 1090 | #endif /* _HYPERV_NET_H */ |