summaryrefslogtreecommitdiffstats
path: root/private/ntos/ndis/ne3200/request.c
blob: 5c294ce9d76fb3a1634d8abe117665d3dcf36370 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
/*++

Copyright (c) 1991  Microsoft Corporation

Module Name:

    request.c

Abstract:

    This file contains code to implement request processing.
    This driver conforms to the NDIS 3.0 miniport interface.

Author:

    Johnson R. Apacible (JohnsonA) 10-June-1991

Environment:

Revision History:

--*/

#include <ne3200sw.h>

extern
NDIS_STATUS
NE3200ChangeClass(
    PNE3200_ADAPTER Adapter,
    IN UINT NewFilterClasses
    )

/*++

Routine Description:

    Action routine that will get called when a particular filter
    class is first used or last cleared.

Arguments:

    NewFilterClasses - The current value of the class filter

Return Value:

    None.


--*/

{
    //
    // Holds the change that should be returned to the filtering package.
    //
    NDIS_STATUS StatusOfChange;

    //
    // Holds the list of changes;
    //
    UINT PacketChanges;

    //
    // This points to the public Command Block.
    //
    PNE3200_SUPER_COMMAND_BLOCK CommandBlock;

    //
    // This points to the adapter's configuration block.
    //
    PNE3200_CONFIGURATION_BLOCK ConfigurationBlock =
                                    Adapter->ConfigurationBlock;

    //
    // The NE3200 has no method for easily disabling multicast
    // packets.  Therefore, we'll only reconfigure the 82586
    // when there is a change in either directed, broadcast, or
    // promiscuous filtering.
    //
    PacketChanges = (Adapter->CurrentPacketFilter ^ NewFilterClasses) &
                     (NDIS_PACKET_TYPE_PROMISCUOUS |
                      NDIS_PACKET_TYPE_BROADCAST |
                      NDIS_PACKET_TYPE_DIRECTED);

    if (!PacketChanges) {

        return(NDIS_STATUS_SUCCESS);

    }

    //
    // Use the generic command block
    //
    IF_LOG('F');

    NE3200AcquirePublicCommandBlock(
                        Adapter,
                        &CommandBlock
                        );

    //
    // This from a set.
    //
    CommandBlock->Set = TRUE;

    //
    // Setup the command block.
    //
    CommandBlock->NextCommand = NULL;

    CommandBlock->Hardware.State = NE3200_STATE_WAIT_FOR_ADAPTER;
    CommandBlock->Hardware.Status = 0;
    CommandBlock->Hardware.NextPending = NE3200_NULL;
    CommandBlock->Hardware.CommandCode =
            NE3200_COMMAND_CONFIGURE_82586;
    CommandBlock->Hardware.PARAMETERS.CONFIGURE.ConfigurationBlock =
            NdisGetPhysicalAddressLow(Adapter->ConfigurationBlockPhysical);

    //
    // Update the configuration block to reflect the new
    // packet filtering.
    //
    if (NewFilterClasses == 0) {

        ConfigurationBlock->PromiscuousMode = 0;
        ConfigurationBlock->MacBinPromiscuous = 0;
        ConfigurationBlock->DisableBroadcast = 1;

    } else {

        ConfigurationBlock->MacBinEnablePacketReception = 1;

        if (PacketChanges & NDIS_PACKET_TYPE_PROMISCUOUS) {

            ConfigurationBlock->PromiscuousMode = 1;
            ConfigurationBlock->MacBinPromiscuous = 1;

        } else {

            ConfigurationBlock->PromiscuousMode = 0;
            ConfigurationBlock->MacBinPromiscuous = 0;

        }

        if (PacketChanges & NDIS_PACKET_TYPE_BROADCAST) {

            ConfigurationBlock->DisableBroadcast = 0;

        } else {

            ConfigurationBlock->DisableBroadcast = 1;

        }

    }

    //
    // Now that we've got the command block built,
    // let's do it!
    //
    NE3200SubmitCommandBlock(Adapter, CommandBlock);

    StatusOfChange = NDIS_STATUS_PENDING;

    return StatusOfChange;
}


STATIC
NDIS_STATUS
NE3200UpdateMulticastTable(
    IN PNE3200_ADAPTER Adapter,
    IN UINT CurrentAddressCount,
    IN CHAR CurrentAddresses[][NE3200_LENGTH_OF_ADDRESS]
    )

