ret = iwl_pci_find_dev_info(di->device, di->subdevice,
di->rf_type, di->cdb,
di->rf_id, di->bw_limit,
di->discrete); if (!ret) {
iwl_pci_print_dev_info("No entry found for: ", di);
KUNIT_FAIL(test, "No entry found for entry at index %d\n", idx);
} elseif (ret != di) {
iwl_pci_print_dev_info("searched: ", di);
iwl_pci_print_dev_info("found: ", ret);
KUNIT_FAIL(test, "unusable entry at index %d (found index %d instead)\n",
idx, (int)(ret - iwl_dev_info_table));
}
}
}
staticvoid devinfo_discrete_match(struct kunit *test)
{ /* * Validate that any entries with discrete/integrated match have * the same config with the value inverted (if they match at all.)
*/
ret = iwl_pci_find_dev_info(di->device, di->subdevice,
di->rf_type, di->cdb,
di->rf_id, di->bw_limit,
!di->discrete); if (!ret) continue;
KUNIT_EXPECT_PTR_EQ(test, di->cfg, ret->cfg); /* and check the name is different, that'd be the point of it */
KUNIT_EXPECT_NE(test, strcmp(di->name, ret->name), 0);
}
}
staticvoid devinfo_names(struct kunit *test)
{ int idx;
staticvoid devinfo_check_subdev_match(struct kunit *test)
{ for (int i = 0; i < iwl_dev_info_table_size; i++) { conststruct iwl_dev_info *di = &iwl_dev_info_table[i];
u16 subdevice_mask = GENMASK(di->subdevice_m_h,
di->subdevice_m_l);
/* if BW limit bit is matched then must have a limit */ if (di->match_bw_limit == 1 && di->bw_limit == 1)
KUNIT_EXPECT_NE(test, di->cfg->bw_limit, 0);
/* if subdevice is ANY we can have RF ID/BW limit */ if (di->subdevice == (u16)IWL_CFG_ANY) continue;
/* same if the subdevice mask doesn't overlap them */ if (IWL_SUBDEVICE_RF_ID(subdevice_mask) == 0 &&
IWL_SUBDEVICE_BW_LIM(subdevice_mask) == 0) continue;
/* but otherwise they shouldn't be used */
KUNIT_EXPECT_EQ(test, (int)di->match_rf_id, 0);
KUNIT_EXPECT_EQ(test, (int)di->match_bw_limit, 0);
}
}
staticvoid devinfo_check_killer_subdev(struct kunit *test)
{ for (int i = 0; i < iwl_dev_info_table_size; i++) { conststruct iwl_dev_info *di = &iwl_dev_info_table[i];
staticvoid devinfo_api_range(struct kunit *test)
{ /* Check that all iwl_mac_cfg's have either both min and max set, or neither */ for (int i = 0; iwl_hw_card_ids[i].vendor; i++) { conststruct iwl_mac_cfg *mac_cfg =
(void *)iwl_hw_card_ids[i].driver_data; conststruct iwl_family_base_params *base = mac_cfg->base;
KUNIT_EXPECT_EQ_MSG(test, !!base->ucode_api_min,
!!base->ucode_api_max, "%ps: ucode_api_min (%u) and ucode_api_min (%u) should be both set or neither.\n",
base, base->ucode_api_min,
base->ucode_api_max);
}
/* Check the same for the iwl_rf_cfg's */ for (int i = 0; i < iwl_dev_info_table_size; i++) { conststruct iwl_rf_cfg *rf_cfg = iwl_dev_info_table[i].cfg;
KUNIT_EXPECT_EQ_MSG(test, !!rf_cfg->ucode_api_min,
!!rf_cfg->ucode_api_max, "%ps: ucode_api_min (%u) and ucode_api_min (%u) should be both set or neither.\n",
rf_cfg, rf_cfg->ucode_api_min,
rf_cfg->ucode_api_max);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.