40 #include "../porting/rtemscompat.h" 42 #include <sys/types.h> 43 #include <sys/param.h> 44 #include <sys/systm.h> 46 #include <sys/protosw.h> 47 #include <sys/socket.h> 48 #include <sys/malloc.h> 49 #include <sys/kernel.h> 55 #define IFM_LINK_OK IFM_FLAG0 56 #define IFM_ANEG_DIS IFM_FLAG1 58 #define ASSERT(x) if(!(x)) panic("EM: x") 61 #define usec_delay(x) DELAY(x) 62 #define msec_delay(x) DELAY(1000*(x)) 64 #define msec_delay_irq(x) DELAY(1000*(x)) 66 #define MSGOUT(S, A, B) printf(S "\n", A, B) 67 #define DEBUGFUNC(F) DEBUGOUT(F); 69 #define DEBUGOUT(S) printf(S "\n") 70 #define DEBUGOUT1(S,A) printf(S "\n",A) 71 #define DEBUGOUT2(S,A,B) printf(S "\n",A,B) 72 #define DEBUGOUT3(S,A,B,C) printf(S "\n",A,B,C) 73 #define bootverbose (1) 74 #define DEBUGOUT7(S,A,B,C,D,E,F,G) printf(S "\n",A,B,C,D,E,F,G) 77 #define DEBUGOUT1(S,A) 78 #define DEBUGOUT2(S,A,B) 79 #define DEBUGOUT3(S,A,B,C) 80 #define bootverbose (0) 81 #define DEBUGOUT7(S,A,B,C,D,E,F,G) 84 #define CMD_MEM_WRT_INVALIDATE 0x0010 85 #define PCI_COMMAND_REGISTER PCIR_COMMAND 89 unsigned mem_bus_space_handle;
97 #define E1000_WRITE_FLUSH(hw) E1000_READ_REG(hw, STATUS) 100 #define E1000_READ_OFFSET(hw, offset) \ 101 bus_space_read_4( ((struct em_osdep *)(hw)->back)->mem_bus_space_tag, \ 102 ((struct em_osdep *)(hw)->back)->mem_bus_space_handle, \ 106 #define E1000_WRITE_OFFSET(hw, offset, value) \ 107 bus_space_write_4( ((struct em_osdep *)(hw)->back)->mem_bus_space_tag, \ 108 ((struct em_osdep *)(hw)->back)->mem_bus_space_handle, \ 113 #define E1000_REG_OFFSET(hw, reg) \ 114 ((hw)->mac_type >= em_82543 ? E1000_##reg : E1000_82542_##reg) 116 #define E1000_READ_REG(hw, reg) \ 117 E1000_READ_OFFSET(hw, E1000_REG_OFFSET(hw, reg)) 119 #define E1000_WRITE_REG(hw, reg, value) \ 120 E1000_WRITE_OFFSET(hw, E1000_REG_OFFSET(hw, reg), value) 122 #define E1000_READ_REG_ARRAY(hw, reg, index) \ 123 E1000_READ_OFFSET(hw, E1000_REG_OFFSET(hw, reg) + ((index) << 2)) 125 #define E1000_READ_REG_ARRAY_DWORD E1000_READ_REG_ARRAY 127 #define E1000_WRITE_REG_ARRAY(hw, reg, index, value) \ 128 E1000_WRITE_OFFSET(hw, E1000_REG_OFFSET(hw, reg) + ((index) << 2), value) 130 #define E1000_WRITE_REG_ARRAY_BYTE(hw, reg, index, value) \ 131 bus_space_write_1( ((struct em_osdep *)(hw)->back)->mem_bus_space_tag, \ 132 ((struct em_osdep *)(hw)->back)->mem_bus_space_handle, \ 133 E1000_REG_OFFSET(hw, reg) + (index), \ 136 #define E1000_WRITE_REG_ARRAY_WORD(hw, reg, index, value) \ 137 bus_space_write_2( ((struct em_osdep *)(hw)->back)->mem_bus_space_tag, \ 138 ((struct em_osdep *)(hw)->back)->mem_bus_space_handle, \ 139 E1000_REG_OFFSET(hw, reg) + (index), \ 142 #define E1000_WRITE_REG_ARRAY_DWORD(hw, reg, index, value) \ 143 E1000_WRITE_OFFSET(hw, E1000_REG_OFFSET(hw, reg) + ((index) << 2), value) Definition: rtemscompat1.h:15
Definition: if_em_osdep.h:87