If the interrupt status register reads as 0xffff in rtk_intr, assume

that the card is gone and abort the loop. This fixes hot-plugging of
cardbus cards.

From FreeBSD's rl(4).
This commit is contained in:
joerg 2007-05-18 14:10:37 +00:00
parent a6f33abf23
commit 1044d56390

View File

@ -1,4 +1,4 @@
/* $NetBSD: rtl81x9.c,v 1.73 2007/05/18 14:08:57 joerg Exp $ */
/* $NetBSD: rtl81x9.c,v 1.74 2007/05/18 14:10:37 joerg Exp $ */
/*
* Copyright (c) 1997, 1998
@ -86,7 +86,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.73 2007/05/18 14:08:57 joerg Exp $");
__KERNEL_RCSID(0, "$NetBSD: rtl81x9.c,v 1.74 2007/05/18 14:10:37 joerg Exp $");
#include "bpfilter.h"
#include "rnd.h"
@ -1249,6 +1249,10 @@ rtk_intr(void *arg)
for (;;) {
status = CSR_READ_2(sc, RTK_ISR);
if (status == 0xffff)
break; /* Card is gone... */
if (status)
CSR_WRITE_2(sc, RTK_ISR, status);