34,6 → 34,7 |
*/ |
|
#include <assert.h> |
#include <async.h> |
#include <ddi.h> |
#include <errno.h> |
#include <malloc.h> |
70,14 → 71,14 |
}, |
{ |
.cmd = CMD_PREDICATE, |
.value = 2, |
.value = 1, |
.srcarg = 2 |
}, |
{ .cmd = CMD_PIO_WRITE_8, |
/* { .cmd = CMD_PIO_WRITE_8, |
.addr = NULL, |
.srcarg = 2 |
.value = 0 |
}, |
{ |
*/ { |
.cmd = CMD_ACCEPT |
} |
}; |
141,7 → 142,6 |
|
void irq_handler( ipc_callid_t iid, ipc_call_t * call ) |
{ |
// int irq; |
device_ref device; |
dpeth_t * dep; |
packet_t received; |
148,35 → 148,31 |
device_id_t device_id; |
int phone; |
|
// async_serialize_start(); |
device_id = IRQ_GET_DEVICE( call ); |
// printf( "device %d - irq %x\n", device_id, IPC_GET_ISR( call )); |
rwlock_write_lock( & netif_globals.lock ); |
if( find_device( device_id, & device ) != EOK ){ |
rwlock_write_unlock( & netif_globals.lock ); |
// async_serialize_end() |
return; |
} |
dep = ( dpeth_t * ) device->specific; |
// printf( "dev %d, irq %x\n\n", device->device_id, IPC_GET_ISR( call )); |
if ( dep->de_mode != DEM_ENABLED){ |
// continue; |
rwlock_write_unlock( & netif_globals.lock ); |
// async_serialize_end() |
return; |
} |
assert( dep->de_flags & DEF_ENABLED); |
// irq= dep.de_irq; |
// assert(irq >= 0 && irq < NR_IRQ_VECTORS); |
// if ( dep->de_int_pending || 1) |
// { |
dep->de_int_pending= 0; |
dp_check_ints( dep ); |
// do_int(dep); |
/* r= sys_irqenable(&dep->de_hook); |
if (r != OK) |
{ |
panic("DP8390", |
"unable enable interrupts", r); |
} |
*/// } |
printf( "I%d -%d\n", device_id, IPC_GET_ISR( call )); |
/* putchar( 'I' ); |
putchar( '0' + device_id ); |
putchar( '-' ); |
putchar( '0' + IPC_GET_ISR( call ) / 100 ); |
putchar( '0' + ( IPC_GET_ISR( call ) % 100 ) / 10 ); |
putchar( '0' + IPC_GET_ISR( call ) % 10 ); |
putchar( '\n' ); |
*/ dp_check_ints( dep, IPC_GET_ISR( call )); |
if( dep->received_queue ){ |
received = dep->received_queue; |
phone = device->nil_phone; |
187,6 → 183,7 |
rwlock_write_unlock( & netif_globals.lock ); |
} |
ipc_answer_0( iid, EOK ); |
// async_serialize_end() |
} |
|
int netif_probe_auto_message( void ){ |
236,12 → 233,13 |
dpeth_t * dep; |
packet_t next; |
|
ERROR_PROPAGATE( find_device( device_id, & device )); |
dep = ( dpeth_t * ) device->specific; |
// TODO remove debug dump: |
uint8_t * data; |
data = packet_get_data( packet ); |
printf( "Sending packet:\n\tid\t= %d\n\tlength\t= %d\n\tdata\t= %.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX\n\t\t%.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX:%.2hhX %.2hhX %.2hhX %.2hhX\n", packet_get_id( packet ), packet_get_data_length( packet ), data[ 0 ], data[ 1 ], data[ 2 ], data[ 3 ], data[ 4 ], data[ 5 ], data[ 6 ], data[ 7 ], data[ 8 ], data[ 9 ], data[ 10 ], data[ 11 ], data[ 12 ], data[ 13 ], data[ 14 ], data[ 15 ], data[ 16 ], data[ 17 ], data[ 18 ], data[ 19 ], data[ 20 ], data[ 21 ], data[ 22 ], data[ 23 ], data[ 24 ], data[ 25 ], data[ 26 ], data[ 27 ], data[ 28 ], data[ 29 ], data[ 30 ], data[ 31 ], data[ 32 ], data[ 33 ], data[ 34 ], data[ 35 ], data[ 36 ], data[ 37 ], data[ 38 ], data[ 39 ], data[ 40 ], data[ 41 ], data[ 42 ], data[ 43 ], data[ 44 ], data[ 45 ], data[ 46 ], data[ 47 ], data[ 48 ], data[ 49 ], data[ 50 ], data[ 51 ], data[ 52 ], data[ 53 ], data[ 54 ], data[ 55 ], data[ 56 ], data[ 57 ], data[ 58 ], data[ 59 ] ); |
|
ERROR_PROPAGATE( find_device( device_id, & device )); |
dep = ( dpeth_t * ) device->specific; |
// process packet queue |
do{ |
next = pq_detach( packet ); |
250,6 → 248,7 |
} |
packet = next; |
}while( packet ); |
dp8390_dump( dep ); |
return EOK; |
} |
|