From 1044d56390ed188adbc02aa369b24a2e9f098d89 Mon Sep 17 00:00:00 2001 From: joerg Date: Fri, 18 May 2007 14:10:37 +0000 Subject: [PATCH] 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). --- sys/dev/ic/rtl81x9.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 6db19b8e5b49..d91a981ed190 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -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 -__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);