📄 ee_intr.c,v
字号:
head 1.2;access;symbols;locks; strict;comment @ * @;1.2date 95.02.05.21.44.01; author dls; state Broken;branches;next 1.1;1.1date 94.09.24.01.00.41; author dls; state Works;branches;next ;desc@@1.2log@*** empty log message ***@text@/* ee_intr.c - ee_intr */#include <conf.h>#include <kernel.h>#include <network.h>#include <ee.h>/*------------------------------------------------------------------------ * ee_intr - handle an Intel EtherExpress16 device interrupt *------------------------------------------------------------------------ */intee_intr(){ static int next; struct etdev *ped; int i, csr, status; ped = 0; for (i=0; i<Neth; ++i, ++next) { if (next >= Neth) next = 0; ped = &ee[next]; if ((status = ee_hasintr(ped)) & 0xf000) break; } if (i == Neth) return; csr = ped->ed_pdev->dvcsr; ee_ack(ped, status); if (status & (STAT_CX|STAT_CNA)) ee_xintr(ped); /* * ee_demux can cause a context switch, so must re-enable board * interrupt latch before calling it. */ outb(csr+SIRQ, ped->ed_irq); outb(csr+SIRQ, ped->ed_irq | SIRQ_IEN); if (status & STAT_FR) ee_demux(ped);}/*------------------------------------------------------------------------ * ee_hasintr - return true if this ee device has a pending interrupt *------------------------------------------------------------------------ */intee_hasintr(ped)struct etdev *ped;{ struct scb *pscb = ped->ed_scb; ee_wait(ped); return pscb->scb_status & 0xf000;}/*------------------------------------------------------------------------ * ee_xintr - handle a transmit interrupt on an Intel EtherExpress *------------------------------------------------------------------------ */intee_xintr(ped)struct etdev *ped;{ struct cbl *pcbl = ped->ed_cbl; struct devsw *pdev = ped->ed_pdev; if (!(pcbl->cbl_status & MCSTAT_C)) { kprintf("ee%d: CBL status not complete (%x)\n",pdev->dvminor, pcbl->cbl_status); return; } if ((pcbl->cbl_cmd & EECMD_MASK) == EECMD_MCSET) { signal(ped->ed_cmutex); } else if (pcbl->cbl_status & TSTAT_C) { if (!(pcbl->cbl_status & TSTAT_OK)) { kprintf("ee%d: tranmission error, status %x\n", ped->ed_pdev->dvminor, pcbl->cbl_status); nif[ped->ed_ifnum].ni_oerrors++; } if (scount(ped->ed_cmutex) > 0) { kprintf("ee%d: stray command interrupt (stat %x)\n", pdev->dvminor, pcbl->cbl_status); return; } else signal(ped->ed_cmutex); pcbl->cbl_status = 0; }}@1.1log@Initial revision@text@d70 1d72 8a79 1 if (pcbl->cbl_status & TSTAT_C) {d85 6a90 4 if (!ped->ed_xpending) kprintf("stray transmit interrupt\n"); else ped->ed_xpending--;a92 2 if (lenq(ped->ed_outq)) ee_wstrt(ped);@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -