mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-18 15:59:59 +00:00
Added change to handle the case of controllers supporting Buffer Size
larger than 251. Current memory allocation for buffers is limited to 251 size and hence fragmentation is needed in case buffer size is larger.
This commit is contained in:
committed by
Abhinav Kudnar
parent
6336a6de85
commit
f123585faf
@@ -413,6 +413,7 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !(SOC_ESP_NIMBLE_CONTROLLER)
|
||||
/**
|
||||
* Calculates the largest ACL payload that the controller can accept.
|
||||
*/
|
||||
@@ -426,6 +427,7 @@ ble_hs_hci_max_acl_payload_sz(void)
|
||||
*/
|
||||
return ble_hs_hci_buf_sz;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allocates an mbuf to contain an outgoing ACL data fragment.
|
||||
@@ -534,8 +536,11 @@ ble_hs_hci_acl_tx_now(struct ble_hs_conn *conn, struct os_mbuf **om)
|
||||
|
||||
/* Send fragments until the entire packet has been sent. */
|
||||
while (txom != NULL && ble_hs_hci_avail_pkts > 0) {
|
||||
frag = mem_split_frag(&txom, ble_hs_hci_max_acl_payload_sz(),
|
||||
ble_hs_hci_frag_alloc, NULL);
|
||||
#if SOC_ESP_NIMBLE_CONTROLLER
|
||||
frag = mem_split_frag(&txom, BLE_ACL_MAX_PKT_SIZE, ble_hs_hci_frag_alloc, NULL);
|
||||
#else
|
||||
frag = mem_split_frag(&txom, ble_hs_hci_max_acl_payload_sz(), ble_hs_hci_frag_alloc, NULL);
|
||||
#endif
|
||||
if (frag == NULL) {
|
||||
*om = txom;
|
||||
return BLE_HS_EAGAIN;
|
||||
|
||||
Reference in New Issue
Block a user