1231 id = ibpart->dlib_ibpart_id;
1232 if (nvlist_add_uint64(nvl, RCM_NV_LINKID, id) != 0) {
1233 rcm_log_message(RCM_ERROR,
1234 _("IBPART: failed to construct nvlist\n"));
1235 (void) mutex_unlock(&cache_lock);
1236 goto done;
1237 }
1238 }
1239 (void) mutex_unlock(&cache_lock);
1240
1241 if (rcm_notify_event(hd, RCM_RESOURCE_LINK_NEW, 0, nvl, NULL) !=
1242 RCM_SUCCESS) {
1243 rcm_log_message(RCM_ERROR,
1244 _("IBPART: failed to notify %s event for %s\n"),
1245 RCM_RESOURCE_LINK_NEW, node->pc_resource);
1246 goto done;
1247 }
1248
1249 ret = 0;
1250 done:
1251 if (nvl != NULL)
1252 nvlist_free(nvl);
1253 return (ret);
1254 }
1255
1256 /*
1257 * ibpart_consumer_notify() - Notify consumers of IBPARTs coming back online.
1258 */
1259 static int
1260 ibpart_consumer_notify(rcm_handle_t *hd, datalink_id_t linkid, char **errorp,
1261 uint_t flags, rcm_info_t **info)
1262 {
1263 char rsrc[RCM_LINK_RESOURCE_MAX];
1264 link_cache_t *node;
1265
1266 /* Check for the interface in the cache */
1267 (void) snprintf(rsrc, RCM_LINK_RESOURCE_MAX, "%s/%u", RCM_LINK_PREFIX,
1268 linkid);
1269
1270 rcm_log_message(RCM_TRACE2, "IBPART: ibpart_consumer_notify(%s)\n",
1271 rsrc);
|
1231 id = ibpart->dlib_ibpart_id;
1232 if (nvlist_add_uint64(nvl, RCM_NV_LINKID, id) != 0) {
1233 rcm_log_message(RCM_ERROR,
1234 _("IBPART: failed to construct nvlist\n"));
1235 (void) mutex_unlock(&cache_lock);
1236 goto done;
1237 }
1238 }
1239 (void) mutex_unlock(&cache_lock);
1240
1241 if (rcm_notify_event(hd, RCM_RESOURCE_LINK_NEW, 0, nvl, NULL) !=
1242 RCM_SUCCESS) {
1243 rcm_log_message(RCM_ERROR,
1244 _("IBPART: failed to notify %s event for %s\n"),
1245 RCM_RESOURCE_LINK_NEW, node->pc_resource);
1246 goto done;
1247 }
1248
1249 ret = 0;
1250 done:
1251 nvlist_free(nvl);
1252 return (ret);
1253 }
1254
1255 /*
1256 * ibpart_consumer_notify() - Notify consumers of IBPARTs coming back online.
1257 */
1258 static int
1259 ibpart_consumer_notify(rcm_handle_t *hd, datalink_id_t linkid, char **errorp,
1260 uint_t flags, rcm_info_t **info)
1261 {
1262 char rsrc[RCM_LINK_RESOURCE_MAX];
1263 link_cache_t *node;
1264
1265 /* Check for the interface in the cache */
1266 (void) snprintf(rsrc, RCM_LINK_RESOURCE_MAX, "%s/%u", RCM_LINK_PREFIX,
1267 linkid);
1268
1269 rcm_log_message(RCM_TRACE2, "IBPART: ibpart_consumer_notify(%s)\n",
1270 rsrc);
|