int unifi_cfg_wmm_addts(unifi_priv_t *priv, unsigned char *arg) { u32 addts_tid; u8 addts_ie_length; u8 *addts_ie; u8 *addts_params; CsrWifiSmeDataBlock tspec; CsrWifiSmeDataBlock tclas; int rc; addts_params = (u8*)(((unifi_cfg_command_t*)arg) + 1); if (get_user(addts_tid, (u32*)addts_params)) { unifi_error(priv, "unifi_cfg_wmm_addts: Failed to get the argument\n"); return -EFAULT; } addts_params += sizeof(u32); if (get_user(addts_ie_length, (u8*)addts_params)) { unifi_error(priv, "unifi_cfg_wmm_addts: Failed to get the argument\n"); return -EFAULT; } unifi_trace(priv, UDBG4, "addts: tid = 0x%x ie_length = %d\n", addts_tid, 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", addts_ie_length); return -ENOMEM; } addts_params += sizeof(u8); 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"); kfree(addts_ie); return -EFAULT; } tspec.data = addts_ie; tspec.length = addts_ie_length; tclas.data = NULL; tclas.length = 0; rc = sme_mgt_tspec(priv, CSR_WIFI_SME_LIST_ACTION_ADD, addts_tid, &tspec, &tclas); kfree(addts_ie); return rc; }
int unifi_cfg_wmm_addts(unifi_priv_t *priv, unsigned char *arg) { CsrUint32 addts_tid; CsrUint8 addts_ie_length; CsrUint8 *addts_ie; CsrUint8 *addts_params; unifi_DataBlock tspec; unifi_DataBlock tclas; int rc; addts_params = (CsrUint8*)(((unifi_cfg_command_t*)arg) + 1); if (get_user(addts_tid, (CsrUint32*)addts_params)) { unifi_error(priv, "unifi_cfg_wmm_addts: Failed to get the argument\n"); return -EFAULT; } addts_params += sizeof(CsrUint32); if (get_user(addts_ie_length, (CsrUint8*)addts_params)) { unifi_error(priv, "unifi_cfg_wmm_addts: Failed to get the argument\n"); return -EFAULT; } unifi_trace(priv, UDBG4, "addts: tid = 0x%x ie_length = %d\n", addts_tid, addts_ie_length); addts_ie = CsrPmalloc(addts_ie_length); if (addts_ie == NULL) { unifi_error(priv, "unifi_cfg_wmm_addts: Failed to malloc %d bytes for addts_ie buffer\n", addts_ie_length); return -ENOMEM; } addts_params += sizeof(CsrUint8); 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"); CsrPfree(addts_ie); return -EFAULT; } tspec.data = addts_ie; tspec.length = addts_ie_length; tclas.data = NULL; tclas.length = 0; rc = sme_mgt_tspec(priv, unifi_ListActionAdd, addts_tid, &tspec, &tclas); CsrPfree(addts_ie); return rc; }
int unifi_cfg_wmm_delts(unifi_priv_t *priv, unsigned char *arg) { u32 delts_tid; u8 *delts_params; CsrWifiSmeDataBlock tspec; CsrWifiSmeDataBlock tclas; int rc; delts_params = (u8*)(((unifi_cfg_command_t*)arg) + 1); if (get_user(delts_tid, (u32*)delts_params)) { unifi_error(priv, "unifi_cfg_wmm_delts: Failed to get the argument\n"); return -EFAULT; } unifi_trace(priv, UDBG4, "delts: tid = 0x%x\n", delts_tid); tspec.data = tclas.data = NULL; tspec.length = tclas.length = 0; rc = sme_mgt_tspec(priv, CSR_WIFI_SME_LIST_ACTION_REMOVE, delts_tid, &tspec, &tclas); return rc; }
int unifi_cfg_wmm_delts(unifi_priv_t *priv, unsigned char *arg) { CsrUint32 delts_tid; CsrUint8 *delts_params; unifi_DataBlock tspec; unifi_DataBlock tclas; int rc; delts_params = (CsrUint8*)(((unifi_cfg_command_t*)arg) + 1); if (get_user(delts_tid, (CsrUint32*)delts_params)) { unifi_error(priv, "unifi_cfg_wmm_delts: Failed to get the argument\n"); return -EFAULT; } unifi_trace(priv, UDBG4, "delts: tid = 0x%x\n", delts_tid); tspec.data = tclas.data = NULL; tspec.length = tclas.length = 0; rc = sme_mgt_tspec(priv, unifi_ListActionRemove, delts_tid, &tspec, &tclas); return rc; }