[Skiboot] [PATCH] hw/bt: allow BT driver to use different buffer size

Cédric Le Goater clg at fr.ibm.com
Wed Jan 6 20:57:13 AEDT 2016


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 at fr.ibm.com>
---

 Tested on palmetto which uses a 64bytes fifo and qemu which uses
 255bytes.
 
 hw/bt.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Index: skiboot.git/hw/bt.c
===================================================================
--- skiboot.git.orig/hw/bt.c
+++ skiboot.git/hw/bt.c
@@ -164,16 +164,14 @@ static void get_bt_caps_complete(struct
 		goto out;
 	}
 
-	if (msg->data[1] + 1 != BT_FIFO_LEN) {
+	if (msg->data[1] != BT_FIFO_LEN) {
 		BT_DBG("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) {
 		BT_DBG("Got a output buffer len (%u) cap which differs from the default\n",
 				msg->data[2]);
-		goto out;
 	}
 
 	/*



More information about the Skiboot mailing list