hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
....@@ -838,12 +838,10 @@
838838 struct dma_pub *dma = NULL;
839839 struct d11txh *txh = NULL;
840840 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;
844843 bool lastframe;
845844 struct ieee80211_hdr *h;
846
- u16 mcl;
847845 struct ieee80211_tx_info *tx_info;
848846 struct ieee80211_tx_rate *txrate;
849847 int i;
....@@ -880,7 +878,6 @@
880878 }
881879
882880 txh = (struct d11txh *) (p->data);
883
- mcl = le16_to_cpu(txh->MacTxControlLow);
884881
885882 if (txs->phyerr)
886883 brcms_dbg_tx(wlc->hw->d11core, "phyerr 0x%x, rate 0x%x\n",
....@@ -917,11 +914,8 @@
917914 CHSPEC_CHANNEL(wlc->default_bss->chanspec));
918915 }
919916
920
- tx_rts = le16_to_cpu(txh->MacTxControlLow) & TXC_SENDRTS;
921917 tx_frame_count =
922918 (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;
925919
926920 lastframe = !ieee80211_has_morefrags(h->frame_control);
927921
....@@ -988,9 +982,6 @@
988982 if (txs->status & TX_STATUS_ACK_RCV)
989983 tx_info->flags |= IEEE80211_TX_STAT_ACK;
990984 }
991
-
992
- totlen = p->len;
993
- free_pdu = true;
994985
995986 if (lastframe) {
996987 /* remove PLCP & Broadcom tx descriptor header */
....@@ -1064,7 +1055,7 @@
10641055 txs->lasttxtime = 0;
10651056
10661057 *fatal = brcms_c_dotxstatus(wlc_hw->wlc, txs);
1067
- if (*fatal == true)
1058
+ if (*fatal)
10681059 return false;
10691060 n++;
10701061 }
....@@ -1783,7 +1774,6 @@
17831774 {
17841775 struct brcms_phy_pub *pih = wlc_hw->band->pi;
17851776 u32 phy_bw_clkbits;
1786
- bool phy_in_reset = false;
17871777
17881778 brcms_dbg_info(wlc_hw->d11core, "wl%d: reset phy\n", wlc_hw->unit);
17891779
....@@ -1806,7 +1796,6 @@
18061796 /* reset the PHY */
18071797 brcms_b_core_ioctl(wlc_hw, (SICF_PRST | SICF_PCLKE),
18081798 (SICF_PRST | SICF_PCLKE));
1809
- phy_in_reset = true;
18101799 } else {
18111800 brcms_b_core_ioctl(wlc_hw,
18121801 (SICF_PRST | SICF_PCLKE | SICF_BWMASK),
....@@ -1816,8 +1805,7 @@
18161805 udelay(2);
18171806 brcms_b_core_phy_clk(wlc_hw, ON);
18181807
1819
- if (pih)
1820
- wlc_phy_anacore(pih, ON);
1808
+ wlc_phy_anacore(pih, ON);
18211809 }
18221810
18231811 /* switch to and initialize new band */
....@@ -2278,10 +2266,7 @@
22782266
22792267 static void brcms_ucode_download(struct brcms_hardware *wlc_hw)
22802268 {
2281
- struct brcms_c_info *wlc;
22822269 struct brcms_ucode *ucode = &wlc_hw->wlc->wl->ucode;
2283
-
2284
- wlc = wlc_hw->wlc;
22852270
22862271 if (wlc_hw->ucode_loaded)
22872272 return;
....@@ -3181,7 +3166,6 @@
31813166 {
31823167 struct brcms_hardware *wlc_hw = wlc->hw;
31833168 struct bcma_device *core = wlc_hw->d11core;
3184
- u32 sflags;
31853169 u32 bcnint_us;
31863170 uint i = 0;
31873171 bool fifosz_fixup = false;
....@@ -3214,7 +3198,7 @@
32143198
32153199 brcms_c_gpio_init(wlc);
32163200
3217
- sflags = bcma_aread32(core, BCMA_IOST);
3201
+ bcma_aread32(core, BCMA_IOST);
32183202
32193203 if (D11REV_IS(wlc_hw->corerev, 17) || D11REV_IS(wlc_hw->corerev, 23)) {
32203204 if (BRCMS_ISNPHY(wlc_hw->band))
....@@ -3776,17 +3760,14 @@
37763760 * Write this BSS config's MAC address to core.
37773761 * Updates RXE match engine.
37783762 */
3779
-static int brcms_c_set_mac(struct brcms_bss_cfg *bsscfg)
3763
+static void brcms_c_set_mac(struct brcms_bss_cfg *bsscfg)
37803764 {
3781
- int err = 0;
37823765 struct brcms_c_info *wlc = bsscfg->wlc;
37833766
37843767 /* enter the MAC addr into the RXE match registers */
37853768 brcms_c_set_addrmatch(wlc, RCM_MAC_OFFSET, wlc->pub->cur_etheraddr);
37863769
37873770 brcms_c_ampdu_macaddr_upd(wlc);
3788
-
3789
- return err;
37903771 }
37913772
37923773 /* Write the BSS config's BSSID address to core (set_bssid in d11procs.tcl).
....@@ -3910,7 +3891,6 @@
39103891 static void brcms_c_set_chanspec(struct brcms_c_info *wlc, u16 chanspec)
39113892 {
39123893 uint bandunit;
3913
- bool switchband = false;
39143894 u16 old_chanspec = wlc->chanspec;
39153895
39163896 if (!brcms_c_valid_chanspec_db(wlc->cmi, chanspec)) {
....@@ -3923,7 +3903,6 @@
39233903 if (wlc->pub->_nbands > 1) {
39243904 bandunit = chspec_bandunit(chanspec);
39253905 if (wlc->band->bandunit != bandunit || wlc->bandinit_pending) {
3926
- switchband = true;
39273906 if (wlc->bandlocked) {
39283907 brcms_err(wlc->hw->d11core,
39293908 "wl%d: %s: chspec %d band is locked!\n",
....@@ -5106,13 +5085,6 @@
51065085 return 0;
51075086 }
51085087
5109
-static uint brcms_c_down_del_timer(struct brcms_c_info *wlc)
5110
-{
5111
- uint callbacks = 0;
5112
-
5113
- return callbacks;
5114
-}
5115
-
51165088 static int brcms_b_bmac_down_prep(struct brcms_hardware *wlc_hw)
51175089 {
51185090 bool dev_gone;
....@@ -5190,7 +5162,6 @@
51905162
51915163 uint callbacks = 0;
51925164 int i;
5193
- bool dev_gone = false;
51945165
51955166 brcms_dbg_info(wlc->hw->d11core, "wl%d\n", wlc->pub->unit);
51965167
....@@ -5208,7 +5179,7 @@
52085179
52095180 callbacks += brcms_b_bmac_down_prep(wlc->hw);
52105181
5211
- dev_gone = brcms_deviceremoved(wlc);
5182
+ brcms_deviceremoved(wlc);
52125183
52135184 /* Call any registered down handlers */
52145185 for (i = 0; i < BRCMS_MAXMODULES; i++) {
....@@ -5223,8 +5194,6 @@
52235194 callbacks++;
52245195 wlc->WDarmed = false;
52255196 }
5226
- /* cancel all other timers */
5227
- callbacks += brcms_c_down_del_timer(wlc);
52285197
52295198 wlc->pub->up = false;
52305199
....@@ -5248,15 +5217,7 @@
52485217 /* Default to 54g Auto */
52495218 /* Advertise and use shortslot (-1/0/1 Auto/Off/On) */
52505219 s8 shortslot = BRCMS_SHORTSLOT_AUTO;
5251
- bool shortslot_restrict = false; /* Restrict association to stations
5252
- * that support shortslot
5253
- */
52545220 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
- */
52605221 struct brcms_band *band;
52615222
52625223 /* if N-support is enabled, allow Gmode set as long as requested
....@@ -5297,16 +5258,11 @@
52975258
52985259 case GMODE_ONLY:
52995260 ofdm_basic = true;
5300
- preamble = BRCMS_PLCP_SHORT;
5301
- preamble_restrict = true;
53025261 break;
53035262
53045263 case GMODE_PERFORMANCE:
53055264 shortslot = BRCMS_SHORTSLOT_ON;
5306
- shortslot_restrict = true;
53075265 ofdm_basic = true;
5308
- preamble = BRCMS_PLCP_SHORT;
5309
- preamble_restrict = true;
53105266 break;
53115267
53125268 default:
....@@ -5414,22 +5370,14 @@
54145370
54155371 static void brcms_c_ofdm_rateset_war(struct brcms_c_info *wlc)
54165372 {
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);
54265374 }
54275375
54285376 int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel)
54295377 {
54305378 u16 chspec = ch20mhz_chspec(channel);
54315379
5432
- if (channel < 0 || channel > MAXCHANNEL)
5380
+ if (channel > MAXCHANNEL)
54335381 return -EINVAL;
54345382
54355383 if (!brcms_c_valid_chanspec_db(wlc->cmi, chspec))
....@@ -5897,7 +5845,6 @@
58975845 bool issgi = ((int_val & NRATE_SGI_MASK) >> NRATE_SGI_SHIFT);
58985846 bool override_mcs_only = ((int_val & NRATE_OVERRIDE_MCS_ONLY)
58995847 == NRATE_OVERRIDE_MCS_ONLY);
5900
- int bcmerror = 0;
59015848
59025849 if (!ismcs)
59035850 return (u32) rate;
....@@ -5908,7 +5855,6 @@
59085855 if (stf > PHY_TXC1_MODE_SDM) {
59095856 brcms_err(core, "wl%d: %s: Invalid stf\n",
59105857 wlc->pub->unit, __func__);
5911
- bcmerror = -EINVAL;
59125858 goto done;
59135859 }
59145860
....@@ -5919,7 +5865,6 @@
59195865 && (stf != PHY_TXC1_MODE_CDD))) {
59205866 brcms_err(core, "wl%d: %s: Invalid mcs 32\n",
59215867 wlc->pub->unit, __func__);
5922
- bcmerror = -EINVAL;
59235868 goto done;
59245869 }
59255870 /* mcs > 7 must use stf SDM */
....@@ -5941,7 +5886,6 @@
59415886 && (stf == PHY_TXC1_MODE_STBC))) {
59425887 brcms_err(core, "wl%d: %s: Invalid STBC\n",
59435888 wlc->pub->unit, __func__);
5944
- bcmerror = -EINVAL;
59455889 goto done;
59465890 }
59475891 }
....@@ -5949,7 +5893,6 @@
59495893 if ((stf != PHY_TXC1_MODE_CDD) && (stf != PHY_TXC1_MODE_SISO)) {
59505894 brcms_err(core, "wl%d: %s: Invalid OFDM\n",
59515895 wlc->pub->unit, __func__);
5952
- bcmerror = -EINVAL;
59535896 goto done;
59545897 }
59555898 } else if (is_cck_rate(rate)) {
....@@ -5957,20 +5900,17 @@
59575900 || (stf != PHY_TXC1_MODE_SISO)) {
59585901 brcms_err(core, "wl%d: %s: Invalid CCK\n",
59595902 wlc->pub->unit, __func__);
5960
- bcmerror = -EINVAL;
59615903 goto done;
59625904 }
59635905 } else {
59645906 brcms_err(core, "wl%d: %s: Unknown rate type\n",
59655907 wlc->pub->unit, __func__);
5966
- bcmerror = -EINVAL;
59675908 goto done;
59685909 }
59695910 /* make sure multiple antennae are available for non-siso rates */
59705911 if ((stf != PHY_TXC1_MODE_SISO) && (wlc->stf->txstreams == 1)) {
59715912 brcms_err(core, "wl%d: %s: SISO antenna but !SISO "
59725913 "request\n", wlc->pub->unit, __func__);
5973
- bcmerror = -EINVAL;
59745914 goto done;
59755915 }
59765916
....@@ -6234,7 +6174,6 @@
62346174 bool use_rts = false;
62356175 bool use_cts = false;
62366176 bool use_rifs = false;
6237
- bool short_preamble[2] = { false, false };
62386177 u8 preamble_type[2] = { BRCMS_LONG_PREAMBLE, BRCMS_LONG_PREAMBLE };
62396178 u8 rts_preamble_type[2] = { BRCMS_LONG_PREAMBLE, BRCMS_LONG_PREAMBLE };
62406179 u8 *rts_plcp, rts_plcp_fallback[D11_PHY_HDR_LEN];
....@@ -6320,10 +6259,6 @@
63206259 rspec[k] =
63216260 hw->wiphy->bands[tx_info->band]->
63226261 bitrates[txrate[k]->idx].hw_value;
6323
- short_preamble[k] =
6324
- txrate[k]->
6325
- flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ?
6326
- true : false;
63276262 } else {
63286263 rspec[k] = BRCM_RATE_1M;
63296264 }
....@@ -7397,9 +7332,7 @@
73977332 false, true);
73987333 /* mark beacon0 valid */
73997334 bcma_set32(core, D11REGOFFS(maccommand), MCMD_BCN1VLD);
7400
- return;
74017335 }
7402
- return;
74037336 }
74047337
74057338 /*