From 455a27fa3afe1d16b531f59a4e464df1afea8c73 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 10 Feb 2012 12:18:12 +0200 Subject: [PATCH] mgmt-api: Reorder parameters for read_commands It makes more sense to have the num_commands and num_events parameters in the beginning so that the message length can be validated up front. --- doc/mgmt-api.txt | 2 +- lib/mgmt.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt index e48e741be..7f679939e 100644 --- a/doc/mgmt-api.txt +++ b/doc/mgmt-api.txt @@ -49,10 +49,10 @@ Read Management Supported Commands Command Controller Index: Command Parameters: Return Parameters: Num_Of_Commands (2 Octets) + Num_Of_Events (2 Octets) Command1 (2 Octets) Command2 (2 Octets) ... - Num_Of_Events (2 Octets) Event1 (2 Octets) Event2 (2 Octets) ... diff --git a/lib/mgmt.h b/lib/mgmt.h index 3d40f3bff..37e63c8ed 100644 --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -53,9 +53,8 @@ struct mgmt_rp_read_version { #define MGMT_OP_READ_COMMANDS 0x0002 struct mgmt_rp_read_commands { uint16_t num_commands; - uint16_t commands[0]; uint16_t num_events; - uint16_t events[0]; + uint16_t opcodes[0]; } __packed; #define MGMT_OP_READ_INDEX_LIST 0x0003 -- 2.47.3