Skip to content

Commit c4a9faf

Browse files
Felix Fietkaujmberg-intel
Felix Fietkau
authored andcommitted
cfg80211: fix antenna gain handling
No driver initializes chan->max_antenna_gain to something sensible, and the only place where it is being used right now is inside ath9k. This leads to ath9k potentially using less tx power than it can use, which can decrease performance/range in some rare cases. Rather than going through every single driver, this patch initializes chan->orig_mag in wiphy_register(), ignoring whatever value the driver left in there. If a driver for some reason wishes to limit it independent from regulatory rulesets, it can do so internally. Signed-off-by: Felix Fietkau <[email protected]> Cc: [email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 3a40414 commit c4a9faf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

net/wireless/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,7 @@ int wiphy_register(struct wiphy *wiphy)
526526
for (i = 0; i < sband->n_channels; i++) {
527527
sband->channels[i].orig_flags =
528528
sband->channels[i].flags;
529-
sband->channels[i].orig_mag =
530-
sband->channels[i].max_antenna_gain;
529+
sband->channels[i].orig_mag = INT_MAX;
531530
sband->channels[i].orig_mpwr =
532531
sband->channels[i].max_power;
533532
sband->channels[i].band = band;

0 commit comments

Comments
 (0)