/* * is called in wl_pci_probe() context, therefore no locking required. */ static int ieee_hw_rate_init(struct ieee80211_hw *hw) { struct wl_info *wl = HW_TO_WL(hw); int has_5g; char phy_list[4]; has_5g = 0; hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL; hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL; if (wlc_get(wl->wlc, WLC_GET_PHYLIST, (int *)&phy_list) < 0) { WL_ERROR("Phy list failed\n"); } WL_NONE("%s: phylist = %c\n", __func__, phy_list[0]); if (phy_list[0] == 'n' || phy_list[0] == 'c') { if (phy_list[0] == 'c') { /* Single stream */ wl_band_2GHz_nphy.ht_cap.mcs.rx_mask[1] = 0; wl_band_2GHz_nphy.ht_cap.mcs.rx_highest = 72; } hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl_band_2GHz_nphy; } else { BUG(); return -1; } /* Assume all bands use the same phy. True for 11n devices. */ if (NBANDS_PUB(wl->pub) > 1) { has_5g++; if (phy_list[0] == 'n' || phy_list[0] == 'c') { hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &wl_band_5GHz_nphy; } else { return -1; } } WL_NONE("%s: 2ghz = %d, 5ghz = %d\n", __func__, 1, has_5g); return 0; }
/* * is called in brcms_pci_probe() context, therefore no locking required. */ static int ieee_hw_rate_init(struct ieee80211_hw *hw) { struct brcms_info *wl = HW_TO_WL(hw); int has_5g; char phy_list[4]; has_5g = 0; hw->wiphy->bands[IEEE80211_BAND_2GHZ] = NULL; hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL; if (brcms_c_get(wl->wlc, BRCM_GET_PHYLIST, (int *)&phy_list) < 0) wiphy_err(hw->wiphy, "Phy list failed\n"); if (phy_list[0] == 'n' || phy_list[0] == 'c') { if (phy_list[0] == 'c') { /* Single stream */ brcms_band_2GHz_nphy.ht_cap.mcs.rx_mask[1] = 0; brcms_band_2GHz_nphy.ht_cap.mcs.rx_highest = 72; } hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &brcms_band_2GHz_nphy; } else { return -EPERM; } /* Assume all bands use the same phy. True for 11n devices. */ if (NBANDS_PUB(wl->pub) > 1) { has_5g++; if (phy_list[0] == 'n' || phy_list[0] == 'c') { hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &brcms_band_5GHz_nphy; } else { return -EPERM; } } return 0; }