aboutsummaryrefslogtreecommitdiff
path: root/hw/bt.c
diff options
context:
space:
mode:
authorCédric Le Goater <clg@fr.ibm.com>2016-01-06 10:57:13 +0100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-03-08 19:13:34 +1100
commit4eb9807b63330ff85b0b02213a2a44f84b31095e (patch)
tree60496500c1700f09dfe72d6037c42ae6b87a1ded /hw/bt.c
parent2fb8d518ce8bd2b1a23f3513f28ee02968fdbda4 (diff)
downloadskiboot-4eb9807b63330ff85b0b02213a2a44f84b31095e.zip
skiboot-4eb9807b63330ff85b0b02213a2a44f84b31095e.tar.gz
skiboot-4eb9807b63330ff85b0b02213a2a44f84b31095e.tar.bz2
hw/bt: allow BT driver to use different buffer size
The buffer size used by the BT driver defaults to 64bytes even when the BMC reports a different size. This patch removes the restriction as there is no apparent reason for it. The extra byte added on the input and output buffer size in the test also seems superfluous. The buffer lengths used later in the code are correct as they take into account the extra byte needed for the message size : bt.caps.input_buf_len = msg->data[1] + 1; bt.caps.output_buf_len = msg->data[2] + 1; >From IPMI Specs: 22.10 Get BT Interface Capabilities Command For Bytes 3 and 4 (Input and Output Buffer size), the buffer message size is the largest value allowed in first byte (length field) of any BT request or response message. For a send, this means if Get BT Interface Capabilities returns 255 in byte 3 (input buffer size) the driver can actually write 256 bytes to the input buffer (adding one for the length byte (byte 1) that is sent in with the request.) Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/bt.c')
-rw-r--r--hw/bt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/bt.c b/hw/bt.c
index ca8bd1e..0c75ef5 100644
--- a/hw/bt.c
+++ b/hw/bt.c
@@ -164,16 +164,14 @@ static void get_bt_caps_complete(struct ipmi_msg *msg)
goto out;
}
- if (msg->data[1] + 1 != BT_FIFO_LEN) {
+ if (msg->data[1] != BT_FIFO_LEN) {
prlog(PR_DEBUG, "Got a input buffer len (%u) cap which differs from the default\n",
msg->data[1]);
- goto out;
}
- if (msg->data[2] + 1 != BT_FIFO_LEN) {
+ if (msg->data[2] != BT_FIFO_LEN) {
prlog(PR_DEBUG, "Got a output buffer len (%u) cap which differs from the default\n",
msg->data[2]);
- goto out;
}
/*