Skip to content

Commit

Permalink
qtnfmac: update bands information on CHANGE_INTF command
Browse files Browse the repository at this point in the history
In some regions, different regulatory limits (like max Tx power) may be
defined for different operating modes. As an example: in ETSI regions
DFS master devices may use higher transmit powers compared to DFS slave
devices. Update bands information in CHANGE_INTF command if mode of
operation changes.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Igor Mitsyanko authored and Kalle Valo committed Apr 4, 2019
1 parent 438fb43 commit 93eeab2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions drivers/net/wireless/quantenna/qtnfmac/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,25 @@ int qtnf_cmd_send_change_intf_type(struct qtnf_vif *vif,
int use4addr,
u8 *mac_addr)
{
return qtnf_cmd_send_add_change_intf(vif, iftype, use4addr, mac_addr,
QLINK_CMD_CHANGE_INTF);
int ret;

ret = qtnf_cmd_send_add_change_intf(vif, iftype, use4addr, mac_addr,
QLINK_CMD_CHANGE_INTF);

/* Regulatory settings may be different for different interface types */
if (ret == 0 && vif->wdev.iftype != iftype) {
enum nl80211_band band;
struct wiphy *wiphy = priv_to_wiphy(vif->mac);

for (band = 0; band < NUM_NL80211_BANDS; ++band) {
if (!wiphy->bands[band])
continue;

qtnf_cmd_band_info_get(vif->mac, wiphy->bands[band]);
}
}

return ret;
}

int qtnf_cmd_send_del_intf(struct qtnf_vif *vif)
Expand Down

0 comments on commit 93eeab2

Please sign in to comment.