Lines Matching defs:ap_id

34  *	the HCA static ap_id, and the IB static ap_id.
38 * packed nvlist data structure to hold ap_id related information.
99 "ap_id [ap_id...]\n",
148 "Invalid ap_id supplied " },
251 * node_path - Physical path of the ap_id node
253 * logpp - Logical path to the ap_id node
259 * Given a physical path to an ap_id ensure that it exists
379 * ap_id - The attachment point of an IB fabric
395 * Some messages may display ap_id or errno, which is why they are
399 ib_err_msg(char **errstring, cfga_ib_ret_t rv, const char *ap_id, int l_errno)
441 /* These messages also print ap_id. */
442 ib_set_msg(errstring, ERR_STR(rv), "ap_id: ", ap_id, "", NULL);
459 ib_set_msg(errstring, ERR_STR(rv), "ap_id: ", ap_id, "\n",
478 * ap_id - The attachment point of an IB fabric
482 * 0 if ap_id is valid; otherwise -1
484 * Check if ap_id is valid or not.
485 * Ensure the ap_id passed is in the correct (physical ap_id) form:
489 * Note the library always calls the plugin with a physical ap_id.
493 ib_verify_valid_apid(const char *ap_id)
497 if (ap_id == NULL) {
501 l_ap_id = strchr(ap_id, *MINOR_SEP);
505 if (strstr((char *)ap_id, IBNEX_FABRIC) != NULL) {
507 /* if the ap_id is "ib::" then report an error */
518 /* ap_id has 1..2 or more than 2 dots */
532 * ap_id - The attachment point of an IB fabric
540 * Check if "options" and "errstring" are valid and if ap_id is
544 ib_verify_params(const char *ap_id, const char *options, char **errstring)
556 if (ib_verify_valid_apid(ap_id) != 0) {
557 DPRINTF("ib_verify_params: not an IB ap_id.\n");
595 * ap_id - Attachment point for the IB device in question
596 * use_static_ap_id - Whether to use static ap_id or not flag
606 * the ap_id (as a string). This nvlist_t is looked up in the kernel
607 * to figure out which ap_id we are currently dealing with.
616 ib_setup_for_devctl_cmd(char *ap_id, boolean_t use_static_ap_id,
619 char *apid = (use_static_ap_id == B_TRUE) ? IB_STATIC_APID : ap_id;
629 /* Set up to pass dynamic ap_id down to driver */
639 if (nvlist_add_string(*user_nvlistp, IB_APID, ap_id) == -1) {
662 * issues a "devctl" to get the Receptacle state for that ap_id.
663 * If the ap_id is already configured it returns CFGA_IB_OK.
672 /* get ap_id's "devctl_ap_state" first */
700 * issues a "devctl" to get the Occupant state for that ap_id.
701 * If the ap_id is already connected it returns CFGA_IB_OK.
728 * ap_id - The dynamic attachment point of an IB device
751 ib_do_control_ioctl(char *ap_id, uint_t sub_cmd1, uint_t sub_cmd2,
759 /* try to open the ONLY static ap_id */
778 /* Pass "ap_id" up for all other commands */
782 ioctl_data.ap_id = (caddr_t)ap_id;
783 ioctl_data.ap_id_len = strlen(ap_id);
786 ioctl_data.ap_id = NULL;
844 * ap_id - The attachment point of an IB fabric
860 cfga_change_state(cfga_cmd_t state_change_cmd, const char *ap_id,
873 if ((rv = ib_verify_params(ap_id, options, errstring)) != CFGA_IB_OK) {
876 ap_id, errno));
884 return (ib_err_msg(errstring, CFGA_IB_PRIV_ERR, ap_id, errno));
887 if (strstr((char *)ap_id, IB_FABRIC_APID_STR) == NULL)
890 if ((rv = ib_setup_for_devctl_cmd((char *)ap_id, static_ap_id,
893 return (ib_err_msg(errstring, rv, ap_id, errno));
903 return (ib_err_msg(errstring, ret, ap_id, errno));
914 CFGA_IB_ALREADY_CONFIGURED, ap_id,
929 devpath = ib_get_devicepath(ap_id);
941 devpath = ib_get_devicepath(ap_id);
960 return (ib_err_msg(errstring, rv, ap_id, errno));
967 return (ib_err_msg(errstring, rv, ap_id, errno));
977 devpath = ib_get_devicepath(ap_id);
984 if ((rv = ib_rcm_offline(ap_id, errstring, devpath, flags)) !=
998 (void) ib_rcm_online(ap_id, errstring, devpath, flags);
1001 (void) ib_rcm_remove(ap_id, errstring, devpath, flags);
1022 return (ib_err_msg(errstring, rv, ap_id, errno));
1031 * ap_id - The attachment point of an IB fabric
1048 cfga_private_func(const char *func, const char *ap_id, const char *options,
1056 char *fab_apid = strstr((char *)ap_id, IBNEX_FABRIC);
1065 if ((rv = ib_verify_params(ap_id, NULL, errstring)) != CFGA_IB_OK) {
1068 return (ib_err_msg(errstring, rv, ap_id, errno));
1073 return (ib_err_msg(errstring, CFGA_IB_INVAL_ARG_ERR, ap_id,
1078 * check first if IB static ap_id is "configured" for use
1084 return (ib_err_msg(errstring, rv, ap_id, errno));
1088 return (ib_err_msg(errstring, rv, ap_id, errno));
1101 ap_id, errno));
1108 ap_id, errno));
1111 if ((rv = ib_do_control_ioctl((char *)ap_id, IBNEX_HCA_LIST_SZ,
1117 ap_id, errno));
1125 return (ib_err_msg(errstring, CFGA_IB_NVLIST_ERR, ap_id,
1167 return (ib_err_msg(errstring, CFGA_IB_PRIV_ERR, ap_id,
1175 ap_id, errno));
1186 rv = ib_do_control_ioctl((char *)ap_id, IBNEX_UNCFG_CLNTS_SZ,
1192 ap_id, errno));
1199 return (ib_err_msg(errstring, CFGA_IB_NVLIST_ERR, ap_id,
1266 "failed with %d\n", ap_id, ret);
1268 ap_id, errno));
1277 return (ib_err_msg(errstring, CFGA_IB_PRIV_ERR, ap_id,
1285 ap_id, errno));
1302 rv = ib_do_control_ioctl((char *)ap_id, IBNEX_UPDATE_PKEY_TBLS,
1309 ap_id, errno));
1322 ap_id, errno));
1327 return (ib_err_msg(errstring, CFGA_IB_PRIV_ERR, ap_id,
1337 ap_id, errno));
1349 ap_id, errno));
1358 ap_id, errno));
1369 ap_id, errno));
1379 ap_id, errno));
1388 ap_id, errno));
1398 CFGA_IB_INVAL_ARG_ERR, ap_id, errno));
1421 ap_id, errno));
1435 return (ib_err_msg(errstring, rv, ap_id, errno));
1443 ap_id, errno));
1450 return (ib_err_msg(errstring, rv, ap_id, errno));
1459 return (ib_err_msg(errstring, CFGA_IB_PRIV_ERR, ap_id,
1464 * check: Only supported on fabric ap_id or IOC APID
1471 ap_id, errno));
1491 rv = ib_do_control_ioctl((char *)ap_id, IBNEX_UPDATE_IOC_CONF,
1498 ap_id, errno));
1507 return (ib_err_msg(errstring, rv, ap_id, errno));
1515 * ap_id - The attachment point of an IB fabric
1529 cfga_test(const char *ap_id, const char *options, struct cfga_msg *msgp,
1541 * ap_id - The static attachment point of an IB device
1553 ib_fill_static_apids(char *ap_id, cfga_list_data_t *clp)
1558 /* Get /dev/cfg path to corresponding to the physical ap_id */
1560 if (ib_physpath_to_devlink(ap_id, &ap_id_log,
1584 (void) strlcpy(clp->ap_phys_id, ap_id, sizeof (clp->ap_phys_id));
1587 if (strstr((char *)ap_id, IB_FABRIC_APID_STR) != NULL) {
1600 rv = ib_do_control_ioctl(ap_id, IBNEX_HCA_VERBOSE_SZ,
1623 * ap_id - The attachment point of an IB fabric
1639 cfga_list_ext(const char *ap_id, cfga_list_data_t **ap_id_list, int *nlistp,
1652 boolean_t apid_matched = B_FALSE; /* for valid ap_id */
1656 if ((rv = ib_verify_params(ap_id, options, errstring)) != CFGA_IB_OK) {
1658 return (ib_err_msg(errstring, rv, ap_id, errno));
1666 ap_id, errno));
1669 DPRINTF("cfga_list_ext: ap_id = %s\n", ap_id);
1675 if (GET_DYN(ap_id) != NULL) {
1680 (strstr((char *)ap_id, IB_FABRIC_APID_STR) != NULL)) {
1685 if ((rv = ib_do_control_ioctl((char *)ap_id,
1692 return (ib_err_msg(errstring, rv, ap_id, errno));
1699 if ((rv = ib_do_control_ioctl((char *)ap_id, IBNEX_NUM_HCA_NODES, 0, 0,
1705 return (ib_err_msg(errstring, rv, ap_id, errno));
1719 * If ap_id is "fabric" then
1721 * If ap_id is "HCA" ap_id then
1727 if (strstr((char *)ap_id, IB_FABRIC_APID_STR) != NULL) {
1731 /* Assume it as a HCA ap_id */
1741 ap_id, errno));
1745 * Only static ap_id is ib_fabric:
1746 * If -a options isn't specified then only show the static ap_id.
1751 if ((rv = ib_fill_static_apids((char *)ap_id, clp)) !=
1754 return (ib_err_msg(errstring, rv, ap_id, errno));
1768 if (strstr((char *)ap_id, IB_FABRIC_APID_STR) != NULL) {
1769 rv = ib_do_control_ioctl((char *)ap_id, IBNEX_SNAPSHOT_SIZE,
1777 return (ib_err_msg(errstring, rv, ap_id, errno));
1786 ap_id, errno));
1790 * In kernel a nvlist is build per ap_id which contains
1793 * ap_id, type, occupant, receptacle, condition and info
1795 * In addition, one could specify a dynamic ap_id from
1797 * ap_id and skip rest.
1825 /* First nvlist entry is "ap_id" always */
1832 * If a dynamic ap_id is specified in the
1837 strstr(ap_id, nv_apid) == NULL) {
1853 /* build the physical ap_id */
1854 if (strstr(ap_id, DYN_SEP) == NULL) {
1857 ap_id, DYN_SEP, nv_apid);
1861 ap_id);
1868 "not a valid IB ap_id\n");
1873 CFGA_IB_AP_ERR, ap_id, errno));
1876 /* build the logical ap_id */
1976 * if a cmdline specified ap_id doesn't match the known list of ap_ids
1980 return (ib_err_msg(errstring, rv, ap_id, errno));
2103 * ap_id - The dynamic attachment point of an IB device
2112 ib_get_devicepath(const char *ap_id)
2118 if (ib_do_control_ioctl((char *)ap_id, IBNEX_DEVICE_PATH_SZ,