wmi_unified_mlme_tlv.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. *
  16. */
  17. /**
  18. * DOC: contains wmi mlme declarations
  19. */
  20. #include <wmi_unified_priv.h>
  21. #include "wmi.h"
  22. #include "wlan_mlme_api.h"
  23. static QDF_STATUS csa_event_status_ind_tlv(wmi_unified_t wmi_handle,
  24. struct csa_event_status_ind params)
  25. {
  26. wmi_csa_event_status_ind_fixed_param *cmd;
  27. wmi_buf_t buf;
  28. QDF_STATUS status;
  29. buf = wmi_buf_alloc(wmi_handle, sizeof(*cmd));
  30. if (!buf)
  31. return QDF_STATUS_E_FAILURE;
  32. cmd = (wmi_csa_event_status_ind_fixed_param *)wmi_buf_data(buf);
  33. WMITLV_SET_HDR(&cmd->tlv_header,
  34. WMITLV_TAG_STRUC_wmi_csa_event_status_ind_fixed_param,
  35. WMITLV_GET_STRUCT_TLVLEN
  36. (wmi_csa_event_status_ind_fixed_param));
  37. cmd->vdev_id = params.vdev_id;
  38. cmd->status = params.status;
  39. wmi_debug("vdev_id: %d status: %d ", cmd->vdev_id, cmd->status);
  40. status = wmi_unified_cmd_send(wmi_handle, buf, sizeof(*cmd),
  41. WMI_CSA_EVENT_STATUS_INDICATION_CMDID);
  42. if (QDF_IS_STATUS_ERROR(status))
  43. wmi_buf_free(buf);
  44. return status;
  45. }
  46. /**
  47. * wmi_mlme_attach_tlv() - attach MLME tlv handlers
  48. * @wmi_handle: wmi handle
  49. *
  50. * Return: void
  51. */
  52. void wmi_mlme_attach_tlv(wmi_unified_t wmi_handle)
  53. {
  54. struct wmi_ops *ops = wmi_handle->ops;
  55. ops->send_csa_event_status_ind = csa_event_status_ind_tlv;
  56. }