1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup rtems_bsd_rtems |
---|
5 | * |
---|
6 | * @brief This file describes the divice structure. It was derived |
---|
7 | * from the libbsdport source. |
---|
8 | */ |
---|
9 | |
---|
10 | /* |
---|
11 | * COPYRIGHT (c) 2012. On-Line Applications Research Corporation (OAR). |
---|
12 | * All rights reserved. |
---|
13 | * |
---|
14 | * Redistribution and use in source and binary forms, with or without |
---|
15 | * modification, are permitted provided that the following conditions |
---|
16 | * are met: |
---|
17 | * 1. Redistributions of source code must retain the above copyright |
---|
18 | * notice, this list of conditions and the following disclaimer. |
---|
19 | * 2. Redistributions in binary form must reproduce the above copyright |
---|
20 | * notice, this list of conditions and the following disclaimer in the |
---|
21 | * documentation and/or other materials provided with the distribution. |
---|
22 | * |
---|
23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
---|
24 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
---|
27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
---|
29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
---|
30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
---|
31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
---|
32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
---|
33 | * SUCH DAMAGE. |
---|
34 | */ |
---|
35 | |
---|
36 | #ifndef _RTEMS_BSD_MACHINE_RTEMS_BSD_DEVICET_H_ |
---|
37 | #define _RTEMS_BSD_MACHINE_RTEMS_BSD_DEVICET_H_ |
---|
38 | |
---|
39 | #include <rtems.h> |
---|
40 | #include <rtems/bspIo.h> |
---|
41 | #include <stdarg.h> |
---|
42 | #include <stdio.h> |
---|
43 | |
---|
44 | #include <sys/queue.h> |
---|
45 | |
---|
46 | typedef struct device *device_t; |
---|
47 | |
---|
48 | typedef struct _pcidev_t { |
---|
49 | unsigned short bus; |
---|
50 | unsigned char dev; |
---|
51 | unsigned char fun; |
---|
52 | } pcidev_t; |
---|
53 | |
---|
54 | #define DEVICE_SOFTC_ALIGNMENT 16 |
---|
55 | |
---|
56 | struct device { |
---|
57 | union { |
---|
58 | pcidev_t pci; |
---|
59 | } bushdr; |
---|
60 | int type; |
---|
61 | STAILQ_ENTRY(device) list; |
---|
62 | const char *name; |
---|
63 | char nameunit[16]; /* NEVER use knowledge about the size of this -- we may change it */ |
---|
64 | int unit; |
---|
65 | char *desc; |
---|
66 | driver_t *drv; |
---|
67 | int attached; |
---|
68 | void *rawmem; /* back pointer */ |
---|
69 | struct rtems_bsdnet_ifconfig *ifconfig; |
---|
70 | char softc[] __attribute__ ((aligned(DEVICE_SOFTC_ALIGNMENT), may_alias)); |
---|
71 | /* a pointer to back to the device is installed past the 'softc' */ |
---|
72 | }; |
---|
73 | #endif |
---|