| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ralink_eth.c,v 1.2 2011/07/28 15:38:49 matt Exp $ */ | | 1 | /* $NetBSD: ralink_eth.c,v 1.3 2011/08/01 23:01:40 matt Exp $ */ |
2 | /*- | | 2 | /*- |
3 | * Copyright (c) 2011 CradlePoint Technology, Inc. | | 3 | * Copyright (c) 2011 CradlePoint Technology, Inc. |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * | | 5 | * |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -19,53 +19,52 @@ | | | @@ -19,53 +19,52 @@ |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 | * POSSIBILITY OF SUCH DAMAGE. | | 26 | * POSSIBILITY OF SUCH DAMAGE. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | /* ralink_eth.c -- Ralink Ethernet Driver */ | | 29 | /* ralink_eth.c -- Ralink Ethernet Driver */ |
30 | | | 30 | |
31 | #include <sys/cdefs.h> | | 31 | #include <sys/cdefs.h> |
32 | __KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.2 2011/07/28 15:38:49 matt Exp $"); | | 32 | __KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.3 2011/08/01 23:01:40 matt Exp $"); |
33 | | | 33 | |
34 | #include <sys/param.h> | | 34 | #include <sys/param.h> |
| | | 35 | #include <sys/bus.h> |
35 | #include <sys/callout.h> | | 36 | #include <sys/callout.h> |
36 | #include <sys/device.h> | | 37 | #include <sys/device.h> |
37 | #include <sys/endian.h> | | 38 | #include <sys/endian.h> |
38 | #include <sys/errno.h> | | 39 | #include <sys/errno.h> |
39 | #include <sys/ioctl.h> | | 40 | #include <sys/ioctl.h> |
| | | 41 | #include <sys/intr.h> |
40 | #include <sys/kernel.h> | | 42 | #include <sys/kernel.h> |
41 | #include <sys/malloc.h> | | 43 | #include <sys/malloc.h> |
42 | #include <sys/mbuf.h> | | 44 | #include <sys/mbuf.h> |
43 | #include <sys/socket.h> | | 45 | #include <sys/socket.h> |
44 | #include <sys/systm.h> | | 46 | #include <sys/systm.h> |
45 | | | 47 | |
46 | #include <uvm/uvm_extern.h> | | 48 | #include <uvm/uvm_extern.h> |
47 | | | 49 | |
48 | #include <net/if.h> | | 50 | #include <net/if.h> |
49 | #include <net/if_dl.h> | | 51 | #include <net/if_dl.h> |
50 | #include <net/if_media.h> | | 52 | #include <net/if_media.h> |
51 | #include <net/if_ether.h> | | 53 | #include <net/if_ether.h> |
52 | #include <net/if_vlanvar.h> | | 54 | #include <net/if_vlanvar.h> |
53 | | | 55 | |
54 | #include <net/bpf.h> | | 56 | #include <net/bpf.h> |
55 | | | 57 | |
56 | #include <machine/bus.h> | | | |
57 | #include <machine/intr.h> | | | |
58 | | | | |
59 | #include <dev/mii/mii.h> | | 58 | #include <dev/mii/mii.h> |
60 | #include <dev/mii/miivar.h> | | 59 | #include <dev/mii/miivar.h> |
61 | #include <dev/mii/mii_bitbang.h> | | 60 | #include <dev/mii/mii_bitbang.h> |
62 | | | 61 | |
63 | #include <mips/ralink/ralink_var.h> | | 62 | #include <mips/ralink/ralink_var.h> |
64 | #include <mips/ralink/ralink_reg.h> | | 63 | #include <mips/ralink/ralink_reg.h> |
65 | #if 0 | | 64 | #if 0 |
66 | #define CPDEBUG /* XXX TMP DEBUG FIXME */ | | 65 | #define CPDEBUG /* XXX TMP DEBUG FIXME */ |
67 | #define RALINK_ETH_DEBUG /* XXX TMP DEBUG FIXME */ | | 66 | #define RALINK_ETH_DEBUG /* XXX TMP DEBUG FIXME */ |
68 | #define ENABLE_RALINK_DEBUG_ERROR 1 | | 67 | #define ENABLE_RALINK_DEBUG_ERROR 1 |
69 | #define ENABLE_RALINK_DEBUG_MISC 1 | | 68 | #define ENABLE_RALINK_DEBUG_MISC 1 |
70 | #define ENABLE_RALINK_DEBUG_INFO 1 | | 69 | #define ENABLE_RALINK_DEBUG_INFO 1 |
71 | #define ENABLE_RALINK_DEBUG_FORCE 1 | | 70 | #define ENABLE_RALINK_DEBUG_FORCE 1 |