version 1.39, 2002/10/02 16:51:26 |
version 1.39.6.2, 2004/08/25 06:58:05 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* documentation and/or other materials provided with the distribution. |
* 3. All advertising materials mentioning features or use of this software |
* 3. Neither the name of the University nor the names of its contributors |
* must display the following acknowledgement: |
|
* This product includes software developed by the University of |
|
* California, Berkeley and its contributors. |
|
* 4. Neither the name of the University nor the names of its contributors |
|
* may be used to endorse or promote products derived from this software |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* without specific prior written permission. |
* |
* |
Line 106 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 102 __KERNEL_RCSID(0, "$NetBSD$"); |
|
|
|
#include <dev/pci/if_levar.h> |
#include <dev/pci/if_levar.h> |
|
|
int le_pci_match __P((struct device *, struct cfdata *, void *)); |
static int le_pci_match(struct device *, struct cfdata *, void *); |
void le_pci_attach __P((struct device *, struct device *, void *)); |
static void le_pci_attach(struct device *, struct device *, void *); |
int le_pci_mediachange __P((struct lance_softc *)); |
static int le_pci_mediachange(struct lance_softc *); |
|
|
CFATTACH_DECL(le_pci, sizeof(struct le_softc), |
CFATTACH_DECL(le_pci, sizeof(struct le_softc), |
le_pci_match, le_pci_attach, NULL, NULL); |
le_pci_match, le_pci_attach, NULL, NULL); |
|
|
#if defined(_KERNEL_OPT) |
|
#include "opt_ddb.h" |
|
#endif |
|
|
|
#ifdef DDB |
|
#define integrate |
|
#define hide |
|
#else |
|
#define integrate static __inline |
|
#define hide static |
|
#endif |
|
|
|
hide void le_pci_wrcsr __P((struct lance_softc *, u_int16_t, u_int16_t)); |
|
hide u_int16_t le_pci_rdcsr __P((struct lance_softc *, u_int16_t)); |
|
|
|
/* |
/* |
* PCI constants. |
* PCI constants. |
* XXX These should be in a common file! |
* XXX These should be in a common file! |
Line 145 static int le_pci_supmedia[] = { |
|
Line 126 static int le_pci_supmedia[] = { |
|
IFM_ETHER|IFM_10_5|IFM_FDX, |
IFM_ETHER|IFM_10_5|IFM_FDX, |
}; |
}; |
|
|
hide void |
static void |
le_pci_wrcsr(sc, port, val) |
le_pci_wrcsr(struct lance_softc *sc, u_int16_t port, u_int16_t val) |
struct lance_softc *sc; |
|
u_int16_t port, val; |
|
{ |
{ |
struct le_softc *lesc = (struct le_softc *)sc; |
struct le_softc *lesc = (struct le_softc *)sc; |
bus_space_tag_t iot = lesc->sc_iot; |
bus_space_tag_t iot = lesc->sc_iot; |
Line 158 le_pci_wrcsr(sc, port, val) |
|
Line 137 le_pci_wrcsr(sc, port, val) |
|
bus_space_write_2(iot, ioh, lesc->sc_rdp, val); |
bus_space_write_2(iot, ioh, lesc->sc_rdp, val); |
} |
} |
|
|
hide u_int16_t |
static u_int16_t |
le_pci_rdcsr(sc, port) |
le_pci_rdcsr(struct lance_softc *sc, u_int16_t port) |
struct lance_softc *sc; |
|
u_int16_t port; |
|
{ |
{ |
struct le_softc *lesc = (struct le_softc *)sc; |
struct le_softc *lesc = (struct le_softc *)sc; |
bus_space_tag_t iot = lesc->sc_iot; |
bus_space_tag_t iot = lesc->sc_iot; |
Line 173 le_pci_rdcsr(sc, port) |
|
Line 150 le_pci_rdcsr(sc, port) |
|
return (val); |
return (val); |
} |
} |
|
|
int |
static int |
le_pci_mediachange(sc) |
le_pci_mediachange(struct lance_softc *sc) |
struct lance_softc *sc; |
|
{ |
{ |
struct le_softc *lesc = (struct le_softc *)sc; |
struct le_softc *lesc = (struct le_softc *)sc; |
bus_space_tag_t iot = lesc->sc_iot; |
bus_space_tag_t iot = lesc->sc_iot; |
Line 236 le_pci_mediachange(sc) |
|
Line 212 le_pci_mediachange(sc) |
|
return (0); |
return (0); |
} |
} |
|
|
int |
static int |
le_pci_match(parent, match, aux) |
le_pci_match(struct device *parent, struct cfdata *match, void *aux) |
struct device *parent; |
|
struct cfdata *match; |
|
void *aux; |
|
{ |
{ |
struct pci_attach_args *pa = aux; |
struct pci_attach_args *pa = aux; |
|
|
Line 255 le_pci_match(parent, match, aux) |
|
Line 228 le_pci_match(parent, match, aux) |
|
return (0); |
return (0); |
} |
} |
|
|
void |
static void |
le_pci_attach(parent, self, aux) |
le_pci_attach(struct device *parent, struct device *self, void *aux) |
struct device *parent, *self; |
|
void *aux; |
|
{ |
{ |
struct le_softc *lesc = (void *)self; |
struct le_softc *lesc = (void *)self; |
struct lance_softc *sc = &lesc->sc_am79900.lsc; |
struct lance_softc *sc = &lesc->sc_am79900.lsc; |