bluetooth: ioctls always pass size on Haiku.
This commit is contained in:
@@ -42,13 +42,6 @@ const char* BluetoothError(uint8 error);
|
|||||||
#define HCI_FEATURES_SIZE 8 /* LMP features */
|
#define HCI_FEATURES_SIZE 8 /* LMP features */
|
||||||
#define HCI_DEVICE_NAME_SIZE 248 /* unit name size */
|
#define HCI_DEVICE_NAME_SIZE 248 /* unit name size */
|
||||||
|
|
||||||
/* Device drivers need to take this into account
|
|
||||||
* when receiving ioctls. Only applies to R5 builds
|
|
||||||
* in deprecation process
|
|
||||||
*/
|
|
||||||
#define BT_IOCTLS_PASS_SIZE
|
|
||||||
|
|
||||||
|
|
||||||
// HCI Packet types
|
// HCI Packet types
|
||||||
#define HCI_2DH1 0x0002
|
#define HCI_2DH1 0x0002
|
||||||
#define HCI_3DH1 0x0004
|
#define HCI_3DH1 0x0004
|
||||||
|
|||||||
@@ -618,16 +618,11 @@ device_control(void* cookie, uint32 msg, void* params, size_t size)
|
|||||||
|
|
||||||
switch (msg) {
|
switch (msg) {
|
||||||
case ISSUE_BT_COMMAND:
|
case ISSUE_BT_COMMAND:
|
||||||
#ifdef BT_IOCTLS_PASS_SIZE
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
TRACE("%s: Invalid size control\n", __func__);
|
TRACE("%s: Invalid size control\n", __func__);
|
||||||
err = B_BAD_VALUE;
|
err = B_BAD_VALUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
size = (*((size_t*)params));
|
|
||||||
(*(size_t**)¶ms)++;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO: Reuse from some TXcompleted queue
|
// TODO: Reuse from some TXcompleted queue
|
||||||
// snbuf = snb_create(size);
|
// snbuf = snb_create(size);
|
||||||
|
|||||||
@@ -16,22 +16,11 @@ inline void* buildCommand(uint8 ogf, uint8 ocf, void** param, size_t psize,
|
|||||||
CALLED();
|
CALLED();
|
||||||
struct hci_command_header* header;
|
struct hci_command_header* header;
|
||||||
|
|
||||||
#ifdef BT_IOCTLS_PASS_SIZE
|
|
||||||
header = (struct hci_command_header*) malloc(psize
|
header = (struct hci_command_header*) malloc(psize
|
||||||
+ sizeof(struct hci_command_header));
|
+ sizeof(struct hci_command_header));
|
||||||
*outsize = psize + sizeof(struct hci_command_header);
|
*outsize = psize + sizeof(struct hci_command_header);
|
||||||
#else
|
|
||||||
size_t* size = (size_t*)malloc(psize + sizeof(struct hci_command_header)
|
|
||||||
+ sizeof(size_t));
|
|
||||||
*outsize = psize + sizeof(struct hci_command_header) + sizeof(size_t);
|
|
||||||
|
|
||||||
*size = psize + sizeof(struct hci_command_header);
|
|
||||||
header = (struct hci_command_header*) (((uint8*)size)+4);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if (header != NULL) {
|
if (header != NULL) {
|
||||||
|
|
||||||
header->opcode = B_HOST_TO_LENDIAN_INT16(PACK_OPCODE(ogf, ocf));
|
header->opcode = B_HOST_TO_LENDIAN_INT16(PACK_OPCODE(ogf, ocf));
|
||||||
header->clen = psize;
|
header->clen = psize;
|
||||||
|
|
||||||
@@ -39,11 +28,7 @@ inline void* buildCommand(uint8 ogf, uint8 ocf, void** param, size_t psize,
|
|||||||
*param = ((uint8*)header) + sizeof(struct hci_command_header);
|
*param = ((uint8*)header) + sizeof(struct hci_command_header);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef BT_IOCTLS_PASS_SIZE
|
|
||||||
return header;
|
return header;
|
||||||
#else
|
|
||||||
return (void*)size;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user