diff -Nru ./drivers/net/wireless/b43legacy/debugfs.c ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/debugfs.c --- ./drivers/net/wireless/b43legacy/debugfs.c 2016-12-11 00:27:13.000000000 +0900 +++ ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/debugfs.c 2017-02-04 17:47:29.000000000 +0900 @@ -221,7 +221,8 @@ goto out_unlock; } - dfops = container_of(file->f_op, struct b43legacy_debugfs_fops, fops); + dfops = container_of(debugfs_real_fops(file), + struct b43legacy_debugfs_fops, fops); if (!dfops->read) { err = -ENOSYS; goto out_unlock; @@ -287,7 +288,8 @@ goto out_unlock; } - dfops = container_of(file->f_op, struct b43legacy_debugfs_fops, fops); + dfops = container_of(debugfs_real_fops(file), + struct b43legacy_debugfs_fops, fops); if (!dfops->write) { err = -ENOSYS; goto out_unlock; @@ -369,11 +371,11 @@ e->dyn_debug_dentries[id] = d; \ } while (0) - add_dyn_dbg("debug_xmitpower", B43legacy_DBG_XMITPOWER, 0); - add_dyn_dbg("debug_dmaoverflow", B43legacy_DBG_DMAOVERFLOW, 0); - add_dyn_dbg("debug_dmaverbose", B43legacy_DBG_DMAVERBOSE, 0); - add_dyn_dbg("debug_pwork_fast", B43legacy_DBG_PWORK_FAST, 0); - add_dyn_dbg("debug_pwork_stop", B43legacy_DBG_PWORK_STOP, 0); + add_dyn_dbg("debug_xmitpower", B43legacy_DBG_XMITPOWER, false); + add_dyn_dbg("debug_dmaoverflow", B43legacy_DBG_DMAOVERFLOW, false); + add_dyn_dbg("debug_dmaverbose", B43legacy_DBG_DMAVERBOSE, false); + add_dyn_dbg("debug_pwork_fast", B43legacy_DBG_PWORK_FAST, false); + add_dyn_dbg("debug_pwork_stop", B43legacy_DBG_PWORK_STOP, false); #undef add_dyn_dbg } diff -Nru ./drivers/net/wireless/b43legacy/debugfs.h ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/debugfs.h --- ./drivers/net/wireless/b43legacy/debugfs.h 2016-12-11 00:27:13.000000000 +0900 +++ ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/debugfs.h 2017-02-04 17:47:29.000000000 +0900 @@ -47,7 +47,7 @@ struct b43legacy_txstatus_log txstatlog; /* Enabled/Disabled list for the dynamic debugging features. */ - u32 dyn_debug[__B43legacy_NR_DYNDBG]; + bool dyn_debug[__B43legacy_NR_DYNDBG]; /* Dentries for the dynamic debugging entries. */ struct dentry *dyn_debug_dentries[__B43legacy_NR_DYNDBG]; }; diff -Nru ./drivers/net/wireless/b43legacy/dma.c ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/dma.c --- ./drivers/net/wireless/b43legacy/dma.c 2016-12-11 00:27:13.000000000 +0900 +++ ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/dma.c 2017-02-04 17:47:29.000000000 +0900 @@ -331,10 +331,9 @@ static int alloc_ringmemory(struct b43legacy_dmaring *ring) { /* GFP flags must match the flags in free_ringmemory()! */ - ring->descbase = dma_alloc_coherent(ring->dev->dev->dma_dev, - B43legacy_DMA_RINGMEMSIZE, - &(ring->dmabase), - GFP_KERNEL | __GFP_ZERO); + ring->descbase = dma_zalloc_coherent(ring->dev->dev->dma_dev, + B43legacy_DMA_RINGMEMSIZE, + &(ring->dmabase), GFP_KERNEL); if (!ring->descbase) return -ENOMEM; @@ -428,7 +427,7 @@ bool dma_to_device) { if (unlikely(dma_mapping_error(ring->dev->dev->dma_dev, addr))) - return 1; + return true; switch (ring->type) { case B43legacy_DMA_30BIT: @@ -442,13 +441,13 @@ } /* The address is OK. */ - return 0; + return false; address_error: /* We can't support this address. Unmap it again. */ unmap_descbuffer(ring, addr, buffersize, dma_to_device); - return 1; + return true; } static int setup_rx_descbuffer(struct b43legacy_dmaring *ring, @@ -807,12 +806,9 @@ /* Try to set the DMA mask. If it fails, try falling back to a * lower mask, as we can always also support a lower one. */ while (1) { - err = dma_set_mask(dev->dev->dma_dev, mask); - if (!err) { - err = dma_set_coherent_mask(dev->dev->dma_dev, mask); - if (!err) - break; - } + err = dma_set_mask_and_coherent(dev->dev->dma_dev, mask); + if (!err) + break; if (mask == DMA_BIT_MASK(64)) { mask = DMA_BIT_MASK(32); fallback = true; diff -Nru ./drivers/net/wireless/b43legacy/main.c ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/main.c --- ./drivers/net/wireless/b43legacy/main.c 2016-12-11 00:27:13.000000000 +0900 +++ ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/main.c 2017-02-04 17:47:29.000000000 +0900 @@ -86,7 +86,7 @@ static const struct ssb_device_id b43legacy_ssb_tbl[] = { SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 2), SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 4), - SSB_DEVTABLE_END + {}, }; MODULE_DEVICE_TABLE(ssb, b43legacy_ssb_tbl); @@ -978,7 +978,7 @@ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(dev->wl->current_beacon); bcn = (const struct ieee80211_mgmt *)(dev->wl->current_beacon->data); - len = min((size_t)dev->wl->current_beacon->len, + len = min_t(size_t, dev->wl->current_beacon->len, 0x200 - sizeof(struct b43legacy_plcp_hdr6)); rate = ieee80211_get_tx_rate(dev->wl->hw, info)->hw_value; @@ -1056,7 +1056,7 @@ b43legacy_generate_plcp_hdr(&plcp, size + FCS_LEN, rate->hw_value); dur = ieee80211_generic_frame_duration(dev->wl->hw, dev->wl->vif, - IEEE80211_BAND_2GHZ, + NL80211_BAND_2GHZ, size, rate); /* Write PLCP in two parts and timing for packet transfer */ @@ -1122,7 +1122,7 @@ IEEE80211_STYPE_PROBE_RESP); dur = ieee80211_generic_frame_duration(dev->wl->hw, dev->wl->vif, - IEEE80211_BAND_2GHZ, + NL80211_BAND_2GHZ, *dest_size, rate); hdr->duration_id = dur; @@ -1155,7 +1155,7 @@ b43legacy_write_probe_resp_plcp(dev, 0x350, size, &b43legacy_b_ratetable[3]); - size = min((size_t)size, + size = min_t(size_t, size, 0x200 - sizeof(struct b43legacy_plcp_hdr6)); b43legacy_write_template_common(dev, probe_resp_data, size, ram_offset, @@ -2055,8 +2055,6 @@ ctl |= B43legacy_MACCTL_KEEP_BAD; if (wl->filter_flags & FIF_PLCPFAIL) ctl |= B43legacy_MACCTL_KEEP_BADPLCP; - if (wl->filter_flags & FIF_PROMISC_IN_BSS) - ctl |= B43legacy_MACCTL_PROMISC; if (wl->filter_flags & FIF_BCN_PRBRESP_PROMISC) ctl |= B43legacy_MACCTL_BEACPROMISC; @@ -2721,7 +2719,7 @@ /* Switch the PHY mode (if necessary). */ switch (conf->chandef.chan->band) { - case IEEE80211_BAND_2GHZ: + case NL80211_BAND_2GHZ: if (phy->type == B43legacy_PHYTYPE_B) new_phymode = B43legacy_PHYMODE_B; else @@ -2794,7 +2792,7 @@ static void b43legacy_update_basic_rates(struct b43legacy_wldev *dev, u32 brates) { struct ieee80211_supported_band *sband = - dev->wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ]; + dev->wl->hw->wiphy->bands[NL80211_BAND_2GHZ]; struct ieee80211_rate *rate; int i; u16 basic, direct, offset, basic_offset, rateptr; @@ -2866,7 +2864,7 @@ if (conf->bssid) memcpy(wl->bssid, conf->bssid, ETH_ALEN); else - memset(wl->bssid, 0, ETH_ALEN); + eth_zero_addr(wl->bssid); } if (b43legacy_status(dev) >= B43legacy_STAT_INITIALIZED) { @@ -2922,16 +2920,14 @@ } spin_lock_irqsave(&wl->irq_lock, flags); - *fflags &= FIF_PROMISC_IN_BSS | - FIF_ALLMULTI | + *fflags &= FIF_ALLMULTI | FIF_FCSFAIL | FIF_PLCPFAIL | FIF_CONTROL | FIF_OTHER_BSS | FIF_BCN_PRBRESP_PROMISC; - changed &= FIF_PROMISC_IN_BSS | - FIF_ALLMULTI | + changed &= FIF_ALLMULTI | FIF_FCSFAIL | FIF_PLCPFAIL | FIF_CONTROL | @@ -3470,7 +3466,7 @@ spin_lock_irqsave(&wl->irq_lock, flags); b43legacy_adjust_opmode(dev); - memset(wl->mac_addr, 0, ETH_ALEN); + eth_zero_addr(wl->mac_addr); b43legacy_upload_card_macaddress(dev); spin_unlock_irqrestore(&wl->irq_lock, flags); @@ -3487,8 +3483,8 @@ /* Kill all old instance specific information to make sure * the card won't use it in the short timeframe between start * and mac80211 reconfiguring it. */ - memset(wl->bssid, 0, ETH_ALEN); - memset(wl->mac_addr, 0, ETH_ALEN); + eth_zero_addr(wl->bssid); + eth_zero_addr(wl->mac_addr); wl->filter_flags = 0; wl->beacon0_uploaded = false; wl->beacon1_uploaded = false; @@ -3634,13 +3630,13 @@ phy->possible_phymodes = 0; if (have_bphy) { - hw->wiphy->bands[IEEE80211_BAND_2GHZ] = + hw->wiphy->bands[NL80211_BAND_2GHZ] = &b43legacy_band_2GHz_BPHY; phy->possible_phymodes |= B43legacy_PHYMODE_B; } if (have_gphy) { - hw->wiphy->bands[IEEE80211_BAND_2GHZ] = + hw->wiphy->bands[NL80211_BAND_2GHZ] = &b43legacy_band_2GHz_GPHY; phy->possible_phymodes |= B43legacy_PHYMODE_G; } @@ -3836,8 +3832,9 @@ } /* fill hw info */ - hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | - IEEE80211_HW_SIGNAL_DBM; + ieee80211_hw_set(hw, RX_INCLUDES_FCS); + ieee80211_hw_set(hw, SIGNAL_DBM); + hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_STATION) | @@ -3919,6 +3916,7 @@ * as the ieee80211 unreg will destroy the workqueue. */ cancel_work_sync(&wldev->restart_work); cancel_work_sync(&wl->firmware_load); + complete(&wldev->fw_load_complete); B43legacy_WARN_ON(!wl); if (!wldev->fw.ucode) diff -Nru ./drivers/net/wireless/b43legacy/radio.c ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/radio.c --- ./drivers/net/wireless/b43legacy/radio.c 2016-12-11 00:27:13.000000000 +0900 +++ ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/radio.c 2017-02-04 17:47:29.000000000 +0900 @@ -1743,25 +1743,6 @@ return value; } -void b43legacy_radio_set_tx_iq(struct b43legacy_wldev *dev) -{ - static const u8 data_high[5] = { 0x00, 0x40, 0x80, 0x90, 0xD0 }; - static const u8 data_low[5] = { 0x00, 0x01, 0x05, 0x06, 0x0A }; - u16 tmp = b43legacy_radio_read16(dev, 0x001E); - int i; - int j; - - for (i = 0; i < 5; i++) { - for (j = 0; j < 5; j++) { - if (tmp == (data_high[i] | data_low[j])) { - b43legacy_phy_write(dev, 0x0069, (i - j) << 8 | - 0x00C0); - return; - } - } - } -} - int b43legacy_radio_selectchannel(struct b43legacy_wldev *dev, u8 channel, int synthetic_pu_workaround) diff -Nru ./drivers/net/wireless/b43legacy/radio.h ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/radio.h --- ./drivers/net/wireless/b43legacy/radio.h 2016-12-11 00:27:13.000000000 +0900 +++ ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/radio.h 2017-02-04 17:47:29.000000000 +0900 @@ -92,7 +92,6 @@ void b43legacy_nrssi_hw_update(struct b43legacy_wldev *dev, u16 val); void b43legacy_nrssi_mem_update(struct b43legacy_wldev *dev); -void b43legacy_radio_set_tx_iq(struct b43legacy_wldev *dev); u16 b43legacy_radio_calibrationvalue(struct b43legacy_wldev *dev); #endif /* B43legacy_RADIO_H_ */ diff -Nru ./drivers/net/wireless/b43legacy/rfkill.c ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/rfkill.c --- ./drivers/net/wireless/b43legacy/rfkill.c 2016-12-11 00:27:13.000000000 +0900 +++ ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/rfkill.c 2017-02-04 17:47:29.000000000 +0900 @@ -32,7 +32,7 @@ if (dev->dev->id.revision >= 3) { if (!(b43legacy_read32(dev, B43legacy_MMIO_RADIO_HWENABLED_HI) & B43legacy_MMIO_RADIO_HWENABLED_HI_MASK)) - return 1; + return true; } else { /* To prevent CPU fault on PPC, do not read a register * unless the interface is started; however, on resume @@ -40,12 +40,12 @@ * that happens, unconditionally return TRUE. */ if (b43legacy_status(dev) < B43legacy_STAT_STARTED) - return 1; + return true; if (b43legacy_read16(dev, B43legacy_MMIO_RADIO_HWENABLED_LO) & B43legacy_MMIO_RADIO_HWENABLED_LO_MASK) - return 1; + return true; } - return 0; + return false; } /* The poll callback for the hardware button. */ diff -Nru ./drivers/net/wireless/b43legacy/sysfs.c ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/sysfs.c --- ./drivers/net/wireless/b43legacy/sysfs.c 2016-12-11 00:27:13.000000000 +0900 +++ ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/sysfs.c 2017-02-04 17:47:29.000000000 +0900 @@ -42,7 +42,7 @@ if (count == 0) goto out; - count = min(count, (size_t)10); + count = min_t(size_t, count, 10); memcpy(tmp, buf, count); ret = simple_strtol(tmp, NULL, 10); out: diff -Nru ./drivers/net/wireless/b43legacy/xmit.c ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/xmit.c --- ./drivers/net/wireless/b43legacy/xmit.c 2016-12-11 00:27:13.000000000 +0900 +++ ../../../linux-4.9.8/drivers/net/wireless/broadcom/b43legacy/xmit.c 2017-02-04 17:47:29.000000000 +0900 @@ -215,7 +215,7 @@ rate_fb_ofdm = b43legacy_is_ofdm_rate(rate_fb->hw_value); txhdr->mac_frame_ctl = wlhdr->frame_control; - memcpy(txhdr->tx_receiver, wlhdr->addr1, 6); + memcpy(txhdr->tx_receiver, wlhdr->addr1, ETH_ALEN); /* Calculate duration for fallback rate */ if ((rate_fb->hw_value == rate) || @@ -254,7 +254,7 @@ B43legacy_TX4_MAC_KEYALG_SHIFT) & B43legacy_TX4_MAC_KEYALG; wlhdr_len = ieee80211_hdrlen(wlhdr->frame_control); - iv_len = min((size_t)info->control.hw_key->iv_len, + iv_len = min_t(size_t, info->control.hw_key->iv_len, ARRAY_SIZE(txhdr->iv)); memcpy(txhdr->iv, ((u8 *)wlhdr) + wlhdr_len, iv_len); } else { @@ -565,7 +565,7 @@ switch (chanstat & B43legacy_RX_CHAN_PHYTYPE) { case B43legacy_PHYTYPE_B: case B43legacy_PHYTYPE_G: - status.band = IEEE80211_BAND_2GHZ; + status.band = NL80211_BAND_2GHZ; status.freq = chanid + 2400; break; default: