src/drivers/fxp/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 <minix/ds.h>
#include <minix/endpoint.h>
#include <timers.h>
#include "assert.h"
#include "fxp.h"
#include "mii.h"

Go to the source code of this file.

Classes

struct  pcitab
union  tmpbuf
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 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 FT_82801   0x8
#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)))

Typedefs

typedef int irq_hook_t
typedef struct fxp fxp_t

Functions

 _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_writev_s,(message *mp, int from_int))
 _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 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))
 _PROTOTYPE (static void tell_dev,(vir_bytes start, size_t size, int pci_bus, int pci_dev, int pci_func))
PRIVATE void handle_hw_intr (void)
FORWARD _PROTOTYPE (void sef_local_startup,(void))
FORWARD _PROTOTYPE (int sef_cb_init_fresh,(int type, sef_init_info_t *info))
int main (int argc, char *argv[])
PRIVATE void sef_local_startup ()
PRIVATE int sef_cb_init_fresh (int type, sef_init_info_t *info)
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 ()
PRIVATE void tell_dev (vir_bytes buf, size_t size, int pci_bus, int pci_dev, int pci_func)

Variables

PRIVATE struct pcitab pcitab_fxp []
union tmpbuftmpbufp
phys_bytes fxp_table_phys
int errno
u32_t system_hz
EXTERN int env_argc
EXTERN char ** env_argv


Define Documentation

#define debug   0

Definition at line 70 of file fxp.c.

#define FF_BROAD   0x100

Definition at line 199 of file fxp.c.

#define FF_EMPTY   0x000

Definition at line 192 of file fxp.c.

#define FF_ENABLED   0x200

Definition at line 200 of file fxp.c.

#define FF_MULTI   0x080

Definition at line 198 of file fxp.c.

#define FF_PACK_RECV   0x002

Definition at line 194 of file fxp.c.

#define FF_PACK_SENT   0x001

Definition at line 193 of file fxp.c.

#define FF_PROMISC   0x040

Definition at line 197 of file fxp.c.

#define FF_READING   0x010

Definition at line 196 of file fxp.c.

#define FF_SEND_AVAIL   0x004

Definition at line 195 of file fxp.c.

#define FFE_NONE   0x0

Definition at line 203 of file fxp.c.

#define FM_DISABLED   0x0

Definition at line 188 of file fxp.c.

#define FM_ENABLED   0x1

Definition at line 189 of file fxp.c.

#define FT_82557   0x1

Definition at line 207 of file fxp.c.

#define FT_82558A   0x2

Definition at line 208 of file fxp.c.

#define FT_82559   0x4

Definition at line 209 of file fxp.c.

#define FT_82801   0x8

Definition at line 210 of file fxp.c.

#define FT_UNKNOWN   0x0

Definition at line 206 of file fxp.c.

#define FXP_ENVVAR   "FXPETH"

Definition at line 89 of file fxp.c.

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

Definition at line 223 of file fxp.c.

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

Definition at line 225 of file fxp.c.

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

Definition at line 224 of file fxp.c.

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

Definition at line 226 of file fxp.c.

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

Definition at line 228 of file fxp.c.

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

Definition at line 227 of file fxp.c.

#define FXP_PORT_NR   1

Definition at line 108 of file fxp.c.

#define interrupt ( x   )     0

Definition at line 116 of file fxp.c.

#define IOVEC_NR   16

Definition at line 86 of file fxp.c.

#define N_RX_BUF   40

Definition at line 80 of file fxp.c.

#define N_TX_BUF   4

Definition at line 83 of file fxp.c.

 
#define printW (  )     ((void)0)

Definition at line 72 of file fxp.c.

#define Proc_number ( p   )     proc_number(p)

Definition at line 69 of file fxp.c.

#define RAND_UPDATE

Definition at line 71 of file fxp.c.

#define tmra_inittimer ( tp   )     tmr_inittimer(tp)

Definition at line 68 of file fxp.c.

#define tmra_ut   timer_t

Definition at line 67 of file fxp.c.

#define vm_1phys2bus ( p   )     (p)

Definition at line 73 of file fxp.c.


Typedef Documentation

typedef struct fxp fxp_t

typedef int irq_hook_t

Definition at line 110 of file fxp.c.


Function Documentation

FORWARD _PROTOTYPE ( int  sef_cb_init_fresh,
(int type, sef_init_info_t *info  
)

FORWARD _PROTOTYPE ( void  sef_local_startup,
(void)   
)

_PROTOTYPE ( static void  tell_dev,
(vir_bytes start, size_t size, int pci_bus, int pci_dev, int pci_func)   
)

_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  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_s,
(message *mp, int from_int)   
)

_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  
)

PRIVATE void eeprom_addrsize ( fxp_t fp  ) 

Definition at line 2798 of file fxp.c.

PRIVATE u16_t eeprom_read ( fxp_t fp,
int  reg 
)

Definition at line 2738 of file fxp.c.

PRIVATE void fxp_expire_timers (  ) 

Definition at line 2929 of file fxp.c.

PRIVATE void fxp_set_timer ( timer_t tp,
clock_t  delta,
tmr_func_t  watchdog 
)

Definition at line 2893 of file fxp.c.

PRIVATE void handle_hw_intr ( void   ) 

Definition at line 275 of file fxp.c.

int main ( int argc  ,
char *  argv[] 
)

Definition at line 307 of file fxp.c.

PRIVATE u16_t mii_read ( fxp_t fp,
int  reg 
)

Definition at line 2856 of file fxp.c.

PRIVATE int sef_cb_init_fresh ( int  type,
sef_init_info_t info 
)

Definition at line 384 of file fxp.c.

PRIVATE void sef_local_startup ( void   ) 

Definition at line 369 of file fxp.c.

PRIVATE void tell_dev ( vir_bytes  buf,
size_t  size,
int  pci_bus,
int  pci_dev,
int  pci_func 
)

Definition at line 2997 of file fxp.c.


Variable Documentation

EXTERN int env_argc

Definition at line 301 of file fxp.c.

EXTERN char** env_argv

Definition at line 302 of file fxp.c.

int errno

Definition at line 70 of file rcp.c.

Definition at line 213 of file fxp.c.

PRIVATE struct pcitab pcitab_fxp[]

Initial value:

{
        { 0x8086, 0x1229, 0 },          
        { 0x8086, 0x2449, 0 },          
        { 0x8086, 0x103d, 0 },          
        { 0x8086, 0x1064, 0 },          

        { 0x0000, 0x0000, 0 }
}

Definition at line 98 of file fxp.c.

Definition at line 221 of file fxp.c.

union tmpbuf * tmpbufp


Generated on Tue Mar 9 04:36:48 2010 for Minix by  doxygen 1.5.8