Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
"Here is a set of staging driver updates for 6.5-rc1. It's a small
update this merge window, nothing major at all, overall just under
1000 lines of code removed, not a huge churn.

Nothing major to highlight here either, just lots of small coding
style fixes.

All of these have been in linux-next for a while with no reported
problems"

* tag 'staging-6.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (62 commits)
staging: rtl8192e: Remove whitespace and blank lines
staging: rtl8192e: remove 5G related code
staging: rtl8192e: remove comparison to true
staging: rtl8192e: remove return statement from void function
staging: rtl8192e: convert else if sequence to switch
staging: rtl8192e: clean up brace coding style issues
staging: rtl8723bs: Fix blank line issues
staging: rtl8723bs: Fix block comment issue
staging: rtl8723bs: Fix indentation issues
staging: vchiq_arm: Remove extra struct vchiq_instance declaration
staging: rtl8192e: Rename variable InitialGainHandler
staging: rtl8192e: Rename variable LeisurePSLeave
staging: rtl8192e: Rename variable SetBWModeHandler
staging: rtl8192e: Rename variable SetWirelessMode
staging: rtl8192e: Rename RTLLIB_LINKED_SCANNING
staging: rtl8192e: Rename RTLLIB_LINKED to MAC80211_LINKED
staging: rtl8192e: Rename RTLLIB_NOLINK to MAC80211_NOLINK
staging: rtl8192e: Rename state to link_state
staging: rtl8192e: Rename rtllib_state to rtl_link_state
staging: rtl8192e: Remove unused enum led_ctl_mode
...

