dlcosmk.c revision f4b3ec61df05330d25f55a36b975b4d7519fdeb1
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* Module to mark the 802.1d user priority field for a given packet */
/* Debug level */
int dlcosmk_debug = 0;
/*
* Given a packet, this module marks the mblk with the appropriate b_band or
* dl_max value so that the VLAN driver marks the outgoing frame with the
* configured 802.1D user_priority value. For non-VLAN devices or for inbound
* packets, this module does not do anything (i.e. the packet is processed by
* the next action in the list, if present).
* This module does not free any mblks or packets in case or errors.
*/
int
{
/*
* The action module will receive an M_DATA or an M_CTL followed
* by an M_DATA. In the latter case skip the M_CTL.
*/
dlcosmk0dbg(("dlcosmk_process: no data\n"));
return (EINVAL);
}
}
/* Update global stats */
/*
* This should only be called for outgoing packets. For inbound, just
* send it along.
*/
dlcosmk2dbg(("dlcosmk_process:cannot mark incoming packets\n"));
return (0);
}
if ((ill_index == 0) ||
dlcosmk2dbg(("dlcosmk_process:invalid ill index %u\n",
ill_index));
return (0);
}
/*
* Check if the interface supports CoS marking. If not send it to the
* next action in the chain
*/
dlcosmk2dbg(("dlcosmk_process:ill %u does not support CoS\n",
ill_index));
return (0);
}
/*
* Mark the b_band for fastpath messages or dl_priority.dl_max for
* DL_UNITDATA_REQ messages. For, others just pass it along.
*/
case M_PROTO:
case M_PCPROTO:
{ /* DL_UNITDATA */
/* DL_UNITDATA message?? */
} else {
1);
}
break;
}
case M_DATA:
/* fastpath message */
break;
default:
break;
}
return (0);
}