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#include "platform.h"
27#include "pc.h"
28#include "pr_pc.h"
29#include "di_defs.h"
30#include "di.h"
31#if !defined USE_EXTENDED_DEBUGS
32#include "dimaint.h"
33#else
34#define dprintf
35#endif
36#include "io.h"
37#include "dfifo.h"
38#define PR_RAM ((struct pr_ram *)0)
39#define RAM ((struct dual *)0)
40
41
42
43void pr_out(ADAPTER *a);
44byte pr_dpc(ADAPTER *a);
45static byte pr_ready(ADAPTER *a);
46static byte isdn_rc(ADAPTER *, byte, byte, byte, word, dword, dword);
47static byte isdn_ind(ADAPTER *, byte, byte, byte, PBUFFER *, byte, word);
48
49
50
51
52
53
54
55
56
57#if defined(XDI_USE_XLOG)
58#define XDI_A_NR(_x_) ((byte)(((ISDN_ADAPTER *)(_x_->io))->ANum))
59static void xdi_xlog(byte *msg, word code, int length);
60static byte xdi_xlog_sec = 0;
61#else
62#define XDI_A_NR(_x_) ((byte)0)
63#endif
64static void xdi_xlog_rc_event(byte Adapter,
65 byte Id, byte Ch, byte Rc, byte cb, byte type);
66static void xdi_xlog_request(byte Adapter, byte Id,
67 byte Ch, byte Req, byte type);
68static void xdi_xlog_ind(byte Adapter,
69 byte Id,
70 byte Ch,
71 byte Ind,
72 byte rnr_valid,
73 byte rnr,
74 byte type);
75
76
77
78void pr_out(ADAPTER *a)
79{
80 byte e_no;
81 ENTITY *this = NULL;
82 BUFFERS *X;
83 word length;
84 word i;
85 word clength;
86 REQ *ReqOut;
87 byte more;
88 byte ReadyCount;
89 byte ReqCount;
90 byte Id;
91 dtrc(dprintf("pr_out"));
92
93 e_no = look_req(a);
94 if (!e_no)
95 {
96 dtrc(dprintf("no_req"));
97 return;
98 }
99 ReadyCount = pr_ready(a);
100 if (!ReadyCount)
101 {
102 dtrc(dprintf("not_ready"));
103 return;
104 }
105 ReqCount = 0;
106 while (e_no && ReadyCount) {
107 next_req(a);
108 this = entity_ptr(a, e_no);
109#ifdef USE_EXTENDED_DEBUGS
110 if (!this)
111 {
112 DBG_FTL(("XDI: [%02x] !A%d ==> NULL entity ptr - try to ignore",
113 xdi_xlog_sec++, (int)((ISDN_ADAPTER *)a->io)->ANum))
114 e_no = look_req(a);
115 ReadyCount--;
116 continue;
117 }
118 {
119 DBG_TRC((">A%d Id=0x%x Req=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, this->Id, this->Req))
120 }
121#else
122 dbug(dprintf("out:Req=%x,Id=%x,Ch=%x", this->Req, this->Id, this->ReqCh));
123#endif
124
125 ReqOut = (REQ *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextReq)];
126#if defined(DIVA_ISTREAM)
127 if (!(a->tx_stream[this->Id] &&
128 this->Req == N_DATA)) {
129#endif
130
131
132 length = 0;
133 i = this->XCurrent;
134 X = PTR_X(a, this);
135 while (i < this->XNum && length < 270) {
136 clength = min((word)(270 - length), (word)(X[i].PLength-this->XOffset));
137 a->ram_out_buffer(a,
138 &ReqOut->XBuffer.P[length],
139 PTR_P(a, this, &X[i].P[this->XOffset]),
140 clength);
141 length += clength;
142 this->XOffset += clength;
143 if (this->XOffset == X[i].PLength) {
144 this->XCurrent = (byte)++i;
145 this->XOffset = 0;
146 }
147 }
148#if defined(DIVA_ISTREAM)
149 } else {
150 i = this->XCurrent;
151 X = PTR_X(a, this);
152 while (i < this->XNum) {
153 diva_istream_write(a,
154 this->Id,
155 PTR_P(a, this, &X[i].P[0]),
156 X[i].PLength,
157 ((i + 1) == this->XNum),
158 0, 0);
159 this->XCurrent = (byte)++i;
160 }
161 length = 0;
162 }
163#endif
164 a->ram_outw(a, &ReqOut->XBuffer.length, length);
165 a->ram_out(a, &ReqOut->ReqId, this->Id);
166 a->ram_out(a, &ReqOut->ReqCh, this->ReqCh);
167
168 if (this->Id & 0x1f) {
169
170
171 this->More++;
172 if (i < this->XNum && this->MInd) {
173 xdi_xlog_request(XDI_A_NR(a), this->Id, this->ReqCh, this->MInd,
174 a->IdTypeTable[this->No]);
175 a->ram_out(a, &ReqOut->Req, this->MInd);
176 more = true;
177 }
178 else {
179 xdi_xlog_request(XDI_A_NR(a), this->Id, this->ReqCh, this->Req,
180 a->IdTypeTable[this->No]);
181 this->More |= XMOREF;
182 a->ram_out(a, &ReqOut->Req, this->Req);
183 more = false;
184 if (a->FlowControlIdTable[this->ReqCh] == this->Id)
185 a->FlowControlSkipTable[this->ReqCh] = true;
186
187
188
189 if (this->Req == REMOVE) {
190 a->misc_flags_table[e_no] |= DIVA_MISC_FLAGS_REMOVE_PENDING;
191 }
192 }
193
194
195 if (more) {
196 req_queue(a, this->No);
197 }
198 }
199
200 else {
201
202 this->MInd = 0;
203 if (this->Id == BLLC_ID) this->MInd = LL_MDATA;
204 if (this->Id == NL_ID ||
205 this->Id == TASK_ID ||
206 this->Id == MAN_ID
207 ) this->MInd = N_MDATA;
208
209 a->IdTypeTable[this->No] = this->Id;
210 xdi_xlog_request(XDI_A_NR(a), this->Id, this->ReqCh, this->Req, this->Id);
211 this->More |= XMOREF;
212 a->ram_out(a, &ReqOut->Req, this->Req);
213
214 assign_queue(a, this->No, a->ram_inw(a, &ReqOut->Reference));
215 }
216 a->ram_outw(a, &PR_RAM->NextReq, a->ram_inw(a, &ReqOut->next));
217 ReadyCount--;
218 ReqCount++;
219 e_no = look_req(a);
220 }
221
222 a->ram_out(a, &PR_RAM->ReqInput,
223 (byte)(a->ram_in(a, &PR_RAM->ReqInput) + ReqCount));
224
225
226 if (this && (this->Req == UREMOVE) && this->Id) {
227 Id = this->Id;
228 e_no = a->IdTable[Id];
229 free_entity(a, e_no);
230 for (i = 0; i < 256; i++)
231 {
232 if (a->FlowControlIdTable[i] == Id)
233 a->FlowControlIdTable[i] = 0;
234 }
235 a->IdTable[Id] = 0;
236 this->Id = 0;
237 }
238}
239static byte pr_ready(ADAPTER *a)
240{
241 byte ReadyCount;
242 ReadyCount = (byte)(a->ram_in(a, &PR_RAM->ReqOutput) -
243 a->ram_in(a, &PR_RAM->ReqInput));
244 if (!ReadyCount) {
245 if (!a->ReadyInt) {
246 a->ram_inc(a, &PR_RAM->ReadyInt);
247 a->ReadyInt++;
248 }
249 }
250 return ReadyCount;
251}
252
253
254
255byte pr_dpc(ADAPTER *a)
256{
257 byte Count;
258 RC *RcIn;
259 IND *IndIn;
260 byte c;
261 byte RNRId;
262 byte Rc;
263 byte Ind;
264
265 if ((Count = a->ram_in(a, &PR_RAM->RcOutput)) != 0) {
266 dtrc(dprintf("#Rc=%x", Count));
267
268 RcIn = (RC *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextRc)];
269
270 while (Count--) {
271 if ((Rc = a->ram_in(a, &RcIn->Rc)) != 0) {
272 dword tmp[2];
273
274
275
276 a->ram_in_buffer(a,
277 &RcIn->Reserved2[0],
278 (byte *)&tmp[0],
279 8);
280
281
282
283 isdn_rc(a,
284 Rc,
285 a->ram_in(a, &RcIn->RcId),
286 a->ram_in(a, &RcIn->RcCh),
287 a->ram_inw(a, &RcIn->Reference),
288 tmp[0],
289 tmp[1]);
290 a->ram_out(a, &RcIn->Rc, 0);
291 }
292
293 RcIn = (RC *)&PR_RAM->B[a->ram_inw(a, &RcIn->next)];
294 }
295
296 a->ram_out(a, &PR_RAM->RcOutput, 0);
297
298 pr_out(a);
299 }
300
301 RNRId = 0;
302
303 if ((Count = a->ram_in(a, &PR_RAM->IndOutput)) != 0) {
304 dtrc(dprintf("#Ind=%x", Count));
305
306 IndIn = (IND *)&PR_RAM->B[a->ram_inw(a, &PR_RAM->NextInd)];
307
308 while (Count--) {
309
310
311
312 if (RNRId && RNRId == a->ram_in(a, &IndIn->IndId)) {
313 a->ram_out(a, &IndIn->Ind, 0);
314 a->ram_out(a, &IndIn->RNR, true);
315 }
316 else {
317 Ind = a->ram_in(a, &IndIn->Ind);
318 if (Ind) {
319 RNRId = 0;
320
321
322
323 c = isdn_ind(a,
324 Ind,
325 a->ram_in(a, &IndIn->IndId),
326 a->ram_in(a, &IndIn->IndCh),
327 &IndIn->RBuffer,
328 a->ram_in(a, &IndIn->MInd),
329 a->ram_inw(a, &IndIn->MLength));
330 if (c == 1) {
331 dtrc(dprintf("RNR"));
332 a->ram_out(a, &IndIn->Ind, 0);
333 RNRId = a->ram_in(a, &IndIn->IndId);
334 a->ram_out(a, &IndIn->RNR, true);
335 }
336 }
337 }
338
339 IndIn = (IND *)&PR_RAM->B[a->ram_inw(a, &IndIn->next)];
340 }
341 a->ram_out(a, &PR_RAM->IndOutput, 0);
342 }
343 return false;
344}
345byte scom_test_int(ADAPTER *a)
346{
347 return a->ram_in(a, (void *)0x3fe);
348}
349void scom_clear_int(ADAPTER *a)
350{
351 a->ram_out(a, (void *)0x3fe, 0);
352}
353
354
355
356static byte isdn_rc(ADAPTER *a,
357 byte Rc,
358 byte Id,
359 byte Ch,
360 word Ref,
361 dword extended_info_type,
362 dword extended_info)
363{
364 ENTITY *this;
365 byte e_no;
366 word i;
367 int cancel_rc;
368#ifdef USE_EXTENDED_DEBUGS
369 {
370 DBG_TRC(("<A%d Id=0x%x Rc=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, Id, Rc))
371 }
372#else
373 dbug(dprintf("isdn_rc(Rc=%x,Id=%x,Ch=%x)", Rc, Id, Ch));
374#endif
375
376 if (Rc == READY_INT) {
377 xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 0, 0);
378 if (a->ReadyInt) {
379 a->ReadyInt--;
380 return 0;
381 }
382 return 2;
383 }
384
385 e_no = a->IdTable[Id];
386 if (e_no) {
387 this = entity_ptr(a, e_no);
388 xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 0, a->IdTypeTable[this->No]);
389 this->RcCh = Ch;
390
391
392 if ((a->misc_flags_table[e_no] & DIVA_MISC_FLAGS_REMOVE_PENDING) &&
393 (Rc == OK)) {
394 if (a->IdTypeTable[e_no] == NL_ID) {
395 if (a->RcExtensionSupported &&
396 (extended_info_type != DIVA_RC_TYPE_REMOVE_COMPLETE)) {
397 dtrc(dprintf("XDI: N-REMOVE, A(%02x) Id:%02x, ignore RC=OK",
398 XDI_A_NR(a), Id));
399 return (0);
400 }
401 if (extended_info_type == DIVA_RC_TYPE_REMOVE_COMPLETE)
402 a->RcExtensionSupported = true;
403 }
404 a->misc_flags_table[e_no] &= ~DIVA_MISC_FLAGS_REMOVE_PENDING;
405 a->misc_flags_table[e_no] &= ~DIVA_MISC_FLAGS_NO_RC_CANCELLING;
406 free_entity(a, e_no);
407 for (i = 0; i < 256; i++)
408 {
409 if (a->FlowControlIdTable[i] == Id)
410 a->FlowControlIdTable[i] = 0;
411 }
412 a->IdTable[Id] = 0;
413 this->Id = 0;
414
415
416
417
418
419
420
421
422 if ((this->More & XMOREC) > 1) {
423 this->More &= ~XMOREC;
424 this->More |= 1;
425 dtrc(dprintf("XDI: correct MORE on REMOVE A(%02x) Id:%02x",
426 XDI_A_NR(a), Id));
427 }
428 }
429 if (Rc == OK_FC) {
430 a->FlowControlIdTable[Ch] = Id;
431 a->FlowControlSkipTable[Ch] = false;
432 this->Rc = Rc;
433 this->More &= ~(XBUSY | XMOREC);
434 this->complete = 0xff;
435 xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]);
436 CALLBACK(a, this);
437 return 0;
438 }
439
440
441
442
443
444
445
446
447
448
449 if (extended_info_type == DIVA_RC_TYPE_OK_FC) {
450 a->misc_flags_table[e_no] |= DIVA_MISC_FLAGS_NO_RC_CANCELLING;
451 this->Rc = Rc;
452 this->complete = 0xff;
453 xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]);
454 DBG_TRC(("XDI OK_FC A(%02x) Id:%02x Ch:%02x Rc:%02x",
455 XDI_A_NR(a), Id, Ch, Rc))
456 CALLBACK(a, this);
457 return 0;
458 }
459 cancel_rc = !(a->misc_flags_table[e_no] & DIVA_MISC_FLAGS_NO_RC_CANCELLING);
460 if (cancel_rc && (a->FlowControlIdTable[Ch] == Id))
461 {
462 a->FlowControlIdTable[Ch] = 0;
463 if ((Rc != OK) || !a->FlowControlSkipTable[Ch])
464 {
465 this->Rc = Rc;
466 if (Ch == this->ReqCh)
467 {
468 this->More &= ~(XBUSY | XMOREC);
469 this->complete = 0xff;
470 }
471 xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]);
472 CALLBACK(a, this);
473 }
474 return 0;
475 }
476 if (this->More & XMOREC)
477 this->More--;
478
479 if (((!cancel_rc) || (this->More & XMOREF)) && !(this->More & XMOREC)) {
480 this->Rc = Rc;
481 this->More &= ~XBUSY;
482 this->complete = 0xff;
483 xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 1, a->IdTypeTable[this->No]);
484 CALLBACK(a, this);
485 }
486 return 0;
487 }
488
489
490 if ((Rc & 0xf0) == ASSIGN_RC) {
491 e_no = get_assign(a, Ref);
492 if (e_no) {
493 this = entity_ptr(a, e_no);
494 this->Id = Id;
495 xdi_xlog_rc_event(XDI_A_NR(a), Id, Ch, Rc, 2, a->IdTypeTable[this->No]);
496
497 this->Rc = Rc;
498 this->More &= ~XBUSY;
499 this->complete = 0xff;
500#if defined(DIVA_ISTREAM)
501 if ((Rc == ASSIGN_OK) && a->ram_offset &&
502 (a->IdTypeTable[this->No] == NL_ID) &&
503 ((extended_info_type == DIVA_RC_TYPE_RX_DMA) ||
504 (extended_info_type == DIVA_RC_TYPE_CMA_PTR)) &&
505 extended_info) {
506 dword offset = (*(a->ram_offset)) (a);
507 dword tmp[2];
508 extended_info -= offset;
509#ifdef PLATFORM_GT_32BIT
510 a->ram_in_dw(a, (void *)ULongToPtr(extended_info), (dword *)&tmp[0], 2);
511#else
512 a->ram_in_dw(a, (void *)extended_info, (dword *)&tmp[0], 2);
513#endif
514 a->tx_stream[Id] = tmp[0];
515 a->rx_stream[Id] = tmp[1];
516 if (extended_info_type == DIVA_RC_TYPE_RX_DMA) {
517 DBG_TRC(("Id=0x%x RxDMA=%08x:%08x",
518 Id, a->tx_stream[Id], a->rx_stream[Id]))
519 a->misc_flags_table[this->No] |= DIVA_MISC_FLAGS_RX_DMA;
520 } else {
521 DBG_TRC(("Id=0x%x CMA=%08x:%08x",
522 Id, a->tx_stream[Id], a->rx_stream[Id]))
523 a->misc_flags_table[this->No] &= ~DIVA_MISC_FLAGS_RX_DMA;
524 a->rx_pos[Id] = 0;
525 a->rx_stream[Id] -= offset;
526 }
527 a->tx_pos[Id] = 0;
528 a->tx_stream[Id] -= offset;
529 } else {
530 a->tx_stream[Id] = 0;
531 a->rx_stream[Id] = 0;
532 a->misc_flags_table[this->No] &= ~DIVA_MISC_FLAGS_RX_DMA;
533 }
534#endif
535 CALLBACK(a, this);
536 if (Rc == ASSIGN_OK) {
537 a->IdTable[Id] = e_no;
538 }
539 else
540 {
541 free_entity(a, e_no);
542 for (i = 0; i < 256; i++)
543 {
544 if (a->FlowControlIdTable[i] == Id)
545 a->FlowControlIdTable[i] = 0;
546 }
547 a->IdTable[Id] = 0;
548 this->Id = 0;
549 }
550 return 1;
551 }
552 }
553 return 2;
554}
555
556
557
558static byte isdn_ind(ADAPTER *a,
559 byte Ind,
560 byte Id,
561 byte Ch,
562 PBUFFER *RBuffer,
563 byte MInd,
564 word MLength)
565{
566 ENTITY *this;
567 word clength;
568 word offset;
569 BUFFERS *R;
570 byte *cma = NULL;
571#ifdef USE_EXTENDED_DEBUGS
572 {
573 DBG_TRC(("<A%d Id=0x%x Ind=0x%x", ((ISDN_ADAPTER *)a->io)->ANum, Id, Ind))
574 }
575#else
576 dbug(dprintf("isdn_ind(Ind=%x,Id=%x,Ch=%x)", Ind, Id, Ch));
577#endif
578 if (a->IdTable[Id]) {
579 this = entity_ptr(a, a->IdTable[Id]);
580 this->IndCh = Ch;
581 xdi_xlog_ind(XDI_A_NR(a), Id, Ch, Ind,
582 0, 0 , a->IdTypeTable[this->No]);
583
584
585 if (this->RCurrent == 0xff) {
586
587 if (Ind == this->MInd) {
588 this->complete = 0;
589 this->Ind = MInd;
590 }
591 else {
592 this->complete = 1;
593 this->Ind = Ind;
594 }
595
596
597 this->RLength = MLength;
598#if defined(DIVA_ISTREAM)
599 if ((a->rx_stream[this->Id] ||
600 (a->misc_flags_table[this->No] & DIVA_MISC_FLAGS_RX_DMA)) &&
601 ((Ind == N_DATA) ||
602 (a->protocol_capabilities & PROTCAP_CMA_ALLPR))) {
603 PISDN_ADAPTER IoAdapter = (PISDN_ADAPTER)a->io;
604 if (a->misc_flags_table[this->No] & DIVA_MISC_FLAGS_RX_DMA) {
605#if defined(DIVA_IDI_RX_DMA)
606 dword d;
607 diva_get_dma_map_entry(\
608 (struct _diva_dma_map_entry *)IoAdapter->dma_map,
609 (int)a->rx_stream[this->Id], (void **)&cma, &d);
610#else
611 cma = &a->stream_buffer[0];
612 cma[0] = cma[1] = cma[2] = cma[3] = 0;
613#endif
614 this->RLength = MLength = (word)*(dword *)cma;
615 cma += 4;
616 } else {
617 int final = 0;
618 cma = &a->stream_buffer[0];
619 this->RLength = MLength = (word)diva_istream_read(a,
620 Id,
621 cma,
622 sizeof(a->stream_buffer),
623 &final, NULL, NULL);
624 }
625 IoAdapter->RBuffer.length = min(MLength, (word)270);
626 if (IoAdapter->RBuffer.length != MLength) {
627 this->complete = 0;
628 } else {
629 this->complete = 1;
630 }
631 memcpy(IoAdapter->RBuffer.P, cma, IoAdapter->RBuffer.length);
632 this->RBuffer = (DBUFFER *)&IoAdapter->RBuffer;
633 }
634#endif
635 if (!cma) {
636 a->ram_look_ahead(a, RBuffer, this);
637 }
638 this->RNum = 0;
639 CALLBACK(a, this);
640
641
642 this = entity_ptr(a, a->IdTable[Id]);
643 xdi_xlog_ind(XDI_A_NR(a), Id, Ch, Ind,
644 1, this->RNR, a->IdTypeTable[this->No]);
645
646 if (this->RNR == 1) {
647 this->RNR = 0;
648 return 1;
649 }
650
651
652
653 if (!this->RNR && !this->RNum) {
654 xdi_xlog_ind(XDI_A_NR(a), Id, Ch, Ind,
655 2, 0, a->IdTypeTable[this->No]);
656 return 0;
657 }
658
659 this->RCurrent = 0;
660 this->ROffset = 0;
661 }
662 if (this->RNR == 2) {
663 if (Ind != this->MInd) {
664 this->RCurrent = 0xff;
665 this->RNR = 0;
666 }
667 return 0;
668 }
669
670
671 offset = 0;
672 R = PTR_R(a, this);
673 do {
674 if (this->ROffset == R[this->RCurrent].PLength) {
675 this->ROffset = 0;
676 this->RCurrent++;
677 }
678 if (cma) {
679 clength = min(MLength, (word)(R[this->RCurrent].PLength-this->ROffset));
680 } else {
681 clength = min(a->ram_inw(a, &RBuffer->length)-offset,
682 R[this->RCurrent].PLength-this->ROffset);
683 }
684 if (R[this->RCurrent].P) {
685 if (cma) {
686 memcpy(PTR_P(a, this, &R[this->RCurrent].P[this->ROffset]),
687 &cma[offset],
688 clength);
689 } else {
690 a->ram_in_buffer(a,
691 &RBuffer->P[offset],
692 PTR_P(a, this, &R[this->RCurrent].P[this->ROffset]),
693 clength);
694 }
695 }
696 offset += clength;
697 this->ROffset += clength;
698 if (cma) {
699 if (offset >= MLength) {
700 break;
701 }
702 continue;
703 }
704 } while (offset < (a->ram_inw(a, &RBuffer->length)));
705
706
707
708 if (Ind != this->MInd) {
709 R[this->RCurrent].PLength = this->ROffset;
710 if (this->ROffset) this->RCurrent++;
711 this->RNum = this->RCurrent;
712 this->RCurrent = 0xff;
713 this->Ind = Ind;
714 this->complete = 2;
715 xdi_xlog_ind(XDI_A_NR(a), Id, Ch, Ind,
716 3, 0, a->IdTypeTable[this->No]);
717 CALLBACK(a, this);
718 }
719 return 0;
720 }
721 return 2;
722}
723#if defined(XDI_USE_XLOG)
724
725
726
727
728static void xdi_xlog(byte *msg, word code, int length) {
729 xdi_dbg_xlog("\x00\x02", msg, code, length);
730}
731#endif
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
757static void xdi_xlog_rc_event(byte Adapter,
758 byte Id, byte Ch, byte Rc, byte cb, byte type) {
759#if defined(XDI_USE_XLOG)
760 word LogInfo[4];
761 PUT_WORD(&LogInfo[0], ((word)Adapter | (word)(xdi_xlog_sec++ << 8)));
762 PUT_WORD(&LogInfo[1], ((word)Id | (word)(Ch << 8)));
763 PUT_WORD(&LogInfo[2], ((word)Rc | (word)(type << 8)));
764 PUT_WORD(&LogInfo[3], cb);
765 xdi_xlog((byte *)&LogInfo[0], 221, sizeof(LogInfo));
766#endif
767}
768
769
770
771
772
773
774
775
776
777
778
779
780
781static void xdi_xlog_request(byte Adapter, byte Id,
782 byte Ch, byte Req, byte type) {
783#if defined(XDI_USE_XLOG)
784 word LogInfo[3];
785 PUT_WORD(&LogInfo[0], ((word)Adapter | (word)(xdi_xlog_sec++ << 8)));
786 PUT_WORD(&LogInfo[1], ((word)Id | (word)(Ch << 8)));
787 PUT_WORD(&LogInfo[2], ((word)Req | (word)(type << 8)));
788 xdi_xlog((byte *)&LogInfo[0], 220, sizeof(LogInfo));
789#endif
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
820static void xdi_xlog_ind(byte Adapter,
821 byte Id,
822 byte Ch,
823 byte Ind,
824 byte rnr_valid,
825 byte rnr,
826 byte type) {
827#if defined(XDI_USE_XLOG)
828 word LogInfo[4];
829 PUT_WORD(&LogInfo[0], ((word)Adapter | (word)(xdi_xlog_sec++ << 8)));
830 PUT_WORD(&LogInfo[1], ((word)Id | (word)(Ch << 8)));
831 PUT_WORD(&LogInfo[2], ((word)Ind | (word)(type << 8)));
832 PUT_WORD(&LogInfo[3], ((word)rnr | (word)(rnr_valid << 8)));
833 xdi_xlog((byte *)&LogInfo[0], 222, sizeof(LogInfo));
834#endif
835}
836