/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/*
* This file defines interfaces between fcoe and fct driver.
*/
/*
* Driver kernel header files
*/
#include <sys/byteorder.h>
#include <sys/ethernet.h>
/*
* COMSTAR header files
*/
#include <sys/stmf_defines.h>
#include <sys/fct_defines.h>
/*
* FCoE hader files
*/
/*
* Driver's own header files
*/
#include "fcoet.h"
#include "fcoet_fc.h"
#include "fcoet_eth.h"
/*
* function forward declaration
*/
/*
* Return the lower link information
*/
{
return (FCT_SUCCESS);
}
/*
* FCT will call this, when it wants to send PLOGI or has received PLOGI.
*/
{
case 0xFFFFFC:
handle = 0x7FC;
break;
case 0xFFFFFD:
handle = 0x7FD;
break;
case 0xFFFFFE:
handle = 0x7FE;
break;
case 0xFFFFFF:
handle = 0x7FF;
break;
default:
/*
* For not well-known address, we let FCT to select one.
*/
break;
}
} else {
}
return (ret);
}
/*
* FCT will call this to say "FCoET can release resources with this RP now."
*/
/* ARGSUSED */
{
this_ss->ss_rport_dereg_state = 0;
this_ss->ss_rportid_in_dereg = 0;
return (FCT_SUCCESS);
}
{
return (fcoet_send_sol_els(cmd));
return (fcoet_send_sol_ct(cmd));
}
return (FCT_FAILURE);
}
/*
* SCSI response phase
*/
{
if (ioflags & FCT_IOF_FORCE_FCA_DONE) {
goto send_cmd_rsp_error;
} else {
return (fcoet_send_status(cmd));
}
}
if (ioflags & FCT_IOF_FORCE_FCA_DONE) {
goto send_cmd_rsp_error;
} else {
return (fcoet_send_els_response(cmd));
}
}
if (ioflags & FCT_IOF_FORCE_FCA_DONE) {
cmd->cmd_handle = 0;
}
return (fcoet_send_abts_response(cmd, 0));
} else {
ASSERT(0);
return (FCT_FAILURE);
}
"handle FCT_IOF_FORCE_FCA_DONE for cmd %p, ioflags-%x", (void *)cmd,
ioflags);
return (FCT_FAILURE);
}
/*
*/
/* ARGSUSED */
{
int idx;
int frm_num;
int data_size;
int left_size;
int offset;
if (dbuf->db_relative_offset == 0)
/*
* If it's write type command, we need send xfer_rdy now
* We may need to consider bidirectional command later
*/
dbuf->db_sglist_length = 0;
ASSERT(0);
return (FCT_FAILURE);
} else {
}
return (FCT_SUCCESS);
}
/*
* It's time to transfer READ data to remote side
*/
} else {
}
ASSERT(0);
return (FCT_FAILURE);
} else {
/*
* lock the xchg to avoid being released (by abort)
* after sent out and before release
*/
}
} else {
}
/*
* Disassociate netbs which will be freed by NIC driver
*/
}
return (FCT_SUCCESS);
}
{
case FCT_CMD_RCVD_ABTS:
/*
* Sometimes unsolicited ABTS request will be received twice
* and the first ABTS is not done yet, so the second ABTS
* will be passed down here, in this case we will do
* nothing and abts response is not needed to be sent
* fct_ret = fcoet_send_abts_response(cmd, 1);
*/
break;
case FCT_CMD_FCP_XCHG:
case FCT_CMD_RCVD_ELS:
break;
}
if (!(flags & FCT_IOF_FORCE_FCA_DONE)) {
}
break;
case FCT_CMD_SOL_ELS:
case FCT_CMD_SOL_CT:
break;
}
if (!(flags & FCT_IOF_FORCE_FCA_DONE)) {
}
break;
default:
ASSERT(0);
break;
}
if ((flags & FCT_IOF_FORCE_FCA_DONE) &&
cmd->cmd_handle = 0;
}
return (fct_ret);
}
/* ARGSUSED */
{
return (FCT_FAILURE);
}
void
{
/*
* FCT will initialize fct_cmd_t
* Initialize fcoet_exchange
*/
sizeof (fcoet_exchange_t), 0);
}
/*
* Keep it to compare with response
*/
/*
* FCoE will initialize fcoe_frame_t
*/
ASSERT(0);
return;
} else {
}
/* Common Service Parameters */
/* N_PORT */
/* PWWN and NWWN */
/* Class 3 Service Parameters */
}
/*
* This is for solicited FLOGI only
*/
void
{
/*
* FCoE will initialize fcoe_frame_t
* ABTS has no payload
*/
ASSERT(0);
return;
} else {
}
}
void
{
switch (cmd) {
case FCT_CMD_PORT_ONLINE:
this_ss->ss_state_not_acked = 0;
} else {
}
}
this_ss->ss_change_state_flags = 0;
break;
case FCT_CMD_PORT_OFFLINE:
}
this_ss->ss_state_not_acked = 0;
} else {
}
}
/*
* Notify the watchdog to do clear work
*/
break;
this_ss->ss_state_not_acked = 0;
break;
this_ss->ss_state_not_acked = 0;
if (fct_port_initialize(port,
"fcoet_ctl FCT_ACK_PORT_OFFLINE_COMPLETE "
"with RLFLAG_RESET") != FCT_SUCCESS) {
"fct_port_initialize %s failed",
FCOET_LOG("fcoet_ctl: fct_port_initialize "
}
}
break;
default:
break;
}
}
/*
* Filling the hba attributes
*/
/* ARGSUSED */
void
struct fct_port_attrs *port_attrs)
{
"Sun Microsystems, Inc.");
"%s", FCOET_NAME);
"%s", FCOET_VERSION);
/* Specified a fix speed here, need to change it in the future */
}
static fct_status_t
{
xch->xch_left_data_size = 0;
xch->xch_sequence_no = 0;
}
ASSERT(0);
return (FCT_FAILURE);
} else {
}
return (FCT_SUCCESS);
}
static fct_status_t
{
xch->xch_left_data_size = 0;
xch->xch_sequence_no = 0;
}
ASSERT(0);
return (FCT_FAILURE);
} else {
}
return (FCT_SUCCESS);
}
{
int raw_frame_size;
/*
* Fast channel for good status phase
*/
return (fcoet_send_good_status(cmd));
}
}
ASSERT(0);
return (FCT_FAILURE);
} else {
/*
* lock the xchg to avoid being released (by abort)
* after sent out and before release
*/
}
/*
* If there's sense data, copy it first
*/
}
/*
* Fill fcp_rsp
*/
}
}
}
/*
* Fill fc frame header
*/
return (FCT_SUCCESS);
}
static fct_status_t
{
ASSERT(0);
return (FCT_FAILURE);
} else {
/*
* lock the xchg to avoid being released (by abort)
* after sent out and before release
*/
}
return (FCT_SUCCESS);
}
/* ARGSUSED */
static fct_status_t
{
/*
* The relevant fcoet_exchange has been released
*/
ASSERT(0);
return (FCT_FAILURE);
} else {
}
return (FCT_SUCCESS);
}
/*
*/
{
/* Call fcoe function to online the port */
FCOE_FAILURE) {
return (FCT_FAILURE);
}
}
return (FCT_SUCCESS);
}
{
/* Call fcoe function to offline the port */
return (status);
}
static fct_status_t
{
ASSERT(0);
return (FCT_FAILURE);
} else {
}
if (xch_oxid == 0xFFFF) {
}
return (FCT_SUCCESS);
}
/*
* Called by: fcoet_register_remote_port
*/
/* ARGSUSED */
static fct_status_t
{
uint8_t *p;
p[0] = ELS_OP_PLOGI;
p[4] = 0x20;
p[5] = 0x20;
p[7] = 3;
p[8] = 0x88;
p[10] = 8;
p[13] = 0xff; p[15] = 0x1f;
p[18] = 7; p[19] = 0xd0;
p[68] = 0x80;
p[74] = 8;
p[77] = 0xff;
p[81] = 1;
return (FCT_SUCCESS);
}
/*
* Called by: fcoet_register_remote_port
*/
/* ARGSUSED */
static fct_status_t
{
uint8_t *p;
/*
* ACC
*/
p[0] = ELS_OP_ACC;
p[4] = 0x20;
p[5] = 0x20;
p[7] = 0x0A;
p[10] = 0x05;
p[11] = 0xAC;
p[68] = 0x88;
return (FCT_SUCCESS);
}
static fct_status_t
{
int raw_frame_size;
ASSERT(0);
return (FCT_FAILURE);
} else {
/*
* lock the xchg to avoid being released (by abort)
* after sent out and before release
*/
}
/*
* Fill fc frame header
*/
return (FCT_SUCCESS);
}