fxp.c File Reference

#include "../drivers.h"
#include <stdlib.h>
#include <net/hton.h>
#include <net/gen/ether.h>
#include <net/gen/eth_io.h>
#include <ibm/pci.h>
#include <timers.h>
#include "assert.h"
#include "fxp.h"
#include "mii.h"

Include dependency graph for fxp.c:

Go to the source code of this file.

Data Structures

struct  pcitab
struct  fxp

Defines

#define tmra_ut   timer_t
#define tmra_inittimer(tp)   tmr_inittimer(tp)
#define Proc_number(p)   proc_number(p)
#define debug   0
#define RAND_UPDATE
#define printW()   ((void)0)
#define vm_1phys2bus(p)   (p)
#define N_RX_BUF   40
#define N_TX_BUF   4
#define IOVEC_NR   16
#define FXP_ENVVAR   "FXPETH"
#define FXP_PORT_NR   1
#define structof(type, field, ptr)   ((type *) (((char *) (ptr)) - offsetof(type, field)))
#define MICROS_TO_TICKS(m)   (((m)*HZ/1000000)+1)
#define interrupt(x)   0
#define FM_DISABLED   0x0
#define FM_ENABLED   0x1
#define FF_EMPTY   0x000
#define FF_PACK_SENT   0x001
#define FF_PACK_RECV   0x002
#define FF_SEND_AVAIL   0x004
#define FF_READING   0x010
#define FF_PROMISC   0x040
#define FF_MULTI   0x080
#define FF_BROAD   0x100
#define FF_ENABLED   0x200
#define FFE_NONE   0x0
#define FT_UNKNOWN   0x0
#define FT_82557   0x1
#define FT_82558A   0x2
#define FT_82559   0x4
#define fxp_inb(port, offset)   (do_inb((port) + (offset)))
#define fxp_inw(port, offset)   (do_inw((port) + (offset)))
#define fxp_inl(port, offset)   (do_inl((port) + (offset)))
#define fxp_outb(port, offset, value)   (do_outb((port) + (offset), (value)))
#define fxp_outw(port, offset, value)   (do_outw((port) + (offset), (value)))
#define fxp_outl(port, offset, value)   (do_outl((port) + (offset), (value)))
#define BUFALIGN   4096

Typedefs

typedef int irq_hook_t
typedef fxp fxp_t

Functions

static void micro_delay (unsigned long usecs)
 _PROTOTYPE (static void fxp_init,(message *mp))
 _PROTOTYPE (static void fxp_pci_conf,(void))
 _PROTOTYPE (static int fxp_probe,(fxp_t *fp))
 _PROTOTYPE (static void fxp_conf_hw,(fxp_t *fp))
 _PROTOTYPE (static void fxp_writev,(message *mp, int from_int, int vectored))
 _PROTOTYPE (static void fxp_cu_ptr_cmd,(fxp_t *fp, int cmd, phys_bytes bus_addr, int check_idle))
 _PROTOTYPE (static void fxp_watchdog_f,(timer_t *tp))
 _PROTOTYPE (static void reply,(fxp_t *fp, int err, int may_block))
 _PROTOTYPE (static void mess_reply,(message *req, message *reply))
 _PROTOTYPE (static void put_userdata,(int user_proc, vir_bytes user_addr, vir_bytes count, void *loc_addr))
 _PROTOTYPE (static u16_t eeprom_read,(fxp_t *fp, int reg))
 _PROTOTYPE (static void fxp_set_timer,(timer_t *tp, clock_t delta, tmr_func_t watchdog))
 _PROTOTYPE (static u8_t do_inb,(port_t port))
 _PROTOTYPE (static u32_t do_inl,(port_t port))
 _PROTOTYPE (static void do_outb,(port_t port, u8_t v))
 _PROTOTYPE (static void do_outl,(port_t port, u32_t v))
