/*
* 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
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*/
#include <sys/byteorder.h>
#include <sys/sysmacros.h>
#include <sys/mac_client.h>
/*
* FCoE header files
*/
/*
* Driver's own header files
*/
#include <fcoe.h>
#include <fcoe_fc.h>
#include <fcoe_eth.h>
static void fcoe_free_netb(void *netb);
/*
* Only this function will be called explicitly by clients
*/
{
"fail registering client.");
return (NULL);
}
/*
* We will not come here, when someone is changing ss_mac_list,
* so it's safe to go through ss_mac_list.
*/
break;
}
}
FCOE_LOG(0, "can't find the MAC you want to bind");
return (NULL);
}
FCOE_LOG(0, "the MAC you want to bind is bound already");
return (NULL);
}
/*
* fcoe_port_t initialization
*/
return (eport);
}
/*
* The following routines will be called through vectors in fcoe_port_t
*/
/*
* offline status already
*/
static void
{
/*
* Wait for all the related frame to be freed, this should be fast
* is already in offline status so no frame will be received or sent
* any more
*/
while (mac->fm_frm_cnt > 0) {
delay(10);
}
(void) fcoe_close_mac(mac);
}
}
/* ARGSUSED */
static int
{
switch (cmd) {
case FCOE_CMD_PORT_ONLINE:
/*
* client ask us to online, so it's safe to post event
* and data up
*/
return (FCOE_FAILURE);
}
(void) ddi_taskq_dispatch(
break;
case FCOE_CMD_PORT_OFFLINE:
return (FCOE_FAILURE);
}
// in case there are threads waiting
break;
default:
break;
}
return (FCOE_SUCCESS);
}
/*
* Transmit the specified frame to the link
*/
static void
{
if (ret_cookie != NULL) {
/*
* we are doing offline, so just tell the upper that
* this is finished, the cmd will be aborted soon.
*/
} else {
goto tx_frame;
}
}
/*
* MAC driver will release the mblk of the frame
* We need only release the frame itself
*/
mac->fm_frm_cnt ++;
}
}
/*
* Consider cache allocation in the future
*/
void
{
}
static void *
{
}
return (mp);
}
static void
{
}
{
if (fc_frame_size > 2136) {
return (NULL);
}
/*
* We are allocating solicited frame now
*/
return (NULL);
}
}
/*
* fcoe_frame_t initialization
*/
sizeof (fcoe_fc_frame_header_t);
/*
* fcoe_i_frame_t initialization
*/
/*
* Continue to initialize fcoe_frame_t
*/
return (frm);
}
/*
* Sub routines called by interface functions
*/
/*
* According to spec, fill EthernetII frame header, FCoE frame header
* VLAN (not included for now)
*/
static void
{
/*
* Initialize ethernet frame header
*/
/*
* Initialize FCoE frame header
*/
/* set to SOFi3 for the first frame of a sequence */
if (FRM_SEQ_CNT(frm) == 0) {
} else {
}
}
/*
* According to spec, fill FCOE frame tailer including CRC
* VLAN (not included for now)
*/
static void
{
/*
* Initialize FCoE frame tailer
* CRC is not big endian, can't use macro V2B
*/
(uint32_t)~0, crc32_table);
} else {
}
}
void
{
}
void
{
}
}
int
{
int rval = 0;
return (NDI_FAILURE);
}
FCOE_LOG("fcoe",
"fcoe%d: prop_update port mac id failed for mac %d",
(void) ndi_devi_free(child);
return (NDI_FAILURE);
}
if (rval != NDI_SUCCESS) {
return (NDI_FAILURE);
}
return (rval);
}
int
{
int rval = 0;
return (EINVAL);
}
return (EALREADY);
}
/*
* It means that deferred detach has finished
* of last delete operation
*/
goto skip_devi_offline;
}
if (rval != NDI_SUCCESS) {
return (EBUSY);
}
(void) fcoe_close_mac(mac);
return (0);
}