36 #ifndef _EM_H_DEFINED_ 37 #define _EM_H_DEFINED_ 40 #include <sys/param.h> 41 #include <sys/systm.h> 43 #include <sys/protosw.h> 44 #include <sys/socket.h> 45 #include <sys/malloc.h> 46 #include <sys/kernel.h> 48 #include <sys/module.h> 50 #include <sys/sockio.h> 51 #include <sys/sysctl.h> 54 #include <net/if_arp.h> 55 #include <net/ethernet.h> 56 #include <net/if_dl.h> 57 #include <net/if_media.h> 61 #include <net/if_types.h> 62 #include <net/if_vlan_var.h> 64 #include <net/if_types.h> 67 #include <netinet/in_systm.h> 68 #include <netinet/in.h> 69 #include <netinet/ip.h> 70 #include <netinet/tcp.h> 71 #include <netinet/udp.h> 75 #include <machine/bus.h> 77 #include <machine/resource.h> 80 #include <machine/clock.h> 81 #include <dev/pci/pcivar.h> 82 #include <dev/pci/pcireg.h> 84 #include <netinet/if_ether.h> 89 #include <sys/endian.h> 94 #include <dev/em/if_em_hw.h> 110 #define EM_MAX_TXD 256 123 #define EM_MAX_RXD 80 190 #define EM_MAX_INTR 3 195 #define EM_CHECKSUM_FEATURES (CSUM_TCP | CSUM_UDP) 200 #define EM_TX_TIMEOUT 5 207 #define EM_TX_CLEANUP_THRESHOLD EM_MAX_TXD / 8 209 #define EM_TX_CLEANUP_THRESHOLD (adapter->tx_cleanup_threshold) 217 #define DO_AUTO_NEG 1 225 #define WAIT_FOR_AUTO_NEG_DEFAULT 0 241 #define AUTONEG_ADV_DEFAULT (ADVERTISE_10_HALF | ADVERTISE_10_FULL | \ 242 ADVERTISE_100_HALF | ADVERTISE_100_FULL | \ 245 #define EM_VENDOR_ID 0x8086 246 #define EM_MMBA 0x0010 247 #define EM_ROUNDUP(size, unit) (((size) + (unit) - 1) & ~((unit) - 1)) 249 #define EM_JUMBO_PBA 0x00000028 250 #define EM_DEFAULT_PBA 0x00000030 251 #define EM_SMARTSPEED_DOWNSHIFT 3 252 #define EM_SMARTSPEED_MAX 15 255 #define MAX_NUM_MULTICAST_ADDRESSES 128 256 #define PCI_ANY_ID (~0U) 257 #define ETHER_ALIGN 2 261 #define DEBUG_IOCTL 0 264 #define INIT_DEBUGOUT(S) if (DEBUG_INIT) printf(S "\n") 265 #define INIT_DEBUGOUT1(S, A) if (DEBUG_INIT) printf(S "\n", A) 266 #define INIT_DEBUGOUT2(S, A, B) if (DEBUG_INIT) printf(S "\n", A, B) 267 #define IOCTL_DEBUGOUT(S) if (DEBUG_IOCTL) printf(S "\n") 268 #define IOCTL_DEBUGOUT1(S, A) if (DEBUG_IOCTL) printf(S "\n", A) 269 #define IOCTL_DEBUGOUT2(S, A, B) if (DEBUG_IOCTL) printf(S "\n", A, B) 270 #define HW_DEBUGOUT(S) if (DEBUG_HW) printf(S "\n") 271 #define HW_DEBUGOUT1(S, A) if (DEBUG_HW) printf(S "\n", A) 272 #define HW_DEBUGOUT2(S, A, B) if (DEBUG_HW) printf(S "\n", A, B) 276 #define EM_RXBUFFER_2048 2048 277 #define EM_RXBUFFER_4096 4096 278 #define EM_RXBUFFER_8192 8192 279 #define EM_RXBUFFER_16384 16384 281 #define EM_MAX_SCATTER 64 291 unsigned int vendor_id;
292 unsigned int device_id;
293 unsigned int subvendor_id;
294 unsigned int subdevice_id;
311 bus_addr_t dma_paddr;
314 bus_dma_tag_t dma_tag;
325 typedef enum _XSUM_CONTEXT_T {
353 struct arpcom interface_data;
362 struct resource *res_memory;
363 struct resource *res_ioport;
364 struct resource *res_interrupt;
365 void *int_handler_tag;
366 struct ifmedia media;
370 struct ifmedia media;
375 int em_insert_vlan_header;
378 unsigned char irq_no;
389 u_int8_t link_active;
390 u_int16_t link_speed;
391 u_int16_t link_duplex;
392 u_int32_t smartspeed;
398 XSUM_CONTEXT_T active_checksum_context;
411 u_int32_t next_avail_tx_desc;
412 u_int32_t oldest_used_tx_desc;
413 volatile u_int16_t num_tx_desc_avail;
414 u_int16_t num_tx_desc;
421 u_int16_t tx_cleanup_threshold;
434 u_int32_t next_rx_desc_to_check;
435 u_int16_t num_rx_desc;
436 u_int32_t rx_buffer_len;
447 unsigned long dropped_pkts;
448 unsigned long mbuf_alloc_failed;
449 unsigned long mbuf_cluster_failed;
450 unsigned long no_tx_desc_avail1;
451 unsigned long no_tx_desc_avail2;
452 unsigned long no_tx_map_avail;
453 unsigned long no_tx_dma_setup;
456 #define EM_PBA_BYTES_SHIFT 0xA 457 #define EM_TX_HEAD_ADDR_SHIFT 7 458 #define EM_PBA_TX_MASK 0xFFFF0000 459 #define EM_FIFO_HDR 0x10 461 #define EM_82547_PKT_THRESH 0x3e0 463 u_int32_t tx_fifo_size;
464 u_int32_t tx_fifo_head;
465 u_int32_t tx_fifo_head_addr;
466 u_int64_t tx_fifo_reset_cnt;
467 u_int64_t tx_fifo_wrk_cnt;
468 u_int32_t tx_head_addr;
471 boolean_t pcix_82544;
477 #define EM_LOCK_INIT(_sc, _name) \ 478 mtx_init(&(_sc)->mtx, _name, MTX_NETWORK_LOCK, MTX_DEF) 479 #define EM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx) 480 #define EM_LOCK(_sc) mtx_lock(&(_sc)->mtx) 481 #define EM_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) 482 #define EM_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->mtx, MA_OWNED)
Definition: if_em_hw.h:1212
Definition: if_em_hw.h:1283
Definition: rtemscompat1.h:15
Definition: if_gfevar.h:58
Definition: if_em_hw.h:696
Definition: rtemscompat_defs.h:91
Definition: if_fxpvar.h:78
Definition: if_em_hw.h:577
Definition: if_em_osdep.h:87
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:83
Definition: rtemsmain.c:734