int main (int argc, char *argv[])
static void fxp_init (message *mp)
static void fxp_pci_conf ()
static int fxp_probe (fxp_t *fp)
static void fxp_conf_hw (fxp_t *fp)
static void fxp_init_hw (fxp_t *fp)
static void fxp_init_buf (fxp_t *fp)
static void fxp_reset_hw (fxp_t *fp)
static void fxp_confaddr (fxp_t *fp)
static void fxp_rec_mode (fxp_t *fp)
static void fxp_writev (message *mp, int from_int, int vectored)
static void fxp_readv (message *mp, int from_int, int vectored)
static void fxp_do_conf (fxp_t *fp)
static void fxp_cu_ptr_cmd (fxp_t *fp, int cmd, phys_bytes bus_addr, int check_idle)
static void fxp_ru_ptr_cmd (fxp_t *fp, int cmd, phys_bytes bus_addr, int check_idle)
static void fxp_restart_ru (fxp_t *fp)
static void fxp_getstat (message *mp)
static void fxp_getname (message *mp)
static int fxp_handler (fxp_t *fp)
static void fxp_check_ints (fxp_t *fp)
static void fxp_watchdog_f (timer_t *tp)
static int fxp_link_changed (fxp_t *fp)
static void fxp_report_link (fxp_t *fp)
static void fxp_stop ()
static void reply (fxp_t *fp, int err, int may_block)
static void mess_reply (message *req, message *reply_mess)
static void put_userdata (int user_proc, vir_bytes user_addr, vir_bytes count, void *loc_addr)
PRIVATE u16_t eeprom_read (fxp_t *fp, int reg)
PRIVATE void eeprom_addrsize (fxp_t *fp)
PRIVATE u16_t mii_read (fxp_t *fp, int reg)
PRIVATE void fxp_set_timer (timer_t *tp, clock_t delta, tmr_func_t watchdog)
PRIVATE void fxp_expire_timers ()
static u8_t do_inb (port_t port)
static u32_t do_inl (port_t port)
static void do_outb (port_t port, u8_t value)
static void do_outl (port_t port, u32_t value)

Variables

PRIVATE struct pcitab pcitab_fxp []
static timer_tfxp_timers = NULL
static clock_t fxp_next_timeout = 0
char buffer [70 *1024]
static fxp_t fxp_table [FXP_PORT_NR]
static int fxp_tasknr = ANY
static u16_t eth_ign_proto
static tmra_ut fxp_watchdog
static char * progname
int errno


Define Documentation

#define BUFALIGN   4096
 

Referenced by fxp_init_buf().

#define debug   0
 

Definition at line 56 of file fxp.c.

#define FF_BROAD   0x100
 

Definition at line 187 of file fxp.c.

Referenced by fxp_init(), and fxp_rec_mode().

#define FF_EMPTY   0x000
 

Definition at line 180 of file fxp.c.

Referenced by fxp_conf_hw(), and fxp_init_hw().

#define FF_ENABLED   0x200
 

Definition at line 188 of file fxp.c.

Referenced by fxp_getstat(), fxp_init(), fxp_init_hw(), fxp_readv(), fxp_stop(), fxp_writev(), and main().

#define FF_MULTI   0x080
 

Definition at line 186 of file fxp.c.

Referenced by fxp_init(), and fxp_rec_mode().

#define FF_PACK_RECV   0x002
 

Definition at line 182 of file fxp.c.

Referenced by fxp_readv(), and reply().

#define FF_PACK_SENT   0x001
 

Definition at line 181 of file fxp.c.

Referenced by fxp_writev(), and reply().

#define FF_PROMISC   0x040
 

Definition at line 185 of file fxp.c.

Referenced by fxp_init(), and fxp_rec_mode().

#define FF_READING   0x010
 

Definition at line 184 of file fxp.c.

Referenced by fxp_check_ints(), fxp_handler(), and fxp_readv().

#define FF_SEND_AVAIL   0x004
 

Definition at line 183 of file fxp.c.

Referenced by fxp_check_ints(), and fxp_writev().

#define FFE_NONE   0x0
 

Definition at line 191 of file fxp.c.

Referenced by fxp_pci_conf().

#define FM_DISABLED   0x0
 

Definition at line 176 of file fxp.c.

Referenced by fxp_conf_hw(), and fxp_init().

#define FM_ENABLED   0x1
 

Definition at line 177 of file fxp.c.

Referenced by fxp_conf_hw(), fxp_getstat(), fxp_init(), fxp_readv(), fxp_stop(), fxp_watchdog_f(), fxp_writev(), and main().

#define FT_82557   0x1
 

Definition at line 195 of file fxp.c.

Referenced by fxp_conf_hw().

#define FT_82558A   0x2
 

Definition at line 196 of file fxp.c.

#define FT_82559   0x4
 

Definition at line 197 of file fxp.c.

