/*
* 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
*/
/*
*/
#include "ecp_impl.h"
static int __ecp_logging = 0;
static int ecp_send_impl(void *, char *, int, boolean_t);
void
{
if (__ecp_logging == 0) {
return;
}
if (__ecp_logging == ECP_SYS_LOG)
else
}
static void
{
return;
}
logerr("SRC: %s\n",
logerr("DST: %s\n",
logerr("Version %d\n",
logerr("OP %d\n",
logerr("Type: %d\n",
logerr("Seq: %d\n",
}
/* Only VDP is defined as a consumer of ECP */
static boolean_t
{
switch (subtype) {
case ECP_VDP:
return (B_TRUE);
default:
return (B_FALSE);
}
}
static void
{
logtrace("ecp_sighandler\n");
pthread_exit(0);
}
static void
{
}
/*
* Parse an incoming ECP packet. If this is an ACK for the last sequence
* we sent, we are done. If this is a request, we ACK it. Additionally, if
* we are seeing a request from the peer for the first time, we initialize the
* peer's sequence number.
*/
static void
{
return;
}
/* Ignore packets sent by us */
return;
}
logerr("ecp_parse_rx_packet: unsupported version %d\n",
ecp_ver);
return;
}
} else {
logerr("ecp rcvd ack %d expected %d \n",
}
if (ecp_instp->ecp_init_req_seq) {
/*
* Resend REQ ack
*/
return;
}
/*
* ACK the request
*/
/*
* Pass it on to the ULP
*/
} else {
logerr("ecp_parse_rx_packet not for us - subtype %d\n",
ecp_type);
}
}
/* Thread for receiving ECP packets */
static void *
{
int ret;
my_ecp_instp = arg;
/* LINTED */
while (B_TRUE) {
errno = 0;
if (ret <= 0) {
break;
} else {
/* Let's look at the packet */
}
}
return (NULL);
}
/*
* Initialize an ECP instance including the callback function to be invoked.
*/
void *
int *errorp)
{
if (!ecp_validate_subtype(subtype)) {
return (NULL);
}
return (NULL);
}
/* LINTED */
/*
* Need a progrmatic way to find this.
*/
ecp_inst_thr_process, (void *)ecp_instp);
__ecp_logging = log;
return (ecp_instp);
}
void
{
logtrace("ecp_fini: calling pthread_kill \n");
}
int
{
return (sizeof (ecp_hdr_t));
}
/*
* Prepare and transmit an ECP packet after prepending the ECP header, if not
* a retransmit.
*/
static int
{
int ret;
} else {
}
if (!resend) {
}
/*
* ACK request received
* OR resend the last req ACK
*/
} else if (!resend) {
/* LINTED */
}
errno = 0;
return (ret);
}
if (resend)
return (0);
}
/*
* Send an ECP request and wait for the ACK. Retransmit if not ack'd
* upto the max retries time.
*/
{
int retry_count = 0;
/*
* Check if ECP was acked
*/
if (ecp_instp->ecp_tx_acked)
break;
retry_count++;
}
if (!ecp_instp->ecp_tx_acked)
return (ret);
}
void
{
}
void
{
}
void
{
}