Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
955c5038
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
955c5038
编写于
10月 29, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
上级
62d3af1b
2ab540be
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
719 addition
and
167 deletion
+719
-167
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+9
-9
drivers/scsi/libata-scsi.c
drivers/scsi/libata-scsi.c
+656
-130
drivers/scsi/libata.h
drivers/scsi/libata.h
+2
-1
drivers/scsi/pdc_adma.c
drivers/scsi/pdc_adma.c
+14
-14
drivers/scsi/sata_promise.c
drivers/scsi/sata_promise.c
+4
-0
drivers/scsi/sata_qstor.c
drivers/scsi/sata_qstor.c
+1
-1
drivers/scsi/sata_svw.c
drivers/scsi/sata_svw.c
+16
-6
drivers/scsi/sata_vsc.c
drivers/scsi/sata_vsc.c
+14
-6
include/scsi/scsi.h
include/scsi/scsi.h
+3
-0
未找到文件。
drivers/scsi/libata-core.c
浏览文件 @
955c5038
...
...
@@ -370,6 +370,8 @@ static void ata_tf_read_pio(struct ata_port *ap, struct ata_taskfile *tf)
{
struct
ata_ioports
*
ioaddr
=
&
ap
->
ioaddr
;
tf
->
command
=
ata_check_status
(
ap
);
tf
->
feature
=
ata_chk_err
(
ap
);
tf
->
nsect
=
inb
(
ioaddr
->
nsect_addr
);
tf
->
lbal
=
inb
(
ioaddr
->
lbal_addr
);
tf
->
lbam
=
inb
(
ioaddr
->
lbam_addr
);
...
...
@@ -402,6 +404,8 @@ static void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf)
{
struct
ata_ioports
*
ioaddr
=
&
ap
->
ioaddr
;
tf
->
command
=
ata_check_status
(
ap
);
tf
->
feature
=
ata_chk_err
(
ap
);
tf
->
nsect
=
readb
((
void
__iomem
*
)
ioaddr
->
nsect_addr
);
tf
->
lbal
=
readb
((
void
__iomem
*
)
ioaddr
->
lbal_addr
);
tf
->
lbam
=
readb
((
void
__iomem
*
)
ioaddr
->
lbam_addr
);
...
...
@@ -4254,11 +4258,10 @@ int ata_device_add(const struct ata_probe_ent *ent)
DPRINTK
(
"ENTER
\n
"
);
/* alloc a container for our list of ATA ports (buses) */
host_set
=
k
m
alloc
(
sizeof
(
struct
ata_host_set
)
+
host_set
=
k
z
alloc
(
sizeof
(
struct
ata_host_set
)
+
(
ent
->
n_ports
*
sizeof
(
void
*
)),
GFP_KERNEL
);
if
(
!
host_set
)
return
0
;
memset
(
host_set
,
0
,
sizeof
(
struct
ata_host_set
)
+
(
ent
->
n_ports
*
sizeof
(
void
*
)));
spin_lock_init
(
&
host_set
->
lock
);
host_set
->
dev
=
dev
;
...
...
@@ -4298,10 +4301,8 @@ int ata_device_add(const struct ata_probe_ent *ent)
count
++
;
}
if
(
!
count
)
{
kfree
(
host_set
);
return
0
;
}
if
(
!
count
)
goto
err_free_ret
;
/* obtain irq, that is shared between channels */
if
(
request_irq
(
ent
->
irq
,
ent
->
port_ops
->
irq_handler
,
ent
->
irq_flags
,
...
...
@@ -4359,6 +4360,7 @@ int ata_device_add(const struct ata_probe_ent *ent)
ata_host_remove
(
host_set
->
ports
[
i
],
1
);
scsi_host_put
(
host_set
->
ports
[
i
]
->
host
);
}
err_free_ret:
kfree
(
host_set
);
VPRINTK
(
"EXIT, returning 0
\n
"
);
return
0
;
...
...
@@ -4468,15 +4470,13 @@ ata_probe_ent_alloc(struct device *dev, const struct ata_port_info *port)
{
struct
ata_probe_ent
*
probe_ent
;
probe_ent
=
k
m
alloc
(
sizeof
(
*
probe_ent
),
GFP_KERNEL
);
probe_ent
=
k
z
alloc
(
sizeof
(
*
probe_ent
),
GFP_KERNEL
);
if
(
!
probe_ent
)
{
printk
(
KERN_ERR
DRV_NAME
"(%s): out of memory
\n
"
,
kobject_name
(
&
(
dev
->
kobj
)));
return
NULL
;
}
memset
(
probe_ent
,
0
,
sizeof
(
*
probe_ent
));
INIT_LIST_HEAD
(
&
probe_ent
->
node
);
probe_ent
->
dev
=
dev
;
...
...
drivers/scsi/libata-scsi.c
浏览文件 @
955c5038
此差异已折叠。
点击以展开。
drivers/scsi/libata.h
浏览文件 @
955c5038
...
...
@@ -50,13 +50,14 @@ extern void ata_dev_select(struct ata_port *ap, unsigned int device,
unsigned
int
wait
,
unsigned
int
can_sleep
);
extern
void
ata_tf_to_host_nolock
(
struct
ata_port
*
ap
,
const
struct
ata_taskfile
*
tf
);
extern
void
swap_buf_le16
(
u16
*
buf
,
unsigned
int
buf_words
);
extern
int
ata_task_ioctl
(
struct
scsi_device
*
scsidev
,
void
__user
*
arg
);
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
void
ata_to_sense_error
(
struct
ata_queued_cmd
*
qc
,
u8
drv_stat
);
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
);
...
...
drivers/scsi/pdc_adma.c
浏览文件 @
955c5038
...
...
@@ -46,7 +46,7 @@
#include <linux/libata.h>
#define DRV_NAME "pdc_adma"
#define DRV_VERSION "0.0
1
"
#define DRV_VERSION "0.0
3
"
/* macro to calculate base address for ATA regs */
#define ADMA_ATA_REGS(base,port_no) ((base) + ((port_no) * 0x40))
...
...
@@ -79,7 +79,6 @@ enum {
aNIEN
=
(
1
<<
8
),
/* irq mask: 1==masked */
aGO
=
(
1
<<
7
),
/* packet trigger ("Go!") */
aRSTADM
=
(
1
<<
5
),
/* ADMA logic reset */
aRSTA
=
(
1
<<
2
),
/* ATA hard reset */
aPIOMD4
=
0x0003
,
/* PIO mode 4 */
/* ADMA_STATUS register bits */
...
...
@@ -452,24 +451,25 @@ static inline unsigned int adma_intr_pkt(struct ata_host_set *host_set)
struct
adma_port_priv
*
pp
;
struct
ata_queued_cmd
*
qc
;
void
__iomem
*
chan
=
ADMA_REGS
(
mmio_base
,
port_no
);
u8
drv_stat
,
status
=
readb
(
chan
+
ADMA_STATUS
);
u8
drv_stat
=
0
,
status
=
readb
(
chan
+
ADMA_STATUS
);
if
(
status
==
0
)
continue
;
handled
=
1
;
adma_enter_reg_mode
(
ap
);
if
(
(
ap
->
flags
&
ATA_FLAG_PORT_DISABLED
))
if
(
ap
->
flags
&
(
ATA_FLAG_PORT_DISABLED
|
ATA_FLAG_NOINTR
))
continue
;
pp
=
ap
->
private_data
;
if
(
!
pp
||
pp
->
state
!=
adma_state_pkt
)
continue
;
qc
=
ata_qc_from_tag
(
ap
,
ap
->
active_tag
);
drv_stat
=
0
;
if
((
status
&
(
aPERR
|
aPSD
|
aUIRQ
)))
drv_stat
=
ATA_ERR
;
else
if
(
pp
->
pkt
[
0
]
!=
cDONE
)
drv_stat
=
ATA_ERR
;
ata_qc_complete
(
qc
,
drv_stat
);
if
(
qc
&&
(
!
(
qc
->
tf
.
ctl
&
ATA_NIEN
)))
{
if
((
status
&
(
aPERR
|
aPSD
|
aUIRQ
)))
drv_stat
=
ATA_ERR
;
else
if
(
pp
->
pkt
[
0
]
!=
cDONE
)
drv_stat
=
ATA_ERR
;
ata_qc_complete
(
qc
,
drv_stat
);
}
}
return
handled
;
}
...
...
@@ -490,7 +490,7 @@ static inline unsigned int adma_intr_mmio(struct ata_host_set *host_set)
if
(
qc
&&
(
!
(
qc
->
tf
.
ctl
&
ATA_NIEN
)))
{
/* check main status, clearing INTRQ */
u8
status
=
ata_chk_status
(
ap
);
u8
status
=
ata_ch
ec
k_status
(
ap
);
if
((
status
&
ATA_BUSY
))
continue
;
DPRINTK
(
"ata%u: protocol %d (dev_stat 0x%X)
\n
"
,
...
...
@@ -561,15 +561,15 @@ static int adma_port_start(struct ata_port *ap)
if
((
pp
->
pkt_dma
&
7
)
!=
0
)
{
printk
(
"bad alignment for pp->pkt_dma: %08x
\n
"
,
(
u32
)
pp
->
pkt_dma
);
goto
err_out_kfree2
;
dma_free_coherent
(
dev
,
ADMA_PKT_BYTES
,
pp
->
pkt
,
pp
->
pkt_dma
);
goto
err_out_kfree
;
}
memset
(
pp
->
pkt
,
0
,
ADMA_PKT_BYTES
);
ap
->
private_data
=
pp
;
adma_reinit_engine
(
ap
);
return
0
;
err_out_kfree2:
kfree
(
pp
);
err_out_kfree:
kfree
(
pp
);
err_out:
...
...
drivers/scsi/sata_promise.c
浏览文件 @
955c5038
...
...
@@ -195,6 +195,8 @@ static struct ata_port_info pdc_port_info[] = {
static
struct
pci_device_id
pdc_ata_pci_tbl
[]
=
{
{
PCI_VENDOR_ID_PROMISE
,
0x3371
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
board_2037x
},
{
PCI_VENDOR_ID_PROMISE
,
0x3570
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
board_2037x
},
{
PCI_VENDOR_ID_PROMISE
,
0x3571
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
board_2037x
},
{
PCI_VENDOR_ID_PROMISE
,
0x3373
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
...
...
@@ -207,6 +209,8 @@ static struct pci_device_id pdc_ata_pci_tbl[] = {
board_2037x
},
{
PCI_VENDOR_ID_PROMISE
,
0x3d75
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
board_2037x
},
{
PCI_VENDOR_ID_PROMISE
,
0x3d73
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
board_2037x
},
{
PCI_VENDOR_ID_PROMISE
,
0x3318
,
PCI_ANY_ID
,
PCI_ANY_ID
,
0
,
0
,
board_20319
},
...
...
drivers/scsi/sata_qstor.c
浏览文件 @
955c5038
...
...
@@ -433,7 +433,7 @@ static inline unsigned int qs_intr_mmio(struct ata_host_set *host_set)
if
(
qc
&&
(
!
(
qc
->
tf
.
ctl
&
ATA_NIEN
)))
{
/* check main status, clearing INTRQ */
u8
status
=
ata_chk_status
(
ap
);
u8
status
=
ata_ch
ec
k_status
(
ap
);
if
((
status
&
ATA_BUSY
))
continue
;
DPRINTK
(
"ata%u: protocol %d (dev_stat 0x%X)
\n
"
,
...
...
drivers/scsi/sata_svw.c
浏览文件 @
955c5038
...
...
@@ -84,6 +84,8 @@
/* Port stride */
#define K2_SATA_PORT_OFFSET 0x100
static
u8
k2_stat_check_status
(
struct
ata_port
*
ap
);
static
u32
k2_sata_scr_read
(
struct
ata_port
*
ap
,
unsigned
int
sc_reg
)
{
...
...
@@ -136,16 +138,24 @@ static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
static
void
k2_sata_tf_read
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
)
{
struct
ata_ioports
*
ioaddr
=
&
ap
->
ioaddr
;
u16
nsect
,
lbal
,
lbam
,
lbah
;
u16
nsect
,
lbal
,
lbam
,
lbah
,
feature
;
nsect
=
tf
->
nsect
=
readw
(
ioaddr
->
nsect_addr
);
lbal
=
tf
->
lbal
=
readw
(
ioaddr
->
lbal_addr
);
lbam
=
tf
->
lbam
=
readw
(
ioaddr
->
lbam_addr
);
lbah
=
tf
->
lbah
=
readw
(
ioaddr
->
lbah_addr
);
tf
->
command
=
k2_stat_check_status
(
ap
);
tf
->
device
=
readw
(
ioaddr
->
device_addr
);
feature
=
readw
(
ioaddr
->
error_addr
);
nsect
=
readw
(
ioaddr
->
nsect_addr
);
lbal
=
readw
(
ioaddr
->
lbal_addr
);
lbam
=
readw
(
ioaddr
->
lbam_addr
);
lbah
=
readw
(
ioaddr
->
lbah_addr
);
tf
->
feature
=
feature
;
tf
->
nsect
=
nsect
;
tf
->
lbal
=
lbal
;
tf
->
lbam
=
lbam
;
tf
->
lbah
=
lbah
;
if
(
tf
->
flags
&
ATA_TFLAG_LBA48
)
{
tf
->
hob_feature
=
readw
(
ioaddr
->
error_addr
)
>>
8
;
tf
->
hob_feature
=
feature
>>
8
;
tf
->
hob_nsect
=
nsect
>>
8
;
tf
->
hob_lbal
=
lbal
>>
8
;
tf
->
hob_lbam
=
lbam
>>
8
;
...
...
drivers/scsi/sata_vsc.c
浏览文件 @
955c5038
...
...
@@ -153,16 +153,24 @@ static void vsc_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
static
void
vsc_sata_tf_read
(
struct
ata_port
*
ap
,
struct
ata_taskfile
*
tf
)
{
struct
ata_ioports
*
ioaddr
=
&
ap
->
ioaddr
;
u16
nsect
,
lbal
,
lbam
,
lbah
;
u16
nsect
,
lbal
,
lbam
,
lbah
,
feature
;
nsect
=
tf
->
nsect
=
readw
(
ioaddr
->
nsect_addr
);
lbal
=
tf
->
lbal
=
readw
(
ioaddr
->
lbal_addr
);
lbam
=
tf
->
lbam
=
readw
(
ioaddr
->
lbam_addr
);
lbah
=
tf
->
lbah
=
readw
(
ioaddr
->
lbah_addr
);
tf
->
command
=
ata_check_status
(
ap
);
tf
->
device
=
readw
(
ioaddr
->
device_addr
);
feature
=
readw
(
ioaddr
->
error_addr
);
nsect
=
readw
(
ioaddr
->
nsect_addr
);
lbal
=
readw
(
ioaddr
->
lbal_addr
);
lbam
=
readw
(
ioaddr
->
lbam_addr
);
lbah
=
readw
(
ioaddr
->
lbah_addr
);
tf
->
feature
=
feature
;
tf
->
nsect
=
nsect
;
tf
->
lbal
=
lbal
;
tf
->
lbam
=
lbam
;
tf
->
lbah
=
lbah
;
if
(
tf
->
flags
&
ATA_TFLAG_LBA48
)
{
tf
->
hob_feature
=
readb
(
ioaddr
->
error_addr
)
;
tf
->
hob_feature
=
feature
>>
8
;
tf
->
hob_nsect
=
nsect
>>
8
;
tf
->
hob_lbal
=
lbal
>>
8
;
tf
->
hob_lbam
=
lbam
>>
8
;
...
...
include/scsi/scsi.h
浏览文件 @
955c5038
...
...
@@ -116,6 +116,9 @@ extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
/* values for service action in */
#define SAI_READ_CAPACITY_16 0x10
/* Values for T10/04-262r7 */
#define ATA_16 0x85
/* 16-byte pass-thru */
#define ATA_12 0xa1
/* 12-byte pass-thru */
/*
* SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录