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

5-freebsd-12
Last change on this file since dd35ec5 was 4613db0, checked in by Christian Mauderer <Christian.Mauderer@…>, on Nov 2, 2017 at 1:34:35 PM

wpa_supplicant: Add lock.

  • 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-thread.h>
44
45#include <sys/types.h>
46#include <sys/kernel.h>
47#include <sys/lock.h>
48#include <sys/mutex.h>
49
50#include <machine/rtems-bsd-wpa-supplicant.h>
51
52static struct mtx wpa_supplicant_mtx;
53
54MTX_SYSINIT(rtems_bsd_wpa_supplicant, &wpa_supplicant_mtx, "BSD WPA Supplicant",
55    MTX_DEF);
56
57void
58rtems_bsd_wpa_supplicant_lock(void)
59{
60        mtx_lock(&wpa_supplicant_mtx);
61}
62
63void
64rtems_bsd_wpa_supplicant_unlock(void)
65{
66        mtx_unlock(&wpa_supplicant_mtx);
67}
68
Note: See TracBrowser for help on using the repository browser.