ReactOS 0.4.16-dev-1223-gddcd5f7
main.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Novell Eagle 2000 driver
4 * FILE: ne2000/main.c
5 * PURPOSE: Driver entry point
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * REVISIONS:
8 * CSH 27/08-2000 Created
9 */
10
11#include <ne2000.h>
12
18
19
20#if DBG
21
22/* See debug.h for debug/trace constants */
24
25#endif /* DBG */
26
27
28/* List of supported OIDs */
58};
59
62
63
65 IN NDIS_HANDLE MiniportAdapterContext)
66/*
67 * FUNCTION: Examines if an adapter has hung
68 * ARGUMENTS:
69 * MiniportAdapterContext = Pointer to adapter context area
70 * RETURNS:
71 * TRUE if the adapter has hung, FALSE if not
72 */
73{
74 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
75
76 return FALSE;
77}
78
79
81 IN NDIS_HANDLE MiniportAdapterContext)
82/*
83 * FUNCTION: Disables interrupts from an adapter
84 * ARGUMENTS:
85 * MiniportAdapterContext = Pointer to adapter context area
86 */
87{
88 NDIS_DbgPrint(MAX_TRACE, ("Called. (MiniportDisableInterrupt).\n"));
89#ifndef NOCARD
90 NICDisableInterrupts((PNIC_ADAPTER)MiniportAdapterContext);
91#endif
92}
93
94
96 IN NDIS_HANDLE MiniportAdapterContext)
97/*
98 * FUNCTION: Enables interrupts from an adapter
99 * ARGUMENTS:
100 * MiniportAdapterContext = Pointer to adapter context area
101 */
102{
103 NDIS_DbgPrint(MAX_TRACE, ("Called. (MiniportEnableInterrupt).\n"));
104#ifndef NOCARD
105 NICEnableInterrupts((PNIC_ADAPTER)MiniportAdapterContext);
106#endif
107}
108
109
111 IN NDIS_HANDLE MiniportAdapterContext)
112/*
113 * FUNCTION: Deallocates resources for and halts an adapter
114 * ARGUMENTS:
115 * MiniportAdapterContext = Pointer to adapter context area
116 */
117{
118 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
119
121
122 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
123#ifndef NOCARD
124 /* Stop the NIC */
125 NICStop(Adapter);
126#endif
127 /* Wait for any DPCs to complete. FIXME: Use something else */
128 NdisStallExecution(250000);
129
130 if (Adapter->InterruptRegistered)
131 /* Deregister interrupt */
133
134 if (Adapter->IOPortRangeRegistered)
135 /* Deregister I/O port range */
137 Adapter->MiniportAdapterHandle,
138 Adapter->IoBaseAddress,
139 0x20,
140 Adapter->IOBase);
141
142 if (Adapter->ShutdownHandlerRegistered)
144
145 /* Remove adapter from global adapter list */
146 if ((&Adapter->ListEntry)->Blink != NULL) {
147 RemoveEntryList(&Adapter->ListEntry);
148 }
149
150 /* Free adapter context area */
151 NdisFreeMemory(Adapter, sizeof(NIC_ADAPTER), 0);
152}
153
154
157 IN PNIC_ADAPTER Adapter,
159{
160 PNDIS_RESOURCE_LIST AssignedResources;
161 UINT BufferSize = 0;
163 UINT i;
164
167 NULL,
168 &BufferSize);
170 return;
171
172 *Status = NdisAllocateMemory((PVOID)&AssignedResources,
174 0,
177 return;
178
181 AssignedResources,
182 &BufferSize);
184 return;
185
186 for (i = 0; i < AssignedResources->Count; i++)
187 {
188 Descriptor = AssignedResources->PartialDescriptors + i;
189 switch (Descriptor->Type)
190 {
192 Adapter->InterruptLevel = Descriptor->u.Interrupt.Level;
193 Adapter->InterruptVector = Descriptor->u.Interrupt.Vector;
194 Adapter->InterruptShared = (Descriptor->ShareDisposition == CmResourceShareShared);
195 Adapter->InterruptMode = Descriptor->Flags & CM_RESOURCE_INTERRUPT_LATCHED ?
197 break;
199 Adapter->IoBaseAddress = Descriptor->u.Port.Start.LowPart;
200 break;
201 }
202 }
203}
204
205VOID
206NTAPI
208{
209 #ifndef NOCARD
211 #endif
212}
213
217 IN PNDIS_MEDIUM MediumArray,
221/*
222 * FUNCTION: Adapter initialization function
223 * ARGUMENTS:
224 * OpenErrorStatus = Address of buffer to place additional status information
225 * SelectedMediumIndex = Address of buffer to place selected medium index
226 * MediumArray = Pointer to an array of NDIS_MEDIUMs
227 * MediaArraySize = Number of elements in MediumArray
228 * MiniportAdapterHandle = Miniport adapter handle assigned by NDIS
229 * WrapperConfigurationContext = Handle used to identify configuration context
230 * RETURNS:
231 * Status of operation
232 */
233{
234 UINT i;
236 PNIC_ADAPTER Adapter;
238 UINT *RegNetworkAddress = 0;
239 UINT RegNetworkAddressLength = 0;
240
242
243 NDIS_DbgPrint(MAX_TRACE, ("Called (Adapter %X).\n", MiniportAdapterHandle));
244
245 /* Search for 802.3 media which is the only one we support */
246 for (i = 0; i < MediumArraySize; i++) {
247 if (MediumArray[i] == NdisMedium802_3)
248 break;
249 }
250
251 if (i == MediumArraySize) {
252 NDIS_DbgPrint(MIN_TRACE, ("No supported media.\n"));
254 }
255
257
258 Status = NdisAllocateMemory((PVOID)&Adapter,
259 sizeof(NIC_ADAPTER),
260 0,
263 NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
264 return Status;
265 }
266
267 NdisZeroMemory(Adapter, sizeof(NIC_ADAPTER));
277
278 /* Query the resources from PnP. */
280
281 /* Get the port, irq, and MAC address from registry if the PnP
282 failed. */
284 {
285 PNDIS_CONFIGURATION_PARAMETER ConfigurationParameter;
287
290 {
294 {
295 NDIS_DbgPrint(MID_TRACE,("NdisReadConfiguration for Irq returned successfully, irq 0x%x\n",
296 ConfigurationParameter->ParameterData.IntegerData));
297 Adapter->InterruptLevel =
298 Adapter->InterruptVector = ConfigurationParameter->ParameterData.IntegerData;
299 }
300
304 {
305 NDIS_DbgPrint(MID_TRACE,("NdisReadConfiguration for Port returned successfully, port 0x%x\n",
306 ConfigurationParameter->ParameterData.IntegerData));
307 Adapter->IoBaseAddress = ConfigurationParameter->ParameterData.IntegerData;
308 }
309
311 }
312 else
313 {
314 NDIS_DbgPrint(MIN_TRACE,("NdisOpenConfiguration returned error 0x%x\n", Status));
315 }
316 }
317
318 /* find the nic */
319 if (!NICCheck(Adapter)) {
320 NDIS_DbgPrint(MID_TRACE, ("No adapter found at (0x%X).\n", Adapter->IoBaseAddress));
321 NdisFreeMemory(Adapter, sizeof(NIC_ADAPTER), 0);
323 } else
324 NDIS_DbgPrint(MID_TRACE, ("Adapter found at (0x%X).\n", Adapter->IoBaseAddress));
325
328 (NDIS_HANDLE)Adapter,
329 FALSE,
331
333 (PVOID*)&Adapter->IOBase,
335 Adapter->IoBaseAddress,
336 0x20);
337
339 NDIS_DbgPrint(MIN_TRACE, ("Cannot register port range. Status (0x%X).\n", Status));
340 MiniportHalt((NDIS_HANDLE)Adapter);
341 return Status;
342 }
343
344 Adapter->IOPortRangeRegistered = TRUE;
345
346 /* Initialize NIC */
347#ifndef NOCARD
348 Status = NICInitialize(Adapter);
350 NDIS_DbgPrint(MIN_TRACE,("No NE2000 or compatible network adapter found at address 0x%X.\n",
351 Adapter->IOBase));
352
353 NDIS_DbgPrint(MID_TRACE, ("Status (0x%X).\n", Status));
354 MiniportHalt((NDIS_HANDLE)Adapter);
355 return Status;
356 }
357
360 {
361 NdisReadNetworkAddress(&Status, (PVOID *)&RegNetworkAddress, &RegNetworkAddressLength, ConfigurationHandle);
362 if(Status == NDIS_STATUS_SUCCESS && RegNetworkAddressLength == DRIVER_LENGTH_OF_ADDRESS)
363 {
364 int i;
365 NDIS_DbgPrint(MID_TRACE,("NdisReadNetworkAddress returned successfully, address %x:%x:%x:%x:%x:%x\n",
366 RegNetworkAddress[0], RegNetworkAddress[1], RegNetworkAddress[2], RegNetworkAddress[3],
367 RegNetworkAddress[4], RegNetworkAddress[5]));
368 for(i = 0; i < DRIVER_LENGTH_OF_ADDRESS; i++)
369 Adapter->StationAddress[i] = RegNetworkAddress[i];
370 }
371
373 }
374
375 if (Status != NDIS_STATUS_SUCCESS || RegNetworkAddressLength != DRIVER_LENGTH_OF_ADDRESS)
376 {
377 int i;
378 for (i = 0; i < DRIVER_LENGTH_OF_ADDRESS; i++)
379 Adapter->StationAddress[i] = Adapter->PermanentAddress[i];
380 }
381
382 NDIS_DbgPrint(MID_TRACE, ("BOARDDATA:\n"));
383 for (i = 0; i < 4; i++) {
384 NDIS_DbgPrint(MID_TRACE, ("%02X %02X %02X %02X\n",
385 Adapter->SAPROM[i*4+0],
386 Adapter->SAPROM[i*4+1],
387 Adapter->SAPROM[i*4+2],
388 Adapter->SAPROM[i*4+3]));
389 }
390
391 /* Setup adapter structure */
392 Adapter->TXStart = ((ULONG_PTR)Adapter->RamBase >> 8);
395 Adapter->TXCurrent = -1;
396 Adapter->PageStart = Adapter->TXStart + Adapter->TXCount;
397 Adapter->PageStop = Adapter->TXStart + (Adapter->RamSize >> 8);
398
399 /* Initialize multicast address mask to accept all */
400 for (i = 0; i < 8; i++)
401 Adapter->MulticastAddressMask[i] = 0xFF;
402
403 /* Setup the NIC */
404 NICSetup(Adapter);
405
406 NDIS_DbgPrint(MID_TRACE, ("TXStart (0x%X) TXCount (0x%X) PageStart (0x%X)\n",
407 Adapter->TXStart,
408 Adapter->TXCount,
409 Adapter->PageStart));
410
411 NDIS_DbgPrint(MID_TRACE, ("PageStop (0x%X) CurrentPage (0x%X) NextPacket (0x%X).\n",
412 Adapter->PageStop,
413 Adapter->CurrentPage,
414 Adapter->NextPacket));
415#endif
416 /* Register the interrupt */
418 &Adapter->Interrupt,
420 Adapter->InterruptVector,
421 Adapter->InterruptLevel,
422 FALSE,
423 Adapter->InterruptShared,
424 Adapter->InterruptMode);
426 NDIS_DbgPrint(MIN_TRACE, ("Cannot register interrupt. Status (0x%X).\n", Status));
427 MiniportHalt((NDIS_HANDLE)Adapter);
428 return Status;
429 }
430
431 Adapter->InterruptRegistered = TRUE;
432#ifndef NOCARD
433 /* Start the NIC */
434 NICStart(Adapter);
435#endif
436
437 /* Register the shutdown handler */
439
441
442 /* Add adapter to the global adapter list */
444
445 NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n"));
446
447 return NDIS_STATUS_SUCCESS;
448}
449
450
452 OUT PBOOLEAN InterruptRecognized,
453 OUT PBOOLEAN QueueMiniportHandleInterrupt,
454 IN NDIS_HANDLE MiniportAdapterContext)
455/*
456 * FUNCTION: Interrupt Service Routine for controlled adapters
457 * ARGUMENTS:
458 * InterruptRecognized = Address of buffer to place wether
459 * the adapter generated the interrupt
460 * QueueMiniportHandleInterrupt = Address of buffer to place wether
461 * MiniportHandleInterrupt should be called
462 * MiniportAdapterContext = Pointer to adapter context area
463 * NOTES:
464 * All pending interrupts are handled
465 */
466{
467 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
468
469 NICDisableInterrupts((PNIC_ADAPTER)MiniportAdapterContext);
470
471 *InterruptRecognized = TRUE;
472 *QueueMiniportHandleInterrupt = TRUE;
473}
474
475
477 IN NDIS_HANDLE MiniportAdapterContext,
478 IN NDIS_OID Oid,
479 IN PVOID InformationBuffer,
480 IN ULONG InformationBufferLength,
482 OUT PULONG BytesNeeded)
483/*
484 * FUNCTION: Handler to process queries
485 * ARGUMENTS:
486 * MiniportAdapterContext = Pointer to adapter context area
487 * Oid = OID code designating query operation
488 * InformationBuffer = Address of return buffer
489 * InformationBufferLength = Length of return buffer
490 * BytesWritten = Address of buffer to place number of bytes returned
491 * BytesNeeded = Address of buffer to place number of bytes needed
492 * in InformationBuffer for specified OID
493 * RETURNS:
494 * Status of operation
495 */
496{
498 PVOID CopyFrom;
499 UINT CopySize;
500 ULONG GenericULONG;
501 USHORT GenericUSHORT;
503 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
504
505 NDIS_DbgPrint(MAX_TRACE, ("Called. Oid (0x%X).\n", Oid));
506
508 CopyFrom = (PVOID)&GenericULONG;
509 CopySize = sizeof(ULONG);
510
511 switch (Oid) {
513 CopyFrom = (PVOID)&MiniportOIDList;
514 CopySize = sizeof(MiniportOIDList);
515 break;
517 GenericULONG = (ULONG)NdisHardwareStatusReady;
518 break;
521 CopyFrom = (PVOID)&Medium;
522 CopySize = sizeof(NDIS_MEDIUM);
523 break;
525 GenericULONG = DRIVER_MAXIMUM_LOOKAHEAD;
526 break;
528 GenericULONG = DRIVER_FRAME_SIZE - DRIVER_HEADER_SIZE;
529 break;
531 GenericULONG = 100000; /* 10Mbps */
532 break;
534 GenericULONG = Adapter->TXCount * DRIVER_BLOCK_SIZE;
535 break;
537 GenericULONG = Adapter->RamSize -
538 (ULONG_PTR)Adapter->RamBase -
539 (Adapter->TXCount * DRIVER_BLOCK_SIZE);
540 break;
542 GenericULONG = DRIVER_BLOCK_SIZE;
543 break;
545 GenericULONG = DRIVER_BLOCK_SIZE;
546 break;
548 NdisMoveMemory(&GenericULONG, &Adapter->PermanentAddress, 3);
549 GenericULONG &= 0xFFFFFF00;
550 GenericULONG |= 0x01;
551 break;
553 CopyFrom = (PVOID)&DRIVER_VENDOR_DESCRIPTION;
554 CopySize = sizeof(DRIVER_VENDOR_DESCRIPTION);
555 break;
557 GenericUSHORT = (USHORT)DRIVER_VENDOR_DRIVER_VERSION;
558 CopyFrom = (PVOID)&GenericUSHORT;
559 CopySize = sizeof(USHORT);
560 break;
562 GenericULONG = Adapter->PacketFilter;
563 break;
565 GenericULONG = Adapter->LookaheadSize;
566 break;
569 CopyFrom = (PVOID)&GenericUSHORT;
570 CopySize = sizeof(USHORT);
571 break;
573 GenericULONG = DRIVER_FRAME_SIZE;
574 break;
576 NDIS_DbgPrint(MID_TRACE, ("OID_GEN_PROTOCOL_OPTIONS.\n"));
578 break;
584 break;
586 GenericULONG = (ULONG)NdisMediaStateConnected;
587 break;
589 GenericULONG = 1;
590 break;
592 CopyFrom = (PVOID)&Adapter->PermanentAddress;
593 CopySize = DRIVER_LENGTH_OF_ADDRESS;
594 break;
596 CopyFrom = (PVOID)&Adapter->StationAddress;
597 CopySize = DRIVER_LENGTH_OF_ADDRESS;
598 break;
600 NDIS_DbgPrint(MID_TRACE, ("OID_802_3_MULTICAST_LIST.\n"));
602 break;
604 GenericULONG = Adapter->MaxMulticastListSize;
605 break;
607 NDIS_DbgPrint(MID_TRACE, ("OID_802_3_MAC_OPTIONS.\n"));
609 break;
611 GenericULONG = NdisPhysicalMedium802_3;
612 break;
613 default:
614 NDIS_DbgPrint(MIN_TRACE, ("Unknown OID (0x%X).\n", Oid));
616 break;
617 }
618
620 if (CopySize > InformationBufferLength) {
621 *BytesNeeded = (CopySize - InformationBufferLength);
622 *BytesWritten = 0;
624 } else {
625 NdisMoveMemory(InformationBuffer, CopyFrom, CopySize);
626 *BytesWritten = CopySize;
627 *BytesNeeded = 0;
628 }
629 }
630
631 NDIS_DbgPrint(MAX_TRACE, ("Leaving. Status is (0x%X).\n", Status));
632
633 return Status;
634}
635
636
639 IN NDIS_HANDLE MiniportAdapterContext,
641/*
642 * FUNCTION: Reconfigures an adapter
643 * ARGUMENTS:
644 * OpenErrorStatus = Address of buffer to place additional status information
645 * MiniportAdapterContext = Pointer to adapter context area
646 * WrapperConfigurationContext = Handle used to identify configuration context
647 * RETURNS:
648 * Status of operation
649 * NOTES:
650 * Never called by NDIS library
651 */
652{
653 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
654
655 return NDIS_STATUS_FAILURE;
656}
657
658
659
661 OUT PBOOLEAN AddressingReset,
662 IN NDIS_HANDLE MiniportAdapterContext)
663/*
664 * FUNCTION: Resets an adapter
665 * ARGUMENTS:
666 * AddressingReset = Address of a buffer to place value indicating
667 * wether NDIS library should call MiniportSetInformation
668 * to restore addressing information
669 * MiniportAdapterContext = Pointer to adapter context area
670 * RETURNS:
671 * Status of operation
672 */
673{
674 NDIS_STATUS NdisStatus = NDIS_STATUS_SUCCESS;
675
676 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
677
678#ifndef NOCARD
679 NdisStatus = NICReset((PNIC_ADAPTER)MiniportAdapterContext);
680#endif
681
682 *AddressingReset = TRUE;
683
684 return NdisStatus;
685}
686
687
689 IN NDIS_HANDLE MiniportAdapterContext,
691 IN UINT Flags)
692/*
693 * FUNCTION: Transmits a packet
694 * ARGUMENTS:
695 * MiniportAdapterContext = Pointer to adapter context area
696 * Packet = Pointer to a packet descriptor specifying
697 * the data to be transmitted
698 * Flags = Specifies optional packet flags
699 * RETURNS:
700 * Status of operation
701 */
702{
703 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
704
706
707#ifndef NOCARD
708 NDIS_DbgPrint(MID_TRACE, ("Queueing packet.\n"));
709
710 /* Queue the packet on the transmit queue */
711 RESERVED(Packet)->Next = NULL;
712 if (Adapter->TXQueueHead == NULL) {
713 Adapter->TXQueueHead = Packet;
714 } else {
715 RESERVED(Adapter->TXQueueTail)->Next = Packet;
716 }
717
718 Adapter->TXQueueTail = Packet;
719
720 /* Transmit the packet */
721 NICTransmit(Adapter);
722
723 return NDIS_STATUS_PENDING;
724#else
725 return NDIS_STATUS_SUCCESS;
726#endif
727}
728
729
731 IN NDIS_HANDLE MiniportAdapterContext,
732 IN NDIS_OID Oid,
733 IN PVOID InformationBuffer,
734 IN ULONG InformationBufferLength,
736 OUT PULONG BytesNeeded)
737/*
738 * FUNCTION: Changes state information in the driver
739 * ARGUMENTS:
740 * MiniportAdapterContext = Pointer to adapter context area
741 * Oid = OID code designating set operation
742 * InformationBuffer = Pointer to buffer with state information
743 * InformationBufferLength = Length of InformationBuffer
744 * BytesRead = Address of buffer to place number of bytes read
745 * BytesNeeded = Address of buffer to place number of extra bytes
746 * needed in InformationBuffer for specified OID
747 * RETURNS:
748 * Status of operation
749 */
750{
751 ULONG GenericULONG;
753 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
754
755 NDIS_DbgPrint(MAX_TRACE, ("Called. Oid (0x%X).\n", Oid));
756
757 switch (Oid) {
759 /* Verify length */
760 if (InformationBufferLength < sizeof(ULONG)) {
761 *BytesRead = 0;
762 *BytesNeeded = sizeof(ULONG) - InformationBufferLength;
764 break;
765 }
766
767 NdisMoveMemory(&GenericULONG, InformationBuffer, sizeof(ULONG));
768 /* Check for properties the driver don't support */
769 if (GenericULONG &
776 *BytesRead = 4;
777 *BytesNeeded = 0;
779 break;
780 }
781
782 Adapter->PacketFilter = GenericULONG;
783
784 /* FIXME: Set filter on hardware */
785
786 break;
788 /* Verify length */
789 if (InformationBufferLength < sizeof(ULONG)) {
790 *BytesRead = 0;
791 *BytesNeeded = sizeof(ULONG) - InformationBufferLength;
793 break;
794 }
795
796 NdisMoveMemory(&GenericULONG, InformationBuffer, sizeof(ULONG));
797 if (GenericULONG > DRIVER_MAXIMUM_LOOKAHEAD)
799 else
800 Adapter->LookaheadSize = GenericULONG;
801 break;
803 /* Verify length. Must be multiple of hardware address length */
804 if ((InformationBufferLength % DRIVER_LENGTH_OF_ADDRESS) != 0) {
805 *BytesRead = 0;
806 *BytesNeeded = 0;
808 break;
809 }
810
811 /* Set new multicast address list */
812 NdisMoveMemory(Adapter->Addresses, InformationBuffer, InformationBufferLength);
813
814 /* FIXME: Update hardware */
815
816 break;
817 default:
818 NDIS_DbgPrint(MIN_TRACE, ("Invalid object ID (0x%X).\n", Oid));
819 *BytesRead = 0;
820 *BytesNeeded = 0;
822 break;
823 }
824
826 *BytesRead = InformationBufferLength;
827 *BytesNeeded = 0;
828 }
829
830 NDIS_DbgPrint(MAX_TRACE, ("Leaving. Status (0x%X).\n", Status));
831
832 return Status;
833}
834
835
839 IN NDIS_HANDLE MiniportAdapterContext,
840 IN NDIS_HANDLE MiniportReceiveContext,
842 IN UINT BytesToTransfer)
843/*
844 * FUNCTION: Transfers data from a received frame into an NDIS packet
845 * ARGUMENTS:
846 * Packet = Address of packet to copy received data into
847 * BytesTransferred = Address of buffer to place number of bytes transmitted
848 * MiniportAdapterContext = Pointer to adapter context area
849 * MiniportReceiveContext = Pointer to receive context area (actually NULL)
850 * ByteOffset = Offset within received packet to begin copying
851 * BytesToTransfer = Number of bytes to copy into packet
852 * RETURNS:
853 * Status of operation
854 */
855{
856 PNDIS_BUFFER DstBuffer;
857 UINT BytesCopied, BytesToCopy, DstSize;
858 ULONG SrcData;
859 PUCHAR DstData;
860 UINT RecvStart;
861 UINT RecvStop;
862 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
863
864 NDIS_DbgPrint(MAX_TRACE, ("Called. Packet (0x%X) ByteOffset (0x%X) BytesToTransfer (%d).\n",
865 Packet, ByteOffset, BytesToTransfer));
866
867 if (BytesToTransfer == 0) {
868 *BytesTransferred = 0;
869 return NDIS_STATUS_SUCCESS;
870 }
871
872 RecvStart = Adapter->PageStart * DRIVER_BLOCK_SIZE;
873 RecvStop = Adapter->PageStop * DRIVER_BLOCK_SIZE;
874
875 NdisQueryPacket(Packet, NULL, NULL, &DstBuffer, NULL);
876 NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize);
877
878 SrcData = Adapter->PacketOffset + sizeof(DISCARD_HEADER) + ByteOffset;
879 if (ByteOffset + sizeof(DISCARD_HEADER) + BytesToTransfer >
880 Adapter->PacketHeader.PacketLength)
881 BytesToTransfer = Adapter->PacketHeader.PacketLength -
882 sizeof(DISCARD_HEADER) - ByteOffset;
883
884 /* Start copying the data */
885 BytesCopied = 0;
886 for (;;) {
887 BytesToCopy = (DstSize < BytesToTransfer) ? DstSize : BytesToTransfer;
888 if (SrcData + BytesToCopy > RecvStop)
889 BytesToCopy = (RecvStop - SrcData);
890
891 NICReadData(Adapter, DstData, SrcData, BytesToCopy);
892
894 SrcData += BytesToCopy;
895 DstData = (PUCHAR)((ULONG_PTR) DstData + BytesToCopy);
896 BytesToTransfer -= BytesToCopy;
897 if (BytesToTransfer == 0)
898 break;
899
900 DstSize -= BytesToCopy;
901 if (DstSize == 0) {
902 /* No more bytes in destination buffer. Proceed to
903 the next buffer in the destination buffer chain */
904 NdisGetNextBuffer(DstBuffer, &DstBuffer);
905 if (!DstBuffer)
906 break;
907
908 NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize);
909 }
910
911 if (SrcData == RecvStop)
912 SrcData = RecvStart;
913 }
914
915 NDIS_DbgPrint(MID_TRACE, ("Transferred (%d) bytes.\n", BytesToTransfer));
916
918
919 return NDIS_STATUS_SUCCESS;
920}
921
922
924NTAPI
928/*
929 * FUNCTION: Main driver entry point
930 * ARGUMENTS:
931 * DriverObject = Pointer to a driver object for this driver
932 * RegistryPath = Registry node for configuration parameters
933 * RETURNS:
934 * Status of driver initialization
935 */
936{
938 NDIS_HANDLE NdisWrapperHandle;
940
941 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
942
943 NdisZeroMemory(&Miniport, sizeof(Miniport));
944 Miniport.MajorNdisVersion = DRIVER_NDIS_MAJOR_VERSION;
945 Miniport.MinorNdisVersion = DRIVER_NDIS_MINOR_VERSION;
946 Miniport.CheckForHangHandler = MiniportCheckForHang;
947 Miniport.DisableInterruptHandler = MiniportDisableInterrupt;
948 Miniport.EnableInterruptHandler = MiniportEnableInterrupt;
949 Miniport.HaltHandler = MiniportHalt;
950 Miniport.HandleInterruptHandler = MiniportHandleInterrupt;
951 Miniport.InitializeHandler = MiniportInitialize;
952 Miniport.ISRHandler = MiniportISR;
953 Miniport.QueryInformationHandler = MiniportQueryInformation;
954 Miniport.ReconfigureHandler = MiniportReconfigure;
955 Miniport.ResetHandler = MiniportReset;
956 Miniport.SendHandler = MiniportSend;
957 Miniport.SetInformationHandler = MiniportSetInformation;
958 Miniport.TransferDataHandler = MiniportTransferData;
959
960 NdisMInitializeWrapper(&NdisWrapperHandle,
963 NULL);
964
965 if (!NdisWrapperHandle) {
966 NDIS_DbgPrint(MIN_TRACE, ("NdisMInitializeWrapper() failed\n"));
967 return STATUS_UNSUCCESSFUL;
968 }
969
970 DriverInfo.NdisWrapperHandle = NdisWrapperHandle;
973
974 Status = NdisMRegisterMiniport(NdisWrapperHandle,
975 &Miniport,
978 NDIS_DbgPrint(MIN_TRACE, ("NdisMRegisterMiniport() failed with status code (0x%X).\n", Status));
979 NdisTerminateWrapper(NdisWrapperHandle, NULL);
980 return STATUS_UNSUCCESSFUL;
981 }
982
983 return STATUS_SUCCESS;
984}
985
986#if 0
987 /* while i'm here - some basic registry sanity checks */
988 {
989 /* write tests */
991
992 ParameterValue.ParameterType = NdisParameterInteger;
993 ParameterValue.ParameterData.IntegerData = 0x12345678;
994 NdisInitUnicodeString(&Keyword, L"DwordTest");
996
998 {
999 DbgPrint("ne2000!MiniportInitialize: failed to set DwordTest: 0x%x\n", Status);
1000 DbgBreakPoint();
1001 }
1002
1003 DbgPrint("ne2000!MiniportInitialize: DwordTest successfully set\n");
1004
1005 NdisInitUnicodeString(&Keyword, L"StringTest");
1006 ParameterValue.ParameterType = NdisParameterString;
1007 NdisInitUnicodeString(&ParameterValue.ParameterData.StringData, L"Testing123");
1008
1010
1012 {
1013 DbgPrint("ne2000!MiniportInitialize: failed to set StringTest: 0x%x\n", Status);
1014 DbgBreakPoint();
1015 }
1016
1017 DbgPrint("ne2000!MiniportInitialize: StringTest successfully set\n");
1018 }
1019
1020 {
1021 /* read back the test values */
1023
1024 NdisInitUnicodeString(&Keyword, L"DwordTest");
1026
1028 {
1029 DbgPrint("ne2000!MiniportInitialize: failed to read DwordTest: 0x%x\n", Status);
1030 DbgBreakPoint();
1031 }
1032
1033 if(ParameterValue->ParameterData.IntegerData != 0x12345678)
1034 {
1035 DbgPrint("ne2000!MiniportInitialize: DwordTest value is wrong: 0x%x\n",
1036 ParameterValue->ParameterData.IntegerData);
1037 DbgBreakPoint();
1038 }
1039
1040 DbgPrint("ne2000!MiniportInitialize: DwordTest value was correctly read\n");
1041
1042 NdisInitUnicodeString(&Keyword, L"StringTest");
1044
1046 {
1047 DbgPrint("ne2000!MiniportInitialize: failed to read StringTest: 0x%x\n", Status);
1048 DbgBreakPoint();
1049 }
1050
1051 if(wcsncmp(ParameterValue->ParameterData.StringData.Buffer, L"Testing123",
1052 wcslen(L"Testing123")))
1053 {
1054 DbgPrint("ne2000!MiniportInitialize: StringTest value is wrong: %wZ\n",
1055 &ParameterValue->ParameterData.StringData);
1056 DbgBreakPoint();
1057 }
1058
1059 DbgPrint("ne2000!MiniportInitialize: StringTest value was correctly read\n");
1060 }
1061
1062#endif
1063
1064/* EOF */
struct _DISCARD_HEADER DISCARD_HEADER
#define NICEnableInterrupts(Adapter)
Definition: 8390.h:164
#define NICDisableInterrupts(Adapter)
Definition: 8390.h:159
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define MIN_TRACE
Definition: debug.h:14
#define MID_TRACE
Definition: debug.h:15
#define MAX_TRACE
Definition: debug.h:16
_In_opt_ PWSTR _In_ PWSTR _Inout_ PULONG ParameterValue
Definition: cdrom.h:963
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
DRIVER_INITIALIZE DriverEntry
Definition: main.c:9
#define NDIS_DbgPrint(_t_, _x_)
Definition: debug.h:40
#define ASSERT_IRQL_EQUAL(x)
Definition: debug.h:43
VOID NTAPI MiniportHandleInterrupt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: interrupt.c:46
static VOID NTAPI MiniportEnableInterrupt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:95
static ULONG MiniportOIDList[]
Definition: main.c:29
VOID NTAPI MiniportShutdown(PVOID Context)
Definition: main.c:207
static 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: main.c:730
static NDIS_STATUS NTAPI MiniportInitialize(OUT PNDIS_STATUS OpenErrorStatus, OUT PUINT SelectedMediumIndex, IN PNDIS_MEDIUM MediumArray, IN UINT MediumArraySize, IN NDIS_HANDLE MiniportAdapterHandle, IN NDIS_HANDLE WrapperConfigurationContext)
Definition: main.c:214
static VOID NTAPI MiniportISR(OUT PBOOLEAN InterruptRecognized, OUT PBOOLEAN QueueMiniportHandleInterrupt, IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:451
static VOID NTAPI MiniportHalt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:110
static NDIS_STATUS NTAPI MiniportTransferData(OUT PNDIS_PACKET Packet, OUT PUINT BytesTransferred, IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_HANDLE MiniportReceiveContext, IN UINT ByteOffset, IN UINT BytesToTransfer)
Definition: main.c:836
static 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: main.c:476
static VOID NTAPI MiniportDisableInterrupt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:80
static BOOLEAN NTAPI MiniportCheckForHang(IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:64
static NDIS_STATUS NTAPI MiniportReset(OUT PBOOLEAN AddressingReset, IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:660
static VOID NTAPI MiQueryResources(OUT PNDIS_STATUS Status, IN PNIC_ADAPTER Adapter, IN NDIS_HANDLE WrapperConfigurationContext)
Definition: main.c:155
DRIVER_INFORMATION DriverInfo
Definition: main.c:60
NDIS_PHYSICAL_ADDRESS HighestAcceptableMax
Definition: main.c:61
static NDIS_STATUS NTAPI MiniportSend(IN NDIS_HANDLE MiniportAdapterContext, IN PNDIS_PACKET Packet, IN UINT Flags)
Definition: main.c:688
static NDIS_STATUS NTAPI MiniportReconfigure(OUT PNDIS_STATUS OpenErrorStatus, IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_HANDLE WrapperConfigurationContext)
Definition: main.c:637
VOID EXPORT NdisCloseConfiguration(IN NDIS_HANDLE ConfigurationHandle)
Definition: config.c:136
VOID EXPORT NdisWriteConfiguration(OUT PNDIS_STATUS Status, IN NDIS_HANDLE ConfigurationHandle, IN PNDIS_STRING Keyword, IN PNDIS_CONFIGURATION_PARAMETER ParameterValue)
Definition: config.c:45
VOID EXPORT NdisReadConfiguration(OUT PNDIS_STATUS Status, OUT PNDIS_CONFIGURATION_PARAMETER *ParameterValue, IN NDIS_HANDLE ConfigurationHandle, IN PNDIS_STRING Keyword, IN NDIS_PARAMETER_TYPE ParameterType)
Definition: config.c:414
VOID EXPORT NdisReadNetworkAddress(OUT PNDIS_STATUS Status, OUT PVOID *NetworkAddress, OUT PUINT NetworkAddressLength, IN NDIS_HANDLE ConfigurationHandle)
Definition: config.c:740
VOID EXPORT NdisOpenConfiguration(OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE ConfigurationHandle, IN NDIS_HANDLE WrapperConfigurationContext)
Definition: config.c:197
VOID EXPORT NdisMQueryAdapterResources(OUT PNDIS_STATUS Status, IN NDIS_HANDLE WrapperConfigurationContext, OUT PNDIS_RESOURCE_LIST ResourceList, IN OUT PUINT BufferSize)
Definition: hardware.c:103
VOID EXPORT NdisMDeregisterInterrupt(IN PNDIS_MINIPORT_INTERRUPT Interrupt)
Definition: io.c:700
VOID EXPORT NdisMDeregisterIoPortRange(IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InitialPort, IN UINT NumberOfPorts, IN PVOID PortOffset)
Definition: io.c:1093
NDIS_STATUS EXPORT NdisMRegisterIoPortRange(OUT PVOID *PortOffset, IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InitialPort, IN UINT NumberOfPorts)
Definition: io.c:1018
NDIS_STATUS EXPORT NdisMRegisterInterrupt(OUT PNDIS_MINIPORT_INTERRUPT Interrupt, IN NDIS_HANDLE MiniportAdapterHandle, IN UINT InterruptVector, IN UINT InterruptLevel, IN BOOLEAN RequestIsr, IN BOOLEAN SharedInterrupt, IN NDIS_INTERRUPT_MODE InterruptMode)
Definition: io.c:941
VOID EXPORT NdisFreeMemory(IN PVOID VirtualAddress, IN UINT Length, IN UINT MemoryFlags)
Definition: memory.c:110
NDIS_STATUS EXPORT NdisAllocateMemory(OUT PVOID *VirtualAddress, IN UINT Length, IN UINT MemoryFlags, IN NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress)
Definition: memory.c:57
VOID EXPORT NdisInitUnicodeString(IN OUT PNDIS_STRING DestinationString, IN PCWSTR SourceString)
Definition: string.c:130
#define ULONG_PTR
Definition: config.h:101
ULONG DebugTraceLevel
Definition: ndis.c:13
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
Definition: fatprocs.h:732
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DbgPrint
Definition: hal.h:12
#define CmResourceTypePort
Definition: hwresource.cpp:123
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define NdisGetNextBuffer(CurrentBuffer, NextBuffer)
Definition: ndis.h:3386
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1549
@ NdisParameterInteger
Definition: ndis.h:926
@ NdisParameterString
Definition: ndis.h:928
@ NdisParameterHexInteger
Definition: ndis.h:927
#define NdisInterruptLatched
Definition: ndis.h:921
#define NdisZeroMemory(Destination, Length)
Definition: ndis.h:3926
unsigned int * PUINT
Definition: ndis.h:50
unsigned int UINT
Definition: ndis.h:50
#define NdisMSetAttributes(MiniportAdapterHandle, MiniportAdapterContext, BusMaster, AdapterType)
Definition: ndis.h:5736
static __inline VOID NdisQueryPacket(IN PNDIS_PACKET Packet, OUT PUINT PhysicalBufferCount OPTIONAL, OUT PUINT BufferCount OPTIONAL, OUT PNDIS_BUFFER *FirstBuffer OPTIONAL, OUT PUINT TotalPacketLength OPTIONAL)
Definition: ndis.h:3593
#define NDIS_STATUS_NOT_SUPPORTED
Definition: ndis.h:479
#define NDIS_PACKET_TYPE_MAC_FRAME
Definition: ndis.h:674
#define NdisInterruptLevelSensitive
Definition: ndis.h:920
#define NDIS_PACKET_TYPE_SOURCE_ROUTING
Definition: ndis.h:667
#define NDIS_STATUS_INVALID_LENGTH
Definition: ndis.h:485
#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL
Definition: ndis.h:672
#define NDIS_STATUS_FAILURE
Definition: ndis.h:465
_In_ UINT _In_ UINT _In_ PNDIS_PACKET _In_ UINT _Out_ PUINT BytesCopied
Definition: ndis.h:3171
#define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND
Definition: ndis.h:684
#define NDIS_MAC_OPTION_RECEIVE_SERIALIZED
Definition: ndis.h:683
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT SelectedMediumIndex
Definition: ndis.h:6011
#define NdisStallExecution
Definition: ndis.h:4453
#define NDIS_PACKET_TYPE_FUNCTIONAL
Definition: ndis.h:673
#define NDIS_PACKET_TYPE_GROUP
Definition: ndis.h:671
_In_ UINT _In_ UINT BytesToCopy
Definition: ndis.h:3168
#define NDIS_STATUS_INVALID_OID
Definition: ndis.h:488
#define NDIS_STATUS_SUCCESS
Definition: ndis.h:346
MDL * PNDIS_BUFFER
Definition: ndis.h:343
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT MediumArraySize
Definition: ndis.h:6013
@ NdisInterfaceIsa
Definition: ndis.h:901
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _In_ NDIS_HANDLE WrapperConfigurationContext
Definition: ndis.h:3946
_In_ NDIS_HANDLE MiniportAdapterHandle
Definition: ndis.h:4668
#define NDIS_PACKET_TYPE_SMT
Definition: ndis.h:669
#define NdisQueryBuffer(_Buffer, _VirtualAddress, _Length)
Definition: ndis.h:3029
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE ConfigurationHandle
Definition: ndis.h:3945
#define NDIS_STATUS_UNSUPPORTED_MEDIA
Definition: ndis.h:490
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_CONFIGURATION_PARAMETER _In_ NDIS_HANDLE _In_ PNDIS_STRING Keyword
Definition: ndis.h:4416
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS OpenErrorStatus
Definition: ndis.h:6009
#define NDIS_STATUS_ADAPTER_NOT_FOUND
Definition: ndis.h:470
#define NdisMInitializeWrapper(NdisWrapperHandle, SystemSpecific1, SystemSpecific2, SystemSpecific3)
Definition: ndis.h:5592
#define NDIS_PHYSICAL_ADDRESS_CONST(Low, High)
Definition: ndis.h:3866
#define NDIS_MAC_OPTION_NO_LOOPBACK
Definition: ndis.h:685
* PNDIS_STATUS
Definition: ndis.h:45
#define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA
Definition: ndis.h:682
#define NdisMoveMemory(Destination, Source, Length)
Definition: ndis.h:3896
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
#define DRIVER_VENDOR_DESCRIPTION
Definition: ne2000.h:39
#define RESERVED(Packet)
Definition: ne2000.h:70
#define DRIVER_HEADER_SIZE
Definition: ne2000.h:43
#define DRIVER_DEFAULT_INTERRUPT_MODE
Definition: ne2000.h:35
struct _NIC_ADAPTER * PNIC_ADAPTER
#define DRIVER_MAXIMUM_LOOKAHEAD
Definition: ne2000.h:47
#define DRIVER_MAX_MULTICAST_LIST_SIZE
Definition: ne2000.h:37
BOOLEAN NICCheck(PNIC_ADAPTER Adapter)
Definition: 8390.c:53
#define DRIVER_FRAME_SIZE
Definition: ne2000.h:42
VOID NICTransmit(PNIC_ADAPTER Adapter)
Definition: 8390.c:1124
#define DRIVER_DEFAULT_INTERRUPT_SHARED
Definition: ne2000.h:34
#define DRIVER_DEFAULT_INTERRUPT_NUMBER
Definition: ne2000.h:33
#define DRIVER_DEFAULT_TX_BUFFER_COUNT
Definition: ne2000.h:54
#define DRIVER_INTERRUPT_MASK
Definition: ne2000.h:58
NDIS_STATUS NICStop(PNIC_ADAPTER Adapter)
Definition: 8390.c:451
#define DRIVER_NDIS_MAJOR_VERSION
Definition: ne2000.h:29
VOID NICReadData(PNIC_ADAPTER Adapter, PUCHAR Target, ULONG_PTR Source, USHORT Length)
Definition: 8390.c:791
#define DRIVER_LENGTH_OF_ADDRESS
Definition: ne2000.h:44
NDIS_STATUS NICSetup(PNIC_ADAPTER Adapter)
Definition: 8390.c:352
NDIS_STATUS NICReset(PNIC_ADAPTER Adapter)
Definition: 8390.c:500
#define DRIVER_VENDOR_DRIVER_VERSION
Definition: ne2000.h:40
#define DRIVER_BLOCK_SIZE
Definition: ne2000.h:50
#define DRIVER_NDIS_MINOR_VERSION
Definition: ne2000.h:30
NDIS_STATUS NICStart(PNIC_ADAPTER Adapter)
Definition: 8390.c:429
NDIS_STATUS NICInitialize(PNIC_ADAPTER Adapter)
Definition: 8390.c:289
#define DRIVER_DEFAULT_IO_BASE_ADDRESS
Definition: ne2000.h:32
VOID EXPORT NdisMDeregisterAdapterShutdownHandler(IN NDIS_HANDLE MiniportHandle)
Definition: miniport.c:1517
VOID EXPORT NdisMRegisterAdapterShutdownHandler(IN NDIS_HANDLE MiniportHandle, IN PVOID ShutdownContext, IN ADAPTER_SHUTDOWN_HANDLER ShutdownHandler)
Definition: miniport.c:1694
NDIS_STATUS EXPORT NdisMRegisterMiniport(IN NDIS_HANDLE NdisWrapperHandle, IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, IN UINT CharacteristicsLength)
Definition: miniport.c:2637
VOID EXPORT NdisTerminateWrapper(IN NDIS_HANDLE NdisWrapperHandle, IN PVOID SystemSpecific)
Definition: miniport.c:3012
enum _NDIS_MEDIUM NDIS_MEDIUM
#define OID_GEN_TRANSMIT_BLOCK_SIZE
Definition: ntddndis.h:242
#define OID_GEN_PROTOCOL_OPTIONS
Definition: ntddndis.h:250
#define OID_GEN_MAXIMUM_TOTAL_SIZE
Definition: ntddndis.h:249
#define OID_GEN_VENDOR_DRIVER_VERSION
Definition: ntddndis.h:254
@ NdisPhysicalMedium802_3
Definition: ntddndis.h:221
#define OID_802_3_PERMANENT_ADDRESS
Definition: ntddndis.h:302
#define OID_GEN_LINK_SPEED
Definition: ntddndis.h:239
#define OID_GEN_VENDOR_ID
Definition: ntddndis.h:244
#define OID_GEN_CURRENT_PACKET_FILTER
Definition: ntddndis.h:246
@ NdisMediaStateConnected
Definition: ntddndis.h:470
#define OID_GEN_PHYSICAL_MEDIUM
Definition: ntddndis.h:264
#define OID_GEN_RECEIVE_BUFFER_SPACE
Definition: ntddndis.h:241
#define OID_802_3_MAXIMUM_LIST_SIZE
Definition: ntddndis.h:305
#define OID_GEN_DRIVER_VERSION
Definition: ntddndis.h:248
#define OID_802_3_MAC_OPTIONS
Definition: ntddndis.h:306
#define OID_802_3_CURRENT_ADDRESS
Definition: ntddndis.h:303
enum _NDIS_MEDIUM * PNDIS_MEDIUM
#define OID_802_3_MULTICAST_LIST
Definition: ntddndis.h:304
#define OID_GEN_TRANSMIT_BUFFER_SPACE
Definition: ntddndis.h:240
#define OID_GEN_MEDIA_SUPPORTED
Definition: ntddndis.h:235
@ NdisMedium802_3
Definition: ntddndis.h:188
#define OID_GEN_MAXIMUM_FRAME_SIZE
Definition: ntddndis.h:238
#define OID_GEN_MEDIA_IN_USE
Definition: ntddndis.h:236
#define OID_GEN_MEDIA_CONNECT_STATUS
Definition: ntddndis.h:252
#define OID_GEN_MAXIMUM_LOOKAHEAD
Definition: ntddndis.h:237
int NDIS_STATUS
Definition: ntddndis.h:475
@ NdisHardwareStatusReady
Definition: ntddndis.h:450
#define OID_GEN_CURRENT_LOOKAHEAD
Definition: ntddndis.h:247
#define OID_GEN_MAC_OPTIONS
Definition: ntddndis.h:251
#define OID_GEN_VENDOR_DESCRIPTION
Definition: ntddndis.h:245
#define OID_GEN_SUPPORTED_LIST
Definition: ntddndis.h:233
ULONG NDIS_OID
Definition: ntddndis.h:230
#define OID_GEN_RECEIVE_BLOCK_SIZE
Definition: ntddndis.h:243
#define OID_GEN_MAXIMUM_SEND_PACKETS
Definition: ntddndis.h:253
#define OID_GEN_HARDWARE_STATUS
Definition: ntddndis.h:234
#define L(x)
Definition: ntvdm.h:50
unsigned short USHORT
Definition: pedump.c:61
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define STATUS_SUCCESS
Definition: shellext.h:65
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
NDIS_HANDLE NdisMacHandle
Definition: ne2000.h:188
LIST_ENTRY AdapterListHead
Definition: ne2000.h:189
NDIS_HANDLE NdisWrapperHandle
Definition: ne2000.h:187
union _NDIS_CONFIGURATION_PARAMETER::@2199 ParameterData
ULONG InterruptLevel
Definition: ne2000.h:86
ULONG PacketFilter
Definition: ne2000.h:126
UINT TXFree
Definition: ne2000.h:162
UINT CurrentPage
Definition: ne2000.h:135
PACKET_HEADER PacketHeader
Definition: ne2000.h:151
ULONG InterruptMask
Definition: ne2000.h:120
UINT PageStart
Definition: ne2000.h:133
UINT PageStop
Definition: ne2000.h:134
UINT RamSize
Definition: ne2000.h:99
BOOLEAN InterruptRegistered
Definition: ne2000.h:180
PUCHAR IOBase
Definition: ne2000.h:92
BOOLEAN InterruptShared
Definition: ne2000.h:88
UCHAR MulticastAddressMask[8]
Definition: ne2000.h:117
BOOLEAN IOPortRangeRegistered
Definition: ne2000.h:179
PNDIS_PACKET TXQueueTail
Definition: ne2000.h:171
UINT TXCount
Definition: ne2000.h:161
DRIVER_HARDWARE_ADDRESS Addresses[DRIVER_MAX_MULTICAST_LIST_SIZE]
Definition: ne2000.h:114
UINT TXStart
Definition: ne2000.h:160
NDIS_MINIPORT_INTERRUPT Interrupt
Definition: ne2000.h:82
UINT NextPacket
Definition: ne2000.h:136
ULONG InterruptVector
Definition: ne2000.h:87
PUCHAR RamBase
Definition: ne2000.h:98
UCHAR SAPROM[16]
Definition: ne2000.h:102
ULONG PacketOffset
Definition: ne2000.h:154
INT TXCurrent
Definition: ne2000.h:166
DRIVER_HARDWARE_ADDRESS PermanentAddress
Definition: ne2000.h:105
ULONG_PTR IoBaseAddress
Definition: ne2000.h:85
KINTERRUPT_MODE InterruptMode
Definition: ne2000.h:89
NDIS_HANDLE MiniportAdapterHandle
Definition: ne2000.h:80
UINT LookaheadSize
Definition: ne2000.h:129
PNDIS_PACKET TXQueueHead
Definition: ne2000.h:169
LIST_ENTRY ListEntry
Definition: ne2000.h:78
ULONG MaxMulticastListSize
Definition: ne2000.h:111
BOOLEAN ShutdownHandlerRegistered
Definition: ne2000.h:181
DRIVER_HARDWARE_ADDRESS StationAddress
Definition: ne2000.h:108
USHORT PacketLength
Definition: 8390.h:142
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PBOOLEAN
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_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:960
_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:870
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET _In_opt_ PWDF_MEMORY_DESCRIPTOR _Out_opt_ PULONG BytesTransferred
Definition: wdfusb.h:1342
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
@ CmResourceShareShared
Definition: cmtypes.h:243