#define FT_UNKNOWN   0x0
 

Definition at line 194 of file fxp.c.

#define FXP_ENVVAR   "FXPETH"
 

Definition at line 75 of file fxp.c.

Referenced by fxp_confaddr(), and fxp_pci_conf().

#define fxp_inb port,
offset   )     (do_inb((port) + (offset)))
 

Definition at line 208 of file fxp.c.

Referenced by fxp_check_ints(), fxp_cu_ptr_cmd(), fxp_handler(), fxp_init_hw(), fxp_readv(), fxp_restart_ru(), and fxp_ru_ptr_cmd().

#define fxp_inl port,
offset   )     (do_inl((port) + (offset)))
 

Definition at line 210 of file fxp.c.

Referenced by mii_read().

#define fxp_inw port,
offset   )     (do_inw((port) + (offset)))
 

Definition at line 209 of file fxp.c.

#define fxp_outb port,
offset,
value   )     (do_outb((port) + (offset), (value)))
 

Definition at line 211 of file fxp.c.

Referenced by eeprom_addrsize(), eeprom_read(), fxp_cu_ptr_cmd(), fxp_handler(), fxp_init_hw(), fxp_reset_hw(), and fxp_ru_ptr_cmd().

#define fxp_outl port,
offset,
value   )     (do_outl((port) + (offset), (value)))
 

Definition at line 213 of file fxp.c.

Referenced by fxp_cu_ptr_cmd(), fxp_reset_hw(), fxp_ru_ptr_cmd(), fxp_stop(), and mii_read().

#define fxp_outw port,
offset,
value   )     (do_outw((port) + (offset), (value)))
 

Definition at line 212 of file fxp.c.

#define FXP_PORT_NR   1
 

Definition at line 92 of file fxp.c.

Referenced by fxp_init(), fxp_pci_conf(), and main().

#define interrupt x   )     0
 

Definition at line 110 of file fxp.c.

Referenced by catchdel(), delay(), do_absolute(), do_bscreens(), do_fscreens(), do_search(), execute(), fxp_handler(), fxp_watchdog_f(), getblock(), getch(), getcomm(), interrupt(), main(), pr_mach(), processfiles(), readline(), Sigint(), Sigquit(), and to_lastline().

#define IOVEC_NR   16
 

Definition at line 72 of file fxp.c.

#define MICROS_TO_TICKS m   )     (((m)*HZ/1000000)+1)
 

Definition at line 102 of file fxp.c.

#define N_RX_BUF   40
 

Definition at line 66 of file fxp.c.

Referenced by fxp_init_buf().

#define N_TX_BUF   4
 

Definition at line 69 of file fxp.c.

Referenced by fxp_init_buf(), rl_handler(), rl_init_buf(), rl_reset_hw(), and rl_writev().

 
#define printW  )     ((void)0)
 

Definition at line 58 of file fxp.c.

Referenced by dp_check_ints(), and reply().

#define Proc_number p   )     proc_number(p)
 

Definition at line 55 of file fxp.c.

#define RAND_UPDATE
 

Definition at line 57 of file fxp.c.

Referenced by fxp_handler().

#define structof type,
field,
ptr   )     ((type *) (((char *) (ptr)) - offsetof(type, field)))
 

Definition at line 99 of file fxp.c.

#define tmra_inittimer tp   )     tmr_inittimer(tp)
 

Definition at line 54 of file fxp.c.

Referenced by fxp_init(), and rl_init().

#define tmra_ut   timer_t
 

Definition at line 53 of file fxp.c.

#define vm_1phys2bus p   )     (p)
 

Definition at line 59 of file fxp.c.

Referenced by rl_reset_hw().


Typedef Documentation

typedef struct fxp fxp_t
 

typedef int irq_hook_t
 

Definition at line 94 of file fxp.c.


Function Documentation

_PROTOTYPE static void  do_outl,
(port_t port, u32_t v) 
 

_PROTOTYPE static void  do_outb,
(port_t port, u8_t v) 
 

