![]() |
Max OS 0.3
|
Driver for the AMD AM79C973 Ethernet Controller. More...
#include <amd_am79c973.h>
Public Member Functions | |
| AMD_AM79C973 (hardwarecommunication::PCIDeviceDescriptor *dev) | |
| Constructs a new AMD_AM79C973 Ethernet driver, reads the MAC address and sets up the initialisation block and buffer descriptors. | |
| uint32_t | reset () final |
| This function resets the device. | |
| void | activate () final |
| This function activates the device and starts it (Runs when the driver-manger calls activateAll()) | |
| void | deactivate () final |
| Deactivate the driver. | |
| string | vendor_name () final |
| Get who created the device. | |
| string | device_name () final |
| Get the device name of the driver. | |
| void | handle_interrupt () final |
| This function handles the interrupt for the device. | |
| void | do_send (uint8_t *buffer, uint32_t size) final |
| This function sends a package. | |
| uint64_t | get_media_access_control_address () final |
| This function gets the MAC address. | |
Public Member Functions inherited from MaxOS::drivers::ethernet::EthernetDriver | |
| void | send (uint8_t *buffer, uint32_t size) |
| send data to the network via the driver backend | |
Public Member Functions inherited from MaxOS::drivers::Driver | |
| virtual void | initialise () |
| Initialise the driver. | |
Public Member Functions inherited from MaxOS::common::EventManager< EthernetDriverEvents > | |
| void | connect_event_handler (EventHandler< EthernetDriverEvents > *handler) |
| connect an event handler to the event manager if it is not already connected | |
| void | disconnect_event_handler (EventHandler< EthernetDriverEvents > *handler) |
| disconnect an event handler from the event manager if it is connected | |
| Vector< Event< EthernetDriverEvents > * > | raise_event (Event< EthernetDriverEvents > *event) |
| Calls the on_event function of all the event m_handlers connected to the event manager and returns a list of the results. | |
Public Member Functions inherited from MaxOS::hardwarecommunication::InterruptHandler | |
| virtual system::cpu_status_t * | handle_interrupt (system::cpu_status_t *status) |
| Handles an interrupt and returns the status. | |
Additional Inherited Members | |
Static Public Member Functions inherited from MaxOS::drivers::ethernet::EthernetDriver | |
| static MediaAccessControlAddress | create_media_access_control_address (uint8_t digit1, uint8_t digit2, uint8_t digit3, uint8_t digit4, uint8_t digit5, uint8_t digit6) |
| Create a Media Access Control Address. | |
Protected Member Functions inherited from MaxOS::drivers::ethernet::EthernetDriver | |
| void | fire_data_received (uint8_t *buffer, uint32_t size) |
| Handle the recieved data. | |
| void | fire_data_sent (uint8_t *buffer, uint32_t size) |
| send data | |
Protected Member Functions inherited from MaxOS::hardwarecommunication::InterruptHandler | |
| InterruptHandler (uint8_t interrupt_number, int64_t redirect=-1, uint64_t redirect_index=0) | |
| Creates a new interrupt handler and registers it with the interrupt manager. | |
| ~InterruptHandler () | |
| Destroys the interrupt handler and unregisters it from the interrupt manager. | |
Protected Attributes inherited from MaxOS::common::EventManager< EthernetDriverEvents > | |
| Vector< EventHandler< EthernetDriverEvents > * > | m_handlers |
Protected Attributes inherited from MaxOS::hardwarecommunication::InterruptHandler | |
| uint8_t | m_interrupt_number |
| The interrupt number this handler handles. | |
Driver for the AMD AM79C973 Ethernet Controller.
Definition at line 65 of file amd_am79c973.h.
|
explicit |
Constructs a new AMD_AM79C973 Ethernet driver, reads the MAC address and sets up the initialisation block and buffer descriptors.
MAX OS NET CODE: All the old (this) networking code poorly written and not used, this will be moved to userspace in the future but is kept here as a reference for now.
| dev | The PCI device descriptor for this device |
Definition at line 26 of file amd_am79c973.cpp.
References MaxOS::memory::MemoryManager::kmalloc(), MaxOS::hardwarecommunication::Port16Bit::read(), and MaxOS::hardwarecommunication::Port16Bit::write().
|
finalvirtual |
This function activates the device and starts it (Runs when the driver-manger calls activateAll())
Reimplemented from MaxOS::drivers::Driver.
Definition at line 127 of file amd_am79c973.cpp.
References MaxOS::hardwarecommunication::Port16Bit::read(), and MaxOS::hardwarecommunication::Port16Bit::write().
|
finalvirtual |
Deactivate the driver.
Reimplemented from MaxOS::drivers::Driver.
Definition at line 305 of file amd_am79c973.cpp.
|
finalvirtual |
Get the device name of the driver.
Reimplemented from MaxOS::drivers::Driver.
Definition at line 313 of file amd_am79c973.cpp.
This function sends a package.
| buffer | The buffer to send |
| size | The size of the buffer |
Reimplemented from MaxOS::drivers::ethernet::EthernetDriver.
Definition at line 210 of file amd_am79c973.cpp.
References MaxOS::hardwarecommunication::Port16Bit::write().
|
finalvirtual |
This function gets the MAC address.
Reimplemented from MaxOS::drivers::ethernet::EthernetDriver.
Definition at line 300 of file amd_am79c973.cpp.
|
finalvirtual |
This function handles the interrupt for the device.
Reimplemented from MaxOS::hardwarecommunication::InterruptHandler.
Definition at line 168 of file amd_am79c973.cpp.
References MaxOS::hardwarecommunication::Port16Bit::read(), MaxOS::Logger::WARNING(), and MaxOS::hardwarecommunication::Port16Bit::write().
|
finalvirtual |
This function resets the device.
Reimplemented from MaxOS::drivers::Driver.
Definition at line 155 of file amd_am79c973.cpp.
References MaxOS::hardwarecommunication::Port16Bit::read(), and MaxOS::hardwarecommunication::Port16Bit::write().
|
finalvirtual |
Get who created the device.
Reimplemented from MaxOS::drivers::Driver.
Definition at line 309 of file amd_am79c973.cpp.