Rediger

Del via


OID_RECEIVE_FILTER_CLEAR_FILTER

Overlying drivers issue OID set requests of OID_RECEIVE_FILTER_CLEAR_FILTER to clear a receive filter on a network adapter.

The InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to an NDIS_RECEIVE_FILTER_CLEAR_PARAMETERS structure.

Remarks

NDIS receive filters are used in the following NDIS interfaces:

The OID set request of OID_RECEIVE_FILTER_CLEAR_FILTER is mandatory for miniport drivers that support the NDIS packet coalescing, SR-IOV, or VMQ interface.

An overlying driver, such as an NDIS protocol or filter driver, uses the OID_RECEIVE_FILTER_CLEAR_FILTER set request to clear a previously set filter. Only the driver that set the receive filter can clear it.

The overlying driver clears a receive filter by setting the FilterId member of the NDIS_RECEIVE_FILTER_CLEAR_PARAMETERS structure to the identifier for the filter. The driver obtained the filter identifier from an earlier OID method request of OID_RECEIVE_FILTER_SET_FILTER.

Additional Instructions for NDIS Packet Coalescing

The following point applies to miniport and overlying drivers that support NDIS packet coalescing:

  • An overlying driver must clear all the receive filters that it set on the miniport driver before it unbinds or detaches from the driver.

Additional Guidelines for the SR-IOV Interface

The following points apply to miniport and overlying drivers that support the SR-IOV interface:

  • An overlying driver must clear all the filters that it set on a SR-IOV VPort before it frees the VPort. The overlying driver must also clear all the filters that it set on the default VPort before it closes its binding to the network adapter.

  • A miniport driver must not indicate packets on a nondefault VPort if it has completed the OID request of OID_RECEIVE_FILTER_CLEAR_FILTER to clear the last filter on the VPort.

    Note  A miniport driver also must not indicate packets on a nondefault VPort if it has completed an OID request of OID_NIC_SWITCH_DELETE_VPORT to free the VPort.

Additional Guidelines for the VMQ Interface

The following points apply to miniport and overlying drivers that support the VMQ interface:

  • An overlying driver must clear all the filters that it set on a VMQ receive queue before it frees the queue. The overlying driver must also clear all the filters that it set on the default or drop queues before it closes its binding to the network adapter.

  • A miniport driver must not indicate packets on a receive queue if it has completed the OID request of OID_RECEIVE_FILTER_CLEAR_FILTER to clear the last filter on the receive queue.

    Note  A miniport driver also must not indicate packets on a receive queue if it has completed an OID request of OID_RECEIVE_FILTER_FREE_QUEUE to free the receive queue.

Return status codes

The miniport driver's MiniportOidRequest function returns one of the following values for this request:

Term Description

NDIS_STATUS_SUCCESS

The miniport driver completed the request successfully.

NDIS_STATUS_PENDING

The miniport driver will complete the request asynchronously. After the miniport driver has completed all processing, it must succeed the request by calling the NdisMOidRequestComplete function, passing NDIS_STATUS_SUCCESS for the Status parameter.

NDIS_STATUS_NOT_ACCEPTED

The miniport adapter has been surprise removed.

NDIS returns one of the following status codes for this request:

NDIS_STATUS_SUCCESS
The specified filter was cleared successfully.

NDIS_STATUS_PENDING
The request is pending completion. NDIS will pass the final status code and results to the OID request completion handler of the caller after the request is complete.

NDIS_STATUS_FILE_NOT_FOUND
The filter identifier is not valid.

NDIS_STATUS_INVALID_LENGTH
The information buffer is too small. NDIS sets the DATA.SET_INFORMATION.BytesNeeded member in the NDIS_OID_REQUEST structure to the minimum buffer size that is required.

Requirements

Version

Supported in NDIS 6.20 and later.

Header

Ntddndis.h (include Ndis.h)

See also

NDIS_OID_REQUEST

NDIS_RECEIVE_FILTER_CLEAR_PARAMETERS

OID_NIC_SWITCH_DELETE_VPORT

OID_RECEIVE_FILTER_FREE_QUEUE

OID_RECEIVE_FILTER_SET_FILTER