_PROTOTYPE static u32_t  do_inl,
(port_t port
 

_PROTOTYPE static u8_t  do_inb,
(port_t port
 

_PROTOTYPE static void  fxp_set_timer,
(timer_t *tp, clock_t delta, tmr_func_t watchdog) 
 

_PROTOTYPE static u16_t  eeprom_read,
(fxp_t *fp, int reg) 
 

_PROTOTYPE static void  put_userdata,
(int user_proc, vir_bytes user_addr, vir_bytes count, void *loc_addr) 
 

_PROTOTYPE static void  mess_reply,
(message *req, message *reply) 
 

_PROTOTYPE static void  reply,
(fxp_t *fp, int err, int may_block) 
 

_PROTOTYPE static void  fxp_watchdog_f,
(timer_t *tp
 

_PROTOTYPE static void  fxp_cu_ptr_cmd,
(fxp_t *fp, int cmd, phys_bytes bus_addr, int check_idle) 
 

_PROTOTYPE static void  fxp_writev,
(message *mp, int from_int, int vectored) 
 

_PROTOTYPE static void  fxp_conf_hw,
(fxp_t *fp
 

_PROTOTYPE static int  fxp_probe,
(fxp_t *fp
 

_PROTOTYPE static void  fxp_pci_conf,
(void) 
 

_PROTOTYPE static void  fxp_init,
(message *mp
 

static u8_t do_inb port_t  port  )  [static]
 

Definition at line 2460 of file fxp.c.

References OK, panic, r, and sys_inb.

Referenced by read_exca().

static u32_t do_inl port_t  port  )  [static]
 

Definition at line 2471 of file fxp.c.

References OK, panic, r, and sys_inl.

static void do_outb port_t  port,
u8_t  value
[static]
 

Definition at line 2482 of file fxp.c.

References OK, panic, r, and sys_outb.

Referenced by read_exca().

static void do_outl port_t  port,
u32_t  value
[static]
 

Definition at line 2491 of file fxp.c.

References OK, panic, r, and sys_outl.

PRIVATE void eeprom_addrsize fxp_t fp  ) 
 

Definition at line 2295 of file fxp.c.

References b, CE_EECS, CE_EEDI, CE_EESK, CSR_EEPROM, EEPROM_PREFIX_LEN, EEPROM_READ_PREFIX, EESK_PERIOD, fxp_outb, i, and micro_delay().

Referenced by eeprom_read().

PRIVATE u16_t eeprom_read fxp_t fp,
int  reg
 

Definition at line 2235 of file fxp.c.

References assert, b, CE_EECS, CE_EEDI, CE_EESK, CSR_EEPROM, eeprom_addrsize(), EEPROM_PREFIX_LEN, EEPROM_READ_PREFIX, EESK_PERIOD, fxp_outb, i, and micro_delay().

static void fxp_check_ints fxp_t fp  )  [static]
 

Definition at line 1678 of file fxp.c.

References assert, DL_READ, DL_READV, DL_WRITE, DL_WRITEV, FALSE, FF_READING, FF_SEND_AVAIL, fxp_cu_ptr_cmd(), fxp_do_conf(), fxp_inb, fxp_readv(), fxp_writev(), if(), n, printf, RFDS_C, SC_CU_START, SCB_STATUS, SS_CU_IDLE, SS_CUS_MASK, TRUE, tx::tx_command, tx::tx_linkaddr, tx::tx_status, TXC_EL, TXS_C, TXS_OK, TXS_U, and TXTT_MAX.

Referenced by main().

static void fxp_conf_hw fxp_t fp  )  [static]
 

Definition at line 628 of file fxp.c.

References CAI_DEFAULT, CC_BYTES_NR, CCB10_NSAI, CCB10_RES1, CCB13_DEFAULT, CCB14_DEFAULT, CCB15_CRSCDT, CCB15_RES1, CCB15_RES2, CCB16_DEFAULT, CCB17_DEFAULT, CCB18_PE, CCB18_PFCT, CCB18_RES1, CCB19_FDPE, CCB20_PFCL, CCB20_RES1, CCB21_RES21, CCB6_ESC, CCB6_ETCB, CCB6_RES, CCB8_503_MII, CIS_DEFAULT, CLB_NORMAL, CPAL_DEFAULT, CRL_DEFAULT, CTL_DEFAULT, CUR_1, FF_EMPTY, FM_DISABLED, FM_ENABLED, FT_82557, i, if(), printf, and TXTT_MIN.

Referenced by fxp_init().

static void fxp_confaddr fxp_t fp  )  [static]
 

Definition at line 928 of file fxp.c.

References env_parse(), EP_SET, FXP_ENVVAR, fxp_table, i, r, and t1.

