Lines Matching defs:rule
595 /* aligned to 2, then followed by __be16 array of rule pointers */
641 static bool valid_wmm(struct fwdb_wmm_rule *rule)
643 struct fwdb_wmm_ac *ac = (struct fwdb_wmm_ac *)rule;
663 struct fwdb_rule *rule = (void *)(data + (rule_ptr << 2));
665 if ((u8 *)rule + sizeof(rule->len) > data + size)
669 if (rule->len < offsetofend(struct fwdb_rule, max_bw))
671 if (rule->len >= offsetofend(struct fwdb_rule, wmm_ptr)) {
672 u32 wmm_ptr = be16_to_cpu(rule->wmm_ptr) << 2;
861 const struct fwdb_rule *rule,
868 wmm_ptr = be16_to_cpu(rule->wmm_ptr) << 2;
872 pr_err("Invalid regulatory WMM rule %u-%u in domain %c%c\n",
873 be32_to_cpu(rule->start), be32_to_cpu(rule->end),
905 struct fwdb_rule *rule = (void *)((u8 *)db + rule_ptr);
907 if (rule->len < offsetofend(struct fwdb_rule, wmm_ptr))
910 if (freq >= KHZ_TO_MHZ(be32_to_cpu(rule->start)) &&
911 freq <= KHZ_TO_MHZ(be32_to_cpu(rule->end))) {
912 set_wmm_rule(db, country, rule, rrule);
920 int reg_query_regdb_wmm(char *alpha2, int freq, struct ieee80211_reg_rule *rule)
934 return __regdb_query_wmm(regdb, country, freq, rule);
964 struct fwdb_rule *rule = (void *)((u8 *)db + rule_ptr);
967 rrule->freq_range.start_freq_khz = be32_to_cpu(rule->start);
968 rrule->freq_range.end_freq_khz = be32_to_cpu(rule->end);
969 rrule->freq_range.max_bandwidth_khz = be32_to_cpu(rule->max_bw);
972 rrule->power_rule.max_eirp = be16_to_cpu(rule->max_eirp);
975 if (rule->flags & FWDB_FLAG_NO_OFDM)
977 if (rule->flags & FWDB_FLAG_NO_OUTDOOR)
979 if (rule->flags & FWDB_FLAG_DFS)
981 if (rule->flags & FWDB_FLAG_NO_IR)
983 if (rule->flags & FWDB_FLAG_AUTO_BW)
989 if (rule->len >= offsetofend(struct fwdb_rule, cac_timeout))
991 1000 * be16_to_cpu(rule->cac_timeout);
992 if (rule->len >= offsetofend(struct fwdb_rule, wmm_ptr))
993 set_wmm_rule(db, country, rule, rrule);
1158 const struct ieee80211_reg_rule *rule)
1160 const struct ieee80211_freq_range *freq_range = &rule->freq_range;
1166 if (rule == &rd->reg_rules[idx])
1188 freq_range = &rule->freq_range;
1207 const struct ieee80211_reg_rule *rule)
1209 unsigned int bw = reg_get_max_bandwidth_from_range(rd, rule);
1211 if (rule->flags & NL80211_RRF_NO_160MHZ)
1213 if (rule->flags & NL80211_RRF_NO_80MHZ)
1220 if (rule->flags & NL80211_RRF_NO_HT40MINUS &&
1221 rule->flags & NL80211_RRF_NO_HT40PLUS)
1227 /* Sanity check on a regulatory rule */
1228 static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule)
1230 const struct ieee80211_freq_range *freq_range = &rule->freq_range;
1270 * @freq_range: frequency rule we want to query
1273 * This lets us know if a specific frequency rule is or is not relevant to
1276 * however it is safe for now to assume that a frequency rule should not be
1281 * regulatory rule support for other "bands".
1375 * set AUTO_BW in intersected rule also. Next we will
1428 /* check whether old rule contains new rule */
1455 /* add or extend current rules. do nothing if rule is already contained */
1456 static void add_rule(struct ieee80211_reg_rule *rule,
1464 /* rule is already contained - do nothing */
1465 if (rule_contains(tmp_rule, rule))
1468 /* extend rule if possible */
1469 if (rule_contains(rule, tmp_rule)) {
1470 memcpy(tmp_rule, rule, sizeof(*rule));
1475 memcpy(®_rules[*n_rules], rule, sizeof(*rule));
1510 * is it will return -EINVAL if the rule computed makes no sense.
1538 * No need to memset here the intersected rule here as
1606 * We only need to know if one frequency rule was
1889 * (otherwise no adj. rule case), recheck therefore
1990 * received regulatory rule unless the hint is coming
2498 pr_debug("Disabling freq %d.%03d MHz as custom regd has no rule that fits it\n",
2548 * otherwise channel 12 might get enabled if this rule is