^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * This file is provided under a dual BSD/GPLv2 license. When using or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * redistributing this file, you may do so under either license.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * GPL LICENSE SUMMARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * This program is free software; you can redistribute it and/or modify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * it under the terms of version 2 of the GNU General Public License as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * published by the Free Software Foundation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * This program is distributed in the hope that it will be useful, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * You should have received a copy of the GNU General Public License
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * along with this program; if not, write to the Free Software
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * The full GNU General Public License is included in this distribution
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * in the file called LICENSE.GPL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * BSD LICENSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * Redistribution and use in source and binary forms, with or without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * modification, are permitted provided that the following conditions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * are met:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * * Redistributions of source code must retain the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * notice, this list of conditions and the following disclaimer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * * Redistributions in binary form must reproduce the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * notice, this list of conditions and the following disclaimer in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * the documentation and/or other materials provided with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * distribution.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * * Neither the name of Intel Corporation nor the names of its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * contributors may be used to endorse or promote products derived
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * from this software without specific prior written permission.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #ifndef _ISCI_PORT_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define _ISCI_PORT_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #include <scsi/libsas.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #include "isci.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #include "sas.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #include "phy.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define SCIC_SDS_DUMMY_PORT 0xFF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #define PF_NOTIFY (1 << 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) #define PF_RESUME (1 << 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) struct isci_phy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) struct isci_host;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) enum isci_status {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) isci_freed = 0x00,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) isci_starting = 0x01,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) isci_ready = 0x02,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) isci_ready_for_io = 0x03,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) isci_stopping = 0x04,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) isci_stopped = 0x05,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) * struct isci_port - isci direct attached sas port object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) * @ready_exit: several states constitute 'ready'. When exiting ready we
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) * need to take extra port-teardown actions that are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) * skipped when exiting to another 'ready' state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) * @logical_port_index: software port index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) * @physical_port_index: hardware port index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) * @active_phy_mask: identifies phy members
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * @enabled_phy_mask: phy mask for the port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) * that are already part of the port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) * @reserved_tag:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) * @reserved_rni: reserver for port task scheduler workaround
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) * @started_request_count: reference count for outstanding commands
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) * @not_ready_reason: set during state transitions and notified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) * @timer: timeout start/stop operations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) struct isci_port {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) struct isci_host *isci_host;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) struct list_head remote_dev_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #define IPORT_RESET_PENDING 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) unsigned long state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) enum sci_status hard_reset_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) struct sci_base_state_machine sm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) bool ready_exit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) u8 logical_port_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) u8 physical_port_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) u8 active_phy_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) u8 enabled_phy_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) u8 last_active_phy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) u16 reserved_rni;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) u16 reserved_tag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) u32 started_request_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) u32 assigned_device_count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) u32 hang_detect_users;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) u32 not_ready_reason;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) struct isci_phy *phy_table[SCI_MAX_PHYS];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) struct isci_host *owning_controller;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) struct sci_timer timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) struct scu_port_task_scheduler_registers __iomem *port_task_scheduler_registers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) /* XXX rework: only one register, no need to replicate per-port */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) u32 __iomem *port_pe_configuration_register;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) struct scu_viit_entry __iomem *viit_registers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) enum sci_port_not_ready_reason_code {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) SCIC_PORT_NOT_READY_INVALID_PORT_CONFIGURATION,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) SCIC_PORT_NOT_READY_RECONFIGURING,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) SCIC_PORT_NOT_READY_REASON_CODE_MAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) struct sci_port_end_point_properties {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) struct sci_sas_address sas_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) struct sci_phy_proto protocols;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) struct sci_port_properties {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) u32 index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) struct sci_port_end_point_properties local;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) struct sci_port_end_point_properties remote;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) u32 phy_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) * enum sci_port_states - port state machine states
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) * @SCI_PORT_STOPPED: port has successfully been stopped. In this state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) * no new IO operations are permitted. This state is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) * entered from the STOPPING state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) * @SCI_PORT_STOPPING: port is in the process of stopping. In this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * state no new IO operations are permitted, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) * existing IO operations are allowed to complete.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * This state is entered from the READY state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) * @SCI_PORT_READY: port is now ready. Thus, the user is able to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) * perform IO operations on this port. This state is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) * entered from the STARTING state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) * @SCI_PORT_SUB_WAITING: port is started and ready but has no active
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) * phys.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) * @SCI_PORT_SUB_OPERATIONAL: port is started and ready and there is at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * least one phy operational.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) * @SCI_PORT_SUB_CONFIGURING: port is started and there was an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) * add/remove phy event. This state is only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) * used in Automatic Port Configuration Mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) * (APC)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) * @SCI_PORT_RESETTING: port is in the process of performing a hard
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) * reset. Thus, the user is unable to perform IO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * operations on this port. This state is entered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) * from the READY state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) * @SCI_PORT_FAILED: port has failed a reset request. This state is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) * entered when a port reset request times out. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) * state is entered from the RESETTING state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) #define PORT_STATES {\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) C(PORT_STOPPED),\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) C(PORT_STOPPING),\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) C(PORT_READY),\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) C(PORT_SUB_WAITING),\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) C(PORT_SUB_OPERATIONAL),\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) C(PORT_SUB_CONFIGURING),\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) C(PORT_RESETTING),\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) C(PORT_FAILED),\
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) #undef C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) #define C(a) SCI_##a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) enum sci_port_states PORT_STATES;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #undef C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) static inline void sci_port_decrement_request_count(struct isci_port *iport)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) if (WARN_ONCE(iport->started_request_count == 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) "%s: tried to decrement started_request_count past 0!?",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) __func__))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) /* pass */;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) iport->started_request_count--;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) #define sci_port_active_phy(port, phy) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) (((port)->active_phy_mask & (1 << (phy)->phy_index)) != 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) void sci_port_construct(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) u8 port_index,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) struct isci_host *ihost);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) enum sci_status sci_port_start(struct isci_port *iport);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) enum sci_status sci_port_stop(struct isci_port *iport);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) enum sci_status sci_port_add_phy(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) struct isci_phy *iphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) enum sci_status sci_port_remove_phy(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) struct isci_phy *iphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) void sci_port_setup_transports(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) u32 device_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) void isci_port_bcn_enable(struct isci_host *, struct isci_port *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) void sci_port_deactivate_phy(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) struct isci_phy *iphy,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) bool do_notify_user);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) bool sci_port_link_detected(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) struct isci_phy *iphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) enum sci_status sci_port_get_properties(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) struct sci_port_properties *prop);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) enum sci_status sci_port_link_up(struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) struct isci_phy *iphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) enum sci_status sci_port_link_down(struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) struct isci_phy *iphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) struct isci_request;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) struct isci_remote_device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) enum sci_status sci_port_start_io(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) struct isci_remote_device *idev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) struct isci_request *ireq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) enum sci_status sci_port_complete_io(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) struct isci_remote_device *idev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) struct isci_request *ireq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) enum sas_linkrate sci_port_get_max_allowed_speed(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) struct isci_port *iport);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) void sci_port_broadcast_change_received(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) struct isci_phy *iphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) bool sci_port_is_valid_phy_assignment(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) u32 phy_index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) void sci_port_get_sas_address(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) struct sci_sas_address *sas_address);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) void sci_port_get_attached_sas_address(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) struct sci_sas_address *sas_address);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) void sci_port_set_hang_detection_timeout(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) struct isci_port *isci_port,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) u32 timeout);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) void isci_port_formed(struct asd_sas_phy *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) void isci_port_deformed(struct asd_sas_phy *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) int isci_port_perform_hard_reset(struct isci_host *ihost, struct isci_port *iport,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) struct isci_phy *iphy);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) int isci_ata_check_ready(struct domain_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) #endif /* !defined(_ISCI_PORT_H_) */