Referenced by fxp_init_hw().

static void fxp_cu_ptr_cmd fxp_t fp,
int  cmd,
phys_bytes  bus_addr,
int  check_idle
[static]
 

Definition at line 1418 of file fxp.c.

References fxp_inb, fxp_outb, fxp_outl, getuptime(), MICROS_TO_TICKS, NO_NUM, OK, panic, SC_CU_NOP, SC_CUC_MASK, SCB_CMD, SCB_POINTER, SCB_STATUS, SS_CU_IDLE, SS_CUS_MASK, and t1.

Referenced by fxp_check_ints(), fxp_do_conf(), fxp_getstat(), fxp_init_hw(), fxp_reset_hw(), and fxp_writev().

static void fxp_do_conf fxp_t fp  )  [static]
 

Definition at line 1380 of file fxp.c.

References CBL_C_EL, CBL_CONF, CBL_F_C, CBL_F_OK, cbl_conf::cc_bytes, cbl_conf::cc_command, cbl_conf::cc_linkaddr, cbl_conf::cc_status, D, fxp_cu_ptr_cmd(), getuptime(), memcpy(), MICROS_TO_TICKS, NO_NUM, OK, panic, r, SC_CU_START, SELF, sys_umap(), t1, and TRUE.

Referenced by fxp_check_ints(), fxp_init_hw(), and fxp_rec_mode().

PRIVATE void fxp_expire_timers  ) 
 

Definition at line 2426 of file fxp.c.

References fxp_next_timeout, fxp_timers, getuptime(), now, NULL, OK, panic, r, sys_setalarm(), timer::tmr_exp_time, TMR_NEVER, and tmrs_exptimers().

Referenced by main().

static void fxp_getname message mp  )  [static]
 

Definition at line 1604 of file fxp.c.

References DL_NAME_REPLY, OK, panic, progname, r, send, and strncpy().

Referenced by main().

static void fxp_getstat message mp  )  [static]
 

Definition at line 1528 of file fxp.c.

References assert, eth_stat::ets_carrSense, eth_stat::ets_CDheartbeat, eth_stat::ets_collision, eth_stat::ets_CRCerr, eth_stat::ets_fifoOver, eth_stat::ets_fifoUnder, eth_stat::ets_frameAll, eth_stat::ets_missedP, eth_stat::ets_OVW, eth_stat::ets_OWC, eth_stat::ets_packetR, eth_stat::ets_packetT, eth_stat::ets_recvErr, eth_stat::ets_sendErr, eth_stat::ets_transAb, eth_stat::ets_transDef, FALSE, FF_ENABLED, FM_ENABLED, fp, fxp_cu_ptr_cmd(), fxp_table, getuptime(), MICROS_TO_TICKS, NO_NUM, OK, p, panic, put_userdata(), reply, SC_CU_DUMP_SC, SCM_DSC, and t1.

Referenced by main().

static int fxp_handler fxp_t fp  )  [static]
 

Definition at line 1620 of file fxp.c.

References FF_READING, fxp_inb, fxp_outb, fxp_tasknr, interrupt, printf, RAND_UPDATE, SCB_INT_STAT, SIS_CNA, SIS_FR, SIS_RNR, and TRUE.

static void fxp_init message mp  )  [static]
 

Definition at line 342 of file fxp.c.

References assert, DL_BROAD_REQ, DL_INIT_REPLY, DL_MULTI_REQ, DL_PROMISC_REQ, ENXIO, FF_BROAD, FF_ENABLED, FF_MULTI, FF_PROMISC, FM_DISABLED, FM_ENABLED, fp, fxp_conf_hw(), fxp_init_hw(), fxp_pci_conf(), FXP_PORT_NR, fxp_rec_mode(), fxp_report_link(), fxp_set_timer(), fxp_table, fxp_watchdog, HZ, message::m_type, mess_reply(), tmr_arg, and tmra_inittimer.

Referenced by main().

static void fxp_init_buf fxp_t fp  )  [static]
 

Definition at line 810 of file fxp.c.

