source: rtems-libbsd/rtemsbsd/rtems/rtems-kernel-wpa-supplicant.c @ 028bf82

55-freebsd-126-freebsd-12
Last change on this file since 028bf82 was b376ae1, checked in by Christian Mauderer <christian.mauderer@…>, on 05/03/18 at 12:15:11

ipsec-tools: Port libipsec, setkey and racoon.

Note that this replaces the libipsec from FreeBSD with the one provided
by ipsec-tools.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup rtems_bsd_rtems
5 *
6 * @brief Mutex for protecting wpa_supplicant.
7 *
8 * The wpa_supplicant needs it's own mutex so it can be used in background.
9 */
10
11/*
12 * Copyright (c) 2017 embedded brains GmbH.  All rights reserved.
13 *
14 *  embedded brains GmbH
15 *  Dornierstr. 4
16 *  82178 Puchheim
17 *  Germany
18 *  <rtems@embedded-brains.de>
19 *
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
22 * are met:
23 * 1. Redistributions of source code must retain the above copyright
24 *    notice, this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright
26 *    notice, this list of conditions and the following disclaimer in the
27 *    documentation and/or other materials provided with the distribution.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 */
41
42#include <machine/rtems-bsd-kernel-space.h>
43#include <machine/rtems-bsd-wpa-supplicant.h>
44
45#include <sys/types.h>
46#include <sys/kernel.h>
47#include <sys/mutex.h>
48
49static struct mtx wpa_supplicant_mtx;
50
51MTX_SYSINIT(rtems_bsd_wpa_supplicant, &wpa_supplicant_mtx, "BSD WPA Supplicant",
52    MTX_DEF);
53
54void
55rtems_bsd_wpa_supplicant_lock(void)
56{
57        mtx_lock(&wpa_supplicant_mtx);
58}
59
60void
61rtems_bsd_wpa_supplicant_unlock(void)
62{
63        mtx_unlock(&wpa_supplicant_mtx);
64}
65
Note: See TracBrowser for help on using the repository browser.