source: rtems/c/src/lib/libbsp/powerpc/beatnik/network/if_em/rtemscompat_defs.h @ 90b6801

4.115
Last change on this file since 90b6801 was 90b6801, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/11/11 at 12:44:28

2011-02-11 Ralf Corsépius <ralf.corsepius@…>

  • irq/discovery_pic.c, network/if_em/rtemscompat_defs.h,
  • network/if_gfe/rtemscompat_defs.h, startup/bspstart.c: Use "asm" instead of "asm" for improved c99-compliance.
  • Property mode set to 100644
File size: 3.1 KB
Line 
1#ifndef RTEMS_COMPAT_DEFS_H
2#define RTEMS_COMPAT_DEFS_H
3
4/* Number of device instances the driver should support
5 * - may be limited to 1 depending on IRQ API
6 * (braindamaged PC586 and powerpc)
7 */
8#define NETDRIVER_SLOTS 1
9
10/* String name to print with error messages */
11#define NETDRIVER       "em"
12/* Name snippet used to make global symbols unique to this driver */
13#define NETDRIVER_PREFIX em
14
15#define adapter                 em_softc
16#define interface_data  arpcom
17
18/* Define according to endianness of the *ethernet*chip*
19 * (not the CPU - most probably are LE)
20 * This must be either NET_CHIP_LE or NET_CHIP_BE
21 */
22
23#define NET_CHIP_LE
24#undef  NET_CHIP_BE
25
26/* Define either NET_CHIP_MEM_IO or NET_CHIP_PORT_IO,
27 * depending whether the CPU sees it in memory address space
28 * or (e.g. x86) uses special I/O instructions.
29 */
30#define NET_CHIP_MEM_IO
31#undef  NET_CHIP_PORT_IO
32
33/* The name of the hijacked 'bus handle' field in the softc
34 * structure. We use this field to store the chip's base address.
35 */
36#define NET_SOFTC_BHANDLE_FIELD osdep.mem_bus_space_handle
37
38/* define the names of the 'if_XXXreg.h' and 'if_XXXvar.h' headers
39 * (only if present, i.e., if the BSDNET driver has no respective
40 * header, leave this undefined).
41 *
42 */
43#define  IF_REG_HEADER <if_em.h>
44#undef  IF_VAR_HEADER
45
46/* define if a pci device */
47#define NETDRIVER_PCI <bsp/pci.h>
48
49/* Macros to disable and enable interrupts, respectively.
50 * The 'disable' macro is expanded in the ISR, the 'enable'
51 * macro is expanded in the driver task.
52 * The global network semaphore usually provides mutex
53 * protection of the device registers.
54 * Special care must be taken when coding the 'disable' macro,
55 * however to MAKE SURE THERE ARE NO OTHER SIDE EFFECTS such
56 * as:
57 *    - macro must not clear any status flags
58 *    - macro must save/restore any context information
59 *      (e.g., a address register pointer or a bank switch register)
60 *
61 * ARGUMENT: the macro arg is a pointer to the driver's 'softc' structure
62 */
63
64#define NET_ENABLE_IRQS(sc)     do { \
65                E1000_WRITE_REG(&sc->hw, IMS, (IMS_ENABLE_MASK)); \
66                } while (0)
67
68#define NET_DISABLE_IRQS(sc)    do { \
69                E1000_WRITE_REG(&sc->hw, IMC, 0xffffffff);      \
70                } while (0)
71               
72#define KASSERT(a...) do {} while (0)
73
74/* dmamap stuff; these are defined just to work with the current version
75 * of this driver and the implementation must be carefully checked if
76 * a newer version is merged.!
77 *
78 * The more cumbersome routines have been commented in the source, the
79 * simpler ones are defined to be NOOPs here so the source gets less
80 * cluttered...
81 *
82 * ASSUMPTIONS:
83 *
84 *        -> dmamap_sync cannot sync caches; assume we have HW snooping
85 *
86 */
87
88typedef unsigned bus_size_t;
89typedef unsigned bus_addr_t;
90
91typedef struct {
92        unsigned        ds_addr;
93        unsigned        ds_len;
94} bus_dma_segment_t;
95
96#define bus_dma_tag_destroy(args...) do {} while(0)
97
98#define bus_dmamap_destroy(args...) do {} while(0)
99
100#define bus_dmamap_unload(args...) do {} while (0)
101
102#ifdef __PPC__
103#define bus_dmamap_sync(args...) do { __asm__ volatile("sync":::"memory"); } while (0)
104#else
105#define bus_dmamap_sync(args...) do {} while (0)
106#endif
107
108#define BUS_DMA_NOWAIT          0xdeadbeef      /* unused */
109
110#endif
Note: See TracBrowser for help on using the repository browser.