Deleted Added
full compact
if_ep_mca.c (132529) if_ep_mca.c (140523)
1/*-
2 * Copyright (c) 1999 Matthew N. Dodd <winter@jurai.net>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999 Matthew N. Dodd <winter@jurai.net>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep_mca.c 132529 2004-07-22 07:11:15Z imp $");
28__FBSDID("$FreeBSD: head/sys/dev/ep/if_ep_mca.c 140523 2005-01-20 19:39:33Z imp $");
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/socket.h>
33#include <sys/module.h>
34#include <sys/bus.h>
35
36#include <machine/bus.h>

--- 33 unchanged lines hidden (view full) ---

70 {EP_MCA_62F7, "3Com 3c529 EtherLink III (TP)"},
71
72 {0, NULL},
73};
74
75#define EP_MCA_IOPORT_POS MCA_ADP_POS(MCA_POS2)
76#define EP_MCA_IOPORT_MASK 0xfc
77#define EP_MCA_IOPORT_SIZE EP_IOSIZE
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/socket.h>
33#include <sys/module.h>
34#include <sys/bus.h>
35
36#include <machine/bus.h>

--- 33 unchanged lines hidden (view full) ---

70 {EP_MCA_62F7, "3Com 3c529 EtherLink III (TP)"},
71
72 {0, NULL},
73};
74
75#define EP_MCA_IOPORT_POS MCA_ADP_POS(MCA_POS2)
76#define EP_MCA_IOPORT_MASK 0xfc
77#define EP_MCA_IOPORT_SIZE EP_IOSIZE
78#define EP_MCA_IOPORT(pos) ((((u_int32_t)pos & EP_MCA_IOPORT_MASK) \
78#define EP_MCA_IOPORT(pos) ((((uint32_t)pos & EP_MCA_IOPORT_MASK) \
79 | 0x02) << 8)
80
81#define EP_MCA_IRQ_POS MCA_ADP_POS(MCA_POS3)
82#define EP_MCA_IRQ_MASK 0x0f
83#define EP_MCA_IRQ(pos) (pos & EP_MCA_IRQ_MASK)
84
85#define EP_MCA_MEDIA_POS MCA_ADP_POS(MCA_POS2)
86#define EP_MCA_MEDIA_MASK 0x03
87#define EP_MCA_MEDIA(pos) (pos & EP_MCA_MEDIA_MASK)
88
89static int
90ep_mca_probe(device_t dev)
91{
92 const char *desc;
79 | 0x02) << 8)
80
81#define EP_MCA_IRQ_POS MCA_ADP_POS(MCA_POS3)
82#define EP_MCA_IRQ_MASK 0x0f
83#define EP_MCA_IRQ(pos) (pos & EP_MCA_IRQ_MASK)
84
85#define EP_MCA_MEDIA_POS MCA_ADP_POS(MCA_POS2)
86#define EP_MCA_MEDIA_MASK 0x03
87#define EP_MCA_MEDIA(pos) (pos & EP_MCA_MEDIA_MASK)
88
89static int
90ep_mca_probe(device_t dev)
91{
92 const char *desc;
93 u_int32_t iobase = 0;
94 u_int8_t irq = 0;
95 u_int8_t pos;
93 uint32_t iobase = 0;
94 uint8_t irq = 0;
95 uint8_t pos;
96
97 desc = mca_match_id(mca_get_id(dev), ep_mca_devs);
98 if (!desc)
99 return (ENXIO);
100 device_set_desc(dev, desc);
101
102 pos = mca_pos_read(dev, EP_MCA_IOPORT_POS);
103 iobase = EP_MCA_IOPORT(pos);

--- 60 unchanged lines hidden ---
96
97 desc = mca_match_id(mca_get_id(dev), ep_mca_devs);
98 if (!desc)
99 return (ENXIO);
100 device_set_desc(dev, desc);
101
102 pos = mca_pos_read(dev, EP_MCA_IOPORT_POS);
103 iobase = EP_MCA_IOPORT(pos);

--- 60 unchanged lines hidden ---