Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
127f2fa3
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
127f2fa3
编写于
11月 04, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'srp' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
上级
ba77df57
aef9ec39
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
2091 addition
and
0 deletion
+2091
-0
drivers/infiniband/Kconfig
drivers/infiniband/Kconfig
+2
-0
drivers/infiniband/Makefile
drivers/infiniband/Makefile
+1
-0
drivers/infiniband/ulp/srp/Kbuild
drivers/infiniband/ulp/srp/Kbuild
+1
-0
drivers/infiniband/ulp/srp/Kconfig
drivers/infiniband/ulp/srp/Kconfig
+11
-0
drivers/infiniband/ulp/srp/ib_srp.c
drivers/infiniband/ulp/srp/ib_srp.c
+1700
-0
drivers/infiniband/ulp/srp/ib_srp.h
drivers/infiniband/ulp/srp/ib_srp.h
+150
-0
include/scsi/srp.h
include/scsi/srp.h
+226
-0
未找到文件。
drivers/infiniband/Kconfig
浏览文件 @
127f2fa3
...
...
@@ -33,4 +33,6 @@ source "drivers/infiniband/hw/mthca/Kconfig"
source "drivers/infiniband/ulp/ipoib/Kconfig"
source "drivers/infiniband/ulp/srp/Kconfig"
endmenu
drivers/infiniband/Makefile
浏览文件 @
127f2fa3
obj-$(CONFIG_INFINIBAND)
+=
core/
obj-$(CONFIG_INFINIBAND_MTHCA)
+=
hw/mthca/
obj-$(CONFIG_INFINIBAND_IPOIB)
+=
ulp/ipoib/
obj-$(CONFIG_INFINIBAND_SRP)
+=
ulp/srp/
drivers/infiniband/ulp/srp/Kbuild
0 → 100644
浏览文件 @
127f2fa3
obj-$(CONFIG_INFINIBAND_SRP) += ib_srp.o
drivers/infiniband/ulp/srp/Kconfig
0 → 100644
浏览文件 @
127f2fa3
config INFINIBAND_SRP
tristate "InfiniBand SCSI RDMA Protocol"
depends on INFINIBAND && SCSI
---help---
Support for the SCSI RDMA Protocol over InfiniBand. This
allows you to access storage devices that speak SRP over
InfiniBand.
The SRP protocol is defined by the INCITS T10 technical
committee. See <http://www.t10.org/>.
drivers/infiniband/ulp/srp/ib_srp.c
0 → 100644
浏览文件 @
127f2fa3
此差异已折叠。
点击以展开。
drivers/infiniband/ulp/srp/ib_srp.h
0 → 100644
浏览文件 @
127f2fa3
/*
* Copyright (c) 2005 Cisco Systems. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* $Id: ib_srp.h 3932 2005-11-01 17:19:29Z roland $
*/
#ifndef IB_SRP_H
#define IB_SRP_H
#include <linux/types.h>
#include <linux/list.h>
#include <asm/semaphore.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>
#include <rdma/ib_verbs.h>
#include <rdma/ib_sa.h>
#include <rdma/ib_cm.h>
enum
{
SRP_PATH_REC_TIMEOUT_MS
=
1000
,
SRP_ABORT_TIMEOUT_MS
=
5000
,
SRP_PORT_REDIRECT
=
1
,
SRP_DLID_REDIRECT
=
2
,
SRP_MAX_IU_LEN
=
256
,
SRP_RQ_SHIFT
=
6
,
SRP_RQ_SIZE
=
1
<<
SRP_RQ_SHIFT
,
SRP_SQ_SIZE
=
SRP_RQ_SIZE
-
1
,
SRP_CQ_SIZE
=
SRP_SQ_SIZE
+
SRP_RQ_SIZE
,
SRP_TAG_TSK_MGMT
=
1
<<
(
SRP_RQ_SHIFT
+
1
)
};
#define SRP_OP_RECV (1 << 31)
#define SRP_MAX_INDIRECT ((SRP_MAX_IU_LEN - \
sizeof (struct srp_cmd) - \
sizeof (struct srp_indirect_buf)) / 16)
enum
srp_target_state
{
SRP_TARGET_LIVE
,
SRP_TARGET_CONNECTING
,
SRP_TARGET_DEAD
,
SRP_TARGET_REMOVED
};
struct
srp_host
{
u8
initiator_port_id
[
16
];
struct
ib_device
*
dev
;
u8
port
;
struct
ib_pd
*
pd
;
struct
ib_mr
*
mr
;
struct
class_device
class_dev
;
struct
list_head
target_list
;
struct
semaphore
target_mutex
;
struct
completion
released
;
struct
list_head
list
;
};
struct
srp_request
{
struct
list_head
list
;
struct
scsi_cmnd
*
scmnd
;
struct
srp_iu
*
cmd
;
struct
srp_iu
*
tsk_mgmt
;
DECLARE_PCI_UNMAP_ADDR
(
direct_mapping
)
struct
completion
done
;
short
next
;
u8
cmd_done
;
u8
tsk_status
;
};
struct
srp_target_port
{
__be64
id_ext
;
__be64
ioc_guid
;
__be64
service_id
;
struct
srp_host
*
srp_host
;
struct
Scsi_Host
*
scsi_host
;
char
target_name
[
32
];
unsigned
int
scsi_id
;
struct
ib_sa_path_rec
path
;
struct
ib_sa_query
*
path_query
;
int
path_query_id
;
struct
ib_cm_id
*
cm_id
;
struct
ib_cq
*
cq
;
struct
ib_qp
*
qp
;
int
max_ti_iu_len
;
s32
req_lim
;
unsigned
rx_head
;
struct
srp_iu
*
rx_ring
[
SRP_RQ_SIZE
];
unsigned
tx_head
;
unsigned
tx_tail
;
struct
srp_iu
*
tx_ring
[
SRP_SQ_SIZE
+
1
];
int
req_head
;
struct
list_head
req_queue
;
struct
srp_request
req_ring
[
SRP_SQ_SIZE
];
struct
work_struct
work
;
struct
list_head
list
;
struct
completion
done
;
int
status
;
enum
srp_target_state
state
;
};
struct
srp_iu
{
dma_addr_t
dma
;
void
*
buf
;
size_t
size
;
enum
dma_data_direction
direction
;
};
#endif
/* IB_SRP_H */
include/scsi/srp.h
0 → 100644
浏览文件 @
127f2fa3
/*
* Copyright (c) 2005 Cisco Systems. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* $Id$
*/
#ifndef SCSI_SRP_H
#define SCSI_SRP_H
/*
* Structures and constants for the SCSI RDMA Protocol (SRP) as
* defined by the INCITS T10 committee. This file was written using
* draft Revision 16a of the SRP standard.
*/
#include <linux/types.h>
enum
{
SRP_LOGIN_REQ
=
0x00
,
SRP_TSK_MGMT
=
0x01
,
SRP_CMD
=
0x02
,
SRP_I_LOGOUT
=
0x03
,
SRP_LOGIN_RSP
=
0xc0
,
SRP_RSP
=
0xc1
,
SRP_LOGIN_REJ
=
0xc2
,
SRP_T_LOGOUT
=
0x80
,
SRP_CRED_REQ
=
0x81
,
SRP_AER_REQ
=
0x82
,
SRP_CRED_RSP
=
0x41
,
SRP_AER_RSP
=
0x42
};
enum
{
SRP_BUF_FORMAT_DIRECT
=
1
<<
1
,
SRP_BUF_FORMAT_INDIRECT
=
1
<<
2
};
enum
{
SRP_NO_DATA_DESC
=
0
,
SRP_DATA_DESC_DIRECT
=
1
,
SRP_DATA_DESC_INDIRECT
=
2
};
enum
{
SRP_TSK_ABORT_TASK
=
0x01
,
SRP_TSK_ABORT_TASK_SET
=
0x02
,
SRP_TSK_CLEAR_TASK_SET
=
0x04
,
SRP_TSK_LUN_RESET
=
0x08
,
SRP_TSK_CLEAR_ACA
=
0x40
};
enum
srp_login_rej_reason
{
SRP_LOGIN_REJ_UNABLE_ESTABLISH_CHANNEL
=
0x00010000
,
SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES
=
0x00010001
,
SRP_LOGIN_REJ_REQ_IT_IU_LENGTH_TOO_LARGE
=
0x00010002
,
SRP_LOGIN_REJ_UNABLE_ASSOCIATE_CHANNEL
=
0x00010003
,
SRP_LOGIN_REJ_UNSUPPORTED_DESCRIPTOR_FMT
=
0x00010004
,
SRP_LOGIN_REJ_MULTI_CHANNEL_UNSUPPORTED
=
0x00010005
,
SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED
=
0x00010006
};
struct
srp_direct_buf
{
__be64
va
;
__be32
key
;
__be32
len
;
};
/*
* We need the packed attribute because the SRP spec puts the list of
* descriptors at an offset of 20, which is not aligned to the size
* of struct srp_direct_buf.
*/
struct
srp_indirect_buf
{
struct
srp_direct_buf
table_desc
;
__be32
len
;
struct
srp_direct_buf
desc_list
[
0
]
__attribute__
((
packed
));
};
enum
{
SRP_MULTICHAN_SINGLE
=
0
,
SRP_MULTICHAN_MULTI
=
1
};
struct
srp_login_req
{
u8
opcode
;
u8
reserved1
[
7
];
u64
tag
;
__be32
req_it_iu_len
;
u8
reserved2
[
4
];
__be16
req_buf_fmt
;
u8
req_flags
;
u8
reserved3
[
5
];
u8
initiator_port_id
[
16
];
u8
target_port_id
[
16
];
};
struct
srp_login_rsp
{
u8
opcode
;
u8
reserved1
[
3
];
__be32
req_lim_delta
;
u64
tag
;
__be32
max_it_iu_len
;
__be32
max_ti_iu_len
;
__be16
buf_fmt
;
u8
rsp_flags
;
u8
reserved2
[
25
];
};
struct
srp_login_rej
{
u8
opcode
;
u8
reserved1
[
3
];
__be32
reason
;
u64
tag
;
u8
reserved2
[
8
];
__be16
buf_fmt
;
u8
reserved3
[
6
];
};
struct
srp_i_logout
{
u8
opcode
;
u8
reserved
[
7
];
u64
tag
;
};
struct
srp_t_logout
{
u8
opcode
;
u8
sol_not
;
u8
reserved
[
2
];
__be32
reason
;
u64
tag
;
};
/*
* We need the packed attribute because the SRP spec only aligns the
* 8-byte LUN field to 4 bytes.
*/
struct
srp_tsk_mgmt
{
u8
opcode
;
u8
sol_not
;
u8
reserved1
[
6
];
u64
tag
;
u8
reserved2
[
4
];
__be64
lun
__attribute__
((
packed
));
u8
reserved3
[
2
];
u8
tsk_mgmt_func
;
u8
reserved4
;
u64
task_tag
;
u8
reserved5
[
8
];
};
/*
* We need the packed attribute because the SRP spec only aligns the
* 8-byte LUN field to 4 bytes.
*/
struct
srp_cmd
{
u8
opcode
;
u8
sol_not
;
u8
reserved1
[
3
];
u8
buf_fmt
;
u8
data_out_desc_cnt
;
u8
data_in_desc_cnt
;
u64
tag
;
u8
reserved2
[
4
];
__be64
lun
__attribute__
((
packed
));
u8
reserved3
;
u8
task_attr
;
u8
reserved4
;
u8
add_cdb_len
;
u8
cdb
[
16
];
u8
add_data
[
0
];
};
enum
{
SRP_RSP_FLAG_RSPVALID
=
1
<<
0
,
SRP_RSP_FLAG_SNSVALID
=
1
<<
1
,
SRP_RSP_FLAG_DOOVER
=
1
<<
2
,
SRP_RSP_FLAG_DOUNDER
=
1
<<
3
,
SRP_RSP_FLAG_DIOVER
=
1
<<
4
,
SRP_RSP_FLAG_DIUNDER
=
1
<<
5
};
struct
srp_rsp
{
u8
opcode
;
u8
sol_not
;
u8
reserved1
[
2
];
__be32
req_lim_delta
;
u64
tag
;
u8
reserved2
[
2
];
u8
flags
;
u8
status
;
__be32
data_out_res_cnt
;
__be32
data_in_res_cnt
;
__be32
sense_data_len
;
__be32
resp_data_len
;
u8
data
[
0
];
};
#endif
/* SCSI_SRP_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录