Merge tag 'spi-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc
[cascardo/linux.git] / drivers / staging / csr / unifi_sme.c
index 85e0c9e..ff639d4 100644 (file)
@@ -130,7 +130,7 @@ sme_log_event(ul_client_t *pcli,
             raddr = macHdrLocation + MAC_HEADER_ADDR1_OFFSET;
             taddr = macHdrLocation + MAC_HEADER_ADDR2_OFFSET;
 
-            CsrMemCpy(peerMacAddress.a, taddr, ETH_ALEN);
+            memcpy(peerMacAddress.a, taddr, ETH_ALEN);
 
             if(ind->ReceptionStatus == CSR_MICHAEL_MIC_ERROR)
             {
@@ -411,7 +411,7 @@ uf_multicast_list_wq(struct work_struct *work)
      * Allocate a new list, need to free it later
      * in unifi_mgt_multicast_address_cfm().
      */
-    multicast_address_list = CsrPmemAlloc(mc_count * sizeof(CsrWifiMacAddress));
+    multicast_address_list = kmalloc(mc_count * sizeof(CsrWifiMacAddress), GFP_KERNEL);
 
     if (multicast_address_list == NULL) {
         return;
@@ -423,7 +423,7 @@ uf_multicast_list_wq(struct work_struct *work)
     }
 
     if (priv->smepriv == NULL) {
-        CsrPmemFree(multicast_address_list);
+        kfree(multicast_address_list);
         return;
     }
 
@@ -433,7 +433,7 @@ uf_multicast_list_wq(struct work_struct *work)
             mc_count, multicast_address_list);
 
     /* The SME will take a copy of the addreses*/
-    CsrPmemFree(multicast_address_list);
+    kfree(multicast_address_list);
 }
 
 
@@ -572,7 +572,7 @@ int unifi_cfg_packet_filters(unifi_priv_t *priv, unsigned char *arg)
 
     /* Free any TCLASs previously allocated */
     if (priv->packet_filters.tclas_ies_length) {
-        CsrPmemFree(priv->filter_tclas_ies);
+        kfree(priv->filter_tclas_ies);
         priv->filter_tclas_ies = NULL;
     }
 
@@ -590,7 +590,7 @@ int unifi_cfg_packet_filters(unifi_priv_t *priv, unsigned char *arg)
         priv->packet_filters.tclas_ies_length += sizeof(tclas_t);
     }
     if (priv->packet_filters.tclas_ies_length > 0) {
-        priv->filter_tclas_ies = CsrPmemAlloc(priv->packet_filters.tclas_ies_length);
+        priv->filter_tclas_ies = kmalloc(priv->packet_filters.tclas_ies_length, GFP_KERNEL);
         if (priv->filter_tclas_ies == NULL) {
             return -ENOMEM;
         }
@@ -671,7 +671,7 @@ int unifi_cfg_wmm_addts(unifi_priv_t *priv, unsigned char *arg)
     unifi_trace(priv, UDBG4, "addts: tid = 0x%x ie_length = %d\n",
             addts_tid, addts_ie_length);
 
-    addts_ie = CsrPmemAlloc(addts_ie_length);
+    addts_ie = kmalloc(addts_ie_length, GFP_KERNEL);
     if (addts_ie == NULL) {
         unifi_error(priv,
                 "unifi_cfg_wmm_addts: Failed to malloc %d bytes for addts_ie buffer\n",
@@ -683,7 +683,7 @@ int unifi_cfg_wmm_addts(unifi_priv_t *priv, unsigned char *arg)
     rc = copy_from_user(addts_ie, addts_params, addts_ie_length);
     if (rc) {
         unifi_error(priv, "unifi_cfg_wmm_addts: Failed to get the addts buffer\n");
-        CsrPmemFree(addts_ie);
+        kfree(addts_ie);
         return -EFAULT;
     }
 
@@ -695,7 +695,7 @@ int unifi_cfg_wmm_addts(unifi_priv_t *priv, unsigned char *arg)
     rc = sme_mgt_tspec(priv, CSR_WIFI_SME_LIST_ACTION_ADD, addts_tid,
             &tspec, &tclas);
 
-    CsrPmemFree(addts_ie);
+    kfree(addts_ie);
     return rc;
 }
 
@@ -1209,8 +1209,8 @@ void uf_send_pkt_to_encrypt(struct work_struct *work)
         pktBulkDataLength = interfacePriv->wapi_unicast_bulk_data.data_length;
 
         if (pktBulkDataLength > 0) {
-                   pktBulkData = (u8 *)CsrPmemAlloc(pktBulkDataLength);
-                   CsrMemSet(pktBulkData, 0, pktBulkDataLength);
+                   pktBulkData = kmalloc(pktBulkDataLength, GFP_KERNEL);
+                   memset(pktBulkData, 0, pktBulkDataLength);
            } else {
                    unifi_error(priv, "uf_send_pkt_to_encrypt() : invalid buffer\n");
                    return;
@@ -1218,7 +1218,7 @@ void uf_send_pkt_to_encrypt(struct work_struct *work)
 
         spin_lock_irqsave(&priv->wapi_lock, flags);
         /* Copy over the MA PKT REQ bulk data */
-        CsrMemCpy(pktBulkData, (u8*)interfacePriv->wapi_unicast_bulk_data.os_data_ptr, pktBulkDataLength);
+        memcpy(pktBulkData, (u8*)interfacePriv->wapi_unicast_bulk_data.os_data_ptr, pktBulkDataLength);
         /* Free any bulk data buffers allocated for the WAPI Data pkt */
         unifi_net_data_free(priv, &interfacePriv->wapi_unicast_bulk_data);
         interfacePriv->wapi_unicast_bulk_data.net_buf_length = 0;
@@ -1229,7 +1229,7 @@ void uf_send_pkt_to_encrypt(struct work_struct *work)
         CsrWifiRouterCtrlWapiUnicastTxEncryptIndSend(priv->CSR_WIFI_SME_IFACEQUEUE, 0, interfaceTag, pktBulkDataLength, pktBulkData);
         unifi_trace(priv, UDBG1, "WapiUnicastTxEncryptInd sent to SME\n");
 
-        CsrPmemFree(pktBulkData); /* Would have been copied over by the SME Handler */
+        kfree(pktBulkData); /* Would have been copied over by the SME Handler */
 
         func_exit();
     } else {