From 3aee8d644fe3cdff916bf0ea52a48050bbce4fd3 Mon Sep 17 00:00:00 2001 From: haya Date: Thu, 25 Oct 2001 10:02:12 +0000 Subject: Prevent hang-up when a CardBus card is removed during the card is working. --- sys/dev/ic/elinkxlvar.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sys/dev/ic') diff --git a/sys/dev/ic/elinkxlvar.h b/sys/dev/ic/elinkxlvar.h index faa2cdc6e87..d64fcb2d702 100644 --- a/sys/dev/ic/elinkxlvar.h +++ b/sys/dev/ic/elinkxlvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: elinkxlvar.h,v 1.10 2001/01/30 19:27:40 thorpej Exp $ */ +/* $NetBSD: elinkxlvar.h,v 1.11 2001/10/25 10:02:12 haya Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -137,8 +137,13 @@ struct ex_softc { }; #define ex_waitcmd(sc) \ - while (bus_space_read_2((sc)->sc_iot, (sc)->sc_ioh, ELINK_STATUS) \ - & S_COMMAND_IN_PROGRESS); + do { \ + int stat; \ + do { \ + stat = bus_space_read_2((sc)->sc_iot, (sc)->sc_ioh, \ + ELINK_STATUS); \ + } while ((stat & S_COMMAND_IN_PROGRESS) && (stat != 0xffff)); \ + } while (0)\ u_int16_t exreadeeprom __P((bus_space_tag_t, bus_space_handle_t, int)); void ex_config __P((struct ex_softc *)); -- cgit