Changeset d8d8bbd in mainline


Ignore:
Timestamp:
2011-01-06T22:22:37Z (13 years ago)
Author:
martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba21938
Parents:
9cdac5a
Message:

improve ISR handling

Location:
uspace/srv/hw/netif/dp8390
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/netif/dp8390/dp8390.c

    r9cdac5a rd8d8bbd  
    375375}
    376376
    377 void dp_check_ints(int nil_phone, device_id_t device_id, dpeth_t *dep, int isr)
     377static uint8_t isr_acknowledge(dpeth_t *dep)
     378{
     379        uint8_t isr = inb_reg0(dep, DP_ISR) & 0x7f;
     380        if (isr != 0)
     381                outb_reg0(dep, DP_ISR, isr);
     382       
     383        return isr;
     384}
     385
     386void dp_check_ints(int nil_phone, device_id_t device_id, dpeth_t *dep, uint8_t isr)
    378387{
    379388        int tsr;
     
    383392                fprintf(stderr, "dp8390: got premature interrupt\n");
    384393       
    385         for (; isr; isr = inb_reg0(dep, DP_ISR)) {
    386                 outb_reg0(dep, DP_ISR, isr);
    387                
     394        for (; isr != 0; isr = isr_acknowledge(dep)) {
    388395                if (isr & (ISR_PTX | ISR_TXE)) {
    389396                        if (isr & ISR_TXE)
  • uspace/srv/hw/netif/dp8390/dp8390_drv.h

    r9cdac5a rd8d8bbd  
    5656 *  @param[in,out] dep The network interface structure.
    5757 */
    58 void dp_check_ints(int nil_phone, device_id_t device_id, dpeth_t *dep, int isr);
     58void dp_check_ints(int nil_phone, device_id_t device_id, dpeth_t *dep, uint8_t isr);
    5959
    6060/** Probes and initializes the network interface.
  • uspace/srv/hw/netif/dp8390/dp8390_module.c

    r9cdac5a rd8d8bbd  
    9292        },
    9393        {
    94                 .cmd = CMD_PIO_WRITE_8,
     94                .cmd = CMD_PIO_WRITE_A_8,
    9595                .addr = NULL,
    96                 .value = 0xff
     96                .srcarg = 3
    9797        },
    9898        {
Note: See TracChangeset for help on using the changeset viewer.