-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
178 lines (163 loc) · 6.26 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Kernel build directory
KDIR := /lib/modules/$(shell uname -r)/build
RADIO_TEST := 0
FW_LOAD_SUPPORT := 1
FW_LOAD?=PATCH
# Default is empty to force explicit selection
BUS_IF := PCIE
# Due to multiple Makefiles, we need to get the current directory
NRF_WIFI_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
INCLUDES = -I$(NRF_WIFI_DIR)/utils/inc \
-I$(NRF_WIFI_DIR)/os_if/inc \
-I$(NRF_WIFI_DIR)/bus_if/bal/inc/ \
-I$(NRF_WIFI_DIR)/fw_if/umac_if/inc \
-I$(NRF_WIFI_DIR)/fw_load/mips/fw/inc \
-I$(NRF_WIFI_DIR)/hw_if/hal/inc/ \
-I$(NRF_WIFI_DIR)/hw_if/hal/inc/fw \
-I$(NRF_WIFI_DIR)/fw_if/umac_if/inc/fw
ifeq ($(BUS_IF), QSPI)
INCLUDES += -I$(NRF_WIFI_DIR)/bus_if/bus/qspi/inc
else ifeq ($(BUS_IF), SPI)
INCLUDES += -I$(NRF_WIFI_DIR)/bus_if/bus/spi/inc
else ifeq ($(BUS_IF), PCIE)
INCLUDES += -I$(NRF_WIFI_DIR)/bus_if/bus/pcie/inc
endif
# TODO: Use Kconfig + menuconfig for this
# For now, just comment/uncomment the flags you want
ccflags-y += -DNRF_WIFI_LOW_POWER
ccflags-y += -DNRF_WIFI_RPU_RECOVERY
ccflags-y += -DNRF_WIFI_AP_DEAD_DETECT_TIMEOUT=20
ccflags-y += -DNRF_WIFI_IFACE_MTU=1500
ccflags-y += -DNRF70_STA_MODE
ccflags-y += -DNRF70_DATA_TX
#ccflags-y += -DNRF70_RAW_DATA_TX
#ccflags-y += -DNRF70_RAW_DATA_RX
#ccflags-y += -DNRF70_PROMISC_DATA_RX
#ccflags-y += -DNRF70_TX_DONE_WQ_ENABLED
#ccflags-y += -DNRF70_RX_WQ_ENABLED
ccflags-y += -DNRF70_UTIL
#ccflags-y += -DNRF70_OFFLOADED_RAW_TX
ccflags-y += -DNRF70_TCP_IP_CHECKSUM_OFFLOAD
ccflags-y += -DNRF70_RPU_EXTEND_TWT_SP
#ccflags-y += -DNRF70_SYSTEM_WITH_RAW_MODES
#ccflags-y += -DNRF70_SCAN_ONLY
#ccflags-y += -DNRF70_2_4G_ONLY
ccflags-y += -DNRF70_LOG_VERBOSE
#ccflags-y += -DNRF70_AP_MODE
ccflags-y += -DNRF_WIFI_MGMT_BUFF_OFFLOAD
ccflags-y += -DNRF_WIFI_FEAT_KEEPALIVE
ccflags-y += -DNRF_WIFI_KEEPALIVE_PERIOD_S=60
#ccflags-y += -DWIFI_MGMT_RAW_SCAN_RESULTS
#ccflags-y += -DNRF_WIFI_COEX_DISABLE_PRIORITY_WINDOW_FOR_SCAN
ccflags-y += -DNRF70_RX_NUM_BUFS=48
ccflags-y += -DNRF70_MAX_TX_TOKENS=10
ccflags-y += -DNRF70_RX_MAX_DATA_SIZE=1600
ccflags-y += -DNRF70_MAX_TX_PENDING_QLEN=18
ccflags-y += -DNRF70_RPU_PS_IDLE_TIMEOUT_MS=10
ccflags-y += -DNRF70_BAND_2G_LOWER_EDGE_BACKOFF_DSSS=0
ccflags-y += -DNRF70_BAND_2G_LOWER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_2G_LOWER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_2G_UPPER_EDGE_BACKOFF_DSSS=0
ccflags-y += -DNRF70_BAND_2G_UPPER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_2G_UPPER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_1_LOWER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_1_UPPER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_2A_LOWER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_2A_UPPER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_2C_LOWER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_2C_UPPER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_3_LOWER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_3_UPPER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_4_LOWER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HT=0
ccflags-y += -DNRF70_BAND_UNII_4_UPPER_EDGE_BACKOFF_HE=0
ccflags-y += -DNRF70_PCB_LOSS_2G=0
ccflags-y += -DNRF70_PCB_LOSS_5G_BAND1=0
ccflags-y += -DNRF70_PCB_LOSS_5G_BAND2=0
ccflags-y += -DNRF70_PCB_LOSS_5G_BAND3=0
ccflags-y += -DNRF70_ANT_GAIN_2G=0
ccflags-y += -DNRF70_ANT_GAIN_5G_BAND1=0
ccflags-y += -DNRF70_ANT_GAIN_5G_BAND2=0
ccflags-y += -DNRF70_ANT_GAIN_5G_BAND3=0
ccflags-y += -DNRF_WIFI_PS_INT_PS
ccflags-y += -DNRF_WIFI_RPU_RECOVERY_PS_ACTIVE_TIMEOUT_MS=50000
ccflags-y += -DNRF_WIFI_DISPLAY_SCAN_BSS_LIMIT=150
ccflags-y += -DNRF_WIFI_RPU_MIN_TIME_TO_ENTER_SLEEP_MS=1000
ccflags-y += -DWIFI_NRF70_LOG_LEVEL=1
# Source files
SRCS = os_if/src/osal.c \
utils/src/list.c \
utils/src/queue.c \
utils/src/util.c \
hw_if/hal/src/common/hal_interrupt.c \
hw_if/hal/src/common/hal_mem.c \
hw_if/hal/src/common/hal_reg.c \
hw_if/hal/src/common/hpqm.c \
hw_if/hal/src/common/pal.c \
bus_if/bal/src/bal.c \
fw_if/umac_if/src/common/fmac_cmd_common.c \
fw_if/umac_if/src/common/fmac_api_common.c \
fw_if/umac_if/src/common/fmac_util.c \
hw_if/hal/src/common/hal_api_common.c \
nrf_wifi_osal_module.c
ifeq ($(BUS_IF), QSPI)
SRCS += bus_if/bus/qspi/src/qspi.c
else ifeq ($(BUS_IF), SPI)
SRCS += bus_if/bus/pcie/src/spi.c
else ifeq ($(BUS_IF), PCIE)
SRCS += bus_if/bus/pcie/src/pcie.c
endif
ifeq ($(RADIO_TEST), 1)
SRCS += fw_if/umac_if/src/radio_test/fmac_api.c
SRCS += fw_if/umac_if/src/radio_test/fmac_cmd.c
SRCS += fw_if/umac_if/src/radio_test/fmac_event.c
ccflags-y += -DNRF70_RADIO_TEST
INCLUDES += -I$(NRF_WIFI_DIR)/fw_if/umac_if/inc/radio_test
else
SRCS += fw_if/umac_if/src/system/fmac_peer.c
SRCS += fw_if/umac_if/src/system/fmac_vif.c
SRCS += fw_if/umac_if/src/system/fmac_api.c
SRCS += fw_if/umac_if/src/system/fmac_cmd.c
SRCS += fw_if/umac_if/src/system/fmac_event.c
SRCS += fw_if/umac_if/src/system/rx.c
SRCS += fw_if/umac_if/src/system/tx.c
SRCS += hw_if/hal/src/system/hal_api.c
ccflags-y += -DNRF70_SYSTEM_MODE
INCLUDES += -I$(NRF_WIFI_DIR)/fw_if/umac_if/inc/system
endif
ifeq ($(FW_LOAD_SUPPORT), 1)
ifeq ($(FW_LOAD), $(filter $(FW_LOAD), ROM ROM_PATCH))
SRCS += hw_if/hal/src/hal_fw_rom_loader.c
endif
ifeq ($(FW_LOAD), $(filter $(FW_LOAD), PATCH ROM_PATCH))
SRCS += hw_if/hal/src/common/hal_fw_patch_loader.c
endif
ifeq ($(FW_LOAD), $(filter $(FW_LOAD), RAM))
SRCS += hw_if/hal/src/hal_fw_ram_loader.c
endif
endif
ccflags-y += $(INCLUDES)
# Object files
OBJS = $(SRCS:.c=.o)
# Module
obj-m := nrf_wifi_osal.o
nrf_wifi_osal-objs := $(OBJS)
all:
@echo "Building nrf_wifi_osal module: $(NRF_WIFI_DIR)"
$(MAKE) -C $(KDIR) M=$(NRF_WIFI_DIR) modules
menuconfig:
$(MAKE) -C $(KDIR) M=$(NRF_WIFI_DIR) menuconfig
clean:
make -C $(KDIR) M=$(NRF_WIFI_DIR) clean
install:
$(MAKE) -C $(KDIR) M=$(NRF_WIFI_DIR) modules_install
.PHONY: all clean install menuconfig