Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
fab88a83
Commit
fab88a83
authored
Jan 18, 2004
by
Andrew Morton
Committed by
Linus Torvalds
Jan 18, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] CardServices removal for ide-cs
From: Arjan van de Ven <arjanv@redhat.com>
parent
fbb3bc6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
29 deletions
+28
-29
drivers/ide/legacy/ide-cs.c
drivers/ide/legacy/ide-cs.c
+28
-29
No files found.
drivers/ide/legacy/ide-cs.c
View file @
fab88a83
...
...
@@ -152,7 +152,7 @@ static dev_link_t *ide_attach(void)
client_reg
.
event_handler
=
&
ide_event
;
client_reg
.
Version
=
0x0210
;
client_reg
.
event_callback_args
.
client_data
=
link
;
ret
=
CardServices
(
RegisterClient
,
&
link
->
handle
,
&
client_reg
);
ret
=
pcmcia_register_client
(
&
link
->
handle
,
&
client_reg
);
if
(
ret
!=
CS_SUCCESS
)
{
cs_error
(
link
->
handle
,
RegisterClient
,
ret
);
ide_detach
(
link
);
...
...
@@ -188,7 +188,7 @@ static void ide_detach(dev_link_t *link)
ide_release
(
link
);
if
(
link
->
handle
)
{
ret
=
CardServices
(
DeregisterClient
,
link
->
handle
);
ret
=
pcmcia_deregister_client
(
link
->
handle
);
if
(
ret
!=
CS_SUCCESS
)
cs_error
(
link
->
handle
,
DeregisterClient
,
ret
);
}
...
...
@@ -207,11 +207,8 @@ static void ide_detach(dev_link_t *link)
======================================================================*/
#define CS_CHECK(fn, args...) \
while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed
#define CFG_CHECK(fn, args...) \
if (CardServices(fn, args) != 0) goto next_entry
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
static
int
idecs_register
(
unsigned
long
io
,
unsigned
long
ctl
,
unsigned
long
irq
)
{
...
...
@@ -241,16 +238,16 @@ void ide_config(dev_link_t *link)
tuple
.
TupleOffset
=
0
;
tuple
.
TupleDataMax
=
255
;
tuple
.
Attributes
=
0
;
tuple
.
DesiredTuple
=
CISTPL_CONFIG
;
CS_CHECK
(
GetFirstTuple
,
handle
,
&
tuple
);
CS_CHECK
(
GetTupleData
,
handle
,
&
tuple
);
CS_CHECK
(
ParseTuple
,
handle
,
&
tuple
,
&
parse
);
CS_CHECK
(
GetFirstTuple
,
pcmcia_get_first_tuple
(
handle
,
&
tuple
)
);
CS_CHECK
(
GetTupleData
,
pcmcia_get_tuple_data
(
handle
,
&
tuple
)
);
CS_CHECK
(
ParseTuple
,
pcmcia_parse_tuple
(
handle
,
&
tuple
,
&
parse
)
);
link
->
conf
.
ConfigBase
=
parse
.
config
.
base
;
link
->
conf
.
Present
=
parse
.
config
.
rmask
[
0
];
tuple
.
DesiredTuple
=
CISTPL_MANFID
;
if
(
!
CardServices
(
GetFirstTuple
,
handle
,
&
tuple
)
&&
!
CardServices
(
GetTupleData
,
handle
,
&
tuple
)
&&
!
CardServices
(
ParseTuple
,
handle
,
&
tuple
,
&
parse
))
if
(
!
pcmcia_get_first_tuple
(
handle
,
&
tuple
)
&&
!
pcmcia_get_tuple_data
(
handle
,
&
tuple
)
&&
!
pcmcia_parse_tuple
(
handle
,
&
tuple
,
&
parse
))
is_kme
=
((
parse
.
manfid
.
manf
==
MANFID_KME
)
&&
((
parse
.
manfid
.
card
==
PRODID_KME_KXLC005_A
)
||
(
parse
.
manfid
.
card
==
PRODID_KME_KXLC005_B
)));
...
...
@@ -259,16 +256,16 @@ void ide_config(dev_link_t *link)
link
->
state
|=
DEV_CONFIG
;
/* Not sure if this is right... look up the current Vcc */
CS_CHECK
(
GetConfigurationInfo
,
handle
,
&
conf
);
CS_CHECK
(
GetConfigurationInfo
,
pcmcia_get_configuration_info
(
handle
,
&
conf
)
);
link
->
conf
.
Vcc
=
conf
.
Vcc
;
pass
=
io_base
=
ctl_base
=
0
;
tuple
.
DesiredTuple
=
CISTPL_CFTABLE_ENTRY
;
tuple
.
Attributes
=
0
;
CS_CHECK
(
GetFirstTuple
,
handle
,
&
tuple
);
CS_CHECK
(
GetFirstTuple
,
pcmcia_get_first_tuple
(
handle
,
&
tuple
)
);
while
(
1
)
{
CFG_CHECK
(
GetTupleData
,
handle
,
&
tuple
)
;
CFG_CHECK
(
ParseTuple
,
handle
,
&
tuple
,
&
parse
)
;
if
(
pcmcia_get_tuple_data
(
handle
,
&
tuple
)
!=
0
)
goto
next_entry
;
if
(
pcmcia_parse_tuple
(
handle
,
&
tuple
,
&
parse
)
!=
0
)
goto
next_entry
;
/* Check for matching Vcc, unless we're desperate */
if
(
!
pass
)
{
...
...
@@ -299,13 +296,15 @@ void ide_config(dev_link_t *link)
link
->
io
.
NumPorts1
=
8
;
link
->
io
.
BasePort2
=
io
->
win
[
1
].
base
;
link
->
io
.
NumPorts2
=
(
is_kme
)
?
2
:
1
;
CFG_CHECK
(
RequestIO
,
link
->
handle
,
&
link
->
io
);
if
(
pcmcia_request_io
(
link
->
handle
,
&
link
->
io
)
!=
0
)
goto
next_entry
;
io_base
=
link
->
io
.
BasePort1
;
ctl_base
=
link
->
io
.
BasePort2
;
}
else
if
((
io
->
nwin
==
1
)
&&
(
io
->
win
[
0
].
len
>=
16
))
{
link
->
io
.
NumPorts1
=
io
->
win
[
0
].
len
;
link
->
io
.
NumPorts2
=
0
;
CFG_CHECK
(
RequestIO
,
link
->
handle
,
&
link
->
io
);
if
(
pcmcia_request_io
(
link
->
handle
,
&
link
->
io
)
!=
0
)
goto
next_entry
;
io_base
=
link
->
io
.
BasePort1
;
ctl_base
=
link
->
io
.
BasePort1
+
0x0e
;
}
else
goto
next_entry
;
...
...
@@ -316,16 +315,16 @@ void ide_config(dev_link_t *link)
next_entry:
if
(
cfg
->
flags
&
CISTPL_CFTABLE_DEFAULT
)
dflt
=
*
cfg
;
if
(
pass
)
{
CS_CHECK
(
GetNextTuple
,
handle
,
&
tuple
);
}
else
if
(
CardServices
(
GetNextTuple
,
handle
,
&
tuple
)
!=
0
)
{
CS_CHECK
(
GetFirstTuple
,
handle
,
&
tuple
);
CS_CHECK
(
GetNextTuple
,
pcmcia_get_next_tuple
(
handle
,
&
tuple
)
);
}
else
if
(
pcmcia_get_next_tuple
(
handle
,
&
tuple
)
!=
0
)
{
CS_CHECK
(
GetFirstTuple
,
pcmcia_get_first_tuple
(
handle
,
&
tuple
)
);
memset
(
&
dflt
,
0
,
sizeof
(
dflt
));
pass
++
;
}
}
CS_CHECK
(
RequestIRQ
,
handle
,
&
link
->
irq
);
CS_CHECK
(
RequestConfiguration
,
handle
,
&
link
->
conf
);
CS_CHECK
(
RequestIRQ
,
pcmcia_request_irq
(
handle
,
&
link
->
irq
)
);
CS_CHECK
(
RequestConfiguration
,
pcmcia_request_configuration
(
handle
,
&
link
->
conf
)
);
/* deal with brain dead IDE resource management */
release_region
(
link
->
io
.
BasePort1
,
link
->
io
.
NumPorts1
);
...
...
@@ -413,9 +412,9 @@ void ide_release(dev_link_t *link)
info
->
ndev
=
0
;
link
->
dev
=
NULL
;
CardServices
(
ReleaseConfiguration
,
link
->
handle
);
CardServices
(
ReleaseIO
,
link
->
handle
,
&
link
->
io
);
CardServices
(
ReleaseIRQ
,
link
->
handle
,
&
link
->
irq
);
pcmcia_release_configuration
(
link
->
handle
);
pcmcia_release_io
(
link
->
handle
,
&
link
->
io
);
pcmcia_release_irq
(
link
->
handle
,
&
link
->
irq
);
link
->
state
&=
~
DEV_CONFIG
;
...
...
@@ -452,14 +451,14 @@ int ide_event(event_t event, int priority,
/* Fall through... */
case
CS_EVENT_RESET_PHYSICAL
:
if
(
link
->
state
&
DEV_CONFIG
)
CardServices
(
ReleaseConfiguration
,
link
->
handle
);
pcmcia_release_configuration
(
link
->
handle
);
break
;
case
CS_EVENT_PM_RESUME
:
link
->
state
&=
~
DEV_SUSPEND
;
/* Fall through... */
case
CS_EVENT_CARD_RESET
:
if
(
DEV_OK
(
link
))
CardServices
(
RequestConfiguration
,
link
->
handle
,
&
link
->
conf
);
pcmcia_request_configuration
(
link
->
handle
,
&
link
->
conf
);
break
;
}
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment