198,6 → 198,7 |
device = arp_cache_find( & arp_globals.cache, device_id ); |
if( device ){ |
if( device->service != service ){ |
printf( "\nDevice %d already exists", device->device_id ); |
rwlock_write_unlock( & arp_globals.lock ); |
return EEXIST; |
} |
218,7 → 219,7 |
return ERROR_CODE; |
} |
} |
return EOK; |
printf( "\nCache of the existing device %d cleaned", device->device_id ); |
}else{ |
// create a new device |
device = ( arp_device_ref ) malloc( sizeof( arp_device_t )); |
291,6 → 292,7 |
free( device ); |
return ERROR_CODE; |
} |
printf( "\nNew device registered:\n\tid\t= %d\n\ttype\t= %x\n\tservice\t= %d", device->device_id, device->hardware, device->service ); |
} |
rwlock_write_unlock( & arp_globals.lock ); |
return EOK; |
442,6 → 444,7 |
return ENOENT; |
} |
clear_device( device ); |
printf( "\nDevice %d cleared", device_id ); |
rwlock_write_unlock( & arp_globals.lock ); |
return EOK; |
} |
476,7 → 479,8 |
} |
} |
arp_cache_clear( & arp_globals.cache ); |
rwlock_write_lock( & arp_globals.lock ); |
rwlock_write_unlock( & arp_globals.lock ); |
printf( "\nCache cleaned" ); |
return EOK; |
} |
|