Commit e74b1e7f authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

cfg80211: ignore consecutive equal regulatory hints

We ignore regulatory hints for the same alpha2 if we already
have processed the same alpha2 on the current regulatory domain.
For a driver regulatory_hint() this means we copy onto its
wiphy->regd the previously procesed regulatory domain from CRDA
without having to call CRDA again.
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5eebade6
...@@ -1080,8 +1080,13 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, ...@@ -1080,8 +1080,13 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by,
} }
return REG_INTERSECT; return REG_INTERSECT;
case REGDOM_SET_BY_DRIVER: case REGDOM_SET_BY_DRIVER:
if (last_request->initiator == REGDOM_SET_BY_CORE) if (last_request->initiator == REGDOM_SET_BY_CORE) {
return 0; if (is_old_static_regdom(cfg80211_regdomain))
return 0;
if (!alpha2_equal(cfg80211_regdomain->alpha2, alpha2))
return 0;
return -EALREADY;
}
return REG_INTERSECT; return REG_INTERSECT;
case REGDOM_SET_BY_USER: case REGDOM_SET_BY_USER:
if (last_request->initiator == REGDOM_SET_BY_COUNTRY_IE) if (last_request->initiator == REGDOM_SET_BY_COUNTRY_IE)
...@@ -1101,6 +1106,10 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, ...@@ -1101,6 +1106,10 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by,
return -EAGAIN; return -EAGAIN;
} }
if (!is_old_static_regdom(cfg80211_regdomain) &&
alpha2_equal(cfg80211_regdomain->alpha2, alpha2))
return -EALREADY;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment