Lines Matching defs:wwnstr

1233  * Description: This routine translates wwn from wwnstr string to uint64 wwn.
1235 * Arguments: wwnstr - the string wwn to be transformed
1239 scsi_wwnstr_to_wwn(const char *wwnstr, uint64_t *wwnp)
1249 if (wwnstr == NULL)
1252 /* Skip leading 'w' if wwnstr is in unit-address form */
1253 wwnstr = scsi_wwnstr_skip_ua_prefix(wwnstr);
1255 if (strlen(wwnstr) != 16)
1259 ch = ctoi(*wwnstr++);
1260 cl = ctoi(*wwnstr++);
1273 * Description: This routine translates from a uint64 wwn to a wwnstr
1278 * wwnstr - allow caller to perform wwnstr allocation.
1283 scsi_wwn_to_wwnstr(uint64_t wwn, int unit_address_form, char *wwnstr)
1293 if (wwnstr == NULL) {
1295 if ((wwnstr = DEVID_MALLOC(len)) == NULL)
1300 (void) snprintf(wwnstr, len, "w%016" PRIx64, wwn);
1302 (void) snprintf(wwnstr, len, "%016" PRIx64, wwn);
1303 return (wwnstr);
1309 * Description: This routine switches a wwnstr to upper/lower case hex
1310 * (a wwnstr uses lower-case hex by default).
1313 * wwnstr - the pointer to the wwnstr string.
1318 scsi_wwnstr_hexcase(char *wwnstr, int upper_case_hex)
1323 for (s = wwnstr; *s; s++) {
1338 * Description: This routine removes the leading 'w' in wwnstr,
1341 * Arguments: wwnstr - the string wwn to be transformed
1345 scsi_wwnstr_skip_ua_prefix(const char *wwnstr)
1347 if (*wwnstr == 'w')
1348 wwnstr++;
1349 return (wwnstr);
1355 * Description: This routine frees a wwnstr returned by a call
1356 * to scsi_wwn_to_strwwn with a NULL wwnstr argument.
1359 * wwnstr - the pointer to the wwnstr string to free.
1362 scsi_free_wwnstr(char *wwnstr)
1365 kmem_free(wwnstr, strlen(wwnstr) + 1);
1367 free(wwnstr);