summaryrefslogblamecommitdiffstats
path: root/private/ntos/ndis/htdsu/interrup.c
blob: fad79ce798629b9a094764cc346e87a0fa740fd1 (plain) (tree)
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















































































































































































































































































































































































































































































































































































































































































                                                                                     
/***************************************************************************\
|* Copyright (c) 1994  Microsoft Corporation                               *|
|* Developed for Microsoft by TriplePoint, Inc. Beaverton, Oregon          *|
|*                                                                         *|
|* This file is part of the HT Communications DSU41 WAN Miniport Driver.   *|
\***************************************************************************/
#include "version.h"
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Module Name:

    interrup.c

Abstract:

    This module contains the Miniport interrupt processing routines:
        MiniportCheckForHang()
        MiniportDisableInterrupt()
        MiniportEnableInterrupt()
        MiniportISR()
        MiniportHandleInterrupt()

    This driver conforms to the NDIS 3.0 Miniport interface.

Author:

    Larry Hattery - TriplePoint, Inc. (larryh@tpi.com) Jun-94

Environment:

    Windows NT 3.5 kernel mode Miniport driver or equivalent.

Revision History:

---------------------------------------------------------------------------*/

#define  __FILEID__     3       // Unique file ID for error logging

#include "htdsu.h"


BOOLEAN
HtDsuCheckForHang(
    IN PHTDSU_ADAPTER Adapter
    )

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Functional Description:

    The MiniportCheckForHang request is used by the wrapper to periodically
    have the miniport check if the adapter appears hung.

    The Miniport driver should do nothing more than check the internal state
    and return if the adapter is hung.  The wrapper will then attempt to
    recover the adapter by calling MiniportReset.

    This routine will be called once every two seconds.

    Interrupts will be in any state when called.

Parameters:

    MiniportAdapterContext _ The handle returned from MiniportInitialize.

Return Values:

    TRUE if the driver believes that the underlying hardware is hung,
    FALSE otherwise.

---------------------------------------------------------------------------*/

{
    return (Adapter->NeedReset);
}


VOID
HtDsuDisableInterrupt(
    IN PHTDSU_ADAPTER Adapter
    )

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Functional Description:

    The MiniportDisableInterrupt request is used to disable the adapter
    from generating any interrupts.  Typically this is done by writing a
    mask which disables the adapter from generating hardware interrupts.

    If the underlying hardware does not support enabling and disabling
    interrupts, the Miniport driver will have to register a MiniportISR
    with the wrapper, and the Miniport driver will have to acknowledge
    and save the interrupt information from within the interrupt service
    routine.

    This routine may be called any time interrupts are enabled.  If the
    underlying hardware is required to be in a certain state for this
    routine to execute correctly, the Miniport driver must encapsulate
    all portions of the driver which violate the state and which may be
    called when interrupts are enabled, with a function and call the
    function through the NdisMSynchronizeWithInterrupt service.

    Interrupts will be in any state when called.

Parameters:

    MiniportAdapterContext _ The adapter handle passed to NdisMSetAttributes
                             during MiniportInitialize.

Return Values:

    None.

---------------------------------------------------------------------------*/

{
    DBG_FUNC("HtDsuDisableInterrupt")

    /*
    // Save the current interrupt status on the card.
    */
    USHORT InterruptStatus = CardGetInterrupt(Adapter);

//  DBG_ENTER(Adapter);

    /*
    // Disable the interrupt at the card after saving the current state
    // of the InterruptStatus register -- which will be reset by the clear
    // interrupt command.
    */
    Adapter->InterruptStatusFlag |= InterruptStatus;
    CardClearInterrupt(Adapter);
    CardDisableInterrupt(Adapter);

    DBG_NOTICE(Adapter, ("IntrStatus=%Xh LineStatus=%Xh\n",
               InterruptStatus,
               READ_REGISTER_USHORT(&Adapter->AdapterRam->StatusLine1)
               ));

//  DBG_LEAVE(Adapter);
}


VOID
HtDsuEnableInterrupt(
    IN PHTDSU_ADAPTER Adapter
    )

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Functional Description:

    The MiniportEnableInterrupt request is used to enable the adapter for
    generating any interrupts.  Typically this is done by writing a mask
    which will reenable adapter interrupts.

    If the underlying hardware does not support enabling and disabling
    interrupts, the Miniport driver will have to register a MiniportISR
    with the wrapper, and the Miniport driver will have to acknowledge
    and save the interrupt information from within the interrupt service
    routine.

    Interrupts will be in any state when called.

Parameters:

    MiniportAdapterContext _ The adapter handle passed to NdisMSetAttributes
                             during MiniportInitialize.

Return Values:

    None.

---------------------------------------------------------------------------*/

