xref: /freebsd/sys/dev/ath/ah_osdep_ar5211.c (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1 /*-
2  * Copyright 2017 Adrian Chadd <adrian@FreeBSD.org>.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  *
25  */
26 
27 #include "opt_ah.h"
28 #include "opt_wlan.h"
29 
30 #include <sys/cdefs.h>
31 #include <sys/types.h>
32 #include <sys/systm.h>
33 #include <sys/conf.h>
34 #include <sys/errno.h>
35 #include <sys/kernel.h>
36 #include <sys/module.h>
37 
38 #include <dev/ath/ath_hal/ah.h>
39 #include <dev/ath/ath_hal/ah_internal.h>
40 
41 extern struct ath_hal_chip AR5211_chip;
42 
43 static int
44 ath_hal_ar5211_modevent(module_t mod __unused, int type, void *data __unused)
45 {
46 	int error = 0;
47 
48 	switch (type) {
49 	case MOD_LOAD:
50 		ath_hal_add_chip(&AR5211_chip);
51 		printf("[ar5211] loaded\n");
52 		break;
53 
54 	case MOD_UNLOAD:
55 		ath_hal_remove_chip(&AR5211_chip);
56 		printf("[ar5211] unloaded\n");
57 		break;
58 
59 	case MOD_SHUTDOWN:
60 		break;
61 
62 	default:
63 		error = EOPNOTSUPP;
64 		break;
65 	}
66 	return (error);
67 }
68 
69 DEV_MODULE(ath_hal_ar5211, ath_hal_ar5211_modevent, NULL);
70 MODULE_VERSION(ath_hal_ar5211, 1);
71 MODULE_DEPEND(ath_hal_ar5211, ath_hal, 1, 1, 1);
72