ReactOS  0.4.15-dev-5618-g8866b9d
pcnet.h File Reference
#include <ndis.h>
#include "pci.h"
#include "pcnethw.h"
Include dependency graph for pcnet.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ADAPTER_STATS
 
struct  _ADAPTER
 

Macros

#define NUMBER_OF_BUFFERS   0x20
 
#define LOG_NUMBER_OF_BUFFERS   5 /* log2(NUMBER_OF_BUFFERS) */
 
#define BUFFER_SIZE   0x600
 
#define MAX_MULTICAST_ADDRESSES   32
 
#define MEDIA_DETECTION_INTERVAL   5000
 
#define RESET_IN_PROGRESS   0x1
 
#define INTERRUPT_LIMIT   10
 
#define PCNET_TAG   'tNcP'
 

Typedefs

typedef struct _ADAPTER_STATS ADAPTER_STATS
 
typedef struct _ADAPTER_STATSPADAPTER_STATS
 
typedef struct _ADAPTER ADAPTER
 
typedef struct _ADAPTERPADAPTER
 

Functions

NDIS_STATUS NTAPI MiniportQueryInformation (IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesWritten, OUT PULONG BytesNeeded)
 
NDIS_STATUS NTAPI MiniportSetInformation (IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_OID Oid, IN PVOID InformationBuffer, IN ULONG InformationBufferLength, OUT PULONG BytesRead, OUT PULONG BytesNeeded)
 
NDIS_STATUS NTAPI MiSetMulticast (PADAPTER Adapter, UCHAR *Addresses, UINT AddressCount)
 
NDIS_MEDIA_STATE NTAPI MiGetMediaState (PADAPTER Adapter)
 
UINT NTAPI MiGetMediaSpeed (PADAPTER Adapter)
 
BOOLEAN NTAPI MiGetMediaDuplex (PADAPTER Adapter)
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   0x600

Definition at line 154 of file pcnet.h.

◆ INTERRUPT_LIMIT

#define INTERRUPT_LIMIT   10

Definition at line 162 of file pcnet.h.

◆ LOG_NUMBER_OF_BUFFERS

#define LOG_NUMBER_OF_BUFFERS   5 /* log2(NUMBER_OF_BUFFERS) */

Definition at line 153 of file pcnet.h.

◆ MAX_MULTICAST_ADDRESSES

#define MAX_MULTICAST_ADDRESSES   32

Definition at line 155 of file pcnet.h.

◆ MEDIA_DETECTION_INTERVAL

#define MEDIA_DETECTION_INTERVAL   5000

Definition at line 156 of file pcnet.h.

◆ NUMBER_OF_BUFFERS

#define NUMBER_OF_BUFFERS   0x20

Definition at line 152 of file pcnet.h.

◆ PCNET_TAG

#define PCNET_TAG   'tNcP'

Definition at line 165 of file pcnet.h.

◆ RESET_IN_PROGRESS

#define RESET_IN_PROGRESS   0x1

Definition at line 159 of file pcnet.h.

Typedef Documentation

◆ ADAPTER

◆ ADAPTER_STATS

◆ PADAPTER

◆ PADAPTER_STATS

Function Documentation

◆ MiGetMediaDuplex()

BOOLEAN NTAPI MiGetMediaDuplex ( PADAPTER  Adapter)

Definition at line 1285 of file pcnet.c.

