2018-10-03 14:17:16 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2010-08-20 15:15:30 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* rtl871x_cmd.c
|
|
|
|
*
|
|
|
|
* Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
|
|
|
|
* Linux device driver for RTL8192SU
|
|
|
|
*
|
|
|
|
* Modifications for inclusion into the Linux staging tree are
|
|
|
|
* Copyright(c) 2010 Larry Finger. All rights reserved.
|
|
|
|
*
|
|
|
|
* Contact information:
|
|
|
|
* WLAN FAE <wlanfae@realtek.com>
|
|
|
|
* Larry Finger <Larry.Finger@lwfinger.net>
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#define _RTL871X_CMD_C_
|
|
|
|
|
2011-09-03 19:14:11 +00:00
|
|
|
#include <linux/compiler.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/slab.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kref.h>
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
#include <linux/skbuff.h>
|
|
|
|
#include <linux/usb.h>
|
|
|
|
#include <linux/usb/ch9.h>
|
|
|
|
#include <linux/circ_buf.h>
|
|
|
|
#include <linux/uaccess.h>
|
|
|
|
#include <asm/byteorder.h>
|
|
|
|
#include <linux/atomic.h>
|
|
|
|
#include <linux/semaphore.h>
|
|
|
|
#include <linux/rtnetlink.h>
|
|
|
|
|
2010-08-20 15:15:30 +00:00
|
|
|
#include "osdep_service.h"
|
|
|
|
#include "drv_types.h"
|
|
|
|
#include "recv_osdep.h"
|
|
|
|
#include "mlme_osdep.h"
|
|
|
|
|
|
|
|
/*
|
2016-09-02 10:15:40 +00:00
|
|
|
* Caller and the r8712_cmd_thread can protect cmd_q by spin_lock.
|
|
|
|
* No irqsave is necessary.
|
|
|
|
*/
|
2010-08-20 15:15:30 +00:00
|
|
|
|
2019-06-21 06:08:16 +00:00
|
|
|
int r8712_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
2016-06-02 04:24:07 +00:00
|
|
|
init_completion(&pcmdpriv->cmd_queue_comp);
|
2016-06-02 04:24:08 +00:00
|
|
|
init_completion(&pcmdpriv->terminate_cmdthread_comp);
|
2010-08-20 15:15:30 +00:00
|
|
|
|
|
|
|
_init_queue(&(pcmdpriv->cmd_queue));
|
|
|
|
|
|
|
|
/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
|
|
|
|
pcmdpriv->cmd_seq = 1;
|
2014-05-24 08:19:27 +00:00
|
|
|
pcmdpriv->cmd_allocated_buf = kmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ,
|
|
|
|
GFP_ATOMIC);
|
2016-09-20 09:07:43 +00:00
|
|
|
if (!pcmdpriv->cmd_allocated_buf)
|
2019-06-24 05:48:54 +00:00
|
|
|
return -ENOMEM;
|
2010-08-20 15:15:30 +00:00
|
|
|
pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ -
|
|
|
|
((addr_t)(pcmdpriv->cmd_allocated_buf) &
|
2015-10-19 17:16:01 +00:00
|
|
|
(CMDBUFF_ALIGN_SZ - 1));
|
2014-05-24 08:19:27 +00:00
|
|
|
pcmdpriv->rsp_allocated_buf = kmalloc(MAX_RSPSZ + 4, GFP_ATOMIC);
|
2016-10-31 11:26:05 +00:00
|
|
|
if (!pcmdpriv->rsp_allocated_buf) {
|
|
|
|
kfree(pcmdpriv->cmd_allocated_buf);
|
|
|
|
pcmdpriv->cmd_allocated_buf = NULL;
|
2019-06-24 05:48:54 +00:00
|
|
|
return -ENOMEM;
|
2016-10-31 11:26:05 +00:00
|
|
|
}
|
2010-08-20 15:15:30 +00:00
|
|
|
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 -
|
|
|
|
((addr_t)(pcmdpriv->rsp_allocated_buf) & 3);
|
|
|
|
pcmdpriv->cmd_issued_cnt = 0;
|
|
|
|
pcmdpriv->cmd_done_cnt = 0;
|
|
|
|
pcmdpriv->rsp_cnt = 0;
|
2019-06-24 05:48:54 +00:00
|
|
|
return 0;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
2019-06-24 05:48:55 +00:00
|
|
|
int r8712_init_evt_priv(struct evt_priv *pevtpriv)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
|
|
|
|
pevtpriv->event_seq = 0;
|
2014-05-24 08:19:27 +00:00
|
|
|
pevtpriv->evt_allocated_buf = kmalloc(MAX_EVTSZ + 4, GFP_ATOMIC);
|
2010-08-20 15:15:30 +00:00
|
|
|
|
2016-09-20 09:07:43 +00:00
|
|
|
if (!pevtpriv->evt_allocated_buf)
|
2019-06-24 05:48:56 +00:00
|
|
|
return -ENOMEM;
|
2010-08-20 15:15:30 +00:00
|
|
|
pevtpriv->evt_buf = pevtpriv->evt_allocated_buf + 4 -
|
|
|
|
((addr_t)(pevtpriv->evt_allocated_buf) & 3);
|
|
|
|
pevtpriv->evt_done_cnt = 0;
|
2019-06-24 05:48:56 +00:00
|
|
|
return 0;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
2019-06-24 05:48:58 +00:00
|
|
|
void r8712_free_evt_priv(struct evt_priv *pevtpriv)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
kfree(pevtpriv->evt_allocated_buf);
|
|
|
|
}
|
|
|
|
|
2019-06-24 05:48:57 +00:00
|
|
|
void r8712_free_cmd_priv(struct cmd_priv *pcmdpriv)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
if (pcmdpriv) {
|
|
|
|
kfree(pcmdpriv->cmd_allocated_buf);
|
|
|
|
kfree(pcmdpriv->rsp_allocated_buf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2016-09-02 10:15:40 +00:00
|
|
|
* Calling Context:
|
|
|
|
*
|
2019-06-26 06:09:40 +00:00
|
|
|
* r8712_enqueue_cmd can only be called between kernel thread,
|
2016-09-02 10:15:40 +00:00
|
|
|
* since only spin_lock is used.
|
|
|
|
*
|
|
|
|
* ISR/Call-Back functions can't call this sub-function.
|
|
|
|
*
|
|
|
|
*/
|
2010-08-20 15:15:30 +00:00
|
|
|
|
2019-06-26 06:09:40 +00:00
|
|
|
void r8712_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
2019-06-26 06:09:40 +00:00
|
|
|
struct __queue *queue;
|
2010-08-20 15:15:30 +00:00
|
|
|
unsigned long irqL;
|
|
|
|
|
2019-06-26 06:09:40 +00:00
|
|
|
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
|
|
|
|
return;
|
2016-09-20 09:07:43 +00:00
|
|
|
if (!obj)
|
2019-06-20 11:52:59 +00:00
|
|
|
return;
|
2019-06-26 06:09:40 +00:00
|
|
|
queue = &pcmdpriv->cmd_queue;
|
2010-08-20 15:15:30 +00:00
|
|
|
spin_lock_irqsave(&queue->lock, irqL);
|
2014-06-25 02:52:36 +00:00
|
|
|
list_add_tail(&obj->list, &queue->queue);
|
2010-08-20 15:15:30 +00:00
|
|
|
spin_unlock_irqrestore(&queue->lock, irqL);
|
2019-06-26 06:09:40 +00:00
|
|
|
complete(&pcmdpriv->cmd_queue_comp);
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
2019-06-26 06:09:41 +00:00
|
|
|
struct cmd_obj *r8712_dequeue_cmd(struct __queue *queue)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
unsigned long irqL;
|
|
|
|
struct cmd_obj *obj;
|
|
|
|
|
2016-02-01 14:47:03 +00:00
|
|
|
spin_lock_irqsave(&queue->lock, irqL);
|
|
|
|
obj = list_first_entry_or_null(&queue->queue,
|
|
|
|
struct cmd_obj, list);
|
|
|
|
if (obj)
|
2014-06-25 02:52:37 +00:00
|
|
|
list_del_init(&obj->list);
|
2016-02-01 14:47:03 +00:00
|
|
|
spin_unlock_irqrestore(&queue->lock, irqL);
|
2010-08-20 15:15:30 +00:00
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2019-06-21 06:08:11 +00:00
|
|
|
void r8712_enqueue_cmd_ex(struct cmd_priv *pcmdpriv, struct cmd_obj *obj)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
unsigned long irqL;
|
|
|
|
struct __queue *queue;
|
|
|
|
|
2016-09-20 09:07:43 +00:00
|
|
|
if (!obj)
|
2019-06-21 06:08:11 +00:00
|
|
|
return;
|
2015-10-19 17:14:29 +00:00
|
|
|
if (pcmdpriv->padapter->eeprompriv.bautoload_fail_flag)
|
2019-06-21 06:08:11 +00:00
|
|
|
return;
|
2010-08-20 15:15:30 +00:00
|
|
|
queue = &pcmdpriv->cmd_queue;
|
|
|
|
spin_lock_irqsave(&queue->lock, irqL);
|
2014-06-25 02:52:36 +00:00
|
|
|
list_add_tail(&obj->list, &queue->queue);
|
2010-08-20 15:15:30 +00:00
|
|
|
spin_unlock_irqrestore(&queue->lock, irqL);
|
2016-06-02 04:24:07 +00:00
|
|
|
complete(&pcmdpriv->cmd_queue_comp);
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void r8712_free_cmd_obj(struct cmd_obj *pcmd)
|
|
|
|
{
|
|
|
|
if ((pcmd->cmdcode != _JoinBss_CMD_) &&
|
|
|
|
(pcmd->cmdcode != _CreateBss_CMD_))
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(pcmd->parmbuf);
|
2020-09-19 08:50:31 +00:00
|
|
|
if (pcmd->rsp) {
|
2010-08-20 15:15:30 +00:00
|
|
|
if (pcmd->rspsz != 0)
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(pcmd->rsp);
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(pcmd);
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
u8 r8712_sitesurvey_cmd(struct _adapter *padapter,
|
|
|
|
struct ndis_802_11_ssid *pssid)
|
2020-07-05 18:09:44 +00:00
|
|
|
__must_hold(&padapter->mlmepriv.lock)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct sitesurvey_parm *psurveyPara;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2010-08-20 15:15:30 +00:00
|
|
|
return _FAIL;
|
2014-06-14 11:47:21 +00:00
|
|
|
psurveyPara = kmalloc(sizeof(*psurveyPara), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!psurveyPara) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2010-08-20 15:15:30 +00:00
|
|
|
return _FAIL;
|
|
|
|
}
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, psurveyPara,
|
|
|
|
GEN_CMD_CODE(_SiteSurvey));
|
|
|
|
psurveyPara->bsslimit = cpu_to_le32(48);
|
2011-09-03 19:14:21 +00:00
|
|
|
psurveyPara->passive_mode = cpu_to_le32(pmlmepriv->passive_mode);
|
2010-08-20 15:15:30 +00:00
|
|
|
psurveyPara->ss_ssidlen = 0;
|
|
|
|
memset(psurveyPara->ss_ssid, 0, IW_ESSID_MAX_SIZE + 1);
|
2020-09-19 08:50:31 +00:00
|
|
|
if (pssid && pssid->SsidLength) {
|
2021-03-01 13:26:48 +00:00
|
|
|
int len = min_t(int, pssid->SsidLength, IW_ESSID_MAX_SIZE);
|
|
|
|
|
|
|
|
memcpy(psurveyPara->ss_ssid, pssid->Ssid, len);
|
|
|
|
psurveyPara->ss_ssidlen = cpu_to_le32(len);
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
set_fwstate(pmlmepriv, _FW_UNDER_SURVEY);
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, ph2c);
|
2015-02-27 17:55:48 +00:00
|
|
|
mod_timer(&pmlmepriv->scan_to_timer,
|
|
|
|
jiffies + msecs_to_jiffies(SCANNING_TIMEOUT));
|
2010-08-20 15:15:30 +00:00
|
|
|
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_SITE_SURVEY);
|
2011-09-03 19:14:21 +00:00
|
|
|
padapter->blnEnableRxFF0Filter = 0;
|
2010-08-20 15:15:30 +00:00
|
|
|
return _SUCCESS;
|
|
|
|
}
|
|
|
|
|
2019-06-10 08:22:53 +00:00
|
|
|
int r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct setdatarate_parm *pbsetdataratepara;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-10 08:22:53 +00:00
|
|
|
return -ENOMEM;
|
2014-06-14 11:47:21 +00:00
|
|
|
pbsetdataratepara = kmalloc(sizeof(*pbsetdataratepara), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!pbsetdataratepara) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-10 08:22:53 +00:00
|
|
|
return -ENOMEM;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara,
|
|
|
|
GEN_CMD_CODE(_SetDataRate));
|
|
|
|
pbsetdataratepara->mac_id = 5;
|
|
|
|
memcpy(pbsetdataratepara->datarates, rateset, NumRates);
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, ph2c);
|
2019-06-10 08:22:53 +00:00
|
|
|
return 0;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
2019-06-20 11:53:00 +00:00
|
|
|
void r8712_set_chplan_cmd(struct _adapter *padapter, int chplan)
|
2011-09-03 19:14:20 +00:00
|
|
|
{
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct SetChannelPlan_param *psetchplanpara;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-20 11:53:00 +00:00
|
|
|
return;
|
2014-06-14 11:47:21 +00:00
|
|
|
psetchplanpara = kmalloc(sizeof(*psetchplanpara), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!psetchplanpara) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-20 11:53:00 +00:00
|
|
|
return;
|
2011-09-03 19:14:20 +00:00
|
|
|
}
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, psetchplanpara,
|
|
|
|
GEN_CMD_CODE(_SetChannelPlan));
|
|
|
|
psetchplanpara->ChannelPlan = chplan;
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, ph2c);
|
|
|
|
}
|
|
|
|
|
2019-06-24 05:49:03 +00:00
|
|
|
int r8712_setrfreg_cmd(struct _adapter *padapter, u8 offset, u32 val)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct writeRF_parm *pwriterfparm;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-24 05:49:03 +00:00
|
|
|
return -ENOMEM;
|
2014-06-14 11:47:21 +00:00
|
|
|
pwriterfparm = kmalloc(sizeof(*pwriterfparm), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!pwriterfparm) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-24 05:49:03 +00:00
|
|
|
return -ENOMEM;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, pwriterfparm, GEN_CMD_CODE(_SetRFReg));
|
|
|
|
pwriterfparm->offset = offset;
|
|
|
|
pwriterfparm->value = val;
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, ph2c);
|
2019-06-24 05:49:03 +00:00
|
|
|
return 0;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
2019-06-26 06:09:33 +00:00
|
|
|
int r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct readRF_parm *prdrfparm;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-26 06:09:33 +00:00
|
|
|
return -ENOMEM;
|
2014-06-14 11:47:21 +00:00
|
|
|
prdrfparm = kmalloc(sizeof(*prdrfparm), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!prdrfparm) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-26 06:09:33 +00:00
|
|
|
return -ENOMEM;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
2014-06-25 02:52:34 +00:00
|
|
|
INIT_LIST_HEAD(&ph2c->list);
|
2010-08-20 15:15:30 +00:00
|
|
|
ph2c->cmdcode = GEN_CMD_CODE(_GetRFReg);
|
|
|
|
ph2c->parmbuf = (unsigned char *)prdrfparm;
|
|
|
|
ph2c->cmdsz = sizeof(struct readRF_parm);
|
|
|
|
ph2c->rsp = pval;
|
|
|
|
ph2c->rspsz = sizeof(struct readRF_rsp);
|
|
|
|
prdrfparm->offset = offset;
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, ph2c);
|
2019-06-26 06:09:33 +00:00
|
|
|
return 0;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void r8712_getbbrfreg_cmdrsp_callback(struct _adapter *padapter,
|
|
|
|
struct cmd_obj *pcmd)
|
|
|
|
{
|
2011-09-03 19:14:19 +00:00
|
|
|
kfree(pcmd->parmbuf);
|
|
|
|
kfree(pcmd);
|
|
|
|
padapter->mppriv.workparam.bcompleted = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void r8712_readtssi_cmdrsp_callback(struct _adapter *padapter,
|
|
|
|
struct cmd_obj *pcmd)
|
|
|
|
{
|
|
|
|
kfree(pcmd->parmbuf);
|
|
|
|
kfree(pcmd);
|
|
|
|
|
2010-08-20 15:15:30 +00:00
|
|
|
padapter->mppriv.workparam.bcompleted = true;
|
|
|
|
}
|
|
|
|
|
2019-06-10 08:22:54 +00:00
|
|
|
int r8712_createbss_cmd(struct _adapter *padapter)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_obj *pcmd;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
struct wlan_bssid_ex *pdev_network =
|
|
|
|
&padapter->registrypriv.dev_network;
|
|
|
|
|
|
|
|
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_START_TO_LINK);
|
2014-06-14 11:47:21 +00:00
|
|
|
pcmd = kmalloc(sizeof(*pcmd), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!pcmd)
|
2019-06-10 08:22:54 +00:00
|
|
|
return -ENOMEM;
|
2014-06-25 02:52:34 +00:00
|
|
|
INIT_LIST_HEAD(&pcmd->list);
|
2010-08-20 15:15:30 +00:00
|
|
|
pcmd->cmdcode = _CreateBss_CMD_;
|
|
|
|
pcmd->parmbuf = (unsigned char *)pdev_network;
|
2015-08-06 00:17:19 +00:00
|
|
|
pcmd->cmdsz = r8712_get_wlan_bssid_ex_sz(pdev_network);
|
2010-08-20 15:15:30 +00:00
|
|
|
pcmd->rsp = NULL;
|
|
|
|
pcmd->rspsz = 0;
|
|
|
|
/* notes: translate IELength & Length after assign to cmdsz; */
|
2014-03-04 23:23:58 +00:00
|
|
|
pdev_network->Length = pcmd->cmdsz;
|
|
|
|
pdev_network->IELength = pdev_network->IELength;
|
|
|
|
pdev_network->Ssid.SsidLength = pdev_network->Ssid.SsidLength;
|
2010-08-20 15:15:30 +00:00
|
|
|
r8712_enqueue_cmd(pcmdpriv, pcmd);
|
2019-06-10 08:22:54 +00:00
|
|
|
return 0;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
2019-06-20 11:52:58 +00:00
|
|
|
int r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
2015-08-06 00:17:18 +00:00
|
|
|
struct wlan_bssid_ex *psecnetwork;
|
2010-08-20 15:15:30 +00:00
|
|
|
struct cmd_obj *pcmd;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
|
|
|
|
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
|
|
|
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
2017-12-19 20:16:23 +00:00
|
|
|
enum NDIS_802_11_NETWORK_INFRASTRUCTURE ndis_network_mode =
|
|
|
|
pnetwork->network.InfrastructureMode;
|
2010-08-20 15:15:30 +00:00
|
|
|
|
|
|
|
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_START_TO_LINK);
|
2014-06-14 11:47:21 +00:00
|
|
|
pcmd = kmalloc(sizeof(*pcmd), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!pcmd)
|
2019-06-20 11:52:58 +00:00
|
|
|
return -ENOMEM;
|
2010-08-20 15:15:30 +00:00
|
|
|
|
|
|
|
/* for hidden ap to set fw_state here */
|
2015-10-19 17:16:01 +00:00
|
|
|
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE) !=
|
2010-08-20 15:15:30 +00:00
|
|
|
true) {
|
|
|
|
switch (ndis_network_mode) {
|
|
|
|
case Ndis802_11IBSS:
|
|
|
|
pmlmepriv->fw_state |= WIFI_ADHOC_STATE;
|
|
|
|
break;
|
|
|
|
case Ndis802_11Infrastructure:
|
|
|
|
pmlmepriv->fw_state |= WIFI_STATION_STATE;
|
|
|
|
break;
|
|
|
|
case Ndis802_11APMode:
|
|
|
|
case Ndis802_11AutoUnknown:
|
|
|
|
case Ndis802_11InfrastructureMax:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2015-08-06 00:17:18 +00:00
|
|
|
psecnetwork = &psecuritypriv->sec_bss;
|
2015-08-06 00:17:15 +00:00
|
|
|
memcpy(psecnetwork, &pnetwork->network, sizeof(*psecnetwork));
|
2010-08-20 15:15:30 +00:00
|
|
|
psecuritypriv->authenticator_ie[0] = (unsigned char)
|
|
|
|
psecnetwork->IELength;
|
2015-10-19 17:16:01 +00:00
|
|
|
if ((psecnetwork->IELength - 12) < (256 - 1))
|
2010-08-20 15:15:30 +00:00
|
|
|
memcpy(&psecuritypriv->authenticator_ie[1],
|
2015-10-19 17:16:01 +00:00
|
|
|
&psecnetwork->IEs[12], psecnetwork->IELength - 12);
|
2010-08-20 15:15:30 +00:00
|
|
|
else
|
|
|
|
memcpy(&psecuritypriv->authenticator_ie[1],
|
2015-10-19 17:16:01 +00:00
|
|
|
&psecnetwork->IEs[12], (256 - 1));
|
2010-08-20 15:15:30 +00:00
|
|
|
psecnetwork->IELength = 0;
|
2016-09-02 10:15:40 +00:00
|
|
|
/*
|
|
|
|
* If the driver wants to use the bssid to create the connection.
|
|
|
|
* If not, we copy the connecting AP's MAC address to it so that
|
2010-08-20 15:15:30 +00:00
|
|
|
* the driver just has the bssid information for PMKIDList searching.
|
|
|
|
*/
|
2015-10-19 17:14:29 +00:00
|
|
|
if (!pmlmepriv->assoc_by_bssid)
|
Staging: rtl8712: replace memcpy() by ether_addr_copy() using coccinelle and pack variable
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rtl871x_cmd.c
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)
@@ expression e1, e2; @@
- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);
struct _adapter {
struct dvobj_priv dvobjpriv; /* 0 40*/
struct mlme_priv mlmepriv; /* 40 1560*/
/* --- cacheline 25 boundary (1600 bytes) --- */
struct cmd_priv cmdpriv; /* 1600 136*/
/* --- cacheline 27 boundary (1728 bytes) was 8 bytes ago --- */
struct evt_priv evtpriv; /* 1736 96*/
/* --- cacheline 28 boundary (1792 bytes) was 40 bytes ago --- * */
struct io_queue * pio_queue; /* 1832 8*/
struct xmit_priv xmitpriv; /* 1840 912*/
/* --- cacheline 43 boundary (2752 bytes) --- */
struct recv_priv recvpriv; /* 2752 1088*/
/* --- cacheline 60 boundary (3840 bytes) --- */
struct sta_priv stapriv; /* 3840 672*/
/* --- cacheline 70 boundary (4480 bytes) was 32 bytes ago --- * */
struct security_priv securitypriv; /* 4512 4816*/
/* --- cacheline 145 boundary (9280 bytes) was 48 bytes ago --- * */
struct registry_priv registrypriv; /* 9328 968*/
/* --- cacheline 160 boundary (10240 bytes) was 56 bytes ago --- * */
struct wlan_acl_pool acl_list; /* 10296 1536*/
/* --- cacheline 184 boundary (11776 bytes) was 56 bytes ago --- * */
struct pwrctrl_priv pwrctrlpriv; /* 11832 224*/
/* --- cacheline 188 boundary (12032 bytes) was 24 bytes ago --- * */
struct eeprom_priv eeprompriv; /* 12056 508*/
/* XXX 4 bytes hole, try to pack */
/* --- cacheline 196 boundary (12544 bytes) was 24 bytes ago --- * */
struct hal_priv halpriv; /* 12568 88*/
/* --- cacheline 197 boundary (12608 bytes) was 48 bytes ago --- * */
struct led_priv ledpriv; /* 12656 304*/
/* --- cacheline 202 boundary (12928 bytes) was 32 bytes ago --- * */
struct mp_priv mppriv; /* 12960 1080*/
/* --- cacheline 219 boundary (14016 bytes) was 24 bytes ago * --- */
s32 bDriverStopped; /* 14040 4*/
s32 bSurpriseRemoved; /* 14044 4*/
u32 IsrContent; /* 14048 4*/
u32 ImrContent; /* 14052 4*/
u8 EepromAddressSize; /* 14056 1*/
u8 hw_init_completed; /* 14057 1*/
/* XXX 6 bytes hole, try to pack */
struct task_struct * cmdThread; /* 14064 8*/
pid_t evtThread; /* 14072 4*/
/* XXX 4 bytes hole, try to pack */
/* --- cacheline 220 boundary (14080 bytes) --- */
struct task_struct * xmitThread; /* 14080 8*/
pid_t recvThread; /* 14088 4*/
/* XXX 4 bytes hole, try to pack */
uint (*dvobj_init)(struct _adapter *); /*14096 8 */
void (*dvobj_deinit)(struct _adapter *);/* 14104 8 */
struct net_device * pnetdev; /* 14112 8*/
int bup; /* 14120 4*/
/* XXX 4 bytes hole, try to pack */
struct net_device_stats stats; /* 14128 184*/
/* --- cacheline 223 boundary (14272 bytes) was 40 bytes ago --- * */
struct iw_statistics iwstats; /* 14312 32*/
/* --- cacheline 224 boundary (14336 bytes) was 8 bytes ago --- * */
int pid; /* 14344 4*/
/* XXX 4 bytes hole, try to pack */
struct work_struct wkFilterRxFF0; /* 14352 32*/
u8 blnEnableRxFF0Filter; /* 14384 1*/
/* XXX 3 bytes hole, try to pack */
spinlock_t lockRxFF0Filter; /* 14388 4*/
const struct firmware * fw; /* 14392 8*/
/* --- cacheline 225 boundary (14400 bytes) --- */
struct usb_interface * pusb_intf; /* 14400 8*/
struct mutex mutex_start; /* 14408 40*/
/* XXX last struct has 4 bytes of padding */
struct completion rtl8712_fw_ready; /* 14448 32*/
/* --- cacheline 226 boundary (14464 bytes) was 16 bytes ago --- * */
/* size: 14480, cachelines: 227, members: 40 */
/* sum members: 14451, holes: 7, sum holes: 29 */
/* paddings: 1, sum paddings: 4 */
/* last cacheline: 16 bytes */
};
Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-23 07:11:57 +00:00
|
|
|
ether_addr_copy(&pmlmepriv->assoc_bssid[0],
|
|
|
|
&pnetwork->network.MacAddress[0]);
|
2010-08-20 15:15:30 +00:00
|
|
|
psecnetwork->IELength = r8712_restruct_sec_ie(padapter,
|
|
|
|
&pnetwork->network.IEs[0],
|
|
|
|
&psecnetwork->IEs[0],
|
|
|
|
pnetwork->network.IELength);
|
|
|
|
pqospriv->qos_option = 0;
|
|
|
|
if (pregistrypriv->wmm_enable) {
|
|
|
|
u32 tmp_len;
|
|
|
|
|
|
|
|
tmp_len = r8712_restruct_wmm_ie(padapter,
|
|
|
|
&pnetwork->network.IEs[0],
|
|
|
|
&psecnetwork->IEs[0],
|
|
|
|
pnetwork->network.IELength,
|
|
|
|
psecnetwork->IELength);
|
|
|
|
if (psecnetwork->IELength != tmp_len) {
|
|
|
|
psecnetwork->IELength = tmp_len;
|
|
|
|
pqospriv->qos_option = 1; /* WMM IE in beacon */
|
2015-10-19 17:15:29 +00:00
|
|
|
} else {
|
2010-08-20 15:15:30 +00:00
|
|
|
pqospriv->qos_option = 0; /* no WMM IE in beacon */
|
2015-10-19 17:15:29 +00:00
|
|
|
}
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
if (pregistrypriv->ht_enable) {
|
2016-09-02 10:15:40 +00:00
|
|
|
/*
|
|
|
|
* For WEP mode, we will use the bg mode to do the connection
|
2010-08-31 03:32:34 +00:00
|
|
|
* to avoid some IOT issues, especially for Realtek 8192u
|
|
|
|
* SoftAP.
|
|
|
|
*/
|
2011-04-02 01:02:12 +00:00
|
|
|
if ((padapter->securitypriv.PrivacyAlgrthm != _WEP40_) &&
|
|
|
|
(padapter->securitypriv.PrivacyAlgrthm != _WEP104_)) {
|
2010-08-31 03:32:34 +00:00
|
|
|
/* restructure_ht_ie */
|
|
|
|
r8712_restructure_ht_ie(padapter,
|
|
|
|
&pnetwork->network.IEs[0],
|
|
|
|
&psecnetwork->IEs[0],
|
|
|
|
pnetwork->network.IELength,
|
|
|
|
&psecnetwork->IELength);
|
|
|
|
}
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
psecuritypriv->supplicant_ie[0] = (u8)psecnetwork->IELength;
|
|
|
|
if (psecnetwork->IELength < 255)
|
|
|
|
memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0],
|
|
|
|
psecnetwork->IELength);
|
|
|
|
else
|
|
|
|
memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0],
|
|
|
|
255);
|
|
|
|
/* get cmdsz before endian conversion */
|
2015-08-06 00:17:19 +00:00
|
|
|
pcmd->cmdsz = r8712_get_wlan_bssid_ex_sz(psecnetwork);
|
2010-08-20 15:15:30 +00:00
|
|
|
#ifdef __BIG_ENDIAN
|
|
|
|
/* 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
|
2014-06-25 02:52:34 +00:00
|
|
|
INIT_LIST_HEAD(&pcmd->list);
|
2010-08-20 15:15:30 +00:00
|
|
|
pcmd->cmdcode = _JoinBss_CMD_;
|
|
|
|
pcmd->parmbuf = (unsigned char *)psecnetwork;
|
|
|
|
pcmd->rsp = NULL;
|
|
|
|
pcmd->rspsz = 0;
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, pcmd);
|
2019-06-20 11:52:58 +00:00
|
|
|
return 0;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
|
2019-06-20 11:53:01 +00:00
|
|
|
void r8712_disassoc_cmd(struct _adapter *padapter) /* for sta_mode */
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_obj *pdisconnect_cmd;
|
|
|
|
struct disconnect_parm *pdisconnect;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
pdisconnect_cmd = kmalloc(sizeof(*pdisconnect_cmd), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!pdisconnect_cmd)
|
2019-06-20 11:53:01 +00:00
|
|
|
return;
|
2014-06-14 11:47:21 +00:00
|
|
|
pdisconnect = kmalloc(sizeof(*pdisconnect), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!pdisconnect) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(pdisconnect_cmd);
|
2019-06-20 11:53:01 +00:00
|
|
|
return;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(pdisconnect_cmd, pdisconnect,
|
|
|
|
_DisConnect_CMD_);
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, pdisconnect_cmd);
|
|
|
|
}
|
|
|
|
|
2019-06-20 11:53:02 +00:00
|
|
|
void r8712_setopmode_cmd(struct _adapter *padapter,
|
2010-08-20 15:15:30 +00:00
|
|
|
enum NDIS_802_11_NETWORK_INFRASTRUCTURE networktype)
|
|
|
|
{
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct setopmode_parm *psetop;
|
|
|
|
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-20 11:53:02 +00:00
|
|
|
return;
|
2014-06-14 11:47:21 +00:00
|
|
|
psetop = kmalloc(sizeof(*psetop), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!psetop) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-20 11:53:02 +00:00
|
|
|
return;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, psetop, _SetOpMode_CMD_);
|
|
|
|
psetop->mode = (u8)networktype;
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, ph2c);
|
|
|
|
}
|
|
|
|
|
2019-06-20 11:53:03 +00:00
|
|
|
void r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct set_stakey_parm *psetstakey_para;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
struct set_stakey_rsp *psetstakey_rsp = NULL;
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
|
|
|
struct sta_info *sta = (struct sta_info *)psta;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-20 11:53:03 +00:00
|
|
|
return;
|
2014-06-14 11:47:21 +00:00
|
|
|
psetstakey_para = kmalloc(sizeof(*psetstakey_para), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!psetstakey_para) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-20 11:53:03 +00:00
|
|
|
return;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
2014-06-14 11:47:21 +00:00
|
|
|
psetstakey_rsp = kmalloc(sizeof(*psetstakey_rsp), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!psetstakey_rsp) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
|
|
|
kfree(psetstakey_para);
|
2019-06-20 11:53:03 +00:00
|
|
|
return;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, _SetStaKey_CMD_);
|
|
|
|
ph2c->rsp = (u8 *) psetstakey_rsp;
|
|
|
|
ph2c->rspsz = sizeof(struct set_stakey_rsp);
|
Staging: rtl8712: replace memcpy() by ether_addr_copy() using coccinelle and pack variable
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rtl871x_cmd.c
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)
@@ expression e1, e2; @@
- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);
struct _adapter {
struct dvobj_priv dvobjpriv; /* 0 40*/
struct mlme_priv mlmepriv; /* 40 1560*/
/* --- cacheline 25 boundary (1600 bytes) --- */
struct cmd_priv cmdpriv; /* 1600 136*/
/* --- cacheline 27 boundary (1728 bytes) was 8 bytes ago --- */
struct evt_priv evtpriv; /* 1736 96*/
/* --- cacheline 28 boundary (1792 bytes) was 40 bytes ago --- * */
struct io_queue * pio_queue; /* 1832 8*/
struct xmit_priv xmitpriv; /* 1840 912*/
/* --- cacheline 43 boundary (2752 bytes) --- */
struct recv_priv recvpriv; /* 2752 1088*/
/* --- cacheline 60 boundary (3840 bytes) --- */
struct sta_priv stapriv; /* 3840 672*/
/* --- cacheline 70 boundary (4480 bytes) was 32 bytes ago --- * */
struct security_priv securitypriv; /* 4512 4816*/
/* --- cacheline 145 boundary (9280 bytes) was 48 bytes ago --- * */
struct registry_priv registrypriv; /* 9328 968*/
/* --- cacheline 160 boundary (10240 bytes) was 56 bytes ago --- * */
struct wlan_acl_pool acl_list; /* 10296 1536*/
/* --- cacheline 184 boundary (11776 bytes) was 56 bytes ago --- * */
struct pwrctrl_priv pwrctrlpriv; /* 11832 224*/
/* --- cacheline 188 boundary (12032 bytes) was 24 bytes ago --- * */
struct eeprom_priv eeprompriv; /* 12056 508*/
/* XXX 4 bytes hole, try to pack */
/* --- cacheline 196 boundary (12544 bytes) was 24 bytes ago --- * */
struct hal_priv halpriv; /* 12568 88*/
/* --- cacheline 197 boundary (12608 bytes) was 48 bytes ago --- * */
struct led_priv ledpriv; /* 12656 304*/
/* --- cacheline 202 boundary (12928 bytes) was 32 bytes ago --- * */
struct mp_priv mppriv; /* 12960 1080*/
/* --- cacheline 219 boundary (14016 bytes) was 24 bytes ago * --- */
s32 bDriverStopped; /* 14040 4*/
s32 bSurpriseRemoved; /* 14044 4*/
u32 IsrContent; /* 14048 4*/
u32 ImrContent; /* 14052 4*/
u8 EepromAddressSize; /* 14056 1*/
u8 hw_init_completed; /* 14057 1*/
/* XXX 6 bytes hole, try to pack */
struct task_struct * cmdThread; /* 14064 8*/
pid_t evtThread; /* 14072 4*/
/* XXX 4 bytes hole, try to pack */
/* --- cacheline 220 boundary (14080 bytes) --- */
struct task_struct * xmitThread; /* 14080 8*/
pid_t recvThread; /* 14088 4*/
/* XXX 4 bytes hole, try to pack */
uint (*dvobj_init)(struct _adapter *); /*14096 8 */
void (*dvobj_deinit)(struct _adapter *);/* 14104 8 */
struct net_device * pnetdev; /* 14112 8*/
int bup; /* 14120 4*/
/* XXX 4 bytes hole, try to pack */
struct net_device_stats stats; /* 14128 184*/
/* --- cacheline 223 boundary (14272 bytes) was 40 bytes ago --- * */
struct iw_statistics iwstats; /* 14312 32*/
/* --- cacheline 224 boundary (14336 bytes) was 8 bytes ago --- * */
int pid; /* 14344 4*/
/* XXX 4 bytes hole, try to pack */
struct work_struct wkFilterRxFF0; /* 14352 32*/
u8 blnEnableRxFF0Filter; /* 14384 1*/
/* XXX 3 bytes hole, try to pack */
spinlock_t lockRxFF0Filter; /* 14388 4*/
const struct firmware * fw; /* 14392 8*/
/* --- cacheline 225 boundary (14400 bytes) --- */
struct usb_interface * pusb_intf; /* 14400 8*/
struct mutex mutex_start; /* 14408 40*/
/* XXX last struct has 4 bytes of padding */
struct completion rtl8712_fw_ready; /* 14448 32*/
/* --- cacheline 226 boundary (14464 bytes) was 16 bytes ago --- * */
/* size: 14480, cachelines: 227, members: 40 */
/* sum members: 14451, holes: 7, sum holes: 29 */
/* paddings: 1, sum paddings: 4 */
/* last cacheline: 16 bytes */
};
Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-23 07:11:57 +00:00
|
|
|
ether_addr_copy(psetstakey_para->addr, sta->hwaddr);
|
2010-08-20 15:15:30 +00:00
|
|
|
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
|
|
|
|
psetstakey_para->algorithm = (unsigned char)
|
|
|
|
psecuritypriv->PrivacyAlgrthm;
|
|
|
|
else
|
|
|
|
GET_ENCRY_ALGO(psecuritypriv, sta,
|
|
|
|
psetstakey_para->algorithm, false);
|
2015-10-19 17:14:29 +00:00
|
|
|
if (unicast_key)
|
2010-08-20 15:15:30 +00:00
|
|
|
memcpy(&psetstakey_para->key, &sta->x_UncstKey, 16);
|
|
|
|
else
|
|
|
|
memcpy(&psetstakey_para->key,
|
|
|
|
&psecuritypriv->XGrpKey[
|
|
|
|
psecuritypriv->XGrpKeyid - 1]. skey, 16);
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, ph2c);
|
|
|
|
}
|
|
|
|
|
2019-06-20 11:53:04 +00:00
|
|
|
void r8712_setMacAddr_cmd(struct _adapter *padapter, u8 *mac_addr)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct SetMacAddr_param *psetMacAddr_para;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-20 11:53:04 +00:00
|
|
|
return;
|
2014-06-14 11:47:21 +00:00
|
|
|
psetMacAddr_para = kmalloc(sizeof(*psetMacAddr_para), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!psetMacAddr_para) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-20 11:53:04 +00:00
|
|
|
return;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, psetMacAddr_para,
|
|
|
|
_SetMacAddress_CMD_);
|
Staging: rtl8712: replace memcpy() by ether_addr_copy() using coccinelle and pack variable
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rtl871x_cmd.c
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)
@@ expression e1, e2; @@
- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);
struct _adapter {
struct dvobj_priv dvobjpriv; /* 0 40*/
struct mlme_priv mlmepriv; /* 40 1560*/
/* --- cacheline 25 boundary (1600 bytes) --- */
struct cmd_priv cmdpriv; /* 1600 136*/
/* --- cacheline 27 boundary (1728 bytes) was 8 bytes ago --- */
struct evt_priv evtpriv; /* 1736 96*/
/* --- cacheline 28 boundary (1792 bytes) was 40 bytes ago --- * */
struct io_queue * pio_queue; /* 1832 8*/
struct xmit_priv xmitpriv; /* 1840 912*/
/* --- cacheline 43 boundary (2752 bytes) --- */
struct recv_priv recvpriv; /* 2752 1088*/
/* --- cacheline 60 boundary (3840 bytes) --- */
struct sta_priv stapriv; /* 3840 672*/
/* --- cacheline 70 boundary (4480 bytes) was 32 bytes ago --- * */
struct security_priv securitypriv; /* 4512 4816*/
/* --- cacheline 145 boundary (9280 bytes) was 48 bytes ago --- * */
struct registry_priv registrypriv; /* 9328 968*/
/* --- cacheline 160 boundary (10240 bytes) was 56 bytes ago --- * */
struct wlan_acl_pool acl_list; /* 10296 1536*/
/* --- cacheline 184 boundary (11776 bytes) was 56 bytes ago --- * */
struct pwrctrl_priv pwrctrlpriv; /* 11832 224*/
/* --- cacheline 188 boundary (12032 bytes) was 24 bytes ago --- * */
struct eeprom_priv eeprompriv; /* 12056 508*/
/* XXX 4 bytes hole, try to pack */
/* --- cacheline 196 boundary (12544 bytes) was 24 bytes ago --- * */
struct hal_priv halpriv; /* 12568 88*/
/* --- cacheline 197 boundary (12608 bytes) was 48 bytes ago --- * */
struct led_priv ledpriv; /* 12656 304*/
/* --- cacheline 202 boundary (12928 bytes) was 32 bytes ago --- * */
struct mp_priv mppriv; /* 12960 1080*/
/* --- cacheline 219 boundary (14016 bytes) was 24 bytes ago * --- */
s32 bDriverStopped; /* 14040 4*/
s32 bSurpriseRemoved; /* 14044 4*/
u32 IsrContent; /* 14048 4*/
u32 ImrContent; /* 14052 4*/
u8 EepromAddressSize; /* 14056 1*/
u8 hw_init_completed; /* 14057 1*/
/* XXX 6 bytes hole, try to pack */
struct task_struct * cmdThread; /* 14064 8*/
pid_t evtThread; /* 14072 4*/
/* XXX 4 bytes hole, try to pack */
/* --- cacheline 220 boundary (14080 bytes) --- */
struct task_struct * xmitThread; /* 14080 8*/
pid_t recvThread; /* 14088 4*/
/* XXX 4 bytes hole, try to pack */
uint (*dvobj_init)(struct _adapter *); /*14096 8 */
void (*dvobj_deinit)(struct _adapter *);/* 14104 8 */
struct net_device * pnetdev; /* 14112 8*/
int bup; /* 14120 4*/
/* XXX 4 bytes hole, try to pack */
struct net_device_stats stats; /* 14128 184*/
/* --- cacheline 223 boundary (14272 bytes) was 40 bytes ago --- * */
struct iw_statistics iwstats; /* 14312 32*/
/* --- cacheline 224 boundary (14336 bytes) was 8 bytes ago --- * */
int pid; /* 14344 4*/
/* XXX 4 bytes hole, try to pack */
struct work_struct wkFilterRxFF0; /* 14352 32*/
u8 blnEnableRxFF0Filter; /* 14384 1*/
/* XXX 3 bytes hole, try to pack */
spinlock_t lockRxFF0Filter; /* 14388 4*/
const struct firmware * fw; /* 14392 8*/
/* --- cacheline 225 boundary (14400 bytes) --- */
struct usb_interface * pusb_intf; /* 14400 8*/
struct mutex mutex_start; /* 14408 40*/
/* XXX last struct has 4 bytes of padding */
struct completion rtl8712_fw_ready; /* 14448 32*/
/* --- cacheline 226 boundary (14464 bytes) was 16 bytes ago --- * */
/* size: 14480, cachelines: 227, members: 40 */
/* sum members: 14451, holes: 7, sum holes: 29 */
/* paddings: 1, sum paddings: 4 */
/* last cacheline: 16 bytes */
};
Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-23 07:11:57 +00:00
|
|
|
ether_addr_copy(psetMacAddr_para->MacAddr, mac_addr);
|
2010-08-20 15:15:30 +00:00
|
|
|
r8712_enqueue_cmd(pcmdpriv, ph2c);
|
|
|
|
}
|
|
|
|
|
2019-06-21 06:08:07 +00:00
|
|
|
void r8712_addbareq_cmd(struct _adapter *padapter, u8 tid)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct addBaReq_parm *paddbareq_parm;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-21 06:08:07 +00:00
|
|
|
return;
|
2014-06-14 11:47:21 +00:00
|
|
|
paddbareq_parm = kmalloc(sizeof(*paddbareq_parm), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!paddbareq_parm) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-21 06:08:07 +00:00
|
|
|
return;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
paddbareq_parm->tid = tid;
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm,
|
|
|
|
GEN_CMD_CODE(_AddBAReq));
|
|
|
|
r8712_enqueue_cmd_ex(pcmdpriv, ph2c);
|
|
|
|
}
|
|
|
|
|
2019-06-21 06:08:09 +00:00
|
|
|
void r8712_wdg_wk_cmd(struct _adapter *padapter)
|
2010-08-20 15:15:30 +00:00
|
|
|
{
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct drvint_cmd_parm *pdrvintcmd_param;
|
|
|
|
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-21 06:08:09 +00:00
|
|
|
return;
|
2014-06-14 11:47:21 +00:00
|
|
|
pdrvintcmd_param = kmalloc(sizeof(*pdrvintcmd_param), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!pdrvintcmd_param) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-21 06:08:09 +00:00
|
|
|
return;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
pdrvintcmd_param->i_cid = WDG_WK_CID;
|
|
|
|
pdrvintcmd_param->sz = 0;
|
|
|
|
pdrvintcmd_param->pbuf = NULL;
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvintcmd_param, _DRV_INT_CMD_);
|
|
|
|
r8712_enqueue_cmd_ex(pcmdpriv, ph2c);
|
|
|
|
}
|
|
|
|
|
|
|
|
void r8712_survey_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd)
|
|
|
|
{
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
|
|
|
|
if (pcmd->res != H2C_SUCCESS)
|
|
|
|
clr_fwstate(pmlmepriv, _FW_UNDER_SURVEY);
|
|
|
|
r8712_free_cmd_obj(pcmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void r8712_disassoc_cmd_callback(struct _adapter *padapter,
|
|
|
|
struct cmd_obj *pcmd)
|
|
|
|
{
|
|
|
|
unsigned long irqL;
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
|
|
|
|
if (pcmd->res != H2C_SUCCESS) {
|
|
|
|
spin_lock_irqsave(&pmlmepriv->lock, irqL);
|
|
|
|
set_fwstate(pmlmepriv, _FW_LINKED);
|
|
|
|
spin_unlock_irqrestore(&pmlmepriv->lock, irqL);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
r8712_free_cmd_obj(pcmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void r8712_joinbss_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd)
|
|
|
|
{
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
|
2014-03-11 22:55:34 +00:00
|
|
|
if (pcmd->res != H2C_SUCCESS)
|
2015-02-27 17:55:48 +00:00
|
|
|
mod_timer(&pmlmepriv->assoc_timer,
|
|
|
|
jiffies + msecs_to_jiffies(1));
|
2010-08-20 15:15:30 +00:00
|
|
|
r8712_free_cmd_obj(pcmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void r8712_createbss_cmd_callback(struct _adapter *padapter,
|
|
|
|
struct cmd_obj *pcmd)
|
|
|
|
{
|
|
|
|
unsigned long irqL;
|
|
|
|
struct sta_info *psta = NULL;
|
|
|
|
struct wlan_network *pwlan = NULL;
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
2015-08-06 00:17:18 +00:00
|
|
|
struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)pcmd->parmbuf;
|
2010-08-20 15:15:30 +00:00
|
|
|
struct wlan_network *tgt_network = &(pmlmepriv->cur_network);
|
|
|
|
|
2014-03-11 22:55:34 +00:00
|
|
|
if (pcmd->res != H2C_SUCCESS)
|
2015-02-27 17:55:48 +00:00
|
|
|
mod_timer(&pmlmepriv->assoc_timer,
|
|
|
|
jiffies + msecs_to_jiffies(1));
|
2015-05-15 09:19:39 +00:00
|
|
|
del_timer(&pmlmepriv->assoc_timer);
|
2010-08-20 15:15:30 +00:00
|
|
|
#ifdef __BIG_ENDIAN
|
|
|
|
/* endian_convert */
|
|
|
|
pnetwork->Length = le32_to_cpu(pnetwork->Length);
|
|
|
|
pnetwork->Ssid.SsidLength = le32_to_cpu(pnetwork->Ssid.SsidLength);
|
|
|
|
pnetwork->Privacy = le32_to_cpu(pnetwork->Privacy);
|
|
|
|
pnetwork->Rssi = le32_to_cpu(pnetwork->Rssi);
|
|
|
|
pnetwork->NetworkTypeInUse = le32_to_cpu(pnetwork->NetworkTypeInUse);
|
2017-12-19 20:16:23 +00:00
|
|
|
pnetwork->Configuration.ATIMWindow =
|
|
|
|
le32_to_cpu(pnetwork->Configuration.ATIMWindow);
|
|
|
|
pnetwork->Configuration.DSConfig =
|
|
|
|
le32_to_cpu(pnetwork->Configuration.DSConfig);
|
|
|
|
pnetwork->Configuration.FHConfig.DwellTime =
|
|
|
|
le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime);
|
|
|
|
pnetwork->Configuration.FHConfig.HopPattern =
|
|
|
|
le32_to_cpu(pnetwork->Configuration.FHConfig.HopPattern);
|
|
|
|
pnetwork->Configuration.FHConfig.HopSet =
|
|
|
|
le32_to_cpu(pnetwork->Configuration.FHConfig.HopSet);
|
|
|
|
pnetwork->Configuration.FHConfig.Length =
|
|
|
|
le32_to_cpu(pnetwork->Configuration.FHConfig.Length);
|
|
|
|
pnetwork->Configuration.Length =
|
|
|
|
le32_to_cpu(pnetwork->Configuration.Length);
|
|
|
|
pnetwork->InfrastructureMode =
|
|
|
|
le32_to_cpu(pnetwork->InfrastructureMode);
|
2010-08-20 15:15:30 +00:00
|
|
|
pnetwork->IELength = le32_to_cpu(pnetwork->IELength);
|
|
|
|
#endif
|
|
|
|
spin_lock_irqsave(&pmlmepriv->lock, irqL);
|
|
|
|
if ((pmlmepriv->fw_state) & WIFI_AP_STATE) {
|
|
|
|
psta = r8712_get_stainfo(&padapter->stapriv,
|
|
|
|
pnetwork->MacAddress);
|
|
|
|
if (!psta) {
|
|
|
|
psta = r8712_alloc_stainfo(&padapter->stapriv,
|
|
|
|
pnetwork->MacAddress);
|
2016-09-20 09:07:43 +00:00
|
|
|
if (!psta)
|
2013-10-01 15:26:55 +00:00
|
|
|
goto createbss_cmd_fail;
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
r8712_indicate_connect(padapter);
|
|
|
|
} else {
|
|
|
|
pwlan = _r8712_alloc_network(pmlmepriv);
|
2016-09-20 09:07:43 +00:00
|
|
|
if (!pwlan) {
|
2010-08-20 15:15:30 +00:00
|
|
|
pwlan = r8712_get_oldest_wlan_network(
|
|
|
|
&pmlmepriv->scanned_queue);
|
2016-09-20 09:07:43 +00:00
|
|
|
if (!pwlan)
|
2010-08-20 15:15:30 +00:00
|
|
|
goto createbss_cmd_fail;
|
|
|
|
pwlan->last_scanned = jiffies;
|
2017-09-12 00:40:15 +00:00
|
|
|
} else {
|
2014-06-25 02:52:36 +00:00
|
|
|
list_add_tail(&(pwlan->list),
|
2010-08-20 15:15:30 +00:00
|
|
|
&pmlmepriv->scanned_queue.queue);
|
2017-09-12 00:40:15 +00:00
|
|
|
}
|
2015-08-06 00:17:19 +00:00
|
|
|
pnetwork->Length = r8712_get_wlan_bssid_ex_sz(pnetwork);
|
2010-08-20 15:15:30 +00:00
|
|
|
memcpy(&(pwlan->network), pnetwork, pnetwork->Length);
|
|
|
|
pwlan->fixed = true;
|
|
|
|
memcpy(&tgt_network->network, pnetwork,
|
2015-08-06 00:17:19 +00:00
|
|
|
(r8712_get_wlan_bssid_ex_sz(pnetwork)));
|
2010-08-20 15:15:30 +00:00
|
|
|
if (pmlmepriv->fw_state & _FW_UNDER_LINKING)
|
|
|
|
pmlmepriv->fw_state ^= _FW_UNDER_LINKING;
|
2016-09-02 10:15:40 +00:00
|
|
|
/*
|
|
|
|
* we will set _FW_LINKED when there is one more sat to
|
|
|
|
* join us (stassoc_event_callback)
|
|
|
|
*/
|
2010-08-20 15:15:30 +00:00
|
|
|
}
|
|
|
|
createbss_cmd_fail:
|
|
|
|
spin_unlock_irqrestore(&pmlmepriv->lock, irqL);
|
|
|
|
r8712_free_cmd_obj(pcmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void r8712_setstaKey_cmdrsp_callback(struct _adapter *padapter,
|
|
|
|
struct cmd_obj *pcmd)
|
|
|
|
{
|
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
|
struct set_stakey_rsp *psetstakey_rsp = (struct set_stakey_rsp *)
|
|
|
|
(pcmd->rsp);
|
|
|
|
struct sta_info *psta = r8712_get_stainfo(pstapriv,
|
|
|
|
psetstakey_rsp->addr);
|
|
|
|
|
2016-09-20 09:07:43 +00:00
|
|
|
if (!psta)
|
2010-08-20 15:15:30 +00:00
|
|
|
goto exit;
|
|
|
|
psta->aid = psta->mac_id = psetstakey_rsp->keyid; /*CAM_ID(CAM_ENTRY)*/
|
|
|
|
exit:
|
|
|
|
r8712_free_cmd_obj(pcmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void r8712_setassocsta_cmdrsp_callback(struct _adapter *padapter,
|
|
|
|
struct cmd_obj *pcmd)
|
|
|
|
{
|
|
|
|
unsigned long irqL;
|
|
|
|
struct sta_priv *pstapriv = &padapter->stapriv;
|
|
|
|
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
|
|
|
struct set_assocsta_parm *passocsta_parm =
|
|
|
|
(struct set_assocsta_parm *)(pcmd->parmbuf);
|
|
|
|
struct set_assocsta_rsp *passocsta_rsp =
|
|
|
|
(struct set_assocsta_rsp *) (pcmd->rsp);
|
|
|
|
struct sta_info *psta = r8712_get_stainfo(pstapriv,
|
|
|
|
passocsta_parm->addr);
|
|
|
|
|
2016-09-20 09:07:43 +00:00
|
|
|
if (!psta)
|
2010-08-20 15:15:30 +00:00
|
|
|
return;
|
|
|
|
psta->aid = psta->mac_id = passocsta_rsp->cam_id;
|
|
|
|
spin_lock_irqsave(&pmlmepriv->lock, irqL);
|
|
|
|
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE)) &&
|
|
|
|
(check_fwstate(pmlmepriv, _FW_UNDER_LINKING)))
|
|
|
|
pmlmepriv->fw_state ^= _FW_UNDER_LINKING;
|
|
|
|
set_fwstate(pmlmepriv, _FW_LINKED);
|
|
|
|
spin_unlock_irqrestore(&pmlmepriv->lock, irqL);
|
|
|
|
r8712_free_cmd_obj(pcmd);
|
|
|
|
}
|
2011-09-03 19:14:20 +00:00
|
|
|
|
2019-06-21 06:08:08 +00:00
|
|
|
void r8712_disconnectCtrlEx_cmd(struct _adapter *adapter, u32 enableDrvCtrl,
|
2011-09-03 19:14:20 +00:00
|
|
|
u32 tryPktCnt, u32 tryPktInterval, u32 firstStageTO)
|
|
|
|
{
|
|
|
|
struct cmd_obj *ph2c;
|
|
|
|
struct DisconnectCtrlEx_param *param;
|
|
|
|
struct cmd_priv *pcmdpriv = &adapter->cmdpriv;
|
|
|
|
|
2014-06-14 11:47:21 +00:00
|
|
|
ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!ph2c)
|
2019-06-21 06:08:08 +00:00
|
|
|
return;
|
2014-06-14 11:47:21 +00:00
|
|
|
param = kzalloc(sizeof(*param), GFP_ATOMIC);
|
2016-03-20 20:39:49 +00:00
|
|
|
if (!param) {
|
2014-10-08 15:11:26 +00:00
|
|
|
kfree(ph2c);
|
2019-06-21 06:08:08 +00:00
|
|
|
return;
|
2011-09-03 19:14:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
param->EnableDrvCtrl = (unsigned char)enableDrvCtrl;
|
|
|
|
param->TryPktCnt = (unsigned char)tryPktCnt;
|
|
|
|
param->TryPktInterval = (unsigned char)tryPktInterval;
|
|
|
|
param->FirstStageTO = (unsigned int)firstStageTO;
|
|
|
|
|
|
|
|
init_h2fwcmd_w_parm_no_rsp(ph2c, param,
|
|
|
|
GEN_CMD_CODE(_DisconnectCtrlEx));
|
|
|
|
r8712_enqueue_cmd(pcmdpriv, ph2c);
|
|
|
|
}
|