Skip to content

Commit

Permalink
update Realtek drivers (2024/07/15)
Browse files Browse the repository at this point in the history
  • Loading branch information
spockfish committed Aug 24, 2024
1 parent 1e8d377 commit edcddfa
Show file tree
Hide file tree
Showing 38 changed files with 222 additions and 2,338 deletions.
10 changes: 5 additions & 5 deletions drivers/net/wireless/realtek/rtl8192eu/include/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ struct ieee_param {
struct {
u32 len;
u8 reserved[32];
u8 data[0];
u8 data[];
} wpa_ie;
struct {
int command;
Expand All @@ -323,7 +323,7 @@ struct ieee_param {
u8 idx;
u8 seq[8]; /* sequence counter (set: RX, get: TX) */
u16 key_len;
u8 key[0];
u8 key[];
} crypt;
#ifdef CONFIG_AP_MODE
struct {
Expand All @@ -335,7 +335,7 @@ struct ieee_param {
} add_sta;
struct {
u8 reserved[2];/* for set max_num_sta */
u8 buf[0];
u8 buf[];
} bcn_ie;
#endif

Expand All @@ -346,7 +346,7 @@ struct ieee_param {
struct ieee_param_ex {
u32 cmd;
u8 sta_addr[ETH_ALEN];
u8 data[0];
u8 data[];
};

struct sta_data {
Expand Down Expand Up @@ -711,7 +711,7 @@ extern struct rate_section_ent rates_by_sections[];
struct ieee80211_info_element {
u8 id;
u8 len;
u8 data[0];
u8 data[];
} __attribute__((packed));

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ typedef struct _NDIS_802_11_FIXED_IEs {
typedef struct _NDIS_802_11_VARIABLE_IEs {
UCHAR ElementID;
UCHAR Length;
UCHAR data[1];
UCHAR data[];
} NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
if (started) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
Expand All @@ -454,7 +454,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,

if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
goto exit;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/realtek/rtl8812au/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) -fno-pie
EXTRA_CFLAGS += -O3
EXTRA_CFLAGS += -Wno-unused-variable
#EXTRA_CFLAGS += -Wno-unused-value
EXTRA_CFLAGS += -Wno-unused-value
EXTRA_CFLAGS += -Wno-unused-label
#EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-implicit-fallthrough
EXTRA_CFLAGS += -Wno-unused-parameter
#EXTRA_CFLAGS += -Wno-unused-function
#EXTRA_CFLAGS += -Wno-implicit-fallthrough
EXTRA_CFLAGS += -Wno-cast-function-type
EXTRA_CFLAGS += -Wno-missing-declarations
EXTRA_CFLAGS += -Wno-missing-prototypes
#EXTRA_CFLAGS += -Wno-error=cast-function-type
EXTRA_CFLAGS += -Wno-error=cast-function-type
#EXTRA_CFLAGS += -Wno-parentheses-equality
#EXTRA_CFLAGS += -Wno-error=incompatible-pointer-types
EXTRA_CFLAGS += -Wno-stringop-overread
Expand Down
Binary file not shown.
Binary file not shown.
18 changes: 0 additions & 18 deletions drivers/net/wireless/realtek/rtl8812au/core/rtw_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,6 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv)
goto exit;
}
pevtpriv->evt_buf = pevtpriv->evt_allocated_buf + 4 - ((unsigned int)(pevtpriv->evt_allocated_buf) & 3);


#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
pevtpriv->allocated_c2h_mem = rtw_zmalloc(C2H_MEM_SZ + 4);

if (pevtpriv->allocated_c2h_mem == NULL) {
res = _FAIL;
goto exit;
}

pevtpriv->c2h_mem = pevtpriv->allocated_c2h_mem + 4\
- ((u32)(pevtpriv->allocated_c2h_mem) & 3);
#endif /* end of CONFIG_SDIO_HCI */
_rtw_init_queue(&(pevtpriv->evt_queue));

exit:
Expand Down Expand Up @@ -5422,11 +5409,6 @@ u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf)
case CHECK_HIQ_WK_CID:
rtw_chk_hi_queue_hdl(padapter);
break;
#endif
#ifdef CONFIG_INTEL_WIDI
case INTEl_WIDI_WK_CID:
intel_widi_wk_hdl(padapter, pdrvextra_cmd->type, pdrvextra_cmd->pbuf);
break;
#endif
/* add for CONFIG_IEEE80211W, none 11w can use it */
case RESET_SECURITYPRIV:
Expand Down
48 changes: 2 additions & 46 deletions drivers/net/wireless/realtek/rtl8812au/core/rtw_mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,13 +1390,6 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf)
|| _SUCCESS != rtw_sitesurvey_cmd(adapter, &parm)
) {
rtw_set_to_roam(adapter, 0);
#ifdef CONFIG_INTEL_WIDI
if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n");
}
#endif /* CONFIG_INTEL_WIDI */
rtw_free_assoc_resources(adapter, _TRUE);
rtw_indicate_disconnect(adapter, 0, _FALSE);
} else
Expand Down Expand Up @@ -1756,13 +1749,6 @@ void rtw_indicate_connect(_adapter *padapter)
}

