Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile errors on 3.x kernels #25

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ffd1b0a
Update README.md
Darkar25 Nov 6, 2021
2ba84ab
chandef.chan -> channel
Darkar25 Nov 14, 2021
899c462
Comment out VHT stuff
Darkar25 Nov 14, 2021
bb3841f
Fix some missing stuff
Darkar25 Nov 14, 2021
e86a56c
RX_FLAG_MACTIME_START -> RX_FLAG_MACTIME_MPDU
Darkar25 Nov 14, 2021
90abd21
Remove unknown field
Darkar25 Nov 14, 2021
6ce1bff
ampdu struct is also missing
Darkar25 Nov 14, 2021
bee9f74
Replace two TX_STOP cases with one
Darkar25 Nov 14, 2021
08d7bf0
change key flag
Darkar25 Nov 14, 2021
4321f1e
Replace channel width to channel type
Darkar25 Nov 14, 2021
cf78517
Forgot those changes from last commit :/
Darkar25 Nov 14, 2021
58608eb
Add tx_control struct and comment out center_freq1
Darkar25 Nov 14, 2021
a4b77a9
Missed that one
Darkar25 Nov 14, 2021
78a2d31
How did that happen?
Darkar25 Nov 14, 2021
3768d2f
Add missing.h file to other files
Darkar25 Nov 14, 2021
9141235
A bunch of 8188e fixes
Darkar25 Nov 14, 2021
0b9a14d
Update README.md
Darkar25 Nov 14, 2021
2749d51
Update README.md
Darkar25 Nov 14, 2021
c287ba7
Update README.md
Darkar25 Nov 14, 2021
2ac1535
Nvm, it IS working im just noob :\
Darkar25 Nov 16, 2021
7eca46e
Final check
Darkar25 Nov 16, 2021
e63b5f0
Crash fix
Darkar25 Nov 16, 2021
9452e39
Update README.md
Darkar25 Nov 16, 2021
788b802
Fix initialization from incompatible pointer type
Darkar25 Nov 18, 2021
f722c7d
Fix crash (again :\)
Darkar25 Nov 18, 2021
a36f08a
Update Makefile
Darkar25 Nov 19, 2021
f41a65d
Prepare for merge
Darkar25 Nov 19, 2021
d8bacc2
Prepare for merge #2
Darkar25 Nov 19, 2021
fb4c74f
Yeah, i messed that up)
Darkar25 Nov 19, 2021
90e0e0c
Fix 0 PWR and Malformed packet receiving
Darkar25 Dec 1, 2021
c88b91e
Merge branch 'master' into master
Darkar25 Dec 1, 2021
0e33855
Fix 0 PWR and Malformed packet receiving
Darkar25 Dec 4, 2021
e2bad44
Merge branch 'master' of https://github.com/Darkar25/realtek_rtwifi
Darkar25 Dec 4, 2021
6f09e87
Make port up to date with main driver
Darkar25 Dec 5, 2021
c6812a7
Update README.md
Darkar25 Dec 5, 2021
ad97242
fix compile errors
Darkar25 Jan 24, 2022
f4eb8a1
Fix version checks...
Darkar25 Feb 6, 2022
0d49d94
Merge branch 'kimocoder:master' into master
Darkar25 Jan 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


## Realtek RTWIFI - standalone mac80211 driver w/good support
This driver currently supports these chipsets: Realtek 8188e(us) 8192e 8192c 8723a and 8723b

Expand Down
30 changes: 30 additions & 0 deletions missing.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <linux/list.h>
#include <net/mac80211.h>
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,5,7)
#define ETH_ALEN 6
static inline void eth_broadcast_addr(u8 *addr)
{
memset(addr, 0xff, ETH_ALEN);
}
#endif
static inline void ether_addr_copy(u8 *dst, const u8 *src)
{
u16 *a = (u16 *)dst;
const u16 *b = (const u16 *)src;

a[0] = b[0];
a[1] = b[1];
a[2] = b[2];
}
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,7,10)
#define IEEE80211_NUM_TIDS 16
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,9,11)
#define list_first_entry_or_null(ptr, type, member) ({ \
struct list_head *head__ = (ptr); \
struct list_head *pos__ = ACCESS_ONCE(head__->next); \
pos__ != head__ ? list_entry(pos__, type, member) : NULL; \
})
#define IEEE80211_SCTL_SEQ 0xFFF0
#define IEEE80211_SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
#endif
17 changes: 9 additions & 8 deletions rtl8xxxu.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@

#include <asm/byteorder.h>

#include <linux/version.h>

#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,13,11)
#include "missing.h"
#endif

