diff options
Diffstat (limited to 'drivers/staging/csr')
-rw-r--r-- | drivers/staging/csr/bh.c | 2 | ||||
-rw-r--r-- | drivers/staging/csr/drv.c | 6 | ||||
-rw-r--r-- | drivers/staging/csr/sme_sys.c | 41 | ||||
-rw-r--r-- | drivers/staging/csr/unifi_sme.c | 3 |
4 files changed, 31 insertions, 21 deletions
diff --git a/drivers/staging/csr/bh.c b/drivers/staging/csr/bh.c index 1a1f5c79822a..7b133597e923 100644 --- a/drivers/staging/csr/bh.c +++ b/drivers/staging/csr/bh.c @@ -15,7 +15,7 @@ */ #include "csr_wifi_hip_unifi.h" #include "unifi_priv.h" - +#include <linux/sched/rt.h> /* * --------------------------------------------------------------------------- diff --git a/drivers/staging/csr/drv.c b/drivers/staging/csr/drv.c index 4780c32c2fe3..3bd52fdeac3b 100644 --- a/drivers/staging/csr/drv.c +++ b/drivers/staging/csr/drv.c @@ -819,15 +819,15 @@ unifi_write(struct file *filp, const char *p, size_t len, loff_t *poff) unifi_trace(priv, UDBG2, "unifi_write: signal 0x%.4X len:%d\n", sig_id, signal_size); - /* Allocate a buffer for the signal */ - signal_buf = kmalloc(signal_size, GFP_KERNEL); + /* Allocate a buffer for the signal */ + signal_buf = kmemdup(bulkdata.d[0].os_data_ptr, signal_size, + GFP_KERNEL); if (!signal_buf) { unifi_net_data_free(priv, &bulkdata.d[0]); return -ENOMEM; } /* Get the signal from the os_data_ptr */ - memcpy(signal_buf, bulkdata.d[0].os_data_ptr, signal_size); signal_buf[5] = (pcli->sender_id >> 8) & 0xff; if (signal_size < len) { diff --git a/drivers/staging/csr/sme_sys.c b/drivers/staging/csr/sme_sys.c index 2b068197ed44..b1151a28d8e3 100644 --- a/drivers/staging/csr/sme_sys.c +++ b/drivers/staging/csr/sme_sys.c @@ -280,7 +280,7 @@ void CsrWifiRouterCtrlHipReqHandler(void* drvpriv, CsrWifiFsmEvent* msg) CSR_SIGNAL *signal; u16 interfaceTag = 0; CSR_MA_PACKET_REQUEST *req; - netInterface_priv_t *interfacePriv = priv->interfacePriv[interfaceTag]; + netInterface_priv_t *interfacePriv; if (priv == NULL) { return; @@ -294,6 +294,8 @@ void CsrWifiRouterCtrlHipReqHandler(void* drvpriv, CsrWifiFsmEvent* msg) return; } + interfacePriv = priv->interfacePriv[interfaceTag]; + /* Initialize bulkdata to avoid os_net_buf is garbage */ memset(&bulkdata, 0, sizeof(bulk_data_param_t)); @@ -1498,7 +1500,7 @@ void CsrWifiRouterMaPacketReqHandler(void* drvpriv, CsrWifiFsmEvent* msg) u8 *daddr, *saddr; u16 interfaceTag = mareq->interfaceTag & 0x00ff; int queue; - netInterface_priv_t *interfacePriv = priv->interfacePriv[interfaceTag]; + netInterface_priv_t *interfacePriv; if (!mareq->frame || !priv || !priv->smepriv) { @@ -1510,6 +1512,8 @@ void CsrWifiRouterMaPacketReqHandler(void* drvpriv, CsrWifiFsmEvent* msg) unifi_error(priv, "CsrWifiRouterMaPacketReqHandler: interfaceID >= CSR_WIFI_NUM_INTERFACES.\n"); return; } + + interfacePriv = priv->interfacePriv[interfaceTag]; /* get a pointer to dest & source Mac address */ daddr = mareq->frame; saddr = (mareq->frame + ETH_ALEN); @@ -2056,9 +2060,9 @@ void CsrWifiRouterCtrlPeerDelReqHandler(void* drvpriv, CsrWifiFsmEvent* msg) CsrWifiRouterCtrlPeerDelReq* req = (CsrWifiRouterCtrlPeerDelReq*)msg; CsrResult status = CSR_RESULT_SUCCESS; unifi_priv_t *priv = (unifi_priv_t*)drvpriv; - netInterface_priv_t *interfacePriv = priv->interfacePriv[req->interfaceTag]; + netInterface_priv_t *interfacePriv; - unifi_trace(priv, UDBG2, "entering CsrWifiRouterCtrlPeerDelReqHandler \n"); + unifi_trace(priv, UDBG2, "entering CsrWifiRouterCtrlPeerDelReqHandler\n"); if (priv == NULL) { unifi_error(priv, "CsrWifiRouterCtrlPeerDelReqHandler: invalid smepriv\n"); @@ -2071,6 +2075,8 @@ void CsrWifiRouterCtrlPeerDelReqHandler(void* drvpriv, CsrWifiFsmEvent* msg) return; } + interfacePriv = priv->interfacePriv[req->interfaceTag]; + switch(interfacePriv->interfaceMode) { case CSR_WIFI_ROUTER_CTRL_MODE_AP: @@ -2471,7 +2477,7 @@ void CsrWifiRouterCtrlPeerAddReqHandler(void* drvpriv,CsrWifiFsmEvent* msg) CsrResult status = CSR_RESULT_SUCCESS; unifi_priv_t *priv = (unifi_priv_t*)drvpriv; u32 handle = 0; - netInterface_priv_t *interfacePriv = priv->interfacePriv[req->interfaceTag]; + netInterface_priv_t *interfacePriv; unifi_trace(priv, UDBG2, "entering CsrWifiRouterCtrlPeerAddReqHandler \n"); if (priv == NULL) @@ -2486,6 +2492,8 @@ void CsrWifiRouterCtrlPeerAddReqHandler(void* drvpriv,CsrWifiFsmEvent* msg) return; } + interfacePriv = priv->interfacePriv[req->interfaceTag]; + switch(interfacePriv->interfaceMode) { case CSR_WIFI_ROUTER_CTRL_MODE_AP: @@ -3036,21 +3044,24 @@ void CsrWifiRouterCtrlWapiRxPktReqHandler(void* drvpriv, CsrWifiFsmEvent* msg) ul_client_t *client; CSR_SIGNAL signal; CSR_MA_PACKET_INDICATION *pkt_ind; - netInterface_priv_t *interfacePriv = priv->interfacePriv[req->interfaceTag]; + netInterface_priv_t *interfacePriv; + + if (priv == NULL) { + unifi_error(priv, "CsrWifiRouterCtrlWapiRxPktReq : invalid priv\n", __func__); + return; + } + + if (priv->smepriv == NULL) { + unifi_error(priv, "CsrWifiRouterCtrlWapiRxPktReq : invalid sme priv\n", __func__); + return; + } + + interfacePriv = priv->interfacePriv[req->interfaceTag]; if (CSR_WIFI_ROUTER_CTRL_MODE_STA == interfacePriv->interfaceMode) { unifi_trace(priv, UDBG6, ">>%s\n", __FUNCTION__); - if (priv == NULL) { - unifi_error(priv, "CsrWifiRouterCtrlWapiRxPktReq : invalid priv\n",__FUNCTION__); - return; - } - - if (priv->smepriv == NULL) { - unifi_error(priv, "CsrWifiRouterCtrlWapiRxPktReq : invalid sme priv\n",__FUNCTION__); - return; - } if (req->dataLength == 0 || req->data == NULL) { unifi_error(priv, "CsrWifiRouterCtrlWapiRxPktReq: invalid request\n",__FUNCTION__); diff --git a/drivers/staging/csr/unifi_sme.c b/drivers/staging/csr/unifi_sme.c index 7c6c4138fc76..7d19e632a5e4 100644 --- a/drivers/staging/csr/unifi_sme.c +++ b/drivers/staging/csr/unifi_sme.c @@ -15,7 +15,7 @@ #include "unifi_priv.h" #include "csr_wifi_hip_unifi.h" #include "csr_wifi_hip_conversions.h" - +#include <linux/sched/rt.h> @@ -1196,7 +1196,6 @@ void uf_send_pkt_to_encrypt(struct work_struct *work) if (pktBulkDataLength > 0) { pktBulkData = kmalloc(pktBulkDataLength, GFP_KERNEL); - memset(pktBulkData, 0, pktBulkDataLength); } else { unifi_error(priv, "uf_send_pkt_to_encrypt() : invalid buffer\n"); return; |