2009-12-07 02:05:39 +03:00
|
|
|
/* $NetBSD: if_xivar.h,v 1.6 2009/12/06 23:05:39 dyoung Exp $ */
|
Split "xi" into a "xirc" frontend (similar to mhzc; it attaches two child
devices) and a "xi" backend.
My CE2 and CEM2 cards are now probed correctly. However, there are still
some problems with one model of the CE2, and the CEM2 doesn't seem to get
any modem interrupts.
While I'm at it, fix several bugs:
* The tuple scan for the MAC address was broken in multiple ways.
* xi_intr() did not deal well with a shared interrupt.
* We were setting the wrong page number to look at the receive status. (How
did this work???)
* Remove the xi_full_reset() from xi_reset(). Move the parts of
xi_full_reset() needed to undo the effect of xi_stop() into xi_init(). This
allows a stop/init pair to DTRT, and much quicker, as used by various
ioctl()s.
* Set the TRS register before reading the TSO register, as the Linux driver
does. While I'm at it, fix the name.
* Fix numerous problems with xi_set_address(). "Where do I begin?" There's a
chance that multicast works now, but I haven't tested it.
* Explicitly clear the MSR register, and also force SELECT_MII to 0 if we
didn't find any PHYs.
* Clean up some cruft that appears to be bogus.
Probably needs more work, but it's a start.
2004-08-08 09:56:08 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2004 Charles M. Hannum. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by Charles M. Hannum.
|
|
|
|
* 4. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "rnd.h"
|
|
|
|
|
|
|
|
#if NRND > 0
|
|
|
|
#include <sys/rnd.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct xi_softc {
|
2009-12-07 02:05:39 +03:00
|
|
|
device_t sc_dev; /* Generic device info */
|
Split "xi" into a "xirc" frontend (similar to mhzc; it attaches two child
devices) and a "xi" backend.
My CE2 and CEM2 cards are now probed correctly. However, there are still
some problems with one model of the CE2, and the CEM2 doesn't seem to get
any modem interrupts.
While I'm at it, fix several bugs:
* The tuple scan for the MAC address was broken in multiple ways.
* xi_intr() did not deal well with a shared interrupt.
* We were setting the wrong page number to look at the receive status. (How
did this work???)
* Remove the xi_full_reset() from xi_reset(). Move the parts of
xi_full_reset() needed to undo the effect of xi_stop() into xi_init(). This
allows a stop/init pair to DTRT, and much quicker, as used by various
ioctl()s.
* Set the TRS register before reading the TSO register, as the Linux driver
does. While I'm at it, fix the name.
* Fix numerous problems with xi_set_address(). "Where do I begin?" There's a
chance that multicast works now, but I haven't tested it.
* Explicitly clear the MSR register, and also force SELECT_MII to 0 if we
didn't find any PHYs.
* Clean up some cruft that appears to be bogus.
Probably needs more work, but it's a start.
2004-08-08 09:56:08 +04:00
|
|
|
struct ethercom sc_ethercom; /* Ethernet common part */
|
|
|
|
|
|
|
|
struct mii_data sc_mii; /* MII media information */
|
|
|
|
|
|
|
|
bus_space_tag_t sc_bst; /* Bus cookie */
|
|
|
|
bus_space_handle_t sc_bsh; /* Bus I/O handle */
|
|
|
|
|
|
|
|
/* Power management hooks and state. */
|
2005-02-04 05:10:35 +03:00
|
|
|
int (*sc_enable)(struct xi_softc *);
|
|
|
|
void (*sc_disable)(struct xi_softc *);
|
Split "xi" into a "xirc" frontend (similar to mhzc; it attaches two child
devices) and a "xi" backend.
My CE2 and CEM2 cards are now probed correctly. However, there are still
some problems with one model of the CE2, and the CEM2 doesn't seem to get
any modem interrupts.
While I'm at it, fix several bugs:
* The tuple scan for the MAC address was broken in multiple ways.
* xi_intr() did not deal well with a shared interrupt.
* We were setting the wrong page number to look at the receive status. (How
did this work???)
* Remove the xi_full_reset() from xi_reset(). Move the parts of
xi_full_reset() needed to undo the effect of xi_stop() into xi_init(). This
allows a stop/init pair to DTRT, and much quicker, as used by various
ioctl()s.
* Set the TRS register before reading the TSO register, as the Linux driver
does. While I'm at it, fix the name.
* Fix numerous problems with xi_set_address(). "Where do I begin?" There's a
chance that multicast works now, but I haven't tested it.
* Explicitly clear the MSR register, and also force SELECT_MII to 0 if we
didn't find any PHYs.
* Clean up some cruft that appears to be bogus.
Probably needs more work, but it's a start.
2004-08-08 09:56:08 +04:00
|
|
|
int sc_enabled;
|
|
|
|
|
|
|
|
int sc_chipset; /* Chipset type */
|
|
|
|
#define XI_CHIPSET_SCIPPER 0
|
|
|
|
#define XI_CHIPSET_MOHAWK 1
|
|
|
|
#define XI_CHIPSET_DINGO 2
|
|
|
|
u_int8_t sc_rev; /* Chip revision */
|
|
|
|
|
|
|
|
#if NRND > 0
|
|
|
|
rndsource_element_t sc_rnd_source;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2005-02-04 05:10:35 +03:00
|
|
|
void xi_attach(struct xi_softc *, u_int8_t *);
|
2009-05-12 18:38:26 +04:00
|
|
|
int xi_detach(device_t, int);
|
|
|
|
int xi_activate(device_t, enum devact);
|
2005-02-04 05:10:35 +03:00
|
|
|
int xi_intr(void *);
|