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
f002ad35
Commit
f002ad35
authored
Feb 02, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://bart.bkbits.net/ide-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
7bda0fae
48a59b60
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
83 additions
and
187 deletions
+83
-187
drivers/ide/ide-disk.c
drivers/ide/ide-disk.c
+2
-3
drivers/ide/ide-dma.c
drivers/ide/ide-dma.c
+11
-15
drivers/ide/ide-floppy.c
drivers/ide/ide-floppy.c
+2
-2
drivers/ide/ide-io.c
drivers/ide/ide-io.c
+18
-16
drivers/ide/ide-iops.c
drivers/ide/ide-iops.c
+21
-24
drivers/ide/ide-pnp.c
drivers/ide/ide-pnp.c
+1
-1
drivers/ide/ide-probe.c
drivers/ide/ide-probe.c
+5
-1
drivers/ide/ide-tape.c
drivers/ide/ide-tape.c
+1
-1
drivers/ide/ide-taskfile.c
drivers/ide/ide-taskfile.c
+2
-2
drivers/ide/ide.c
drivers/ide/ide.c
+5
-5
drivers/ide/legacy/ide-cs.c
drivers/ide/legacy/ide-cs.c
+1
-1
drivers/ide/pci/Makefile
drivers/ide/pci/Makefile
+0
-1
drivers/ide/pci/adma100.c
drivers/ide/pci/adma100.c
+0
-30
drivers/ide/pci/adma100.h
drivers/ide/pci/adma100.h
+0
-28
drivers/ide/pci/it8172.c
drivers/ide/pci/it8172.c
+2
-2
drivers/ide/pci/it8172.h
drivers/ide/pci/it8172.h
+0
-3
drivers/ide/pci/opti621.c
drivers/ide/pci/opti621.c
+0
-5
drivers/ide/pci/opti621.h
drivers/ide/pci/opti621.h
+0
-3
drivers/ide/pci/piix.c
drivers/ide/pci/piix.c
+1
-15
drivers/ide/pci/piix.h
drivers/ide/pci/piix.h
+0
-3
drivers/ide/pci/sgiioc4.c
drivers/ide/pci/sgiioc4.c
+2
-1
drivers/ide/pci/siimage.c
drivers/ide/pci/siimage.c
+1
-1
drivers/scsi/ide-scsi.c
drivers/scsi/ide-scsi.c
+4
-4
include/linux/ide.h
include/linux/ide.h
+4
-20
No files found.
drivers/ide/ide-disk.c
View file @
f002ad35
...
...
@@ -132,7 +132,7 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
nsectors
.
all
=
(
u16
)
rq
->
nr_sectors
;
if
(
hwif
->
no_lba48_dma
&&
lba48
&&
dma
)
{
if
(
rq
->
sector
+
rq
->
nr_sectors
>
1ULL
<<
28
)
if
(
block
+
rq
->
nr_sectors
>
1ULL
<<
28
)
dma
=
0
;
}
...
...
@@ -253,8 +253,7 @@ ide_startstop_t __ide_do_rw_disk (ide_drive_t *drive, struct request *rq, sector
/* FIXME: ->OUTBSYNC ? */
hwif
->
OUTB
(
command
,
IDE_COMMAND_REG
);
pre_task_out_intr
(
drive
,
rq
);
return
ide_started
;
return
pre_task_out_intr
(
drive
,
rq
);
}
}
EXPORT_SYMBOL_GPL
(
__ide_do_rw_disk
);
...
...
drivers/ide/ide-dma.c
View file @
f002ad35
...
...
@@ -227,7 +227,9 @@ EXPORT_SYMBOL_GPL(ide_build_sglist);
* the PRD table that the IDE layer wants to be fed. The code
* knows about the 64K wrap bug in the CS5530.
*
* Returns 0 if all went okay, returns 1 otherwise.
* Returns the number of built PRD entries if all went okay,
* returns 0 otherwise.
*
* May also be invoked from trm290.c
*/
...
...
@@ -631,7 +633,7 @@ int __ide_dma_end (ide_drive_t *drive)
EXPORT_SYMBOL
(
__ide_dma_end
);
/* returns 1 if dma irq issued, 0 otherwise */
int
__ide_dma_test_irq
(
ide_drive_t
*
drive
)
static
int
__ide_dma_test_irq
(
ide_drive_t
*
drive
)
{
ide_hwif_t
*
hwif
=
HWIF
(
drive
);
u8
dma_stat
=
hwif
->
INB
(
hwif
->
dma_status
);
...
...
@@ -650,8 +652,6 @@ int __ide_dma_test_irq (ide_drive_t *drive)
drive
->
name
,
__FUNCTION__
);
return
0
;
}
EXPORT_SYMBOL
(
__ide_dma_test_irq
);
#endif
/* CONFIG_BLK_DEV_IDEDMA_PCI */
int
__ide_dma_bad_drive
(
ide_drive_t
*
drive
)
...
...
@@ -784,7 +784,7 @@ EXPORT_SYMBOL(__ide_dma_timeout);
/*
* Needed for allowing full modular support of ide-driver
*/
int
ide_release_dma_engine
(
ide_hwif_t
*
hwif
)
static
int
ide_release_dma_engine
(
ide_hwif_t
*
hwif
)
{
if
(
hwif
->
dmatable_cpu
)
{
pci_free_consistent
(
hwif
->
pci_dev
,
...
...
@@ -796,7 +796,7 @@ int ide_release_dma_engine (ide_hwif_t *hwif)
return
1
;
}
int
ide_release_iomio_dma
(
ide_hwif_t
*
hwif
)
static
int
ide_release_iomio_dma
(
ide_hwif_t
*
hwif
)
{
if
((
hwif
->
dma_extra
)
&&
(
hwif
->
channel
==
0
))
release_region
((
hwif
->
dma_base
+
16
),
hwif
->
dma_extra
);
...
...
@@ -820,7 +820,7 @@ int ide_release_dma (ide_hwif_t *hwif)
return
ide_release_iomio_dma
(
hwif
);
}
int
ide_allocate_dma_engine
(
ide_hwif_t
*
hwif
)
static
int
ide_allocate_dma_engine
(
ide_hwif_t
*
hwif
)
{
hwif
->
dmatable_cpu
=
pci_alloc_consistent
(
hwif
->
pci_dev
,
PRD_ENTRIES
*
PRD_BYTES
,
...
...
@@ -830,14 +830,13 @@ int ide_allocate_dma_engine (ide_hwif_t *hwif)
return
0
;
printk
(
KERN_ERR
"%s: -- Error, unable to allocate%s DMA table(s).
\n
"
,
(
hwif
->
dmatable_cpu
==
NULL
)
?
" CPU"
:
""
,
hwif
->
cds
->
name
);
hwif
->
cds
->
name
,
!
hwif
->
dmatable_cpu
?
" CPU"
:
""
);
ide_release_dma_engine
(
hwif
);
return
1
;
}
int
ide_mapped_mmio_dma
(
ide_hwif_t
*
hwif
,
unsigned
long
base
,
unsigned
int
ports
)
static
int
ide_mapped_mmio_dma
(
ide_hwif_t
*
hwif
,
unsigned
long
base
,
unsigned
int
ports
)
{
printk
(
KERN_INFO
" %s: MMIO-DMA "
,
hwif
->
name
);
...
...
@@ -852,7 +851,7 @@ int ide_mapped_mmio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int port
return
0
;
}
int
ide_iomio_dma
(
ide_hwif_t
*
hwif
,
unsigned
long
base
,
unsigned
int
ports
)
static
int
ide_iomio_dma
(
ide_hwif_t
*
hwif
,
unsigned
long
base
,
unsigned
int
ports
)
{
printk
(
KERN_INFO
" %s: BM-DMA at 0x%04lx-0x%04lx"
,
hwif
->
name
,
base
,
base
+
ports
-
1
);
...
...
@@ -881,10 +880,7 @@ int ide_iomio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int ports)
return
0
;
}
/*
*
*/
int
ide_dma_iobase
(
ide_hwif_t
*
hwif
,
unsigned
long
base
,
unsigned
int
ports
)
static
int
ide_dma_iobase
(
ide_hwif_t
*
hwif
,
unsigned
long
base
,
unsigned
int
ports
)
{
if
(
hwif
->
mmio
==
2
)
return
ide_mapped_mmio_dma
(
hwif
,
base
,
ports
);
...
...
drivers/ide/ide-floppy.c
View file @
f002ad35
...
...
@@ -585,7 +585,7 @@ static void idefloppy_input_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, uns
count
=
min
(
bvec
->
bv_len
,
bcount
);
data
=
bvec_kmap_irq
(
bvec
,
&
flags
);
atapi_input_bytes
(
drive
,
data
,
count
);
drive
->
hwif
->
atapi_input_bytes
(
drive
,
data
,
count
);
bvec_kunmap_irq
(
data
,
&
flags
);
bcount
-=
count
;
...
...
@@ -619,7 +619,7 @@ static void idefloppy_output_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, un
count
=
min
(
bvec
->
bv_len
,
bcount
);
data
=
bvec_kmap_irq
(
bvec
,
&
flags
);
atapi_output_bytes
(
drive
,
data
,
count
);
drive
->
hwif
->
atapi_output_bytes
(
drive
,
data
,
count
);
bvec_kunmap_irq
(
data
,
&
flags
);
bcount
-=
count
;
...
...
drivers/ide/ide-io.c
View file @
f002ad35
...
...
@@ -555,7 +555,7 @@ ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, u8 stat)
err
=
ide_dump_status
(
drive
,
msg
,
stat
);
if
(
drive
==
NULL
||
(
rq
=
HWGROUP
(
drive
)
->
rq
)
==
NULL
)
if
((
rq
=
HWGROUP
(
drive
)
->
rq
)
==
NULL
)
return
ide_stopped
;
/* retry only "normal" I/O: */
...
...
@@ -933,6 +933,7 @@ void ide_stall_queue (ide_drive_t *drive, unsigned long timeout)
if
(
timeout
>
WAIT_WORSTCASE
)
timeout
=
WAIT_WORSTCASE
;
drive
->
sleep
=
timeout
+
jiffies
;
drive
->
sleeping
=
1
;
}
EXPORT_SYMBOL
(
ide_stall_queue
);
...
...
@@ -972,18 +973,18 @@ static inline ide_drive_t *choose_drive (ide_hwgroup_t *hwgroup)
}
do
{
if
((
!
drive
->
sleep
||
time_after_eq
(
jiffies
,
drive
->
sleep
))
if
((
!
drive
->
sleep
ing
||
time_after_eq
(
jiffies
,
drive
->
sleep
))
&&
!
elv_queue_empty
(
drive
->
queue
))
{
if
(
!
best
||
(
drive
->
sleep
&&
(
!
best
->
sleep
||
0
<
(
signed
long
)(
best
->
sleep
-
drive
->
sleep
)))
||
(
!
best
->
sleep
&&
0
<
(
signed
long
)(
WAKEUP
(
best
)
-
WAKEUP
(
drive
))))
||
(
drive
->
sleep
ing
&&
(
!
best
->
sleeping
||
time_before
(
drive
->
sleep
,
best
->
sleep
)))
||
(
!
best
->
sleep
ing
&&
time_before
(
WAKEUP
(
drive
),
WAKEUP
(
best
))))
{
if
(
!
blk_queue_plugged
(
drive
->
queue
))
best
=
drive
;
}
}
}
while
((
drive
=
drive
->
next
)
!=
hwgroup
->
drive
);
if
(
best
&&
best
->
nice1
&&
!
best
->
sleep
&&
best
!=
hwgroup
->
drive
&&
best
->
service_time
>
WAIT_MIN_SLEEP
)
{
if
(
best
&&
best
->
nice1
&&
!
best
->
sleep
ing
&&
best
!=
hwgroup
->
drive
&&
best
->
service_time
>
WAIT_MIN_SLEEP
)
{
long
t
=
(
signed
long
)(
WAKEUP
(
best
)
-
jiffies
);
if
(
t
>=
WAIT_MIN_SLEEP
)
{
/*
...
...
@@ -992,10 +993,9 @@ static inline ide_drive_t *choose_drive (ide_hwgroup_t *hwgroup)
*/
drive
=
best
->
next
;
do
{
if
(
!
drive
->
sleep
/* FIXME: use time_before */
&&
0
<
(
signed
long
)(
WAKEUP
(
drive
)
-
(
jiffies
-
best
->
service_time
))
&&
0
<
(
signed
long
)((
jiffies
+
t
)
-
WAKEUP
(
drive
)))
if
(
!
drive
->
sleeping
&&
time_before
(
jiffies
-
best
->
service_time
,
WAKEUP
(
drive
))
&&
time_before
(
WAKEUP
(
drive
),
jiffies
+
t
))
{
ide_stall_queue
(
best
,
min_t
(
long
,
t
,
10
*
WAIT_MIN_SLEEP
));
goto
repeat
;
...
...
@@ -1058,14 +1058,17 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
hwgroup
->
busy
=
1
;
drive
=
choose_drive
(
hwgroup
);
if
(
drive
==
NULL
)
{
unsigned
long
sleep
=
0
;
int
sleeping
=
0
;
unsigned
long
sleep
=
0
;
/* shut up, gcc */
hwgroup
->
rq
=
NULL
;
drive
=
hwgroup
->
drive
;
do
{
if
(
drive
->
sleep
&&
(
!
sleep
||
0
<
(
signed
long
)(
sleep
-
drive
->
sleep
)))
if
(
drive
->
sleeping
&&
(
!
sleeping
||
time_before
(
drive
->
sleep
,
sleep
)))
{
sleeping
=
1
;
sleep
=
drive
->
sleep
;
}
}
while
((
drive
=
drive
->
next
)
!=
hwgroup
->
drive
);
if
(
sleep
)
{
if
(
sleep
ing
)
{
/*
* Take a short snooze, and then wake up this hwgroup again.
* This gives other hwgroups on the same a chance to
...
...
@@ -1105,7 +1108,7 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int masked_irq)
}
hwgroup
->
hwif
=
hwif
;
hwgroup
->
drive
=
drive
;
drive
->
sleep
=
0
;
drive
->
sleep
ing
=
0
;
drive
->
service_start
=
jiffies
;
if
(
blk_queue_plugged
(
drive
->
queue
))
{
...
...
@@ -1311,7 +1314,7 @@ void ide_timer_expiry (unsigned long data)
/* local CPU only,
* as if we were handling an interrupt */
local_irq_disable
();
if
(
hwgroup
->
poll
_timeout
!=
0
)
{
if
(
hwgroup
->
poll
ing
)
{
startstop
=
handler
(
drive
);
}
else
if
(
drive_is_ready
(
drive
))
{
if
(
drive
->
waiting_for_dma
)
...
...
@@ -1439,8 +1442,7 @@ irqreturn_t ide_intr (int irq, void *dev_id, struct pt_regs *regs)
return
IRQ_NONE
;
}
if
((
handler
=
hwgroup
->
handler
)
==
NULL
||
hwgroup
->
poll_timeout
!=
0
)
{
if
((
handler
=
hwgroup
->
handler
)
==
NULL
||
hwgroup
->
polling
)
{
/*
* Not expecting an interrupt from this drive.
* That means this could be:
...
...
drivers/ide/ide-iops.c
View file @
f002ad35
...
...
@@ -184,16 +184,6 @@ void default_hwif_mmiops (ide_hwif_t *hwif)
EXPORT_SYMBOL
(
default_hwif_mmiops
);
void
default_hwif_transport
(
ide_hwif_t
*
hwif
)
{
hwif
->
ata_input_data
=
ata_input_data
;
hwif
->
ata_output_data
=
ata_output_data
;
hwif
->
atapi_input_bytes
=
atapi_input_bytes
;
hwif
->
atapi_output_bytes
=
atapi_output_bytes
;
}
EXPORT_SYMBOL
(
default_hwif_transport
);
u32
ide_read_24
(
ide_drive_t
*
drive
)
{
u8
hcyl
=
HWIF
(
drive
)
->
INB
(
IDE_HCYL_REG
);
...
...
@@ -202,8 +192,6 @@ u32 ide_read_24 (ide_drive_t *drive)
return
(
hcyl
<<
16
)
|
(
lcyl
<<
8
)
|
sect
;
}
EXPORT_SYMBOL
(
ide_read_24
);
void
SELECT_DRIVE
(
ide_drive_t
*
drive
)
{
if
(
HWIF
(
drive
)
->
selectproc
)
...
...
@@ -240,7 +228,7 @@ void QUIRK_LIST (ide_drive_t *drive)
* of the sector count register location, with interrupts disabled
* to ensure that the reads all happen together.
*/
void
ata_vlb_sync
(
ide_drive_t
*
drive
,
unsigned
long
port
)
static
void
ata_vlb_sync
(
ide_drive_t
*
drive
,
unsigned
long
port
)
{
(
void
)
HWIF
(
drive
)
->
INB
(
port
);
(
void
)
HWIF
(
drive
)
->
INB
(
port
);
...
...
@@ -250,7 +238,7 @@ void ata_vlb_sync (ide_drive_t *drive, unsigned long port)
/*
* This is used for most PIO data transfers *from* the IDE interface
*/
void
ata_input_data
(
ide_drive_t
*
drive
,
void
*
buffer
,
u32
wcount
)
static
void
ata_input_data
(
ide_drive_t
*
drive
,
void
*
buffer
,
u32
wcount
)
{
ide_hwif_t
*
hwif
=
HWIF
(
drive
);
u8
io_32bit
=
drive
->
io_32bit
;
...
...
@@ -272,7 +260,7 @@ void ata_input_data (ide_drive_t *drive, void *buffer, u32 wcount)
/*
* This is used for most PIO data transfers *to* the IDE interface
*/
void
ata_output_data
(
ide_drive_t
*
drive
,
void
*
buffer
,
u32
wcount
)
static
void
ata_output_data
(
ide_drive_t
*
drive
,
void
*
buffer
,
u32
wcount
)
{
ide_hwif_t
*
hwif
=
HWIF
(
drive
);
u8
io_32bit
=
drive
->
io_32bit
;
...
...
@@ -299,7 +287,7 @@ void ata_output_data (ide_drive_t *drive, void *buffer, u32 wcount)
* extra byte allocated for the buffer.
*/
void
atapi_input_bytes
(
ide_drive_t
*
drive
,
void
*
buffer
,
u32
bytecount
)
static
void
atapi_input_bytes
(
ide_drive_t
*
drive
,
void
*
buffer
,
u32
bytecount
)
{
ide_hwif_t
*
hwif
=
HWIF
(
drive
);
...
...
@@ -316,9 +304,7 @@ void atapi_input_bytes (ide_drive_t *drive, void *buffer, u32 bytecount)
hwif
->
INSW
(
IDE_DATA_REG
,
((
u8
*
)
buffer
)
+
(
bytecount
&
~
0x03
),
1
);
}
EXPORT_SYMBOL
(
atapi_input_bytes
);
void
atapi_output_bytes
(
ide_drive_t
*
drive
,
void
*
buffer
,
u32
bytecount
)
static
void
atapi_output_bytes
(
ide_drive_t
*
drive
,
void
*
buffer
,
u32
bytecount
)
{
ide_hwif_t
*
hwif
=
HWIF
(
drive
);
...
...
@@ -335,7 +321,15 @@ void atapi_output_bytes (ide_drive_t *drive, void *buffer, u32 bytecount)
hwif
->
OUTSW
(
IDE_DATA_REG
,
((
u8
*
)
buffer
)
+
(
bytecount
&
~
0x03
),
1
);
}
EXPORT_SYMBOL
(
atapi_output_bytes
);
void
default_hwif_transport
(
ide_hwif_t
*
hwif
)
{
hwif
->
ata_input_data
=
ata_input_data
;
hwif
->
ata_output_data
=
ata_output_data
;
hwif
->
atapi_input_bytes
=
atapi_input_bytes
;
hwif
->
atapi_output_bytes
=
atapi_output_bytes
;
}
EXPORT_SYMBOL
(
default_hwif_transport
);
/*
* Beginning of Taskfile OPCODE Library and feature sets.
...
...
@@ -437,6 +431,7 @@ void ide_fix_driveid (struct hd_driveid *id)
#endif
}
/* FIXME: exported for use by the USB storage (isd200.c) code only */
EXPORT_SYMBOL
(
ide_fix_driveid
);
void
ide_fixstring
(
u8
*
s
,
const
int
bytecount
,
const
int
byteswap
)
...
...
@@ -1028,14 +1023,14 @@ static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive)
return
ide_started
;
}
/* end of polling */
hwgroup
->
poll
_timeout
=
0
;
hwgroup
->
poll
ing
=
0
;
printk
(
"%s: ATAPI reset timed-out, status=0x%02x
\n
"
,
drive
->
name
,
stat
);
/* do it the old fashioned way */
return
do_reset1
(
drive
,
1
);
}
/* done polling */
hwgroup
->
poll
_timeout
=
0
;
hwgroup
->
poll
ing
=
0
;
return
ide_stopped
;
}
...
...
@@ -1095,7 +1090,7 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
printk
(
"
\n
"
);
}
}
hwgroup
->
poll
_timeout
=
0
;
/* done polling */
hwgroup
->
poll
ing
=
0
;
/* done polling */
return
ide_stopped
;
}
...
...
@@ -1112,7 +1107,7 @@ static void check_dma_crc(ide_drive_t *drive)
#endif
}
void
pre_reset
(
ide_drive_t
*
drive
)
static
void
pre_reset
(
ide_drive_t
*
drive
)
{
DRIVER
(
drive
)
->
pre_reset
(
drive
);
...
...
@@ -1170,6 +1165,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
udelay
(
20
);
hwif
->
OUTB
(
WIN_SRST
,
IDE_COMMAND_REG
);
hwgroup
->
poll_timeout
=
jiffies
+
WAIT_WORSTCASE
;
hwgroup
->
polling
=
1
;
__ide_set_handler
(
drive
,
&
atapi_reset_pollfunc
,
HZ
/
20
,
NULL
);
spin_unlock_irqrestore
(
&
ide_lock
,
flags
);
return
ide_started
;
...
...
@@ -1210,6 +1206,7 @@ static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi)
/* more than enough time */
udelay
(
10
);
hwgroup
->
poll_timeout
=
jiffies
+
WAIT_WORSTCASE
;
hwgroup
->
polling
=
1
;
__ide_set_handler
(
drive
,
&
reset_pollfunc
,
HZ
/
20
,
NULL
);
/*
...
...
drivers/ide/ide-pnp.c
View file @
f002ad35
...
...
@@ -21,7 +21,7 @@
#include <linux/ide.h>
/* Add your devices here :)) */
struct
pnp_device_id
idepnp_devices
[]
=
{
st
atic
st
ruct
pnp_device_id
idepnp_devices
[]
=
{
/* Generic ESDI/IDE/ATA compatible hard disk controller */
{.
id
=
"PNP0600"
,
.
driver_data
=
0
},
{.
id
=
""
}
...
...
drivers/ide/ide-probe.c
View file @
f002ad35
...
...
@@ -841,7 +841,11 @@ int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)
if
(
fixup
)
fixup
(
hwif
);
hwif_init
(
hwif
);
if
(
!
hwif_init
(
hwif
))
{
printk
(
KERN_INFO
"%s: failed to initialize IDE interface
\n
"
,
hwif
->
name
);
return
-
1
;
}
if
(
hwif
->
present
)
{
u16
unit
=
0
;
...
...
drivers/ide/ide-tape.c
View file @
f002ad35
...
...
@@ -2439,7 +2439,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
tape
->
dsc_polling_start
=
jiffies
;
tape
->
dsc_polling_frequency
=
tape
->
best_dsc_rw_frequency
;
tape
->
dsc_timeout
=
jiffies
+
IDETAPE_DSC_RW_TIMEOUT
;
}
else
if
(
(
signed
long
)
(
jiffies
-
tape
->
dsc_timeout
)
>
0
)
{
}
else
if
(
time_after
(
jiffies
,
tape
->
dsc_timeout
)
)
{
printk
(
KERN_ERR
"ide-tape: %s: DSC timeout
\n
"
,
tape
->
name
);
if
(
rq
->
cmd
[
0
]
&
REQ_IDETAPE_PC2
)
{
...
...
drivers/ide/ide-taskfile.c
View file @
f002ad35
...
...
@@ -851,8 +851,8 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
hwif
->
OUTB
(
taskfile
->
high_cylinder
,
IDE_HCYL_REG
);
/*
* (ks) In the flagged taskfile approch, we will use
d
all specified
* registers and the register value will not be changed
. E
xcept the
* (ks) In the flagged taskfile approch, we will use all specified
* registers and the register value will not be changed
, e
xcept the
* select bit (master/slave) in the drive_head register. We must make
* sure that the desired drive is selected.
*/
...
...
drivers/ide/ide.c
View file @
f002ad35
...
...
@@ -333,7 +333,7 @@ static void __init init_ide_data (void)
* Returns a guessed speed in MHz.
*/
int
ide_system_bus_speed
(
void
)
static
int
ide_system_bus_speed
(
void
)
{
static
struct
pci_device_id
pci_default
[]
=
{
{
PCI_DEVICE
(
PCI_ANY_ID
,
PCI_ANY_ID
)
},
...
...
@@ -414,7 +414,7 @@ struct seq_operations ide_drivers_op = {
#ifdef CONFIG_PROC_FS
struct
proc_dir_entry
*
proc_ide_root
;
ide_proc_entry_t
generic_subdriver_entries
[]
=
{
static
ide_proc_entry_t
generic_subdriver_entries
[]
=
{
{
"capacity"
,
S_IFREG
|
S_IRUGO
,
proc_ide_read_capacity
,
NULL
},
{
NULL
,
0
,
NULL
,
NULL
}
};
...
...
@@ -1675,7 +1675,7 @@ static int __initdata is_chipset_set[MAX_HWIFS];
*
* Remember to update Documentation/ide.txt if you change something here.
*/
int
__init
ide_setup
(
char
*
s
)
static
int
__init
ide_setup
(
char
*
s
)
{
int
i
,
vals
[
3
];
ide_hwif_t
*
hwif
;
...
...
@@ -2261,7 +2261,7 @@ struct bus_type ide_bus_type = {
/*
* This is gets invoked once during initialization, to set *everything* up
*/
int
__init
ide_init
(
void
)
static
int
__init
ide_init
(
void
)
{
printk
(
KERN_INFO
"Uniform Multi-Platform E-IDE driver "
REVISION
"
\n
"
);
devfs_mk_dir
(
"ide"
);
...
...
@@ -2308,7 +2308,7 @@ int __init ide_init (void)
}
#ifdef MODULE
char
*
options
=
NULL
;
static
char
*
options
=
NULL
;
module_param
(
options
,
charp
,
0
);
MODULE_LICENSE
(
"GPL"
);
...
...
drivers/ide/legacy/ide-cs.c
View file @
f002ad35
...
...
@@ -209,7 +209,7 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
void
ide_config
(
dev_link_t
*
link
)
static
void
ide_config
(
dev_link_t
*
link
)
{
client_handle_t
handle
=
link
->
handle
;
ide_info_t
*
info
=
link
->
priv
;
...
...
drivers/ide/pci/Makefile
View file @
f002ad35
obj-$(CONFIG_BLK_DEV_ADMA100)
+=
adma100.o
obj-$(CONFIG_BLK_DEV_AEC62XX)
+=
aec62xx.o
obj-$(CONFIG_BLK_DEV_ALI15X3)
+=
alim15x3.o
obj-$(CONFIG_BLK_DEV_AMD74XX)
+=
amd74xx.o
...
...
drivers/ide/pci/adma100.c
deleted
100644 → 0
View file @
7bda0fae
/*
* linux/drivers/ide/pci/adma100.c -- basic support for Pacific Digital ADMA-100 boards
*
* Created 09 Apr 2002 by Mark Lord
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*/
#include <linux/mm.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <asm/io.h>
void
__init
ide_init_adma100
(
ide_hwif_t
*
hwif
)
{
unsigned
long
phy_admctl
=
pci_resource_start
(
hwif
->
pci_dev
,
4
)
+
0x80
+
(
hwif
->
channel
*
0x20
);
void
*
v_admctl
;
hwif
->
autodma
=
0
;
// not compatible with normal IDE DMA transfers
hwif
->
dma_base
=
0
;
// disable DMA completely
hwif
->
io_ports
[
IDE_CONTROL_OFFSET
]
+=
4
;
// chip needs offset of 6 instead of 2
v_admctl
=
ioremap_nocache
(
phy_admctl
,
1024
);
// map config regs, so we can turn on drive IRQs
*
((
unsigned
short
*
)
v_admctl
)
&=
3
;
// enable aIEN; preserve PIO mode
iounmap
(
v_admctl
);
// all done; unmap config regs
}
drivers/ide/pci/adma100.h
deleted
100644 → 0
View file @
7bda0fae
#ifndef ADMA_100_H
#define ADMA_100_H
#include <linux/config.h>
#include <linux/pci.h>
#include <linux/ide.h>
extern
void
init_setup_pdcadma
(
struct
pci_dev
*
,
ide_pci_device_t
*
);
extern
unsigned
int
init_chipset_pdcadma
(
struct
pci_dev
*
,
const
char
*
);
extern
void
init_hwif_pdcadma
(
ide_hwif_t
*
);
extern
void
init_dma_pdcadma
(
ide_hwif_t
*
,
unsigned
long
);
static
ide_pci_device_t
pdcadma_chipsets
[]
__devinitdata
=
{
{
.
vendor
=
PCI_VENDOR_ID_PDC
,
.
device
=
PCI_DEVICE_ID_PDC_1841
,
.
name
=
"ADMA100"
,
.
init_setup
=
init_setup_pdcadma
,
.
init_chipset
=
init_chipset_pdcadma
,
.
init_hwif
=
init_hwif_pdcadma
,
.
init_dma
=
init_dma_pdcadma
,
.
channels
=
2
,
.
autodma
=
NODMA
,
.
bootable
=
OFF_BOARD
,
}
}
#endif
/* ADMA_100_H */
drivers/ide/pci/it8172.c
View file @
f002ad35
...
...
@@ -56,7 +56,7 @@ static void it8172_tune_drive (ide_drive_t *drive, u8 pio)
{
ide_hwif_t
*
hwif
=
HWIF
(
drive
);
struct
pci_dev
*
dev
=
hwif
->
pci_dev
;
int
is_slave
=
(
hwif
->
drives
[
1
]
==
drive
);
int
is_slave
=
(
&
hwif
->
drives
[
1
]
==
drive
);
unsigned
long
flags
;
u16
drive_enables
;
u32
drive_timing
;
...
...
@@ -94,7 +94,7 @@ static void it8172_tune_drive (ide_drive_t *drive, u8 pio)
}
pci_write_config_word
(
dev
,
0x40
,
drive_enables
);
spin_unlock_irqrestore
(
&
ide_lock
,
flags
)
spin_unlock_irqrestore
(
&
ide_lock
,
flags
)
;
}
static
u8
it8172_dma_2_pio
(
u8
xfer_rate
)
...
...
drivers/ide/pci/it8172.h
View file @
f002ad35
...
...
@@ -6,7 +6,6 @@
#include <linux/ide.h>
static
u8
it8172_ratemask
(
ide_drive_t
*
drive
);
static
u8
it8172_ratefilter
(
ide_drive_t
*
drive
,
u8
speed
);
static
void
it8172_tune_drive
(
ide_drive_t
*
drive
,
u8
pio
);
static
u8
it8172_dma_2_pio
(
u8
xfer_rate
);
static
int
it8172_tune_chipset
(
ide_drive_t
*
drive
,
u8
xferspeed
);
...
...
@@ -14,14 +13,12 @@ static int it8172_tune_chipset(ide_drive_t *drive, u8 xferspeed);
static
int
it8172_config_chipset_for_dma
(
ide_drive_t
*
drive
);
#endif
static
void
init_setup_it8172
(
struct
pci_dev
*
,
ide_pci_device_t
*
);
static
unsigned
int
init_chipset_it8172
(
struct
pci_dev
*
,
const
char
*
);
static
void
init_hwif_it8172
(
ide_hwif_t
*
);
static
ide_pci_device_t
it8172_chipsets
[]
__devinitdata
=
{
{
/* 0 */
.
name
=
"IT8172G"
,
.
init_setup
=
init_setup_it8172
,
.
init_chipset
=
init_chipset_it8172
,
.
init_hwif
=
init_hwif_it8172
,
.
channels
=
2
,
...
...
drivers/ide/pci/opti621.c
View file @
f002ad35
...
...
@@ -348,11 +348,6 @@ static void __init init_hwif_opti621 (ide_hwif_t *hwif)
hwif
->
drives
[
1
].
autodma
=
hwif
->
autodma
;
}
static
int
__init
init_setup_opti621
(
struct
pci_dev
*
dev
,
ide_pci_device_t
*
d
)
{
return
ide_setup_pci_device
(
dev
,
d
);
}
static
int
__devinit
opti621_init_one
(
struct
pci_dev
*
dev
,
const
struct
pci_device_id
*
id
)
{
return
ide_setup_pci_device
(
dev
,
&
opti621_chipsets
[
id
->
driver_data
]);
...
...
drivers/ide/pci/opti621.h
View file @
f002ad35
...
...
@@ -5,13 +5,11 @@
#include <linux/pci.h>
#include <linux/ide.h>
static
int
init_setup_opti621
(
struct
pci_dev
*
,
ide_pci_device_t
*
);
static
void
init_hwif_opti621
(
ide_hwif_t
*
);
static
ide_pci_device_t
opti621_chipsets
[]
__devinitdata
=
{
{
/* 0 */
.
name
=
"OPTI621"
,
.
init_setup
=
init_setup_opti621
,
.
init_hwif
=
init_hwif_opti621
,
.
channels
=
2
,
.
autodma
=
AUTODMA
,
...
...
@@ -19,7 +17,6 @@ static ide_pci_device_t opti621_chipsets[] __devinitdata = {
.
bootable
=
ON_BOARD
,
},{
/* 1 */
.
name
=
"OPTI621X"
,
.
init_setup
=
init_setup_opti621
,
.
init_hwif
=
init_hwif_opti621
,
.
channels
=
2
,
.
autodma
=
AUTODMA
,
...
...
drivers/ide/pci/piix.c
View file @
f002ad35
...
...
@@ -530,20 +530,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
hwif
->
drives
[
0
].
autodma
=
hwif
->
autodma
;
}
/**
* init_setup_piix - callback for IDE initialize
* @dev: PIIX PCI device
* @d: IDE pci info
*
* Enable the xp fixup for the PIIX controller and then perform
* a standard ide PCI setup
*/
static
int
__devinit
init_setup_piix
(
struct
pci_dev
*
dev
,
ide_pci_device_t
*
d
)
{
return
ide_setup_pci_device
(
dev
,
d
);
}
/**
* piix_init_one - called when a PIIX is found
* @dev: the piix device
...
...
@@ -557,7 +543,7 @@ static int __devinit piix_init_one(struct pci_dev *dev, const struct pci_device_
{
ide_pci_device_t
*
d
=
&
piix_pci_info
[
id
->
driver_data
];
return
d
->
init_setup
(
dev
,
d
);
return
ide_setup_pci_device
(
dev
,
d
);
}
/**
...
...
drivers/ide/pci/piix.h
View file @
f002ad35
...
...
@@ -5,14 +5,12 @@
#include <linux/pci.h>
#include <linux/ide.h>
static
int
init_setup_piix
(
struct
pci_dev
*
,
ide_pci_device_t
*
);
static
unsigned
int
__devinit
init_chipset_piix
(
struct
pci_dev
*
,
const
char
*
);
static
void
init_hwif_piix
(
ide_hwif_t
*
);
#define DECLARE_PIIX_DEV(name_str) \
{ \
.name = name_str, \
.init_setup = init_setup_piix, \
.init_chipset = init_chipset_piix, \
.init_hwif = init_hwif_piix, \
.channels = 2, \
...
...
@@ -32,7 +30,6 @@ static ide_pci_device_t piix_pci_info[] __devinitdata = {
{
/* 2 */
.
name
=
"MPIIX"
,
.
init_setup
=
init_setup_piix
,
.
init_hwif
=
init_hwif_piix
,
.
channels
=
2
,
.
autodma
=
NODMA
,
...
...
drivers/ide/pci/sgiioc4.c
View file @
f002ad35
...
...
@@ -669,7 +669,8 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev, ide_pci_device_t * d)
printk
(
KERN_INFO
"%s: %s Bus-Master DMA disabled
\n
"
,
hwif
->
name
,
d
->
name
);
probe_hwif_init
(
hwif
);
if
(
probe_hwif_init
(
hwif
))
return
-
EIO
;
/* Create /proc/ide entries */
create_proc_ide_interfaces
();
...
...
drivers/ide/pci/siimage.c
View file @
f002ad35
...
...
@@ -590,7 +590,7 @@ static int siimage_reset_poll (ide_drive_t *drive)
if
((
hwif
->
INL
(
SATA_STATUS_REG
)
&
0x03
)
!=
0x03
)
{
printk
(
KERN_WARNING
"%s: reset phy dead, status=0x%08x
\n
"
,
hwif
->
name
,
hwif
->
INL
(
SATA_STATUS_REG
));
HWGROUP
(
drive
)
->
poll
_timeout
=
0
;
HWGROUP
(
drive
)
->
poll
ing
=
0
;
return
ide_started
;
}
return
0
;
...
...
drivers/scsi/ide-scsi.c
View file @
f002ad35
...
...
@@ -152,7 +152,7 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne
}
count
=
min
(
pc
->
sg
->
length
-
pc
->
b_count
,
bcount
);
buf
=
page_address
(
pc
->
sg
->
page
)
+
pc
->
sg
->
offset
;
atapi_input_bytes
(
drive
,
buf
+
pc
->
b_count
,
count
);
drive
->
hwif
->
atapi_input_bytes
(
drive
,
buf
+
pc
->
b_count
,
count
);
bcount
-=
count
;
pc
->
b_count
+=
count
;
if
(
pc
->
b_count
==
pc
->
sg
->
length
)
{
pc
->
sg
++
;
...
...
@@ -174,7 +174,7 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
}
count
=
min
(
pc
->
sg
->
length
-
pc
->
b_count
,
bcount
);
buf
=
page_address
(
pc
->
sg
->
page
)
+
pc
->
sg
->
offset
;
atapi_output_bytes
(
drive
,
buf
+
pc
->
b_count
,
count
);
drive
->
hwif
->
atapi_output_bytes
(
drive
,
buf
+
pc
->
b_count
,
count
);
bcount
-=
count
;
pc
->
b_count
+=
count
;
if
(
pc
->
b_count
==
pc
->
sg
->
length
)
{
pc
->
sg
++
;
...
...
@@ -481,7 +481,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
if
(
pc
->
sg
)
idescsi_input_buffers
(
drive
,
pc
,
temp
);
else
atapi_input_bytes
(
drive
,
pc
->
current_position
,
temp
);
drive
->
hwif
->
atapi_input_bytes
(
drive
,
pc
->
current_position
,
temp
);
printk
(
KERN_ERR
"ide-scsi: transferred %d of %d bytes
\n
"
,
temp
,
bcount
.
all
);
}
pc
->
actually_transferred
+=
temp
;
...
...
@@ -541,7 +541,7 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive)
/* Set the interrupt routine */
ide_set_handler
(
drive
,
&
idescsi_pc_intr
,
get_timeout
(
pc
),
idescsi_expiry
);
/* Send the actual packet */
atapi_output_bytes
(
drive
,
scsi
->
pc
->
c
,
12
);
drive
->
hwif
->
atapi_output_bytes
(
drive
,
scsi
->
pc
->
c
,
12
);
if
(
test_bit
(
PC_DMA_OK
,
&
pc
->
flags
))
{
set_bit
(
PC_DMA_IN_PROGRESS
,
&
pc
->
flags
);
hwif
->
dma_start
(
drive
);
...
...
include/linux/ide.h
View file @
f002ad35
...
...
@@ -187,11 +187,7 @@ typedef unsigned char byte; /* used everywhere */
* Timeouts for various operations:
*/
#define WAIT_DRQ (HZ/10)
/* 100msec - spec allows up to 20ms */
#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
#define WAIT_READY (5*HZ)
/* 5sec - some laptops are very slow */
#else
#define WAIT_READY (HZ/10)
/* 100msec - should be instantaneous */
#endif
/* CONFIG_APM || CONFIG_APM_MODULE */
#define WAIT_PIDENTIFY (10*HZ)
/* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */
#define WAIT_WORSTCASE (30*HZ)
/* 30sec - worst case when spinning up */
#define WAIT_CMD (10*HZ)
/* 10sec - maximum wait for an IRQ to happen */
...
...
@@ -721,6 +717,7 @@ typedef struct ide_drive_s {
* 3=64-bit
*/
unsigned
scsi
:
1
;
/* 0=default, 1=ide-scsi emulation */
unsigned
sleeping
:
1
;
/* 1=sleeping & sleep field valid */
u8
quirk_list
;
/* considered quirky, set for a specific host */
u8
init_speed
;
/* transfer rate set at boot */
...
...
@@ -937,7 +934,9 @@ typedef struct hwgroup_s {
/* BOOL: protects all fields below */
volatile
int
busy
;
/* BOOL: wake us up on timer expiry */
int
sleeping
;
int
sleeping
:
1
;
/* BOOL: polling active & poll_timeout field valid */
int
polling
:
1
;
/* current drive */
ide_drive_t
*
drive
;
/* ptr to current hwif in linked-list */
...
...
@@ -1297,11 +1296,6 @@ extern void SELECT_INTERRUPT(ide_drive_t *);
extern
void
SELECT_MASK
(
ide_drive_t
*
,
int
);
extern
void
QUIRK_LIST
(
ide_drive_t
*
);
extern
void
ata_input_data
(
ide_drive_t
*
,
void
*
,
u32
);
extern
void
ata_output_data
(
ide_drive_t
*
,
void
*
,
u32
);
extern
void
atapi_input_bytes
(
ide_drive_t
*
,
void
*
,
u32
);
extern
void
atapi_output_bytes
(
ide_drive_t
*
,
void
*
,
u32
);
extern
int
drive_is_ready
(
ide_drive_t
*
);
extern
int
wait_for_ready
(
ide_drive_t
*
,
int
/* timeout */
);
...
...
@@ -1340,14 +1334,6 @@ extern int taskfile_lib_get_identify(ide_drive_t *drive, u8 *);
extern
int
ide_wait_not_busy
(
ide_hwif_t
*
hwif
,
unsigned
long
timeout
);
ide_startstop_t
__ide_do_rw_disk
(
ide_drive_t
*
drive
,
struct
request
*
rq
,
sector_t
block
);
/*
* ide_system_bus_speed() returns what we think is the system VESA/PCI
* bus speed (in MHz). This is used for calculating interface PIO timings.
* The default is 40 for known PCI systems, 50 otherwise.
* The "idebus=xx" parameter can be used to override this value.
*/
extern
int
ide_system_bus_speed
(
void
);
/*
* ide_stall_queue() can be used by a drive to give excess bandwidth back
* to the hwgroup by sleeping for timeout jiffies.
...
...
@@ -1361,7 +1347,6 @@ extern void do_ide_request(request_queue_t *);
extern
void
ide_init_subdrivers
(
void
);
extern
struct
block_device_operations
ide_fops
[];
extern
ide_proc_entry_t
generic_subdriver_entries
[];
extern
int
ata_attach
(
ide_drive_t
*
);
...
...
@@ -1458,7 +1443,6 @@ extern int __ide_dma_check(ide_drive_t *);
extern
int
ide_dma_setup
(
ide_drive_t
*
);
extern
void
ide_dma_start
(
ide_drive_t
*
);
extern
int
__ide_dma_end
(
ide_drive_t
*
);
extern
int
__ide_dma_test_irq
(
ide_drive_t
*
);
extern
int
__ide_dma_lostirq
(
ide_drive_t
*
);
extern
int
__ide_dma_timeout
(
ide_drive_t
*
);
#endif
/* CONFIG_BLK_DEV_IDEDMA_PCI */
...
...
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