BazisLib::Linux::Driver Class Reference

#include <driver.h>

Inherited by BazisLib::Linux::UsbDriver.

List of all members.

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 DriverGetMainDriver ()

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


Detailed Description

This class represents a base Linux kernel driver. To implement a real driver, you should create a subclass, override the Initialize() method, and implement the CreateMainDriverInstance() routine. See Driver::Initialize() for further details.

Constructor & Destructor Documentation

virtual __bzslib_extern BazisLib::Linux::Driver::~Driver (  )  [virtual]


Member Function Documentation

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.

Parameters:
pDevice Device to register


Friends And Related Function Documentation

friend class Device [friend]


Member Data Documentation


The documentation for this class was generated from the following file:
SourceForge.net Logo