1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-22 21:34:37 +00:00

Minor code cleanup

This commit is contained in:
kimocoder 2022-06-06 03:01:42 +02:00
parent 56419c2d98
commit 91d47c6982

View File

@ -164,21 +164,10 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv)
pevtpriv->c2h_mem = pevtpriv->allocated_c2h_mem + 4\ pevtpriv->c2h_mem = pevtpriv->allocated_c2h_mem + 4\
- ((u32)(pevtpriv->allocated_c2h_mem) & 3); - ((u32)(pevtpriv->allocated_c2h_mem) & 3);
#ifdef PLATFORM_OS_XP
pevtpriv->pc2h_mdl = IoAllocateMdl((u8 *)pevtpriv->c2h_mem, C2H_MEM_SZ , FALSE, FALSE, NULL);
if (pevtpriv->pc2h_mdl == NULL) {
res = _FAIL;
goto exit;
}
MmBuildMdlForNonPagedPool(pevtpriv->pc2h_mdl);
#endif
#endif /* end of CONFIG_SDIO_HCI */ #endif /* end of CONFIG_SDIO_HCI */
_rtw_init_queue(&(pevtpriv->evt_queue)); _rtw_init_queue(&(pevtpriv->evt_queue));
exit: exit:
#endif /* end of CONFIG_EVENT_THREAD_MODE */ #endif /* end of CONFIG_EVENT_THREAD_MODE */
#ifdef CONFIG_C2H_WK #ifdef CONFIG_C2H_WK
@ -186,15 +175,12 @@ exit:
pevtpriv->c2h_wk_alive = _FALSE; pevtpriv->c2h_wk_alive = _FALSE;
pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1); pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
#endif #endif
return res; return res;
} }
void _rtw_free_evt_priv(struct evt_priv *pevtpriv) void _rtw_free_evt_priv(struct evt_priv *pevtpriv)
{ {
#ifdef CONFIG_EVENT_THREAD_MODE #ifdef CONFIG_EVENT_THREAD_MODE
_rtw_free_sema(&(pevtpriv->evt_notify)); _rtw_free_sema(&(pevtpriv->evt_notify));
@ -215,9 +201,6 @@ void _rtw_free_evt_priv(struct evt_priv *pevtpriv)
} }
rtw_cbuf_free(pevtpriv->c2h_queue); rtw_cbuf_free(pevtpriv->c2h_queue);
#endif #endif
} }
void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
@ -309,7 +292,6 @@ sint _rtw_enqueue_cmd(_queue *queue, struct cmd_obj *obj, bool to_head)
exit: exit:
return _SUCCESS; return _SUCCESS;
} }
@ -318,7 +300,6 @@ struct cmd_obj *_rtw_dequeue_cmd(_queue *queue)
_irqL irqL; _irqL irqL;
struct cmd_obj *obj; struct cmd_obj *obj;
/* _enter_critical_bh(&(queue->lock), &irqL); */ /* _enter_critical_bh(&(queue->lock), &irqL); */
_enter_critical(&queue->lock, &irqL); _enter_critical(&queue->lock, &irqL);
@ -329,7 +310,6 @@ struct cmd_obj *_rtw_dequeue_cmd(_queue *queue)
} }
#endif /* DBG_CMD_QUEUE */ #endif /* DBG_CMD_QUEUE */
if (rtw_is_list_empty(&(queue->queue))) if (rtw_is_list_empty(&(queue->queue)))
obj = NULL; obj = NULL;
else { else {
@ -1523,25 +1503,6 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork)
pcmd->cmdsz = sizeof(WLAN_BSSID_EX); pcmd->cmdsz = sizeof(WLAN_BSSID_EX);
#ifdef CONFIG_RTL8712
/* wlan_network endian conversion */
psecnetwork->Length = cpu_to_le32(psecnetwork->Length);
psecnetwork->Ssid.SsidLength = cpu_to_le32(psecnetwork->Ssid.SsidLength);
psecnetwork->Privacy = cpu_to_le32(psecnetwork->Privacy);
psecnetwork->Rssi = cpu_to_le32(psecnetwork->Rssi);
psecnetwork->NetworkTypeInUse = cpu_to_le32(psecnetwork->NetworkTypeInUse);
psecnetwork->Configuration.ATIMWindow = cpu_to_le32(psecnetwork->Configuration.ATIMWindow);
psecnetwork->Configuration.BeaconPeriod = cpu_to_le32(psecnetwork->Configuration.BeaconPeriod);
psecnetwork->Configuration.DSConfig = cpu_to_le32(psecnetwork->Configuration.DSConfig);
psecnetwork->Configuration.FHConfig.DwellTime = cpu_to_le32(psecnetwork->Configuration.FHConfig.DwellTime);
psecnetwork->Configuration.FHConfig.HopPattern = cpu_to_le32(psecnetwork->Configuration.FHConfig.HopPattern);
psecnetwork->Configuration.FHConfig.HopSet = cpu_to_le32(psecnetwork->Configuration.FHConfig.HopSet);
psecnetwork->Configuration.FHConfig.Length = cpu_to_le32(psecnetwork->Configuration.FHConfig.Length);
psecnetwork->Configuration.Length = cpu_to_le32(psecnetwork->Configuration.Length);
psecnetwork->InfrastructureMode = cpu_to_le32(psecnetwork->InfrastructureMode);
psecnetwork->IELength = cpu_to_le32(psecnetwork->IELength);
#endif
_rtw_init_listhead(&pcmd->list); _rtw_init_listhead(&pcmd->list);
pcmd->cmdcode = _JoinBss_CMD_;/* GEN_CMD_CODE(_JoinBss) */ pcmd->cmdcode = _JoinBss_CMD_;/* GEN_CMD_CODE(_JoinBss) */
pcmd->parmbuf = (unsigned char *)psecnetwork; pcmd->parmbuf = (unsigned char *)psecnetwork;