#include "../drivers.h"#include <stdlib.h>#include <minix/com.h>#include <net/hton.h>#include <net/gen/ether.h>#include <net/gen/eth_io.h>#include "assert.h"#include "local.h"#include "dp8390.h"Include dependency graph for dp8390.c:

Go to the source code of this file.
Data Structures | |
| struct | dp_conf |
Defines | |
| #define | DE_PORT_NR 3 |
| #define | CR_EXTRA CR_STA |
Typedefs | |
| typedef dp_conf | dp_conf_t |
Functions | |
| _PROTOTYPE (static void pci_conf,(void)) | |
| _PROTOTYPE (static void do_vwrite,(message *mp, int from_int, int vectored)) | |
| _PROTOTYPE (static void do_vread,(message *mp, int vectored)) | |
| _PROTOTYPE (static void do_init,(message *mp)) | |
| _PROTOTYPE (static void do_int,(dpeth_t *dep)) | |
| _PROTOTYPE (static void dp_getblock,(dpeth_t *dep, int page, size_t offset, size_t size, void *dst)) | |
| _PROTOTYPE (static int dp_pkt2user,(dpeth_t *dep, int page, int length)) | |
| _PROTOTYPE (static void dp_user2nic,(dpeth_t *dep, iovec_dat_t *iovp, vir_bytes offset, int nic_addr, vir_bytes count)) | |
| _PROTOTYPE (static void dp_nic2user,(dpeth_t *dep, int nic_addr, iovec_dat_t *iovp, vir_bytes offset, vir_bytes count)) | |
| _PROTOTYPE (static void dp_next_iovec,(iovec_dat_t *iovp)) | |
| _PROTOTYPE (static void update_conf,(dpeth_t *dep, dp_conf_t *dcp)) | |
| _PROTOTYPE (static int calc_iovec_size,(iovec_dat_t *iovp)) | |
| _PROTOTYPE (static void reply,(dpeth_t *dep, int err, int may_block)) | |
| _PROTOTYPE (static void mess_reply,(message *req, message *reply)) | |
| _PROTOTYPE (static void get_userdata,(int user_proc, vir_bytes user_addr, vir_bytes count, void *loc_addr)) | |
| _PROTOTYPE (static void insb,(port_t port, void *buf, size_t size)) | |
| _PROTOTYPE (static void do_vir_insb,(port_t port, int proc, vir_bytes buf, size_t size)) | |
| int | main (int argc, char *argv[]) |
| static void | dp8390_stop () |
| static void | pci_conf () |
| static void | do_vwrite (message *mp, int from_int, int vectored) |
| static void | do_vread (message *mp, int vectored) |
| static void | do_init (message *mp) |
| static void | do_int (dpeth_t *dep) |
| static void | do_getstat (message *mp) |
| static void | do_getname (message *mp) |
| static void | do_stop (message *mp) |
| static void | dp_init (dpeth_t *dep) |
| static void | dp_confaddr (dpeth_t *dep) |
| static void | dp_reinit (dpeth_t *dep) |
| static void | dp_reset (dpeth_t *dep) |
| static void | dp_check_ints (dpeth_t *dep) |
| static void | dp_recv (dpeth_t *dep) |
| static void | dp_send (dpeth_t *dep) |
| static void | dp_getblock (dpeth_t *dep, int page, size_t offset, size_t size, void *dst) |
| static void | dp_pio8_getblock (dpeth_t *dep, int page, size_t offset, size_t size, void *dst) |
| static void | dp_pio16_getblock (dpeth_t *dep, int page, size_t offset, size_t size, void *dst) |
| static int | dp_pkt2user (dpeth_t *dep, int page, int length) |
| static void | dp_user2nic (dpeth_t *dep, iovec_dat_t *iovp, vir_bytes offset, int nic_addr, vir_bytes count) |
| static void | dp_pio8_user2nic (dpeth_t *dep, iovec_dat_t *iovp, vir_bytes offset, int nic_addr, vir_bytes count) |
| static void | dp_pio16_user2nic (dpeth_t *dep, iovec_dat_t *iovp, vir_bytes offset, int nic_addr, vir_bytes count) |
| static void | dp_nic2user (dpeth_t *dep, int nic_addr, iovec_dat_t *iovp, vir_bytes offset, vir_bytes count) |
| static void | dp_pio8_nic2user (dpeth_t *dep, int nic_addr, iovec_dat_t *iovp, vir_bytes offset, vir_bytes count) |
| static void | dp_pio16_nic2user (dpeth_t *dep, int nic_addr, iovec_dat_t *iovp, vir_bytes offset, vir_bytes count) |
| static void | dp_next_iovec (iovec_dat_t *iovp) |
| static void | conf_hw (dpeth_t *dep) |
| static void | update_conf (dpeth_t *dep, dp_conf_t *dcp) |
| static int | calc_iovec_size (iovec_dat_t *iovp) |
| static void | reply (dpeth_t *dep, int err, int may_block) |
| static void | mess_reply (message *req, message *reply_mess) |
| static void | get_userdata (int user_proc, vir_bytes user_addr, vir_bytes count, void *loc_addr) |
| static void | put_userdata (int user_proc, vir_bytes user_addr, vir_bytes count, void *loc_addr) |
| u8_t | inb (port_t port) |
| u16_t | inw (port_t port) |
| void | outb (port_t port, u8_t value) |
| void | outw (port_t port, u16_t value) |
| static void | insb (port_t port, void *buf, size_t size) |
| static void | insw (port_t port, void *buf, size_t size) |
| static void | do_vir_insb (port_t port, int proc, vir_bytes buf, size_t size) |
| static void | do_vir_insw (port_t port, int proc, vir_bytes buf, size_t size) |
| static void | do_vir_outsb (port_t port, int proc, vir_bytes buf, size_t size) |
| static void | do_vir_outsw (port_t port, int proc, vir_bytes buf, size_t size) |
Variables | |
| static dpeth_t | de_table [DE_PORT_NR] |
| static u16_t | eth_ign_proto |
| static char * | progname |
| dp_conf_t | dp_conf [] |
| int | ___dummy [DE_PORT_NR==sizeof(dp_conf)/sizeof(dp_conf[0])?1:-1] |
|
|
Definition at line 104 of file dp8390.c. Referenced by do_vwrite(), dp_check_ints(), dp_recv(), and dp_reinit(). |
|
|
Definition at line 61 of file dp8390.c. Referenced by do_dump(), do_getstat(), do_init(), do_stop(), do_vread(), do_vwrite(), and main(). |
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
Definition at line 1783 of file dp8390.c. References dp_next_iovec(), IOVEC_NR, and size. Referenced by do_vread(), and do_vwrite(). |
|
|
Definition at line 1700 of file dp8390.c. References dpeth::de_mode, de_table, DEF_EMPTY, DEM_DISABLED, DEM_ENABLED, el2_probe(), ne_probe(), printf, update_conf(), and wdeth_probe(). Referenced by do_init(). |
|
|
Definition at line 667 of file dp8390.c. References DL_NAME_REPLY, OK, panic, progname, r, send, and strncpy(). Referenced by main(). |
|
|
Definition at line 634 of file dp8390.c. References assert, dpeth::de_client, dpeth::de_flags, dpeth::de_mode, dpeth::de_stat, de_table, DEM_ENABLED, DEM_SINK, DP_CNTR0, DP_CNTR1, DP_CNTR2, eth_stat::ets_CRCerr, eth_stat::ets_frameAll, eth_stat::ets_missedP, FALSE, inb_reg0, OK, panic, put_userdata(), and reply. Referenced by main(). |
|
|
Definition at line 550 of file dp8390.c. References assert, conf_hw(), dpeth::de_address, dpeth::de_client, dpeth::de_flags, dpeth::de_mode, de_table, DEF_BROAD, DEF_MULTI, DEF_PROMISC, DEM_DISABLED, DEM_ENABLED, DEM_SINK, DL_BROAD_REQ, DL_INIT_REPLY, DL_MULTI_REQ, DL_PROMISC_REQ, dp_confaddr(), dp_init(), dp_reinit(), ether_addr::ea_addr, ENXIO, message::m_type, mess_reply(), pci_conf(), and strncpy(). Referenced by main(). |
|
|
Definition at line 624 of file dp8390.c. References DEF_PACK_RECV, DEF_PACK_SEND, OK, reply, and TRUE. Referenced by hw_init(). |
|
|
Definition at line 683 of file dp8390.c. References assert, CR_DM_ABORT, CR_STP, dpeth::de_flags, dpeth::de_mode, dpeth::de_stopf, de_table, DEF_EMPTY, DEM_ENABLED, DEM_SINK, DP_CR, outb_reg0, and panic. Referenced by dp8390_stop(), lance_stop(), and main(). |
|
||||||||||||||||||||
|
Definition at line 1944 of file dp8390.c. References DIO_BYTE, DIO_INPUT, OK, panic, r, and sys_sdevio(). Referenced by dp_pio8_nic2user(), and insb(). |
|
||||||||||||||||||||
|
Definition at line 1953 of file dp8390.c. References DIO_INPUT, DIO_WORD, OK, panic, r, and sys_sdevio(). Referenced by dp_pio16_nic2user(), and insw(). |
|
||||||||||||||||||||
|
Definition at line 1962 of file dp8390.c. References DIO_BYTE, DIO_OUTPUT, OK, panic, r, and sys_sdevio(). Referenced by dp_pio8_user2nic(). |
|
||||||||||||||||||||
|
Definition at line 1971 of file dp8390.c. References DIO_OUTPUT, DIO_WORD, OK, panic, r, and sys_sdevio(). Referenced by dp_pio16_user2nic(). |
|
||||||||||||
|
Definition at line 482 of file dp8390.c. References assert, count, dpeth::de_client, dpeth::de_flags, dpeth::de_mode, dpeth::de_read_iovec, de_table, dpeth::de_tmp_iovec, DEF_READING, DEF_STOPPED, DEM_ENABLED, DEM_SINK, dp_recv(), dp_reset(), ETH_MAX_PACK_SIZE_TAGGED, FALSE, get_userdata(), iovec_dat::iod_iovec, iovec_dat::iod_iovec_addr, iovec_dat::iod_iovec_s, iovec_dat::iod_proc_nr, iovec_t::iov_addr, iovec_t::iov_size, IOVEC_NR, NO_NUM, OK, panic, reply, and size. Referenced by main(). |
|
||||||||||||||||
|
|
Definition at line 312 of file dp8390.c. References de_table, DEM_ENABLED, DL_STOP, do_stop(), and message::m_type. |
|
|
Definition at line 918 of file dp8390.c. References assert, CR_EXTRA, CR_TXP, debug, DEF_READING, DEF_SEND_AVAIL, DEF_STOPPED, DP_CNTR0, DP_CNTR1, DP_CNTR2, DP_CR, DP_ISR, dp_recv(), dp_send(), DP_TBCR0, DP_TBCR1, DP_TPSR, DP_TSR, inb_reg0, ISR_CNT, ISR_OVW, ISR_PRX, ISR_PTX, ISR_RDC, ISR_RST, ISR_RXE, ISR_TXE, NO_NUM, outb_reg0, panic, printf, printW, size, TSR_ABT, TSR_CDH, TSR_COL, TSR_CRS, TSR_DFR, TSR_FU, TSR_OWC, and TSR_PTX. |
|
|
Definition at line 836 of file dp8390.c. References de_table, env_parse(), EP_SET, if(), strcat(), and strcpy(). |
|
||||||||||||||||||||||||
|
Definition at line 1173 of file dp8390.c. References BIOS_SEG, D, DP_PAGESIZE, OK, panic, r, SELF, and sys_vircopy(). |
|
|
Definition at line 710 of file dp8390.c. References CR_DM_ABORT, CR_PS_P0, CR_PS_P1, CR_STA, CR_STP, DCR_8BYTES, DCR_BMS, DCR_BYTEWIDE, DCR_WORDWIDE, debug, DEF_BROAD, DEF_EMPTY, DEF_MULTI, DEF_PROMISC, DP_BNRY, DP_CNTR0, DP_CNTR1, DP_CNTR2, dp_confaddr(), DP_CR, DP_CURR, DP_DCR, DP_IMR, DP_ISR, DP_MAR0, DP_MAR1, DP_MAR2, DP_MAR3, DP_MAR4, DP_MAR5, DP_MAR6, DP_MAR7, DP_PAR0, DP_PAR1, DP_PAR2, DP_PAR3, DP_PAR4, DP_PAR5, DP_PSTART, DP_PSTOP, DP_RBCR0, DP_RBCR1, DP_RCR, DP_TCR, if(), IMR_CNTE, IMR_OVWE, IMR_PRXE, IMR_PTXE, IMR_RXEE, IMR_TXEE, inb_reg0, outb_reg0, outb_reg1, printf, r, RCR_AB, RCR_AM, RCR_PRO, TCR_INTERNAL, and TCR_NORMAL. Referenced by do_init(). |
|
|
Definition at line 1683 of file dp8390.c. References assert, get_userdata(), and IOVEC_NR. Referenced by calc_iovec_size(), dp_nic2user(), dp_pio16_nic2user(), dp_pio16_user2nic(), dp_pio8_nic2user(), dp_pio8_user2nic(), dp_user2nic(), el3_write_fifo(), mem2user(), mem_nic2user(), mem_user2nic(), pio_nic2user(), pio_user2nic(), and user2mem(). |
|
||||||||||||||||||||||||
|
Definition at line 1491 of file dp8390.c. References assert, BIOS_SEG, bytes, D, dp_next_iovec(), iovec_dat::iod_iovec, iovec_dat::iod_proc_nr, iovec_t::iov_addr, iovec_t::iov_size, IOVEC_NR, OK, panic, r, SELF, and sys_vircopy(). |
|
||||||||||||||||||||||||
|
Definition at line 1214 of file dp8390.c. References assert, CR_DM_RR, CR_PS_P0, CR_STA, DP_CR, DP_PAGESIZE, DP_RBCR0, DP_RBCR1, DP_RSAR0, DP_RSAR1, insw(), and outb_reg0. |
|
||||||||||||||||||||||||
|
Definition at line 1586 of file dp8390.c. References assert, bytes, CR_DM_RR, CR_PS_P0, CR_STA, D, do_vir_insw(), DP_CR, dp_next_iovec(), DP_RBCR0, DP_RBCR1, DP_RSAR0, DP_RSAR1, inw(), iovec_dat::iod_iovec, iovec_dat::iod_proc_nr, iovec_t::iov_addr, iovec_t::iov_size, IOVEC_NR, OK, outb_reg0, panic, r, SELF, sys_vircopy(), and two_bytes(). |
|
||||||||||||||||||||||||
|
Definition at line 1380 of file dp8390.c. References assert, bytes, CR_DM_RW, CR_PS_P0, CR_STA, D, do_vir_outsw(), DP_CR, DP_ISR, dp_next_iovec(), DP_RBCR0, DP_RBCR1, DP_RSAR0, DP_RSAR1, inb_reg0, iovec_dat::iod_iovec, iovec_dat::iod_proc_nr, iovec_t::iov_addr, iovec_t::iov_size, IOVEC_NR, ISR_RDC, OK, outb_reg0, outw(), panic, r, SELF, sys_vircopy(), and two_bytes(). |
|
||||||||||||||||||||||||
|
Definition at line 1194 of file dp8390.c. References CR_DM_RR, CR_PS_P0, CR_STA, DP_CR, DP_PAGESIZE, DP_RBCR0, DP_RBCR1, DP_RSAR0, DP_RSAR1, insb(), and outb_reg0. |
|
||||||||||||||||||||||||
|
Definition at line 1539 of file dp8390.c. References assert, bytes, CR_DM_RR, CR_PS_P0, CR_STA, do_vir_insb(), DP_CR, dp_next_iovec(), DP_RBCR0, DP_RBCR1, DP_RSAR0, DP_RSAR1, iovec_dat::iod_iovec, iovec_dat::iod_proc_nr, iovec_t::iov_addr, iovec_t::iov_size, IOVEC_NR, and outb_reg0. |
|
||||||||||||||||||||||||
|
Definition at line 1321 of file dp8390.c. References assert, bytes, CR_DM_RW, CR_PS_P0, CR_STA, do_vir_outsb(), DP_CR, DP_ISR, dp_next_iovec(), DP_RBCR0, DP_RBCR1, DP_RSAR0, DP_RSAR1, inb_reg0, iovec_dat::iod_iovec, iovec_dat::iod_proc_nr, iovec_t::iov_addr, iovec_t::iov_size, IOVEC_NR, ISR_RDC, and outb_reg0. |
|
||||||||||||||||
|
Definition at line 1235 of file dp8390.c. References count, DEF_PACK_RECV, DEF_READING, DP_PAGESIZE, EGENERIC, and OK. Referenced by dp_recv(). |
|
|
Definition at line 1064 of file dp8390.c. References CR_EXTRA, CR_PS_P0, CR_PS_P1, dpeth::de_startpage, DP_BNRY, DP_CR, DP_CURR, dp_pkt2user(), eth_ign_proto, ETH_MAX_PACK_SIZE_TAGGED, ETH_MIN_PACK_SIZE, FALSE, first, header, inb_reg0, inb_reg1, length, next, ntohs, OK, outb_reg0, printf, r, RSR_FO, RSR_PRX, and TRUE. Referenced by do_vread(), and dp_check_ints(). |
|
|
Definition at line 864 of file dp8390.c. References CR_EXTRA, CR_PS_P0, DEF_BROAD, DEF_MULTI, DEF_PROMISC, DP_CR, DP_RCR, outb_reg0, RCR_AB, RCR_AM, and RCR_PRO. Referenced by do_init(). |
|
|
Definition at line 884 of file dp8390.c. References CR_DM_ABORT, CR_STA, CR_STP, DEF_STOPPED, DP_CR, DP_ISR, DP_RBCR0, DP_RBCR1, DP_TCR, inb_reg0, ISR_RDC, ISR_RST, outb_reg0, TCR_1EXTERNAL, TCR_NORMAL, and TCR_OFST. Referenced by do_vread(). |
|
|
Definition at line 1153 of file dp8390.c. References dpeth::de_flags, DEF_SEND_AVAIL, DL_WRITE, DL_WRITEV, do_vwrite(), FALSE, panic, and TRUE. Referenced by dp_check_ints(). |
|
||||||||||||||||||||||||
|
Definition at line 1273 of file dp8390.c. References assert, BIOS_SEG, bytes, D, dp_next_iovec(), iovec_dat::iod_iovec, iovec_dat::iod_proc_nr, iovec_t::iov_addr, iovec_t::iov_size, IOVEC_NR, OK, panic, r, SELF, and sys_vircopy(). |
|
||||||||||||||||||||
|
Definition at line 1863 of file dp8390.c. References D, OK, panic, r, SELF, and sys_vircopy(). Referenced by do_vread(), do_vwrite(), dp_next_iovec(), ec_next_iovec(), iqp_getc(), and qp_query(). |
|
|
Definition at line 1894 of file dp8390.c. References OK, panic, r, and sys_inb. Referenced by clock_handler(), do_devio(), do_piix(), do_vdevio(), el3_probe(), el3_read_eeprom(), read_clock(), read_register(), and ser_putc(). |
|
||||||||||||||||
|
Definition at line 1934 of file dp8390.c. References do_vir_insb(), and SELF. Referenced by dp_pio8_getblock(), el1_interrupt(), el3_rx_complete(), pio_getblock(), and pio_nic2user(). |
|
||||||||||||||||
|
Definition at line 1939 of file dp8390.c. References do_vir_insw(), and SELF. Referenced by dp_pio16_getblock(), and pio_getblock(). |
|
|
Definition at line 1905 of file dp8390.c. References OK, panic, r, and sys_inw. Referenced by do_devio(), do_vdevio(), and dp_pio16_nic2user(). |
|
||||||||||||
|
Definition at line 171 of file dp8390.c. References dpeth::de_name, DE_PORT_NR, de_table, env_setargs(), i, m, NO_NUM, panic, progname, r, strcpy(), and strrchr(). |
|
||||||||||||
|
Definition at line 1852 of file dp8390.c. References NO_NUM, OK, panic, and send. Referenced by do_init(), fxp_init(), and rl_init(). |
|
||||||||||||
|
Definition at line 1916 of file dp8390.c. References OK, panic, r, and sys_outb. Referenced by clock_handler(), clock_stop(), do_devio(), do_vdevio(), el3_open(), el3_probe(), el3_read_eeprom(), el3_write_fifo(), el3_write_id(), init_clock(), intr_init(), read_clock(), read_register(), shutdown(), and write_register(). |
|
||||||||||||
|
Definition at line 1925 of file dp8390.c. References OK, panic, r, and sys_outw. Referenced by do_devio(), do_vdevio(), and dp_pio16_user2nic(). |
|
|
Definition at line 331 of file dp8390.c. References de_table, env_parse(), and env_prefix(). Referenced by do_init(). |
|
||||||||||||||||||||
|
Definition at line 1880 of file dp8390.c. References D, OK, panic, r, SELF, and sys_vircopy(). Referenced by do_getstat(), fxp_getstat(), iqp_putc(), and rl_getstat(). |
|
||||||||||||||||
|
Definition at line 1811 of file dp8390.c. References de_table, DEF_PACK_RECV, DEF_PACK_SEND, DL_PACK_RECV, DL_PACK_SEND, DL_TASK_REPLY, ELOCKED, panic, printf, r, reply, send, and status. |
|
||||||||||||
|
Definition at line 1732 of file dp8390.c. References dpeth::de_mode, DEI_DEFAULT, DEM_DISABLED, DEM_ENABLED, DEM_SINK, dp_conf::dpc_envvar, dp_conf::dpc_irq, dp_conf::dpc_mem, dp_conf::dpc_port, env_parse(), EP_OFF, EP_ON, EP_SET, L, and NR_IRQ_VECTORS. |
|
|
|
|
|
Definition at line 63 of file dp8390.c. Referenced by conf_hw(), do_dump(), do_getstat(), do_init(), do_stop(), do_vread(), do_vwrite(), dp8390_stop(), dp_confaddr(), main(), pci_conf(), and reply(). |
|
|
Initial value:
{
{ 0x280, 3, 0xD0000, "DPETH0" },
{ 0x300, 5, 0xC8000, "DPETH1" },
{ 0x380, 10, 0xD8000, "DPETH2" },
}
Definition at line 76 of file dp8390.c. Referenced by do_init(), and dp_confaddr(). |
|
|
|
|
|
|
1.4.6