mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-21 14:46:23 +00:00
ib_srpt: Rework r4984 (skip Ethernet ports)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4991 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+11
-9
@@ -695,7 +695,6 @@ err:
|
|||||||
*/
|
*/
|
||||||
static int srpt_refresh_port(struct srpt_port *sport)
|
static int srpt_refresh_port(struct srpt_port *sport)
|
||||||
{
|
{
|
||||||
static const union ib_gid zero_gid;
|
|
||||||
struct ib_mad_reg_req reg_req;
|
struct ib_mad_reg_req reg_req;
|
||||||
struct ib_port_modify port_modify;
|
struct ib_port_modify port_modify;
|
||||||
struct ib_port_attr port_attr;
|
struct ib_port_attr port_attr;
|
||||||
@@ -704,6 +703,15 @@ static int srpt_refresh_port(struct srpt_port *sport)
|
|||||||
|
|
||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
|
switch (rdma_port_get_link_layer(sport->sdev->device, sport->port)) {
|
||||||
|
case IB_LINK_LAYER_UNSPECIFIED:
|
||||||
|
case IB_LINK_LAYER_INFINIBAND:
|
||||||
|
break;
|
||||||
|
case IB_LINK_LAYER_ETHERNET:
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
memset(&port_modify, 0, sizeof(port_modify));
|
memset(&port_modify, 0, sizeof(port_modify));
|
||||||
port_modify.set_port_cap_mask = IB_PORT_DEVICE_MGMT_SUP;
|
port_modify.set_port_cap_mask = IB_PORT_DEVICE_MGMT_SUP;
|
||||||
port_modify.clr_port_cap_mask = 0;
|
port_modify.clr_port_cap_mask = 0;
|
||||||
@@ -755,14 +763,8 @@ static int srpt_refresh_port(struct srpt_port *sport)
|
|||||||
be16_to_cpu(((__be16 *) sport->gid.raw)[5]),
|
be16_to_cpu(((__be16 *) sport->gid.raw)[5]),
|
||||||
be16_to_cpu(((__be16 *) sport->gid.raw)[6]),
|
be16_to_cpu(((__be16 *) sport->gid.raw)[6]),
|
||||||
be16_to_cpu(((__be16 *) sport->gid.raw)[7]));
|
be16_to_cpu(((__be16 *) sport->gid.raw)[7]));
|
||||||
/*
|
sport->srpt_tgt.scst_tgt = scst_register_target(&srpt_template,
|
||||||
* Skip target registration if the port mode has been changed
|
tgt_name);
|
||||||
* from IB into Ethernet after the add_client() callback
|
|
||||||
* started and before the port GID has been queried.
|
|
||||||
*/
|
|
||||||
if (memcmp(&sport->gid, &zero_gid, sizeof(zero_gid)) != 0)
|
|
||||||
sport->srpt_tgt.scst_tgt =
|
|
||||||
scst_register_target(&srpt_template, tgt_name);
|
|
||||||
if (sport->srpt_tgt.scst_tgt)
|
if (sport->srpt_tgt.scst_tgt)
|
||||||
scst_tgt_set_tgt_priv(sport->srpt_tgt.scst_tgt, sport);
|
scst_tgt_set_tgt_priv(sport->srpt_tgt.scst_tgt, sport);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user