|
@@ -3325,101 +3325,6 @@ lim_send_meas_report_frame(struct mac_context *mac,
|
|
|
|
|
|
} /* End lim_send_meas_report_frame. */
|
|
|
|
|
|
-/**
|
|
|
- * \brief Send a TPC Request Action frame
|
|
|
- *
|
|
|
- *
|
|
|
- * \param mac Pointer to the global MAC datastructure
|
|
|
- *
|
|
|
- * \param peer MAC address to which the frame should be sent
|
|
|
- *
|
|
|
- *
|
|
|
- */
|
|
|
-
|
|
|
-void
|
|
|
-lim_send_tpc_request_frame(struct mac_context *mac,
|
|
|
- tSirMacAddr peer, struct pe_session *pe_session)
|
|
|
-{
|
|
|
- tDot11fTPCRequest frm;
|
|
|
- uint8_t *pFrame;
|
|
|
- tpSirMacMgmtHdr pMacHdr;
|
|
|
- uint32_t nBytes, nPayload, nStatus;
|
|
|
- void *pPacket;
|
|
|
- QDF_STATUS qdf_status;
|
|
|
-
|
|
|
- qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
|
|
|
-
|
|
|
- frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT;
|
|
|
- frm.Action.action = SIR_MAC_ACTION_TPC_REQUEST_ID;
|
|
|
- frm.DialogToken.token = 1;
|
|
|
- frm.TPCRequest.present = 1;
|
|
|
-
|
|
|
- nStatus = dot11f_get_packed_tpc_request_size(mac, &frm, &nPayload);
|
|
|
- if (DOT11F_FAILED(nStatus)) {
|
|
|
- pe_err("Failed to calculate the packed size for a TPC Request (0x%08x)", nStatus);
|
|
|
- /* We'll fall back on the worst case scenario: */
|
|
|
- nPayload = sizeof(tDot11fTPCRequest);
|
|
|
- } else if (DOT11F_WARNED(nStatus)) {
|
|
|
- pe_warn("There were warnings while calculating the packed size for a TPC Request (0x%08x)",
|
|
|
- nStatus);
|
|
|
- }
|
|
|
-
|
|
|
- nBytes = nPayload + sizeof(tSirMacMgmtHdr);
|
|
|
-
|
|
|
- qdf_status =
|
|
|
- cds_packet_alloc(mac->hdd_handle, TXRX_FRM_802_11_MGMT,
|
|
|
- (uint16_t) nBytes, (void **)&pFrame,
|
|
|
- (void **)&pPacket);
|
|
|
- if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
|
|
|
- pe_err("Failed to allocate %d bytes for a TPC"
|
|
|
- " Request", nBytes);
|
|
|
- return;
|
|
|
- }
|
|
|
- /* Paranoia: */
|
|
|
- qdf_mem_set(pFrame, nBytes, 0);
|
|
|
-
|
|
|
- /* Next, we fill out the buffer descriptor: */
|
|
|
- lim_populate_mac_header(mac, pFrame, SIR_MAC_MGMT_FRAME,
|
|
|
- SIR_MAC_MGMT_ACTION, peer);
|
|
|
- pMacHdr = (tpSirMacMgmtHdr) pFrame;
|
|
|
-
|
|
|
- qdf_mem_copy(pMacHdr->bssId, pe_session->bssId, sizeof(tSirMacAddr));
|
|
|
-
|
|
|
- lim_set_protected_bit(mac, pe_session, peer, pMacHdr);
|
|
|
-
|
|
|
- nStatus = dot11f_pack_tpc_request(mac, &frm, pFrame +
|
|
|
- sizeof(tSirMacMgmtHdr),
|
|
|
- nPayload, &nPayload);
|
|
|
- if (DOT11F_FAILED(nStatus)) {
|
|
|
- pe_err("Failed to pack a TPC Request (0x%08x)",
|
|
|
- nStatus);
|
|
|
- cds_packet_free(mac->hdd_handle, TXRX_FRM_802_11_MGMT,
|
|
|
- (void *)pFrame, (void *)pPacket);
|
|
|
- return; /* allocated! */
|
|
|
- } else if (DOT11F_WARNED(nStatus)) {
|
|
|
- pe_warn("There were warnings while packing a TPC Request (0x%08x)",
|
|
|
- nStatus);
|
|
|
- }
|
|
|
-
|
|
|
- MTRACE(qdf_trace(QDF_MODULE_ID_PE, TRACE_CODE_TX_MGMT,
|
|
|
- ((pe_session) ? pe_session->
|
|
|
- peSessionId : NO_SESSION), pMacHdr->fc.subType));
|
|
|
- qdf_status =
|
|
|
- wma_tx_frame(mac, pPacket, (uint16_t) nBytes,
|
|
|
- TXRX_FRM_802_11_MGMT, ANI_TXDIR_TODS, 7,
|
|
|
- lim_tx_complete, pFrame, 0, 0, RATEID_DEFAULT);
|
|
|
- MTRACE(qdf_trace
|
|
|
- (QDF_MODULE_ID_PE, TRACE_CODE_TX_COMPLETE,
|
|
|
- ((pe_session) ? pe_session->peSessionId : NO_SESSION),
|
|
|
- qdf_status));
|
|
|
- if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
|
|
|
- pe_err("Failed to send a TPC Request (%X)!",
|
|
|
- qdf_status);
|
|
|
- /* Pkt will be freed up by the callback */
|
|
|
- }
|
|
|
-
|
|
|
-} /* End lim_send_tpc_request_frame. */
|
|
|
-
|
|
|
/**
|
|
|
* \brief Send a TPC Report Action frame
|
|
|
*
|