Skip to content

Commit c9ffcac

Browse files
npal-cykartben
authored andcommitted
drivers: wifi: AIROC: add support of new devices
- add support Wi-Fi Host Driver (WHD) 4.2.1 - add Country configuration from Kconfig Support new devices: -- CYW43022 -- CYW55500 (WIFI6) -- CYW55572 (WIFI6) Support new modules: -- CYW43022CUB -- CYW955573M2IPA1_SM -- CYW955513SDM2WLIPA_SM -- CYW4373_MURATA_2BC -- CYW4373_MURATA_2AE -- CYW43439_STERLING_LWBPLUS Signed-off-by: Nazar Palamar <[email protected]>
1 parent 2920b7a commit c9ffcac

File tree

6 files changed

+323
-107
lines changed

6 files changed

+323
-107
lines changed

drivers/wifi/infineon/Kconfig.airoc

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ config AIROC_WIFI_BUS_SPI
3535
help
3636
Enable SPI bus support
3737

38+
config AIROC_WIFI6
39+
bool
40+
3841
config AIROC_WIFI_EVENT_TASK_STACK_SIZE
3942
int "Event Task Stack Size"
4043
default 4096
@@ -48,6 +51,14 @@ config AIROC_WLAN_MFG_FIRMWARE
4851
help
4952
Enable WLAN Manufacturing Firmware.
5053

54+
config WHD_WIFI_COUNTRY
55+
string "Wifi couuntry option"
56+
default "WHD_COUNTRY_UNITED_STATES" if CYW55572 || CYW55500
57+
default "WHD_COUNTRY_AUSTRALIA"
58+
help
59+
Sets the country, this will operate in for wifi initialization
60+
parameters. See the wifi-host-driver's whd_country_code_t for legal options.
61+
5162
config AIROC_WIFI_CUSTOM
5263
bool "Custom CYW43xx device/module"
5364
help
@@ -80,6 +91,13 @@ config CYW43012
8091
More information about CYW43012 device you can find on
8192
https://www.infineon.com/cms/en/product/wireless-connectivity/airoc-wi-fi-plus-bluetooth-combos/cyw43012/
8293

94+
config CYW43022
95+
bool "CYW43022"
96+
help
97+
Enable Infineon AIROC CYW43022 Wi-Fi connectivity,
98+
More information about CYW43022 device you can find on
99+
https://www.infineon.com/cms/en/product/wireless-connectivity/airoc-wi-fi-plus-bluetooth-combos/wi-fi-5-802.11ac/cyw43022/
100+
83101
config CYW43438
84102
bool "CYW43438"
85103
help
@@ -93,6 +111,23 @@ config CYW43439
93111
Enable Infineon AIROC CYW43439 Wi-Fi connectivity,
94112
More information about CYW43439 device you can find on
95113
https://www.infineon.com/cms/en/product/wireless-connectivity/airoc-wi-fi-plus-bluetooth-combos/cyw43439/
114+
115+
config CYW55500
116+
bool "CYW55500"
117+
select AIROC_WIFI6
118+
help
119+
Enable Infineon AIROC CYW55500 Wi-Fi connectivity,
120+
More information about CYW55500 device you can find on
121+
https://www.infineon.com/cms/en/product/wireless-connectivity/airoc-wi-fi-plus-bluetooth-combos/wi-fi-6-6e-802.11ax/cyw55511/
122+
123+
config CYW55572
124+
bool "CYW55572"
125+
select AIROC_WIFI6
126+
help
127+
Enable Infineon AIROC CYW55572 Wi-Fi connectivity,
128+
More information about CYW55572 device you can find on
129+
https://www.infineon.com/cms/en/product/wireless-connectivity/airoc-wi-fi-plus-bluetooth-combos/wi-fi-6-6e-802.11ax/cyw55572/
130+
96131
endchoice
97132

98133
choice CYW43012_MODULE
@@ -111,6 +146,19 @@ config CYW43012_MURATA_1LV
111146
https://www.murata.com/en-us/products/connectivitymodule/wi-fi-bluetooth/overview/lineup/type1lv
112147
endchoice
113148

