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

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

Pull staging driver updates from Greg KH:
"Here is the large set of staging driver changes for 6.2-rc1.

Another round of cleanups for staging drivers with no big additions.
Overall more lines were removed than added, always a nice sign, with
nothing happening in here other than general coding style cleanups and
minor fixes in the drivers. Full, boring, details are in the shortlog.

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

* tag 'staging-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (253 commits)
vme: Use root_device_register() not underlined version
staging: rtl8192e: Fix spelling mistake "ContryIE" -> "CountryIE"
vme: Fix error not catched in fake_init()
staging: vme_user: remove multiple blank lines
staging: r8188eu: use subtype helper in rtw_check_bcn_info
staging: r8188eu: use subtype helpers in collect_bss_info
staging: r8188eu: remove unused da parameter
staging: r8188eu: merge two probereq_p2p functions
staging: r8188eu: simplify err handling for unknown station
staging: r8188eu: handle the non-ap case first
staging: r8188eu: move bBusyTraffic update
staging: r8188eu: read reason code from ieee80211_mgmt
staging: r8188eu: use ieee80211_mgmt to parse addresses
staging: r8188eu: remove a variable
staging: r8188eu: simplify error handling for missing station
staging: r8188eu: stop beacon processing if kmalloc fails
staging: r8188eu: exit if beacon is not from our bss
staging: r8188eu: simplify update_sta_support_rate params
staging: r8188eu: use ie buffer in update_beacon_info
staging: r8188eu: pass only ies to process_p2p_ps_ie
...

+1746 -2794
+2 -2
arch/mips/include/asm/octeon/cvmx.h
··· 154 154 155 155 /** 156 156 * Convert a memory pointer (void*) into a hardware compatible 157 - * memory address (uint64_t). Octeon hardware widgets don't 157 + * memory address (phys_addr_t). Octeon hardware widgets don't 158 158 * understand logical addresses. 159 159 * 160 160 * @ptr: C style memory pointer 161 161 * Returns Hardware physical address 162 162 */ 163 - static inline uint64_t cvmx_ptr_to_phys(void *ptr) 163 + static inline phys_addr_t cvmx_ptr_to_phys(void *ptr) 164 164 { 165 165 if (sizeof(void *) == 8) { 166 166 /*
+1 -4
drivers/staging/emxx_udc/emxx_udc.c
··· 1004 1004 /* MAX Packet Size */ 1005 1005 mpkt = _nbu2ss_readl(&preg->EP_REGS[num].EP_PCKT_ADRS) & EPN_MPKT; 1006 1006 1007 - if ((DMA_MAX_COUNT * mpkt) < length) 1008 - i_write_length = DMA_MAX_COUNT * mpkt; 1009 - else 1010 - i_write_length = length; 1007 + i_write_length = min(DMA_MAX_COUNT * mpkt, length); 1011 1008 1012 1009 /*------------------------------------------------------------*/ 1013 1010 /* Number of transmission packets */
+7 -10
drivers/staging/fieldbus/dev_core.c
··· 28 28 { 29 29 struct fieldbus_dev *fb = dev_get_drvdata(dev); 30 30 31 - return sprintf(buf, "%d\n", !!fb->online); 31 + return sysfs_emit(buf, "%d\n", !!fb->online); 32 32 } 33 33 static DEVICE_ATTR_RO(online); 34 34 ··· 39 39 40 40 if (!fb->enable_get) 41 41 return -EINVAL; 42 - return sprintf(buf, "%d\n", !!fb->enable_get(fb)); 42 + return sysfs_emit(buf, "%d\n", !!fb->enable_get(fb)); 43 43 } 44 44 45 45 static ssize_t enabled_store(struct device *dev, struct device_attribute *attr, ··· 66 66 { 67 67 struct fieldbus_dev *fb = dev_get_drvdata(dev); 68 68 69 - /* 70 - * card_name was provided by child driver, could potentially be long. 71 - * protect against buffer overrun. 72 - */ 73 - return snprintf(buf, PAGE_SIZE, "%s\n", fb->card_name); 69 + /* card_name was provided by child driver. */ 70 + return sysfs_emit(buf, "%s\n", fb->card_name); 74 71 } 75 72 static DEVICE_ATTR_RO(card_name); 76 73 ··· 76 79 { 77 80 struct fieldbus_dev *fb = dev_get_drvdata(dev); 78 81 79 - return sprintf(buf, "%zu\n", fb->read_area_sz); 82 + return sysfs_emit(buf, "%zu\n", fb->read_area_sz); 80 83 } 81 84 static DEVICE_ATTR_RO(read_area_size); 82 85 ··· 85 88 { 86 89 struct fieldbus_dev *fb = dev_get_drvdata(dev); 87 90 88 - return sprintf(buf, "%zu\n", fb->write_area_sz); 91 + return sysfs_emit(buf, "%zu\n", fb->write_area_sz); 89 92 } 90 93 static DEVICE_ATTR_RO(write_area_size); 91 94 ··· 113 116 break; 114 117 } 115 118 116 - return sprintf(buf, "%s\n", t); 119 + return sysfs_emit(buf, "%s\n", t); 117 120 } 118 121 static DEVICE_ATTR_RO(fieldbus_type); 119 122
+8 -5
drivers/staging/gdm724x/gdm_tty.c
··· 21 21 22 22 #define MUX_TX_MAX_SIZE 2048 23 23 24 - #define GDM_TTY_READY(gdm) (gdm && gdm->tty_dev && gdm->port.count) 24 + static inline bool gdm_tty_ready(struct gdm *gdm) 25 + { 26 + return gdm && gdm->tty_dev && gdm->port.count; 27 + } 25 28 26 29 static struct tty_driver *gdm_driver[TTY_MAX_COUNT]; 27 30 static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR]; ··· 116 113 { 117 114 struct gdm *gdm = tty_dev->gdm[index]; 118 115 119 - if (!GDM_TTY_READY(gdm)) { 116 + if (!gdm_tty_ready(gdm)) { 120 117 if (complete == RECV_PACKET_PROCESS_COMPLETE) 121 118 gdm->tty_dev->recv_func(gdm->tty_dev->priv_dev, 122 119 gdm_tty_recv_complete); ··· 143 140 { 144 141 struct gdm *gdm = arg; 145 142 146 - if (!GDM_TTY_READY(gdm)) 143 + if (!gdm_tty_ready(gdm)) 147 144 return; 148 145 149 146 tty_port_tty_wakeup(&gdm->port); ··· 157 154 int sent_len = 0; 158 155 int sending_len = 0; 159 156 160 - if (!GDM_TTY_READY(gdm)) 157 + if (!gdm_tty_ready(gdm)) 161 158 return -ENODEV; 162 159 163 160 if (!len) ··· 184 181 { 185 182 struct gdm *gdm = tty->driver_data; 186 183 187 - if (!GDM_TTY_READY(gdm)) 184 + if (!gdm_tty_ready(gdm)) 188 185 return 0; 189 186 190 187 return WRITE_SIZE;
+1 -14
drivers/staging/greybus/tools/loopback_test.c
··· 239 239 240 240 for (i = 0; i < t->device_count; i++) 241 241 printf("device[%d] = %s\n", i, t->devices[i].name); 242 - 243 242 } 244 243 245 244 int open_sysfs(const char *sys_pfx, const char *node, int flags) ··· 273 274 char buf[SYSFS_MAX_INT]; 274 275 275 276 if (read(fd, buf, sizeof(buf)) < 0) { 276 - 277 277 fprintf(stderr, "unable to read from %s%s %s\n", sys_pfx, node, 278 278 strerror(errno)); 279 279 close(fd); ··· 365 367 r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min; 366 368 r->gbphy_firmware_latency_jitter = 367 369 r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min; 368 - 369 370 } 370 371 371 372 /*calculate the aggregate results of all enabled devices */ ··· 404 407 r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min; 405 408 r->gbphy_firmware_latency_jitter = 406 409 r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min; 407 - 408 410 } 409 411 410 412 return 0; ··· 532 536 fprintf(stderr, "unable to open %s for appending\n", file_name); 533 537 abort(); 534 538 } 535 - 536 539 } 537 540 for (i = 0; i < t->device_count; i++) { 538 541 if (!device_enabled(t, i)) ··· 545 550 if (ret == -1) 546 551 fprintf(stderr, "unable to write %d bytes to csv.\n", len); 547 552 } 548 - 549 553 } 550 - 551 554 552 555 if (t->aggregate_output) { 553 556 len = format_output(t, &t->aggregate_results, "aggregate", ··· 668 675 static int close_poll_files(struct loopback_test *t) 669 676 { 670 677 int i; 678 + 671 679 for (i = 0; i < t->poll_count; i++) 672 680 close(t->fds[i].fd); 673 681 ··· 734 740 ts = &t->poll_timeout; 735 741 736 742 while (1) { 737 - 738 743 ret = ppoll(t->fds, t->poll_count, ts, &mask_old); 739 744 if (ret <= 0) { 740 745 stop_tests(t); ··· 772 779 for (i = 0; i < t->device_count; i++) 773 780 if (t->stop_all || device_enabled(t, i)) 774 781 write_sysfs_val(t->devices[i].sysfs_entry, "type", 0); 775 - 776 782 777 783 for (i = 0; i < t->device_count; i++) { 778 784 if (!device_enabled(t, i)) ··· 815 823 return 0; 816 824 } 817 825 818 - 819 826 void loopback_run(struct loopback_test *t) 820 827 { 821 828 int i; ··· 843 852 if (ret) 844 853 goto err; 845 854 846 - 847 855 get_results(t); 848 856 849 857 log_results(t); ··· 851 861 852 862 err: 853 863 printf("Error running test\n"); 854 - return; 855 864 } 856 865 857 866 static int sanity_check(struct loopback_test *t) ··· 870 881 fprintf(stderr, "Bad device mask %x\n", (1 << i)); 871 882 return -1; 872 883 } 873 - 874 884 } 875 - 876 885 877 886 return 0; 878 887 }
+2 -4
drivers/staging/iio/frequency/ad9834.c
··· 331 331 static IIO_DEV_ATTR_PHASESYMBOL(0, 0200, NULL, ad9834_write, AD9834_PSEL); 332 332 static IIO_CONST_ATTR_PHASE_SCALE(0, "0.0015339808"); /* 2PI/2^12 rad*/ 333 333 334 - static IIO_DEV_ATTR_PINCONTROL_EN(0, 0200, NULL, 335 - ad9834_write, AD9834_PIN_SW); 334 + static IIO_DEV_ATTR_PINCONTROL_EN(0, 0200, NULL, ad9834_write, AD9834_PIN_SW); 336 335 static IIO_DEV_ATTR_OUT_ENABLE(0, 0200, NULL, ad9834_write, AD9834_RESET); 337 - static IIO_DEV_ATTR_OUTY_ENABLE(0, 1, 0200, NULL, 338 - ad9834_write, AD9834_OPBITEN); 336 + static IIO_DEV_ATTR_OUTY_ENABLE(0, 1, 0200, NULL, ad9834_write, AD9834_OPBITEN); 339 337 static IIO_DEV_ATTR_OUT_WAVETYPE(0, 0, ad9834_store_wavetype, 0); 340 338 static IIO_DEV_ATTR_OUT_WAVETYPE(0, 1, ad9834_store_wavetype, 1); 341 339
+2 -3
drivers/staging/iio/meter/ade7854-i2c.c
··· 109 109 return ret; 110 110 } 111 111 112 - static int ade7854_i2c_probe(struct i2c_client *client, 113 - const struct i2c_device_id *id) 112 + static int ade7854_i2c_probe(struct i2c_client *client) 114 113 { 115 114 struct ade7854_state *st; 116 115 struct iio_dev *indio_dev; ··· 140 141 .driver = { 141 142 .name = "ade7854", 142 143 }, 143 - .probe = ade7854_i2c_probe, 144 + .probe_new = ade7854_i2c_probe, 144 145 .id_table = ade7854_id, 145 146 }; 146 147 module_i2c_driver(ade7854_i2c_driver);
+3
drivers/staging/ks7010/TODO
··· 27 27 - fix the 'card removal' event when card is inserted when booting 28 28 - check what other upstream wireless mechanisms can be used instead of the 29 29 custom ones here 30 + - Switch to use LIB80211. 31 + - Switch to use MAC80211. 32 + - Switch to use CFG80211. 30 33 31 34 Please send any patches to: 32 35 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+126 -122
drivers/staging/ks7010/ks_wlan_net.c
··· 1763 1763 } 1764 1764 1765 1765 static int ks_wlan_set_stop_request(struct net_device *dev, 1766 - struct iw_request_info *info, __u32 *uwrq, 1767 - char *extra) 1766 + struct iw_request_info *info, 1767 + union iwreq_data *uwrq, char *extra) 1768 1768 { 1769 1769 struct ks_wlan_private *priv = netdev_priv(dev); 1770 1770 ··· 1772 1772 return -EPERM; 1773 1773 1774 1774 /* for SLEEP MODE */ 1775 - if (!(*uwrq)) 1775 + if (!(uwrq->mode)) 1776 1776 return -EINVAL; 1777 1777 1778 1778 hostif_sme_enqueue(priv, SME_STOP_REQUEST); ··· 1786 1786 { 1787 1787 struct ks_wlan_private *priv = netdev_priv(dev); 1788 1788 struct iw_mlme *mlme = (struct iw_mlme *)extra; 1789 - __u32 mode = 1; 1789 + union iwreq_data uwrq; 1790 + 1791 + uwrq.mode = 1; 1790 1792 1791 1793 if (priv->sleep_mode == SLP_SLEEP) 1792 1794 return -EPERM; ··· 1801 1799 mlme->reason_code == WLAN_REASON_MIC_FAILURE) 1802 1800 return 0; 1803 1801 1804 - return ks_wlan_set_stop_request(dev, NULL, &mode, NULL); 1802 + return ks_wlan_set_stop_request(dev, NULL, &uwrq, NULL); 1805 1803 } 1806 1804 1807 1805 static int ks_wlan_get_firmware_version(struct net_device *dev, 1808 1806 struct iw_request_info *info, 1809 - struct iw_point *dwrq, char *extra) 1807 + union iwreq_data *uwrq, char *extra) 1810 1808 { 1809 + struct iw_point *dwrq = &uwrq->data; 1811 1810 struct ks_wlan_private *priv = netdev_priv(dev); 1812 1811 1813 1812 dwrq->length = priv->version_size + 1; ··· 1817 1814 } 1818 1815 1819 1816 static int ks_wlan_set_preamble(struct net_device *dev, 1820 - struct iw_request_info *info, __u32 *uwrq, 1821 - char *extra) 1817 + struct iw_request_info *info, 1818 + union iwreq_data *uwrq, char *extra) 1822 1819 { 1823 1820 struct ks_wlan_private *priv = netdev_priv(dev); 1824 1821 ··· 1826 1823 return -EPERM; 1827 1824 1828 1825 /* for SLEEP MODE */ 1829 - if (*uwrq != LONG_PREAMBLE && *uwrq != SHORT_PREAMBLE) 1826 + if (uwrq->mode != LONG_PREAMBLE && uwrq->mode != SHORT_PREAMBLE) 1830 1827 return -EINVAL; 1831 1828 1832 - priv->reg.preamble = *uwrq; 1829 + priv->reg.preamble = uwrq->mode; 1833 1830 priv->need_commit |= SME_MODE_SET; 1834 1831 return -EINPROGRESS; /* Call commit handler */ 1835 1832 } 1836 1833 1837 1834 static int ks_wlan_get_preamble(struct net_device *dev, 1838 - struct iw_request_info *info, __u32 *uwrq, 1839 - char *extra) 1835 + struct iw_request_info *info, 1836 + union iwreq_data *uwrq, char *extra) 1840 1837 { 1841 1838 struct ks_wlan_private *priv = netdev_priv(dev); 1842 1839 ··· 1844 1841 return -EPERM; 1845 1842 1846 1843 /* for SLEEP MODE */ 1847 - *uwrq = priv->reg.preamble; 1844 + uwrq->mode = priv->reg.preamble; 1848 1845 return 0; 1849 1846 } 1850 1847 1851 1848 static int ks_wlan_set_power_mgmt(struct net_device *dev, 1852 - struct iw_request_info *info, __u32 *uwrq, 1853 - char *extra) 1849 + struct iw_request_info *info, 1850 + union iwreq_data *uwrq, char *extra) 1854 1851 { 1855 1852 struct ks_wlan_private *priv = netdev_priv(dev); 1856 1853 1857 1854 if (priv->sleep_mode == SLP_SLEEP) 1858 1855 return -EPERM; 1859 1856 1860 - if (*uwrq != POWER_MGMT_ACTIVE && 1861 - *uwrq != POWER_MGMT_SAVE1 && 1862 - *uwrq != POWER_MGMT_SAVE2) 1857 + if (uwrq->mode != POWER_MGMT_ACTIVE && 1858 + uwrq->mode != POWER_MGMT_SAVE1 && 1859 + uwrq->mode != POWER_MGMT_SAVE2) 1863 1860 return -EINVAL; 1864 1861 1865 - if ((*uwrq == POWER_MGMT_SAVE1 || *uwrq == POWER_MGMT_SAVE2) && 1862 + if ((uwrq->mode == POWER_MGMT_SAVE1 || uwrq->mode == POWER_MGMT_SAVE2) && 1866 1863 (priv->reg.operation_mode != MODE_INFRASTRUCTURE)) 1867 1864 return -EINVAL; 1868 1865 1869 - priv->reg.power_mgmt = *uwrq; 1866 + priv->reg.power_mgmt = uwrq->mode; 1870 1867 hostif_sme_enqueue(priv, SME_POW_MNGMT_REQUEST); 1871 1868 1872 1869 return 0; 1873 1870 } 1874 1871 1875 1872 static int ks_wlan_get_power_mgmt(struct net_device *dev, 1876 - struct iw_request_info *info, __u32 *uwrq, 1877 - char *extra) 1873 + struct iw_request_info *info, 1874 + union iwreq_data *uwrq, char *extra) 1878 1875 { 1879 1876 struct ks_wlan_private *priv = netdev_priv(dev); 1880 1877 ··· 1882 1879 return -EPERM; 1883 1880 1884 1881 /* for SLEEP MODE */ 1885 - *uwrq = priv->reg.power_mgmt; 1882 + uwrq->mode = priv->reg.power_mgmt; 1886 1883 return 0; 1887 1884 } 1888 1885 1889 1886 static int ks_wlan_set_scan_type(struct net_device *dev, 1890 - struct iw_request_info *info, __u32 *uwrq, 1891 - char *extra) 1887 + struct iw_request_info *info, 1888 + union iwreq_data *uwrq, char *extra) 1892 1889 { 1893 1890 struct ks_wlan_private *priv = netdev_priv(dev); 1894 1891 ··· 1896 1893 return -EPERM; 1897 1894 /* for SLEEP MODE */ 1898 1895 1899 - if (*uwrq != ACTIVE_SCAN && *uwrq != PASSIVE_SCAN) 1896 + if (uwrq->mode != ACTIVE_SCAN && uwrq->mode != PASSIVE_SCAN) 1900 1897 return -EINVAL; 1901 1898 1902 - priv->reg.scan_type = *uwrq; 1899 + priv->reg.scan_type = uwrq->mode; 1903 1900 return 0; 1904 1901 } 1905 1902 1906 1903 static int ks_wlan_get_scan_type(struct net_device *dev, 1907 - struct iw_request_info *info, __u32 *uwrq, 1908 - char *extra) 1904 + struct iw_request_info *info, 1905 + union iwreq_data *uwrq, char *extra) 1909 1906 { 1910 1907 struct ks_wlan_private *priv = netdev_priv(dev); 1911 1908 1912 1909 if (priv->sleep_mode == SLP_SLEEP) 1913 1910 return -EPERM; 1914 1911 /* for SLEEP MODE */ 1915 - *uwrq = priv->reg.scan_type; 1912 + uwrq->mode = priv->reg.scan_type; 1916 1913 return 0; 1917 1914 } 1918 1915 1919 1916 static int ks_wlan_set_beacon_lost(struct net_device *dev, 1920 - struct iw_request_info *info, __u32 *uwrq, 1921 - char *extra) 1917 + struct iw_request_info *info, 1918 + union iwreq_data *uwrq, char *extra) 1922 1919 { 1923 1920 struct ks_wlan_private *priv = netdev_priv(dev); 1924 1921 1925 1922 if (priv->sleep_mode == SLP_SLEEP) 1926 1923 return -EPERM; 1927 1924 /* for SLEEP MODE */ 1928 - if (*uwrq > BEACON_LOST_COUNT_MAX) 1925 + if (uwrq->mode > BEACON_LOST_COUNT_MAX) 1929 1926 return -EINVAL; 1930 1927 1931 - priv->reg.beacon_lost_count = *uwrq; 1928 + priv->reg.beacon_lost_count = uwrq->mode; 1932 1929 1933 1930 if (priv->reg.operation_mode == MODE_INFRASTRUCTURE) { 1934 1931 priv->need_commit |= SME_MODE_SET; ··· 1939 1936 } 1940 1937 1941 1938 static int ks_wlan_get_beacon_lost(struct net_device *dev, 1942 - struct iw_request_info *info, __u32 *uwrq, 1943 - char *extra) 1939 + struct iw_request_info *info, 1940 + union iwreq_data *uwrq, char *extra) 1944 1941 { 1945 1942 struct ks_wlan_private *priv = netdev_priv(dev); 1946 1943 1947 1944 if (priv->sleep_mode == SLP_SLEEP) 1948 1945 return -EPERM; 1949 1946 /* for SLEEP MODE */ 1950 - *uwrq = priv->reg.beacon_lost_count; 1947 + uwrq->mode = priv->reg.beacon_lost_count; 1951 1948 return 0; 1952 1949 } 1953 1950 1954 1951 static int ks_wlan_set_phy_type(struct net_device *dev, 1955 - struct iw_request_info *info, __u32 *uwrq, 1956 - char *extra) 1952 + struct iw_request_info *info, 1953 + union iwreq_data *uwrq, char *extra) 1957 1954 { 1958 1955 struct ks_wlan_private *priv = netdev_priv(dev); 1959 1956 1960 1957 if (priv->sleep_mode == SLP_SLEEP) 1961 1958 return -EPERM; 1962 1959 1963 - if (*uwrq != D_11B_ONLY_MODE && 1964 - *uwrq != D_11G_ONLY_MODE && 1965 - *uwrq != D_11BG_COMPATIBLE_MODE) 1960 + if (uwrq->mode != D_11B_ONLY_MODE && 1961 + uwrq->mode != D_11G_ONLY_MODE && 1962 + uwrq->mode != D_11BG_COMPATIBLE_MODE) 1966 1963 return -EINVAL; 1967 1964 1968 1965 /* for SLEEP MODE */ 1969 - priv->reg.phy_type = *uwrq; 1966 + priv->reg.phy_type = uwrq->mode; 1970 1967 priv->need_commit |= SME_MODE_SET; 1971 1968 return -EINPROGRESS; /* Call commit handler */ 1972 1969 } 1973 1970 1974 1971 static int ks_wlan_get_phy_type(struct net_device *dev, 1975 - struct iw_request_info *info, __u32 *uwrq, 1976 - char *extra) 1972 + struct iw_request_info *info, 1973 + union iwreq_data *uwrq, char *extra) 1977 1974 { 1978 1975 struct ks_wlan_private *priv = netdev_priv(dev); 1979 1976 1980 1977 if (priv->sleep_mode == SLP_SLEEP) 1981 1978 return -EPERM; 1982 1979 /* for SLEEP MODE */ 1983 - *uwrq = priv->reg.phy_type; 1980 + uwrq->mode = priv->reg.phy_type; 1984 1981 return 0; 1985 1982 } 1986 1983 1987 1984 static int ks_wlan_set_cts_mode(struct net_device *dev, 1988 - struct iw_request_info *info, __u32 *uwrq, 1989 - char *extra) 1985 + struct iw_request_info *info, 1986 + union iwreq_data *uwrq, char *extra) 1990 1987 { 1991 1988 struct ks_wlan_private *priv = netdev_priv(dev); 1992 1989 1993 1990 if (priv->sleep_mode == SLP_SLEEP) 1994 1991 return -EPERM; 1995 1992 /* for SLEEP MODE */ 1996 - if (*uwrq != CTS_MODE_FALSE && *uwrq != CTS_MODE_TRUE) 1993 + if (uwrq->mode != CTS_MODE_FALSE && uwrq->mode != CTS_MODE_TRUE) 1997 1994 return -EINVAL; 1998 1995 1999 - priv->reg.cts_mode = (*uwrq == CTS_MODE_FALSE) ? *uwrq : 1996 + priv->reg.cts_mode = (uwrq->mode == CTS_MODE_FALSE) ? uwrq->mode : 2000 1997 (priv->reg.phy_type == D_11G_ONLY_MODE || 2001 1998 priv->reg.phy_type == D_11BG_COMPATIBLE_MODE) ? 2002 - *uwrq : !*uwrq; 1999 + uwrq->mode : !uwrq->mode; 2003 2000 2004 2001 priv->need_commit |= SME_MODE_SET; 2005 2002 return -EINPROGRESS; /* Call commit handler */ 2006 2003 } 2007 2004 2008 2005 static int ks_wlan_get_cts_mode(struct net_device *dev, 2009 - struct iw_request_info *info, __u32 *uwrq, 2010 - char *extra) 2006 + struct iw_request_info *info, 2007 + union iwreq_data *uwrq, char *extra) 2011 2008 { 2012 2009 struct ks_wlan_private *priv = netdev_priv(dev); 2013 2010 2014 2011 if (priv->sleep_mode == SLP_SLEEP) 2015 2012 return -EPERM; 2016 2013 /* for SLEEP MODE */ 2017 - *uwrq = priv->reg.cts_mode; 2014 + uwrq->mode = priv->reg.cts_mode; 2018 2015 return 0; 2019 2016 } 2020 2017 2021 2018 static int ks_wlan_set_sleep_mode(struct net_device *dev, 2022 2019 struct iw_request_info *info, 2023 - __u32 *uwrq, char *extra) 2020 + union iwreq_data *uwrq, char *extra) 2024 2021 { 2025 2022 struct ks_wlan_private *priv = netdev_priv(dev); 2026 2023 2027 - if (*uwrq != SLP_SLEEP && 2028 - *uwrq != SLP_ACTIVE) { 2029 - netdev_err(dev, "SET_SLEEP_MODE %d error\n", *uwrq); 2024 + if (uwrq->mode != SLP_SLEEP && 2025 + uwrq->mode != SLP_ACTIVE) { 2026 + netdev_err(dev, "SET_SLEEP_MODE %d error\n", uwrq->mode); 2030 2027 return -EINVAL; 2031 2028 } 2032 2029 2033 - priv->sleep_mode = *uwrq; 2030 + priv->sleep_mode = uwrq->mode; 2034 2031 netdev_info(dev, "SET_SLEEP_MODE %d\n", priv->sleep_mode); 2035 2032 2036 - if (*uwrq == SLP_SLEEP) 2033 + if (uwrq->mode == SLP_SLEEP) 2037 2034 hostif_sme_enqueue(priv, SME_STOP_REQUEST); 2038 2035 2039 2036 hostif_sme_enqueue(priv, SME_SLEEP_REQUEST); ··· 2043 2040 2044 2041 static int ks_wlan_get_sleep_mode(struct net_device *dev, 2045 2042 struct iw_request_info *info, 2046 - __u32 *uwrq, char *extra) 2043 + union iwreq_data *uwrq, char *extra) 2047 2044 { 2048 2045 struct ks_wlan_private *priv = netdev_priv(dev); 2049 2046 2050 - *uwrq = priv->sleep_mode; 2047 + uwrq->mode = priv->sleep_mode; 2051 2048 2052 2049 return 0; 2053 2050 } 2054 2051 2055 2052 static int ks_wlan_set_wps_enable(struct net_device *dev, 2056 - struct iw_request_info *info, __u32 *uwrq, 2057 - char *extra) 2053 + struct iw_request_info *info, 2054 + union iwreq_data *uwrq, char *extra) 2058 2055 { 2059 2056 struct ks_wlan_private *priv = netdev_priv(dev); 2060 2057 2061 2058 if (priv->sleep_mode == SLP_SLEEP) 2062 2059 return -EPERM; 2063 2060 /* for SLEEP MODE */ 2064 - if (*uwrq != 0 && *uwrq != 1) 2061 + if (uwrq->mode != 0 && uwrq->mode != 1) 2065 2062 return -EINVAL; 2066 2063 2067 - priv->wps.wps_enabled = *uwrq; 2064 + priv->wps.wps_enabled = uwrq->mode; 2068 2065 hostif_sme_enqueue(priv, SME_WPS_ENABLE_REQUEST); 2069 2066 2070 2067 return 0; 2071 2068 } 2072 2069 2073 2070 static int ks_wlan_get_wps_enable(struct net_device *dev, 2074 - struct iw_request_info *info, __u32 *uwrq, 2075 - char *extra) 2071 + struct iw_request_info *info, 2072 + union iwreq_data *uwrq, char *extra) 2076 2073 { 2077 2074 struct ks_wlan_private *priv = netdev_priv(dev); 2078 2075 2079 2076 if (priv->sleep_mode == SLP_SLEEP) 2080 2077 return -EPERM; 2081 2078 /* for SLEEP MODE */ 2082 - *uwrq = priv->wps.wps_enabled; 2083 - netdev_info(dev, "return=%d\n", *uwrq); 2079 + uwrq->mode = priv->wps.wps_enabled; 2080 + netdev_info(dev, "return=%d\n", uwrq->mode); 2084 2081 2085 2082 return 0; 2086 2083 } 2087 2084 2088 2085 static int ks_wlan_set_wps_probe_req(struct net_device *dev, 2089 2086 struct iw_request_info *info, 2090 - struct iw_point *dwrq, char *extra) 2087 + union iwreq_data *uwrq, char *extra) 2091 2088 { 2089 + struct iw_point *dwrq = &uwrq->data; 2092 2090 u8 *p = extra; 2093 2091 unsigned char len; 2094 2092 struct ks_wlan_private *priv = netdev_priv(dev); ··· 2118 2114 } 2119 2115 2120 2116 static int ks_wlan_set_tx_gain(struct net_device *dev, 2121 - struct iw_request_info *info, __u32 *uwrq, 2122 - char *extra) 2117 + struct iw_request_info *info, 2118 + union iwreq_data *uwrq, char *extra) 2123 2119 { 2124 2120 struct ks_wlan_private *priv = netdev_priv(dev); 2125 2121 2126 2122 if (priv->sleep_mode == SLP_SLEEP) 2127 2123 return -EPERM; 2128 2124 /* for SLEEP MODE */ 2129 - if (*uwrq > 0xFF) 2125 + if (uwrq->mode > 0xFF) 2130 2126 return -EINVAL; 2131 2127 2132 - priv->gain.tx_gain = (u8)*uwrq; 2128 + priv->gain.tx_gain = (u8)uwrq->mode; 2133 2129 priv->gain.tx_mode = (priv->gain.tx_gain < 0xFF) ? 1 : 0; 2134 2130 hostif_sme_enqueue(priv, SME_SET_GAIN); 2135 2131 return 0; 2136 2132 } 2137 2133 2138 2134 static int ks_wlan_get_tx_gain(struct net_device *dev, 2139 - struct iw_request_info *info, __u32 *uwrq, 2140 - char *extra) 2135 + struct iw_request_info *info, 2136 + union iwreq_data *uwrq, char *extra) 2141 2137 { 2142 2138 struct ks_wlan_private *priv = netdev_priv(dev); 2143 2139 2144 2140 if (priv->sleep_mode == SLP_SLEEP) 2145 2141 return -EPERM; 2146 2142 /* for SLEEP MODE */ 2147 - *uwrq = priv->gain.tx_gain; 2143 + uwrq->mode = priv->gain.tx_gain; 2148 2144 hostif_sme_enqueue(priv, SME_GET_GAIN); 2149 2145 return 0; 2150 2146 } 2151 2147 2152 2148 static int ks_wlan_set_rx_gain(struct net_device *dev, 2153 - struct iw_request_info *info, __u32 *uwrq, 2154 - char *extra) 2149 + struct iw_request_info *info, 2150 + union iwreq_data *uwrq, char *extra) 2155 2151 { 2156 2152 struct ks_wlan_private *priv = netdev_priv(dev); 2157 2153 2158 2154 if (priv->sleep_mode == SLP_SLEEP) 2159 2155 return -EPERM; 2160 2156 /* for SLEEP MODE */ 2161 - if (*uwrq > 0xFF) 2157 + if (uwrq->mode > 0xFF) 2162 2158 return -EINVAL; 2163 2159 2164 - priv->gain.rx_gain = (u8)*uwrq; 2160 + priv->gain.rx_gain = (u8)uwrq->mode; 2165 2161 priv->gain.rx_mode = (priv->gain.rx_gain < 0xFF) ? 1 : 0; 2166 2162 hostif_sme_enqueue(priv, SME_SET_GAIN); 2167 2163 return 0; 2168 2164 } 2169 2165 2170 2166 static int ks_wlan_get_rx_gain(struct net_device *dev, 2171 - struct iw_request_info *info, __u32 *uwrq, 2172 - char *extra) 2167 + struct iw_request_info *info, 2168 + union iwreq_data *uwrq, char *extra) 2173 2169 { 2174 2170 struct ks_wlan_private *priv = netdev_priv(dev); 2175 2171 2176 2172 if (priv->sleep_mode == SLP_SLEEP) 2177 2173 return -EPERM; 2178 2174 /* for SLEEP MODE */ 2179 - *uwrq = priv->gain.rx_gain; 2175 + uwrq->mode = priv->gain.rx_gain; 2180 2176 hostif_sme_enqueue(priv, SME_GET_GAIN); 2181 2177 return 0; 2182 2178 } 2183 2179 2184 2180 static int ks_wlan_get_eeprom_cksum(struct net_device *dev, 2185 - struct iw_request_info *info, __u32 *uwrq, 2186 - char *extra) 2181 + struct iw_request_info *info, 2182 + union iwreq_data *uwrq, char *extra) 2187 2183 { 2188 2184 struct ks_wlan_private *priv = netdev_priv(dev); 2189 2185 2190 - *uwrq = priv->eeprom_checksum; 2186 + uwrq->mode = priv->eeprom_checksum; 2191 2187 return 0; 2192 2188 } 2193 2189 ··· 2306 2302 2307 2303 /* get host command history */ 2308 2304 static int ks_wlan_hostt(struct net_device *dev, struct iw_request_info *info, 2309 - __u32 *uwrq, char *extra) 2305 + union iwreq_data *uwrq, char *extra) 2310 2306 { 2311 2307 int i, event; 2312 2308 struct ks_wlan_private *priv = netdev_priv(dev); ··· 2413 2409 2414 2410 /* private_handler */ 2415 2411 static const iw_handler ks_wlan_private_handler[] = { 2416 - (iw_handler)NULL, /* 0 */ 2417 - (iw_handler)NULL, /* 1, KS_WLAN_GET_DRIVER_VERSION */ 2418 - (iw_handler)NULL, /* 2 */ 2419 - (iw_handler)ks_wlan_get_firmware_version,/* 3 KS_WLAN_GET_FIRM_VERSION */ 2420 - (iw_handler)ks_wlan_set_wps_enable, /* 4 KS_WLAN_SET_WPS_ENABLE */ 2421 - (iw_handler)ks_wlan_get_wps_enable, /* 5 KS_WLAN_GET_WPS_ENABLE */ 2422 - (iw_handler)ks_wlan_set_wps_probe_req, /* 6 KS_WLAN_SET_WPS_PROBE_REQ */ 2423 - (iw_handler)ks_wlan_get_eeprom_cksum, /* 7 KS_WLAN_GET_CONNECT */ 2424 - (iw_handler)ks_wlan_set_preamble, /* 8 KS_WLAN_SET_PREAMBLE */ 2425 - (iw_handler)ks_wlan_get_preamble, /* 9 KS_WLAN_GET_PREAMBLE */ 2426 - (iw_handler)ks_wlan_set_power_mgmt, /* 10 KS_WLAN_SET_POWER_SAVE */ 2427 - (iw_handler)ks_wlan_get_power_mgmt, /* 11 KS_WLAN_GET_POWER_SAVE */ 2428 - (iw_handler)ks_wlan_set_scan_type, /* 12 KS_WLAN_SET_SCAN_TYPE */ 2429 - (iw_handler)ks_wlan_get_scan_type, /* 13 KS_WLAN_GET_SCAN_TYPE */ 2430 - (iw_handler)ks_wlan_set_rx_gain, /* 14 KS_WLAN_SET_RX_GAIN */ 2431 - (iw_handler)ks_wlan_get_rx_gain, /* 15 KS_WLAN_GET_RX_GAIN */ 2432 - (iw_handler)ks_wlan_hostt, /* 16 KS_WLAN_HOSTT */ 2433 - (iw_handler)NULL, /* 17 */ 2434 - (iw_handler)ks_wlan_set_beacon_lost, /* 18 KS_WLAN_SET_BECAN_LOST */ 2435 - (iw_handler)ks_wlan_get_beacon_lost, /* 19 KS_WLAN_GET_BECAN_LOST */ 2436 - (iw_handler)ks_wlan_set_tx_gain, /* 20 KS_WLAN_SET_TX_GAIN */ 2437 - (iw_handler)ks_wlan_get_tx_gain, /* 21 KS_WLAN_GET_TX_GAIN */ 2438 - (iw_handler)ks_wlan_set_phy_type, /* 22 KS_WLAN_SET_PHY_TYPE */ 2439 - (iw_handler)ks_wlan_get_phy_type, /* 23 KS_WLAN_GET_PHY_TYPE */ 2440 - (iw_handler)ks_wlan_set_cts_mode, /* 24 KS_WLAN_SET_CTS_MODE */ 2441 - (iw_handler)ks_wlan_get_cts_mode, /* 25 KS_WLAN_GET_CTS_MODE */ 2442 - (iw_handler)NULL, /* 26 */ 2443 - (iw_handler)NULL, /* 27 */ 2444 - (iw_handler)ks_wlan_set_sleep_mode, /* 28 KS_WLAN_SET_SLEEP_MODE */ 2445 - (iw_handler)ks_wlan_get_sleep_mode, /* 29 KS_WLAN_GET_SLEEP_MODE */ 2446 - (iw_handler)NULL, /* 30 */ 2447 - (iw_handler)NULL, /* 31 */ 2412 + NULL, /* 0 */ 2413 + NULL, /* 1, KS_WLAN_GET_DRIVER_VERSION */ 2414 + NULL, /* 2 */ 2415 + ks_wlan_get_firmware_version, /* 3 KS_WLAN_GET_FIRM_VERSION */ 2416 + ks_wlan_set_wps_enable, /* 4 KS_WLAN_SET_WPS_ENABLE */ 2417 + ks_wlan_get_wps_enable, /* 5 KS_WLAN_GET_WPS_ENABLE */ 2418 + ks_wlan_set_wps_probe_req, /* 6 KS_WLAN_SET_WPS_PROBE_REQ */ 2419 + ks_wlan_get_eeprom_cksum, /* 7 KS_WLAN_GET_CONNECT */ 2420 + ks_wlan_set_preamble, /* 8 KS_WLAN_SET_PREAMBLE */ 2421 + ks_wlan_get_preamble, /* 9 KS_WLAN_GET_PREAMBLE */ 2422 + ks_wlan_set_power_mgmt, /* 10 KS_WLAN_SET_POWER_SAVE */ 2423 + ks_wlan_get_power_mgmt, /* 11 KS_WLAN_GET_POWER_SAVE */ 2424 + ks_wlan_set_scan_type, /* 12 KS_WLAN_SET_SCAN_TYPE */ 2425 + ks_wlan_get_scan_type, /* 13 KS_WLAN_GET_SCAN_TYPE */ 2426 + ks_wlan_set_rx_gain, /* 14 KS_WLAN_SET_RX_GAIN */ 2427 + ks_wlan_get_rx_gain, /* 15 KS_WLAN_GET_RX_GAIN */ 2428 + ks_wlan_hostt, /* 16 KS_WLAN_HOSTT */ 2429 + NULL, /* 17 */ 2430 + ks_wlan_set_beacon_lost, /* 18 KS_WLAN_SET_BECAN_LOST */ 2431 + ks_wlan_get_beacon_lost, /* 19 KS_WLAN_GET_BECAN_LOST */ 2432 + ks_wlan_set_tx_gain, /* 20 KS_WLAN_SET_TX_GAIN */ 2433 + ks_wlan_get_tx_gain, /* 21 KS_WLAN_GET_TX_GAIN */ 2434 + ks_wlan_set_phy_type, /* 22 KS_WLAN_SET_PHY_TYPE */ 2435 + ks_wlan_get_phy_type, /* 23 KS_WLAN_GET_PHY_TYPE */ 2436 + ks_wlan_set_cts_mode, /* 24 KS_WLAN_SET_CTS_MODE */ 2437 + ks_wlan_get_cts_mode, /* 25 KS_WLAN_GET_CTS_MODE */ 2438 + NULL, /* 26 */ 2439 + NULL, /* 27 */ 2440 + ks_wlan_set_sleep_mode, /* 28 KS_WLAN_SET_SLEEP_MODE */ 2441 + ks_wlan_get_sleep_mode, /* 29 KS_WLAN_GET_SLEEP_MODE */ 2442 + NULL, /* 30 */ 2443 + NULL, /* 31 */ 2448 2444 }; 2449 2445 2450 2446 static const struct iw_handler_def ks_wlan_handler_def = { ··· 2465 2461 2466 2462 switch (cmd) { 2467 2463 case SIOCIWFIRSTPRIV + 20: /* KS_WLAN_SET_STOP_REQ */ 2468 - ret = ks_wlan_set_stop_request(dev, NULL, &wrq->u.mode, NULL); 2464 + ret = ks_wlan_set_stop_request(dev, NULL, &wrq->u, NULL); 2469 2465 break; 2470 2466 // All other calls are currently unsupported 2471 2467 default:
+2 -2
drivers/staging/most/dim2/dim2.c
··· 161 161 struct list_head *head = &hdm_ch->pending_list; 162 162 struct mbo *mbo; 163 163 unsigned long flags; 164 - struct dim_ch_state_t st; 164 + struct dim_ch_state st; 165 165 166 166 BUG_ON(!hdm_ch); 167 167 BUG_ON(!hdm_ch->is_initialized); ··· 259 259 static void service_done_flag(struct dim2_hdm *dev, int ch_idx) 260 260 { 261 261 struct hdm_channel *hdm_ch = dev->hch + ch_idx; 262 - struct dim_ch_state_t st; 262 + struct dim_ch_state st; 263 263 struct list_head *head; 264 264 struct mbo *mbo; 265 265 int done_buffers;
+2 -2
drivers/staging/most/dim2/hal.c
··· 943 943 return channel_service(ch); 944 944 } 945 945 946 - struct dim_ch_state_t *dim_get_channel_state(struct dim_channel *ch, 947 - struct dim_ch_state_t *state_ptr) 946 + struct dim_ch_state *dim_get_channel_state(struct dim_channel *ch, 947 + struct dim_ch_state *state_ptr) 948 948 { 949 949 if (!ch || !state_ptr) 950 950 return NULL;
+3 -3
drivers/staging/most/dim2/hal.h
··· 27 27 CLK_8192FS = 7, 28 28 }; 29 29 30 - struct dim_ch_state_t { 30 + struct dim_ch_state { 31 31 bool ready; /* Shows readiness to enqueue next buffer */ 32 32 u16 done_buffers; /* Number of completed buffers */ 33 33 }; ··· 87 87 88 88 u8 dim_service_channel(struct dim_channel *ch); 89 89 90 - struct dim_ch_state_t *dim_get_channel_state(struct dim_channel *ch, 91 - struct dim_ch_state_t *state_ptr); 90 + struct dim_ch_state *dim_get_channel_state(struct dim_channel *ch, 91 + struct dim_ch_state *state_ptr); 92 92 93 93 u16 dim_dbr_space(struct dim_channel *ch); 94 94
+2 -2
drivers/staging/most/i2c/i2c.c
··· 284 284 * 285 285 * Register the i2c client device as a MOST interface 286 286 */ 287 - static int i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) 287 + static int i2c_probe(struct i2c_client *client) 288 288 { 289 289 struct hdm_i2c *dev; 290 290 int ret, i; ··· 359 359 .driver = { 360 360 .name = "hdm_i2c", 361 361 }, 362 - .probe = i2c_probe, 362 + .probe_new = i2c_probe, 363 363 .remove = i2c_remove, 364 364 .id_table = i2c_id, 365 365 };
-2
drivers/staging/octeon/ethernet-tx.c
··· 73 73 { 74 74 int skb_to_free; 75 75 int qos, queues_per_port; 76 - int total_freed = 0; 77 76 int total_remaining = 0; 78 77 unsigned long flags; 79 78 struct octeon_ethernet *priv = netdev_priv(dev); ··· 86 87 MAX_SKB_TO_FREE); 87 88 skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free, 88 89 priv->fau + qos * 4); 89 - total_freed += skb_to_free; 90 90 if (skb_to_free > 0) { 91 91 struct sk_buff *to_free_list = NULL; 92 92
+1 -1
drivers/staging/octeon/octeon-stubs.h
··· 1212 1212 return (void *)(uintptr_t)(physical_address); 1213 1213 } 1214 1214 1215 - static inline uint64_t cvmx_ptr_to_phys(void *ptr) 1215 + static inline phys_addr_t cvmx_ptr_to_phys(void *ptr) 1216 1216 { 1217 1217 return (unsigned long)ptr; 1218 1218 }
+2 -2
drivers/staging/olpc_dcon/olpc_dcon.c
··· 579 579 return 0; 580 580 } 581 581 582 - static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id) 582 + static int dcon_probe(struct i2c_client *client) 583 583 { 584 584 struct dcon_priv *dcon; 585 585 int rc, i, j; ··· 779 779 }, 780 780 .class = I2C_CLASS_DDC | I2C_CLASS_HWMON, 781 781 .id_table = dcon_idtable, 782 - .probe = dcon_probe, 782 + .probe_new = dcon_probe, 783 783 .remove = dcon_remove, 784 784 .detect = dcon_detect, 785 785 .address_list = normal_i2c,
+2 -5
drivers/staging/r8188eu/core/rtw_ap.c
··· 1017 1017 return beacon_updated; 1018 1018 } 1019 1019 1020 - int rtw_sta_flush(struct adapter *padapter) 1020 + void rtw_sta_flush(struct adapter *padapter) 1021 1021 { 1022 1022 struct list_head *phead, *plist; 1023 - int ret = 0; 1024 1023 struct sta_info *psta = NULL; 1025 1024 struct sta_priv *pstapriv = &padapter->stapriv; 1026 1025 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ··· 1027 1028 u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 1028 1029 1029 1030 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) 1030 - return ret; 1031 + return; 1031 1032 1032 1033 spin_lock_bh(&pstapriv->asoc_list_lock); 1033 1034 phead = &pstapriv->asoc_list; ··· 1049 1050 issue_deauth(padapter, bc_addr, WLAN_REASON_DEAUTH_LEAVING); 1050 1051 1051 1052 associated_clients_update(padapter, true); 1052 - 1053 - return ret; 1054 1053 } 1055 1054 1056 1055 /* called > TSR LEVEL for USB or SDIO Interface*/
+62 -64
drivers/staging/r8188eu/core/rtw_br_ext.c
··· 50 50 static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type) 51 51 { 52 52 unsigned char *cur_ptr, *start_ptr; 53 - unsigned short tagLen, tagType; 53 + unsigned short tag_len, tag_type; 54 54 55 55 start_ptr = (unsigned char *)ph->tag; 56 56 cur_ptr = (unsigned char *)ph->tag; 57 57 while ((cur_ptr - start_ptr) < ntohs(ph->length)) { 58 58 /* prevent un-alignment access */ 59 - tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]); 60 - tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]); 61 - if (tagType == type) 59 + tag_type = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]); 60 + tag_len = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]); 61 + if (tag_type == type) 62 62 return cur_ptr; 63 - cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen; 63 + cur_ptr = cur_ptr + TAG_HDR_LEN + tag_len; 64 64 } 65 65 return NULL; 66 66 } ··· 111 111 return 0; 112 112 } 113 113 114 - static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr, 115 - unsigned int *ipAddr) 114 + static void __nat25_generate_ipv4_network_addr(unsigned char *addr, 115 + unsigned int *ip_addr) 116 116 { 117 - memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); 117 + memset(addr, 0, MAX_NETWORK_ADDR_LEN); 118 118 119 - networkAddr[0] = NAT25_IPV4; 120 - memcpy(networkAddr + 7, (unsigned char *)ipAddr, 4); 119 + addr[0] = NAT25_IPV4; 120 + memcpy(addr + 7, (unsigned char *)ip_addr, 4); 121 121 } 122 122 123 - static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr, 123 + static void __nat25_generate_pppoe_network_addr(unsigned char *addr, 124 124 unsigned char *ac_mac, __be16 *sid) 125 125 { 126 - memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); 126 + memset(addr, 0, MAX_NETWORK_ADDR_LEN); 127 127 128 - networkAddr[0] = NAT25_PPPOE; 129 - memcpy(networkAddr + 1, (unsigned char *)sid, 2); 130 - memcpy(networkAddr + 3, (unsigned char *)ac_mac, 6); 128 + addr[0] = NAT25_PPPOE; 129 + memcpy(addr + 1, (unsigned char *)sid, 2); 130 + memcpy(addr + 3, (unsigned char *)ac_mac, 6); 131 131 } 132 132 133 - static void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr, 134 - unsigned int *ipAddr) 133 + static void __nat25_generate_ipv6_network_addr(unsigned char *addr, 134 + unsigned int *ip_addr) 135 135 { 136 - memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN); 136 + memset(addr, 0, MAX_NETWORK_ADDR_LEN); 137 137 138 - networkAddr[0] = NAT25_IPV6; 139 - memcpy(networkAddr + 1, (unsigned char *)ipAddr, 16); 138 + addr[0] = NAT25_IPV6; 139 + memcpy(addr + 1, (unsigned char *)ip_addr, 16); 140 140 } 141 141 142 142 static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag, unsigned char len8b) ··· 200 200 return 0; 201 201 } 202 202 203 - static int __nat25_network_hash(unsigned char *networkAddr) 203 + static int __nat25_network_hash(unsigned char *addr) 204 204 { 205 - if (networkAddr[0] == NAT25_IPV4) { 205 + if (addr[0] == NAT25_IPV4) { 206 206 unsigned long x; 207 207 208 - x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10]; 208 + x = addr[7] ^ addr[8] ^ addr[9] ^ addr[10]; 209 209 210 210 return x & (NAT25_HASH_SIZE - 1); 211 - } else if (networkAddr[0] == NAT25_IPX) { 211 + } else if (addr[0] == NAT25_IPX) { 212 212 unsigned long x; 213 213 214 - x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ 215 - networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10]; 214 + x = addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ addr[5] ^ 215 + addr[6] ^ addr[7] ^ addr[8] ^ addr[9] ^ addr[10]; 216 216 217 217 return x & (NAT25_HASH_SIZE - 1); 218 - } else if (networkAddr[0] == NAT25_APPLE) { 218 + } else if (addr[0] == NAT25_APPLE) { 219 219 unsigned long x; 220 220 221 - x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3]; 221 + x = addr[1] ^ addr[2] ^ addr[3]; 222 222 223 223 return x & (NAT25_HASH_SIZE - 1); 224 - } else if (networkAddr[0] == NAT25_PPPOE) { 224 + } else if (addr[0] == NAT25_PPPOE) { 225 225 unsigned long x; 226 226 227 - x = networkAddr[0] ^ networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ networkAddr[6] ^ networkAddr[7] ^ networkAddr[8]; 227 + x = addr[0] ^ addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ 228 + addr[5] ^ addr[6] ^ addr[7] ^ addr[8]; 228 229 229 230 return x & (NAT25_HASH_SIZE - 1); 230 - } else if (networkAddr[0] == NAT25_IPV6) { 231 + } else if (addr[0] == NAT25_IPV6) { 231 232 unsigned long x; 232 233 233 - x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ 234 - networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10] ^ 235 - networkAddr[11] ^ networkAddr[12] ^ networkAddr[13] ^ networkAddr[14] ^ networkAddr[15] ^ 236 - networkAddr[16]; 234 + x = addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ addr[5] ^ addr[6] ^ 235 + addr[7] ^ addr[8] ^ addr[9] ^ addr[10] ^ addr[11] ^ addr[12] ^ 236 + addr[13] ^ addr[14] ^ addr[15] ^ addr[16]; 237 237 238 238 return x & (NAT25_HASH_SIZE - 1); 239 239 } else { ··· 241 241 int i; 242 242 243 243 for (i = 0; i < MAX_NETWORK_ADDR_LEN; i++) 244 - x ^= networkAddr[i]; 244 + x ^= addr[i]; 245 245 246 246 return x & (NAT25_HASH_SIZE - 1); 247 247 } ··· 269 269 } 270 270 271 271 static void __nat25_db_network_insert(struct adapter *priv, 272 - unsigned char *macAddr, unsigned char *networkAddr) 272 + unsigned char *mac_addr, unsigned char *addr) 273 273 { 274 274 struct nat25_network_db_entry *db; 275 275 int hash; 276 276 277 277 spin_lock_bh(&priv->br_ext_lock); 278 - hash = __nat25_network_hash(networkAddr); 278 + hash = __nat25_network_hash(addr); 279 279 db = priv->nethash[hash]; 280 280 while (db) { 281 - if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) { 282 - memcpy(db->macAddr, macAddr, ETH_ALEN); 281 + if (!memcmp(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN)) { 282 + memcpy(db->macAddr, mac_addr, ETH_ALEN); 283 283 db->ageing_timer = jiffies; 284 284 spin_unlock_bh(&priv->br_ext_lock); 285 285 return; ··· 291 291 spin_unlock_bh(&priv->br_ext_lock); 292 292 return; 293 293 } 294 - memcpy(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN); 295 - memcpy(db->macAddr, macAddr, ETH_ALEN); 294 + memcpy(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN); 295 + memcpy(db->macAddr, mac_addr, ETH_ALEN); 296 296 atomic_set(&db->use_count, 1); 297 297 db->ageing_timer = jiffies; 298 298 ··· 366 366 int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method) 367 367 { 368 368 unsigned short protocol; 369 - unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; 369 + unsigned char addr[MAX_NETWORK_ADDR_LEN]; 370 370 unsigned int tmp; 371 371 372 372 if (!skb) ··· 395 395 if (iph->saddr == 0) 396 396 return 0; 397 397 tmp = be32_to_cpu(iph->saddr); 398 - __nat25_generate_ipv4_network_addr(networkAddr, &tmp); 398 + __nat25_generate_ipv4_network_addr(addr, &tmp); 399 399 /* record source IP address and , source mac address into db */ 400 - __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); 400 + __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr); 401 401 return 0; 402 402 default: 403 403 return -1; ··· 421 421 memcpy(arp_ptr, GET_MY_HWADDR(priv), ETH_ALEN); 422 422 arp_ptr += arp->ar_hln; 423 423 sender = (unsigned int *)arp_ptr; 424 - __nat25_generate_ipv4_network_addr(networkAddr, sender); 425 - __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); 424 + __nat25_generate_ipv4_network_addr(addr, sender); 425 + __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr); 426 426 return 0; 427 427 default: 428 428 return -1; ··· 495 495 return -1; 496 496 } 497 497 } else { /* session phase */ 498 - __nat25_generate_pppoe_network_addr(networkAddr, skb->data, &ph->sid); 498 + __nat25_generate_pppoe_network_addr(addr, skb->data, &ph->sid); 499 499 500 - __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); 500 + __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr); 501 501 502 502 if (!priv->ethBrExtInfo.addPPPoETag && 503 503 priv->pppoe_connection_in_progress && ··· 548 548 return -1; 549 549 case NAT25_INSERT: 550 550 if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) { 551 - __nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->saddr); 552 - __nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr); 551 + __nat25_generate_ipv6_network_addr(addr, (unsigned int *)&iph->saddr); 552 + __nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr); 553 553 554 554 if (iph->nexthdr == IPPROTO_ICMPV6 && 555 555 skb->len > (ETH_HLEN + sizeof(*iph) + 4)) { ··· 606 606 if (!priv->ethBrExtInfo.dhcp_bcst_disable) { 607 607 __be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN)); 608 608 609 - if (protocol == __constant_htons(ETH_P_IP)) { /* IP */ 609 + if (protocol == htons(ETH_P_IP)) { /* IP */ 610 610 struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN); 611 611 612 612 if (iph->protocol == IPPROTO_UDP) { /* UDP */ 613 - struct udphdr *udph = (struct udphdr *)((size_t)iph + (iph->ihl << 2)); 613 + struct udphdr *udph = (void *)iph + (iph->ihl << 2); 614 614 615 - if ((udph->source == __constant_htons(CLIENT_PORT)) && 616 - (udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */ 617 - struct dhcpMessage *dhcph = 618 - (struct dhcpMessage *)((size_t)udph + sizeof(struct udphdr)); 619 - u32 cookie = be32_to_cpu((__be32)dhcph->cookie); 615 + if ((udph->source == htons(CLIENT_PORT)) && 616 + (udph->dest == htons(SERVER_PORT))) { /* DHCP request */ 617 + struct dhcpMessage *dhcph = (void *)udph + sizeof(struct udphdr); 618 + u32 cookie = be32_to_cpu(dhcph->cookie); 620 619 621 620 if (cookie == DHCP_MAGIC) { /* match magic word */ 622 621 if (!(dhcph->flags & htons(BROADCAST_FLAG))) { ··· 638 639 } 639 640 } 640 641 641 - void *scdb_findEntry(struct adapter *priv, unsigned char *ipAddr) 642 + void *scdb_findEntry(struct adapter *priv, unsigned char *ip_addr) 642 643 { 643 - unsigned char networkAddr[MAX_NETWORK_ADDR_LEN]; 644 + unsigned char addr[MAX_NETWORK_ADDR_LEN]; 644 645 struct nat25_network_db_entry *db; 645 646 int hash; 646 647 647 - __nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr); 648 - hash = __nat25_network_hash(networkAddr); 648 + __nat25_generate_ipv4_network_addr(addr, (unsigned int *)ip_addr); 649 + hash = __nat25_network_hash(addr); 649 650 db = priv->nethash[hash]; 650 651 while (db) { 651 - if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) { 652 + if (!memcmp(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN)) 652 653 return (void *)db; 653 - } 654 654 655 655 db = db->next_hash; 656 656 }
+14 -20
drivers/staging/r8188eu/core/rtw_cmd.c
··· 54 54 return _SUCCESS; 55 55 } 56 56 57 - u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) 57 + int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) 58 58 { 59 59 init_completion(&pcmdpriv->enqueue_cmd); 60 60 /* sema_init(&(pcmdpriv->cmd_done_sema), 0); */ ··· 71 71 GFP_KERNEL); 72 72 73 73 if (!pcmdpriv->cmd_allocated_buf) 74 - return _FAIL; 74 + return -ENOMEM; 75 75 76 76 pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ - 1)); 77 77 ··· 79 79 80 80 if (!pcmdpriv->rsp_allocated_buf) { 81 81 kfree(pcmdpriv->cmd_allocated_buf); 82 - return _FAIL; 82 + return -ENOMEM; 83 83 } 84 84 85 85 pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3); ··· 87 87 pcmdpriv->cmd_done_cnt = 0; 88 88 pcmdpriv->rsp_cnt = 0; 89 89 90 - return _SUCCESS; 90 + return 0; 91 91 } 92 92 93 - u32 rtw_init_evt_priv(struct evt_priv *pevtpriv) 93 + int rtw_init_evt_priv(struct evt_priv *pevtpriv) 94 94 { 95 - u32 res = _SUCCESS; 96 - 97 95 /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ 98 96 atomic_set(&pevtpriv->event_seq, 0); 99 97 ··· 99 101 pevtpriv->c2h_wk_alive = false; 100 102 pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1); 101 103 if (!pevtpriv->c2h_queue) 102 - res = _FAIL; 104 + return -ENOMEM; 103 105 104 - return res; 106 + return 0; 105 107 } 106 108 107 109 void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) ··· 340 342 return res; 341 343 } 342 344 343 - u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset) 345 + int rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset) 344 346 { 345 347 struct cmd_obj *ph2c; 346 348 struct setdatarate_parm *pbsetdataratepara; 347 349 struct cmd_priv *pcmdpriv = &padapter->cmdpriv; 348 - u8 res = _SUCCESS; 349 350 350 351 ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); 351 - if (!ph2c) { 352 - res = _FAIL; 353 - goto exit; 354 - } 352 + if (!ph2c) 353 + return -ENOMEM; 355 354 356 355 pbsetdataratepara = kzalloc(sizeof(*pbsetdataratepara), GFP_ATOMIC); 357 356 if (!pbsetdataratepara) { 358 357 kfree(ph2c); 359 - res = _FAIL; 360 - goto exit; 358 + return -ENOMEM; 361 359 } 362 360 363 361 init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate)); 364 362 pbsetdataratepara->mac_id = 5; 365 363 memcpy(pbsetdataratepara->datarates, rateset, NumRates); 366 - res = rtw_enqueue_cmd(pcmdpriv, ph2c); 367 - exit: 364 + if (rtw_enqueue_cmd(pcmdpriv, ph2c) == _FAIL) 365 + return -EPERM; 368 366 369 - return res; 367 + return 0; 370 368 } 371 369 372 370 void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd)
+2 -4
drivers/staging/r8188eu/core/rtw_ioctl_set.c
··· 287 287 288 288 if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { 289 289 if (check_fwstate(pmlmepriv, _FW_LINKED)) 290 - rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not */ 290 + rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ 291 291 } 292 292 293 293 *pold_state = networktype; ··· 314 314 return true; 315 315 } 316 316 317 - u8 rtw_set_802_11_disassociate(struct adapter *padapter) 317 + void rtw_set_802_11_disassociate(struct adapter *padapter) 318 318 { 319 319 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 320 320 ··· 328 328 } 329 329 330 330 spin_unlock_bh(&pmlmepriv->lock); 331 - 332 - return true; 333 331 } 334 332 335 333 u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
+19 -60
drivers/staging/r8188eu/core/rtw_led.c
··· 26 26 27 27 pLed->BlinkTimes = 0; /* Number of times to toggle led state for blinking. */ 28 28 29 - pLed->bLedLinkBlinkInProgress = false; 30 29 pLed->bLedScanBlinkInProgress = false; 31 30 } 32 31 33 - static void SwLedOn(struct adapter *padapter, struct led_priv *pLed) 32 + static void SwLedOn(struct led_priv *pLed) 34 33 { 35 - u8 LedCfg; 36 - int res; 34 + struct adapter *padapter = container_of(pLed, struct adapter, ledpriv); 37 35 38 36 if (padapter->bDriverStopped) 39 37 return; 40 38 41 - res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg); 42 - if (res) 39 + if (rtw_write8(padapter, REG_LEDCFG2, BIT(5)) != _SUCCESS) 43 40 return; 44 41 45 - rtw_write8(padapter, REG_LEDCFG2, (LedCfg & 0xf0) | BIT(5) | BIT(6)); /* SW control led0 on. */ 46 42 pLed->bLedOn = true; 47 43 } 48 44 49 - static void SwLedOff(struct adapter *padapter, struct led_priv *pLed) 45 + static void SwLedOff(struct led_priv *pLed) 50 46 { 51 - u8 LedCfg; 52 - int res; 47 + struct adapter *padapter = container_of(pLed, struct adapter, ledpriv); 53 48 54 49 if (padapter->bDriverStopped) 55 - goto exit; 50 + return; 56 51 57 - res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */ 58 - if (res) 59 - goto exit; 52 + if (rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3)) != _SUCCESS) 53 + return; 60 54 61 - LedCfg &= 0x90; /* Set to software control. */ 62 - rtw_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3))); 63 - res = rtw_read8(padapter, REG_MAC_PINMUX_CFG, &LedCfg); 64 - if (res) 65 - goto exit; 66 - 67 - LedCfg &= 0xFE; 68 - rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg); 69 - exit: 70 55 pLed->bLedOn = false; 71 56 } 72 57 ··· 59 74 { 60 75 struct delayed_work *dwork = to_delayed_work(work); 61 76 struct led_priv *pLed = container_of(dwork, struct led_priv, blink_work); 62 - struct adapter *padapter = pLed->padapter; 77 + struct adapter *padapter = container_of(pLed, struct adapter, ledpriv); 63 78 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 64 79 65 80 if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) { 66 - SwLedOff(padapter, pLed); 81 + SwLedOff(pLed); 67 82 ResetLedStatus(pLed); 68 83 return; 69 84 } 70 85 71 86 if (pLed->bLedOn) 72 - SwLedOff(padapter, pLed); 87 + SwLedOff(pLed); 73 88 else 74 - SwLedOn(padapter, pLed); 89 + SwLedOn(pLed); 75 90 76 91 switch (pLed->CurrLedState) { 77 92 case LED_BLINK_SLOWLY: ··· 81 96 schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); 82 97 break; 83 98 case LED_BLINK_SCAN: 84 - pLed->BlinkTimes--; 85 - if (pLed->BlinkTimes == 0) { 86 - if (check_fwstate(pmlmepriv, _FW_LINKED)) { 87 - pLed->bLedLinkBlinkInProgress = true; 88 - pLed->CurrLedState = LED_BLINK_NORMAL; 89 - schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); 90 - } else { 91 - pLed->CurrLedState = LED_BLINK_SLOWLY; 92 - schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL); 93 - } 94 - pLed->bLedScanBlinkInProgress = false; 95 - } else { 96 - schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL); 97 - } 98 - break; 99 99 case LED_BLINK_TXRX: 100 100 pLed->BlinkTimes--; 101 101 if (pLed->BlinkTimes == 0) { 102 102 if (check_fwstate(pmlmepriv, _FW_LINKED)) { 103 - pLed->bLedLinkBlinkInProgress = true; 104 103 pLed->CurrLedState = LED_BLINK_NORMAL; 105 104 schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); 106 105 } else { ··· 92 123 schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL); 93 124 } 94 125 pLed->bLedBlinkInProgress = false; 126 + pLed->bLedScanBlinkInProgress = false; 95 127 } else { 96 - schedule_delayed_work(&pLed->blink_work, LED_BLINK_FASTER_INTVL); 128 + schedule_delayed_work(&pLed->blink_work, 129 + pLed->CurrLedState == LED_BLINK_SCAN ? 130 + LED_BLINK_SCAN_INTVL : LED_BLINK_FASTER_INTVL); 97 131 } 98 132 break; 99 133 case LED_BLINK_WPS: ··· 104 132 break; 105 133 case LED_BLINK_WPS_STOP: /* WPS success */ 106 134 if (!pLed->bLedOn) { 107 - pLed->bLedLinkBlinkInProgress = true; 108 135 pLed->CurrLedState = LED_BLINK_NORMAL; 109 136 schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); 110 137 ··· 121 150 { 122 151 struct led_priv *pledpriv = &padapter->ledpriv; 123 152 124 - pledpriv->padapter = padapter; 125 153 ResetLedStatus(pledpriv); 126 154 INIT_DELAYED_WORK(&pledpriv->blink_work, blink_work); 127 155 } ··· 131 161 132 162 cancel_delayed_work_sync(&ledpriv->blink_work); 133 163 ResetLedStatus(ledpriv); 134 - SwLedOff(padapter, ledpriv); 164 + SwLedOff(ledpriv); 135 165 } 136 166 137 167 void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) ··· 140 170 struct registry_priv *registry_par; 141 171 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 142 172 143 - if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped) || 144 - (!padapter->hw_init_completed)) 173 + if (!padapter->hw_init_completed) 145 174 return; 146 175 147 176 if (!pLed->bRegUseLed) ··· 158 189 159 190 cancel_delayed_work(&pLed->blink_work); 160 191 161 - pLed->bLedLinkBlinkInProgress = false; 162 192 pLed->bLedBlinkInProgress = false; 163 193 164 194 pLed->CurrLedState = LED_BLINK_SLOWLY; 165 195 schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL); 166 196 break; 167 197 case LED_CTL_LINK: 168 - if (!pLed->bLedLinkBlinkInProgress) 169 - return; 170 - 171 198 if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed)) 172 199 return; 173 200 174 201 cancel_delayed_work(&pLed->blink_work); 175 202 176 203 pLed->bLedBlinkInProgress = false; 177 - pLed->bLedLinkBlinkInProgress = true; 178 204 179 205 pLed->CurrLedState = LED_BLINK_NORMAL; 180 206 schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); ··· 186 222 187 223 cancel_delayed_work(&pLed->blink_work); 188 224 189 - pLed->bLedLinkBlinkInProgress = false; 190 225 pLed->bLedBlinkInProgress = false; 191 226 pLed->bLedScanBlinkInProgress = true; 192 227 ··· 203 240 204 241 cancel_delayed_work(&pLed->blink_work); 205 242 206 - pLed->bLedLinkBlinkInProgress = false; 207 243 pLed->bLedBlinkInProgress = true; 208 244 209 245 pLed->CurrLedState = LED_BLINK_TXRX; ··· 215 253 216 254 cancel_delayed_work(&pLed->blink_work); 217 255 218 - pLed->bLedLinkBlinkInProgress = false; 219 256 pLed->bLedBlinkInProgress = false; 220 257 pLed->bLedScanBlinkInProgress = false; 221 258 pLed->bLedWPSBlinkInProgress = true; ··· 224 263 case LED_CTL_STOP_WPS: 225 264 cancel_delayed_work(&pLed->blink_work); 226 265 227 - pLed->bLedLinkBlinkInProgress = false; 228 266 pLed->bLedBlinkInProgress = false; 229 267 pLed->bLedScanBlinkInProgress = false; 230 268 pLed->bLedWPSBlinkInProgress = true; ··· 243 283 break; 244 284 case LED_CTL_POWER_OFF: 245 285 pLed->CurrLedState = RTW_LED_OFF; 246 - pLed->bLedLinkBlinkInProgress = false; 247 286 pLed->bLedBlinkInProgress = false; 248 287 pLed->bLedWPSBlinkInProgress = false; 249 288 pLed->bLedScanBlinkInProgress = false; 250 289 cancel_delayed_work(&pLed->blink_work); 251 - SwLedOff(padapter, pLed); 290 + SwLedOff(pLed); 252 291 break; 253 292 default: 254 293 break;
+12 -39
drivers/staging/r8188eu/core/rtw_mlme.c
··· 76 76 spin_unlock_bh(&free_queue->lock); 77 77 } 78 78 79 - void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork) 80 - { 81 - struct __queue *free_queue = &pmlmepriv->free_bss_pool; 82 - 83 - if (!pnetwork) 84 - return; 85 - if (pnetwork->fixed) 86 - return; 87 - list_del_init(&pnetwork->list); 88 - list_add_tail(&pnetwork->list, get_list_head(free_queue)); 89 - pmlmepriv->num_of_scanned--; 90 - } 91 - 92 79 /* 93 80 return the wlan_network with the matching addr 94 81 ··· 211 224 u8 *pbuf; 212 225 struct wlan_network *pnetwork; 213 226 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 214 - int res = _SUCCESS; 215 227 216 228 /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */ 217 229 ··· 231 245 232 246 pbuf = vzalloc(MAX_BSS_CNT * (sizeof(struct wlan_network))); 233 247 234 - if (!pbuf) { 235 - res = _FAIL; 236 - goto exit; 237 - } 248 + if (!pbuf) 249 + return -ENOMEM; 250 + 238 251 pmlmepriv->free_bss_buf = pbuf; 239 252 240 253 pnetwork = (struct wlan_network *)pbuf; ··· 250 265 251 266 rtw_init_mlme_timer(padapter); 252 267 253 - exit: 254 - 255 - return res; 268 + return 0; 256 269 } 257 270 258 271 void rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) ··· 294 311 static void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, 295 312 struct wlan_network *pnetwork) 296 313 { 314 + struct __queue *free_queue = &pmlmepriv->free_bss_pool; 297 315 298 - _rtw_free_network_nolock(pmlmepriv, pnetwork); 299 - 316 + if (!pnetwork) 317 + return; 318 + if (pnetwork->fixed) 319 + return; 320 + list_del_init(&pnetwork->list); 321 + list_add_tail(&pnetwork->list, get_list_head(free_queue)); 322 + pmlmepriv->num_of_scanned--; 300 323 } 301 324 302 325 void rtw_free_network_queue(struct adapter *dev, u8 isfreeall) ··· 1811 1822 pdev_network->Privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0); /* adhoc no 802.1x */ 1812 1823 1813 1824 pdev_network->Rssi = 0; 1814 - 1815 - switch (pregistrypriv->wireless_mode) { 1816 - case WIRELESS_11B: 1817 - pdev_network->NetworkTypeInUse = (Ndis802_11DS); 1818 - break; 1819 - case WIRELESS_11G: 1820 - case WIRELESS_11BG: 1821 - case WIRELESS_11_24N: 1822 - case WIRELESS_11G_24N: 1823 - case WIRELESS_11BG_24N: 1824 - pdev_network->NetworkTypeInUse = (Ndis802_11OFDM24); 1825 - break; 1826 - default: 1827 - /* TODO */ 1828 - break; 1829 - } 1830 1825 1831 1826 pdev_network->Configuration.DSConfig = (pregistrypriv->channel); 1832 1827
+299 -454
drivers/staging/r8188eu/core/rtw_mlme_ext.c
··· 12 12 #include "../include/rtl8188e_xmit.h" 13 13 #include "../include/rtl8188e_dm.h" 14 14 15 - /* response function for each management frame subtype, do not reorder */ 16 - static mlme_handler mlme_sta_tbl[] = { 17 - OnAssocReq, 18 - OnAssocRsp, 19 - OnAssocReq, 20 - OnAssocRsp, 21 - OnProbeReq, 22 - OnProbeRsp, 23 - NULL, 24 - NULL, 25 - OnBeacon, 26 - NULL, 27 - OnDisassoc, 28 - OnAuthClient, 29 - OnDeAuth, 30 - OnAction, 31 - }; 32 - 33 15 static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; 34 16 35 17 /************************************************** ··· 119 137 {0x03}, /* 0x41, RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G */ 120 138 }; 121 139 122 - static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03}; /* use the conbination for max channel numbers */ 140 + static struct rt_channel_plan_map RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE = {0x03}; /* use the combination for max channel numbers */ 123 141 124 142 /* 125 143 * Search the @param channel_num in given @param channel_set ··· 375 393 } 376 394 } 377 395 378 - void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame) 379 - { 380 - int index; 381 - mlme_handler fct; 382 - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 383 - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; 384 - struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, hdr->addr2); 385 - 386 - if (!ieee80211_is_mgmt(hdr->frame_control)) 387 - return; 388 - 389 - /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ 390 - if (memcmp(hdr->addr1, myid(&padapter->eeprompriv), ETH_ALEN) && 391 - !is_broadcast_ether_addr(hdr->addr1)) 392 - return; 393 - 394 - index = (le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_STYPE) >> 4; 395 - if (index >= ARRAY_SIZE(mlme_sta_tbl)) 396 - return; 397 - fct = mlme_sta_tbl[index]; 398 - 399 - if (psta) { 400 - if (ieee80211_has_retry(hdr->frame_control)) { 401 - if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum) 402 - /* drop the duplicate management frame */ 403 - return; 404 - } 405 - psta->RxMgmtFrameSeqNum = precv_frame->attrib.seq_num; 406 - } 407 - 408 - if (ieee80211_is_auth(hdr->frame_control)) { 409 - if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) 410 - fct = OnAuth; 411 - else 412 - fct = OnAuthClient; 413 - } 414 - 415 - if (fct) 416 - fct(padapter, precv_frame); 417 - } 418 - 419 396 static u32 p2p_listen_state_process(struct adapter *padapter, unsigned char *da) 420 397 { 421 398 bool response = true; ··· 387 446 issue_probersp_p2p(padapter, da); 388 447 389 448 return _SUCCESS; 390 - } 391 - 392 - static void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe) 393 - { 394 - u8 *pIE; 395 - __le32 *pbuf; 396 - 397 - pIE = pframe + sizeof(struct ieee80211_hdr_3addr); 398 - pbuf = (__le32 *)pIE; 399 - 400 - pmlmeext->TSFValue = le32_to_cpu(*(pbuf + 1)); 401 - 402 - pmlmeext->TSFValue = pmlmeext->TSFValue << 32; 403 - 404 - pmlmeext->TSFValue |= le32_to_cpu(*pbuf); 405 449 } 406 450 407 451 static void correct_TSF(struct adapter *padapter) ··· 432 506 433 507 *****************************************************************************/ 434 508 435 - unsigned int OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame) 509 + static void OnProbeReq(struct adapter *padapter, struct recv_frame *precv_frame) 436 510 { 437 511 unsigned int ielen; 438 512 unsigned char *p; ··· 466 540 report_survey_event(padapter, precv_frame); 467 541 p2p_listen_state_process(padapter, get_sa(pframe)); 468 542 469 - return _SUCCESS; 543 + return; 470 544 } 471 545 } 472 546 } 473 547 474 548 if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) 475 - return _SUCCESS; 549 + return; 476 550 477 551 if (!check_fwstate(pmlmepriv, _FW_LINKED) && 478 552 !check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE)) 479 - return _SUCCESS; 553 + return; 480 554 481 555 p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ielen, 482 556 len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); ··· 488 562 489 563 if ((ielen != 0 && memcmp((void *)(p + 2), (void *)cur->Ssid.Ssid, cur->Ssid.SsidLength)) || 490 564 (ielen == 0 && pmlmeinfo->hidden_ssid_mode)) 491 - return _SUCCESS; 565 + return; 492 566 493 567 _issue_probersp: 494 568 ··· 497 571 check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) 498 572 issue_probersp(padapter, get_sa(pframe), is_valid_p2p_probereq); 499 573 } 500 - return _SUCCESS; 501 574 } 502 575 503 - unsigned int OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame) 576 + static void OnProbeRsp(struct adapter *padapter, struct recv_frame *precv_frame) 504 577 { 505 578 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 506 579 struct wifidirect_info *pwdinfo = &padapter->wdinfo; ··· 521 596 } 522 597 } 523 598 } 524 - return _SUCCESS; 599 + return; 525 600 } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) { 526 601 if (pwdinfo->nego_req_info.benable) { 527 602 if (!memcmp(pwdinfo->nego_req_info.peerDevAddr, GetAddr2Ptr(pframe), ETH_ALEN)) { ··· 539 614 } 540 615 if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { 541 616 report_survey_event(padapter, precv_frame); 542 - return _SUCCESS; 617 + return; 543 618 } 544 - 545 - return _SUCCESS; 546 619 } 547 620 548 - unsigned int OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame) 621 + static void OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame) 549 622 { 623 + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; 550 624 int cam_idx; 551 625 struct sta_info *psta; 552 626 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ··· 555 631 u8 *pframe = precv_frame->rx_data; 556 632 uint len = precv_frame->len; 557 633 struct wlan_bssid_ex *pbss; 558 - int ret = _SUCCESS; 634 + u8 *ie_ptr; 635 + u32 ie_len; 636 + 637 + ie_ptr = (u8 *)&mgmt->u.beacon.variable; 638 + if (precv_frame->len < offsetof(struct ieee80211_mgmt, u.beacon.variable)) 639 + return; 640 + ie_len = precv_frame->len - offsetof(struct ieee80211_mgmt, u.beacon.variable); 559 641 560 642 if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { 561 643 report_survey_event(padapter, precv_frame); 562 - return _SUCCESS; 644 + return; 563 645 } 564 646 565 - if (!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) { 566 - if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { 567 - /* we should update current network before auth, or some IE is wrong */ 568 - pbss = kmalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC); 569 - if (pbss) { 570 - if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) { 571 - update_network(&pmlmepriv->cur_network.network, pbss, padapter, true); 572 - rtw_get_bcn_info(&pmlmepriv->cur_network); 573 - } 574 - kfree(pbss); 575 - } 647 + if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) 648 + return; 576 649 577 - /* check the vendor of the assoc AP */ 578 - pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe + sizeof(struct ieee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr)); 650 + if (pmlmeinfo->state & WIFI_FW_AUTH_NULL) { 651 + /* we should update current network before auth, or some IE is wrong */ 652 + pbss = kmalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC); 653 + if (!pbss) 654 + return; 579 655 580 - /* update TSF Value */ 581 - update_TSF(pmlmeext, pframe); 582 - 583 - /* start auth */ 584 - start_clnt_auth(padapter); 585 - 586 - return _SUCCESS; 656 + if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) { 657 + update_network(&pmlmepriv->cur_network.network, pbss, padapter, true); 658 + rtw_get_bcn_info(&pmlmepriv->cur_network); 587 659 } 660 + kfree(pbss); 588 661 589 - if (((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) { 590 - psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); 591 - if (psta) { 592 - ret = rtw_check_bcn_info(padapter, pframe, len); 593 - if (!ret) { 594 - receive_disconnect(padapter, 595 - pmlmeinfo->network.MacAddress, 0); 596 - return _SUCCESS; 597 - } 598 - /* update WMM, ERP in the beacon */ 599 - /* todo: the timer is used instead of the number of the beacon received */ 600 - if ((sta_rx_pkts(psta) & 0xf) == 0) 601 - update_beacon_info(padapter, pframe, len, psta); 602 - process_p2p_ps_ie(padapter, (pframe + WLAN_HDR_A3_LEN), (len - WLAN_HDR_A3_LEN)); 603 - } 604 - } else if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) { 605 - psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); 606 - if (psta) { 607 - /* update WMM, ERP in the beacon */ 608 - /* todo: the timer is used instead of the number of the beacon received */ 609 - if ((sta_rx_pkts(psta) & 0xf) == 0) 610 - update_beacon_info(padapter, pframe, len, psta); 611 - } else { 612 - /* allocate a new CAM entry for IBSS station */ 613 - cam_idx = allocate_fw_sta_entry(padapter); 614 - if (cam_idx == NUM_STA) 615 - goto _END_ONBEACON_; 662 + /* check the vendor of the assoc AP */ 663 + pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe + sizeof(struct ieee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr)); 616 664 617 - /* get supported rate */ 618 - if (update_sta_support_rate(padapter, (pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_), (len - WLAN_HDR_A3_LEN - _BEACON_IE_OFFSET_), cam_idx) == _FAIL) { 619 - pmlmeinfo->FW_sta_info[cam_idx].status = 0; 620 - goto _END_ONBEACON_; 621 - } 665 + pmlmeext->TSFValue = le64_to_cpu(mgmt->u.beacon.timestamp); 622 666 623 - /* update TSF Value */ 624 - update_TSF(pmlmeext, pframe); 667 + /* start auth */ 668 + start_clnt_auth(padapter); 625 669 626 - /* report sta add event */ 627 - report_add_sta_event(padapter, GetAddr2Ptr(pframe), cam_idx); 628 - } 629 - } 670 + return; 630 671 } 631 672 632 - _END_ONBEACON_: 673 + if (((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) { 674 + psta = rtw_get_stainfo(pstapriv, mgmt->sa); 675 + if (!psta) 676 + return; 633 677 634 - return _SUCCESS; 678 + if (rtw_check_bcn_info(padapter, pframe, len) != _SUCCESS) { 679 + receive_disconnect(padapter, pmlmeinfo->network.MacAddress, 0); 680 + return; 681 + } 682 + /* update WMM, ERP in the beacon */ 683 + /* todo: the timer is used instead of the number of the beacon received */ 684 + if ((sta_rx_pkts(psta) & 0xf) == 0) 685 + update_beacon_info(padapter, ie_ptr, ie_len, psta); 686 + process_p2p_ps_ie(padapter, ie_ptr, ie_len); 687 + } else if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) { 688 + psta = rtw_get_stainfo(pstapriv, mgmt->sa); 689 + if (psta) { 690 + /* update WMM, ERP in the beacon */ 691 + /* todo: the timer is used instead of the number of the beacon received */ 692 + if ((sta_rx_pkts(psta) & 0xf) == 0) 693 + update_beacon_info(padapter, ie_ptr, ie_len, psta); 694 + } else { 695 + /* allocate a new CAM entry for IBSS station */ 696 + cam_idx = allocate_fw_sta_entry(padapter); 697 + if (cam_idx == NUM_STA) 698 + return; 699 + 700 + /* get supported rate */ 701 + if (update_sta_support_rate(padapter, ie_ptr, ie_len, cam_idx) == _FAIL) { 702 + pmlmeinfo->FW_sta_info[cam_idx].status = 0; 703 + return; 704 + } 705 + 706 + pmlmeext->TSFValue = le64_to_cpu(mgmt->u.beacon.timestamp); 707 + 708 + report_add_sta_event(padapter, mgmt->sa, cam_idx); 709 + } 710 + } 635 711 } 636 712 637 - unsigned int OnAuth(struct adapter *padapter, struct recv_frame *precv_frame) 713 + static void OnAuth(struct adapter *padapter, struct recv_frame *precv_frame) 638 714 { 639 715 unsigned int auth_mode, ie_len; 640 716 u16 seq; ··· 651 727 uint len = precv_frame->len; 652 728 653 729 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) 654 - return _FAIL; 730 + return; 655 731 656 732 sa = GetAddr2Ptr(pframe); 657 733 ··· 767 843 if (pstat->state & WIFI_FW_AUTH_SUCCESS) 768 844 pstat->auth_seq = 0; 769 845 770 - return _SUCCESS; 846 + return; 771 847 772 848 auth_fail: 773 849 ··· 780 856 memcpy(pstat->hwaddr, sa, 6); 781 857 782 858 issue_auth(padapter, pstat, (unsigned short)status); 783 - return _FAIL; 784 859 } 785 860 786 - unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_frame) 861 + static void OnAuthClient(struct adapter *padapter, struct recv_frame *precv_frame) 787 862 { 788 863 unsigned int seq, len, status, offset; 789 864 unsigned char *p; 790 - unsigned int go2asoc = 0; 791 865 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 792 866 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 867 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; 793 868 u8 *pframe = precv_frame->rx_data; 794 869 uint pkt_len = precv_frame->len; 795 870 796 871 /* check A1 matches or not */ 797 - if (memcmp(myid(&padapter->eeprompriv), get_da(pframe), ETH_ALEN)) 798 - return _SUCCESS; 872 + if (memcmp(myid(&padapter->eeprompriv), ieee80211_get_DA(hdr), ETH_ALEN)) 873 + return; 799 874 800 875 if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE)) 801 - return _SUCCESS; 876 + return; 802 877 803 - offset = (GetPrivacy(pframe)) ? 4 : 0; 878 + offset = ieee80211_has_protected(hdr->frame_control) ? 4 : 0; 804 879 805 880 seq = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 2)); 806 881 status = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 4)); ··· 813 890 } 814 891 815 892 set_link_timer(pmlmeext, 1); 816 - goto authclnt_fail; 893 + return; 817 894 } 818 895 819 896 if (seq == 2) { ··· 823 900 pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_); 824 901 825 902 if (!p) 826 - goto authclnt_fail; 903 + return; 827 904 828 905 memcpy((void *)(pmlmeinfo->chg_txt), (void *)(p + 2), len); 829 906 pmlmeinfo->auth_seq = 3; 830 907 issue_auth(padapter, NULL, 0); 831 908 set_link_timer(pmlmeext, REAUTH_TO); 832 909 833 - return _SUCCESS; 910 + return; 834 911 } else { 835 912 /* open system */ 836 - go2asoc = 1; 913 + start_clnt_assoc(padapter); 837 914 } 838 915 } else if (seq == 4) { 839 916 if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) 840 - go2asoc = 1; 841 - else 842 - goto authclnt_fail; 843 - } else { 844 - /* this is also illegal */ 845 - goto authclnt_fail; 917 + start_clnt_assoc(padapter); 846 918 } 847 - 848 - if (go2asoc) { 849 - start_clnt_assoc(padapter); 850 - return _SUCCESS; 851 - } 852 - authclnt_fail: 853 - return _FAIL; 854 919 } 855 920 856 921 static void UpdateBrateTbl(u8 *mbrate) ··· 881 970 } 882 971 } 883 972 884 - unsigned int OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame) 973 + static void OnAssocReq(struct adapter *padapter, struct recv_frame *precv_frame) 885 974 { 886 975 u16 capab_info; 887 976 struct rtw_ieee802_11_elems elems; ··· 907 996 u32 p2pielen = 0; 908 997 909 998 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) 910 - return _FAIL; 999 + return; 911 1000 912 1001 frame_type = GetFrameSubType(pframe); 913 1002 if (frame_type == WIFI_ASSOCREQ) ··· 916 1005 ie_offset = _REASOCREQ_IE_OFFSET_; 917 1006 918 1007 if (pkt_len < IEEE80211_3ADDR_LEN + ie_offset) 919 - return _FAIL; 1008 + return; 920 1009 921 1010 pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); 922 1011 if (pstat == (struct sta_info *)NULL) { ··· 1270 1359 report_add_sta_event(padapter, pstat->hwaddr, pstat->aid); 1271 1360 } 1272 1361 1273 - return _SUCCESS; 1362 + return; 1274 1363 1275 1364 asoc_class2_error: 1276 1365 1277 1366 issue_deauth(padapter, (void *)GetAddr2Ptr(pframe), status); 1278 1367 1279 - return _FAIL; 1368 + return; 1280 1369 1281 1370 OnAssocReqFail: 1282 1371 ··· 1286 1375 else 1287 1376 issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); 1288 1377 1289 - return _FAIL; 1378 + return; 1290 1379 } 1291 1380 1292 - unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame) 1381 + static void OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame) 1293 1382 { 1294 1383 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; 1295 1384 uint i; ··· 1303 1392 1304 1393 /* check A1 matches or not */ 1305 1394 if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) 1306 - return _SUCCESS; 1395 + return; 1307 1396 1308 1397 if (!(pmlmeinfo->state & (WIFI_FW_AUTH_SUCCESS | WIFI_FW_ASSOC_STATE))) 1309 - return _SUCCESS; 1398 + return; 1310 1399 1311 1400 if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) 1312 - return _SUCCESS; 1401 + return; 1313 1402 1314 1403 _cancel_timer_ex(&pmlmeext->link_timer); 1315 1404 ··· 1362 1451 1363 1452 report_assoc_result: 1364 1453 report_join_res(padapter, res); 1365 - 1366 - return _SUCCESS; 1367 1454 } 1368 1455 1369 - unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) 1456 + static void OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) 1370 1457 { 1458 + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; 1371 1459 unsigned short reason; 1372 1460 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1373 1461 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 1374 1462 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 1375 - u8 *pframe = precv_frame->rx_data; 1376 1463 struct wifidirect_info *pwdinfo = &padapter->wdinfo; 1377 1464 1378 - /* check A3 */ 1379 - if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) 1380 - return _SUCCESS; 1465 + if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) 1466 + return; 1381 1467 1382 1468 if (pwdinfo->rx_invitereq_info.scan_op_ch_only) { 1383 1469 _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey); 1384 1470 _set_timer(&pwdinfo->reset_ch_sitesurvey, 10); 1385 1471 } 1386 1472 1387 - reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); 1473 + reason = le16_to_cpu(mgmt->u.disassoc.reason_code); 1388 1474 1389 1475 if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { 1390 1476 struct sta_info *psta; 1391 1477 struct sta_priv *pstapriv = &padapter->stapriv; 1478 + u8 updated = 0; 1392 1479 1393 - psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); 1394 - if (psta) { 1395 - u8 updated = 0; 1480 + psta = rtw_get_stainfo(pstapriv, mgmt->sa); 1481 + if (!psta) 1482 + return; 1396 1483 1397 - spin_lock_bh(&pstapriv->asoc_list_lock); 1398 - if (!list_empty(&psta->asoc_list)) { 1399 - list_del_init(&psta->asoc_list); 1400 - pstapriv->asoc_list_cnt--; 1401 - updated = ap_free_sta(padapter, psta, false, reason); 1402 - } 1403 - spin_unlock_bh(&pstapriv->asoc_list_lock); 1404 - 1405 - associated_clients_update(padapter, updated); 1484 + spin_lock_bh(&pstapriv->asoc_list_lock); 1485 + if (!list_empty(&psta->asoc_list)) { 1486 + list_del_init(&psta->asoc_list); 1487 + pstapriv->asoc_list_cnt--; 1488 + updated = ap_free_sta(padapter, psta, false, reason); 1406 1489 } 1490 + spin_unlock_bh(&pstapriv->asoc_list_lock); 1407 1491 1408 - return _SUCCESS; 1492 + associated_clients_update(padapter, updated); 1409 1493 } else { 1410 - int ignore_received_deauth = 0; 1494 + bool ignore_received_deauth = false; 1411 1495 1412 1496 /* Before sending the auth frame to start the STA/GC mode connection with AP/GO, 1413 1497 * we will send the deauth first. 1414 1498 * However, the Win8.1 with BRCM Wi-Fi will send the deauth with reason code 6 to us after receieving our deauth. 1415 1499 * Added the following code to avoid this case. 1416 1500 */ 1417 - if ((pmlmeinfo->state & WIFI_FW_AUTH_STATE) || 1418 - (pmlmeinfo->state & WIFI_FW_ASSOC_STATE)) { 1501 + if (pmlmeinfo->state & (WIFI_FW_AUTH_STATE | WIFI_FW_ASSOC_STATE)) { 1419 1502 if (reason == WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA) { 1420 - ignore_received_deauth = 1; 1503 + ignore_received_deauth = true; 1421 1504 } else if (reason == WLAN_REASON_PREV_AUTH_NOT_VALID) { 1422 1505 // TODO: 802.11r 1423 - ignore_received_deauth = 1; 1506 + ignore_received_deauth = true; 1424 1507 } 1425 1508 } 1426 1509 1427 1510 if (!ignore_received_deauth) 1428 - receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); 1511 + receive_disconnect(padapter, mgmt->bssid, reason); 1512 + 1513 + pmlmepriv->LinkDetectInfo.bBusyTraffic = false; 1429 1514 } 1430 - pmlmepriv->LinkDetectInfo.bBusyTraffic = false; 1431 - return _SUCCESS; 1432 1515 } 1433 1516 1434 - unsigned int OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) 1517 + static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) 1435 1518 { 1519 + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; 1436 1520 u16 reason; 1437 1521 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1438 1522 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 1439 1523 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 1440 - u8 *pframe = precv_frame->rx_data; 1441 1524 struct wifidirect_info *pwdinfo = &padapter->wdinfo; 1525 + struct sta_info *psta; 1526 + struct sta_priv *pstapriv = &padapter->stapriv; 1527 + u8 updated = 0; 1442 1528 1443 - /* check A3 */ 1444 - if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) 1445 - return _SUCCESS; 1529 + if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) 1530 + return; 1446 1531 1447 1532 if (pwdinfo->rx_invitereq_info.scan_op_ch_only) { 1448 1533 _cancel_timer_ex(&pwdinfo->reset_ch_sitesurvey); 1449 1534 _set_timer(&pwdinfo->reset_ch_sitesurvey, 10); 1450 1535 } 1451 1536 1452 - reason = le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN)); 1537 + reason = le16_to_cpu(mgmt->u.disassoc.reason_code); 1453 1538 1454 - if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { 1455 - struct sta_info *psta; 1456 - struct sta_priv *pstapriv = &padapter->stapriv; 1457 - 1458 - psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); 1459 - if (psta) { 1460 - u8 updated = 0; 1461 - 1462 - spin_lock_bh(&pstapriv->asoc_list_lock); 1463 - if (!list_empty(&psta->asoc_list)) { 1464 - list_del_init(&psta->asoc_list); 1465 - pstapriv->asoc_list_cnt--; 1466 - updated = ap_free_sta(padapter, psta, false, reason); 1467 - } 1468 - spin_unlock_bh(&pstapriv->asoc_list_lock); 1469 - 1470 - associated_clients_update(padapter, updated); 1471 - } 1472 - 1473 - return _SUCCESS; 1474 - } else { 1475 - receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); 1539 + if (!check_fwstate(pmlmepriv, WIFI_AP_STATE)) { 1540 + receive_disconnect(padapter, mgmt->bssid, reason); 1541 + pmlmepriv->LinkDetectInfo.bBusyTraffic = false; 1542 + return; 1476 1543 } 1477 - pmlmepriv->LinkDetectInfo.bBusyTraffic = false; 1478 - return _SUCCESS; 1544 + 1545 + psta = rtw_get_stainfo(pstapriv, mgmt->sa); 1546 + if (!psta) 1547 + return; 1548 + 1549 + spin_lock_bh(&pstapriv->asoc_list_lock); 1550 + if (!list_empty(&psta->asoc_list)) { 1551 + list_del_init(&psta->asoc_list); 1552 + pstapriv->asoc_list_cnt--; 1553 + updated = ap_free_sta(padapter, psta, false, reason); 1554 + } 1555 + spin_unlock_bh(&pstapriv->asoc_list_lock); 1556 + 1557 + associated_clients_update(padapter, updated); 1479 1558 } 1480 1559 1481 - unsigned int OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame) 1560 + static void OnAction_back(struct adapter *padapter, struct recv_frame *precv_frame) 1482 1561 { 1483 1562 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; 1484 1563 struct sta_info *psta = NULL; 1485 1564 struct recv_reorder_ctrl *preorder_ctrl; 1486 - unsigned char *frame_body; 1487 1565 unsigned short tid; 1488 1566 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 1489 1567 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 1490 - u8 *pframe = precv_frame->rx_data; 1491 1568 struct sta_priv *pstapriv = &padapter->stapriv; 1492 - /* check RA matches or not */ 1493 - if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */ 1494 - return _SUCCESS; 1495 1569 1496 1570 if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE) 1497 1571 if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) 1498 - return _SUCCESS; 1572 + return; 1499 1573 1500 1574 psta = rtw_get_stainfo(pstapriv, mgmt->sa); 1501 - 1502 1575 if (!psta) 1503 - return _SUCCESS; 1504 - 1505 - frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); 1576 + return; 1506 1577 1507 1578 if (!pmlmeinfo->HT_enable) 1508 - return _SUCCESS; 1579 + return; 1509 1580 /* All union members start with an action code, it's ok to use addba_req. */ 1510 1581 switch (mgmt->u.action.u.addba_req.action_code) { 1511 1582 case WLAN_ACTION_ADDBA_REQ: 1512 - memcpy(&pmlmeinfo->ADDBA_req, &frame_body[2], sizeof(struct ADDBA_request)); 1513 1583 tid = u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_req.capab), 1514 1584 IEEE80211_ADDBA_PARAM_TID_MASK); 1515 1585 preorder_ctrl = &psta->recvreorder_ctrl[tid]; 1516 1586 preorder_ctrl->indicate_seq = 0xffff; 1517 1587 preorder_ctrl->enable = pmlmeinfo->bAcceptAddbaReq; 1518 - 1519 1588 issue_action_BA(padapter, mgmt->sa, WLAN_ACTION_ADDBA_RESP, 1520 1589 pmlmeinfo->bAcceptAddbaReq ? 1521 - WLAN_STATUS_SUCCESS : WLAN_STATUS_REQUEST_DECLINED); 1590 + WLAN_STATUS_SUCCESS : WLAN_STATUS_REQUEST_DECLINED, mgmt); 1522 1591 break; 1523 1592 case WLAN_ACTION_ADDBA_RESP: 1524 1593 tid = u16_get_bits(le16_to_cpu(mgmt->u.action.u.addba_resp.capab), ··· 1527 1636 default: 1528 1637 break; 1529 1638 } 1530 - 1531 - return _SUCCESS; 1532 1639 } 1533 1640 1534 1641 static int get_reg_classes_full_count(struct p2p_channels *channel_list) ··· 1643 1754 p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */ 1644 1755 1645 1756 /* Commented by Albert 20110306 */ 1646 - /* According to the P2P Specification, the group negoitation request frame should contain 9 P2P attributes */ 1757 + /* According to the P2P Specification, the group negotiation request frame should contain 9 P2P attributes */ 1647 1758 /* 1. P2P Capability */ 1648 1759 /* 2. Group Owner Intent */ 1649 1760 /* 3. Configuration Timeout */ ··· 1998 2109 p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */ 1999 2110 2000 2111 /* Commented by Albert 20100908 */ 2001 - /* According to the P2P Specification, the group negoitation response frame should contain 9 P2P attributes */ 2112 + /* According to the P2P Specification, the group negotiation response frame should contain 9 P2P attributes */ 2002 2113 /* 1. Status */ 2003 2114 /* 2. P2P Capability */ 2004 2115 /* 3. Group Owner Intent */ ··· 2294 2405 p2pie[p2pielen++] = 0x09; /* WFA P2P v1.0 */ 2295 2406 2296 2407 /* Commented by Albert 20110306 */ 2297 - /* According to the P2P Specification, the group negoitation request frame should contain 5 P2P attributes */ 2408 + /* According to the P2P Specification, the group negotiation request frame should contain 5 P2P attributes */ 2298 2409 /* 1. Status */ 2299 2410 /* 2. P2P Capability */ 2300 2411 /* 3. Operating Channel */ ··· 3183 3294 dump_mgntframe(padapter, pmgntframe); 3184 3295 } 3185 3296 3186 - static int _issue_probereq_p2p(struct adapter *padapter, u8 *da, int wait_ack) 3297 + inline void issue_probereq_p2p(struct adapter *padapter) 3187 3298 { 3188 - int ret = _FAIL; 3189 3299 struct xmit_frame *pmgntframe; 3190 3300 struct pkt_attrib *pattrib; 3191 3301 unsigned char *pframe; ··· 3200 3312 3201 3313 pmgntframe = alloc_mgtxmitframe(pxmitpriv); 3202 3314 if (!pmgntframe) 3203 - goto exit; 3315 + return; 3204 3316 3205 3317 /* update attribute */ 3206 3318 pattrib = &pmgntframe->attrib; ··· 3216 3328 fctrl = &pwlanhdr->frame_control; 3217 3329 *(fctrl) = 0; 3218 3330 3219 - if (da) { 3220 - memcpy(pwlanhdr->addr1, da, ETH_ALEN); 3221 - memcpy(pwlanhdr->addr3, da, ETH_ALEN); 3331 + if ((pwdinfo->p2p_info.scan_op_ch_only) || (pwdinfo->rx_invitereq_info.scan_op_ch_only)) { 3332 + /* This two flags will be set when this is only the P2P client mode. */ 3333 + memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); 3334 + memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); 3222 3335 } else { 3223 - if ((pwdinfo->p2p_info.scan_op_ch_only) || (pwdinfo->rx_invitereq_info.scan_op_ch_only)) { 3224 - /* This two flags will be set when this is only the P2P client mode. */ 3225 - memcpy(pwlanhdr->addr1, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); 3226 - memcpy(pwlanhdr->addr3, pwdinfo->p2p_peer_interface_addr, ETH_ALEN); 3227 - } else { 3228 - /* broadcast probe request frame */ 3229 - eth_broadcast_addr(pwlanhdr->addr1); 3230 - eth_broadcast_addr(pwlanhdr->addr3); 3231 - } 3336 + /* broadcast probe request frame */ 3337 + eth_broadcast_addr(pwlanhdr->addr1); 3338 + eth_broadcast_addr(pwlanhdr->addr3); 3232 3339 } 3340 + 3233 3341 memcpy(pwlanhdr->addr2, mac, ETH_ALEN); 3234 3342 3235 3343 SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); ··· 3451 3567 3452 3568 pattrib->last_txcmdsz = pattrib->pktlen; 3453 3569 3454 - if (wait_ack) { 3455 - ret = dump_mgntframe_and_wait_ack(padapter, pmgntframe); 3456 - } else { 3457 - dump_mgntframe(padapter, pmgntframe); 3458 - ret = _SUCCESS; 3459 - } 3460 - 3461 - exit: 3462 - return ret; 3570 + dump_mgntframe(padapter, pmgntframe); 3463 3571 } 3464 3572 3465 - inline void issue_probereq_p2p(struct adapter *adapter, u8 *da) 3466 - { 3467 - _issue_probereq_p2p(adapter, da, false); 3468 - } 3469 - 3470 - static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token) 3573 + static s32 rtw_action_public_decache(struct recv_frame *recv_frame, u8 token) 3471 3574 { 3472 3575 struct adapter *adapter = recv_frame->adapter; 3473 3576 struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv; ··· 3463 3592 (recv_frame->attrib.frag_num & 0xf); 3464 3593 3465 3594 if (GetRetry(frame)) { 3466 - if (token >= 0) { 3467 - if ((seq_ctrl == mlmeext->action_public_rxseq) && 3468 - (token == mlmeext->action_public_dialog_token)) 3469 - return _FAIL; 3470 - } else { 3471 - if (seq_ctrl == mlmeext->action_public_rxseq) 3472 - return _FAIL; 3473 - } 3595 + if ((seq_ctrl == mlmeext->action_public_rxseq) && 3596 + (token == mlmeext->action_public_dialog_token)) 3597 + return _FAIL; 3474 3598 } 3475 3599 3476 3600 mlmeext->action_public_rxseq = seq_ctrl; 3477 - 3478 - if (token >= 0) 3479 - mlmeext->action_public_dialog_token = token; 3480 - 3601 + mlmeext->action_public_dialog_token = token; 3481 3602 return _SUCCESS; 3482 3603 } 3483 3604 ··· 3735 3872 return _SUCCESS; 3736 3873 } 3737 3874 3738 - static unsigned int on_action_public_vendor(struct recv_frame *precv_frame) 3875 + static void on_action_public_vendor(struct recv_frame *precv_frame) 3739 3876 { 3740 - unsigned int ret = _FAIL; 3741 3877 u8 *pframe = precv_frame->rx_data; 3742 3878 u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); 3743 3879 3744 - if (!memcmp(frame_body + 2, P2P_OUI, 4)) { 3745 - ret = on_action_public_p2p(precv_frame); 3746 - } 3747 - 3748 - return ret; 3880 + if (!memcmp(frame_body + 2, P2P_OUI, 4)) 3881 + on_action_public_p2p(precv_frame); 3749 3882 } 3750 3883 3751 - static unsigned int on_action_public_default(struct recv_frame *precv_frame) 3884 + static void on_action_public_default(struct recv_frame *precv_frame) 3752 3885 { 3753 - unsigned int ret = _FAIL; 3754 3886 u8 *pframe = precv_frame->rx_data; 3755 3887 u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); 3756 3888 u8 token; 3757 3889 3758 3890 token = frame_body[2]; 3759 3891 3760 - if (rtw_action_public_decache(precv_frame, token) == _FAIL) 3761 - goto exit; 3762 - 3763 - ret = _SUCCESS; 3764 - 3765 - exit: 3766 - return ret; 3892 + rtw_action_public_decache(precv_frame, token); 3767 3893 } 3768 3894 3769 - unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) 3895 + static void on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) 3770 3896 { 3771 - unsigned int ret = _FAIL; 3772 - u8 *pframe = precv_frame->rx_data; 3773 - u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); 3774 - u8 category, action; 3897 + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; 3775 3898 3776 - /* check RA matches or not */ 3777 - if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN)) 3778 - goto exit; 3779 - 3780 - category = frame_body[0]; 3781 - if (category != WLAN_CATEGORY_PUBLIC) 3782 - goto exit; 3783 - 3784 - action = frame_body[1]; 3785 - switch (action) { 3786 - case ACT_PUBLIC_VENDOR: 3787 - ret = on_action_public_vendor(precv_frame); 3788 - break; 3789 - default: 3790 - ret = on_action_public_default(precv_frame); 3791 - break; 3792 - } 3793 - 3794 - exit: 3795 - return ret; 3899 + /* All members of the action enum start with action_code. */ 3900 + if (mgmt->u.action.u.s1g.action_code == WLAN_PUB_ACTION_VENDOR_SPECIFIC) 3901 + on_action_public_vendor(precv_frame); 3902 + else 3903 + on_action_public_default(precv_frame); 3796 3904 } 3797 3905 3798 - unsigned int OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) 3906 + static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) 3799 3907 { 3800 3908 u8 *frame_body; 3801 - u8 category, OUI_Subtype; 3909 + u8 OUI_Subtype; 3802 3910 u8 *pframe = precv_frame->rx_data; 3803 3911 uint len = precv_frame->len; 3804 3912 struct wifidirect_info *pwdinfo = &padapter->wdinfo; 3805 3913 3806 - /* check RA matches or not */ 3807 - if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */ 3808 - return _SUCCESS; 3809 - 3810 3914 frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr)); 3811 3915 3812 - category = frame_body[0]; 3813 - if (category != RTW_WLAN_CATEGORY_P2P) 3814 - return _SUCCESS; 3815 - 3816 3916 if (be32_to_cpu(*((__be32 *)(frame_body + 1))) != P2POUI) 3817 - return _SUCCESS; 3917 + return; 3818 3918 3819 3919 len -= sizeof(struct ieee80211_hdr_3addr); 3820 3920 OUI_Subtype = frame_body[5]; 3821 3921 3822 - switch (OUI_Subtype) { 3823 - case P2P_NOTICE_OF_ABSENCE: 3824 - break; 3825 - case P2P_PRESENCE_REQUEST: 3922 + if (OUI_Subtype == P2P_PRESENCE_REQUEST) 3826 3923 process_p2p_presence_req(pwdinfo, pframe, len); 3827 - break; 3828 - case P2P_PRESENCE_RESPONSE: 3829 - break; 3830 - case P2P_GO_DISC_REQUEST: 3831 - break; 3832 - default: 3833 - break; 3834 - } 3835 - return _SUCCESS; 3836 3924 } 3837 3925 3838 - unsigned int OnAction(struct adapter *padapter, struct recv_frame *precv_frame) 3926 + static void OnAction(struct adapter *padapter, struct recv_frame *precv_frame) 3839 3927 { 3840 3928 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; 3929 + 3930 + if (!ether_addr_equal(myid(&padapter->eeprompriv), mgmt->da)) 3931 + return; 3841 3932 3842 3933 switch (mgmt->u.action.category) { 3843 3934 case WLAN_CATEGORY_BACK: ··· 3804 3987 OnAction_p2p(padapter, precv_frame); 3805 3988 break; 3806 3989 } 3807 - return _SUCCESS; 3808 3990 } 3809 3991 3810 3992 struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv) ··· 3827 4011 return pmgntframe; 3828 4012 } 3829 4013 4014 + void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame) 4015 + { 4016 + mlme_handler mlme_sta_tbl[] = { 4017 + OnAssocReq, 4018 + OnAssocRsp, 4019 + OnAssocReq, 4020 + OnAssocRsp, 4021 + OnProbeReq, 4022 + OnProbeRsp, 4023 + NULL, 4024 + NULL, 4025 + OnBeacon, 4026 + NULL, 4027 + OnDisassoc, 4028 + OnAuthClient, 4029 + OnDeAuth, 4030 + OnAction, 4031 + }; 4032 + int index; 4033 + mlme_handler fct; 4034 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 4035 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; 4036 + struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, hdr->addr2); 4037 + 4038 + if (!ieee80211_is_mgmt(hdr->frame_control)) 4039 + return; 4040 + 4041 + /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ 4042 + if (memcmp(hdr->addr1, myid(&padapter->eeprompriv), ETH_ALEN) && 4043 + !is_broadcast_ether_addr(hdr->addr1)) 4044 + return; 4045 + 4046 + index = (le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_STYPE) >> 4; 4047 + if (index >= ARRAY_SIZE(mlme_sta_tbl)) 4048 + return; 4049 + fct = mlme_sta_tbl[index]; 4050 + 4051 + if (psta) { 4052 + if (ieee80211_has_retry(hdr->frame_control)) { 4053 + if (precv_frame->attrib.seq_num == psta->RxMgmtFrameSeqNum) 4054 + /* drop the duplicate management frame */ 4055 + return; 4056 + } 4057 + psta->RxMgmtFrameSeqNum = precv_frame->attrib.seq_num; 4058 + } 4059 + 4060 + if (ieee80211_is_auth(hdr->frame_control)) { 4061 + if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) 4062 + fct = OnAuth; 4063 + else 4064 + fct = OnAuthClient; 4065 + } 4066 + 4067 + if (fct) 4068 + fct(padapter, precv_frame); 4069 + } 4070 + 3830 4071 /**************************************************************************** 3831 4072 3832 - Following are some TX fuctions for WiFi MLME 4073 + Following are some TX functions for WiFi MLME 3833 4074 3834 4075 *****************************************************************************/ 3835 4076 ··· 3932 4059 3933 4060 void dump_mgntframe(struct adapter *padapter, struct xmit_frame *pmgntframe) 3934 4061 { 3935 - if (padapter->bSurpriseRemoved || padapter->bDriverStopped) 3936 - return; 3937 - 3938 4062 rtl8188eu_mgnt_xmit(padapter, pmgntframe); 3939 4063 } 3940 4064 ··· 3960 4090 s32 ret = _FAIL; 3961 4091 u32 timeout_ms = 500;/* 500ms */ 3962 4092 struct xmit_priv *pxmitpriv = &padapter->xmitpriv; 3963 - 3964 - if (padapter->bSurpriseRemoved || padapter->bDriverStopped) 3965 - return -1; 3966 4093 3967 4094 mutex_lock(&pxmitpriv->ack_tx_mutex); 3968 4095 pxmitpriv->ack_tx = true; ··· 4455 4588 _issue_probereq(padapter, pssid, da, false); 4456 4589 } 4457 4590 4458 - int issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da, 4459 - int try_cnt, int wait_ms) 4591 + void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da) 4460 4592 { 4461 - int ret; 4462 - int i = 0; 4593 + int i; 4463 4594 4464 - do { 4465 - ret = _issue_probereq(padapter, pssid, da, wait_ms > 0); 4466 - 4467 - i++; 4468 - 4469 - if (padapter->bDriverStopped || padapter->bSurpriseRemoved) 4595 + for (i = 0; i < 3; i++) { 4596 + if (_issue_probereq(padapter, pssid, da, true) == _FAIL) 4597 + msleep(1); 4598 + else 4470 4599 break; 4471 - 4472 - if (i < try_cnt && wait_ms > 0 && ret == _FAIL) 4473 - msleep(wait_ms); 4474 - 4475 - } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); 4476 - 4477 - if (ret != _FAIL) { 4478 - ret = _SUCCESS; 4479 - goto exit; 4480 4600 } 4481 - exit: 4482 - return ret; 4483 4601 } 4484 4602 4485 - /* if psta == NULL, indiate we are station(client) now... */ 4603 + /* if psta == NULL, indicate we are station (client) now... */ 4486 4604 void issue_auth(struct adapter *padapter, struct sta_info *psta, unsigned short status) 4487 4605 { 4488 4606 struct xmit_frame *pmgntframe; ··· 4866 5014 if (!padapter->registrypriv.wifi_spec) { 4867 5015 /* Commented by Kurt 20110629 */ 4868 5016 /* In some older APs, WPS handshake */ 4869 - /* would be fail if we append vender extensions informations to AP */ 5017 + /* would be fail if we append vendor extension information to AP */ 4870 5018 if (!memcmp(pIE->data, WPS_OUI, 4)) 4871 5019 pIE->Length = 14; 4872 5020 } ··· 5021 5169 kfree(pmlmepriv->assoc_req); 5022 5170 } 5023 5171 5024 - /* when wait_ack is ture, this function shoule be called at process context */ 5172 + /* when wait_ack is true, this function should be called at process context */ 5025 5173 static int _issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int wait_ack) 5026 5174 { 5027 5175 int ret = _FAIL; ··· 5090 5238 return ret; 5091 5239 } 5092 5240 5093 - /* when wait_ms > 0 , this function shoule be called at process context */ 5241 + /* when wait_ms > 0, this function should be called at process context */ 5094 5242 /* da == NULL for station mode */ 5095 5243 int issue_nulldata(struct adapter *padapter, unsigned char *da, unsigned int power_mode, int try_cnt, int wait_ms) 5096 5244 { ··· 5099 5247 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 5100 5248 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 5101 5249 5102 - /* da == NULL, assum it's null data for sta to ap*/ 5250 + /* da == NULL, assume it's null data for sta to ap*/ 5103 5251 if (!da) 5104 5252 da = get_my_bssid(&pmlmeinfo->network); 5105 5253 ··· 5123 5271 return ret; 5124 5272 } 5125 5273 5126 - /* when wait_ack is ture, this function shoule be called at process context */ 5274 + /* when wait_ack is true, this function should be called at process context */ 5127 5275 static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int wait_ack) 5128 5276 { 5129 5277 int ret = _FAIL; ··· 5196 5344 return ret; 5197 5345 } 5198 5346 5199 - /* when wait_ms > 0 , this function shoule be called at process context */ 5347 + /* when wait_ms > 0 , this function should be called at process context */ 5200 5348 /* da == NULL for station mode */ 5201 5349 int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms) 5202 5350 { ··· 5205 5353 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 5206 5354 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 5207 5355 5208 - /* da == NULL, assum it's null data for sta to ap*/ 5356 + /* da == NULL, assume it's null data for sta to ap*/ 5209 5357 if (!da) 5210 5358 da = get_my_bssid(&pmlmeinfo->network); 5211 5359 ··· 5323 5471 return ret; 5324 5472 } 5325 5473 5326 - void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, u16 status) 5474 + void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, 5475 + u16 status, struct ieee80211_mgmt *mgmt_req) 5327 5476 { 5328 5477 u16 start_seq; 5329 5478 u16 BA_starting_seqctrl = 0; ··· 5393 5540 break; 5394 5541 case WLAN_ACTION_ADDBA_RESP: 5395 5542 mgmt->u.action.u.addba_resp.action_code = WLAN_ACTION_ADDBA_RESP; 5396 - mgmt->u.action.u.addba_resp.dialog_token = pmlmeinfo->ADDBA_req.dialog_token; 5543 + mgmt->u.action.u.addba_resp.dialog_token = mgmt_req->u.action.u.addba_req.dialog_token; 5397 5544 mgmt->u.action.u.addba_resp.status = cpu_to_le16(status); 5398 - capab = le16_to_cpu(pmlmeinfo->ADDBA_req.BA_para_set) & 0x3f; 5545 + capab = le16_to_cpu(mgmt_req->u.action.u.addba_req.capab) & 0x3f; 5399 5546 capab |= u16_encode_bits(64, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK); 5400 5547 capab |= u16_encode_bits(pregpriv->ampdu_amsdu, IEEE80211_ADDBA_PARAM_AMSDU_MASK); 5401 5548 mgmt->u.action.u.addba_req.capab = cpu_to_le16(capab); 5402 - mgmt->u.action.u.addba_resp.timeout = pmlmeinfo->ADDBA_req.BA_timeout_value; 5549 + mgmt->u.action.u.addba_resp.timeout = mgmt_req->u.action.u.addba_req.timeout; 5403 5550 pattrib->pktlen = offsetofend(struct ieee80211_mgmt, u.action.u.addba_resp.timeout); 5404 5551 break; 5405 5552 case WLAN_ACTION_DELBA: ··· 5567 5714 if (initiator == 0) { /* recipient */ 5568 5715 for (tid = 0; tid < MAXTID; tid++) { 5569 5716 if (psta->recvreorder_ctrl[tid].enable) { 5570 - issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F)); 5717 + issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, 5718 + (((tid << 1) | initiator) & 0x1F), NULL); 5571 5719 psta->recvreorder_ctrl[tid].enable = false; 5572 5720 psta->recvreorder_ctrl[tid].indicate_seq = 0xffff; 5573 5721 } ··· 5576 5722 } else if (initiator == 1) { /* originator */ 5577 5723 for (tid = 0; tid < MAXTID; tid++) { 5578 5724 if (psta->htpriv.agg_enable_bitmap & BIT(tid)) { 5579 - issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F)); 5725 + issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, 5726 + (((tid << 1) | initiator) & 0x1F), NULL); 5580 5727 psta->htpriv.agg_enable_bitmap &= ~BIT(tid); 5581 5728 psta->htpriv.candidate_tid_bitmap &= ~BIT(tid); 5582 5729 } ··· 5740 5885 5741 5886 /**************************************************************************** 5742 5887 5743 - Following are some utitity fuctions for WiFi MLME 5888 + Following are some utility functions for WiFi MLME 5744 5889 5745 5890 *****************************************************************************/ 5746 5891 ··· 5792 5937 int res; 5793 5938 u8 reg; 5794 5939 5795 - if ((is_client_associated_to_ap(adapter)) || 5940 + if ((r8188eu_is_client_associated_to_ap(adapter)) || 5796 5941 ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) { 5797 5942 /* enable to rx data frame */ 5798 5943 rtw_write16(adapter, REG_RXFLTMAP2, 0xFFFF); ··· 5863 6008 if (ScanType == SCAN_ACTIVE) { /* obey the channel plan setting... */ 5864 6009 if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || 5865 6010 rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) { 5866 - issue_probereq_p2p(padapter, NULL); 5867 - issue_probereq_p2p(padapter, NULL); 5868 - issue_probereq_p2p(padapter, NULL); 6011 + issue_probereq_p2p(padapter); 6012 + issue_probereq_p2p(padapter); 6013 + issue_probereq_p2p(padapter); 5869 6014 } else { 5870 6015 int i; 5871 6016 for (i = 0; i < RTW_SSID_SCAN_AMOUNT; i++) { ··· 5913 6058 } else { 5914 6059 /* 20100721:Interrupt scan operation here. */ 5915 6060 /* For SW antenna diversity before link, it needs to switch to another antenna and scan again. */ 5916 - /* It compares the scan result and select beter one to do connection. */ 6061 + /* It compares the scan result and selects a better one to do connection. */ 5917 6062 if (AntDivBeforeLink8188E(padapter)) { 5918 6063 pmlmeext->sitesurvey_res.bss_cnt = 0; 5919 6064 pmlmeext->sitesurvey_res.channel_idx = -1; ··· 5943 6088 Restore_DM_Func_Flag(padapter); 5944 6089 /* Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true); */ 5945 6090 5946 - if (is_client_associated_to_ap(padapter)) 6091 + if (r8188eu_is_client_associated_to_ap(padapter)) 5947 6092 issue_nulldata(padapter, NULL, 0, 3, 500); 5948 6093 5949 6094 rtw_mlme_site_survey_done(padapter); ··· 5963 6108 /* collect bss info from Beacon and Probe request/response frames. */ 5964 6109 u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame, struct wlan_bssid_ex *bssid) 5965 6110 { 6111 + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; 5966 6112 int i; 5967 6113 u32 len; 5968 6114 u8 *p; 5969 - u16 val16, subtype; 6115 + u16 val16; 5970 6116 u8 *pframe = precv_frame->rx_data; 5971 6117 u32 packet_len = precv_frame->len; 5972 6118 u8 ie_offset; ··· 5983 6127 5984 6128 memset(bssid, 0, sizeof(struct wlan_bssid_ex)); 5985 6129 5986 - subtype = GetFrameSubType(pframe); 5987 - 5988 - if (subtype == WIFI_BEACON) { 6130 + if (ieee80211_is_beacon(mgmt->frame_control)) { 5989 6131 bssid->Reserved[0] = 1; 5990 6132 ie_offset = _BEACON_IE_OFFSET_; 6133 + } else if (ieee80211_is_probe_req(mgmt->frame_control)) { 6134 + ie_offset = _PROBEREQ_IE_OFFSET_; 6135 + bssid->Reserved[0] = 2; 6136 + } else if (ieee80211_is_probe_resp(mgmt->frame_control)) { 6137 + ie_offset = _PROBERSP_IE_OFFSET_; 6138 + bssid->Reserved[0] = 3; 5991 6139 } else { 5992 - /* FIXME : more type */ 5993 - if (subtype == WIFI_PROBEREQ) { 5994 - ie_offset = _PROBEREQ_IE_OFFSET_; 5995 - bssid->Reserved[0] = 2; 5996 - } else if (subtype == WIFI_PROBERSP) { 5997 - ie_offset = _PROBERSP_IE_OFFSET_; 5998 - bssid->Reserved[0] = 3; 5999 - } else { 6000 - bssid->Reserved[0] = 0; 6001 - ie_offset = _FIXED_IE_LENGTH_; 6002 - } 6140 + bssid->Reserved[0] = 0; 6141 + ie_offset = _FIXED_IE_LENGTH_; 6003 6142 } 6004 6143 6005 6144 bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; ··· 6041 6190 return _FAIL; 6042 6191 memcpy(bssid->SupportedRates + i, (p + 2), len); 6043 6192 } 6044 - 6045 - /* todo: */ 6046 - bssid->NetworkTypeInUse = Ndis802_11OFDM24; 6047 6193 6048 6194 if (bssid->IELength < 12) 6049 6195 return _FAIL; ··· 6176 6328 /* update wireless mode */ 6177 6329 update_wireless_mode(padapter); 6178 6330 6179 - /* udpate capability */ 6331 + /* update capability */ 6180 6332 caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork); 6181 6333 update_capinfo(padapter, caps); 6182 6334 if (caps & cap_IBSS) {/* adhoc master */ ··· 6226 6378 /* update wireless mode */ 6227 6379 update_wireless_mode(padapter); 6228 6380 6229 - /* udpate capability */ 6381 + /* update capability */ 6230 6382 caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork); 6231 6383 update_capinfo(padapter, caps); 6232 6384 if (caps & cap_ESS) { ··· 6604 6756 pcmd_obj->cmdsz = cmdsz; 6605 6757 pcmd_obj->parmbuf = pevtcmd; 6606 6758 6607 - pcmd_obj->rsp = NULL; 6608 - pcmd_obj->rspsz = 0; 6609 - 6610 6759 pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); 6611 6760 pc2h_evt_hdr->len = sizeof(struct joinbss_event); 6612 6761 pc2h_evt_hdr->ID = GEN_EVT_CODE(_JoinBss); ··· 6817 6972 /* BCN interval */ 6818 6973 rtw_write16(padapter, REG_BCN_INTERVAL, pmlmeinfo->bcn_interval); 6819 6974 6820 - /* udpate capability */ 6975 + /* update capability */ 6821 6976 update_capinfo(padapter, pmlmeinfo->capability); 6822 6977 6823 6978 /* WMM, Update EDCA param */ ··· 6909 7064 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 6910 7065 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 6911 7066 6912 - if (is_client_associated_to_ap(padapter) || is_IBSS_empty(padapter)) { 7067 + if (r8188eu_is_client_associated_to_ap(padapter) || r8188eu_is_ibss_empty(padapter)) { 6913 7068 mlme_disconnect(padapter); 6914 7069 rtw_set_bssid(padapter, null_addr); 6915 7070 ··· 6982 7137 6983 7138 rtl8188e_sreset_linked_status_check(padapter); 6984 7139 6985 - if (is_client_associated_to_ap(padapter)) { 7140 + if (r8188eu_is_client_associated_to_ap(padapter)) { 6986 7141 /* linked infrastructure client mode */ 6987 7142 6988 7143 int tx_chk = _SUCCESS, rx_chk = _SUCCESS; ··· 7010 7165 } 7011 7166 7012 7167 if (rx_chk != _SUCCESS) 7013 - issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr, 3, 1); 7168 + issue_probereq_ex(padapter, &pmlmeinfo->network.Ssid, psta->hwaddr); 7014 7169 7015 7170 if ((tx_chk != _SUCCESS && pmlmeinfo->link_count++ == 0xf) || rx_chk != _SUCCESS) { 7016 7171 tx_chk = issue_nulldata(padapter, psta->hwaddr, 0, 3, 1); ··· 7054 7209 pmlmeinfo->link_count = 0; 7055 7210 } 7056 7211 } /* end of if ((psta = rtw_get_stainfo(pstapriv, passoc_res->network.MacAddress)) != NULL) */ 7057 - } else if (is_client_associated_to_ibss(padapter)) { 7212 + } else if (r8188eu_is_client_associated_to_ibss(padapter)) { 7058 7213 /* linked IBSS mode */ 7059 7214 /* for each assoc list entry to check the rx pkt counter */ 7060 7215 for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) { ··· 7372 7527 u8 val8; 7373 7528 int res; 7374 7529 7375 - if (is_client_associated_to_ap(padapter)) 7530 + if (r8188eu_is_client_associated_to_ap(padapter)) 7376 7531 issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms / 100, 100); 7377 7532 7378 7533 mlme_disconnect(padapter); ··· 7484 7639 pmlmeext->sitesurvey_res.scan_mode = pparm->scan_mode; 7485 7640 7486 7641 /* issue null data if associating to the AP */ 7487 - if (is_client_associated_to_ap(padapter)) { 7642 + if (r8188eu_is_client_associated_to_ap(padapter)) { 7488 7643 pmlmeext->sitesurvey_res.state = SCAN_TXNULL; 7489 7644 7490 7645 issue_nulldata(padapter, NULL, 1, 3, 500); ··· 7628 7783 7629 7784 if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && (pmlmeinfo->HT_enable)) || 7630 7785 ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) { 7631 - issue_action_BA(padapter, pparm->addr, WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid); 7786 + issue_action_BA(padapter, pparm->addr, WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid, NULL); 7632 7787 _set_timer(&psta->addba_retry_timer, ADDBA_TO); 7633 7788 } else { 7634 7789 psta->htpriv.candidate_tid_bitmap &= ~BIT(pparm->tid);
+6 -13
drivers/staging/r8188eu/core/rtw_p2p.c
··· 1453 1453 1454 1454 set_channel_bwmode(padapter, pwdinfo->invitereq_info.peer_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); 1455 1455 rtw_mlme_under_site_survey(padapter); 1456 - issue_probereq_p2p(padapter, NULL); 1456 + issue_probereq_p2p(padapter); 1457 1457 _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); 1458 1458 1459 1459 } ··· 1464 1464 1465 1465 set_channel_bwmode(padapter, pwdinfo->tx_prov_disc_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); 1466 1466 rtw_mlme_under_site_survey(padapter); 1467 - issue_probereq_p2p(padapter, NULL); 1467 + issue_probereq_p2p(padapter); 1468 1468 _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); 1469 1469 1470 1470 } ··· 1475 1475 1476 1476 set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20); 1477 1477 rtw_mlme_under_site_survey(padapter); 1478 - issue_probereq_p2p(padapter, NULL); 1478 + issue_probereq_p2p(padapter); 1479 1479 _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); 1480 1480 1481 1481 } ··· 1505 1505 1506 1506 void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength) 1507 1507 { 1508 - u8 *ies; 1509 - u32 ies_len; 1510 1508 u8 *p2p_ie; 1511 1509 u32 p2p_ielen = 0; 1512 1510 u8 noa_attr[MAX_P2P_IE_LEN] = { 0x00 };/* NoA length should be n*(13) + 2 */ ··· 1516 1518 1517 1519 if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) 1518 1520 return; 1519 - if (IELength <= _BEACON_IE_OFFSET_) 1520 - return; 1521 1521 1522 - ies = IEs + _BEACON_IE_OFFSET_; 1523 - ies_len = IELength - _BEACON_IE_OFFSET_; 1524 - 1525 - p2p_ie = rtw_get_p2p_ie(ies, ies_len, NULL, &p2p_ielen); 1522 + p2p_ie = rtw_get_p2p_ie(IEs, IELength, NULL, &p2p_ielen); 1526 1523 1527 1524 while (p2p_ie) { 1528 1525 find_p2p = true; ··· 1572 1579 } 1573 1580 1574 1581 /* Get the next P2P IE */ 1575 - p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, ies_len - (p2p_ie - ies + p2p_ielen), NULL, &p2p_ielen); 1582 + p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, IELength - (p2p_ie - IEs + p2p_ielen), NULL, &p2p_ielen); 1576 1583 } 1577 1584 1578 1585 if (find_p2p) { ··· 1725 1732 if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) { 1726 1733 if (pwdinfo->tx_prov_disc_info.benable) { /* the provision discovery request frame is trigger to send or not */ 1727 1734 p2p_protocol_wk_cmd(adapter, P2P_PRE_TX_PROVDISC_PROCESS_WK); 1728 - /* issue_probereq_p2p(adapter, NULL); */ 1735 + /* issue_probereq_p2p(adapter); */ 1729 1736 /* _set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT); */ 1730 1737 } 1731 1738 } else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING)) {
+1 -1
drivers/staging/r8188eu/core/rtw_pwrctrl.c
··· 273 273 err = -1; 274 274 break; 275 275 } 276 - msleep(1); 276 + mdelay(1); 277 277 } 278 278 279 279 return err;
+12 -15
drivers/staging/r8188eu/core/rtw_recv.c
··· 779 779 } 780 780 781 781 /* check BSSID */ 782 - if (!memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || 783 - !memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) || 784 - (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { 782 + if (is_zero_ether_addr(pattrib->bssid) || is_zero_ether_addr(mybssid) || 783 + (memcmp(pattrib->bssid, mybssid, ETH_ALEN))) { 785 784 if (!bmcast) 786 785 issue_deauth(adapter, pattrib->bssid, WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); 787 786 ··· 971 972 if (psta->sleepq_len == 0) { 972 973 pstapriv->tim_bitmap &= ~BIT(psta->aid); 973 974 974 - /* upate BCN for TIM IE */ 975 + /* update BCN for TIM IE */ 975 976 /* update_BCNTIM(padapter); */ 976 977 update_beacon(padapter, _TIM_IE_, NULL, false); 977 978 } ··· 985 986 986 987 pstapriv->tim_bitmap &= ~BIT(psta->aid); 987 988 988 - /* upate BCN for TIM IE */ 989 + /* update BCN for TIM IE */ 989 990 /* update_BCNTIM(padapter); */ 990 991 update_beacon(padapter, _TIM_IE_, NULL, false); 991 992 } ··· 1031 1032 struct recv_frame *precv_frame) 1032 1033 { 1033 1034 struct sta_info *psta = NULL; 1034 - u8 *ptr = precv_frame->rx_data; 1035 1035 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precv_frame->rx_data; 1036 1036 struct rx_pkt_attrib *pattrib = &precv_frame->attrib; 1037 1037 struct security_priv *psecuritypriv = &adapter->securitypriv; ··· 1063 1065 if (!psta) 1064 1066 return _FAIL; 1065 1067 1066 - /* psta->rssi = prxcmd->rssi; */ 1067 - /* psta->signal_quality = prxcmd->sq; */ 1068 1068 precv_frame->psta = psta; 1069 1069 1070 1070 pattrib->amsdu = 0; 1071 1071 pattrib->ack_policy = 0; 1072 1072 /* parsing QC field */ 1073 1073 if (pattrib->qos) { 1074 + struct ieee80211_qos_hdr *qos_hdr = (struct ieee80211_qos_hdr *)hdr; 1075 + 1074 1076 pattrib->priority = ieee80211_get_tid(hdr); 1075 - pattrib->ack_policy = GetAckpolicy((ptr + 24)); 1076 - pattrib->amsdu = GetAMsdu((ptr + 24)); 1077 - pattrib->hdrlen = 26; 1077 + pattrib->ack_policy = GetAckpolicy(&qos_hdr->qos_ctrl); 1078 + pattrib->amsdu = GetAMsdu(&qos_hdr->qos_ctrl); 1079 + pattrib->hdrlen = sizeof(*qos_hdr); 1078 1080 1079 1081 if (pattrib->priority != 0 && pattrib->priority != 3) 1080 1082 adapter->recvpriv.bIsAnyNonBEPkts = true; ··· 1413 1415 1414 1416 struct recv_priv *precvpriv = &padapter->recvpriv; 1415 1417 struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue; 1416 - int ret = _SUCCESS; 1417 1418 1418 1419 nr_subframes = 0; 1419 1420 ··· 1510 1513 prframe->len = 0; 1511 1514 rtw_free_recvframe(prframe, pfree_recv_queue);/* free this recv_frame */ 1512 1515 1513 - return ret; 1516 + return _SUCCESS; 1514 1517 } 1515 1518 1516 1519 static bool check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num) ··· 1981 1984 } else { 1982 1985 if (recvpriv->signal_strength_data.update_req == 0) {/* update_req is clear, means we got rx */ 1983 1986 avg_signal_strength = recvpriv->signal_strength_data.avg_val; 1984 - /* after avg_vals are accquired, we can re-stat the signal values */ 1987 + /* after avg_vals are acquired, we can re-stat the signal values */ 1985 1988 recvpriv->signal_strength_data.update_req = 1; 1986 1989 } 1987 1990 1988 1991 if (recvpriv->signal_qual_data.update_req == 0) {/* update_req is clear, means we got rx */ 1989 1992 avg_signal_qual = recvpriv->signal_qual_data.avg_val; 1990 - /* after avg_vals are accquired, we can re-stat the signal values */ 1993 + /* after avg_vals are acquired, we can re-stat the signal values */ 1991 1994 recvpriv->signal_qual_data.update_req = 1; 1992 1995 } 1993 1996
+1 -3
drivers/staging/r8188eu/core/rtw_security.c
··· 954 954 955 955 } 956 956 957 - static int aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) 957 + static void aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen) 958 958 { 959 959 uint qc_exists, a4_exists, i, j, payload_remainder, 960 960 num_blocks, payload_index; ··· 1083 1083 bitwise_xor(aes_out, padded_buffer, chain_buffer); 1084 1084 for (j = 0; j < 8; j++) 1085 1085 pframe[payload_index++] = chain_buffer[j]; 1086 - 1087 - return _SUCCESS; 1088 1086 } 1089 1087 1090 1088 u32 rtw_aes_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe)
+6 -10
drivers/staging/r8188eu/core/rtw_sta_mgt.c
··· 45 45 psta->keep_alive_trycnt = 0; 46 46 } 47 47 48 - u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) 48 + int _rtw_init_sta_priv(struct sta_priv *pstapriv) 49 49 { 50 50 struct sta_info *psta; 51 51 s32 i; ··· 53 53 pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) * NUM_STA + 4); 54 54 55 55 if (!pstapriv->pallocated_stainfo_buf) 56 - return _FAIL; 56 + return -ENOMEM; 57 57 58 58 pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 - 59 59 ((size_t)(pstapriv->pallocated_stainfo_buf) & 3); ··· 93 93 pstapriv->expire_to = 3; /* 3*2 = 6 sec */ 94 94 pstapriv->max_num_sta = NUM_STA; 95 95 96 - return _SUCCESS; 96 + return 0; 97 97 } 98 98 99 99 inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta) ··· 242 242 } 243 243 244 244 /* using pstapriv->sta_hash_lock to protect */ 245 - u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) 245 + void rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta) 246 246 { 247 247 int i; 248 248 struct __queue *pfree_sta_queue; ··· 252 252 struct sta_priv *pstapriv = &padapter->stapriv; 253 253 254 254 if (!psta) 255 - goto exit; 255 + return; 256 256 257 257 pfree_sta_queue = &pstapriv->free_sta_queue; 258 258 ··· 356 356 spin_lock_bh(&pfree_sta_queue->lock); 357 357 list_add_tail(&psta->list, get_list_head(pfree_sta_queue)); 358 358 spin_unlock_bh(&pfree_sta_queue->lock); 359 - 360 - exit: 361 - 362 - return _SUCCESS; 363 359 } 364 360 365 361 /* free all stainfo which in sta_hash[all] */ ··· 400 404 if (!hwaddr) 401 405 return NULL; 402 406 403 - if (IS_MCAST(hwaddr)) 407 + if (is_multicast_ether_addr(hwaddr)) 404 408 addr = bc_addr; 405 409 else 406 410 addr = hwaddr;
+16 -20
drivers/staging/r8188eu/core/rtw_wlan_util.c
··· 331 331 return le16_to_cpu(val); 332 332 } 333 333 334 - int is_client_associated_to_ap(struct adapter *padapter) 334 + bool r8188eu_is_client_associated_to_ap(struct adapter *padapter) 335 335 { 336 336 struct mlme_ext_priv *pmlmeext; 337 337 struct mlme_ext_info *pmlmeinfo; 338 338 339 339 if (!padapter) 340 - return _FAIL; 340 + return false; 341 341 342 342 pmlmeext = &padapter->mlmeextpriv; 343 343 pmlmeinfo = &pmlmeext->mlmext_info; 344 344 345 345 if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)) 346 346 return true; 347 - else 348 - return _FAIL; 347 + 348 + return false; 349 349 } 350 350 351 - int is_client_associated_to_ibss(struct adapter *padapter) 351 + bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter) 352 352 { 353 353 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; 354 354 struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; 355 355 356 356 if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)) 357 357 return true; 358 - else 359 - return _FAIL; 358 + 359 + return false; 360 360 } 361 361 362 - int is_IBSS_empty(struct adapter *padapter) 362 + bool r8188eu_is_ibss_empty(struct adapter *padapter) 363 363 { 364 364 unsigned int i; 365 365 struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; ··· 367 367 368 368 for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) { 369 369 if (pmlmeinfo->FW_sta_info[i].status == 1) 370 - return _FAIL; 370 + return false; 371 371 } 372 372 return true; 373 373 } ··· 874 874 875 875 int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) 876 876 { 877 + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)pframe; 877 878 unsigned int len; 878 879 unsigned char *p; 879 - unsigned short val16, subtype; 880 + unsigned short val16; 880 881 struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network; 881 882 /* u8 wpa_ie[255], rsn_ie[255]; */ 882 883 u16 wpa_len = 0, rsn_len = 0; ··· 894 893 unsigned short ht_cap_info; 895 894 unsigned char ht_info_infos_0; 896 895 897 - if (!is_client_associated_to_ap(Adapter)) 896 + if (!r8188eu_is_client_associated_to_ap(Adapter)) 898 897 return true; 899 898 900 899 len = packet_len - sizeof(struct ieee80211_hdr_3addr); ··· 909 908 if (!bssid) 910 909 return _FAIL; 911 910 912 - subtype = GetFrameSubType(pframe) >> 4; 913 - 914 - if (subtype == WIFI_BEACON) 911 + if (ieee80211_is_beacon(mgmt->frame_control)) 915 912 bssid->Reserved[0] = 1; 916 913 917 914 bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; ··· 1034 1035 return _FAIL; 1035 1036 } 1036 1037 1037 - void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, struct sta_info *psta) 1038 + void update_beacon_info(struct adapter *padapter, u8 *ie_ptr, uint ie_len, struct sta_info *psta) 1038 1039 { 1039 1040 unsigned int i; 1040 - unsigned int len; 1041 1041 struct ndis_802_11_var_ie *pIE; 1042 1042 1043 - len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN); 1044 - 1045 - for (i = 0; i < len;) { 1046 - pIE = (struct ndis_802_11_var_ie *)(pframe + (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN) + i); 1043 + for (i = 0; i < ie_len;) { 1044 + pIE = (struct ndis_802_11_var_ie *)(ie_ptr + i); 1047 1045 1048 1046 switch (pIE->ElementID) { 1049 1047 case _HT_EXTRA_INFO_IE_: /* HT info */
+20 -34
drivers/staging/r8188eu/core/rtw_xmit.c
··· 38 38 { 39 39 pxmitbuf->pallocated_buf = kzalloc(alloc_sz, GFP_KERNEL); 40 40 if (!pxmitbuf->pallocated_buf) 41 - return _FAIL; 41 + return -ENOMEM; 42 42 43 43 pxmitbuf->pbuf = (u8 *)ALIGN((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); 44 44 pxmitbuf->dma_transfer_addr = 0; ··· 46 46 pxmitbuf->pxmit_urb = usb_alloc_urb(0, GFP_KERNEL); 47 47 if (!pxmitbuf->pxmit_urb) { 48 48 kfree(pxmitbuf->pallocated_buf); 49 - return _FAIL; 49 + return -ENOMEM; 50 50 } 51 51 52 - return _SUCCESS; 52 + return 0; 53 53 } 54 54 55 55 static void rtw_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, ··· 59 59 kfree(pxmitbuf->pallocated_buf); 60 60 } 61 61 62 - s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) 62 + int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) 63 63 { 64 64 int i; 65 65 struct xmit_buf *pxmitbuf; 66 66 struct xmit_frame *pxframe; 67 - int res = _SUCCESS; 68 67 u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ; 69 68 u32 num_xmit_extbuf = NR_XMIT_EXTBUFF; 70 69 ··· 96 97 97 98 if (!pxmitpriv->pallocated_frame_buf) { 98 99 pxmitpriv->pxmit_frame_buf = NULL; 99 - res = _FAIL; 100 100 goto exit; 101 101 } 102 102 pxmitpriv->pxmit_frame_buf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_frame_buf), 4); ··· 130 132 131 133 pxmitpriv->pallocated_xmitbuf = vzalloc(NR_XMITBUFF * sizeof(struct xmit_buf) + 4); 132 134 133 - if (!pxmitpriv->pallocated_xmitbuf) { 134 - res = _FAIL; 135 + if (!pxmitpriv->pallocated_xmitbuf) 135 136 goto free_frame_buf; 136 - } 137 137 138 138 pxmitpriv->pxmitbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmitbuf), 4); 139 139 /* pxmitpriv->pxmitbuf = pxmitpriv->pallocated_xmitbuf + 4 - */ ··· 147 151 pxmitbuf->ext_tag = false; 148 152 149 153 /* Tx buf allocation may fail sometimes, so sleep and retry. */ 150 - res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); 151 - if (res == _FAIL) { 154 + if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) { 152 155 msleep(10); 153 - res = rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ)); 154 - if (res == _FAIL) 156 + if (rtw_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) 155 157 goto free_xmitbuf; 156 158 } 157 159 ··· 166 172 167 173 pxmitpriv->pallocated_xmit_extbuf = vzalloc(num_xmit_extbuf * sizeof(struct xmit_buf) + 4); 168 174 169 - if (!pxmitpriv->pallocated_xmit_extbuf) { 170 - res = _FAIL; 175 + if (!pxmitpriv->pallocated_xmit_extbuf) 171 176 goto free_xmitbuf; 172 - } 173 177 174 178 pxmitpriv->pxmit_extbuf = (u8 *)ALIGN((size_t)(pxmitpriv->pallocated_xmit_extbuf), 4); 175 179 ··· 180 188 pxmitbuf->padapter = padapter; 181 189 pxmitbuf->ext_tag = true; 182 190 183 - res = rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ); 184 - if (res == _FAIL) { 185 - res = _FAIL; 191 + if (rtw_xmit_resource_alloc(padapter, pxmitbuf, max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) 186 192 goto free_xmit_extbuf; 187 - } 188 193 189 194 list_add_tail(&pxmitbuf->list, &pxmitpriv->free_xmit_extbuf_queue.queue); 190 195 pxmitbuf++; ··· 189 200 190 201 pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; 191 202 192 - if (rtw_alloc_hwxmits(padapter)) { 193 - res = _FAIL; 203 + if (rtw_alloc_hwxmits(padapter)) 194 204 goto free_xmit_extbuf; 195 - } 196 205 197 206 rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); 198 207 ··· 213 226 214 227 rtl8188eu_init_xmit_priv(padapter); 215 228 216 - return _SUCCESS; 229 + return 0; 217 230 218 231 free_xmit_extbuf: 219 232 pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; ··· 233 246 free_frame_buf: 234 247 vfree(pxmitpriv->pallocated_frame_buf); 235 248 exit: 236 - return res; 249 + return -ENOMEM; 237 250 } 238 251 239 252 static void rtw_pkt_complete(struct adapter *padapter, struct sk_buff *pkt) ··· 463 476 { 464 477 uint len; 465 478 466 - len = rtw_remainder_len(pfile); 467 - len = (rlen > len) ? len : rlen; 479 + len = min(rtw_remainder_len(pfile), rlen); 468 480 469 481 if (rmem) 470 482 skb_copy_bits(pfile->pkt, pfile->buf_len - pfile->pkt_len, rmem, len); ··· 1608 1622 spin_lock_bh(&padapter->br_ext_lock); 1609 1623 if (!(skb->data[0] & 1) && br_port && 1610 1624 memcmp(skb->data + ETH_ALEN, padapter->br_mac, ETH_ALEN) && 1611 - *((__be16 *)(skb->data + ETH_ALEN * 2)) != __constant_htons(ETH_P_8021Q) && 1612 - *((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP) && 1625 + *((__be16 *)(skb->data + ETH_ALEN * 2)) != htons(ETH_P_8021Q) && 1626 + *((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_IP) && 1613 1627 !memcmp(padapter->scdb_mac, skb->data + ETH_ALEN, ETH_ALEN) && padapter->scdb_entry) { 1614 1628 memcpy(skb->data + ETH_ALEN, GET_MY_HWADDR(padapter), ETH_ALEN); 1615 1629 padapter->scdb_entry->ageing_timer = jiffies; 1616 1630 spin_unlock_bh(&padapter->br_ext_lock); 1617 1631 } else { 1618 - if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_8021Q)) { 1632 + if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_8021Q)) { 1619 1633 is_vlan_tag = 1; 1620 1634 vlan_hdr = *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)); 1621 1635 for (i = 0; i < 6; i++) ··· 1623 1637 skb_pull(skb, 4); 1624 1638 } 1625 1639 if (!memcmp(skb->data + ETH_ALEN, padapter->br_mac, ETH_ALEN) && 1626 - (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP))) 1640 + (*((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_IP))) 1627 1641 memcpy(padapter->br_ip, skb->data + WLAN_ETHHDR_LEN + 12, 4); 1628 1642 1629 - if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == __constant_htons(ETH_P_IP)) { 1643 + if (*((__be16 *)(skb->data + ETH_ALEN * 2)) == htons(ETH_P_IP)) { 1630 1644 if (memcmp(padapter->scdb_mac, skb->data + ETH_ALEN, ETH_ALEN)) { 1631 1645 padapter->scdb_entry = (struct nat25_network_db_entry *)scdb_findEntry(padapter, 1632 1646 skb->data + WLAN_ETHHDR_LEN + 12); ··· 1655 1669 skb_push(skb, 4); 1656 1670 for (i = 0; i < 6; i++) 1657 1671 *((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2)); 1658 - *((__be16 *)(skb->data + ETH_ALEN * 2)) = __constant_htons(ETH_P_8021Q); 1672 + *((__be16 *)(skb->data + ETH_ALEN * 2)) = htons(ETH_P_8021Q); 1659 1673 *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr; 1660 1674 } 1661 1675 ··· 1694 1708 skb_push(skb, 4); 1695 1709 for (i = 0; i < 6; i++) 1696 1710 *((unsigned short *)(skb->data + i * 2)) = *((unsigned short *)(skb->data + 4 + i * 2)); 1697 - *((__be16 *)(skb->data + ETH_ALEN * 2)) = __constant_htons(ETH_P_8021Q); 1711 + *((__be16 *)(skb->data + ETH_ALEN * 2)) = htons(ETH_P_8021Q); 1698 1712 *((unsigned short *)(skb->data + ETH_ALEN * 2 + 2)) = vlan_hdr; 1699 1713 } 1700 1714 }
+2 -10
drivers/staging/r8188eu/hal/HalPhyRf_8188e.c
··· 69 69 /*----------------------------------------------------------------------------- 70 70 * Function: odm_TxPwrTrackSetPwr88E() 71 71 * 72 - * Overview: 88E change all channel tx power accordign to flag. 72 + * Overview: 88E change all channel tx power according to flag. 73 73 * OFDM & CCK are all different. 74 74 * 75 75 * Input: NONE ··· 583 583 tmp2 = resulta[c2][i]; 584 584 } 585 585 586 - diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1); 586 + diff = abs(tmp1 - tmp2); 587 587 588 588 if (diff > MAX_TOLERANCE) { 589 589 if ((i == 2 || i == 6) && !sim_bitmap) { ··· 881 881 } 882 882 if (RegE94 != 0) 883 883 patha_fill_iqk(adapt, pathaok, result, final_candidate, (RegEA4 == 0)); 884 - 885 - /* To Fix BSOD when final_candidate is 0xff */ 886 - /* by sherry 20120321 */ 887 - if (final_candidate < 4) { 888 - for (i = 0; i < IQK_Matrix_REG_NUM; i++) 889 - dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.Value[0][i] = result[final_candidate][i]; 890 - dm_odm->RFCalibrateInfo.IQKMatrixRegSetting.bIQKDone = true; 891 - } 892 884 893 885 _PHY_SaveADDARegisters(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); 894 886 }
+7 -12
drivers/staging/r8188eu/hal/hal_intf.c
··· 6 6 #include "../include/drv_types.h" 7 7 #include "../include/hal_intf.h" 8 8 9 - uint rtw_hal_init(struct adapter *adapt) 9 + uint rtw_hal_init(struct adapter *adapt) 10 10 { 11 - uint status = _SUCCESS; 12 - 13 11 adapt->hw_init_completed = false; 14 12 15 - status = rtl8188eu_hal_init(adapt); 13 + if (rtl8188eu_hal_init(adapt) != _SUCCESS) 14 + return _FAIL; 16 15 17 - if (status == _SUCCESS) { 18 - adapt->hw_init_completed = true; 16 + adapt->hw_init_completed = true; 19 17 20 - if (adapt->registrypriv.notch_filter == 1) 21 - hal_notch_filter_8188e(adapt, 1); 22 - } else { 23 - adapt->hw_init_completed = false; 24 - } 18 + if (adapt->registrypriv.notch_filter == 1) 19 + hal_notch_filter_8188e(adapt, 1); 25 20 26 - return status; 21 + return _SUCCESS; 27 22 } 28 23 29 24 uint rtw_hal_deinit(struct adapter *adapt)
+3 -3
drivers/staging/r8188eu/hal/odm_RTL8188E.c
··· 194 194 for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) { 195 195 pEntry = dm_odm->pODM_StaInfo[i]; 196 196 if (IS_STA_VALID(pEntry)) { 197 - /* 2 Caculate RSSI per Antenna */ 197 + /* 2 Calculate RSSI per Antenna */ 198 198 Main_RSSI = (dm_fat_tbl->MainAnt_Cnt[i] != 0) ? (dm_fat_tbl->MainAnt_Sum[i] / dm_fat_tbl->MainAnt_Cnt[i]) : 0; 199 199 Aux_RSSI = (dm_fat_tbl->AuxAnt_Cnt[i] != 0) ? (dm_fat_tbl->AuxAnt_Sum[i] / dm_fat_tbl->AuxAnt_Cnt[i]) : 0; 200 200 TargetAnt = (Main_RSSI >= Aux_RSSI) ? MAIN_ANT : AUX_ANT; 201 201 /* 2 Select MaxRSSI for DIG */ 202 - LocalMaxRSSI = (Main_RSSI > Aux_RSSI) ? Main_RSSI : Aux_RSSI; 202 + LocalMaxRSSI = max(Main_RSSI, Aux_RSSI); 203 203 if ((LocalMaxRSSI > AntDivMaxRSSI) && (LocalMaxRSSI < 40)) 204 204 AntDivMaxRSSI = LocalMaxRSSI; 205 205 if (LocalMaxRSSI > MaxRSSI) ··· 211 211 else if ((dm_fat_tbl->RxIdleAnt == AUX_ANT) && (Aux_RSSI == 0)) 212 212 Aux_RSSI = Main_RSSI; 213 213 214 - LocalMinRSSI = (Main_RSSI > Aux_RSSI) ? Aux_RSSI : Main_RSSI; 214 + LocalMinRSSI = min(Main_RSSI, Aux_RSSI); 215 215 if (LocalMinRSSI < MinRSSI) { 216 216 MinRSSI = LocalMinRSSI; 217 217 RxIdleAnt = TargetAnt;
+2 -6
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
··· 355 355 if (PwrState) { 356 356 rtw_write8(pAdapter, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON); 357 357 358 - /* 1.2V Power: From VDDON with Power Cut(0x0000h[15]), defualt valid */ 358 + /* 1.2V Power: From VDDON with Power Cut(0x0000h[15]), default valid */ 359 359 res = rtw_read16(pAdapter, REG_SYS_ISO_CTRL, &tmpV16); 360 360 if (res) 361 361 return; ··· 676 676 return status; 677 677 } 678 678 679 - void 680 - Hal_EfuseParseIDCode88E( 681 - struct adapter *padapter, 682 - u8 *hwinfo 683 - ) 679 + void Hal_EfuseParseIDCode88E(struct adapter *padapter, u8 *hwinfo) 684 680 { 685 681 struct eeprom_priv *pEEPROM = &padapter->eeprompriv; 686 682 struct net_device *netdev = padapter->pnetdev;
+8 -8
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
··· 23 23 /** 24 24 * Function: PHY_QueryBBReg 25 25 * 26 - * OverView: Read "sepcific bits" from BB register 26 + * Overview: Read "sepcific bits" from BB register 27 27 * 28 28 * Input: 29 29 * struct adapter *Adapter, ··· 56 56 /** 57 57 * Function: PHY_SetBBReg 58 58 * 59 - * OverView: Write "Specific bits" to BB register (page 8~) 59 + * Overview: Write "Specific bits" to BB register (page 8~) 60 60 * 61 61 * Input: 62 62 * struct adapter *Adapter, ··· 94 94 /** 95 95 * Function: phy_RFSerialRead 96 96 * 97 - * OverView: Read regster from RF chips 97 + * Overview: Read register from RF chips 98 98 * 99 99 * Input: 100 100 * struct adapter *Adapter, ··· 160 160 /** 161 161 * Function: phy_RFSerialWrite 162 162 * 163 - * OverView: Write data to RF register (page 8~) 163 + * Overview: Write data to RF register (page 8~) 164 164 * 165 165 * Input: 166 166 * struct adapter *Adapter, ··· 235 235 /** 236 236 * Function: PHY_QueryRFReg 237 237 * 238 - * OverView: Query "Specific bits" to RF register (page 8~) 238 + * Overview: Query "Specific bits" to RF register (page 8~) 239 239 * 240 240 * Input: 241 241 * struct adapter *Adapter, ··· 261 261 /** 262 262 * Function: PHY_SetRFReg 263 263 * 264 - * OverView: Write "Specific bits" to RF register (page 8~) 264 + * Overview: Write "Specific bits" to RF register (page 8~) 265 265 * 266 266 * Input: 267 267 * struct adapter *Adapter, ··· 335 335 /** 336 336 * Function: phy_InitBBRFRegisterDefinition 337 337 * 338 - * OverView: Initialize Register definition offset for Radio Path A/B/C/D 338 + * Overview: Initialize Register definition offset for Radio Path A/B/C/D 339 339 * 340 340 * Input: 341 341 * struct adapter *Adapter, ··· 363 363 /* RF Interface (Output and) Enable */ 364 364 pHalData->PHYRegDef.rfintfe = rFPGA0_XA_RFInterfaceOE; /* 16 MSBs if read 32-bit from 0x860 (16-bit for 0x862) */ 365 365 366 - /* Addr of LSSI. Wirte RF register by driver */ 366 + /* Addr of LSSI. Write RF register by driver */ 367 367 pHalData->PHYRegDef.rf3wireOffset = rFPGA0_XA_LSSIParameter; /* LSSI Parameter */ 368 368 369 369 /* RF parameter */
+15 -17
drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c
··· 66 66 67 67 if (pattrib->pkt_rpt_type == NORMAL_RX) { 68 68 pattrib->pkt_len = le32_to_cpu(prxstat->rxdw0) & 0x00003fff; 69 + pattrib->icv_err = (le32_to_cpu(prxstat->rxdw0) >> 15) & 0x1; 69 70 pattrib->drvinfo_sz = ((le32_to_cpu(prxstat->rxdw0) >> 16) & 0xf) * 8; 70 - 71 - pattrib->physt = (le32_to_cpu(prxstat->rxdw0) >> 26) & 0x1; 72 - 73 - pattrib->bdecrypted = (le32_to_cpu(prxstat->rxdw0) & BIT(27)) ? 0 : 1; 74 - pattrib->encrypt = (le32_to_cpu(prxstat->rxdw0) >> 20) & 0x7; 75 - 71 + pattrib->encrypt = (u8)((le32_to_cpu(prxstat->rxdw0) >> 20) & 0x7); 76 72 pattrib->qos = (le32_to_cpu(prxstat->rxdw0) >> 23) & 0x1; 77 - pattrib->priority = (le32_to_cpu(prxstat->rxdw1) >> 8) & 0xf; 73 + pattrib->shift_sz = (le32_to_cpu(prxstat->rxdw0) >> 24) & 0x3; 74 + pattrib->physt = (le32_to_cpu(prxstat->rxdw0) >> 26) & 0x1; 75 + pattrib->bdecrypted = (le32_to_cpu(prxstat->rxdw0) & BIT(27)) ? 0 : 1; 78 76 77 + pattrib->priority = (le32_to_cpu(prxstat->rxdw1) >> 8) & 0xf; 79 78 pattrib->amsdu = (le32_to_cpu(prxstat->rxdw1) >> 13) & 0x1; 79 + pattrib->mdata = (le32_to_cpu(prxstat->rxdw1) >> 26) & 0x1; 80 + pattrib->mfrag = (le32_to_cpu(prxstat->rxdw1) >> 27) & 0x1; 80 81 81 82 pattrib->seq_num = le32_to_cpu(prxstat->rxdw2) & 0x00000fff; 82 83 pattrib->frag_num = (le32_to_cpu(prxstat->rxdw2) >> 12) & 0xf; 83 - pattrib->mfrag = (le32_to_cpu(prxstat->rxdw1) >> 27) & 0x1; 84 - pattrib->mdata = (le32_to_cpu(prxstat->rxdw1) >> 26) & 0x1; 85 84 86 85 pattrib->mcs_rate = le32_to_cpu(prxstat->rxdw3) & 0x3f; 87 86 pattrib->rxht = (le32_to_cpu(prxstat->rxdw3) >> 6) & 0x1; 88 87 89 - pattrib->icv_err = (le32_to_cpu(prxstat->rxdw0) >> 15) & 0x1; 90 - pattrib->shift_sz = (le32_to_cpu(prxstat->rxdw0) >> 24) & 0x3; 91 88 } else if (pattrib->pkt_rpt_type == TX_REPORT1) { /* CCX */ 92 89 pattrib->pkt_len = TX_RPT1_PKT_LEN; 93 90 } else if (pattrib->pkt_rpt_type == TX_REPORT2) { ··· 105 108 */ 106 109 void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat *pphy_status) 107 110 { 111 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)precvframe->rx_data; 108 112 struct adapter *padapter = precvframe->adapter; 109 113 struct rx_pkt_attrib *pattrib = &precvframe->attrib; 110 114 struct hal_data_8188e *pHalData = &padapter->haldata; 111 115 struct phy_info *pPHYInfo = &pattrib->phy_info; 112 116 u8 *wlanhdr = precvframe->rx_data; 113 - __le16 fc = *(__le16 *)wlanhdr; 114 117 struct odm_per_pkt_info pkt_info; 115 118 u8 *sa = NULL; 116 119 struct sta_priv *pstapriv; 117 120 struct sta_info *psta; 118 121 119 - pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl(fc)) && 122 + pkt_info.bPacketMatchBSSID = ((!ieee80211_is_ctl(hdr->frame_control)) && 120 123 !pattrib->icv_err && !pattrib->crc_err && 121 124 !memcmp(get_hdr_bssid(wlanhdr), 122 125 get_bssid(&padapter->mlmepriv), ETH_ALEN)); 123 126 124 127 pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && 125 - (!memcmp(get_da(wlanhdr), 126 - myid(&padapter->eeprompriv), ETH_ALEN)); 128 + ether_addr_equal(ieee80211_get_DA(hdr), 129 + myid(&padapter->eeprompriv)); 127 130 128 - pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && ieee80211_is_beacon(fc); 131 + pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && 132 + ieee80211_is_beacon(hdr->frame_control); 129 133 if (pkt_info.bPacketBeacon) { 130 134 if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE)) 131 135 sa = padapter->mlmepriv.cur_network.network.MacAddress; 132 136 /* to do Ad-hoc */ 133 137 } else { 134 - sa = get_sa(wlanhdr); 138 + sa = ieee80211_get_SA(hdr); 135 139 } 136 140 137 141 pstapriv = &padapter->stapriv;
+1 -2
drivers/staging/r8188eu/hal/rtl8188eu_xmit.c
··· 149 149 150 150 static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bagg_pkt) 151 151 { 152 - int pull = 0; 153 152 uint qsel; 154 153 u8 data_rate, pwr_status, offset; 155 154 struct adapter *adapt = pxmitframe->padapter; ··· 294 295 ODM_SetTxAntByTxInfo_88E(&haldata->odmpriv, pmem, pattrib->mac_id); 295 296 296 297 rtl8188eu_cal_txdesc_chksum(ptxdesc); 297 - return pull; 298 + return 0; 298 299 } 299 300 300 301 /* for non-agg data frame or management frame */
+2 -2
drivers/staging/r8188eu/include/Hal8188EPhyReg.h
··· 92 92 #define rFPGA0_AdDaClockEn 0x888 93 93 #define rFPGA0_AnalogParameter4 0x88c 94 94 95 - #define rFPGA0_XA_LSSIReadBack 0x8a0 /* Tranceiver LSSI Readback */ 95 + #define rFPGA0_XA_LSSIReadBack 0x8a0 /* Transceiver LSSI Readback */ 96 96 #define rFPGA0_XB_LSSIReadBack 0x8a4 97 97 #define rFPGA0_XC_LSSIReadBack 0x8a8 98 98 #define rFPGA0_XD_LSSIReadBack 0x8ac ··· 167 167 168 168 /* RxIQ DC offset, Rx digital filter, DC notch filter */ 169 169 #define rOFDM0_XARxAFE 0xc10 170 - #define rOFDM0_XARxIQImbalance 0xc14 /* RxIQ imblance matrix */ 170 + #define rOFDM0_XARxIQImbalance 0xc14 /* RxIQ imbalance matrix */ 171 171 #define rOFDM0_XBRxAFE 0xc18 172 172 #define rOFDM0_XBRxIQImbalance 0xc1c 173 173 #define rOFDM0_XCRxAFE 0xc20
-1
drivers/staging/r8188eu/include/drv_types.h
··· 167 167 168 168 s32 bDriverStopped; 169 169 s32 bSurpriseRemoved; 170 - s32 bCardDisableWOHSM; 171 170 172 171 u8 hw_init_completed; 173 172 s8 signal_strength;
+2 -8
drivers/staging/r8188eu/include/odm.h
··· 80 80 #define HP_THERMAL_NUM 8 81 81 82 82 #define AVG_THERMAL_NUM 8 83 - #define IQK_Matrix_REG_NUM 8 84 83 85 84 struct odm_phy_dbg_info { 86 85 /* ODM Write,debug info */ ··· 118 119 ODM_BB_PWR_TRA = BIT(8), 119 120 }; 120 121 121 - # define ODM_ITRF_USB 0x2 122 + #define ODM_ITRF_USB 0x2 123 + #define ODM_CE 0x04 122 124 123 125 /* ODM_CMNINFO_WM_MODE */ 124 126 enum odm_wireless_mode { ··· 163 163 u8 PTSmoothFactor; 164 164 }; 165 165 166 - struct ijk_matrix_regs_set { 167 - bool bIQKDone; 168 - s32 Value[1][IQK_Matrix_REG_NUM]; 169 - }; 170 - 171 166 struct odm_rf_cal { 172 167 /* for tx power tracking */ 173 168 u32 RegA24; /* for TempCCK */ ··· 200 205 201 206 u8 ThermalValue_HP[HP_THERMAL_NUM]; 202 207 u8 ThermalValue_HP_index; 203 - struct ijk_matrix_regs_set IQKMatrixRegSetting; 204 208 205 209 u8 Delta_IQK; 206 210 u8 Delta_LCK;
+7
drivers/staging/r8188eu/include/odm_RTL8188E.h
··· 11 11 #define MAIN_ANT_CGCS_RX 0 12 12 #define AUX_ANT_CGCS_RX 1 13 13 14 + #define SET_TX_DESC_ANTSEL_A_88E(__ptxdesc, __value) \ 15 + le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(24)) 16 + #define SET_TX_DESC_ANTSEL_B_88E(__ptxdesc, __value) \ 17 + le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(25)) 18 + #define SET_TX_DESC_ANTSEL_C_88E(__ptxdesc, __value) \ 19 + le32p_replace_bits((__le32 *)(__ptxdesc + 28), __value, BIT(29)) 20 + 14 21 void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *pDM_Odm); 15 22 16 23 void ODM_AntennaDiversity_88E(struct odm_dm_struct *pDM_Odm);
-16
drivers/staging/r8188eu/include/odm_types.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 - /* Copyright(c) 2007 - 2011 Realtek Corporation. */ 3 - 4 - #ifndef __ODM_TYPES_H__ 5 - #define __ODM_TYPES_H__ 6 - 7 - #define ODM_CE 0x04 /* BIT(2) */ 8 - 9 - #define SET_TX_DESC_ANTSEL_A_88E(__ptxdesc, __value) \ 10 - le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(24)) 11 - #define SET_TX_DESC_ANTSEL_B_88E(__ptxdesc, __value) \ 12 - le32p_replace_bits((__le32 *)(__ptxdesc + 8), __value, BIT(25)) 13 - #define SET_TX_DESC_ANTSEL_C_88E(__ptxdesc, __value) \ 14 - le32p_replace_bits((__le32 *)(__ptxdesc + 28), __value, BIT(29)) 15 - 16 - #endif /* __ODM_TYPES_H__ */
+3 -3
drivers/staging/r8188eu/include/osdep_intf.h
··· 43 43 int netdev_close(struct net_device *pnetdev); 44 44 45 45 u8 rtw_init_drv_sw(struct adapter *padapter); 46 - u8 rtw_free_drv_sw(struct adapter *padapter); 47 - u8 rtw_reset_drv_sw(struct adapter *padapter); 46 + void rtw_free_drv_sw(struct adapter *padapter); 47 + void rtw_reset_drv_sw(struct adapter *padapter); 48 48 49 - u32 rtw_start_drv_threads(struct adapter *padapter); 49 + int rtw_start_drv_threads(struct adapter *padapter); 50 50 void rtw_stop_drv_threads (struct adapter *padapter); 51 51 void rtw_cancel_all_timer(struct adapter *padapter); 52 52
+3 -3
drivers/staging/r8188eu/include/osdep_service.h
··· 53 53 return (&(queue->queue)); 54 54 } 55 55 56 - static inline void _set_timer(struct timer_list *ptimer,u32 delay_time) 56 + static inline void _set_timer(struct timer_list *ptimer, u32 delay_time) 57 57 { 58 58 mod_timer(ptimer, jiffies + msecs_to_jiffies(delay_time)); 59 59 } ··· 66 66 netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 3)); 67 67 } 68 68 69 - extern int RTW_STATUS_CODE(int error_code); 69 + int RTW_STATUS_CODE(int error_code); 70 70 71 71 void *rtw_malloc2d(int h, int w, int size); 72 72 ··· 108 108 #define FUNC_ADPT_FMT "%s(%s)" 109 109 #define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name 110 110 111 - #define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)),(sig), 1) 111 + #define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)), (sig), 1) 112 112 113 113 /* Macros for handling unaligned memory accesses */ 114 114
+3 -4
drivers/staging/r8188eu/include/rtl8188e_hal.h
··· 14 14 #include "rtl8188e_xmit.h" 15 15 #include "rtl8188e_cmd.h" 16 16 #include "rtw_efuse.h" 17 - #include "odm_types.h" 18 17 #include "odm.h" 19 18 #include "odm_HWConfig.h" 20 19 #include "odm_RegDefine11N.h" ··· 87 88 /* 9bytes + 1byt + 5bytes and pre 1byte. */ 88 89 /* For worst case: */ 89 90 /* | 2byte|----8bytes----|1byte|--7bytes--| 92D */ 90 - /* PG data exclude header, dummy 7 bytes frome CP test and reserved 1byte. */ 91 + /* PG data exclude header, dummy 7 bytes from CP test and reserved 1byte. */ 91 92 #define EFUSE_OOB_PROTECT_BYTES_88E 18 92 93 93 94 #define EFUSE_PROTECT_BYTES_BANK 16 ··· 164 165 165 166 void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo, 166 167 bool AutoLoadFail); 167 - void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter,u8 *PROMContent, 168 + void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter, u8 *PROMContent, 168 169 bool AutoLoadFail); 169 - void Hal_ReadThermalMeter_88E(struct adapter * dapter, u8 *PROMContent, 170 + void Hal_ReadThermalMeter_88E(struct adapter *padapter, u8 *PROMContent, 170 171 bool AutoloadFail); 171 172 void Hal_EfuseParseXtal_8188E(struct adapter *pAdapter, u8 *hwinfo, 172 173 bool AutoLoadFail);
+9 -9
drivers/staging/r8188eu/include/rtl8188e_spec.h
··· 4 4 #ifndef __RTL8188E_SPEC_H__ 5 5 #define __RTL8188E_SPEC_H__ 6 6 7 - /* 8192C Regsiter offset definition */ 7 + /* 8192C Register offset definition */ 8 8 9 9 #define HAL_PS_TIMER_INT_DELAY 50 /* 50 microseconds */ 10 10 #define HAL_92C_NAV_UPPER_UNIT 128 /* micro-second */ ··· 674 674 675 675 #define REG_USB_HRPWM 0xFE58 676 676 #define REG_USB_HCPWM 0xFE57 677 - /* 8192C Regsiter Bit and Content definition */ 677 + /* 8192C Register Bit and Content definition */ 678 678 /* 0x0000h ~ 0x00FFh System Configuration */ 679 679 680 680 /* 2 SYS_ISO_CTRL */ ··· 900 900 #define HQSEL_HIQ BIT(5) 901 901 902 902 /* For normal driver, 0x10C */ 903 - #define _TXDMA_HIQ_MAP(x) (((x)&0x3) << 14) 904 - #define _TXDMA_MGQ_MAP(x) (((x)&0x3) << 12) 905 - #define _TXDMA_BKQ_MAP(x) (((x)&0x3) << 10) 906 - #define _TXDMA_BEQ_MAP(x) (((x)&0x3) << 8 ) 907 - #define _TXDMA_VIQ_MAP(x) (((x)&0x3) << 6 ) 908 - #define _TXDMA_VOQ_MAP(x) (((x)&0x3) << 4 ) 903 + #define _TXDMA_HIQ_MAP(x) (((x) & 0x3) << 14) 904 + #define _TXDMA_MGQ_MAP(x) (((x) & 0x3) << 12) 905 + #define _TXDMA_BKQ_MAP(x) (((x) & 0x3) << 10) 906 + #define _TXDMA_BEQ_MAP(x) (((x) & 0x3) << 8) 907 + #define _TXDMA_VIQ_MAP(x) (((x) & 0x3) << 6) 908 + #define _TXDMA_VOQ_MAP(x) (((x) & 0x3) << 4) 909 909 910 910 #define QUEUE_LOW 1 911 911 #define QUEUE_NORMAL 2 ··· 1135 1135 #define EEPROM_Default_CrystalCap_88E 0x20 1136 1136 #define EEPROM_Default_ThermalMeter_88E 0x18 1137 1137 1138 - /* New EFUSE deafult value */ 1138 + /* New EFUSE default value */ 1139 1139 #define EEPROM_DEFAULT_24G_INDEX 0x2D 1140 1140 #define EEPROM_DEFAULT_24G_HT20_DIFF 0X02 1141 1141 #define EEPROM_DEFAULT_24G_OFDM_DIFF 0X04
+1 -1
drivers/staging/r8188eu/include/rtw_ap.h
··· 26 26 void sta_info_update(struct adapter *padapter, struct sta_info *psta); 27 27 u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta, 28 28 bool active, u16 reason); 29 - int rtw_sta_flush(struct adapter *padapter); 29 + void rtw_sta_flush(struct adapter *padapter); 30 30 void start_ap_mode(struct adapter *padapter); 31 31 void stop_ap_mode(struct adapter *padapter); 32 32 void update_bmc_sta(struct adapter *padapter);
+30 -41
drivers/staging/r8188eu/include/rtw_cmd.h
··· 6 6 7 7 #include "wlan_bssdef.h" 8 8 #include "rtw_rf.h" 9 - #include "rtw_led.h" 10 - 11 - #define C2H_MEM_SZ (16*1024) 12 9 13 10 #include "osdep_service.h" 14 11 #include "ieee80211.h" /* <ieee80211/ieee80211.h> */ 15 - 16 - #define FREE_CMDOBJ_SZ 128 17 12 18 13 #define MAX_CMDSZ 1024 19 14 #define MAX_RSPSZ 512 ··· 77 82 78 83 int rtw_cmd_thread(void *context); 79 84 80 - u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); 85 + int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv); 81 86 void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv); 82 87 83 - u32 rtw_init_evt_priv(struct evt_priv *pevtpriv); 88 + int rtw_init_evt_priv(struct evt_priv *pevtpriv); 84 89 void rtw_free_evt_priv(struct evt_priv *pevtpriv); 85 90 void rtw_evt_notify_isr(struct evt_priv *pevtpriv); 86 91 u8 p2p_protocol_wk_cmd(struct adapter *padapter, int intCmdType); ··· 440 445 u8 rfintfs; 441 446 }; 442 447 443 - struct Tx_Beacon_param 444 - { 448 + struct Tx_Beacon_param { 445 449 struct wlan_bssid_ex network; 446 450 }; 447 451 ··· 449 455 450 456 mac[0] == 0 451 457 ==> CMD mode, return H2C_SUCCESS. 452 - The following condition must be ture under CMD mode 458 + The following condition must be true under CMD mode 453 459 mac[1] == mac[4], mac[2] == mac[3], mac[0]=mac[5]= 0; 454 460 s0 == 0x1234, s1 == 0xabcd, w0 == 0x78563412, w1 == 0x5aa5def7; 455 461 s2 == (b1 << 8 | b0); ··· 502 508 unsigned char *pbuf; 503 509 }; 504 510 505 - /*------------------- Below are used for RF/BB tunning ---------------------*/ 511 + /*------------------- Below are used for RF/BB tuning ---------------------*/ 506 512 507 513 struct setantenna_parm { 508 514 u8 tx_antset; ··· 586 592 }; 587 593 588 594 struct getratable_parm { 589 - uint rsvd; 595 + uint rsvd; 590 596 }; 591 597 592 598 struct getratable_rsp { 593 - u8 ss_ForceUp[NumRates]; 594 - u8 ss_ULevel[NumRates]; 595 - u8 ss_DLevel[NumRates]; 596 - u8 count_judge[NumRates]; 599 + u8 ss_ForceUp[NumRates]; 600 + u8 ss_ULevel[NumRates]; 601 + u8 ss_DLevel[NumRates]; 602 + u8 count_judge[NumRates]; 597 603 }; 598 604 599 605 /* to get TX,RX retry count */ ··· 676 682 }; 677 683 678 684 /*H2C Handler index: 59 */ 679 - struct SetChannelPlan_param 680 - { 685 + struct SetChannelPlan_param { 681 686 u8 channel_plan; 682 687 }; 683 688 684 689 /*H2C Handler index: 60 */ 685 - struct LedBlink_param 686 - { 690 + struct LedBlink_param { 687 691 struct LED_871x *pLed; 688 692 }; 689 693 690 694 /*H2C Handler index: 61 */ 691 - struct SetChannelSwitch_param 692 - { 695 + struct SetChannelSwitch_param { 693 696 u8 new_ch_no; 694 697 }; 695 698 696 699 /*H2C Handler index: 62 */ 697 - struct TDLSoption_param 698 - { 700 + struct TDLSoption_param { 699 701 u8 addr[ETH_ALEN]; 700 702 u8 option; 701 703 }; ··· 720 730 #define H2C_CMD_OVERFLOW 0x06 721 731 #define H2C_RESERVED 0x07 722 732 723 - u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num); 724 - u8 rtw_createbss_cmd(struct adapter *padapter); 733 + u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid, int ssid_num); 734 + u8 rtw_createbss_cmd(struct adapter *padapter); 725 735 u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key); 726 736 u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue); 727 - u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork); 737 + u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork); 728 738 u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue); 729 - u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); 730 - u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); 731 - u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode); 739 + u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infra networktype); 740 + int rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset); 741 + u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode); 732 742 733 - u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset,u8 *pval); 734 - u8 rtw_setfwdig_cmd(struct adapter*padapter, u8 type); 735 - u8 rtw_setfwra_cmd(struct adapter*padapter, u8 type); 743 + u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset, u8 *pval); 744 + u8 rtw_setfwdig_cmd(struct adapter *padapter, u8 type); 745 + u8 rtw_setfwra_cmd(struct adapter *padapter, u8 type); 736 746 737 - u8 rtw_addbareq_cmd(struct adapter*padapter, u8 tid, u8 *addr); 747 + u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr); 738 748 739 749 u8 rtw_dynamic_chk_wk_cmd(struct adapter *adapter); 740 750 741 - u8 rtw_lps_ctrl_wk_cmd(struct adapter*padapter, u8 lps_ctrl_type, u8 enqueue); 742 - u8 rtw_rpt_timer_cfg_cmd(struct adapter*padapter, u16 minRptTime); 751 + u8 rtw_lps_ctrl_wk_cmd(struct adapter *padapter, u8 lps_ctrl_type, u8 enqueue); 752 + u8 rtw_rpt_timer_cfg_cmd(struct adapter *padapter, u16 minRptTime); 743 753 744 - u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue); 745 - u8 rtw_ps_cmd(struct adapter*padapter); 754 + u8 rtw_antenna_select_cmd(struct adapter *padapter, u8 antenna, u8 enqueue); 755 + u8 rtw_ps_cmd(struct adapter *padapter); 746 756 747 - u8 rtw_chk_hi_queue_cmd(struct adapter*padapter); 757 + u8 rtw_chk_hi_queue_cmd(struct adapter *padapter); 748 758 749 759 u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan); 750 760 ··· 849 859 #define _SetRFReg_CMD_ _Write_RFREG_CMD_ 850 860 851 861 #ifdef _RTW_CMD_C_ 852 - static struct _cmd_callback rtw_cmd_callback[] = 853 - { 862 + static struct _cmd_callback rtw_cmd_callback[] = { 854 863 {GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/ 855 864 {GEN_CMD_CODE(_Write_MACREG), NULL}, 856 865 {GEN_CMD_CODE(_Read_BBREG), &rtw_getbbrfreg_cmdrsp_callback},
+1 -15
drivers/staging/r8188eu/include/rtw_io.h
··· 209 209 }; 210 210 211 211 uint ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue); 212 - void sync_ioreq_enqueue(struct io_req *preq,struct io_queue *ioqueue); 212 + void sync_ioreq_enqueue(struct io_req *preq, struct io_queue *ioqueue); 213 213 uint sync_ioreq_flush(struct adapter *adapter, struct io_queue *ioqueue); 214 214 uint free_ioreq(struct io_req *preq, struct io_queue *pio_queue); 215 215 struct io_req *alloc_ioreq(struct io_queue *pio_q); ··· 284 284 void bus_sync_io(struct io_queue *pio_q); 285 285 u32 _ioreq2rwmem(struct io_queue *pio_q); 286 286 void dev_power_down(struct adapter *Adapter, u8 bpwrup); 287 - 288 - #define PlatformEFIOWrite1Byte(_a,_b,_c) \ 289 - rtw_write8(_a,_b,_c) 290 - #define PlatformEFIOWrite2Byte(_a,_b,_c) \ 291 - rtw_write16(_a,_b,_c) 292 - #define PlatformEFIOWrite4Byte(_a,_b,_c) \ 293 - rtw_write32(_a,_b,_c) 294 - 295 - #define PlatformEFIORead1Byte(_a,_b) \ 296 - rtw_read8(_a,_b) 297 - #define PlatformEFIORead2Byte(_a,_b) \ 298 - rtw_read16(_a,_b) 299 - #define PlatformEFIORead4Byte(_a,_b) \ 300 - rtw_read32(_a,_b) 301 287 302 288 #endif /* _RTL8711_IO_H_ */
+3 -3
drivers/staging/r8188eu/include/rtw_ioctl_set.h
··· 10 10 11 11 u8 rtw_set_802_11_authentication_mode(struct adapter *adapt, 12 12 enum ndis_802_11_auth_mode authmode); 13 - u8 rtw_set_802_11_bssid(struct adapter*adapter, u8 *bssid); 13 + u8 rtw_set_802_11_bssid(struct adapter *adapter, u8 *bssid); 14 14 u8 rtw_set_802_11_add_wep(struct adapter *adapter, struct ndis_802_11_wep *wep); 15 - u8 rtw_set_802_11_disassociate(struct adapter *adapter); 16 - u8 rtw_set_802_11_bssid_list_scan(struct adapter*adapter, 15 + void rtw_set_802_11_disassociate(struct adapter *adapter); 16 + u8 rtw_set_802_11_bssid_list_scan(struct adapter *adapter, 17 17 struct ndis_802_11_ssid *pssid, 18 18 int ssid_max_num); 19 19 u8 rtw_set_802_11_infrastructure_mode(struct adapter *adapter,
-3
drivers/staging/r8188eu/include/rtw_led.h
··· 33 33 }; 34 34 35 35 struct led_priv { 36 - struct adapter *padapter; 37 - 38 36 bool bRegUseLed; 39 37 40 38 enum LED_STATE_871x CurrLedState; /* Current LED state. */ ··· 45 47 46 48 u32 BlinkTimes; /* Number of times to toggle led state for blinking. */ 47 49 48 - bool bLedLinkBlinkInProgress; 49 50 bool bLedScanBlinkInProgress; 50 51 struct delayed_work blink_work; 51 52 };
+11 -18
drivers/staging/r8188eu/include/rtw_mlme.h
··· 101 101 102 102 struct profile_info { 103 103 u8 ssidlen; 104 - u8 ssid[ WLAN_SSID_MAXLEN ]; 105 - u8 peermac[ ETH_ALEN ]; 104 + u8 ssid[WLAN_SSID_MAXLEN]; 105 + u8 peermac[ETH_ALEN]; 106 106 }; 107 107 108 108 struct tx_invite_req_info { 109 109 u8 token; 110 110 u8 benable; 111 - u8 go_ssid[ WLAN_SSID_MAXLEN ]; 111 + u8 go_ssid[WLAN_SSID_MAXLEN]; 112 112 u8 ssidlen; 113 - u8 go_bssid[ ETH_ALEN ]; 114 - u8 peer_macaddr[ ETH_ALEN ]; 113 + u8 go_bssid[ETH_ALEN]; 114 + u8 peer_macaddr[ETH_ALEN]; 115 115 u8 operating_ch; /* This information will be set by using the 116 116 * p2p_set op_ch=x */ 117 117 u8 peer_ch; /* The listen channel for peer P2P device */ ··· 154 154 }; 155 155 156 156 struct group_id_info { 157 - u8 go_device_addr[ ETH_ALEN ]; /* The GO's device address of 157 + u8 go_device_addr[ETH_ALEN]; /* The GO's device address of 158 158 * this P2P group */ 159 - u8 ssid[ WLAN_SSID_MAXLEN ]; /* The SSID of this P2P group */ 159 + u8 ssid[WLAN_SSID_MAXLEN]; /* The SSID of this P2P group */ 160 160 }; 161 161 162 162 struct scan_limit_info { ··· 443 443 return false; 444 444 } 445 445 446 - static inline int get_fwstate(struct mlme_priv *pmlmepriv) 447 - { 448 - return pmlmepriv->fw_state; 449 - } 450 - 451 446 /* 452 447 * No Limit on the calling context, 453 448 * therefore set it to be the critical section... ··· 454 459 { 455 460 pmlmepriv->fw_state |= state; 456 461 /* FOR HW integration */ 457 - if (_FW_UNDER_SURVEY==state) 462 + if (_FW_UNDER_SURVEY == state) 458 463 pmlmepriv->bScanInProcess = true; 459 464 } 460 465 ··· 462 467 { 463 468 pmlmepriv->fw_state &= ~state; 464 469 /* FOR HW integration */ 465 - if (_FW_UNDER_SURVEY==state) 470 + if (_FW_UNDER_SURVEY == state) 466 471 pmlmepriv->bScanInProcess = false; 467 472 } 468 473 ··· 523 528 int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, 524 529 uint in_len); 525 530 int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, 526 - uint in_len, uint initial_out_len); 531 + uint in_len, uint initial_out_len); 527 532 void rtw_init_registrypriv_dev_network(struct adapter *adapter); 528 533 529 534 void rtw_update_registrypriv_dev_network(struct adapter *adapter); ··· 539 544 540 545 void _rtw_free_network(struct mlme_priv *pmlmepriv, 541 546 struct wlan_network *pnetwork, u8 isfreeall); 542 - void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, 543 - struct wlan_network *pnetwork); 544 547 545 - struct wlan_network* _rtw_find_network(struct __queue *scanned_queue, u8 *addr); 548 + struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr); 546 549 547 550 void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall); 548 551
+14 -44
drivers/staging/r8188eu/include/rtw_mlme_ext.h
··· 184 184 SCAN_STATE_MAX, 185 185 }; 186 186 187 - typedef unsigned int (*mlme_handler)(struct adapter *adapt, struct recv_frame *frame); 187 + typedef void (*mlme_handler)(struct adapter *adapt, struct recv_frame *frame); 188 188 189 189 struct ss_res { 190 190 int state; ··· 285 285 u8 bwmode_updated; 286 286 u8 hidden_ssid_mode; 287 287 288 - struct ADDBA_request ADDBA_req; 289 288 struct WMM_para_element WMM_param; 290 289 struct HT_caps_element HT_caps; 291 290 struct HT_info_element HT_info; ··· 387 388 void init_mlme_ext_priv(struct adapter *adapter); 388 389 int init_hw_mlme_ext(struct adapter *padapter); 389 390 void free_mlme_ext_priv (struct mlme_ext_priv *pmlmeext); 390 - extern struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv); 391 + struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv); 391 392 392 393 unsigned char networktype_to_raid(unsigned char network_type); 393 394 u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int len); ··· 431 432 u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork); 432 433 u16 get_beacon_interval(struct wlan_bssid_ex *bss); 433 434 434 - int is_client_associated_to_ap(struct adapter *padapter); 435 - int is_client_associated_to_ibss(struct adapter *padapter); 436 - int is_IBSS_empty(struct adapter *padapter); 435 + bool r8188eu_is_client_associated_to_ap(struct adapter *padapter); 436 + bool r8188eu_is_client_associated_to_ibss(struct adapter *padapter); 437 + bool r8188eu_is_ibss_empty(struct adapter *padapter); 437 438 438 439 unsigned char check_assoc_AP(u8 *pframe, uint len); 439 440 ··· 447 448 void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE); 448 449 void VCS_update(struct adapter *padapter, struct sta_info *psta); 449 450 450 - void update_beacon_info(struct adapter *padapter, u8 *pframe, uint len, 451 - struct sta_info *psta); 451 + void update_beacon_info(struct adapter *padapter, u8 *ie_ptr, uint ie_len, struct sta_info *psta); 452 452 int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len); 453 453 void update_IOT_info(struct adapter *padapter); 454 454 void update_capinfo(struct adapter *adapter, u16 updatecap); ··· 477 479 void report_surveydone_event(struct adapter *padapter); 478 480 void report_del_sta_event(struct adapter *padapter, 479 481 unsigned char *addr, unsigned short reason); 480 - void report_add_sta_event(struct adapter *padapter, unsigned char* addr, 482 + void report_add_sta_event(struct adapter *padapter, unsigned char *addr, 481 483 int cam_idx); 482 484 483 485 void beacon_timing_control(struct adapter *padapter); 484 - extern u8 set_tx_beacon_cmd(struct adapter*padapter); 486 + u8 set_tx_beacon_cmd(struct adapter *padapter); 485 487 unsigned int setup_beacon_frame(struct adapter *padapter, 486 488 unsigned char *beacon_frame); 487 489 void update_mgnt_tx_rate(struct adapter *padapter, u8 rate); ··· 497 499 void issue_p2p_provision_request(struct adapter *padapter, u8 *pssid, 498 500 u8 ussidlen, u8 *pdev_raddr); 499 501 void issue_p2p_GO_request(struct adapter *padapter, u8 *raddr); 500 - void issue_probereq_p2p(struct adapter *padapter, u8 *da); 502 + void issue_probereq_p2p(struct adapter *padapter); 501 503 void issue_p2p_invitation_response(struct adapter *padapter, u8 *raddr, 502 504 u8 dialogToken, u8 success); 503 - void issue_p2p_invitation_request(struct adapter *padapter, u8* raddr); 505 + void issue_p2p_invitation_request(struct adapter *padapter, u8 *raddr); 504 506 void issue_beacon(struct adapter *padapter, int timeout_ms); 505 507 void issue_probersp(struct adapter *padapter, unsigned char *da, 506 508 u8 is_valid_p2p_probereq); ··· 511 513 unsigned short status); 512 514 void issue_probereq(struct adapter *padapter, struct ndis_802_11_ssid *pssid, 513 515 u8 *da); 514 - s32 issue_probereq_ex(struct adapter *adapter, struct ndis_802_11_ssid *pssid, 515 - u8* da, int try_cnt, int wait_ms); 516 + void issue_probereq_ex(struct adapter *padapter, struct ndis_802_11_ssid *pssid, u8 *da); 516 517 int issue_nulldata(struct adapter *padapter, unsigned char *da, 517 518 unsigned int power_mode, int try_cnt, int wait_ms); 518 519 int issue_qos_nulldata(struct adapter *padapter, unsigned char *da, ··· 520 523 unsigned short reason); 521 524 int issue_deauth_ex(struct adapter *padapter, u8 *da, unsigned short reason, 522 525 int try_cnt, int wait_ms); 523 - void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, u16 status); 526 + void issue_action_BA(struct adapter *padapter, unsigned char *raddr, u8 action, 527 + u16 status, struct ieee80211_mgmt *mgmt_req); 524 528 unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr); 525 529 unsigned int send_beacon(struct adapter *padapter); 526 530 bool get_beacon_valid_bit(struct adapter *adapter); ··· 533 535 void start_clnt_auth(struct adapter *padapter); 534 536 void start_clnt_join(struct adapter *padapter); 535 537 void start_create_ibss(struct adapter *padapter); 536 - 537 - unsigned int OnAssocReq(struct adapter *padapter, 538 - struct recv_frame *precv_frame); 539 - unsigned int OnAssocRsp(struct adapter *padapter, 540 - struct recv_frame *precv_frame); 541 - unsigned int OnProbeReq(struct adapter *padapter, 542 - struct recv_frame *precv_frame); 543 - unsigned int OnProbeRsp(struct adapter *padapter, 544 - struct recv_frame *precv_frame); 545 - unsigned int OnBeacon(struct adapter *padapter, 546 - struct recv_frame *precv_frame); 547 - unsigned int OnDisassoc(struct adapter *padapter, 548 - struct recv_frame *precv_frame); 549 - unsigned int OnAuth(struct adapter *padapter, 550 - struct recv_frame *precv_frame); 551 - unsigned int OnAuthClient(struct adapter *padapter, 552 - struct recv_frame *precv_frame); 553 - unsigned int OnDeAuth(struct adapter *padapter, 554 - struct recv_frame *precv_frame); 555 - unsigned int OnAction(struct adapter *padapter, 556 - struct recv_frame *precv_frame); 557 - 558 - unsigned int OnAction_back(struct adapter *padapter, 559 - struct recv_frame *precv_frame); 560 - unsigned int on_action_public(struct adapter *padapter, 561 - struct recv_frame *precv_frame); 562 - unsigned int OnAction_p2p(struct adapter *padapter, 563 - struct recv_frame *precv_frame); 564 538 565 539 void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res); 566 540 void mlmeext_sta_del_event_callback(struct adapter *padapter); ··· 699 729 GEN_EVT_CODE(_Survey), /*8*/ 700 730 GEN_EVT_CODE(_SurveyDone), /*9*/ 701 731 702 - GEN_EVT_CODE(_JoinBss) , /*10*/ 732 + GEN_EVT_CODE(_JoinBss), /*10*/ 703 733 GEN_EVT_CODE(_AddSTA), 704 734 GEN_EVT_CODE(_DelSTA), 705 735 GEN_EVT_CODE(_AtimDone),
+2 -2
drivers/staging/r8188eu/include/rtw_recv.h
··· 92 92 u8 privacy; /* in frame_ctrl field */ 93 93 u8 bdecrypted; 94 94 u8 encrypt; /* when 0 indicate no encrypt. when non-zero, 95 - * indicate the encrypt algorith */ 95 + * indicate the encrypt algorithm */ 96 96 u8 iv_len; 97 97 u8 icv_len; 98 98 u8 crc_err; ··· 175 175 u8 *precv_buf; /* 4 alignment */ 176 176 struct __queue free_recv_buf_queue; 177 177 u32 free_recv_buf_queue_cnt; 178 - /* For display the phy informatiom */ 178 + /* For display the phy information */ 179 179 u8 is_signal_dbg; /* for debug */ 180 180 u8 signal_strength_dbg; /* for debug */ 181 181 s8 rssi;
+2 -2
drivers/staging/r8188eu/include/rtw_xmit.h
··· 116 116 u32 last_txcmdsz; 117 117 u8 nr_frags; 118 118 u8 encrypt; /* when 0 indicate no encrypt. when non-zero, 119 - * indicate the encrypt algorith */ 119 + * indicate the encrypt algorithm */ 120 120 u8 iv_len; 121 121 u8 icv_len; 122 122 u8 iv[18]; ··· 351 351 s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, 352 352 struct pkt_attrib *pattrib); 353 353 void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry); 354 - s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter); 354 + int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter); 355 355 void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv); 356 356 int rtw_alloc_hwxmits(struct adapter *padapter); 357 357 void rtw_free_hwxmits(struct adapter *padapter);
+9 -9
drivers/staging/r8188eu/include/sta_info.h
··· 295 295 return x; 296 296 } 297 297 298 - extern u32 _rtw_init_sta_priv(struct sta_priv *pstapriv); 299 - extern void _rtw_free_sta_priv(struct sta_priv *pstapriv); 298 + int _rtw_init_sta_priv(struct sta_priv *pstapriv); 299 + void _rtw_free_sta_priv(struct sta_priv *pstapriv); 300 300 301 301 #define stainfo_offset_valid(offset) (offset < NUM_STA && offset >= 0) 302 302 int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta); 303 303 struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int off); 304 304 305 - extern struct sta_info *rtw_alloc_stainfo(struct sta_priv *stapriv, u8 *hwaddr); 306 - extern u32 rtw_free_stainfo(struct adapter *adapt, struct sta_info *psta); 307 - extern void rtw_free_all_stainfo(struct adapter *adapt); 308 - extern struct sta_info *rtw_get_stainfo(struct sta_priv *stapriv, u8 *hwaddr); 309 - extern u32 rtw_init_bcmc_stainfo(struct adapter *adapt); 310 - extern struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter); 311 - extern u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr); 305 + struct sta_info *rtw_alloc_stainfo(struct sta_priv *stapriv, u8 *hwaddr); 306 + void rtw_free_stainfo(struct adapter *adapt, struct sta_info *psta); 307 + void rtw_free_all_stainfo(struct adapter *adapt); 308 + struct sta_info *rtw_get_stainfo(struct sta_priv *stapriv, u8 *hwaddr); 309 + u32 rtw_init_bcmc_stainfo(struct adapter *adapt); 310 + struct sta_info *rtw_get_bcmc_stainfo(struct adapter *padapter); 311 + u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr); 312 312 313 313 #endif /* _STA_INFO_H_ */
+6 -71
drivers/staging/r8188eu/include/wifi.h
··· 140 140 #define _PWRMGT_ BIT(12) 141 141 #define _MORE_DATA_ BIT(13) 142 142 #define _PRIVACY_ BIT(14) 143 - #define _ORDER_ BIT(15) 144 143 145 144 #define SetToDs(pbuf) \ 146 145 *(__le16 *)(pbuf) |= cpu_to_le16(_TO_DS_) ··· 170 171 #define SetPrivacy(pbuf) \ 171 172 *(__le16 *)(pbuf) |= cpu_to_le16(_PRIVACY_) 172 173 173 - #define GetPrivacy(pbuf) \ 174 - (((*(__le16 *)(pbuf)) & cpu_to_le16(_PRIVACY_)) != 0) 175 - 176 174 #define GetFrameType(pbuf) \ 177 175 (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2))) 178 176 ··· 181 185 *(__le16 *)(pbuf) &= cpu_to_le16(~(BIT(7) | BIT(6) | \ 182 186 BIT(5) | BIT(4) | BIT(3) | BIT(2))); \ 183 187 *(__le16 *)(pbuf) |= cpu_to_le16(type); \ 184 - } while (0) 185 - 186 - #define GetTupleCache(pbuf) \ 187 - (cpu_to_le16(*(unsigned short *)((size_t)(pbuf) + 22))) 188 - 189 - #define SetFragNum(pbuf, num) \ 190 - do { \ 191 - *(unsigned short *)((size_t)(pbuf) + 22) = \ 192 - ((*(unsigned short *)((size_t)(pbuf) + 22)) & \ 193 - le16_to_cpu(~(0x000f))) | \ 194 - cpu_to_le16(0x0f & (num)); \ 195 188 } while (0) 196 189 197 190 #define SetSeqNum(pbuf, num) \ ··· 206 221 207 222 #define GetAMsdu(pbuf) (((le16_to_cpu(*(__le16 *)pbuf)) >> 7) & 0x1) 208 223 209 - #define SetAMsdu(pbuf, amsdu) \ 210 - *(__le16 *)(pbuf) |= cpu_to_le16((amsdu & 1) << 7) 211 - 212 - #define GetTid(pbuf) (le16_to_cpu(*(__le16 *)((size_t)(pbuf) + \ 213 - (((GetToDs(pbuf)<<1) | GetFrDs(pbuf)) == 3 ? \ 214 - 30 : 24))) & 0x000f) 215 - 216 224 #define GetAddr1Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 4)) 217 225 218 226 #define GetAddr2Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 10)) ··· 213 235 #define GetAddr3Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 16)) 214 236 215 237 #define GetAddr4Ptr(pbuf) ((unsigned char *)((size_t)(pbuf) + 24)) 216 - 217 - static inline bool IS_MCAST(unsigned char *da) 218 - { 219 - return (*da) & 0x01; 220 - } 221 - 222 - static inline unsigned char *get_da(unsigned char *pframe) 223 - { 224 - unsigned char *da; 225 - unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); 226 - 227 - switch (to_fr_ds) { 228 - case 0x00: /* ToDs=0, FromDs=0 */ 229 - da = GetAddr1Ptr(pframe); 230 - break; 231 - case 0x01: /* ToDs=0, FromDs=1 */ 232 - da = GetAddr1Ptr(pframe); 233 - break; 234 - case 0x02: /* ToDs=1, FromDs=0 */ 235 - da = GetAddr3Ptr(pframe); 236 - break; 237 - default: /* ToDs=1, FromDs=1 */ 238 - da = GetAddr3Ptr(pframe); 239 - break; 240 - } 241 - return da; 242 - } 243 238 244 239 static inline unsigned char *get_sa(unsigned char *pframe) 245 240 { ··· 366 415 Below is the definition for 802.11n 367 416 ------------------------------------------------------------------------------*/ 368 417 369 - #define SetOrderBit(pbuf) \ 370 - do { \ 371 - *(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \ 372 - } while (0) 373 - 374 - #define GetOrderBit(pbuf) \ 375 - (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0) 376 - 377 418 /** 378 419 * struct rtw_ieee80211_bar - HT Block Ack Request 379 420 * ··· 425 482 unsigned char QoS_info; 426 483 unsigned char reserved; 427 484 struct AC_param ac_param[4]; 428 - } __packed; 429 - 430 - struct ADDBA_request { 431 - unsigned char action_code; 432 - unsigned char dialog_token; 433 - __le16 BA_para_set; 434 - __le16 BA_timeout_value; 435 - __le16 BA_starting_seqctrl; 436 485 } __packed; 437 486 438 487 #define MAX_AMPDU_FACTOR_64K 3 ··· 636 701 637 702 #define P2P_WILDCARD_SSID_LEN 7 638 703 639 - /* default value, used when: (1)p2p disabed or (2)p2p enabled 704 + /* default value, used when: (1)p2p disabled or (2)p2p enabled 640 705 * but only do 1 scan phase */ 641 706 #define P2P_FINDPHASE_EX_NONE 0 642 707 /* used when p2p enabled and want to do 1 scan phase and ··· 701 766 P2P_STATE_TX_PROVISION_DIS_REQ = 6, 702 767 P2P_STATE_RX_PROVISION_DIS_RSP = 7, 703 768 P2P_STATE_RX_PROVISION_DIS_REQ = 8, 704 - /* Doing the group owner negoitation handshake */ 769 + /* Doing the group owner negotiation handshake */ 705 770 P2P_STATE_GONEGO_ING = 9, 706 - /* finish the group negoitation handshake with success */ 771 + /* finish the group negotiation handshake with success */ 707 772 P2P_STATE_GONEGO_OK = 10, 708 - /* finish the group negoitation handshake with failure */ 773 + /* finish the group negotiation handshake with failure */ 709 774 P2P_STATE_GONEGO_FAIL = 11, 710 775 /* receiving the P2P Inviation request and match with the profile. */ 711 776 P2P_STATE_RECV_INVITE_REQ_MATCH = 12, ··· 725 790 P2P_STATE_RECV_INVITE_REQ_JOIN = 19, 726 791 /* recveing the P2P Inviation response with failure */ 727 792 P2P_STATE_RX_INVITE_RESP_FAIL = 20, 728 - /* receiving p2p negoitation response with information is not available */ 793 + /* receiving p2p negotiation response with information is not available */ 729 794 P2P_STATE_RX_INFOR_NOREADY = 21, 730 - /* sending p2p negoitation response with information is not available */ 795 + /* sending p2p negotiation response with information is not available */ 731 796 P2P_STATE_TX_INFOR_NOREADY = 22, 732 797 }; 733 798
-51
drivers/staging/r8188eu/include/wlan_bssdef.h
··· 17 17 u8 Ssid[32]; 18 18 }; 19 19 20 - enum NDIS_802_11_NETWORK_TYPE { 21 - Ndis802_11FH, 22 - Ndis802_11DS, 23 - Ndis802_11OFDM5, 24 - Ndis802_11OFDM24, 25 - Ndis802_11NetworkTypeMax /* dummy upper bound */ 26 - }; 27 - 28 20 struct ndis_802_11_config_fh { 29 21 u32 Length; /* Length of structure */ 30 22 u32 HopPattern; /* As defined by 802.11, MSB set */ ··· 177 185 /* MIC check time, 60 seconds. */ 178 186 #define MIC_CHECK_TIME 60000000 179 187 180 - struct ndis_802_11_auth_evt { 181 - struct ndis_802_11_status_ind Status; 182 - struct ndis_802_11_auth_req Request[1]; 183 - }; 184 - 185 - struct ndis_802_11_test { 186 - u32 Length; 187 - u32 Type; 188 - union { 189 - struct ndis_802_11_auth_evt AuthenticationEvent; 190 - NDIS_802_11_RSSI RssiTrigger; 191 - } tt; 192 - }; 193 - 194 188 #ifndef Ndis802_11APMode 195 189 #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1) 196 190 #endif ··· 211 233 struct ndis_802_11_ssid Ssid; 212 234 u32 Privacy; 213 235 NDIS_802_11_RSSI Rssi;/* in dBM,raw data ,get from PHY) */ 214 - enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; 215 236 struct ndis_802_11_config Configuration; 216 237 enum ndis_802_11_network_infra InfrastructureMode; 217 238 unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX]; ··· 264 287 265 288 #define NUM_PRE_AUTH_KEY 16 266 289 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY 267 - 268 - /* 269 - * WPA2 270 - */ 271 - 272 - struct pmkid_candidate { 273 - unsigned char BSSID[ETH_ALEN]; 274 - u32 Flags; 275 - }; 276 - 277 - struct ndis_802_11_pmkid_list { 278 - u32 Version; /* Version of the structure */ 279 - u32 NumCandidates; /* No. of pmkid candidates */ 280 - struct pmkid_candidate CandidateList[1]; 281 - }; 282 - 283 - struct ndis_802_11_auth_encrypt { 284 - enum ndis_802_11_auth_mode AuthModeSupported; 285 - enum ndis_802_11_wep_status EncryptStatusSupported; 286 - }; 287 - 288 - struct ndis_802_11_cap { 289 - u32 Length; 290 - u32 Version; 291 - u32 NoOfPMKIDs; 292 - u32 NoOfAuthEncryptPairsSupported; 293 - struct ndis_802_11_auth_encrypt AuthenticationEncryptionSupported[1]; 294 - }; 295 290 296 291 u8 key_2char2num(u8 hch, u8 lch); 297 292 u8 key_char2num(u8 ch);
+10 -18
drivers/staging/r8188eu/os_dep/ioctl_linux.c
··· 1011 1011 struct iw_request_info *info, 1012 1012 union iwreq_data *wrqu, char *extra) 1013 1013 { 1014 - int ret = 0; 1015 1014 struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 1016 1015 struct iw_mlme *mlme = (struct iw_mlme *)extra; 1017 1016 ··· 1019 1020 1020 1021 switch (mlme->cmd) { 1021 1022 case IW_MLME_DEAUTH: 1022 - if (!rtw_set_802_11_disassociate(padapter)) 1023 - ret = -1; 1023 + rtw_set_802_11_disassociate(padapter); 1024 1024 break; 1025 1025 case IW_MLME_DISASSOC: 1026 - if (!rtw_set_802_11_disassociate(padapter)) 1027 - ret = -1; 1026 + rtw_set_802_11_disassociate(padapter); 1028 1027 break; 1029 1028 default: 1030 1029 return -EOPNOTSUPP; 1031 1030 } 1032 - return ret; 1031 + return 0; 1033 1032 } 1034 1033 1035 1034 static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a, ··· 1337 1340 struct iw_request_info *a, 1338 1341 union iwreq_data *wrqu, char *extra) 1339 1342 { 1340 - int i, ret = 0; 1343 + int i; 1341 1344 struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 1342 1345 u8 datarates[NumRates]; 1343 1346 u32 target_rate = wrqu->bitrate.value; ··· 1405 1408 } 1406 1409 } 1407 1410 1408 - if (rtw_setdatarate_cmd(padapter, datarates) != _SUCCESS) 1409 - ret = -1; 1410 - 1411 - return ret; 1411 + return rtw_setdatarate_cmd(padapter, datarates); 1412 1412 } 1413 1413 1414 1414 static int rtw_wx_get_rate(struct net_device *dev, ··· 2641 2647 u32 peer_channel = 0; 2642 2648 2643 2649 /* Commented by Albert 20110304 */ 2644 - /* The input data contains two informations. */ 2650 + /* The input data contains two information. */ 2645 2651 /* 1. First information is the MAC address which wants to formate with */ 2646 2652 /* 2. Second information is the WPS PINCode or "pbc" string for push button method */ 2647 2653 /* Format: 00:E0:4C:00:00:05 */ ··· 2715 2721 uint p2pielen = 0, attr_contentlen = 0; 2716 2722 struct tx_invite_req_info *pinvite_req_info = &pwdinfo->invitereq_info; 2717 2723 2718 - /* The input data contains two informations. */ 2724 + /* The input data contains two information items. */ 2719 2725 /* 1. First information is the P2P device address which you want to send to. */ 2720 2726 /* 2. Second information is the group id which combines with GO's mac address, space and GO's ssid. */ 2721 2727 /* Command line sample: iwpriv wlan0 p2p_set invite ="00:11:22:33:44:55 00:E0:4C:00:00:05 DIRECT-xy" */ ··· 2839 2845 u8 *p2pie; 2840 2846 uint p2pielen = 0, attr_contentlen = 0; 2841 2847 2842 - /* The input data contains two informations. */ 2848 + /* The input data contains two information items. */ 2843 2849 /* 1. First information is the MAC address which wants to issue the provisioning discovery request frame. */ 2844 2850 /* 2. Second information is the WPS configuration method which wants to discovery */ 2845 2851 /* Format: 00:E0:4C:00:00:05_display */ ··· 2973 2979 struct iw_request_info *info, 2974 2980 union iwreq_data *wrqu, char *extra) 2975 2981 { 2976 - int ret = 0; 2977 - 2978 2982 if (!memcmp(extra, "enable =", 7)) { 2979 2983 rtw_wext_p2p_enable(dev, info, wrqu, &extra[7]); 2980 2984 } else if (!memcmp(extra, "setDN =", 6)) { ··· 3019 3027 rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]); 3020 3028 } 3021 3029 3022 - return ret; 3030 + return 0; 3023 3031 } 3024 3032 3025 3033 static int rtw_p2p_get2(struct net_device *dev, ··· 3560 3568 3561 3569 if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) && 3562 3570 (!memcmp(&probereq_wpsie[2], wps_oui, 4))) { 3563 - cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len; 3571 + cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN); 3564 3572 3565 3573 pmlmepriv->wps_probe_req_ie_len = 0; 3566 3574 kfree(pmlmepriv->wps_probe_req_ie);
+15 -26
drivers/staging/r8188eu/os_dep/os_intfs.c
··· 363 363 return pnetdev; 364 364 } 365 365 366 - u32 rtw_start_drv_threads(struct adapter *padapter) 366 + int rtw_start_drv_threads(struct adapter *padapter) 367 367 { 368 - u32 _status = _SUCCESS; 369 - 370 368 padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD"); 371 369 if (IS_ERR(padapter->cmdThread)) 372 - _status = _FAIL; 373 - else 374 - /* wait for rtw_cmd_thread() to start running */ 375 - wait_for_completion(&padapter->cmdpriv.start_cmd_thread); 370 + return PTR_ERR(padapter->cmdThread); 376 371 377 - return _status; 372 + /* wait for rtw_cmd_thread() to start running */ 373 + wait_for_completion(&padapter->cmdpriv.start_cmd_thread); 374 + 375 + return 0; 378 376 } 379 377 380 378 void rtw_stop_drv_threads(struct adapter *padapter) ··· 405 407 pmlmepriv->htpriv.ampdu_enable = false;/* set to disabled */ 406 408 407 409 /* security_priv */ 408 - psecuritypriv->binstallGrpkey = _FAIL; 410 + psecuritypriv->binstallGrpkey = false; 409 411 psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt; 410 412 psecuritypriv->sw_decrypt = pregistrypriv->software_decrypt; 411 413 psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */ ··· 431 433 padapter->bShowGetP2PState = 1; 432 434 } 433 435 434 - u8 rtw_reset_drv_sw(struct adapter *padapter) 436 + void rtw_reset_drv_sw(struct adapter *padapter) 435 437 { 436 438 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 437 439 ··· 453 455 padapter->mlmeextpriv.sitesurvey_res.state = SCAN_DISABLE; 454 456 455 457 rtw_set_signal_stat_timer(&padapter->recvpriv); 456 - 457 - return _SUCCESS; 458 458 } 459 459 460 460 u8 rtw_init_drv_sw(struct adapter *padapter) 461 461 { 462 - if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) { 462 + if (rtw_init_cmd_priv(&padapter->cmdpriv)) { 463 463 dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_cmd_priv failed\n"); 464 464 return _FAIL; 465 465 } 466 466 467 467 padapter->cmdpriv.padapter = padapter; 468 468 469 - if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) { 469 + if (rtw_init_evt_priv(&padapter->evtpriv)) { 470 470 dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_evt_priv failed\n"); 471 471 goto free_cmd_priv; 472 472 } 473 473 474 - if (rtw_init_mlme_priv(padapter) == _FAIL) { 474 + if (rtw_init_mlme_priv(padapter)) { 475 475 dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_mlme_priv failed\n"); 476 476 goto free_evt_priv; 477 477 } ··· 480 484 481 485 init_mlme_ext_priv(padapter); 482 486 483 - if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) { 487 + if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter)) { 484 488 dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_xmit_priv failed\n"); 485 489 goto free_mlme_ext; 486 490 } ··· 490 494 goto free_xmit_priv; 491 495 } 492 496 493 - if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) { 497 + if (_rtw_init_sta_priv(&padapter->stapriv)) { 494 498 dev_err(dvobj_to_dev(padapter->dvobj), "_rtw_init_sta_priv failed\n"); 495 499 goto free_recv_priv; 496 500 } ··· 546 550 _cancel_timer_ex(&padapter->recvpriv.signal_stat_timer); 547 551 } 548 552 549 - u8 rtw_free_drv_sw(struct adapter *padapter) 553 + void rtw_free_drv_sw(struct adapter *padapter) 550 554 { 551 555 /* we can call rtw_p2p_enable here, but: */ 552 556 /* 1. rtw_p2p_enable may have IO operation */ ··· 583 587 /* clear pbuddystruct adapter to avoid access wrong pointer. */ 584 588 if (padapter->pbuddy_adapter) 585 589 padapter->pbuddy_adapter->pbuddy_adapter = NULL; 586 - 587 - return _SUCCESS; 588 590 } 589 591 590 592 void netdev_br_init(struct net_device *netdev) ··· 618 624 if (!padapter->bup) { 619 625 padapter->bDriverStopped = false; 620 626 padapter->bSurpriseRemoved = false; 621 - padapter->bCardDisableWOHSM = false; 622 627 623 628 status = rtw_hal_init(padapter); 624 629 if (status == _FAIL) ··· 625 632 626 633 netdev_dbg(pnetdev, "MAC Address = %pM\n", pnetdev->dev_addr); 627 634 628 - status = rtw_start_drv_threads(padapter); 629 - if (status == _FAIL) { 635 + if (rtw_start_drv_threads(padapter)) { 630 636 pr_info("Initialize driver software resource Failed!\n"); 631 637 goto netdev_open_error; 632 638 } ··· 682 690 683 691 padapter->bDriverStopped = false; 684 692 padapter->bSurpriseRemoved = false; 685 - padapter->bCardDisableWOHSM = false; 686 693 687 694 status = rtw_hal_init(padapter); 688 695 if (status == _FAIL) ··· 713 722 714 723 void rtw_ips_pwr_down(struct adapter *padapter) 715 724 { 716 - padapter->bCardDisableWOHSM = true; 717 725 padapter->net_closed = true; 718 726 719 727 rtw_led_control(padapter, LED_CTL_POWER_OFF); 720 728 721 729 rtw_ips_dev_unload(padapter); 722 - padapter->bCardDisableWOHSM = false; 723 730 } 724 731 725 732 static void rtw_fifo_cleanup(struct adapter *adapter)
+17 -1
drivers/staging/rtl8192e/TODO
··· 1 - * merge into drivers/net/wireless/rtllib/rtl8192e 1 + To-do list: 2 + 3 + * merge into drivers/net/wireless/realtek/rtlwifi/rtl8192* 2 4 * clean up function naming 5 + * Correct the coding style according to Linux guidelines; please read the document 6 + at https://www.kernel.org/doc/html/latest/process/coding-style.html. 7 + * Remove unnecessary debugging/printing macros; for those that are still needed 8 + use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()). 9 + * Remove dead code such as unusued functions, variables, fields, etc.. 10 + * Use in-kernel API and remove unnecessary wrappers where possible. 11 + * Fix bugs due to code that sleeps in atomic context. 12 + * Remove the HAL layer and migrate its functionality into the relevant parts of 13 + the driver. 14 + * Switch to use LIB80211. 15 + * Switch to use MAC80211. 16 + * Switch to use CFG80211. 17 + * Improve the error handling of various functions, particularly those that use 18 + existing kernel APIs.
-15
drivers/staging/rtl8192e/rtl8192e/r8190P_def.h
··· 154 154 155 155 }; 156 156 157 - struct log_int_8190 { 158 - u32 nIMR_COMDOK; 159 - u32 nIMR_MGNTDOK; 160 - u32 nIMR_HIGH; 161 - u32 nIMR_VODOK; 162 - u32 nIMR_VIDOK; 163 - u32 nIMR_BEDOK; 164 - u32 nIMR_BKDOK; 165 - u32 nIMR_ROK; 166 - u32 nIMR_RCOK; 167 - u32 nIMR_TBDOK; 168 - u32 nIMR_BDOK; 169 - u32 nIMR_RXFOVW; 170 - }; 171 - 172 157 struct phy_ofdm_rx_status_rxsc_sgien_exintfflag { 173 158 u8 reserved:4; 174 159 u8 rxsc:2;
+22 -33
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
··· 224 224 u8 acm = pAciAifsn->f.acm; 225 225 u8 AcmCtrl = rtl92e_readb(dev, AcmHwCtrl); 226 226 227 - AcmCtrl = AcmCtrl | ((priv->AcmMethod == 2) ? 0x0 : 0x1); 228 - 229 227 if (acm) { 230 228 switch (eACI) { 231 229 case AC0_BE: ··· 472 474 473 475 priv->rf_chip = RF_8256; 474 476 475 - if (priv->RegChannelPlan == 0xf) 477 + if (priv->reg_chnl_plan == 0xf) 476 478 priv->ChannelPlan = priv->eeprom_ChannelPlan; 477 479 else 478 - priv->ChannelPlan = priv->RegChannelPlan; 480 + priv->ChannelPlan = priv->reg_chnl_plan; 479 481 480 482 if (priv->eeprom_vid == 0x1186 && priv->eeprom_did == 0x3304) 481 483 priv->CustomerID = RT_CID_DLINK; ··· 501 503 priv->ChannelPlan = 0x0; 502 504 break; 503 505 case EEPROM_CID_Nettronix: 504 - priv->ScanDelay = 100; 505 506 priv->CustomerID = RT_CID_Nettronix; 506 507 break; 507 508 case EEPROM_CID_Pronet: ··· 615 618 start: 616 619 rtl92e_reset_desc_ring(dev); 617 620 priv->Rf_Mode = RF_OP_By_SW_3wire; 618 - if (priv->ResetProgress == RESET_TYPE_NORESET) { 621 + if (priv->rst_progress == RESET_TYPE_NORESET) { 619 622 rtl92e_writeb(dev, ANAPAR, 0x37); 620 623 mdelay(500); 621 624 } 622 625 priv->pFirmware->status = FW_STATUS_0_INIT; 623 - 624 - if (priv->RegRfOff) 625 - priv->rtllib->rf_power_state = rf_off; 626 626 627 627 ulRegRead = rtl92e_readl(dev, CPU_GEN); 628 628 if (priv->pFirmware->status == FW_STATUS_0_INIT) ··· 648 654 } 649 655 650 656 priv->LoopbackMode = RTL819X_NO_LOOPBACK; 651 - if (priv->ResetProgress == RESET_TYPE_NORESET) { 657 + if (priv->rst_progress == RESET_TYPE_NORESET) { 652 658 ulRegRead = rtl92e_readl(dev, CPU_GEN); 653 659 if (priv->LoopbackMode == RTL819X_NO_LOOPBACK) 654 660 ulRegRead = (ulRegRead & CPU_GEN_NO_LOOPBACK_MSK) | ··· 697 703 698 704 rtl92e_writeb(dev, ACK_TIMEOUT, 0x30); 699 705 700 - if (priv->ResetProgress == RESET_TYPE_NORESET) 706 + if (priv->rst_progress == RESET_TYPE_NORESET) 701 707 rtl92e_set_wireless_mode(dev, priv->rtllib->mode); 702 708 rtl92e_cam_reset(dev); 703 709 { ··· 737 743 } 738 744 } 739 745 740 - if (priv->ResetProgress == RESET_TYPE_NORESET) { 746 + if (priv->rst_progress == RESET_TYPE_NORESET) { 741 747 rtStatus = rtl92e_config_phy(dev); 742 748 if (!rtStatus) { 743 749 netdev_info(dev, "RF Config failed\n"); ··· 750 756 751 757 rtl92e_writeb(dev, 0x87, 0x0); 752 758 753 - if (priv->RegRfOff) { 754 - rtl92e_set_rf_state(dev, rf_off, RF_CHANGE_BY_SW); 755 - } else if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_PS) { 759 + if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_PS) { 756 760 rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason); 757 761 } else if (priv->rtllib->rf_off_reason >= RF_CHANGE_BY_IPS) { 758 762 rtl92e_set_rf_state(dev, rf_off, priv->rtllib->rf_off_reason); ··· 764 772 else 765 773 priv->Rf_Mode = RF_OP_By_SW_3wire; 766 774 767 - if (priv->ResetProgress == RESET_TYPE_NORESET) { 775 + if (priv->rst_progress == RESET_TYPE_NORESET) { 768 776 rtl92e_dm_init_txpower_tracking(dev); 769 777 770 778 if (priv->IC_Cut >= IC_VersionCut_D) { ··· 793 801 } 794 802 priv->CCKPresentAttentuation_40Mdefault = 0; 795 803 priv->CCKPresentAttentuation_difference = 0; 796 - priv->CCKPresentAttentuation = 804 + priv->cck_present_attn = 797 805 priv->CCKPresentAttentuation_20Mdefault; 798 806 priv->btxpower_tracking = false; 799 807 } ··· 857 865 858 866 reg = rtl92e_readl(dev, RCR); 859 867 if (priv->rtllib->state == RTLLIB_LINKED) { 860 - if (ieee->IntelPromiscuousModeInfo.bPromiscuousOn) 868 + if (ieee->intel_promiscuous_md_info.promiscuous_on) 861 869 ; 862 870 else 863 871 priv->ReceiveConfig = reg |= RCR_CBSSID; ··· 1104 1112 if (cb_desc->bHwSec) { 1105 1113 static u8 tmp; 1106 1114 1107 - if (!tmp) { 1115 + if (!tmp) 1108 1116 tmp = 1; 1109 - } 1110 1117 switch (priv->rtllib->pairwise_key_type) { 1111 1118 case KEY_TYPE_WEP40: 1112 1119 case KEY_TYPE_WEP104: ··· 1134 1143 cb_desc->priority); 1135 1144 pdesc->TxFWInfoSize = sizeof(struct tx_fwinfo_8190pci); 1136 1145 1137 - pdesc->DISFB = cb_desc->bTxDisableRateFallBack; 1138 - pdesc->USERATE = cb_desc->bTxUseDriverAssingedRate; 1146 + pdesc->DISFB = cb_desc->tx_dis_rate_fallback; 1147 + pdesc->USERATE = cb_desc->tx_use_drv_assinged_rate; 1139 1148 1140 1149 pdesc->FirstSeg = 1; 1141 1150 pdesc->LastSeg = 1; ··· 1926 1935 if (!reset) { 1927 1936 mdelay(150); 1928 1937 1929 - priv->bHwRfOffAction = 2; 1938 + priv->hw_rf_off_action = 2; 1930 1939 1931 1940 if (!priv->rtllib->bSupportRemoteWakeUp) { 1932 1941 rtl92e_set_rf_off(dev); ··· 1946 1955 1947 1956 for (i = 0; i < MAX_QUEUE_SIZE; i++) 1948 1957 skb_queue_purge(&priv->rtllib->skb_waitQ[i]); 1949 - for (i = 0; i < MAX_QUEUE_SIZE; i++) 1950 - skb_queue_purge(&priv->rtllib->skb_aggQ[i]); 1951 1958 1952 1959 skb_queue_purge(&priv->skb_queue); 1953 1960 } ··· 1954 1965 { 1955 1966 struct r8192_priv *priv = rtllib_priv(dev); 1956 1967 struct rtllib_device *ieee = priv->rtllib; 1957 - u8 *pMcsRate = ieee->dot11HTOperationalRateSet; 1968 + u8 *pMcsRate = ieee->dot11ht_oper_rate_set; 1958 1969 u32 ratr_value = 0; 1959 1970 u16 rate_config = 0; 1960 1971 u8 rate_index = 0; ··· 1974 1985 break; 1975 1986 case IEEE_N_24G: 1976 1987 case IEEE_N_5G: 1977 - if (ieee->pHTInfo->peer_mimo_ps == 0) { 1988 + if (ieee->ht_info->peer_mimo_ps == 0) { 1978 1989 ratr_value &= 0x0007F007; 1979 1990 } else { 1980 1991 if (priv->rf_type == RF_1T2R) ··· 1987 1998 break; 1988 1999 } 1989 2000 ratr_value &= 0x0FFFFFFF; 1990 - if (ieee->pHTInfo->cur_tx_bw40mhz && 1991 - ieee->pHTInfo->bCurShortGI40MHz) 2001 + if (ieee->ht_info->cur_tx_bw40mhz && 2002 + ieee->ht_info->bCurShortGI40MHz) 1992 2003 ratr_value |= 0x80000000; 1993 - else if (!ieee->pHTInfo->cur_tx_bw40mhz && 1994 - ieee->pHTInfo->bCurShortGI20MHz) 2004 + else if (!ieee->ht_info->cur_tx_bw40mhz && 2005 + ieee->ht_info->bCurShortGI20MHz) 1995 2006 ratr_value |= 0x80000000; 1996 2007 rtl92e_writel(dev, RATR0+rate_index*4, ratr_value); 1997 2008 rtl92e_writeb(dev, UFWP, 1); ··· 2125 2136 2126 2137 SlotIndex = (priv->SilentResetRxSlotIndex++)%SilentResetRxSoltNum; 2127 2138 2128 - if (priv->RxCounter == RegRxCounter) { 2139 + if (priv->rx_ctr == RegRxCounter) { 2129 2140 priv->SilentResetRxStuckEvent[SlotIndex] = 1; 2130 2141 2131 2142 for (i = 0; i < SilentResetRxSoltNum; i++) ··· 2143 2154 priv->SilentResetRxStuckEvent[SlotIndex] = 0; 2144 2155 } 2145 2156 2146 - priv->RxCounter = RegRxCounter; 2157 + priv->rx_ctr = RegRxCounter; 2147 2158 2148 2159 return bStuck; 2149 2160 }
+23 -27
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
··· 522 522 rtStatus = rtl92e_check_bb_and_rf(dev, 523 523 (enum hw90_block)eCheckItem, 524 524 (enum rf90_radio_path)0); 525 - if (!rtStatus) { 525 + if (!rtStatus) 526 526 return rtStatus; 527 - } 528 527 } 529 528 rtl92e_set_bb_reg(dev, rFPGA0_RFMOD, bCCKEn|bOFDMEn, 0x0); 530 529 _rtl92e_phy_config_bb(dev, BaseBand_Config_PHY_REG); ··· 1008 1009 1009 1010 switch (priv->CurrentChannelBW) { 1010 1011 case HT_CHANNEL_WIDTH_20: 1011 - priv->CCKPresentAttentuation = 1012 + priv->cck_present_attn = 1012 1013 priv->CCKPresentAttentuation_20Mdefault + 1013 1014 priv->CCKPresentAttentuation_difference; 1014 1015 1015 - if (priv->CCKPresentAttentuation > 1016 + if (priv->cck_present_attn > 1016 1017 (CCKTxBBGainTableLength-1)) 1017 - priv->CCKPresentAttentuation = 1018 + priv->cck_present_attn = 1018 1019 CCKTxBBGainTableLength-1; 1019 - if (priv->CCKPresentAttentuation < 0) 1020 - priv->CCKPresentAttentuation = 0; 1020 + if (priv->cck_present_attn < 0) 1021 + priv->cck_present_attn = 0; 1021 1022 1022 1023 if (priv->rtllib->current_network.channel == 14 && 1023 1024 !priv->bcck_in_ch14) { ··· 1033 1034 break; 1034 1035 1035 1036 case HT_CHANNEL_WIDTH_20_40: 1036 - priv->CCKPresentAttentuation = 1037 + priv->cck_present_attn = 1037 1038 priv->CCKPresentAttentuation_40Mdefault + 1038 1039 priv->CCKPresentAttentuation_difference; 1039 1040 1040 - if (priv->CCKPresentAttentuation > 1041 + if (priv->cck_present_attn > 1041 1042 (CCKTxBBGainTableLength - 1)) 1042 - priv->CCKPresentAttentuation = 1043 + priv->cck_present_attn = 1043 1044 CCKTxBBGainTableLength-1; 1044 - if (priv->CCKPresentAttentuation < 0) 1045 - priv->CCKPresentAttentuation = 0; 1045 + if (priv->cck_present_attn < 0) 1046 + priv->cck_present_attn = 0; 1046 1047 1047 1048 if (priv->rtllib->current_network.channel == 14 && 1048 1049 !priv->bcck_in_ch14) { ··· 1303 1304 enum rt_rf_power_state rf_power_state) 1304 1305 { 1305 1306 struct r8192_priv *priv = rtllib_priv(dev); 1306 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 1307 - (&(priv->rtllib->PowerSaveControl)); 1307 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 1308 + (&priv->rtllib->pwr_save_ctrl); 1308 1309 bool bResult = true; 1309 1310 u8 i = 0, QueueID = 0; 1310 1311 struct rtl8192_tx_ring *ring = NULL; ··· 1318 1319 switch (rf_power_state) { 1319 1320 case rf_on: 1320 1321 if ((priv->rtllib->rf_power_state == rf_off) && 1321 - RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) { 1322 + RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) { 1322 1323 bool rtstatus; 1323 1324 u32 InitilizeCount = 3; 1324 1325 1325 1326 do { 1326 1327 InitilizeCount--; 1327 - priv->RegRfOff = false; 1328 1328 rtstatus = rtl92e_enable_nic(dev); 1329 1329 } while (!rtstatus && (InitilizeCount > 0)); 1330 1330 ··· 1335 1337 return false; 1336 1338 } 1337 1339 1338 - RT_CLEAR_PS_LEVEL(pPSC, 1340 + RT_CLEAR_PS_LEVEL(psc, 1339 1341 RT_RF_OFF_LEVL_HALT_NIC); 1340 1342 } else { 1341 1343 rtl92e_writeb(dev, ANAPAR, 0x37); 1342 1344 mdelay(1); 1343 1345 rtl92e_set_bb_reg(dev, rFPGA0_AnalogParameter1, 1344 1346 0x4, 0x1); 1345 - priv->bHwRfOffAction = 0; 1347 + priv->hw_rf_off_action = 0; 1346 1348 1347 1349 rtl92e_set_bb_reg(dev, rFPGA0_XA_RFInterfaceOE, 1348 1350 BIT4, 0x1); ··· 1377 1379 i++; 1378 1380 } 1379 1381 1380 - if (i >= MAX_DOZE_WAITING_TIMES_9x) { 1382 + if (i >= MAX_DOZE_WAITING_TIMES_9x) 1381 1383 break; 1382 - } 1383 1384 } 1384 1385 rtl92e_set_rf_off(dev); 1385 1386 break; ··· 1395 1398 i++; 1396 1399 } 1397 1400 1398 - if (i >= MAX_DOZE_WAITING_TIMES_9x) { 1401 + if (i >= MAX_DOZE_WAITING_TIMES_9x) 1399 1402 break; 1400 - } 1401 1403 } 1402 1404 1403 - if (pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC && 1404 - !RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) { 1405 + if (psc->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC && 1406 + !RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) { 1405 1407 rtl92e_disable_nic(dev); 1406 - RT_SET_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC); 1407 - } else if (!(pPSC->RegRfPsLevel & 1408 + RT_SET_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC); 1409 + } else if (!(psc->RegRfPsLevel & 1408 1410 RT_RF_OFF_LEVL_HALT_NIC)) { 1409 1411 rtl92e_set_rf_off(dev); 1410 1412 } ··· 1450 1454 bool bResult = false; 1451 1455 1452 1456 if (rf_power_state == priv->rtllib->rf_power_state && 1453 - priv->bHwRfOffAction == 0) { 1457 + priv->hw_rf_off_action == 0) { 1454 1458 return bResult; 1455 1459 } 1456 1460
+20 -23
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
··· 17 17 { 18 18 u32 ulcommand = 0; 19 19 20 - ulcommand |= BIT31|BIT30; 20 + ulcommand |= BIT31 | BIT30; 21 21 rtl92e_writel(dev, RWCAM, ulcommand); 22 22 } 23 23 ··· 40 40 SECR_value |= SCR_TxUseDK; 41 41 } 42 42 43 - 44 43 ieee->hwsec_active = 1; 45 - if ((ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) { 44 + if ((ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE) || !hwwep) { 46 45 ieee->hwsec_active = 0; 47 46 SECR_value &= ~SCR_RxDecEnable; 48 47 } ··· 80 81 enum rt_rf_power_state rt_state; 81 82 82 83 rt_state = priv->rtllib->rf_power_state; 83 - if (priv->rtllib->PowerSaveControl.bInactivePs) { 84 - if (rt_state == rf_off) { 85 - if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { 86 - netdev_warn(dev, "%s(): RF is OFF.\n", 87 - __func__); 88 - return; 89 - } 90 - mutex_lock(&priv->rtllib->ips_mutex); 91 - rtl92e_ips_leave(dev); 92 - mutex_unlock(&priv->rtllib->ips_mutex); 84 + if (rt_state == rf_off) { 85 + if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { 86 + netdev_warn(dev, "%s(): RF is OFF.\n", 87 + __func__); 88 + return; 93 89 } 90 + mutex_lock(&priv->rtllib->ips_mutex); 91 + rtl92e_ips_leave(dev); 92 + mutex_unlock(&priv->rtllib->ips_mutex); 94 93 } 95 94 priv->rtllib->is_set_key = true; 96 95 if (EntryNo >= TOTAL_CAM_ENTRY) { ··· 97 100 } 98 101 99 102 if (DefaultKey) 100 - usConfig |= BIT15 | (KeyType<<2); 103 + usConfig |= BIT15 | (KeyType << 2); 101 104 else 102 - usConfig |= BIT15 | (KeyType<<2) | KeyIndex; 105 + usConfig |= BIT15 | (KeyType << 2) | KeyIndex; 103 106 104 107 105 108 for (i = 0; i < CAM_CONTENT_COUNT; i++) { 106 109 TargetCommand = i + CAM_CONTENT_COUNT * EntryNo; 107 - TargetCommand |= BIT31|BIT16; 110 + TargetCommand |= BIT31 | BIT16; 108 111 109 112 if (i == 0) { 110 - TargetContent = (u32)(*(MacAddr+0)) << 16 | 111 - (u32)(*(MacAddr+1)) << 24 | 113 + TargetContent = (u32)(*(MacAddr + 0)) << 16 | 114 + (u32)(*(MacAddr + 1)) << 24 | 112 115 (u32)usConfig; 113 116 114 117 rtl92e_writel(dev, WCAMI, TargetContent); 115 118 rtl92e_writel(dev, RWCAM, TargetCommand); 116 119 } else if (i == 1) { 117 - TargetContent = (u32)(*(MacAddr+2)) | 118 - (u32)(*(MacAddr+3)) << 8 | 119 - (u32)(*(MacAddr+4)) << 16 | 120 - (u32)(*(MacAddr+5)) << 24; 120 + TargetContent = (u32)(*(MacAddr + 2)) | 121 + (u32)(*(MacAddr + 3)) << 8 | 122 + (u32)(*(MacAddr + 4)) << 16 | 123 + (u32)(*(MacAddr + 5)) << 24; 121 124 rtl92e_writel(dev, WCAMI, TargetContent); 122 125 rtl92e_writel(dev, RWCAM, TargetCommand); 123 126 } else { 124 127 if (KeyContent != NULL) { 125 128 rtl92e_writel(dev, WCAMI, 126 - (u32)(*(KeyContent+i-2))); 129 + (u32)(*(KeyContent + i - 2))); 127 130 rtl92e_writel(dev, RWCAM, TargetCommand); 128 131 udelay(100); 129 132 }
+84 -107
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
··· 307 307 u8 cur_slot_time = priv->slot_time; 308 308 309 309 if ((cap & WLAN_CAPABILITY_SHORT_SLOT_TIME) && 310 - (!priv->rtllib->pHTInfo->current_rt2rt_long_slot_time)) { 310 + (!priv->rtllib->ht_info->current_rt2rt_long_slot_time)) { 311 311 if (cur_slot_time != SHORT_SLOT_TIME) { 312 312 slot_time_val = SHORT_SLOT_TIME; 313 313 priv->rtllib->SetHwRegHandler(dev, ··· 339 339 struct rtllib_device *ieee = priv->rtllib; 340 340 struct rtllib_network *net = &ieee->current_network; 341 341 342 - if (ieee->pHTInfo->bCurrentHTSupport) 342 + if (ieee->ht_info->bCurrentHTSupport) 343 343 HT_update_self_and_peer_setting(ieee, net); 344 - ieee->pHTInfo->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time; 345 - ieee->pHTInfo->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode; 344 + ieee->ht_info->current_rt2rt_long_slot_time = net->bssht.bd_rt2rt_long_slot_time; 345 + ieee->ht_info->RT2RT_HT_Mode = net->bssht.rt2rt_ht_mode; 346 346 _rtl92e_update_cap(dev, net->capability); 347 347 } 348 348 ··· 494 494 tcb_desc->queue_index = BEACON_QUEUE; 495 495 tcb_desc->data_rate = 2; 496 496 tcb_desc->RATRIndex = 7; 497 - tcb_desc->bTxDisableRateFallBack = 1; 498 - tcb_desc->bTxUseDriverAssingedRate = 1; 497 + tcb_desc->tx_dis_rate_fallback = 1; 498 + tcb_desc->tx_use_drv_assinged_rate = 1; 499 499 skb_push(pnewskb, priv->rtllib->tx_headroom); 500 500 501 501 pdesc = &ring->desc[0]; ··· 607 607 608 608 if (ieee->mode == WIRELESS_MODE_N_24G || 609 609 ieee->mode == WIRELESS_MODE_N_5G) { 610 - memcpy(ieee->Regdot11HTOperationalRateSet, 611 - ieee->RegHTSuppRateSet, 16); 612 - memcpy(ieee->Regdot11TxHTOperationalRateSet, 613 - ieee->RegHTSuppRateSet, 16); 610 + memcpy(ieee->reg_dot11ht_oper_rate_set, 611 + ieee->reg_ht_supp_rate_set, 16); 612 + memcpy(ieee->reg_dot11tx_ht_oper_rate_set, 613 + ieee->reg_ht_supp_rate_set, 16); 614 614 615 615 } else { 616 - memset(ieee->Regdot11HTOperationalRateSet, 0, 16); 616 + memset(ieee->reg_dot11ht_oper_rate_set, 0, 16); 617 617 } 618 618 } 619 619 ··· 642 642 void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode) 643 643 { 644 644 struct r8192_priv *priv = rtllib_priv(dev); 645 - u8 bSupportMode = _rtl92e_get_supported_wireless_mode(dev); 645 + u8 support_mode = _rtl92e_get_supported_wireless_mode(dev); 646 646 647 647 if ((wireless_mode == WIRELESS_MODE_AUTO) || 648 - ((wireless_mode & bSupportMode) == 0)) { 649 - if (bSupportMode & WIRELESS_MODE_N_24G) { 648 + ((wireless_mode & support_mode) == 0)) { 649 + if (support_mode & WIRELESS_MODE_N_24G) { 650 650 wireless_mode = WIRELESS_MODE_N_24G; 651 - } else if (bSupportMode & WIRELESS_MODE_N_5G) { 651 + } else if (support_mode & WIRELESS_MODE_N_5G) { 652 652 wireless_mode = WIRELESS_MODE_N_5G; 653 - } else if ((bSupportMode & WIRELESS_MODE_A)) { 653 + } else if ((support_mode & WIRELESS_MODE_A)) { 654 654 wireless_mode = WIRELESS_MODE_A; 655 - } else if ((bSupportMode & WIRELESS_MODE_G)) { 655 + } else if ((support_mode & WIRELESS_MODE_G)) { 656 656 wireless_mode = WIRELESS_MODE_G; 657 - } else if ((bSupportMode & WIRELESS_MODE_B)) { 657 + } else if ((support_mode & WIRELESS_MODE_B)) { 658 658 wireless_mode = WIRELESS_MODE_B; 659 659 } else { 660 660 netdev_info(dev, ··· 672 672 673 673 if ((wireless_mode == WIRELESS_MODE_N_24G) || 674 674 (wireless_mode == WIRELESS_MODE_N_5G)) { 675 - priv->rtllib->pHTInfo->bEnableHT = 1; 675 + priv->rtllib->ht_info->enable_ht = 1; 676 676 } else { 677 - priv->rtllib->pHTInfo->bEnableHT = 0; 677 + priv->rtllib->ht_info->enable_ht = 0; 678 678 } 679 679 _rtl92e_refresh_support_rate(priv); 680 680 } ··· 682 682 static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) 683 683 { 684 684 struct r8192_priv *priv = rtllib_priv(dev); 685 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 686 - (&priv->rtllib->PowerSaveControl); 685 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 686 + (&priv->rtllib->pwr_save_ctrl); 687 687 bool init_status; 688 688 689 - priv->bDriverIsGoingToUnload = false; 690 689 priv->bdisable_nic = false; 691 690 692 691 priv->up = 1; ··· 700 701 return -1; 701 702 } 702 703 703 - RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC); 704 + RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC); 704 705 priv->bfirst_init = false; 705 706 706 707 if (priv->polling_timer_on == 0) ··· 723 724 { 724 725 struct r8192_priv *priv = rtllib_priv(dev); 725 726 unsigned long flags = 0; 726 - u8 RFInProgressTimeOut = 0; 727 + u8 rf_in_progress_timeout = 0; 727 728 728 729 if (priv->up == 0) 729 730 return -1; ··· 734 735 if (priv->rtllib->state == RTLLIB_LINKED) 735 736 rtl92e_leisure_ps_leave(dev); 736 737 737 - priv->bDriverIsGoingToUnload = true; 738 738 priv->up = 0; 739 739 priv->rtllib->ieee_up = 0; 740 740 priv->bfirst_after_down = true; ··· 755 757 spin_lock_irqsave(&priv->rf_ps_lock, flags); 756 758 while (priv->rf_change_in_progress) { 757 759 spin_unlock_irqrestore(&priv->rf_ps_lock, flags); 758 - if (RFInProgressTimeOut > 100) { 760 + if (rf_in_progress_timeout > 100) { 759 761 spin_lock_irqsave(&priv->rf_ps_lock, flags); 760 762 break; 761 763 } 762 764 mdelay(1); 763 - RFInProgressTimeOut++; 765 + rf_in_progress_timeout++; 764 766 spin_lock_irqsave(&priv->rf_ps_lock, flags); 765 767 } 766 768 priv->rf_change_in_progress = true; ··· 819 821 static void _rtl92e_init_priv_constant(struct net_device *dev) 820 822 { 821 823 struct r8192_priv *priv = rtllib_priv(dev); 822 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 823 - &priv->rtllib->PowerSaveControl; 824 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 825 + &priv->rtllib->pwr_save_ctrl; 824 826 825 - pPSC->RegMaxLPSAwakeIntvl = 5; 827 + psc->reg_max_lps_awake_intvl = 5; 826 828 } 827 829 828 830 static void _rtl92e_init_priv_variable(struct net_device *dev) ··· 830 832 struct r8192_priv *priv = rtllib_priv(dev); 831 833 u8 i; 832 834 833 - priv->AcmMethod = eAcmWay2_SW; 834 835 priv->dot11_current_preamble_mode = PREAMBLE_AUTO; 835 836 priv->rtllib->status = 0; 836 837 priv->polling_timer_on = 0; 837 838 priv->up_first_time = 1; 838 839 priv->blinked_ingpio = false; 839 - priv->bDriverIsGoingToUnload = false; 840 840 priv->being_init_adapter = false; 841 - priv->initialized_at_probe = false; 842 841 priv->bdisable_nic = false; 843 842 priv->bfirst_init = false; 844 843 priv->txringcount = 64; ··· 843 848 priv->rxringcount = MAX_RX_COUNT; 844 849 priv->irq_enabled = 0; 845 850 priv->chan = 1; 846 - priv->RegChannelPlan = 0xf; 851 + priv->reg_chnl_plan = 0xf; 847 852 priv->rtllib->mode = WIRELESS_MODE_AUTO; 848 853 priv->rtllib->iw_mode = IW_MODE_INFRA; 849 - priv->rtllib->bNetPromiscuousMode = false; 850 - priv->rtllib->IntelPromiscuousModeInfo.bPromiscuousOn = false; 851 - priv->rtllib->IntelPromiscuousModeInfo.bFilterSourceStationFrame = 854 + priv->rtllib->net_promiscuous_md = false; 855 + priv->rtllib->intel_promiscuous_md_info.promiscuous_on = false; 856 + priv->rtllib->intel_promiscuous_md_info.fltr_src_sta_frame = 852 857 false; 853 858 priv->rtllib->ieee_up = 0; 854 859 priv->retry_rts = DEFAULT_RETRY_RTS; ··· 859 864 priv->promisc = (dev->flags & IFF_PROMISC) ? 1 : 0; 860 865 priv->bcck_in_ch14 = false; 861 866 priv->bfsync_processing = false; 862 - priv->CCKPresentAttentuation = 0; 867 + priv->cck_present_attn = 0; 863 868 priv->rfa_txpowertrackingindex = 0; 864 869 priv->rfc_txpowertrackingindex = 0; 865 870 priv->CckPwEnl = 6; 866 - priv->ScanDelay = 50; 867 - priv->ResetProgress = RESET_TYPE_NORESET; 868 - priv->bForcedSilentReset = false; 869 - priv->bDisableNormalResetCheck = false; 871 + priv->rst_progress = RESET_TYPE_NORESET; 870 872 priv->force_reset = false; 871 873 memset(priv->rtllib->swcamtable, 0, sizeof(struct sw_cam_table) * 32); 872 - 873 - memset(&priv->InterruptLog, 0, sizeof(struct log_int_8190)); 874 - priv->RxCounter = 0; 874 + priv->rx_ctr = 0; 875 875 priv->rtllib->wx_set_enc = 0; 876 876 priv->hw_radio_off = false; 877 - priv->RegRfOff = false; 878 - priv->isRFOff = false; 879 - priv->bInPowerSaveMode = false; 880 877 priv->rtllib->rf_off_reason = 0; 881 878 priv->rf_change_in_progress = false; 882 - priv->bHwRfOffAction = 0; 879 + priv->hw_rf_off_action = 0; 883 880 priv->SetRFPowerStateInProgress = false; 884 - priv->rtllib->PowerSaveControl.bInactivePs = true; 885 - priv->rtllib->PowerSaveControl.bIPSModeBackup = false; 886 - priv->rtllib->PowerSaveControl.bLeisurePs = true; 887 - priv->rtllib->PowerSaveControl.bFwCtrlLPS = false; 881 + priv->rtllib->pwr_save_ctrl.bLeisurePs = true; 888 882 priv->rtllib->LPSDelayCnt = 0; 889 883 priv->rtllib->sta_sleep = LPS_IS_WAKE; 890 884 priv->rtllib->rf_power_state = rf_on; ··· 900 916 901 917 for (i = 0; i < MAX_QUEUE_SIZE; i++) 902 918 skb_queue_head_init(&priv->rtllib->skb_waitQ[i]); 903 - for (i = 0; i < MAX_QUEUE_SIZE; i++) 904 - skb_queue_head_init(&priv->rtllib->skb_aggQ[i]); 905 919 } 906 920 907 921 static void _rtl92e_init_priv_lock(struct r8192_priv *priv) ··· 1129 1147 struct rtllib_device *ieee = priv->rtllib; 1130 1148 unsigned long flag; 1131 1149 1132 - if (priv->ResetProgress == RESET_TYPE_NORESET) { 1133 - priv->ResetProgress = RESET_TYPE_SILENT; 1150 + if (priv->rst_progress == RESET_TYPE_NORESET) { 1151 + priv->rst_progress = RESET_TYPE_SILENT; 1134 1152 1135 1153 spin_lock_irqsave(&priv->rf_ps_lock, flag); 1136 1154 if (priv->rf_change_in_progress) { ··· 1227 1245 rtl92e_cam_restore(dev); 1228 1246 rtl92e_dm_restore_state(dev); 1229 1247 END: 1230 - priv->ResetProgress = RESET_TYPE_NORESET; 1248 + priv->rst_progress = RESET_TYPE_NORESET; 1231 1249 priv->reset_count++; 1232 - 1233 - priv->bForcedSilentReset = false; 1234 1250 priv->bResetInProgress = false; 1235 1251 1236 1252 rtl92e_writeb(dev, UFWP, 1); ··· 1244 1264 *TotalRxBcnNum = 0; 1245 1265 *TotalRxDataNum = 0; 1246 1266 1247 - SlotIndex = (priv->rtllib->LinkDetectInfo.SlotIndex++) % 1248 - (priv->rtllib->LinkDetectInfo.SlotNum); 1249 - priv->rtllib->LinkDetectInfo.RxBcnNum[SlotIndex] = 1250 - priv->rtllib->LinkDetectInfo.NumRecvBcnInPeriod; 1251 - priv->rtllib->LinkDetectInfo.RxDataNum[SlotIndex] = 1252 - priv->rtllib->LinkDetectInfo.NumRecvDataInPeriod; 1253 - for (i = 0; i < priv->rtllib->LinkDetectInfo.SlotNum; i++) { 1254 - *TotalRxBcnNum += priv->rtllib->LinkDetectInfo.RxBcnNum[i]; 1255 - *TotalRxDataNum += priv->rtllib->LinkDetectInfo.RxDataNum[i]; 1267 + SlotIndex = (priv->rtllib->link_detect_info.SlotIndex++) % 1268 + (priv->rtllib->link_detect_info.SlotNum); 1269 + priv->rtllib->link_detect_info.RxBcnNum[SlotIndex] = 1270 + priv->rtllib->link_detect_info.NumRecvBcnInPeriod; 1271 + priv->rtllib->link_detect_info.RxDataNum[SlotIndex] = 1272 + priv->rtllib->link_detect_info.NumRecvDataInPeriod; 1273 + for (i = 0; i < priv->rtllib->link_detect_info.SlotNum; i++) { 1274 + *TotalRxBcnNum += priv->rtllib->link_detect_info.RxBcnNum[i]; 1275 + *TotalRxDataNum += priv->rtllib->link_detect_info.RxDataNum[i]; 1256 1276 } 1257 1277 } 1258 1278 ··· 1265 1285 enum reset_type ResetType = RESET_TYPE_NORESET; 1266 1286 static u8 check_reset_cnt; 1267 1287 unsigned long flags; 1268 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 1269 - (&priv->rtllib->PowerSaveControl); 1288 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 1289 + (&priv->rtllib->pwr_save_ctrl); 1270 1290 bool bBusyTraffic = false; 1271 1291 bool bHigherBusyTraffic = false; 1272 1292 bool bHigherBusyRxTraffic = false; ··· 1289 1309 RTLLIB_NOLINK) && 1290 1310 (ieee->rf_power_state == rf_on) && !ieee->is_set_key && 1291 1311 (!ieee->proto_stoppping) && !ieee->wx_set_enc) { 1292 - if ((ieee->PowerSaveControl.ReturnPoint == 1312 + if ((ieee->pwr_save_ctrl.ReturnPoint == 1293 1313 IPS_CALLBACK_NONE) && 1294 - (!ieee->bNetPromiscuousMode)) { 1314 + (!ieee->net_promiscuous_md)) { 1295 1315 rtl92e_ips_enter(dev); 1296 1316 } 1297 1317 } 1298 1318 } 1299 1319 if ((ieee->state == RTLLIB_LINKED) && (ieee->iw_mode == 1300 - IW_MODE_INFRA) && (!ieee->bNetPromiscuousMode)) { 1301 - if (ieee->LinkDetectInfo.NumRxOkInPeriod > 100 || 1302 - ieee->LinkDetectInfo.NumTxOkInPeriod > 100) 1320 + IW_MODE_INFRA) && (!ieee->net_promiscuous_md)) { 1321 + if (ieee->link_detect_info.NumRxOkInPeriod > 100 || 1322 + ieee->link_detect_info.NumTxOkInPeriod > 100) 1303 1323 bBusyTraffic = true; 1304 1324 1305 - if (ieee->LinkDetectInfo.NumRxOkInPeriod > 4000 || 1306 - ieee->LinkDetectInfo.NumTxOkInPeriod > 4000) { 1325 + if (ieee->link_detect_info.NumRxOkInPeriod > 4000 || 1326 + ieee->link_detect_info.NumTxOkInPeriod > 4000) { 1307 1327 bHigherBusyTraffic = true; 1308 - if (ieee->LinkDetectInfo.NumRxOkInPeriod > 5000) 1328 + if (ieee->link_detect_info.NumRxOkInPeriod > 5000) 1309 1329 bHigherBusyRxTraffic = true; 1310 1330 else 1311 1331 bHigherBusyRxTraffic = false; 1312 1332 } 1313 1333 1314 - if (((ieee->LinkDetectInfo.NumRxUnicastOkInPeriod + 1315 - ieee->LinkDetectInfo.NumTxOkInPeriod) > 8) || 1316 - (ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) 1334 + if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + 1335 + ieee->link_detect_info.NumTxOkInPeriod) > 8) || 1336 + (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) 1317 1337 bEnterPS = false; 1318 1338 else 1319 1339 bEnterPS = true; ··· 1330 1350 rtl92e_leisure_ps_leave(dev); 1331 1351 } 1332 1352 1333 - ieee->LinkDetectInfo.NumRxOkInPeriod = 0; 1334 - ieee->LinkDetectInfo.NumTxOkInPeriod = 0; 1335 - ieee->LinkDetectInfo.NumRxUnicastOkInPeriod = 0; 1336 - ieee->LinkDetectInfo.bBusyTraffic = bBusyTraffic; 1353 + ieee->link_detect_info.NumRxOkInPeriod = 0; 1354 + ieee->link_detect_info.NumTxOkInPeriod = 0; 1355 + ieee->link_detect_info.NumRxUnicastOkInPeriod = 0; 1356 + ieee->link_detect_info.bBusyTraffic = bBusyTraffic; 1337 1357 1338 - ieee->LinkDetectInfo.bHigherBusyTraffic = bHigherBusyTraffic; 1339 - ieee->LinkDetectInfo.bHigherBusyRxTraffic = bHigherBusyRxTraffic; 1358 + ieee->link_detect_info.bHigherBusyTraffic = bHigherBusyTraffic; 1359 + ieee->link_detect_info.bHigherBusyRxTraffic = bHigherBusyRxTraffic; 1340 1360 1341 1361 if (ieee->state == RTLLIB_LINKED && ieee->iw_mode == IW_MODE_INFRA) { 1342 1362 u32 TotalRxBcnNum = 0; ··· 1377 1397 1378 1398 priv->check_roaming_cnt = 0; 1379 1399 } 1380 - ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0; 1381 - ieee->LinkDetectInfo.NumRecvDataInPeriod = 0; 1400 + ieee->link_detect_info.NumRecvBcnInPeriod = 0; 1401 + ieee->link_detect_info.NumRecvDataInPeriod = 0; 1382 1402 } 1383 1403 1384 1404 spin_lock_irqsave(&priv->tx_lock, flags); 1385 1405 if ((check_reset_cnt++ >= 3) && (!ieee->is_roaming) && 1386 - (!priv->rf_change_in_progress) && (!pPSC->bSwRfProcessing)) { 1406 + (!priv->rf_change_in_progress) && (!psc->bSwRfProcessing)) { 1387 1407 ResetType = _rtl92e_if_check_reset(dev); 1388 1408 check_reset_cnt = 3; 1389 1409 } 1390 1410 spin_unlock_irqrestore(&priv->tx_lock, flags); 1391 1411 1392 - if (!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_NORMAL) { 1393 - priv->ResetProgress = RESET_TYPE_NORMAL; 1412 + if (ResetType == RESET_TYPE_NORMAL) { 1413 + priv->rst_progress = RESET_TYPE_NORMAL; 1394 1414 return; 1395 1415 } 1396 1416 1397 - if (((priv->force_reset) || (!priv->bDisableNormalResetCheck && 1398 - ResetType == RESET_TYPE_SILENT))) 1417 + if ((priv->force_reset || ResetType == RESET_TYPE_SILENT)) 1399 1418 _rtl92e_if_silent_reset(dev); 1400 1419 priv->force_reset = false; 1401 - priv->bForcedSilentReset = false; 1402 1420 priv->bResetInProgress = false; 1403 1421 } 1404 1422 ··· 1532 1554 } 1533 1555 1534 1556 tcb_desc->RATRIndex = 7; 1535 - tcb_desc->bTxDisableRateFallBack = 1; 1536 - tcb_desc->bTxUseDriverAssingedRate = 1; 1557 + tcb_desc->tx_dis_rate_fallback = 1; 1558 + tcb_desc->tx_use_drv_assinged_rate = 1; 1537 1559 tcb_desc->bTxEnableFwCalcDur = 1; 1538 1560 skb_push(skb, priv->rtllib->tx_headroom); 1539 1561 ret = _rtl92e_tx(dev, skb); ··· 2183 2205 2184 2206 if (inta & IMR_ROK) { 2185 2207 priv->stats.rxint++; 2186 - priv->InterruptLog.nIMR_ROK++; 2187 2208 tasklet_schedule(&priv->irq_rx_tasklet); 2188 2209 } 2189 2210 ··· 2206 2229 2207 2230 if (inta & IMR_BKDOK) { 2208 2231 priv->stats.txbkokint++; 2209 - priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++; 2232 + priv->rtllib->link_detect_info.NumTxOkInPeriod++; 2210 2233 _rtl92e_tx_isr(dev, BK_QUEUE); 2211 2234 } 2212 2235 2213 2236 if (inta & IMR_BEDOK) { 2214 2237 priv->stats.txbeokint++; 2215 - priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++; 2238 + priv->rtllib->link_detect_info.NumTxOkInPeriod++; 2216 2239 _rtl92e_tx_isr(dev, BE_QUEUE); 2217 2240 } 2218 2241 2219 2242 if (inta & IMR_VIDOK) { 2220 2243 priv->stats.txviokint++; 2221 - priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++; 2244 + priv->rtllib->link_detect_info.NumTxOkInPeriod++; 2222 2245 _rtl92e_tx_isr(dev, VI_QUEUE); 2223 2246 } 2224 2247 2225 2248 if (inta & IMR_VODOK) { 2226 2249 priv->stats.txvookint++; 2227 - priv->rtllib->LinkDetectInfo.NumTxOkInPeriod++; 2250 + priv->rtllib->link_detect_info.NumTxOkInPeriod++; 2228 2251 _rtl92e_tx_isr(dev, VO_QUEUE); 2229 2252 } 2230 2253 ··· 2414 2437 { 2415 2438 bool init_status = true; 2416 2439 struct r8192_priv *priv = rtllib_priv(dev); 2417 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 2418 - (&priv->rtllib->PowerSaveControl); 2440 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 2441 + (&priv->rtllib->pwr_save_ctrl); 2419 2442 2420 2443 if (!priv->up) { 2421 2444 netdev_warn(dev, "%s(): Driver is already down!\n", __func__); ··· 2430 2453 priv->bdisable_nic = false; 2431 2454 return false; 2432 2455 } 2433 - RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC); 2456 + RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC); 2434 2457 priv->bfirst_init = false; 2435 2458 2436 2459 rtl92e_irq_enable(dev);
+5 -31
drivers/staging/rtl8192e/rtl8192e/rtl_core.h
··· 234 234 u32 CurrentShowTxate; 235 235 }; 236 236 237 - struct channel_access_setting { 238 - u16 SIFS_Timer; 239 - u16 DIFS_Timer; 240 - u16 SlotTimeTimer; 241 - u16 EIFS_Timer; 242 - u16 CWminIndex; 243 - u16 CWmaxIndex; 244 - }; 245 - 246 237 struct init_gain { 247 238 u8 xaagccore1; 248 239 u8 xbagccore1; ··· 300 309 301 310 bool bfirst_init; 302 311 bool bfirst_after_down; 303 - bool initialized_at_probe; 304 312 bool being_init_adapter; 305 - bool bDriverIsGoingToUnload; 306 313 307 314 int irq; 308 315 short irq_enabled; ··· 312 323 struct delayed_work txpower_tracking_wq; 313 324 struct delayed_work rfpath_check_wq; 314 325 struct delayed_work gpio_change_rf_wq; 315 - 316 - struct channel_access_setting ChannelAccessSetting; 317 - 318 326 struct rtl819x_ops *ops; 319 327 struct rtllib_device *rtllib; 320 328 321 329 struct work_struct reset_wq; 322 - 323 - struct log_int_8190 InterruptLog; 324 330 325 331 enum rt_customer_id CustomerID; 326 332 ··· 324 340 enum ht_channel_width CurrentChannelBW; 325 341 struct bb_reg_definition PHYRegDef[4]; 326 342 struct rate_adaptive rate_adaptive; 327 - 328 - enum acm_method AcmMethod; 329 343 330 344 struct rt_firmware *pFirmware; 331 345 enum rtl819x_loopback LoopbackMode; ··· 392 410 short chan; 393 411 short sens; 394 412 short max_sens; 395 - 396 - u8 ScanDelay; 397 413 bool ps_force; 398 414 399 415 u32 irq_mask[2]; ··· 450 470 451 471 bool bTXPowerDataReadFromEEPORM; 452 472 453 - u16 RegChannelPlan; 473 + u16 reg_chnl_plan; 454 474 u16 ChannelPlan; 455 - 456 - bool RegRfOff; 457 - bool isRFOff; 458 - bool bInPowerSaveMode; 459 - u8 bHwRfOffAction; 475 + u8 hw_rf_off_action; 460 476 461 477 bool rf_change_in_progress; 462 478 bool SetRFPowerStateInProgress; ··· 466 490 u8 CCKPresentAttentuation_20Mdefault; 467 491 u8 CCKPresentAttentuation_40Mdefault; 468 492 s8 CCKPresentAttentuation_difference; 469 - s8 CCKPresentAttentuation; 493 + s8 cck_present_attn; 470 494 long undecorated_smoothed_pwdb; 471 495 472 496 u32 MCSTxPowerLevelOriginalOffset[6]; ··· 519 543 520 544 u32 reset_count; 521 545 522 - enum reset_type ResetProgress; 523 - bool bForcedSilentReset; 524 - bool bDisableNormalResetCheck; 546 + enum reset_type rst_progress; 525 547 u16 TxCounter; 526 - u16 RxCounter; 548 + u16 rx_ctr; 527 549 bool bResetInProgress; 528 550 bool force_reset; 529 551 bool force_lps;
+59 -64
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
··· 267 267 "PATH=/usr/bin:/bin", 268 268 NULL}; 269 269 270 - if (priv->ResetProgress == RESET_TYPE_SILENT) { 270 + if (priv->rst_progress == RESET_TYPE_SILENT) 271 271 return; 272 - } 273 - 274 272 if (priv->rtllib->state != RTLLIB_LINKED) 275 273 return; 276 274 call_usermodehelper(ac_dc_script, argv, envp, UMH_WAIT_PROC); ··· 321 323 static void _rtl92e_dm_check_rate_adaptive(struct net_device *dev) 322 324 { 323 325 struct r8192_priv *priv = rtllib_priv(dev); 324 - struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo; 326 + struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; 325 327 struct rate_adaptive *pra = &priv->rate_adaptive; 326 328 u32 currentRATR, targetRATR = 0; 327 329 u32 LowRSSIThreshForRA = 0, HighRSSIThreshForRA = 0; 328 330 bool bshort_gi_enabled = false; 329 331 static u8 ping_rssi_state; 330 332 331 - if (!priv->up) { 333 + if (!priv->up) 332 334 return; 333 - } 334 335 335 336 if (pra->rate_adaptive_disabled) 336 337 return; ··· 340 343 341 344 if (priv->rtllib->state == RTLLIB_LINKED) { 342 345 343 - bshort_gi_enabled = (pHTInfo->cur_tx_bw40mhz && 344 - pHTInfo->bCurShortGI40MHz) || 345 - (!pHTInfo->cur_tx_bw40mhz && 346 - pHTInfo->bCurShortGI20MHz); 346 + bshort_gi_enabled = (ht_info->cur_tx_bw40mhz && 347 + ht_info->bCurShortGI40MHz) || 348 + (!ht_info->cur_tx_bw40mhz && 349 + ht_info->bCurShortGI20MHz); 347 350 348 351 pra->upper_rssi_threshold_ratr = 349 352 (pra->upper_rssi_threshold_ratr & (~BIT31)) | ··· 628 631 629 632 for (j = 0; j <= 30; j++) { 630 633 631 - tx_cmd.Op = TXCMD_SET_TX_PWR_TRACKING; 632 - tx_cmd.Length = 4; 633 - tx_cmd.Value = Value; 634 + tx_cmd.op = TXCMD_SET_TX_PWR_TRACKING; 635 + tx_cmd.length = 4; 636 + tx_cmd.value = Value; 634 637 rtl92e_send_cmd_pkt(dev, DESC_PACKET_TYPE_NORMAL, (u8 *)&tx_cmd, 635 638 sizeof(struct dcmd_txcmd)); 636 639 mdelay(1); ··· 716 719 } 717 720 718 721 if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20) 719 - priv->CCKPresentAttentuation = 722 + priv->cck_present_attn = 720 723 priv->CCKPresentAttentuation_20Mdefault + 721 724 priv->CCKPresentAttentuation_difference; 722 725 else 723 - priv->CCKPresentAttentuation = 726 + priv->cck_present_attn = 724 727 priv->CCKPresentAttentuation_40Mdefault + 725 728 priv->CCKPresentAttentuation_difference; 726 729 727 - if (priv->CCKPresentAttentuation > (CCKTxBBGainTableLength-1)) 728 - priv->CCKPresentAttentuation = CCKTxBBGainTableLength-1; 729 - if (priv->CCKPresentAttentuation < 0) 730 - priv->CCKPresentAttentuation = 0; 730 + if (priv->cck_present_attn > (CCKTxBBGainTableLength-1)) 731 + priv->cck_present_attn = CCKTxBBGainTableLength-1; 732 + if (priv->cck_present_attn < 0) 733 + priv->cck_present_attn = 0; 731 734 732 - if (priv->CCKPresentAttentuation > -1 && 733 - priv->CCKPresentAttentuation < CCKTxBBGainTableLength) { 735 + if (priv->cck_present_attn > -1 && 736 + priv->cck_present_attn < CCKTxBBGainTableLength) { 734 737 if (priv->rtllib->current_network.channel == 14 && 735 738 !priv->bcck_in_ch14) { 736 739 priv->bcck_in_ch14 = true; ··· 774 777 tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance, 775 778 bMaskDWord); 776 779 for (i = 0; i < OFDM_Table_Length; i++) { 777 - if (tmpRegA == OFDMSwingTable[i]) { 780 + if (tmpRegA == OFDMSwingTable[i]) 778 781 priv->OFDM_index[0] = i; 779 - } 780 782 } 781 783 782 784 TempCCk = rtl92e_get_bb_reg(dev, rCCK0_TxFilter1, bMaskByte2); ··· 963 967 { 964 968 u32 TempVal; 965 969 struct r8192_priv *priv = rtllib_priv(dev); 966 - u8 attenuation = priv->CCKPresentAttentuation; 970 + u8 attenuation = priv->cck_present_attn; 967 971 968 972 TempVal = 0; 969 973 if (!bInCH14) { ··· 1062 1066 u32 reg_ratr = priv->rate_adaptive.last_ratr; 1063 1067 u32 ratr_value; 1064 1068 1065 - if (!priv->up) { 1069 + if (!priv->up) 1066 1070 return; 1067 - } 1068 1071 1069 1072 if (priv->rate_adaptive.rate_adaptive_disabled) 1070 1073 return; ··· 1138 1143 1139 1144 dm_digtable.dig_state = DM_STA_DIG_MAX; 1140 1145 dm_digtable.dig_highpwr_state = DM_STA_DIG_MAX; 1141 - dm_digtable.CurSTAConnectState = DIG_STA_DISCONNECT; 1142 - dm_digtable.PreSTAConnectState = DIG_STA_DISCONNECT; 1146 + dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT; 1147 + dm_digtable.pre_sta_connect_state = DIG_STA_DISCONNECT; 1143 1148 1144 1149 dm_digtable.rssi_low_thresh = DM_DIG_THRESH_LOW; 1145 1150 dm_digtable.rssi_high_thresh = DM_DIG_THRESH_HIGH; ··· 1207 1212 } 1208 1213 1209 1214 if (priv->rtllib->state == RTLLIB_LINKED) 1210 - dm_digtable.CurSTAConnectState = DIG_STA_CONNECT; 1215 + dm_digtable.cur_sta_connect_state = DIG_STA_CONNECT; 1211 1216 else 1212 - dm_digtable.CurSTAConnectState = DIG_STA_DISCONNECT; 1217 + dm_digtable.cur_sta_connect_state = DIG_STA_DISCONNECT; 1213 1218 1214 1219 1215 1220 dm_digtable.rssi_val = priv->undecorated_smoothed_pwdb; ··· 1218 1223 _rtl92e_dm_cs_ratio(dev); 1219 1224 if (dm_digtable.dig_algorithm_switch) 1220 1225 dm_digtable.dig_algorithm_switch = 0; 1221 - dm_digtable.PreSTAConnectState = dm_digtable.CurSTAConnectState; 1226 + dm_digtable.pre_sta_connect_state = dm_digtable.cur_sta_connect_state; 1222 1227 1223 1228 } 1224 1229 ··· 1368 1373 return; 1369 1374 } 1370 1375 1371 - if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) { 1372 - if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) { 1376 + if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) { 1377 + if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) { 1373 1378 long gain_range = dm_digtable.rssi_val + 10 - 1374 1379 dm_digtable.backoff_val; 1375 1380 gain_range = clamp_t(long, gain_range, ··· 1419 1424 reset_cnt = 0; 1420 1425 } 1421 1426 1422 - if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) { 1423 - if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) { 1427 + if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) { 1428 + if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) { 1424 1429 if (dm_digtable.rssi_val >= 1425 1430 dm_digtable.rssi_high_power_highthresh) 1426 1431 dm_digtable.curpd_thstate = ··· 1487 1492 reset_cnt = 0; 1488 1493 } 1489 1494 1490 - if (dm_digtable.PreSTAConnectState == dm_digtable.CurSTAConnectState) { 1491 - if (dm_digtable.CurSTAConnectState == DIG_STA_CONNECT) { 1495 + if (dm_digtable.pre_sta_connect_state == dm_digtable.cur_sta_connect_state) { 1496 + if (dm_digtable.cur_sta_connect_state == DIG_STA_CONNECT) { 1492 1497 if (dm_digtable.rssi_val <= dm_digtable.rssi_low_thresh) 1493 1498 dm_digtable.curcs_ratio_state = DIG_CS_RATIO_LOWER; 1494 1499 else if (dm_digtable.rssi_val >= dm_digtable.rssi_high_thresh) ··· 1532 1537 static void _rtl92e_dm_check_edca_turbo(struct net_device *dev) 1533 1538 { 1534 1539 struct r8192_priv *priv = rtllib_priv(dev); 1535 - struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo; 1540 + struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; 1536 1541 1537 1542 static unsigned long lastTxOkCnt; 1538 1543 static unsigned long lastRxOkCnt; ··· 1543 1548 goto dm_CheckEdcaTurbo_EXIT; 1544 1549 if (priv->rtllib->state != RTLLIB_LINKED) 1545 1550 goto dm_CheckEdcaTurbo_EXIT; 1546 - if (priv->rtllib->pHTInfo->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO) 1551 + if (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_DISABLE_EDCA_TURBO) 1547 1552 goto dm_CheckEdcaTurbo_EXIT; 1548 1553 1549 1554 if (!priv->rtllib->bis_any_nonbepkts) { 1550 1555 curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; 1551 1556 curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; 1552 - if (pHTInfo->iot_action & HT_IOT_ACT_EDCA_BIAS_ON_RX) { 1557 + if (ht_info->iot_action & HT_IOT_ACT_EDCA_BIAS_ON_RX) { 1553 1558 if (curTxOkCnt > 4*curRxOkCnt) { 1554 1559 if (priv->bis_cur_rdlstate || 1555 1560 !priv->bcurrent_turbo_EDCA) { 1556 1561 rtl92e_writel(dev, EDCAPARA_BE, 1557 - edca_setting_UL[pHTInfo->IOTPeer]); 1562 + edca_setting_UL[ht_info->IOTPeer]); 1558 1563 priv->bis_cur_rdlstate = false; 1559 1564 } 1560 1565 } else { ··· 1562 1567 !priv->bcurrent_turbo_EDCA) { 1563 1568 if (priv->rtllib->mode == WIRELESS_MODE_G) 1564 1569 rtl92e_writel(dev, EDCAPARA_BE, 1565 - edca_setting_DL_GMode[pHTInfo->IOTPeer]); 1570 + edca_setting_DL_GMode[ht_info->IOTPeer]); 1566 1571 else 1567 1572 rtl92e_writel(dev, EDCAPARA_BE, 1568 - edca_setting_DL[pHTInfo->IOTPeer]); 1573 + edca_setting_DL[ht_info->IOTPeer]); 1569 1574 priv->bis_cur_rdlstate = true; 1570 1575 } 1571 1576 } ··· 1576 1581 !priv->bcurrent_turbo_EDCA) { 1577 1582 if (priv->rtllib->mode == WIRELESS_MODE_G) 1578 1583 rtl92e_writel(dev, EDCAPARA_BE, 1579 - edca_setting_DL_GMode[pHTInfo->IOTPeer]); 1584 + edca_setting_DL_GMode[ht_info->IOTPeer]); 1580 1585 else 1581 1586 rtl92e_writel(dev, EDCAPARA_BE, 1582 - edca_setting_DL[pHTInfo->IOTPeer]); 1587 + edca_setting_DL[ht_info->IOTPeer]); 1583 1588 priv->bis_cur_rdlstate = true; 1584 1589 } 1585 1590 } else { 1586 1591 if (priv->bis_cur_rdlstate || 1587 1592 !priv->bcurrent_turbo_EDCA) { 1588 1593 rtl92e_writel(dev, EDCAPARA_BE, 1589 - edca_setting_UL[pHTInfo->IOTPeer]); 1594 + edca_setting_UL[ht_info->IOTPeer]); 1590 1595 priv->bis_cur_rdlstate = false; 1591 1596 } 1592 1597 ··· 1621 1626 static void _rtl92e_dm_cts_to_self(struct net_device *dev) 1622 1627 { 1623 1628 struct r8192_priv *priv = rtllib_priv((struct net_device *)dev); 1624 - struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo; 1629 + struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; 1625 1630 static unsigned long lastTxOkCnt; 1626 1631 static unsigned long lastRxOkCnt; 1627 1632 unsigned long curTxOkCnt = 0; 1628 1633 unsigned long curRxOkCnt = 0; 1629 1634 1630 1635 if (!priv->rtllib->bCTSToSelfEnable) { 1631 - pHTInfo->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; 1636 + ht_info->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; 1632 1637 return; 1633 1638 } 1634 - if (pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) { 1639 + if (ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { 1635 1640 curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; 1636 1641 curRxOkCnt = priv->stats.rxbytesunicast - lastRxOkCnt; 1637 1642 if (curRxOkCnt > 4*curTxOkCnt) 1638 - pHTInfo->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; 1643 + ht_info->iot_action &= ~HT_IOT_ACT_FORCED_CTS2SELF; 1639 1644 else 1640 - pHTInfo->iot_action |= HT_IOT_ACT_FORCED_CTS2SELF; 1645 + ht_info->iot_action |= HT_IOT_ACT_FORCED_CTS2SELF; 1641 1646 1642 1647 lastTxOkCnt = priv->stats.txbytesunicast; 1643 1648 lastRxOkCnt = priv->stats.rxbytesunicast; ··· 1648 1653 static void _rtl92e_dm_init_wa_broadcom_iot(struct net_device *dev) 1649 1654 { 1650 1655 struct r8192_priv *priv = rtllib_priv((struct net_device *)dev); 1651 - struct rt_hi_throughput *pHTInfo = priv->rtllib->pHTInfo; 1656 + struct rt_hi_throughput *ht_info = priv->rtllib->ht_info; 1652 1657 1653 - pHTInfo->bWAIotBroadcom = false; 1654 - pHTInfo->WAIotTH = WAIotTHVal; 1658 + ht_info->bWAIotBroadcom = false; 1659 + ht_info->WAIotTH = WAIotTHVal; 1655 1660 } 1656 1661 1657 1662 static void _rtl92e_dm_check_rf_ctrl_gpio(void *data) ··· 1693 1698 1694 1699 if (bActuallySet) { 1695 1700 mdelay(1000); 1696 - priv->bHwRfOffAction = 1; 1701 + priv->hw_rf_off_action = 1; 1697 1702 rtl92e_set_rf_state(dev, rf_power_state_to_set, RF_CHANGE_BY_HW); 1698 1703 if (priv->hw_radio_off) 1699 1704 argv[1] = "RFOFF"; ··· 1992 1997 1993 1998 if (priv->rtllib->state == RTLLIB_LINKED && 1994 1999 priv->rtllib->bfsync_enable && 1995 - (priv->rtllib->pHTInfo->iot_action & HT_IOT_ACT_CDD_FSYNC)) { 2000 + (priv->rtllib->ht_info->iot_action & HT_IOT_ACT_CDD_FSYNC)) { 1996 2001 u32 rate_bitmap; 1997 2002 1998 2003 for (rate_index = 0; rate_index <= 27; rate_index++) { ··· 2121 2126 static void _rtl92e_dm_start_sw_fsync(struct net_device *dev) 2122 2127 { 2123 2128 struct r8192_priv *priv = rtllib_priv(dev); 2124 - u32 rateIndex; 2125 - u32 rateBitmap; 2129 + u32 rate_index; 2130 + u32 rate_bitmap; 2126 2131 2127 2132 priv->rate_record = 0; 2128 2133 priv->ContinueDiffCount = 0; ··· 2136 2141 priv->rtllib->fsync_firstdiff_ratethreshold = 200; 2137 2142 priv->rtllib->fsync_seconddiff_ratethreshold = 200; 2138 2143 } 2139 - for (rateIndex = 0; rateIndex <= 27; rateIndex++) { 2140 - rateBitmap = 1 << rateIndex; 2141 - if (priv->rtllib->fsync_rate_bitmap & rateBitmap) 2144 + for (rate_index = 0; rate_index <= 27; rate_index++) { 2145 + rate_bitmap = 1 << rate_index; 2146 + if (priv->rtllib->fsync_rate_bitmap & rate_bitmap) 2142 2147 priv->rate_record += 2143 2148 priv->stats.received_rate_histogram[1] 2144 - [rateIndex]; 2149 + [rate_index]; 2145 2150 } 2146 2151 if (timer_pending(&priv->fsync_timer)) 2147 2152 del_timer_sync(&priv->fsync_timer); ··· 2163 2168 static u32 reset_cnt; 2164 2169 2165 2170 if (priv->rtllib->state == RTLLIB_LINKED && 2166 - priv->rtllib->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) { 2171 + priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) { 2167 2172 if (priv->rtllib->bfsync_enable == 0) { 2168 2173 switch (priv->rtllib->fsync_state) { 2169 2174 case Default_Fsync: ··· 2288 2293 priv->bDynamicTxLowPower = false; 2289 2294 return; 2290 2295 } 2291 - if ((priv->rtllib->pHTInfo->IOTPeer == HT_IOT_PEER_ATHEROS) && 2296 + if ((priv->rtllib->ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) && 2292 2297 (priv->rtllib->mode == IEEE_G)) { 2293 2298 txhipower_threshold = TX_POWER_ATHEROAP_THRESH_HIGH; 2294 2299 txlowpower_threshold = TX_POWER_ATHEROAP_THRESH_LOW;
+5 -5
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h
··· 66 66 67 67 u8 dig_state; 68 68 u8 dig_highpwr_state; 69 - u8 CurSTAConnectState; 70 - u8 PreSTAConnectState; 69 + u8 cur_sta_connect_state; 70 + u8 pre_sta_connect_state; 71 71 72 72 u8 curpd_thstate; 73 73 u8 prepd_thstate; ··· 152 152 153 153 154 154 struct dcmd_txcmd { 155 - u32 Op; 156 - u32 Length; 157 - u32 Value; 155 + u32 op; 156 + u32 length; 157 + u32 value; 158 158 }; 159 159 /*------------------------------Define structure----------------------------*/ 160 160
+1 -1
drivers/staging/rtl8192e/rtl8192e/rtl_eeprom.c
··· 79 79 ret = _rtl92e_eeprom_xfer(dev, (addr & 0x3F) | (0x6 << 6), 9); 80 80 81 81 rtl92e_writeb(dev, EPROM_CMD, 82 - (EPROM_CMD_NORMAL<<EPROM_CMD_OPERATING_MODE_SHIFT)); 82 + (EPROM_CMD_NORMAL << EPROM_CMD_OPERATING_MODE_SHIFT)); 83 83 return ret; 84 84 }
+39 -56
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
··· 100 100 static void _rtl92e_ps_update_rf_state(struct net_device *dev) 101 101 { 102 102 struct r8192_priv *priv = rtllib_priv(dev); 103 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 104 - &(priv->rtllib->PowerSaveControl); 103 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 104 + &priv->rtllib->pwr_save_ctrl; 105 105 106 - pPSC->bSwRfProcessing = true; 107 - rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS); 106 + psc->bSwRfProcessing = true; 107 + rtl92e_set_rf_state(dev, psc->eInactivePowerState, RF_CHANGE_BY_IPS); 108 108 109 - pPSC->bSwRfProcessing = false; 109 + psc->bSwRfProcessing = false; 110 110 } 111 111 112 112 void rtl92e_ips_enter(struct net_device *dev) 113 113 { 114 114 struct r8192_priv *priv = rtllib_priv(dev); 115 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 116 - &(priv->rtllib->PowerSaveControl); 115 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 116 + &priv->rtllib->pwr_save_ctrl; 117 117 enum rt_rf_power_state rt_state; 118 118 119 - if (pPSC->bInactivePs) { 120 - rt_state = priv->rtllib->rf_power_state; 121 - if (rt_state == rf_on && !pPSC->bSwRfProcessing && 122 - (priv->rtllib->state != RTLLIB_LINKED) && 123 - (priv->rtllib->iw_mode != IW_MODE_MASTER)) { 124 - pPSC->eInactivePowerState = rf_off; 125 - priv->isRFOff = true; 126 - priv->bInPowerSaveMode = true; 127 - _rtl92e_ps_update_rf_state(dev); 128 - } 119 + rt_state = priv->rtllib->rf_power_state; 120 + if (rt_state == rf_on && !psc->bSwRfProcessing && 121 + (priv->rtllib->state != RTLLIB_LINKED) && 122 + (priv->rtllib->iw_mode != IW_MODE_MASTER)) { 123 + psc->eInactivePowerState = rf_off; 124 + _rtl92e_ps_update_rf_state(dev); 129 125 } 130 126 } 131 127 132 128 void rtl92e_ips_leave(struct net_device *dev) 133 129 { 134 130 struct r8192_priv *priv = rtllib_priv(dev); 135 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 136 - &(priv->rtllib->PowerSaveControl); 131 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 132 + &priv->rtllib->pwr_save_ctrl; 137 133 enum rt_rf_power_state rt_state; 138 134 139 - if (pPSC->bInactivePs) { 140 - rt_state = priv->rtllib->rf_power_state; 141 - if (rt_state != rf_on && !pPSC->bSwRfProcessing && 142 - priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) { 143 - pPSC->eInactivePowerState = rf_on; 144 - priv->bInPowerSaveMode = false; 145 - _rtl92e_ps_update_rf_state(dev); 146 - } 135 + rt_state = priv->rtllib->rf_power_state; 136 + if (rt_state != rf_on && !psc->bSwRfProcessing && 137 + priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) { 138 + psc->eInactivePowerState = rf_on; 139 + _rtl92e_ps_update_rf_state(dev); 147 140 } 148 141 } 149 142 ··· 158 165 enum rt_rf_power_state rt_state; 159 166 160 167 rt_state = priv->rtllib->rf_power_state; 161 - 162 - if (priv->rtllib->PowerSaveControl.bInactivePs) { 163 - if (rt_state == rf_off) { 164 - if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { 165 - netdev_warn(dev, "%s(): RF is OFF.\n", 166 - __func__); 167 - return; 168 - } 169 - netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n", 168 + if (rt_state == rf_off) { 169 + if (priv->rtllib->rf_off_reason > RF_CHANGE_BY_IPS) { 170 + netdev_warn(dev, "%s(): RF is OFF.\n", 170 171 __func__); 171 - schedule_work(&priv->rtllib->ips_leave_wq); 172 + return; 172 173 } 174 + netdev_info(dev, "=========>%s(): rtl92e_ips_leave\n", 175 + __func__); 176 + schedule_work(&priv->rtllib->ips_leave_wq); 173 177 } 174 178 } 175 179 ··· 206 216 void rtl92e_leisure_ps_enter(struct net_device *dev) 207 217 { 208 218 struct r8192_priv *priv = rtllib_priv(dev); 209 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 210 - &(priv->rtllib->PowerSaveControl); 219 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 220 + &priv->rtllib->pwr_save_ctrl; 211 221 212 222 if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) && 213 223 (priv->rtllib->state == RTLLIB_LINKED)) ··· 215 225 (priv->rtllib->iw_mode == IW_MODE_MASTER)) 216 226 return; 217 227 218 - if (pPSC->bLeisurePs) { 219 - if (pPSC->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) { 228 + if (psc->bLeisurePs) { 229 + if (psc->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) { 220 230 221 231 if (priv->rtllib->ps == RTLLIB_PS_DISABLED) { 222 - if (!pPSC->bFwCtrlLPS) { 223 - if (priv->rtllib->SetFwCmdHandler) 224 - priv->rtllib->SetFwCmdHandler( 225 - dev, FW_CMD_LPS_ENTER); 226 - } 232 + if (priv->rtllib->SetFwCmdHandler) 233 + priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_ENTER); 227 234 _rtl92e_ps_set_mode(dev, RTLLIB_PS_MBCAST | 228 235 RTLLIB_PS_UNICAST); 229 236 } 230 237 } else 231 - pPSC->LpsIdleCount++; 238 + psc->LpsIdleCount++; 232 239 } 233 240 } 234 241 235 242 void rtl92e_leisure_ps_leave(struct net_device *dev) 236 243 { 237 244 struct r8192_priv *priv = rtllib_priv(dev); 238 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 239 - &(priv->rtllib->PowerSaveControl); 245 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 246 + &priv->rtllib->pwr_save_ctrl; 240 247 241 - if (pPSC->bLeisurePs) { 248 + if (psc->bLeisurePs) { 242 249 if (priv->rtllib->ps != RTLLIB_PS_DISABLED) { 243 250 _rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED); 244 - 245 - if (!pPSC->bFwCtrlLPS) { 246 - if (priv->rtllib->SetFwCmdHandler) 247 - priv->rtllib->SetFwCmdHandler(dev, 248 - FW_CMD_LPS_LEAVE); 249 - } 251 + if (priv->rtllib->SetFwCmdHandler) 252 + priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_LEAVE); 250 253 } 251 254 } 252 255 }
+45 -49
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
··· 159 159 union iwreq_data *wrqu, char *extra) 160 160 { 161 161 struct r8192_priv *priv = rtllib_priv(dev); 162 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 163 - (&priv->rtllib->PowerSaveControl); 162 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 163 + (&priv->rtllib->pwr_save_ctrl); 164 164 struct rtllib_device *ieee = priv->rtllib; 165 165 166 166 mutex_lock(&priv->wx_mutex); 167 167 168 168 if (*extra || priv->force_lps) { 169 169 priv->ps_force = false; 170 - pPSC->bLeisurePs = true; 170 + psc->bLeisurePs = true; 171 171 } else { 172 172 if (priv->rtllib->state == RTLLIB_LINKED) 173 173 rtl92e_leisure_ps_leave(dev); 174 174 175 175 priv->ps_force = true; 176 - pPSC->bLeisurePs = false; 176 + psc->bLeisurePs = false; 177 177 ieee->ps = *extra; 178 178 } 179 179 ··· 188 188 char *extra) 189 189 { 190 190 struct r8192_priv *priv = rtllib_priv(dev); 191 - struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) 192 - (&priv->rtllib->PowerSaveControl); 191 + struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *) 192 + (&priv->rtllib->pwr_save_ctrl); 193 193 194 194 mutex_lock(&priv->wx_mutex); 195 195 196 196 netdev_info(dev, "%s(): set lps awake interval ! extra is %d\n", 197 197 __func__, *extra); 198 198 199 - pPSC->RegMaxLPSAwakeIntvl = *extra; 199 + psc->reg_max_lps_awake_intvl = *extra; 200 200 mutex_unlock(&priv->wx_mutex); 201 201 return 0; 202 202 } ··· 251 251 rt_state = priv->rtllib->rf_power_state; 252 252 mutex_lock(&priv->wx_mutex); 253 253 if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR || 254 - ieee->bNetPromiscuousMode) { 255 - if (priv->rtllib->PowerSaveControl.bInactivePs) { 256 - if (rt_state == rf_off) { 257 - if (priv->rtllib->rf_off_reason > 258 - RF_CHANGE_BY_IPS) { 259 - netdev_warn(dev, "%s(): RF is OFF.\n", 260 - __func__); 261 - mutex_unlock(&priv->wx_mutex); 262 - return -1; 263 - } 264 - netdev_info(dev, 265 - "=========>%s(): rtl92e_ips_leave\n", 254 + ieee->net_promiscuous_md) { 255 + if (rt_state == rf_off) { 256 + if (priv->rtllib->rf_off_reason > 257 + RF_CHANGE_BY_IPS) { 258 + netdev_warn(dev, "%s(): RF is OFF.\n", 266 259 __func__); 267 - mutex_lock(&priv->rtllib->ips_mutex); 268 - rtl92e_ips_leave(dev); 269 - mutex_unlock(&priv->rtllib->ips_mutex); 260 + mutex_unlock(&priv->wx_mutex); 261 + return -1; 270 262 } 263 + netdev_info(dev, 264 + "=========>%s(): rtl92e_ips_leave\n", 265 + __func__); 266 + mutex_lock(&priv->rtllib->ips_mutex); 267 + rtl92e_ips_leave(dev); 268 + mutex_unlock(&priv->rtllib->ips_mutex); 271 269 } 272 270 } 273 271 ret = rtllib_wx_set_mode(priv->rtllib, a, wrqu, b); ··· 393 395 rt_state = priv->rtllib->rf_power_state; 394 396 if (!priv->up) 395 397 return -ENETDOWN; 396 - if (priv->rtllib->LinkDetectInfo.bBusyTraffic == true) 398 + if (priv->rtllib->link_detect_info.bBusyTraffic == true) 397 399 return -EAGAIN; 398 400 399 401 if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { ··· 412 414 priv->rtllib->FirstIe_InScan = true; 413 415 414 416 if (priv->rtllib->state != RTLLIB_LINKED) { 415 - if (priv->rtllib->PowerSaveControl.bInactivePs) { 416 - if (rt_state == rf_off) { 417 - if (priv->rtllib->rf_off_reason > 418 - RF_CHANGE_BY_IPS) { 419 - netdev_warn(dev, "%s(): RF is OFF.\n", 420 - __func__); 421 - mutex_unlock(&priv->wx_mutex); 422 - return -1; 423 - } 424 - mutex_lock(&priv->rtllib->ips_mutex); 425 - rtl92e_ips_leave(dev); 426 - mutex_unlock(&priv->rtllib->ips_mutex); 417 + if (rt_state == rf_off) { 418 + if (priv->rtllib->rf_off_reason > 419 + RF_CHANGE_BY_IPS) { 420 + netdev_warn(dev, "%s(): RF is OFF.\n", 421 + __func__); 422 + mutex_unlock(&priv->wx_mutex); 423 + return -1; 427 424 } 425 + mutex_lock(&priv->rtllib->ips_mutex); 426 + rtl92e_ips_leave(dev); 427 + mutex_unlock(&priv->rtllib->ips_mutex); 428 428 } 429 429 rtllib_stop_scan(priv->rtllib); 430 430 if (priv->rtllib->LedControlHandler) ··· 915 919 key, 0); 916 920 } else { 917 921 if ((ieee->pairwise_key_type == KEY_TYPE_CCMP) && 918 - ieee->pHTInfo->bCurrentHTSupport) 922 + ieee->ht_info->bCurrentHTSupport) 919 923 rtl92e_writeb(dev, 0x173, 1); 920 924 rtl92e_set_key(dev, 4, idx, alg, 921 925 (u8 *)ieee->ap_mac_addr, 0, key); ··· 1014 1018 u32 info_buf[3]; 1015 1019 1016 1020 u32 oid; 1017 - u32 bPromiscuousOn; 1018 - u32 bFilterSourceStationFrame; 1021 + u32 promiscuous_on; 1022 + u32 fltr_src_sta_frame; 1019 1023 1020 1024 if (copy_from_user(info_buf, wrqu->data.pointer, sizeof(info_buf))) 1021 1025 return -EFAULT; 1022 1026 1023 1027 oid = info_buf[0]; 1024 - bPromiscuousOn = info_buf[1]; 1025 - bFilterSourceStationFrame = info_buf[2]; 1028 + promiscuous_on = info_buf[1]; 1029 + fltr_src_sta_frame = info_buf[2]; 1026 1030 1027 1031 if (oid == OID_RT_INTEL_PROMISCUOUS_MODE) { 1028 - ieee->IntelPromiscuousModeInfo.bPromiscuousOn = 1029 - (bPromiscuousOn) ? (true) : (false); 1030 - ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame = 1031 - (bFilterSourceStationFrame) ? (true) : (false); 1032 - (bPromiscuousOn) ? 1032 + ieee->intel_promiscuous_md_info.promiscuous_on = 1033 + (promiscuous_on) ? (true) : (false); 1034 + ieee->intel_promiscuous_md_info.fltr_src_sta_frame = 1035 + (fltr_src_sta_frame) ? (true) : (false); 1036 + (promiscuous_on) ? 1033 1037 (rtllib_EnableIntelPromiscuousMode(dev, false)) : 1034 1038 (rtllib_DisableIntelPromiscuousMode(dev, false)); 1035 1039 1036 1040 netdev_info(dev, 1037 1041 "=======>%s(), on = %d, filter src sta = %d\n", 1038 - __func__, bPromiscuousOn, 1039 - bFilterSourceStationFrame); 1042 + __func__, promiscuous_on, 1043 + fltr_src_sta_frame); 1040 1044 } else { 1041 1045 return -1; 1042 1046 } ··· 1054 1058 mutex_lock(&priv->wx_mutex); 1055 1059 1056 1060 snprintf(extra, 45, "PromiscuousMode:%d, FilterSrcSTAFrame:%d", 1057 - ieee->IntelPromiscuousModeInfo.bPromiscuousOn, 1058 - ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame); 1061 + ieee->intel_promiscuous_md_info.promiscuous_on, 1062 + ieee->intel_promiscuous_md_info.fltr_src_sta_frame); 1059 1063 wrqu->data.length = strlen(extra) + 1; 1060 1064 1061 1065 mutex_unlock(&priv->wx_mutex);
+18 -20
drivers/staging/rtl8192e/rtl819x_BAProc.c
··· 62 62 pBA->dialog_token = 0; 63 63 pBA->ba_start_seq_ctrl.short_data = 0; 64 64 } 65 + 65 66 static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, 66 67 struct ba_record *pBA, 67 68 u16 StatusCode, u8 type) ··· 112 111 tag += 2; 113 112 114 113 if (type == ACT_ADDBAREQ) { 115 - memcpy(tag, (u8 *)&(pBA->ba_start_seq_ctrl), 2); 114 + memcpy(tag, (u8 *)&pBA->ba_start_seq_ctrl, 2); 116 115 tag += 2; 117 116 } 118 117 ··· 160 159 *tag++ = ACT_CAT_BA; 161 160 *tag++ = ACT_DELBA; 162 161 163 - 164 162 put_unaligned_le16(DelbaParamSet.short_data, tag); 165 163 tag += 2; 166 164 ··· 180 180 181 181 skb = rtllib_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); 182 182 183 - if (skb) { 183 + if (skb) 184 184 softmac_mgmt_xmit(skb, ieee); 185 - } else { 185 + else 186 186 netdev_dbg(ieee->dev, "Failed to generate ADDBAReq packet.\n"); 187 - } 188 187 } 189 188 190 189 static void rtllib_send_ADDBARsp(struct rtllib_device *ieee, u8 *dst, ··· 244 245 pBaStartSeqCtrl = (union sequence_control *)(req + 7); 245 246 246 247 if (!ieee->current_network.qos_data.active || 247 - !ieee->pHTInfo->bCurrentHTSupport || 248 - (ieee->pHTInfo->iot_action & HT_IOT_ACT_REJECT_ADDBA_REQ)) { 248 + !ieee->ht_info->bCurrentHTSupport || 249 + (ieee->ht_info->iot_action & HT_IOT_ACT_REJECT_ADDBA_REQ)) { 249 250 rc = ADDBA_STATUS_REFUSED; 250 251 netdev_warn(ieee->dev, 251 252 "Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n", 252 253 ieee->current_network.qos_data.active, 253 - ieee->pHTInfo->bCurrentHTSupport); 254 + ieee->ht_info->bCurrentHTSupport); 254 255 goto OnADDBAReq_Fail; 255 256 } 256 - if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst, 257 - (u8)(pBaParamSet->field.tid), RX_DIR, true)) { 257 + if (!GetTs(ieee, (struct ts_common_info **)&pTS, dst, 258 + (u8)(pBaParamSet->field.tid), RX_DIR, true)) { 258 259 rc = ADDBA_STATUS_REFUSED; 259 260 netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); 260 261 goto OnADDBAReq_Fail; ··· 277 278 pBA->ba_start_seq_ctrl = *pBaStartSeqCtrl; 278 279 279 280 if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev) || 280 - (ieee->pHTInfo->iot_action & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT)) 281 + (ieee->ht_info->iot_action & HT_IOT_ACT_ALLOW_PEER_AGG_ONE_PKT)) 281 282 pBA->ba_param_set.field.buffer_size = 1; 282 283 else 283 284 pBA->ba_param_set.field.buffer_size = 32; ··· 326 327 pBaTimeoutVal = (u16 *)(tag + 7); 327 328 328 329 if (!ieee->current_network.qos_data.active || 329 - !ieee->pHTInfo->bCurrentHTSupport || 330 - !ieee->pHTInfo->bCurrentAMPDUEnable) { 330 + !ieee->ht_info->bCurrentHTSupport || 331 + !ieee->ht_info->bCurrentAMPDUEnable) { 331 332 netdev_warn(ieee->dev, 332 333 "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n", 333 334 ieee->current_network.qos_data.active, 334 - ieee->pHTInfo->bCurrentHTSupport, 335 - ieee->pHTInfo->bCurrentAMPDUEnable); 335 + ieee->ht_info->bCurrentHTSupport, 336 + ieee->ht_info->bCurrentAMPDUEnable); 336 337 ReasonCode = DELBA_REASON_UNKNOWN_BA; 337 338 goto OnADDBARsp_Reject; 338 339 } 339 340 340 - if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst, 341 + if (!GetTs(ieee, (struct ts_common_info **)&pTS, dst, 341 342 (u8)(pBaParamSet->field.tid), TX_DIR, false)) { 342 343 netdev_warn(ieee->dev, "%s(): can't get TS\n", __func__); 343 344 ReasonCode = DELBA_REASON_UNKNOWN_BA; ··· 373 374 ReasonCode = DELBA_REASON_END_BA; 374 375 goto OnADDBARsp_Reject; 375 376 } 376 - 377 377 378 378 pAdmittedBA->dialog_token = *pDialogToken; 379 379 pAdmittedBA->ba_timeout_value = *pBaTimeoutVal; ··· 413 415 } 414 416 415 417 if (!ieee->current_network.qos_data.active || 416 - !ieee->pHTInfo->bCurrentHTSupport) { 418 + !ieee->ht_info->bCurrentHTSupport) { 417 419 netdev_warn(ieee->dev, 418 420 "received DELBA while QOS or HT is not supported(%d, %d)\n", 419 421 ieee->current_network. qos_data.active, 420 - ieee->pHTInfo->bCurrentHTSupport); 422 + ieee->ht_info->bCurrentHTSupport); 421 423 return -1; 422 424 } 423 425 ··· 433 435 struct rx_ts_record *pRxTs; 434 436 435 437 if (!GetTs(ieee, (struct ts_common_info **)&pRxTs, dst, 436 - (u8)pDelBaParamSet->field.tid, RX_DIR, false)) { 438 + (u8)pDelBaParamSet->field.tid, RX_DIR, false)) { 437 439 netdev_warn(ieee->dev, 438 440 "%s(): can't get TS for RXTS. dst:%pM TID:%d\n", 439 441 __func__, dst,
+1 -1
drivers/staging/rtl8192e/rtl819x_HT.h
··· 96 96 97 97 98 98 struct rt_hi_throughput { 99 - u8 bEnableHT; 99 + u8 enable_ht; 100 100 u8 bCurrentHTSupport; 101 101 102 102 u8 bRegBW40MHz;
+201 -204
drivers/staging/rtl8192e/rtl819x_HTProc.c
··· 69 69 70 70 void HTUpdateDefaultSetting(struct rtllib_device *ieee) 71 71 { 72 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 73 - pHTInfo->bRegShortGI20MHz = 1; 74 - pHTInfo->bRegShortGI40MHz = 1; 72 + struct rt_hi_throughput *ht_info = ieee->ht_info; 75 73 76 - pHTInfo->bRegBW40MHz = 1; 74 + ht_info->bRegShortGI20MHz = 1; 75 + ht_info->bRegShortGI40MHz = 1; 77 76 78 - if (pHTInfo->bRegBW40MHz) 79 - pHTInfo->bRegSuppCCK = 1; 77 + ht_info->bRegBW40MHz = 1; 78 + 79 + if (ht_info->bRegBW40MHz) 80 + ht_info->bRegSuppCCK = 1; 80 81 else 81 - pHTInfo->bRegSuppCCK = true; 82 + ht_info->bRegSuppCCK = true; 82 83 83 - pHTInfo->nAMSDU_MaxSize = 7935UL; 84 - pHTInfo->bAMSDU_Support = 0; 84 + ht_info->nAMSDU_MaxSize = 7935UL; 85 + ht_info->bAMSDU_Support = 0; 85 86 86 - pHTInfo->bAMPDUEnable = 1; 87 - pHTInfo->AMPDU_Factor = 2; 88 - pHTInfo->MPDU_Density = 0; 87 + ht_info->bAMPDUEnable = 1; 88 + ht_info->AMPDU_Factor = 2; 89 + ht_info->MPDU_Density = 0; 89 90 90 - pHTInfo->self_mimo_ps = 3; 91 - if (pHTInfo->self_mimo_ps == 2) 92 - pHTInfo->self_mimo_ps = 3; 93 - ieee->bTxDisableRateFallBack = 0; 94 - ieee->bTxUseDriverAssingedRate = 0; 91 + ht_info->self_mimo_ps = 3; 92 + if (ht_info->self_mimo_ps == 2) 93 + ht_info->self_mimo_ps = 3; 94 + ieee->tx_dis_rate_fallback = 0; 95 + ieee->tx_use_drv_assinged_rate = 0; 95 96 96 97 ieee->bTxEnableFwCalcDur = 1; 97 98 98 - pHTInfo->reg_rt2rt_aggregation = 1; 99 + ht_info->reg_rt2rt_aggregation = 1; 99 100 100 - pHTInfo->reg_rx_reorder_enable = 1; 101 - pHTInfo->rx_reorder_win_size = 64; 102 - pHTInfo->rx_reorder_pending_time = 30; 101 + ht_info->reg_rx_reorder_enable = 1; 102 + ht_info->rx_reorder_win_size = 64; 103 + ht_info->rx_reorder_pending_time = 30; 103 104 } 104 105 105 106 static u16 HTMcsToDataRate(struct rtllib_device *ieee, u8 nMcsRate) 106 107 { 107 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 108 + struct rt_hi_throughput *ht_info = ieee->ht_info; 108 109 109 - u8 is40MHz = (pHTInfo->bCurBW40MHz) ? 1 : 0; 110 - u8 isShortGI = (pHTInfo->bCurBW40MHz) ? 111 - ((pHTInfo->bCurShortGI40MHz) ? 1 : 0) : 112 - ((pHTInfo->bCurShortGI20MHz) ? 1 : 0); 110 + u8 is40MHz = (ht_info->bCurBW40MHz) ? 1 : 0; 111 + u8 isShortGI = (ht_info->bCurBW40MHz) ? 112 + ((ht_info->bCurShortGI40MHz) ? 1 : 0) : 113 + ((ht_info->bCurShortGI20MHz) ? 1 : 0); 113 114 return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate & 0x7f)]; 114 115 } 115 116 ··· 152 151 (net->ralink_cap_exist)) 153 152 retValue = true; 154 153 else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) || 155 - !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) || 156 - !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) || 154 + !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) || 155 + !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) || 157 156 (net->broadcom_cap_exist)) 158 157 retValue = true; 159 158 else if (net->bssht.bd_rt2rt_aggregation) ··· 166 165 167 166 static void HTIOTPeerDetermine(struct rtllib_device *ieee) 168 167 { 169 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 168 + struct rt_hi_throughput *ht_info = ieee->ht_info; 170 169 struct rtllib_network *net = &ieee->current_network; 171 170 172 171 if (net->bssht.bd_rt2rt_aggregation) { 173 - pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK; 172 + ht_info->IOTPeer = HT_IOT_PEER_REALTEK; 174 173 if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_92SE) 175 - pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK_92SE; 174 + ht_info->IOTPeer = HT_IOT_PEER_REALTEK_92SE; 176 175 if (net->bssht.rt2rt_ht_mode & RT_HT_CAP_USE_SOFTAP) 177 - pHTInfo->IOTPeer = HT_IOT_PEER_92U_SOFTAP; 176 + ht_info->IOTPeer = HT_IOT_PEER_92U_SOFTAP; 178 177 } else if (net->broadcom_cap_exist) { 179 - pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM; 178 + ht_info->IOTPeer = HT_IOT_PEER_BROADCOM; 180 179 } else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) || 181 180 !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) || 182 181 !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)) { 183 - pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM; 182 + ht_info->IOTPeer = HT_IOT_PEER_BROADCOM; 184 183 } else if ((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3) == 0) || 185 184 (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3) == 0) || 186 185 (memcmp(net->bssid, PCI_RALINK, 3) == 0) || 187 186 (memcmp(net->bssid, EDIMAX_RALINK, 3) == 0) || 188 187 (memcmp(net->bssid, AIRLINK_RALINK, 3) == 0) || 189 188 net->ralink_cap_exist) { 190 - pHTInfo->IOTPeer = HT_IOT_PEER_RALINK; 189 + ht_info->IOTPeer = HT_IOT_PEER_RALINK; 191 190 } else if ((net->atheros_cap_exist) || 192 191 (memcmp(net->bssid, DLINK_ATHEROS_1, 3) == 0) || 193 192 (memcmp(net->bssid, DLINK_ATHEROS_2, 3) == 0)) { 194 - pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS; 193 + ht_info->IOTPeer = HT_IOT_PEER_ATHEROS; 195 194 } else if ((memcmp(net->bssid, CISCO_BROADCOM, 3) == 0) || 196 195 net->cisco_cap_exist) { 197 - pHTInfo->IOTPeer = HT_IOT_PEER_CISCO; 196 + ht_info->IOTPeer = HT_IOT_PEER_CISCO; 198 197 } else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) || 199 198 net->marvell_cap_exist) { 200 - pHTInfo->IOTPeer = HT_IOT_PEER_MARVELL; 199 + ht_info->IOTPeer = HT_IOT_PEER_MARVELL; 201 200 } else if (net->airgo_cap_exist) { 202 - pHTInfo->IOTPeer = HT_IOT_PEER_AIRGO; 201 + ht_info->IOTPeer = HT_IOT_PEER_AIRGO; 203 202 } else { 204 - pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN; 203 + ht_info->IOTPeer = HT_IOT_PEER_UNKNOWN; 205 204 } 206 205 207 - netdev_dbg(ieee->dev, "IOTPEER: %x\n", pHTInfo->IOTPeer); 206 + netdev_dbg(ieee->dev, "IOTPEER: %x\n", ht_info->IOTPeer); 208 207 } 209 208 210 209 static u8 HTIOTActIsDisableMCS14(struct rtllib_device *ieee, u8 *PeerMacAddr) ··· 233 232 { 234 233 u8 retValue = 0; 235 234 236 - if (ieee->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) 235 + if (ieee->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) 237 236 retValue = 1; 238 237 239 238 return retValue; ··· 243 242 { 244 243 u8 retValue = 0; 245 244 246 - if (ieee->pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) 245 + if (ieee->ht_info->IOTPeer == HT_IOT_PEER_BROADCOM) 247 246 retValue = 1; 248 247 return retValue; 249 248 } 250 249 251 250 static void HTIOTActDetermineRaFunc(struct rtllib_device *ieee, bool bPeerRx2ss) 252 251 { 253 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 252 + struct rt_hi_throughput *ht_info = ieee->ht_info; 254 253 255 - pHTInfo->iot_ra_func &= HT_IOT_RAFUNC_DISABLE_ALL; 254 + ht_info->iot_ra_func &= HT_IOT_RAFUNC_DISABLE_ALL; 256 255 257 - if (pHTInfo->IOTPeer == HT_IOT_PEER_RALINK && !bPeerRx2ss) 258 - pHTInfo->iot_ra_func |= HT_IOT_RAFUNC_PEER_1R; 256 + if (ht_info->IOTPeer == HT_IOT_PEER_RALINK && !bPeerRx2ss) 257 + ht_info->iot_ra_func |= HT_IOT_RAFUNC_PEER_1R; 259 258 260 - if (pHTInfo->iot_action & HT_IOT_ACT_AMSDU_ENABLE) 261 - pHTInfo->iot_ra_func |= HT_IOT_RAFUNC_TX_AMSDU; 259 + if (ht_info->iot_action & HT_IOT_ACT_AMSDU_ENABLE) 260 + ht_info->iot_ra_func |= HT_IOT_RAFUNC_TX_AMSDU; 262 261 } 263 262 264 - void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo) 263 + void HTResetIOTSetting(struct rt_hi_throughput *ht_info) 265 264 { 266 - pHTInfo->iot_action = 0; 267 - pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN; 268 - pHTInfo->iot_ra_func = 0; 265 + ht_info->iot_action = 0; 266 + ht_info->IOTPeer = HT_IOT_PEER_UNKNOWN; 267 + ht_info->iot_ra_func = 0; 269 268 } 270 269 271 270 void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, 272 271 u8 *len, u8 IsEncrypt, bool bAssoc) 273 272 { 274 - struct rt_hi_throughput *pHT = ieee->pHTInfo; 273 + struct rt_hi_throughput *pHT = ieee->ht_info; 275 274 struct ht_capab_ele *pCapELE = NULL; 276 275 277 276 if (!posHTCap || !pHT) { 278 277 netdev_warn(ieee->dev, 279 - "%s(): posHTCap and pHTInfo are null\n", __func__); 278 + "%s(): posHTCap and ht_info are null\n", __func__); 280 279 return; 281 280 } 282 281 memset(posHTCap, 0, *len); 283 282 284 283 if ((bAssoc) && (pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC)) { 285 - u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; 284 + static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 }; 286 285 287 286 memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap)); 288 - pCapELE = (struct ht_capab_ele *)&(posHTCap[4]); 287 + pCapELE = (struct ht_capab_ele *)&posHTCap[4]; 289 288 *len = 30 + 2; 290 289 } else { 291 290 pCapELE = (struct ht_capab_ele *)posHTCap; ··· 323 322 pCapELE->MPDUDensity = 0; 324 323 } 325 324 326 - memcpy(pCapELE->MCS, ieee->Regdot11HTOperationalRateSet, 16); 325 + memcpy(pCapELE->MCS, ieee->reg_dot11ht_oper_rate_set, 16); 327 326 memset(&pCapELE->ExtHTCapInfo, 0, 2); 328 327 memset(pCapELE->TxBFCap, 0, 4); 329 328 ··· 352 351 void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo, 353 352 u8 *len, u8 IsEncrypt) 354 353 { 355 - struct rt_hi_throughput *pHT = ieee->pHTInfo; 354 + struct rt_hi_throughput *pHT = ieee->ht_info; 356 355 struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo; 357 356 358 357 if (!posHTInfo || !pHTInfoEle) { ··· 489 488 u8 i; 490 489 491 490 for (i = 0; i <= 15; i++) 492 - pOperateMCS[i] = ieee->Regdot11TxHTOperationalRateSet[i] & 491 + pOperateMCS[i] = ieee->reg_dot11tx_ht_oper_rate_set[i] & 493 492 pSupportMCS[i]; 494 493 495 494 HT_PickMCSRate(ieee, pOperateMCS); ··· 509 508 510 509 void HTOnAssocRsp(struct rtllib_device *ieee) 511 510 { 512 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 511 + struct rt_hi_throughput *ht_info = ieee->ht_info; 513 512 struct ht_capab_ele *pPeerHTCap = NULL; 514 513 struct ht_info_ele *pPeerHTInfo = NULL; 515 514 u16 nMaxAMSDUSize = 0; 516 515 u8 *pMcsFilter = NULL; 517 516 518 - static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; 519 - static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34}; 517 + static const u8 EWC11NHTCap[] = { 0x00, 0x90, 0x4c, 0x33 }; 518 + static const u8 EWC11NHTInfo[] = { 0x00, 0x90, 0x4c, 0x34 }; 520 519 521 - if (!pHTInfo->bCurrentHTSupport) { 520 + if (!ht_info->bCurrentHTSupport) { 522 521 netdev_warn(ieee->dev, "%s(): HT_DISABLE\n", __func__); 523 522 return; 524 523 } 525 524 netdev_dbg(ieee->dev, "%s(): HT_ENABLE\n", __func__); 526 525 527 - if (!memcmp(pHTInfo->PeerHTCapBuf, EWC11NHTCap, sizeof(EWC11NHTCap))) 528 - pPeerHTCap = (struct ht_capab_ele *)(&pHTInfo->PeerHTCapBuf[4]); 526 + if (!memcmp(ht_info->PeerHTCapBuf, EWC11NHTCap, sizeof(EWC11NHTCap))) 527 + pPeerHTCap = (struct ht_capab_ele *)(&ht_info->PeerHTCapBuf[4]); 529 528 else 530 - pPeerHTCap = (struct ht_capab_ele *)(pHTInfo->PeerHTCapBuf); 529 + pPeerHTCap = (struct ht_capab_ele *)(ht_info->PeerHTCapBuf); 531 530 532 - if (!memcmp(pHTInfo->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo))) 531 + if (!memcmp(ht_info->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo))) 533 532 pPeerHTInfo = (struct ht_info_ele *) 534 - (&pHTInfo->PeerHTInfoBuf[4]); 533 + (&ht_info->PeerHTInfoBuf[4]); 535 534 else 536 - pPeerHTInfo = (struct ht_info_ele *)(pHTInfo->PeerHTInfoBuf); 535 + pPeerHTInfo = (struct ht_info_ele *)(ht_info->PeerHTInfoBuf); 537 536 538 537 #ifdef VERBOSE_DEBUG 539 538 print_hex_dump_bytes("%s: ", __func__, DUMP_PREFIX_NONE, 540 539 pPeerHTCap, sizeof(struct ht_capab_ele)); 541 540 #endif 542 541 HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth), 543 - (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset)); 544 - pHTInfo->cur_tx_bw40mhz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ? 542 + (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset)); 543 + ht_info->cur_tx_bw40mhz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ? 545 544 true : false); 546 545 547 - pHTInfo->bCurShortGI20MHz = ((pHTInfo->bRegShortGI20MHz) ? 546 + ht_info->bCurShortGI20MHz = ((ht_info->bRegShortGI20MHz) ? 548 547 ((pPeerHTCap->ShortGI20Mhz == 1) ? 549 548 true : false) : false); 550 - pHTInfo->bCurShortGI40MHz = ((pHTInfo->bRegShortGI40MHz) ? 549 + ht_info->bCurShortGI40MHz = ((ht_info->bRegShortGI40MHz) ? 551 550 ((pPeerHTCap->ShortGI40Mhz == 1) ? 552 551 true : false) : false); 553 552 554 - pHTInfo->bCurSuppCCK = ((pHTInfo->bRegSuppCCK) ? 553 + ht_info->bCurSuppCCK = ((ht_info->bRegSuppCCK) ? 555 554 ((pPeerHTCap->DssCCk == 1) ? true : 556 555 false) : false); 557 556 558 - pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support; 557 + ht_info->bCurrent_AMSDU_Support = ht_info->bAMSDU_Support; 559 558 560 559 nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize == 0) ? 3839 : 7935; 561 560 562 - if (pHTInfo->nAMSDU_MaxSize > nMaxAMSDUSize) 563 - pHTInfo->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize; 561 + if (ht_info->nAMSDU_MaxSize > nMaxAMSDUSize) 562 + ht_info->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize; 564 563 else 565 - pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize; 564 + ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize; 566 565 567 - pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable; 566 + ht_info->bCurrentAMPDUEnable = ht_info->bAMPDUEnable; 568 567 if (ieee->rtllib_ap_sec_type && 569 - (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) { 570 - if ((pHTInfo->IOTPeer == HT_IOT_PEER_ATHEROS) || 571 - (pHTInfo->IOTPeer == HT_IOT_PEER_UNKNOWN)) 572 - pHTInfo->bCurrentAMPDUEnable = false; 568 + (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) { 569 + if ((ht_info->IOTPeer == HT_IOT_PEER_ATHEROS) || 570 + (ht_info->IOTPeer == HT_IOT_PEER_UNKNOWN)) 571 + ht_info->bCurrentAMPDUEnable = false; 573 572 } 574 573 575 - if (!pHTInfo->reg_rt2rt_aggregation) { 576 - if (pHTInfo->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor) 577 - pHTInfo->CurrentAMPDUFactor = 574 + if (!ht_info->reg_rt2rt_aggregation) { 575 + if (ht_info->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor) 576 + ht_info->CurrentAMPDUFactor = 578 577 pPeerHTCap->MaxRxAMPDUFactor; 579 578 else 580 - pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; 579 + ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor; 581 580 582 581 } else { 583 582 if (ieee->current_network.bssht.bd_rt2rt_aggregation) { 584 583 if (ieee->pairwise_key_type != KEY_TYPE_NA) 585 - pHTInfo->CurrentAMPDUFactor = 584 + ht_info->CurrentAMPDUFactor = 586 585 pPeerHTCap->MaxRxAMPDUFactor; 587 586 else 588 - pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_64K; 587 + ht_info->CurrentAMPDUFactor = HT_AGG_SIZE_64K; 589 588 } else { 590 - if (pPeerHTCap->MaxRxAMPDUFactor < HT_AGG_SIZE_32K) 591 - pHTInfo->CurrentAMPDUFactor = 592 - pPeerHTCap->MaxRxAMPDUFactor; 593 - else 594 - pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_32K; 589 + ht_info->CurrentAMPDUFactor = min_t(u32, pPeerHTCap->MaxRxAMPDUFactor, 590 + HT_AGG_SIZE_32K); 595 591 } 596 592 } 597 - if (pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity) 598 - pHTInfo->current_mpdu_density = pHTInfo->MPDU_Density; 599 - else 600 - pHTInfo->current_mpdu_density = pPeerHTCap->MPDUDensity; 601 - if (pHTInfo->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) { 602 - pHTInfo->bCurrentAMPDUEnable = false; 603 - pHTInfo->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE; 593 + ht_info->current_mpdu_density = max_t(u8, ht_info->MPDU_Density, 594 + pPeerHTCap->MPDUDensity); 595 + if (ht_info->iot_action & HT_IOT_ACT_TX_USE_AMSDU_8K) { 596 + ht_info->bCurrentAMPDUEnable = false; 597 + ht_info->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE; 604 598 } 605 - pHTInfo->cur_rx_reorder_enable = pHTInfo->reg_rx_reorder_enable; 599 + ht_info->cur_rx_reorder_enable = ht_info->reg_rx_reorder_enable; 606 600 607 601 if (pPeerHTCap->MCS[0] == 0) 608 602 pPeerHTCap->MCS[0] = 0xff; 609 603 610 604 HTIOTActDetermineRaFunc(ieee, ((pPeerHTCap->MCS[1]) != 0)); 611 605 612 - HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11HTOperationalRateSet); 606 + HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11ht_oper_rate_set); 613 607 614 - pHTInfo->peer_mimo_ps = pPeerHTCap->MimoPwrSave; 615 - if (pHTInfo->peer_mimo_ps == MIMO_PS_STATIC) 608 + ht_info->peer_mimo_ps = pPeerHTCap->MimoPwrSave; 609 + if (ht_info->peer_mimo_ps == MIMO_PS_STATIC) 616 610 pMcsFilter = MCS_FILTER_1SS; 617 611 else 618 612 pMcsFilter = MCS_FILTER_ALL; 619 613 ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, 620 - ieee->dot11HTOperationalRateSet, pMcsFilter); 614 + ieee->dot11ht_oper_rate_set, 615 + pMcsFilter); 621 616 ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate; 622 617 623 - pHTInfo->current_op_mode = pPeerHTInfo->OptMode; 618 + ht_info->current_op_mode = pPeerHTInfo->OptMode; 624 619 } 625 620 626 621 void HTInitializeHTInfo(struct rtllib_device *ieee) 627 622 { 628 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 623 + struct rt_hi_throughput *ht_info = ieee->ht_info; 629 624 630 - pHTInfo->bCurrentHTSupport = false; 625 + ht_info->bCurrentHTSupport = false; 631 626 632 - pHTInfo->bCurBW40MHz = false; 633 - pHTInfo->cur_tx_bw40mhz = false; 627 + ht_info->bCurBW40MHz = false; 628 + ht_info->cur_tx_bw40mhz = false; 634 629 635 - pHTInfo->bCurShortGI20MHz = false; 636 - pHTInfo->bCurShortGI40MHz = false; 637 - pHTInfo->forced_short_gi = false; 630 + ht_info->bCurShortGI20MHz = false; 631 + ht_info->bCurShortGI40MHz = false; 632 + ht_info->forced_short_gi = false; 638 633 639 - pHTInfo->bCurSuppCCK = true; 634 + ht_info->bCurSuppCCK = true; 640 635 641 - pHTInfo->bCurrent_AMSDU_Support = false; 642 - pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize; 643 - pHTInfo->current_mpdu_density = pHTInfo->MPDU_Density; 644 - pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; 636 + ht_info->bCurrent_AMSDU_Support = false; 637 + ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize; 638 + ht_info->current_mpdu_density = ht_info->MPDU_Density; 639 + ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor; 645 640 646 - memset((void *)(&(pHTInfo->SelfHTCap)), 0, 647 - sizeof(pHTInfo->SelfHTCap)); 648 - memset((void *)(&(pHTInfo->SelfHTInfo)), 0, 649 - sizeof(pHTInfo->SelfHTInfo)); 650 - memset((void *)(&(pHTInfo->PeerHTCapBuf)), 0, 651 - sizeof(pHTInfo->PeerHTCapBuf)); 652 - memset((void *)(&(pHTInfo->PeerHTInfoBuf)), 0, 653 - sizeof(pHTInfo->PeerHTInfoBuf)); 641 + memset((void *)(&ht_info->SelfHTCap), 0, 642 + sizeof(ht_info->SelfHTCap)); 643 + memset((void *)(&ht_info->SelfHTInfo), 0, 644 + sizeof(ht_info->SelfHTInfo)); 645 + memset((void *)(&ht_info->PeerHTCapBuf), 0, 646 + sizeof(ht_info->PeerHTCapBuf)); 647 + memset((void *)(&ht_info->PeerHTInfoBuf), 0, 648 + sizeof(ht_info->PeerHTInfoBuf)); 654 649 655 - pHTInfo->sw_bw_in_progress = false; 650 + ht_info->sw_bw_in_progress = false; 656 651 657 - pHTInfo->ePeerHTSpecVer = HT_SPEC_VER_IEEE; 652 + ht_info->ePeerHTSpecVer = HT_SPEC_VER_IEEE; 658 653 659 - pHTInfo->current_rt2rt_aggregation = false; 660 - pHTInfo->current_rt2rt_long_slot_time = false; 661 - pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0; 654 + ht_info->current_rt2rt_aggregation = false; 655 + ht_info->current_rt2rt_long_slot_time = false; 656 + ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0; 662 657 663 - pHTInfo->IOTPeer = 0; 664 - pHTInfo->iot_action = 0; 665 - pHTInfo->iot_ra_func = 0; 658 + ht_info->IOTPeer = 0; 659 + ht_info->iot_action = 0; 660 + ht_info->iot_ra_func = 0; 666 661 667 662 { 668 - u8 *RegHTSuppRateSets = &(ieee->RegHTSuppRateSet[0]); 663 + u8 *RegHTSuppRateSets = &ieee->reg_ht_supp_rate_set[0]; 669 664 670 665 RegHTSuppRateSets[0] = 0xFF; 671 666 RegHTSuppRateSets[1] = 0xFF; ··· 687 690 void HTResetSelfAndSavePeerSetting(struct rtllib_device *ieee, 688 691 struct rtllib_network *pNetwork) 689 692 { 690 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 693 + struct rt_hi_throughput *ht_info = ieee->ht_info; 691 694 u8 bIOTAction = 0; 692 695 693 - /* unmark bEnableHT flag here is the same reason why unmarked in 696 + /* unmark enable_ht flag here is the same reason why unmarked in 694 697 * function rtllib_softmac_new_net. WB 2008.09.10 695 698 */ 696 699 if (pNetwork->bssht.bd_support_ht) { 697 - pHTInfo->bCurrentHTSupport = true; 698 - pHTInfo->ePeerHTSpecVer = pNetwork->bssht.bd_ht_spec_ver; 700 + ht_info->bCurrentHTSupport = true; 701 + ht_info->ePeerHTSpecVer = pNetwork->bssht.bd_ht_spec_ver; 699 702 700 703 if (pNetwork->bssht.bd_ht_cap_len > 0 && 701 - pNetwork->bssht.bd_ht_cap_len <= sizeof(pHTInfo->PeerHTCapBuf)) 702 - memcpy(pHTInfo->PeerHTCapBuf, 704 + pNetwork->bssht.bd_ht_cap_len <= sizeof(ht_info->PeerHTCapBuf)) 705 + memcpy(ht_info->PeerHTCapBuf, 703 706 pNetwork->bssht.bd_ht_cap_buf, 704 707 pNetwork->bssht.bd_ht_cap_len); 705 708 706 709 if (pNetwork->bssht.bd_ht_info_len > 0 && 707 710 pNetwork->bssht.bd_ht_info_len <= 708 - sizeof(pHTInfo->PeerHTInfoBuf)) 709 - memcpy(pHTInfo->PeerHTInfoBuf, 711 + sizeof(ht_info->PeerHTInfoBuf)) 712 + memcpy(ht_info->PeerHTInfoBuf, 710 713 pNetwork->bssht.bd_ht_info_buf, 711 714 pNetwork->bssht.bd_ht_info_len); 712 715 713 - if (pHTInfo->reg_rt2rt_aggregation) { 714 - pHTInfo->current_rt2rt_aggregation = 716 + if (ht_info->reg_rt2rt_aggregation) { 717 + ht_info->current_rt2rt_aggregation = 715 718 pNetwork->bssht.bd_rt2rt_aggregation; 716 - pHTInfo->current_rt2rt_long_slot_time = 719 + ht_info->current_rt2rt_long_slot_time = 717 720 pNetwork->bssht.bd_rt2rt_long_slot_time; 718 - pHTInfo->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode; 721 + ht_info->RT2RT_HT_Mode = pNetwork->bssht.rt2rt_ht_mode; 719 722 } else { 720 - pHTInfo->current_rt2rt_aggregation = false; 721 - pHTInfo->current_rt2rt_long_slot_time = false; 722 - pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0; 723 + ht_info->current_rt2rt_aggregation = false; 724 + ht_info->current_rt2rt_long_slot_time = false; 725 + ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0; 723 726 } 724 727 725 728 HTIOTPeerDetermine(ieee); 726 729 727 - pHTInfo->iot_action = 0; 730 + ht_info->iot_action = 0; 728 731 bIOTAction = HTIOTActIsDisableMCS14(ieee, pNetwork->bssid); 729 732 if (bIOTAction) 730 - pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_MCS14; 733 + ht_info->iot_action |= HT_IOT_ACT_DISABLE_MCS14; 731 734 732 735 bIOTAction = HTIOTActIsDisableMCS15(ieee); 733 736 if (bIOTAction) 734 - pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_MCS15; 737 + ht_info->iot_action |= HT_IOT_ACT_DISABLE_MCS15; 735 738 736 739 bIOTAction = HTIOTActIsDisableMCSTwoSpatialStream(ieee); 737 740 if (bIOTAction) 738 - pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_ALL_2SS; 741 + ht_info->iot_action |= HT_IOT_ACT_DISABLE_ALL_2SS; 739 742 740 743 bIOTAction = HTIOTActIsDisableEDCATurbo(ieee, pNetwork->bssid); 741 744 if (bIOTAction) 742 - pHTInfo->iot_action |= HT_IOT_ACT_DISABLE_EDCA_TURBO; 745 + ht_info->iot_action |= HT_IOT_ACT_DISABLE_EDCA_TURBO; 743 746 744 747 bIOTAction = HTIOTActIsMgntUseCCK6M(ieee, pNetwork); 745 748 if (bIOTAction) 746 - pHTInfo->iot_action |= HT_IOT_ACT_MGNT_USE_CCK_6M; 749 + ht_info->iot_action |= HT_IOT_ACT_MGNT_USE_CCK_6M; 747 750 bIOTAction = HTIOTActIsCCDFsync(ieee); 748 751 if (bIOTAction) 749 - pHTInfo->iot_action |= HT_IOT_ACT_CDD_FSYNC; 752 + ht_info->iot_action |= HT_IOT_ACT_CDD_FSYNC; 750 753 } else { 751 - pHTInfo->bCurrentHTSupport = false; 752 - pHTInfo->current_rt2rt_aggregation = false; 753 - pHTInfo->current_rt2rt_long_slot_time = false; 754 - pHTInfo->RT2RT_HT_Mode = (enum rt_ht_capability)0; 754 + ht_info->bCurrentHTSupport = false; 755 + ht_info->current_rt2rt_aggregation = false; 756 + ht_info->current_rt2rt_long_slot_time = false; 757 + ht_info->RT2RT_HT_Mode = (enum rt_ht_capability)0; 755 758 756 - pHTInfo->iot_action = 0; 757 - pHTInfo->iot_ra_func = 0; 759 + ht_info->iot_action = 0; 760 + ht_info->iot_ra_func = 0; 758 761 } 759 762 } 760 763 761 764 void HT_update_self_and_peer_setting(struct rtllib_device *ieee, 762 765 struct rtllib_network *pNetwork) 763 766 { 764 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 767 + struct rt_hi_throughput *ht_info = ieee->ht_info; 765 768 struct ht_info_ele *pPeerHTInfo = 766 769 (struct ht_info_ele *)pNetwork->bssht.bd_ht_info_buf; 767 770 768 - if (pHTInfo->bCurrentHTSupport) { 771 + if (ht_info->bCurrentHTSupport) { 769 772 if (pNetwork->bssht.bd_ht_info_len != 0) 770 - pHTInfo->current_op_mode = pPeerHTInfo->OptMode; 773 + ht_info->current_op_mode = pPeerHTInfo->OptMode; 771 774 } 772 775 } 773 776 EXPORT_SYMBOL(HT_update_self_and_peer_setting); 774 777 775 778 void HTUseDefaultSetting(struct rtllib_device *ieee) 776 779 { 777 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 780 + struct rt_hi_throughput *ht_info = ieee->ht_info; 778 781 779 - if (pHTInfo->bEnableHT) { 780 - pHTInfo->bCurrentHTSupport = true; 781 - pHTInfo->bCurSuppCCK = pHTInfo->bRegSuppCCK; 782 + if (ht_info->enable_ht) { 783 + ht_info->bCurrentHTSupport = true; 784 + ht_info->bCurSuppCCK = ht_info->bRegSuppCCK; 782 785 783 - pHTInfo->bCurBW40MHz = pHTInfo->bRegBW40MHz; 784 - pHTInfo->bCurShortGI20MHz = pHTInfo->bRegShortGI20MHz; 786 + ht_info->bCurBW40MHz = ht_info->bRegBW40MHz; 787 + ht_info->bCurShortGI20MHz = ht_info->bRegShortGI20MHz; 785 788 786 - pHTInfo->bCurShortGI40MHz = pHTInfo->bRegShortGI40MHz; 789 + ht_info->bCurShortGI40MHz = ht_info->bRegShortGI40MHz; 787 790 788 791 if (ieee->iw_mode == IW_MODE_ADHOC) 789 792 ieee->current_network.qos_data.active = 790 793 ieee->current_network.qos_data.supported; 791 - pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support; 792 - pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize; 794 + ht_info->bCurrent_AMSDU_Support = ht_info->bAMSDU_Support; 795 + ht_info->nCurrent_AMSDU_MaxSize = ht_info->nAMSDU_MaxSize; 793 796 794 - pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable; 795 - pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor; 797 + ht_info->bCurrentAMPDUEnable = ht_info->bAMPDUEnable; 798 + ht_info->CurrentAMPDUFactor = ht_info->AMPDU_Factor; 796 799 797 - pHTInfo->current_mpdu_density = pHTInfo->current_mpdu_density; 800 + ht_info->current_mpdu_density = ht_info->current_mpdu_density; 798 801 799 - HTFilterMCSRate(ieee, ieee->Regdot11TxHTOperationalRateSet, 800 - ieee->dot11HTOperationalRateSet); 802 + HTFilterMCSRate(ieee, ieee->reg_dot11tx_ht_oper_rate_set, 803 + ieee->dot11ht_oper_rate_set); 801 804 ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, 802 - ieee->dot11HTOperationalRateSet, 803 - MCS_FILTER_ALL); 805 + ieee->dot11ht_oper_rate_set, 806 + MCS_FILTER_ALL); 804 807 ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate; 805 808 806 809 } else { 807 - pHTInfo->bCurrentHTSupport = false; 810 + ht_info->bCurrentHTSupport = false; 808 811 } 809 812 } 810 813 811 814 u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame) 812 815 { 813 - if (ieee->pHTInfo->bCurrentHTSupport) { 816 + if (ieee->ht_info->bCurrentHTSupport) { 814 817 if ((IsQoSDataFrame(pFrame) && Frame_Order(pFrame)) == 1) { 815 818 netdev_dbg(ieee->dev, "HT CONTROL FILED EXIST!!\n"); 816 819 return true; ··· 821 824 822 825 static void HTSetConnectBwModeCallback(struct rtllib_device *ieee) 823 826 { 824 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 827 + struct rt_hi_throughput *ht_info = ieee->ht_info; 825 828 826 - if (pHTInfo->bCurBW40MHz) { 827 - if (pHTInfo->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER) 829 + if (ht_info->bCurBW40MHz) { 830 + if (ht_info->CurSTAExtChnlOffset == HT_EXTCHNL_OFFSET_UPPER) 828 831 ieee->set_chan(ieee->dev, 829 832 ieee->current_network.channel + 2); 830 - else if (pHTInfo->CurSTAExtChnlOffset == 833 + else if (ht_info->CurSTAExtChnlOffset == 831 834 HT_EXTCHNL_OFFSET_LOWER) 832 835 ieee->set_chan(ieee->dev, 833 836 ieee->current_network.channel - 2); ··· 836 839 ieee->current_network.channel); 837 840 838 841 ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20_40, 839 - pHTInfo->CurSTAExtChnlOffset); 842 + ht_info->CurSTAExtChnlOffset); 840 843 } else { 841 844 ieee->set_chan(ieee->dev, ieee->current_network.channel); 842 845 ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, 843 846 HT_EXTCHNL_OFFSET_NO_EXT); 844 847 } 845 848 846 - pHTInfo->sw_bw_in_progress = false; 849 + ht_info->sw_bw_in_progress = false; 847 850 } 848 851 849 852 void HTSetConnectBwMode(struct rtllib_device *ieee, 850 853 enum ht_channel_width bandwidth, 851 854 enum ht_extchnl_offset Offset) 852 855 { 853 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 856 + struct rt_hi_throughput *ht_info = ieee->ht_info; 854 857 855 - if (!pHTInfo->bRegBW40MHz) 858 + if (!ht_info->bRegBW40MHz) 856 859 return; 857 860 858 861 if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) 859 862 bandwidth = HT_CHANNEL_WIDTH_20; 860 863 861 - if (pHTInfo->sw_bw_in_progress) { 864 + if (ht_info->sw_bw_in_progress) { 862 865 pr_info("%s: sw_bw_in_progress!!\n", __func__); 863 866 return; 864 867 } ··· 868 871 Offset = HT_EXTCHNL_OFFSET_NO_EXT; 869 872 if (Offset == HT_EXTCHNL_OFFSET_UPPER || 870 873 Offset == HT_EXTCHNL_OFFSET_LOWER) { 871 - pHTInfo->bCurBW40MHz = true; 872 - pHTInfo->CurSTAExtChnlOffset = Offset; 874 + ht_info->bCurBW40MHz = true; 875 + ht_info->CurSTAExtChnlOffset = Offset; 873 876 } else { 874 - pHTInfo->bCurBW40MHz = false; 875 - pHTInfo->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; 877 + ht_info->bCurBW40MHz = false; 878 + ht_info->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; 876 879 } 877 880 } else { 878 - pHTInfo->bCurBW40MHz = false; 879 - pHTInfo->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; 881 + ht_info->bCurBW40MHz = false; 882 + ht_info->CurSTAExtChnlOffset = HT_EXTCHNL_OFFSET_NO_EXT; 880 883 } 881 884 882 - netdev_dbg(ieee->dev, "%s():pHTInfo->bCurBW40MHz:%x\n", __func__, 883 - pHTInfo->bCurBW40MHz); 885 + netdev_dbg(ieee->dev, "%s():ht_info->bCurBW40MHz:%x\n", __func__, 886 + ht_info->bCurBW40MHz); 884 887 885 - pHTInfo->sw_bw_in_progress = true; 888 + ht_info->sw_bw_in_progress = true; 886 889 887 890 HTSetConnectBwModeCallback(ieee); 888 891 }
-7
drivers/staging/rtl8192e/rtl819x_Qos.h
··· 97 97 DIR_BI_DIR = 3, 98 98 }; 99 99 100 - enum acm_method { 101 - eAcmWay0_SwAndHw = 0, 102 - eAcmWay1_HW = 1, 103 - eAcmWay2_SW = 2, 104 - }; 105 - 106 - 107 100 struct acm { 108 101 u64 UsedTime; 109 102 u64 MediumTime;
+1 -1
drivers/staging/rtl8192e/rtl819x_TSProc.c
··· 83 83 if (bPktInBuf && (pRxTs->rx_timeout_indicate_seq == 0xffff)) { 84 84 pRxTs->rx_timeout_indicate_seq = pRxTs->rx_indicate_seq; 85 85 mod_timer(&pRxTs->rx_pkt_pending_timer, jiffies + 86 - msecs_to_jiffies(ieee->pHTInfo->rx_reorder_pending_time) 86 + msecs_to_jiffies(ieee->ht_info->rx_reorder_pending_time) 87 87 ); 88 88 } 89 89 spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
+22 -29
drivers/staging/rtl8192e/rtllib.h
··· 111 111 #define SUPPORT_CKIP_MIC 0x08 112 112 #define SUPPORT_CKIP_PK 0x10 113 113 #define RT_RF_OFF_LEVL_HALT_NIC BIT3 114 - #define RT_IN_PS_LEVEL(pPSC, _PS_FLAG) \ 115 - ((pPSC->CurPsLevel & _PS_FLAG) ? true : false) 116 - #define RT_CLEAR_PS_LEVEL(pPSC, _PS_FLAG) \ 117 - (pPSC->CurPsLevel &= (~(_PS_FLAG))) 118 - #define RT_SET_PS_LEVEL(pPSC, _PS_FLAG) (pPSC->CurPsLevel |= _PS_FLAG) 114 + #define RT_IN_PS_LEVEL(psc, _PS_FLAG) \ 115 + ((psc->CurPsLevel & _PS_FLAG) ? true : false) 116 + #define RT_CLEAR_PS_LEVEL(psc, _PS_FLAG) \ 117 + (psc->CurPsLevel &= (~(_PS_FLAG))) 118 + #define RT_SET_PS_LEVEL(psc, _PS_FLAG) (psc->CurPsLevel |= _PS_FLAG) 119 119 120 120 /* defined for skb cb field */ 121 121 /* At most 28 byte */ ··· 126 126 u8 bFirstSeg:1; 127 127 u8 bLastSeg:1; 128 128 u8 bEncrypt:1; 129 - u8 bTxDisableRateFallBack:1; 130 - u8 bTxUseDriverAssingedRate:1; 129 + u8 tx_dis_rate_fallback:1; 130 + u8 tx_use_drv_assinged_rate:1; 131 131 u8 bHwSec:1; 132 132 133 133 u8 nStuckCount; ··· 1250 1250 }; 1251 1251 1252 1252 struct rt_pwr_save_ctrl { 1253 - 1254 - bool bInactivePs; 1255 - bool bIPSModeBackup; 1256 1253 bool bSwRfProcessing; 1257 1254 enum rt_rf_power_state eInactivePowerState; 1258 1255 enum ips_callback_function ReturnPoint; 1259 1256 1260 1257 bool bLeisurePs; 1261 1258 u8 LpsIdleCount; 1262 - u8 RegMaxLPSAwakeIntvl; 1259 + u8 reg_max_lps_awake_intvl; 1263 1260 u8 LPSAwakeIntvl; 1264 1261 1265 1262 u32 CurPsLevel; 1266 1263 u32 RegRfPsLevel; 1267 - 1268 - bool bFwCtrlLPS; 1269 - 1270 1264 }; 1271 1265 1272 1266 #define RT_RF_CHANGE_SOURCE u32 ··· 1384 1390 }; 1385 1391 1386 1392 struct rt_intel_promisc_mode { 1387 - bool bPromiscuousOn; 1388 - bool bFilterSourceStationFrame; 1393 + bool promiscuous_on; 1394 + bool fltr_src_sta_frame; 1389 1395 }; 1390 1396 1391 1397 ··· 1432 1438 RT_RF_CHANGE_SOURCE rf_off_reason; 1433 1439 bool is_set_key; 1434 1440 bool wx_set_enc; 1435 - struct rt_hi_throughput *pHTInfo; 1441 + struct rt_hi_throughput *ht_info; 1436 1442 1437 1443 spinlock_t reorder_spinlock; 1438 - u8 Regdot11HTOperationalRateSet[16]; 1439 - u8 Regdot11TxHTOperationalRateSet[16]; 1440 - u8 dot11HTOperationalRateSet[16]; 1441 - u8 RegHTSuppRateSet[16]; 1444 + u8 reg_dot11ht_oper_rate_set[16]; 1445 + u8 reg_dot11tx_ht_oper_rate_set[16]; 1446 + u8 dot11ht_oper_rate_set[16]; 1447 + u8 reg_ht_supp_rate_set[16]; 1442 1448 u8 HTCurrentOperaRate; 1443 1449 u8 HTHighestOperaRate; 1444 - u8 bTxDisableRateFallBack; 1445 - u8 bTxUseDriverAssingedRate; 1450 + u8 tx_dis_rate_fallback; 1451 + u8 tx_use_drv_assinged_rate; 1446 1452 u8 bTxEnableFwCalcDur; 1447 1453 atomic_t atm_swbw; 1448 1454 ··· 1470 1476 int scan_age; 1471 1477 1472 1478 int iw_mode; /* operating mode (IW_MODE_*) */ 1473 - bool bNetPromiscuousMode; 1474 - struct rt_intel_promisc_mode IntelPromiscuousModeInfo; 1479 + bool net_promiscuous_md; 1480 + struct rt_intel_promisc_mode intel_promiscuous_md_info; 1475 1481 1476 1482 spinlock_t lock; 1477 1483 spinlock_t wpax_suitlist_lock; ··· 1624 1630 int mgmt_queue_tail; 1625 1631 u8 AsocRetryCount; 1626 1632 struct sk_buff_head skb_waitQ[MAX_QUEUE_SIZE]; 1627 - struct sk_buff_head skb_aggQ[MAX_QUEUE_SIZE]; 1628 1633 1629 1634 bool bdynamic_txpower_enable; 1630 1635 ··· 1642 1649 struct bandwidth_autoswitch bandwidth_auto_switch; 1643 1650 bool FwRWRF; 1644 1651 1645 - struct rt_link_detect LinkDetectInfo; 1652 + struct rt_link_detect link_detect_info; 1646 1653 bool bIsAggregateFrame; 1647 - struct rt_pwr_save_ctrl PowerSaveControl; 1654 + struct rt_pwr_save_ctrl pwr_save_ctrl; 1648 1655 1649 1656 /* used if IEEE_SOFTMAC_TX_QUEUE is set */ 1650 1657 struct tx_pending tx_pending; ··· 2088 2095 extern u8 MCS_FILTER_ALL[]; 2089 2096 extern u16 MCS_DATA_RATE[2][2][77]; 2090 2097 u8 HTCCheck(struct rtllib_device *ieee, u8 *pFrame); 2091 - void HTResetIOTSetting(struct rt_hi_throughput *pHTInfo); 2098 + void HTResetIOTSetting(struct rt_hi_throughput *ht_info); 2092 2099 bool IsHTHalfNmodeAPs(struct rtllib_device *ieee); 2093 2100 u16 TxCountToDataRate(struct rtllib_device *ieee, u8 nDataRate); 2094 2101 int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb);
+16 -36
drivers/staging/rtl8192e/rtllib_crypt_tkip.c
··· 62 62 return NULL; 63 63 64 64 priv = kzalloc(sizeof(*priv), GFP_ATOMIC); 65 - if (priv == NULL) 65 + if (!priv) 66 66 goto fail; 67 67 priv->key_idx = key_idx; 68 68 ··· 91 91 return NULL; 92 92 } 93 93 94 - 95 94 static void rtllib_tkip_deinit(void *priv) 96 95 { 97 96 struct rtllib_tkip_data *_priv = priv; ··· 102 103 kfree_sensitive(priv); 103 104 } 104 105 105 - 106 106 static inline u16 RotR1(u16 val) 107 107 { 108 108 return (val >> 1) | (val << 15); 109 109 } 110 - 111 110 112 111 static inline u8 Lo8(u16 val) 113 112 { 114 113 return val & 0xff; 115 114 } 116 115 117 - 118 116 static inline u8 Hi8(u16 val) 119 117 { 120 118 return val >> 8; 121 119 } 122 - 123 120 124 121 static inline u16 Lo16(u32 val) 125 122 { 126 123 return val & 0xffff; 127 124 } 128 125 129 - 130 126 static inline u16 Hi16(u32 val) 131 127 { 132 128 return val >> 16; 133 129 } 134 - 135 130 136 131 static inline u16 Mk16(u8 hi, u8 lo) 137 132 { 138 133 return lo | (hi << 8); 139 134 } 140 135 141 - 142 136 static inline u16 Mk16_le(u16 *v) 143 137 { 144 138 return *v; 145 139 } 146 - 147 140 148 141 static const u16 Sbox[256] = { 149 142 0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154, ··· 172 181 0x82C3, 0x29B0, 0x5A77, 0x1E11, 0x7BCB, 0xA8FC, 0x6DD6, 0x2C3A, 173 182 }; 174 183 175 - 176 184 static inline u16 _S_(u16 v) 177 185 { 178 186 u16 t = Sbox[Hi8(v)]; 179 187 return Sbox[Lo8(v)] ^ ((t << 8) | (t >> 8)); 180 188 } 181 189 182 - 183 190 #define PHASE1_LOOP_COUNT 8 184 - 185 191 186 192 static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32) 187 193 { ··· 200 212 TTAK[4] += _S_(TTAK[3] ^ Mk16(TK[1 + j], TK[0 + j])) + i; 201 213 } 202 214 } 203 - 204 215 205 216 static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK, 206 217 u16 IV16) ··· 250 263 #endif 251 264 } 252 265 253 - 254 266 static int rtllib_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) 255 267 { 256 268 struct rtllib_tkip_data *tkey = priv; ··· 271 285 if (!tcb_desc->bHwSec) { 272 286 if (!tkey->tx_phase1_done) { 273 287 tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2, 274 - tkey->tx_iv32); 288 + tkey->tx_iv32); 275 289 tkey->tx_phase1_done = 1; 276 290 } 277 291 tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak, 278 292 tkey->tx_iv16); 279 - } else 293 + } else { 280 294 tkey->tx_phase1_done = 1; 281 - 295 + } 282 296 283 297 len = skb->len - hdr_len; 284 298 pos = skb_push(skb, 8); ··· 322 336 if (!tcb_desc->bHwSec) 323 337 return ret; 324 338 return 0; 325 - 326 - 327 339 } 328 340 329 341 static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) ··· 373 389 374 390 if (!tcb_desc->bHwSec || (skb->cb[0] == 1)) { 375 391 if ((iv32 < tkey->rx_iv32 || 376 - (iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) && 377 - tkey->initialized) { 392 + (iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) && 393 + tkey->initialized) { 378 394 if (net_ratelimit()) { 379 395 netdev_dbg(skb->dev, 380 396 "Replay detected: STA= %pM previous TSC %08x%04x received TSC %08x%04x\n", ··· 420 436 tkey->dot11RSNAStatsTKIPICVErrors++; 421 437 return -5; 422 438 } 423 - 424 439 } 425 440 426 441 /* Update real counters only after Michael MIC verification has ··· 435 452 436 453 return keyidx; 437 454 } 438 - 439 455 440 456 static int michael_mic(struct crypto_shash *tfm_michael, u8 *key, u8 *hdr, 441 457 u8 *data, size_t data_len, u8 *mic) ··· 488 506 break; 489 507 } 490 508 491 - hdr[12] = 0; /* priority */ 509 + /* priority */ 510 + hdr[12] = 0; 492 511 493 - hdr[13] = hdr[14] = hdr[15] = 0; /* reserved */ 512 + /* reserved */ 513 + hdr[13] = 0; 514 + hdr[14] = 0; 515 + hdr[15] = 0; 494 516 } 495 - 496 517 497 518 static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv) 498 519 { ··· 518 533 tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07; 519 534 pos = skb_put(skb, 8); 520 535 if (michael_mic(tkey->tx_tfm_michael, &tkey->key[16], tkey->tx_hdr, 521 - skb->data + hdr_len, skb->len - 8 - hdr_len, pos)) 536 + skb->data + hdr_len, skb->len - 8 - hdr_len, pos)) 522 537 return -1; 523 538 524 539 return 0; 525 540 } 526 - 527 541 528 542 static void rtllib_michael_mic_failure(struct net_device *dev, 529 543 struct rtllib_hdr_4addr *hdr, ··· 593 609 return 0; 594 610 } 595 611 596 - 597 612 static int rtllib_tkip_set_key(void *key, int len, u8 *seq, void *priv) 598 613 { 599 614 struct rtllib_tkip_data *tkey = priv; ··· 615 632 (seq[3] << 8) | seq[2]; 616 633 tkey->rx_iv16 = (seq[1] << 8) | seq[0]; 617 634 } 618 - } else if (len == 0) 635 + } else if (len == 0) { 619 636 tkey->key_set = 0; 620 - else 637 + } else { 621 638 return -1; 639 + } 622 640 623 641 return 0; 624 642 } 625 - 626 643 627 644 static int rtllib_tkip_get_key(void *key, int len, u8 *seq, void *priv) 628 645 { ··· 653 670 654 671 return TKIP_KEY_LEN; 655 672 } 656 - 657 673 658 674 static void rtllib_tkip_print_stats(struct seq_file *m, void *priv) 659 675 { ··· 695 713 .owner = THIS_MODULE, 696 714 }; 697 715 698 - 699 716 static int __init rtllib_crypto_tkip_init(void) 700 717 { 701 718 return lib80211_register_crypto_ops(&rtllib_crypt_tkip); 702 719 } 703 - 704 720 705 721 static void __exit rtllib_crypto_tkip_exit(void) 706 722 {
-8
drivers/staging/rtl8192e/rtllib_crypt_wep.c
··· 27 27 struct arc4_ctx tx_ctx_arc4; 28 28 }; 29 29 30 - 31 30 static void *prism2_wep_init(int keyidx) 32 31 { 33 32 struct prism2_wep_data *priv; ··· 44 45 45 46 return priv; 46 47 } 47 - 48 48 49 49 static void prism2_wep_deinit(void *priv) 50 50 { ··· 118 120 return 0; 119 121 } 120 122 121 - 122 123 /* Perform WEP decryption on given struct buffer. Buffer includes whole WEP 123 124 * part of the frame: IV (4 bytes), encrypted payload (including SNAP header), 124 125 * ICV (4 bytes). len includes both IV and ICV. ··· 177 180 return 0; 178 181 } 179 182 180 - 181 183 static int prism2_wep_set_key(void *key, int len, u8 *seq, void *priv) 182 184 { 183 185 struct prism2_wep_data *wep = priv; ··· 190 194 return 0; 191 195 } 192 196 193 - 194 197 static int prism2_wep_get_key(void *key, int len, u8 *seq, void *priv) 195 198 { 196 199 struct prism2_wep_data *wep = priv; ··· 201 206 202 207 return wep->key_len; 203 208 } 204 - 205 209 206 210 static void prism2_wep_print_stats(struct seq_file *m, void *priv) 207 211 { ··· 225 231 .owner = THIS_MODULE, 226 232 }; 227 233 228 - 229 234 static int __init rtllib_crypto_wep_init(void) 230 235 { 231 236 return lib80211_register_crypto_ops(&rtllib_crypt_wep); 232 237 } 233 - 234 238 235 239 static void __exit rtllib_crypto_wep_exit(void) 236 240 {
+4 -4
drivers/staging/rtl8192e/rtllib_module.c
··· 107 107 spin_lock_init(&ieee->lock); 108 108 spin_lock_init(&ieee->wpax_suitlist_lock); 109 109 spin_lock_init(&ieee->reorder_spinlock); 110 - atomic_set(&(ieee->atm_swbw), 0); 110 + atomic_set(&ieee->atm_swbw, 0); 111 111 112 112 /* SAM FIXME */ 113 113 lib80211_crypt_info_init(&ieee->crypt_info, "RTLLIB", &ieee->lock); ··· 125 125 if (err) 126 126 goto free_crypt_info; 127 127 128 - ieee->pHTInfo = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL); 129 - if (!ieee->pHTInfo) 128 + ieee->ht_info = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL); 129 + if (!ieee->ht_info) 130 130 goto free_softmac; 131 131 132 132 HTUpdateDefaultSetting(ieee); ··· 160 160 struct rtllib_device *ieee = (struct rtllib_device *) 161 161 netdev_priv_rsl(dev); 162 162 163 - kfree(ieee->pHTInfo); 163 + kfree(ieee->ht_info); 164 164 rtllib_softmac_free(ieee); 165 165 166 166 lib80211_crypt_info_free(&ieee->crypt_info);
+19 -19
drivers/staging/rtl8192e/rtllib_rx.c
··· 567 567 struct rtllib_rxb *prxb, 568 568 struct rx_ts_record *pTS, u16 SeqNum) 569 569 { 570 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 570 + struct rt_hi_throughput *ht_info = ieee->ht_info; 571 571 struct rx_reorder_entry *pReorderEntry = NULL; 572 - u8 WinSize = pHTInfo->rx_reorder_win_size; 572 + u8 WinSize = ht_info->rx_reorder_win_size; 573 573 u16 WinEnd = 0; 574 574 u8 index = 0; 575 575 bool bMatchWinStart = false, bPktInBuf = false; ··· 591 591 netdev_dbg(ieee->dev, 592 592 "Packet Drop! IndicateSeq: %d, NewSeq: %d\n", 593 593 pTS->rx_indicate_seq, SeqNum); 594 - pHTInfo->rx_reorder_drop_counter++; 594 + ht_info->rx_reorder_drop_counter++; 595 595 { 596 596 int i; 597 597 ··· 755 755 netdev_dbg(ieee->dev, "%s(): SET rx timeout timer\n", __func__); 756 756 pTS->rx_timeout_indicate_seq = pTS->rx_indicate_seq; 757 757 mod_timer(&pTS->rx_pkt_pending_timer, jiffies + 758 - msecs_to_jiffies(pHTInfo->rx_reorder_pending_time)); 758 + msecs_to_jiffies(ht_info->rx_reorder_pending_time)); 759 759 } 760 760 spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); 761 761 } ··· 924 924 sc = le16_to_cpu(hdr->seq_ctl); 925 925 frag = WLAN_GET_SEQ_FRAG(sc); 926 926 927 - if (!ieee->pHTInfo->cur_rx_reorder_enable || 927 + if (!ieee->ht_info->cur_rx_reorder_enable || 928 928 !ieee->current_network.qos_data.active || 929 929 !IsDataFrame(skb->data) || 930 930 IsLegacyDataFrame(skb->data)) { ··· 999 999 } 1000 1000 1001 1001 /* Filter packets sent by an STA that will be forwarded by AP */ 1002 - if (ieee->IntelPromiscuousModeInfo.bPromiscuousOn && 1003 - ieee->IntelPromiscuousModeInfo.bFilterSourceStationFrame) { 1002 + if (ieee->intel_promiscuous_md_info.promiscuous_on && 1003 + ieee->intel_promiscuous_md_info.fltr_src_sta_frame) { 1004 1004 if ((fc & RTLLIB_FCTL_TODS) && !(fc & RTLLIB_FCTL_FROMDS) && 1005 1005 !ether_addr_equal(dst, ieee->current_network.bssid) && 1006 1006 ether_addr_equal(bssid, ieee->current_network.bssid)) { ··· 1011 1011 /* Nullfunc frames may have PS-bit set, so they must be passed to 1012 1012 * hostap_handle_sta_rx() before being dropped here. 1013 1013 */ 1014 - if (!ieee->IntelPromiscuousModeInfo.bPromiscuousOn) { 1014 + if (!ieee->intel_promiscuous_md_info.promiscuous_on) { 1015 1015 if (stype != RTLLIB_STYPE_DATA && 1016 1016 stype != RTLLIB_STYPE_DATA_CFACK && 1017 1017 stype != RTLLIB_STYPE_DATA_CFPOLL && ··· 1211 1211 if (unicast) { 1212 1212 1213 1213 if (ieee->state == RTLLIB_LINKED) { 1214 - if (((ieee->LinkDetectInfo.NumRxUnicastOkInPeriod + 1215 - ieee->LinkDetectInfo.NumTxOkInPeriod) > 8) || 1216 - (ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2)) { 1214 + if (((ieee->link_detect_info.NumRxUnicastOkInPeriod + 1215 + ieee->link_detect_info.NumTxOkInPeriod) > 8) || 1216 + (ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) { 1217 1217 if (ieee->LeisurePSLeave) 1218 1218 ieee->LeisurePSLeave(ieee->dev); 1219 1219 } ··· 1317 1317 multicast = is_multicast_ether_addr(hdr->addr1); 1318 1318 unicast = !multicast; 1319 1319 if (unicast && !ether_addr_equal(dev->dev_addr, hdr->addr1)) { 1320 - if (ieee->bNetPromiscuousMode) 1320 + if (ieee->net_promiscuous_md) 1321 1321 bToOtherSTA = true; 1322 1322 else 1323 1323 goto rx_dropped; ··· 1355 1355 1356 1356 /* Update statstics for AP roaming */ 1357 1357 if (!bToOtherSTA) { 1358 - ieee->LinkDetectInfo.NumRecvDataInPeriod++; 1359 - ieee->LinkDetectInfo.NumRxOkInPeriod++; 1358 + ieee->link_detect_info.NumRecvDataInPeriod++; 1359 + ieee->link_detect_info.NumRxOkInPeriod++; 1360 1360 } 1361 1361 1362 1362 /* Data frame - extract src/dst addresses */ ··· 1437 1437 else 1438 1438 nr_subframes = 1; 1439 1439 if (unicast) 1440 - ieee->LinkDetectInfo.NumRxUnicastOkInPeriod += nr_subframes; 1440 + ieee->link_detect_info.NumRxUnicastOkInPeriod += nr_subframes; 1441 1441 rtllib_rx_check_leave_lps(ieee, unicast, nr_subframes); 1442 1442 } 1443 1443 1444 1444 /* Indicate packets to upper layer or Rx Reorder */ 1445 - if (!ieee->pHTInfo->cur_rx_reorder_enable || pTS == NULL || bToOtherSTA) 1445 + if (!ieee->ht_info->cur_rx_reorder_enable || pTS == NULL || bToOtherSTA) 1446 1446 rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src); 1447 1447 else 1448 1448 RxReorderIndicatePacket(ieee, rxb, pTS, SeqNum); ··· 1489 1489 hdrlen += 4; 1490 1490 } 1491 1491 1492 - rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen); 1493 1492 ieee->stats.rx_packets++; 1494 1493 ieee->stats.rx_bytes += skb->len; 1494 + rtllib_monitor_rx(ieee, skb, rx_stats, hdrlen); 1495 1495 1496 1496 return 1; 1497 1497 } ··· 1776 1776 if (rtllib_act_scanning(ieee, false) && 1777 1777 ieee->FirstIe_InScan) 1778 1778 netdev_info(ieee->dev, 1779 - "Received beacon ContryIE, SSID: <%s>\n", 1779 + "Received beacon CountryIE, SSID: <%s>\n", 1780 1780 network->ssid); 1781 1781 dot11d_update_country(ieee, addr2, 1782 1782 info_element->len, ··· 2620 2620 } 2621 2621 if (is_beacon(frame_ctl)) { 2622 2622 if (ieee->state >= RTLLIB_LINKED) 2623 - ieee->LinkDetectInfo.NumRecvBcnInPeriod++; 2623 + ieee->link_detect_info.NumRecvBcnInPeriod++; 2624 2624 } 2625 2625 } 2626 2626 list_for_each_entry(target, &ieee->network_list, list) {
+86 -87
drivers/staging/rtl8192e/rtllib_softmac.c
··· 148 148 } 149 149 150 150 151 - u8 152 - MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) 151 + u8 MgntQuery_TxRateExcludeCCKRates(struct rtllib_device *ieee) 153 152 { 154 153 u16 i; 155 154 u8 QueryRate = 0; ··· 176 177 177 178 static u8 MgntQuery_MgntFrameTxRate(struct rtllib_device *ieee) 178 179 { 179 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 180 + struct rt_hi_throughput *ht_info = ieee->ht_info; 180 181 u8 rate; 181 182 182 - if (pHTInfo->iot_action & HT_IOT_ACT_MGNT_USE_CCK_6M) 183 + if (ht_info->iot_action & HT_IOT_ACT_MGNT_USE_CCK_6M) 183 184 rate = 0x0c; 184 185 else 185 186 rate = ieee->basic_rate & 0x7f; ··· 187 188 if (rate == 0) { 188 189 if (ieee->mode == IEEE_A || 189 190 ieee->mode == IEEE_N_5G || 190 - (ieee->mode == IEEE_N_24G && !pHTInfo->bCurSuppCCK)) 191 + (ieee->mode == IEEE_N_24G && !ht_info->bCurSuppCCK)) 191 192 rate = 0x0c; 192 193 else 193 194 rate = 0x02; ··· 220 221 221 222 tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); 222 223 tcb_desc->RATRIndex = 7; 223 - tcb_desc->bTxDisableRateFallBack = 1; 224 - tcb_desc->bTxUseDriverAssingedRate = 1; 224 + tcb_desc->tx_dis_rate_fallback = 1; 225 + tcb_desc->tx_use_drv_assinged_rate = 1; 225 226 if (single) { 226 227 if (ieee->queue_stop) { 227 228 enqueue_mgmt(ieee, skb); ··· 298 299 299 300 tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); 300 301 tcb_desc->RATRIndex = 7; 301 - tcb_desc->bTxDisableRateFallBack = 1; 302 - tcb_desc->bTxUseDriverAssingedRate = 1; 302 + tcb_desc->tx_dis_rate_fallback = 1; 303 + tcb_desc->tx_use_drv_assinged_rate = 1; 303 304 if (single) { 304 305 if (type != RTLLIB_FTYPE_CTL) { 305 306 header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4); ··· 445 446 ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID, 446 447 (u8 *)&bFilterOutNonAssociatedBSSID); 447 448 448 - ieee->bNetPromiscuousMode = true; 449 + ieee->net_promiscuous_md = true; 449 450 } 450 451 EXPORT_SYMBOL(rtllib_EnableIntelPromiscuousMode); 451 452 ··· 466 467 ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID, 467 468 (u8 *)&bFilterOutNonAssociatedBSSID); 468 469 469 - ieee->bNetPromiscuousMode = false; 470 + ieee->net_promiscuous_md = false; 470 471 } 471 472 EXPORT_SYMBOL(rtllib_DisableIntelPromiscuousMode); 472 473 ··· 829 830 u8 tmp_ht_cap_len = 0; 830 831 u8 *tmp_ht_info_buf = NULL; 831 832 u8 tmp_ht_info_len = 0; 832 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 833 + struct rt_hi_throughput *ht_info = ieee->ht_info; 833 834 u8 *tmp_generic_ie_buf = NULL; 834 835 u8 tmp_generic_ie_len = 0; 835 836 ··· 843 844 844 845 if ((ieee->current_network.mode == IEEE_G) || 845 846 (ieee->current_network.mode == IEEE_N_24G && 846 - ieee->pHTInfo->bCurSuppCCK)) { 847 + ieee->ht_info->bCurSuppCCK)) { 847 848 erp_len = 3; 848 849 erpinfo_content = 0; 849 850 if (ieee->current_network.buseprotection) ··· 854 855 crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; 855 856 encrypt = ieee->host_encrypt && crypt && crypt->ops && 856 857 ((strcmp(crypt->ops->name, "R-WEP") == 0 || wpa_ie_len)); 857 - if (ieee->pHTInfo->bCurrentHTSupport) { 858 - tmp_ht_cap_buf = (u8 *)&(ieee->pHTInfo->SelfHTCap); 859 - tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap); 860 - tmp_ht_info_buf = (u8 *)&(ieee->pHTInfo->SelfHTInfo); 861 - tmp_ht_info_len = sizeof(ieee->pHTInfo->SelfHTInfo); 858 + if (ieee->ht_info->bCurrentHTSupport) { 859 + tmp_ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); 860 + tmp_ht_cap_len = sizeof(ieee->ht_info->SelfHTCap); 861 + tmp_ht_info_buf = (u8 *)&(ieee->ht_info->SelfHTInfo); 862 + tmp_ht_info_len = sizeof(ieee->ht_info->SelfHTInfo); 862 863 HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, 863 864 &tmp_ht_cap_len, encrypt, false); 864 865 HTConstructInfoElement(ieee, tmp_ht_info_buf, &tmp_ht_info_len, 865 866 encrypt); 866 867 867 - if (pHTInfo->reg_rt2rt_aggregation) { 868 - tmp_generic_ie_buf = ieee->pHTInfo->sz_rt2rt_agg_buf; 868 + if (ht_info->reg_rt2rt_aggregation) { 869 + tmp_generic_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf; 869 870 tmp_generic_ie_len = 870 - sizeof(ieee->pHTInfo->sz_rt2rt_agg_buf); 871 + sizeof(ieee->ht_info->sz_rt2rt_agg_buf); 871 872 HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, 872 873 &tmp_generic_ie_len); 873 874 } ··· 1179 1180 if ((ieee->rtllib_ap_sec_type && 1180 1181 (ieee->rtllib_ap_sec_type(ieee) & SEC_ALG_TKIP)) || 1181 1182 ieee->bForcedBgMode) { 1182 - ieee->pHTInfo->bEnableHT = 0; 1183 + ieee->ht_info->enable_ht = 0; 1183 1184 ieee->mode = WIRELESS_MODE_G; 1184 1185 } 1185 1186 1186 - if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) { 1187 - ht_cap_buf = (u8 *)&(ieee->pHTInfo->SelfHTCap); 1188 - ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap); 1187 + if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { 1188 + ht_cap_buf = (u8 *)&(ieee->ht_info->SelfHTCap); 1189 + ht_cap_len = sizeof(ieee->ht_info->SelfHTCap); 1189 1190 HTConstructCapabilityElement(ieee, ht_cap_buf, &ht_cap_len, 1190 1191 encrypt, true); 1191 - if (ieee->pHTInfo->current_rt2rt_aggregation) { 1192 - realtek_ie_buf = ieee->pHTInfo->sz_rt2rt_agg_buf; 1192 + if (ieee->ht_info->current_rt2rt_aggregation) { 1193 + realtek_ie_buf = ieee->ht_info->sz_rt2rt_agg_buf; 1193 1194 realtek_ie_len = 1194 - sizeof(ieee->pHTInfo->sz_rt2rt_agg_buf); 1195 + sizeof(ieee->ht_info->sz_rt2rt_agg_buf); 1195 1196 HTConstructRT2RTAggElement(ieee, realtek_ie_buf, 1196 1197 &realtek_ie_len); 1197 1198 } ··· 1324 1325 memcpy(tag, osCcxVerNum.Octet, osCcxVerNum.Length); 1325 1326 tag += osCcxVerNum.Length; 1326 1327 } 1327 - if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) { 1328 - if (ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC) { 1328 + if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { 1329 + if (ieee->ht_info->ePeerHTSpecVer != HT_SPEC_VER_EWC) { 1329 1330 tag = skb_put(skb, ht_cap_len); 1330 1331 *tag++ = MFIE_TYPE_HT_CAP; 1331 1332 *tag++ = ht_cap_len - 2; ··· 1358 1359 rtllib_TURBO_Info(ieee, &tag); 1359 1360 } 1360 1361 1361 - if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) { 1362 - if (ieee->pHTInfo->ePeerHTSpecVer == HT_SPEC_VER_EWC) { 1362 + if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { 1363 + if (ieee->ht_info->ePeerHTSpecVer == HT_SPEC_VER_EWC) { 1363 1364 tag = skb_put(skb, ht_cap_len); 1364 1365 *tag++ = MFIE_TYPE_GENERIC; 1365 1366 *tag++ = ht_cap_len - 2; ··· 1367 1368 tag += ht_cap_len - 2; 1368 1369 } 1369 1370 1370 - if (ieee->pHTInfo->current_rt2rt_aggregation) { 1371 + if (ieee->ht_info->current_rt2rt_aggregation) { 1371 1372 tag = skb_put(skb, realtek_ie_len); 1372 1373 *tag++ = MFIE_TYPE_GENERIC; 1373 1374 *tag++ = realtek_ie_len - 2; ··· 1504 1505 container_of_work_rsl(data, 1505 1506 struct rtllib_device, 1506 1507 associate_complete_wq); 1507 - struct rt_pwr_save_ctrl *pPSC = &(ieee->PowerSaveControl); 1508 + struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl; 1508 1509 1509 1510 netdev_info(ieee->dev, "Associated successfully with %pM\n", 1510 1511 ieee->current_network.bssid); ··· 1524 1525 ieee->SetWirelessMode(ieee->dev, IEEE_B); 1525 1526 netdev_info(ieee->dev, "Using B rates:%d\n", ieee->rate); 1526 1527 } 1527 - if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT) { 1528 + if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht) { 1528 1529 netdev_info(ieee->dev, "Successfully associated, ht enabled\n"); 1529 1530 HTOnAssocRsp(ieee); 1530 1531 } else { 1531 1532 netdev_info(ieee->dev, 1532 1533 "Successfully associated, ht not enabled(%d, %d)\n", 1533 - ieee->pHTInfo->bCurrentHTSupport, 1534 - ieee->pHTInfo->bEnableHT); 1535 - memset(ieee->dot11HTOperationalRateSet, 0, 16); 1534 + ieee->ht_info->bCurrentHTSupport, 1535 + ieee->ht_info->enable_ht); 1536 + memset(ieee->dot11ht_oper_rate_set, 0, 16); 1536 1537 } 1537 - ieee->LinkDetectInfo.SlotNum = 2 * (1 + 1538 + ieee->link_detect_info.SlotNum = 2 * (1 + 1538 1539 ieee->current_network.beacon_interval / 1539 1540 500); 1540 - if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || 1541 - ieee->LinkDetectInfo.NumRecvDataInPeriod == 0) { 1542 - ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1; 1543 - ieee->LinkDetectInfo.NumRecvDataInPeriod = 1; 1541 + if (ieee->link_detect_info.NumRecvBcnInPeriod == 0 || 1542 + ieee->link_detect_info.NumRecvDataInPeriod == 0) { 1543 + ieee->link_detect_info.NumRecvBcnInPeriod = 1; 1544 + ieee->link_detect_info.NumRecvDataInPeriod = 1; 1544 1545 } 1545 - pPSC->LpsIdleCount = 0; 1546 + psc->LpsIdleCount = 0; 1546 1547 ieee->link_change(ieee->dev); 1547 1548 1548 1549 if (ieee->is_silent_reset) { ··· 1684 1685 ieee->current_network.ssid, 1685 1686 ieee->current_network.channel, 1686 1687 ieee->current_network.qos_data.supported, 1687 - ieee->pHTInfo->bEnableHT, 1688 + ieee->ht_info->enable_ht, 1688 1689 ieee->current_network.bssht.bd_support_ht, 1689 1690 ieee->current_network.mode, 1690 1691 ieee->current_network.flags); ··· 1693 1694 !(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) 1694 1695 rtllib_stop_scan_syncro(ieee); 1695 1696 1696 - HTResetIOTSetting(ieee->pHTInfo); 1697 + HTResetIOTSetting(ieee->ht_info); 1697 1698 ieee->wmm_acm = 0; 1698 1699 if (ieee->iw_mode == IW_MODE_INFRA) { 1699 1700 /* Join the network for the first time */ ··· 1703 1704 HTResetSelfAndSavePeerSetting(ieee, 1704 1705 &(ieee->current_network)); 1705 1706 else 1706 - ieee->pHTInfo->bCurrentHTSupport = 1707 + ieee->ht_info->bCurrentHTSupport = 1707 1708 false; 1708 1709 1709 1710 ieee->state = RTLLIB_ASSOCIATING; ··· 1728 1729 netdev_info(ieee->dev, 1729 1730 "Using B rates\n"); 1730 1731 } 1731 - memset(ieee->dot11HTOperationalRateSet, 0, 16); 1732 + memset(ieee->dot11ht_oper_rate_set, 0, 16); 1732 1733 ieee->state = RTLLIB_LINKED; 1733 1734 } 1734 1735 } ··· 1893 1894 ((ieee->mode == IEEE_G) && 1894 1895 (ieee->current_network.mode == IEEE_N_24G) && 1895 1896 (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) { 1896 - ieee->pHTInfo->iot_action |= HT_IOT_ACT_PURE_N_MODE; 1897 + ieee->ht_info->iot_action |= HT_IOT_ACT_PURE_N_MODE; 1897 1898 } else { 1898 1899 ieee->AsocRetryCount = 0; 1899 1900 } ··· 1960 1961 { 1961 1962 int timeout; 1962 1963 u8 dtim; 1963 - struct rt_pwr_save_ctrl *pPSC = &(ieee->PowerSaveControl); 1964 + struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl; 1964 1965 1965 1966 if (ieee->LPSDelayCnt) { 1966 1967 ieee->LPSDelayCnt--; ··· 1990 1991 1991 1992 if (time) { 1992 1993 if (ieee->bAwakePktSent) { 1993 - pPSC->LPSAwakeIntvl = 1; 1994 + psc->LPSAwakeIntvl = 1; 1994 1995 } else { 1995 1996 u8 MaxPeriod = 1; 1996 1997 1997 - if (pPSC->LPSAwakeIntvl == 0) 1998 - pPSC->LPSAwakeIntvl = 1; 1999 - if (pPSC->RegMaxLPSAwakeIntvl == 0) 1998 + if (psc->LPSAwakeIntvl == 0) 1999 + psc->LPSAwakeIntvl = 1; 2000 + if (psc->reg_max_lps_awake_intvl == 0) 2000 2001 MaxPeriod = 1; 2001 - else if (pPSC->RegMaxLPSAwakeIntvl == 0xFF) 2002 + else if (psc->reg_max_lps_awake_intvl == 0xFF) 2002 2003 MaxPeriod = ieee->current_network.dtim_period; 2003 2004 else 2004 - MaxPeriod = pPSC->RegMaxLPSAwakeIntvl; 2005 - pPSC->LPSAwakeIntvl = (pPSC->LPSAwakeIntvl >= 2005 + MaxPeriod = psc->reg_max_lps_awake_intvl; 2006 + psc->LPSAwakeIntvl = (psc->LPSAwakeIntvl >= 2006 2007 MaxPeriod) ? MaxPeriod : 2007 - (pPSC->LPSAwakeIntvl + 1); 2008 + (psc->LPSAwakeIntvl + 1); 2008 2009 } 2009 2010 { 2010 2011 u8 LPSAwakeIntvl_tmp = 0; ··· 2012 2013 u8 count = ieee->current_network.tim.tim_count; 2013 2014 2014 2015 if (count == 0) { 2015 - if (pPSC->LPSAwakeIntvl > period) 2016 + if (psc->LPSAwakeIntvl > period) 2016 2017 LPSAwakeIntvl_tmp = period + 2017 - (pPSC->LPSAwakeIntvl - 2018 + (psc->LPSAwakeIntvl - 2018 2019 period) - 2019 - ((pPSC->LPSAwakeIntvl-period) % 2020 + ((psc->LPSAwakeIntvl-period) % 2020 2021 period); 2021 2022 else 2022 - LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl; 2023 + LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl; 2023 2024 2024 2025 } else { 2025 - if (pPSC->LPSAwakeIntvl > 2026 + if (psc->LPSAwakeIntvl > 2026 2027 ieee->current_network.tim.tim_count) 2027 2028 LPSAwakeIntvl_tmp = count + 2028 - (pPSC->LPSAwakeIntvl - count) - 2029 - ((pPSC->LPSAwakeIntvl-count)%period); 2029 + (psc->LPSAwakeIntvl - count) - 2030 + ((psc->LPSAwakeIntvl-count)%period); 2030 2031 else 2031 - LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl; 2032 + LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl; 2032 2033 } 2033 2034 2034 2035 *time = ieee->current_network.last_dtim_sta_time ··· 2100 2101 { 2101 2102 if (ieee->sta_sleep == LPS_IS_WAKE) { 2102 2103 if (nl) { 2103 - if (ieee->pHTInfo->iot_action & 2104 + if (ieee->ht_info->iot_action & 2104 2105 HT_IOT_ACT_NULL_DATA_POWER_SAVING) { 2105 2106 ieee->ack_tx_to_ieee = 1; 2106 2107 rtllib_sta_ps_send_null_frame(ieee, 0); ··· 2116 2117 if (ieee->sta_sleep == LPS_IS_SLEEP) 2117 2118 ieee->sta_wake_up(ieee->dev); 2118 2119 if (nl) { 2119 - if (ieee->pHTInfo->iot_action & 2120 + if (ieee->ht_info->iot_action & 2120 2121 HT_IOT_ACT_NULL_DATA_POWER_SAVING) { 2121 2122 ieee->ack_tx_to_ieee = 1; 2122 2123 rtllib_sta_ps_send_null_frame(ieee, 0); ··· 2151 2152 2152 2153 if ((ieee->sta_sleep == LPS_IS_WAKE) && !success) { 2153 2154 spin_lock_irqsave(&ieee->mgmt_tx_lock, flags2); 2154 - if (ieee->pHTInfo->iot_action & 2155 + if (ieee->ht_info->iot_action & 2155 2156 HT_IOT_ACT_NULL_DATA_POWER_SAVING) 2156 2157 rtllib_sta_ps_send_null_frame(ieee, 0); 2157 2158 else ··· 2235 2236 kfree(network); 2236 2237 return 1; 2237 2238 } 2238 - memcpy(ieee->pHTInfo->PeerHTCapBuf, 2239 + memcpy(ieee->ht_info->PeerHTCapBuf, 2239 2240 network->bssht.bd_ht_cap_buf, 2240 2241 network->bssht.bd_ht_cap_len); 2241 - memcpy(ieee->pHTInfo->PeerHTInfoBuf, 2242 + memcpy(ieee->ht_info->PeerHTInfoBuf, 2242 2243 network->bssht.bd_ht_info_buf, 2243 2244 network->bssht.bd_ht_info_len); 2244 2245 if (ieee->handle_assoc_response != NULL) ··· 2295 2296 if (ieee->open_wep || !challenge) { 2296 2297 ieee->state = RTLLIB_ASSOCIATING_AUTHENTICATED; 2297 2298 ieee->softmac_stats.rx_auth_rs_ok++; 2298 - if (!(ieee->pHTInfo->iot_action & HT_IOT_ACT_PURE_N_MODE)) { 2299 + if (!(ieee->ht_info->iot_action & HT_IOT_ACT_PURE_N_MODE)) { 2299 2300 if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { 2300 2301 if (IsHTHalfNmodeAPs(ieee)) { 2301 2302 bSupportNmode = true; ··· 2369 2370 ieee->state = RTLLIB_ASSOCIATING; 2370 2371 ieee->softmac_stats.reassoc++; 2371 2372 ieee->is_roaming = true; 2372 - ieee->LinkDetectInfo.bBusyTraffic = false; 2373 + ieee->link_detect_info.bBusyTraffic = false; 2373 2374 rtllib_disassociate(ieee); 2374 2375 RemovePeerTS(ieee, header->addr2); 2375 2376 if (ieee->LedControlHandler != NULL) ··· 2669 2670 if ((ieee->mode == IEEE_N_24G) || (ieee->mode == IEEE_N_5G)) 2670 2671 HTUseDefaultSetting(ieee); 2671 2672 else 2672 - ieee->pHTInfo->bCurrentHTSupport = false; 2673 + ieee->ht_info->bCurrentHTSupport = false; 2673 2674 2674 2675 ieee->SetHwRegHandler(ieee->dev, HW_VAR_MEDIA_STATUS, 2675 2676 (u8 *)(&ieee->state)); ··· 2963 2964 if (!ieee->dot11d_info) 2964 2965 return -ENOMEM; 2965 2966 2966 - ieee->LinkDetectInfo.SlotIndex = 0; 2967 - ieee->LinkDetectInfo.SlotNum = 2; 2968 - ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0; 2969 - ieee->LinkDetectInfo.NumRecvDataInPeriod = 0; 2970 - ieee->LinkDetectInfo.NumTxOkInPeriod = 0; 2971 - ieee->LinkDetectInfo.NumRxOkInPeriod = 0; 2972 - ieee->LinkDetectInfo.NumRxUnicastOkInPeriod = 0; 2967 + ieee->link_detect_info.SlotIndex = 0; 2968 + ieee->link_detect_info.SlotNum = 2; 2969 + ieee->link_detect_info.NumRecvBcnInPeriod = 0; 2970 + ieee->link_detect_info.NumRecvDataInPeriod = 0; 2971 + ieee->link_detect_info.NumTxOkInPeriod = 0; 2972 + ieee->link_detect_info.NumRxOkInPeriod = 0; 2973 + ieee->link_detect_info.NumRxUnicastOkInPeriod = 0; 2973 2974 ieee->bIsAggregateFrame = false; 2974 2975 ieee->assoc_id = 0; 2975 2976 ieee->queue_stop = 0; ··· 2984 2985 ieee->ps = RTLLIB_PS_DISABLED; 2985 2986 ieee->sta_sleep = LPS_IS_WAKE; 2986 2987 2987 - ieee->Regdot11HTOperationalRateSet[0] = 0xff; 2988 - ieee->Regdot11HTOperationalRateSet[1] = 0xff; 2989 - ieee->Regdot11HTOperationalRateSet[4] = 0x01; 2988 + ieee->reg_dot11ht_oper_rate_set[0] = 0xff; 2989 + ieee->reg_dot11ht_oper_rate_set[1] = 0xff; 2990 + ieee->reg_dot11ht_oper_rate_set[4] = 0x01; 2990 2991 2991 - ieee->Regdot11TxHTOperationalRateSet[0] = 0xff; 2992 - ieee->Regdot11TxHTOperationalRateSet[1] = 0xff; 2993 - ieee->Regdot11TxHTOperationalRateSet[4] = 0x01; 2992 + ieee->reg_dot11tx_ht_oper_rate_set[0] = 0xff; 2993 + ieee->reg_dot11tx_ht_oper_rate_set[1] = 0xff; 2994 + ieee->reg_dot11tx_ht_oper_rate_set[4] = 0x01; 2994 2995 2995 2996 ieee->FirstIe_InScan = false; 2996 2997 ieee->actscanning = false;
+9 -10
drivers/staging/rtl8192e/rtllib_softmac_wx.c
··· 359 359 if (ieee->ScanOperationBackupHandler) 360 360 ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP); 361 361 362 - if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT && 363 - ieee->pHTInfo->bCurBW40MHz) { 362 + if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht && 363 + ieee->ht_info->bCurBW40MHz) { 364 364 b40M = 1; 365 - chan_offset = ieee->pHTInfo->CurSTAExtChnlOffset; 366 - bandwidth = (enum ht_channel_width)ieee->pHTInfo->bCurBW40MHz; 365 + chan_offset = ieee->ht_info->CurSTAExtChnlOffset; 366 + bandwidth = (enum ht_channel_width)ieee->ht_info->bCurBW40MHz; 367 367 ieee->SetBWModeHandler(ieee->dev, HT_CHANNEL_WIDTH_20, 368 368 HT_EXTCHNL_OFFSET_NO_EXT); 369 369 } ··· 391 391 /* Notify AP that I wake up again */ 392 392 rtllib_sta_ps_send_null_frame(ieee, 0); 393 393 394 - if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || 395 - ieee->LinkDetectInfo.NumRecvDataInPeriod == 0) { 396 - ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1; 397 - ieee->LinkDetectInfo.NumRecvDataInPeriod = 1; 394 + if (ieee->link_detect_info.NumRecvBcnInPeriod == 0 || 395 + ieee->link_detect_info.NumRecvDataInPeriod == 0) { 396 + ieee->link_detect_info.NumRecvBcnInPeriod = 1; 397 + ieee->link_detect_info.NumRecvDataInPeriod = 1; 398 398 } 399 399 400 400 if (ieee->data_hard_resume) ··· 564 564 ieee->ps = RTLLIB_PS_DISABLED; 565 565 goto exit; 566 566 } 567 - if (wrqu->power.flags & IW_POWER_TIMEOUT) { 567 + if (wrqu->power.flags & IW_POWER_TIMEOUT) 568 568 ieee->ps_timeout = wrqu->power.value / 1000; 569 - } 570 569 571 570 if (wrqu->power.flags & IW_POWER_PERIOD) 572 571 ieee->ps_period = wrqu->power.value / 1000;
+57 -63
drivers/staging/rtl8192e/rtllib_tx.c
··· 191 191 return 0; 192 192 } 193 193 194 - 195 194 void rtllib_txb_free(struct rtllib_txb *txb) 196 195 { 197 196 if (unlikely(!txb)) ··· 266 267 struct sk_buff *skb, 267 268 struct cb_desc *tcb_desc) 268 269 { 269 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 270 + struct rt_hi_throughput *ht_info = ieee->ht_info; 270 271 struct tx_ts_record *pTxTs = NULL; 271 272 struct rtllib_hdr_1addr *hdr = (struct rtllib_hdr_1addr *)skb->data; 272 273 273 274 if (rtllib_act_scanning(ieee, false)) 274 275 return; 275 276 276 - if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT) 277 + if (!ht_info->bCurrentHTSupport || !ht_info->enable_ht) 277 278 return; 278 279 if (!IsQoSDataFrame(skb->data)) 279 280 return; ··· 283 284 if (tcb_desc->bdhcp || ieee->CntAfterLink < 2) 284 285 return; 285 286 286 - if (pHTInfo->iot_action & HT_IOT_ACT_TX_NO_AGGREGATION) 287 + if (ht_info->iot_action & HT_IOT_ACT_TX_NO_AGGREGATION) 287 288 return; 288 289 289 290 if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) 290 291 return; 291 - if (pHTInfo->bCurrentAMPDUEnable) { 292 + if (ht_info->bCurrentAMPDUEnable) { 292 293 if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), hdr->addr1, 293 - skb->priority, TX_DIR, true)) { 294 + skb->priority, TX_DIR, true)) { 294 295 netdev_info(ieee->dev, "%s: can't get TS\n", __func__); 295 296 return; 296 297 } ··· 306 307 goto FORCED_AGG_SETTING; 307 308 } else if (!pTxTs->bUsingBa) { 308 309 if (SN_LESS(pTxTs->TxAdmittedBARecord.ba_start_seq_ctrl.field.seq_num, 309 - (pTxTs->TxCurSeq+1)%4096)) 310 + (pTxTs->TxCurSeq + 1) % 4096)) 310 311 pTxTs->bUsingBa = true; 311 312 else 312 313 goto FORCED_AGG_SETTING; 313 314 } 314 315 if (ieee->iw_mode == IW_MODE_INFRA) { 315 316 tcb_desc->bAMPDUEnable = true; 316 - tcb_desc->ampdu_factor = pHTInfo->CurrentAMPDUFactor; 317 - tcb_desc->ampdu_density = pHTInfo->current_mpdu_density; 317 + tcb_desc->ampdu_factor = ht_info->CurrentAMPDUFactor; 318 + tcb_desc->ampdu_density = ht_info->current_mpdu_density; 318 319 } 319 320 } 320 321 FORCED_AGG_SETTING: 321 - switch (pHTInfo->ForcedAMPDUMode) { 322 + switch (ht_info->ForcedAMPDUMode) { 322 323 case HT_AGG_AUTO: 323 324 break; 324 325 325 326 case HT_AGG_FORCE_ENABLE: 326 327 tcb_desc->bAMPDUEnable = true; 327 - tcb_desc->ampdu_density = pHTInfo->forced_mpdu_density; 328 - tcb_desc->ampdu_factor = pHTInfo->forced_ampdu_factor; 328 + tcb_desc->ampdu_density = ht_info->forced_mpdu_density; 329 + tcb_desc->ampdu_factor = ht_info->forced_ampdu_factor; 329 330 break; 330 331 331 332 case HT_AGG_FORCE_DISABLE: ··· 350 351 static void rtllib_query_HTCapShortGI(struct rtllib_device *ieee, 351 352 struct cb_desc *tcb_desc) 352 353 { 353 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 354 + struct rt_hi_throughput *ht_info = ieee->ht_info; 354 355 355 356 tcb_desc->bUseShortGI = false; 356 357 357 - if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT) 358 + if (!ht_info->bCurrentHTSupport || !ht_info->enable_ht) 358 359 return; 359 360 360 - if (pHTInfo->forced_short_gi) { 361 + if (ht_info->forced_short_gi) { 361 362 tcb_desc->bUseShortGI = true; 362 363 return; 363 364 } 364 365 365 - if (pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI40MHz) 366 + if (ht_info->bCurBW40MHz && ht_info->bCurShortGI40MHz) 366 367 tcb_desc->bUseShortGI = true; 367 - else if (!pHTInfo->bCurBW40MHz && pHTInfo->bCurShortGI20MHz) 368 + else if (!ht_info->bCurBW40MHz && ht_info->bCurShortGI20MHz) 368 369 tcb_desc->bUseShortGI = true; 369 370 } 370 371 371 372 static void rtllib_query_BandwidthMode(struct rtllib_device *ieee, 372 373 struct cb_desc *tcb_desc) 373 374 { 374 - struct rt_hi_throughput *pHTInfo = ieee->pHTInfo; 375 + struct rt_hi_throughput *ht_info = ieee->ht_info; 375 376 376 377 tcb_desc->bPacketBW = false; 377 378 378 - if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT) 379 + if (!ht_info->bCurrentHTSupport || !ht_info->enable_ht) 379 380 return; 380 381 381 382 if (tcb_desc->bMulticast || tcb_desc->bBroadcast) ··· 383 384 384 385 if ((tcb_desc->data_rate & 0x80) == 0) 385 386 return; 386 - if (pHTInfo->bCurBW40MHz && pHTInfo->cur_tx_bw40mhz && 387 + if (ht_info->bCurBW40MHz && ht_info->cur_tx_bw40mhz && 387 388 !ieee->bandwidth_auto_switch.bforced_tx20Mhz) 388 389 tcb_desc->bPacketBW = true; 389 390 } ··· 392 393 struct cb_desc *tcb_desc, 393 394 struct sk_buff *skb) 394 395 { 395 - struct rt_hi_throughput *pHTInfo; 396 + struct rt_hi_throughput *ht_info; 396 397 397 398 tcb_desc->bRTSSTBC = false; 398 399 tcb_desc->bRTSUseShortGI = false; ··· 403 404 if (tcb_desc->bBroadcast || tcb_desc->bMulticast) 404 405 return; 405 406 406 - if (is_broadcast_ether_addr(skb->data+16)) 407 + if (is_broadcast_ether_addr(skb->data + 16)) 407 408 return; 408 409 409 410 if (ieee->mode < IEEE_N_24G) { ··· 418 419 return; 419 420 } 420 421 421 - pHTInfo = ieee->pHTInfo; 422 + ht_info = ieee->ht_info; 422 423 423 424 while (true) { 424 - if (pHTInfo->iot_action & HT_IOT_ACT_FORCED_CTS2SELF) { 425 + if (ht_info->iot_action & HT_IOT_ACT_FORCED_CTS2SELF) { 425 426 tcb_desc->bCTSEnable = true; 426 427 tcb_desc->rts_rate = MGN_24M; 427 428 tcb_desc->bRTSEnable = true; 428 429 break; 429 - } else if (pHTInfo->iot_action & (HT_IOT_ACT_FORCED_RTS | 430 + } else if (ht_info->iot_action & (HT_IOT_ACT_FORCED_RTS | 430 431 HT_IOT_ACT_PURE_N_MODE)) { 431 432 tcb_desc->bRTSEnable = true; 432 433 tcb_desc->rts_rate = MGN_24M; ··· 438 439 tcb_desc->rts_rate = MGN_24M; 439 440 break; 440 441 } 441 - if (pHTInfo->bCurrentHTSupport && pHTInfo->bEnableHT) { 442 - u8 HTOpMode = pHTInfo->current_op_mode; 442 + if (ht_info->bCurrentHTSupport && ht_info->enable_ht) { 443 + u8 HTOpMode = ht_info->current_op_mode; 443 444 444 - if ((pHTInfo->bCurBW40MHz && (HTOpMode == 2 || 445 - HTOpMode == 3)) || 446 - (!pHTInfo->bCurBW40MHz && HTOpMode == 3)) { 445 + if ((ht_info->bCurBW40MHz && (HTOpMode == 2 || 446 + HTOpMode == 3)) || 447 + (!ht_info->bCurBW40MHz && HTOpMode == 3)) { 447 448 tcb_desc->rts_rate = MGN_24M; 448 449 tcb_desc->bRTSEnable = true; 449 450 break; ··· 474 475 tcb_desc->bRTSBW = false; 475 476 } 476 477 477 - 478 478 static void rtllib_txrate_selectmode(struct rtllib_device *ieee, 479 479 struct cb_desc *tcb_desc) 480 480 { 481 - if (ieee->bTxDisableRateFallBack) 482 - tcb_desc->bTxDisableRateFallBack = true; 481 + if (ieee->tx_dis_rate_fallback) 482 + tcb_desc->tx_dis_rate_fallback = true; 483 483 484 - if (ieee->bTxUseDriverAssingedRate) 485 - tcb_desc->bTxUseDriverAssingedRate = true; 486 - if (!tcb_desc->bTxDisableRateFallBack || 487 - !tcb_desc->bTxUseDriverAssingedRate) { 484 + if (ieee->tx_use_drv_assinged_rate) 485 + tcb_desc->tx_use_drv_assinged_rate = true; 486 + if (!tcb_desc->tx_dis_rate_fallback || 487 + !tcb_desc->tx_use_drv_assinged_rate) { 488 488 if (ieee->iw_mode == IW_MODE_INFRA || 489 489 ieee->iw_mode == IW_MODE_ADHOC) 490 490 tcb_desc->RATRIndex = 0; ··· 501 503 struct tx_ts_record *pTS = NULL; 502 504 503 505 if (!GetTs(ieee, (struct ts_common_info **)(&pTS), dst, 504 - skb->priority, TX_DIR, true)) 506 + skb->priority, TX_DIR, true)) 505 507 return 0; 506 508 seqnum = pTS->TxCurSeq; 507 - pTS->TxCurSeq = (pTS->TxCurSeq+1)%4096; 509 + pTS->TxCurSeq = (pTS->TxCurSeq + 1) % 4096; 508 510 return seqnum; 509 511 } 510 512 return 0; ··· 580 582 goto success; 581 583 } 582 584 583 - 584 585 if (likely(ieee->raw_tx == 0)) { 585 586 if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) { 586 587 netdev_warn(ieee->dev, "skb too small (%d).\n", ··· 611 614 if (skb->len > 282) { 612 615 if (ether_type == ETH_P_IP) { 613 616 const struct iphdr *ip = (struct iphdr *) 614 - ((u8 *)skb->data+14); 617 + ((u8 *)skb->data + 14); 615 618 if (ip->protocol == IPPROTO_UDP) { 616 619 struct udphdr *udp; 617 620 618 621 udp = (struct udphdr *)((u8 *)ip + 619 622 (ip->ihl << 2)); 620 623 if (((((u8 *)udp)[1] == 68) && 621 - (((u8 *)udp)[3] == 67)) || 624 + (((u8 *)udp)[3] == 67)) || 622 625 ((((u8 *)udp)[1] == 67) && 623 626 (((u8 *)udp)[3] == 68))) { 624 627 bdhcp = true; ··· 712 715 /* in case we are a client verify acm is not set for this ac */ 713 716 while (unlikely(ieee->wmm_acm & (0x01 << skb->priority))) { 714 717 netdev_info(ieee->dev, "skb->priority = %x\n", 715 - skb->priority); 718 + skb->priority); 716 719 if (wme_downgrade_ac(skb)) 717 720 break; 718 721 netdev_info(ieee->dev, "converted skb->priority = %x\n", 719 - skb->priority); 722 + skb->priority); 720 723 } 721 724 722 725 qos_ctl |= skb->priority; ··· 802 805 * MOREFRAGS bit to the frame control 803 806 */ 804 807 if (i != nr_frags - 1) { 805 - frag_hdr->frame_ctl = cpu_to_le16( 806 - fc | RTLLIB_FCTL_MOREFRAGS); 808 + frag_hdr->frame_ctl = cpu_to_le16(fc | 809 + RTLLIB_FCTL_MOREFRAGS); 807 810 bytes = bytes_per_frag; 808 811 809 812 } else { ··· 813 816 if ((qos_activated) && (!bIsMulticast)) { 814 817 frag_hdr->seq_ctl = 815 818 cpu_to_le16(rtllib_query_seqnum(ieee, skb_frag, 816 - header.addr1)); 819 + header.addr1)); 817 820 frag_hdr->seq_ctl = 818 - cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctl)<<4 | i); 821 + cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctl) << 4 | i); 819 822 } else { 820 823 frag_hdr->seq_ctl = 821 - cpu_to_le16(ieee->seq_ctrl[0]<<4 | i); 824 + cpu_to_le16(ieee->seq_ctrl[0] << 4 | i); 822 825 } 823 826 /* Put a SNAP header on the first fragment */ 824 827 if (i == 0) { 825 - rtllib_put_snap( 826 - skb_put(skb_frag, SNAP_SIZE + 827 - sizeof(u16)), ether_type); 828 + rtllib_put_snap(skb_put(skb_frag, 829 + SNAP_SIZE + 830 + sizeof(u16)), ether_type); 828 831 bytes -= SNAP_SIZE + sizeof(u16); 829 832 } 830 833 ··· 882 885 tcb_desc->priority = skb->priority; 883 886 884 887 if (ether_type == ETH_P_PAE) { 885 - if (ieee->pHTInfo->iot_action & 888 + if (ieee->ht_info->iot_action & 886 889 HT_IOT_ACT_WA_IOT_Broadcom) { 887 890 tcb_desc->data_rate = 888 891 MgntQuery_TxRateExcludeCCKRates(ieee); 889 - tcb_desc->bTxDisableRateFallBack = false; 892 + tcb_desc->tx_dis_rate_fallback = false; 890 893 } else { 891 894 tcb_desc->data_rate = ieee->basic_rate; 892 - tcb_desc->bTxDisableRateFallBack = 1; 895 + tcb_desc->tx_dis_rate_fallback = 1; 893 896 } 894 897 895 - 896 898 tcb_desc->RATRIndex = 7; 897 - tcb_desc->bTxUseDriverAssingedRate = 1; 899 + tcb_desc->tx_use_drv_assinged_rate = 1; 898 900 } else { 899 901 if (is_multicast_ether_addr(header.addr1)) 900 902 tcb_desc->bMulticast = 1; ··· 906 910 tcb_desc->data_rate = rtllib_current_rate(ieee); 907 911 908 912 if (bdhcp) { 909 - if (ieee->pHTInfo->iot_action & 913 + if (ieee->ht_info->iot_action & 910 914 HT_IOT_ACT_WA_IOT_Broadcom) { 911 915 tcb_desc->data_rate = 912 916 MgntQuery_TxRateExcludeCCKRates(ieee); 913 - tcb_desc->bTxDisableRateFallBack = false; 917 + tcb_desc->tx_dis_rate_fallback = false; 914 918 } else { 915 919 tcb_desc->data_rate = MGN_1M; 916 - tcb_desc->bTxDisableRateFallBack = 1; 920 + tcb_desc->tx_dis_rate_fallback = 1; 917 921 } 918 922 919 - 920 923 tcb_desc->RATRIndex = 7; 921 - tcb_desc->bTxUseDriverAssingedRate = 1; 924 + tcb_desc->tx_use_drv_assinged_rate = 1; 922 925 tcb_desc->bdhcp = 1; 923 926 } 924 927 ··· 954 959 netif_stop_queue(dev); 955 960 stats->tx_errors++; 956 961 return 1; 957 - 958 962 } 959 963 960 964 netdev_tx_t rtllib_xmit(struct sk_buff *skb, struct net_device *dev)
+3 -3
drivers/staging/rtl8192e/rtllib_wx.c
··· 217 217 p = custom; 218 218 p += scnprintf(p, MAX_CUSTOM_LEN - (p - custom), 219 219 " Last beacon: %lums ago", 220 - (jiffies - network->last_scanned) / (HZ / 100)); 220 + (100 * (jiffies - network->last_scanned)) / HZ); 221 221 iwe.u.data.length = p - custom; 222 222 if (iwe.u.data.length) 223 223 start = iwe_stream_add_point_rsl(info, start, stop, ··· 258 258 escape_essid(network->ssid, 259 259 network->ssid_len), 260 260 network->bssid, 261 - (jiffies - network->last_scanned) / 262 - (HZ / 100)); 261 + (100 * (jiffies - network->last_scanned)) / 262 + HZ); 263 263 } 264 264 265 265 spin_unlock_irqrestore(&ieee->lock, flags);
+16
drivers/staging/rtl8192u/TODO
··· 1 + To-do list: 2 + 3 + * Correct the coding style according to Linux guidelines; please read the document 4 + at https://www.kernel.org/doc/html/latest/process/coding-style.html. 5 + * Remove unnecessary debugging/printing macros; for those that are still needed 6 + use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()). 7 + * Remove dead code such as unusued functions, variables, fields, etc.. 8 + * Use in-kernel API and remove unnecessary wrappers where possible. 9 + * Fix bugs due to code that sleeps in atomic context. 10 + * Remove the HAL layer and migrate its functionality into the relevant parts of 11 + the driver. 12 + * Switch to use LIB80211. 13 + * Switch to use MAC80211. 14 + * Switch to use CFG80211. 15 + * Improve the error handling of various functions, particularly those that use 16 + existing kernel APIs.
-64
drivers/staging/rtl8192u/ieee80211/ieee80211.h
··· 223 223 #define MAX_IE_LEN 0xff 224 224 225 225 // added for kernel conflict 226 - #define ieee80211_crypt_deinit_entries ieee80211_crypt_deinit_entries_rsl 227 - #define ieee80211_crypt_deinit_handler ieee80211_crypt_deinit_handler_rsl 228 - #define ieee80211_crypt_delayed_deinit ieee80211_crypt_delayed_deinit_rsl 229 - #define ieee80211_register_crypto_ops ieee80211_register_crypto_ops_rsl 230 - #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl 231 - #define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl 232 - 233 - #define ieee80211_ccmp_null ieee80211_ccmp_null_rsl 234 - 235 - #define ieee80211_tkip_null ieee80211_tkip_null_rsl 236 - 237 - #define free_ieee80211 free_ieee80211_rsl 238 - #define alloc_ieee80211 alloc_ieee80211_rsl 239 - 240 - #define ieee80211_rx ieee80211_rx_rsl 241 - #define ieee80211_rx_mgt ieee80211_rx_mgt_rsl 242 - 243 - #define ieee80211_get_beacon ieee80211_get_beacon_rsl 244 226 #define ieee80211_wake_queue ieee80211_wake_queue_rsl 245 227 #define ieee80211_stop_queue ieee80211_stop_queue_rsl 246 - #define ieee80211_reset_queue ieee80211_reset_queue_rsl 247 - #define ieee80211_softmac_stop_protocol ieee80211_softmac_stop_protocol_rsl 248 - #define ieee80211_softmac_start_protocol ieee80211_softmac_start_protocol_rsl 249 - #define ieee80211_is_shortslot ieee80211_is_shortslot_rsl 250 - #define ieee80211_is_54g ieee80211_is_54g_rsl 251 - #define ieee80211_wpa_supplicant_ioctl ieee80211_wpa_supplicant_ioctl_rsl 252 - #define ieee80211_ps_tx_ack ieee80211_ps_tx_ack_rsl 253 - #define ieee80211_softmac_xmit ieee80211_softmac_xmit_rsl 254 - #define ieee80211_stop_send_beacons ieee80211_stop_send_beacons_rsl 255 228 #define notify_wx_assoc_event notify_wx_assoc_event_rsl 256 229 #define SendDisassociation SendDisassociation_rsl 257 - #define ieee80211_disassociate ieee80211_disassociate_rsl 258 - #define ieee80211_start_send_beacons ieee80211_start_send_beacons_rsl 259 - #define ieee80211_stop_scan ieee80211_stop_scan_rsl 260 - #define ieee80211_send_probe_requests ieee80211_send_probe_requests_rsl 261 - #define ieee80211_softmac_scan_syncro ieee80211_softmac_scan_syncro_rsl 262 - #define ieee80211_start_scan_syncro ieee80211_start_scan_syncro_rsl 263 - 264 - #define ieee80211_wx_get_essid ieee80211_wx_get_essid_rsl 265 - #define ieee80211_wx_set_essid ieee80211_wx_set_essid_rsl 266 - #define ieee80211_wx_set_rate ieee80211_wx_set_rate_rsl 267 - #define ieee80211_wx_get_rate ieee80211_wx_get_rate_rsl 268 - #define ieee80211_wx_set_wap ieee80211_wx_set_wap_rsl 269 - #define ieee80211_wx_get_wap ieee80211_wx_get_wap_rsl 270 - #define ieee80211_wx_set_mode ieee80211_wx_set_mode_rsl 271 - #define ieee80211_wx_get_mode ieee80211_wx_get_mode_rsl 272 - #define ieee80211_wx_set_scan ieee80211_wx_set_scan_rsl 273 - #define ieee80211_wx_get_freq ieee80211_wx_get_freq_rsl 274 - #define ieee80211_wx_set_freq ieee80211_wx_set_freq_rsl 275 - #define ieee80211_wx_set_rawtx ieee80211_wx_set_rawtx_rsl 276 - #define ieee80211_wx_get_name ieee80211_wx_get_name_rsl 277 - #define ieee80211_wx_set_power ieee80211_wx_set_power_rsl 278 - #define ieee80211_wx_get_power ieee80211_wx_get_power_rsl 279 - #define ieee80211_wlan_frequencies ieee80211_wlan_frequencies_rsl 280 - #define ieee80211_wx_set_rts ieee80211_wx_set_rts_rsl 281 - #define ieee80211_wx_get_rts ieee80211_wx_get_rts_rsl 282 - 283 - #define ieee80211_txb_free ieee80211_txb_free_rsl 284 - 285 - #define ieee80211_wx_set_gen_ie ieee80211_wx_set_gen_ie_rsl 286 - #define ieee80211_wx_get_scan ieee80211_wx_get_scan_rsl 287 - #define ieee80211_wx_set_encode ieee80211_wx_set_encode_rsl 288 - #define ieee80211_wx_get_encode ieee80211_wx_get_encode_rsl 289 - #define ieee80211_wx_set_mlme ieee80211_wx_set_mlme_rsl 290 - #define ieee80211_wx_set_auth ieee80211_wx_set_auth_rsl 291 - #define ieee80211_wx_set_encode_ext ieee80211_wx_set_encode_ext_rsl 292 - #define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl 293 230 294 231 295 232 struct ieee_param { ··· 2193 2256 void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee); 2194 2257 2195 2258 /* ieee80211_crypt_ccmp&tkip&wep.c */ 2196 - void ieee80211_tkip_null(void); 2197 2259 2198 2260 int ieee80211_crypto_init(void); 2199 2261 void ieee80211_crypto_deinit(void);
-6
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
··· 716 716 { 717 717 ieee80211_unregister_crypto_ops(&ieee80211_crypt_tkip); 718 718 } 719 - 720 - void ieee80211_tkip_null(void) 721 - { 722 - // printk("============>%s()\n", __func__); 723 - return; 724 - }
-3
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
··· 159 159 ieee->last_packet_time[i] = 0; 160 160 } 161 161 162 - /* These function were added to load crypte module autoly */ 163 - ieee80211_tkip_null(); 164 - 165 162 return dev; 166 163 167 164 failed:
+4 -2
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
··· 951 951 #endif 952 952 953 953 if (ieee->iw_mode == IW_MODE_MONITOR) { 954 + unsigned int len = skb->len; 955 + 954 956 ieee80211_monitor_rx(ieee, skb, rx_stats); 955 957 stats->rx_packets++; 956 - stats->rx_bytes += skb->len; 958 + stats->rx_bytes += len; 957 959 return 1; 958 960 } 959 961 ··· 1808 1806 info_element->data[0] == 0x00 && 1809 1807 info_element->data[1] == 0x13 && 1810 1808 info_element->data[2] == 0x74)) { 1811 - netdev_dbg(ieee->dev, "========> athros AP is exist\n"); 1809 + netdev_dbg(ieee->dev, "========> Atheros AP exists\n"); 1812 1810 network->atheros_cap_exist = true; 1813 1811 } else 1814 1812 network->atheros_cap_exist = false;
+22 -5
drivers/staging/rtl8712/os_intfs.c
··· 304 304 padapter->cmdpriv.padapter = padapter; 305 305 ret = r8712_init_evt_priv(&padapter->evtpriv); 306 306 if (ret) 307 - return ret; 307 + goto free_cmd; 308 308 ret = r8712_init_mlme_priv(padapter); 309 309 if (ret) 310 - return ret; 311 - _r8712_init_xmit_priv(&padapter->xmitpriv, padapter); 312 - _r8712_init_recv_priv(&padapter->recvpriv, padapter); 310 + goto free_evt; 311 + ret = _r8712_init_xmit_priv(&padapter->xmitpriv, padapter); 312 + if (ret) 313 + goto free_mlme; 314 + ret = _r8712_init_recv_priv(&padapter->recvpriv, padapter); 315 + if (ret) 316 + goto free_xmit; 313 317 memset((unsigned char *)&padapter->securitypriv, 0, 314 318 sizeof(struct security_priv)); 315 319 timer_setup(&padapter->securitypriv.tkip_timer, 316 320 r8712_use_tkipkey_handler, 0); 317 321 ret = _r8712_init_sta_priv(&padapter->stapriv); 318 322 if (ret) 319 - return ret; 323 + goto free_recv; 320 324 padapter->stapriv.padapter = padapter; 321 325 r8712_init_bcmc_stainfo(padapter); 322 326 r8712_init_pwrctrl_priv(padapter); 323 327 mp871xinit(padapter); 324 328 init_default_value(padapter); 325 329 r8712_InitSwLeds(padapter); 330 + 331 + return 0; 332 + 333 + free_recv: 334 + _r8712_free_recv_priv(&padapter->recvpriv); 335 + free_xmit: 336 + _free_xmit_priv(&padapter->xmitpriv); 337 + free_mlme: 338 + r8712_free_mlme_priv(&padapter->mlmepriv); 339 + free_evt: 340 + r8712_free_evt_priv(&padapter->evtpriv); 341 + free_cmd: 342 + r8712_free_cmd_priv(&padapter->cmdpriv); 326 343 return ret; 327 344 } 328 345
+4 -4
drivers/staging/rtl8712/recv_osdep.h
··· 18 18 #include "drv_types.h" 19 19 #include <linux/skbuff.h> 20 20 21 - void _r8712_init_recv_priv(struct recv_priv *precvpriv, 22 - struct _adapter *padapter); 21 + int _r8712_init_recv_priv(struct recv_priv *precvpriv, 22 + struct _adapter *padapter); 23 23 void _r8712_free_recv_priv(struct recv_priv *precvpriv); 24 24 void r8712_recv_entry(union recv_frame *precv_frame); 25 25 void r8712_recv_indicatepkt(struct _adapter *adapter, 26 26 union recv_frame *precv_frame); 27 27 void r8712_handle_tkip_mic_err(struct _adapter *padapter, u8 bgroup); 28 - void r8712_init_recv_priv(struct recv_priv *precvpriv, 29 - struct _adapter *padapter); 28 + int r8712_init_recv_priv(struct recv_priv *precvpriv, 29 + struct _adapter *padapter); 30 30 void r8712_free_recv_priv(struct recv_priv *precvpriv); 31 31 void r8712_os_recv_resource_alloc(struct _adapter *padapter, 32 32 union recv_frame *precvframe);
+4 -3
drivers/staging/rtl8712/rtl8712_recv.c
··· 30 30 31 31 static void recv_tasklet(struct tasklet_struct *t); 32 32 33 - void r8712_init_recv_priv(struct recv_priv *precvpriv, 34 - struct _adapter *padapter) 33 + int r8712_init_recv_priv(struct recv_priv *precvpriv, 34 + struct _adapter *padapter) 35 35 { 36 36 int i; 37 37 struct recv_buf *precvbuf; ··· 44 44 precvpriv->pallocated_recv_buf = 45 45 kzalloc(NR_RECVBUFF * sizeof(struct recv_buf) + 4, GFP_ATOMIC); 46 46 if (!precvpriv->pallocated_recv_buf) 47 - return; 47 + return -ENOMEM; 48 48 precvpriv->precv_buf = precvpriv->pallocated_recv_buf + 4 - 49 49 ((addr_t)(precvpriv->pallocated_recv_buf) & 3); 50 50 precvbuf = (struct recv_buf *)precvpriv->precv_buf; ··· 75 75 } 76 76 pskb = NULL; 77 77 } 78 + return 0; 78 79 } 79 80 80 81 void r8712_free_recv_priv(struct recv_priv *precvpriv)
+1 -2
drivers/staging/rtl8712/rtl8712_xmit.c
··· 601 601 #ifdef CONFIG_R8712_TX_AGGR 602 602 struct xmit_frame *p2ndxmitframe = NULL; 603 603 #else 604 - int res = _SUCCESS, xcnt = 0; 604 + int res = _SUCCESS; 605 605 #endif 606 606 607 607 phwxmits = pxmitpriv->hwxmits; ··· 673 673 dump_xframe(padapter, pxmitframe); 674 674 else 675 675 r8712_free_xmitframe_ex(pxmitpriv, pxmitframe); 676 - xcnt++; 677 676 #endif 678 677 679 678 } else { /* pxmitframe == NULL && p2ndxmitframe == NULL */
+9 -7
drivers/staging/rtl8712/rtl871x_recv.c
··· 17 17 #define _RTL871X_RECV_C_ 18 18 19 19 #include <linux/ip.h> 20 - #include <linux/slab.h> 21 20 #include <linux/if_ether.h> 22 - #include <linux/kmemleak.h> 23 21 #include <linux/etherdevice.h> 24 22 #include <linux/ieee80211.h> 25 23 #include <net/cfg80211.h> ··· 42 44 _init_queue(&psta_recvpriv->defrag_q); 43 45 } 44 46 45 - void _r8712_init_recv_priv(struct recv_priv *precvpriv, 46 - struct _adapter *padapter) 47 + int _r8712_init_recv_priv(struct recv_priv *precvpriv, 48 + struct _adapter *padapter) 47 49 { 50 + int ret; 48 51 sint i; 49 52 union recv_frame *precvframe; 50 53 ··· 59 60 sizeof(union recv_frame) + RXFRAME_ALIGN_SZ, 60 61 GFP_ATOMIC); 61 62 if (!precvpriv->pallocated_frame_buf) 62 - return; 63 - kmemleak_not_leak(precvpriv->pallocated_frame_buf); 63 + return -ENOMEM; 64 64 precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + 65 65 RXFRAME_ALIGN_SZ - 66 66 ((addr_t)(precvpriv->pallocated_frame_buf) & ··· 74 76 precvframe++; 75 77 } 76 78 precvpriv->rx_pending_cnt = 1; 77 - r8712_init_recv_priv(precvpriv, padapter); 79 + ret = r8712_init_recv_priv(precvpriv, padapter); 80 + if (ret) 81 + kfree(precvpriv->pallocated_frame_buf); 82 + 83 + return ret; 78 84 } 79 85 80 86 void _r8712_free_recv_priv(struct recv_priv *precvpriv)
+1 -1
drivers/staging/rtl8723bs/core/rtw_efuse.c
··· 282 282 { 283 283 u8 tmpidx = 0; 284 284 u8 bResult = false; 285 - u32 efuseValue = 0; 285 + u32 efuseValue; 286 286 287 287 if (bPseudoTest) 288 288 return Efuse_Write1ByteToFakeContent(addr, data);
+6 -6
drivers/staging/rtl8723bs/core/rtw_ieee80211.c
··· 1063 1063 /* parsing HT_CAP_IE */ 1064 1064 p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, WLAN_EID_HT_CAPABILITY, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_); 1065 1065 if (p && len > 0) { 1066 - pht_cap = (struct ieee80211_ht_cap *)(p + 2); 1067 - pnetwork->bcn_info.ht_cap_info = le16_to_cpu(pht_cap->cap_info); 1066 + pht_cap = (struct ieee80211_ht_cap *)(p + 2); 1067 + pnetwork->bcn_info.ht_cap_info = le16_to_cpu(pht_cap->cap_info); 1068 1068 } else { 1069 - pnetwork->bcn_info.ht_cap_info = 0; 1069 + pnetwork->bcn_info.ht_cap_info = 0; 1070 1070 } 1071 1071 /* parsing HT_INFO_IE */ 1072 1072 p = rtw_get_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, WLAN_EID_HT_OPERATION, &len, pnetwork->network.ie_length - _FIXED_IE_LENGTH_); 1073 1073 if (p && len > 0) { 1074 - pht_info = (struct HT_info_element *)(p + 2); 1075 - pnetwork->bcn_info.ht_info_infos_0 = pht_info->infos[0]; 1074 + pht_info = (struct HT_info_element *)(p + 2); 1075 + pnetwork->bcn_info.ht_info_infos_0 = pht_info->infos[0]; 1076 1076 } else { 1077 - pnetwork->bcn_info.ht_info_infos_0 = 0; 1077 + pnetwork->bcn_info.ht_info_infos_0 = 0; 1078 1078 } 1079 1079 } 1080 1080
+9 -8
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
··· 78 78 goto exit; 79 79 } else { 80 80 int select_ret; 81 + 81 82 spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); 82 83 select_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv); 83 84 if (select_ret == _SUCCESS) { ··· 160 159 if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) { 161 160 if ((pmlmepriv->assoc_ssid.ssid_length == ssid->ssid_length) && 162 161 (!memcmp(&pmlmepriv->assoc_ssid.ssid, ssid->ssid, ssid->ssid_length))) { 163 - if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false)) { 162 + if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) { 164 163 if (rtw_is_same_ibss(padapter, pnetwork) == false) { 165 164 /* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */ 166 165 rtw_disassoc_cmd(padapter, 0, true); ··· 312 311 if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) { 313 312 if (check_fwstate(pmlmepriv, _FW_LINKED) == true) 314 313 rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */ 315 - } 314 + } 316 315 317 316 *pold_state = networktype; 318 317 ··· 368 367 369 368 u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num) 370 369 { 371 - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 370 + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 372 371 u8 res = true; 373 372 374 373 if (!padapter) { ··· 463 462 } 464 463 465 464 /* 466 - * rtw_get_cur_max_rate - 467 - * @adapter: pointer to struct adapter structure 468 - * 469 - * Return 0 or 100Kbps 470 - */ 465 + * rtw_get_cur_max_rate - 466 + * @adapter: pointer to struct adapter structure 467 + * 468 + * Return 0 or 100Kbps 469 + */ 471 470 u16 rtw_get_cur_max_rate(struct adapter *adapter) 472 471 { 473 472 int i = 0;
+14 -16
drivers/staging/rtl8723bs/core/rtw_mlme.c
··· 389 389 __le16 tmps, tmpd; 390 390 391 391 if (rtw_bug_check(dst, src, &s_cap, &d_cap) == false) 392 - return false; 392 + return false; 393 393 394 394 memcpy((u8 *)&tmps, rtw_get_capability_from_ie(src->ies), 2); 395 395 memcpy((u8 *)&tmpd, rtw_get_capability_from_ie(dst->ies), 2); ··· 669 669 uint ie_len = 0; 670 670 671 671 if ((desired_encmode == Ndis802_11EncryptionDisabled) && (privacy != 0)) 672 - bselected = false; 672 + bselected = false; 673 673 674 674 if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { 675 675 p = rtw_get_ie(pnetwork->network.ies + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_)); ··· 795 795 pmlmepriv->to_join = false; 796 796 s_ret = rtw_select_and_join_from_scanned_queue(pmlmepriv); 797 797 if (s_ret == _SUCCESS) { 798 - _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); 798 + _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT); 799 799 } else if (s_ret == 2) {/* there is no need to wait for join */ 800 800 _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); 801 801 rtw_indicate_connect(adapter); ··· 2010 2010 2011 2011 if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50 && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) { /* WMM element ID and OUI */ 2012 2012 for (j = i; j < i + 9; j++) { 2013 - out_ie[ielength] = in_ie[j]; 2014 - ielength++; 2013 + out_ie[ielength] = in_ie[j]; 2014 + ielength++; 2015 2015 } 2016 2016 out_ie[initial_out_len + 1] = 0x07; 2017 2017 out_ie[initial_out_len + 6] = 0x00; ··· 2064 2064 2065 2065 if (ie[13] <= 20) { 2066 2066 /* The RSN IE didn't include the PMK ID, append the PMK information */ 2067 - ie[ie_len] = 1; 2068 - ie_len++; 2069 - ie[ie_len] = 0; /* PMKID count = 0x0100 */ 2070 - ie_len++; 2071 - memcpy(&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16); 2072 - 2073 - ie_len += 16; 2074 - ie[13] += 18;/* PMKID length = 2+16 */ 2075 - 2067 + ie[ie_len] = 1; 2068 + ie_len++; 2069 + ie[ie_len] = 0; /* PMKID count = 0x0100 */ 2070 + ie_len++; 2071 + memcpy(&ie[ie_len], &psecuritypriv->PMKIDList[iEntry].PMKID, 16); 2072 + ie_len += 16; 2073 + ie[13] += 18;/* PMKID length = 2+16 */ 2076 2074 } 2077 2075 return ie_len; 2078 2076 } ··· 2089 2091 memcpy(out_ie, in_ie, 12); 2090 2092 ielength = 12; 2091 2093 if ((ndisauthmode == Ndis802_11AuthModeWPA) || (ndisauthmode == Ndis802_11AuthModeWPAPSK)) 2092 - authmode = WLAN_EID_VENDOR_SPECIFIC; 2094 + authmode = WLAN_EID_VENDOR_SPECIFIC; 2093 2095 if ((ndisauthmode == Ndis802_11AuthModeWPA2) || (ndisauthmode == Ndis802_11AuthModeWPA2PSK)) 2094 - authmode = WLAN_EID_RSN; 2096 + authmode = WLAN_EID_RSN; 2095 2097 2096 2098 if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) { 2097 2099 memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
+1 -1
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
··· 5447 5447 u8 val8; 5448 5448 5449 5449 if (is_client_associated_to_ap(padapter)) 5450 - issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100); 5450 + issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100); 5451 5451 5452 5452 if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) { 5453 5453 /* Stop BCN */
+3 -3
drivers/staging/rtl8723bs/core/rtw_recv.c
··· 161 161 162 162 if (padapter) { 163 163 if (pfree_recv_queue == &precvpriv->free_recv_queue) 164 - precvpriv->free_recvframe_cnt++; 164 + precvpriv->free_recvframe_cnt++; 165 165 } 166 166 spin_unlock_bh(&pfree_recv_queue->lock); 167 167 return _SUCCESS; ··· 691 691 if (bmcast) { 692 692 /* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ 693 693 if (!IS_MCAST(pattrib->bssid)) { 694 - ret = _FAIL; 695 - goto exit; 694 + ret = _FAIL; 695 + goto exit; 696 696 } 697 697 } else { /* not mc-frame */ 698 698 /* For AP mode, if DA is non-MCAST, then it must be BSSID, and bssid == BSSID */
+1 -1
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
··· 551 551 else if (pacl_list->mode == 2)/* deny unless in accept list */ 552 552 res = match; 553 553 else 554 - res = true; 554 + res = true; 555 555 556 556 return res; 557 557 }
+4 -8
drivers/staging/rtl8723bs/core/rtw_wlan_util.c
··· 986 986 pmlmeinfo->HT_caps.u.HT_cap[i] &= (pIE->data[i]); 987 987 } else { 988 988 /* modify from fw by Thomas 2010/11/17 */ 989 - if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (pIE->data[i] & 0x3)) 990 - max_AMPDU_len = (pIE->data[i] & 0x3); 991 - else 992 - max_AMPDU_len = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3); 989 + max_AMPDU_len = min(pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3, 990 + pIE->data[i] & 0x3); 993 991 994 - if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) > (pIE->data[i] & 0x1c)) 995 - min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c); 996 - else 997 - min_MPDU_spacing = (pIE->data[i] & 0x1c); 992 + min_MPDU_spacing = max(pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c, 993 + pIE->data[i] & 0x1c); 998 994 999 995 pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para = max_AMPDU_len | min_MPDU_spacing; 1000 996 }
+10 -11
drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
··· 244 244 Final_CCK_Swing_Index = 0; 245 245 246 246 setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath, 247 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], 248 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); 247 + pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0], 248 + pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]); 249 249 250 250 setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index); 251 251 ··· 257 257 pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index - PwrTrackingLimit_OFDM; 258 258 259 259 setIqkMatrix_8723B(pDM_Odm, PwrTrackingLimit_OFDM, RFPath, 260 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], 261 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); 260 + pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0], 261 + pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]); 262 262 263 263 pDM_Odm->Modify_TxAGC_Flag_PathA = true; 264 264 PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); ··· 267 267 pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index; 268 268 269 269 setIqkMatrix_8723B(pDM_Odm, 0, RFPath, 270 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], 271 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); 270 + pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0], 271 + pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]); 272 272 273 273 pDM_Odm->Modify_TxAGC_Flag_PathA = true; 274 274 PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); 275 275 PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7); 276 276 } else { 277 277 setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath, 278 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], 279 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); 278 + pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][0], 279 + pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[ChannelMappedIndex][1]); 280 280 281 281 if (pDM_Odm->Modify_TxAGC_Flag_PathA) { /* If TxAGC has changed, reset TxAGC again */ 282 282 pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0; ··· 1759 1759 /* To Fix BSOD when final_candidate is 0xff */ 1760 1760 /* by sherry 20120321 */ 1761 1761 if (final_candidate < 4) { 1762 - for (i = 0; i < IQK_Matrix_REG_NUM; i++) 1763 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][i] = result[final_candidate][i]; 1764 - pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].bIQKDone = true; 1762 + for (i = 0; i < IQK_MATRIX_REG_NUM; i++) 1763 + pDM_Odm->RFCalibrateInfo.iqk_matrix_regs_setting_value[0][i] = result[final_candidate][i]; 1765 1764 } 1766 1765 1767 1766 _PHY_SaveADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, 9);
+3 -9
drivers/staging/rtl8723bs/hal/odm.h
··· 193 193 #define HP_THERMAL_NUM 8 194 194 195 195 #define AVG_THERMAL_NUM 8 196 - #define IQK_Matrix_REG_NUM 8 197 - #define IQK_Matrix_Settings_NUM 14 /* Channels_2_4G_NUM */ 196 + #define IQK_MATRIX_REG_NUM 8 197 + #define IQK_MATRIX_SETTINGS_NUM 14 /* Channels_2_4G_NUM */ 198 198 199 199 #define DM_Type_ByFW 0 200 200 #define DM_Type_ByDriver 1 ··· 479 479 TYPE_ALNA3 = BIT(3)|BIT(2)|BIT(1)|BIT(0) 480 480 }; 481 481 482 - struct iqk_matrix_regs_setting { /* _IQK_MATRIX_REGS_SETTING */ 483 - bool bIQKDone; 484 - s32 Value[3][IQK_Matrix_REG_NUM]; 485 - bool bBWIqkResultSaved[3]; 486 - }; 487 - 488 482 /* Remove PATHDIV_PARA struct to odm_PathDiv.h */ 489 483 490 484 struct odm_rf_cal_t { /* ODM_RF_Calibration_Structure */ ··· 524 530 525 531 u8 ThermalValue_HP[HP_THERMAL_NUM]; 526 532 u8 ThermalValue_HP_index; 527 - struct iqk_matrix_regs_setting IQKMatrixRegSetting[IQK_Matrix_Settings_NUM]; 533 + s32 iqk_matrix_regs_setting_value[IQK_MATRIX_SETTINGS_NUM][IQK_MATRIX_REG_NUM]; 528 534 bool bNeedIQK; 529 535 bool bIQKInProgress; 530 536 u8 Delta_IQK;
+1 -4
drivers/staging/rtl8723bs/hal/odm_DIG.c
··· 598 598 /* Lower bound checking */ 599 599 600 600 /* RSSI Lower bound check */ 601 - if ((pDM_Odm->RSSI_Min-10) > DM_DIG_MIN_NIC) 602 - RSSI_Lower = pDM_Odm->RSSI_Min-10; 603 - else 604 - RSSI_Lower = DM_DIG_MIN_NIC; 601 + RSSI_Lower = max(pDM_Odm->RSSI_Min - 10, DM_DIG_MIN_NIC); 605 602 606 603 /* Upper and Lower Bound checking */ 607 604 if (CurrentIGI > DM_DIG_MAX_NIC)
+1 -1
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
··· 1551 1551 1552 1552 wps_ie = rtw_get_wps_ie(buf, ielen, NULL, &wps_ielen); 1553 1553 if (wps_ie && wps_ielen > 0) { 1554 - padapter->securitypriv.wps_ie_len = wps_ielen < MAX_WPS_IE_LEN ? wps_ielen : MAX_WPS_IE_LEN; 1554 + padapter->securitypriv.wps_ie_len = min_t(uint, wps_ielen, MAX_WPS_IE_LEN); 1555 1555 memcpy(padapter->securitypriv.wps_ie, wps_ie, padapter->securitypriv.wps_ie_len); 1556 1556 set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); 1557 1557 } else {
+2 -1
drivers/staging/rts5208/sd.c
··· 4506 4506 if (CHK_SD(sd_card)) { 4507 4507 retval = reset_sd(chip); 4508 4508 if (retval != STATUS_SUCCESS) { 4509 - sd_card->sd_lock_status &= ~(SD_UNLOCK_POW_ON | SD_SDR_RST); 4509 + sd_card->sd_lock_status &= 4510 + ~(SD_UNLOCK_POW_ON | SD_SDR_RST); 4510 4511 goto sd_execute_write_cmd_failed; 4511 4512 } 4512 4513 }
+1 -1
drivers/staging/sm750fb/Kconfig
··· 9 9 select VIDEO_NOMODESET 10 10 help 11 11 Frame buffer driver for the Silicon Motion SM750 chip 12 - with 2D accelearion and dual head support. 12 + with 2D acceleration and dual head support. 13 13 14 14 This driver is also available as a module. The module will be 15 15 called sm750fb. If you want to compile it as a module, say M
+15 -15
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
··· 87 87 .depth = 12, 88 88 .mmal_component = COMP_CAMERA, 89 89 .ybbp = 1, 90 - .remove_padding = 1, 90 + .remove_padding = true, 91 91 }, { 92 92 .fourcc = V4L2_PIX_FMT_YUYV, 93 93 .mmal = MMAL_ENCODING_YUYV, 94 94 .depth = 16, 95 95 .mmal_component = COMP_CAMERA, 96 96 .ybbp = 2, 97 - .remove_padding = 0, 97 + .remove_padding = false, 98 98 }, { 99 99 .fourcc = V4L2_PIX_FMT_RGB24, 100 100 .mmal = MMAL_ENCODING_RGB24, 101 101 .depth = 24, 102 102 .mmal_component = COMP_CAMERA, 103 103 .ybbp = 3, 104 - .remove_padding = 0, 104 + .remove_padding = false, 105 105 }, { 106 106 .fourcc = V4L2_PIX_FMT_JPEG, 107 107 .flags = V4L2_FMT_FLAG_COMPRESSED, ··· 109 109 .depth = 8, 110 110 .mmal_component = COMP_IMAGE_ENCODE, 111 111 .ybbp = 0, 112 - .remove_padding = 0, 112 + .remove_padding = false, 113 113 }, { 114 114 .fourcc = V4L2_PIX_FMT_H264, 115 115 .flags = V4L2_FMT_FLAG_COMPRESSED, ··· 117 117 .depth = 8, 118 118 .mmal_component = COMP_VIDEO_ENCODE, 119 119 .ybbp = 0, 120 - .remove_padding = 0, 120 + .remove_padding = false, 121 121 }, { 122 122 .fourcc = V4L2_PIX_FMT_MJPEG, 123 123 .flags = V4L2_FMT_FLAG_COMPRESSED, ··· 125 125 .depth = 8, 126 126 .mmal_component = COMP_VIDEO_ENCODE, 127 127 .ybbp = 0, 128 - .remove_padding = 0, 128 + .remove_padding = false, 129 129 }, { 130 130 .fourcc = V4L2_PIX_FMT_YVYU, 131 131 .mmal = MMAL_ENCODING_YVYU, 132 132 .depth = 16, 133 133 .mmal_component = COMP_CAMERA, 134 134 .ybbp = 2, 135 - .remove_padding = 0, 135 + .remove_padding = false, 136 136 }, { 137 137 .fourcc = V4L2_PIX_FMT_VYUY, 138 138 .mmal = MMAL_ENCODING_VYUY, 139 139 .depth = 16, 140 140 .mmal_component = COMP_CAMERA, 141 141 .ybbp = 2, 142 - .remove_padding = 0, 142 + .remove_padding = false, 143 143 }, { 144 144 .fourcc = V4L2_PIX_FMT_UYVY, 145 145 .mmal = MMAL_ENCODING_UYVY, 146 146 .depth = 16, 147 147 .mmal_component = COMP_CAMERA, 148 148 .ybbp = 2, 149 - .remove_padding = 0, 149 + .remove_padding = false, 150 150 }, { 151 151 .fourcc = V4L2_PIX_FMT_NV12, 152 152 .mmal = MMAL_ENCODING_NV12, 153 153 .depth = 12, 154 154 .mmal_component = COMP_CAMERA, 155 155 .ybbp = 1, 156 - .remove_padding = 1, 156 + .remove_padding = true, 157 157 }, { 158 158 .fourcc = V4L2_PIX_FMT_BGR24, 159 159 .mmal = MMAL_ENCODING_BGR24, 160 160 .depth = 24, 161 161 .mmal_component = COMP_CAMERA, 162 162 .ybbp = 3, 163 - .remove_padding = 0, 163 + .remove_padding = false, 164 164 }, { 165 165 .fourcc = V4L2_PIX_FMT_YVU420, 166 166 .mmal = MMAL_ENCODING_YV12, 167 167 .depth = 12, 168 168 .mmal_component = COMP_CAMERA, 169 169 .ybbp = 1, 170 - .remove_padding = 1, 170 + .remove_padding = true, 171 171 }, { 172 172 .fourcc = V4L2_PIX_FMT_NV21, 173 173 .mmal = MMAL_ENCODING_NV21, 174 174 .depth = 12, 175 175 .mmal_component = COMP_CAMERA, 176 176 .ybbp = 1, 177 - .remove_padding = 1, 177 + .remove_padding = true, 178 178 }, { 179 179 .fourcc = V4L2_PIX_FMT_BGR32, 180 180 .mmal = MMAL_ENCODING_BGRA, 181 181 .depth = 32, 182 182 .mmal_component = COMP_CAMERA, 183 183 .ybbp = 4, 184 - .remove_padding = 0, 184 + .remove_padding = false, 185 185 }, 186 186 }; 187 187 ··· 1147 1147 struct vchiq_mmal_port *port = NULL, *camera_port = NULL; 1148 1148 struct vchiq_mmal_component *encode_component = NULL; 1149 1149 struct mmal_fmt *mfmt = get_format(f); 1150 - u32 remove_padding; 1150 + bool remove_padding; 1151 1151 1152 1152 if (!mfmt) 1153 1153 return -EINVAL;
+9 -9
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
··· 863 863 goto release_msg; 864 864 865 865 if (rmsg->u.port_info_get_reply.port.is_enabled == 0) 866 - port->enabled = 0; 866 + port->enabled = false; 867 867 else 868 - port->enabled = 1; 868 + port->enabled = true; 869 869 870 870 /* copy the values out of the message */ 871 871 port->handle = rmsg->u.port_info_get_reply.port_handle; ··· 1304 1304 if (!port->enabled) 1305 1305 return 0; 1306 1306 1307 - port->enabled = 0; 1307 + port->enabled = false; 1308 1308 1309 1309 ret = port_action_port(instance, port, 1310 1310 MMAL_MSG_PORT_ACTION_TYPE_DISABLE); ··· 1359 1359 if (ret) 1360 1360 goto done; 1361 1361 1362 - port->enabled = 1; 1362 + port->enabled = true; 1363 1363 1364 1364 if (port->buffer_cb) { 1365 1365 /* send buffer headers to videocore */ ··· 1531 1531 pr_err("failed disconnecting src port\n"); 1532 1532 goto release_unlock; 1533 1533 } 1534 - src->connected->enabled = 0; 1534 + src->connected->enabled = false; 1535 1535 src->connected = NULL; 1536 1536 } 1537 1537 ··· 1648 1648 for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) { 1649 1649 if (!instance->component[idx].in_use) { 1650 1650 component = &instance->component[idx]; 1651 - component->in_use = 1; 1651 + component->in_use = true; 1652 1652 break; 1653 1653 } 1654 1654 } ··· 1724 1724 destroy_component(instance, component); 1725 1725 unlock: 1726 1726 if (component) 1727 - component->in_use = 0; 1727 + component->in_use = false; 1728 1728 mutex_unlock(&instance->vchiq_mutex); 1729 1729 1730 1730 return ret; ··· 1747 1747 1748 1748 ret = destroy_component(instance, component); 1749 1749 1750 - component->in_use = 0; 1750 + component->in_use = false; 1751 1751 1752 1752 mutex_unlock(&instance->vchiq_mutex); 1753 1753 ··· 1799 1799 1800 1800 ret = disable_component(instance, component); 1801 1801 if (ret == 0) 1802 - component->enabled = 0; 1802 + component->enabled = false; 1803 1803 1804 1804 mutex_unlock(&instance->vchiq_mutex); 1805 1805
+3 -3
drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.h
··· 48 48 int status, struct mmal_buffer *buffer); 49 49 50 50 struct vchiq_mmal_port { 51 - u32 enabled:1; 51 + bool enabled; 52 52 u32 handle; 53 53 u32 type; /* port type, cached to use on port info set */ 54 54 u32 index; /* port index, cached to use on port info set */ ··· 82 82 }; 83 83 84 84 struct vchiq_mmal_component { 85 - u32 in_use:1; 86 - u32 enabled:1; 85 + bool in_use; 86 + bool enabled; 87 87 u32 handle; /* VideoCore handle for component */ 88 88 u32 inputs; /* Number of input ports */ 89 89 u32 outputs; /* Number of output ports */
-2
drivers/staging/vme_user/vme.h
··· 27 27 #define VME_A64_MAX 0x10000000000000000ULL 28 28 #define VME_CRCSR_MAX 0x1000000ULL 29 29 30 - 31 30 /* VME Cycle Types */ 32 31 #define VME_SCT 0x1 33 32 #define VME_BLT 0x2 ··· 183 184 184 185 int vme_register_driver(struct vme_driver *, unsigned int); 185 186 void vme_unregister_driver(struct vme_driver *); 186 - 187 187 188 188 #endif /* _VME_H_ */ 189 189
+3 -6
drivers/staging/vme_user/vme_fake.c
··· 356 356 return 0; 357 357 } 358 358 359 - 360 359 static int fake_master_get(struct vme_master_resource *image, int *enabled, 361 360 unsigned long long *vme_base, unsigned long long *size, 362 361 u32 *aspace, u32 *cycle, u32 *dwidth) ··· 371 372 372 373 return retval; 373 374 } 374 - 375 375 376 376 static void fake_lm_check(struct fake_driver *bridge, unsigned long long addr, 377 377 u32 aspace, u32 cycle) ··· 1058 1060 kfree(bridge->crcsr_kernel); 1059 1061 } 1060 1062 1061 - 1062 1063 static int __init fake_init(void) 1063 1064 { 1064 1065 int retval, i; ··· 1069 1072 struct vme_lm_resource *lm; 1070 1073 1071 1074 /* We need a fake parent device */ 1072 - vme_root = __root_device_register("vme", THIS_MODULE); 1075 + vme_root = root_device_register("vme"); 1076 + if (IS_ERR(vme_root)) 1077 + return PTR_ERR(vme_root); 1073 1078 1074 1079 /* If we want to support more than one bridge at some point, we need to 1075 1080 * dynamically allocate this so we get one per device. ··· 1237 1238 1238 1239 } 1239 1240 1240 - 1241 1241 static void __exit fake_exit(void) 1242 1242 { 1243 1243 struct list_head *pos = NULL; ··· 1291 1293 1292 1294 root_device_unregister(vme_root); 1293 1295 } 1294 - 1295 1296 1296 1297 MODULE_PARM_DESC(geoid, "Set geographical addressing"); 1297 1298 module_param(geoid, int, 0);
+1 -6
drivers/staging/vme_user/vme_tsi148.c
··· 34 34 static int tsi148_probe(struct pci_dev *, const struct pci_device_id *); 35 35 static void tsi148_remove(struct pci_dev *); 36 36 37 - 38 37 /* Module parameter */ 39 38 static bool err_chk; 40 39 static int geoid; ··· 672 673 /* Need granularity before we set the size */ 673 674 *size = (unsigned long long)((vme_bound - *vme_base) + granularity); 674 675 675 - 676 676 if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_160) 677 677 *cycle |= VME_2eSST160; 678 678 if ((ctl & TSI148_LCSR_ITAT_2eSSTM_M) == TSI148_LCSR_ITAT_2eSSTM_267) ··· 1140 1142 return 0; 1141 1143 } 1142 1144 1143 - 1144 1145 static int tsi148_master_get(struct vme_master_resource *image, int *enabled, 1145 1146 unsigned long long *vme_base, unsigned long long *size, u32 *aspace, 1146 1147 u32 *cycle, u32 *dwidth) ··· 1240 1243 1241 1244 return retval; 1242 1245 } 1243 - 1244 1246 1245 1247 static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf, 1246 1248 size_t count, loff_t offset) ··· 1747 1751 return 0; 1748 1752 1749 1753 err_dma: 1754 + list_del(&entry->list); 1750 1755 err_dest: 1751 1756 err_source: 1752 1757 err_align: ··· 1995 1998 1996 1999 if ((lm_ctl & TSI148_LCSR_LMAT_AS_M) == TSI148_LCSR_LMAT_AS_A64) 1997 2000 *aspace |= VME_A64; 1998 - 1999 2001 2000 2002 if (lm_ctl & TSI148_LCSR_LMAT_SUPR) 2001 2003 *cycle |= VME_SUPER; ··· 2545 2549 struct vme_bridge *tsi148_bridge = pci_get_drvdata(pdev); 2546 2550 2547 2551 bridge = tsi148_bridge->driver_priv; 2548 - 2549 2552 2550 2553 dev_dbg(&pdev->dev, "Driver is being unloaded.\n"); 2551 2554
-7
drivers/staging/vme_user/vme_tsi148.h
··· 87 87 * Control and Status Registers 88 88 */ 89 89 90 - 91 90 /* 92 91 * Command/Status Registers (CRG + $004) 93 92 */ ··· 341 342 #define TSI148_LCSR_IT7_ITOFL 0x3F4 342 343 #define TSI148_LCSR_IT7_ITAT 0x3F8 343 344 344 - 345 345 #define TSI148_LCSR_IT0 0x300 346 346 #define TSI148_LCSR_IT1 0x320 347 347 #define TSI148_LCSR_IT2 0x340 ··· 462 464 #define TSI148_LCSR_DMA0 0x500 463 465 #define TSI148_LCSR_DMA1 0x580 464 466 465 - 466 467 static const int TSI148_LCSR_DMA[TSI148_MAX_DMA] = { TSI148_LCSR_DMA0, 467 468 TSI148_LCSR_DMA1 }; 468 469 ··· 528 531 #define TSI148_CSRBCR 0xFF4 529 532 #define TSI148_CSRBSR 0xFF8 530 533 #define TSI148_CBAR 0xFFC 531 - 532 - 533 - 534 534 535 535 /* 536 536 * TSI148 Register Bit Definitions ··· 821 827 #define TSI148_LCSR_VEAT_DS0 (1<<14) /* DS0_ signal state */ 822 828 #define TSI148_LCSR_VEAT_AM_M (0x3F<<8) /* Address Mode Mask */ 823 829 #define TSI148_LCSR_VEAT_XAM_M (0xFF<<0) /* Master AMode Mask */ 824 - 825 830 826 831 /* 827 832 * VMEbus PCI Error Diagnostics PCI/X Attributes Register CRG + $280
+18 -18
drivers/staging/vt6655/rxtx.c
··· 54 54 */ 55 55 #define CRITICAL_PACKET_LEN 256 56 56 57 - static const unsigned short wTimeStampOff[2][MAX_RATE] = { 57 + static const unsigned short time_stamp_off[2][MAX_RATE] = { 58 58 {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23}, /* Long Preamble */ 59 59 {384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23}, /* Short Preamble */ 60 60 }; 61 61 62 - static const unsigned short wFB_Opt0[2][5] = { 62 + static const unsigned short fb_opt0[2][5] = { 63 63 {RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, /* fallback_rate0 */ 64 64 {RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, /* fallback_rate1 */ 65 65 }; 66 66 67 - static const unsigned short wFB_Opt1[2][5] = { 67 + static const unsigned short fb_opt1[2][5] = { 68 68 {RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, /* fallback_rate0 */ 69 69 {RATE_6M, RATE_6M, RATE_12M, RATE_12M, RATE_18M}, /* fallback_rate1 */ 70 70 }; ··· 142 142 143 143 static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate) 144 144 { 145 - return cpu_to_le16(wTimeStampOff[priv->preamble_type % 2] 145 + return cpu_to_le16(time_stamp_off[priv->preamble_type % 2] 146 146 [rate % MAX_RATE]); 147 147 } 148 148 ··· 310 310 wRate -= RATE_18M; 311 311 312 312 if (byFBOption == AUTO_FB_0) 313 - wRate = wFB_Opt0[FB_RATE0][wRate]; 313 + wRate = fb_opt0[FB_RATE0][wRate]; 314 314 else 315 - wRate = wFB_Opt1[FB_RATE0][wRate]; 315 + wRate = fb_opt1[FB_RATE0][wRate]; 316 316 317 317 uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, 318 318 len, wRate, bNeedAck); ··· 365 365 case RTSDUR_BA_F0: /* RTSDuration_ba_f0 */ 366 366 uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); 367 367 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 368 - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); 368 + uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); 369 369 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 370 - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); 370 + uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); 371 371 372 372 break; 373 373 374 374 case RTSDUR_AA_F0: /* RTSDuration_aa_f0 */ 375 375 uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate); 376 376 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 377 - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); 377 + uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); 378 378 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 379 - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); 379 + uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); 380 380 381 381 break; 382 382 383 383 case RTSDUR_BA_F1: /* RTSDuration_ba_f1 */ 384 384 uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopCCKBasicRate); 385 385 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 386 - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); 386 + uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); 387 387 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 388 - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); 388 + uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); 389 389 390 390 break; 391 391 392 392 case RTSDUR_AA_F1: /* RTSDuration_aa_f1 */ 393 393 uCTSTime = bb_get_frame_time(pDevice->preamble_type, byPktType, 14, pDevice->byTopOFDMBasicRate); 394 394 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 395 - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); 395 + uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); 396 396 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 397 - uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); 397 + uDurTime = uCTSTime + 2 * pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); 398 398 399 399 break; 400 400 401 401 case CTSDUR_BA_F0: /* CTSDuration_ba_f0 */ 402 402 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 403 - uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); 403 + uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE0][wRate - RATE_18M], bNeedAck); 404 404 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 405 - uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); 405 + uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE0][wRate - RATE_18M], bNeedAck); 406 406 407 407 break; 408 408 409 409 case CTSDUR_BA_F1: /* CTSDuration_ba_f1 */ 410 410 if ((byFBOption == AUTO_FB_0) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 411 - uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); 411 + uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt0[FB_RATE1][wRate - RATE_18M], bNeedAck); 412 412 else if ((byFBOption == AUTO_FB_1) && (wRate >= RATE_18M) && (wRate <= RATE_54M)) 413 - uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); 413 + uDurTime = pDevice->uSIFS + s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, fb_opt1[FB_RATE1][wRate - RATE_18M], bNeedAck); 414 414 415 415 break; 416 416
+16
drivers/staging/wlan-ng/TODO
··· 1 + To-do list: 2 + 3 + * Correct the coding style according to Linux guidelines; please read the document 4 + at https://www.kernel.org/doc/html/latest/process/coding-style.html. 5 + * Remove unnecessary debugging/printing macros; for those that are still needed 6 + use the proper kernel API (pr_debug(), dev_dbg(), netdev_dbg()). 7 + * Remove dead code such as unusued functions, variables, fields, etc.. 8 + * Use in-kernel API and remove unnecessary wrappers where possible. 9 + * Fix bugs due to code that sleeps in atomic context. 10 + * Remove the HAL layer and migrate its functionality into the relevant parts of 11 + the driver. 12 + * Switch to use LIB80211. 13 + * Switch to use MAC80211. 14 + * Switch to use CFG80211. 15 + * Improve the error handling of various functions, particularly those that use 16 + existing kernel APIs.
-301
drivers/staging/wlan-ng/p80211mgmt.h
··· 217 217 #define WLAN_SET_MGMT_CAP_INFO_PBCC(n) ((n) << 6) 218 218 #define WLAN_SET_MGMT_CAP_INFO_AGILITY(n) ((n) << 7) 219 219 220 - /*-- Information Element Types --------------------*/ 221 - /* prototype structure, all IEs start with these members */ 222 - 223 - struct wlan_ie { 224 - u8 eid; 225 - u8 len; 226 - } __packed; 227 - 228 - /*-- Service Set Identity (SSID) -----------------*/ 229 - struct wlan_ie_ssid { 230 - u8 eid; 231 - u8 len; 232 - u8 ssid[1]; /* may be zero, ptrs may overlap */ 233 - } __packed; 234 - 235 - /*-- Supported Rates -----------------------------*/ 236 - struct wlan_ie_supp_rates { 237 - u8 eid; 238 - u8 len; 239 - u8 rates[1]; /* had better be at LEAST one! */ 240 - } __packed; 241 - 242 - /*-- FH Parameter Set ----------------------------*/ 243 - struct wlan_ie_fh_parms { 244 - u8 eid; 245 - u8 len; 246 - u16 dwell; 247 - u8 hopset; 248 - u8 hoppattern; 249 - u8 hopindex; 250 - } __packed; 251 - 252 - /*-- DS Parameter Set ----------------------------*/ 253 - struct wlan_ie_ds_parms { 254 - u8 eid; 255 - u8 len; 256 - u8 curr_ch; 257 - } __packed; 258 - 259 - /*-- CF Parameter Set ----------------------------*/ 260 - 261 - struct wlan_ie_cf_parms { 262 - u8 eid; 263 - u8 len; 264 - u8 cfp_cnt; 265 - u8 cfp_period; 266 - u16 cfp_maxdur; 267 - u16 cfp_durremaining; 268 - } __packed; 269 - 270 - /*-- TIM ------------------------------------------*/ 271 - struct wlan_ie_tim { 272 - u8 eid; 273 - u8 len; 274 - u8 dtim_cnt; 275 - u8 dtim_period; 276 - u8 bitmap_ctl; 277 - u8 virt_bm[1]; 278 - } __packed; 279 - 280 - /*-- IBSS Parameter Set ---------------------------*/ 281 - struct wlan_ie_ibss_parms { 282 - u8 eid; 283 - u8 len; 284 - u16 atim_win; 285 - } __packed; 286 - 287 - /*-- Challenge Text ------------------------------*/ 288 - struct wlan_ie_challenge { 289 - u8 eid; 290 - u8 len; 291 - u8 challenge[1]; 292 - } __packed; 293 - 294 - /*-------------------------------------------------*/ 295 - /* Frame Types */ 296 - 297 - /* prototype structure, all mgmt frame types will start with these members */ 298 - struct wlan_fr_mgmt { 299 - u16 type; 300 - u16 len; /* DOES NOT include CRC !!!! */ 301 - u8 *buf; 302 - struct p80211_hdr *hdr; 303 - /* used for target specific data, skb in Linux */ 304 - void *priv; 305 - /*-- fixed fields -----------*/ 306 - /*-- info elements ----------*/ 307 - }; 308 - 309 - /*-- Beacon ---------------------------------------*/ 310 - struct wlan_fr_beacon { 311 - u16 type; 312 - u16 len; 313 - u8 *buf; 314 - struct p80211_hdr *hdr; 315 - /* used for target specific data, skb in Linux */ 316 - void *priv; 317 - /*-- fixed fields -----------*/ 318 - u64 *ts; 319 - u16 *bcn_int; 320 - u16 *cap_info; 321 - /*-- info elements ----------*/ 322 - struct wlan_ie_ssid *ssid; 323 - struct wlan_ie_supp_rates *supp_rates; 324 - struct wlan_ie_fh_parms *fh_parms; 325 - struct wlan_ie_ds_parms *ds_parms; 326 - struct wlan_ie_cf_parms *cf_parms; 327 - struct wlan_ie_ibss_parms *ibss_parms; 328 - struct wlan_ie_tim *tim; 329 - 330 - }; 331 - 332 - /*-- IBSS ATIM ------------------------------------*/ 333 - struct wlan_fr_ibssatim { 334 - u16 type; 335 - u16 len; 336 - u8 *buf; 337 - struct p80211_hdr *hdr; 338 - /* used for target specific data, skb in Linux */ 339 - void *priv; 340 - 341 - /*-- fixed fields -----------*/ 342 - /*-- info elements ----------*/ 343 - 344 - /* this frame type has a null body */ 345 - 346 - }; 347 - 348 - /*-- Disassociation -------------------------------*/ 349 - struct wlan_fr_disassoc { 350 - u16 type; 351 - u16 len; 352 - u8 *buf; 353 - struct p80211_hdr *hdr; 354 - /* used for target specific data, skb in Linux */ 355 - void *priv; 356 - /*-- fixed fields -----------*/ 357 - u16 *reason; 358 - 359 - /*-- info elements ----------*/ 360 - 361 - }; 362 - 363 - /*-- Association Request --------------------------*/ 364 - struct wlan_fr_assocreq { 365 - u16 type; 366 - u16 len; 367 - u8 *buf; 368 - struct p80211_hdr *hdr; 369 - /* used for target specific data, skb in Linux */ 370 - void *priv; 371 - /*-- fixed fields -----------*/ 372 - u16 *cap_info; 373 - u16 *listen_int; 374 - /*-- info elements ----------*/ 375 - struct wlan_ie_ssid *ssid; 376 - struct wlan_ie_supp_rates *supp_rates; 377 - 378 - }; 379 - 380 - /*-- Association Response -------------------------*/ 381 - struct wlan_fr_assocresp { 382 - u16 type; 383 - u16 len; 384 - u8 *buf; 385 - struct p80211_hdr *hdr; 386 - /* used for target specific data, skb in Linux */ 387 - void *priv; 388 - /*-- fixed fields -----------*/ 389 - u16 *cap_info; 390 - u16 *status; 391 - u16 *aid; 392 - /*-- info elements ----------*/ 393 - struct wlan_ie_supp_rates *supp_rates; 394 - 395 - }; 396 - 397 - /*-- Reassociation Request ------------------------*/ 398 - struct wlan_fr_reassocreq { 399 - u16 type; 400 - u16 len; 401 - u8 *buf; 402 - struct p80211_hdr *hdr; 403 - /* used for target specific data, skb in Linux */ 404 - void *priv; 405 - /*-- fixed fields -----------*/ 406 - u16 *cap_info; 407 - u16 *listen_int; 408 - u8 *curr_ap; 409 - /*-- info elements ----------*/ 410 - struct wlan_ie_ssid *ssid; 411 - struct wlan_ie_supp_rates *supp_rates; 412 - 413 - }; 414 - 415 - /*-- Reassociation Response -----------------------*/ 416 - struct wlan_fr_reassocresp { 417 - u16 type; 418 - u16 len; 419 - u8 *buf; 420 - struct p80211_hdr *hdr; 421 - /* used for target specific data, skb in Linux */ 422 - void *priv; 423 - /*-- fixed fields -----------*/ 424 - u16 *cap_info; 425 - u16 *status; 426 - u16 *aid; 427 - /*-- info elements ----------*/ 428 - struct wlan_ie_supp_rates *supp_rates; 429 - 430 - }; 431 - 432 - /*-- Probe Request --------------------------------*/ 433 - struct wlan_fr_probereq { 434 - u16 type; 435 - u16 len; 436 - u8 *buf; 437 - struct p80211_hdr *hdr; 438 - /* used for target specific data, skb in Linux */ 439 - void *priv; 440 - /*-- fixed fields -----------*/ 441 - /*-- info elements ----------*/ 442 - struct wlan_ie_ssid *ssid; 443 - struct wlan_ie_supp_rates *supp_rates; 444 - 445 - }; 446 - 447 - /*-- Probe Response -------------------------------*/ 448 - struct wlan_fr_proberesp { 449 - u16 type; 450 - u16 len; 451 - u8 *buf; 452 - struct p80211_hdr *hdr; 453 - /* used for target specific data, skb in Linux */ 454 - void *priv; 455 - /*-- fixed fields -----------*/ 456 - u64 *ts; 457 - u16 *bcn_int; 458 - u16 *cap_info; 459 - /*-- info elements ----------*/ 460 - struct wlan_ie_ssid *ssid; 461 - struct wlan_ie_supp_rates *supp_rates; 462 - struct wlan_ie_fh_parms *fh_parms; 463 - struct wlan_ie_ds_parms *ds_parms; 464 - struct wlan_ie_cf_parms *cf_parms; 465 - struct wlan_ie_ibss_parms *ibss_parms; 466 - }; 467 - 468 - /*-- Authentication -------------------------------*/ 469 - struct wlan_fr_authen { 470 - u16 type; 471 - u16 len; 472 - u8 *buf; 473 - struct p80211_hdr *hdr; 474 - /* used for target specific data, skb in Linux */ 475 - void *priv; 476 - /*-- fixed fields -----------*/ 477 - u16 *auth_alg; 478 - u16 *auth_seq; 479 - u16 *status; 480 - /*-- info elements ----------*/ 481 - struct wlan_ie_challenge *challenge; 482 - 483 - }; 484 - 485 - /*-- Deauthenication -----------------------------*/ 486 - struct wlan_fr_deauthen { 487 - u16 type; 488 - u16 len; 489 - u8 *buf; 490 - struct p80211_hdr *hdr; 491 - /* used for target specific data, skb in Linux */ 492 - void *priv; 493 - /*-- fixed fields -----------*/ 494 - u16 *reason; 495 - 496 - /*-- info elements ----------*/ 497 - 498 - }; 499 - 500 - void wlan_mgmt_encode_beacon(struct wlan_fr_beacon *f); 501 - void wlan_mgmt_decode_beacon(struct wlan_fr_beacon *f); 502 - void wlan_mgmt_encode_disassoc(struct wlan_fr_disassoc *f); 503 - void wlan_mgmt_decode_disassoc(struct wlan_fr_disassoc *f); 504 - void wlan_mgmt_encode_assocreq(struct wlan_fr_assocreq *f); 505 - void wlan_mgmt_decode_assocreq(struct wlan_fr_assocreq *f); 506 - void wlan_mgmt_encode_assocresp(struct wlan_fr_assocresp *f); 507 - void wlan_mgmt_decode_assocresp(struct wlan_fr_assocresp *f); 508 - void wlan_mgmt_encode_reassocreq(struct wlan_fr_reassocreq *f); 509 - void wlan_mgmt_decode_reassocreq(struct wlan_fr_reassocreq *f); 510 - void wlan_mgmt_encode_reassocresp(struct wlan_fr_reassocresp *f); 511 - void wlan_mgmt_decode_reassocresp(struct wlan_fr_reassocresp *f); 512 - void wlan_mgmt_encode_probereq(struct wlan_fr_probereq *f); 513 - void wlan_mgmt_decode_probereq(struct wlan_fr_probereq *f); 514 - void wlan_mgmt_encode_proberesp(struct wlan_fr_proberesp *f); 515 - void wlan_mgmt_decode_proberesp(struct wlan_fr_proberesp *f); 516 - void wlan_mgmt_encode_authen(struct wlan_fr_authen *f); 517 - void wlan_mgmt_decode_authen(struct wlan_fr_authen *f); 518 - void wlan_mgmt_encode_deauthen(struct wlan_fr_deauthen *f); 519 - void wlan_mgmt_decode_deauthen(struct wlan_fr_deauthen *f); 520 - 521 220 #endif /* _P80211MGMT_H */
-22
drivers/staging/wlan-ng/p80211netdev.c
··· 881 881 wlandev->rx.mgmt++; 882 882 switch (fstype) { 883 883 case WLAN_FSTYPE_ASSOCREQ: 884 - /* printk("assocreq"); */ 885 884 wlandev->rx.assocreq++; 886 885 break; 887 886 case WLAN_FSTYPE_ASSOCRESP: 888 - /* printk("assocresp"); */ 889 887 wlandev->rx.assocresp++; 890 888 break; 891 889 case WLAN_FSTYPE_REASSOCREQ: 892 - /* printk("reassocreq"); */ 893 890 wlandev->rx.reassocreq++; 894 891 break; 895 892 case WLAN_FSTYPE_REASSOCRESP: 896 - /* printk("reassocresp"); */ 897 893 wlandev->rx.reassocresp++; 898 894 break; 899 895 case WLAN_FSTYPE_PROBEREQ: 900 - /* printk("probereq"); */ 901 896 wlandev->rx.probereq++; 902 897 break; 903 898 case WLAN_FSTYPE_PROBERESP: 904 - /* printk("proberesp"); */ 905 899 wlandev->rx.proberesp++; 906 900 break; 907 901 case WLAN_FSTYPE_BEACON: 908 - /* printk("beacon"); */ 909 902 wlandev->rx.beacon++; 910 903 break; 911 904 case WLAN_FSTYPE_ATIM: 912 - /* printk("atim"); */ 913 905 wlandev->rx.atim++; 914 906 break; 915 907 case WLAN_FSTYPE_DISASSOC: 916 - /* printk("disassoc"); */ 917 908 wlandev->rx.disassoc++; 918 909 break; 919 910 case WLAN_FSTYPE_AUTHEN: 920 - /* printk("authen"); */ 921 911 wlandev->rx.authen++; 922 912 break; 923 913 case WLAN_FSTYPE_DEAUTHEN: 924 - /* printk("deauthen"); */ 925 914 wlandev->rx.deauthen++; 926 915 break; 927 916 default: 928 - /* printk("unknown"); */ 929 917 wlandev->rx.mgmt_unknown++; 930 918 break; 931 919 } 932 - /* printk("\n"); */ 933 920 drop = 2; 934 921 break; 935 922 ··· 930 943 wlandev->rx.ctl++; 931 944 switch (fstype) { 932 945 case WLAN_FSTYPE_PSPOLL: 933 - /* printk("pspoll"); */ 934 946 wlandev->rx.pspoll++; 935 947 break; 936 948 case WLAN_FSTYPE_RTS: 937 - /* printk("rts"); */ 938 949 wlandev->rx.rts++; 939 950 break; 940 951 case WLAN_FSTYPE_CTS: 941 - /* printk("cts"); */ 942 952 wlandev->rx.cts++; 943 953 break; 944 954 case WLAN_FSTYPE_ACK: 945 - /* printk("ack"); */ 946 955 wlandev->rx.ack++; 947 956 break; 948 957 case WLAN_FSTYPE_CFEND: 949 - /* printk("cfend"); */ 950 958 wlandev->rx.cfend++; 951 959 break; 952 960 case WLAN_FSTYPE_CFENDCFACK: 953 - /* printk("cfendcfack"); */ 954 961 wlandev->rx.cfendcfack++; 955 962 break; 956 963 default: 957 - /* printk("unknown"); */ 958 964 wlandev->rx.ctl_unknown++; 959 965 break; 960 966 } 961 - /* printk("\n"); */ 962 967 drop = 2; 963 968 break; 964 969 ··· 986 1007 wlandev->rx.cfack_cfpoll++; 987 1008 break; 988 1009 default: 989 - /* printk("unknown"); */ 990 1010 wlandev->rx.data_unknown++; 991 1011 break; 992 1012 }
-6
drivers/staging/wlan-ng/p80211types.h
··· 231 231 u8 data[MAXLEN_PSTR32]; 232 232 } __packed; 233 233 234 - /* MAC address array */ 235 - struct p80211macarray { 236 - u32 cnt; 237 - u8 data[1][MAXLEN_PSTR6]; 238 - } __packed; 239 - 240 234 /* prototype template */ 241 235 struct p80211item { 242 236 u32 did;