linux/include/linux/rndis.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Remote Network Driver Interface Specification (RNDIS)
 * definitions of the magic numbers used by this protocol
 */

/* Remote NDIS Versions */
#define RNDIS_MAJOR_VERSION
#define RNDIS_MINOR_VERSION

/* Device Flags */
#define RNDIS_DF_CONNECTIONLESS
#define RNDIS_DF_CONNECTION_ORIENTED
#define RNDIS_DF_RAW_DATA

/*
 * Codes for "msg_type" field of rndis messages;
 * only the data channel uses packet messages (maybe batched);
 * everything else goes on the control channel.
 */
#define RNDIS_MSG_COMPLETION
#define RNDIS_MSG_PACKET
#define RNDIS_MSG_INIT
#define RNDIS_MSG_INIT_C
#define RNDIS_MSG_HALT
#define RNDIS_MSG_QUERY
#define RNDIS_MSG_QUERY_C
#define RNDIS_MSG_SET
#define RNDIS_MSG_SET_C
#define RNDIS_MSG_RESET
#define RNDIS_MSG_RESET_C
#define RNDIS_MSG_INDICATE
#define RNDIS_MSG_KEEPALIVE
#define RNDIS_MSG_KEEPALIVE_C
/*
 * Reserved message type for private communication between lower-layer host
 * driver and remote device, if necessary.
 */
#define RNDIS_MSG_BUS

/* codes for "status" field of completion messages */
#define RNDIS_STATUS_SUCCESS
#define RNDIS_STATUS_PENDING

/*  Status codes */
#define RNDIS_STATUS_NOT_RECOGNIZED
#define RNDIS_STATUS_NOT_COPIED
#define RNDIS_STATUS_NOT_ACCEPTED
#define RNDIS_STATUS_CALL_ACTIVE

#define RNDIS_STATUS_ONLINE
#define RNDIS_STATUS_RESET_START
#define RNDIS_STATUS_RESET_END
#define RNDIS_STATUS_RING_STATUS
#define RNDIS_STATUS_CLOSED
#define RNDIS_STATUS_WAN_LINE_UP
#define RNDIS_STATUS_WAN_LINE_DOWN
#define RNDIS_STATUS_WAN_FRAGMENT
#define RNDIS_STATUS_MEDIA_CONNECT
#define RNDIS_STATUS_MEDIA_DISCONNECT
#define RNDIS_STATUS_HARDWARE_LINE_UP
#define RNDIS_STATUS_HARDWARE_LINE_DOWN
#define RNDIS_STATUS_INTERFACE_UP
#define RNDIS_STATUS_INTERFACE_DOWN
#define RNDIS_STATUS_MEDIA_BUSY
#define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION
#define RNDIS_STATUS_WW_INDICATION
#define RNDIS_STATUS_LINK_SPEED_CHANGE
#define RNDIS_STATUS_NETWORK_CHANGE

#define RNDIS_STATUS_NOT_RESETTABLE
#define RNDIS_STATUS_SOFT_ERRORS
#define RNDIS_STATUS_HARD_ERRORS
#define RNDIS_STATUS_BUFFER_OVERFLOW

#define RNDIS_STATUS_FAILURE
#define RNDIS_STATUS_RESOURCES
#define RNDIS_STATUS_NOT_SUPPORTED
#define RNDIS_STATUS_CLOSING
#define RNDIS_STATUS_BAD_VERSION
#define RNDIS_STATUS_BAD_CHARACTERISTICS
#define RNDIS_STATUS_ADAPTER_NOT_FOUND
#define RNDIS_STATUS_OPEN_FAILED
#define RNDIS_STATUS_DEVICE_FAILED
#define RNDIS_STATUS_MULTICAST_FULL
#define RNDIS_STATUS_MULTICAST_EXISTS
#define RNDIS_STATUS_MULTICAST_NOT_FOUND
#define RNDIS_STATUS_REQUEST_ABORTED
#define RNDIS_STATUS_RESET_IN_PROGRESS
#define RNDIS_STATUS_CLOSING_INDICATING
#define RNDIS_STATUS_INVALID_PACKET
#define RNDIS_STATUS_OPEN_LIST_FULL
#define RNDIS_STATUS_ADAPTER_NOT_READY
#define RNDIS_STATUS_ADAPTER_NOT_OPEN
#define RNDIS_STATUS_NOT_INDICATING
#define RNDIS_STATUS_INVALID_LENGTH
#define RNDIS_STATUS_INVALID_DATA
#define RNDIS_STATUS_BUFFER_TOO_SHORT
#define RNDIS_STATUS_INVALID_OID
#define RNDIS_STATUS_ADAPTER_REMOVED
#define RNDIS_STATUS_UNSUPPORTED_MEDIA
#define RNDIS_STATUS_GROUP_ADDRESS_IN_USE
#define RNDIS_STATUS_FILE_NOT_FOUND
#define RNDIS_STATUS_ERROR_READING_FILE
#define RNDIS_STATUS_ALREADY_MAPPED
#define RNDIS_STATUS_RESOURCE_CONFLICT
#define RNDIS_STATUS_NO_CABLE

