From: stsp Date: Fri, 12 Nov 2021 11:40:35 +0000 (+0000) Subject: Sync the iwn(4) "enhanced Tx power" eeprom data structure with Linux. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1f94d8c3007756baa21a28fd0079e62fe90d0b33;p=openbsd Sync the iwn(4) "enhanced Tx power" eeprom data structure with Linux. No functional change, as this data is not being used anywhere yet. --- diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 594ec004b14..0ca26cfb9cd 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.251 2021/11/11 13:36:58 stsp Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.252 2021/11/12 11:40:35 stsp Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini @@ -1682,7 +1682,7 @@ iwn_read_eeprom_enhinfo(struct iwn_softc *sc) memset(sc->enh_maxpwr, 0, sizeof sc->enh_maxpwr); for (i = 0; i < nitems(enhinfo); i++) { - if (enhinfo[i].chan == 0 || enhinfo[i].reserved != 0) + if ((enhinfo[i].flags & IWN_TXP_VALID) == 0) continue; /* Skip invalid entries. */ maxpwr = 0; diff --git a/sys/dev/pci/if_iwnreg.h b/sys/dev/pci/if_iwnreg.h index 57e8841552c..a6ed77338a0 100644 --- a/sys/dev/pci/if_iwnreg.h +++ b/sys/dev/pci/if_iwnreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwnreg.h,v 1.57 2021/11/11 13:36:58 stsp Exp $ */ +/* $OpenBSD: if_iwnreg.h,v 1.58 2021/11/12 11:40:36 stsp Exp $ */ /*- * Copyright (c) 2007, 2008 @@ -1706,9 +1706,18 @@ struct iwn_eeprom_chan { } __packed; struct iwn_eeprom_enhinfo { - uint16_t chan; + uint8_t flags; +#define IWN_TXP_VALID (1 << 0) +#define IWN_TXP_BAND_52G (1 << 1) +#define IWN_TXP_OFDM (1 << 2) +#define IWN_TXP_40MHZ (1 << 3) +#define IWN_TXP_HT_AP (1 << 4) +#define IWN_TXP_RES1 (1 << 5) +#define IWN_TXP_RES2 (1 << 6) +#define IWN_TXP_COMMON_TYPE (1 << 7) + uint8_t chan; int8_t chain[3]; /* max power in half-dBm */ - uint8_t reserved; + uint8_t delta_20_in_40; int8_t mimo2; /* max power in half-dBm */ int8_t mimo3; /* max power in half-dBm */ } __packed;