#define RTL8XXXU_DEBUG_REG_WRITE 0x01
#define RTL8XXXU_DEBUG_REG_READ 0x02
#define RTL8XXXU_DEBUG_RFREG_WRITE 0x04
Expand Down Expand Up @@ -875,15 +881,10 @@ struct rtl8192eu_efuse {
u8 usb_optional_function;
u8 res9[2];
u8 mac_addr[ETH_ALEN]; /* 0xd7 */
u8 res10[2];
u8 vendor_name[7];
u8 res11[2];
u8 device_name[0x0b]; /* 0xe8 */
u8 res12[2];
u8 serial[0x0b]; /* 0xf5 */
u8 res13[0x30];
u8 device_info[80];
u8 res11[3];
u8 unknown[0x0d]; /* 0x130 */
u8 res14[0xc3];
u8 res12[0xc3];
};

struct rtl8188eu_efuse {
Expand Down
28 changes: 28 additions & 0 deletions rtl8xxxu_8188e.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "rtl8xxxu.h"
#include "rtl8xxxu_regs.h"

#include <linux/version.h>

static struct rtl8xxxu_reg8val rtl8188e_mac_init_table[] = {
{0x026, 0x41}, {0x027, 0x35}, {0x428, 0x0a}, {0x429, 0x10},
{0x430, 0x00}, {0x431, 0x01}, {0x432, 0x02}, {0x433, 0x04},
Expand Down Expand Up @@ -356,13 +358,26 @@ void rtl8188eu_config_channel(struct ieee80211_hw *hw)

opmode = rtl8xxxu_read8(priv, REG_BW_OPMODE);
rsr = rtl8xxxu_read32(priv, REG_RESPONSE_RATE_SET);
#if LINUX_VERSION_CODE > KERNEL_VERSION(3,9,11)
channel = hw->conf.chandef.chan->hw_value;
#else
channel = hw->conf.channel->hw_value;
#endif

#if LINUX_VERSION_CODE > KERNEL_VERSION(3,9,11)
switch (hw->conf.chandef.width) {
case NL80211_CHAN_WIDTH_20_NOHT:
#else
switch (hw->conf.channel_type) {
case NL80211_CHAN_NO_HT:
#endif
ht = false;
/* fall through */
#if LINUX_VERSION_CODE > KERNEL_VERSION(3,9,11)
case NL80211_CHAN_WIDTH_20:
#else
case NL80211_CHAN_HT20:
#endif
opmode |= BW_OPMODE_20MHZ;
rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);

Expand All @@ -374,7 +389,12 @@ void rtl8188eu_config_channel(struct ieee80211_hw *hw)
val32 &= ~FPGA_RF_MODE;
rtl8xxxu_write32(priv, REG_FPGA1_RF_MODE, val32);
break;
#if LINUX_VERSION_CODE > KERNEL_VERSION(3,9,11)
case NL80211_CHAN_WIDTH_40:
#else
case NL80211_CHAN_HT40MINUS:
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(3,9,11)
if (hw->conf.chandef.center_freq1 >
hw->conf.chandef.chan->center_freq) {
sec_ch_above = 1;
Expand All @@ -383,6 +403,10 @@ void rtl8188eu_config_channel(struct ieee80211_hw *hw)
sec_ch_above = 0;
channel -= 2;
}
#else
sec_ch_above = 0;
channel -= 2;
#endif

opmode &= ~BW_OPMODE_20MHZ;
rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);
Expand Down Expand Up @@ -454,7 +478,11 @@ void rtl8188eu_config_channel(struct ieee80211_hw *hw)

for (i = RF_A; i < priv->rf_paths; i++) {
val32 = rtl8xxxu_read_rfreg(priv, i, RF6052_REG_MODE_AG);
#if LINUX_VERSION_CODE > KERNEL_VERSION(3,9,11)
if (hw->conf.chandef.width == NL80211_CHAN_WIDTH_40)
#else
if (hw->conf.channel_type == NL80211_CHAN_HT40MINUS)
#endif
val32 &= ~MODE_AG_CHANNEL_20MHZ;
else
val32 |= MODE_AG_CHANNEL_20MHZ;
Expand Down
2 changes: 1 addition & 1 deletion rtl8xxxu_8192e.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv *priv)
rtl8192eu_log_next_device_info(priv, "Vendor", efuse->device_info, &record_offset);
rtl8192eu_log_next_device_info(priv, "Product", efuse->device_info, &record_offset);
rtl8192eu_log_next_device_info(priv, "Serial", efuse->device_info, &record_offset);

if (rtl8xxxu_debug & RTL8XXXU_DEBUG_EFUSE) {
unsigned char *raw = priv->efuse_wifi.raw;

Expand Down
Loading