#define RNDIS_STATUS_INVALID_SAP
#define RNDIS_STATUS_SAP_IN_USE
#define RNDIS_STATUS_INVALID_ADDRESS
#define RNDIS_STATUS_VC_NOT_ACTIVATED
#define RNDIS_STATUS_DEST_OUT_OF_ORDER
#define RNDIS_STATUS_VC_NOT_AVAILABLE
#define RNDIS_STATUS_CELLRATE_NOT_AVAILABLE
#define RNDIS_STATUS_INCOMPATABLE_QOS
#define RNDIS_STATUS_AAL_PARAMS_UNSUPPORTED
#define RNDIS_STATUS_NO_ROUTE_TO_DESTINATION

#define RNDIS_STATUS_TOKEN_RING_OPEN_ERROR

/* codes for RNDIS_OID_GEN_PHYSICAL_MEDIUM */
#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED
#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN
#define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM
#define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE
#define RNDIS_PHYSICAL_MEDIUM_POWER_LINE
#define RNDIS_PHYSICAL_MEDIUM_DSL
#define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL
#define RNDIS_PHYSICAL_MEDIUM_1394
#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN
#define RNDIS_PHYSICAL_MEDIUM_MAX

/*  Remote NDIS medium types. */
#define RNDIS_MEDIUM_UNSPECIFIED
#define RNDIS_MEDIUM_802_3
#define RNDIS_MEDIUM_802_5
#define RNDIS_MEDIUM_FDDI
#define RNDIS_MEDIUM_WAN
#define RNDIS_MEDIUM_LOCAL_TALK
#define RNDIS_MEDIUM_ARCNET_RAW
#define RNDIS_MEDIUM_ARCNET_878_2
#define RNDIS_MEDIUM_ATM
#define RNDIS_MEDIUM_WIRELESS_LAN
#define RNDIS_MEDIUM_IRDA
#define RNDIS_MEDIUM_BPC
#define RNDIS_MEDIUM_CO_WAN
#define RNDIS_MEDIUM_1394
/* Not a real medium, defined as an upper-bound */
#define RNDIS_MEDIUM_MAX

/* Remote NDIS medium connection states. */
#define RNDIS_MEDIA_STATE_CONNECTED
#define RNDIS_MEDIA_STATE_DISCONNECTED

/* packet filter bits used by RNDIS_OID_GEN_CURRENT_PACKET_FILTER */
#define RNDIS_PACKET_TYPE_DIRECTED
#define RNDIS_PACKET_TYPE_MULTICAST
#define RNDIS_PACKET_TYPE_ALL_MULTICAST
#define RNDIS_PACKET_TYPE_BROADCAST
#define RNDIS_PACKET_TYPE_SOURCE_ROUTING
#define RNDIS_PACKET_TYPE_PROMISCUOUS
#define RNDIS_PACKET_TYPE_SMT
#define RNDIS_PACKET_TYPE_ALL_LOCAL
#define RNDIS_PACKET_TYPE_GROUP
#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL
#define RNDIS_PACKET_TYPE_FUNCTIONAL
#define RNDIS_PACKET_TYPE_MAC_FRAME

