count = of_property_count_strings(np, "brcm,ccode-map"); if (count < 0) { /* If no explicit country code map is specified, check whether * the trivial map should be used.
*/
settings->trivial_ccode_map =
of_property_read_bool(np, "brcm,ccode-map-trivial");
/* The property is optional, so return success if it doesn't * exist. Otherwise propagate the error code.
*/ return (count == -EINVAL) ? 0 : count;
}
cc = devm_kzalloc(dev, struct_size(cc, table, count), GFP_KERNEL); if (!cc) return -ENOMEM;
cc->table_size = count;
for (i = 0; i < count; i++) { constchar *map;
cce = &cc->table[i];
if (of_property_read_string_index(np, "brcm,ccode-map",
i, &map)) continue;
/* String format e.g. US-Q2-86 */ if (sscanf(map, "%2c-%2c-%d", cce->iso3166, cce->cc,
&cce->rev) != 3)
brcmf_err("failed to read country map %s\n", map); else
brcmf_dbg(INFO, "%s-%s-%d\n", cce->iso3166, cce->cc,
cce->rev);
}
/* Apple ARM64 platforms have their own idea of board type, passed in * via the device tree. They also have an antenna SKU parameter
*/
err = of_property_read_string(np, "brcm,board-type", &prop); if (!err)
settings->board_type = prop;
if (!of_property_read_string(np, "apple,antenna-sku", &prop))
settings->antenna_sku = prop;
/* The WLAN calibration blob is normally stored in SROM, but Apple * ARM64 platforms pass it via the DT instead.
*/
prop = of_get_property(np, "brcm,cal-blob", &settings->cal_size); if (prop && settings->cal_size)
settings->cal_blob = prop;
/* Set board-type to the first string of the machine compatible prop */
root = of_find_node_by_path("/"); if (root && err) { char *board_type = NULL; constchar *tmp;
/* get rid of '/' in the compatible string to be able to find the FW */ if (!of_property_read_string_index(root, "compatible", 0, &tmp))
board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);
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.