win-pvdrivers

changeset 975:3560901bfe11

remove unused file
author James Harper <james.harper@bendigoit.com.au>
date Sun Apr 15 15:13:54 2012 +1000 (2012-04-15)
parents 9cea419e4b1d
children 941699790045
files xennet/xennet.h
line diff
     1.1 --- a/xennet/xennet.h	Sun Apr 15 14:35:32 2012 +1000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,478 +0,0 @@
     1.4 -/*
     1.5 -PV Drivers for Windows Xen HVM Domains
     1.6 -Copyright (C) 2007 James Harper
     1.7 -Copyright (C) 2007 Andrew Grover <andy.grover@oracle.com>
     1.8 -
     1.9 -This program is free software; you can redistribute it and/or
    1.10 -modify it under the terms of the GNU General Public License
    1.11 -as published by the Free Software Foundation; either version 2
    1.12 -of the License, or (at your option) any later version.
    1.13 -
    1.14 -This program is distributed in the hope that it will be useful,
    1.15 -but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.17 -GNU General Public License for more details.
    1.18 -
    1.19 -You should have received a copy of the GNU General Public License
    1.20 -along with this program; if not, write to the Free Software
    1.21 -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    1.22 -*/
    1.23 -
    1.24 -#pragma warning(disable: 4201)
    1.25 -#pragma warning(disable: 4214)
    1.26 -
    1.27 -#include <ntddk.h>
    1.28 -#include <wdm.h>
    1.29 -#define NDIS_MINIPORT_DRIVER
    1.30 -#if NTDDI_VERSION < NTDDI_WINXP
    1.31 -# define NDIS50_MINIPORT 1
    1.32 -#else
    1.33 -# define NDIS51_MINIPORT 1
    1.34 -#endif
    1.35 -#include <ndis.h>
    1.36 -#define NTSTRSAFE_LIB
    1.37 -#include <ntstrsafe.h>
    1.38 -#include <liblfds.h>
    1.39 -
    1.40 -#define VENDOR_DRIVER_VERSION_MAJOR 0
    1.41 -#define VENDOR_DRIVER_VERSION_MINOR 10
    1.42 -
    1.43 -#define VENDOR_DRIVER_VERSION (((VENDOR_DRIVER_VERSION_MAJOR) << 16) | (VENDOR_DRIVER_VERSION_MINOR))
    1.44 -
    1.45 -#define __DRIVER_NAME "XenNet"
    1.46 -
    1.47 -#include <xen_windows.h>
    1.48 -#include <memory.h>
    1.49 -#include <grant_table.h>
    1.50 -#include <event_channel.h>
    1.51 -#include <hvm/params.h>
    1.52 -#include <hvm/hvm_op.h>
    1.53 -#include <xen_public.h>
    1.54 -#include <io/ring.h>
    1.55 -#include <io/netif.h>
    1.56 -#include <io/xenbus.h>
    1.57 -#include <stdlib.h>
    1.58 -#define XENNET_POOL_TAG (ULONG) 'XenN'
    1.59 -
    1.60 -/* Xen macros use these, so they need to be redefined to Win equivs */
    1.61 -#define wmb() KeMemoryBarrier()
    1.62 -#define mb() KeMemoryBarrier()
    1.63 -
    1.64 -#define GRANT_INVALID_REF 0
    1.65 -
    1.66 -#define NAME_SIZE 64
    1.67 -
    1.68 -#define ETH_ALEN 6
    1.69 -
    1.70 -/*
    1.71 -#define __NET_USHORT_BYTE_0(x) ((USHORT)(x & 0xFF))
    1.72 -#define __NET_USHORT_BYTE_1(x) ((USHORT)((PUCHAR)&x)[1] & 0xFF)
    1.73 -
    1.74 -#define GET_NET_USHORT(x) ((__NET_USHORT_BYTE_0(x) << 8) | __NET_USHORT_BYTE_1(x))
    1.75 -#define SET_NET_USHORT(y, x) *((USHORT *)&(y)) = ((__NET_USHORT_BYTE_0(x) << 8) | __NET_USHORT_BYTE_1(x))
    1.76 -*/
    1.77 -
    1.78 -static FORCEINLINE USHORT
    1.79 -GET_NET_USHORT(USHORT data)
    1.80 -{
    1.81 -  return (data << 8) | (data >> 8);
    1.82 -}
    1.83 -
    1.84 -static FORCEINLINE USHORT
    1.85 -GET_NET_PUSHORT(PVOID pdata)
    1.86 -{
    1.87 -  return (*((PUSHORT)pdata) << 8) | (*((PUSHORT)pdata) >> 8);
    1.88 -}
    1.89 -
    1.90 -static FORCEINLINE VOID
    1.91 -SET_NET_USHORT(PVOID ptr, USHORT data)
    1.92 -{
    1.93 -  *((PUSHORT)ptr) = GET_NET_USHORT(data);
    1.94 -}
    1.95 -
    1.96 -static FORCEINLINE ULONG
    1.97 -GET_NET_ULONG(ULONG data)
    1.98 -{
    1.99 -  ULONG tmp;
   1.100 -  
   1.101 -  tmp = ((data & 0x00ff00ff) << 8) | ((data & 0xff00ff00) >> 8);
   1.102 -  return (tmp << 16) | (tmp >> 16);
   1.103 -}
   1.104 -
   1.105 -static FORCEINLINE ULONG
   1.106 -GET_NET_PULONG(PVOID pdata)
   1.107 -{
   1.108 -  ULONG tmp;
   1.109 -  
   1.110 -  tmp = ((*((PULONG)pdata) & 0x00ff00ff) << 8) | ((*((PULONG)pdata) & 0xff00ff00) >> 8);
   1.111 -  return (tmp << 16) | (tmp >> 16);
   1.112 -}
   1.113 -
   1.114 -static FORCEINLINE VOID
   1.115 -SET_NET_ULONG(PVOID ptr, ULONG data)
   1.116 -{
   1.117 -  *((PULONG)ptr) = GET_NET_ULONG(data);
   1.118 -}
   1.119 -/*
   1.120 -#define GET_NET_ULONG(x) ((GET_NET_USHORT(x) << 16) | GET_NET_USHORT(((PUCHAR)&x)[2]))
   1.121 -#define SET_NET_ULONG(y, x) *((ULONG *)&(y)) = ((GET_NET_USHORT(x) << 16) | GET_NET_USHORT(((PUCHAR)&x)[2]))
   1.122 -*/
   1.123 -
   1.124 -#define SUPPORTED_PACKET_FILTERS (\
   1.125 -  NDIS_PACKET_TYPE_DIRECTED | \
   1.126 -  NDIS_PACKET_TYPE_MULTICAST | \
   1.127 -  NDIS_PACKET_TYPE_BROADCAST | \
   1.128 -  NDIS_PACKET_TYPE_PROMISCUOUS | \
   1.129 -  NDIS_PACKET_TYPE_ALL_MULTICAST)
   1.130 -
   1.131 -/* couldn't get regular xen ring macros to work...*/
   1.132 -#define __NET_RING_SIZE(type, _sz) \
   1.133 -    (__RD32( \
   1.134 -    (_sz - sizeof(struct type##_sring) + sizeof(union type##_sring_entry)) \
   1.135 -    / sizeof(union type##_sring_entry)))
   1.136 -
   1.137 -#define NET_TX_RING_SIZE __NET_RING_SIZE(netif_tx, PAGE_SIZE)
   1.138 -#define NET_RX_RING_SIZE __NET_RING_SIZE(netif_rx, PAGE_SIZE)
   1.139 -
   1.140 -#pragma warning(disable: 4127) // conditional expression is constant
   1.141 -
   1.142 -#define MIN_LARGE_SEND_SEGMENTS 4
   1.143 -
   1.144 -/* TODO: crank this up if we support higher mtus? */
   1.145 -#define XN_HDR_SIZE 14
   1.146 -#define XN_MAX_DATA_SIZE 1500
   1.147 -#define XN_MIN_FRAME_SIZE 60
   1.148 -#define XN_MAX_FRAME_SIZE (XN_HDR_SIZE + XN_DATA_SIZE)
   1.149 -/*
   1.150 -#if !defined(OFFLOAD_LARGE_SEND)
   1.151 -  #define XN_MAX_PKT_SIZE (XN_HDR_SIZE + XN_DATA_SIZE)
   1.152 -#else
   1.153 -  #define XN_MAX_PKT_SIZE MAX_LARGE_SEND_OFFLOAD
   1.154 -#endif
   1.155 -*/
   1.156 -
   1.157 -#define XN_MAX_SEND_PKTS 16
   1.158 -
   1.159 -#define XENSOURCE_MAC_HDR 0x00163E
   1.160 -#define XN_VENDOR_DESC "Xensource"
   1.161 -#define MAX_XENBUS_STR_LEN 128
   1.162 -
   1.163 -#define RX_MIN_TARGET 8
   1.164 -#define RX_DFL_MIN_TARGET 256
   1.165 -#define RX_MAX_TARGET min(NET_RX_RING_SIZE, 256)
   1.166 -
   1.167 -//#define MAX_BUFFERS_PER_PACKET NET_RX_RING_SIZE
   1.168 -
   1.169 -#define MIN_ETH_HEADER_LENGTH 14
   1.170 -#define MAX_ETH_HEADER_LENGTH 14
   1.171 -#define MIN_IP4_HEADER_LENGTH 20
   1.172 -#define MAX_IP4_HEADER_LENGTH (15 * 4)
   1.173 -#define MIN_TCP_HEADER_LENGTH 20
   1.174 -#define MAX_TCP_HEADER_LENGTH (15 * 4)
   1.175 -#define MAX_PKT_HEADER_LENGTH (MAX_ETH_HEADER_LENGTH + MAX_IP4_HEADER_LENGTH + MAX_TCP_HEADER_LENGTH)
   1.176 -
   1.177 -#define MIN_LOOKAHEAD_LENGTH (MAX_IP4_HEADER_LENGTH + MAX_TCP_HEADER_LENGTH)
   1.178 -#define MAX_LOOKAHEAD_LENGTH 256
   1.179 -
   1.180 -#define LINUX_MAX_SG_ELEMENTS 19
   1.181 -
   1.182 -struct _shared_buffer_t;
   1.183 -
   1.184 -typedef struct _shared_buffer_t shared_buffer_t;
   1.185 -
   1.186 -struct _shared_buffer_t
   1.187 -{
   1.188 -  struct netif_rx_response rsp;
   1.189 -  shared_buffer_t *next;
   1.190 -  grant_ref_t gref;
   1.191 -  USHORT offset;
   1.192 -  PVOID virtual;
   1.193 -  PNDIS_BUFFER buffer;
   1.194 -  //USHORT id;
   1.195 -  volatile LONG ref_count;
   1.196 -};
   1.197 -
   1.198 -typedef struct
   1.199 -{
   1.200 -  PNDIS_PACKET packet; /* only set on the last packet */
   1.201 -  PVOID *cb;
   1.202 -  grant_ref_t gref;
   1.203 -} tx_shadow_t;
   1.204 -
   1.205 -typedef struct {
   1.206 -  PNDIS_BUFFER first_buffer;
   1.207 -  PNDIS_BUFFER curr_buffer;
   1.208 -  shared_buffer_t *first_pb;
   1.209 -  shared_buffer_t *curr_pb;
   1.210 -  PUCHAR first_buffer_virtual;
   1.211 -  ULONG mdl_count;
   1.212 -  ULONG curr_mdl_offset;
   1.213 -  USHORT mss;
   1.214 -  NDIS_TCP_IP_CHECKSUM_PACKET_INFO csum_info;
   1.215 -  BOOLEAN csum_blank;
   1.216 -  BOOLEAN data_validated;
   1.217 -  BOOLEAN split_required;
   1.218 -  UCHAR ip_version;
   1.219 -  PUCHAR header;
   1.220 -  ULONG first_buffer_length;
   1.221 -  ULONG header_length;
   1.222 -  UCHAR ip_proto;
   1.223 -  ULONG total_length;
   1.224 -  USHORT ip4_header_length;
   1.225 -  USHORT ip4_length;
   1.226 -  USHORT tcp_header_length;
   1.227 -  BOOLEAN tcp_has_options;
   1.228 -  USHORT tcp_length;
   1.229 -  USHORT tcp_remaining;
   1.230 -  ULONG tcp_seq;
   1.231 -  /* anything past here doesn't get cleared automatically by the ClearPacketInfo */
   1.232 -  UCHAR header_data[MAX_LOOKAHEAD_LENGTH + MAX_ETH_HEADER_LENGTH];
   1.233 -} packet_info_t;
   1.234 -
   1.235 -#define PAGE_LIST_SIZE (max(NET_RX_RING_SIZE, NET_TX_RING_SIZE) * 4)
   1.236 -#define MULTICAST_LIST_MAX_SIZE 32
   1.237 -
   1.238 -struct xennet_info
   1.239 -{
   1.240 -  BOOLEAN inactive;
   1.241 -  
   1.242 -  /* Base device vars */
   1.243 -  PDEVICE_OBJECT pdo;
   1.244 -  PDEVICE_OBJECT fdo;
   1.245 -  PDEVICE_OBJECT lower_do;
   1.246 -  //WDFDEVICE wdf_device;
   1.247 -  WCHAR dev_desc[NAME_SIZE];
   1.248 -
   1.249 -  /* NDIS-related vars */
   1.250 -  NDIS_HANDLE adapter_handle;
   1.251 -  NDIS_MINIPORT_INTERRUPT interrupt;
   1.252 -  ULONG packet_filter;
   1.253 -  BOOLEAN connected;
   1.254 -  BOOLEAN shutting_down;
   1.255 -  BOOLEAN tx_shutting_down;
   1.256 -  BOOLEAN rx_shutting_down;
   1.257 -  uint8_t perm_mac_addr[ETH_ALEN];
   1.258 -  uint8_t curr_mac_addr[ETH_ALEN];
   1.259 -  ULONG current_lookahead;
   1.260 -  NDIS_DEVICE_POWER_STATE new_power_state;
   1.261 -  NDIS_DEVICE_POWER_STATE power_state;
   1.262 -  PIO_WORKITEM power_workitem;
   1.263 -
   1.264 -  /* Misc. Xen vars */
   1.265 -  XENPCI_VECTORS vectors;
   1.266 -  PXENPCI_DEVICE_STATE device_state;
   1.267 -  evtchn_port_t event_channel;
   1.268 -  ULONG state;
   1.269 -  char backend_path[MAX_XENBUS_STR_LEN];
   1.270 -  ULONG backend_state;
   1.271 -  PVOID config_page;
   1.272 -  UCHAR multicast_list[MULTICAST_LIST_MAX_SIZE][6];
   1.273 -  ULONG multicast_list_size;
   1.274 -  KDPC suspend_dpc;
   1.275 -  PIO_WORKITEM resume_work_item;
   1.276 -  KSPIN_LOCK resume_lock;
   1.277 -  KDPC rxtx_dpc;
   1.278 -
   1.279 -  /* tx related - protected by tx_lock */
   1.280 -  KSPIN_LOCK tx_lock;
   1.281 -  LIST_ENTRY tx_waiting_pkt_list;
   1.282 -  struct netif_tx_front_ring tx;
   1.283 -  ULONG tx_ring_free;
   1.284 -  tx_shadow_t tx_shadows[NET_TX_RING_SIZE];
   1.285 -  NDIS_HANDLE tx_buffer_pool;
   1.286 -#define TX_HEADER_BUFFER_SIZE 512
   1.287 -//#define TX_COALESCE_BUFFERS (NET_TX_RING_SIZE >> 2)
   1.288 -#define TX_COALESCE_BUFFERS (NET_TX_RING_SIZE)
   1.289 -  KEVENT tx_idle_event;
   1.290 -  ULONG tx_outstanding;
   1.291 -  ULONG tx_id_free;
   1.292 -  USHORT tx_id_list[NET_TX_RING_SIZE];
   1.293 -  NPAGED_LOOKASIDE_LIST tx_lookaside_list;
   1.294 -
   1.295 -  /* rx_related - protected by rx_lock */
   1.296 -  KSPIN_LOCK rx_lock;
   1.297 -  struct netif_rx_front_ring rx;
   1.298 -  ULONG rx_id_free;
   1.299 -  packet_info_t *rxpi;
   1.300 -  KEVENT packet_returned_event;
   1.301 -  //NDIS_MINIPORT_TIMER rx_timer;
   1.302 -  KTIMER rx_timer;
   1.303 -  KDPC rx_timer_dpc;
   1.304 -  NDIS_HANDLE rx_packet_pool;
   1.305 -  NDIS_HANDLE rx_buffer_pool;
   1.306 -  volatile LONG rx_pb_free;
   1.307 -  struct stack_state *rx_packet_stack;
   1.308 -  struct stack_state *rx_pb_stack;
   1.309 -  shared_buffer_t *rx_ring_pbs[NET_RX_RING_SIZE];
   1.310 -  NPAGED_LOOKASIDE_LIST rx_lookaside_list;
   1.311 -  /* Receive-ring batched refills. */
   1.312 -  ULONG rx_target;
   1.313 -  ULONG rx_max_target;
   1.314 -  ULONG rx_min_target;
   1.315 -  shared_buffer_t *rx_partial_buf;
   1.316 -  BOOLEAN rx_partial_extra_info_flag ;
   1.317 -  BOOLEAN rx_partial_more_data_flag;
   1.318 -
   1.319 -  /* how many packets are in the net stack atm */
   1.320 -  LONG rx_outstanding;
   1.321 -
   1.322 -  /* config vars from registry */
   1.323 -  ULONG config_sg;
   1.324 -  ULONG config_csum;
   1.325 -  ULONG config_csum_rx_check;
   1.326 -  ULONG config_csum_rx_dont_fix;
   1.327 -  ULONG config_gso;
   1.328 -  ULONG config_mtu;
   1.329 -  ULONG config_rx_interrupt_moderation;
   1.330 -
   1.331 -  NDIS_TASK_TCP_IP_CHECKSUM setting_csum;
   1.332 -  ULONG setting_max_offload;
   1.333 -
   1.334 -  /* config stuff calculated from the above */
   1.335 -  ULONG config_max_pkt_size;
   1.336 -
   1.337 -  /* stats */
   1.338 -  ULONG64 stat_tx_ok;
   1.339 -  ULONG64 stat_rx_ok;
   1.340 -  ULONG64 stat_tx_error;
   1.341 -  ULONG64 stat_rx_error;
   1.342 -  ULONG64 stat_rx_no_buffer;
   1.343 -  
   1.344 -} typedef xennet_info_t;
   1.345 -
   1.346 -VOID
   1.347 -XenNet_ReturnPacket(
   1.348 -  IN NDIS_HANDLE MiniportAdapterContext,
   1.349 -  IN PNDIS_PACKET Packet
   1.350 -  );
   1.351 -
   1.352 -BOOLEAN
   1.353 -XenNet_RxInit(xennet_info_t *xi);
   1.354 -
   1.355 -BOOLEAN
   1.356 -XenNet_RxShutdown(xennet_info_t *xi);
   1.357 -
   1.358 -VOID
   1.359 -XenNet_RxResumeStart(xennet_info_t *xi);
   1.360 -
   1.361 -VOID
   1.362 -XenNet_RxResumeEnd(xennet_info_t *xi);
   1.363 -
   1.364 -BOOLEAN
   1.365 -XenNet_RxBufferCheck(struct xennet_info *xi);
   1.366 -
   1.367 -VOID
   1.368 -XenNet_TxResumeStart(xennet_info_t *xi);
   1.369 -
   1.370 -VOID
   1.371 -XenNet_TxResumeEnd(xennet_info_t *xi);
   1.372 -
   1.373 -VOID
   1.374 -XenNet_SendPackets(
   1.375 -  IN NDIS_HANDLE MiniportAdapterContext,
   1.376 -  IN PPNDIS_PACKET PacketArray,
   1.377 -  IN UINT NumberOfPackets
   1.378 -  );
   1.379 -
   1.380 -VOID
   1.381 -XenNet_CancelSendPackets(
   1.382 -  NDIS_HANDLE MiniportAdapterContext,
   1.383 -  PVOID CancelId);
   1.384 -  
   1.385 -BOOLEAN
   1.386 -XenNet_TxInit(xennet_info_t *xi);
   1.387 -
   1.388 -BOOLEAN
   1.389 -XenNet_TxShutdown(xennet_info_t *xi);
   1.390 -
   1.391 -VOID
   1.392 -XenNet_TxBufferGC(struct xennet_info *xi, BOOLEAN dont_set_event);
   1.393 -
   1.394 -NDIS_STATUS
   1.395 -XenNet_QueryInformation(
   1.396 -  IN NDIS_HANDLE MiniportAdapterContext,
   1.397 -  IN NDIS_OID Oid,
   1.398 -  IN PVOID InformationBuffer,
   1.399 -  IN ULONG InformationBufferLength,
   1.400 -  OUT PULONG BytesWritten,
   1.401 -  OUT PULONG BytesNeeded);
   1.402 -
   1.403 -NDIS_STATUS
   1.404 -XenNet_SetInformation(
   1.405 -  IN NDIS_HANDLE MiniportAdapterContext,
   1.406 -  IN NDIS_OID Oid,
   1.407 -  IN PVOID InformationBuffer,
   1.408 -  IN ULONG InformationBufferLength,
   1.409 -  OUT PULONG BytesRead,
   1.410 -  OUT PULONG BytesNeeded
   1.411 -  );
   1.412 -
   1.413 -NDIS_STATUS
   1.414 -XenNet_D0Entry(struct xennet_info *xi);
   1.415 -NDIS_STATUS
   1.416 -XenNet_D0Exit(struct xennet_info *xi);
   1.417 -IO_WORKITEM_ROUTINE
   1.418 -XenNet_SetPower;
   1.419 -
   1.420 -/* return values */
   1.421 -#define PARSE_OK 0
   1.422 -#define PARSE_TOO_SMALL 1 /* first buffer is too small */
   1.423 -#define PARSE_UNKNOWN_TYPE 2
   1.424 -
   1.425 -BOOLEAN
   1.426 -XenNet_BuildHeader(packet_info_t *pi, PVOID header, ULONG new_header_size);
   1.427 -ULONG
   1.428 -XenNet_ParsePacketHeader(packet_info_t *pi, PUCHAR buffer, ULONG min_header_size);
   1.429 -BOOLEAN
   1.430 -XenNet_FilterAcceptPacket(struct xennet_info *xi,packet_info_t *pi);
   1.431 -
   1.432 -VOID
   1.433 -XenNet_SumIpHeader(
   1.434 -  PUCHAR header,
   1.435 -  USHORT ip4_header_length
   1.436 -);
   1.437 -
   1.438 -static __forceinline VOID
   1.439 -XenNet_ClearPacketInfo(packet_info_t *pi)
   1.440 -{
   1.441 -#if 1
   1.442 -  RtlZeroMemory(pi, sizeof(packet_info_t) - FIELD_OFFSET(packet_info_t, header_data));
   1.443 -#else
   1.444 -  pi->mdl_count = 0;
   1.445 -  pi->mss = 0;
   1.446 -  pi->ip4_header_length = 0;
   1.447 -  pi->tcp_header_length = 0;
   1.448 -  pi->curr_mdl_index = pi->curr_mdl_offset = 0;
   1.449 -  pi->extra_info = pi->more_frags = pi->csum_blank =
   1.450 -    pi->data_validated = pi->split_required = 0;
   1.451 -#endif
   1.452 -}
   1.453 -
   1.454 -/* Get some data from the current packet, but don't cross a page boundry. */
   1.455 -static __forceinline ULONG
   1.456 -XenNet_QueryData(packet_info_t *pi, ULONG length)
   1.457 -{
   1.458 -  ULONG offset_in_page;
   1.459 -  
   1.460 -  if (length > MmGetMdlByteCount(pi->curr_buffer) - pi->curr_mdl_offset)
   1.461 -    length = MmGetMdlByteCount(pi->curr_buffer) - pi->curr_mdl_offset;
   1.462 -
   1.463 -  offset_in_page = (MmGetMdlByteOffset(pi->curr_buffer) + pi->curr_mdl_offset) & (PAGE_SIZE - 1);
   1.464 -  if (offset_in_page + length > PAGE_SIZE)
   1.465 -    length = PAGE_SIZE - offset_in_page;
   1.466 -  
   1.467 -  return length;
   1.468 -}
   1.469 -
   1.470 -/* Move the pointers forward by the given amount. No error checking is done.  */
   1.471 -static __forceinline VOID
   1.472 -XenNet_EatData(packet_info_t *pi, ULONG length)
   1.473 -{
   1.474 -  pi->curr_mdl_offset += length;
   1.475 -  if (pi->curr_mdl_offset >= MmGetMdlByteCount(pi->curr_buffer))
   1.476 -  {
   1.477 -    pi->curr_mdl_offset -= MmGetMdlByteCount(pi->curr_buffer);
   1.478 -    NdisGetNextBuffer(pi->curr_buffer, &pi->curr_buffer);
   1.479 -  }
   1.480 -}
   1.481 -