.. | .. |
---|
838 | 838 | struct dma_pub *dma = NULL; |
---|
839 | 839 | struct d11txh *txh = NULL; |
---|
840 | 840 | struct scb *scb = NULL; |
---|
841 | | - bool free_pdu; |
---|
842 | | - int tx_rts, tx_frame_count, tx_rts_count; |
---|
843 | | - uint totlen, supr_status; |
---|
| 841 | + int tx_frame_count; |
---|
| 842 | + uint supr_status; |
---|
844 | 843 | bool lastframe; |
---|
845 | 844 | struct ieee80211_hdr *h; |
---|
846 | | - u16 mcl; |
---|
847 | 845 | struct ieee80211_tx_info *tx_info; |
---|
848 | 846 | struct ieee80211_tx_rate *txrate; |
---|
849 | 847 | int i; |
---|
.. | .. |
---|
880 | 878 | } |
---|
881 | 879 | |
---|
882 | 880 | txh = (struct d11txh *) (p->data); |
---|
883 | | - mcl = le16_to_cpu(txh->MacTxControlLow); |
---|
884 | 881 | |
---|
885 | 882 | if (txs->phyerr) |
---|
886 | 883 | brcms_dbg_tx(wlc->hw->d11core, "phyerr 0x%x, rate 0x%x\n", |
---|
.. | .. |
---|
917 | 914 | CHSPEC_CHANNEL(wlc->default_bss->chanspec)); |
---|
918 | 915 | } |
---|
919 | 916 | |
---|
920 | | - tx_rts = le16_to_cpu(txh->MacTxControlLow) & TXC_SENDRTS; |
---|
921 | 917 | tx_frame_count = |
---|
922 | 918 | (txs->status & TX_STATUS_FRM_RTX_MASK) >> TX_STATUS_FRM_RTX_SHIFT; |
---|
923 | | - tx_rts_count = |
---|
924 | | - (txs->status & TX_STATUS_RTS_RTX_MASK) >> TX_STATUS_RTS_RTX_SHIFT; |
---|
925 | 919 | |
---|
926 | 920 | lastframe = !ieee80211_has_morefrags(h->frame_control); |
---|
927 | 921 | |
---|
.. | .. |
---|
988 | 982 | if (txs->status & TX_STATUS_ACK_RCV) |
---|
989 | 983 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
---|
990 | 984 | } |
---|
991 | | - |
---|
992 | | - totlen = p->len; |
---|
993 | | - free_pdu = true; |
---|
994 | 985 | |
---|
995 | 986 | if (lastframe) { |
---|
996 | 987 | /* remove PLCP & Broadcom tx descriptor header */ |
---|
.. | .. |
---|
1064 | 1055 | txs->lasttxtime = 0; |
---|
1065 | 1056 | |
---|
1066 | 1057 | *fatal = brcms_c_dotxstatus(wlc_hw->wlc, txs); |
---|
1067 | | - if (*fatal == true) |
---|
| 1058 | + if (*fatal) |
---|
1068 | 1059 | return false; |
---|
1069 | 1060 | n++; |
---|
1070 | 1061 | } |
---|
.. | .. |
---|
1783 | 1774 | { |
---|
1784 | 1775 | struct brcms_phy_pub *pih = wlc_hw->band->pi; |
---|
1785 | 1776 | u32 phy_bw_clkbits; |
---|
1786 | | - bool phy_in_reset = false; |
---|
1787 | 1777 | |
---|
1788 | 1778 | brcms_dbg_info(wlc_hw->d11core, "wl%d: reset phy\n", wlc_hw->unit); |
---|
1789 | 1779 | |
---|
.. | .. |
---|
1806 | 1796 | /* reset the PHY */ |
---|
1807 | 1797 | brcms_b_core_ioctl(wlc_hw, (SICF_PRST | SICF_PCLKE), |
---|
1808 | 1798 | (SICF_PRST | SICF_PCLKE)); |
---|
1809 | | - phy_in_reset = true; |
---|
1810 | 1799 | } else { |
---|
1811 | 1800 | brcms_b_core_ioctl(wlc_hw, |
---|
1812 | 1801 | (SICF_PRST | SICF_PCLKE | SICF_BWMASK), |
---|
.. | .. |
---|
1816 | 1805 | udelay(2); |
---|
1817 | 1806 | brcms_b_core_phy_clk(wlc_hw, ON); |
---|
1818 | 1807 | |
---|
1819 | | - if (pih) |
---|
1820 | | - wlc_phy_anacore(pih, ON); |
---|
| 1808 | + wlc_phy_anacore(pih, ON); |
---|
1821 | 1809 | } |
---|
1822 | 1810 | |
---|
1823 | 1811 | /* switch to and initialize new band */ |
---|
.. | .. |
---|
2278 | 2266 | |
---|
2279 | 2267 | static void brcms_ucode_download(struct brcms_hardware *wlc_hw) |
---|
2280 | 2268 | { |
---|
2281 | | - struct brcms_c_info *wlc; |
---|
2282 | 2269 | struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode; |
---|
2283 | | - |
---|
2284 | | - wlc = wlc_hw->wlc; |
---|
2285 | 2270 | |
---|
2286 | 2271 | if (wlc_hw->ucode_loaded) |
---|
2287 | 2272 | return; |
---|
.. | .. |
---|
3181 | 3166 | { |
---|
3182 | 3167 | struct brcms_hardware *wlc_hw = wlc->hw; |
---|
3183 | 3168 | struct bcma_device *core = wlc_hw->d11core; |
---|
3184 | | - u32 sflags; |
---|
3185 | 3169 | u32 bcnint_us; |
---|
3186 | 3170 | uint i = 0; |
---|
3187 | 3171 | bool fifosz_fixup = false; |
---|
.. | .. |
---|
3214 | 3198 | |
---|
3215 | 3199 | brcms_c_gpio_init(wlc); |
---|
3216 | 3200 | |
---|
3217 | | - sflags = bcma_aread32(core, BCMA_IOST); |
---|
| 3201 | + bcma_aread32(core, BCMA_IOST); |
---|
3218 | 3202 | |
---|
3219 | 3203 | if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) { |
---|
3220 | 3204 | if (BRCMS_ISNPHY(wlc_hw->band)) |
---|
.. | .. |
---|
3776 | 3760 | * Write this BSS config's MAC address to core. |
---|
3777 | 3761 | * Updates RXE match engine. |
---|
3778 | 3762 | */ |
---|
3779 | | -static int brcms_c_set_mac(struct brcms_bss_cfg *bsscfg) |
---|
| 3763 | +static void brcms_c_set_mac(struct brcms_bss_cfg *bsscfg) |
---|
3780 | 3764 | { |
---|
3781 | | - int err = 0; |
---|
3782 | 3765 | struct brcms_c_info *wlc = bsscfg->wlc; |
---|
3783 | 3766 | |
---|
3784 | 3767 | /* enter the MAC addr into the RXE match registers */ |
---|
3785 | 3768 | brcms_c_set_addrmatch(wlc, RCM_MAC_OFFSET, wlc->pub->cur_etheraddr); |
---|
3786 | 3769 | |
---|
3787 | 3770 | brcms_c_ampdu_macaddr_upd(wlc); |
---|
3788 | | - |
---|
3789 | | - return err; |
---|
3790 | 3771 | } |
---|
3791 | 3772 | |
---|
3792 | 3773 | /* Write the BSS config's BSSID address to core (set_bssid in d11procs.tcl). |
---|
.. | .. |
---|
3910 | 3891 | static void brcms_c_set_chanspec(struct brcms_c_info *wlc, u16 chanspec) |
---|
3911 | 3892 | { |
---|
3912 | 3893 | uint bandunit; |
---|
3913 | | - bool switchband = false; |
---|
3914 | 3894 | u16 old_chanspec = wlc->chanspec; |
---|
3915 | 3895 | |
---|
3916 | 3896 | if (!brcms_c_valid_chanspec_db(wlc->cmi, chanspec)) { |
---|
.. | .. |
---|
3923 | 3903 | if (wlc->pub->_nbands > 1) { |
---|
3924 | 3904 | bandunit = chspec_bandunit(chanspec); |
---|
3925 | 3905 | if (wlc->band->bandunit != bandunit || wlc->bandinit_pending) { |
---|
3926 | | - switchband = true; |
---|
3927 | 3906 | if (wlc->bandlocked) { |
---|
3928 | 3907 | brcms_err(wlc->hw->d11core, |
---|
3929 | 3908 | "wl%d: %s: chspec %d band is locked!\n", |
---|
.. | .. |
---|
5106 | 5085 | return 0; |
---|
5107 | 5086 | } |
---|
5108 | 5087 | |
---|
5109 | | -static uint brcms_c_down_del_timer(struct brcms_c_info *wlc) |
---|
5110 | | -{ |
---|
5111 | | - uint callbacks = 0; |
---|
5112 | | - |
---|
5113 | | - return callbacks; |
---|
5114 | | -} |
---|
5115 | | - |
---|
5116 | 5088 | static int brcms_b_bmac_down_prep(struct brcms_hardware *wlc_hw) |
---|
5117 | 5089 | { |
---|
5118 | 5090 | bool dev_gone; |
---|
.. | .. |
---|
5190 | 5162 | |
---|
5191 | 5163 | uint callbacks = 0; |
---|
5192 | 5164 | int i; |
---|
5193 | | - bool dev_gone = false; |
---|
5194 | 5165 | |
---|
5195 | 5166 | brcms_dbg_info(wlc->hw->d11core, "wl%d\n", wlc->pub->unit); |
---|
5196 | 5167 | |
---|
.. | .. |
---|
5208 | 5179 | |
---|
5209 | 5180 | callbacks += brcms_b_bmac_down_prep(wlc->hw); |
---|
5210 | 5181 | |
---|
5211 | | - dev_gone = brcms_deviceremoved(wlc); |
---|
| 5182 | + brcms_deviceremoved(wlc); |
---|
5212 | 5183 | |
---|
5213 | 5184 | /* Call any registered down handlers */ |
---|
5214 | 5185 | for (i = 0; i < BRCMS_MAXMODULES; i++) { |
---|
.. | .. |
---|
5223 | 5194 | callbacks++; |
---|
5224 | 5195 | wlc->WDarmed = false; |
---|
5225 | 5196 | } |
---|
5226 | | - /* cancel all other timers */ |
---|
5227 | | - callbacks += brcms_c_down_del_timer(wlc); |
---|
5228 | 5197 | |
---|
5229 | 5198 | wlc->pub->up = false; |
---|
5230 | 5199 | |
---|
.. | .. |
---|
5248 | 5217 | /* Default to 54g Auto */ |
---|
5249 | 5218 | /* Advertise and use shortslot (-1/0/1 Auto/Off/On) */ |
---|
5250 | 5219 | s8 shortslot = BRCMS_SHORTSLOT_AUTO; |
---|
5251 | | - bool shortslot_restrict = false; /* Restrict association to stations |
---|
5252 | | - * that support shortslot |
---|
5253 | | - */ |
---|
5254 | 5220 | bool ofdm_basic = false; /* Make 6, 12, and 24 basic rates */ |
---|
5255 | | - /* Advertise and use short preambles (-1/0/1 Auto/Off/On) */ |
---|
5256 | | - int preamble = BRCMS_PLCP_LONG; |
---|
5257 | | - bool preamble_restrict = false; /* Restrict association to stations |
---|
5258 | | - * that support short preambles |
---|
5259 | | - */ |
---|
5260 | 5221 | struct brcms_band *band; |
---|
5261 | 5222 | |
---|
5262 | 5223 | /* if N-support is enabled, allow Gmode set as long as requested |
---|
.. | .. |
---|
5297 | 5258 | |
---|
5298 | 5259 | case GMODE_ONLY: |
---|
5299 | 5260 | ofdm_basic = true; |
---|
5300 | | - preamble = BRCMS_PLCP_SHORT; |
---|
5301 | | - preamble_restrict = true; |
---|
5302 | 5261 | break; |
---|
5303 | 5262 | |
---|
5304 | 5263 | case GMODE_PERFORMANCE: |
---|
5305 | 5264 | shortslot = BRCMS_SHORTSLOT_ON; |
---|
5306 | | - shortslot_restrict = true; |
---|
5307 | 5265 | ofdm_basic = true; |
---|
5308 | | - preamble = BRCMS_PLCP_SHORT; |
---|
5309 | | - preamble_restrict = true; |
---|
5310 | 5266 | break; |
---|
5311 | 5267 | |
---|
5312 | 5268 | default: |
---|
.. | .. |
---|
5414 | 5370 | |
---|
5415 | 5371 | static void brcms_c_ofdm_rateset_war(struct brcms_c_info *wlc) |
---|
5416 | 5372 | { |
---|
5417 | | - u8 r; |
---|
5418 | | - bool war = false; |
---|
5419 | | - |
---|
5420 | | - if (wlc->pub->associated) |
---|
5421 | | - r = wlc->bsscfg->current_bss->rateset.rates[0]; |
---|
5422 | | - else |
---|
5423 | | - r = wlc->default_bss->rateset.rates[0]; |
---|
5424 | | - |
---|
5425 | | - wlc_phy_ofdm_rateset_war(wlc->band->pi, war); |
---|
| 5373 | + wlc_phy_ofdm_rateset_war(wlc->band->pi, false); |
---|
5426 | 5374 | } |
---|
5427 | 5375 | |
---|
5428 | 5376 | int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel) |
---|
5429 | 5377 | { |
---|
5430 | 5378 | u16 chspec = ch20mhz_chspec(channel); |
---|
5431 | 5379 | |
---|
5432 | | - if (channel < 0 || channel > MAXCHANNEL) |
---|
| 5380 | + if (channel > MAXCHANNEL) |
---|
5433 | 5381 | return -EINVAL; |
---|
5434 | 5382 | |
---|
5435 | 5383 | if (!brcms_c_valid_chanspec_db(wlc->cmi, chspec)) |
---|
.. | .. |
---|
5897 | 5845 | bool issgi = ((int_val & NRATE_SGI_MASK) >> NRATE_SGI_SHIFT); |
---|
5898 | 5846 | bool override_mcs_only = ((int_val & NRATE_OVERRIDE_MCS_ONLY) |
---|
5899 | 5847 | == NRATE_OVERRIDE_MCS_ONLY); |
---|
5900 | | - int bcmerror = 0; |
---|
5901 | 5848 | |
---|
5902 | 5849 | if (!ismcs) |
---|
5903 | 5850 | return (u32) rate; |
---|
.. | .. |
---|
5908 | 5855 | if (stf > PHY_TXC1_MODE_SDM) { |
---|
5909 | 5856 | brcms_err(core, "wl%d: %s: Invalid stf\n", |
---|
5910 | 5857 | wlc->pub->unit, __func__); |
---|
5911 | | - bcmerror = -EINVAL; |
---|
5912 | 5858 | goto done; |
---|
5913 | 5859 | } |
---|
5914 | 5860 | |
---|
.. | .. |
---|
5919 | 5865 | && (stf != PHY_TXC1_MODE_CDD))) { |
---|
5920 | 5866 | brcms_err(core, "wl%d: %s: Invalid mcs 32\n", |
---|
5921 | 5867 | wlc->pub->unit, __func__); |
---|
5922 | | - bcmerror = -EINVAL; |
---|
5923 | 5868 | goto done; |
---|
5924 | 5869 | } |
---|
5925 | 5870 | /* mcs > 7 must use stf SDM */ |
---|
.. | .. |
---|
5941 | 5886 | && (stf == PHY_TXC1_MODE_STBC))) { |
---|
5942 | 5887 | brcms_err(core, "wl%d: %s: Invalid STBC\n", |
---|
5943 | 5888 | wlc->pub->unit, __func__); |
---|
5944 | | - bcmerror = -EINVAL; |
---|
5945 | 5889 | goto done; |
---|
5946 | 5890 | } |
---|
5947 | 5891 | } |
---|
.. | .. |
---|
5949 | 5893 | if ((stf != PHY_TXC1_MODE_CDD) && (stf != PHY_TXC1_MODE_SISO)) { |
---|
5950 | 5894 | brcms_err(core, "wl%d: %s: Invalid OFDM\n", |
---|
5951 | 5895 | wlc->pub->unit, __func__); |
---|
5952 | | - bcmerror = -EINVAL; |
---|
5953 | 5896 | goto done; |
---|
5954 | 5897 | } |
---|
5955 | 5898 | } else if (is_cck_rate(rate)) { |
---|
.. | .. |
---|
5957 | 5900 | || (stf != PHY_TXC1_MODE_SISO)) { |
---|
5958 | 5901 | brcms_err(core, "wl%d: %s: Invalid CCK\n", |
---|
5959 | 5902 | wlc->pub->unit, __func__); |
---|
5960 | | - bcmerror = -EINVAL; |
---|
5961 | 5903 | goto done; |
---|
5962 | 5904 | } |
---|
5963 | 5905 | } else { |
---|
5964 | 5906 | brcms_err(core, "wl%d: %s: Unknown rate type\n", |
---|
5965 | 5907 | wlc->pub->unit, __func__); |
---|
5966 | | - bcmerror = -EINVAL; |
---|
5967 | 5908 | goto done; |
---|
5968 | 5909 | } |
---|
5969 | 5910 | /* make sure multiple antennae are available for non-siso rates */ |
---|
5970 | 5911 | if ((stf != PHY_TXC1_MODE_SISO) && (wlc->stf->txstreams == 1)) { |
---|
5971 | 5912 | brcms_err(core, "wl%d: %s: SISO antenna but !SISO " |
---|
5972 | 5913 | "request\n", wlc->pub->unit, __func__); |
---|
5973 | | - bcmerror = -EINVAL; |
---|
5974 | 5914 | goto done; |
---|
5975 | 5915 | } |
---|
5976 | 5916 | |
---|
.. | .. |
---|
6234 | 6174 | bool use_rts = false; |
---|
6235 | 6175 | bool use_cts = false; |
---|
6236 | 6176 | bool use_rifs = false; |
---|
6237 | | - bool short_preamble[2] = { false, false }; |
---|
6238 | 6177 | u8 preamble_type[2] = { BRCMS_LONG_PREAMBLE, BRCMS_LONG_PREAMBLE }; |
---|
6239 | 6178 | u8 rts_preamble_type[2] = { BRCMS_LONG_PREAMBLE, BRCMS_LONG_PREAMBLE }; |
---|
6240 | 6179 | u8 *rts_plcp, rts_plcp_fallback[D11_PHY_HDR_LEN]; |
---|
.. | .. |
---|
6320 | 6259 | rspec[k] = |
---|
6321 | 6260 | hw->wiphy->bands[tx_info->band]-> |
---|
6322 | 6261 | bitrates[txrate[k]->idx].hw_value; |
---|
6323 | | - short_preamble[k] = |
---|
6324 | | - txrate[k]-> |
---|
6325 | | - flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ? |
---|
6326 | | - true : false; |
---|
6327 | 6262 | } else { |
---|
6328 | 6263 | rspec[k] = BRCM_RATE_1M; |
---|
6329 | 6264 | } |
---|
.. | .. |
---|
7397 | 7332 | false, true); |
---|
7398 | 7333 | /* mark beacon0 valid */ |
---|
7399 | 7334 | bcma_set32(core, D11REGOFFS(maccommand), MCMD_BCN1VLD); |
---|
7400 | | - return; |
---|
7401 | 7335 | } |
---|
7402 | | - return; |
---|
7403 | 7336 | } |
---|
7404 | 7337 | |
---|
7405 | 7338 | /* |
---|