149+
choice CYW43022_MODULE
150+
prompt "Select CYW43022 module"
151+
depends on CYW43022 && !AIROC_WIFI_CUSTOM
152+
153+
config CYW43022CUB
154+
bool "CYW43022CUB"
155+
help
156+
Infineon CYW43022CUB M2 module
157+
158+
Detailed information about CYW43022CUB module you can find on
159+
https://www.infineon.com/cms/en/product/wireless-connectivity/airoc-wi-fi-plus-bluetooth-combos/wi-fi-5-802.11ac/cyw43022/
160+
endchoice
161+
114162
choice CYW4343W_MODULE
115163
prompt "Select CYW4343W module"
116164
depends on CYW4343W && !AIROC_WIFI_CUSTOM
@@ -131,13 +179,30 @@ choice CYW4373_MODULE
131179
prompt "Select CYW4373 module"
132180
depends on CYW4373 && !AIROC_WIFI_CUSTOM
133181

182+
183+
config CYW4373_MURATA_2AE
184+
bool "CYW4373_MURATA_2AE"
185+
help
186+
Murata Type 2AE modules based on Infineon CYW4373 combo chipset
187+
188+
Detailed information about Murata Type 2AE module you can find on
189+
https://www.murata.com/en-us/products/connectivitymodule/wi-fi-bluetooth/overview/lineup/type2ae
190+
191+
config CYW4373_MURATA_2BC
192+
bool "CYW4373_MURATA_2BC"
193+
help
194+
Murata Type 2BC modules based on Infineon CYW4373 combo chipset
195+
196+
Detailed information about Murata Type 2BC module you can find on
197+
https://www.murata.com/en-us/products/connectivitymodule/wi-fi-bluetooth/overview/lineup/type2bc
198+
134199
config CYW4373_STERLING_LWB5PLUS
135200
bool "STERLING-LWB5plus"
136201
help
137202
Ezurio Sterling LWB5+ 802.11ac / Bluetooth 5.0 M.2 Carrier Board
138203
(E-Type Key w/ SDIO/UART)
139204

140-
Detailed information about Type Sterling LWB5+ module you can find on
205+
Detailed information about Sterling LWB5+ module you can find on
141206
https://www.ezurio.com/wireless-modules/wifi-modules-bluetooth/sterling-lwb5-plus-wifi-5-bluetooth-5-module
142207
endchoice
143208

@@ -155,6 +220,34 @@ config CYW43439_MURATA_1YN
155220

156221
Detailed information about Murata Type 1YN module you can find on
157222
https://www.murata.com/en-us/products/connectivitymodule/wi-fi-bluetooth/overview/lineup/type1yn
223+
224+
config CYW43439_STERLING_LWBPLUS
225+
bool "STERLING-LWBplus"
226+
help
227+
Ezurio Sterling-LWB+ WiFi 4 with Bluetooth 5.2 module
228+
Detailed information about this module you can find on
229+
https://www.ezurio.com/wireless-modules/wifi-modules-bluetooth/sterling-lwb-wifi-4-and-bluetooth-52-modules
230+
231+
endchoice
232+
233+
choice CYW55500_MODULE
234+
prompt "Select CYW55500 module"
235+
depends on CYW55500 && !AIROC_WIFI_CUSTOM
236+
237+
config CYW955513SDM2WLIPA_SM
238+
bool "CYW955513SDM2WLIPA_SM"
239+
help
240+
Infineon CYW955513SDM2WLIPA (SM) module
241+
endchoice
242+
243+
choice CYW55572_MODULE
244+
prompt "Select CYW55572 module"
245+
depends on CYW55572 && !AIROC_WIFI_CUSTOM
246+
247+
config CYW955573M2IPA1_SM
248+
bool "CYW955573M2IPA1_SM"
249+
help
250+
Infineon CYW955573M2IPA1 (SM) module
158251
endchoice
159252

160253
endif # AIROC_WIFI

drivers/wifi/infineon/airoc_whd_hal_common.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,31 @@ int airoc_wifi_power_on(const struct device *dev)
6464
* Implement WHD memory wrappers
6565
*/
6666

67-
void *whd_mem_malloc(size_t size)
67+
inline void *whd_mem_malloc(size_t size)
6868
{
6969
return k_malloc(size);
7070
}
7171

