2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
5 Desc: ReleaseCard() function.
9 #include <proto/exec.h>
11 #include "card_intern.h"
13 AROS_LH2(void, ReleaseCard
,
14 AROS_LHA(struct CardHandle
*, handle
, A1
),
15 AROS_LHA(ULONG
, flags
, D0
),
16 struct CardResource
*, CardResource
, 2, Card
)
20 CARDDEBUG(bug("ReleaseCard(%p,%08x) flags=%02x owned=%p removed=%d\n",
21 handle
, flags
, handle
->cah_CardFlags
, CardResource
->ownedcard
, CardResource
->removed
));
23 handle
->cah_CardFlags
&= ~CARDF_USED
;
24 if (CardResource
->ownedcard
== handle
) {
25 if (CardResource
->removed
== FALSE
)
26 handle
->cah_CardFlags
|= CARDF_USED
;
27 CardResource
->ownedcard
= NULL
;
28 pcmcia_reset(CardResource
);
29 pcmcia_enable_interrupts();
31 if (CardResource
->removed
== FALSE
)
32 pcmcia_newowner(CardResource
, TRUE
);
35 if (flags
& CARDF_REMOVEHANDLE
) {
37 Remove(&handle
->cah_CardNode
);
39 handle
->cah_CardFlags
&= ~CARDF_USED
;