1286 {
1287  ULONG Data;
1288 
1290  NdisRawReadPortUshort(Adapter->PortOffset + BDP, &Data);
1291 
1292  return (Data & BCR5_LEDOUT) != 0;
1293 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
Definition: wdfdevice.h:4527
#define RAP
Definition: pcnethw.h:48
#define NdisRawReadPortUshort(Port, Data)
Definition: ndis.h:4191
ULONG_PTR PortOffset
Definition: pcnet.h:65
#define NdisRawWritePortUshort(Port, Data)
Definition: ndis.h:4248
#define BCR5
Definition: pcnethw.h:140
#define BCR5_LEDOUT
Definition: pcnethw.h:285
unsigned int ULONG
Definition: retypes.h:1
#define BDP
Definition: pcnethw.h:49

Referenced by MiInitChip(), and MiSyncMediaDetection().

◆ MiGetMediaSpeed()

UINT NTAPI MiGetMediaSpeed ( PADAPTER  Adapter)

Definition at line 1297 of file pcnet.c.

1298 {
1299  ULONG Data;
1300 
1302  NdisRawReadPortUshort(Adapter->PortOffset + BDP, &Data);
1303 
1304  return Data & BCR6_LEDOUT ? 100 : 10;
1305 }
#define BCR6
Definition: pcnethw.h:141
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
Definition: wdfdevice.h:4527
#define RAP
Definition: pcnethw.h:48
#define NdisRawReadPortUshort(Port, Data)
Definition: ndis.h:4191
ULONG_PTR PortOffset
Definition: pcnet.h:65
#define BCR6_LEDOUT
Definition: pcnethw.h:301
#define NdisRawWritePortUshort(Port, Data)
Definition: ndis.h:4248
unsigned int ULONG
Definition: retypes.h:1
#define BDP
Definition: pcnethw.h:49

Referenced by MiInitChip(), and MiSyncMediaDetection().

◆ MiGetMediaState()

NDIS_MEDIA_STATE NTAPI MiGetMediaState ( PADAPTER  Adapter)

Definition at line 1309 of file pcnet.c.

1318 {
1319  ULONG Data;
1321  NdisRawReadPortUshort(Adapter->PortOffset + BDP, &Data);
1323 }
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
Definition: wdfdevice.h:4527
#define RAP
Definition: pcnethw.h:48
#define NdisRawReadPortUshort(Port, Data)
Definition: ndis.h:4191
ULONG_PTR PortOffset
Definition: pcnet.h:65
#define BCR4
Definition: pcnethw.h:139
#define NdisRawWritePortUshort(Port, Data)
Definition: ndis.h:4248
unsigned int ULONG
Definition: retypes.h:1
#define BDP
Definition: pcnethw.h:49
#define BCR4_LEDOUT
Definition: pcnethw.h:269

Referenced by MiInitChip(), and MiSyncMediaDetection().

◆ MiniportQueryInformation()

NDIS_STATUS NTAPI MiniportQueryInformation ( IN NDIS_HANDLE  MiniportAdapterContext,
IN NDIS_OID  Oid,
IN PVOID  InformationBuffer,
IN ULONG  InformationBufferLength,
OUT PULONG  BytesWritten,
OUT PULONG  BytesNeeded 
)

Definition at line 73 of file info.c.

80 {
81  PE1000_ADAPTER Adapter = (PE1000_ADAPTER)MiniportAdapterContext;
82  ULONG copyLength;
83  PVOID copySource;
85  union _GENERIC_INFORMATION
86  {
87  USHORT Ushort;
88  ULONG Ulong;
89  ULONG64 Ulong64;
90  NDIS_MEDIUM Medium;
91  NDIS_PNP_CAPABILITIES PmCapabilities;
92  } GenericInfo;
93 
95  copySource = &GenericInfo;
96  copyLength = sizeof(ULONG);
97 
98  switch (Oid)
99  {
101  copySource = (PVOID)&SupportedOidList;
102  copyLength = sizeof(SupportedOidList);
103  break;
104 
106  GenericInfo.Ulong = Adapter->PacketFilter;
107  break;
108 
111  GenericInfo.Ulong = (ULONG)NdisHardwareStatusReady; //FIXME
112  break;
113 
116  {
117  GenericInfo.Medium = NdisMedium802_3;
118  copyLength = sizeof(NDIS_MEDIUM);
119  break;
120  }
121 
127  GenericInfo.Ulong = MAXIMUM_FRAME_SIZE - sizeof(ETH_HEADER);
128  break;
129 
131  copySource = Adapter->MulticastList;
132  copyLength = Adapter->MulticastListSize * IEEE_802_ADDR_LENGTH;
133  break;
134 
136  GenericInfo.Ulong = MAXIMUM_MULTICAST_ADDRESSES;
137  break;
138 
139  case OID_GEN_LINK_SPEED:
140  GenericInfo.Ulong = Adapter->LinkSpeedMbps * 10000;
141  break;
142 
144  GenericInfo.Ulong = MAXIMUM_FRAME_SIZE;
145  break;
146 
148  GenericInfo.Ulong = RECEIVE_BUFFER_SIZE;
149  break;
150 
151  case OID_GEN_VENDOR_ID:
152  /* The 3 bytes of the MAC address is the vendor ID */
153  GenericInfo.Ulong = 0;
154  GenericInfo.Ulong |= (Adapter->PermanentMacAddress[0] << 16);
155  GenericInfo.Ulong |= (Adapter->PermanentMacAddress[1] << 8);
156  GenericInfo.Ulong |= (Adapter->PermanentMacAddress[2] & 0xFF);
157  break;
158 
160  {
161  static UCHAR vendorDesc[] = "ReactOS Team";
162  copySource = vendorDesc;
163  copyLength = sizeof(vendorDesc);
164  break;
165  }
166 
168  GenericInfo.Ulong = DRIVER_VERSION;
169  break;
170 
172  {
173  copyLength = sizeof(USHORT);
174  GenericInfo.Ushort = (NDIS_MINIPORT_MAJOR_VERSION << 8) + NDIS_MINIPORT_MINOR_VERSION;
175  break;
176  }
177 
179  GenericInfo.Ulong = MAXIMUM_FRAME_SIZE;
180  break;
181 
183  GenericInfo.Ulong = 1;
184  break;
185 
186  case OID_GEN_MAC_OPTIONS:
187  GenericInfo.Ulong = NDIS_MAC_OPTION_RECEIVE_SERIALIZED |
191  break;
192 
194  GenericInfo.Ulong = Adapter->MediaState;
195  break;
196 
198  copySource = Adapter->MulticastList[0].MacAddress;
199  copyLength = IEEE_802_ADDR_LENGTH;
200  break;
201 
203  copySource = Adapter->PermanentMacAddress;
204  copyLength = IEEE_802_ADDR_LENGTH;
205  break;
206 
207  case OID_GEN_XMIT_OK:
208  case OID_GEN_RCV_OK:
209  case OID_GEN_XMIT_ERROR:
210  case OID_GEN_RCV_ERROR:
212  {
213  GenericInfo.Ulong64 = NICQueryStatisticCounter(Adapter, Oid);
214 
215  *BytesNeeded = sizeof(ULONG64);
216  if (InformationBufferLength >= sizeof(ULONG64))
217  {
218  *BytesWritten = sizeof(ULONG64);
219  NdisMoveMemory(InformationBuffer, copySource, sizeof(ULONG64));
220  }
221  else if (InformationBufferLength >= sizeof(ULONG))
222  {
223  *BytesWritten = sizeof(ULONG);
224  NdisMoveMemory(InformationBuffer, copySource, sizeof(ULONG));
225  }
226  else
227  {
228  *BytesWritten = 0;
230  }
231  return NDIS_STATUS_SUCCESS;
232  }
233 
235  {
236  copyLength = sizeof(NDIS_PNP_CAPABILITIES);
237 
238  status = NICFillPowerManagementCapabilities(Adapter, &GenericInfo.PmCapabilities);
239  break;
240  }
241 
242  default:
243  NDIS_DbgPrint(MIN_TRACE, ("Unknown OID 0x%x(%s)\n", Oid, Oid2Str(Oid)));
245  break;
246  }
247 
249  {
250  if (copyLength > InformationBufferLength)
251  {
252  *BytesNeeded = copyLength;
253  *BytesWritten = 0;
255  }
256  else
257  {
258  NdisMoveMemory(InformationBuffer, copySource, copyLength);
259  *BytesWritten = copyLength;
260  *BytesNeeded = copyLength;
261  }
262  }
263  else
264  {
265  *BytesWritten = 0;
266  *BytesNeeded = 0;
267  }
268 
269  NDIS_DbgPrint(MAX_TRACE, ("Query OID 0x%x(%s): Completed with status 0x%x (%d, %d)\n",
270  Oid, Oid2Str(Oid), status, *BytesWritten, *BytesNeeded));
271  return status;
272 }
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:949
ULONG MulticastListSize
Definition: nic.h:47
struct _E1000_ADAPTER::@969 MulticastList[MAXIMUM_MULTICAST_ADDRESSES]
#define MAXIMUM_MULTICAST_ADDRESSES
Definition: e1000hw.h:23
static ULONG
Definition: info.c:26
#define OID_GEN_VENDOR_DRIVER_VERSION
Definition: ntddndis.h:254
enum _NDIS_MEDIUM NDIS_MEDIUM
#define DRIVER_VERSION
Definition: nic.h:22
#define OID_GEN_RECEIVE_BUFFER_SPACE
Definition: ntddndis.h:241
struct _E1000_ADAPTER * PE1000_ADAPTER
#define OID_GEN_MAC_OPTIONS
Definition: ntddndis.h:251
#define OID_GEN_RCV_ERROR
Definition: ntddndis.h:270
#define OID_GEN_CURRENT_PACKET_FILTER
Definition: ntddndis.h:246
#define OID_GEN_HARDWARE_STATUS
Definition: ntddndis.h:234
#define OID_PNP_CAPABILITIES
Definition: ntddndis.h:360
#define OID_GEN_MEDIA_IN_USE
Definition: ntddndis.h:236
#define NDIS_MAC_OPTION_NO_LOOPBACK
Definition: ndis.h:685
int NDIS_STATUS
Definition: ntddndis.h:475
#define NDIS_STATUS_NOT_SUPPORTED
Definition: ndis.h:479
#define OID_802_3_MAXIMUM_LIST_SIZE
Definition: ntddndis.h:305
ULONG PacketFilter
Definition: nic.h:51
#define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND
Definition: ndis.h:684
#define NDIS_STATUS_BUFFER_TOO_SHORT
Definition: ndis.h:487
#define OID_GEN_MEDIA_CONNECT_STATUS
Definition: ntddndis.h:252
#define OID_GEN_TRANSMIT_BUFFER_SPACE
Definition: ntddndis.h:240
#define OID_GEN_MAXIMUM_LOOKAHEAD
Definition: ntddndis.h:237
#define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA
Definition: ndis.h:682
#define OID_GEN_RCV_OK
Definition: ntddndis.h:268
#define OID_GEN_SUPPORTED_LIST
Definition: ntddndis.h:233
#define OID_GEN_VENDOR_ID
Definition: ntddndis.h:244
#define NDIS_MAC_OPTION_RECEIVE_SERIALIZED
Definition: ndis.h:683
ULONG MediaState
Definition: nic.h:50
static NDIS_OID SupportedOidList[]
Definition: info.c:13
#define OID_GEN_VENDOR_DESCRIPTION
Definition: ntddndis.h:245
#define OID_GEN_XMIT_OK
Definition: ntddndis.h:267
#define OID_GEN_MAXIMUM_FRAME_SIZE
Definition: ntddndis.h:238
struct _ETH_HEADER ETH_HEADER
#define OID_GEN_MAXIMUM_TOTAL_SIZE
Definition: ntddndis.h:249
ULONG LinkSpeedMbps
Definition: nic.h:49
#define IEEE_802_ADDR_LENGTH
Definition: e1000hw.h:11
UCHAR PermanentMacAddress[IEEE_802_ADDR_LENGTH]
Definition: nic.h:42
const char * Oid2Str(IN NDIS_OID Oid)
Definition: debug.c:12
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
unsigned __int64 ULONG64
Definition: imports.h:198
unsigned char UCHAR
Definition: xmlstorage.h:181
static PVOID
Definition: info.c:26
#define OID_GEN_LINK_SPEED
Definition: ntddndis.h:239
#define OID_802_3_MULTICAST_LIST
Definition: ntddndis.h:304
static NDIS_STATUS NICFillPowerManagementCapabilities(_In_ PE1000_ADAPTER Adapter, _Out_ PNDIS_PNP_CAPABILITIES Capabilities)
Definition: info.c:63
#define OID_GEN_MAXIMUM_SEND_PACKETS
Definition: ntddndis.h:253
#define MAX_TRACE
Definition: debug.h:16
unsigned short Ushort
Definition: utypes.h:44
#define OID_GEN_MEDIA_SUPPORTED
Definition: ntddndis.h:235
unsigned short USHORT
Definition: pedump.c:61
#define OID_GEN_XMIT_ERROR
Definition: ntddndis.h:269
#define OID_GEN_TRANSMIT_BLOCK_SIZE
Definition: ntddndis.h:242
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define RECEIVE_BUFFER_SIZE
Definition: nic.h:20
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
struct _NDIS_PNP_CAPABILITIES NDIS_PNP_CAPABILITIES
#define OID_GEN_RECEIVE_BLOCK_SIZE
Definition: ntddndis.h:243
unsigned int ULONG
Definition: retypes.h:1
#define MIN_TRACE
Definition: debug.h:14
#define OID_802_3_PERMANENT_ADDRESS
Definition: ntddndis.h:302
#define OID_802_3_CURRENT_ADDRESS
Definition: ntddndis.h:303
#define MAXIMUM_FRAME_SIZE
Definition: nic.h:19
unsigned long Ulong
Definition: utypes.h:42
#define NdisMoveMemory(Destination, Source, Length)
Definition: ndis.h:3896
static SERVICE_STATUS status
Definition: service.c:31
#define OID_GEN_CURRENT_LOOKAHEAD
Definition: ntddndis.h:247
#define OID_GEN_DRIVER_VERSION
Definition: ntddndis.h:248
static ULONG64 NICQueryStatisticCounter(_In_ PE1000_ADAPTER Adapter, _In_ NDIS_OID Oid)
Definition: info.c:53
#define OID_GEN_RCV_NO_BUFFER
Definition: ntddndis.h:271
Definition: ps.c:97

◆ MiniportSetInformation()

NDIS_STATUS NTAPI MiniportSetInformation ( IN NDIS_HANDLE  MiniportAdapterContext,
IN NDIS_OID  Oid,
IN PVOID  InformationBuffer,
IN ULONG  InformationBufferLength,
OUT PULONG  BytesRead,
OUT PULONG  BytesNeeded 
)

Definition at line 276 of file info.c.

283 {
284  PE1000_ADAPTER Adapter = (PE1000_ADAPTER)MiniportAdapterContext;
285  ULONG genericUlong;
287 
289 
290  switch (Oid)
291  {
293  if (InformationBufferLength < sizeof(ULONG))
294  {
295  *BytesRead = 0;
296  *BytesNeeded = sizeof(ULONG);
298  break;
299  }
300 
301  NdisMoveMemory(&genericUlong, InformationBuffer, sizeof(ULONG));
302 
303  if (genericUlong &
310  {
311  *BytesRead = sizeof(ULONG);
312  *BytesNeeded = sizeof(ULONG);
314  break;
315  }
316 
317  if (Adapter->PacketFilter == genericUlong)
318  {
319  break;
320  }
321 
322  Adapter->PacketFilter = genericUlong;
323 
324  status = NICApplyPacketFilter(Adapter);
326  {
327  NDIS_DbgPrint(MIN_TRACE, ("Failed to apply new packet filter (0x%x)\n", status));
328  break;
329  }
330 
331  break;
332 
334  if (InformationBufferLength < sizeof(ULONG))
335  {
336  *BytesRead = 0;
337  *BytesNeeded = sizeof(ULONG);
339  break;
340  }
341 
342  NdisMoveMemory(&genericUlong, InformationBuffer, sizeof(ULONG));
343 
344  if (genericUlong > MAXIMUM_FRAME_SIZE - sizeof(ETH_HEADER))
345  {
347  }
348  else
349  {
350  // Ignore this...
351  }
352 
353  break;
354 
356  if (InformationBufferLength % IEEE_802_ADDR_LENGTH)
357  {
358  *BytesRead = 0;
359  *BytesNeeded = InformationBufferLength + (InformationBufferLength % IEEE_802_ADDR_LENGTH);
361  break;
362  }
363 
364  if (InformationBufferLength > sizeof(Adapter->MulticastList))
365  {
366  *BytesNeeded = sizeof(Adapter->MulticastList);
367  *BytesRead = 0;
369  break;
370  }
371 
372  NdisMoveMemory(Adapter->MulticastList, InformationBuffer, InformationBufferLength);
373 
374  Adapter->MulticastListSize = InformationBufferLength / IEEE_802_ADDR_LENGTH;
375 
376  NICUpdateMulticastList(Adapter);
377  break;
378 
379  default:
380  NDIS_DbgPrint(MIN_TRACE, ("Unknown OID 0x%x(%s)\n", Oid, Oid2Str(Oid)));
382  *BytesRead = 0;
383  *BytesNeeded = 0;
384  break;
385  }
386 
388  {
389  *BytesRead = InformationBufferLength;
390  *BytesNeeded = 0;
391  }
392 
393  return status;
394 }
ULONG MulticastListSize
Definition: nic.h:47
struct _E1000_ADAPTER::@969 MulticastList[MAXIMUM_MULTICAST_ADDRESSES]
static ULONG
Definition: info.c:26
NDIS_STATUS NTAPI NICApplyPacketFilter(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:722
struct _E1000_ADAPTER * PE1000_ADAPTER
#define OID_GEN_CURRENT_PACKET_FILTER
Definition: ntddndis.h:246
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
Definition: wdfiotarget.h:859
int NDIS_STATUS
Definition: ntddndis.h:475
#define NDIS_STATUS_NOT_SUPPORTED
Definition: ndis.h:479
ULONG PacketFilter
Definition: nic.h:51
Definition: lan.h:33
#define NDIS_STATUS_INVALID_LENGTH
Definition: ndis.h:485
#define NDIS_STATUS_INVALID_DATA
Definition: ndis.h:486
#define NDIS_STATUS_MULTICAST_FULL
Definition: ndis.h:473
#define NDIS_PACKET_TYPE_ALL_MULTICAST
Definition: ndis.h:665
#define IEEE_802_ADDR_LENGTH
Definition: e1000hw.h:11
#define NDIS_PACKET_TYPE_MULTICAST
Definition: ndis.h:664
const char * Oid2Str(IN NDIS_OID Oid)
Definition: debug.c:12
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
#define OID_802_3_MULTICAST_LIST
Definition: ntddndis.h:304
#define NDIS_PACKET_TYPE_PROMISCUOUS
Definition: ndis.h:668
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
NDIS_STATUS NTAPI NICUpdateMulticastList(IN PE1000_ADAPTER Adapter)
Definition: hardware.c:691
unsigned int ULONG
Definition: retypes.h:1
#define MIN_TRACE
Definition: debug.h:14
#define NDIS_PACKET_TYPE_MAC_FRAME
Definition: ndis.h:674
#define MAXIMUM_FRAME_SIZE
Definition: nic.h:19
#define NdisMoveMemory(Destination, Source, Length)
Definition: ndis.h:3896
static SERVICE_STATUS status
Definition: service.c:31
#define OID_GEN_CURRENT_LOOKAHEAD
Definition: ntddndis.h:247
#define NDIS_PACKET_TYPE_DIRECTED
Definition: ndis.h:663
#define NDIS_PACKET_TYPE_BROADCAST
Definition: ndis.h:666
Definition: ps.c:97

◆ MiSetMulticast()

NDIS_STATUS NTAPI MiSetMulticast ( PADAPTER  Adapter,
UCHAR Addresses,
UINT  AddressCount 
)

Definition at line 1262 of file pcnet.c.

1266 {
1267  UINT Index;
1268  ULONG CrcIndex;
1269 
1271  for (Index = 0; Index < AddressCount; Index++)
1272  {
1273  CrcIndex = MiEthernetCrc(Addresses) >> 26;
1274  Adapter->InitializationBlockVirt->LADR[CrcIndex >> 3] |= 1 << (CrcIndex & 15);
1275  Addresses += 6;
1276  }
1277 
1278  /* FIXME: The specification mentions we need to reload the init block here. */
1279 
1280  return NDIS_STATUS_SUCCESS;
1281 }
static ULONG NTAPI MiEthernetCrc(UCHAR *Address)
Definition: pcnet.c:1235
_In_ WDFCOLLECTION _In_ ULONG Index
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
PINITIALIZATION_BLOCK InitializationBlockVirt
Definition: pcnet.h:81
unsigned int UINT
Definition: ndis.h:50
#define NdisZeroMemory(Destination, Length)
Definition: ndis.h:3926
unsigned int ULONG
Definition: retypes.h:1

Referenced by MiniportSetInformation().