Lines Matching refs:rule
615 /* aligned to 2, then followed by __be16 array of rule pointers */
661 static bool valid_wmm(struct fwdb_wmm_rule *rule)
663 struct fwdb_wmm_ac *ac = (struct fwdb_wmm_ac *)rule;
683 struct fwdb_rule *rule = (void *)(data + (rule_ptr << 2));
685 if ((u8 *)rule + sizeof(rule->len) > data + size)
689 if (rule->len < offsetofend(struct fwdb_rule, max_bw))
691 if (rule->len >= offsetofend(struct fwdb_rule, wmm_ptr)) {
692 u32 wmm_ptr = be16_to_cpu(rule->wmm_ptr) << 2;
843 const struct fwdb_rule *rule,
850 wmm_ptr = be16_to_cpu(rule->wmm_ptr) << 2;
854 pr_err("Invalid regulatory WMM rule %u-%u in domain %c%c\n",
855 be32_to_cpu(rule->start), be32_to_cpu(rule->end),
887 struct fwdb_rule *rule = (void *)((u8 *)db + rule_ptr);
889 if (rule->len < offsetofend(struct fwdb_rule, wmm_ptr))
892 if (freq >= KHZ_TO_MHZ(be32_to_cpu(rule->start)) &&
893 freq <= KHZ_TO_MHZ(be32_to_cpu(rule->end))) {
894 set_wmm_rule(db, country, rule, rrule);
902 int reg_query_regdb_wmm(char *alpha2, int freq, struct ieee80211_reg_rule *rule)
916 return __regdb_query_wmm(regdb, country, freq, rule);
946 struct fwdb_rule *rule = (void *)((u8 *)db + rule_ptr);
949 rrule->freq_range.start_freq_khz = be32_to_cpu(rule->start);
950 rrule->freq_range.end_freq_khz = be32_to_cpu(rule->end);
951 rrule->freq_range.max_bandwidth_khz = be32_to_cpu(rule->max_bw);
954 rrule->power_rule.max_eirp = be16_to_cpu(rule->max_eirp);
957 if (rule->flags & FWDB_FLAG_NO_OFDM)
959 if (rule->flags & FWDB_FLAG_NO_OUTDOOR)
961 if (rule->flags & FWDB_FLAG_DFS)
963 if (rule->flags & FWDB_FLAG_NO_IR)
965 if (rule->flags & FWDB_FLAG_AUTO_BW)
971 if (rule->len >= offsetofend(struct fwdb_rule, cac_timeout))
973 1000 * be16_to_cpu(rule->cac_timeout);
974 if (rule->len >= offsetofend(struct fwdb_rule, wmm_ptr))
975 set_wmm_rule(db, country, rule, rrule);
1160 const struct ieee80211_reg_rule *rule)
1162 const struct ieee80211_freq_range *freq_range = &rule->freq_range;
1168 if (rule == &rd->reg_rules[idx])
1190 freq_range = &rule->freq_range;
1209 const struct ieee80211_reg_rule *rule)
1211 unsigned int bw = reg_get_max_bandwidth_from_range(rd, rule);
1213 if (rule->flags & NL80211_RRF_NO_320MHZ)
1215 if (rule->flags & NL80211_RRF_NO_160MHZ)
1217 if (rule->flags & NL80211_RRF_NO_80MHZ)
1224 if (rule->flags & NL80211_RRF_NO_HT40MINUS &&
1225 rule->flags & NL80211_RRF_NO_HT40PLUS)
1231 /* Sanity check on a regulatory rule */
1232 static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
1234 const struct ieee80211_freq_range *freq_range = &rule->freq_range;
1274 * @freq_range: frequency rule we want to query
1277 * This lets us know if a specific frequency rule is or is not relevant to
1280 * however it is safe for now to assume that a frequency rule should not be
1285 * regulatory rule support for other "bands".
1379 * set AUTO_BW in intersected rule also. Next we will
1432 /* check whether old rule contains new rule */
1459 /* add or extend current rules. do nothing if rule is already contained */
1460 static void add_rule(struct ieee80211_reg_rule *rule,
1468 /* rule is already contained - do nothing */
1469 if (rule_contains(tmp_rule, rule))
1472 /* extend rule if possible */
1473 if (rule_contains(rule, tmp_rule)) {
1474 memcpy(tmp_rule, rule, sizeof(*rule));
1479 memcpy(®_rules[*n_rules], rule, sizeof(*rule));
1514 * is it will return -EINVAL if the rule computed makes no sense.
1542 * No need to memset here the intersected rule here as
1614 * We only need to know if one frequency rule was
1899 * (otherwise no adj. rule case), recheck therefore
2000 * received regulatory rule unless the hint is coming
2544 pr_debug("Disabling freq %d.%03d MHz as custom regd has no rule that fits it\n",
2594 * otherwise channel 12 might get enabled if this rule is