References assert, BUFALIGN, CBL_NOP, D, i, N_RX_BUF, N_TX_BUF, OK, panic, r, rfd::rfd_buf, rfd::rfd_command, rfd::rfd_linkaddr, rfd::rfd_res, rfd::rfd_reserved, rfd::rfd_size, rfd::rfd_status, RFDC_EL, SELF, sys_umap(), tx::tx_command, tx::tx_linkaddr, tx::tx_ntbd, tx::tx_size, tx::tx_status, tx::tx_tbda, TX_TBDA_NIL, tx::tx_tthresh, and TXC_EL.

Referenced by fxp_init_hw(), and main().

static void fxp_init_hw fxp_t fp  )  [static]
 

Definition at line 746 of file fxp.c.

References D, debug, FF_EMPTY, FF_ENABLED, fxp_confaddr(), fxp_cu_ptr_cmd(), fxp_do_conf(), fxp_inb, fxp_init_buf(), fxp_outb, fxp_reset_hw(), fxp_ru_ptr_cmd(), i, OK, panic, printf, r, SC_CU_LOAD_DCA, SC_RU_START, SCB_INT_MASK, SCB_INT_STAT, SELF, sys_irqenable, sys_irqsetpolicy, sys_umap(), and TRUE.

Referenced by fxp_init().

static int fxp_link_changed fxp_t fp  )  [static]
 

Definition at line 1878 of file fxp.c.

References mii_read(), MII_SCR, MII_SCR_RES, MII_SCR_RES_1, and scr.

Referenced by fxp_watchdog_f().

static void fxp_pci_conf  )  [static]
 

Definition at line 413 of file fxp.c.

References FALSE, FFE_NONE, fp, FXP_ENVVAR, FXP_PORT_NR, fxp_table, getenv(), i, if(), NULL, strcmp, and strcpy().

Referenced by fxp_init().

static int fxp_probe fxp_t fp  )  [static]
 

Definition at line 480 of file fxp.c.

References FALSE, i, NO_NUM, panic, pci_find_dev(), pci_first_dev(), pci_ids(), pcitab_fxp, printf, r, rev, TRUE, and pcitab::vid.

static void fxp_readv message mp,
int  from_int,
int  vectored
[static]
 

Definition at line 1200 of file fxp.c.

References assert, count, D, FALSE, FF_ENABLED, FF_PACK_RECV, FF_READING, FM_ENABLED, fp, fxp_inb, fxp_restart_ru(), fxp_table, i, iovec_t::iov_addr, iovec_t::iov_size, IOVEC_NR, j, n, OK, panic, printf, r, reply, rfd::rfd_buf, rfd::rfd_command, rfd::rfd_res, rfd::rfd_reserved, rfd::rfd_size, rfd::rfd_status, RFDC_EL, RFDR_EOF, RFDR_F, RFDS_ALIGNERR, RFDS_C, RFDS_CRCERR, RFDS_DMAOVR, RFDS_OK, RFDS_OUTOFBUF, RFDS_RXERR, RFDS_TOOSHORT, RFDSZ_SIZE, s, SCB_STATUS, SELF, size, SS_RU_NORES, SS_RU_READY, SS_RUS_MASK, suspend(), and sys_vircopy().

Referenced by fxp_check_ints(), and main().

static void fxp_rec_mode fxp_t fp  )  [static]
 

Definition at line 1010 of file fxp.c.

References CCB15_BD, CCB15_PM, CCB21_MA, FF_BROAD, FF_MULTI, FF_PROMISC, fxp_do_conf(), printf, and TRUE.

Referenced by fxp_init().

static void fxp_report_link fxp_t fp  )  [static]
 

Definition at line 1892 of file fxp.c.

References debug, FALSE, MII_ANA, MII_ANE, MII_ANE_LPANA, MII_ANE_PDF, MII_ANLPA, MII_CTRL, MII_CTRL_ANE, MII_CTRL_DM, MII_CTRL_ISO, MII_CTRL_LB, MII_CTRL_PD, MII_CTRL_SP_10, MII_CTRL_SP_100, MII_CTRL_SP_1000, MII_CTRL_SP_LSB, MII_CTRL_SP_MSB, MII_CTRL_SP_RES, MII_EXT_STATUS, MII_MS_CTRL, MII_MS_STATUS, MII_MSC_1000T_FD, MII_MSC_1000T_HD, MII_MSC_MS_MANUAL, MII_MSC_MS_VAL, MII_MSC_MULTIPORT, MII_MSC_RES, MII_MSS_FAULT, MII_MSS_IDLE_ERR, MII_MSS_LOCREC, MII_MSS_LP1000T_FD, MII_MSS_LP1000T_HD, MII_MSS_MASTER, MII_MSS_REMREC, MII_MSS_RES, MII_PH_OUI_H_C_SHIFT, MII_PHYID_H, MII_PHYID_L, MII_PL_MODEL_MASK, MII_PL_MODEL_SHIFT, MII_PL_OUI_L_MASK, MII_PL_OUI_L_SHIFT, MII_PL_REV_MASK, mii_print_stat_speed(), mii_print_techab(), mii_read(), MII_SCR, MII_SCR_100, MII_SCR_FD, MII_SCR_RES, MII_SCR_RES_1, MII_STATUS, MII_STATUS_ANA, MII_STATUS_ANC, MII_STATUS_EC, MII_STATUS_EXT_STAT, MII_STATUS_JD, MII_STATUS_LS, MII_STATUS_RF, printf, rev, and scr.

