aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xpc_channel.c
diff options
context:
space:
mode:
authorDean Nelson <dcn@sgi.com>2008-07-30 01:34:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-30 12:41:49 -0400
commitbc63d387e4f5dbbe4ea0c5ade862c38073fd7fa3 (patch)
treeebeb9a381224a935fc50697902fcc38b9df47d90 /drivers/misc/sgi-xp/xpc_channel.c
parent78ce1bbe446e9b46dcd6c1e60a4768448a8ce355 (diff)
sgi-xp: support runtime selection of xp_max_npartitions
Support runtime selection of the max number of partitions based on the hardware being run on. Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_channel.c')
-rw-r--r--drivers/misc/sgi-xp/xpc_channel.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/misc/sgi-xp/xpc_channel.c b/drivers/misc/sgi-xp/xpc_channel.c
index 9c90c2d55c08..12d8eb6957a7 100644
--- a/drivers/misc/sgi-xp/xpc_channel.c
+++ b/drivers/misc/sgi-xp/xpc_channel.c
@@ -110,14 +110,14 @@ xpc_setup_infrastructure(struct xpc_partition *part)
110 * Allocate all of the channel structures as a contiguous chunk of 110 * Allocate all of the channel structures as a contiguous chunk of
111 * memory. 111 * memory.
112 */ 112 */
113 part->channels = kzalloc(sizeof(struct xpc_channel) * XPC_NCHANNELS, 113 part->channels = kzalloc(sizeof(struct xpc_channel) * XPC_MAX_NCHANNELS,
114 GFP_KERNEL); 114 GFP_KERNEL);
115 if (part->channels == NULL) { 115 if (part->channels == NULL) {
116 dev_err(xpc_chan, "can't get memory for channels\n"); 116 dev_err(xpc_chan, "can't get memory for channels\n");
117 return xpNoMemory; 117 return xpNoMemory;
118 } 118 }
119 119
120 part->nchannels = XPC_NCHANNELS; 120 part->nchannels = XPC_MAX_NCHANNELS;
121 121
122 /* allocate all the required GET/PUT values */ 122 /* allocate all the required GET/PUT values */
123 123
@@ -1432,9 +1432,9 @@ xpc_initiate_connect(int ch_number)
1432 struct xpc_partition *part; 1432 struct xpc_partition *part;
1433 struct xpc_channel *ch; 1433 struct xpc_channel *ch;
1434 1434
1435 DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS); 1435 DBUG_ON(ch_number < 0 || ch_number >= XPC_MAX_NCHANNELS);
1436 1436
1437 for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) { 1437 for (partid = 0; partid < xp_max_npartitions; partid++) {
1438 part = &xpc_partitions[partid]; 1438 part = &xpc_partitions[partid];
1439 1439
1440 if (xpc_part_ref(part)) { 1440 if (xpc_part_ref(part)) {
@@ -1488,10 +1488,10 @@ xpc_initiate_disconnect(int ch_number)
1488 struct xpc_partition *part; 1488 struct xpc_partition *part;
1489 struct xpc_channel *ch; 1489 struct xpc_channel *ch;
1490 1490
1491 DBUG_ON(ch_number < 0 || ch_number >= XPC_NCHANNELS); 1491 DBUG_ON(ch_number < 0 || ch_number >= XPC_MAX_NCHANNELS);
1492 1492
1493 /* initiate the channel disconnect for every active partition */ 1493 /* initiate the channel disconnect for every active partition */
1494 for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) { 1494 for (partid = 0; partid < xp_max_npartitions; partid++) {
1495 part = &xpc_partitions[partid]; 1495 part = &xpc_partitions[partid];
1496 1496
1497 if (xpc_part_ref(part)) { 1497 if (xpc_part_ref(part)) {
@@ -1734,7 +1734,7 @@ xpc_initiate_allocate(short partid, int ch_number, u32 flags, void **payload)
1734 enum xp_retval ret = xpUnknownReason; 1734 enum xp_retval ret = xpUnknownReason;
1735 struct xpc_msg *msg = NULL; 1735 struct xpc_msg *msg = NULL;
1736 1736
1737 DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS); 1737 DBUG_ON(partid < 0 || partid >= xp_max_npartitions);
1738 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels); 1738 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels);
1739 1739
1740 *payload = NULL; 1740 *payload = NULL;
@@ -1918,7 +1918,7 @@ xpc_initiate_send(short partid, int ch_number, void *payload)
1918 dev_dbg(xpc_chan, "msg=0x%p, partid=%d, channel=%d\n", (void *)msg, 1918 dev_dbg(xpc_chan, "msg=0x%p, partid=%d, channel=%d\n", (void *)msg,
1919 partid, ch_number); 1919 partid, ch_number);
1920 1920
1921 DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS); 1921 DBUG_ON(partid < 0 || partid >= xp_max_npartitions);
1922 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels); 1922 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels);
1923 DBUG_ON(msg == NULL); 1923 DBUG_ON(msg == NULL);
1924 1924
@@ -1968,7 +1968,7 @@ xpc_initiate_send_notify(short partid, int ch_number, void *payload,
1968 dev_dbg(xpc_chan, "msg=0x%p, partid=%d, channel=%d\n", (void *)msg, 1968 dev_dbg(xpc_chan, "msg=0x%p, partid=%d, channel=%d\n", (void *)msg,
1969 partid, ch_number); 1969 partid, ch_number);
1970 1970
1971 DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS); 1971 DBUG_ON(partid < 0 || partid >= xp_max_npartitions);
1972 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels); 1972 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels);
1973 DBUG_ON(msg == NULL); 1973 DBUG_ON(msg == NULL);
1974 DBUG_ON(func == NULL); 1974 DBUG_ON(func == NULL);
@@ -2210,7 +2210,7 @@ xpc_initiate_received(short partid, int ch_number, void *payload)
2210 struct xpc_msg *msg = XPC_MSG_ADDRESS(payload); 2210 struct xpc_msg *msg = XPC_MSG_ADDRESS(payload);
2211 s64 get, msg_number = msg->number; 2211 s64 get, msg_number = msg->number;
2212 2212
2213 DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS); 2213 DBUG_ON(partid < 0 || partid >= xp_max_npartitions);
2214 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels); 2214 DBUG_ON(ch_number < 0 || ch_number >= part->nchannels);
2215 2215
2216 ch = &part->channels[ch_number]; 2216 ch = &part->channels[ch_number];