mirror of https://github.com/ARMmbed/mbed-os.git
wsf buffer transfers owenrship to controller
parent
0de3510d1c
commit
96040be349
|
@ -55,7 +55,7 @@ public:
|
|||
* packet, ACL packet or EVT packet. Depending on the type of transport
|
||||
* it can prefix the packet itself.
|
||||
* @param len Number of bytes to transmit.
|
||||
* @param pData pointer to the data to transmit.
|
||||
* @param pData Pointer to the data to transmit. This is an WSF buffer and we receive ownership.
|
||||
*
|
||||
* @return The number of bytes which have been transmited.
|
||||
*/
|
||||
|
|
|
@ -80,7 +80,7 @@ void hciTrSendAclData(void *pContext, uint8_t *pData)
|
|||
*
|
||||
* \brief Send a complete HCI command to the transport.
|
||||
*
|
||||
* \param pData WSF msg buffer containing an HCI command.
|
||||
* \param pData WSF msg buffer containing an HCI command. WSF buffer ownership is released by this function.
|
||||
*
|
||||
* \return None.
|
||||
*/
|
||||
|
@ -95,12 +95,13 @@ void hciTrSendCmd(uint8_t *pData)
|
|||
/* dump event for protocol analysis */
|
||||
HCI_PDUMP_CMD(len, pData);
|
||||
|
||||
/* transmit ACL header and data */
|
||||
if (hciDrvWrite(HCI_CMD_TYPE, len, pData) == len)
|
||||
/* transmit ACL header and data (releases the ownership of the WSF buffer containing pData) */
|
||||
if (hciDrvWrite(HCI_CMD_TYPE, len, pData) != len)
|
||||
{
|
||||
/* free buffer */
|
||||
WsfMsgFree(pData);
|
||||
/* transport failure */
|
||||
WSF_ASSERT(0);
|
||||
}
|
||||
/* pData is not freed as the hciDrvWrite took ownership of the WSF buffer */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ void NRFCordioHCITransportDriver::terminate()
|
|||
|
||||
uint16_t NRFCordioHCITransportDriver::write(uint8_t hci_type, uint16_t len, uint8_t *pData)
|
||||
{
|
||||
/* ownership of the WSF buffer is transferred to the controller (zero copy HCI) */
|
||||
return FakeChciTrRead(CHCI_TR_PROT_BLE, hci_type, len, pData);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
* packet, ACL packet or EVT packet. Depending on the type of transport
|
||||
* it can prefix the packet itself.
|
||||
* @param len Number of bytes to transmit.
|
||||
* @param pData pointer to the data to transmit.
|
||||
* @param pData Pointer to the data to transmit. This is an WSF buffer and we receive ownership.
|
||||
*
|
||||
* @return The number of bytes which have been transmited.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue