From 2897df967633aab846ff4917b53e2af7d1e54eeb Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sun, 18 Nov 2018 14:42:09 -0500 Subject: [PATCH] bluetooth: ioctls always pass size on Haiku. --- headers/os/bluetooth/HCI/btHCI.h | 7 ------- .../drivers/bluetooth/h2/h2generic/h2generic.cpp | 5 ----- src/kits/bluetooth/CommandManager.cpp | 15 --------------- 3 files changed, 27 deletions(-) diff --git a/headers/os/bluetooth/HCI/btHCI.h b/headers/os/bluetooth/HCI/btHCI.h index 031fe0871b..b1489dec7b 100644 --- a/headers/os/bluetooth/HCI/btHCI.h +++ b/headers/os/bluetooth/HCI/btHCI.h @@ -42,13 +42,6 @@ const char* BluetoothError(uint8 error); #define HCI_FEATURES_SIZE 8 /* LMP features */ #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 #define HCI_2DH1 0x0002 #define HCI_3DH1 0x0004 diff --git a/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.cpp b/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.cpp index 16a2c225d8..f5d3e4b09a 100644 --- a/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.cpp +++ b/src/add-ons/kernel/drivers/bluetooth/h2/h2generic/h2generic.cpp @@ -618,16 +618,11 @@ device_control(void* cookie, uint32 msg, void* params, size_t size) switch (msg) { case ISSUE_BT_COMMAND: -#ifdef BT_IOCTLS_PASS_SIZE if (size == 0) { TRACE("%s: Invalid size control\n", __func__); err = B_BAD_VALUE; break; } -#else - size = (*((size_t*)params)); - (*(size_t**)¶ms)++; -#endif // TODO: Reuse from some TXcompleted queue // snbuf = snb_create(size); diff --git a/src/kits/bluetooth/CommandManager.cpp b/src/kits/bluetooth/CommandManager.cpp index 931f4d18f6..513383e00f 100644 --- a/src/kits/bluetooth/CommandManager.cpp +++ b/src/kits/bluetooth/CommandManager.cpp @@ -16,22 +16,11 @@ inline void* buildCommand(uint8 ogf, uint8 ocf, void** param, size_t psize, CALLED(); struct hci_command_header* header; -#ifdef BT_IOCTLS_PASS_SIZE header = (struct hci_command_header*) malloc(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) { - header->opcode = B_HOST_TO_LENDIAN_INT16(PACK_OPCODE(ogf, ocf)); 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); } } -#ifdef BT_IOCTLS_PASS_SIZE return header; -#else - return (void*)size; -#endif }