[PATCH 4.4 2/9] net/ncsi: Introduce NCSI_RESERVED_CHANNEL

Gavin Shan gwshan at linux.vnet.ibm.com
Fri Oct 21 11:47:39 AEDT 2016


This defines NCSI_RESERVED_CHANNEL as the reserved NCSI channel
ID (0x1f). No logical changes introduced.

Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
Reviewed-by: Joel Stanley <joel at jms.id.au>
---
 net/ncsi/internal.h    |  1 +
 net/ncsi/ncsi-manage.c | 14 +++++++-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h
index e97906c..339177a 100644
--- a/net/ncsi/internal.h
+++ b/net/ncsi/internal.h
@@ -5,6 +5,7 @@ struct ncsi_dev_priv;
 struct ncsi_package;
 
 #define NCSI_PACKAGE_INDEX(c)	(((c) >> 5) & 0x7)
+#define NCSI_RESERVED_CHANNEL	0x1f
 #define NCSI_CHANNEL_INDEX(c)	((c) & 0x1ffff)
 #define NCSI_TO_CHANNEL(p, c)	((((p) & 0x7) << 5) | ((c) & 0x1ffff))
 
diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
index b32aa39..3d1d775 100644
--- a/net/ncsi/ncsi-manage.c
+++ b/net/ncsi/ncsi-manage.c
@@ -397,7 +397,7 @@ static void ncsi_dev_config(struct ncsi_dev_priv *ndp)
 		nca.nca_type = NCSI_PKT_CMD_SP;
 		nca.nca_bytes[0] = 1;
 		nca.nca_package = np->np_id;
-		nca.nca_channel = 0x1f;
+		nca.nca_channel = NCSI_RESERVED_CHANNEL;
 		ret = ncsi_xmit_cmd(&nca);
 		if (ret)
 			goto error;
@@ -533,7 +533,7 @@ static void ncsi_dev_probe(struct ncsi_dev_priv *ndp)
 
 		/* Deselect all possible packages */
 		nca.nca_type = NCSI_PKT_CMD_DP;
-		nca.nca_channel = 0x1f;
+		nca.nca_channel = NCSI_RESERVED_CHANNEL;
 		for (index = 0; index < 8; index++) {
 			nca.nca_package = index;
 			ret = ncsi_xmit_cmd(&nca);
@@ -549,7 +549,7 @@ static void ncsi_dev_probe(struct ncsi_dev_priv *ndp)
 		/* Select all possible packages */
 		nca.nca_type = NCSI_PKT_CMD_SP;
 		nca.nca_bytes[0] = 1;
-		nca.nca_channel = 0x1f;
+		nca.nca_channel = NCSI_RESERVED_CHANNEL;
 		for (index = 0; index < 8; index++) {
 			nca.nca_package = index;
 			ret = ncsi_xmit_cmd(&nca);
@@ -608,7 +608,7 @@ static void ncsi_dev_probe(struct ncsi_dev_priv *ndp)
 		nca.nca_type = NCSI_PKT_CMD_SP;
 		nca.nca_bytes[0] = 1;
 		nca.nca_package = ndp->ndp_active_package->np_id;
-		nca.nca_channel = 0x1f;
+		nca.nca_channel = NCSI_RESERVED_CHANNEL;
 		ret = ncsi_xmit_cmd(&nca);
 		if (ret)
 			goto error;
@@ -666,7 +666,7 @@ static void ncsi_dev_probe(struct ncsi_dev_priv *ndp)
 		/* Deselect the active package */
 		nca.nca_type = NCSI_PKT_CMD_DP;
 		nca.nca_package = ndp->ndp_active_package->np_id;
-		nca.nca_channel = 0x1f;
+		nca.nca_channel = NCSI_RESERVED_CHANNEL;
 		ret = ncsi_xmit_cmd(&nca);
 		if (ret)
 			goto error;
@@ -716,7 +716,7 @@ static void ncsi_dev_suspend(struct ncsi_dev_priv *ndp)
 		nca.nca_package = np->np_id;
 		if (nd->nd_state == ncsi_dev_state_suspend_select) {
 			nca.nca_type = NCSI_PKT_CMD_SP;
-			nca.nca_channel = 0x1f;
+			nca.nca_channel = NCSI_RESERVED_CHANNEL;
 			nca.nca_bytes[0] = 1;
 			nd->nd_state = ncsi_dev_state_suspend_dcnt;
 		} else if (nd->nd_state == ncsi_dev_state_suspend_dcnt) {
@@ -730,7 +730,7 @@ static void ncsi_dev_suspend(struct ncsi_dev_priv *ndp)
 			nd->nd_state = ncsi_dev_state_suspend_deselect;
 		} else if (nd->nd_state == ncsi_dev_state_suspend_deselect) {
 			nca.nca_type = NCSI_PKT_CMD_DP;
-			nca.nca_channel = 0x1f;
+			nca.nca_channel = NCSI_RESERVED_CHANNEL;
 			nd->nd_state = ncsi_dev_state_suspend_done;
 		}
 
-- 
2.1.0



More information about the openbmc mailing list