/*++

Routine Description:

    This routine is called to update the list of multicast addreses
    on the adapter.

Arguments:

    Adapter - The adapter where the multicast is to be changed.

    CurrentAddressCount - The number of addresses in the address array.

    CurrentAddresses - An array of multicast addresses.  Note that this
    array already contains the new address.

Return Value:

    None.


--*/

{

    //
    // This points to the public Command Block.
    //
    PNE3200_SUPER_COMMAND_BLOCK CommandBlock;

    //
    // Holds the status that should be returned to the filtering package.
    //
    NDIS_STATUS StatusOfUpdate;

    //
    // Multicast address table
    //
    PUCHAR MulticastAddressTable;

    IF_LOG('f');

    //
    // See if we can acquire a private command block.
    //
    NE3200AcquirePublicCommandBlock(Adapter, &CommandBlock);

    //
    // Store the request that uses this command block.
    //
    CommandBlock->Set = TRUE;

    //
    // Get the multicast address table.
    //
    MulticastAddressTable = Adapter->CardMulticastTable;

    //
    // Clear out the old address
    //
    NdisZeroMemory(
            MulticastAddressTable,
            CurrentAddressCount * NE3200_SIZE_OF_MULTICAST_TABLE_ENTRY
            );

    {

        //
        // Simple iteration counter.
        //
        UINT i;

        //
        // Pointer into the multicast address table.
        //
        PCHAR OriginalAddress;

        //
        // Pointer into our temporary buffer.
        //
        PCHAR MungedAddress;

        //
        // Munge the address to 16 bytes per entry.
        //
        OriginalAddress = &CurrentAddresses[0][0];
        MungedAddress = MulticastAddressTable;

        for ( i = CurrentAddressCount ; i > 0 ; i-- ) {

            NdisMoveMemory(
                MungedAddress,
                OriginalAddress,
                NE3200_LENGTH_OF_ADDRESS
                );

            OriginalAddress += NE3200_LENGTH_OF_ADDRESS;
            MungedAddress += NE3200_SIZE_OF_MULTICAST_TABLE_ENTRY;

        }


        //
        // Setup the command block.
        //
        CommandBlock->NextCommand = NULL;

        CommandBlock->Hardware.State = NE3200_STATE_WAIT_FOR_ADAPTER;
        CommandBlock->Hardware.Status = 0;
        CommandBlock->Hardware.NextPending = NE3200_NULL;
        CommandBlock->Hardware.CommandCode = NE3200_COMMAND_SET_MULTICAST_ADDRESS;
        CommandBlock->Hardware.PARAMETERS.MULTICAST.NumberOfMulticastAddresses =
            (USHORT)CurrentAddressCount;

        if (CurrentAddressCount == 0) {

            CommandBlock->Hardware.PARAMETERS.MULTICAST.MulticastAddressTable =
                (NE3200_PHYSICAL_ADDRESS)NULL;

        } else {

            CommandBlock->Hardware.PARAMETERS.MULTICAST.MulticastAddressTable =
                NdisGetPhysicalAddressLow(Adapter->CardMulticastTablePhysical);

        }

        //
        // Now that we've got the command block built,
        // let's do it!
        //
        NE3200SubmitCommandBlock(Adapter, CommandBlock);

        StatusOfUpdate = NDIS_STATUS_PENDING;

    }

    return StatusOfUpdate;

}

extern
NDIS_STATUS
NE3200SetInformation(
    IN NDIS_HANDLE MiniportAdapterContext,
    IN NDIS_OID Oid,
    IN PVOID InformationBuffer,
    IN ULONG InformationBufferLength,
    OUT PULONG BytesRead,
    OUT PULONG BytesNeeded
    )

/*++

Routine Description:

    NE3200SetInformation handles a set operation for a
    single OID.

Arguments:

    MiniportAdapterContext - The adapter that the set is for.

    Oid - The OID of the set.

    InformationBuffer - Holds the data to be set.

    InformationBufferLength - The length of InformationBuffer.

    BytesRead - If the call is successful, returns the number
        of bytes read from InformationBuffer.

    BytesNeeded - If there is not enough data in OvbBuffer
        to satisfy the OID, returns the amount of storage needed.

Return Value:

    NDIS_STATUS_SUCCESS
    NDIS_STATUS_PENDING
    NDIS_STATUS_INVALID_LENGTH
    NDIS_STATUS_INVALID_OID

--*/

