sci_base_port.c revision 231136
112115Sdyson/*-
212115Sdyson * This file is provided under a dual BSD/GPLv2 license.  When using or
312115Sdyson * redistributing this file, you may do so under either license.
412115Sdyson *
512115Sdyson * GPL LICENSE SUMMARY
612115Sdyson *
712115Sdyson * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
812115Sdyson *
912115Sdyson * This program is free software; you can redistribute it and/or modify
1012115Sdyson * it under the terms of version 2 of the GNU General Public License as
1112115Sdyson * published by the Free Software Foundation.
1212115Sdyson *
1312115Sdyson * This program is distributed in the hope that it will be useful, but
1412115Sdyson * WITHOUT ANY WARRANTY; without even the implied warranty of
1512115Sdyson * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1612115Sdyson * General Public License for more details.
1712115Sdyson *
1812115Sdyson * You should have received a copy of the GNU General Public License
1912115Sdyson * along with this program; if not, write to the Free Software
2012115Sdyson * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
2112115Sdyson * The full GNU General Public License is included in this distribution
2212115Sdyson * in the file called LICENSE.GPL.
2312115Sdyson *
2412115Sdyson * BSD LICENSE
2512115Sdyson *
2612115Sdyson * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
2712115Sdyson * All rights reserved.
2812115Sdyson *
2912115Sdyson * Redistribution and use in source and binary forms, with or without
3012115Sdyson * modification, are permitted provided that the following conditions
3112115Sdyson * are met:
3212115Sdyson *
3312115Sdyson *   * Redistributions of source code must retain the above copyright
3412115Sdyson *     notice, this list of conditions and the following disclaimer.
3512115Sdyson *   * Redistributions in binary form must reproduce the above copyright
3612115Sdyson *     notice, this list of conditions and the following disclaimer in
3712115Sdyson *     the documentation and/or other materials provided with the
3812115Sdyson *     distribution.
3912115Sdyson *
4012115Sdyson * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4112115Sdyson * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
4212115Sdyson * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
4312115Sdyson * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
4412115Sdyson * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4593016Sbde * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
4612115Sdyson * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
4712115Sdyson * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
4812115Sdyson * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
4912159Sbde * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5012115Sdyson * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5160041Sphk */
5212115Sdyson
5312115Sdyson#include <sys/cdefs.h>
5412115Sdyson__FBSDID("$FreeBSD: head/sys/dev/isci/scil/sci_base_port.c 231136 2012-02-07 17:43:58Z jimharris $");
5512115Sdyson
5612115Sdyson/**
5796753Siedowse * @file
5812115Sdyson *
5912115Sdyson * @brief This file contains the base port method implementations and
6012115Sdyson *        any constants or structures private to the base port object.
6196749Siedowse */
6296749Siedowse
6312115Sdyson#include <dev/isci/scil/sci_base_port.h>
6412115Sdyson
6512115Sdyson//******************************************************************************
6612115Sdyson//* P R O T E C T E D   M E T H O D S
6796753Siedowse//******************************************************************************
6896753Siedowse
6996753Siedowsevoid sci_base_port_construct(
7096753Siedowse   SCI_BASE_PORT_T   *this_port,
7196753Siedowse   SCI_BASE_LOGGER_T *logger,
7296753Siedowse   SCI_BASE_STATE_T  *state_table
7396753Siedowse)
7496753Siedowse{
7596753Siedowse   sci_base_object_construct(&this_port->parent, logger);
76111742Sdes
7712115Sdyson   sci_base_state_machine_construct(
7812115Sdyson      &this_port->state_machine,
7912115Sdyson      &this_port->parent,
8012115Sdyson      state_table,
8112115Sdyson      SCI_BASE_PORT_STATE_STOPPED
8212115Sdyson   );
8355477Sbde
8455477Sbde   sci_base_state_machine_start(
8555477Sbde      &this_port->state_machine
8655477Sbde   );
8755477Sbde}
8855477Sbde
8955477Sbde