OLD | NEW |
1 /* | 1 /* |
2 * EEPROM parser code for mac80211 Prism54 drivers | 2 * EEPROM parser code for mac80211 Prism54 drivers |
3 * | 3 * |
4 * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net> | 4 * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net> |
5 * Copyright (c) 2007-2009, Christian Lamparter <chunkeey@web.de> | 5 * Copyright (c) 2007-2009, Christian Lamparter <chunkeey@web.de> |
6 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net> | 6 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net> |
7 * | 7 * |
8 * Based on: | 8 * Based on: |
9 * - the islsm (softmac prism54) driver, which is: | 9 * - the islsm (softmac prism54) driver, which is: |
10 * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al. | 10 * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 list->channels[i].index, list->channels[i].fre
q); | 160 list->channels[i].index, list->channels[i].fre
q); |
161 continue; | 161 continue; |
162 } | 162 } |
163 | 163 |
164 tmp->channels[j].band = list->channels[i].band; | 164 tmp->channels[j].band = list->channels[i].band; |
165 tmp->channels[j].center_freq = list->channels[i].freq; | 165 tmp->channels[j].center_freq = list->channels[i].freq; |
166 j++; | 166 j++; |
167 } | 167 } |
168 | 168 |
169 if (j == 0) { | 169 if (j == 0) { |
170 » » wiphy_err(dev->wiphy, "disabling totally damaged %d GHz band\n", | 170 » » wiphy_err(dev->wiphy, "Disabling totally damaged %d GHz band\n", |
171 (band == IEEE80211_BAND_2GHZ) ? 2 : 5); | 171 (band == IEEE80211_BAND_2GHZ) ? 2 : 5); |
172 | 172 |
173 ret = -ENODATA; | 173 ret = -ENODATA; |
174 goto err_out; | 174 goto err_out; |
175 } | 175 } |
176 | 176 |
177 tmp->n_channels = j; | 177 tmp->n_channels = j; |
178 old = priv->band_table[band]; | 178 old = priv->band_table[band]; |
179 priv->band_table[band] = tmp; | 179 priv->band_table[band] = tmp; |
180 if (old) { | 180 if (old) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 253 |
254 list = kzalloc(sizeof(*list), GFP_KERNEL); | 254 list = kzalloc(sizeof(*list), GFP_KERNEL); |
255 if (!list) { | 255 if (!list) { |
256 ret = -ENOMEM; | 256 ret = -ENOMEM; |
257 goto free; | 257 goto free; |
258 } | 258 } |
259 | 259 |
260 list->max_entries = max_channel_num; | 260 list->max_entries = max_channel_num; |
261 list->channels = kzalloc(sizeof(struct p54_channel_entry) * | 261 list->channels = kzalloc(sizeof(struct p54_channel_entry) * |
262 max_channel_num, GFP_KERNEL); | 262 max_channel_num, GFP_KERNEL); |
263 » if (!list->channels) | 263 » if (!list->channels) { |
| 264 » » ret = -ENOMEM; |
264 goto free; | 265 goto free; |
| 266 } |
265 | 267 |
266 for (i = 0; i < max_channel_num; i++) { | 268 for (i = 0; i < max_channel_num; i++) { |
267 if (i < priv->iq_autocal_len) { | 269 if (i < priv->iq_autocal_len) { |
268 freq = le16_to_cpu(priv->iq_autocal[i].freq); | 270 freq = le16_to_cpu(priv->iq_autocal[i].freq); |
269 p54_update_channel_param(list, freq, CHAN_HAS_CAL); | 271 p54_update_channel_param(list, freq, CHAN_HAS_CAL); |
270 } | 272 } |
271 | 273 |
272 if (i < priv->output_limit->entries) { | 274 if (i < priv->output_limit->entries) { |
273 freq = le16_to_cpup((__le16 *) (i * | 275 freq = le16_to_cpup((__le16 *) (i * |
274 priv->output_limit->entry_size + | 276 priv->output_limit->entry_size + |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 priv->band_table[IEEE80211_BAND_5GHZ]; | 690 priv->band_table[IEEE80211_BAND_5GHZ]; |
689 if ((synth & PDR_SYNTH_RX_DIV_MASK) == PDR_SYNTH_RX_DIV_SUPPORTED) | 691 if ((synth & PDR_SYNTH_RX_DIV_MASK) == PDR_SYNTH_RX_DIV_SUPPORTED) |
690 priv->rx_diversity_mask = 3; | 692 priv->rx_diversity_mask = 3; |
691 if ((synth & PDR_SYNTH_TX_DIV_MASK) == PDR_SYNTH_TX_DIV_SUPPORTED) | 693 if ((synth & PDR_SYNTH_TX_DIV_MASK) == PDR_SYNTH_TX_DIV_SUPPORTED) |
692 priv->tx_diversity_mask = 3; | 694 priv->tx_diversity_mask = 3; |
693 | 695 |
694 if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { | 696 if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { |
695 u8 perm_addr[ETH_ALEN]; | 697 u8 perm_addr[ETH_ALEN]; |
696 | 698 |
697 wiphy_warn(dev->wiphy, | 699 wiphy_warn(dev->wiphy, |
698 » » » "invalid hwaddr! using randomly generated mac addr\n"
); | 700 » » » "Invalid hwaddr! Using randomly generated MAC addr\n"
); |
699 random_ether_addr(perm_addr); | 701 random_ether_addr(perm_addr); |
700 SET_IEEE80211_PERM_ADDR(dev, perm_addr); | 702 SET_IEEE80211_PERM_ADDR(dev, perm_addr); |
701 } | 703 } |
702 | 704 |
703 » wiphy_info(dev->wiphy, "hwaddr %pm, mac:isl38%02x rf:%s\n", | 705 » wiphy_info(dev->wiphy, "hwaddr %pM, MAC:isl38%02x RF:%s\n", |
704 dev->wiphy->perm_addr, priv->version, | 706 dev->wiphy->perm_addr, priv->version, |
705 p54_rf_chips[priv->rxhw]); | 707 p54_rf_chips[priv->rxhw]); |
706 | 708 |
707 return 0; | 709 return 0; |
708 | 710 |
709 err: | 711 err: |
710 kfree(priv->iq_autocal); | 712 kfree(priv->iq_autocal); |
711 kfree(priv->output_limit); | 713 kfree(priv->output_limit); |
712 kfree(priv->curve_data); | 714 kfree(priv->curve_data); |
713 priv->iq_autocal = NULL; | 715 priv->iq_autocal = NULL; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 offset += blocksize; | 748 offset += blocksize; |
747 eeprom_size -= blocksize; | 749 eeprom_size -= blocksize; |
748 } | 750 } |
749 | 751 |
750 ret = p54_parse_eeprom(dev, eeprom, offset); | 752 ret = p54_parse_eeprom(dev, eeprom, offset); |
751 free: | 753 free: |
752 kfree(eeprom); | 754 kfree(eeprom); |
753 return ret; | 755 return ret; |
754 } | 756 } |
755 EXPORT_SYMBOL_GPL(p54_read_eeprom); | 757 EXPORT_SYMBOL_GPL(p54_read_eeprom); |
OLD | NEW |