{
    DBG_FUNC("HtDsuEnableInterrupt")

    /*
    // Save the current interrupt status on the card.
    */
    USHORT InterruptStatus = CardGetInterrupt(Adapter);

//  DBG_ENTER(Adapter);

    CardEnableInterrupt(Adapter);

    DBG_NOTICE(Adapter, ("IntrStatus=%Xh LineStatus=%Xh\n",
               InterruptStatus,
               READ_REGISTER_USHORT(&Adapter->AdapterRam->StatusLine1)
               ));

//  DBG_LEAVE(Adapter);
}



VOID
HtDsuISR(
    OUT PBOOLEAN InterruptRecognized,
    OUT PBOOLEAN QueueMiniportHandleInterrupt,
    IN PHTDSU_ADAPTER Adapter
    )

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Functional Description:

    The MiniportISR request is called if the adapter generates an
    interrupt when there is an outstanding call to MiniportInitialize
    or to MiniportReconfigure, if the Miniport driver supports sharing
    its interrupt line with another adapter, or if the Miniport driver
    specifies that the routine must be called for every interrupt (See
    NdisMRegisterInterrupt's RequestIsr and SharedInterrupt parameters).

    This routine runs immediately after an interrupt, at very high priority,
    and is subject to all the limitations of the interrupt service routine
    in the NDIS 3.0 specification.  The driver should do as little work as
    possible in this routine.  It should return TRUE in the parameter
    InterruptRecognized if it recognizes the interrupt as belonging to its
    adapter, or FALSE otherwise.  It should return TRUE in the parameter
    QueueMiniportHandleInterrupt if it needs a call to MiniportHandleInterrupt
    at a lower priority to complete the handling of the interrupt, or FALSE
    otherwise.

    Note that a Dpc will not be queued if the Miniport is currently executing
    in any of the following routines: MiniportHalt, MiniportInitialize,
    MiniportReconfigure.

Parameters:

    InterruptRecognized _ If the Miniport is sharing an interrupt line, it
                          should set this parameter to TRUE if the Miniport
                          driver recognizes that the interrupt came from the
                          adapter it is supporting.

    QueueMiniportHandleInterrupt _ If the Miniport driver is sharing an
                                   interrupt line, it sets this parameter to
                                   TRUE if the driver needs to have
                                   MiniportHandleInterrupt called.

    MiniportAdapterContext _ The adapter handle passed to NdisMSetAttributes
                             during MiniportInitialize.

Return Values:

    None.

---------------------------------------------------------------------------*/

{
    DBG_FUNC("HtDsuISR")

    /*
    // Save the current interrupt status on the card.
    */
    USHORT InterruptStatus;

    DBG_ENTER(Adapter);

    /*
    // This routine should never be called after initialization since we
    // support the Enable/Disable Interrupt routines.
    */
    if (InterruptStatus = CardGetInterrupt(Adapter))
    {
        /*
        // The adapter prevents the failure case where additional status
        // bits could be set between the time we read the InterruptStatus
        // and it is reset by the clear interrupt command...
        */
        CardClearInterrupt(Adapter);
        Adapter->InterruptStatusFlag |= InterruptStatus;

        /*
        // The card generated an interrupt, we need to service it only if we are
        // interested in it.  In either case it must be dismissed from the card.
        */
        *InterruptRecognized = TRUE;
        *QueueMiniportHandleInterrupt = TRUE;
    }
    else
    {
        /*
        // It's not our interrupt, so we don't need to service anything.
        */
        *InterruptRecognized = FALSE;
    }

    DBG_NOTICE(Adapter, ("IntrStatus=%Xh LineStatus=%Xh\n",
               InterruptStatus,
               READ_REGISTER_USHORT(&Adapter->AdapterRam->StatusLine1)
               ));

    DBG_LEAVE(Adapter);
}


VOID
HtDsuHandleInterrupt(
    IN PHTDSU_ADAPTER Adapter
    )

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Functional Description:

    The MiniportHandleInterrupt routine is called from within a wrapper
    deferred processing routine, and is used to process the reason an
    interrupt was generated.  The Miniport driver should handle all
    outstanding interrupts and start any new operations.

    Interrupts will be disabled during the call to this routine.

Parameters:

    MiniportAdapterContext _ The adapter handle passed to NdisMSetAttributes
                             during MiniportInitialize.

Return Values:

    None.

---------------------------------------------------------------------------*/

{
    DBG_FUNC("HtDsuHandleInterrupt")

    /*
    // A pointer to our link information structure.
    */
    PHTDSU_LINK Link;

    UINT TimeOut;

    NdisAcquireSpinLock(&Adapter->Lock);
    Adapter->InTheDpcHandler = TRUE;

    DBG_ENTER(Adapter);

    /*
    // Loop thru here until all the interrupts are handled.
    // This should not be allowed to take more than a few mili-seconds.
    // If it does, the checked kernel will trap, and you'll have to
    // find a way to leave the DPC early and handle the rest during
    // the next pass.
    */
    while (Adapter->InterruptStatusFlag)
    {
        /********************************************************************
        // Do we have a packet waiting in the adapter?
        */
        if (Adapter->InterruptStatusFlag & (HTDSU_INTR_RX_PACKET1 |
                                            HTDSU_INTR_RX_PACKET2))
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_RX_PACKET\n"));

            Adapter->InterruptStatusFlag &= ~(HTDSU_INTR_RX_PACKET1 |
                                              HTDSU_INTR_RX_PACKET2);
            HtDsuReceivePacket(Adapter);
        }

        /********************************************************************
        // Has the packet been transmitted?
        // Actually, this just means that the DSU firmware has moved the
        // packet from our buffer area to its own buffer to be transmitted.
        // It won't have actually completed until HTDSU_INTR_TX_EMPTY.
        */
        if (Adapter->InterruptStatusFlag & (HTDSU_INTR_TX_PACKET1 |
                                            HTDSU_INTR_TX_PACKET2))
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_TX_PACKET\n"));

            Adapter->InterruptStatusFlag &= ~(HTDSU_INTR_TX_PACKET1 |
                                              HTDSU_INTR_TX_PACKET2);
            HtDsuTransmitComplete(Adapter);
        }

        /********************************************************************
        // Does somebody want to chat?
        */
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_RINGING1)
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_RINGING1\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_RINGING1;

            /*
            // CAVEAT: Normally you don't want to stall execution in your
            // DPC because locks are held and no other threads will run.
            // However, I have seen some hardware/firmware anomallies
            // on the answering side where we get here before the signal
            // is established, so I double check here by waiting up to 100MS.
            */
            TimeOut = 0;
            while (!CardStatusRinging(Adapter, HTDSU_CMD_LINE1) ||
                   CardStatusNoSignal(Adapter, HTDSU_CMD_LINE1))
            {
                if (TimeOut++ > 1000)
                {
                    DBG_ERROR(Adapter,("Timeout waiting for SIGNAL on line 1\n"));
                    break;
                }
                else
                {
                    NdisStallExecution(_100_MICROSECONDS);
                }
            }

            if (TimeOut != 0)
            {
                DBG_WARNING(Adapter, ("Ring1 signal delay=%d*100us\n", TimeOut));
            }

            /*
            // Make sure the ring is still asserted or it may
            // just be noise from the cable being unplugged.
            */
            if (CardStatusRinging(Adapter, HTDSU_CMD_LINE1))
            {
                Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE1);
                HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_RINGING);
            }
            else
            {
                DBG_WARNING(Adapter, ("Ring1 lost - status=%Xh\n",
                    READ_REGISTER_USHORT(&Adapter->AdapterRam->StatusLine1)));
            }
        }
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_RINGING2)
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_RINGING2\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_RINGING2;

            TimeOut = 0;
            while (!CardStatusRinging(Adapter, HTDSU_CMD_LINE2) ||
                   CardStatusNoSignal(Adapter, HTDSU_CMD_LINE2))
            {
                if (TimeOut++ > 100)
                {
                    DBG_ERROR(Adapter,("Timeout waiting for SIGNAL on line 2\n"));
                    break;
                }
                else
                {
                    NdisStallExecution(_100_MICROSECONDS);
                }
            }

            if (TimeOut != 0)
            {
                DBG_WARNING(Adapter, ("Ring2 signal delay=%d*100us\n", TimeOut));
            }

            if (CardStatusRinging(Adapter, HTDSU_CMD_LINE2))
            {
                Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE2);
                HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_RINGING);
            }
            else
            {
                DBG_WARNING(Adapter, ("Ring2 lost - status=%Xh\n",
                    READ_REGISTER_USHORT(&Adapter->AdapterRam->StatusLine2)));
            }
        }

        /********************************************************************
        // Do we have a connection being established?
        */
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_CONNECTED1)
        {

            DBG_NOTICE(Adapter,("HTDSU_INTR_CONNECTED1\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_CONNECTED1;

            /*
            // CAVEAT: Normally you don't want to stall execution in your
            // DPC because locks are held and no other threads will run.
            // However, I have seen some hardware/firmware anomallies
            // on the calling side where we get here before the carrier
            // is established, so I double check here by waiting up to 100MS.
            */
            TimeOut = 0;
            while (!CardStatusCarrierDetect(Adapter, HTDSU_CMD_LINE1) ||
                   !CardStatusOnLine(Adapter, HTDSU_CMD_LINE1))
            {
                if (TimeOut++ > 1000)
                {
                    DBG_ERROR(Adapter,("Timeout waiting for CARRIER/LINE 1\n"));
                    break;
                }
                else
                {
                    NdisStallExecution(_100_MICROSECONDS);
                }
            }

            if (TimeOut != 0)
            {
                DBG_WARNING(Adapter, ("Connect1 carrier delay=%d*100us\n", TimeOut));
            }

            /*
            // Make sure the connection is accompanied by a carrier and
            // an online status, Otherwise, it's probably just cable bounce.
            */
            if (CardStatusCarrierDetect(Adapter, HTDSU_CMD_LINE1) &&
                CardStatusOnLine(Adapter, HTDSU_CMD_LINE1))
            {
                Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE1);
                HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_CONNECTED);
            }
            else
            {
                DBG_WARNING(Adapter, ("Connect1 but not ready - status=%X\n",
                    READ_REGISTER_USHORT(&Adapter->AdapterRam->StatusLine1)));
            }
        }
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_CONNECTED2)
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_CONNECTED2\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_CONNECTED2;

            TimeOut = 0;
            while (!CardStatusCarrierDetect(Adapter, HTDSU_CMD_LINE2) ||
                   !CardStatusOnLine(Adapter, HTDSU_CMD_LINE2))
            {
                if (TimeOut++ > 1000)
                {
                    DBG_ERROR(Adapter,("Timeout waiting for CARRIER/LINE 2\n"));
                    break;
                }
                else
                {
                    NdisStallExecution(_100_MICROSECONDS);
                }
            }

            if (TimeOut != 0)
            {
                DBG_WARNING(Adapter, ("Connect2 carrier delay=%d*100us\n", TimeOut));
            }

            if (CardStatusCarrierDetect(Adapter, HTDSU_CMD_LINE2) &&
                CardStatusOnLine(Adapter, HTDSU_CMD_LINE2))
            {
                Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE2);
                HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_CONNECTED);
            }
            else
            {
                DBG_WARNING(Adapter, ("Connect2 but not ready - status=%X\n",
                    READ_REGISTER_USHORT(&Adapter->AdapterRam->StatusLine2)));
            }
        }

        /********************************************************************
        // Did the other guy hung up on us? -- how rude...
        */
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_DISCONNECTED1)
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_DISCONNECTED1\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_DISCONNECTED1;

            Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE1);
            HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_DISCONNECTED);
        }
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_DISCONNECTED2)
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_DISCONNECTED2\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_DISCONNECTED2;

            Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE2);
            HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_DISCONNECTED);
        }

        /********************************************************************
        // Has the transmitter gone idle?  Ask me if I care...
        */
        if (Adapter->InterruptStatusFlag & (HTDSU_INTR_TX_EMPTY1 |
                                            HTDSU_INTR_TX_EMPTY2))
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_TX_EMPTY\n"));

            Adapter->InterruptStatusFlag &= ~(HTDSU_INTR_TX_EMPTY1 |
                                              HTDSU_INTR_TX_EMPTY2);
        }

        /********************************************************************
        // Maybe somebody unplugged the phone line?
        */
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_NO_SIGNAL1)
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_NO_SIGNAL1\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_NO_SIGNAL1;

            Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE1);
            HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_OUTOFSERVICE);
        }
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_NO_SIGNAL2)
        {
            DBG_NOTICE(Adapter,("HTDSU_INTR_NO_SIGNAL2\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_NO_SIGNAL2;

            Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE2);
            HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_OUTOFSERVICE);
        }

        /********************************************************************
        // What about a receive buffer overrun? -- This better never happen!
        // However, if it does, we'll shut this sucker off til it's reset.
        */
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_RX_FULL1)
        {
            DBG_ERROR(Adapter,("HTDSU_INTR_RX_FULL1\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_RX_FULL1;

            /*
            // Ask for reset, and disable interrupts until we get it.
            */
            Adapter->NeedReset = TRUE;
            Adapter->InterruptEnableFlag = HTDSU_INTR_DISABLE;

            Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE1);
            LinkLineError(Link, WAN_ERROR_BUFFEROVERRUN);
            HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_DISCONNECTED);
        }
        if (Adapter->InterruptStatusFlag & HTDSU_INTR_RX_FULL2)
        {
            DBG_ERROR(Adapter,("HTDSU_INTR_RX_FULL2\n"));

            Adapter->InterruptStatusFlag &= ~HTDSU_INTR_RX_FULL2;

            Adapter->NeedReset = TRUE;
            Adapter->InterruptEnableFlag = HTDSU_INTR_DISABLE;

            Link = GET_LINK_FROM_CARDLINE(Adapter, HTDSU_CMD_LINE2);
            LinkLineError(Link, WAN_ERROR_BUFFEROVERRUN);
            HtTapiLineDevStateHandler(Adapter, Link, LINEDEVSTATE_DISCONNECTED);
        }
    }
    DBG_LEAVE(Adapter);

    Adapter->InTheDpcHandler = FALSE;
    NdisReleaseSpinLock(&Adapter->Lock);
}