/* RNDIS_OID_GEN_MINIPORT_INFO constants */
#define RNDIS_MINIPORT_BUS_MASTER
#define RNDIS_MINIPORT_WDM_DRIVER
#define RNDIS_MINIPORT_SG_LIST
#define RNDIS_MINIPORT_SUPPORTS_MEDIA_QUERY
#define RNDIS_MINIPORT_INDICATES_PACKETS
#define RNDIS_MINIPORT_IGNORE_PACKET_QUEUE
#define RNDIS_MINIPORT_IGNORE_REQUEST_QUEUE
#define RNDIS_MINIPORT_IGNORE_TOKEN_RING_ERRORS
#define RNDIS_MINIPORT_INTERMEDIATE_DRIVER
#define RNDIS_MINIPORT_IS_NDIS_5
#define RNDIS_MINIPORT_IS_CO
#define RNDIS_MINIPORT_DESERIALIZE
#define RNDIS_MINIPORT_REQUIRES_MEDIA_POLLING
#define RNDIS_MINIPORT_SUPPORTS_MEDIA_SENSE
#define RNDIS_MINIPORT_NETBOOT_CARD
#define RNDIS_MINIPORT_PM_SUPPORTED
#define RNDIS_MINIPORT_SUPPORTS_MAC_ADDRESS_OVERWRITE
#define RNDIS_MINIPORT_USES_SAFE_BUFFER_APIS
#define RNDIS_MINIPORT_HIDDEN
#define RNDIS_MINIPORT_SWENUM
#define RNDIS_MINIPORT_SURPRISE_REMOVE_OK
#define RNDIS_MINIPORT_NO_HALT_ON_SUSPEND
#define RNDIS_MINIPORT_HARDWARE_DEVICE
#define RNDIS_MINIPORT_SUPPORTS_CANCEL_SEND_PACKETS
#define RNDIS_MINIPORT_64BITS_DMA

#define RNDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA
#define RNDIS_MAC_OPTION_RECEIVE_SERIALIZED
#define RNDIS_MAC_OPTION_TRANSFERS_NOT_PEND
#define RNDIS_MAC_OPTION_NO_LOOPBACK
#define RNDIS_MAC_OPTION_FULL_DUPLEX
#define RNDIS_MAC_OPTION_EOTX_INDICATION
#define RNDIS_MAC_OPTION_8021P_PRIORITY
#define RNDIS_MAC_OPTION_RESERVED

/* Object Identifiers used by NdisRequest Query/Set Information */
/* General (Required) Objects */
#define RNDIS_OID_GEN_SUPPORTED_LIST
#define RNDIS_OID_GEN_HARDWARE_STATUS
#define RNDIS_OID_GEN_MEDIA_SUPPORTED
#define RNDIS_OID_GEN_MEDIA_IN_USE
#define RNDIS_OID_GEN_MAXIMUM_LOOKAHEAD
#define RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE
#define RNDIS_OID_GEN_LINK_SPEED
#define RNDIS_OID_GEN_TRANSMIT_BUFFER_SPACE
#define RNDIS_OID_GEN_RECEIVE_BUFFER_SPACE
#define RNDIS_OID_GEN_TRANSMIT_BLOCK_SIZE
#define RNDIS_OID_GEN_RECEIVE_BLOCK_SIZE
#define RNDIS_OID_GEN_VENDOR_ID
#define RNDIS_OID_GEN_VENDOR_DESCRIPTION
#define RNDIS_OID_GEN_CURRENT_PACKET_FILTER
#define RNDIS_OID_GEN_CURRENT_LOOKAHEAD
#define RNDIS_OID_GEN_DRIVER_VERSION
#define RNDIS_OID_GEN_MAXIMUM_TOTAL_SIZE
#define RNDIS_OID_GEN_PROTOCOL_OPTIONS
#define RNDIS_OID_GEN_MAC_OPTIONS
#define RNDIS_OID_GEN_MEDIA_CONNECT_STATUS
#define RNDIS_OID_GEN_MAXIMUM_SEND_PACKETS
#define RNDIS_OID_GEN_VENDOR_DRIVER_VERSION
#define RNDIS_OID_GEN_SUPPORTED_GUIDS
#define RNDIS_OID_GEN_NETWORK_LAYER_ADDRESSES
#define RNDIS_OID_GEN_TRANSPORT_HEADER_OFFSET
#define RNDIS_OID_GEN_PHYSICAL_MEDIUM
#define RNDIS_OID_GEN_MACHINE_NAME
#define RNDIS_OID_GEN_RNDIS_CONFIG_PARAMETER
#define RNDIS_OID_GEN_VLAN_ID

/* Optional OIDs */
#define RNDIS_OID_GEN_MEDIA_CAPABILITIES

/* Required statistics OIDs */
#define RNDIS_OID_GEN_XMIT_OK
#define RNDIS_OID_GEN_RCV_OK
#define RNDIS_OID_GEN_XMIT_ERROR
#define RNDIS_OID_GEN_RCV_ERROR
#define RNDIS_OID_GEN_RCV_NO_BUFFER