rtw_set_to_roam(padapter, 0);
#ifdef CONFIG_INTEL_WIDI
if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n");
}
#endif /* CONFIG_INTEL_WIDI */
if (!MLME_IS_AP(padapter) && !MLME_IS_MESH(padapter))
rtw_mi_set_scan_deny(padapter, 3000);

Expand Down Expand Up @@ -2918,10 +2904,6 @@ void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf)
roam = _TRUE;
roam_target = pmlmepriv->roam_network;
}
#ifdef CONFIG_INTEL_WIDI
else if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_CONNECTED)
roam = _TRUE;
#endif /* CONFIG_INTEL_WIDI */

if (roam == _TRUE) {
if (rtw_to_roam(adapter) > 0)
Expand All @@ -2938,10 +2920,6 @@ void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf)
rtw_free_mlme_priv_ie_data(pmlmepriv);

rtw_indicate_disconnect(adapter, *(u16 *)pstadel->rsvd, pstadel->locally_generated);
#ifdef CONFIG_INTEL_WIDI
if (!rtw_to_roam(adapter))
process_intel_widi_disconnect(adapter, 1);
#endif /* CONFIG_INTEL_WIDI */

_rtw_roaming(adapter, roam_target);
}
Expand Down Expand Up @@ -3063,13 +3041,6 @@ void rtw_join_timeout_handler(void *ctx)
}
break;
} else {
#ifdef CONFIG_INTEL_WIDI
if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
_rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
RTW_INFO("change to widi listen\n");
}
#endif /* CONFIG_INTEL_WIDI */
RTW_INFO("%s We've try roaming but fail\n", __FUNCTION__);
#ifdef CONFIG_RTW_80211R
rtw_ft_clr_flags(adapter, RTW_FT_PEER_EN|RTW_FT_PEER_OTD_EN);
Expand Down Expand Up @@ -3097,13 +3068,10 @@ void rtw_join_timeout_handler(void *ctx)

_exit_critical_bh(&pmlmepriv->lock, &irqL);


#ifdef CONFIG_DRVEXT_MODULE_WSC
drvext_assoc_fail_indicate(&adapter->drvextpriv);
#endif



}

/*
Expand Down Expand Up @@ -3343,7 +3311,6 @@ void rtw_iface_dynamic_check_timer_handlder(_adapter *adapter)


#ifdef CONFIG_BR_EXT

#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
rcu_read_lock();
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35)) */
Expand Down Expand Up @@ -3823,7 +3790,6 @@ The caller must hold the following spinlock
pmlmepriv->lock
*/

int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
Expand Down Expand Up @@ -3963,15 +3929,13 @@ sint rtw_set_auth(_adapter *adapter, struct security_priv *psecuritypriv)
pcmd->rsp = NULL;
pcmd->rspsz = 0;


_rtw_init_listhead(&pcmd->list);


res = rtw_enqueue_cmd(pcmdpriv, pcmd);

exit:


return res;

}
Expand Down Expand Up @@ -4233,7 +4197,6 @@ int rtw_restruct_wmm_ie(_adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, u

}


