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