ReactOS 0.4.17-dev-1321-g5c122a9
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 */
29static const NDIS_OID MiniportOIDList[] =
30{
59};
60
63
64
66 IN NDIS_HANDLE MiniportAdapterContext)
67/*
68 * FUNCTION: Examines if an adapter has hung
69 * ARGUMENTS:
70 * MiniportAdapterContext = Pointer to adapter context area
71 * RETURNS:
72 * TRUE if the adapter has hung, FALSE if not
73 */
74{
75 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
76
77 return FALSE;
78}
79
80
82 IN NDIS_HANDLE MiniportAdapterContext)
83/*
84 * FUNCTION: Disables interrupts from an adapter
85 * ARGUMENTS:
86 * MiniportAdapterContext = Pointer to adapter context area
87 */
88{
89 NDIS_DbgPrint(MAX_TRACE, ("Called. (MiniportDisableInterrupt).\n"));
90#ifndef NOCARD
91 NICDisableInterrupts((PNIC_ADAPTER)MiniportAdapterContext);
92#endif
93}
94
95
97 IN NDIS_HANDLE MiniportAdapterContext)
98/*
99 * FUNCTION: Enables interrupts from an adapter
100 * ARGUMENTS:
101 * MiniportAdapterContext = Pointer to adapter context area
102 */
103{
104 NDIS_DbgPrint(MAX_TRACE, ("Called. (MiniportEnableInterrupt).\n"));
105#ifndef NOCARD
106 NICEnableInterrupts((PNIC_ADAPTER)MiniportAdapterContext);
107#endif
108}
109
110
112 IN NDIS_HANDLE MiniportAdapterContext)
113/*
114 * FUNCTION: Deallocates resources for and halts an adapter
115 * ARGUMENTS:
116 * MiniportAdapterContext = Pointer to adapter context area
117 */
118{
119 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
120
122
123 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
124#ifndef NOCARD
125 /* Stop the NIC */
126 NICStop(Adapter);
127#endif
128 /* Wait for any DPCs to complete. FIXME: Use something else */
129 NdisStallExecution(250000);
130
131 if (Adapter->InterruptRegistered)
132 /* Deregister interrupt */
134
135 if (Adapter->IOPortRangeRegistered)
136 /* Deregister I/O port range */
138 Adapter->MiniportAdapterHandle,
139 Adapter->IoBaseAddress,
140 0x20,
141 Adapter->IOBase);
142
143 if (Adapter->ShutdownHandlerRegistered)
145
146 /* Remove adapter from global adapter list */
147 if ((&Adapter->ListEntry)->Blink != NULL) {
148 RemoveEntryList(&Adapter->ListEntry);
149 }
150
151 /* Free adapter context area */
152 NdisFreeMemory(Adapter, sizeof(NIC_ADAPTER), 0);
153}
154
155
158 IN PNIC_ADAPTER Adapter,
160{
161 PNDIS_RESOURCE_LIST AssignedResources;
162 UINT BufferSize = 0;
164 UINT i;
165
168 NULL,
169 &BufferSize);
171 return;
172
173 *Status = NdisAllocateMemory((PVOID)&AssignedResources,
175 0,
178 return;
179
182 AssignedResources,
183 &BufferSize);
185 return;
186
187 for (i = 0; i < AssignedResources->Count; i++)
188 {
189 Descriptor = AssignedResources->PartialDescriptors + i;
190 switch (Descriptor->Type)
191 {
193 Adapter->InterruptLevel = Descriptor->u.Interrupt.Level;
194 Adapter->InterruptVector = Descriptor->u.Interrupt.Vector;
195 Adapter->InterruptShared = (Descriptor->ShareDisposition == CmResourceShareShared);
196 Adapter->InterruptMode = Descriptor->Flags & CM_RESOURCE_INTERRUPT_LATCHED ?
198 break;
200 Adapter->IoBaseAddress = Descriptor->u.Port.Start.LowPart;
201 break;
202 }
203 }
204}
205
206VOID
207NTAPI
209{
210 #ifndef NOCARD
212 #endif
213}
214
218 IN PNDIS_MEDIUM MediumArray,
222/*
223 * FUNCTION: Adapter initialization function
224 * ARGUMENTS:
225 * OpenErrorStatus = Address of buffer to place additional status information
226 * SelectedMediumIndex = Address of buffer to place selected medium index
227 * MediumArray = Pointer to an array of NDIS_MEDIUMs
228 * MediaArraySize = Number of elements in MediumArray
229 * MiniportAdapterHandle = Miniport adapter handle assigned by NDIS
230 * WrapperConfigurationContext = Handle used to identify configuration context
231 * RETURNS:
232 * Status of operation
233 */
234{
235 UINT i;
237 PNIC_ADAPTER Adapter;
239 UINT *RegNetworkAddress = 0;
240 UINT RegNetworkAddressLength = 0;
241
243
244 NDIS_DbgPrint(MAX_TRACE, ("Called (Adapter %X).\n", MiniportAdapterHandle));
245
246 /* Search for 802.3 media which is the only one we support */
247 for (i = 0; i < MediumArraySize; i++) {
248 if (MediumArray[i] == NdisMedium802_3)
249 break;
250 }
251
252 if (i == MediumArraySize) {
253 NDIS_DbgPrint(MIN_TRACE, ("No supported media.\n"));
255 }
256
258
259 Status = NdisAllocateMemory((PVOID)&Adapter,
260 sizeof(NIC_ADAPTER),
261 0,
264 NDIS_DbgPrint(MIN_TRACE, ("Insufficient resources.\n"));
265 return Status;
266 }
267
268 NdisZeroMemory(Adapter, sizeof(NIC_ADAPTER));
278
279 /* Query the resources from PnP. */
281
282 /* Get the port, irq, and MAC address from registry if the PnP
283 failed. */
285 {
286 PNDIS_CONFIGURATION_PARAMETER ConfigurationParameter;
288
291 {
295 {
296 NDIS_DbgPrint(MID_TRACE,("NdisReadConfiguration for Irq returned successfully, irq 0x%x\n",
297 ConfigurationParameter->ParameterData.IntegerData));
298 Adapter->InterruptLevel =
299 Adapter->InterruptVector = ConfigurationParameter->ParameterData.IntegerData;
300 }
301
305 {
306 NDIS_DbgPrint(MID_TRACE,("NdisReadConfiguration for Port returned successfully, port 0x%x\n",
307 ConfigurationParameter->ParameterData.IntegerData));
308 Adapter->IoBaseAddress = ConfigurationParameter->ParameterData.IntegerData;
309 }
310
312 }
313 else
314 {
315 NDIS_DbgPrint(MIN_TRACE,("NdisOpenConfiguration returned error 0x%x\n", Status));
316 }
317 }
318
319 /* find the nic */
320 if (!NICCheck(Adapter)) {
321 NDIS_DbgPrint(MID_TRACE, ("No adapter found at (0x%X).\n", Adapter->IoBaseAddress));
322 NdisFreeMemory(Adapter, sizeof(NIC_ADAPTER), 0);
324 } else
325 NDIS_DbgPrint(MID_TRACE, ("Adapter found at (0x%X).\n", Adapter->IoBaseAddress));
326
329 (NDIS_HANDLE)Adapter,
330 FALSE,
332
334 (PVOID*)&Adapter->IOBase,
336 Adapter->IoBaseAddress,
337 0x20);
338
340 NDIS_DbgPrint(MIN_TRACE, ("Cannot register port range. Status (0x%X).\n", Status));
341 MiniportHalt((NDIS_HANDLE)Adapter);
342 return Status;
343 }
344
345 Adapter->IOPortRangeRegistered = TRUE;
346
347 /* Initialize NIC */
348#ifndef NOCARD
349 Status = NICInitialize(Adapter);
351 NDIS_DbgPrint(MIN_TRACE,("No NE2000 or compatible network adapter found at address 0x%X.\n",
352 Adapter->IOBase));
353
354 NDIS_DbgPrint(MID_TRACE, ("Status (0x%X).\n", Status));
355 MiniportHalt((NDIS_HANDLE)Adapter);
356 return Status;
357 }
358
361 {
362 NdisReadNetworkAddress(&Status, (PVOID *)&RegNetworkAddress, &RegNetworkAddressLength, ConfigurationHandle);
363 if(Status == NDIS_STATUS_SUCCESS && RegNetworkAddressLength == DRIVER_LENGTH_OF_ADDRESS)
364 {
365 int i;
366 NDIS_DbgPrint(MID_TRACE,("NdisReadNetworkAddress returned successfully, address %x:%x:%x:%x:%x:%x\n",
367 RegNetworkAddress[0], RegNetworkAddress[1], RegNetworkAddress[2], RegNetworkAddress[3],
368 RegNetworkAddress[4], RegNetworkAddress[5]));
369 for(i = 0; i < DRIVER_LENGTH_OF_ADDRESS; i++)
370 Adapter->StationAddress[i] = RegNetworkAddress[i];
371 }
372
374 }
375
376 if (Status != NDIS_STATUS_SUCCESS || RegNetworkAddressLength != DRIVER_LENGTH_OF_ADDRESS)
377 {
378 int i;
379 for (i = 0; i < DRIVER_LENGTH_OF_ADDRESS; i++)
380 Adapter->StationAddress[i] = Adapter->PermanentAddress[i];
381 }
382
383 NDIS_DbgPrint(MID_TRACE, ("BOARDDATA:\n"));
384 for (i = 0; i < 4; i++) {
385 NDIS_DbgPrint(MID_TRACE, ("%02X %02X %02X %02X\n",
386 Adapter->SAPROM[i*4+0],
387 Adapter->SAPROM[i*4+1],
388 Adapter->SAPROM[i*4+2],
389 Adapter->SAPROM[i*4+3]));
390 }
391
392 /* Setup adapter structure */
393 Adapter->TXStart = ((ULONG_PTR)Adapter->RamBase >> 8);
396 Adapter->TXCurrent = -1;
397 Adapter->PageStart = Adapter->TXStart + Adapter->TXCount;
398 Adapter->PageStop = Adapter->TXStart + (Adapter->RamSize >> 8);
399
400 /* Initialize multicast address mask to accept all */
401 for (i = 0; i < 8; i++)
402 Adapter->MulticastAddressMask[i] = 0xFF;
403
404 /* Setup the NIC */
405 NICSetup(Adapter);
406
407 NDIS_DbgPrint(MID_TRACE, ("TXStart (0x%X) TXCount (0x%X) PageStart (0x%X)\n",
408 Adapter->TXStart,
409 Adapter->TXCount,
410 Adapter->PageStart));
411
412 NDIS_DbgPrint(MID_TRACE, ("PageStop (0x%X) CurrentPage (0x%X) NextPacket (0x%X).\n",
413 Adapter->PageStop,
414 Adapter->CurrentPage,
415 Adapter->NextPacket));
416#endif
417 /* Register the interrupt */
419 &Adapter->Interrupt,
421 Adapter->InterruptVector,
422 Adapter->InterruptLevel,
423 FALSE,
424 Adapter->InterruptShared,
425 Adapter->InterruptMode);
427 NDIS_DbgPrint(MIN_TRACE, ("Cannot register interrupt. Status (0x%X).\n", Status));
428 MiniportHalt((NDIS_HANDLE)Adapter);
429 return Status;
430 }
431
432 Adapter->InterruptRegistered = TRUE;
433#ifndef NOCARD
434 /* Start the NIC */
435 NICStart(Adapter);
436#endif
437
438 /* Register the shutdown handler */
440
442
443 /* Add adapter to the global adapter list */
445
446 NDIS_DbgPrint(MAX_TRACE, ("Leaving.\n"));
447
448 return NDIS_STATUS_SUCCESS;
449}
450
451
453 OUT PBOOLEAN InterruptRecognized,
454 OUT PBOOLEAN QueueMiniportHandleInterrupt,
455 IN NDIS_HANDLE MiniportAdapterContext)
456/*
457 * FUNCTION: Interrupt Service Routine for controlled adapters
458 * ARGUMENTS:
459 * InterruptRecognized = Address of buffer to place wether
460 * the adapter generated the interrupt
461 * QueueMiniportHandleInterrupt = Address of buffer to place wether
462 * MiniportHandleInterrupt should be called
463 * MiniportAdapterContext = Pointer to adapter context area
464 * NOTES:
465 * All pending interrupts are handled
466 */
467{
468 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
469
470 NICDisableInterrupts((PNIC_ADAPTER)MiniportAdapterContext);
471
472 *InterruptRecognized = TRUE;
473 *QueueMiniportHandleInterrupt = TRUE;
474}
475
476
478 IN NDIS_HANDLE MiniportAdapterContext,
479 IN NDIS_OID Oid,
480 IN PVOID InformationBuffer,
481 IN ULONG InformationBufferLength,
483 OUT PULONG BytesNeeded)
484/*
485 * FUNCTION: Handler to process queries
486 * ARGUMENTS:
487 * MiniportAdapterContext = Pointer to adapter context area
488 * Oid = OID code designating query operation
489 * InformationBuffer = Address of return buffer
490 * InformationBufferLength = Length of return buffer
491 * BytesWritten = Address of buffer to place number of bytes returned
492 * BytesNeeded = Address of buffer to place number of bytes needed
493 * in InformationBuffer for specified OID
494 * RETURNS:
495 * Status of operation
496 */
497{
499 const VOID* CopyFrom;
500 UINT CopySize;
501 ULONG GenericULONG;
502 USHORT GenericUSHORT;
504 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
505
506 NDIS_DbgPrint(MAX_TRACE, ("Called. Oid (0x%X).\n", Oid));
507
509 CopyFrom = (PVOID)&GenericULONG;
510 CopySize = sizeof(ULONG);
511
512 switch (Oid) {
514 CopyFrom = MiniportOIDList;
515 CopySize = sizeof(MiniportOIDList);
516 break;
518 GenericULONG = (ULONG)NdisHardwareStatusReady;
519 break;
522 CopyFrom = (PVOID)&Medium;
523 CopySize = sizeof(NDIS_MEDIUM);
524 break;
526 GenericULONG = DRIVER_MAXIMUM_LOOKAHEAD;
527 break;
529 GenericULONG = DRIVER_FRAME_SIZE - DRIVER_HEADER_SIZE;
530 break;
532 GenericULONG = 100000; /* 10Mbps */
533 break;
535 GenericULONG = Adapter->TXCount * DRIVER_BLOCK_SIZE;
536 break;
538 GenericULONG = Adapter->RamSize -
539 (ULONG_PTR)Adapter->RamBase -
540 (Adapter->TXCount * DRIVER_BLOCK_SIZE);
541 break;
543 GenericULONG = DRIVER_BLOCK_SIZE;
544 break;
546 GenericULONG = DRIVER_BLOCK_SIZE;
547 break;
549 NdisMoveMemory(&GenericULONG, &Adapter->PermanentAddress, 3);
550 GenericULONG &= 0xFFFFFF00;
551 GenericULONG |= 0x01;
552 break;
554 CopyFrom = (PVOID)&DRIVER_VENDOR_DESCRIPTION;
555 CopySize = sizeof(DRIVER_VENDOR_DESCRIPTION);
556 break;
558 GenericUSHORT = (USHORT)DRIVER_VENDOR_DRIVER_VERSION;
559 CopyFrom = (PVOID)&GenericUSHORT;
560 CopySize = sizeof(USHORT);
561 break;
563 GenericULONG = Adapter->PacketFilter;
564 break;
566 GenericULONG = Adapter->LookaheadSize;
567 break;
570 CopyFrom = (PVOID)&GenericUSHORT;
571 CopySize = sizeof(USHORT);
572 break;
574 GenericULONG = DRIVER_FRAME_SIZE;
575 break;
577 NDIS_DbgPrint(MID_TRACE, ("OID_GEN_PROTOCOL_OPTIONS.\n"));
579 break;
585 break;
587 GenericULONG = (ULONG)NdisMediaStateConnected;
588 break;
590 GenericULONG = 1;
591 break;
593 CopyFrom = (PVOID)&Adapter->PermanentAddress;
594 CopySize = DRIVER_LENGTH_OF_ADDRESS;
595 break;
597 CopyFrom = (PVOID)&Adapter->StationAddress;
598 CopySize = DRIVER_LENGTH_OF_ADDRESS;
599 break;
601 NDIS_DbgPrint(MID_TRACE, ("OID_802_3_MULTICAST_LIST.\n"));
603 break;
605 GenericULONG = Adapter->MaxMulticastListSize;
606 break;
608 NDIS_DbgPrint(MID_TRACE, ("OID_802_3_MAC_OPTIONS.\n"));
610 break;
612 GenericULONG = NdisPhysicalMedium802_3;
613 break;
614 default:
615 NDIS_DbgPrint(MIN_TRACE, ("Unknown OID (0x%X).\n", Oid));
617 break;
618 }
619
621 if (CopySize > InformationBufferLength) {
622 *BytesNeeded = (CopySize - InformationBufferLength);
623 *BytesWritten = 0;
625 } else {
626 NdisMoveMemory(InformationBuffer, CopyFrom, CopySize);
627 *BytesWritten = CopySize;
628 *BytesNeeded = 0;
629 }
630 }
631
632 NDIS_DbgPrint(MAX_TRACE, ("Leaving. Status is (0x%X).\n", Status));
633
634 return Status;
635}
636
637
640 IN NDIS_HANDLE MiniportAdapterContext,
642/*
643 * FUNCTION: Reconfigures an adapter
644 * ARGUMENTS:
645 * OpenErrorStatus = Address of buffer to place additional status information
646 * MiniportAdapterContext = Pointer to adapter context area
647 * WrapperConfigurationContext = Handle used to identify configuration context
648 * RETURNS:
649 * Status of operation
650 * NOTES:
651 * Never called by NDIS library
652 */
653{
654 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
655
656 return NDIS_STATUS_FAILURE;
657}
658
659
660
662 OUT PBOOLEAN AddressingReset,
663 IN NDIS_HANDLE MiniportAdapterContext)
664/*
665 * FUNCTION: Resets an adapter
666 * ARGUMENTS:
667 * AddressingReset = Address of a buffer to place value indicating
668 * wether NDIS library should call MiniportSetInformation
669 * to restore addressing information
670 * MiniportAdapterContext = Pointer to adapter context area
671 * RETURNS:
672 * Status of operation
673 */
674{
675 NDIS_STATUS NdisStatus = NDIS_STATUS_SUCCESS;
676
677 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
678
679#ifndef NOCARD
680 NdisStatus = NICReset((PNIC_ADAPTER)MiniportAdapterContext);
681#endif
682
683 *AddressingReset = TRUE;
684
685 return NdisStatus;
686}
687
688
690 IN NDIS_HANDLE MiniportAdapterContext,
692 IN UINT Flags)
693/*
694 * FUNCTION: Transmits a packet
695 * ARGUMENTS:
696 * MiniportAdapterContext = Pointer to adapter context area
697 * Packet = Pointer to a packet descriptor specifying
698 * the data to be transmitted
699 * Flags = Specifies optional packet flags
700 * RETURNS:
701 * Status of operation
702 */
703{
704 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
705
707
708#ifndef NOCARD
709 NDIS_DbgPrint(MID_TRACE, ("Queueing packet.\n"));
710
711 /* Queue the packet on the transmit queue */
712 RESERVED(Packet)->Next = NULL;
713 if (Adapter->TXQueueHead == NULL) {
714 Adapter->TXQueueHead = Packet;
715 } else {
716 RESERVED(Adapter->TXQueueTail)->Next = Packet;
717 }
718
719 Adapter->TXQueueTail = Packet;
720
721 /* Transmit the packet */
722 NICTransmit(Adapter);
723
724 return NDIS_STATUS_PENDING;
725#else
726 return NDIS_STATUS_SUCCESS;
727#endif
728}
729
730
732 IN NDIS_HANDLE MiniportAdapterContext,
733 IN NDIS_OID Oid,
734 IN PVOID InformationBuffer,
735 IN ULONG InformationBufferLength,
737 OUT PULONG BytesNeeded)
738/*
739 * FUNCTION: Changes state information in the driver
740 * ARGUMENTS:
741 * MiniportAdapterContext = Pointer to adapter context area
742 * Oid = OID code designating set operation
743 * InformationBuffer = Pointer to buffer with state information
744 * InformationBufferLength = Length of InformationBuffer
745 * BytesRead = Address of buffer to place number of bytes read
746 * BytesNeeded = Address of buffer to place number of extra bytes
747 * needed in InformationBuffer for specified OID
748 * RETURNS:
749 * Status of operation
750 */
751{
752 ULONG GenericULONG;
754 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
755
756 NDIS_DbgPrint(MAX_TRACE, ("Called. Oid (0x%X).\n", Oid));
757
758 switch (Oid) {
760 /* Verify length */
761 if (InformationBufferLength < sizeof(ULONG)) {
762 *BytesRead = 0;
763 *BytesNeeded = sizeof(ULONG) - InformationBufferLength;
765 break;
766 }
767
768 NdisMoveMemory(&GenericULONG, InformationBuffer, sizeof(ULONG));
769 /* Check for properties the driver don't support */
770 if (GenericULONG &
777 *BytesRead = 4;
778 *BytesNeeded = 0;
780 break;
781 }
782
783 Adapter->PacketFilter = GenericULONG;
784
785 /* FIXME: Set filter on hardware */
786
787 break;
789 /* Verify length */
790 if (InformationBufferLength < sizeof(ULONG)) {
791 *BytesRead = 0;
792 *BytesNeeded = sizeof(ULONG) - InformationBufferLength;
794 break;
795 }
796
797 NdisMoveMemory(&GenericULONG, InformationBuffer, sizeof(ULONG));
798 if (GenericULONG > DRIVER_MAXIMUM_LOOKAHEAD)
800 else
801 Adapter->LookaheadSize = GenericULONG;
802 break;
804 /* Verify length. Must be multiple of hardware address length */
805 if ((InformationBufferLength % DRIVER_LENGTH_OF_ADDRESS) != 0) {
806 *BytesRead = 0;
807 *BytesNeeded = 0;
809 break;
810 }
811
812 /* Set new multicast address list */
813 NdisMoveMemory(Adapter->Addresses, InformationBuffer, InformationBufferLength);
814
815 /* FIXME: Update hardware */
816
817 break;
818 default:
819 NDIS_DbgPrint(MIN_TRACE, ("Invalid object ID (0x%X).\n", Oid));
820 *BytesRead = 0;
821 *BytesNeeded = 0;
823 break;
824 }
825
827 *BytesRead = InformationBufferLength;
828 *BytesNeeded = 0;
829 }
830
831 NDIS_DbgPrint(MAX_TRACE, ("Leaving. Status (0x%X).\n", Status));
832
833 return Status;
834}
835
836
840 IN NDIS_HANDLE MiniportAdapterContext,
841 IN NDIS_HANDLE MiniportReceiveContext,
843 IN UINT BytesToTransfer)
844/*
845 * FUNCTION: Transfers data from a received frame into an NDIS packet
846 * ARGUMENTS:
847 * Packet = Address of packet to copy received data into
848 * BytesTransferred = Address of buffer to place number of bytes transmitted
849 * MiniportAdapterContext = Pointer to adapter context area
850 * MiniportReceiveContext = Pointer to receive context area (actually NULL)
851 * ByteOffset = Offset within received packet to begin copying
852 * BytesToTransfer = Number of bytes to copy into packet
853 * RETURNS:
854 * Status of operation
855 */
856{
857 PNDIS_BUFFER DstBuffer;
858 UINT BytesCopied, BytesToCopy, DstSize;
859 ULONG SrcData;
860 PUCHAR DstData;
861 UINT RecvStart;
862 UINT RecvStop;
863 PNIC_ADAPTER Adapter = (PNIC_ADAPTER)MiniportAdapterContext;
864
865 NDIS_DbgPrint(MAX_TRACE, ("Called. Packet (0x%X) ByteOffset (0x%X) BytesToTransfer (%d).\n",
866 Packet, ByteOffset, BytesToTransfer));
867
868 if (BytesToTransfer == 0) {
869 *BytesTransferred = 0;
870 return NDIS_STATUS_SUCCESS;
871 }
872
873 RecvStart = Adapter->PageStart * DRIVER_BLOCK_SIZE;
874 RecvStop = Adapter->PageStop * DRIVER_BLOCK_SIZE;
875
876 NdisQueryPacket(Packet, NULL, NULL, &DstBuffer, NULL);
877 NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize);
878
879 SrcData = Adapter->PacketOffset + sizeof(DISCARD_HEADER) + ByteOffset;
880 if (ByteOffset + sizeof(DISCARD_HEADER) + BytesToTransfer >
881 Adapter->PacketHeader.PacketLength)
882 BytesToTransfer = Adapter->PacketHeader.PacketLength -
883 sizeof(DISCARD_HEADER) - ByteOffset;
884
885 /* Start copying the data */
886 BytesCopied = 0;
887 for (;;) {
888 BytesToCopy = (DstSize < BytesToTransfer) ? DstSize : BytesToTransfer;
889 if (SrcData + BytesToCopy > RecvStop)
890 BytesToCopy = (RecvStop - SrcData);
891
892 NICReadData(Adapter, DstData, SrcData, BytesToCopy);
893
895 SrcData += BytesToCopy;
896 DstData = (PUCHAR)((ULONG_PTR) DstData + BytesToCopy);
897 BytesToTransfer -= BytesToCopy;
898 if (BytesToTransfer == 0)
899 break;
900
901 DstSize -= BytesToCopy;
902 if (DstSize == 0) {
903 /* No more bytes in destination buffer. Proceed to
904 the next buffer in the destination buffer chain */
905 NdisGetNextBuffer(DstBuffer, &DstBuffer);
906 if (!DstBuffer)
907 break;
908
909 NdisQueryBuffer(DstBuffer, (PVOID)&DstData, &DstSize);
910 }
911
912 if (SrcData == RecvStop)
913 SrcData = RecvStart;
914 }
915
916 NDIS_DbgPrint(MID_TRACE, ("Transferred (%d) bytes.\n", BytesToTransfer));
917
919
920 return NDIS_STATUS_SUCCESS;
921}
922
923
925NTAPI
929/*
930 * FUNCTION: Main driver entry point
931 * ARGUMENTS:
932 * DriverObject = Pointer to a driver object for this driver
933 * RegistryPath = Registry node for configuration parameters
934 * RETURNS:
935 * Status of driver initialization
936 */
937{
939 NDIS_HANDLE NdisWrapperHandle;
941
942 NDIS_DbgPrint(MAX_TRACE, ("Called.\n"));
943
944 NdisZeroMemory(&Miniport, sizeof(Miniport));
945 Miniport.MajorNdisVersion = DRIVER_NDIS_MAJOR_VERSION;
946 Miniport.MinorNdisVersion = DRIVER_NDIS_MINOR_VERSION;
947 Miniport.CheckForHangHandler = MiniportCheckForHang;
948 Miniport.DisableInterruptHandler = MiniportDisableInterrupt;
949 Miniport.EnableInterruptHandler = MiniportEnableInterrupt;
950 Miniport.HaltHandler = MiniportHalt;
951 Miniport.HandleInterruptHandler = MiniportHandleInterrupt;
952 Miniport.InitializeHandler = MiniportInitialize;
953 Miniport.ISRHandler = MiniportISR;
954 Miniport.QueryInformationHandler = MiniportQueryInformation;
955 Miniport.ReconfigureHandler = MiniportReconfigure;
956 Miniport.ResetHandler = MiniportReset;
957 Miniport.SendHandler = MiniportSend;
958 Miniport.SetInformationHandler = MiniportSetInformation;
959 Miniport.TransferDataHandler = MiniportTransferData;
960
961 NdisMInitializeWrapper(&NdisWrapperHandle,
964 NULL);
965
966 if (!NdisWrapperHandle) {
967 NDIS_DbgPrint(MIN_TRACE, ("NdisMInitializeWrapper() failed\n"));
968 return STATUS_UNSUCCESSFUL;
969 }
970
971 DriverInfo.NdisWrapperHandle = NdisWrapperHandle;
974
975 Status = NdisMRegisterMiniport(NdisWrapperHandle,
976 &Miniport,
979 NDIS_DbgPrint(MIN_TRACE, ("NdisMRegisterMiniport() failed with status code (0x%X).\n", Status));
980 NdisTerminateWrapper(NdisWrapperHandle, NULL);
981 return STATUS_UNSUCCESSFUL;
982 }
983
984 return STATUS_SUCCESS;
985}
986
987#if 0
988 /* while i'm here - some basic registry sanity checks */
989 {
990 /* write tests */
992
993 ParameterValue.ParameterType = NdisParameterInteger;
994 ParameterValue.ParameterData.IntegerData = 0x12345678;
995 NdisInitUnicodeString(&Keyword, L"DwordTest");
997
999 {
1000 DbgPrint("ne2000!MiniportInitialize: failed to set DwordTest: 0x%x\n", Status);
1001 DbgBreakPoint();
1002 }
1003
1004 DbgPrint("ne2000!MiniportInitialize: DwordTest successfully set\n");
1005
1006 NdisInitUnicodeString(&Keyword, L"StringTest");
1007 ParameterValue.ParameterType = NdisParameterString;
1008 NdisInitUnicodeString(&ParameterValue.ParameterData.StringData, L"Testing123");
1009
1011
1013 {
1014 DbgPrint("ne2000!MiniportInitialize: failed to set StringTest: 0x%x\n", Status);
1015 DbgBreakPoint();
1016 }
1017
1018 DbgPrint("ne2000!MiniportInitialize: StringTest successfully set\n");
1019 }
1020
1021 {
1022 /* read back the test values */
1024
1025 NdisInitUnicodeString(&Keyword, L"DwordTest");
1027
1029 {
1030 DbgPrint("ne2000!MiniportInitialize: failed to read DwordTest: 0x%x\n", Status);
1031 DbgBreakPoint();
1032 }
1033
1034 if(ParameterValue->ParameterData.IntegerData != 0x12345678)
1035 {
1036 DbgPrint("ne2000!MiniportInitialize: DwordTest value is wrong: 0x%x\n",
1037 ParameterValue->ParameterData.IntegerData);
1038 DbgBreakPoint();
1039 }
1040
1041 DbgPrint("ne2000!MiniportInitialize: DwordTest value was correctly read\n");
1042
1043 NdisInitUnicodeString(&Keyword, L"StringTest");
1045
1047 {
1048 DbgPrint("ne2000!MiniportInitialize: failed to read StringTest: 0x%x\n", Status);
1049 DbgBreakPoint();
1050 }
1051
1052 if(wcsncmp(ParameterValue->ParameterData.StringData.Buffer, L"Testing123",
1053 wcslen(L"Testing123")))
1054 {
1055 DbgPrint("ne2000!MiniportInitialize: StringTest value is wrong: %wZ\n",
1056 &ParameterValue->ParameterData.StringData);
1057 DbgBreakPoint();
1058 }
1059
1060 DbgPrint("ne2000!MiniportInitialize: StringTest value was correctly read\n");
1061 }
1062
1063#endif
1064
1065/* EOF */
struct _DISCARD_HEADER DISCARD_HEADER
#define NICEnableInterrupts(Adapter)
Definition: 8390.h:164
#define NICDisableInterrupts(Adapter)
Definition: 8390.h:159
unsigned char BOOLEAN
Definition: actypes.h:127
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
_In_ ULONG BufferSize
Definition: dispmprt.h:490
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
Definition: dispmprt.h:245
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:523
DRIVER_INITIALIZE DriverEntry
Definition: main.c:9
#define L(x)
Definition: resources.c:13
#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 const NDIS_OID MiniportOIDList[]
Definition: main.c:29
static VOID NTAPI MiniportEnableInterrupt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:96
VOID NTAPI MiniportShutdown(PVOID Context)
Definition: main.c:208
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:731
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:215
static VOID NTAPI MiniportISR(OUT PBOOLEAN InterruptRecognized, OUT PBOOLEAN QueueMiniportHandleInterrupt, IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:452
static VOID NTAPI MiniportHalt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:111
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:837
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:477
static VOID NTAPI MiniportDisableInterrupt(IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:81
static BOOLEAN NTAPI MiniportCheckForHang(IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:65
static NDIS_STATUS NTAPI MiniportReset(OUT PBOOLEAN AddressingReset, IN NDIS_HANDLE MiniportAdapterContext)
Definition: main.c:661
static VOID NTAPI MiQueryResources(OUT PNDIS_STATUS Status, IN PNIC_ADAPTER Adapter, IN NDIS_HANDLE WrapperConfigurationContext)
Definition: main.c:156
DRIVER_INFORMATION DriverInfo
Definition: main.c:61
NDIS_PHYSICAL_ADDRESS HighestAcceptableMax
Definition: main.c:62
static NDIS_STATUS NTAPI MiniportSend(IN NDIS_HANDLE MiniportAdapterContext, IN PNDIS_PACKET Packet, IN UINT Flags)
Definition: main.c:689
static NDIS_STATUS NTAPI MiniportReconfigure(OUT PNDIS_STATUS OpenErrorStatus, IN NDIS_HANDLE MiniportAdapterContext, IN NDIS_HANDLE WrapperConfigurationContext)
Definition: main.c:638
VOID EXPORT NdisCloseConfiguration(IN NDIS_HANDLE ConfigurationHandle)
Definition: config.c:193
VOID EXPORT NdisWriteConfiguration(OUT PNDIS_STATUS Status, IN NDIS_HANDLE ConfigurationHandle, IN PNDIS_STRING Keyword, IN PNDIS_CONFIGURATION_PARAMETER ParameterValue)
Definition: config.c:102
VOID EXPORT NdisReadNetworkAddress(OUT PNDIS_STATUS Status, OUT PVOID *NetworkAddress, OUT PUINT NetworkAddressLength, IN NDIS_HANDLE ConfigurationHandle)
Definition: config.c:757
VOID EXPORT NdisOpenConfiguration(OUT PNDIS_STATUS Status, OUT PNDIS_HANDLE ConfigurationHandle, IN NDIS_HANDLE WrapperConfigurationContext)
Definition: config.c:254
VOID EXPORT NdisReadConfiguration(_At_(*Status, _Must_inspect_result_) _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:441
VOID EXPORT NdisMQueryAdapterResources(OUT PNDIS_STATUS Status, IN NDIS_HANDLE WrapperConfigurationContext, OUT PNDIS_RESOURCE_LIST ResourceList, IN OUT PUINT BufferSize)
Definition: hardware.c:155
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:1092
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:111
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:24
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
unsigned int UINT
Definition: sysinfo.c:13
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Definition: kse.h:81
#define NdisGetNextBuffer(CurrentBuffer, NextBuffer)
Definition: ndis.h:3388
#define NDIS_STATUS_PENDING
Definition: ndis.h:347
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1551
@ NdisParameterInteger
Definition: ndis.h:928
@ NdisParameterString
Definition: ndis.h:930
@ NdisParameterHexInteger
Definition: ndis.h:929
#define NdisInterruptLatched
Definition: ndis.h:923
#define NdisZeroMemory(Destination, Length)
Definition: ndis.h:3928
unsigned int * PUINT
Definition: ndis.h:50
#define NdisMSetAttributes(MiniportAdapterHandle, MiniportAdapterContext, BusMaster, AdapterType)
Definition: ndis.h:5738
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:3595
#define NDIS_STATUS_NOT_SUPPORTED
Definition: ndis.h:479
#define NDIS_PACKET_TYPE_MAC_FRAME
Definition: ndis.h:674
#define NdisInterruptLevelSensitive
Definition: ndis.h:922
#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:3173
#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:6013
#define NdisStallExecution
Definition: ndis.h:4455
#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:3170
#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:6015
@ NdisInterfaceIsa
Definition: ndis.h:903
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _In_ NDIS_HANDLE WrapperConfigurationContext
Definition: ndis.h:3948
_In_ NDIS_HANDLE MiniportAdapterHandle
Definition: ndis.h:4670
#define NDIS_PACKET_TYPE_SMT
Definition: ndis.h:669
#define NdisQueryBuffer(_Buffer, _VirtualAddress, _Length)
Definition: ndis.h:3031
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE ConfigurationHandle
Definition: ndis.h:3947
#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:4418
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS OpenErrorStatus
Definition: ndis.h:6011
#define NDIS_STATUS_ADAPTER_NOT_FOUND
Definition: ndis.h:470
#define NdisMInitializeWrapper(NdisWrapperHandle, SystemSpecific1, SystemSpecific2, SystemSpecific3)
Definition: ndis.h:5594
#define NDIS_PHYSICAL_ADDRESS_CONST(Low, High)
Definition: ndis.h:3868
#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:3898
#define DRIVER_VENDOR_DESCRIPTION
Definition: ne2000.h:36
#define RESERVED(Packet)
Definition: ne2000.h:67
#define DRIVER_HEADER_SIZE
Definition: ne2000.h:40
#define DRIVER_DEFAULT_INTERRUPT_MODE
Definition: ne2000.h:32
struct _NIC_ADAPTER * PNIC_ADAPTER
#define DRIVER_MAXIMUM_LOOKAHEAD
Definition: ne2000.h:44
#define DRIVER_MAX_MULTICAST_LIST_SIZE
Definition: ne2000.h:34
BOOLEAN NICCheck(PNIC_ADAPTER Adapter)
Definition: 8390.c:53
#define DRIVER_FRAME_SIZE
Definition: ne2000.h:39
VOID NICTransmit(PNIC_ADAPTER Adapter)
Definition: 8390.c:1124
#define DRIVER_DEFAULT_INTERRUPT_SHARED
Definition: ne2000.h:31
#define DRIVER_DEFAULT_INTERRUPT_NUMBER
Definition: ne2000.h:30
#define DRIVER_DEFAULT_TX_BUFFER_COUNT
Definition: ne2000.h:51
#define DRIVER_INTERRUPT_MASK
Definition: ne2000.h:55
NDIS_STATUS NICStop(PNIC_ADAPTER Adapter)
Definition: 8390.c:451
#define DRIVER_NDIS_MAJOR_VERSION
Definition: ne2000.h:26
VOID NICReadData(PNIC_ADAPTER Adapter, PUCHAR Target, ULONG_PTR Source, USHORT Length)
Definition: 8390.c:791
#define DRIVER_LENGTH_OF_ADDRESS
Definition: ne2000.h:41
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:37
#define DRIVER_BLOCK_SIZE
Definition: ne2000.h:47
#define DRIVER_NDIS_MINOR_VERSION
Definition: ne2000.h:27
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:29
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:2722
VOID EXPORT NdisTerminateWrapper(IN NDIS_HANDLE NdisWrapperHandle, IN PVOID SystemSpecific)
Definition: miniport.c:3097
enum _NDIS_MEDIUM NDIS_MEDIUM
#define OID_GEN_TRANSMIT_BLOCK_SIZE
Definition: ntddndis.h:261
#define OID_GEN_PROTOCOL_OPTIONS
Definition: ntddndis.h:269
#define OID_GEN_MAXIMUM_TOTAL_SIZE
Definition: ntddndis.h:268
#define OID_GEN_VENDOR_DRIVER_VERSION
Definition: ntddndis.h:273
@ NdisPhysicalMedium802_3
Definition: ntddndis.h:237
#define OID_802_3_PERMANENT_ADDRESS
Definition: ntddndis.h:321
#define OID_GEN_LINK_SPEED
Definition: ntddndis.h:258
#define OID_GEN_VENDOR_ID
Definition: ntddndis.h:263
#define OID_GEN_CURRENT_PACKET_FILTER
Definition: ntddndis.h:265
@ NdisMediaStateConnected
Definition: ntddndis.h:491
#define OID_GEN_PHYSICAL_MEDIUM
Definition: ntddndis.h:283
#define OID_GEN_RECEIVE_BUFFER_SPACE
Definition: ntddndis.h:260
#define OID_802_3_MAXIMUM_LIST_SIZE
Definition: ntddndis.h:324
#define OID_GEN_DRIVER_VERSION
Definition: ntddndis.h:267
#define OID_802_3_MAC_OPTIONS
Definition: ntddndis.h:325
#define OID_802_3_CURRENT_ADDRESS
Definition: ntddndis.h:322
enum _NDIS_MEDIUM * PNDIS_MEDIUM
#define OID_802_3_MULTICAST_LIST
Definition: ntddndis.h:323
#define OID_GEN_TRANSMIT_BUFFER_SPACE
Definition: ntddndis.h:259
#define OID_GEN_MEDIA_SUPPORTED
Definition: ntddndis.h:254
@ NdisMedium802_3
Definition: ntddndis.h:191
#define OID_GEN_MAXIMUM_FRAME_SIZE
Definition: ntddndis.h:257
#define OID_GEN_MEDIA_IN_USE
Definition: ntddndis.h:255
#define OID_GEN_MEDIA_CONNECT_STATUS
Definition: ntddndis.h:271
#define OID_GEN_MAXIMUM_LOOKAHEAD
Definition: ntddndis.h:256
int NDIS_STATUS
Definition: ntddndis.h:496
@ NdisHardwareStatusReady
Definition: ntddndis.h:471
#define OID_GEN_CURRENT_LOOKAHEAD
Definition: ntddndis.h:266
#define OID_GEN_MAC_OPTIONS
Definition: ntddndis.h:270
#define OID_GEN_VENDOR_DESCRIPTION
Definition: ntddndis.h:264
#define OID_GEN_SUPPORTED_LIST
Definition: ntddndis.h:252
ULONG NDIS_OID
Definition: ntddndis.h:249
#define OID_GEN_RECEIVE_BLOCK_SIZE
Definition: ntddndis.h:262
#define OID_GEN_MAXIMUM_SEND_PACKETS
Definition: ntddndis.h:272
#define OID_GEN_HARDWARE_STATUS
Definition: ntddndis.h:253
unsigned short USHORT
Definition: pedump.c:61
#define CmResourceTypePort
Definition: restypes.h:104
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: restypes.h:117
#define CmResourceTypeInterrupt
Definition: restypes.h:105
#define STATUS_SUCCESS
Definition: shellext.h:65
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: restypes.h:100
NDIS_HANDLE NdisMacHandle
Definition: ne2000.h:185
LIST_ENTRY AdapterListHead
Definition: ne2000.h:186
NDIS_HANDLE NdisWrapperHandle
Definition: ne2000.h:184
union _NDIS_CONFIGURATION_PARAMETER::@2557 ParameterData
ULONG InterruptLevel
Definition: ne2000.h:83
ULONG PacketFilter
Definition: ne2000.h:123
UINT TXFree
Definition: ne2000.h:159
UINT CurrentPage
Definition: ne2000.h:132
PACKET_HEADER PacketHeader
Definition: ne2000.h:148
ULONG InterruptMask
Definition: ne2000.h:117
UINT PageStart
Definition: ne2000.h:130
UINT PageStop
Definition: ne2000.h:131
UINT RamSize
Definition: ne2000.h:96
BOOLEAN InterruptRegistered
Definition: ne2000.h:177
PUCHAR IOBase
Definition: ne2000.h:89
BOOLEAN InterruptShared
Definition: ne2000.h:85
UCHAR MulticastAddressMask[8]
Definition: ne2000.h:114
BOOLEAN IOPortRangeRegistered
Definition: ne2000.h:176
PNDIS_PACKET TXQueueTail
Definition: ne2000.h:168
UINT TXCount
Definition: ne2000.h:158
DRIVER_HARDWARE_ADDRESS Addresses[DRIVER_MAX_MULTICAST_LIST_SIZE]
Definition: ne2000.h:111
UINT TXStart
Definition: ne2000.h:157
NDIS_MINIPORT_INTERRUPT Interrupt
Definition: ne2000.h:79
UINT NextPacket
Definition: ne2000.h:133
ULONG InterruptVector
Definition: ne2000.h:84
PUCHAR RamBase
Definition: ne2000.h:95
UCHAR SAPROM[16]
Definition: ne2000.h:99
ULONG PacketOffset
Definition: ne2000.h:151
INT TXCurrent
Definition: ne2000.h:163
DRIVER_HARDWARE_ADDRESS PermanentAddress
Definition: ne2000.h:102
ULONG_PTR IoBaseAddress
Definition: ne2000.h:82
KINTERRUPT_MODE InterruptMode
Definition: ne2000.h:86
NDIS_HANDLE MiniportAdapterHandle
Definition: ne2000.h:77
UINT LookaheadSize
Definition: ne2000.h:126
PNDIS_PACKET TXQueueHead
Definition: ne2000.h:166
LIST_ENTRY ListEntry
Definition: ne2000.h:75
ULONG MaxMulticastListSize
Definition: ne2000.h:108
BOOLEAN ShutdownHandlerRegistered
Definition: ne2000.h:178
DRIVER_HARDWARE_ADDRESS StationAddress
Definition: ne2000.h:105
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
_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
NTSYSAPI void WINAPI DbgBreakPoint(void)
@ CmResourceShareShared
Definition: cmtypes.h:243