diff mbox series

[06/10] band: add band_chandef_width_to_string

Message ID 20221220214318.2041986-6-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [01/10] ap: make supported rates a common builder. | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Dec. 20, 2022, 9:43 p.m. UTC
---
 src/band.c | 20 ++++++++++++++++++++
 src/band.h |  1 +
 2 files changed, 21 insertions(+)

Comments

Denis Kenzior Dec. 27, 2022, 5:33 p.m. UTC | #1
Hi James,

On 12/20/22 15:43, James Prestwood wrote:
> ---
>   src/band.c | 20 ++++++++++++++++++++
>   src/band.h |  1 +
>   2 files changed, 21 insertions(+)
> 

Patch 6 & 7 applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/src/band.c b/src/band.c
index b1e319d7..73a63c79 100644
--- a/src/band.c
+++ b/src/band.c
@@ -1581,3 +1581,23 @@  enum band_freq band_oper_class_to_band(const uint8_t *country,
 	else
 		return 0;
 }
+
+const char *band_chandef_width_to_string(enum band_chandef_width width)
+{
+	switch (width) {
+	case BAND_CHANDEF_WIDTH_20NOHT:
+		return "20MHz (no-HT)";
+	case BAND_CHANDEF_WIDTH_20:
+		return "20MHz";
+	case BAND_CHANDEF_WIDTH_40:
+		return "40MHz";
+	case BAND_CHANDEF_WIDTH_80:
+		return "80MHz";
+	case BAND_CHANDEF_WIDTH_80P80:
+		return "80+80MHz";
+	case BAND_CHANDEF_WIDTH_160:
+		return "160MHz";
+	}
+
+	return NULL;
+}
diff --git a/src/band.h b/src/band.h
index f7f0c318..1b3f1669 100644
--- a/src/band.h
+++ b/src/band.h
@@ -115,3 +115,4 @@  uint8_t band_freq_to_channel(uint32_t freq, enum band_freq *out_band);
 uint32_t band_channel_to_freq(uint8_t channel, enum band_freq band);
 enum band_freq band_oper_class_to_band(const uint8_t *country,
 					uint8_t oper_class);
+const char *band_chandef_width_to_string(enum band_chandef_width width);