#include <driver.h>
Inherited by BazisLib::Linux::UsbDriver.
Public Member Functions | |
virtual LKSTATUS __bzslib_extern | Initialize () |
Initializes the driver. | |
virtual __bzslib_extern | ~Driver () |
Protected Member Functions | |
bool __bzslib_extern | DeregisterDevice (Device *pDevice) |
Deregisters a Linux device from a driver. | |
Static Protected Member Functions | |
static Driver * | GetMainDriver () |
Private Member Functions | |
bool __bzslib_extern | RegisterDevice (Device *pDevice) |
Registers a Linux device within a driver. | |
Private Attributes | |
std::list< Device * > | m_RegisteredDevices |
Friends | |
class | Device |
virtual __bzslib_extern BazisLib::Linux::Driver::~Driver | ( | ) | [virtual] |
bool __bzslib_extern BazisLib::Linux::Driver::DeregisterDevice | ( | Device * | pDevice | ) | [protected] |
Deregisters a Linux device from a driver.
This method should be called only in some special cases when the device object is being deleted before driver unload. An example of such case is the USB driver that deletes its devices when the corresponding physical devices are unplugged from the USB bus.
static Driver* BazisLib::Linux::Driver::GetMainDriver | ( | ) | [static, protected] |
virtual LKSTATUS __bzslib_extern BazisLib::Linux::Driver::Initialize | ( | ) | [inline, virtual] |
Initializes the driver.
This method should perform driver initialization. A typical device driver uses the following initialization sequence: LKSTATUS status; SomeDevice *pDevice = new SomeDevice(...); status = pDevice->RegisterDevice(this); if (!LK_SUCCESS(status)) { delete pDevice; return status; } return SUCCESS;
Reimplemented in BazisLib::Linux::UsbDriver.
bool __bzslib_extern BazisLib::Linux::Driver::RegisterDevice | ( | Device * | pDevice | ) | [private] |
Registers a Linux device within a driver.
This method registers a device within a driver. A driver deletes all its device objects when it is being removed from system (module_cleanup() is called). This method is internally called from the Device::RegisterDevice() routine.
pDevice | Device to register |
friend class Device [friend] |
std::list<Device *> BazisLib::Linux::Driver::m_RegisteredDevices [private] |