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
Kirill Smelkov
linux
Commits
ffe75ef6
Commit
ffe75ef6
authored
Oct 09, 2005
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'upstream'
parents
9dc26323
e710245b
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
2863 additions
and
577 deletions
+2863
-577
Documentation/DocBook/libata.tmpl
Documentation/DocBook/libata.tmpl
+1072
-0
drivers/scsi/ahci.c
drivers/scsi/ahci.c
+25
-6
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+259
-174
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+494
-170
drivers/scsi/libata.h
drivers/scsi/libata.h
+6
-10
drivers/scsi/sata_mv.c
drivers/scsi/sata_mv.c
+953
-189
drivers/scsi/sata_nv.c
drivers/scsi/sata_nv.c
+8
-8
drivers/scsi/sata_promise.c
drivers/scsi/sata_promise.c
+3
-3
drivers/scsi/sata_sis.c
drivers/scsi/sata_sis.c
+1
-1
drivers/scsi/sata_uli.c
drivers/scsi/sata_uli.c
+1
-1
drivers/scsi/sata_via.c
drivers/scsi/sata_via.c
+1
-1
include/linux/ata.h
include/linux/ata.h
+17
-3
include/linux/libata.h
include/linux/libata.h
+23
-11
No files found.
Documentation/DocBook/libata.tmpl
View file @
ffe75ef6
This diff is collapsed.
Click to expand it.
drivers/scsi/ahci.c
View file @
ffe75ef6
...
...
@@ -672,17 +672,36 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
for
(
i
=
0
;
i
<
host_set
->
n_ports
;
i
++
)
{
struct
ata_port
*
ap
;
u32
tmp
;
VPRINTK
(
"port %u
\n
"
,
i
);
if
(
!
(
irq_stat
&
(
1
<<
i
)))
continue
;
ap
=
host_set
->
ports
[
i
];
tmp
=
irq_stat
&
(
1
<<
i
);
if
(
tmp
&&
ap
)
{
if
(
ap
)
{
struct
ata_queued_cmd
*
qc
;
qc
=
ata_qc_from_tag
(
ap
,
ap
->
active_tag
);
if
(
ahci_host_intr
(
ap
,
qc
))
irq_ack
|=
(
1
<<
i
);
if
(
!
ahci_host_intr
(
ap
,
qc
))
if
(
ata_ratelimit
())
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
printk
(
KERN_WARNING
"ahci(%s): unhandled interrupt on port %u
\n
"
,
pci_name
(
pdev
),
i
);
}
VPRINTK
(
"port %u
\n
"
,
i
);
}
else
{
VPRINTK
(
"port %u (no irq)
\n
"
,
i
);
if
(
ata_ratelimit
())
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
printk
(
KERN_WARNING
"ahci(%s): interrupt on disabled port %u
\n
"
,
pci_name
(
pdev
),
i
);
}
}
irq_ack
|=
(
1
<<
i
);
}
if
(
irq_ack
)
{
...
...
drivers/scsi/libata-core.c
View file @
ffe75ef6
This diff is collapsed.
Click to expand it.
drivers/scsi/libata-scsi.c
View file @
ffe75ef6
This diff is collapsed.
Click to expand it.
drivers/scsi/libata.h
View file @
ffe75ef6
...
...
@@ -39,6 +39,7 @@ struct ata_scsi_args {
/* libata-core.c */
extern
int
atapi_enabled
;
extern
int
ata_qc_complete_noop
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
);
extern
struct
ata_queued_cmd
*
ata_qc_new_init
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
);
extern
void
ata_qc_free
(
struct
ata_queued_cmd
*
qc
);
...
...
@@ -53,6 +54,9 @@ extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
/* libata-scsi.c */
extern
void
atapi_request_sense
(
struct
ata_port
*
ap
,
struct
ata_device
*
dev
,
struct
scsi_cmnd
*
cmd
);
extern
void
ata_scsi_scan_host
(
struct
ata_port
*
ap
);
extern
int
ata_scsi_error
(
struct
Scsi_Host
*
host
);
extern
unsigned
int
ata_scsiop_inq_std
(
struct
ata_scsi_args
*
args
,
u8
*
rbuf
,
unsigned
int
buflen
);
...
...
@@ -77,18 +81,10 @@ extern unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf,
extern
void
ata_scsi_badcmd
(
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_cmnd
*
),
u8
asc
,
u8
ascq
);
extern
void
ata_scsi_set_sense
(
struct
scsi_cmnd
*
cmd
,
u8
sk
,
u8
asc
,
u8
ascq
);
extern
void
ata_scsi_rbuf_fill
(
struct
ata_scsi_args
*
args
,
unsigned
int
(
*
actor
)
(
struct
ata_scsi_args
*
args
,
u8
*
rbuf
,
unsigned
int
buflen
));
static
inline
void
ata_bad_scsiop
(
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_cmnd
*
))
{
ata_scsi_badcmd
(
cmd
,
done
,
0x20
,
0x00
);
}
static
inline
void
ata_bad_cdb
(
struct
scsi_cmnd
*
cmd
,
void
(
*
done
)(
struct
scsi_cmnd
*
))
{
ata_scsi_badcmd
(
cmd
,
done
,
0x24
,
0x00
);
}
#endif
/* __LIBATA_H__ */
drivers/scsi/sata_mv.c
View file @
ffe75ef6
This diff is collapsed.
Click to expand it.
drivers/scsi/sata_nv.c
View file @
ffe75ef6
...
...
@@ -29,6 +29,8 @@
* NV-specific details such as register offsets, SATA phy location,
* hotplug info, etc.
*
* 0.09
* - Fixed bug introduced by 0.08's MCP51 and MCP55 support.
*
* 0.08
* - Added support for MCP51 and MCP55.
...
...
@@ -132,9 +134,7 @@ enum nv_host_type
GENERIC
,
NFORCE2
,
NFORCE3
,
CK804
,
MCP51
,
MCP55
CK804
};
static
struct
pci_device_id
nv_pci_tbl
[]
=
{
...
...
@@ -153,13 +153,13 @@ static struct pci_device_id nv_pci_tbl[] = {
{
PCI_VENDOR_ID_NVIDIA
,
PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
CK804
},
{
PCI_VENDOR_ID_NVIDIA
,
PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
MCP51
},
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
GENERIC
},
{
PCI_VENDOR_ID_NVIDIA
,
PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
MCP51
},
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
GENERIC
},
{
PCI_VENDOR_ID_NVIDIA
,
PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
MCP55
},
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
GENERIC
},
{
PCI_VENDOR_ID_NVIDIA
,
PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
MCP55
},
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
GENERIC
},
{
PCI_VENDOR_ID_NVIDIA
,
PCI_ANY_ID
,
PCI_ANY_ID
,
PCI_ANY_ID
,
PCI_CLASS_STORAGE_IDE
<<
8
,
0xffff00
,
GENERIC
},
...
...
@@ -405,7 +405,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
rc
=
-
ENOMEM
;
ppi
=
&
nv_port_info
;
probe_ent
=
ata_pci_init_native_mode
(
pdev
,
&
ppi
);
probe_ent
=
ata_pci_init_native_mode
(
pdev
,
&
ppi
,
ATA_PORT_PRIMARY
|
ATA_PORT_SECONDARY
);
if
(
!
probe_ent
)
goto
err_out_regions
;
...
...
drivers/scsi/sata_promise.c
View file @
ffe75ef6
...
...
@@ -438,11 +438,11 @@ static inline unsigned int pdc_host_intr( struct ata_port *ap,
break
;
default:
ap
->
stats
.
idle_irq
++
;
break
;
ap
->
stats
.
idle_irq
++
;
break
;
}
return
handled
;
return
handled
;
}
static
void
pdc_irq_clear
(
struct
ata_port
*
ap
)
...
...
drivers/scsi/sata_sis.c
View file @
ffe75ef6
...
...
@@ -263,7 +263,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
goto
err_out_regions
;
ppi
=
&
sis_port_info
;
probe_ent
=
ata_pci_init_native_mode
(
pdev
,
&
ppi
);
probe_ent
=
ata_pci_init_native_mode
(
pdev
,
&
ppi
,
ATA_PORT_PRIMARY
|
ATA_PORT_SECONDARY
);
if
(
!
probe_ent
)
{
rc
=
-
ENOMEM
;
goto
err_out_regions
;
...
...
drivers/scsi/sata_uli.c
View file @
ffe75ef6
...
...
@@ -202,7 +202,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
goto
err_out_regions
;
ppi
=
&
uli_port_info
;
probe_ent
=
ata_pci_init_native_mode
(
pdev
,
&
ppi
);
probe_ent
=
ata_pci_init_native_mode
(
pdev
,
&
ppi
,
ATA_PORT_PRIMARY
|
ATA_PORT_SECONDARY
);
if
(
!
probe_ent
)
{
rc
=
-
ENOMEM
;
goto
err_out_regions
;
...
...
drivers/scsi/sata_via.c
View file @
ffe75ef6
...
...
@@ -212,7 +212,7 @@ static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev)
struct
ata_probe_ent
*
probe_ent
;
struct
ata_port_info
*
ppi
=
&
svia_port_info
;
probe_ent
=
ata_pci_init_native_mode
(
pdev
,
&
ppi
);
probe_ent
=
ata_pci_init_native_mode
(
pdev
,
&
ppi
,
ATA_PORT_PRIMARY
|
ATA_PORT_SECONDARY
);
if
(
!
probe_ent
)
return
NULL
;
...
...
include/linux/ata.h
View file @
ffe75ef6
...
...
@@ -132,6 +132,7 @@ enum {
ATA_CMD_PACKET
=
0xA0
,
ATA_CMD_VERIFY
=
0x40
,
ATA_CMD_VERIFY_EXT
=
0x42
,
ATA_CMD_INIT_DEV_PARAMS
=
0x91
,
/* SETFEATURES stuff */
SETFEATURES_XFER
=
0x03
,
...
...
@@ -146,14 +147,14 @@ enum {
XFER_MW_DMA_2
=
0x22
,
XFER_MW_DMA_1
=
0x21
,
XFER_MW_DMA_0
=
0x20
,
XFER_SW_DMA_2
=
0x12
,
XFER_SW_DMA_1
=
0x11
,
XFER_SW_DMA_0
=
0x10
,
XFER_PIO_4
=
0x0C
,
XFER_PIO_3
=
0x0B
,
XFER_PIO_2
=
0x0A
,
XFER_PIO_1
=
0x09
,
XFER_PIO_0
=
0x08
,
XFER_SW_DMA_2
=
0x12
,
XFER_SW_DMA_1
=
0x11
,
XFER_SW_DMA_0
=
0x10
,
XFER_PIO_SLOW
=
0x00
,
/* ATAPI stuff */
...
...
@@ -181,6 +182,7 @@ enum {
ATA_TFLAG_ISADDR
=
(
1
<<
1
),
/* enable r/w to nsect/lba regs */
ATA_TFLAG_DEVICE
=
(
1
<<
2
),
/* enable r/w to device reg */
ATA_TFLAG_WRITE
=
(
1
<<
3
),
/* data dir: host->dev==1 (write) */
ATA_TFLAG_LBA
=
(
1
<<
4
),
/* enable LBA */
};
enum
ata_tf_protocols
{
...
...
@@ -250,6 +252,18 @@ struct ata_taskfile {
((u64) (id)[(n) + 1] << 16) | \
((u64) (id)[(n) + 0]) )
static
inline
int
ata_id_current_chs_valid
(
u16
*
id
)
{
/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
has not been issued to the device then the values of
id[54] to id[56] are vendor specific. */
return
(
id
[
53
]
&
0x01
)
&&
/* Current translation valid */
id
[
54
]
&&
/* cylinders in current translation */
id
[
55
]
&&
/* heads in current translation */
id
[
55
]
<=
16
&&
id
[
56
];
/* sectors in current translation */
}
static
inline
int
atapi_cdb_len
(
u16
*
dev_id
)
{
u16
tmp
=
dev_id
[
0
]
&
0x3
;
...
...
include/linux/libata.h
View file @
ffe75ef6
...
...
@@ -97,6 +97,7 @@ enum {
ATA_DFLAG_LBA48
=
(
1
<<
0
),
/* device supports LBA48 */
ATA_DFLAG_PIO
=
(
1
<<
1
),
/* device currently in PIO mode */
ATA_DFLAG_LOCK_SECTORS
=
(
1
<<
2
),
/* don't adjust max_sectors */
ATA_DFLAG_LBA
=
(
1
<<
3
),
/* device supports LBA */
ATA_DEV_UNKNOWN
=
0
,
/* unknown device */
ATA_DEV_ATA
=
1
,
/* ATA device */
...
...
@@ -154,17 +155,21 @@ enum {
ATA_SHIFT_UDMA
=
0
,
ATA_SHIFT_MWDMA
=
8
,
ATA_SHIFT_PIO
=
11
,
/* Masks for port functions */
ATA_PORT_PRIMARY
=
(
1
<<
0
),
ATA_PORT_SECONDARY
=
(
1
<<
1
),
};
enum
pio
_task_states
{
PIO
_ST_UNKNOWN
,
PIO
_ST_IDLE
,
PIO
_ST_POLL
,
PIO
_ST_TMOUT
,
PIO
_ST
,
PIO
_ST_LAST
,
PIO
_ST_LAST_POLL
,
PIO
_ST_ERR
,
enum
hsm
_task_states
{
HSM
_ST_UNKNOWN
,
HSM
_ST_IDLE
,
HSM
_ST_POLL
,
HSM
_ST_TMOUT
,
HSM
_ST
,
HSM
_ST_LAST
,
HSM
_ST_LAST_POLL
,
HSM
_ST_ERR
,
};
/* forward declarations */
...
...
@@ -282,6 +287,11 @@ struct ata_device {
u8
xfer_protocol
;
/* taskfile xfer protocol */
u8
read_cmd
;
/* opcode to use on read */
u8
write_cmd
;
/* opcode to use on write */
/* for CHS addressing */
u16
cylinders
;
/* Number of cylinders */
u16
heads
;
/* Number of heads */
u16
sectors
;
/* Number of sectors per track */
};
struct
ata_port
{
...
...
@@ -319,7 +329,7 @@ struct ata_port {
struct
work_struct
packet_task
;
struct
work_struct
pio_task
;
unsigned
int
pio
_task_state
;
unsigned
int
hsm
_task_state
;
unsigned
long
pio_task_timeout
;
void
*
private_data
;
...
...
@@ -400,6 +410,8 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn
extern
int
ata_scsi_error
(
struct
Scsi_Host
*
host
);
extern
int
ata_scsi_release
(
struct
Scsi_Host
*
host
);
extern
unsigned
int
ata_host_intr
(
struct
ata_port
*
ap
,
struct
ata_queued_cmd
*
qc
);
extern
int
ata_ratelimit
(
void
);
/*
* Default driver ops implementations
*/
...
...
@@ -452,7 +464,7 @@ struct pci_bits {
extern
void
ata_pci_host_stop
(
struct
ata_host_set
*
host_set
);
extern
struct
ata_probe_ent
*
ata_pci_init_native_mode
(
struct
pci_dev
*
pdev
,
struct
ata_port_info
**
port
);
ata_pci_init_native_mode
(
struct
pci_dev
*
pdev
,
struct
ata_port_info
**
port
,
int
portmask
);
extern
int
pci_test_config_bits
(
struct
pci_dev
*
pdev
,
struct
pci_bits
*
bits
);
#endif
/* CONFIG_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