softmac_pkt.c revision 10972dde7ca84b20374a9b03e1aa514b454e974b
/*
* 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/softmac_impl.h>
/*
* Macro to check whether the write-queue of the lower stream is full.
*
* Because softmac is pushed right above the underlying device and
* _I_INSERT/_I_REMOVE is not processed in the lower stream, it is
* safe to directly access the q_next pointer.
*/
#define CANPUTNEXT(q) \
mblk_t *
{
/*
* Optimize for the most common case.
*/
if (!CANPUTNEXT(wq))
return (mp);
return (NULL);
}
if (!CANPUTNEXT(wq))
break;
}
return (mp);
}
void
{
/*
* When packets arrive, the softmac might not be fully started.
*/
"copymsg failed");
goto failed;
}
}
return;
}
/*
* Serialize control message processing.
*/
static void
{
while (slp->sl_ctl_inprogress)
}
static void
{
}
static int
{
}
static int
{
union DL_primitives *dlp;
int err = 0;
/*
* Record the pending DLPI primitive.
*/
break;
}
/*
* If we timed out, sl_ack_mp will still be NULL, but sl_pending_prim
* won't be set to DL_PRIM_INVAL.
*/
} else {
}
} else {
}
else
return (err);
}
void
{
/*
* Record that ioctl processing is currently in progress.
*/
while (slp->sl_pending_ioctl)
}
static int
{
union DL_primitives *dlp;
DL_ERROR_ACK)) == NULL)
return (ENOMEM);
return (0);
}
int
{
int err = 0;
switch (dl_prim) {
case DL_ENABMULTI_REQ:
case DL_DISABMULTI_REQ:
case DL_SET_PHYS_ADDR_REQ:
case DL_UNBIND_REQ:
case DL_UDQOS_REQ:
case DL_PROMISCON_REQ:
case DL_PROMISCOFF_REQ:
break;
case DL_BIND_REQ:
break;
case DL_NOTIFY_REQ:
break;
case DL_CONTROL_REQ:
break;
case DL_CAPABILITY_REQ:
break;
default:
DL_UNSUPPORTED, 0);
}
break;
}
return (err);
}