Lines Matching +full:rates +full:- +full:mcs
1 // SPDX-License-Identifier: ISC
15 struct device_node *np = dev->dev->of_node; in mt76_get_of_eeprom()
26 return -ENOENT; in mt76_get_of_eeprom()
28 data = of_get_property(np, "mediatek,eeprom-data", &size); in mt76_get_of_eeprom()
31 return -EINVAL; in mt76_get_of_eeprom()
38 list = of_get_property(np, "mediatek,mtd-eeprom", &size); in mt76_get_of_eeprom()
40 return -ENOENT; in mt76_get_of_eeprom()
44 return -ENOENT; in mt76_get_of_eeprom()
48 return -EINVAL; in mt76_get_of_eeprom()
52 part = np->name; in mt76_get_of_eeprom()
61 ret = -EINVAL; in mt76_get_of_eeprom()
71 dev_err(dev->dev, "reading EEPROM from mtd %s failed: %i\n", in mt76_get_of_eeprom()
77 ret = -EINVAL; in mt76_get_of_eeprom()
81 if (of_property_read_bool(dev->dev->of_node, "big-endian")) { in mt76_get_of_eeprom()
92 dev->test_mtd.name = devm_kstrdup(dev->dev, part, GFP_KERNEL); in mt76_get_of_eeprom()
93 dev->test_mtd.offset = offset; in mt76_get_of_eeprom()
100 return -ENOENT; in mt76_get_of_eeprom()
108 struct mt76_dev *dev = phy->dev; in mt76_eeprom_override()
109 struct device_node *np = dev->dev->of_node; in mt76_eeprom_override()
111 of_get_mac_address(np, phy->macaddr); in mt76_eeprom_override()
113 if (!is_valid_ether_addr(phy->macaddr)) { in mt76_eeprom_override()
114 eth_random_addr(phy->macaddr); in mt76_eeprom_override()
115 dev_info(dev->dev, in mt76_eeprom_override()
117 phy->macaddr); in mt76_eeprom_override()
139 struct device_node *np = dev->dev->of_node; in mt76_find_power_limits_node()
148 if (dev->region < ARRAY_SIZE(region_names)) in mt76_find_power_limits_node()
149 region_name = region_names[dev->region]; in mt76_find_power_limits_node()
151 np = of_get_child_by_name(np, "power-limits"); in mt76_find_power_limits_node()
164 if (mt76_string_prop_find(country, dev->alpha2) || in mt76_find_power_limits_node()
180 if (!prop || !prop->value || prop->length < min * 4) in mt76_get_of_array()
183 *len = prop->length; in mt76_get_of_array()
185 return prop->value; in mt76_get_of_array()
201 if (chan->hw_value >= be32_to_cpu(val[0]) && in mt76_find_channel_node()
202 chan->hw_value <= be32_to_cpu(val[1])) in mt76_find_channel_node()
206 len -= 2 * sizeof(*val); in mt76_find_channel_node()
219 val = mt76_get_of_array(np, "txs-delta", &len, nss); in mt76_get_txs_delta()
223 return be32_to_cpu(val[nss - 1]); in mt76_get_txs_delta()
260 if (--cur > 0) in mt76_apply_multi_array_limit()
264 len -= pwr_len + 1; in mt76_apply_multi_array_limit()
277 struct mt76_dev *dev = phy->dev; in mt76_get_rate_power_limits()
281 u32 mcs_rates = dev->drv->mcs_rates; in mt76_get_rate_power_limits()
282 u32 ru_rates = ARRAY_SIZE(dest->ru[0]); in mt76_get_rate_power_limits()
300 switch (chan->band) { in mt76_get_rate_power_limits()
314 snprintf(name, sizeof(name), "txpower-%cg", band); in mt76_get_rate_power_limits()
323 txs_delta = mt76_get_txs_delta(np, hweight8(phy->antenna_mask)); in mt76_get_rate_power_limits()
325 val = mt76_get_of_array(np, "rates-cck", &len, ARRAY_SIZE(dest->cck)); in mt76_get_rate_power_limits()
326 mt76_apply_array_limit(dest->cck, ARRAY_SIZE(dest->cck), val, in mt76_get_rate_power_limits()
329 val = mt76_get_of_array(np, "rates-ofdm", in mt76_get_rate_power_limits()
330 &len, ARRAY_SIZE(dest->ofdm)); in mt76_get_rate_power_limits()
331 mt76_apply_array_limit(dest->ofdm, ARRAY_SIZE(dest->ofdm), val, in mt76_get_rate_power_limits()
334 val = mt76_get_of_array(np, "rates-mcs", &len, mcs_rates + 1); in mt76_get_rate_power_limits()
335 mt76_apply_multi_array_limit(dest->mcs[0], ARRAY_SIZE(dest->mcs[0]), in mt76_get_rate_power_limits()
336 ARRAY_SIZE(dest->mcs), val, len, in mt76_get_rate_power_limits()
339 val = mt76_get_of_array(np, "rates-ru", &len, ru_rates + 1); in mt76_get_rate_power_limits()
340 mt76_apply_multi_array_limit(dest->ru[0], ARRAY_SIZE(dest->ru[0]), in mt76_get_rate_power_limits()
341 ARRAY_SIZE(dest->ru), val, len, in mt76_get_rate_power_limits()
351 dev->eeprom.size = len; in mt76_eeprom_init()
352 dev->eeprom.data = devm_kzalloc(dev->dev, len, GFP_KERNEL); in mt76_eeprom_init()
353 if (!dev->eeprom.data) in mt76_eeprom_init()
354 return -ENOMEM; in mt76_eeprom_init()
356 return !mt76_get_of_eeprom(dev, dev->eeprom.data, 0, len); in mt76_eeprom_init()