Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38da1703 authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann
Browse files

Bluetooth: Use shorter "rand" name for "randomizer"



The common short form of "randomizer" is "rand" in many places
(including the Bluetooth specification). The shorter version also makes
for easier to read code with less forced line breaks. This patch renames
all occurences of "randomizer" to "rand" in the Bluetooth subsystem
code.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent c19a495c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -639,7 +639,7 @@ struct hci_cp_user_passkey_reply {
struct hci_cp_remote_oob_data_reply {
	bdaddr_t bdaddr;
	__u8     hash[16];
	__u8     randomizer[16];
	__u8     rand[16];
} __packed;

#define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY	0x0433
@@ -731,9 +731,9 @@ struct hci_rp_set_csb {
struct hci_cp_remote_oob_ext_data_reply {
	bdaddr_t bdaddr;
	__u8     hash192[16];
	__u8     randomizer192[16];
	__u8     rand192[16];
	__u8     hash256[16];
	__u8     randomizer256[16];
	__u8     rand256[16];
} __packed;

#define HCI_OP_SNIFF_MODE		0x0803
@@ -940,7 +940,7 @@ struct hci_cp_write_ssp_mode {
struct hci_rp_read_local_oob_data {
	__u8     status;
	__u8     hash[16];
	__u8     randomizer[16];
	__u8     rand[16];
} __packed;

#define HCI_OP_READ_INQ_RSP_TX_POWER	0x0c58
@@ -1024,9 +1024,9 @@ struct hci_cp_write_sc_support {
struct hci_rp_read_local_oob_ext_data {
	__u8     status;
	__u8     hash192[16];
	__u8     randomizer192[16];
	__u8     rand192[16];
	__u8     hash256[16];
	__u8     randomizer256[16];
	__u8     rand256[16];
} __packed;

#define HCI_OP_READ_LOCAL_VERSION	0x1001
+7 −7
Original line number Diff line number Diff line
@@ -140,9 +140,9 @@ struct oob_data {
	struct list_head list;
	bdaddr_t bdaddr;
	u8 hash192[16];
	u8 randomizer192[16];
	u8 rand192[16];
	u8 hash256[16];
	u8 randomizer256[16];
	u8 rand256[16];
};

#define HCI_MAX_SHORT_NAME_LENGTH	10
@@ -943,10 +943,10 @@ void hci_remote_oob_data_clear(struct hci_dev *hdev);
struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev,
					  bdaddr_t *bdaddr);
int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
			    u8 *hash, u8 *randomizer);
			    u8 *hash, u8 *rand);
int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
				u8 *hash192, u8 *randomizer192,
				u8 *hash256, u8 *randomizer256);
				u8 *hash192, u8 *rand192,
				u8 *hash256, u8 *rand256);
int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);

void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
@@ -1374,8 +1374,8 @@ void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class,
				    u8 status);
void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status);
void mgmt_read_local_oob_data_complete(struct hci_dev *hdev, u8 *hash192,
				       u8 *randomizer192, u8 *hash256,
				       u8 *randomizer256, u8 status);
				       u8 *rand192, u8 *hash256, u8 *rand256,
				       u8 status);
void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
		       u8 addr_type, u8 *dev_class, s8 rssi, u32 flags,
		       u8 *eir, u16 eir_len, u8 *scan_rsp, u8 scan_rsp_len);
+6 −6
Original line number Diff line number Diff line
@@ -299,28 +299,28 @@ struct mgmt_cp_user_passkey_neg_reply {
#define MGMT_READ_LOCAL_OOB_DATA_SIZE	0
struct mgmt_rp_read_local_oob_data {
	__u8	hash[16];
	__u8	randomizer[16];
	__u8	rand[16];
} __packed;
struct mgmt_rp_read_local_oob_ext_data {
	__u8	hash192[16];
	__u8	randomizer192[16];
	__u8	rand192[16];
	__u8	hash256[16];
	__u8	randomizer256[16];
	__u8	rand256[16];
} __packed;

#define MGMT_OP_ADD_REMOTE_OOB_DATA	0x0021
struct mgmt_cp_add_remote_oob_data {
	struct mgmt_addr_info addr;
	__u8	hash[16];
	__u8	randomizer[16];
	__u8	rand[16];
} __packed;
#define MGMT_ADD_REMOTE_OOB_DATA_SIZE	(MGMT_ADDR_INFO_SIZE + 32)
struct mgmt_cp_add_remote_oob_ext_data {
	struct mgmt_addr_info addr;
	__u8	hash192[16];
	__u8	randomizer192[16];
	__u8	rand192[16];
	__u8	hash256[16];
	__u8	randomizer256[16];
	__u8	rand256[16];
} __packed;
#define MGMT_ADD_REMOTE_OOB_EXT_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 64)

+7 −7
Original line number Diff line number Diff line
@@ -3469,7 +3469,7 @@ void hci_remote_oob_data_clear(struct hci_dev *hdev)
}