{
    //
    // Variable to hold the new packet filter
    //
    ULONG PacketFilter;

    //
    // The adapter to process the request for.
    //
    PNE3200_ADAPTER Adapter = PNE3200_ADAPTER_FROM_CONTEXT_HANDLE(MiniportAdapterContext);

    //
    // Status of NDIS operation
    //
    NDIS_STATUS Status;

    IF_LOG('w');

    //
    // Now check for the most common OIDs
    //
    switch (Oid) {

    case OID_802_3_MULTICAST_LIST:

        if (InformationBufferLength % NE3200_LENGTH_OF_ADDRESS != 0) {

            //
            // The data must be a multiple of the Ethernet
            // address size.
            //
            return(NDIS_STATUS_INVALID_DATA);

        }

        //
        // Now call the routine that does this.
        //
        Status = NE3200UpdateMulticastTable(
                                            Adapter,
                                            InformationBufferLength /
                                                 NE3200_LENGTH_OF_ADDRESS,
                                            InformationBuffer
                                            );

        *BytesRead = InformationBufferLength;
        break;

    case OID_GEN_CURRENT_PACKET_FILTER:

        if (InformationBufferLength != 4) {

            return NDIS_STATUS_INVALID_DATA;

        }

        //
        // Now call the filter package to set the packet filter.
        //
        NdisMoveMemory ((PVOID)&PacketFilter, InformationBuffer, sizeof(ULONG));

        //
        // Verify bits
        //
        if (PacketFilter & (NDIS_PACKET_TYPE_SOURCE_ROUTING |
                            NDIS_PACKET_TYPE_SMT |
                            NDIS_PACKET_TYPE_MAC_FRAME |
                            NDIS_PACKET_TYPE_FUNCTIONAL |
                            NDIS_PACKET_TYPE_ALL_FUNCTIONAL |
                            NDIS_PACKET_TYPE_ALL_MULTICAST |
                            NDIS_PACKET_TYPE_GROUP
                           )) {

            Status = NDIS_STATUS_NOT_SUPPORTED;

            *BytesRead = 4;
            *BytesNeeded = 0;

            break;

        }

        //
        // Submit the change
        //
        Status = NE3200ChangeClass(
                     Adapter,
                     PacketFilter
                     );

        *BytesRead = InformationBufferLength;

        break;

    case OID_GEN_CURRENT_LOOKAHEAD:

        *BytesRead = 4;
        Status = NDIS_STATUS_SUCCESS;
        break;

    default:

        Status = NDIS_STATUS_INVALID_OID;
        break;

    }

    if (Status == NDIS_STATUS_PENDING) {

        Adapter->RequestInProgress = TRUE;

    }

    IF_LOG('W');
    return Status;
}

STATIC
NDIS_STATUS
NE3200QueryInformation(
    IN NDIS_HANDLE MiniportAdapterContext,
    IN NDIS_OID Oid,
    IN PVOID InformationBuffer,
    IN ULONG InformationBufferLength,
    OUT PULONG BytesWritten,
    OUT PULONG BytesNeeded
)

/*++

Routine Description:

    The NE3200QueryInformation process a Query request for
    NDIS_OIDs that are specific about the Driver.

Arguments:

    MiniportAdapterContext - a pointer to the adapter.

    Oid - the NDIS_OID to process.

    InformationBuffer -  a pointer into the
    NdisRequest->InformationBuffer into which store the result of the query.

    InformationBufferLength - a pointer to the number of bytes left in the
    InformationBuffer.

    BytesWritten - a pointer to the number of bytes written into the
    InformationBuffer.

    BytesNeeded - If there is not enough room in the information buffer
    then this will contain the number of bytes needed to complete the
    request.

Return Value:

    The function value is the status of the operation.

--*/

