1302 goto done;
1303 }
1304 }
1305
1306 (void) mutex_unlock(&cache_lock);
1307
1308 /*
1309 * If this link is not the only port in the aggregation, the aggregation
1310 * is not new. No need to inform other consumers in that case.
1311 */
1312 if (is_only_port && rcm_notify_event(hd, RCM_RESOURCE_LINK_NEW,
1313 0, nvl, NULL) != RCM_SUCCESS) {
1314 rcm_log_message(RCM_ERROR,
1315 _("AGGR: failed to notify %s event for %s\n"),
1316 RCM_RESOURCE_LINK_NEW, node->vc_resource);
1317 goto done;
1318 }
1319
1320 ret = 0;
1321 done:
1322 if (nvl != NULL)
1323 nvlist_free(nvl);
1324 return (ret);
1325 }
1326
1327 /*
1328 * aggr_consumer_notify() - Notify consumers of AGGRs coming back online.
1329 */
1330 static int
1331 aggr_consumer_notify(rcm_handle_t *hd, datalink_id_t linkid, char **errorp,
1332 uint_t flags, rcm_info_t **depend_info)
1333 {
1334 char rsrc[RCM_LINK_RESOURCE_MAX];
1335 link_cache_t *node;
1336
1337 (void) snprintf(rsrc, RCM_LINK_RESOURCE_MAX, "%s/%u",
1338 RCM_LINK_PREFIX, linkid);
1339
1340 rcm_log_message(RCM_TRACE1, "AGGR: aggr_consumer_notify(%s)\n", rsrc);
1341
1342 /*
|
1302 goto done;
1303 }
1304 }
1305
1306 (void) mutex_unlock(&cache_lock);
1307
1308 /*
1309 * If this link is not the only port in the aggregation, the aggregation
1310 * is not new. No need to inform other consumers in that case.
1311 */
1312 if (is_only_port && rcm_notify_event(hd, RCM_RESOURCE_LINK_NEW,
1313 0, nvl, NULL) != RCM_SUCCESS) {
1314 rcm_log_message(RCM_ERROR,
1315 _("AGGR: failed to notify %s event for %s\n"),
1316 RCM_RESOURCE_LINK_NEW, node->vc_resource);
1317 goto done;
1318 }
1319
1320 ret = 0;
1321 done:
1322 nvlist_free(nvl);
1323 return (ret);
1324 }
1325
1326 /*
1327 * aggr_consumer_notify() - Notify consumers of AGGRs coming back online.
1328 */
1329 static int
1330 aggr_consumer_notify(rcm_handle_t *hd, datalink_id_t linkid, char **errorp,
1331 uint_t flags, rcm_info_t **depend_info)
1332 {
1333 char rsrc[RCM_LINK_RESOURCE_MAX];
1334 link_cache_t *node;
1335
1336 (void) snprintf(rsrc, RCM_LINK_RESOURCE_MAX, "%s/%u",
1337 RCM_LINK_PREFIX, linkid);
1338
1339 rcm_log_message(RCM_TRACE1, "AGGR: aggr_consumer_notify(%s)\n", rsrc);
1340
1341 /*
|