wrsm_mh.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1999-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Multi-hop routing module of the WildCat RSM diver.
* This file manages the programming of WCI route maps based on link
* up and down events.
*/
#include <sys/wrsm_common.h>
#include <sys/wrsm_nc_impl.h>
#ifdef DEBUG
#define DBG_MH 0x01
#define DBG_MH_EXTRA 0x02
#define DBG_WARN 0x04
#define DBG_DUMP 0x08
#else
#define DPRINTF(a, b) { }
#define DUMPWCI(m, w) { }
#endif /* DEBUG */
/*
* WCI specific definitions used to program the control registers.
*/
#define ROUTE_MAP_LOCAL 3
enum mh_link_state {
};
struct wrsm_mh_reroute_state {
};
#ifdef DEBUG
void
{
}
}
}
#endif /* DEBUG */
/*
* Called from NR when a new wci is brought into use so that the
* per-wci MH private data structures can be initialized.
*/
void
{
int i;
KM_SLEEP);
for (i = 0; i < WRSM_LINKS_PER_WCI; ++i) {
}
for (i = 0; i < WRSM_MAX_WNODES; ++i) {
}
/* local wnode is for loopback to local node memory */
}
/*
* Called from NR when wci taken away so that resources allocated
* by wrsm_mh_new_wci() can be freed.
*/
void
{
/* force a full reroute analysis */
}
/*
* Main entry point of the MH module used to initiate an
* reevaluation of the multihop subnet.
*/
{
/*
* If the wci is in the wrong state, return
* without calling wrsm_nr_mhreroute().
*/
return (B_FALSE);
}
/* wci not attached */
return (B_FALSE);
}
/* Do the reroute now */
return (B_TRUE);
}
/*
* Called from the LC when a new link has been successfully
* brought up. Programs the WCI's route_map registers to
* start using that link for direct-connect communication.
*/
void
{
#ifdef DEBUG
}
#endif
/*
* Use the one hop route if the current route uses more hops, or
* if a loopback route (0 hops) is currently being used. The theory
* behind this is that there wouldn't be a 1 hop route to the
* local node in the configuration unless the configurer wanted
* it to be preferred over loopback.
*/
/* Enable route map striping */
"mh_link_is_up: enabling link striping"));
}
}
}
/* Sets both routemap entries to route over the given link */
static void
{
/* Write to route_map_0 */
/* Write same value to route_map_1 */
}
/* Changes route map entry 1 to route over the given link */
static void
{
/* Assume route_map0 contains original stripe, just change map1 */
}
/*
* Determines which route map entry uses the link, and replaces it with
* the other route map entry. Returns ENOENT if the wnode was not using
* this link to stripe.
*/
static void
{
/* Make sure both route map entries are in use, and not the same */
/*
* If the caller passed in link0, reprogram routemap to use link1
* and vice versa.
*/
} else {
}
}
/*
* Called from the LC before a link is to be brought down or
* after it has detected an auto-shutdown of the link. Turns
* off routing through the unavailable link.
*/
void
{
return;
/*
* Find all wnodes in the subnet which have routes
* using the link which is going down.
*/
/*
* If this is the local wnode, switching to
* ROUTE_MAP_LOCAL means internal loopback
* is now being used for this wnode. In
* all other cases, using ROUTE_MAP_LOCAL
* will cause failures and is equivalent to
* not having a route.
*/
} else {
}
/*
* Else, if we were striping, and this wnode was
* using this link in its striping, then stop
* striping. Checking for stripine level isn't enough;
* we have to check for the link being in use because
* there could be three links going to same remote
* wnode, and the link going down could be the one
* not being used.
*/
} else if (
/* Fix route maps to be unstriped */
/* Turn off striping on that link */
"wci %d link %d to wnode %d "
"disabling link striping",
wnode));
}
}
}
}
}
/*
* For a given WCI and a remote wnodeid, find the link.
* This is used to populate the wrsm_route_kstat.
*/
int
{
int i;
return (-1);
}
for (i = 0; i < WRSM_LINKS_PER_WCI; i++) {
return (i);
}
}
return (-1);
}
/*
* For a given WCI, determine if the given link leads to given remode wnodeid
* This is used to populate the wrsm_route_kstat.
*/
{
return (B_FALSE);
}
return (boolean_t)
}