+445 -1427
-3
drivers/staging/axis-fifo/axis-fifo.c
··· 906 906 if (rc < 0) 907 907 goto err_initial; 908 908 909 - dev_info(fifo->dt_device, "axis-fifo created at %pa mapped to 0x%pa, irq=%i\n", 910 - &r_mem->start, &fifo->base_addr, fifo->irq); 911 - 912 909 return 0; 913 910 914 911 err_initial:
+1 -1
drivers/staging/most/i2c/i2c.c
··· 362 362 .driver = { 363 363 .name = "hdm_i2c", 364 364 }, 365 - .probe_new = i2c_probe, 365 + .probe = i2c_probe, 366 366 .remove = i2c_remove, 367 367 .id_table = i2c_id, 368 368 };
+1 -1
drivers/staging/olpc_dcon/olpc_dcon.c
··· 779 779 }, 780 780 .class = I2C_CLASS_DDC | I2C_CLASS_HWMON, 781 781 .id_table = dcon_idtable, 782 - .probe_new = dcon_probe, 782 + .probe = dcon_probe, 783 783 .remove = dcon_remove, 784 784 .detect = dcon_detect, 785 785 .address_list = normal_i2c,
-1
drivers/staging/pi433/pi433_if.c
··· 1019 1019 } 1020 1020 1021 1021 /* configure the pin */ 1022 - gpiod_unexport(device->gpiod[i]); 1023 1022 retval = gpiod_direction_input(device->gpiod[i]); 1024 1023 if (retval) 1025 1024 return retval;
+1
drivers/staging/rtl8192e/rtl8192e/Kconfig
··· 3 3 tristate "RealTek RTL8192E Wireless LAN NIC driver" 4 4 depends on PCI && WLAN && RTLLIB 5 5 depends on m 6 + select CFG80211 6 7 select WIRELESS_EXT 7 8 select WEXT_PRIV 8 9 select CRYPTO
-8
drivers/staging/rtl8192e/rtl8192e/r8190P_def.h
··· 85 85 #define HAL_PRIME_CHNL_OFFSET_LOWER 1 86 86 #define HAL_PRIME_CHNL_OFFSET_UPPER 2 87 87 88 - 89 88 enum version_8190_loopback { 90 89 VERSION_8190_BD = 0x3, 91 90 VERSION_8190_BE ··· 138 139 u32 Retry_Limit:4; 139 140 u32 Reserved2:1; 140 141 u32 PacketID:13; 141 - 142 - 143 142 }; 144 143 145 144 struct phy_ofdm_rx_status_rxsc_sgien_exintfflag { ··· 168 171 u8 sq_rpt; 169 172 u8 cck_agc_rpt; 170 173 }; 171 - 172 174 173 175 #define PHY_RSSI_SLID_WIN_MAX 100 174 176 #define PHY_Beacon_RSSI_SLID_WIN_MAX 10 ··· 210 214 u32 Reserved7; 211 215 }; 212 216 213 - 214 217 struct tx_desc_cmd { 215 218 u16 PktSize; 216 219 u8 Reserved1; ··· 251 256 u32 Reserved3; 252 257 253 258 u32 BufferAddress; 254 - 255 259 }; 256 - 257 260 258 261 struct rx_fwinfo { 259 262 u16 Reserved1:12; ··· 271 278 u8 Reserved4:1; 272 279 273 280 u32 TSFL; 274 - 275 281 }; 276 282 277 283 #endif
+3 -3
drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
··· 73 73 break; 74 74 case RF90_PATH_B: 75 75 u4RegValue = rtl92e_get_bb_reg(dev, pPhyReg->rfintfs, 76 - bRFSI_RFENV<<16); 76 + bRFSI_RFENV << 16); 77 77 break; 78 78 } 79 79 80 - rtl92e_set_bb_reg(dev, pPhyReg->rfintfe, bRFSI_RFENV<<16, 0x1); 80 + rtl92e_set_bb_reg(dev, pPhyReg->rfintfe, bRFSI_RFENV << 16, 0x1); 81 81 82 82 rtl92e_set_bb_reg(dev, pPhyReg->rfintfo, bRFSI_RFENV, 0x1); 83 83 ··· 117 117 break; 118 118 case RF90_PATH_B: 119 119 rtl92e_set_bb_reg(dev, pPhyReg->rfintfs, 120 - bRFSI_RFENV<<16, u4RegValue); 120 + bRFSI_RFENV << 16, u4RegValue); 121 121 break; 122 122 } 123 123
+38 -59
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
··· 36 36 37 37 rtl92e_writeb(dev, BCN_ERR_THRESH, 100); 38 38 39 - BcnTimeCfg |= BcnCW<<BCN_TCFG_CW_SHIFT; 40 - BcnTimeCfg |= BcnIFS<<BCN_TCFG_IFS; 39 + BcnTimeCfg |= BcnCW << BCN_TCFG_CW_SHIFT; 40 + BcnTimeCfg |= BcnIFS << BCN_TCFG_IFS; 41 41 rtl92e_writew(dev, BCN_TCFG, BcnTimeCfg); 42 42 rtl92e_irq_enable(dev); 43 43 } ··· 46 46 { 47 47 struct r8192_priv *priv = rtllib_priv(dev); 48 48 u8 msr; 49 - enum led_ctl_mode LedAction = LED_CTL_NO_LINK; 50 49 51 50 msr = rtl92e_readb(dev, MSR); 52 51 msr &= ~MSR_LINK_MASK; 53 52 54 53 switch (priv->rtllib->iw_mode) { 55 54 case IW_MODE_INFRA: 56 - if (priv->rtllib->state == RTLLIB_LINKED) 55 + if (priv->rtllib->link_state == MAC80211_LINKED) 57 56 msr |= MSR_LINK_MANAGED; 58 - LedAction = LED_CTL_LINK; 59 57 break; 60 58 case IW_MODE_ADHOC: 61 - if (priv->rtllib->state == RTLLIB_LINKED) 59 + if (priv->rtllib->link_state == MAC80211_LINKED) 62 60 msr |= MSR_LINK_ADHOC; 63 61 break; 64 62 case IW_MODE_MASTER: 65 - if (priv->rtllib->state == RTLLIB_LINKED) 63 + if (priv->rtllib->link_state == MAC80211_LINKED) 66 64 msr |= MSR_LINK_MASTER; 67 65 break; 68 66 default: ··· 68 70 } 69 71 70 72 rtl92e_writeb(dev, MSR, msr); 71 - if (priv->rtllib->LedControlHandler) 72 - priv->rtllib->LedControlHandler(dev, LedAction); 73 73 } 74 74 75 75 void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val) ··· 107 111 } 108 112 109 113 rtl92e_writeb(dev, MSR, btMsr); 110 - 111 114 } 112 115 break; 113 116 ··· 125 130 126 131 rtl92e_writel(dev, RCR, RegRCR); 127 132 priv->receive_config = RegRCR; 128 - 129 133 } 130 134 break; 131 135 ··· 162 168 &priv->rtllib->current_network.qos_data.parameters; 163 169 164 170 u1bAIFS = qop->aifs[pAcParam] * 165 - ((mode&(IEEE_G|IEEE_N_24G)) ? 9 : 20) + aSifsTime; 171 + ((mode & (WIRELESS_MODE_G | WIRELESS_MODE_N_24G)) ? 9 : 20) + aSifsTime; 166 172 167 173 rtl92e_dm_init_edca_turbo(dev); 168 174 ··· 250 256 251 257 case HW_VAR_SIFS: 252 258 rtl92e_writeb(dev, SIFS, val[0]); 253 - rtl92e_writeb(dev, SIFS+1, val[0]); 259 + rtl92e_writeb(dev, SIFS + 1, val[0]); 254 260 break; 255 261 256 262 case HW_VAR_RF_TIMING: ··· 264 270 default: 265 271 break; 266 272 } 267 - 268 273 } 269 274 270 275 static void _rtl92e_read_eeprom_info(struct net_device *dev) ··· 292 299 (EEPROM_Customer_ID >> 1)) >> 8; 293 300 priv->eeprom_customer_id = usValue & 0xff; 294 301 usValue = rtl92e_eeprom_read(dev, 295 - EEPROM_ICVersion_ChannelPlan>>1); 296 - priv->eeprom_chnl_plan = usValue&0xff; 297 - IC_Version = (usValue & 0xff00)>>8; 302 + EEPROM_ICVersion_ChannelPlan >> 1); 303 + priv->eeprom_chnl_plan = usValue & 0xff; 304 + IC_Version = (usValue & 0xff00) >> 8; 298 305 299 306 ICVer8192 = IC_Version & 0xf; 300 - ICVer8256 = (IC_Version & 0xf0)>>4; 307 + ICVer8256 = (IC_Version & 0xf0) >> 4; 301 308 if (ICVer8192 == 0x2) { 302 309 if (ICVer8256 == 0x5) 303 310 priv->card_8192_version = VERSION_8190_BE; ··· 347 354 348 355 if (!priv->autoload_fail_flag) 349 356 priv->eeprom_thermal_meter = ((rtl92e_eeprom_read(dev, 350 - (EEPROM_ThermalMeter>>1))) & 357 + (EEPROM_ThermalMeter >> 1))) & 351 358 0xff00) >> 8; 352 359 else 353 360 priv->eeprom_thermal_meter = EEPROM_Default_ThermalMeter; ··· 589 596 RSVD_FW_QUEUE_PAGE_MGNT_SHIFT); 590 597 rtl92e_writel(dev, RQPN3, APPLIED_RESERVED_QUEUE_IN_FW | 591 598 NUM_OF_PAGE_IN_FW_QUEUE_BCN << 592 - RSVD_FW_QUEUE_PAGE_BCN_SHIFT| 599 + RSVD_FW_QUEUE_PAGE_BCN_SHIFT | 593 600 NUM_OF_PAGE_IN_FW_QUEUE_PUB << 594 601 RSVD_FW_QUEUE_PAGE_PUB_SHIFT); 595 602 ··· 598 605 ulRegRead = (0xFFF00000 & rtl92e_readl(dev, RRSR)) | 599 606 RATE_ALL_OFDM_AG | RATE_ALL_CCK; 600 607 rtl92e_writel(dev, RRSR, ulRegRead); 601 - rtl92e_writel(dev, RATR0+4*7, (RATE_ALL_OFDM_AG | RATE_ALL_CCK)); 608 + rtl92e_writel(dev, RATR0 + 4 * 7, (RATE_ALL_OFDM_AG | RATE_ALL_CCK)); 602 609 603 610 rtl92e_writeb(dev, ACK_TIMEOUT, 0x30); 604 611 ··· 711 718 712 719 static void _rtl92e_net_update(struct net_device *dev) 713 720 { 714 - 715 721 struct r8192_priv *priv = rtllib_priv(dev); 716 722 struct rtllib_network *net; 717 723 u16 BcnTimeCfg = 0, BcnCW = 6, BcnIFS = 0xf; ··· 730 738 rtl92e_writew(dev, BCN_DRV_EARLY_INT, 10); 731 739 rtl92e_writeb(dev, BCN_ERR_THRESH, 100); 732 740 733 - BcnTimeCfg |= (BcnCW<<BCN_TCFG_CW_SHIFT); 734 - BcnTimeCfg |= BcnIFS<<BCN_TCFG_IFS; 741 + BcnTimeCfg |= (BcnCW << BCN_TCFG_CW_SHIFT); 742 + BcnTimeCfg |= BcnIFS << BCN_TCFG_IFS; 735 743 736 744 rtl92e_writew(dev, BCN_TCFG, BcnTimeCfg); 737 745 } ··· 745 753 if (!priv->up) 746 754 return; 747 755 748 - if (ieee->state == RTLLIB_LINKED) { 756 + if (ieee->link_state == MAC80211_LINKED) { 749 757 _rtl92e_net_update(dev); 750 758 rtl92e_update_ratr_table(dev); 751 759 if ((ieee->pairwise_key_type == KEY_TYPE_WEP40) || ··· 760 768 u32 reg; 761 769 762 770 reg = rtl92e_readl(dev, RCR); 763 - if (priv->rtllib->state == RTLLIB_LINKED) { 771 + if (priv->rtllib->link_state == MAC80211_LINKED) { 764 772 if (ieee->intel_promiscuous_md_info.promiscuous_on) 765 773 ; 766 774 else 767 775 priv->receive_config = reg |= RCR_CBSSID; 768 - } else 776 + } else { 769 777 priv->receive_config = reg &= ~RCR_CBSSID; 778 + } 770 779 771 780 rtl92e_writel(dev, RCR, reg); 772 781 } ··· 876 883 case MGN_MCS15: 877 884 ret = DESC90_RATEMCS15; 878 885 break; 879 - case (0x80|0x20): 886 + case (0x80 | 0x20): 880 887 ret = DESC90_RATEMCS32; 881 888 break; 882 889 default: ··· 966 973 pTxFwInfo->RtsEnable = (cb_desc->bRTSEnable) ? 1 : 0; 967 974 pTxFwInfo->CtsEnable = (cb_desc->bCTSEnable) ? 1 : 0; 968 975 pTxFwInfo->RtsSTBC = (cb_desc->bRTSSTBC) ? 1 : 0; 969 - pTxFwInfo->RtsHT = (cb_desc->rts_rate&0x80) ? 1 : 0; 976 + pTxFwInfo->RtsHT = (cb_desc->rts_rate & 0x80) ? 1 : 0; 970 977 pTxFwInfo->RtsRate = _rtl92e_rate_mgn_to_hw(cb_desc->rts_rate); 971 978 pTxFwInfo->RtsBandwidth = 0; 972 979 pTxFwInfo->RtsSubcarrier = cb_desc->RTSSC; ··· 1001 1008 pdesc->PktSize = skb->len - sizeof(struct tx_fwinfo_8190pci); 1002 1009 1003 1010 pdesc->SecCAMID = 0; 1004 - pdesc->RATid = cb_desc->RATRIndex; 1005 - 1011 + pdesc->RATid = cb_desc->ratr_index; 1006 1012 1007 1013 pdesc->NoEnc = 1; 1008 1014 pdesc->SecType = 0x0; ··· 1209 1217 return retsig; 1210 1218 } 1211 1219 1212 - 1213 1220 #define rx_hal_is_cck_rate(_pdrvinfo)\ 1214 1221 ((_pdrvinfo->RxRate == DESC90_RATE1M ||\ 1215 1222 _pdrvinfo->RxRate == DESC90_RATE2M ||\ ··· 1255 1264 0x200); 1256 1265 check_reg824 = 1; 1257 1266 } 1258 - 1259 1267 1260 1268 prxpkt = (u8 *)pdrvinfo; 1261 1269 ··· 1335 1345 else if (pcck_buf->sq_rpt < 20) 1336 1346 sq = 100; 1337 1347 else 1338 - sq = ((64-sq) * 100) / 44; 1348 + sq = ((64 - sq) * 100) / 44; 1339 1349 } 1340 1350 pstats->SignalQuality = sq; 1341 1351 precord_stats->SignalQuality = sq; ··· 1361 1371 precord_stats->RxMIMOSignalStrength[i] = RSSI; 1362 1372 } 1363 1373 } 1364 - 1365 1374 1366 1375 rx_pwr_all = (((pofdm_buf->pwdb_all) >> 1) & 0x7f) - 106; 1367 1376 pwdb_all = rtl92e_rx_db_to_percent(rx_pwr_all); ··· 1441 1452 if (slide_rssi_index >= PHY_RSSI_SLID_WIN_MAX) 1442 1453 slide_rssi_index = 0; 1443 1454 1444 - tmp_val = priv->stats.slide_rssi_total/slide_rssi_statistics; 1455 + tmp_val = priv->stats.slide_rssi_total / slide_rssi_statistics; 1445 1456 priv->stats.signal_strength = rtl92e_translate_to_dbm(priv, tmp_val); 1446 1457 curr_st->rssi = priv->stats.signal_strength; 1447 1458 if (!prev_st->bPacketMatchBSSID) { ··· 1471 1482 } else { 1472 1483 priv->stats.rx_rssi_percentage[rfpath] = 1473 1484 ((priv->stats.rx_rssi_percentage[rfpath] * 1474 - (RX_SMOOTH-1)) + 1485 + (RX_SMOOTH - 1)) + 1475 1486 (prev_st->RxMIMOSignalStrength[rfpath])) / 1476 1487 (RX_SMOOTH); 1477 1488 } 1478 1489 } 1479 1490 } 1480 - 1481 1491 1482 1492 if (prev_st->bPacketBeacon) { 1483 1493 if (slide_beacon_adc_pwdb_statistics++ >= ··· 1505 1517 if (prev_st->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb) { 1506 1518 priv->undecorated_smoothed_pwdb = 1507 1519 (((priv->undecorated_smoothed_pwdb) * 1508 - (RX_SMOOTH-1)) + 1520 + (RX_SMOOTH - 1)) + 1509 1521 (prev_st->RxPWDBAll)) / (RX_SMOOTH); 1510 1522 priv->undecorated_smoothed_pwdb = 1511 1523 priv->undecorated_smoothed_pwdb + 1; 1512 1524 } else { 1513 1525 priv->undecorated_smoothed_pwdb = 1514 1526 (((priv->undecorated_smoothed_pwdb) * 1515 - (RX_SMOOTH-1)) + 1527 + (RX_SMOOTH - 1)) + 1516 1528 (prev_st->RxPWDBAll)) / (RX_SMOOTH); 1517 1529 } 1518 1530 rtl92e_update_rx_statistics(priv, prev_st); ··· 1741 1753 (pDrvInfo->FirstAGGR == 1); 1742 1754 1743 1755 stats->TimeStampLow = pDrvInfo->TSFL; 1744 - stats->TimeStampHigh = rtl92e_readl(dev, TSFR+4); 1756 + stats->TimeStampHigh = rtl92e_readl(dev, TSFR + 4); 1745 1757 1746 1758 rtl92e_update_rx_pkt_timestamp(dev, stats); 1747 1759 ··· 1754 1766 skb_trim(skb, skb->len - S_CRC_LEN); 1755 1767 1756 1768 1757 - stats->packetlength = stats->Length-4; 1769 + stats->packetlength = stats->Length - 4; 1758 1770 stats->fraglength = stats->packetlength; 1759 1771 stats->fragoffset = 0; 1760 1772 stats->ntotalfrag = 1; ··· 1794 1806 rtl92e_writel(dev, WFCRC1, 0xffffffff); 1795 1807 rtl92e_writel(dev, WFCRC2, 0xffffffff); 1796 1808 1797 - 1798 1809 rtl92e_writeb(dev, PMR, 0x5); 1799 1810 rtl92e_writeb(dev, MAC_BLK_CTRL, 0xa); 1800 1811 } ··· 1817 1830 rtl92e_config_rate(dev, &rate_config); 1818 1831 ratr_value = rate_config | *pMcsRate << 12; 1819 1832 switch (ieee->mode) { 1820 - case IEEE_A: 1821 - ratr_value &= 0x00000FF0; 1822 - break; 1823 - case IEEE_B: 1833 + case WIRELESS_MODE_B: 1824 1834 ratr_value &= 0x0000000F; 1825 1835 break; 1826 - case IEEE_G: 1827 - case IEEE_G|IEEE_B: 1836 + case WIRELESS_MODE_G: 1837 + case WIRELESS_MODE_G | WIRELESS_MODE_B: 1828 1838 ratr_value &= 0x00000FF7; 1829 1839 break; 1830 - case IEEE_N_24G: 1831 - case IEEE_N_5G: 1840 + case WIRELESS_MODE_N_24G: 1832 1841 if (ieee->ht_info->peer_mimo_ps == 0) 1833 1842 ratr_value &= 0x0007F007; 1834 1843 else ··· 1840 1857 else if (!ieee->ht_info->cur_tx_bw40mhz && 1841 1858 ieee->ht_info->bCurShortGI20MHz) 1842 1859 ratr_value |= 0x80000000; 1843 - rtl92e_writel(dev, RATR0+rate_index*4, ratr_value); 1860 + rtl92e_writel(dev, RATR0 + rate_index * 4, ratr_value); 1844 1861 rtl92e_writeb(dev, UFWP, 1); 1845 1862 } 1846 1863 ··· 1864 1881 RCR_AMF | RCR_ADF | 1865 1882 RCR_AICV | 1866 1883 RCR_AB | RCR_AM | RCR_APM | 1867 - RCR_AAP | ((u32)7<<RCR_MXDMA_OFFSET) | 1884 + RCR_AAP | ((u32)7 << RCR_MXDMA_OFFSET) | 1868 1885 ((u32)7 << RCR_FIFO_OFFSET) | RCR_ONLYERLPKT; 1869 1886 1870 1887 priv->irq_mask[0] = (u32)(IMR_ROK | IMR_VODOK | IMR_VIDOK | ··· 1884 1901 priv->irq_enabled = 1; 1885 1902 1886 1903 rtl92e_writel(dev, INTA_MASK, priv->irq_mask[0]); 1887 - 1888 1904 } 1889 1905 1890 1906 void rtl92e_disable_irq(struct net_device *dev) ··· 1914 1932 for (i = 0; i < MAX_TX_QUEUE_COUNT; i++) 1915 1933 rtl92e_writel(dev, TX_DESC_BASE[i], priv->tx_ring[i].dma); 1916 1934 } 1917 - 1918 1935 1919 1936 void rtl92e_ack_irq(struct net_device *dev, u32 *p_inta, u32 *p_intb) 1920 1937 { ··· 1957 1976 } 1958 1977 1959 1978 1960 - SlotIndex = (priv->silent_reset_rx_slot_index++)%SilentResetRxSoltNum; 1979 + SlotIndex = (priv->silent_reset_rx_slot_index++) % SilentResetRxSoltNum; 1961 1980 1962 1981 if (priv->rx_ctr == RegRxCounter) { 1963 1982 priv->silent_reset_rx_stuck_event[SlotIndex] = 1; ··· 1971 1990 TotalRxStuckCount += 1972 1991 priv->silent_reset_rx_stuck_event[i]; 1973 1992 } 1974 - 1975 - 1976 1993 } else { 1977 1994 priv->silent_reset_rx_stuck_event[SlotIndex] = 0; 1978 1995 } ··· 2000 2021 struct rtllib_device *ieee = priv->rtllib; 2001 2022 2002 2023 if (ieee->rtllib_ap_sec_type && 2003 - (ieee->rtllib_ap_sec_type(priv->rtllib)&(SEC_ALG_WEP | 2024 + (ieee->rtllib_ap_sec_type(priv->rtllib) & (SEC_ALG_WEP | 2004 2025 SEC_ALG_TKIP))) { 2005 2026 return false; 2006 2027 } else {
-1
drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
··· 159 159 WFCRC2 = 0x2f8, 160 160 161 161 BW_OPMODE = 0x300, 162 - #define BW_OPMODE_5G BIT1 163 162 #define BW_OPMODE_20MHZ BIT2 164 163 IC_VERRSION = 0x301, 165 164 MSR = 0x303,
+21 -41
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
··· 32 32 void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask, 33 33 u32 dwData) 34 34 { 35 - 36 35 u32 OriginalValue, BitShift, NewValue; 37 36 38 37 if (dwBitMask != bMaskDWord) { ··· 39 40 BitShift = _rtl92e_calculate_bit_shift(dwBitMask); 40 41 NewValue = (OriginalValue & ~dwBitMask) | (dwData << BitShift); 41 42 rtl92e_writel(dev, dwRegAddr, NewValue); 42 - } else 43 + } else { 43 44 rtl92e_writel(dev, dwRegAddr, dwData); 45 + } 44 46 } 45 47 46 48 u32 rtl92e_get_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask) ··· 99 99 rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter4, 0x300, 0x3); 100 100 101 101 return ret; 102 - 103 102 } 104 103 105 104 static void _rtl92e_phy_rf_write(struct net_device *dev, ··· 164 165 165 166 _rtl92e_phy_rf_fw_write(dev, eRFPath, RegAddr, 166 167 New_Value); 167 - } else 168 + } else { 168 169 _rtl92e_phy_rf_fw_write(dev, eRFPath, RegAddr, Data); 170 + } 169 171 udelay(200); 170 - 171 172 } else { 172 173 if (BitMask != bMask12Bits) { 173 174 Original_Value = _rtl92e_phy_rf_read(dev, eRFPath, ··· 176 177 New_Value = (Original_Value & ~BitMask) | (Data << BitShift); 177 178 178 179 _rtl92e_phy_rf_write(dev, eRFPath, RegAddr, New_Value); 179 - } else 180 + } else { 180 181 _rtl92e_phy_rf_write(dev, eRFPath, RegAddr, Data); 182 + } 181 183 } 182 184 } 183 185 ··· 226 226 return 0; 227 227 } 228 228 return rtl92e_readl(dev, RF_DATA); 229 - 230 229 } 231 230 232 231 static void _rtl92e_phy_rf_fw_write(struct net_device *dev, ··· 246 247 break; 247 248 } 248 249 rtl92e_writel(dev, QPNR, Data); 249 - 250 250 } 251 - 252 251 253 252 void rtl92e_config_mac(struct net_device *dev) 254 253 { ··· 264 267 } 265 268 for (i = 0; i < dwArrayLen; i += 3) { 266 269 if (pdwArray[i] == 0x318) 267 - pdwArray[i+2] = 0x00000800; 268 - rtl92e_set_bb_reg(dev, pdwArray[i], pdwArray[i+1], 269 - pdwArray[i+2]); 270 + pdwArray[i + 2] = 0x00000800; 271 + rtl92e_set_bb_reg(dev, pdwArray[i], pdwArray[i + 1], 272 + pdwArray[i + 2]); 270 273 } 271 - return; 272 - 273 274 } 274 275 275 276 static void _rtl92e_phy_config_bb(struct net_device *dev, u8 ConfigType) ··· 286 291 for (i = 0; i < PHY_REGArrayLen; i += 2) { 287 292 rtl92e_set_bb_reg(dev, Rtl819XPHY_REGArray_Table[i], 288 293 bMaskDWord, 289 - Rtl819XPHY_REGArray_Table[i+1]); 294 + Rtl819XPHY_REGArray_Table[i + 1]); 290 295 } 291 296 } else if (ConfigType == BB_CONFIG_AGC_TAB) { 292 297 for (i = 0; i < AGCTAB_ArrayLen; i += 2) { 293 298 rtl92e_set_bb_reg(dev, Rtl819XAGCTAB_Array_Table[i], 294 299 bMaskDWord, 295 - Rtl819XAGCTAB_Array_Table[i+1]); 300 + Rtl819XAGCTAB_Array_Table[i + 1]); 296 301 } 297 302 } 298 303 } ··· 365 370 break; 366 371 } 367 372 368 - 369 373 if (dwRegRead != WriteData[i]) { 370 374 netdev_warn(dev, "%s(): Check failed.\n", __func__); 371 375 ret = false; ··· 383 389 u32 dwRegValue = 0; 384 390 385 391 bRegValue = rtl92e_readb(dev, BB_GLOBAL_RESET); 386 - rtl92e_writeb(dev, BB_GLOBAL_RESET, (bRegValue|BB_GLOBAL_RESET_BIT)); 392 + rtl92e_writeb(dev, BB_GLOBAL_RESET, (bRegValue | BB_GLOBAL_RESET_BIT)); 387 393 388 394 dwRegValue = rtl92e_readl(dev, CPU_GEN); 389 - rtl92e_writel(dev, CPU_GEN, (dwRegValue&(~CPU_GEN_BB_RST))); 395 + rtl92e_writel(dev, CPU_GEN, (dwRegValue & (~CPU_GEN_BB_RST))); 390 396 391 397 for (eCheckItem = (enum hw90_block)HW90_BLOCK_PHY0; 392 398 eCheckItem <= HW90_BLOCK_PHY1; eCheckItem++) { ··· 396 402 if (!rtStatus) 397 403 return rtStatus; 398 404 } 399 - rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn|bOFDMEn, 0x0); 405 + rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn | bOFDMEn, 0x0); 400 406 _rtl92e_phy_config_bb(dev, BB_CONFIG_PHY_REG); 401 407 402 408 dwRegValue = rtl92e_readl(dev, CPU_GEN); 403 - rtl92e_writel(dev, CPU_GEN, (dwRegValue|CPU_GEN_BB_RST)); 409 + rtl92e_writel(dev, CPU_GEN, (dwRegValue | CPU_GEN_BB_RST)); 404 410 405 411 _rtl92e_phy_config_bb(dev, BB_CONFIG_AGC_TAB); 406 412 407 413 if (priv->ic_cut > VERSION_8190_BD) { 408 414 dwRegValue = 0x0; 409 415 rtl92e_set_bb_reg(dev, rFPGA0_TxGainStage, 410 - (bXBTxAGC|bXCTxAGC|bXDTxAGC), dwRegValue); 411 - 416 + (bXBTxAGC | bXCTxAGC | bXDTxAGC), dwRegValue); 412 417 413 418 dwRegValue = priv->crystal_cap; 414 419 rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, bXtalCap92x, ··· 463 470 464 471 u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath) 465 472 { 466 - 467 473 int i; 468 474 469 475 switch (eRFPath) { ··· 475 483 rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIO_A_ARR[i], 476 484 bMask12Bits, 477 485 RTL8192E_RADIO_A_ARR[i + 1]); 478 - 479 486 } 480 487 break; 481 488 case RF90_PATH_B: ··· 486 495 rtl92e_set_rf_reg(dev, eRFPath, RTL8192E_RADIO_B_ARR[i], 487 496 bMask12Bits, 488 497 RTL8192E_RADIO_B_ARR[i + 1]); 489 - 490 498 } 491 499 break; 492 500 default: ··· 493 503 } 494 504 495 505 return 0; 496 - 497 506 } 498 507 499 508 static void _rtl92e_set_tx_power_level(struct net_device *dev, u8 channel) ··· 634 645 rtl92e_set_rf_reg(dev, 635 646 (enum rf90_radio_path)eRFPath, 636 647 CurrentCmd->Para1, bMask12Bits, 637 - CurrentCmd->Para2<<7); 648 + CurrentCmd->Para2 << 7); 638 649 break; 639 650 default: 640 651 break; ··· 666 677 667 678 static void _rtl92e_phy_switch_channel_work_item(struct net_device *dev) 668 679 { 669 - 670 680 struct r8192_priv *priv = rtllib_priv(dev); 671 681 672 682 _rtl92e_phy_switch_channel(dev, priv->chan); ··· 681 693 } 682 694 if (priv->sw_chnl_in_progress) 683 695 return false; 684 - 685 696 686 697 switch (priv->rtllib->mode) { 687 698 case WIRELESS_MODE_B: ··· 811 824 812 825 static void _rtl92e_set_bw_mode_work_item(struct net_device *dev) 813 826 { 814 - 815 827 struct r8192_priv *priv = rtllib_priv(dev); 816 828 u8 regBwOpMode; 817 829 ··· 866 880 } 867 881 868 882 rtl92e_set_bb_reg(dev, rCCK0_System, bCCKSideBand, 869 - (priv->n_cur_40mhz_prime_sc>>1)); 883 + (priv->n_cur_40mhz_prime_sc >> 1)); 870 884 rtl92e_set_bb_reg(dev, rOFDM1_LSTF, 0xC00, 871 885 priv->n_cur_40mhz_prime_sc); 872 886 ··· 876 890 netdev_err(dev, "%s(): unknown Bandwidth: %#X\n", __func__, 877 891 priv->current_chnl_bw); 878 892 break; 879 - 880 893 } 881 894 882 895 rtl92e_set_bandwidth(dev, priv->current_chnl_bw); ··· 888 903 enum ht_extchnl_offset Offset) 889 904 { 890 905 struct r8192_priv *priv = rtllib_priv(dev); 891 - 892 906 893 907 if (priv->set_bw_mode_in_progress) 894 908 return; ··· 905 921 priv->n_cur_40mhz_prime_sc = HAL_PRIME_CHNL_OFFSET_DONT_CARE; 906 922 907 923 _rtl92e_set_bw_mode_work_item(dev); 908 - 909 924 } 910 925 911 926 void rtl92e_init_gain(struct net_device *dev, u8 Operation) ··· 976 993 977 994 void rtl92e_set_rf_off(struct net_device *dev) 978 995 { 979 - 980 996 rtl92e_set_bb_reg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x0); 981 997 rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter4, 0x300, 0x0); 982 998 rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, 0x18, 0x0); ··· 984 1002 rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, 0x60, 0x0); 985 1003 rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, 0x4, 0x0); 986 1004 rtl92e_writeb(dev, ANAPAR_FOR_8192PCIE, 0x07); 987 - 988 1005 } 989 1006 990 1007 static bool _rtl92e_set_rf_power_state(struct net_device *dev, ··· 1080 1099 break; 1081 1100 } 1082 1101 1083 - if (bResult) { 1102 + if (bResult) 1084 1103 priv->rtllib->rf_power_state = rf_power_state; 1085 - } 1086 1104 1087 1105 priv->set_rf_pwr_state_in_progress = false; 1088 1106 return bResult; ··· 1110 1130 if (priv->up) { 1111 1131 switch (Operation) { 1112 1132 case SCAN_OPT_BACKUP: 1113 - priv->rtllib->InitialGainHandler(dev, IG_Backup); 1133 + priv->rtllib->init_gain_handler(dev, IG_Backup); 1114 1134 break; 1115 1135 1116 1136 case SCAN_OPT_RESTORE: 1117 - priv->rtllib->InitialGainHandler(dev, IG_Restore); 1137 + priv->rtllib->init_gain_handler(dev, IG_Restore); 1118 1138 break; 1119 1139 } 1120 1140 }
-6
drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h
··· 7 7 #ifndef _R819XU_PHYREG_H 8 8 #define _R819XU_PHYREG_H 9 9 10 - 11 10 #define RF_DATA 0x1d4 12 11 13 12 #define rPMAC_Reset 0x100 ··· 124 125 #define rOFDM0_TxCoeff5 0xcb4 125 126 #define rOFDM0_TxCoeff6 0xcb8 126 127 127 - 128 128 #define rOFDM1_LSTF 0xd00 129 129 #define rOFDM1_TRxPathEnable 0xd04 130 130 #define rOFDM1_CFO 0xd08 ··· 160 162 #define rTxAGC_Mcs07_Mcs04 0xe14 161 163 #define rTxAGC_Mcs11_Mcs08 0xe18 162 164 #define rTxAGC_Mcs15_Mcs12 0xe1c 163 - 164 165 165 166 #define rZebra1_HSSIEnable 0x0 166 167 #define rZebra1_TRxEnable1 0x1 ··· 266 269 #define b3WireAddressLength 0x400 267 270 #define b3WireRFPowerDown 0x1 268 271 /*#define bHWSISelect 0x8 */ 269 - #define b5GPAPEPolarity 0x40000000 270 272 #define b2GPAPEPolarity 0x80000000 271 273 #define bRFSW_TxDefaultAnt 0x3 272 274 #define bRFSW_TxOptionAnt 0x30 ··· 283 287 #define bRFSI_ANTSW 0x100 284 288 #define bRFSI_ANTSWB 0x200 285 289 #define bRFSI_PAPE 0x400 286 - #define bRFSI_PAPE5G 0x800 287 290 #define bBandSelect 0x1 288 291 #define bHTSIG2_GI 0x80 289 292 #define bHTSIG2_Smoothing 0x01 ··· 813 818 #define bCCKPHY0_End 0xaff 814 819 #define bOFDMPHY0_End 0xcff 815 820 #define bOFDMPHY1_End 0xdff 816 - 817 821 818 822 #define bPMACControl 0x0 819 823 #define bWMACControl 0x1
-2
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
··· 101 101 else 102 102 usConfig |= BIT15 | (KeyType << 2) | KeyIndex; 103 103 104 - 105 104 for (i = 0; i < CAM_CONTENT_COUNT; i++) { 106 105 TargetCommand = i + CAM_CONTENT_COUNT * EntryNo; 107 106 TargetCommand |= BIT31 | BIT16; ··· 148 149 149 150 if ((priv->rtllib->pairwise_key_type == KEY_TYPE_WEP40) || 150 151 (priv->rtllib->pairwise_key_type == KEY_TYPE_WEP104)) { 151 - 152 152 for (EntryId = 0; EntryId < 4; EntryId++) { 153 153 MacAddr = CAM_CONST_ADDR[EntryId]; 154 154 if (priv->rtllib->swcamtable[EntryId].bused) {
+26 -56
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
··· 169 169 (priv->rtllib->iw_mode == IW_MODE_ADHOC)) { 170 170 if ((priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) || 171 171 (change_source > RF_CHANGE_BY_IPS)) { 172 - if (ieee->state == RTLLIB_LINKED) 172 + if (ieee->link_state == MAC80211_LINKED) 173 173 priv->blinked_ingpio = true; 174 174 else 175 175 priv->blinked_ingpio = false; ··· 277 277 } 278 278 } 279 279 280 - if (net->mode & (IEEE_G | IEEE_N_24G)) { 280 + if (net->mode & (WIRELESS_MODE_G | WIRELESS_MODE_N_24G)) { 281 281 u8 slot_time_val; 282 282 u8 cur_slot_time = priv->slot_time; 283 283 ··· 327 327 int i; 328 328 329 329 mutex_lock(&priv->mutex); 330 - if (priv->rtllib->state != RTLLIB_LINKED) 330 + if (priv->rtllib->link_state != MAC80211_LINKED) 331 331 goto success; 332 332 333 333 for (i = 0; i < QOS_QUEUE_NUM; i++) ··· 344 344 int ret = 0; 345 345 u32 size = sizeof(struct rtllib_qos_parameters); 346 346 347 - if (priv->rtllib->state != RTLLIB_LINKED) 347 + if (priv->rtllib->link_state != MAC80211_LINKED) 348 348 return ret; 349 349 350 350 if (priv->rtllib->iw_mode != IW_MODE_INFRA) ··· 400 400 if (!priv || !network) 401 401 return 0; 402 402 403 - if (priv->rtllib->state != RTLLIB_LINKED) 403 + if (priv->rtllib->link_state != MAC80211_LINKED) 404 404 return 0; 405 405 406 406 if (priv->rtllib->iw_mode != IW_MODE_INFRA) ··· 466 466 tcb_desc = (struct cb_desc *)(pnewskb->cb + 8); 467 467 tcb_desc->queue_index = BEACON_QUEUE; 468 468 tcb_desc->data_rate = 2; 469 - tcb_desc->RATRIndex = 7; 469 + tcb_desc->ratr_index = 7; 470 470 tcb_desc->tx_dis_rate_fallback = 1; 471 471 tcb_desc->tx_use_drv_assinged_rate = 1; 472 472 skb_push(pnewskb, priv->rtllib->tx_headroom); ··· 635 635 if (priv->polling_timer_on == 0) 636 636 rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer); 637 637 638 - if (priv->rtllib->state != RTLLIB_LINKED) 638 + if (priv->rtllib->link_state != MAC80211_LINKED) 639 639 rtllib_softmac_start_protocol(priv->rtllib, 0); 640 640 rtllib_reset_queue(priv->rtllib); 641 641 _rtl92e_watchdog_timer_cb(&priv->watch_dog_timer); ··· 660 660 661 661 priv->rtllib->rtllib_ips_leave(dev); 662 662 663 - if (priv->rtllib->state == RTLLIB_LINKED) 663 + if (priv->rtllib->link_state == MAC80211_LINKED) 664 664 rtl92e_leisure_ps_leave(dev); 665 665 666 666 priv->up = 0; ··· 716 716 priv->rtllib->check_nic_enough_desc = _rtl92e_check_nic_enough_desc; 717 717 priv->rtllib->handle_assoc_response = _rtl92e_handle_assoc_response; 718 718 priv->rtllib->handle_beacon = _rtl92e_handle_beacon; 719 - priv->rtllib->SetWirelessMode = rtl92e_set_wireless_mode; 720 - priv->rtllib->LeisurePSLeave = rtl92e_leisure_ps_leave; 721 - priv->rtllib->SetBWModeHandler = rtl92e_set_bw_mode; 719 + priv->rtllib->set_wireless_mode = rtl92e_set_wireless_mode; 720 + priv->rtllib->leisure_ps_leave = rtl92e_leisure_ps_leave; 721 + priv->rtllib->set_bw_mode_handler = rtl92e_set_bw_mode; 722 722 priv->rf_set_chan = rtl92e_set_channel; 723 723 724 724 priv->rtllib->start_send_beacons = rtl92e_start_beacon; ··· 734 734 735 735 priv->rtllib->SetHwRegHandler = rtl92e_set_reg; 736 736 priv->rtllib->AllowAllDestAddrHandler = rtl92e_set_monitor_mode; 737 - priv->rtllib->SetFwCmdHandler = NULL; 738 - priv->rtllib->InitialGainHandler = rtl92e_init_gain; 737 + priv->rtllib->init_gain_handler = rtl92e_init_gain; 739 738 priv->rtllib->rtllib_ips_leave_wq = rtl92e_rtllib_ips_leave_wq; 740 739 priv->rtllib->rtllib_ips_leave = rtl92e_rtllib_ips_leave; 741 - 742 - priv->rtllib->LedControlHandler = NULL; 743 - priv->rtllib->UpdateBeaconInterruptHandler = NULL; 744 - 745 740 priv->rtllib->ScanOperationBackupHandler = rtl92e_scan_op_backup; 746 741 } 747 742 ··· 1009 1014 1010 1015 if (rfState == rf_on && 1011 1016 (priv->rtllib->iw_mode == IW_MODE_INFRA) && 1012 - (priv->rtllib->state == RTLLIB_LINKED)) 1017 + (priv->rtllib->link_state == MAC80211_LINKED)) 1013 1018 RxResetType = _rtl92e_rx_check_stuck(dev); 1014 1019 1015 1020 if (TxResetType == RESET_TYPE_NORMAL || ··· 1051 1056 1052 1057 mutex_lock(&priv->wx_mutex); 1053 1058 1054 - if (priv->rtllib->state == RTLLIB_LINKED) 1059 + if (priv->rtllib->link_state == MAC80211_LINKED) 1055 1060 rtl92e_leisure_ps_leave(dev); 1056 1061 1057 1062 if (priv->up) { ··· 1073 1078 rtl92e_dm_deinit(dev); 1074 1079 rtllib_stop_scan_syncro(ieee); 1075 1080 1076 - if (ieee->state == RTLLIB_LINKED) { 1081 + if (ieee->link_state == MAC80211_LINKED) { 1077 1082 mutex_lock(&ieee->wx_mutex); 1078 - netdev_info(dev, "ieee->state is RTLLIB_LINKED\n"); 1083 + netdev_info(dev, "ieee->link_state is MAC80211_LINKED\n"); 1079 1084 rtllib_stop_send_beacons(priv->rtllib); 1080 1085 del_timer_sync(&ieee->associate_timer); 1081 1086 cancel_delayed_work(&ieee->associate_retry_wq); ··· 1083 1088 netif_carrier_off(dev); 1084 1089 mutex_unlock(&ieee->wx_mutex); 1085 1090 } else { 1086 - netdev_info(dev, "ieee->state is NOT LINKED\n"); 1091 + netdev_info(dev, "ieee->link_state is NOT LINKED\n"); 1087 1092 rtllib_softmac_stop_protocol(priv->rtllib, 0, true); 1088 1093 } 1089 1094 ··· 1110 1115 1111 1116 rtl92e_enable_hw_security_config(dev); 1112 1117 1113 - if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == 1118 + if (ieee->link_state == MAC80211_LINKED && ieee->iw_mode == 1114 1119 IW_MODE_INFRA) { 1115 1120 ieee->set_chan(ieee->dev, 1116 1121 ieee->current_network.channel); 1117 1122 1118 1123 schedule_work(&ieee->associate_complete_wq); 1119 1124 1120 - } else if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == 1125 + } else if (ieee->link_state == MAC80211_LINKED && ieee->iw_mode == 1121 1126 IW_MODE_ADHOC) { 1122 1127 ieee->set_chan(ieee->dev, 1123 1128 ieee->current_network.channel); ··· 1181 1186 if (!priv->up || priv->hw_radio_off) 1182 1187 return; 1183 1188 1184 - if (priv->rtllib->state >= RTLLIB_LINKED) { 1189 + if (priv->rtllib->link_state >= MAC80211_LINKED) { 1185 1190 if (priv->rtllib->CntAfterLink < 2) 1186 1191 priv->rtllib->CntAfterLink++; 1187 1192 } else { ··· 1191 1196 rtl92e_dm_watchdog(dev); 1192 1197 1193 1198 if (!rtllib_act_scanning(priv->rtllib, false)) { 1194 - if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state == 1195 - RTLLIB_NOLINK) && 1199 + if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->link_state == 1200 + MAC80211_NOLINK) && 1196 1201 (ieee->rf_power_state == rf_on) && !ieee->is_set_key && 1197 1202 (!ieee->proto_stoppping) && !ieee->wx_set_enc) { 1198 1203 if ((ieee->pwr_save_ctrl.ReturnPoint == ··· 1202 1207 } 1203 1208 } 1204 1209 } 1205 - if ((ieee->state == RTLLIB_LINKED) && (ieee->iw_mode == 1210 + if ((ieee->link_state == MAC80211_LINKED) && (ieee->iw_mode == 1206 1211 IW_MODE_INFRA) && (!ieee->net_promiscuous_md)) { 1207 1212 if (ieee->link_detect_info.NumRxOkInPeriod > 100 || 1208 1213 ieee->link_detect_info.NumTxOkInPeriod > 100) ··· 1244 1249 ieee->link_detect_info.bHigherBusyTraffic = bHigherBusyTraffic; 1245 1250 ieee->link_detect_info.bHigherBusyRxTraffic = bHigherBusyRxTraffic; 1246 1251 1247 - if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) { 1252 + if (ieee->link_state == MAC80211_LINKED && ieee->iw_mode == IW_MODE_INFRA) { 1248 1253 u32 TotalRxBcnNum = 0; 1249 1254 u32 TotalRxDataNum = 0; 1250 1255 ··· 1263 1268 "===>%s(): AP is power off, chan:%d, connect another one\n", 1264 1269 __func__, priv->chan); 1265 1270 1266 - ieee->state = RTLLIB_ASSOCIATING; 1271 + ieee->link_state = RTLLIB_ASSOCIATING; 1267 1272 1268 1273 RemovePeerTS(priv->rtllib, 1269 1274 priv->rtllib->current_network.bssid); 1270 1275 ieee->is_roaming = true; 1271 1276 ieee->is_set_key = false; 1272 1277 ieee->link_change(dev); 1273 - if (ieee->LedControlHandler) 1274 - ieee->LedControlHandler(ieee->dev, 1275 - LED_CTL_START_TO_LINK); 1276 - 1277 1278 notify_wx_assoc_event(ieee); 1278 1279 1279 1280 if (!(ieee->rtllib_ap_sec_type(ieee) & ··· 1431 1440 return 0; 1432 1441 } 1433 1442 1434 - tcb_desc->RATRIndex = 7; 1443 + tcb_desc->ratr_index = 7; 1435 1444 tcb_desc->tx_dis_rate_fallback = 1; 1436 1445 tcb_desc->tx_use_drv_assinged_rate = 1; 1437 1446 tcb_desc->bTxEnableFwCalcDur = 1; ··· 1500 1509 MAX_DEV_ADDR_SIZE); 1501 1510 struct tx_desc *pdesc = NULL; 1502 1511 struct rtllib_hdr_1addr *header = NULL; 1503 - u16 fc = 0, type = 0; 1504 1512 u8 *pda_addr = NULL; 1505 1513 int idx; 1506 1514 u32 fwinfo_size = 0; ··· 1515 1525 fwinfo_size = sizeof(struct tx_fwinfo_8190pci); 1516 1526 1517 1527 header = (struct rtllib_hdr_1addr *)(((u8 *)skb->data) + fwinfo_size); 1518 - fc = le16_to_cpu(header->frame_ctl); 1519 - type = WLAN_FC_GET_TYPE(fc); 1520 1528 pda_addr = header->addr1; 1521 1529 1522 1530 if (!is_broadcast_ether_addr(pda_addr) && !is_multicast_ether_addr(pda_addr)) ··· 1535 1547 skb_queue_len(&ring->queue)); 1536 1548 spin_unlock_irqrestore(&priv->irq_th_lock, flags); 1537 1549 return skb->len; 1538 - } 1539 - 1540 - if (type == RTLLIB_FTYPE_DATA) { 1541 - if (priv->rtllib->LedControlHandler) 1542 - priv->rtllib->LedControlHandler(dev, LED_CTL_TX); 1543 1550 } 1544 1551 rtl92e_fill_tx_desc(dev, pdesc, tcb_desc, skb); 1545 1552 __skb_queue_tail(&ring->queue, skb); ··· 1762 1779 struct r8192_priv *priv = rtllib_priv(dev); 1763 1780 struct rtllib_hdr_1addr *rtllib_hdr = NULL; 1764 1781 bool unicast_packet = false; 1765 - bool bLedBlinking = true; 1766 - u16 fc = 0, type = 0; 1767 1782 u32 skb_len = 0; 1768 1783 int rx_queue_idx = RX_MPDU_QUEUE; 1769 1784 ··· 1769 1788 .signal = 0, 1770 1789 .noise = (u8)-98, 1771 1790 .rate = 0, 1772 - .freq = RTLLIB_24GHZ_BAND, 1773 1791 }; 1774 1792 unsigned int count = priv->rxringcount; 1775 1793 ··· 1804 1824 /* unicast packet */ 1805 1825 unicast_packet = true; 1806 1826 } 1807 - fc = le16_to_cpu(rtllib_hdr->frame_ctl); 1808 - type = WLAN_FC_GET_TYPE(fc); 1809 - if (type == RTLLIB_FTYPE_MGMT) 1810 - bLedBlinking = false; 1811 - 1812 - if (bLedBlinking) 1813 - if (priv->rtllib->LedControlHandler) 1814 - priv->rtllib->LedControlHandler(dev, 1815 - LED_CTL_RX); 1816 - 1817 1827 skb_len = skb->len; 1818 1828 1819 1829 if (!rtllib_rx(priv->rtllib, skb, &stats)) {
-3
drivers/staging/rtl8192e/rtl8192e/rtl_core.h
··· 231 231 struct rt_stats stats; 232 232 struct iw_statistics wstats; 233 233 234 - short (*rf_set_sens)(struct net_device *dev, short sens); 235 234 u8 (*rf_set_chan)(struct net_device *dev, u8 ch); 236 235 237 236 struct rx_desc *rx_ring[MAX_RX_QUEUE]; ··· 270 271 short promisc; 271 272 272 273 short chan; 273 - short sens; 274 - short max_sens; 275 274 bool ps_force; 276 275 277 276 u32 irq_mask[2];
+70 -98
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
··· 159 159 static void _rtl92e_dm_init_bandwidth_autoswitch(struct net_device *dev); 160 160 static void _rtl92e_dm_bandwidth_autoswitch(struct net_device *dev); 161 161 162 - 163 162 static void _rtl92e_dm_check_tx_power_tracking(struct net_device *dev); 164 163 165 164 static void _rtl92e_dm_bb_initialgain_restore(struct net_device *dev); ··· 177 178 static void _rtl92e_dm_check_rx_path_selection(struct net_device *dev); 178 179 static void _rtl92e_dm_init_rx_path_selection(struct net_device *dev); 179 180 static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev); 180 - 181 181 182 182 static void _rtl92e_dm_init_fsync(struct net_device *dev); 183 183 static void _rtl92e_dm_deinit_fsync(struct net_device *dev); ··· 217 219 218 220 void rtl92e_dm_deinit(struct net_device *dev) 219 221 { 220 - 221 222 _rtl92e_dm_deinit_fsync(dev); 222 - 223 223 } 224 224 225 225 void rtl92e_dm_watchdog(struct net_device *dev) ··· 246 250 247 251 void rtl92e_init_adaptive_rate(struct net_device *dev) 248 252 { 249 - 250 253 struct r8192_priv *priv = rtllib_priv(dev); 251 254 struct rate_adaptive *pra = &priv->rate_adaptive; 252 255 ··· 291 296 if (priv->rtllib->mode != WIRELESS_MODE_N_24G) 292 297 return; 293 298 294 - if (priv->rtllib->state == RTLLIB_LINKED) { 295 - 299 + if (priv->rtllib->link_state == MAC80211_LINKED) { 296 300 bshort_gi_enabled = (ht_info->cur_tx_bw40mhz && 297 301 ht_info->bCurShortGI40MHz) || 298 302 (!ht_info->cur_tx_bw40mhz && ··· 347 353 348 354 if (pra->ping_rssi_enable) { 349 355 if (priv->undecorated_smoothed_pwdb < 350 - (long)(pra->ping_rssi_thresh_for_ra+5)) { 356 + (long)(pra->ping_rssi_thresh_for_ra + 5)) { 351 357 if ((priv->undecorated_smoothed_pwdb < 352 358 (long)pra->ping_rssi_thresh_for_ra) || 353 359 ping_rssi_state) { ··· 518 524 priv->rtllib->bdynamic_txpower_enable = false; 519 525 520 526 for (j = 0; j <= 30; j++) { 521 - 522 527 tx_cmd.op = TXCMD_SET_TX_PWR_TRACKING; 523 528 tx_cmd.length = 4; 524 529 tx_cmd.value = priv->pwr_track >> 24; ··· 555 562 for (k = 0; k < 5; k++) { 556 563 if (k != 4) 557 564 tmp_report[k] = rtl92e_readb(dev, 558 - Tssi_Report_Value1+k); 565 + Tssi_Report_Value1 + k); 559 566 else 560 567 tmp_report[k] = rtl92e_readb(dev, 561 568 Tssi_Report_Value2); ··· 622 629 } else if (priv->rtllib->current_network.channel != 14 && priv->bcck_in_ch14) { 623 630 priv->bcck_in_ch14 = false; 624 631 rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); 625 - } else 632 + } else { 626 633 rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); 634 + } 627 635 } 628 636 629 637 if (priv->cck_present_attn_diff <= -12 || ··· 651 657 { 652 658 #define ThermalMeterVal 9 653 659 struct r8192_priv *priv = rtllib_priv(dev); 654 - u32 tmpRegA, TempCCk; 655 - u8 tmpOFDMindex, tmpCCKindex, tmpCCK20Mindex, tmpCCK40Mindex, tmpval; 660 + u32 tmp_reg, tmp_cck; 661 + u8 tmp_ofdm_index, tmp_cck_index, tmp_cck_20m_index, tmp_cck_40m_index, tmpval; 656 662 int i = 0, CCKSwingNeedUpdate = 0; 657 663 658 664 if (!priv->tx_pwr_tracking_init) { 659 - tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance, 665 + tmp_reg = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance, 660 666 bMaskDWord); 661 667 for (i = 0; i < OFDM_TABLE_LEN; i++) { 662 - if (tmpRegA == OFDMSwingTable[i]) 668 + if (tmp_reg == OFDMSwingTable[i]) 663 669 priv->ofdm_index[0] = i; 664 670 } 665 671 666 - TempCCk = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2); 672 + tmp_cck = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2); 667 673 for (i = 0; i < CCK_TABLE_LEN; i++) { 668 - if (TempCCk == (u32)CCKSwingTable_Ch1_Ch13[i][0]) { 674 + if (tmp_cck == (u32)CCKSwingTable_Ch1_Ch13[i][0]) { 669 675 priv->cck_index = i; 670 676 break; 671 677 } ··· 674 680 return; 675 681 } 676 682 677 - tmpRegA = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078); 678 - if (tmpRegA < 3 || tmpRegA > 13) 683 + tmp_reg = rtl92e_get_rf_reg(dev, RF90_PATH_A, 0x12, 0x078); 684 + if (tmp_reg < 3 || tmp_reg > 13) 679 685 return; 680 - if (tmpRegA >= 12) 681 - tmpRegA = 12; 686 + if (tmp_reg >= 12) 687 + tmp_reg = 12; 682 688 priv->thermal_meter[0] = ThermalMeterVal; 683 689 priv->thermal_meter[1] = ThermalMeterVal; 684 690 685 - if (priv->thermal_meter[0] >= (u8)tmpRegA) { 686 - tmpOFDMindex = tmpCCK20Mindex = 6+(priv->thermal_meter[0] - 687 - (u8)tmpRegA); 688 - tmpCCK40Mindex = tmpCCK20Mindex - 6; 689 - if (tmpOFDMindex >= OFDM_TABLE_LEN) 690 - tmpOFDMindex = OFDM_TABLE_LEN - 1; 691 - if (tmpCCK20Mindex >= CCK_TABLE_LEN) 692 - tmpCCK20Mindex = CCK_TABLE_LEN - 1; 693 - if (tmpCCK40Mindex >= CCK_TABLE_LEN) 694 - tmpCCK40Mindex = CCK_TABLE_LEN - 1; 691 + if (priv->thermal_meter[0] >= (u8)tmp_reg) { 692 + tmp_ofdm_index = 6 + (priv->thermal_meter[0] - (u8)tmp_reg); 693 + tmp_cck_20m_index = tmp_ofdm_index; 694 + tmp_cck_40m_index = tmp_cck_20m_index - 6; 695 + if (tmp_ofdm_index >= OFDM_TABLE_LEN) 696 + tmp_ofdm_index = OFDM_TABLE_LEN - 1; 697 + if (tmp_cck_20m_index >= CCK_TABLE_LEN) 698 + tmp_cck_20m_index = CCK_TABLE_LEN - 1; 699 + if (tmp_cck_40m_index >= CCK_TABLE_LEN) 700 + tmp_cck_40m_index = CCK_TABLE_LEN - 1; 695 701 } else { 696 - tmpval = (u8)tmpRegA - priv->thermal_meter[0]; 702 + tmpval = (u8)tmp_reg - priv->thermal_meter[0]; 697 703 if (tmpval >= 6) { 698 - tmpOFDMindex = 0; 699 - tmpCCK20Mindex = 0; 704 + tmp_ofdm_index = 0; 705 + tmp_cck_20m_index = 0; 700 706 } else { 701 - tmpOFDMindex = 6 - tmpval; 702 - tmpCCK20Mindex = 6 - tmpval; 707 + tmp_ofdm_index = 6 - tmpval; 708 + tmp_cck_20m_index = 6 - tmpval; 703 709 } 704 - tmpCCK40Mindex = 0; 710 + tmp_cck_40m_index = 0; 705 711 } 706 712 if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) 707 - tmpCCKindex = tmpCCK40Mindex; 713 + tmp_cck_index = tmp_cck_40m_index; 708 714 else 709 - tmpCCKindex = tmpCCK20Mindex; 715 + tmp_cck_index = tmp_cck_20m_index; 710 716 711 - priv->rec_cck_20m_idx = tmpCCK20Mindex; 712 - priv->rec_cck_40m_idx = tmpCCK40Mindex; 717 + priv->rec_cck_20m_idx = tmp_cck_20m_index; 718 + priv->rec_cck_40m_idx = tmp_cck_40m_index; 713 719 714 720 if (priv->rtllib->current_network.channel == 14 && 715 721 !priv->bcck_in_ch14) { ··· 721 727 CCKSwingNeedUpdate = 1; 722 728 } 723 729 724 - if (priv->cck_index != tmpCCKindex) { 725 - priv->cck_index = tmpCCKindex; 730 + if (priv->cck_index != tmp_cck_index) { 731 + priv->cck_index = tmp_cck_index; 726 732 CCKSwingNeedUpdate = 1; 727 733 } 728 734 729 735 if (CCKSwingNeedUpdate) 730 736 rtl92e_dm_cck_txpower_adjust(dev, priv->bcck_in_ch14); 731 - if (priv->ofdm_index[0] != tmpOFDMindex) { 732 - priv->ofdm_index[0] = tmpOFDMindex; 737 + if (priv->ofdm_index[0] != tmp_ofdm_index) { 738 + priv->ofdm_index[0] = tmp_ofdm_index; 733 739 rtl92e_set_bb_reg(dev, rOFDM0_XATxIQImbalance, bMaskDWord, 734 740 OFDMSwingTable[priv->ofdm_index[0]]); 735 741 } ··· 750 756 751 757 static void _rtl92e_dm_initialize_tx_power_tracking_tssi(struct net_device *dev) 752 758 { 753 - 754 759 struct r8192_priv *priv = rtllib_priv(dev); 755 760 756 761 priv->btxpower_tracking = true; 757 762 priv->txpower_count = 0; 758 763 priv->tx_pwr_tracking_init = false; 759 - 760 764 } 761 765 762 766 static void _rtl92e_dm_init_tx_power_tracking_thermal(struct net_device *dev) 763 767 { 764 768 struct r8192_priv *priv = rtllib_priv(dev); 765 - 766 769 767 770 if (priv->rtllib->FwRWRF) 768 771 priv->btxpower_tracking = true; ··· 790 799 return; 791 800 tx_power_track_counter++; 792 801 793 - 794 802 if (tx_power_track_counter >= 180) { 795 803 schedule_delayed_work(&priv->txpower_tracking_wq, 0); 796 804 tx_power_track_counter = 0; 797 805 } 798 - 799 806 } 800 807 801 808 static void _rtl92e_dm_check_tx_power_tracking_thermal(struct net_device *dev) ··· 822 833 netdev_info(dev, "===============>Schedule TxPowerTrackingWorkItem\n"); 823 834 schedule_delayed_work(&priv->txpower_tracking_wq, 0); 824 835 TM_Trigger = 0; 825 - 826 836 } 827 837 828 838 static void _rtl92e_dm_check_tx_power_tracking(struct net_device *dev) ··· 849 861 rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); 850 862 TempVal = (u32)((dm_cck_tx_bb_gain[attenuation][2]) + 851 863 (dm_cck_tx_bb_gain[attenuation][3] << 8) + 852 - (dm_cck_tx_bb_gain[attenuation][4] << 16)+ 864 + (dm_cck_tx_bb_gain[attenuation][4] << 16) + 853 865 (dm_cck_tx_bb_gain[attenuation][5] << 24)); 854 866 rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); 855 867 TempVal = (u32)(dm_cck_tx_bb_gain[attenuation][6] + ··· 863 875 rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); 864 876 TempVal = (u32)((dm_cck_tx_bb_gain_ch14[attenuation][2]) + 865 877 (dm_cck_tx_bb_gain_ch14[attenuation][3] << 8) + 866 - (dm_cck_tx_bb_gain_ch14[attenuation][4] << 16)+ 878 + (dm_cck_tx_bb_gain_ch14[attenuation][4] << 16) + 867 879 (dm_cck_tx_bb_gain_ch14[attenuation][5] << 24)); 868 880 rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); 869 881 TempVal = (u32)((dm_cck_tx_bb_gain_ch14[attenuation][6]) + ··· 886 898 rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); 887 899 TempVal = CCKSwingTable_Ch1_Ch13[priv->cck_index][2] + 888 900 (CCKSwingTable_Ch1_Ch13[priv->cck_index][3] << 8) + 889 - (CCKSwingTable_Ch1_Ch13[priv->cck_index][4] << 16)+ 901 + (CCKSwingTable_Ch1_Ch13[priv->cck_index][4] << 16) + 890 902 (CCKSwingTable_Ch1_Ch13[priv->cck_index][5] << 24); 891 903 rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); 892 904 TempVal = CCKSwingTable_Ch1_Ch13[priv->cck_index][6] + ··· 900 912 rtl92e_set_bb_reg(dev, rCCK0_TxFilter1, bMaskHWord, TempVal); 901 913 TempVal = CCKSwingTable_Ch14[priv->cck_index][2] + 902 914 (CCKSwingTable_Ch14[priv->cck_index][3] << 8) + 903 - (CCKSwingTable_Ch14[priv->cck_index][4] << 16)+ 915 + (CCKSwingTable_Ch14[priv->cck_index][4] << 16) + 904 916 (CCKSwingTable_Ch14[priv->cck_index][5] << 24); 905 917 rtl92e_set_bb_reg(dev, rCCK0_TxFilter2, bMaskDWord, TempVal); 906 918 TempVal = CCKSwingTable_Ch14[priv->cck_index][6] + 907 - (CCKSwingTable_Ch14[priv->cck_index][7]<<8); 919 + (CCKSwingTable_Ch14[priv->cck_index][7] << 8); 908 920 909 921 rtl92e_set_bb_reg(dev, rCCK0_DebugPort, bMaskLWord, TempVal); 910 922 } ··· 953 965 _rtl92e_dm_tx_power_reset_recovery(dev); 954 966 955 967 _rtl92e_dm_bb_initialgain_restore(dev); 956 - 957 968 } 958 969 959 970 static void _rtl92e_dm_bb_initialgain_restore(struct net_device *dev) ··· 976 989 rtl92e_set_bb_reg(dev, rCCK0_CCA, bit_mask, 977 990 (u32)priv->initgain_backup.cca); 978 991 rtl92e_set_bb_reg(dev, UFWP, bMaskByte1, 0x1); 979 - 980 992 } 981 993 982 994 void rtl92e_dm_backup_state(struct net_device *dev) ··· 1029 1043 1030 1044 static void _rtl92e_dm_ctrl_initgain_byrssi(struct net_device *dev) 1031 1045 { 1032 - 1033 1046 if (!dm_digtable.dig_enable_flag) 1034 1047 return; 1035 1048 ··· 1076 1091 dm_digtable.dig_state = DM_STA_DIG_OFF; 1077 1092 } 1078 1093 1079 - if (priv->rtllib->state == RTLLIB_LINKED) 1094 + if (priv->rtllib->link_state == MAC80211_LINKED) 1080 1095 dm_digtable.cur_sta_connect_state = DIG_STA_CONNECT; 1081 1096 else 1082 1097 dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT; 1083 - 1084 1098 1085 1099 dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb; 1086 1100 _rtl92e_dm_initial_gain(dev); ··· 1088 1104 if (dm_digtable.dig_algorithm_switch) 1089 1105 dm_digtable.dig_algorithm_switch = 0; 1090 1106 dm_digtable.pre_sta_connect_state = dm_digtable.cur_sta_connect_state; 1091 - 1092 1107 } 1093 1108 1094 1109 static void _rtl92e_dm_ctrl_initgain_byrssi_false_alarm(struct net_device *dev) ··· 1106 1123 dm_digtable.dig_algorithm_switch = 0; 1107 1124 } 1108 1125 1109 - if (priv->rtllib->state != RTLLIB_LINKED) 1126 + if (priv->rtllib->link_state != MAC80211_LINKED) 1110 1127 return; 1111 1128 1112 1129 if ((priv->undecorated_smoothed_pwdb > dm_digtable.rssi_low_thresh) && ··· 1129 1146 rtl92e_writeb(dev, rOFDM0_XDAGCCore1, 0x17); 1130 1147 1131 1148 if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) 1132 - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x00); 1149 + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x00); 1133 1150 else 1134 1151 rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x42); 1135 1152 ··· 1166 1183 } 1167 1184 1168 1185 if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) 1169 - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x20); 1186 + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x20); 1170 1187 else 1171 1188 rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x44); 1172 1189 ··· 1176 1193 } 1177 1194 _rtl92e_dm_ctrl_initgain_byrssi_highpwr(dev); 1178 1195 } 1179 - 1180 1196 1181 1197 static void _rtl92e_dm_ctrl_initgain_byrssi_highpwr(struct net_device *dev) 1182 1198 { ··· 1196 1214 dm_digtable.dig_highpwr_state = DM_STA_DIG_ON; 1197 1215 1198 1216 if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) 1199 - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x10); 1217 + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x10); 1200 1218 else 1201 1219 rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x43); 1202 1220 } else { ··· 1210 1228 (priv->undecorated_smoothed_pwdb >= 1211 1229 dm_digtable.rssi_high_thresh)) { 1212 1230 if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) 1213 - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x20); 1231 + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x20); 1214 1232 else 1215 1233 rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x44); 1216 1234 } ··· 1321 1339 (initialized <= 3) || force_write) { 1322 1340 if (dm_digtable.curpd_thstate == DIG_PD_AT_LOW_POWER) { 1323 1341 if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) 1324 - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x00); 1342 + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x00); 1325 1343 else 1326 1344 rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x42); 1327 1345 } else if (dm_digtable.curpd_thstate == 1328 1346 DIG_PD_AT_NORMAL_POWER) { 1329 1347 if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) 1330 - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x20); 1348 + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x20); 1331 1349 else 1332 1350 rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x44); 1333 1351 } else if (dm_digtable.curpd_thstate == DIG_PD_AT_HIGH_POWER) { 1334 1352 if (priv->current_chnl_bw != HT_CHANNEL_WIDTH_20) 1335 - rtl92e_writeb(dev, (rOFDM0_XATxAFE+3), 0x10); 1353 + rtl92e_writeb(dev, (rOFDM0_XATxAFE + 3), 0x10); 1336 1354 else 1337 1355 rtl92e_writeb(dev, rOFDM0_RxDetector1, 0x43); 1338 1356 } ··· 1374 1392 reset_cnt = priv->reset_count; 1375 1393 } 1376 1394 1377 - 1378 1395 if ((dm_digtable.precs_ratio_state != dm_digtable.curcs_ratio_state) || 1379 1396 !initialized || force_write) { 1380 1397 if (dm_digtable.curcs_ratio_state == DIG_CS_RATIO_LOWER) ··· 1407 1426 1408 1427 if (priv->rtllib->iw_mode == IW_MODE_ADHOC) 1409 1428 goto dm_CheckEdcaTurbo_EXIT; 1410 - if (priv->rtllib->state != RTLLIB_LINKED) 1429 + if (priv->rtllib->link_state != MAC80211_LINKED) 1411 1430 goto dm_CheckEdcaTurbo_EXIT; 1412 1431 if (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO) 1413 1432 goto dm_CheckEdcaTurbo_EXIT; ··· 1416 1435 curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; 1417 1436 curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; 1418 1437 if (ht_info->iot_action & HT_IOT_ACT_EDCA_BIAS_ON_RX) { 1419 - if (curTxOkCnt > 4*curRxOkCnt) { 1438 + if (curTxOkCnt > 4 * curRxOkCnt) { 1420 1439 if (priv->bis_cur_rdlstate || 1421 1440 !priv->bcurrent_turbo_EDCA) { 1422 1441 rtl92e_writel(dev, EDCAPARA_BE, ··· 1437 1456 } 1438 1457 priv->bcurrent_turbo_EDCA = true; 1439 1458 } else { 1440 - if (curRxOkCnt > 4*curTxOkCnt) { 1459 + if (curRxOkCnt > 4 * curTxOkCnt) { 1441 1460 if (!priv->bis_cur_rdlstate || 1442 1461 !priv->bcurrent_turbo_EDCA) { 1443 1462 if (priv->rtllib->mode == WIRELESS_MODE_G) ··· 1455 1474 edca_setting_UL[ht_info->IOTPeer]); 1456 1475 priv->bis_cur_rdlstate = false; 1457 1476 } 1458 - 1459 1477 } 1460 1478 1461 1479 priv->bcurrent_turbo_EDCA = true; ··· 1468 1488 priv->bcurrent_turbo_EDCA = false; 1469 1489 } 1470 1490 } 1471 - 1472 1491 1473 1492 dm_CheckEdcaTurbo_EXIT: 1474 1493 priv->rtllib->bis_any_nonbepkts = false; ··· 1498 1519 if (ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { 1499 1520 curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; 1500 1521 curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; 1501 - if (curRxOkCnt > 4*curTxOkCnt) 1522 + if (curRxOkCnt > 4 * curTxOkCnt) 1502 1523 ht_info->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; 1503 1524 else 1504 1525 ht_info->iot_action |= HT_IOT_ACT_FORCED_CTS2SELF; ··· 1525 1546 1526 1547 tmp1byte = rtl92e_readb(dev, GPI); 1527 1548 1528 - rf_power_state_to_set = (tmp1byte&BIT1) ? rf_on : rf_off; 1549 + rf_power_state_to_set = (tmp1byte & BIT1) ? rf_on : rf_off; 1529 1550 1530 1551 if (priv->hw_radio_off && (rf_power_state_to_set == rf_on)) { 1531 1552 netdev_info(dev, "gpiochangeRF - HW Radio ON\n"); ··· 1555 1576 rfpath = rtl92e_readb(dev, 0xc04); 1556 1577 1557 1578 for (i = 0; i < RF90_PATH_MAX; i++) { 1558 - if (rfpath & (0x01<<i)) 1579 + if (rfpath & (0x01 << i)) 1559 1580 priv->brfpath_rxenable[i] = true; 1560 1581 else 1561 1582 priv->brfpath_rxenable[i] = false; ··· 1606 1627 u8 update_cck_rx_path; 1607 1628 1608 1629 if (!cck_Rx_Path_initialized) { 1609 - dm_rx_path_sel_table.cck_rx_path = (rtl92e_readb(dev, 0xa07)&0xf); 1630 + dm_rx_path_sel_table.cck_rx_path = (rtl92e_readb(dev, 0xa07) & 0xf); 1610 1631 cck_Rx_Path_initialized = 1; 1611 1632 } 1612 1633 ··· 1725 1746 tmp_cck_min_pwdb = cur_cck_pwdb; 1726 1747 } 1727 1748 } 1728 - 1729 1749 } 1730 1750 } 1731 1751 } ··· 1741 1763 if ((tmp_max_rssi - tmp_min_rssi) >= 1742 1764 dm_rx_path_sel_table.diff_th) { 1743 1765 dm_rx_path_sel_table.rf_enable_rssi_th[min_rssi_index] = 1744 - tmp_max_rssi+5; 1766 + tmp_max_rssi + 5; 1745 1767 rtl92e_set_bb_reg(dev, rOFDM0_TRxPathEnable, 1746 - 0x1<<min_rssi_index, 0x0); 1768 + 0x1 << min_rssi_index, 0x0); 1747 1769 rtl92e_set_bb_reg(dev, rOFDM1_TRxPathEnable, 1748 - 0x1<<min_rssi_index, 0x0); 1770 + 0x1 << min_rssi_index, 0x0); 1749 1771 disabled_rf_cnt++; 1750 1772 } 1751 1773 if (dm_rx_path_sel_table.cck_method == CCK_Rx_Version_1) { ··· 1757 1779 } 1758 1780 1759 1781 if (update_cck_rx_path) { 1760 - dm_rx_path_sel_table.cck_rx_path = (cck_default_Rx<<2) | 1782 + dm_rx_path_sel_table.cck_rx_path = (cck_default_Rx << 2) | 1761 1783 (cck_optional_Rx); 1762 1784 rtl92e_set_bb_reg(dev, rCCK0_AFESetting, 0x0f000000, 1763 1785 dm_rx_path_sel_table.cck_rx_path); ··· 1790 1812 schedule_delayed_work(&priv->rfpath_check_wq, 0); 1791 1813 } 1792 1814 1793 - 1794 1815 static void _rtl92e_dm_init_fsync(struct net_device *dev) 1795 1816 { 1796 1817 struct r8192_priv *priv = rtllib_priv(dev); ··· 1806 1829 timer_setup(&priv->fsync_timer, _rtl92e_dm_fsync_timer_callback, 0); 1807 1830 } 1808 1831 1809 - 1810 1832 static void _rtl92e_dm_deinit_fsync(struct net_device *dev) 1811 1833 { 1812 1834 struct r8192_priv *priv = rtllib_priv(dev); ··· 1821 1845 bool bSwitchFromCountDiff = false; 1822 1846 bool bDoubleTimeInterval = false; 1823 1847 1824 - if (priv->rtllib->state == RTLLIB_LINKED && 1848 + if (priv->rtllib->link_state == MAC80211_LINKED && 1825 1849 priv->rtllib->bfsync_enable && 1826 1850 (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_CDD_FSYNC)) { 1827 1851 u32 rate_bitmap; ··· 1840 1864 else 1841 1865 rate_count_diff = rate_count - priv->rate_record; 1842 1866 if (rate_count_diff < priv->rate_count_diff_rec) { 1843 - 1844 1867 u32 DiffNum = priv->rate_count_diff_rec - 1845 1868 rate_count_diff; 1846 1869 if (DiffNum >= ··· 1980 2005 add_timer(&priv->fsync_timer); 1981 2006 1982 2007 rtl92e_writel(dev, rOFDM0_RxDetector2, 0x465c12cd); 1983 - 1984 2008 } 1985 2009 1986 2010 static void _rtl92e_dm_check_fsync(struct net_device *dev) ··· 1991 2017 static u8 reg_c38_State = RegC38_Default; 1992 2018 static u32 reset_cnt; 1993 2019 1994 - if (priv->rtllib->state == RTLLIB_LINKED && 2020 + if (priv->rtllib->link_state == MAC80211_LINKED && 1995 2021 priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { 1996 2022 if (priv->rtllib->bfsync_enable == 0) { 1997 2023 switch (priv->rtllib->fsync_state) { ··· 2022 2048 case SW_Fsync: 2023 2049 default: 2024 2050 break; 2025 - 2026 2051 } 2027 2052 } 2028 2053 if (reg_c38_State != RegC38_Fsync_AP_BCM) { ··· 2044 2071 break; 2045 2072 } 2046 2073 2047 - if (priv->rtllib->state == RTLLIB_LINKED) { 2074 + if (priv->rtllib->link_state == MAC80211_LINKED) { 2048 2075 if (priv->undecorated_smoothed_pwdb <= 2049 2076 RegC38_TH) { 2050 2077 if (reg_c38_State != ··· 2057 2084 RegC38_NonFsync_Other_AP; 2058 2085 } 2059 2086 } else if (priv->undecorated_smoothed_pwdb >= 2060 - (RegC38_TH+5)) { 2087 + (RegC38_TH + 5)) { 2061 2088 if (reg_c38_State) { 2062 2089 rtl92e_writeb(dev, 2063 2090 rOFDM0_RxDetector3, ··· 2105 2132 return; 2106 2133 } 2107 2134 if ((priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) && 2108 - (priv->rtllib->mode == IEEE_G)) { 2135 + (priv->rtllib->mode == WIRELESS_MODE_G)) { 2109 2136 txhipower_threshold = TX_POWER_ATHEROAP_THRESH_HIGH; 2110 2137 txlowpower_threshold = TX_POWER_ATHEROAP_THRESH_LOW; 2111 2138 } else { ··· 2113 2140 txlowpower_threshold = TX_POWER_NEAR_FIELD_THRESH_LOW; 2114 2141 } 2115 2142 2116 - if (priv->rtllib->state == RTLLIB_LINKED) { 2143 + if (priv->rtllib->link_state == MAC80211_LINKED) { 2117 2144 if (priv->undecorated_smoothed_pwdb >= txhipower_threshold) { 2118 2145 priv->dynamic_tx_high_pwr = true; 2119 2146 priv->dynamic_tx_low_pwr = false; ··· 2137 2164 } 2138 2165 priv->last_dtp_flag_high = priv->dynamic_tx_high_pwr; 2139 2166 priv->last_dtp_flag_low = priv->dynamic_tx_low_pwr; 2140 - 2141 2167 } 2142 2168 2143 2169 static void _rtl92e_dm_check_txrateandretrycount(struct net_device *dev)
+2 -2
drivers/staging/rtl8192e/rtl8192e/rtl_ethtool.c
··· 27 27 { 28 28 struct r8192_priv *priv = rtllib_priv(dev); 29 29 30 - return ((priv->rtllib->state == RTLLIB_LINKED) || 31 - (priv->rtllib->state == RTLLIB_LINKED_SCANNING)); 30 + return ((priv->rtllib->link_state == MAC80211_LINKED) || 31 + (priv->rtllib->link_state == MAC80211_LINKED_SCANNING)); 32 32 } 33 33 34 34 const struct ethtool_ops rtl819x_ethtool_ops = {
-2
drivers/staging/rtl8192e/rtl8192e/rtl_pm.c
··· 9 9 #include "r8190P_rtl8256.h" 10 10 #include "rtl_pm.h" 11 11 12 - 13 12 int rtl92e_suspend(struct device *dev_d) 14 13 { 15 14 struct net_device *dev = dev_get_drvdata(dev_d); ··· 60 61 u32 val; 61 62 62 63 netdev_info(dev, "================>r8192E resume call.\n"); 63 - 64 64 65 65 pci_read_config_dword(pdev, 0x40, &val); 66 66 if ((val & 0x0000ff00) != 0)
+7 -13
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
··· 118 118 119 119 rt_state = priv->rtllib->rf_power_state; 120 120 if (rt_state == rf_on && !psc->bSwRfProcessing && 121 - (priv->rtllib->state != RTLLIB_LINKED) && 121 + (priv->rtllib->link_state != MAC80211_LINKED) && 122 122 (priv->rtllib->iw_mode != IW_MODE_MASTER)) { 123 123 psc->eInactivePowerState = rf_off; 124 124 _rtl92e_ps_update_rf_state(dev); ··· 209 209 &priv->rtllib->pwr_save_ctrl; 210 210 211 211 if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) && 212 - (priv->rtllib->state == RTLLIB_LINKED)) 212 + (priv->rtllib->link_state == MAC80211_LINKED)) 213 213 || (priv->rtllib->iw_mode == IW_MODE_ADHOC) || 214 214 (priv->rtllib->iw_mode == IW_MODE_MASTER)) 215 215 return; ··· 217 217 if (psc->bLeisurePs) { 218 218 if (psc->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) { 219 219 220 - if (priv->rtllib->ps == RTLLIB_PS_DISABLED) { 221 - if (priv->rtllib->SetFwCmdHandler) 222 - priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_ENTER); 223 - _rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST | 224 - RTLLIB_PS_UNICAST); 225 - } 226 - } else 220 + if (priv->rtllib->ps == RTLLIB_PS_DISABLED) 221 + _rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST | RTLLIB_PS_UNICAST); 222 + } else { 227 223 psc->LpsIdleCount++; 224 + } 228 225 } 229 226 } 230 227 ··· 232 235 &priv->rtllib->pwr_save_ctrl; 233 236 234 237 if (psc->bLeisurePs) { 235 - if (priv->rtllib->ps != RTLLIB_PS_DISABLED) { 238 + if (priv->rtllib->ps != RTLLIB_PS_DISABLED) 236 239 _rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED); 237 - if (priv->rtllib->SetFwCmdHandler) 238 - priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_LEAVE); 239 - } 240 240 } 241 241 }
+13 -60
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
··· 169 169 priv->ps_force = false; 170 170 psc->bLeisurePs = true; 171 171 } else { 172 - if (priv->rtllib->state == RTLLIB_LINKED) 172 + if (priv->rtllib->link_state == MAC80211_LINKED) 173 173 rtl92e_leisure_ps_leave(dev); 174 174 175 175 priv->ps_force = true; ··· 311 311 /* ~130 Mb/s real (802.11n) */ 312 312 range->throughput = 130 * 1000 * 1000; 313 313 314 - if (priv->rf_set_sens != NULL) 315 - /* signal level threshold range */ 316 - range->sensitivity = priv->max_sens; 317 - 318 314 range->max_qual.qual = 100; 319 315 range->max_qual.level = 0; 320 316 range->max_qual.noise = 0; ··· 342 346 343 347 for (i = 0, val = 0; i < 14; i++) { 344 348 if ((priv->rtllib->active_channel_map)[i + 1]) { 349 + s32 freq_khz; 350 + 345 351 range->freq[val].i = i + 1; 346 - range->freq[val].m = rtllib_wlan_frequencies[i] * 347 - 100000; 352 + freq_khz = ieee80211_channel_to_freq_khz(i + 1, NL80211_BAND_2GHZ); 353 + range->freq[val].m = freq_khz * 100; 348 354 range->freq[val].e = 1; 349 355 val++; 350 356 } ··· 375 377 int ret; 376 378 377 379 if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) { 378 - if ((ieee->state >= RTLLIB_ASSOCIATING) && 379 - (ieee->state <= RTLLIB_ASSOCIATING_AUTHENTICATED)) 380 + if ((ieee->link_state >= RTLLIB_ASSOCIATING) && 381 + (ieee->link_state <= RTLLIB_ASSOCIATING_AUTHENTICATED)) 380 382 return 0; 381 - if ((priv->rtllib->state == RTLLIB_LINKED) && 383 + if ((priv->rtllib->link_state == MAC80211_LINKED) && 382 384 (priv->rtllib->CntAfterLink < 2)) 383 385 return 0; 384 386 } ··· 391 393 rt_state = priv->rtllib->rf_power_state; 392 394 if (!priv->up) 393 395 return -ENETDOWN; 394 - if (priv->rtllib->link_detect_info.bBusyTraffic == true) 396 + if (priv->rtllib->link_detect_info.bBusyTraffic) 395 397 return -EAGAIN; 396 398 397 399 if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { ··· 409 411 410 412 priv->rtllib->FirstIe_InScan = true; 411 413 412 - if (priv->rtllib->state != RTLLIB_LINKED) { 414 + if (priv->rtllib->link_state != MAC80211_LINKED) { 413 415 if (rt_state == rf_off) { 414 416 if (priv->rtllib->rf_off_reason > 415 417 RF_CHANGE_BY_IPS) { ··· 423 425 mutex_unlock(&priv->rtllib->ips_mutex); 424 426 } 425 427 rtllib_stop_scan(priv->rtllib); 426 - if (priv->rtllib->LedControlHandler) 427 - priv->rtllib->LedControlHandler(dev, 428 - LED_CTL_SITE_SURVEY); 429 - 430 428 if (priv->rtllib->rf_power_state != rf_off) { 431 429 priv->rtllib->actscanning = true; 432 430 ··· 568 574 if (priv->hw_radio_off) 569 575 return 0; 570 576 571 - if (wrqu->frag.disabled) 577 + if (wrqu->frag.disabled) { 572 578 priv->rtllib->fts = DEFAULT_FRAG_THRESHOLD; 573 - else { 579 + } else { 574 580 if (wrqu->frag.value < MIN_FRAG_THRESHOLD || 575 581 wrqu->frag.value > MAX_FRAG_THRESHOLD) 576 582 return -EINVAL; ··· 801 807 return 0; 802 808 } 803 809 804 - static int _rtl92e_wx_get_sens(struct net_device *dev, 805 - struct iw_request_info *info, 806 - union iwreq_data *wrqu, char *extra) 807 - { 808 - struct r8192_priv *priv = rtllib_priv(dev); 809 - 810 - if (priv->rf_set_sens == NULL) 811 - return -1; /* we have not this support for this radio */ 812 - wrqu->sens.value = priv->sens; 813 - return 0; 814 - } 815 - 816 - static int _rtl92e_wx_set_sens(struct net_device *dev, 817 - struct iw_request_info *info, 818 - union iwreq_data *wrqu, char *extra) 819 - { 820 - struct r8192_priv *priv = rtllib_priv(dev); 821 - 822 - short err = 0; 823 - 824 - if (priv->hw_radio_off) 825 - return 0; 826 - 827 - mutex_lock(&priv->wx_mutex); 828 - if (priv->rf_set_sens == NULL) { 829 - err = -1; /* we have not this support for this radio */ 830 - goto exit; 831 - } 832 - if (priv->rf_set_sens(dev, wrqu->sens.value) == 0) 833 - priv->sens = wrqu->sens.value; 834 - else 835 - err = -EINVAL; 836 - 837 - exit: 838 - mutex_unlock(&priv->wx_mutex); 839 - 840 - return err; 841 - } 842 - 843 810 static int _rtl92e_wx_set_encode_ext(struct net_device *dev, 844 811 struct iw_request_info *info, 845 812 union iwreq_data *wrqu, char *extra) ··· 1021 1066 [IW_IOCTL(SIOCGIWFREQ)] = _rtl92e_wx_get_freq, 1022 1067 [IW_IOCTL(SIOCSIWMODE)] = _rtl92e_wx_set_mode, 1023 1068 [IW_IOCTL(SIOCGIWMODE)] = _rtl92e_wx_get_mode, 1024 - [IW_IOCTL(SIOCSIWSENS)] = _rtl92e_wx_set_sens, 1025 - [IW_IOCTL(SIOCGIWSENS)] = _rtl92e_wx_get_sens, 1026 1069 [IW_IOCTL(SIOCGIWRANGE)] = _rtl92e_wx_get_range, 1027 1070 [IW_IOCTL(SIOCSIWAP)] = _rtl92e_wx_set_wap, 1028 1071 [IW_IOCTL(SIOCGIWAP)] = _rtl92e_wx_get_wap, ··· 1124 1171 int tmp_qual = 0; 1125 1172 int tmp_noise = 0; 1126 1173 1127 - if (ieee->state < RTLLIB_LINKED) { 1174 + if (ieee->link_state < MAC80211_LINKED) { 1128 1175 wstats->qual.qual = 10; 1129 1176 wstats->qual.level = 0; 1130 1177 wstats->qual.noise = 0x100 - 100; /* -100 dBm */
+23 -44
drivers/staging/rtl8192e/rtl819x_HT.h
··· 24 24 }; 25 25 26 26 struct ht_capab_ele { 27 - 28 27 u8 AdvCoding:1; 29 28 u8 ChlWidth:1; 30 29 u8 MimoPwrSave:2; ··· 45 46 46 47 u8 MCS[16]; 47 48 48 - 49 49 u16 ExtHTCapInfo; 50 50 51 51 u8 TxBFCap[4]; ··· 52 54 u8 ASCap; 53 55 54 56 } __packed; 55 - 56 57 57 58 struct ht_info_ele { 58 59 u8 ControlChl; ··· 91 94 HT_AGG_FORCE_DISABLE = 2, 92 95 }; 93 96 94 - 95 97 struct rt_hi_throughput { 96 - u8 enable_ht; 97 - u8 bCurrentHTSupport; 98 - 99 - u8 bRegBW40MHz; 100 - u8 bCurBW40MHz; 101 - 102 - u8 bRegShortGI40MHz; 103 - u8 bCurShortGI40MHz; 104 - 105 - u8 bRegShortGI20MHz; 106 - u8 bCurShortGI20MHz; 107 - 108 - u8 bRegSuppCCK; 109 - u8 bCurSuppCCK; 110 - 98 + u8 enable_ht; 99 + u8 bCurrentHTSupport; 100 + u8 bRegBW40MHz; 101 + u8 bCurBW40MHz; 102 + u8 bRegShortGI40MHz; 103 + u8 bCurShortGI40MHz; 104 + u8 bRegShortGI20MHz; 105 + u8 bCurShortGI20MHz; 106 + u8 bRegSuppCCK; 107 + u8 bCurSuppCCK; 111 108 enum ht_spec_ver ePeerHTSpecVer; 112 - 113 - 114 109 struct ht_capab_ele SelfHTCap; 115 110 struct ht_info_ele SelfHTInfo; 116 - 117 - u8 PeerHTCapBuf[32]; 118 - u8 PeerHTInfoBuf[32]; 119 - 120 - 121 - u8 bAMSDU_Support; 122 - u16 nAMSDU_MaxSize; 123 - u8 bCurrent_AMSDU_Support; 124 - u16 nCurrent_AMSDU_MaxSize; 125 - 126 - u8 bAMPDUEnable; 127 - u8 bCurrentAMPDUEnable; 128 - u8 AMPDU_Factor; 129 - u8 CurrentAMPDUFactor; 130 - u8 MPDU_Density; 111 + u8 PeerHTCapBuf[32]; 112 + u8 PeerHTInfoBuf[32]; 113 + u8 bAMSDU_Support; 114 + u16 nAMSDU_MaxSize; 115 + u8 bCurrent_AMSDU_Support; 116 + u16 nCurrent_AMSDU_MaxSize; 117 + u8 bAMPDUEnable; 118 + u8 bCurrentAMPDUEnable; 119 + u8 AMPDU_Factor; 120 + u8 CurrentAMPDUFactor; 121 + u8 MPDU_Density; 131 122 u8 current_mpdu_density; 132 - 133 123 enum ht_aggre_mode ForcedAMPDUMode; 134 124 u8 forced_ampdu_factor; 135 125 u8 forced_mpdu_density; 136 - 137 126 enum ht_aggre_mode ForcedAMSDUMode; 138 127 u8 forced_short_gi; 139 - 140 128 u8 current_op_mode; 141 - 142 129 u8 self_mimo_ps; 143 130 u8 peer_mimo_ps; 144 - 145 131 enum ht_extchnl_offset CurSTAExtChnlOffset; 146 132 u8 cur_tx_bw40mhz; 147 133 u8 sw_bw_in_progress; 148 134 u8 reg_rt2rt_aggregation; 149 - u8 RT2RT_HT_Mode; 135 + u8 RT2RT_HT_Mode; 150 136 u8 current_rt2rt_aggregation; 151 137 u8 current_rt2rt_long_slot_time; 152 138 u8 sz_rt2rt_agg_buf[10]; 153 - 154 139 u8 reg_rx_reorder_enable; 155 140 u8 cur_rx_reorder_enable; 156 141 u8 rx_reorder_win_size; 157 142 u8 rx_reorder_pending_time; 158 143 u16 rx_reorder_drop_counter; 159 - u8 IOTPeer; 144 + u8 IOTPeer; 160 145 u32 iot_action; 161 146 u8 iot_ra_func; 162 147 } __packed;
+5 -7
drivers/staging/rtl8192e/rtl819x_HTProc.c
··· 424 424 } 425 425 426 426 switch (ieee->mode) { 427 - case IEEE_A: 428 - case IEEE_B: 429 - case IEEE_G: 427 + case WIRELESS_MODE_B: 428 + case WIRELESS_MODE_G: 430 429 for (i = 0; i <= 15; i++) 431 430 pOperateMCS[i] = 0; 432 431 break; 433 - case IEEE_N_24G: 434 - case IEEE_N_5G: 432 + case WIRELESS_MODE_N_24G: 435 433 pOperateMCS[0] &= RATE_ADPT_1SS_MASK; 436 434 pOperateMCS[1] &= RATE_ADPT_2SS_MASK; 437 435 pOperateMCS[3] &= RATE_ADPT_MCS32_MASK; ··· 833 835 ieee->set_chan(ieee->dev, 834 836 ieee->current_network.channel); 835 837 836 - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, 838 + ieee->set_bw_mode_handler(ieee->dev, HT_CHANNEL_WIDTH_20_40, 837 839 ht_info->CurSTAExtChnlOffset); 838 840 } else { 839 841 ieee->set_chan(ieee->dev, ieee->current_network.channel); 840 - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, 842 + ieee->set_bw_mode_handler(ieee->dev, HT_CHANNEL_WIDTH_20, 841 843 HT_EXTCHNL_OFFSET_NO_EXT); 842 844 } 843 845
-1
drivers/staging/rtl8192e/rtl819x_Qos.h
··· 104 104 }; 105 105 106 106 union qos_tclas { 107 - 108 107 struct _TYPE_GENERAL { 109 108 u8 Priority; 110 109 u8 ClassifierType;
-2
drivers/staging/rtl8192e/rtl819x_TS.h
··· 53 53 u8 num; 54 54 }; 55 55 56 - 57 - 58 56 #endif
+15 -72
drivers/staging/rtl8192e/rtllib.h
··· 38 38 39 39 #include <linux/netdevice.h> 40 40 #include <linux/if_arp.h> /* ARPHRD_ETHER */ 41 + #include <net/cfg80211.h> 41 42 #include <net/lib80211.h> 42 43 43 44 #define MAX_PRECMD_CNT 16 ··· 140 139 u8 rata_index; 141 140 u8 queue_index; 142 141 u16 txbuf_size; 143 - u8 RATRIndex; 142 + u8 ratr_index; 144 143 u8 bAMSDU:1; 145 144 u8 bFromAggrQ:1; 146 145 u8 reserved6:6; ··· 309 308 }; 310 309 311 310 #define aSifsTime \ 312 - (((priv->rtllib->current_network.mode == IEEE_A) \ 313 - || (priv->rtllib->current_network.mode == IEEE_N_24G) \ 314 - || (priv->rtllib->current_network.mode == IEEE_N_5G)) ? 16 : 10) 311 + ((priv->rtllib->current_network.mode == WIRELESS_MODE_N_24G) ? 16 : 10) 315 312 316 313 #define MGMT_QUEUE_NUM 5 317 314 ··· 420 421 IG_Max 421 422 }; 422 423 423 - enum led_ctl_mode { 424 - LED_CTL_POWER_ON = 1, 425 - LED_CTL_LINK = 2, 426 - LED_CTL_NO_LINK = 3, 427 - LED_CTL_TX = 4, 428 - LED_CTL_RX = 5, 429 - LED_CTL_SITE_SURVEY = 6, 430 - LED_CTL_POWER_OFF = 7, 431 - LED_CTL_START_TO_LINK = 8, 432 - }; 433 - 434 424 enum wireless_mode { 435 425 WIRELESS_MODE_UNKNOWN = 0x00, 436 426 WIRELESS_MODE_A = 0x01, ··· 427 439 WIRELESS_MODE_G = 0x04, 428 440 WIRELESS_MODE_AUTO = 0x08, 429 441 WIRELESS_MODE_N_24G = 0x10, 430 - WIRELESS_MODE_N_5G = 0x20 431 442 }; 432 443 433 444 #ifndef ETH_P_PAE ··· 486 499 #define RTLLIB_CCK_MODULATION (1<<0) 487 500 #define RTLLIB_OFDM_MODULATION (1<<1) 488 501 489 - #define RTLLIB_24GHZ_BAND (1<<0) 490 - #define RTLLIB_52GHZ_BAND (1<<1) 491 - 492 502 #define RTLLIB_CCK_RATE_LEN 4 493 503 #define RTLLIB_CCK_RATE_1MB 0x02 494 504 #define RTLLIB_CCK_RATE_2MB 0x04 ··· 532 548 u8 signal; 533 549 u8 noise; 534 550 u16 rate; /* in 100 kbps */ 535 - u8 received_channel; 536 551 u8 control; 537 552 u8 mask; 538 - u8 freq; 539 553 u16 len; 540 554 u64 tsf; 541 555 u32 beacon_time; ··· 1118 1136 struct list_head list; 1119 1137 }; 1120 1138 1121 - enum rtllib_state { 1122 - 1139 + enum rtl_link_state { 1123 1140 /* the card is not linked at all */ 1124 - RTLLIB_NOLINK = 0, 1141 + MAC80211_NOLINK = 0, 1125 1142 1126 1143 /* RTLLIB_ASSOCIATING* are for BSS client mode 1127 1144 * the driver shall not perform RX filtering unless ··· 1145 1164 /* the link is ok. the card associated to a BSS or linked 1146 1165 * to a ibss cell or acting as an AP and creating the bss 1147 1166 */ 1148 - RTLLIB_LINKED, 1167 + MAC80211_LINKED, 1149 1168 1150 1169 /* same as LINKED, but the driver shall apply RX filter 1151 1170 * rules as we are in NO_LINK mode. As the card is still 1152 1171 * logically linked, but it is doing a syncro site survey 1153 1172 * then it will be back to LINKED state. 1154 1173 */ 1155 - RTLLIB_LINKED_SCANNING, 1174 + MAC80211_LINKED_SCANNING, 1156 1175 }; 1157 1176 1158 1177 #define DEFAULT_MAX_SCAN_AGE (15 * HZ) ··· 1279 1298 1280 1299 #define RT_MAX_LD_SLOT_NUM 10 1281 1300 struct rt_link_detect { 1282 - 1283 1301 u32 NumRecvBcnInPeriod; 1284 1302 u32 NumRecvDataInPeriod; 1285 1303 ··· 1296 1316 }; 1297 1317 1298 1318 struct sw_cam_table { 1299 - 1300 1319 u8 macaddr[ETH_ALEN]; 1301 1320 bool bused; 1302 1321 u8 key_buf[16]; ··· 1488 1509 */ 1489 1510 struct rtllib_network current_network; 1490 1511 1491 - enum rtllib_state state; 1512 + enum rtl_link_state link_state; 1492 1513 1493 1514 int short_slot; 1494 1515 int mode; /* A, B, G */ ··· 1630 1651 }; 1631 1652 1632 1653 /* Callback functions */ 1633 - void (*set_security)(struct net_device *dev, 1634 - struct rtllib_security *sec); 1635 - 1636 - /* Used to TX data frame by using txb structs. 1637 - * this is not used if in the softmac_features 1638 - * is set the flag IEEE_SOFTMAC_TX_QUEUE 1639 - */ 1640 - int (*hard_start_xmit)(struct rtllib_txb *txb, 1641 - struct net_device *dev); 1642 - 1643 - int (*reset_port)(struct net_device *dev); 1644 1654 1645 1655 /* Softmac-generated frames (management) are TXed via this 1646 1656 * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is ··· 1650 1682 void (*softmac_data_hard_start_xmit)(struct sk_buff *skb, 1651 1683 struct net_device *dev, int rate); 1652 1684 1653 - /* stops the HW queue for DATA frames. Useful to avoid 1654 - * waste time to TX data frame when we are reassociating 1655 - * This function can sleep. 1656 - */ 1657 - void (*data_hard_stop)(struct net_device *dev); 1658 - 1659 - /* OK this is complementing to data_poll_hard_stop */ 1660 - void (*data_hard_resume)(struct net_device *dev); 1661 - 1662 1685 /* ask to the driver to retune the radio. 1663 1686 * This function can sleep. the driver should ensure 1664 1687 * the radio has been switched before return. 1665 1688 */ 1666 1689 void (*set_chan)(struct net_device *dev, short ch); 1667 - 1668 - void (*rtllib_start_hw_scan)(struct net_device *dev); 1669 - void (*rtllib_stop_hw_scan)(struct net_device *dev); 1670 1690 1671 1691 /* indicate the driver that the link state is changed 1672 1692 * for example it may indicate the card is associated now. ··· 1685 1729 1686 1730 /* check whether Tx hw resource available */ 1687 1731 short (*check_nic_enough_desc)(struct net_device *dev, int queue_index); 1688 - void (*SetBWModeHandler)(struct net_device *dev, 1689 - enum ht_channel_width bandwidth, 1690 - enum ht_extchnl_offset Offset); 1732 + void (*set_bw_mode_handler)(struct net_device *dev, 1733 + enum ht_channel_width bandwidth, 1734 + enum ht_extchnl_offset Offset); 1691 1735 bool (*GetNmodeSupportBySecCfg)(struct net_device *dev); 1692 - void (*SetWirelessMode)(struct net_device *dev, u8 wireless_mode); 1736 + void (*set_wireless_mode)(struct net_device *dev, u8 wireless_mode); 1693 1737 bool (*GetHalfNmodeSupportByAPsHandler)(struct net_device *dev); 1694 1738 u8 (*rtllib_ap_sec_type)(struct rtllib_device *ieee); 1695 - void (*InitialGainHandler)(struct net_device *dev, u8 Operation); 1696 - bool (*SetFwCmdHandler)(struct net_device *dev, 1697 - enum fw_cmd_io_type FwCmdIO); 1698 - void (*UpdateBeaconInterruptHandler)(struct net_device *dev, 1699 - bool start); 1739 + void (*init_gain_handler)(struct net_device *dev, u8 Operation); 1700 1740 void (*ScanOperationBackupHandler)(struct net_device *dev, 1701 1741 u8 Operation); 1702 - void (*LedControlHandler)(struct net_device *dev, 1703 - enum led_ctl_mode LedAction); 1704 1742 void (*SetHwRegHandler)(struct net_device *dev, u8 variable, u8 *val); 1705 1743 1706 1744 void (*AllowAllDestAddrHandler)(struct net_device *dev, ··· 1702 1752 1703 1753 void (*rtllib_ips_leave_wq)(struct net_device *dev); 1704 1754 void (*rtllib_ips_leave)(struct net_device *dev); 1705 - void (*LeisurePSLeave)(struct net_device *dev); 1755 + void (*leisure_ps_leave)(struct net_device *dev); 1706 1756 1707 1757 /* This must be the last item so that it points to the data 1708 1758 * allocated beyond this structure by alloc_rtllib ··· 1710 1760 u8 priv[]; 1711 1761 }; 1712 1762 1713 - #define IEEE_A (1<<0) 1714 - #define IEEE_B (1<<1) 1715 - #define IEEE_G (1<<2) 1716 - #define IEEE_N_24G (1<<4) 1717 - #define IEEE_N_5G (1<<5) 1718 - #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) 1763 + #define IEEE_MODE_MASK (WIRELESS_MODE_B | WIRELESS_MODE_G) 1719 1764 1720 1765 /* Generate a 802.11 header */ 1721 1766 ··· 2024 2079 struct tx_ts_record *pTxTS); 2025 2080 void RemovePeerTS(struct rtllib_device *ieee, u8 *Addr); 2026 2081 void RemoveAllTS(struct rtllib_device *ieee); 2027 - 2028 - extern const long rtllib_wlan_frequencies[]; 2029 2082 2030 2083 static inline const char *escape_essid(const char *essid, u8 essid_len) 2031 2084 {
+22 -41
drivers/staging/rtl8192e/rtllib_rx.c
··· 225 225 return 0; 226 226 } 227 227 228 - /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation 229 - * Ethernet-II snap header (RFC1042 for most EtherTypes) 230 - */ 231 - static unsigned char rfc1042_header[] = { 232 - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 233 - }; 234 - 235 - /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ 236 - static unsigned char bridge_tunnel_header[] = { 237 - 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 238 - }; 239 - 240 228 /* No encapsulation header if EtherType < 0x600 (=length) */ 241 229 242 230 /* Called by rtllib_rx_frame_decrypt */ ··· 252 264 RTLLIB_FCTL_FROMDS && 253 265 memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN) == 0) { 254 266 /* FromDS frame with own addr as DA */ 255 - } else 267 + } else { 256 268 return 0; 269 + } 257 270 258 271 if (skb->len < 24 + 8) 259 272 return 0; ··· 422 433 if (*last_frag + 1 != frag) 423 434 /* out-of-order fragment */ 424 435 goto drop; 425 - } else 436 + } else { 426 437 *last_seq = seq; 438 + } 427 439 428 440 *last_frag = frag; 429 441 *last_time = jiffies; ··· 1196 1206 u8 nr_subframes) 1197 1207 { 1198 1208 if (unicast) { 1199 - if (ieee->state == RTLLIB_LINKED) { 1209 + if (ieee->link_state == MAC80211_LINKED) { 1200 1210 if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + 1201 1211 ieee->link_detect_info.NumTxOkInPeriod) > 8) || 1202 1212 (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) { 1203 - ieee->LeisurePSLeave(ieee->dev); 1213 + ieee->leisure_ps_leave(ieee->dev); 1204 1214 } 1205 1215 } 1206 1216 } ··· 2117 2127 network->tim.tim_period = info_element->data[1]; 2118 2128 2119 2129 network->dtim_period = info_element->data[1]; 2120 - if (ieee->state != RTLLIB_LINKED) 2130 + if (ieee->link_state != MAC80211_LINKED) 2121 2131 break; 2122 2132 network->last_dtim_sta_time = jiffies; 2123 2133 ··· 2301 2311 network->CountryIeLen = 0; 2302 2312 memset(network->CountryIeBuf, 0, MAX_IE_LEN); 2303 2313 HTInitializeBssDesc(&network->bssht); 2304 - if (stats->freq == RTLLIB_52GHZ_BAND) { 2305 - /* for A band (No DS info) */ 2306 - network->channel = stats->received_channel; 2307 - } else 2308 - network->flags |= NETWORK_HAS_CCK; 2314 + network->flags |= NETWORK_HAS_CCK; 2309 2315 2310 2316 network->wpa_ie_len = 0; 2311 2317 network->rsn_ie_len = 0; ··· 2315 2329 return 1; 2316 2330 2317 2331 network->mode = 0; 2318 - if (stats->freq == RTLLIB_52GHZ_BAND) 2319 - network->mode = IEEE_A; 2320 - else { 2321 - if (network->flags & NETWORK_HAS_OFDM) 2322 - network->mode |= IEEE_G; 2323 - if (network->flags & NETWORK_HAS_CCK) 2324 - network->mode |= IEEE_B; 2325 - } 2332 + 2333 + if (network->flags & NETWORK_HAS_OFDM) 2334 + network->mode |= WIRELESS_MODE_G; 2335 + if (network->flags & NETWORK_HAS_CCK) 2336 + network->mode |= WIRELESS_MODE_B; 2326 2337 2327 2338 if (network->mode == 0) { 2328 2339 netdev_dbg(ieee->dev, "Filtered out '%s (%pM)' network.\n", ··· 2329 2346 } 2330 2347 2331 2348 if (network->bssht.bd_support_ht) { 2332 - if (network->mode == IEEE_A) 2333 - network->mode = IEEE_N_5G; 2334 - else if (network->mode & (IEEE_G | IEEE_B)) 2335 - network->mode = IEEE_N_24G; 2349 + if (network->mode & (WIRELESS_MODE_G | WIRELESS_MODE_B)) 2350 + network->mode = WIRELESS_MODE_N_24G; 2336 2351 } 2337 2352 if (rtllib_is_empty_essid(network->ssid, network->ssid_len)) 2338 2353 network->flags |= NETWORK_EMPTY_ESSID; ··· 2576 2595 if (is_same_network(&ieee->current_network, network, 2577 2596 (network->ssid_len ? 1 : 0))) { 2578 2597 update_network(ieee, &ieee->current_network, network); 2579 - if ((ieee->current_network.mode == IEEE_N_24G || 2580 - ieee->current_network.mode == IEEE_G) && 2598 + if ((ieee->current_network.mode == WIRELESS_MODE_N_24G || 2599 + ieee->current_network.mode == WIRELESS_MODE_G) && 2581 2600 ieee->current_network.berp_info_valid) { 2582 2601 if (ieee->current_network.erp_value & ERP_UseProtection) 2583 2602 ieee->current_network.buseprotection = true; ··· 2585 2604 ieee->current_network.buseprotection = false; 2586 2605 } 2587 2606 if (is_beacon(frame_ctl)) { 2588 - if (ieee->state >= RTLLIB_LINKED) 2607 + if (ieee->link_state >= MAC80211_LINKED) 2589 2608 ieee->link_detect_info.NumRecvBcnInPeriod++; 2590 2609 } 2591 2610 } ··· 2643 2662 || ((ieee->current_network.ssid_len == network->ssid_len) && 2644 2663 (strncmp(ieee->current_network.ssid, network->ssid, 2645 2664 network->ssid_len) == 0) && 2646 - (ieee->state == RTLLIB_NOLINK)))) 2665 + (ieee->link_state == MAC80211_NOLINK)))) 2647 2666 renew = 1; 2648 2667 update_network(ieee, target, network); 2649 2668 if (renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE)) ··· 2654 2673 if (is_beacon(frame_ctl) && 2655 2674 is_same_network(&ieee->current_network, network, 2656 2675 (network->ssid_len ? 1 : 0)) && 2657 - (ieee->state == RTLLIB_LINKED)) { 2676 + (ieee->link_state == MAC80211_LINKED)) { 2658 2677 ieee->handle_beacon(ieee->dev, beacon, &ieee->current_network); 2659 2678 } 2660 2679 free_network: ··· 2683 2702 2684 2703 if (ieee->sta_sleep || (ieee->ps != RTLLIB_PS_DISABLED && 2685 2704 ieee->iw_mode == IW_MODE_INFRA && 2686 - ieee->state == RTLLIB_LINKED)) 2705 + ieee->link_state == MAC80211_LINKED)) 2687 2706 schedule_work(&ieee->ps_task); 2688 2707 2689 2708 break; ··· 2700 2719 if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) && 2701 2720 ((ieee->iw_mode == IW_MODE_ADHOC || 2702 2721 ieee->iw_mode == IW_MODE_MASTER) && 2703 - ieee->state == RTLLIB_LINKED)) 2722 + ieee->link_state == MAC80211_LINKED)) 2704 2723 rtllib_rx_probe_rq(ieee, skb); 2705 2724 break; 2706 2725 }
+116 -217
drivers/staging/rtl8192e/rtllib_softmac.c
··· 22 22 23 23 static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl); 24 24 25 - 26 25 static short rtllib_is_54g(struct rtllib_network *net) 27 26 { 28 27 return (net->rates_ex_len > 0) || (net->rates_len > 4); ··· 138 139 */ 139 140 ieee->mgmt_queue_head = nh; 140 141 ieee->mgmt_queue_ring[nh] = skb; 141 - 142 142 } 143 143 144 144 static void init_mgmt_queue(struct rtllib_device *ieee) ··· 145 147 ieee->mgmt_queue_tail = ieee->mgmt_queue_head = 0; 146 148 } 147 149 148 - 149 150 u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) 150 151 { 151 152 u16 i; 152 153 u8 QueryRate = 0; 153 154 u8 BasicRate; 154 155 155 - 156 156 for (i = 0; i < ieee->current_network.rates_len; i++) { 157 - BasicRate = ieee->current_network.rates[i]&0x7F; 157 + BasicRate = ieee->current_network.rates[i] & 0x7F; 158 158 if (!rtllib_is_cck_rate(BasicRate)) { 159 159 if (QueryRate == 0) { 160 160 QueryRate = BasicRate; ··· 181 185 rate = ieee->basic_rate & 0x7f; 182 186 183 187 if (rate == 0) { 184 - if (ieee->mode == IEEE_A || 185 - ieee->mode == IEEE_N_5G || 186 - (ieee->mode == IEEE_N_24G && !ht_info->bCurSuppCCK)) 188 + if (ieee->mode == WIRELESS_MODE_N_24G && !ht_info->bCurSuppCCK) 187 189 rate = 0x0c; 188 190 else 189 191 rate = 0x02; ··· 213 219 tcb_desc->queue_index = HIGH_QUEUE; 214 220 215 221 tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); 216 - tcb_desc->RATRIndex = 7; 222 + tcb_desc->ratr_index = 7; 217 223 tcb_desc->tx_dis_rate_fallback = 1; 218 224 tcb_desc->tx_use_drv_assinged_rate = 1; 219 225 if (single) { 220 226 if (ieee->queue_stop) { 221 227 enqueue_mgmt(ieee, skb); 222 228 } else { 223 - header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0]<<4); 229 + header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); 224 230 225 231 if (ieee->seq_ctrl[0] == 0xFFF) 226 232 ieee->seq_ctrl[0] = 0; ··· 280 286 type = WLAN_FC_GET_TYPE(fc); 281 287 stype = WLAN_FC_GET_STYPE(fc); 282 288 283 - 284 289 if (stype != RTLLIB_STYPE_PSPOLL) 285 290 tcb_desc->queue_index = MGNT_QUEUE; 286 291 else ··· 288 295 if (ieee->disable_mgnt_queue) 289 296 tcb_desc->queue_index = HIGH_QUEUE; 290 297 291 - 292 298 tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); 293 - tcb_desc->RATRIndex = 7; 299 + tcb_desc->ratr_index = 7; 294 300 tcb_desc->tx_dis_rate_fallback = 1; 295 301 tcb_desc->tx_use_drv_assinged_rate = 1; 296 302 if (single) { ··· 300 308 ieee->seq_ctrl[0] = 0; 301 309 else 302 310 ieee->seq_ctrl[0]++; 303 - 304 311 } 305 312 /* avoid watchdog triggers */ 306 313 ieee->softmac_data_hard_start_xmit(skb, ieee->dev, ··· 315 324 ieee->seq_ctrl[0]++; 316 325 } 317 326 ieee->softmac_hard_start_xmit(skb, ieee->dev); 318 - 319 327 } 320 328 } 321 329 ··· 378 388 (msecs_to_jiffies(ieee->current_network.beacon_interval - 5))); 379 389 } 380 390 381 - 382 391 static void rtllib_send_beacon_cb(struct timer_list *t) 383 392 { 384 393 struct rtllib_device *ieee = ··· 400 411 ieee->AllowAllDestAddrHandler(dev, true, !bInitState); 401 412 } 402 413 403 - 404 414 /* Disables network monitor mode. Only packets destinated to 405 415 * us will be received. 406 416 */ ··· 412 424 413 425 ieee->AllowAllDestAddrHandler(dev, false, !bInitState); 414 426 } 415 - 416 427 417 428 /* Enables the specialized promiscuous mode required by Intel. 418 429 * In this mode, Intel intends to hear traffics from/to other STAs in the ··· 435 448 ieee->net_promiscuous_md = true; 436 449 } 437 450 EXPORT_SYMBOL(rtllib_EnableIntelPromiscuousMode); 438 - 439 451 440 452 /* Disables the specialized promiscuous mode required by Intel. 441 453 * See MgntEnableIntelPromiscuousMode for detail. ··· 467 481 } 468 482 } 469 483 470 - 471 484 static void rtllib_send_probe_requests(struct rtllib_device *ieee, u8 is_mesh) 472 485 { 473 486 if (ieee->active_scan && (ieee->softmac_features & ··· 479 494 static void rtllib_update_active_chan_map(struct rtllib_device *ieee) 480 495 { 481 496 memcpy(ieee->active_channel_map, GET_DOT11D_INFO(ieee)->channel_map, 482 - MAX_CHANNEL_NUMBER+1); 497 + MAX_CHANNEL_NUMBER + 1); 483 498 } 484 499 485 500 /* this performs syncro scan blocking the caller until all channels ··· 508 523 * performing a complete syncro scan before conclude 509 524 * there are no interesting cell and to create a 510 525 * new one. In this case the link state is 511 - * RTLLIB_NOLINK until we found an interesting cell. 526 + * MAC80211_NOLINK until we found an interesting cell. 512 527 * If so the ieee8021_new_net, called by the RX path 513 - * will set the state to RTLLIB_LINKED, so we stop 528 + * will set the state to MAC80211_LINKED, so we stop 514 529 * scanning 515 530 * 2- We are linked and the root uses run iwlist scan. 516 - * So we switch to RTLLIB_LINKED_SCANNING to remember 531 + * So we switch to MAC80211_LINKED_SCANNING to remember 517 532 * that we are still logically linked (not interested in 518 533 * new network events, despite for updating the net list, 519 534 * but we are temporarly 'unlinked' as the driver shall ··· 522 537 * if the state become LINKED because of the #1 situation 523 538 */ 524 539 525 - if (ieee->state == RTLLIB_LINKED) 540 + if (ieee->link_state == MAC80211_LINKED) 526 541 goto out; 527 542 if (ieee->sync_scan_hurryup) { 528 543 netdev_info(ieee->dev, ··· 543 558 ieee->actscanning = false; 544 559 ieee->sync_scan_hurryup = 0; 545 560 546 - if (ieee->state >= RTLLIB_LINKED) { 561 + if (ieee->link_state >= MAC80211_LINKED) { 547 562 if (IS_DOT11D_ENABLE(ieee)) 548 563 dot11d_scan_complete(ieee); 549 564 } ··· 614 629 mutex_unlock(&ieee->scan_mutex); 615 630 } 616 631 617 - 618 - 619 632 static void rtllib_beacons_start(struct rtllib_device *ieee) 620 633 { 621 634 unsigned long flags; ··· 636 653 637 654 spin_unlock_irqrestore(&ieee->beacon_lock, flags); 638 655 del_timer_sync(&ieee->beacon_timer); 639 - 640 656 } 641 - 642 657 643 658 void rtllib_stop_send_beacons(struct rtllib_device *ieee) 644 659 { ··· 646 665 } 647 666 EXPORT_SYMBOL(rtllib_stop_send_beacons); 648 667 649 - 650 668 void rtllib_start_send_beacons(struct rtllib_device *ieee) 651 669 { 652 670 ieee->start_send_beacons(ieee->dev); ··· 654 674 } 655 675 EXPORT_SYMBOL(rtllib_start_send_beacons); 656 676 657 - 658 677 static void rtllib_softmac_stop_scan(struct rtllib_device *ieee) 659 678 { 660 679 mutex_lock(&ieee->scan_mutex); ··· 661 682 if (ieee->scanning_continue == 1) { 662 683 ieee->scanning_continue = 0; 663 684 ieee->actscanning = false; 664 - 685 + mutex_unlock(&ieee->scan_mutex); 665 686 cancel_delayed_work_sync(&ieee->softmac_scan_wq); 687 + } else { 688 + mutex_unlock(&ieee->scan_mutex); 666 689 } 667 - 668 - mutex_unlock(&ieee->scan_mutex); 669 690 } 670 691 671 692 void rtllib_stop_scan(struct rtllib_device *ieee) 672 693 { 673 - if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) { 694 + if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) 674 695 rtllib_softmac_stop_scan(ieee); 675 - } else { 676 - if (ieee->rtllib_stop_hw_scan) 677 - ieee->rtllib_stop_hw_scan(ieee->dev); 678 - } 679 696 } 680 697 EXPORT_SYMBOL(rtllib_stop_scan); 681 698 682 699 void rtllib_stop_scan_syncro(struct rtllib_device *ieee) 683 700 { 684 - if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) { 701 + if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) 685 702 ieee->sync_scan_hurryup = 1; 686 - } else { 687 - if (ieee->rtllib_stop_hw_scan) 688 - ieee->rtllib_stop_hw_scan(ieee->dev); 689 - } 690 703 } 691 704 EXPORT_SYMBOL(rtllib_stop_scan_syncro); 692 705 ··· 710 739 ieee->scanning_continue = 1; 711 740 schedule_delayed_work(&ieee->softmac_scan_wq, 0); 712 741 } 713 - } else { 714 - if (ieee->rtllib_start_hw_scan) 715 - ieee->rtllib_start_hw_scan(ieee->dev); 716 742 } 717 743 } 718 744 ··· 721 753 RESET_CIE_WATCHDOG(ieee); 722 754 } 723 755 ieee->sync_scan_hurryup = 0; 724 - if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) { 756 + if (ieee->softmac_features & IEEE_SOFTMAC_SCAN) 725 757 rtllib_softmac_scan_syncro(ieee, is_mesh); 726 - } else { 727 - if (ieee->rtllib_start_hw_scan) 728 - ieee->rtllib_start_hw_scan(ieee->dev); 729 - } 730 758 } 731 759 EXPORT_SYMBOL(rtllib_start_scan_syncro); 732 760 ··· 781 817 782 818 char *ssid = ieee->current_network.ssid; 783 819 int ssid_len = ieee->current_network.ssid_len; 784 - int rate_len = ieee->current_network.rates_len+2; 820 + int rate_len = ieee->current_network.rates_len + 2; 785 821 int rate_ex_len = ieee->current_network.rates_ex_len; 786 822 int wpa_ie_len = ieee->wpa_ie_len; 787 823 u8 erpinfo_content = 0; ··· 802 838 else 803 839 atim_len = 0; 804 840 805 - if ((ieee->current_network.mode == IEEE_G) || 806 - (ieee->current_network.mode == IEEE_N_24G && 841 + if ((ieee->current_network.mode == WIRELESS_MODE_G) || 842 + (ieee->current_network.mode == WIRELESS_MODE_N_24G && 807 843 ieee->ht_info->bCurSuppCCK)) { 808 844 erp_len = 3; 809 845 erpinfo_content = 0; 810 846 if (ieee->current_network.buseprotection) 811 847 erpinfo_content |= ERP_UseProtection; 812 - } else 848 + } else { 813 849 erp_len = 0; 850 + } 814 851 815 852 crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; 816 853 encrypt = ieee->host_encrypt && crypt && crypt->ops && ··· 835 870 } 836 871 } 837 872 838 - beacon_size = sizeof(struct rtllib_probe_response)+2+ 873 + beacon_size = sizeof(struct rtllib_probe_response) + 2 + 839 874 ssid_len + 3 + rate_len + rate_ex_len + atim_len + erp_len 840 875 + wpa_ie_len + ieee->tx_headroom; 841 876 skb = dev_alloc_skb(beacon_size); ··· 868 903 if (encrypt) 869 904 beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); 870 905 871 - 872 906 beacon_buf->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_PROBE_RESP); 873 907 beacon_buf->info_element[0].id = MFIE_TYPE_SSID; 874 908 beacon_buf->info_element[0].len = ssid_len; ··· 879 915 tag += ssid_len; 880 916 881 917 *(tag++) = MFIE_TYPE_RATES; 882 - *(tag++) = rate_len-2; 883 - memcpy(tag, ieee->current_network.rates, rate_len-2); 884 - tag += rate_len-2; 918 + *(tag++) = rate_len - 2; 919 + memcpy(tag, ieee->current_network.rates, rate_len - 2); 920 + tag += rate_len - 2; 885 921 886 922 *(tag++) = MFIE_TYPE_DS_SET; 887 923 *(tag++) = 1; ··· 903 939 } 904 940 if (rate_ex_len) { 905 941 *(tag++) = MFIE_TYPE_RATES_EX; 906 - *(tag++) = rate_ex_len-2; 907 - memcpy(tag, ieee->current_network.rates_ex, rate_ex_len-2); 908 - tag += rate_ex_len-2; 942 + *(tag++) = rate_ex_len - 2; 943 + memcpy(tag, ieee->current_network.rates_ex, rate_ex_len - 2); 944 + tag += rate_ex_len - 2; 909 945 } 910 946 911 947 if (wpa_ie_len) { ··· 945 981 ether_addr_copy(assoc->header.addr2, ieee->dev->dev_addr); 946 982 assoc->capability = cpu_to_le16(ieee->iw_mode == IW_MODE_MASTER ? 947 983 WLAN_CAPABILITY_ESS : WLAN_CAPABILITY_IBSS); 948 - 949 984 950 985 if (ieee->short_slot) 951 986 assoc->capability |= ··· 1000 1037 ether_addr_copy(auth->header.addr1, dest); 1001 1038 auth->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_AUTH); 1002 1039 return skb; 1003 - 1004 - 1005 1040 } 1006 1041 1007 1042 static struct sk_buff *rtllib_null_func(struct rtllib_device *ieee, short pwr) ··· 1007 1046 struct sk_buff *skb; 1008 1047 struct rtllib_hdr_3addr *hdr; 1009 1048 1010 - skb = dev_alloc_skb(sizeof(struct rtllib_hdr_3addr)+ieee->tx_headroom); 1049 + skb = dev_alloc_skb(sizeof(struct rtllib_hdr_3addr) + ieee->tx_headroom); 1011 1050 if (!skb) 1012 1051 return NULL; 1013 1052 ··· 1024 1063 (pwr ? RTLLIB_FCTL_PM : 0)); 1025 1064 1026 1065 return skb; 1027 - 1028 - 1029 1066 } 1030 1067 1031 1068 static struct sk_buff *rtllib_pspoll_func(struct rtllib_device *ieee) ··· 1031 1072 struct sk_buff *skb; 1032 1073 struct rtllib_pspoll_hdr *hdr; 1033 1074 1034 - skb = dev_alloc_skb(sizeof(struct rtllib_pspoll_hdr)+ieee->tx_headroom); 1075 + skb = dev_alloc_skb(sizeof(struct rtllib_pspoll_hdr) + ieee->tx_headroom); 1035 1076 if (!skb) 1036 1077 return NULL; 1037 1078 ··· 1047 1088 RTLLIB_FCTL_PM); 1048 1089 1049 1090 return skb; 1050 - 1051 1091 } 1052 1092 1053 1093 static void rtllib_resp_to_assoc_rq(struct rtllib_device *ieee, u8 *dest) ··· 1057 1099 softmac_mgmt_xmit(buf, ieee); 1058 1100 } 1059 1101 1060 - 1061 1102 static void rtllib_resp_to_auth(struct rtllib_device *ieee, int s, u8 *dest) 1062 1103 { 1063 1104 struct sk_buff *buf = rtllib_auth_resp(ieee, s, dest); ··· 1065 1108 softmac_mgmt_xmit(buf, ieee); 1066 1109 } 1067 1110 1068 - 1069 1111 static void rtllib_resp_to_probe(struct rtllib_device *ieee, u8 *dest) 1070 1112 { 1071 1113 struct sk_buff *buf = rtllib_probe_resp(ieee, dest); ··· 1072 1116 if (buf) 1073 1117 softmac_mgmt_xmit(buf, ieee); 1074 1118 } 1075 - 1076 1119 1077 1120 static inline int SecIsInPMKIDList(struct rtllib_device *ieee, u8 *bssid) 1078 1121 { ··· 1150 1195 } 1151 1196 1152 1197 if (beacon->bCkipSupported) 1153 - ckip_ie_len = 30+2; 1198 + ckip_ie_len = 30 + 2; 1154 1199 if (beacon->bCcxRmEnable) 1155 - ccxrm_ie_len = 6+2; 1200 + ccxrm_ie_len = 6 + 2; 1156 1201 if (beacon->BssCcxVerNumber >= 2) 1157 - cxvernum_ie_len = 5+2; 1202 + cxvernum_ie_len = 5 + 2; 1158 1203 1159 1204 PMKCacheIdx = SecIsInPMKIDList(ieee, ieee->current_network.bssid); 1160 1205 if (PMKCacheIdx >= 0) { ··· 1185 1230 1186 1231 hdr = skb_put(skb, sizeof(struct rtllib_assoc_request_frame) + 2); 1187 1232 1188 - 1189 1233 hdr->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_ASSOC_REQ); 1190 1234 hdr->header.duration_id = cpu_to_le16(37); 1191 1235 ether_addr_copy(hdr->header.addr1, beacon->bssid); ··· 1201 1247 hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_PREAMBLE); 1202 1248 1203 1249 if (ieee->short_slot && 1204 - (beacon->capability&WLAN_CAPABILITY_SHORT_SLOT_TIME)) 1250 + (beacon->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)) 1205 1251 hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); 1206 - 1207 1252 1208 1253 hdr->listen_interval = cpu_to_le16(beacon->listen_interval); 1209 1254 ··· 1239 1286 sizeof(AironetIeOui)); 1240 1287 1241 1288 osCcxAironetIE.Octet[IE_CISCO_FLAG_POSITION] |= 1242 - (SUPPORT_CKIP_PK|SUPPORT_CKIP_MIC); 1289 + (SUPPORT_CKIP_PK | SUPPORT_CKIP_MIC); 1243 1290 tag = skb_put(skb, ckip_ie_len); 1244 1291 *tag++ = MFIE_TYPE_AIRONET; 1245 1292 *tag++ = osCcxAironetIE.Length; ··· 1350 1397 * Here we will check if there are good nets to associate 1351 1398 * with, so we retry or just get back to NO_LINK and scanning 1352 1399 */ 1353 - if (ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATING) { 1400 + if (ieee->link_state == RTLLIB_ASSOCIATING_AUTHENTICATING) { 1354 1401 netdev_dbg(ieee->dev, "Authentication failed\n"); 1355 1402 ieee->softmac_stats.no_auth_rs++; 1356 1403 } else { ··· 1358 1405 ieee->softmac_stats.no_ass_rs++; 1359 1406 } 1360 1407 1361 - ieee->state = RTLLIB_ASSOCIATING_RETRY; 1408 + ieee->link_state = RTLLIB_ASSOCIATING_RETRY; 1362 1409 1363 1410 schedule_delayed_work(&ieee->associate_retry_wq, 1364 1411 RTLLIB_SOFTMAC_ASSOC_RETRY_TIME); ··· 1384 1431 1385 1432 skb = rtllib_authentication_req(beacon, ieee, 0, daddr); 1386 1433 1387 - if (!skb) 1434 + if (!skb) { 1388 1435 rtllib_associate_abort(ieee); 1389 - else { 1390 - ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATING; 1436 + } else { 1437 + ieee->link_state = RTLLIB_ASSOCIATING_AUTHENTICATING; 1391 1438 netdev_dbg(ieee->dev, "Sending authentication request\n"); 1392 1439 softmac_mgmt_xmit(skb, ieee); 1393 1440 if (!timer_pending(&ieee->associate_timer)) { ··· 1409 1456 1410 1457 skb = rtllib_authentication_req(beacon, ieee, chlen + 2, beacon->bssid); 1411 1458 1412 - if (!skb) 1459 + if (!skb) { 1413 1460 rtllib_associate_abort(ieee); 1414 - else { 1415 - c = skb_put(skb, chlen+2); 1461 + } else { 1462 + c = skb_put(skb, chlen + 2); 1416 1463 *(c++) = MFIE_TYPE_CHALLENGE; 1417 1464 *(c++) = chlen; 1418 1465 memcpy(c, challenge, chlen); ··· 1424 1471 sizeof(struct rtllib_hdr_3addr)); 1425 1472 1426 1473 softmac_mgmt_xmit(skb, ieee); 1427 - mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); 1474 + mod_timer(&ieee->associate_timer, jiffies + (HZ / 2)); 1428 1475 } 1429 1476 kfree(challenge); 1430 1477 } ··· 1440 1487 1441 1488 ieee->softmac_stats.tx_ass_rq++; 1442 1489 skb = rtllib_association_req(beacon, ieee); 1443 - if (!skb) 1490 + if (!skb) { 1444 1491 rtllib_associate_abort(ieee); 1445 - else { 1492 + } else { 1446 1493 softmac_mgmt_xmit(skb, ieee); 1447 - mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); 1494 + mod_timer(&ieee->associate_timer, jiffies + (HZ / 2)); 1448 1495 } 1449 1496 } 1450 1497 ··· 1471 1518 netdev_info(ieee->dev, "Using G rates:%d\n", ieee->rate); 1472 1519 } else { 1473 1520 ieee->rate = 22; 1474 - ieee->SetWirelessMode(ieee->dev, IEEE_B); 1521 + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_B); 1475 1522 netdev_info(ieee->dev, "Using B rates:%d\n", ieee->rate); 1476 1523 } 1477 1524 if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { ··· 1499 1546 netdev_info(ieee->dev, "silent reset associate\n"); 1500 1547 ieee->is_silent_reset = false; 1501 1548 } 1502 - 1503 - if (ieee->data_hard_resume) 1504 - ieee->data_hard_resume(ieee->dev); 1505 - 1506 1549 } 1507 1550 1508 1551 static void rtllib_sta_send_associnfo(struct rtllib_device *ieee) ··· 1509 1560 { 1510 1561 del_timer_sync(&ieee->associate_timer); 1511 1562 1512 - ieee->state = RTLLIB_LINKED; 1563 + ieee->link_state = MAC80211_LINKED; 1513 1564 rtllib_sta_send_associnfo(ieee); 1514 1565 1515 1566 schedule_work(&ieee->associate_complete_wq); ··· 1523 1574 rtllib_stop_scan_syncro(ieee); 1524 1575 ieee->rtllib_ips_leave(ieee->dev); 1525 1576 mutex_lock(&ieee->wx_mutex); 1526 - 1527 - if (ieee->data_hard_stop) 1528 - ieee->data_hard_stop(ieee->dev); 1529 1577 1530 1578 rtllib_stop_scan(ieee); 1531 1579 HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ··· 1549 1603 /* we are interested in new only if we are not associated 1550 1604 * and we are not associating / authenticating 1551 1605 */ 1552 - if (ieee->state != RTLLIB_NOLINK) 1606 + if (ieee->link_state != MAC80211_NOLINK) 1553 1607 return; 1554 1608 1555 1609 if ((ieee->iw_mode == IW_MODE_INFRA) && !(net->capability & ··· 1584 1638 net->ssid_len = net->hidden_ssid_len; 1585 1639 ssidbroad = 1; 1586 1640 } 1587 - } else 1641 + } else { 1588 1642 ssidmatch = 1589 1643 (ieee->current_network.ssid_len == net->ssid_len) && 1590 1644 (!strncmp(ieee->current_network.ssid, net->ssid, 1591 1645 net->ssid_len)); 1646 + } 1592 1647 1593 1648 /* if the user set the AP check if match. 1594 1649 * if the network does not broadcast essid we check the ··· 1648 1701 ieee->ht_info->bCurrentHTSupport = 1649 1702 false; 1650 1703 1651 - ieee->state = RTLLIB_ASSOCIATING; 1652 - if (ieee->LedControlHandler != NULL) 1653 - ieee->LedControlHandler(ieee->dev, 1654 - LED_CTL_START_TO_LINK); 1704 + ieee->link_state = RTLLIB_ASSOCIATING; 1655 1705 schedule_delayed_work( 1656 1706 &ieee->associate_procedure_wq, 0); 1657 1707 } else { ··· 1656 1712 (ieee->modulation & 1657 1713 RTLLIB_OFDM_MODULATION)) { 1658 1714 ieee->rate = 108; 1659 - ieee->SetWirelessMode(ieee->dev, 1660 - IEEE_G); 1715 + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); 1661 1716 netdev_info(ieee->dev, 1662 1717 "Using G rates\n"); 1663 1718 } else { 1664 1719 ieee->rate = 22; 1665 - ieee->SetWirelessMode(ieee->dev, 1666 - IEEE_B); 1720 + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_B); 1667 1721 netdev_info(ieee->dev, 1668 1722 "Using B rates\n"); 1669 1723 } 1670 1724 memset(ieee->dot11ht_oper_rate_set, 0, 16); 1671 - ieee->state = RTLLIB_LINKED; 1725 + ieee->link_state = MAC80211_LINKED; 1672 1726 } 1673 1727 } 1674 1728 } ··· 1680 1738 spin_lock_irqsave(&ieee->lock, flags); 1681 1739 1682 1740 list_for_each_entry(target, &ieee->network_list, list) { 1683 - 1684 1741 /* if the state become different that NOLINK means 1685 1742 * we had found what we are searching for 1686 1743 */ 1687 1744 1688 - if (ieee->state != RTLLIB_NOLINK) 1745 + if (ieee->link_state != MAC80211_NOLINK) 1689 1746 break; 1690 1747 1691 1748 if (ieee->scan_age == 0 || time_after(target->last_scanned + ··· 1826 1885 status_code = le16_to_cpu(response_head->status); 1827 1886 if ((status_code == WLAN_STATUS_ASSOC_DENIED_RATES || 1828 1887 status_code == WLAN_STATUS_CAPS_UNSUPPORTED) && 1829 - ((ieee->mode == IEEE_G) && 1830 - (ieee->current_network.mode == IEEE_N_24G) && 1831 - (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) { 1888 + ((ieee->mode == WIRELESS_MODE_G) && 1889 + (ieee->current_network.mode == WIRELESS_MODE_N_24G) && 1890 + (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT - 1)))) { 1832 1891 ieee->ht_info->iot_action |= HT_IOT_ACT_PURE_N_MODE; 1833 1892 } else { 1834 1893 ieee->AsocRetryCount = 0; ··· 1866 1925 { 1867 1926 u8 dest[ETH_ALEN]; 1868 1927 1869 - 1870 1928 ieee->softmac_stats.rx_ass_rq++; 1871 1929 if (assoc_rq_parse(ieee->dev, skb, dest) != -1) 1872 1930 rtllib_resp_to_assoc_rq(ieee, dest); ··· 1875 1935 1876 1936 void rtllib_sta_ps_send_null_frame(struct rtllib_device *ieee, short pwr) 1877 1937 { 1878 - 1879 1938 struct sk_buff *buf = rtllib_null_func(ieee, pwr); 1880 1939 1881 1940 if (buf) ··· 1950 2011 LPSAwakeIntvl_tmp = period + 1951 2012 (psc->LPSAwakeIntvl - 1952 2013 period) - 1953 - ((psc->LPSAwakeIntvl-period) % 2014 + ((psc->LPSAwakeIntvl - period) % 1954 2015 period); 1955 2016 else 1956 2017 LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl; ··· 1960 2021 ieee->current_network.tim.tim_count) 1961 2022 LPSAwakeIntvl_tmp = count + 1962 2023 (psc->LPSAwakeIntvl - count) - 1963 - ((psc->LPSAwakeIntvl-count)%period); 2024 + ((psc->LPSAwakeIntvl - count) % period); 1964 2025 else 1965 2026 LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl; 1966 2027 } ··· 1972 2033 } 1973 2034 1974 2035 return 1; 1975 - 1976 - 1977 2036 } 1978 2037 1979 2038 static inline void rtllib_sta_ps(struct work_struct *work) ··· 1987 2050 1988 2051 if ((ieee->ps == RTLLIB_PS_DISABLED || 1989 2052 ieee->iw_mode != IW_MODE_INFRA || 1990 - ieee->state != RTLLIB_LINKED)) { 2053 + ieee->link_state != MAC80211_LINKED)) { 1991 2054 spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); 1992 2055 rtllib_sta_wakeup(ieee, 1); 1993 2056 ··· 2010 2073 ieee->ps_time = time; 2011 2074 } 2012 2075 spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags2); 2013 - 2014 2076 } 2015 2077 2016 2078 ieee->bAwakePktSent = false; ··· 2024 2088 2025 2089 out: 2026 2090 spin_unlock_irqrestore(&ieee->lock, flags); 2027 - 2028 2091 } 2029 2092 2030 2093 static void rtllib_sta_wakeup(struct rtllib_device *ieee, short nl) ··· 2040 2105 } 2041 2106 } 2042 2107 return; 2043 - 2044 2108 } 2045 2109 2046 2110 if (ieee->sta_sleep == LPS_IS_SLEEP) ··· 2141 2207 WLAN_FC_GET_STYPE(frame_ctl)); 2142 2208 2143 2209 if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && 2144 - ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATED && 2210 + ieee->link_state == RTLLIB_ASSOCIATING_AUTHENTICATED && 2145 2211 (ieee->iw_mode == IW_MODE_INFRA)) { 2146 2212 errcode = assoc_parse(ieee, skb, &aid); 2147 2213 if (!errcode) { ··· 2151 2217 2152 2218 if (!network) 2153 2219 return 1; 2154 - ieee->state = RTLLIB_LINKED; 2220 + ieee->link_state = MAC80211_LINKED; 2155 2221 ieee->assoc_id = aid; 2156 2222 ieee->softmac_stats.rx_ass_ok++; 2157 2223 /* station support qos */ ··· 2220 2286 } 2221 2287 2222 2288 if (ieee->open_wep || !challenge) { 2223 - ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED; 2289 + ieee->link_state = RTLLIB_ASSOCIATING_AUTHENTICATED; 2224 2290 ieee->softmac_stats.rx_auth_rs_ok++; 2225 2291 if (!(ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE)) { 2226 2292 if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { ··· 2235 2301 } 2236 2302 /* Dummy wirless mode setting to avoid encryption issue */ 2237 2303 if (bSupportNmode) { 2238 - ieee->SetWirelessMode(ieee->dev, 2304 + ieee->set_wireless_mode(ieee->dev, 2239 2305 ieee->current_network.mode); 2240 2306 } else { 2241 2307 /*TODO*/ 2242 - ieee->SetWirelessMode(ieee->dev, IEEE_G); 2308 + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); 2243 2309 } 2244 2310 2245 - if ((ieee->current_network.mode == IEEE_N_24G) && 2311 + if ((ieee->current_network.mode == WIRELESS_MODE_N_24G) && 2246 2312 bHalfSupportNmode) { 2247 2313 netdev_info(ieee->dev, "======>enter half N mode\n"); 2248 2314 ieee->bHalfWirelessN24GMode = true; ··· 2259 2325 rtllib_rx_auth(struct rtllib_device *ieee, struct sk_buff *skb, 2260 2326 struct rtllib_rx_stats *rx_stats) 2261 2327 { 2262 - 2263 2328 if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) { 2264 - if (ieee->state == RTLLIB_ASSOCIATING_AUTHENTICATING && 2329 + if (ieee->link_state == RTLLIB_ASSOCIATING_AUTHENTICATING && 2265 2330 (ieee->iw_mode == IW_MODE_INFRA)) { 2266 2331 netdev_dbg(ieee->dev, 2267 2332 "Received authentication response"); ··· 2285 2352 * both for disassociation and deauthentication 2286 2353 */ 2287 2354 if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && 2288 - ieee->state == RTLLIB_LINKED && 2355 + ieee->link_state == MAC80211_LINKED && 2289 2356 (ieee->iw_mode == IW_MODE_INFRA)) { 2290 2357 frame_ctl = le16_to_cpu(header->frame_ctl); 2291 2358 netdev_info(ieee->dev, 2292 2359 "==========>received disassoc/deauth(%x) frame, reason code:%x\n", 2293 2360 WLAN_FC_GET_STYPE(frame_ctl), 2294 2361 ((struct rtllib_disassoc *)skb->data)->reason); 2295 - ieee->state = RTLLIB_ASSOCIATING; 2362 + ieee->link_state = RTLLIB_ASSOCIATING; 2296 2363 ieee->softmac_stats.reassoc++; 2297 2364 ieee->is_roaming = true; 2298 2365 ieee->link_detect_info.bBusyTraffic = false; 2299 2366 rtllib_disassociate(ieee); 2300 2367 RemovePeerTS(ieee, header->addr2); 2301 - if (ieee->LedControlHandler != NULL) 2302 - ieee->LedControlHandler(ieee->dev, 2303 - LED_CTL_START_TO_LINK); 2304 - 2305 2368 if (!(ieee->rtllib_ap_sec_type(ieee) & 2306 - (SEC_ALG_CCMP|SEC_ALG_TKIP))) 2369 + (SEC_ALG_CCMP | SEC_ALG_TKIP))) 2307 2370 schedule_delayed_work( 2308 2371 &ieee->associate_procedure_wq, 5); 2309 2372 } ··· 2366 2437 */ 2367 2438 void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee) 2368 2439 { 2369 - 2370 2440 unsigned int queue_index = txb->queue_index; 2371 2441 unsigned long flags; 2372 2442 int i; ··· 2410 2482 rtllib_txb_free(txb); 2411 2483 2412 2484 spin_unlock_irqrestore(&ieee->lock, flags); 2413 - 2414 2485 } 2415 2486 2416 2487 void rtllib_reset_queue(struct rtllib_device *ieee) ··· 2424 2497 } 2425 2498 ieee->queue_stop = 0; 2426 2499 spin_unlock_irqrestore(&ieee->lock, flags); 2427 - 2428 2500 } 2429 2501 EXPORT_SYMBOL(rtllib_reset_queue); 2430 2502 ··· 2460 2534 ether_addr_copy(ieee->current_network.bssid, ieee->dev->dev_addr); 2461 2535 2462 2536 ieee->set_chan(ieee->dev, ieee->current_network.channel); 2463 - ieee->state = RTLLIB_LINKED; 2537 + ieee->link_state = MAC80211_LINKED; 2464 2538 ieee->link_change(ieee->dev); 2465 2539 notify_wx_assoc_event(ieee); 2466 - 2467 - if (ieee->data_hard_resume) 2468 - ieee->data_hard_resume(ieee->dev); 2469 - 2470 2540 netif_carrier_on(ieee->dev); 2471 2541 } 2472 2542 2473 2543 static void rtllib_start_monitor_mode(struct rtllib_device *ieee) 2474 2544 { 2475 2545 /* reset hardware status */ 2476 - if (ieee->raw_tx) { 2477 - if (ieee->data_hard_resume) 2478 - ieee->data_hard_resume(ieee->dev); 2479 - 2546 + if (ieee->raw_tx) 2480 2547 netif_carrier_on(ieee->dev); 2481 - } 2482 2548 } 2483 2549 2484 2550 static void rtllib_start_ibss_wq(void *data) ··· 2497 2579 ieee->ssid_set = 1; 2498 2580 } 2499 2581 2500 - ieee->state = RTLLIB_NOLINK; 2501 - ieee->mode = IEEE_G; 2582 + ieee->link_state = MAC80211_NOLINK; 2583 + ieee->mode = WIRELESS_MODE_G; 2502 2584 /* check if we have this cell in our network list */ 2503 2585 rtllib_softmac_check_all_nets(ieee); 2504 - 2505 2586 2506 2587 /* if not then the state is not linked. Maybe the user switched to 2507 2588 * ad-hoc mode just after being in monitor mode, or just after ··· 2509 2592 * after setting ad-hoc mode. So we have to give another try.. 2510 2593 * Here, in ibss mode, should be safe to do this without extra care 2511 2594 * (in bss mode we had to make sure no-one tried to associate when 2512 - * we had just checked the ieee->state and we was going to start the 2595 + * we had just checked the ieee->link_state and we was going to start the 2513 2596 * scan) because in ibss mode the rtllib_new_net function, when 2514 - * finds a good net, just set the ieee->state to RTLLIB_LINKED, 2597 + * finds a good net, just set the ieee->link_state to MAC80211_LINKED, 2515 2598 * so, at worst, we waste a bit of time to initiate an unneeded syncro 2516 2599 * scan, that will stop at the first round because it sees the state 2517 2600 * associated. 2518 2601 */ 2519 - if (ieee->state == RTLLIB_NOLINK) 2602 + if (ieee->link_state == MAC80211_NOLINK) 2520 2603 rtllib_start_scan_syncro(ieee, 0); 2521 2604 2522 2605 /* the network definitively is not here.. create a new cell */ 2523 - if (ieee->state == RTLLIB_NOLINK) { 2606 + if (ieee->link_state == MAC80211_NOLINK) { 2524 2607 netdev_info(ieee->dev, "creating new IBSS cell\n"); 2525 2608 ieee->current_network.channel = ieee->bss_start_channel; 2526 2609 if (!ieee->wap_set) 2527 2610 eth_random_addr(ieee->current_network.bssid); 2528 2611 2529 2612 if (ieee->modulation & RTLLIB_CCK_MODULATION) { 2530 - 2531 2613 ieee->current_network.rates_len = 4; 2532 2614 2533 2615 ieee->current_network.rates[0] = ··· 2538 2622 ieee->current_network.rates[3] = 2539 2623 RTLLIB_BASIC_RATE_MASK | RTLLIB_CCK_RATE_11MB; 2540 2624 2541 - } else 2625 + } else { 2542 2626 ieee->current_network.rates_len = 0; 2627 + } 2543 2628 2544 2629 if (ieee->modulation & RTLLIB_OFDM_MODULATION) { 2545 2630 ieee->current_network.rates_ex_len = 8; ··· 2569 2652 } 2570 2653 2571 2654 ieee->current_network.qos_data.supported = 0; 2572 - ieee->SetWirelessMode(ieee->dev, IEEE_G); 2655 + ieee->set_wireless_mode(ieee->dev, WIRELESS_MODE_G); 2573 2656 ieee->current_network.mode = ieee->mode; 2574 2657 ieee->current_network.atim_window = 0; 2575 2658 ieee->current_network.capability = WLAN_CAPABILITY_IBSS; 2576 2659 } 2577 2660 2578 2661 netdev_info(ieee->dev, "%s(): ieee->mode = %d\n", __func__, ieee->mode); 2579 - if ((ieee->mode == IEEE_N_24G) || (ieee->mode == IEEE_N_5G)) 2662 + if (ieee->mode == WIRELESS_MODE_N_24G) 2580 2663 HTUseDefaultSetting(ieee); 2581 2664 else 2582 2665 ieee->ht_info->bCurrentHTSupport = false; 2583 2666 2584 2667 ieee->SetHwRegHandler(ieee->dev, HW_VAR_MEDIA_STATUS, 2585 - (u8 *)(&ieee->state)); 2668 + (u8 *)(&ieee->link_state)); 2586 2669 2587 - ieee->state = RTLLIB_LINKED; 2670 + ieee->link_state = MAC80211_LINKED; 2588 2671 ieee->link_change(ieee->dev); 2589 2672 2590 2673 HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); 2591 - if (ieee->LedControlHandler != NULL) 2592 - ieee->LedControlHandler(ieee->dev, LED_CTL_LINK); 2593 - 2594 2674 rtllib_start_send_beacons(ieee); 2595 2675 2596 2676 notify_wx_assoc_event(ieee); 2597 - 2598 - if (ieee->data_hard_resume) 2599 - ieee->data_hard_resume(ieee->dev); 2600 - 2601 2677 netif_carrier_on(ieee->dev); 2602 2678 2603 2679 mutex_unlock(&ieee->wx_mutex); ··· 2618 2708 rtllib_softmac_check_all_nets(ieee); 2619 2709 2620 2710 /* ensure no-one start an associating process (thus setting 2621 - * the ieee->state to rtllib_ASSOCIATING) while we 2711 + * the ieee->link_state to rtllib_ASSOCIATING) while we 2622 2712 * have just checked it and we are going to enable scan. 2623 2713 * The rtllib_new_net function is always called with 2624 2714 * lock held (from both rtllib_softmac_check_all_nets and ··· 2626 2716 */ 2627 2717 spin_lock_irqsave(&ieee->lock, flags); 2628 2718 2629 - if (ieee->state == RTLLIB_NOLINK) 2719 + if (ieee->link_state == MAC80211_NOLINK) 2630 2720 rtllib_start_scan(ieee); 2631 2721 spin_unlock_irqrestore(&ieee->lock, flags); 2632 2722 } ··· 2644 2734 if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) 2645 2735 rtllib_reset_queue(ieee); 2646 2736 2647 - if (ieee->data_hard_stop) 2648 - ieee->data_hard_stop(ieee->dev); 2649 2737 if (IS_DOT11D_ENABLE(ieee)) 2650 2738 dot11d_reset(ieee); 2651 - ieee->state = RTLLIB_NOLINK; 2739 + ieee->link_state = MAC80211_NOLINK; 2652 2740 ieee->is_set_key = false; 2653 2741 ieee->wap_set = 0; 2654 2742 ··· 2665 2757 if (!ieee->proto_started) 2666 2758 goto exit; 2667 2759 2668 - if (ieee->state != RTLLIB_ASSOCIATING_RETRY) 2760 + if (ieee->link_state != RTLLIB_ASSOCIATING_RETRY) 2669 2761 goto exit; 2670 2762 2671 - /* until we do not set the state to RTLLIB_NOLINK 2763 + /* until we do not set the state to MAC80211_NOLINK 2672 2764 * there are no possibility to have someone else trying 2673 2765 * to start an association procedure (we get here with 2674 - * ieee->state = RTLLIB_ASSOCIATING). 2675 - * When we set the state to RTLLIB_NOLINK it is possible 2766 + * ieee->link_state = RTLLIB_ASSOCIATING). 2767 + * When we set the state to MAC80211_NOLINK it is possible 2676 2768 * that the RX path run an attempt to associate, but 2677 2769 * both rtllib_softmac_check_all_nets and the 2678 2770 * RX path works with ieee->lock held so there are no ··· 2682 2774 * state and we are going to start the scan. 2683 2775 */ 2684 2776 ieee->beinretry = true; 2685 - ieee->state = RTLLIB_NOLINK; 2777 + ieee->link_state = MAC80211_NOLINK; 2686 2778 2687 2779 rtllib_softmac_check_all_nets(ieee); 2688 2780 2689 2781 spin_lock_irqsave(&ieee->lock, flags); 2690 2782 2691 - if (ieee->state == RTLLIB_NOLINK) 2783 + if (ieee->link_state == MAC80211_NOLINK) 2692 2784 rtllib_start_scan(ieee); 2693 2785 spin_unlock_irqrestore(&ieee->lock, flags); 2694 2786 ··· 2714 2806 b->header.frame_ctl = cpu_to_le16(RTLLIB_STYPE_BEACON); 2715 2807 2716 2808 return skb; 2717 - 2718 2809 } 2719 2810 2720 2811 struct sk_buff *rtllib_get_beacon(struct rtllib_device *ieee) ··· 2747 2840 } 2748 2841 EXPORT_SYMBOL(rtllib_softmac_stop_protocol); 2749 2842 2750 - 2751 2843 void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown) 2752 2844 { 2753 2845 if (!ieee->proto_started) ··· 2765 2859 cancel_delayed_work_sync(&ieee->link_change_wq); 2766 2860 rtllib_stop_scan(ieee); 2767 2861 2768 - if (ieee->state <= RTLLIB_ASSOCIATING_AUTHENTICATED) 2769 - ieee->state = RTLLIB_NOLINK; 2862 + if (ieee->link_state <= RTLLIB_ASSOCIATING_AUTHENTICATED) 2863 + ieee->link_state = MAC80211_NOLINK; 2770 2864 2771 - if (ieee->state == RTLLIB_LINKED) { 2865 + if (ieee->link_state == MAC80211_LINKED) { 2772 2866 if (ieee->iw_mode == IW_MODE_INFRA) 2773 2867 SendDisassociation(ieee, 1, WLAN_REASON_DEAUTH_LEAVING); 2774 2868 rtllib_disassociate(ieee); ··· 2824 2918 ieee->last_packet_time[i] = 0; 2825 2919 } 2826 2920 2827 - if (ieee->UpdateBeaconInterruptHandler) 2828 - ieee->UpdateBeaconInterruptHandler(ieee->dev, false); 2829 - 2830 2921 ieee->wmm_acm = 0; 2831 2922 /* if the user set the MAC of the ad-hoc cell and then 2832 2923 * switch to managed mode, shall we make sure that association 2833 2924 * attempts does not fail just because the user provide the essid 2834 2925 * and the nic is still checking for the AP MAC ?? 2835 2926 */ 2836 - if (ieee->iw_mode == IW_MODE_INFRA) { 2927 + switch (ieee->iw_mode) { 2928 + case IW_MODE_INFRA: 2837 2929 rtllib_start_bss(ieee); 2838 - } else if (ieee->iw_mode == IW_MODE_ADHOC) { 2839 - if (ieee->UpdateBeaconInterruptHandler) 2840 - ieee->UpdateBeaconInterruptHandler(ieee->dev, true); 2841 - 2930 + break; 2931 + case IW_MODE_ADHOC: 2842 2932 rtllib_start_ibss(ieee); 2843 - 2844 - } else if (ieee->iw_mode == IW_MODE_MASTER) { 2933 + break; 2934 + case IW_MODE_MASTER: 2845 2935 rtllib_start_master_bss(ieee); 2846 - } else if (ieee->iw_mode == IW_MODE_MONITOR) { 2936 + break; 2937 + case IW_MODE_MONITOR: 2847 2938 rtllib_start_monitor_mode(ieee); 2939 + break; 2848 2940 } 2849 2941 } 2850 2942 ··· 2852 2948 2853 2949 memset(&ieee->current_network, 0, sizeof(struct rtllib_network)); 2854 2950 2855 - ieee->state = RTLLIB_NOLINK; 2951 + ieee->link_state = MAC80211_NOLINK; 2856 2952 for (i = 0; i < 5; i++) 2857 2953 ieee->seq_ctrl[i] = 0; 2858 2954 ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC); ··· 3043 3139 u8 i; 3044 3140 bool bFilterOutNonAssociatedBSSID = false; 3045 3141 3046 - rtllib->state = RTLLIB_NOLINK; 3142 + rtllib->link_state = MAC80211_NOLINK; 3047 3143 3048 3144 for (i = 0; i < 6; i++) 3049 3145 rtllib->current_network.bssid[i] = 0x55; ··· 3059 3155 rtllib->SetHwRegHandler(rtllib->dev, HW_VAR_CECHK_BSSID, 3060 3156 (u8 *)(&bFilterOutNonAssociatedBSSID)); 3061 3157 notify_wx_assoc_event(rtllib); 3062 - 3063 3158 } 3064 3159 3065 3160 static void rtllib_MlmeDisassociateRequest(struct rtllib_device *rtllib, ··· 3070 3167 RemovePeerTS(rtllib, asSta); 3071 3168 3072 3169 if (memcmp(rtllib->current_network.bssid, asSta, 6) == 0) { 3073 - rtllib->state = RTLLIB_NOLINK; 3170 + rtllib->link_state = MAC80211_NOLINK; 3074 3171 3075 3172 for (i = 0; i < 6; i++) 3076 3173 rtllib->current_network.bssid[i] = 0x22; ··· 3082 3179 3083 3180 rtllib->SetHwRegHandler(rtllib->dev, HW_VAR_BSSID, 3084 3181 rtllib->current_network.bssid); 3085 - 3086 3182 } 3087 - 3088 3183 } 3089 3184 3090 3185 static void ··· 3099 3198 rtllib_MlmeDisassociateRequest(rtllib, rtllib->current_network.bssid, 3100 3199 asRsn); 3101 3200 3102 - rtllib->state = RTLLIB_NOLINK; 3201 + rtllib->link_state = MAC80211_NOLINK; 3103 3202 } 3104 3203 3105 3204 bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn) ··· 3107 3206 if (rtllib->ps != RTLLIB_PS_DISABLED) 3108 3207 rtllib->sta_wake_up(rtllib->dev); 3109 3208 3110 - if (rtllib->state == RTLLIB_LINKED) { 3209 + if (rtllib->link_state == MAC80211_LINKED) { 3111 3210 if (rtllib->iw_mode == IW_MODE_ADHOC) 3112 3211 rtllib_MgntDisconnectIBSS(rtllib); 3113 3212 if (rtllib->iw_mode == IW_MODE_INFRA) 3114 3213 rtllib_MgntDisconnectAP(rtllib, asRsn); 3115 - 3116 3214 } 3117 3215 3118 3216 return true; ··· 3126 3226 return; 3127 3227 3128 3228 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 3129 - if (ieee->state == RTLLIB_LINKED) 3229 + if (ieee->link_state == MAC80211_LINKED) { 3130 3230 memcpy(wrqu.ap_addr.sa_data, ieee->current_network.bssid, 3131 3231 ETH_ALEN); 3132 - else { 3133 - 3232 + } else { 3134 3233 netdev_info(ieee->dev, "%s(): Tell user space disconnected\n", 3135 3234 __func__); 3136 3235 eth_zero_addr(wrqu.ap_addr.sa_data);
+20 -65
drivers/staging/rtl8192e/rtllib_softmac_wx.c
··· 15 15 16 16 #include "rtllib.h" 17 17 #include "dot11d.h" 18 - /* FIXME: add A freqs */ 19 - 20 - const long rtllib_wlan_frequencies[] = { 21 - 2412, 2417, 2422, 2427, 22 - 2432, 2437, 2442, 2447, 23 - 2452, 2457, 2462, 2467, 24 - 2472, 2484 25 - }; 26 - EXPORT_SYMBOL(rtllib_wlan_frequencies); 27 - 28 18 29 19 int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a, 30 20 union iwreq_data *wrqu, char *b) ··· 33 43 if (fwrq->e == 1) { 34 44 if ((fwrq->m >= (int)2.412e8 && 35 45 fwrq->m <= (int)2.487e8)) { 36 - int f = fwrq->m / 100000; 37 - int c = 0; 38 - 39 - while ((c < 14) && (f != rtllib_wlan_frequencies[c])) 40 - c++; 41 - 42 - /* hack to fall through */ 46 + fwrq->m = ieee80211_freq_khz_to_channel(fwrq->m / 100); 43 47 fwrq->e = 0; 44 - fwrq->m = c + 1; 45 48 } 46 49 } 47 50 ··· 53 70 54 71 if (ieee->iw_mode == IW_MODE_ADHOC || 55 72 ieee->iw_mode == IW_MODE_MASTER) 56 - if (ieee->state == RTLLIB_LINKED) { 73 + if (ieee->link_state == MAC80211_LINKED) { 57 74 rtllib_stop_send_beacons(ieee); 58 75 rtllib_start_send_beacons(ieee); 59 76 } ··· 66 83 } 67 84 EXPORT_SYMBOL(rtllib_wx_set_freq); 68 85 69 - 70 86 int rtllib_wx_get_freq(struct rtllib_device *ieee, 71 87 struct iw_request_info *a, 72 88 union iwreq_data *wrqu, char *b) ··· 74 92 75 93 if (ieee->current_network.channel == 0) 76 94 return -1; 77 - fwrq->m = rtllib_wlan_frequencies[ieee->current_network.channel-1] * 78 - 100000; 95 + fwrq->m = ieee80211_channel_to_freq_khz(ieee->current_network.channel, 96 + NL80211_BAND_2GHZ) * 100; 79 97 fwrq->e = 1; 80 98 return 0; 81 99 } ··· 95 113 /* We want avoid to give to the user inconsistent infos*/ 96 114 spin_lock_irqsave(&ieee->lock, flags); 97 115 98 - if (ieee->state != RTLLIB_LINKED && 99 - ieee->state != RTLLIB_LINKED_SCANNING && 116 + if (ieee->link_state != MAC80211_LINKED && 117 + ieee->link_state != MAC80211_LINKED_SCANNING && 100 118 ieee->wap_set == 0) 101 119 102 120 eth_zero_addr(wrqu->ap_addr.sa_data); ··· 110 128 } 111 129 EXPORT_SYMBOL(rtllib_wx_get_wap); 112 130 113 - 114 131 int rtllib_wx_set_wap(struct rtllib_device *ieee, 115 132 struct iw_request_info *info, 116 133 union iwreq_data *awrq, 117 134 char *extra) 118 135 { 119 - 120 136 int ret = 0; 121 137 unsigned long flags; 122 138 ··· 143 163 ret = -1; 144 164 goto out; 145 165 } 146 - 147 166 148 167 if (ifup) 149 168 rtllib_stop_protocol(ieee, true); ··· 184 205 goto out; 185 206 } 186 207 187 - if (ieee->state != RTLLIB_LINKED && 188 - ieee->state != RTLLIB_LINKED_SCANNING && 208 + if (ieee->link_state != MAC80211_LINKED && 209 + ieee->link_state != MAC80211_LINKED_SCANNING && 189 210 ieee->ssid_set == 0) { 190 211 ret = -1; 191 212 goto out; ··· 199 220 spin_unlock_irqrestore(&ieee->lock, flags); 200 221 201 222 return ret; 202 - 203 223 } 204 224 EXPORT_SYMBOL(rtllib_wx_get_essid); 205 225 ··· 206 228 struct iw_request_info *info, 207 229 union iwreq_data *wrqu, char *extra) 208 230 { 209 - 210 231 u32 target_rate = wrqu->bitrate.value; 211 232 212 - ieee->rate = target_rate/100000; 233 + ieee->rate = target_rate / 100000; 213 234 return 0; 214 235 } 215 236 EXPORT_SYMBOL(rtllib_wx_set_rate); ··· 227 250 } 228 251 EXPORT_SYMBOL(rtllib_wx_get_rate); 229 252 230 - 231 253 int rtllib_wx_set_rts(struct rtllib_device *ieee, 232 254 struct iw_request_info *info, 233 255 union iwreq_data *wrqu, char *extra) 234 256 { 235 - if (wrqu->rts.disabled || !wrqu->rts.fixed) 257 + if (wrqu->rts.disabled || !wrqu->rts.fixed) { 236 258 ieee->rts = DEFAULT_RTS_THRESHOLD; 237 - else { 259 + } else { 238 260 if (wrqu->rts.value < MIN_RTS_THRESHOLD || 239 261 wrqu->rts.value > MAX_RTS_THRESHOLD) 240 262 return -EINVAL; ··· 308 332 enum ht_channel_width bandwidth = 0; 309 333 int b40M = 0; 310 334 335 + mutex_lock(&ieee->wx_mutex); 311 336 if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) { 312 337 rtllib_start_scan_syncro(ieee, 0); 313 338 goto out; ··· 316 339 317 340 chan = ieee->current_network.channel; 318 341 319 - ieee->LeisurePSLeave(ieee->dev); 342 + ieee->leisure_ps_leave(ieee->dev); 320 343 /* notify AP to be in PS mode */ 321 344 rtllib_sta_ps_send_null_frame(ieee, 1); 322 345 rtllib_sta_ps_send_null_frame(ieee, 1); 323 346 324 347 rtllib_stop_all_queues(ieee); 325 - 326 - if (ieee->data_hard_stop) 327 - ieee->data_hard_stop(ieee->dev); 328 348 rtllib_stop_send_beacons(ieee); 329 - ieee->state = RTLLIB_LINKED_SCANNING; 349 + ieee->link_state = MAC80211_LINKED_SCANNING; 330 350 ieee->link_change(ieee->dev); 331 351 /* wait for ps packet to be kicked out successfully */ 332 352 msleep(50); ··· 335 361 b40M = 1; 336 362 chan_offset = ieee->ht_info->CurSTAExtChnlOffset; 337 363 bandwidth = (enum ht_channel_width)ieee->ht_info->bCurBW40MHz; 338 - ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, 364 + ieee->set_bw_mode_handler(ieee->dev, HT_CHANNEL_WIDTH_20, 339 365 HT_EXTCHNL_OFFSET_NO_EXT); 340 366 } 341 367 ··· 348 374 ieee->set_chan(ieee->dev, chan - 2); 349 375 else 350 376 ieee->set_chan(ieee->dev, chan); 351 - ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset); 377 + ieee->set_bw_mode_handler(ieee->dev, bandwidth, chan_offset); 352 378 } else { 353 379 ieee->set_chan(ieee->dev, chan); 354 380 } 355 381 356 382 ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE); 357 383 358 - ieee->state = RTLLIB_LINKED; 384 + ieee->link_state = MAC80211_LINKED; 359 385 ieee->link_change(ieee->dev); 360 386 361 387 /* Notify AP that I wake up again */ ··· 366 392 ieee->link_detect_info.NumRecvBcnInPeriod = 1; 367 393 ieee->link_detect_info.NumRecvDataInPeriod = 1; 368 394 } 369 - 370 - if (ieee->data_hard_resume) 371 - ieee->data_hard_resume(ieee->dev); 372 - 373 395 if (ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) 374 396 rtllib_start_send_beacons(ieee); 375 397 ··· 373 403 374 404 out: 375 405 mutex_unlock(&ieee->wx_mutex); 376 - 377 406 } 378 407 379 408 int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a, ··· 380 411 { 381 412 int ret = 0; 382 413 383 - mutex_lock(&ieee->wx_mutex); 384 - 385 414 if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)) { 386 415 ret = -1; 387 416 goto out; 388 417 } 389 418 390 - if (ieee->state == RTLLIB_LINKED) { 419 + if (ieee->link_state == MAC80211_LINKED) { 391 420 schedule_work(&ieee->wx_sync_scan_wq); 392 421 /* intentionally forget to up sem */ 393 422 return 0; 394 423 } 395 424 396 425 out: 397 - mutex_unlock(&ieee->wx_mutex); 398 426 return ret; 399 427 } 400 428 EXPORT_SYMBOL(rtllib_wx_set_scan); ··· 400 434 struct iw_request_info *a, 401 435 union iwreq_data *wrqu, char *extra) 402 436 { 403 - 404 437 int ret = 0, len; 405 438 short proto_started; 406 439 unsigned long flags; ··· 418 453 419 454 if (proto_started) 420 455 rtllib_stop_protocol(ieee, true); 421 - 422 456 423 457 /* this is just to be sure that the GET wx callback 424 458 * has consistent infos. not needed otherwise ··· 456 492 struct iw_request_info *info, 457 493 union iwreq_data *wrqu, char *extra) 458 494 { 459 - 460 495 int *parms = (int *)extra; 461 496 int enable = (parms[0] > 0); 462 497 short prev = ieee->raw_tx; ··· 471 508 ieee->raw_tx ? "enabled" : "disabled"); 472 509 473 510 if (ieee->iw_mode == IW_MODE_MONITOR) { 474 - if (prev == 0 && ieee->raw_tx) { 475 - if (ieee->data_hard_resume) 476 - ieee->data_hard_resume(ieee->dev); 477 - 511 + if (prev == 0 && ieee->raw_tx) 478 512 netif_carrier_on(ieee->dev); 479 - } 480 513 481 514 if (prev && ieee->raw_tx == 1) 482 515 netif_carrier_off(ieee->dev); ··· 489 530 { 490 531 const char *b = ieee->modulation & RTLLIB_CCK_MODULATION ? "b" : ""; 491 532 const char *g = ieee->modulation & RTLLIB_OFDM_MODULATION ? "g" : ""; 492 - const char *n = ieee->mode & (IEEE_N_24G | IEEE_N_5G) ? "n" : ""; 533 + const char *n = ieee->mode & (WIRELESS_MODE_N_24G) ? "n" : ""; 493 534 494 535 scnprintf(wrqu->name, sizeof(wrqu->name), "802.11%s%s%s", b, g, n); 495 536 return 0; 496 537 } 497 538 EXPORT_SYMBOL(rtllib_wx_get_name); 498 - 499 539 500 540 /* this is mostly stolen from hostap */ 501 541 int rtllib_wx_set_power(struct rtllib_device *ieee, ··· 541 583 default: 542 584 ret = -EINVAL; 543 585 goto exit; 544 - 545 586 } 546 587 exit: 547 588 mutex_unlock(&ieee->wx_mutex); 548 589 return ret; 549 - 550 590 } 551 591 EXPORT_SYMBOL(rtllib_wx_set_power); 552 592 ··· 581 625 exit: 582 626 mutex_unlock(&ieee->wx_mutex); 583 627 return 0; 584 - 585 628 } 586 629 EXPORT_SYMBOL(rtllib_wx_get_power);
+5 -11
drivers/staging/rtl8192e/rtllib_tx.c
··· 406 406 if (is_broadcast_ether_addr(skb->data + 16)) 407 407 return; 408 408 409 - if (ieee->mode < IEEE_N_24G) { 409 + if (ieee->mode < WIRELESS_MODE_N_24G) { 410 410 if (skb->len > ieee->rts) { 411 411 tcb_desc->bRTSEnable = true; 412 412 tcb_desc->rts_rate = MGN_24M; ··· 486 486 !tcb_desc->tx_use_drv_assinged_rate) { 487 487 if (ieee->iw_mode == IW_MODE_INFRA || 488 488 ieee->iw_mode == IW_MODE_ADHOC) 489 - tcb_desc->RATRIndex = 0; 489 + tcb_desc->ratr_index = 0; 490 490 } 491 491 } 492 492 ··· 572 572 /* If there is no driver handler to take the TXB, don't bother 573 573 * creating it... 574 574 */ 575 - if ((!ieee->hard_start_xmit && !(ieee->softmac_features & 576 - IEEE_SOFTMAC_TX_QUEUE)) || 575 + if (!(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) || 577 576 ((!ieee->softmac_data_hard_start_xmit && 578 577 (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) { 579 578 netdev_warn(ieee->dev, "No xmit handler.\n"); ··· 891 892 tcb_desc->tx_dis_rate_fallback = 1; 892 893 } 893 894 894 - tcb_desc->RATRIndex = 7; 895 + tcb_desc->ratr_index = 7; 895 896 tcb_desc->tx_use_drv_assinged_rate = 1; 896 897 } else { 897 898 if (is_multicast_ether_addr(header.addr1)) ··· 915 916 tcb_desc->tx_dis_rate_fallback = 1; 916 917 } 917 918 918 - tcb_desc->RATRIndex = 7; 919 + tcb_desc->ratr_index = 7; 919 920 tcb_desc->tx_use_drv_assinged_rate = 1; 920 921 tcb_desc->bdhcp = 1; 921 922 } ··· 937 938 dev->stats.tx_bytes += le16_to_cpu(txb->payload_size); 938 939 rtllib_softmac_xmit(txb, ieee); 939 940 } else { 940 - if ((*ieee->hard_start_xmit)(txb, dev) == 0) { 941 - stats->tx_packets++; 942 - stats->tx_bytes += le16_to_cpu(txb->payload_size); 943 - return 0; 944 - } 945 941 rtllib_txb_free(txb); 946 942 } 947 943 }
+3 -28
drivers/staging/rtl8192e/rtllib_wx.c
··· 19 19 #include "rtllib.h" 20 20 21 21 static const char * const rtllib_modes[] = { 22 - "a", "b", "g", "?", "N-24G", "N-5G" 22 + "a", "b", "g", "?", "N-24G" 23 23 }; 24 24 25 25 #define MAX_CUSTOM_LEN 64 ··· 118 118 max_rate = rate; 119 119 } 120 120 121 - if (network->mode >= IEEE_N_24G) { 121 + if (network->mode >= WIRELESS_MODE_N_24G) { 122 122 struct ht_capab_ele *ht_cap = NULL; 123 123 bool is40M = false, isShortGI = false; 124 124 u8 max_mcs = 0; ··· 416 416 */ 417 417 sec.flags |= SEC_LEVEL; 418 418 sec.level = SEC_LEVEL_1; /* 40 and 104 bit WEP */ 419 - 420 - if (ieee->set_security) 421 - ieee->set_security(dev, &sec); 422 - 423 - /* Do not reset port if card is in Managed mode since resetting will 424 - * generate new IEEE 802.11 authentication which may end up in looping 425 - * with IEEE 802.1X. If your hardware requires a reset after WEP 426 - * configuration (for example... Prism2), implement the reset_port in 427 - * the callbacks structures used to initialize the 802.11 stack. 428 - */ 429 - if (ieee->reset_on_keychange && 430 - ieee->iw_mode != IW_MODE_INFRA && 431 - ieee->reset_port && ieee->reset_port(dev)) { 432 - netdev_dbg(dev, "%s: reset_port failed\n", dev->name); 433 - return -EINVAL; 434 - } 435 419 return 0; 436 420 } 437 421 EXPORT_SYMBOL(rtllib_wx_set_encode); ··· 607 623 sec.flags &= ~SEC_LEVEL; 608 624 } 609 625 done: 610 - if (ieee->set_security) 611 - ieee->set_security(ieee->dev, &sec); 612 - 613 - if (ieee->reset_on_keychange && 614 - ieee->iw_mode != IW_MODE_INFRA && 615 - ieee->reset_port && ieee->reset_port(dev)) { 616 - netdev_dbg(ieee->dev, "Port reset failed\n"); 617 - return -EINVAL; 618 - } 619 626 return ret; 620 627 } 621 628 EXPORT_SYMBOL(rtllib_wx_set_encode_ext); ··· 619 644 bool deauth = false; 620 645 struct iw_mlme *mlme = (struct iw_mlme *)extra; 621 646 622 - if (ieee->state != RTLLIB_LINKED) 647 + if (ieee->link_state != MAC80211_LINKED) 623 648 return -ENOLINK; 624 649 625 650 mutex_lock(&ieee->wx_mutex);
+4 -1
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
··· 2275 2275 pHalData->EEPROMBluetoothAntNum = tempval & BIT(0); 2276 2276 /* EFUSE_0xC3[6] == 0, S1(Main)-RF_PATH_A; */ 2277 2277 /* EFUSE_0xC3[6] == 1, S0(Aux)-RF_PATH_B */ 2278 - pHalData->ant_path = (tempval & BIT(6))? RF_PATH_B : RF_PATH_A; 2278 + if (tempval & BIT(6)) 2279 + pHalData->ant_path = RF_PATH_B; 2280 + else 2281 + pHalData->ant_path = RF_PATH_A; 2279 2282 } else { 2280 2283 pHalData->EEPROMBluetoothAntNum = Ant_x1; 2281 2284 if (pHalData->PackageType == PACKAGE_QFN68)
+13 -13
drivers/staging/rtl8723bs/include/sta_info.h
··· 16 16 /* if mode == 0, then the sta is allowed once the addr is hit. */ 17 17 /* if mode == 1, then the sta is rejected once the addr is non-hit. */ 18 18 struct rtw_wlan_acl_node { 19 - struct list_head list; 20 - u8 addr[ETH_ALEN]; 21 - u8 valid; 19 + struct list_head list; 20 + u8 addr[ETH_ALEN]; 21 + u8 valid; 22 22 }; 23 23 24 24 /* mode = 0, disable */ ··· 340 340 341 341 static inline u32 wifi_mac_hash(u8 *mac) 342 342 { 343 - u32 x; 343 + u32 x; 344 344 345 - x = mac[0]; 346 - x = (x << 2) ^ mac[1]; 347 - x = (x << 2) ^ mac[2]; 348 - x = (x << 2) ^ mac[3]; 349 - x = (x << 2) ^ mac[4]; 350 - x = (x << 2) ^ mac[5]; 345 + x = mac[0]; 346 + x = (x << 2) ^ mac[1]; 347 + x = (x << 2) ^ mac[2]; 348 + x = (x << 2) ^ mac[3]; 349 + x = (x << 2) ^ mac[4]; 350 + x = (x << 2) ^ mac[5]; 351 351 352 - x ^= x >> 8; 353 - x = x & (NUM_STA - 1); 352 + x ^= x >> 8; 353 + x = x & (NUM_STA - 1); 354 354 355 - return x; 355 + return x; 356 356 } 357 357 358 358
+8 -54
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
··· 305 305 memcpy(pwlanhdr->addr2, pnetwork->network.mac_address, ETH_ALEN); 306 306 memcpy(pwlanhdr->addr3, pnetwork->network.mac_address, ETH_ALEN); 307 307 308 - 309 308 pbuf += sizeof(struct ieee80211_hdr_3addr); 310 309 len = sizeof(struct ieee80211_hdr_3addr); 311 310 ··· 324 325 325 326 exit: 326 327 return bss; 327 - 328 328 } 329 329 330 330 /* 331 - Check the given bss is valid by kernel API cfg80211_get_bss() 332 - @padapter : the given adapter 333 - 334 - return true if bss is valid, false for not found. 335 - */ 331 + * Check the given bss is valid by kernel API cfg80211_get_bss() 332 + * @padapter : the given adapter 333 + * 334 + * return true if bss is valid, false for not found. 335 + */ 336 336 int rtw_cfg80211_check_bss(struct adapter *padapter) 337 337 { 338 338 struct wlan_bssid_ex *pnetwork = &(padapter->mlmeextpriv.mlmext_info.network); ··· 372 374 struct wlan_network *scanned = pmlmepriv->cur_network_scanned; 373 375 374 376 if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) { 375 - 376 377 memcpy(&cur_network->network, pnetwork, sizeof(struct wlan_bssid_ex)); 377 378 rtw_cfg80211_inform_bss(padapter, cur_network); 378 379 } else { ··· 492 495 } 493 496 } 494 497 495 - 496 498 static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len) 497 499 { 498 500 int ret = 0; ··· 565 569 rtw_ap_set_wep_key(padapter, param->u.crypt.key, wep_key_len, wep_key_idx, 1); 566 570 567 571 goto exit; 568 - 569 572 } 570 573 571 574 /* group key */ ··· 576 581 577 582 psecuritypriv->dot118021XGrpPrivacy = _WEP40_; 578 583 if (param->u.crypt.key_len == 13) 579 - psecuritypriv->dot118021XGrpPrivacy = _WEP104_; 584 + psecuritypriv->dot118021XGrpPrivacy = _WEP104_; 580 585 581 586 } else if (strcmp(param->u.crypt.alg, "TKIP") == 0) { 582 587 psecuritypriv->dot118021XGrpPrivacy = _TKIP_; ··· 611 616 pbcmc_sta->ieee8021x_blocked = false; 612 617 pbcmc_sta->dot118021XPrivacy = psecuritypriv->dot118021XGrpPrivacy;/* rx will use bmc_sta's dot118021XPrivacy */ 613 618 } 614 - 615 619 } 616 620 617 621 goto exit; 618 - 619 622 } 620 623 621 624 if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) { /* psk/802_1x */ ··· 636 643 psecuritypriv->busetkipkey = true; 637 644 638 645 } else if (strcmp(param->u.crypt.alg, "CCMP") == 0) { 639 - 640 646 psta->dot118021XPrivacy = _AES_; 641 647 } else { 642 648 psta->dot118021XPrivacy = _NO_PRIVACY_; ··· 687 695 pbcmc_sta->ieee8021x_blocked = false; 688 696 pbcmc_sta->dot118021XPrivacy = psecuritypriv->dot118021XGrpPrivacy;/* rx will use bmc_sta's dot118021XPrivacy */ 689 697 } 690 - 691 698 } 692 - 693 699 } 694 - 695 700 } 696 701 697 702 exit: 698 703 699 704 return ret; 700 - 701 705 } 702 706 703 707 static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len) ··· 776 788 /* Jeff: don't disable ieee8021x_blocked while clearing key */ 777 789 if (strcmp(param->u.crypt.alg, "none") != 0) 778 790 psta->ieee8021x_blocked = false; 779 - 780 791 781 792 if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) || 782 793 (padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) { ··· 887 900 888 901 strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN); 889 902 890 - 891 903 if (!mac_addr || is_broadcast_ether_addr(mac_addr)) 892 904 param->u.crypt.set_tx = 0; /* for wpa/wpa2 group key */ 893 905 else ··· 918 932 kfree(param); 919 933 920 934 return ret; 921 - 922 935 } 923 936 924 937 static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev, ··· 968 983 } 969 984 970 985 return 0; 971 - 972 986 } 973 987 974 988 static int cfg80211_rtw_get_station(struct wiphy *wiphy, ··· 1152 1168 /* ev =translate_scan(padapter, a, pnetwork, ev, stop); */ 1153 1169 rtw_cfg80211_inform_bss(padapter, pnetwork); 1154 1170 } 1155 - 1156 1171 } 1157 1172 1158 1173 spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); ··· 1183 1200 } 1184 1201 1185 1202 return ret; 1186 - 1187 1203 } 1188 1204 1189 1205 static int cfg80211_rtw_scan(struct wiphy *wiphy ··· 1287 1305 } else if (request->n_channels <= 4) { 1288 1306 for (j = request->n_channels - 1; j >= 0; j--) 1289 1307 for (i = 0; i < survey_times; i++) 1290 - memcpy(&ch[j*survey_times+i], &ch[j], sizeof(struct rtw_ieee80211_channel)); 1308 + memcpy(&ch[j*survey_times+i], &ch[j], sizeof(struct rtw_ieee80211_channel)); 1291 1309 _status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, ch, survey_times * request->n_channels); 1292 1310 } else { 1293 1311 _status = rtw_sitesurvey_cmd(padapter, ssid, RTW_SSID_SCAN_AMOUNT, NULL, 0); 1294 1312 } 1295 1313 spin_unlock_bh(&pmlmepriv->lock); 1296 - 1297 1314 1298 1315 if (_status == false) 1299 1316 ret = -1; ··· 1308 1327 1309 1328 exit: 1310 1329 return ret; 1311 - 1312 1330 } 1313 1331 1314 1332 static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed) ··· 1322 1342 return 0; 1323 1343 } 1324 1344 1325 - 1326 1345 if (wpa_version & (NL80211_WPA_VERSION_1 | NL80211_WPA_VERSION_2)) 1327 1346 psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPAPSK; 1328 1347 1329 1348 return 0; 1330 - 1331 1349 } 1332 1350 1333 1351 static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv, ··· 1351 1373 1352 1374 psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; 1353 1375 1354 - 1355 1376 break; 1356 1377 default: 1357 1378 psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; ··· 1358 1381 } 1359 1382 1360 1383 return 0; 1361 - 1362 1384 } 1363 1385 1364 1386 static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 cipher, bool ucast) ··· 1366 1390 1367 1391 u32 *profile_cipher = ucast ? &psecuritypriv->dot11PrivacyAlgrthm : 1368 1392 &psecuritypriv->dot118021XGrpPrivacy; 1369 - 1370 1393 1371 1394 if (!cipher) { 1372 1395 *profile_cipher = _NO_PRIVACY_; ··· 1578 1603 } 1579 1604 1580 1605 if (params->ssid_len > IW_ESSID_MAX_SIZE) { 1581 - 1582 1606 ret = -E2BIG; 1583 1607 goto exit; 1584 1608 } ··· 1645 1671 1646 1672 padapter->mlmepriv.not_indic_disco = true; 1647 1673 1648 - 1649 1674 if (adapter_wdev_data(padapter)->block == true) { 1650 1675 ret = -EBUSY; 1651 1676 goto exit; ··· 1667 1694 } 1668 1695 1669 1696 if (sme->ssid_len > IW_ESSID_MAX_SIZE) { 1670 - 1671 1697 ret = -E2BIG; 1672 1698 goto exit; 1673 1699 } ··· 1861 1889 /* overwrite PMKID */ 1862 1890 for (index = 0 ; index < NUM_PMKID_CACHE; index++) { 1863 1891 if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN)) { 1864 - 1865 1892 memcpy(psecuritypriv->PMKIDList[index].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN); 1866 1893 psecuritypriv->PMKIDList[index].bUsed = true; 1867 1894 psecuritypriv->PMKIDIndex = index+1; ··· 1870 1899 } 1871 1900 1872 1901 if (!blInserted) { 1873 - 1874 1902 memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].Bssid, (u8 *)pmksa->bssid, ETH_ALEN); 1875 1903 memcpy(psecuritypriv->PMKIDList[psecuritypriv->PMKIDIndex].PMKID, (u8 *)pmksa->pmkid, WLAN_PMKID_LEN); 1876 1904 ··· 2105 2135 pattrib->seqnum = pmlmeext->mgnt_seq; 2106 2136 pmlmeext->mgnt_seq++; 2107 2137 2108 - 2109 2138 pattrib->last_txcmdsz = pattrib->pktlen; 2110 2139 2111 2140 dump_mgntframe(padapter, pmgntframe); 2112 - 2113 2141 } 2114 2142 2115 2143 fail: ··· 2115 2147 dev_kfree_skb_any(skb); 2116 2148 2117 2149 return NETDEV_TX_OK; 2118 - 2119 2150 } 2120 - 2121 - 2122 2151 2123 2152 static const struct net_device_ops rtw_cfg80211_monitor_if_ops = { 2124 2153 .ndo_start_xmit = rtw_cfg80211_monitor_if_xmit_entry, ··· 2289 2324 else 2290 2325 ret = -EINVAL; 2291 2326 2292 - 2293 2327 kfree(pbuf); 2294 2328 2295 2329 return ret; ··· 2368 2404 return -EINVAL; 2369 2405 } 2370 2406 2371 - 2372 2407 spin_lock_bh(&pstapriv->asoc_list_lock); 2373 2408 2374 2409 phead = &pstapriv->asoc_list; ··· 2386 2423 2387 2424 break; 2388 2425 } 2389 - 2390 2426 } 2391 - 2392 2427 } 2393 2428 2394 2429 spin_unlock_bh(&pstapriv->asoc_list_lock); ··· 2394 2433 associated_clients_update(padapter, updated); 2395 2434 2396 2435 return ret; 2397 - 2398 2436 } 2399 2437 2400 2438 static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev, ··· 2425 2465 static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *ndev, 2426 2466 int idx, u8 *mac, struct station_info *sinfo) 2427 2467 { 2428 - 2429 2468 int ret = 0; 2430 2469 struct adapter *padapter = rtw_netdev_priv(ndev); 2431 2470 struct sta_info *psta = NULL; ··· 2527 2568 exit: 2528 2569 2529 2570 return ret; 2530 - 2531 2571 } 2532 2572 2533 2573 static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy, ··· 2598 2640 2599 2641 static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap, enum nl80211_band band) 2600 2642 { 2601 - 2602 2643 #define MAX_BIT_RATE_40MHZ_MCS15 300 /* Mbps */ 2603 2644 #define MAX_BIT_RATE_40MHZ_MCS7 150 /* Mbps */ 2604 2645 ··· 2649 2692 2650 2693 /* copy mac_addr to wiphy */ 2651 2694 memcpy(wiphy->perm_addr, padapter->eeprompriv.mac_addr, ETH_ALEN); 2652 - 2653 2695 } 2654 2696 2655 2697 static void rtw_cfg80211_preinit_wiphy(struct adapter *padapter, struct wiphy *wiphy) 2656 2698 { 2657 - 2658 2699 wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; 2659 2700 2660 2701 wiphy->max_scan_ssids = RTW_SSID_SCAN_AMOUNT; ··· 2765 2810 wdev->netdev = pnetdev; 2766 2811 2767 2812 wdev->iftype = NL80211_IFTYPE_STATION; /* will be init in rtw_hal_init() */ 2768 - /* Must sync with _rtw_init_mlme_priv() */ 2813 + /* Must sync with _rtw_init_mlme_priv() */ 2769 2814 /* pmlmepriv->fw_state = WIFI_STATION_STATE */ 2770 2815 padapter->rtw_wdev = wdev; 2771 2816 pnetdev->ieee80211_ptr = wdev; ··· 2799 2844 wiphy_free(wiphy); 2800 2845 exit: 2801 2846 return ret; 2802 - 2803 2847 } 2804 2848 2805 2849 void rtw_wdev_free(struct wireless_dev *wdev)
+7 -13
drivers/staging/rts5208/rtsx.c
··· 382 382 if (chip->srb->sc_data_direction == DMA_BIDIRECTIONAL) { 383 383 dev_err(&dev->pci->dev, "UNKNOWN data direction\n"); 384 384 chip->srb->result = DID_ERROR << 16; 385 - } 386 - 387 - /* reject if target != 0 or if LUN is higher than 388 - * the maximum known LUN 389 - */ 390 - else if (chip->srb->device->id) { 385 + } else if (chip->srb->device->id) { 386 + /* reject if target != 0 or if LUN is higher than 387 + * the maximum known LUN 388 + */ 391 389 dev_err(&dev->pci->dev, "Bad target number (%d:%d)\n", 392 390 chip->srb->device->id, 393 391 (u8)chip->srb->device->lun); 394 392 chip->srb->result = DID_BAD_TARGET << 16; 395 - } 396 - 397 - else if (chip->srb->device->lun > chip->max_lun) { 393 + } else if (chip->srb->device->lun > chip->max_lun) { 398 394 dev_err(&dev->pci->dev, "Bad LUN (%d:%d)\n", 399 395 chip->srb->device->id, 400 396 (u8)chip->srb->device->lun); 401 397 chip->srb->result = DID_BAD_TARGET << 16; 402 - } 403 - 404 - /* we've got a command, let's do it! */ 405 - else { 398 + } else { 399 + /* we've got a command, let's do it! */ 406 400 scsi_show_command(chip); 407 401 rtsx_invoke_transport(chip->srb, chip); 408 402 }
+1 -1
drivers/staging/sm750fb/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 config FB_SM750 3 3 tristate "Silicon Motion SM750 framebuffer support" 4 - depends on FB && PCI 4 + depends on FB && PCI && HAS_IOPORT 5 5 select FB_MODE_HELPERS 6 6 select FB_CFB_FILLRECT 7 7 select FB_CFB_COPYAREA
-2
drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h
··· 78 78 short version_min; /* Update for incompatible changes */ 79 79 }; 80 80 81 - struct vchiq_instance; 82 - 83 81 extern int vchiq_initialise(struct vchiq_instance **pinstance); 84 82 extern int vchiq_shutdown(struct vchiq_instance *instance); 85 83 extern int vchiq_connect(struct vchiq_instance *instance);
+2 -2
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
··· 415 415 pagelistinfo->scatterlist_mapped = 0; 416 416 417 417 /* Deal with any partial cache lines (fragments) */ 418 - if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS) { 418 + if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS && g_fragments_base) { 419 419 char *fragments = g_fragments_base + 420 420 (pagelist->type - PAGELIST_READ_WITH_FRAGMENTS) * 421 421 g_fragments_size; ··· 462 462 cleanup_pagelistinfo(instance, pagelistinfo); 463 463 } 464 464 465 - int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) 465 + static int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) 466 466 { 467 467 struct device *dev = &pdev->dev; 468 468 struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
+1 -1
drivers/staging/vt6655/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 config VT6655 3 3 tristate "VIA Technologies VT6655 support" 4 - depends on PCI && MAC80211 && m 4 + depends on PCI && HAS_IOPORT && MAC80211 && m 5 5 help 6 6 This is a vendor-written driver for VIA VT6655.
-21
drivers/staging/wlan-ng/hfa384x.h
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/hfa384x_usb.c
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211conv.c
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211conv.h
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211hdr.h
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211ioctl.h
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211metadef.h
··· 6 6 * 7 7 * linux-wlan 8 8 * 9 - * The contents of this file are subject to the Mozilla Public 10 - * License Version 1.1 (the "License"); you may not use this file 11 - * except in compliance with the License. You may obtain a copy of 12 - * the License at http://www.mozilla.org/MPL/ 13 - * 14 - * Software distributed under the License is distributed on an "AS 15 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16 - * implied. See the License for the specific language governing 17 - * rights and limitations under the License. 18 - * 19 - * Alternatively, the contents of this file may be used under the 20 - * terms of the GNU Public License version 2 (the "GPL"), in which 21 - * case the provisions of the GPL are applicable instead of the 22 - * above. If you wish to allow the use of your version of this file 23 - * only under the terms of the GPL and not to allow others to use 24 - * your version of this file under the MPL, indicate your decision 25 - * by deleting the provisions above and replace them with the notice 26 - * and other provisions required by the GPL. If you do not delete 27 - * the provisions above, a recipient may use your version of this 28 - * file under either the MPL or the GPL. 29 - * 30 9 * -------------------------------------------------------------------- 31 10 * 32 11 * Inquiries regarding the linux-wlan Open Source project can be
+2 -37
drivers/staging/wlan-ng/p80211metastruct.h
··· 6 6 * 7 7 * linux-wlan 8 8 * 9 - * The contents of this file are subject to the Mozilla Public 10 - * License Version 1.1 (the "License"); you may not use this file 11 - * except in compliance with the License. You may obtain a copy of 12 - * the License at http://www.mozilla.org/MPL/ 13 - * 14 - * Software distributed under the License is distributed on an "AS 15 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 16 - * implied. See the License for the specific language governing 17 - * rights and limitations under the License. 18 - * 19 - * Alternatively, the contents of this file may be used under the 20 - * terms of the GNU Public License version 2 (the "GPL"), in which 21 - * case the provisions of the GPL are applicable instead of the 22 - * above. If you wish to allow the use of your version of this file 23 - * only under the terms of the GPL and not to allow others to use 24 - * your version of this file under the MPL, indicate your decision 25 - * by deleting the provisions above and replace them with the notice 26 - * and other provisions required by the GPL. If you do not delete 27 - * the provisions above, a recipient may use your version of this 28 - * file under either the MPL or the GPL. 29 - * 30 9 * -------------------------------------------------------------------- 31 10 * 32 11 * Inquiries regarding the linux-wlan Open Source project can be ··· 93 114 struct p80211item_uint32 cfpollreq; 94 115 struct p80211item_uint32 privacy; 95 116 struct p80211item_uint32 capinfo; 96 - struct p80211item_uint32 basicrate1; 97 - struct p80211item_uint32 basicrate2; 98 - struct p80211item_uint32 basicrate3; 99 - struct p80211item_uint32 basicrate4; 100 - struct p80211item_uint32 basicrate5; 101 - struct p80211item_uint32 basicrate6; 102 - struct p80211item_uint32 basicrate7; 103 - struct p80211item_uint32 basicrate8; 104 - struct p80211item_uint32 supprate1; 105 - struct p80211item_uint32 supprate2; 106 - struct p80211item_uint32 supprate3; 107 - struct p80211item_uint32 supprate4; 108 - struct p80211item_uint32 supprate5; 109 - struct p80211item_uint32 supprate6; 110 - struct p80211item_uint32 supprate7; 111 - struct p80211item_uint32 supprate8; 117 + struct p80211item_uint32 basicrate[8]; 118 + struct p80211item_uint32 supprate[8]; 112 119 } __packed; 113 120 114 121 struct p80211msg_dot11req_start {
-21
drivers/staging/wlan-ng/p80211mgmt.h
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211msg.h
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211netdev.c
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211netdev.h
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211req.c
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211req.h
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211types.h
··· 9 9 * 10 10 * linux-wlan 11 11 * 12 - * The contents of this file are subject to the Mozilla Public 13 - * License Version 1.1 (the "License"); you may not use this file 14 - * except in compliance with the License. You may obtain a copy of 15 - * the License at http://www.mozilla.org/MPL/ 16 - * 17 - * Software distributed under the License is distributed on an "AS 18 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 19 - * implied. See the License for the specific language governing 20 - * rights and limitations under the License. 21 - * 22 - * Alternatively, the contents of this file may be used under the 23 - * terms of the GNU Public License version 2 (the "GPL"), in which 24 - * case the provisions of the GPL are applicable instead of the 25 - * above. If you wish to allow the use of your version of this file 26 - * only under the terms of the GPL and not to allow others to use 27 - * your version of this file under the MPL, indicate your decision 28 - * by deleting the provisions above and replace them with the notice 29 - * and other provisions required by the GPL. If you do not delete 30 - * the provisions above, a recipient may use your version of this 31 - * file under either the MPL or the GPL. 32 - * 33 12 * -------------------------------------------------------------------- 34 13 * 35 14 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/p80211wep.c
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/prism2fw.c
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
+15 -56
drivers/staging/wlan-ng/prism2mgmt.c
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be ··· 416 437 if (item->supprates[count] == 0) 417 438 break; 418 439 419 - #define REQBASICRATE(N) \ 420 - do { \ 421 - if ((count >= (N)) && DOT11_RATE5_ISBASIC_GET( \ 422 - item->supprates[(N) - 1])) { \ 423 - req->basicrate ## N .data = item->supprates[(N) - 1]; \ 424 - req->basicrate ## N .status = \ 425 - P80211ENUM_msgitem_status_data_ok; \ 426 - } \ 427 - } while (0) 440 + for (int i = 0; i < 8; i++) { 441 + if (count > i && 442 + DOT11_RATE5_ISBASIC_GET(item->supprates[i])) { 443 + req->basicrate[i].data = item->supprates[i]; 444 + req->basicrate[i].status = 445 + P80211ENUM_msgitem_status_data_ok; 446 + } 447 + } 428 448 429 - REQBASICRATE(1); 430 - REQBASICRATE(2); 431 - REQBASICRATE(3); 432 - REQBASICRATE(4); 433 - REQBASICRATE(5); 434 - REQBASICRATE(6); 435 - REQBASICRATE(7); 436 - REQBASICRATE(8); 437 - 438 - #define REQSUPPRATE(N) \ 439 - do { \ 440 - if (count >= (N)) { \ 441 - req->supprate ## N .data = item->supprates[(N) - 1]; \ 442 - req->supprate ## N .status = \ 443 - P80211ENUM_msgitem_status_data_ok; \ 444 - } \ 445 - } while (0) 446 - 447 - REQSUPPRATE(1); 448 - REQSUPPRATE(2); 449 - REQSUPPRATE(3); 450 - REQSUPPRATE(4); 451 - REQSUPPRATE(5); 452 - REQSUPPRATE(6); 453 - REQSUPPRATE(7); 454 - REQSUPPRATE(8); 449 + for (int i = 0; i < 8; i++) { 450 + if (count > i) { 451 + req->supprate[i].data = item->supprates[i]; 452 + req->supprate[i].status = 453 + P80211ENUM_msgitem_status_data_ok; 454 + } 455 + } 455 456 456 457 /* beacon period */ 457 458 req->beaconperiod.status = P80211ENUM_msgitem_status_data_ok;
-21
drivers/staging/wlan-ng/prism2mgmt.h
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/prism2mib.c
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be
-21
drivers/staging/wlan-ng/prism2sta.c
··· 8 8 * 9 9 * linux-wlan 10 10 * 11 - * The contents of this file are subject to the Mozilla Public 12 - * License Version 1.1 (the "License"); you may not use this file 13 - * except in compliance with the License. You may obtain a copy of 14 - * the License at http://www.mozilla.org/MPL/ 15 - * 16 - * Software distributed under the License is distributed on an "AS 17 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 18 - * implied. See the License for the specific language governing 19 - * rights and limitations under the License. 20 - * 21 - * Alternatively, the contents of this file may be used under the 22 - * terms of the GNU Public License version 2 (the "GPL"), in which 23 - * case the provisions of the GPL are applicable instead of the 24 - * above. If you wish to allow the use of your version of this file 25 - * only under the terms of the GPL and not to allow others to use 26 - * your version of this file under the MPL, indicate your decision 27 - * by deleting the provisions above and replace them with the notice 28 - * and other provisions required by the GPL. If you do not delete 29 - * the provisions above, a recipient may use your version of this 30 - * file under either the MPL or the GPL. 31 - * 32 11 * -------------------------------------------------------------------- 33 12 * 34 13 * Inquiries regarding the linux-wlan Open Source project can be