mirror of
https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
synced 2026-01-19 10:26:35 +00:00
Updated to 5.8.7.4
This commit is contained in:
85
os_dep/linux/ioctl_cfg80211.c
Normal file → Executable file
85
os_dep/linux/ioctl_cfg80211.c
Normal file → Executable file
@@ -7776,7 +7776,6 @@ cancel_ps_deny:
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
|
||||
@@ -7785,11 +7784,6 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
||||
struct net_device *ndev,
|
||||
#endif
|
||||
u16 frame_type, bool reg)
|
||||
#else
|
||||
static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
|
||||
struct wireless_dev *wdev,
|
||||
struct mgmt_frame_regs *upd)
|
||||
#endif
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
|
||||
struct net_device *ndev = wdev_to_ndev(wdev);
|
||||
@@ -7797,9 +7791,6 @@ static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
|
||||
_adapter *adapter;
|
||||
|
||||
struct rtw_wdev_priv *pwdev_priv;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
|
||||
u32 rtw_mask;
|
||||
#endif
|
||||
|
||||
if (ndev == NULL)
|
||||
goto exit;
|
||||
@@ -7808,51 +7799,78 @@ static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
|
||||
pwdev_priv = adapter_wdev_data(adapter);
|
||||
|
||||
#ifdef CONFIG_DEBUG_CFG80211
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
RTW_INFO(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
|
||||
frame_type, reg);
|
||||
#else
|
||||
RTW_INFO(FUNC_ADPT_FMT" new_reg:%x, old_reg:%x\n", FUNC_ADPT_ARG(adapter),
|
||||
pwdev_priv->mgmt_mask, upd->interface_stypes);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
|
||||
rtw_mask = BIT(IEEE80211_STYPE_AUTH >> 4);
|
||||
if ((upd->interface_stypes & rtw_mask)
|
||||
== (pwdev_priv->mgmt_mask & rtw_mask))
|
||||
return;
|
||||
pwdev_priv->mgmt_mask = upd->interface_stypes;
|
||||
#else
|
||||
switch (frame_type) {
|
||||
case IEEE80211_STYPE_AUTH: /* 0x00B0 */
|
||||
if (reg > 0)
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH, reg);
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH);
|
||||
else
|
||||
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH, reg);
|
||||
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_AUTH);
|
||||
break;
|
||||
#ifdef not_yet
|
||||
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
|
||||
if (reg > 0)
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ);
|
||||
else
|
||||
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
|
||||
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ);
|
||||
break;
|
||||
case IEEE80211_STYPE_ACTION: /* 0x00D0 */
|
||||
if (reg > 0)
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION, reg);
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION);
|
||||
else
|
||||
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION, reg);
|
||||
CLR_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
#else
|
||||
static void cfg80211_rtw_update_mgmt_frame_register(
|
||||
struct wiphy *wiphy,
|
||||
struct wireless_dev *wdev,
|
||||
struct mgmt_frame_regs *upd)
|
||||
{
|
||||
struct net_device *ndev;
|
||||
_adapter *padapter;
|
||||
struct rtw_wdev_priv *pwdev_priv;
|
||||
u32 rtw_stypes_mask = 0;
|
||||
u32 rtw_mstypes_mask = 0;
|
||||
|
||||
ndev = wdev_to_ndev(wdev);
|
||||
|
||||
if (ndev == NULL)
|
||||
goto exit;
|
||||
|
||||
padapter = (_adapter *)rtw_netdev_priv(ndev);
|
||||
pwdev_priv = adapter_wdev_data(padapter);
|
||||
|
||||
rtw_stypes_mask = BIT(IEEE80211_STYPE_AUTH >> 4);
|
||||
|
||||
#ifdef CONFIG_DEBUG_CFG80211
|
||||
RTW_INFO(FUNC_ADPT_FMT " global_stypes:0x%08x interface_stypes:0x%08x\n",
|
||||
FUNC_ADPT_ARG(padapter), upd->global_stypes, upd->interface_stypes);
|
||||
RTW_INFO(FUNC_ADPT_FMT " global_mcast_stypes:0x%08x interface_mcast_stypes:0x%08x\n",
|
||||
FUNC_ADPT_ARG(padapter), upd->global_mcast_stypes, upd->interface_mcast_stypes);
|
||||
RTW_INFO(FUNC_ADPT_FMT " old_regs:0x%08x new_regs:0x%08x\n",
|
||||
FUNC_ADPT_ARG(padapter), pwdev_priv->mgmt_regs,
|
||||
(upd->interface_stypes & rtw_stypes_mask));
|
||||
#endif
|
||||
if (pwdev_priv->mgmt_regs !=
|
||||
(upd->interface_stypes & rtw_stypes_mask)) {
|
||||
pwdev_priv->mgmt_regs = (upd->interface_stypes & rtw_stypes_mask);
|
||||
}
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0))
|
||||
static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy,
|
||||
@@ -10236,16 +10254,15 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
|
||||
.mgmt_tx = cfg80211_rtw_mgmt_tx,
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
|
||||
#else
|
||||
.update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register,
|
||||
#endif
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
.action = cfg80211_rtw_mgmt_tx,
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
|
||||
.update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register,
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
|
||||
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0))
|
||||
.tdls_mgmt = cfg80211_rtw_tdls_mgmt,
|
||||
.tdls_oper = cfg80211_rtw_tdls_oper,
|
||||
|
||||
@@ -168,16 +168,19 @@ struct rtw_wdev_priv {
|
||||
bool block_scan;
|
||||
bool power_mgmt;
|
||||
|
||||
/* report mgmt_frame registered */
|
||||
u16 report_mgmt;
|
||||
/**
|
||||
* mgmt_regs: bitmap of management frame subtypes registered for the
|
||||
* given interface
|
||||
* mcast_mgmt_regs: mcast RX is needed on this interface for these
|
||||
* subtypes
|
||||
*/
|
||||
u32 mgmt_regs;
|
||||
/* u32 mcast_mgmt_regs; */
|
||||
|
||||
u8 is_mgmt_tx;
|
||||
u16 mgmt_tx_cookie;
|
||||
|
||||
_mutex roch_mutex;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
|
||||
u32 mgmt_mask;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
ATOMIC_T switch_ch_to;
|
||||
@@ -266,9 +269,13 @@ struct rtw_wiphy_data {
|
||||
#define FUNC_WIPHY_FMT "%s("WIPHY_FMT")"
|
||||
#define FUNC_WIPHY_ARG(wiphy) __func__, WIPHY_ARG(wiphy)
|
||||
|
||||
#define SET_CFG80211_REPORT_MGMT(w, t, v) (w->report_mgmt |= BIT(t >> 4))
|
||||
#define CLR_CFG80211_REPORT_MGMT(w, t, v) (w->report_mgmt &= (~BIT(t >> 4)))
|
||||
#define GET_CFG80211_REPORT_MGMT(w, t) ((w->report_mgmt & BIT(t >> 4)) > 0)
|
||||
#define SET_CFG80211_MGMT_REGS(w, t) (w |= BIT(t >> 4))
|
||||
#define CLR_CFG80211_MGMT_REGS(w, t) (w &= (~BIT(t >> 4)))
|
||||
#define GET_CFG80211_MGMT_REGS(w, t) ((w & BIT(t >> 4)) > 0)
|
||||
|
||||
#define SET_CFG80211_REPORT_MGMT(w, t) (SET_CFG80211_MGMT_REGS(w->mgmt_regs, t))
|
||||
#define CLR_CFG80211_REPORT_MGMT(w, t) (CLR_CFG80211_MGMT_REGS(w->mgmt_regs, t))
|
||||
#define GET_CFG80211_REPORT_MGMT(w, t) (GET_CFG80211_MGMT_REGS(w->mgmt_regs, t))
|
||||
|
||||
struct wiphy *rtw_wiphy_alloc(_adapter *padapter, struct device *dev);
|
||||
void rtw_wiphy_free(struct wiphy *wiphy);
|
||||
|
||||
@@ -166,7 +166,10 @@ int rtw_mp_read_reg(struct net_device *dev,
|
||||
char *pextra = extra;
|
||||
int ret = 0;
|
||||
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
if (wrqu->length > 128)
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, wrqu->length);
|
||||
@@ -361,6 +364,9 @@ int rtw_mp_read_rf(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
if (wrqu->length > 128)
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, wrqu->length);
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
@@ -672,6 +678,9 @@ int rtw_mp_txpower_index(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1)))
|
||||
return -EFAULT;
|
||||
|
||||
if (wrqu->length > 128)
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
@@ -749,8 +758,6 @@ int rtw_mp_txpower(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
@@ -1153,8 +1160,6 @@ int rtw_mp_arx(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
@@ -1354,8 +1359,6 @@ int rtw_mp_pwrtrk(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
@@ -1575,8 +1578,6 @@ int rtw_mp_dump(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
pmp_priv = &padapter->mppriv;
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
@@ -1612,8 +1613,6 @@ int rtw_mp_phypara(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
@@ -1680,8 +1679,6 @@ int rtw_mp_SetRFPath(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
@@ -1735,11 +1732,9 @@ int rtw_mp_switch_rf_path(struct net_device *dev,
|
||||
int bwlg = 1, bwla = 1, btg = 1, bbt=1;
|
||||
int ret = 0;
|
||||
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length + 1))
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
@@ -1798,8 +1793,6 @@ int rtw_mp_QueryDrv(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->data.length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
@@ -1839,8 +1832,6 @@ int rtw_mp_PwrCtlDM(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
@@ -2968,8 +2959,6 @@ int rtw_mp_link(struct net_device *dev,
|
||||
if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length))
|
||||
return -EFAULT;
|
||||
|
||||
_rtw_memset(input, 0, sizeof(input));
|
||||
|
||||
if (copy_from_user(input, wrqu->pointer, wrqu->length)) {
|
||||
ret = -EFAULT;
|
||||
goto exit;
|
||||
|
||||
@@ -2594,6 +2594,9 @@ u8 rtw_init_drv_sw(_adapter *padapter)
|
||||
|
||||
dvobj->macid_ctl.num = rtw_min(hal_spec->macid_num, MACID_NUM_SW_LIMIT);
|
||||
|
||||
dvobj->macid_ctl.macid_cap = hal_spec->macid_cap;
|
||||
dvobj->macid_ctl.macid_txrpt = hal_spec->macid_txrpt;
|
||||
dvobj->macid_ctl.macid_txrpt_pgsz = hal_spec->macid_txrpt_pgsz;
|
||||
dvobj->cam_ctl.sec_cap = hal_spec->sec_cap;
|
||||
dvobj->cam_ctl.num = rtw_min(hal_spec->sec_cam_ent_num, SEC_CAM_ENT_NUM_SW_LIMIT);
|
||||
|
||||
|
||||
@@ -614,11 +614,11 @@ fail:
|
||||
}
|
||||
#endif
|
||||
|
||||
int rtw_xmit_entry(_pkt *pkt, _nic_hdl pnetdev)
|
||||
inline netdev_tx_t rtw_xmit_entry(struct sk_buff *pkt, struct net_device *pnetdev)
|
||||
{
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
int ret = 0;
|
||||
netdev_tx_t ret = 0;
|
||||
|
||||
if (pkt) {
|
||||
#ifdef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
|
||||
Reference in New Issue
Block a user