{
    //
    // The command block for getting the statistics from the adapter.
    //
    PNE3200_SUPER_COMMAND_BLOCK CommandBlock;

    //
    // The adapter to process the request for.
    //
    PNE3200_ADAPTER Adapter = PNE3200_ADAPTER_FROM_CONTEXT_HANDLE(MiniportAdapterContext);

    //
    // Save the information about the request
    //
    Adapter->BytesWritten = BytesWritten;
    Adapter->BytesNeeded = BytesNeeded;
    Adapter->Oid = Oid;
    Adapter->InformationBuffer = InformationBuffer;
    Adapter->InformationBufferLength = InformationBufferLength;

    IF_LOG('?');

    //
    // Get a public command block.  This will succeed since
    // the wrapper will only give one request at a time, and
    // there are more than 1 public command block.
    //
    NE3200AcquirePublicCommandBlock(Adapter,
                                    &CommandBlock
                                   );

    //
    // Store the request that uses this CB
    //
    CommandBlock->Set = TRUE;

    //
    // Setup the command block.
    //
    CommandBlock->NextCommand = NULL;

    CommandBlock->Hardware.State = NE3200_STATE_WAIT_FOR_ADAPTER;
    CommandBlock->Hardware.Status = 0;
    CommandBlock->Hardware.NextPending = NE3200_NULL;
    CommandBlock->Hardware.CommandCode = NE3200_COMMAND_READ_ADAPTER_STATISTICS;

    //
    // Now that we're set up, let's do it!
    //
    Adapter->RequestInProgress = TRUE;
    NE3200SubmitCommandBlock(Adapter, CommandBlock);

    //
    // Catch the ball at the interrupt handler
    //

    IF_LOG('/');
    return NDIS_STATUS_PENDING;
}

STATIC
VOID
NE3200FinishQueryInformation(
    IN PNE3200_ADAPTER Adapter
)

/*++

Routine Description:

    The NE3200FinishQueryInformation finish processing a Query request for
    NDIS_OIDs that are specific about the Driver.

Arguments:

    Adapter - a pointer to the adapter.

Return Value:

    The function value is the status of the operation.

--*/

