Lines Matching refs:rule
661 static bool valid_wmm(struct fwdb_wmm_rule *rule) in valid_wmm() argument
663 struct fwdb_wmm_ac *ac = (struct fwdb_wmm_ac *)rule; in valid_wmm()
683 struct fwdb_rule *rule = (void *)(data + (rule_ptr << 2)); in valid_rule() local
685 if ((u8 *)rule + sizeof(rule->len) > data + size) in valid_rule()
689 if (rule->len < offsetofend(struct fwdb_rule, max_bw)) in valid_rule()
691 if (rule->len >= offsetofend(struct fwdb_rule, wmm_ptr)) { in valid_rule()
692 u32 wmm_ptr = be16_to_cpu(rule->wmm_ptr) << 2; in valid_rule()
881 const struct fwdb_rule *rule, in set_wmm_rule() argument
888 wmm_ptr = be16_to_cpu(rule->wmm_ptr) << 2; in set_wmm_rule()
893 be32_to_cpu(rule->start), be32_to_cpu(rule->end), in set_wmm_rule()
925 struct fwdb_rule *rule = (void *)((u8 *)db + rule_ptr); in __regdb_query_wmm() local
927 if (rule->len < offsetofend(struct fwdb_rule, wmm_ptr)) in __regdb_query_wmm()
930 if (freq >= KHZ_TO_MHZ(be32_to_cpu(rule->start)) && in __regdb_query_wmm()
931 freq <= KHZ_TO_MHZ(be32_to_cpu(rule->end))) { in __regdb_query_wmm()
932 set_wmm_rule(db, country, rule, rrule); in __regdb_query_wmm()
940 int reg_query_regdb_wmm(char *alpha2, int freq, struct ieee80211_reg_rule *rule) in reg_query_regdb_wmm() argument
954 return __regdb_query_wmm(regdb, country, freq, rule); in reg_query_regdb_wmm()
984 struct fwdb_rule *rule = (void *)((u8 *)db + rule_ptr); in regdb_query_country() local
987 rrule->freq_range.start_freq_khz = be32_to_cpu(rule->start); in regdb_query_country()
988 rrule->freq_range.end_freq_khz = be32_to_cpu(rule->end); in regdb_query_country()
989 rrule->freq_range.max_bandwidth_khz = be32_to_cpu(rule->max_bw); in regdb_query_country()
992 rrule->power_rule.max_eirp = be16_to_cpu(rule->max_eirp); in regdb_query_country()
995 if (rule->flags & FWDB_FLAG_NO_OFDM) in regdb_query_country()
997 if (rule->flags & FWDB_FLAG_NO_OUTDOOR) in regdb_query_country()
999 if (rule->flags & FWDB_FLAG_DFS) in regdb_query_country()
1001 if (rule->flags & FWDB_FLAG_NO_IR) in regdb_query_country()
1003 if (rule->flags & FWDB_FLAG_AUTO_BW) in regdb_query_country()
1009 if (rule->len >= offsetofend(struct fwdb_rule, cac_timeout)) in regdb_query_country()
1011 1000 * be16_to_cpu(rule->cac_timeout); in regdb_query_country()
1012 if (rule->len >= offsetofend(struct fwdb_rule, wmm_ptr)) in regdb_query_country()
1013 set_wmm_rule(db, country, rule, rrule); in regdb_query_country()
1198 const struct ieee80211_reg_rule *rule) in reg_get_max_bandwidth_from_range() argument
1200 const struct ieee80211_freq_range *freq_range = &rule->freq_range; in reg_get_max_bandwidth_from_range()
1206 if (rule == &rd->reg_rules[idx]) in reg_get_max_bandwidth_from_range()
1228 freq_range = &rule->freq_range; in reg_get_max_bandwidth_from_range()
1247 const struct ieee80211_reg_rule *rule) in reg_get_max_bandwidth() argument
1249 unsigned int bw = reg_get_max_bandwidth_from_range(rd, rule); in reg_get_max_bandwidth()
1251 if (rule->flags & NL80211_RRF_NO_320MHZ) in reg_get_max_bandwidth()
1253 if (rule->flags & NL80211_RRF_NO_160MHZ) in reg_get_max_bandwidth()
1255 if (rule->flags & NL80211_RRF_NO_80MHZ) in reg_get_max_bandwidth()
1262 if (rule->flags & NL80211_RRF_NO_HT40MINUS && in reg_get_max_bandwidth()
1263 rule->flags & NL80211_RRF_NO_HT40PLUS) in reg_get_max_bandwidth()
1270 static bool is_valid_reg_rule(const struct ieee80211_reg_rule *rule) in is_valid_reg_rule() argument
1272 const struct ieee80211_freq_range *freq_range = &rule->freq_range; in is_valid_reg_rule()
1498 static void add_rule(struct ieee80211_reg_rule *rule, in add_rule() argument
1507 if (rule_contains(tmp_rule, rule)) in add_rule()
1511 if (rule_contains(rule, tmp_rule)) { in add_rule()
1512 memcpy(tmp_rule, rule, sizeof(*rule)); in add_rule()
1517 memcpy(®_rules[*n_rules], rule, sizeof(*rule)); in add_rule()