Implemented free hook. The driver now cleanly works when the net_server is restarted via the Network preference panel.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3577 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Niels Sascha Reedijk
2003-06-19 14:52:59 +00:00
parent 5657491aac
commit 93780ea379
2 changed files with 25 additions and 4 deletions
@@ -1,6 +1,4 @@
- A major code cleanup
- Confirm to the Opentracker coding guidelines
- Implement the free_hook
- Support other card types
- Implement support for more than one card
- Fix strange slowness
- Implement support for more than one card
@@ -846,7 +846,8 @@ static status_t
close_hook (void* cookie)
{
rtl8139_properties_t * data = (rtl8139_properties_t *) cookie;
m_pcimodule->write_io_8( data->reg_base + Command , Reset );
//Stop Rx and Tx process
m_pcimodule->write_io_8( data->reg_base + Command , 0 );
m_pcimodule->write_io_16( data->reg_base + IMR , 0 );
return B_OK;
}
@@ -859,6 +860,28 @@ close_hook (void* cookie)
static status_t
rtl8139_free (void* cookie)
{
rtl8139_properties_t *data = (rtl8139_properties_t *) cookie;
dprintf( "rtl8139_nielx free_hook()\n" );
//Remove interrupt handler
remove_io_interrupt_handler( data->pcii->u.h0.interrupt_line ,
rtl8139_interrupt , cookie );
//Free Rx and Tx buffers
delete_area( data->receivebuffer );
delete_area( data->transmitbuffer[0] );
delete_area( data->transmitbuffer[2] );
//Finally, free the cookie
free( data );
//Put the pci module
put_module( B_PCI_MODULE_NAME );
//To conclude: set the status of the device to closed
m_isopen = 0;
return B_OK;
}