1116744Ssam#
2185522Ssam# Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3116744Ssam# All rights reserved.
4116744Ssam#
5116744Ssam# Redistribution and use in source and binary forms, with or without
6116744Ssam# modification, are permitted provided that the following conditions
7116744Ssam# are met:
8116744Ssam# 1. Redistributions of source code must retain the above copyright
9116744Ssam#    notice, this list of conditions and the following disclaimer,
10116744Ssam#    without modification.
11116744Ssam# 2. Redistributions in binary form must reproduce at minimum a disclaimer
12116744Ssam#    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
13116744Ssam#    redistribution must be conditioned upon including a substantially
14116744Ssam#    similar Disclaimer requirement for further binary redistribution.
15116744Ssam#
16116744Ssam# NO WARRANTY
17116744Ssam# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18116744Ssam# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19116744Ssam# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
20116744Ssam# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
21116744Ssam# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
22116744Ssam# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23116744Ssam# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24116744Ssam# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25116744Ssam# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26116744Ssam# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
27116744Ssam# THE POSSIBILITY OF SUCH DAMAGES.
28116744Ssam#
29116744Ssam# $FreeBSD: stable/10/sys/modules/ath/Makefile 313631 2017-02-11 07:14:45Z ngie $
30116744Ssam#
31116744Ssam
32186094SsamATH_RATE?=	sample		# tx rate control algorithm
33116744Ssam
34313631Sngie.PATH:	${SRCTOP}/sys/dev/ath
35313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_hal
36186094Ssam
37186094SsamKMOD=	if_ath
38243837SadrianSRCS=	if_ath.c if_ath_alq.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c
39235679SadrianSRCS+=	if_ath_tx.c if_ath_tx_ht.c if_ath_led.c if_ath_rx.c if_ath_tdma.c
40244952SadrianSRCS+=	if_ath_beacon.c if_ath_rx_edma.c if_ath_tx_edma.c if_ath_spectral.c
41251655SadrianSRCS+=	if_ath_btcoex.c if_ath_lna_div.c
42186094Ssam# NB: v3 eeprom support used by both AR5211 and AR5212; just include it
43203286SrpauloSRCS+=	ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c
44190571SsamSRCS+=	device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h
45186094Ssam
46186094Ssam#
47186094Ssam# AR5210 support; these are first generation 11a-only devices.
48186094Ssam#
49313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_hal/ar5210
50186094SsamSRCS+=	ah_eeprom_v1.c \
51185522Ssam	ar5210_attach.c ar5210_beacon.c ar5210_interrupts.c \
52185522Ssam	ar5210_keycache.c ar5210_misc.c ar5210_phy.c ar5210_power.c \
53185522Ssam	ar5210_recv.c ar5210_reset.c ar5210_xmit.c
54186094Ssam
55186094Ssam#
56186094Ssam# AR5211 support; these are second generation 11b/g/a devices
57186094Ssam# (but 11g was OFDM only and is not supported).
58186094Ssam#
59313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_hal/ar5211
60186094SsamSRCS+=	ar5211_attach.c ar5211_beacon.c ar5211_interrupts.c \
61185522Ssam	ar5211_keycache.c ar5211_misc.c	ar5211_phy.c ar5211_power.c \
62185522Ssam	ar5211_recv.c ar5211_reset.c ar5211_xmit.c
63186094Ssam
64186094Ssam#
65186094Ssam# AR5212 support; this covers all other pci/cardbus legacy parts.
66186094Ssam#
67313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_hal/ar5212
68186094SsamSRCS+=	ar5212_ani.c ar5212_attach.c ar5212_beacon.c ar5212_eeprom.c \
69185522Ssam	ar5212_gpio.c ar5212_interrupts.c ar5212_keycache.c ar5212_misc.c \
70185522Ssam	ar5212_phy.c ar5212_power.c ar5212_recv.c ar5212_reset.c \
71186094Ssam	ar5212_rfgain.c ar5212_xmit.c
72186094Ssam# RF backends
73186094SsamSRCS+=	ar5111.c
74186094SsamSRCS+=	ar5112.c
75186094SsamSRCS+=	ar2413.c
76186094SsamSRCS+=	ar2425.c
77186094SsamSRCS+=	ar5413.c
78186094Ssam
79186094Ssam#
80227421Sadrian# AR5416, AR9130, AR9160, AR9220, AR9280, AR9285, AR9287 support.
81221163Sadrian
82221163Sadrian# Note enabling this support requires defining AH_SUPPORT_AR5416
83221163Sadrian# in opt_ah.h so the 11n tx/rx descriptor format is handled.
84186094Ssam#
85186094Ssam# NB: 9160 depends on 5416 but 5416 does not require 9160
86186094Ssam#
87221163Sadrian# + 5416 (Owl)
88313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_hal/ar5416
89203286SrpauloSRCS+=	ah_eeprom_v14.c ah_eeprom_v4k.c \
90243838Sadrian	ar5416_ani.c ar5416_attach.c ar5416_beacon.c ar5416_btcoex.c \
91243838Sadrian	ar5416_cal.c ar5416_cal_iq.c ar5416_cal_adcgain.c ar5416_cal_adcdc.c \
92185522Ssam	ar5416_eeprom.c ar5416_gpio.c ar5416_interrupts.c ar5416_keycache.c \
93244945Sadrian	ar5416_misc.c ar5416_phy.c ar5416_power.c ar5416_radar.c ar5416_spectral.c \
94231927Sadrian	ar5416_recv.c ar5416_reset.c ar5416_xmit.c
95217631Sadrian
96221163Sadrian# RF backend for 5416, 9130 and 9160
97217631SadrianSRCS+=	ar2133.c
98217631Sadrian
99221163Sadrian# + AR9160 (Sowl)
100313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_hal/ar9001
101186094SsamSRCS+=	ar9160_attach.c
102217631Sadrian
103221163Sadrian# + AR9130 - (Sowl) - Embedded (AR913x SoC)
104221163Sadrian#
105221163Sadrian# This requires AH_SUPPORT_AR9130 in order to function as some
106221163Sadrian# register values have shifted for this chipset. Definig this however
107221163Sadrian# (currently) breaks non-AR9130 chipsets - since this is an embedded
108221163Sadrian# chipset and no other radios are glued to it, this shouldn't pose a
109221163Sadrian# problem.
110221163SadrianSRCS+=	ar9130_attach.c ar9130_eeprom.c ar9130_phy.c
111221163Sadrian
112221163Sadrian# AR9002 series chips
113221163Sadrian# + AR9220/AR9280 - Merlin
114313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_hal/ar9002
115219393SadrianSRCS+=	ar9280.c ar9280_attach.c ar9280_olc.c
116221163Sadrian
117221163Sadrian# + AR9285 - Kite
118220587SadrianSRCS+=	ar9285.c ar9285_reset.c ar9285_attach.c ar9285_cal.c ar9285_phy.c
119243838SadrianSRCS+=	ar9285_diversity.c ar9285_btcoex.c
120185522Ssam
121222325Sadrian# + AR9287 - Kiwi
122313631Sngie.PATH:  ${SRCTOP}/sys/dev/ath/ath_hal
123222325SadrianSRCS+=  ah_eeprom_9287.c
124313631Sngie.PATH:  ${SRCTOP}/sys/dev/ath/ath_hal/ar9002
125222325SadrianSRCS+=  ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c
126222325Sadrian
127248079Sadrian# + AR9300 HAL
128313631Sngie.PATH:  ${SRCTOP}/sys/contrib/dev/ath/ath_hal/ar9300
129250173SadrianSRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c
130250173SadrianSRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c
131250173SadrianSRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c
132250173SadrianSRCS+= ar9300_stub_funcs.c ar9300_eeprom.c ar9300_paprd.c ar9300_recv_ds.c
133250173SadrianSRCS+= ar9300_freebsd.c ar9300_phy.c ar9300_reset.c ar9300_gpio.c
134250173SadrianSRCS+= ar9300_power.c ar9300_timer.c
135248079Sadrian
136186094Ssam# NB: rate control is bound to the driver by symbol names so only pick one
137186094Ssam.if ${ATH_RATE} == "sample"
138313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_rate/sample
139190571SsamSRCS+=	sample.c
140186094Ssam.elif ${ATH_RATE} == "onoe"
141313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_rate/onoe
142186094SsamSRCS+=	onoe.c
143186094Ssam.elif ${ATH_RATE} == "amrr"
144313631Sngie.PATH:	${SRCTOP}/sys/dev/ath/ath_rate/amrr
145186094SsamSRCS+=	amrr.c
146186094Ssam.endif
147116744Ssam
148222585Sadrian# DFS
149313631Sngie.PATH: ${SRCTOP}/sys/dev/ath/ath_dfs/null
150222585SadrianSRCS+=	dfs_null.c
151222585Sadrian
152313631SngieCFLAGS+=  -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal
153313631SngieCFLAGS+=  -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/
154116744Ssam
155229560Sadrian.if !defined(KERNBUILDDIR)
156185522Ssamopt_ah.h:
157185522Ssam	echo '#define AH_SUPPORT_AR5416 1' > $@
158229560Sadrian.endif
159157438Ssam
160116744Ssam.include <bsd.kmod.mk>
161228818Sdim
162228818SdimCWARNFLAGS.ah_regdomain.c=	${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW}
163239462Sdim# XXX Work around clang warnings, until maintainer approves fix.
164239462SdimCWARNFLAGS.if_ath.c=		${NO_WSOMETIMES_UNINITIALIZED}
165228818SdimCWARNFLAGS+=			${CWARNFLAGS.${.IMPSRC:T}}
166248259Sadrian
167248259Sadrian# AR9300 HAL build overrides, as there's still some code to tidy up
168250173SadrianCWARNFLAGS.ar9300_eeprom.c=	${NO_WCONSTANT_CONVERSION}
169260272SdimCWARNFLAGS.ar9300_reset.c=	${NO_WSOMETIMES_UNINITIALIZED} -Wno-unused-function
170