check if eisa card exists before tromping on dma
This commit is contained in:
parent
47b43066ee
commit
3013b3fdbc
|
@ -27,7 +27,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_ep.c,v 1.42 1994/07/01 23:08:11 deraadt Exp $
|
||||
* $Id: if_ep.c,v 1.43 1994/07/21 02:51:53 deraadt Exp $
|
||||
*/
|
||||
|
||||
#include "bpfilter.h"
|
||||
|
@ -160,6 +160,7 @@ epprobe(parent, self, aux)
|
|||
static int firsttime;
|
||||
int slot, port, i;
|
||||
u_short k, k2;
|
||||
u_char b1, b2;
|
||||
|
||||
if (firsttime==0) {
|
||||
firsttime = 1;
|
||||
|
@ -167,6 +168,14 @@ epprobe(parent, self, aux)
|
|||
/* find all EISA cards */
|
||||
for (slot = 1; slot < 8; slot++) {
|
||||
port = 0x1000 * slot;
|
||||
|
||||
b1 = inb(port + 0xc80);
|
||||
b2 = inb(port + 0xc81);
|
||||
/* XXX no card version checking performed! */
|
||||
if (CHAR1(b1, b2) != 'T' || CHAR2(b1, b2) != 'C' ||
|
||||
CHAR3(b1, b2) != 'M')
|
||||
continue;
|
||||
|
||||
outw(port + EP_COMMAND, GLOBAL_RESET);
|
||||
delay(1000);
|
||||
if (inw(port + EP_W0_MFG_ID) != MFG_ID)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_epreg.h,v 1.5 1994/07/01 23:08:15 deraadt Exp $
|
||||
* $Id: if_epreg.h,v 1.6 1994/07/21 02:51:58 deraadt Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -286,3 +286,7 @@
|
|||
#define ENABLE_UTP 0xc0
|
||||
#define DISABLE_UTP 0x0
|
||||
#define RX_BYTES_MASK (u_short) (0x07ff)
|
||||
|
||||
#define CHAR1(b1,b2) (((b1>>2) & 0x1f) | '@')
|
||||
#define CHAR2(b1,b2) (((b1<<3) & 0x18) | ((b2>>5) & 0x07) | '@')
|
||||
#define CHAR3(b1,b2) ((b2 & 0x1f) | '@')
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_ep.c,v 1.42 1994/07/01 23:08:11 deraadt Exp $
|
||||
* $Id: if_ep.c,v 1.43 1994/07/21 02:51:53 deraadt Exp $
|
||||
*/
|
||||
|
||||
#include "bpfilter.h"
|
||||
|
@ -160,6 +160,7 @@ epprobe(parent, self, aux)
|
|||
static int firsttime;
|
||||
int slot, port, i;
|
||||
u_short k, k2;
|
||||
u_char b1, b2;
|
||||
|
||||
if (firsttime==0) {
|
||||
firsttime = 1;
|
||||
|
@ -167,6 +168,14 @@ epprobe(parent, self, aux)
|
|||
/* find all EISA cards */
|
||||
for (slot = 1; slot < 8; slot++) {
|
||||
port = 0x1000 * slot;
|
||||
|
||||
b1 = inb(port + 0xc80);
|
||||
b2 = inb(port + 0xc81);
|
||||
/* XXX no card version checking performed! */
|
||||
if (CHAR1(b1, b2) != 'T' || CHAR2(b1, b2) != 'C' ||
|
||||
CHAR3(b1, b2) != 'M')
|
||||
continue;
|
||||
|
||||
outw(port + EP_COMMAND, GLOBAL_RESET);
|
||||
delay(1000);
|
||||
if (inw(port + EP_W0_MFG_ID) != MFG_ID)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: if_epreg.h,v 1.5 1994/07/01 23:08:15 deraadt Exp $
|
||||
* $Id: if_epreg.h,v 1.6 1994/07/21 02:51:58 deraadt Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -286,3 +286,7 @@
|
|||
#define ENABLE_UTP 0xc0
|
||||
#define DISABLE_UTP 0x0
|
||||
#define RX_BYTES_MASK (u_short) (0x07ff)
|
||||
|
||||
#define CHAR1(b1,b2) (((b1>>2) & 0x1f) | '@')
|
||||
#define CHAR2(b1,b2) (((b1<<3) & 0x18) | ((b2>>5) & 0x07) | '@')
|
||||
#define CHAR3(b1,b2) ((b2 & 0x1f) | '@')
|
||||
|
|
Loading…
Reference in New Issue