iscsid.c revision 904e51f67bfac9f3ec88d9254757474c448808eb
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * ISCSID --
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * Discovery of targets and access to the persistent storage starts here.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl * local function prototypes
9512fe850e98fdd448c638ca63fdd92a8a510255ahlstatic void iscsid_thread_static(iscsi_thread_t *thread, void *p);
9512fe850e98fdd448c638ca63fdd92a8a510255ahlstatic void iscsid_thread_sendtgts(iscsi_thread_t *thread, void *p);
9512fe850e98fdd448c638ca63fdd92a8a510255ahlstatic void iscsid_thread_isns(iscsi_thread_t *thread, void *p);
static void iscsid_threads_destroy(void);
extern int modrootloaded;
static int iscsi_net_up = 0;
typedef struct iscsid_thr_table {
char *name;
NULL }
static boolean_t
if (!ip)
return (B_FALSE);
if (i == IB_IP_BUFLEN) {
return (B_FALSE);
return (B_TRUE);
static boolean_t
return (B_FALSE);
if (!iscsid_ip_check(
return (B_FALSE);
return (B_FALSE);
(void) bcopy(
return (B_TRUE);
entry_t e;
if (!iscsid_ip_check(
iscsid_do_sendtgts(&e);
return (B_FALSE);
if (iscsi_boot_wd_handle) {
return (rval);
return (rval);
return (rval);
dt++) {
(void) iscsi_thread_send_wakeup(
return (rval);
dt++) {
return (rval);
dt++) {
B_TRUE) {
int stl_sz;
const char *ip;
int ctr;
int rc;
sizeof (iscsi_sendtgts_entry_t));
if (rc) {
sizeof (iscsi_sendtgts_entry_t));
goto retry_sendtgts;
sizeof (struct in_addr) ?
int, query_status);
sizeof (isns_portal_group_t);
&pg_list);
int, query_status);
int, query_status);
sizeof (isns_portal_group_t);
sizeof (isns_portal_group_t);
int retry = 0;
int lun_online = 0;
int cur_sec = 0;
if (!iscsi_configroot_printed) {
if (iscsi_net_up == 0) {
retry++;
retry++;
if (lun_online == 0) {
cur_sec++;
} while ((lun_online == 0) &&
retry++;
if (!rc) {
NULL);
int retry = 0;
int lun_online = 0;
int cur_sec = 0;
if (!iscsi_configroot_printed) {
if (iscsi_net_up == 0) {
retry++;
retry++;
if (lun_online == 0) {
cur_sec++;
} while ((lun_online == 0) &&
retry++;
if (!rc) {
int i, pg_sz;
int qry_status;
switch (scn_type) {
case ISNS_OBJ_ADDED:
&pg_list);
NULL);
sizeof (isns_portal_group_t);
case ISNS_OBJ_REMOVED:
B_TRUE) {
case ISNS_OBJ_UPDATED:
static boolean_t
int idx;
int isid;
int size;
char *tmp;
return (B_FALSE);
return (rtn);
return (rtn);
int total = 0;
if ((method ==
(method ==
(bcmp(
total++;
isp_list =
if (total > 0) {
return (rtn);
return (rtn);
static boolean_t
void *v = NULL;
char *name;
char *initiatorName;
int rc;
sizeof (iscsi_tunable_params_t));
v = NULL;
param_id++) {
if (rc == 0) {
if (rc != 0) {
if (iscsiboot_prop &&
return (B_TRUE);
static boolean_t
void *v = NULL;
char *name;
char *iname;
int rc;
v = NULL;
param_id++) {
if (rc == 0) {
if (rc != 0) {
return (B_TRUE);
void *v = NULL;
v = NULL;
B_TRUE) {
void *v = NULL;
B_TRUE);
v = NULL;
B_FALSE);
iscsid_thr_table *t;
iscsid_threads_destroy(void)
iscsid_thr_table *t;
int rtn = 0;
return (EINVAL);
switch (param_id) {
if (rtn == 0) {
return (rtn);
time_t x;
"iqn.1986-03.com.sun:01:");
for (i = 0; i < ETHERADDRL; i++) {
x = ddi_get_time();
(void) persistent_alias_name_set(
KM_SLEEP);
B_FALSE) {
sizeof (struct in_addr));
sizeof (struct in6_addr));
case iSCSIDiscoveryMethodSLP:
case iSCSIDiscoveryMethodISNS:
char *eventclass,
char *subclass,
static boolean_t
return (B_TRUE);
int idx;
char *name;
return (B_FALSE);
name);
return (B_FALSE);
return (B_FALSE);
isp))) {
return (rtn);
return (rtn);
static iscsi_sess_t *
sizeof (struct in6_addr));
return (NULL);
return (NULL);
return (NULL);
return (isp);
while (rc != 0) {
ISCSI_MAX_NAME_LEN) == 0)) {
return (B_TRUE);
return (B_FALSE);
ISCSI_MAX_NAME_LEN) == 0)) {
return (B_TRUE);
return (B_FALSE);
return (B_FALSE);
return (B_FALSE);
ISCSI_MAX_NAME_LEN) == 0) &&
if (bootlun_found) {
return (tgt_mpxio_enabled);
static boolean_t
return (B_TRUE);
return (B_FALSE);