Referenced by fxp_init().

static void fxp_reset_hw fxp_t fp  )  [static]
 

Definition at line 903 of file fxp.c.

References CP_CMD_SOFT_RESET, CSR_PORT, CSR_PORT_RESET_DELAY, fxp_cu_ptr_cmd(), fxp_outb, fxp_outl, fxp_ru_ptr_cmd(), MICROS_TO_TICKS, SC_CU_LOAD_BASE, SC_RU_LOAD_BASE, SCB_INT_MASK, SIM_M, tickdelay(), and TRUE.

Referenced by fxp_init_hw().

static void fxp_restart_ru fxp_t fp  )  [static]
 

Definition at line 1495 of file fxp.c.

References FALSE, fxp_inb, fxp_ru_ptr_cmd(), i, NO_NUM, panic, rfd::rfd_buf, rfd::rfd_command, rfd::rfd_res, rfd::rfd_reserved, rfd::rfd_size, rfd::rfd_status, RFDC_EL, SC_RU_START, SCB_STATUS, SS_RU_NORES, and SS_RUS_MASK.

Referenced by fxp_readv().

static void fxp_ru_ptr_cmd fxp_t fp,
int  cmd,
phys_bytes  bus_addr,
int  check_idle
[static]
 

Definition at line 1458 of file fxp.c.

References fxp_inb, fxp_outb, fxp_outl, getuptime(), MICROS_TO_TICKS, NO_NUM, OK, panic, SC_RU_NOP, SC_RUC_MASK, SCB_CMD, SCB_POINTER, SCB_STATUS, SS_RU_IDLE, SS_RUS_MASK, and t1.

Referenced by fxp_init_hw(), fxp_reset_hw(), and fxp_restart_ru().

PRIVATE void fxp_set_timer timer_t tp,
clock_t  delta,
tmr_func_t  watchdog
 

Definition at line 2390 of file fxp.c.

References fxp_next_timeout, fxp_timers, getuptime(), now, NULL, OK, panic, printf, r, sys_setalarm(), timer::tmr_exp_time, and tmrs_settimer().

Referenced by fxp_init(), and fxp_watchdog_f().

static void fxp_stop  )  [static]
 

Definition at line 2136 of file fxp.c.

References CP_CMD_SOFT_RESET, CSR_PORT, debug, FF_ENABLED, FM_ENABLED, fp, fxp_outl, fxp_table, i, if(), and printf.

Referenced by main().

static void fxp_watchdog_f timer_t tp  )  [static]
 

Definition at line 1828 of file fxp.c.

References FM_ENABLED, fp, fxp_link_changed(), fxp_set_timer(), fxp_table, fxp_tasknr, fxp_watchdog, HZ, i, if(), interrupt, printf, tmr_arg, TRUE, and VERBOSE.

static void fxp_writev message mp,
int  from_int,
int  vectored
[static]
 

Definition at line 1040 of file fxp.c.

References assert, CBL_XMIT, count, D, ETH_MAX_PACK_SIZE_TAGGED, ETH_MIN_PACK_SIZE, FALSE, FF_ENABLED, FF_PACK_SENT, FF_SEND_AVAIL, FM_ENABLED, fp, fxp_cu_ptr_cmd(), fxp_table, i, iovec_t::iov_addr, iovec_t::iov_size, IOVEC_NR, j, n, NO_NUM, NULL, OK, panic, r, reply, s, SC_CU_START, SELF, size, suspend(), sys_vircopy(), TRUE, tx::tx_buf, tx::tx_command, tx::tx_ntbd, tx::tx_size, tx::tx_status, tx::tx_tbda, TX_TBDA_NIL, tx::tx_tthresh, TXC_EL, and TXSZ_EOF.

