Deleted Added
full compact
if_fe_pccard.c (189728) if_fe_pccard.c (189843)
1/*-
2 * All Rights Reserved, Copyright (C) Fujitsu Limited 1995
3 *
4 * This software may be used, modified, copied, distributed, and sold, in
5 * both source and binary form provided that the above copyright, these
6 * terms and the following disclaimer are retained. The name of the author
7 * and/or the contributor may not be used to endorse or promote products
8 * derived from this software without specific prior written permission.

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

17 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
19 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
20 * SUCH DAMAGE.
21 *
22 */
23
24#include <sys/cdefs.h>
1/*-
2 * All Rights Reserved, Copyright (C) Fujitsu Limited 1995
3 *
4 * This software may be used, modified, copied, distributed, and sold, in
5 * both source and binary form provided that the above copyright, these
6 * terms and the following disclaimer are retained. The name of the author
7 * and/or the contributor may not be used to endorse or promote products
8 * derived from this software without specific prior written permission.

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

17 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
19 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
20 * SUCH DAMAGE.
21 *
22 */
23
24#include <sys/cdefs.h>
25__FBSDID("$FreeBSD: head/sys/dev/fe/if_fe_pccard.c 189728 2009-03-12 07:18:27Z imp $");
25__FBSDID("$FreeBSD: head/sys/dev/fe/if_fe_pccard.c 189843 2009-03-15 02:31:34Z imp $");
26
27#include <sys/param.h>
28#include <sys/kernel.h>
29#include <sys/socket.h>
30#include <sys/systm.h>
31#include <sys/module.h>
32
33#include <sys/bus.h>

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

57 */
58static int fe_pccard_probe(device_t);
59static int fe_pccard_attach(device_t);
60static int fe_pccard_detach(device_t);
61
62static const struct fe_pccard_product {
63 struct pccard_product mpp_product;
64 int mpp_flags;
26
27#include <sys/param.h>
28#include <sys/kernel.h>
29#include <sys/socket.h>
30#include <sys/systm.h>
31#include <sys/module.h>
32
33#include <sys/bus.h>

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

57 */
58static int fe_pccard_probe(device_t);
59static int fe_pccard_attach(device_t);
60static int fe_pccard_detach(device_t);
61
62static const struct fe_pccard_product {
63 struct pccard_product mpp_product;
64 int mpp_flags;
65 int mpp_cfe;
65#define MPP_MBH10302 1
66#define MPP_ANYFUNC 2
66#define MPP_MBH10302 1
67#define MPP_ANYFUNC 2
67#define MPP_SKIP_TO_CFE_10 4
68#define MPP_SKIP_TO_CFE 4
68} fe_pccard_products[] = {
69 /* These need to be first */
70 { PCMCIA_CARD(FUJITSU2, FMV_J181), MPP_MBH10302 },
71 { PCMCIA_CARD(FUJITSU2, FMV_J182), 0 },
72 { PCMCIA_CARD(FUJITSU2, FMV_J182A), 0 },
73 { PCMCIA_CARD(FUJITSU2, ITCFJ182A), 0 },
74 /* These need to be second */
75 { PCMCIA_CARD(TDK, LAK_CD021BX), 0 },
76 { PCMCIA_CARD(TDK, LAK_CF010), 0 },
77#if 0 /* XXX 86960-based? */
78 { PCMCIA_CARD(TDK, LAK_DFL9610), 0 },
79#endif
69} fe_pccard_products[] = {
70 /* These need to be first */
71 { PCMCIA_CARD(FUJITSU2, FMV_J181), MPP_MBH10302 },
72 { PCMCIA_CARD(FUJITSU2, FMV_J182), 0 },
73 { PCMCIA_CARD(FUJITSU2, FMV_J182A), 0 },
74 { PCMCIA_CARD(FUJITSU2, ITCFJ182A), 0 },
75 /* These need to be second */
76 { PCMCIA_CARD(TDK, LAK_CD021BX), 0 },
77 { PCMCIA_CARD(TDK, LAK_CF010), 0 },
78#if 0 /* XXX 86960-based? */
79 { PCMCIA_CARD(TDK, LAK_DFL9610), 0 },
80#endif
80 { PCMCIA_CARD(CONTEC, CNETPC), 0 },
81 { PCMCIA_CARD(CONTEC, CNETPC), MPP_SKIP_TO_CFE, 2 },
81 { PCMCIA_CARD(FUJITSU, LA501), 0 },
82 { PCMCIA_CARD(FUJITSU, LA10S), 0 },
83 { PCMCIA_CARD(FUJITSU, NE200T), MPP_MBH10302 },/* Sold by Eagle */
82 { PCMCIA_CARD(FUJITSU, LA501), 0 },
83 { PCMCIA_CARD(FUJITSU, LA10S), 0 },
84 { PCMCIA_CARD(FUJITSU, NE200T), MPP_MBH10302 },/* Sold by Eagle */
84 { PCMCIA_CARD(HITACHI, HT_4840), MPP_MBH10302 | MPP_SKIP_TO_CFE_10},
85 { PCMCIA_CARD(HITACHI, HT_4840), MPP_MBH10302 | MPP_SKIP_TO_CFE, 10 },
85 { PCMCIA_CARD(RATOC, REX_R280), 0 },
86 { PCMCIA_CARD(XIRCOM, CE), MPP_ANYFUNC },
87 { { NULL } }
88};
89
90static int
91fe_pccard_probe(device_t dev)
92{

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

103 if (pp->mpp_flags & MPP_ANYFUNC)
104 return (0);
105 /* Make sure we're a network function */
106 error = pccard_get_function(dev, &fcn);
107 if (error != 0)
108 return (error);
109 if (fcn != PCCARD_FUNCTION_NETWORK)
110 return (ENXIO);
86 { PCMCIA_CARD(RATOC, REX_R280), 0 },
87 { PCMCIA_CARD(XIRCOM, CE), MPP_ANYFUNC },
88 { { NULL } }
89};
90
91static int
92fe_pccard_probe(device_t dev)
93{

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

104 if (pp->mpp_flags & MPP_ANYFUNC)
105 return (0);
106 /* Make sure we're a network function */
107 error = pccard_get_function(dev, &fcn);
108 if (error != 0)
109 return (error);
110 if (fcn != PCCARD_FUNCTION_NETWORK)
111 return (ENXIO);
111 if (pp->mpp_flags & MPP_SKIP_TO_CFE_10) {
112 for (i = 10; i < 27; i++) {
112 if (pp->mpp_flags & MPP_SKIP_TO_CFE) {
113 for (i = pp->mpp_cfe; i < 32; i++) {
113 if (pccard_select_cfe(dev, i) == 0)
114 goto good;
115 }
116 device_printf(dev,
114 if (pccard_select_cfe(dev, i) == 0)
115 goto good;
116 }
117 device_printf(dev,
117 "Hitachi HT-4840-11 workaround failed\n");
118 "Failed to map CFE %d or higher\n", pp->mpp_cfe);
118 return ENXIO;
119 }
120 good:;
121 return (0);
122 }
123 return (ENXIO);
124}
125

--- 230 unchanged lines hidden ---
119 return ENXIO;
120 }
121 good:;
122 return (0);
123 }
124 return (ENXIO);
125}
126

--- 230 unchanged lines hidden ---