/* Optional statistics OIDs */
#define RNDIS_OID_GEN_DIRECTED_BYTES_XMIT
#define RNDIS_OID_GEN_DIRECTED_FRAMES_XMIT
#define RNDIS_OID_GEN_MULTICAST_BYTES_XMIT
#define RNDIS_OID_GEN_MULTICAST_FRAMES_XMIT
#define RNDIS_OID_GEN_BROADCAST_BYTES_XMIT
#define RNDIS_OID_GEN_BROADCAST_FRAMES_XMIT
#define RNDIS_OID_GEN_DIRECTED_BYTES_RCV
#define RNDIS_OID_GEN_DIRECTED_FRAMES_RCV
#define RNDIS_OID_GEN_MULTICAST_BYTES_RCV
#define RNDIS_OID_GEN_MULTICAST_FRAMES_RCV
#define RNDIS_OID_GEN_BROADCAST_BYTES_RCV
#define RNDIS_OID_GEN_BROADCAST_FRAMES_RCV

#define RNDIS_OID_GEN_RCV_CRC_ERROR
#define RNDIS_OID_GEN_TRANSMIT_QUEUE_LENGTH

#define RNDIS_OID_GEN_GET_TIME_CAPS
#define RNDIS_OID_GEN_GET_NETCARD_TIME

#define RNDIS_OID_GEN_NETCARD_LOAD
#define RNDIS_OID_GEN_DEVICE_PROFILE
#define RNDIS_OID_GEN_INIT_TIME_MS
#define RNDIS_OID_GEN_RESET_COUNTS
#define RNDIS_OID_GEN_MEDIA_SENSE_COUNTS
#define RNDIS_OID_GEN_FRIENDLY_NAME
#define RNDIS_OID_GEN_MINIPORT_INFO
#define RNDIS_OID_GEN_RESET_VERIFY_PARAMETERS

/* These are connection-oriented general OIDs. */
/* These replace the above OIDs for connection-oriented media. */
#define RNDIS_OID_GEN_CO_SUPPORTED_LIST
#define RNDIS_OID_GEN_CO_HARDWARE_STATUS
#define RNDIS_OID_GEN_CO_MEDIA_SUPPORTED
#define RNDIS_OID_GEN_CO_MEDIA_IN_USE
#define RNDIS_OID_GEN_CO_LINK_SPEED
#define RNDIS_OID_GEN_CO_VENDOR_ID
#define RNDIS_OID_GEN_CO_VENDOR_DESCRIPTION
#define RNDIS_OID_GEN_CO_DRIVER_VERSION
#define RNDIS_OID_GEN_CO_PROTOCOL_OPTIONS
#define RNDIS_OID_GEN_CO_MAC_OPTIONS
#define RNDIS_OID_GEN_CO_MEDIA_CONNECT_STATUS
#define RNDIS_OID_GEN_CO_VENDOR_DRIVER_VERSION
#define RNDIS_OID_GEN_CO_MINIMUM_LINK_SPEED

#define RNDIS_OID_GEN_CO_GET_TIME_CAPS
#define RNDIS_OID_GEN_CO_GET_NETCARD_TIME

/* These are connection-oriented statistics OIDs. */
#define RNDIS_OID_GEN_CO_XMIT_PDUS_OK
#define RNDIS_OID_GEN_CO_RCV_PDUS_OK
#define RNDIS_OID_GEN_CO_XMIT_PDUS_ERROR
#define RNDIS_OID_GEN_CO_RCV_PDUS_ERROR
#define RNDIS_OID_GEN_CO_RCV_PDUS_NO_BUFFER


#define RNDIS_OID_GEN_CO_RCV_CRC_ERROR
#define RNDIS_OID_GEN_CO_TRANSMIT_QUEUE_LENGTH
#define RNDIS_OID_GEN_CO_BYTES_XMIT
#define RNDIS_OID_GEN_CO_BYTES_RCV
#define RNDIS_OID_GEN_CO_BYTES_XMIT_OUTSTANDING
#define RNDIS_OID_GEN_CO_NETCARD_LOAD

/* These are objects for Connection-oriented media call-managers. */
#define RNDIS_OID_CO_ADD_PVC
#define RNDIS_OID_CO_DELETE_PVC
#define RNDIS_OID_CO_GET_CALL_INFORMATION
#define RNDIS_OID_CO_ADD_ADDRESS
#define RNDIS_OID_CO_DELETE_ADDRESS
#define RNDIS_OID_CO_GET_ADDRESSES
#define RNDIS_OID_CO_ADDRESS_CHANGE
#define RNDIS_OID_CO_SIGNALING_ENABLED
#define RNDIS_OID_CO_SIGNALING_DISABLED

