diff -Nru rtl8192ee-dkms-5.2.19~impish4/debian/changelog rtl8192ee-dkms-5.2.19~impish5/debian/changelog --- rtl8192ee-dkms-5.2.19~impish4/debian/changelog 2022-02-13 21:00:00.000000000 +0000 +++ rtl8192ee-dkms-5.2.19~impish5/debian/changelog 2022-04-25 10:47:35.000000000 +0000 @@ -1,4 +1,11 @@ -rtl8192ee-dkms (5.2.19~impish4) impish; urgency=medium +rtl8192ee-dkms (5.2.19~impish5) impish; urgency=medium + + * Updated from github source (Apr 25, 2022). + - Buildfix for Linux 5.18 + + -- Gökhan Gökkaya Mon, 25 Apr 2022 13:47:35 +0300 + +rtl8192ee-dkms (5.2.19~focal4) focal; urgency=medium * Updated from github source (Feb 3, 2022). - Fix build with kernel 5.17 diff -Nru rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/hal/rtl8192e/pci/pci_ops_linux.c rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/hal/rtl8192e/pci/pci_ops_linux.c --- rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/hal/rtl8192e/pci/pci_ops_linux.c 2022-02-13 20:58:22.000000000 +0000 +++ rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/hal/rtl8192e/pci/pci_ops_linux.c 2022-04-25 10:45:16.000000000 +0000 @@ -49,9 +49,15 @@ /* rx_queue_idx 1:RX_CMD_QUEUE */ for (rx_queue_idx = 0; rx_queue_idx < 1/*RX_MAX_QUEUE*/; rx_queue_idx++) { precvpriv->rx_ring[rx_queue_idx].desc = +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + dma_alloc_coherent(&pdev->dev, + sizeof(*precvpriv->rx_ring[rx_queue_idx].desc) * precvpriv->rxringcount, + &precvpriv->rx_ring[rx_queue_idx].dma, GFP_KERNEL); +#else pci_alloc_consistent(pdev, sizeof(*precvpriv->rx_ring[rx_queue_idx].desc) * precvpriv->rxringcount, &precvpriv->rx_ring[rx_queue_idx].dma); +#endif if (!precvpriv->rx_ring[rx_queue_idx].desc || (unsigned long)precvpriv->rx_ring[rx_queue_idx].desc & 0xFF) { @@ -76,9 +82,15 @@ mapping = (dma_addr_t *)skb->cb; /* just set skb->cb to mapping addr for pci_unmap_single use */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + *mapping = dma_map_single(&pdev->dev, skb_tail_pointer(skb), + precvpriv->rxbuffersize, + DMA_FROM_DEVICE); +#else *mapping = pci_map_single(pdev, skb_tail_pointer(skb), precvpriv->rxbuffersize, PCI_DMA_FROMDEVICE); +#endif /* Reset FS, LS, Total len */ SET_RX_BUFFER_DESC_LS_92E(rx_desc, 0); @@ -112,14 +124,25 @@ if (!skb) continue; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + dma_unmap_single(&pdev->dev, + *((dma_addr_t *) skb->cb), + precvpriv->rxbuffersize, + DMA_FROM_DEVICE); +#else pci_unmap_single(pdev, *((dma_addr_t *) skb->cb), precvpriv->rxbuffersize, PCI_DMA_FROMDEVICE); +#endif kfree_skb(skb); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + dma_free_coherent(&pdev->dev, +#else pci_free_consistent(pdev, +#endif sizeof(*precvpriv->rx_ring[rx_queue_idx].desc) * precvpriv->rxringcount, precvpriv->rx_ring[rx_queue_idx].desc, @@ -142,7 +165,11 @@ RTW_INFO("%s entries num:%d\n", __func__, entries); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + ring = dma_alloc_coherent(&pdev->dev, sizeof(*ring) * entries, &dma, GFP_KERNEL); +#else ring = pci_alloc_consistent(pdev, sizeof(*ring) * entries, &dma); +#endif if (!ring || (unsigned long)ring & 0xFF) { RTW_INFO("Cannot allocate TX ring (prio = %d)\n", prio); return _FAIL; @@ -181,7 +208,11 @@ pxmitbuf = rtl8192ee_dequeue_xmitbuf(ring); if (pxmitbuf) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + dma_unmap_single(&pdev->dev, GET_TX_DESC_TX_BUFFER_ADDRESS_92E(tx_desc), pxmitbuf->len, DMA_TO_DEVICE); +#else pci_unmap_single(pdev, GET_TX_DESC_TX_BUFFER_ADDRESS_92E(tx_desc), pxmitbuf->len, PCI_DMA_TODEVICE); +#endif rtw_free_xmitbuf(pxmitpriv, pxmitbuf); } else { RTW_INFO("%s(): qlen(%d) is not zero, but have xmitbuf in pending queue\n", __func__, ring->qlen); @@ -189,7 +220,11 @@ } } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + dma_free_coherent(&pdev->dev, sizeof(*ring->desc) * ring->entries, ring->desc, ring->dma); +#else pci_free_consistent(pdev, sizeof(*ring->desc) * ring->entries, ring->desc, ring->dma); +#endif ring->desc = NULL; } @@ -305,7 +340,11 @@ pxmitbuf = rtl8192ee_dequeue_xmitbuf(ring); if (pxmitbuf) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + dma_unmap_single(&pdvobjpriv->ppcidev->dev, GET_TX_DESC_TX_BUFFER_ADDRESS_92E(tx_desc), pxmitbuf->len, DMA_TO_DEVICE); +#else pci_unmap_single(pdvobjpriv->ppcidev, GET_TX_DESC_TX_BUFFER_ADDRESS_92E(tx_desc), pxmitbuf->len, PCI_DMA_TODEVICE); +#endif rtw_free_xmitbuf(pxmitpriv, pxmitbuf); } else { RTW_INFO("%s(): qlen(%d) is not zero, but have xmitbuf in pending queue\n", __func__, ring->qlen); @@ -520,7 +559,11 @@ pxmitbuf = rtl8192ee_dequeue_xmitbuf(ring); if (pxmitbuf) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + dma_unmap_single(&pdvobjpriv->ppcidev->dev, GET_TX_DESC_TX_BUFFER_ADDRESS_92E(tx_desc), pxmitbuf->len, DMA_TO_DEVICE); +#else pci_unmap_single(pdvobjpriv->ppcidev, GET_TX_DESC_TX_BUFFER_ADDRESS_92E(tx_desc), pxmitbuf->len, PCI_DMA_TODEVICE); +#endif rtw_sctx_done(&pxmitbuf->sctx); rtw_free_xmitbuf(&(pxmitbuf->padapter->xmitpriv), pxmitbuf); } else @@ -563,7 +606,11 @@ pxmitbuf = rtl8192ee_dequeue_xmitbuf(ring); if (pxmitbuf) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + dma_unmap_single(&pdvobjpriv->ppcidev->dev, GET_TX_DESC_TX_BUFFER_ADDRESS_92E(tx_desc), pxmitbuf->len, DMA_TO_DEVICE); +#else pci_unmap_single(pdvobjpriv->ppcidev, GET_TX_DESC_TX_BUFFER_ADDRESS_92E(tx_desc), pxmitbuf->len, PCI_DMA_TODEVICE); +#endif rtw_sctx_done(&pxmitbuf->sctx); rtw_free_xmitbuf(&(pxmitbuf->padapter->xmitpriv), pxmitbuf); } else @@ -880,10 +927,17 @@ * 8192EE_TODO */ precvframe->u.hdr.len = 0; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + dma_unmap_single(&pdvobjpriv->ppcidev->dev, + *((dma_addr_t *)skb->cb), + precvpriv->rxbuffersize, + DMA_FROM_DEVICE); +#else pci_unmap_single(pdvobjpriv->ppcidev, *((dma_addr_t *)skb->cb), precvpriv->rxbuffersize, PCI_DMA_FROMDEVICE); +#endif rtl8192e_query_rx_desc_status(precvframe, skb->data); @@ -903,7 +957,11 @@ rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue); RTW_INFO("rtl8192ee_rx_mpdu:can not allocate memory for skb copy\n"); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + *((dma_addr_t *) skb->cb) = dma_map_single(&pdvobjpriv->ppcidev->dev, skb_tail_pointer(skb), precvpriv->rxbuffersize, DMA_FROM_DEVICE); +#else *((dma_addr_t *) skb->cb) = pci_map_single(pdvobjpriv->ppcidev, skb_tail_pointer(skb), precvpriv->rxbuffersize, PCI_DMA_FROMDEVICE); +#endif goto done; } @@ -918,7 +976,11 @@ } rtw_free_recvframe(precvframe, pfree_recv_queue); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + *((dma_addr_t *) skb->cb) = dma_map_single(&pdvobjpriv->ppcidev->dev, skb_tail_pointer(skb), precvpriv->rxbuffersize, DMA_FROM_DEVICE); +#else *((dma_addr_t *) skb->cb) = pci_map_single(pdvobjpriv->ppcidev, skb_tail_pointer(skb), precvpriv->rxbuffersize, PCI_DMA_FROMDEVICE); +#endif } done: diff -Nru rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/hal/rtl8192e/pci/rtl8192ee_xmit.c rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/hal/rtl8192e/pci/rtl8192ee_xmit.c --- rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/hal/rtl8192e/pci/rtl8192ee_xmit.c 2022-02-13 20:58:22.000000000 +0000 +++ rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/hal/rtl8192e/pci/rtl8192ee_xmit.c 2022-04-25 10:45:16.000000000 +0000 @@ -345,7 +345,11 @@ HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + mapping = dma_map_single(&pdvobjpriv->ppcidev->dev, pxmitframe->buf_addr , sz + TX_WIFI_INFO_SIZE, DMA_TO_DEVICE); +#else mapping = pci_map_single(pdvobjpriv->ppcidev, pxmitframe->buf_addr , sz + TX_WIFI_INFO_SIZE, PCI_DMA_TODEVICE); +#endif /* Calculate page size. Total buffer length including TX_WIFI_INFO and PacketLen */ if (tx_page_size_reg > 0) { diff -Nru rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/include/ieee80211.h rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/include/ieee80211.h --- rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/include/ieee80211.h 2022-02-13 20:58:22.000000000 +0000 +++ rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/include/ieee80211.h 2022-04-25 10:45:16.000000000 +0000 @@ -1425,18 +1425,30 @@ (((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \ (((Addr[5]) & 0xff) == 0xff)) #else +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) +static inline int is_multicast_mac_addr(const u8 *addr) +#else extern __inline int is_multicast_mac_addr(const u8 *addr) +#endif { return (addr[0] != 0xff) && (0x01 & addr[0]); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) +static inline int is_broadcast_mac_addr(const u8 *addr) +#else extern __inline int is_broadcast_mac_addr(const u8 *addr) +#endif { return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) +static inline int is_zero_mac_addr(const u8 *addr) +#else extern __inline int is_zero_mac_addr(const u8 *addr) +#endif { return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \ (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00)); diff -Nru rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/os_dep/linux/pci_intf.c rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/os_dep/linux/pci_intf.c --- rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/os_dep/linux/pci_intf.c 2022-02-13 20:58:22.000000000 +0000 +++ rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/os_dep/linux/pci_intf.c 2022-04-25 10:45:16.000000000 +0000 @@ -1112,9 +1112,15 @@ } #ifdef CONFIG_64BIT_DMA +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) { + RTW_INFO("RTL819xCE: Using 64bit DMA\n"); + err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); +#else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { RTW_INFO("RTL819xCE: Using 64bit DMA\n"); err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); +#endif if (err != 0) { RTW_ERR("Unable to obtain 64bit DMA for consistent allocations\n"); goto disable_picdev; @@ -1123,8 +1129,13 @@ } else #endif { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)) + if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) { + err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); +#else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); +#endif if (err != 0) { RTW_ERR("Unable to obtain 32bit DMA for consistent allocations\n"); goto disable_picdev; diff -Nru rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/README.md rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/README.md --- rtl8192ee-dkms-5.2.19~impish4/rtl8192ee/README.md 1970-01-01 00:00:00.000000000 +0000 +++ rtl8192ee-dkms-5.2.19~impish5/rtl8192ee/README.md 2022-04-25 10:45:16.000000000 +0000 @@ -0,0 +1,114 @@ +IMPORTANT - PLEASE READ: + +Beginning on November 4, 2019, I will NO LONGER support people that have downloaded the source +as a zip file. Using git has much more flexibility. In addition, there is much less liklihood +that a user will contact me with a problem that is ALREADY fixed. + +If your system says that /lib/modules/...../build does not exist, you have not +installed the kernel headers, you have done it incorrectly, or you are not running +the kernel for which the headers have been installed. The necessary steps are +dependent on which distro you are using. Creating a new issue and asking at +GitHub will not be productive. + +Unsolicited E-mail sent to my private address will be ignored!! + +If a build fails that previously worked, perform a 'git pull' and retry before +reporting a problem. As noted, if you had downloaded the source in zip form, then you would +need to get an entirely new source file. That is why using git, which downloads only the changed +lines, is required. + +rtl8192ee +========= + +Repository for the stand-alone RTL8192EE driver. +May offer much better performance than the kernel rtl8192ee driver, especially when used as Access Point. +Still, it will, with difficulty, barely surpass 50Mbps of uplink, in the best conditions. + +Compiling & Building +--------- +### Dependencies +To compile the driver, you need to have make and a compiler installed. In addition, +you must have the kernel headers installed (usually package linux-headers or linux-headers-generic). If you do not understand what this means, +consult your distro's documentation. + +### Compiling + +Depending on your distribution, you *might* need to run this as root. + +`make all` + +### Installing + +`sudo make install` + +You must also blacklist the kernel driver, or it will override this one. + +`echo "blacklist rtl8192ee" | sudo tee -a /etc/modprobe.d/50-blacklist.conf` + +Now, tell the system to load the module on boot. + +`echo "8192ee" | sudo tee -a /etc/modules-load.d/8192ee.conf` + +### Using as AP + +Reference: TL-WN881ND v2 +This device can broadcast on channels 1-13. +Using hostapd to manage your AP, set the proper ht-capab field for this device, which is: + +`HT_CAPAB=[RX-STBC1][SHORT-GI-40][SHORT-GI-20][DSSS_CCK-40][MAX-AMSDU-7935]` + +Optionally enable wideband, if you don't have neighbours: +Note that while this will result in a increase in network throughput it may cause clients further away to fail connecting. + +`HT_CAPAB=[HT40+][RX-STBC1][SHORT-GI-40][SHORT-GI-20][DSSS_CCK-40][MAX-AMSDU-7935]` (for channels 1-7), or +`HT_CAPAB=[HT40-][RX-STBC1][SHORT-GI-40][SHORT-GI-20][DSSS_CCK-40][MAX-AMSDU-7935]` (for channels 5-13) + +### Changing transmit power + +Currently there is no way to change transmit power in the driver with iw or iwconfig tools, as you would with other wireless devices. +However, you can still manually change the transmit power at compile time +by editing the file `hal/rl8192e/rtl8192e_phycfg.c` and changing the lines below: + +``` +/* Manual Transmit Power Control + The following options take values from 0 to 63, where: + 0 - disable + 1 - lowest transmit power the device can do + 63 - highest transmit power the device can do + Note that these options may override your country's regulations about transmit power. + Setting the device to work at higher transmit powers most of the time may cause premature + failure or damage by overheating. Make sure the device has enough airflow before you increase this. + It is currently unknown what these values translate to in dBm. +*/ + + +// Transmit Power Boost +// This value is added to the device's calculation of transmit power index. +// Useful if you want to keep power usage low while still boosting/decreasing transmit power. +// Can take a negative value as well to reduce power. +// Zero disables it. Default: 2, for a tiny boost. +int transmit_power_boost = 2; +// (ADVANCED) To know what transmit powers this device decides to use dynamically, see: +// https://github.com/lwfinger/rtl8192ee/blob/42ad92dcc71cb15a62f8c39e50debe3a28566b5f/hal/phydm/rtl8192e/halhwimg8192e_rf.c#L1310 + + +// Transmit Power Override +// This value completely overrides the driver's calculations and uses only one value for all transmissions. +// Zero disables it. Default: 0 +int transmit_power_override = 0; + + +/* Manual Transmit Power Control */ +``` + +DKMS +--------- +The module can also be installed with DKMS. Make sure to install the `dkms` package first. +If you aren't updating from an older commit of the driver, there is no need to run the "remove" command. + + sudo dkms remove 8192ee/1.1 + + sudo dkms add ./rtl8192ee + sudo dkms build 8192ee/1.1 + sudo dkms install 8192ee/1.1 +