/*
* 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/inttypes.h>
#include <sys/mac_client.h>
/*
* FCoE header files
*/
/*
* Driver's own header files
*/
#include <fcoe.h>
#include <fcoe_eth.h>
#include <fcoe_fc.h>
/*
* Global variable definitions
*/
/*
* Internal tunable, used to enable p2p mode
*/
int
{
int ret;
int fcoe_ret;
*err_detail = 0;
/*
* Open MAC interface
*/
if (ret != 0) {
return (FCOE_FAILURE);
}
if (ret != 0) {
(void) fcoe_close_mac(mac);
return (FCOE_FAILURE);
}
/*
* Cache the pointer of the immutable MAC inforamtion and
* the current and primary MAC address
*/
(void) fcoe_close_mac(mac);
return (FCOE_FAILURE);
}
if (force_promisc) {
}
/* Get mtu */
/*
* Fail open if fail to get mtu, or we are not
* using p2p, or we are using p2p, but
* the mtu is too small
*/
(void) fcoe_close_mac(mac);
return (FCOE_FAILURE);
}
}
return (fcoe_ret);
}
int
{
int ret;
return (FCOE_SUCCESS);
}
if (mac->fm_running) {
}
} else {
}
}
}
return (FCOE_SUCCESS);
}
int
{
int ret;
/*
* Set message callback
*/
if (mac->fm_force_promisc) {
if (ret != 0) {
return (FCOE_FAILURE);
}
} else {
}
/* Get the link state, if it's up, we will need to notify client */
mac->fm_link_state =
/*
* Add a notify function so that we get updates from MAC
*/
fcoe_mac_notify, (void *)mac);
return (FCOE_SUCCESS);
}
int
{
int ret;
if (mac->fm_promisc_handle) {
} else {
}
if (mac->fm_notify_handle) {
}
return (ret);
}
/* ARGSUSED */
static void
{
if (frm_type != ETHERTYPE_FCOE) {
/*
* This mp is not allocated in FCoE, but we must free it
*/
continue;
}
}
}
}
static void
{
/*
* We assume that the calls to this notification callback are serialized
* by MAC layer
*/
switch (type) {
case MAC_NOTE_LINK:
/*
* This notification is sent every time the MAC driver
* updates the link state.
*/
break;
}
/* Get speed */
"fcoe_mac_notify: link/%d arg/%p LINK up",
} else {
break;
}
"fcoe_mac_notify: link/%d arg/%p LINK down",
}
break;
case MAC_NOTE_TX:
/*
* MAC is not so busy now, then wake up fcoe_tx_frame to try
*/
break;
default:
break;
}
}
int
{
int ret;
return (FCOE_SUCCESS);
}
if (ret != 0) {
return (FCOE_FAILURE);
}
}
if (fc_assigned) {
} else {
}
return (FCOE_SUCCESS);
}