/* 802.3 Objects (Ethernet) */
#define RNDIS_OID_802_3_PERMANENT_ADDRESS
#define RNDIS_OID_802_3_CURRENT_ADDRESS
#define RNDIS_OID_802_3_MULTICAST_LIST
#define RNDIS_OID_802_3_MAXIMUM_LIST_SIZE
#define RNDIS_OID_802_3_MAC_OPTIONS

#define RNDIS_802_3_MAC_OPTION_PRIORITY

#define RNDIS_OID_802_3_RCV_ERROR_ALIGNMENT
#define RNDIS_OID_802_3_XMIT_ONE_COLLISION
#define RNDIS_OID_802_3_XMIT_MORE_COLLISIONS

#define RNDIS_OID_802_3_XMIT_DEFERRED
#define RNDIS_OID_802_3_XMIT_MAX_COLLISIONS
#define RNDIS_OID_802_3_RCV_OVERRUN
#define RNDIS_OID_802_3_XMIT_UNDERRUN
#define RNDIS_OID_802_3_XMIT_HEARTBEAT_FAILURE
#define RNDIS_OID_802_3_XMIT_TIMES_CRS_LOST
#define RNDIS_OID_802_3_XMIT_LATE_COLLISIONS

#define RNDIS_OID_802_11_BSSID
#define RNDIS_OID_802_11_SSID
#define RNDIS_OID_802_11_INFRASTRUCTURE_MODE
#define RNDIS_OID_802_11_ADD_WEP
#define RNDIS_OID_802_11_REMOVE_WEP
#define RNDIS_OID_802_11_DISASSOCIATE
#define RNDIS_OID_802_11_AUTHENTICATION_MODE
#define RNDIS_OID_802_11_PRIVACY_FILTER
#define RNDIS_OID_802_11_BSSID_LIST_SCAN
#define RNDIS_OID_802_11_ENCRYPTION_STATUS
#define RNDIS_OID_802_11_ADD_KEY
#define RNDIS_OID_802_11_REMOVE_KEY
#define RNDIS_OID_802_11_ASSOCIATION_INFORMATION
#define RNDIS_OID_802_11_CAPABILITY
#define RNDIS_OID_802_11_PMKID
#define RNDIS_OID_802_11_NETWORK_TYPES_SUPPORTED
#define RNDIS_OID_802_11_NETWORK_TYPE_IN_USE
#define RNDIS_OID_802_11_TX_POWER_LEVEL
#define RNDIS_OID_802_11_RSSI
#define RNDIS_OID_802_11_RSSI_TRIGGER
#define RNDIS_OID_802_11_FRAGMENTATION_THRESHOLD
#define RNDIS_OID_802_11_RTS_THRESHOLD
#define RNDIS_OID_802_11_SUPPORTED_RATES
#define RNDIS_OID_802_11_CONFIGURATION
#define RNDIS_OID_802_11_POWER_MODE
#define RNDIS_OID_802_11_BSSID_LIST

/* Plug and Play capabilities */
#define RNDIS_OID_PNP_CAPABILITIES
#define RNDIS_OID_PNP_SET_POWER
#define RNDIS_OID_PNP_QUERY_POWER
#define RNDIS_OID_PNP_ADD_WAKE_UP_PATTERN
#define RNDIS_OID_PNP_REMOVE_WAKE_UP_PATTERN
#define RNDIS_OID_PNP_ENABLE_WAKE_UP

/* RNDIS_PNP_CAPABILITIES.Flags constants */
#define RNDIS_DEVICE_WAKE_UP_ENABLE
#define RNDIS_DEVICE_WAKE_ON_PATTERN_MATCH_ENABLE
#define RNDIS_DEVICE_WAKE_ON_MAGIC_PACKET_ENABLE

#define REMOTE_CONDIS_MP_CREATE_VC_MSG
#define REMOTE_CONDIS_MP_DELETE_VC_MSG
#define REMOTE_CONDIS_MP_ACTIVATE_VC_MSG
#define REMOTE_CONDIS_MP_DEACTIVATE_VC_MSG
#define REMOTE_CONDIS_INDICATE_STATUS_MSG

#define REMOTE_CONDIS_MP_CREATE_VC_CMPLT
#define REMOTE_CONDIS_MP_DELETE_VC_CMPLT
#define REMOTE_CONDIS_MP_ACTIVATE_VC_CMPLT
#define REMOTE_CONDIS_MP_DEACTIVATE_VC_CMPLT