iPXE
|
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <ipxe/io.h>
#include <unistd.h>
#include <ipxe/device.h>
#include <ipxe/isa.h>
#include "3c509.h"
Go to the source code of this file.
Data Structures | |
struct | t509_device |
A 3c509 device. More... | |
Functions | |
FILE_LICENCE (BSD2) | |
static void | t509bus_remove (struct root_device *rootdev) |
Remove 3c509 root bus. More... | |
static void | t509_set_drvdata (struct t509_device *t509, void *priv) |
Set 3c509 driver-private data. More... | |
static void * | t509_get_drvdata (struct t509_device *t509) |
Get 3c509 driver-private data. More... | |
static void | t509_set_id_port (void) |
static void | t509_wait_for_id_sequence (void) |
static void | t509_global_reset (void) |
static void | t509_reset_tag (void) |
static void | t509_set_tag (uint8_t tag) |
static void | t509_select_tag (uint8_t tag) |
static void | t509_activate (uint16_t ioaddr) |
static void | t509_deactivate_and_reset_tag (uint16_t ioaddr) |
static void | t509_load_eeprom_word (uint8_t offset) |
static int | t509_find_id_port (void) |
static void | t509_send_id_sequence (void) |
static uint16_t | t509_id_read_eeprom (int offset) |
static int | t509_isolate (void) |
static void | activate_t509_device (struct t509_device *t509) |
static void | deactivate_t509_device (struct t509_device *t509) |
static int | legacy_t509_probe (struct nic *nic, void *hwdev) |
static void | legacy_t509_disable (struct nic *nic, void *hwdev) |
static void | legacy_t509_set_drvdata (void *hwdev, void *priv) |
static void * | legacy_t509_get_drvdata (void *hwdev) |
static int | t509_probe (struct t509_device *t509) |
Probe a 3c509 device. More... | |
static void | t509_remove (struct t509_device *t509) |
Remove a 3c509 device. More... | |
static int | t509bus_probe (struct root_device *rootdev) |
Probe 3c509 root bus. More... | |
ISA_ROM ("3c509", "3c509") | |
Variables | |
static unsigned int | t509_id_port = 0 |
static unsigned int | t509_max_tag = 0 |
static struct root_driver | t509_root_driver |
3c509 bus root device driver More... | |
struct root_device t509_root_device | __root_device |
3c509 bus root device More... | |
FILE_LICENCE | ( | BSD2 | ) |
|
static |
Remove 3c509 root bus.
rootdev | 3c509 bus root device |
Definition at line 408 of file 3c509.c.
References device::children, root_device::dev, t509_device::dev, free, list_del, list_for_each_entry_safe, device::siblings, t509_remove(), and tmp.
Referenced by t509bus_probe().
|
inlinestatic |
Set 3c509 driver-private data.
t509 | 3c509 device |
priv | Private data |
Definition at line 61 of file 3c509.c.
References t509_device::priv, and priv.
Referenced by legacy_t509_set_drvdata().
|
inlinestatic |
Get 3c509 driver-private data.
t509 | 3c509 device |
priv | Private data |
Definition at line 71 of file 3c509.c.
References t509_device::priv.
Referenced by legacy_t509_get_drvdata().
|
inlinestatic |
Definition at line 80 of file 3c509.c.
References outb, and t509_id_port.
Referenced by t509_find_id_port(), and t509_send_id_sequence().
|
inlinestatic |
Definition at line 84 of file 3c509.c.
References outb, and t509_id_port.
Referenced by deactivate_t509_device(), t509_isolate(), t509_send_id_sequence(), and t509bus_probe().
|
inlinestatic |
|
inlinestatic |
Definition at line 92 of file 3c509.c.
References outb, and t509_id_port.
Referenced by t509_isolate().
|
inlinestatic |
Definition at line 96 of file 3c509.c.
References outb, t509_id_port, and tag.
Referenced by deactivate_t509_device(), and t509_isolate().
|
inlinestatic |
Definition at line 100 of file 3c509.c.
References outb, t509_id_port, and tag.
Referenced by activate_t509_device(), deactivate_t509_device(), t509_isolate(), and t509bus_probe().
|
inlinestatic |
Definition at line 104 of file 3c509.c.
References ioaddr, outb, and t509_id_port.
Referenced by activate_t509_device().
|
inlinestatic |
Definition at line 108 of file 3c509.c.
References EP_COMMAND, GLOBAL_RESET, ioaddr, and outb.
Referenced by deactivate_t509_device().
|
inlinestatic |
Definition at line 112 of file 3c509.c.
References offset, outb, and t509_id_port.
Referenced by t509_id_read_eeprom().
|
inlinestatic |
Definition at line 120 of file 3c509.c.
References DBG, ENOENT, EP_ID_PORT_END, EP_ID_PORT_INC, EP_ID_PORT_START, inb(), outb, t509_id_port, and t509_set_id_port().
Referenced by t509_isolate().
|
static |
Definition at line 143 of file 3c509.c.
References outb, t509_id_port, t509_set_id_port(), and t509_wait_for_id_sequence().
Referenced by activate_t509_device(), deactivate_t509_device(), t509_isolate(), and t509bus_probe().
|
static |
Definition at line 169 of file 3c509.c.
References data, inw(), offset, t509_id_port, t509_load_eeprom_word(), and udelay().
Referenced by t509_isolate(), and t509bus_probe().
|
static |
Definition at line 186 of file 3c509.c.
References DBG, EEPROM_MFG_ID, MFG_ID, rc, t509_find_id_port(), t509_id_port, t509_id_read_eeprom(), t509_max_tag, t509_reset_tag(), t509_select_tag(), t509_send_id_sequence(), t509_set_tag(), and t509_wait_for_id_sequence().
Referenced by t509bus_probe().
|
inlinestatic |
Definition at line 250 of file 3c509.c.
References DBG, t509_device::ioaddr, t509_activate(), t509_select_tag(), t509_send_id_sequence(), and t509_device::tag.
Referenced by legacy_t509_probe().
|
inlinestatic |
Definition at line 265 of file 3c509.c.
References DBG, t509_device::ioaddr, t509_deactivate_and_reset_tag(), t509_select_tag(), t509_send_id_sequence(), t509_set_tag(), t509_wait_for_id_sequence(), t509_device::tag, and udelay().
Referenced by legacy_t509_disable().
|
static |
Definition at line 280 of file 3c509.c.
References activate_t509_device(), t509_device::ioaddr, nic::ioaddr, ISA_PROD_ID, ISA_PROD_ID_MASK, PROD_ID, and t5x9_probe().
Referenced by t509_probe().
|
static |
Definition at line 291 of file 3c509.c.
References deactivate_t509_device(), and t5x9_disable().
Referenced by t509_probe(), and t509_remove().
|
inlinestatic |
Definition at line 298 of file 3c509.c.
References priv, and t509_set_drvdata().
Referenced by t509_probe().
|
inlinestatic |
Definition at line 302 of file 3c509.c.
References t509_get_drvdata().
Referenced by t509_remove().
|
static |
Probe a 3c509 device.
t509 | 3c509 device |
rc | Return status code |
Searches for a driver for the 3c509 device. If a driver is found, its probe() routine is called.
Definition at line 315 of file 3c509.c.
References DBG, t509_device::dev, t509_device::ioaddr, legacy_probe(), legacy_t509_disable(), legacy_t509_probe(), legacy_t509_set_drvdata(), and t509_device::tag.
Referenced by t509bus_probe().
|
static |
Remove a 3c509 device.
t509 | 3c509 device |
Definition at line 327 of file 3c509.c.
References DBG, legacy_remove(), legacy_t509_disable(), legacy_t509_get_drvdata(), and t509_device::tag.
Referenced by t509bus_remove().
|
static |
Probe 3c509 root bus.
rootdev | 3c509 bus root device |
Scans the 3c509 bus for devices and registers all devices it can find.
Definition at line 340 of file 3c509.c.
References device_description::bus_type, BUS_TYPE_ISA, device::children, device::desc, root_device::dev, t509_device::dev, device_description::device, EEPROM_ADDR_CFG, ENOMEM, free, INIT_LIST_HEAD, t509_device::ioaddr, list_add, list_del, malloc(), memset(), MFG_ID, device::name, NULL, device::parent, PROD_ID, rc, device::siblings, snprintf(), t509_id_read_eeprom(), t509_isolate(), t509_max_tag, t509_probe(), t509_select_tag(), t509_send_id_sequence(), t509_wait_for_id_sequence(), t509bus_remove(), tag, t509_device::tag, and device_description::vendor.
ISA_ROM | ( | "3c509" | , |
"3c509" | |||
) |
|
static |
Definition at line 36 of file 3c509.c.
Referenced by t509_activate(), t509_find_id_port(), t509_global_reset(), t509_id_read_eeprom(), t509_isolate(), t509_load_eeprom_word(), t509_reset_tag(), t509_select_tag(), t509_send_id_sequence(), t509_set_id_port(), t509_set_tag(), and t509_wait_for_id_sequence().
|
static |
Definition at line 37 of file 3c509.c.
Referenced by t509_isolate(), and t509bus_probe().
|
static |
3c509 bus root device driver
struct root_device t509_root_device __root_device |
3c509 bus root device