{

static
NDIS_OID NE3200GlobalSupportedOids[] = {
    OID_GEN_SUPPORTED_LIST,
    OID_GEN_HARDWARE_STATUS,
    OID_GEN_MEDIA_SUPPORTED,
    OID_GEN_MEDIA_IN_USE,
    OID_GEN_MAXIMUM_LOOKAHEAD,
    OID_GEN_MAXIMUM_FRAME_SIZE,
    OID_GEN_MAXIMUM_TOTAL_SIZE,
    OID_GEN_MAC_OPTIONS,
    OID_GEN_PROTOCOL_OPTIONS,
    OID_GEN_LINK_SPEED,
    OID_GEN_TRANSMIT_BUFFER_SPACE,
    OID_GEN_RECEIVE_BUFFER_SPACE,
    OID_GEN_TRANSMIT_BLOCK_SIZE,
    OID_GEN_RECEIVE_BLOCK_SIZE,
    OID_GEN_VENDOR_ID,
    OID_GEN_VENDOR_DESCRIPTION,
    OID_GEN_DRIVER_VERSION,
    OID_GEN_CURRENT_PACKET_FILTER,
    OID_GEN_CURRENT_LOOKAHEAD,
    OID_GEN_XMIT_OK,
    OID_GEN_RCV_OK,
    OID_GEN_XMIT_ERROR,
    OID_GEN_RCV_ERROR,
    OID_GEN_RCV_NO_BUFFER,
    OID_GEN_RCV_CRC_ERROR,
    OID_GEN_TRANSMIT_QUEUE_LENGTH,
    OID_802_3_PERMANENT_ADDRESS,
    OID_802_3_CURRENT_ADDRESS,
    OID_802_3_MULTICAST_LIST,
    OID_802_3_MAXIMUM_LIST_SIZE,
    OID_802_3_RCV_ERROR_ALIGNMENT,
    OID_802_3_XMIT_ONE_COLLISION,
    OID_802_3_XMIT_MORE_COLLISIONS,
    OID_802_3_XMIT_DEFERRED,
    OID_802_3_XMIT_MAX_COLLISIONS,
    OID_802_3_RCV_OVERRUN,
    OID_802_3_XMIT_UNDERRUN,
    OID_802_3_XMIT_HEARTBEAT_FAILURE,
    OID_802_3_XMIT_TIMES_CRS_LOST,
    OID_802_3_XMIT_LATE_COLLISIONS
    };

    //
    // Get the saved information about the request.
    //
    PUINT BytesWritten = Adapter->BytesWritten;
    PUINT BytesNeeded = Adapter->BytesNeeded;
    NDIS_OID Oid = Adapter->Oid;
    PVOID InformationBuffer = Adapter->InformationBuffer;
    UINT InformationBufferLength = Adapter->InformationBufferLength;


    //
    // Variables for holding the data that satisfies the request.
    //
    NDIS_MEDIUM Medium = NdisMedium802_3;
    UINT GenericUlong;
    USHORT GenericUShort;
    UCHAR GenericArray[6];
    NDIS_HARDWARE_STATUS HardwareStatus;

    //
    // Common variables for pointing to result of query
    //
    PVOID MoveSource = (PVOID)(&GenericUlong);
    ULONG MoveBytes = sizeof(ULONG);

    //
    // The status of the request.
    //
    NDIS_STATUS Status = NDIS_STATUS_SUCCESS;

    //
    // Initialize the result
    //
    *BytesWritten = 0;
    *BytesNeeded = 0;

    IF_LOG('!');

    //
    // Switch on request type
    //
    switch(Oid){

        case OID_GEN_MAC_OPTIONS:

            GenericUlong = (ULONG)(NDIS_MAC_OPTION_TRANSFERS_NOT_PEND   |
                                   NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA  |
                                   NDIS_MAC_OPTION_RECEIVE_SERIALIZED   |
                                   NDIS_MAC_OPTION_NO_LOOPBACK
                                  );

            break;

        case OID_GEN_SUPPORTED_LIST:

            MoveSource = (PVOID)(NE3200GlobalSupportedOids);
            MoveBytes = sizeof(NE3200GlobalSupportedOids);
            break;

        case OID_GEN_HARDWARE_STATUS:

            if (Adapter->ResetInProgress){

                HardwareStatus = NdisHardwareStatusReset;

            } else {

                HardwareStatus = NdisHardwareStatusReady;

            }


            MoveSource = (PVOID)(&HardwareStatus);
            MoveBytes = sizeof(NDIS_HARDWARE_STATUS);

            break;

        case OID_GEN_MEDIA_SUPPORTED:
        case OID_GEN_MEDIA_IN_USE:

            MoveSource = (PVOID) (&Medium);
            MoveBytes = sizeof(NDIS_MEDIUM);
            break;

        case OID_GEN_MAXIMUM_LOOKAHEAD:
        case OID_GEN_CURRENT_LOOKAHEAD:
        case OID_GEN_MAXIMUM_FRAME_SIZE:

            GenericUlong = (ULONG) (MAXIMUM_ETHERNET_PACKET_SIZE - NE3200_HEADER_SIZE);

            break;

        case OID_GEN_MAXIMUM_TOTAL_SIZE:
        case OID_GEN_TRANSMIT_BLOCK_SIZE:
        case OID_GEN_RECEIVE_BLOCK_SIZE:

            GenericUlong = (ULONG) (MAXIMUM_ETHERNET_PACKET_SIZE);

            break;


        case OID_GEN_LINK_SPEED:

            //
            // 10 Mbps
            //
            GenericUlong = (ULONG)100000;

            break;


        case OID_GEN_TRANSMIT_BUFFER_SPACE:

            GenericUlong = (ULONG) MAXIMUM_ETHERNET_PACKET_SIZE *
                                 NE3200_NUMBER_OF_TRANSMIT_BUFFERS;

            break;

        case OID_GEN_RECEIVE_BUFFER_SPACE:

            GenericUlong = (ULONG) MAXIMUM_ETHERNET_PACKET_SIZE *
                                 NE3200_NUMBER_OF_RECEIVE_BUFFERS;

            break;


        case OID_GEN_VENDOR_ID:

            NdisMoveMemory(
                (PVOID)&GenericUlong,
                Adapter->NetworkAddress,
                3
                );
            GenericUlong &= 0xFFFFFF00;
            MoveSource = (PVOID)(&GenericUlong);
            MoveBytes = sizeof(GenericUlong);
            break;

        case OID_GEN_VENDOR_DESCRIPTION:

            MoveSource = (PVOID)"NE3200 Adapter";
            MoveBytes = 15;
            break;

        case OID_GEN_DRIVER_VERSION:

            GenericUShort = (USHORT)0x0300;

            MoveSource = (PVOID)(&GenericUShort);
            MoveBytes = sizeof(GenericUShort);
            break;

        case OID_802_3_PERMANENT_ADDRESS:

            NdisMoveMemory(
                (PCHAR)GenericArray,
                Adapter->NetworkAddress,
                NE3200_LENGTH_OF_ADDRESS
                );

            MoveSource = (PVOID)(GenericArray);
            MoveBytes = NE3200_LENGTH_OF_ADDRESS;
            break;

        case OID_802_3_CURRENT_ADDRESS:
            NdisMoveMemory(
                (PCHAR)GenericArray,
                Adapter->CurrentAddress,
                NE3200_LENGTH_OF_ADDRESS
                );

            MoveSource = (PVOID)(GenericArray);
            MoveBytes = NE3200_LENGTH_OF_ADDRESS;
            break;

        case OID_802_3_MAXIMUM_LIST_SIZE:

            GenericUlong = (ULONG) NE3200_MAXIMUM_MULTICAST;

            break;

        default:

            switch(Oid){

                case OID_GEN_XMIT_OK:
                    GenericUlong = (ULONG) Adapter->GoodTransmits;
                    break;

                case OID_GEN_RCV_OK:
                        GenericUlong = (ULONG) Adapter->GoodReceives;
                        break;

                case OID_GEN_XMIT_ERROR:
                        GenericUlong = (ULONG) (Adapter->RetryFailure +
                                                Adapter->LostCarrier +
                                                Adapter->UnderFlow +
                                                Adapter->NoClearToSend);
                        break;

                case OID_GEN_RCV_ERROR:
                        GenericUlong = (ULONG) (Adapter->CrcErrors +
                                                Adapter->AlignmentErrors +
                                                Adapter->OutOfResources +
                                                Adapter->DmaOverruns);
                        break;

                case OID_GEN_RCV_NO_BUFFER:
                        GenericUlong = (ULONG) Adapter->OutOfResources;
                        break;

                case OID_GEN_RCV_CRC_ERROR:
                        GenericUlong = (ULONG) Adapter->CrcErrors;
                        break;

                case OID_GEN_TRANSMIT_QUEUE_LENGTH:
                        GenericUlong = (ULONG) Adapter->TransmitsQueued;
                        break;

                case OID_802_3_RCV_ERROR_ALIGNMENT:
                        GenericUlong = (ULONG) Adapter->AlignmentErrors;
                        break;

                case OID_802_3_XMIT_ONE_COLLISION:
                        GenericUlong = (ULONG) Adapter->OneRetry;
                        break;

                case OID_802_3_XMIT_MORE_COLLISIONS:
                        GenericUlong = (ULONG) Adapter->MoreThanOneRetry;
                        break;

                case OID_802_3_XMIT_DEFERRED:
                        GenericUlong = (ULONG) Adapter->Deferred;
                        break;

                case OID_802_3_XMIT_MAX_COLLISIONS:
                        GenericUlong = (ULONG) Adapter->RetryFailure;
                        break;

                case OID_802_3_RCV_OVERRUN:
                        GenericUlong = (ULONG) Adapter->DmaOverruns;
                        break;

                case OID_802_3_XMIT_UNDERRUN:
                        GenericUlong = (ULONG) Adapter->UnderFlow;
                        break;

                case OID_802_3_XMIT_HEARTBEAT_FAILURE:
                        GenericUlong = (ULONG) Adapter->NoClearToSend;
                        break;

                case OID_802_3_XMIT_TIMES_CRS_LOST:
                        GenericUlong = (ULONG) Adapter->LostCarrier;
                        break;

                default:
                    Status = NDIS_STATUS_NOT_SUPPORTED;
                    break;

            }

    }

    if (Status == NDIS_STATUS_SUCCESS) {

        if (MoveBytes > InformationBufferLength) {

            //
            // Not enough room in InformationBuffer. Punt
            //
            *BytesNeeded = MoveBytes;

            Status = NDIS_STATUS_INVALID_LENGTH;

        } else {

            //
            // Copy result into InformationBuffer
            //
            *BytesWritten = MoveBytes;

            if (MoveBytes > 0) {

                NE3200_MOVE_MEMORY(
                        InformationBuffer,
                        MoveSource,
                        MoveBytes
                        );
            }
        }
    }

    Adapter->RequestInProgress = FALSE;

    //
    // Complete the request
    //
    NdisMQueryInformationComplete(
        Adapter->MiniportAdapterHandle,
        Status
        );

    IF_LOG('@');

    return;
}