@@ -50,31 +50,31 @@ free()
5050}
5151
5252bool BtIntel::
53- intelSendHCISync (HciCommandHdr *cmd, void *event, uint32_t *size, int timeout)
53+ intelSendHCISync (HciCommandHdr *cmd, void *event, uint32_t eventBufSize, uint32_t *size, int timeout)
5454{
5555// XYLog("%s cmd: 0x%02x len: %d\n", __PRETTY_FUNCTION__, cmd->opcode, cmd->len);
5656 IOReturn ret;
5757 if ((ret = m_pUSBDeviceController->sendHCIRequest (cmd, timeout)) != kIOReturnSuccess ) {
5858 XYLog (" %s sendHCIRequest failed: %s %d" , __FUNCTION__, m_pUSBDeviceController->stringFromReturn (ret), ret);
5959 return false ;
6060 }
61- if ((ret = m_pUSBDeviceController->interruptPipeRead (event, size, timeout)) != kIOReturnSuccess ) {
61+ if ((ret = m_pUSBDeviceController->interruptPipeRead (event, eventBufSize, size, timeout)) != kIOReturnSuccess ) {
6262 XYLog (" %s interruptPipeRead failed: %s %d" , __FUNCTION__, m_pUSBDeviceController->stringFromReturn (ret), ret);
6363 return false ;
6464 }
6565 return true ;
6666}
6767
6868bool BtIntel::
69- intelBulkHCISync (HciCommandHdr *cmd, void *event, uint32_t *size, int timeout)
69+ intelBulkHCISync (HciCommandHdr *cmd, void *event, uint32_t eventBufSize, uint32_t *size, int timeout)
7070{
7171// XYLog("%s cmd: 0x%02x len: %d\n", __FUNCTION__, cmd->opcode, cmd->len);
7272 IOReturn ret;
7373 if ((ret = m_pUSBDeviceController->bulkWrite (cmd, HCI_COMMAND_HDR_SIZE + cmd->len , timeout)) != kIOReturnSuccess ) {
7474 XYLog (" %s bulkWrite failed: %s %d" , __FUNCTION__, m_pUSBDeviceController->stringFromReturn (ret), ret);
7575 return false ;
7676 }
77- if ((ret = m_pUSBDeviceController->bulkPipeRead (event, size, timeout)) != kIOReturnSuccess ) {
77+ if ((ret = m_pUSBDeviceController->bulkPipeRead (event, eventBufSize, size, timeout)) != kIOReturnSuccess ) {
7878 XYLog (" %s bulkPipeRead failed: %s %d" , __FUNCTION__, m_pUSBDeviceController->stringFromReturn (ret), ret);
7979 return false ;
8080 }
@@ -97,7 +97,7 @@ securedSend(uint8_t fragmentType, uint32_t len, const uint8_t *fragment)
9797 hciCommand->data [0 ] = fragmentType;
9898 memcpy (hciCommand->data + 1 , fragment, fragment_len);
9999
100- if (!(ret = intelBulkHCISync (hciCommand, NULL , NULL , HCI_INIT_TIMEOUT))) {
100+ if (!(ret = intelBulkHCISync (hciCommand, NULL , 0 , NULL , HCI_INIT_TIMEOUT))) {
101101 XYLog (" secure send failed\n " );
102102 return ret;
103103 }
@@ -183,7 +183,7 @@ intelBoot(uint32_t bootAddr)
183183 * 1 second. However if that happens, then just fail the setup
184184 * since something went wrong.
185185 */
186- IOReturn ret = m_pUSBDeviceController->interruptPipeRead (buf, &actLen, 1000 );
186+ IOReturn ret = m_pUSBDeviceController->interruptPipeRead (buf, sizeof (buf), &actLen, 1000 );
187187 if (ret != kIOReturnSuccess || actLen <= 0 ) {
188188 XYLog (" Intel boot failed\n " );
189189 if (ret == kIOReturnTimeout ) {
@@ -226,7 +226,7 @@ loadDDCConfig(const char *ddcFileName)
226226 cmd->opcode = OSSwapHostToLittleInt16 (0xfc8b );
227227 cmd->len = cmd_plen;
228228 memcpy (cmd->data , fw_ptr, cmd->len );
229- if (!intelSendHCISync (cmd, NULL , NULL , HCI_INIT_TIMEOUT)) {
229+ if (!intelSendHCISync (cmd, NULL , 0 , NULL , HCI_INIT_TIMEOUT)) {
230230 XYLog (" Failed to send Intel_Write_DDC\n " );
231231 return false ;
232232 }
0 commit comments