part revert commit 56211
[AROS.git] / arch / m68k-amiga / card / cardforcechange.c
blob75c4a35469e063d929a770476d2dcd2ae68773b1
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: CardForceChange() function.
6 Lang: english
7 */
9 #include <proto/exec.h>
11 #include "card_intern.h"
13 AROS_LH0(ULONG, CardForceChange,
14 struct CardResource*, CardResource, 15, Card)
16 AROS_LIBFUNC_INIT
18 CARDDEBUG(bug("CardForceChange()\n"));
20 if (CardResource->resetberr & GAYLE_IRQ_RESET)
21 return FALSE;
22 if (CardResource->removed)
23 return FALSE;
25 pcmcia_reset(CardResource);
26 CardResource->removed = TRUE;
27 pcmcia_removeowner(CardResource);
29 if (pcmcia_havecard()) {
30 /* Simulate re-insertion of current card */
31 CardResource->disabled = TRUE;
32 pcmcia_cardreset(CardResource);
33 pcmcia_enable_interrupts();
34 Signal(CardResource->task, CardResource->signalmask);
35 } else {
36 pcmcia_enable_interrupts();
39 return TRUE;
41 AROS_LIBFUNC_EXIT