1N/A/************************************************************************* 1N/A * The contents of this file are subject to the SNIA Public License 1N/A * Version 1.0 (the "License"); you may not use this file except in 1N/A * compliance with the License. You may obtain a copy of the License at 1N/A * Software distributed under the License is distributed on an "AS IS" 1N/A * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 1N/A * the License for the specific language governing rights and limitations 1N/A * under the License. 1N/A ************************************************************************* 1N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 1N/A * Use is subject to license terms. 1N/A * Next define forces entry points in the dll to be exported 1N/A * LIBRARY_NUM is a shortcut to figure out which library we need to call. 1N/A * The top 16 bits of handle are the library index 1N/A * VENDOR_HANDLE turns a global library handle into a vendor specific handle, 1N/A * with all upper 16 bits set to 0 1N/A#
else /* Not both USESYSLOG and USELOGFILE */ 1N/A#
endif /* USESYSLOG */ 1N/A#
endif /* USELOGFILE */ 1N/A#
endif /* Not both USELOGFILE and USESYSLOG */ 1N/A * When multiple mutex's are grabed, they must be always be grabbed in 1N/A * the same order, or deadlock can result. There are three levels 1N/A * of mutex's involved in this API. If LL_mutex is grabbed, always grap 1N/A * it first. If AL_mutex is grabbed, it may not be grabbed before 1N/A * LL_mutex. If grabbed in a multi grab sequence, the mutex's protecting 1N/A * the callback lists must always be grabbed last and release before calling 1N/A * a vendor specific library function that might invoke a callback function 1N/A * on the same thread. 1N/A * HBA_LIBRARY_STATUS and HBA_LIBRARY_INFO are redefined here. 1N/A * Avoid any change in the common code. 1N/A * Function type def fop Sun extentions. 1N/A * Individual adapter (hba) information 1N/A * Same as hbaadapter with different structure name. 1N/A * Make the list as an array with max size 16 1N/A * Common library internal. Mutex handling 1N/A DEBUG(0,
"pthread_mutex_unlock returned %d",
ret, 0, 0);
1N/A * The API used to use fixed size tables as its primary data structure. 1N/A * Indexing from 1 to N identified each adapters. Now the adapters are 1N/A * on a linked list. There is a unique "index" foreach each adapter. 1N/A * Adapters always keep their index, even if they are removed from the 1N/A * hardware. The only time the indexing is reset is on HBA_FreeLibrary 1N/A DEBUG(
1,
"HBAAPI: number of target mode adapters for %s = %d\n",
1N/A DEBUG(
1,
"HBAAPI: number of target mode_adapters for %s = %d\n",
1N/A * check for duplicates, really, this may just be a second 1N/A * call to this function 1N/A * ??? how do we know when a name becomes stale? 1N/A /* already got this one */ 1N/A "HBA_GetNumberOfAdapters: calloc failed on sizeof:%d\n",
1N/A * The adapter index is from old code, but we have 1N/A * to support it. Go down the list looking for 1N/A /* retrieve the vendor handle */ 1N/A /* or this with the library index to get the common handle */ 1N/A * This function ignores the list of known adapters and instead tries 1N/A * each vendors open function to see if one of them 1N/A * can open an adapter when referenced with a particular WWN 1N/A /* OK, make a vendor non-specific handle */ 1N/A /* caller will release the mutex */ 1N/A DEBUG(
2,
"HBA_NPIVGetAdapterAttributes", 0, 0, 0);
1N/A/* Adapter Device Events ********************************************************/ 1N/A DEBUG(
3,
"AdapterDeviceEvent, port:%s, eventType:%d fabricPortID:0X%06x",
1N/A "Sun_fcRegisterForAdapterDeviceEvents");
1N/A DEBUG(
2,
"Sun_HBA_DoForceLip", 0, 0, 0);