sci_base_domain.c revision 230557
1189251Ssam/*- 2189251Ssam * This file is provided under a dual BSD/GPLv2 license. When using or 3252726Srpaulo * redistributing this file, you may do so under either license. 4189251Ssam * 5252726Srpaulo * GPL LICENSE SUMMARY 6252726Srpaulo * 7189251Ssam * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. 8189251Ssam * 9189251Ssam * This program is free software; you can redistribute it and/or modify 10189251Ssam * it under the terms of version 2 of the GNU General Public License as 11214734Srpaulo * published by the Free Software Foundation. 12189251Ssam * 13189251Ssam * This program is distributed in the hope that it will be useful, but 14189251Ssam * WITHOUT ANY WARRANTY; without even the implied warranty of 15189251Ssam * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16214734Srpaulo * General Public License for more details. 17252726Srpaulo * 18252726Srpaulo * You should have received a copy of the GNU General Public License 19252726Srpaulo * along with this program; if not, write to the Free Software 20252726Srpaulo * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. 21252726Srpaulo * The full GNU General Public License is included in this distribution 22189251Ssam * in the file called LICENSE.GPL. 23189251Ssam * 24214734Srpaulo * BSD LICENSE 25214734Srpaulo * 26189251Ssam * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. 27189251Ssam * All rights reserved. 28189251Ssam * 29189251Ssam * Redistribution and use in source and binary forms, with or without 30189251Ssam * modification, are permitted provided that the following conditions 31189251Ssam * are met: 32189251Ssam * 33189251Ssam * * Redistributions of source code must retain the above copyright 34189251Ssam * notice, this list of conditions and the following disclaimer. 35189251Ssam * * Redistributions in binary form must reproduce the above copyright 36214734Srpaulo * notice, this list of conditions and the following disclaimer in 37214734Srpaulo * the documentation and/or other materials provided with the 38214734Srpaulo * distribution. 39214734Srpaulo * 40214734Srpaulo * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 41214734Srpaulo * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 42214734Srpaulo * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 43214734Srpaulo * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 44214734Srpaulo * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 45214734Srpaulo * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 46214734Srpaulo * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 47214734Srpaulo * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 48214734Srpaulo * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 49214734Srpaulo * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 50214734Srpaulo * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51214734Srpaulo */ 52214734Srpaulo 53214734Srpaulo#include <sys/cdefs.h> 54214734Srpaulo__FBSDID("$FreeBSD$"); 55214734Srpaulo 56214734Srpaulo/** 57214734Srpaulo * @file 58214734Srpaulo * 59214734Srpaulo * @brief This file contains the base domain method implementations and 60214734Srpaulo * any constants or structures private to the base domain object. 61214734Srpaulo */ 62189251Ssam 63214734Srpaulo#include <dev/isci/scil/sci_base_domain.h> 64214734Srpaulo#include <dev/isci/scil/sci_base_state_machine.h> 65214734Srpaulo 66214734Srpaulo//****************************************************************************** 67214734Srpaulo//* P R O T E C T E D M E T H O D S 68214734Srpaulo//****************************************************************************** 69214734Srpaulo 70214734Srpaulovoid sci_base_domain_construct( 71214734Srpaulo SCI_BASE_DOMAIN_T * this_domain, 72214734Srpaulo SCI_BASE_LOGGER_T * logger, 73214734Srpaulo SCI_BASE_STATE_T * state_table 74214734Srpaulo) 75214734Srpaulo{ 76252726Srpaulo sci_base_object_construct(&this_domain->parent, logger); 77252726Srpaulo 78189251Ssam sci_base_state_machine_construct( 79214734Srpaulo &this_domain->state_machine, 80189251Ssam &this_domain->parent, 81214734Srpaulo state_table, 82189251Ssam SCI_BASE_DOMAIN_STATE_INITIAL 83214734Srpaulo ); 84214734Srpaulo 85214734Srpaulo sci_base_state_machine_start( 86214734Srpaulo &this_domain->state_machine 87214734Srpaulo ); 88214734Srpaulo} 89214734Srpaulo 90214734Srpaulo