diff mbox series

[01/17] wiphy: add wiphy_get_supported_ciphers

Message ID 20221101201747.143379-1-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [01/17] wiphy: add wiphy_get_supported_ciphers | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-build success Build - Configure
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-alpine-ci-makecheckvalgrind fail Make FAIL: In file included from ./ell/ell.h:3, from src/ap.c:33: src/ap.c: In function 'ap_start': ./ell/strv.h:41:21: error: 'ciphers_str' may be used uninitialized [-Werror=maybe-uninitialized] 41 | DEFINE_CLEANUP_FUNC(l_strv_free); | ^~~~~~~~~~~ src/ap.c:3182:36: note: 'ciphers_str' was declared here 3182 | _auto_(l_strv_free) char **ciphers_str; | ^~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:2409: src/ap.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:1588: all] Error 2
prestwoj/iwd-alpine-ci-makecheck pending makecheck SKIP
prestwoj/iwd-ci-makecheckvalgrind fail Make FAIL: In file included from ./ell/ell.h:3, from src/ap.c:33: src/ap.c: In function ‘ap_start’: ./ell/strv.h:41:21: error: ‘ciphers_str’ may be used uninitialized [-Werror=maybe-uninitialized] 41 | DEFINE_CLEANUP_FUNC(l_strv_free); | ^~~~~~~~~~~ src/ap.c:3182:36: note: ‘ciphers_str’ was declared here 3182 | _auto_(l_strv_free) char **ciphers_str; | ^~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:2408: src/ap.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:1587: all] Error 2
prestwoj/iwd-ci-makecheck pending makecheck SKIP
prestwoj/iwd-ci-testrunner pending testrunner SKIP
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-alpine-ci-incremental_build fail Make FAIL (patch 2): In file included from ./ell/ell.h:3, from src/ap.c:33: src/ap.c: In function 'ap_start': ./ell/strv.h:41:21: error: 'ciphers_str' may be used uninitialized [-Werror=maybe-uninitialized] 41 | DEFINE_CLEANUP_FUNC(l_strv_free); | ^~~~~~~~~~~ src/ap.c:3163:36: note: 'ciphers_str' was declared here 3163 | _auto_(l_strv_free) char **ciphers_str; | ^~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:2409: src/ap.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:1588: all] Error 2
prestwoj/iwd-ci-incremental_build fail Make FAIL (patch 2): In file included from ./ell/ell.h:3, from src/ap.c:33: src/ap.c: In function ‘ap_start’: ./ell/strv.h:41:21: error: ‘ciphers_str’ may be used uninitialized [-Werror=maybe-uninitialized] 41 | DEFINE_CLEANUP_FUNC(l_strv_free); | ^~~~~~~~~~~ src/ap.c:3163:36: note: ‘ciphers_str’ was declared here 3163 | _auto_(l_strv_free) char **ciphers_str; | ^~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:2408: src/ap.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make: *** [Makefile:1587: all] Error 2

Commit Message

James Prestwood Nov. 1, 2022, 8:17 p.m. UTC
Similar to wiphy_select_cipher but returns all supported ciphers
included in the mask rather than just one.
---
 src/wiphy.c | 5 +++++
 src/wiphy.h | 2 ++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/src/wiphy.c b/src/wiphy.c
index bb83f814..10514572 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -180,6 +180,11 @@  enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy, uint16_t mask)
 	return 0;
 }
 
+uint16_t wiphy_get_supported_ciphers(struct wiphy *wiphy, uint16_t mask)
+{
+	return wiphy->supported_ciphers & mask;
+}
+
 static bool wiphy_can_connect_sae(struct wiphy *wiphy)
 {
 	/*
diff --git a/src/wiphy.h b/src/wiphy.h
index 2c6bf86b..f8de7e0e 100644
--- a/src/wiphy.h
+++ b/src/wiphy.h
@@ -68,6 +68,8 @@  typedef void (*wiphy_destroy_func_t)(void *user_data);
 
 enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy,
 							uint16_t mask);
+uint16_t wiphy_get_supported_ciphers(struct wiphy *wiphy, uint16_t mask);
+
 enum ie_rsn_akm_suite wiphy_select_akm(struct wiphy *wiphy,
 					const struct scan_bss *bss,
 					enum security security,