/*
* Ported from 8185: IsInPreAuthKeyList(). (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.)
* Added by Annie, 2006-05-07.
Expand Down Expand Up @@ -4394,7 +4357,6 @@ void rtw_init_registrypriv_dev_network(_adapter *adapter)
WLAN_BSSID_EX *pdev_network = &pregistrypriv->dev_network;
u8 *myhwaddr = adapter_mac_addr(adapter);


_rtw_memcpy(pdev_network->MacAddress, myhwaddr, ETH_ALEN);

_rtw_memcpy(&pdev_network->Ssid, &pregistrypriv->ssid, sizeof(NDIS_802_11_SSID));
Expand All @@ -4406,8 +4368,6 @@ void rtw_init_registrypriv_dev_network(_adapter *adapter)
pdev_network->Configuration.FHConfig.HopSet = 0;
pdev_network->Configuration.FHConfig.DwellTime = 0;



}

void rtw_update_registrypriv_dev_network(_adapter *adapter)
Expand Down Expand Up @@ -4487,14 +4447,11 @@ void rtw_update_registrypriv_dev_network(_adapter *adapter)
/* notes: translate IELength & Length after assign the Length to cmdsz in createbss_cmd(); */
/* pdev_network->IELength = cpu_to_le32(sz); */


}

void rtw_get_encrypt_decrypt_from_registrypriv(_adapter *adapter)
{



}

/* the fucntion is at passive_level */
Expand All @@ -4513,7 +4470,7 @@ void rtw_joinbss_reset(_adapter *padapter)

phtpriv->ampdu_enable = _FALSE;/* reset to disabled */

#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
#if defined(CONFIG_USB_HCI)
/* TH=1 => means that invalidate usb rx aggregation */
/* TH=0 => means that validate usb rx aggregation, use init value. */
if (phtpriv->ht_option) {
Expand All @@ -4526,8 +4483,7 @@ void rtw_joinbss_reset(_adapter *padapter)
threshold = 1;
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
}
#endif/* #if defined( CONFIG_USB_HCI) || defined (CONFIG_SDIO_HCI) */

#endif/* #if defined( CONFIG_USB_HCI) */
#endif/* #ifdef CONFIG_80211N_HT */

}
Expand Down
25 changes: 19 additions & 6 deletions drivers/net/wireless/realtek/rtl8812au/core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,26 +247,32 @@ void rtw_txpwr_init_regd(struct rf_ctl_t *rfctl)
case TXPWR_LMT_CHILE:
if (regd == TXPWR_LMT_IC || regd == TXPWR_LMT_CHILE)
regd = TXPWR_LMT_FCC;

else if (regd == TXPWR_LMT_KCC || regd == TXPWR_LMT_ACMA)
regd = TXPWR_LMT_ETSI;
ent = _rtw_txpwr_lmt_get_by_name(rfctl, regd_str(regd));

if (ent)
rfctl->regd_name = ent->regd_name;
RTW_PRINT("alternate regd_name:%s %s\n"
, regd_str(regd)
, rfctl->regd_name ? "is used" : "not found"
/* fallthrough */
);

if (rfctl->regd_name)
break;
default:
rfctl->regd_name = regd_str(TXPWR_LMT_WW);
RTW_PRINT("assign %s for default case\n", regd_str(TXPWR_LMT_WW));
break;
};
/* fallthrough */

default:
rfctl->regd_name = regd_str(TXPWR_LMT_WW);
RTW_PRINT("assign %s for default case\n", regd_str(TXPWR_LMT_WW));
/* fallthrough */
}

release_lock:
_exit_critical_mutex(&rfctl->txpwr_lmt_mutex, &irqL);
}

#endif /* CONFIG_TXPWR_LIMIT */

void rtw_rfctl_init(_adapter *adapter)
Expand Down Expand Up @@ -1343,33 +1349,40 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
else
ptable->func = &OnAuthClient;
case WIFI_ASSOCREQ:
break;

case WIFI_REASSOCREQ:
_mgt_dispatcher(padapter, ptable, precv_frame);
#ifdef CONFIG_HOSTAPD_MLME
if (MLME_IS_AP(padapter))
rtw_hostapd_mlme_rx(padapter, precv_frame);
#endif
break;

case WIFI_PROBEREQ:
_mgt_dispatcher(padapter, ptable, precv_frame);
#ifdef CONFIG_HOSTAPD_MLME
if (MLME_IS_AP(padapter))
rtw_hostapd_mlme_rx(padapter, precv_frame);
#endif
break;

case WIFI_BEACON:
_mgt_dispatcher(padapter, ptable, precv_frame);
break;

case WIFI_ACTION:
_mgt_dispatcher(padapter, ptable, precv_frame);
break;

default:
_mgt_dispatcher(padapter, ptable, precv_frame);
#ifdef CONFIG_HOSTAPD_MLME
if (MLME_IS_AP(padapter))
rtw_hostapd_mlme_rx(padapter, precv_frame);
#endif
break;

}
#else

Expand Down
Loading

0 comments on commit edcddfa

Please sign in to comment.