72-
void *whd_mem_calloc(size_t nitems, size_t size)
72+
inline void *whd_mem_calloc(size_t nitems, size_t size)
7373
{
7474
return k_calloc(nitems, size);
7575
}
7676

77-
void whd_mem_free(void *ptr)
77+
inline void whd_mem_free(void *ptr)
7878
{
7979
k_free(ptr);
8080
}
8181

82+
inline void whd_mem_memcpy(void *dest, const void *src, size_t len)
83+
{
84+
memcpy(dest, src, len);
85+
}
86+
87+
inline void whd_mem_memset(void *buf, int val, size_t len)
88+
{
89+
memset(buf, val, len);
90+
}
91+
8292
#ifdef __cplusplus
8393
} /* extern "C" */
8494
#endif

drivers/wifi/infineon/airoc_whd_hal_sdio.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ int airoc_wifi_init_primary(const struct device *dev, whd_interface_t *interface
7373
}
7474

7575
/* Init SDIO functions */
76+
ret = sdio_init_func(&data->card, &data->card.func0, BUS_FUNCTION);
77+
if (ret) {
78+
LOG_ERR("sdio_enable_func BUS_FUNCTION, error: %x", ret);
79+
return ret;
80+
}
7681
ret = sdio_init_func(&data->card, &data->sdio_func1, BACKPLANE_FUNCTION);
7782
if (ret) {
7883
LOG_ERR("sdio_enable_func BACKPLANE_FUNCTION, error: %x", ret);
@@ -93,6 +98,11 @@ int airoc_wifi_init_primary(const struct device *dev, whd_interface_t *interface
9398
LOG_ERR("Can't set block size for WLAN_FUNCTION, error: %x", ret);
9499
return ret;
95100
}
101+
ret = sdio_set_block_size(&data->card.func0, data->card.func0.cis.max_blk_size);
102+
if (ret) {
103+
LOG_ERR("Can't set block size for BUS_FUNCTION, error: %x", ret);
104+
return ret;
105+
}
96106

97107
/* Init wifi host driver (whd) */
98108
cy_rslt_t whd_ret = whd_init(&data->whd_drv, &init_config_default, &resource_ops, buffer_if,

drivers/wifi/infineon/airoc_wifi.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,15 @@ static int convert_whd_security_to_zephyr(whd_security_t security)
152152
case WHD_SECURITY_OPEN:
153153
zephyr_security = WIFI_SECURITY_TYPE_NONE;
154154
break;
155+
155156
case WHD_SECURITY_WEP_PSK:
156157
zephyr_security = WIFI_SECURITY_TYPE_WEP;
157158
break;
158159

159160
case WHD_SECURITY_WPA3_WPA2_PSK:
161+
zephyr_security = WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL;
162+
break;
163+
160164
case WHD_SECURITY_WPA2_AES_PSK:
161165
zephyr_security = WIFI_SECURITY_TYPE_PSK;
162166
break;
@@ -199,7 +203,7 @@ static void scan_callback(whd_scan_result_t **result_ptr, void *user_data, whd_s
199203
{
200204
struct airoc_wifi_data *data = user_data;
201205
whd_scan_result_t whd_scan_result;
202-
struct wifi_scan_result zephyr_scan_result;
206+
struct wifi_scan_result zephyr_scan_result = {0};
203207

204208
if (status == WHD_SCAN_COMPLETED_SUCCESSFULLY || status == WHD_SCAN_ABORTED) {
205209
data->scan_rslt_cb(data->iface, 0, NULL);
@@ -550,6 +554,11 @@ static int airoc_mgmt_connect(const struct device *dev, struct wifi_connect_req_
550554
goto error;
551555
}
552556

557+
if (usr_result.security == WHD_SECURITY_WPA3_WPA2_PSK)
558+
{
559+
usr_result.security = WHD_SECURITY_WPA2_AES_PSK;
560+
}
561+
553562
/* Connect to the network */
554563
if (whd_wifi_join(airoc_sta_if, &usr_result.SSID, usr_result.security, params->psk,
555564
params->psk_length) != WHD_SUCCESS) {

0 commit comments

Comments
 (0)