/*
* 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 <assert.h>
#include <fcntl.h>
#include <libdlpi.h>
#include <libnwam.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "events.h"
#include "ncp.h"
#include "ncu.h"
#include "objects.h"
#include "util.h"
/*
* dlpi_events.c - this file contains routines to retrieve
* DL_NOTE_LINK_[UP|DOWN] events from the system and packages them for high
* level processing. Holding a dlpi_handle to a link prevents the
* associated driver unloading that can happen when IP is not plumbed,
* so it is vital to ensure that the handle is open for the lifetime
* of the WiFi connection.
*/
/*
* This is a callback function executed when dlpi_recv() gets a DL_NOTE_LINK_UP.
* It packages up the event for consumption by the link state machine.
*/
/* ARGSUSED0 */
static void
{
else
}
/*
* We are only intested in DL_NOTE_LINK_UP events which we've registered for
* in nwamd_dlpi_add_link(). But we have to keep calling dlpi_recv() to
* force the notification callback to be executed.
*/
static void *
{
int rc;
do {
} while (rc == DLPI_SUCCESS);
return (NULL);
}
/*
* This is called when we want to start receiving notifications from state
* changes on a link.
*/
void
{
int rc;
/* Already running? */
if (link->nwamd_link_dlpi_thread != 0) {
return;
}
if (rc != DLPI_SUCCESS) {
return;
}
if (rc != DLPI_SUCCESS) {
"nwamd_dlpi_add_link: dlpi_enabnotify(%s) = %s",
return;
}
if (rc != 0) {
}
}
/*
* This function is called when we are no longer interested in receiving
* notification from state changes on a link.
*/
void
{
(void) pthread_cancel(
/* Unset properties before closing */
}
}