Skip to content

Commit

Permalink
iwn: Sync the iwn(4) "enhanced Tx power" eeprom data structure with L…
Browse files Browse the repository at this point in the history
  • Loading branch information
zxystd committed Mar 16, 2024
1 parent 44a6708 commit fa34242
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion itlwm/hal_iwn/ItlIwn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,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;
Expand Down
13 changes: 11 additions & 2 deletions itlwm/hal_iwn/if_iwnreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1727,9 +1727,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;
Expand Down

0 comments on commit fa34242

Please sign in to comment.