int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
			    u8 *hash, u8 *randomizer)
			    u8 *hash, u8 *rand)
{
	struct oob_data *data;

@@ -3484,10 +3484,10 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
	}

	memcpy(data->hash192, hash, sizeof(data->hash192));
	memcpy(data->randomizer192, randomizer, sizeof(data->randomizer192));
	memcpy(data->rand192, rand, sizeof(data->rand192));

	memset(data->hash256, 0, sizeof(data->hash256));
	memset(data->randomizer256, 0, sizeof(data->randomizer256));
	memset(data->rand256, 0, sizeof(data->rand256));

	BT_DBG("%s for %pMR", hdev->name, bdaddr);

@@ -3495,8 +3495,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
}

int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
				u8 *hash192, u8 *randomizer192,
				u8 *hash256, u8 *randomizer256)
				u8 *hash192, u8 *rand192,
				u8 *hash256, u8 *rand256)
{
	struct oob_data *data;

@@ -3511,10 +3511,10 @@ int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
	}

	memcpy(data->hash192, hash192, sizeof(data->hash192));
	memcpy(data->randomizer192, randomizer192, sizeof(data->randomizer192));
	memcpy(data->rand192, rand192, sizeof(data->rand192));

	memcpy(data->hash256, hash256, sizeof(data->hash256));
	memcpy(data->randomizer256, randomizer256, sizeof(data->randomizer256));
	memcpy(data->rand256, rand256, sizeof(data->rand256));

	BT_DBG("%s for %pMR", hdev->name, bdaddr);

+7 −10
Original line number Diff line number Diff line
@@ -994,8 +994,8 @@ static void hci_cc_read_local_oob_data(struct hci_dev *hdev,
	BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);

	hci_dev_lock(hdev);
	mgmt_read_local_oob_data_complete(hdev, rp->hash, rp->randomizer,
					  NULL, NULL, rp->status);
	mgmt_read_local_oob_data_complete(hdev, rp->hash, rp->rand, NULL, NULL,
					  rp->status);
	hci_dev_unlock(hdev);
}

@@ -1007,8 +1007,8 @@ static void hci_cc_read_local_oob_ext_data(struct hci_dev *hdev,
	BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);

	hci_dev_lock(hdev);
	mgmt_read_local_oob_data_complete(hdev, rp->hash192, rp->randomizer192,
					  rp->hash256, rp->randomizer256,
	mgmt_read_local_oob_data_complete(hdev, rp->hash192, rp->rand192,
					  rp->hash256, rp->rand256,
					  rp->status);
	hci_dev_unlock(hdev);
}
@@ -3996,11 +3996,9 @@ static void hci_remote_oob_data_request_evt(struct hci_dev *hdev,

			bacpy(&cp.bdaddr, &ev->bdaddr);
			memcpy(cp.hash192, data->hash192, sizeof(cp.hash192));
			memcpy(cp.randomizer192, data->randomizer192,
			       sizeof(cp.randomizer192));
			memcpy(cp.rand192, data->rand192, sizeof(cp.rand192));
			memcpy(cp.hash256, data->hash256, sizeof(cp.hash256));
			memcpy(cp.randomizer256, data->randomizer256,
			       sizeof(cp.randomizer256));
			memcpy(cp.rand256, data->rand256, sizeof(cp.rand256));

			hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_EXT_DATA_REPLY,
				     sizeof(cp), &cp);
@@ -4009,8 +4007,7 @@ static void hci_remote_oob_data_request_evt(struct hci_dev *hdev,

			bacpy(&cp.bdaddr, &ev->bdaddr);
			memcpy(cp.hash, data->hash192, sizeof(cp.hash));
			memcpy(cp.randomizer, data->randomizer192,
			       sizeof(cp.randomizer));
			memcpy(cp.rand, data->rand192, sizeof(cp.rand));

			hci_send_cmd(hdev, HCI_OP_REMOTE_OOB_DATA_REPLY,
				     sizeof(cp), &cp);
Loading