Referenced by fxp_check_ints(), and main().

int main int  argc,
char *  argv[]
 

Definition at line 260 of file fxp.c.

References _pm_findproc, ANY, assert, DEV_PING, DL_GETNAME, DL_GETSTAT, DL_INIT, DL_READ, DL_READV, DL_WRITE, DL_WRITEV, env_parse(), errno, eth_ign_proto, FALSE, FF_ENABLED, FM_ENABLED, fp, fxp_check_ints(), fxp_expire_timers(), fxp_getname(), fxp_getstat(), fxp_init(), fxp_init_buf(), FXP_PORT_NR, fxp_readv(), fxp_stop(), fxp_table, fxp_tasknr, fxp_writev(), getprocnr, HARD_INT, htons, i, m, NO_NUM, notify, OK, panic, PROC_EVENT, progname, r, receive, sigismember, strrchr(), SYN_ALARM, sys_irqenable, SYS_SIG, and TRUE.

static void mess_reply message req,
message reply_mess
[static]
 

Definition at line 2207 of file fxp.c.

References NO_NUM, OK, panic, and send.

static void micro_delay unsigned long  usecs  )  [static]
 

Definition at line 2455 of file fxp.c.

References MICROS_TO_TICKS, and tickdelay().

PRIVATE u16_t mii_read fxp_t fp,
int  reg
 

Definition at line 2353 of file fxp.c.

References assert, CM_DATA_MASK, CM_PHYADDR_SHIFT, CM_READ, CM_READY, CM_REG_SHIFT, CSR_MDI_CTL, fxp_inl, fxp_outl, getuptime(), MICROS_TO_TICKS, NO_NUM, OK, panic, and t1.

Referenced by fxp_link_changed(), and fxp_report_link().

static void put_userdata int  user_proc,
vir_bytes  user_addr,
vir_bytes  count,
void *  loc_addr
[static]
 

Definition at line 2218 of file fxp.c.

References D, OK, panic, r, SELF, and sys_vircopy().

static void reply fxp_t fp,
int  err,
int  may_block
[static]
 

Definition at line 2161 of file fxp.c.

References DL_PACK_RECV, DL_PACK_SEND, DL_TASK_REPLY, ELOCKED, FF_PACK_RECV, FF_PACK_SENT, fxp_table, get_uptime(), panic, printf, printW, r, reply, send, and status.


Variable Documentation

char buffer[70 *1024]
 

Definition at line 112 of file fxp.c.

int errno
 

Definition at line 70 of file rcp.c.

u16_t eth_ign_proto [static]
 

Definition at line 202 of file fxp.c.

clock_t fxp_next_timeout = 0 [static]
 

Definition at line 105 of file fxp.c.

Referenced by fxp_expire_timers(), and fxp_set_timer().

fxp_t fxp_table[FXP_PORT_NR] [static]
 

Definition at line 199 of file fxp.c.

Referenced by fxp_confaddr(), fxp_getstat(), fxp_init(), fxp_pci_conf(), fxp_readv(), fxp_stop(), fxp_watchdog_f(), fxp_writev(), main(), and reply().

int fxp_tasknr = ANY [static]
 

Definition at line 201 of file fxp.c.

Referenced by fxp_handler(), fxp_watchdog_f(), and main().

timer_t* fxp_timers = NULL [static]
 

Definition at line 104 of file fxp.c.

Referenced by fxp_expire_timers(), and fxp_set_timer().

tmra_ut fxp_watchdog [static]
 

Definition at line 203 of file fxp.c.

Referenced by fxp_init(), and fxp_watchdog_f().

PRIVATE struct pcitab pcitab_fxp[]
 

Initial value:

{
        { 0x8086, 0x1229, 0 },          
        { 0x8086, 0x2449, 0 },          

        { 0x0000, 0x0000, 0 }
}

Definition at line 84 of file fxp.c.

Referenced by fxp_probe().

char* progname [static]
 

Definition at line 204 of file fxp.c.


Generated on Fri Apr 14 23:08:56 2006 for minix by  doxygen 1.4.6