core,bindings: Allow bindings to specify packet size

Currently, we fix all packet sizes to the baseline MTU size. However,
bindings may support larger packet sizes.

This change makes the packet allocator use binding-specific parameters
to suit the binding itself, and uses the max packet size in the
packetisation path.

Since packet sizes may now exceed 255, we change the size and offset
types from uint8_t to size_t.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Change-Id: Ica932479f251dc33c67ea19e9e3e5a193cbe0b32
diff --git a/astlpc.c b/astlpc.c
index 5218c92..616ed1d 100644
--- a/astlpc.c
+++ b/astlpc.c
@@ -178,12 +178,12 @@
 		return;
 	}
 
-	if (len > MCTP_MTU + sizeof(struct mctp_hdr)) {
+	if (len > astlpc->binding.pkt_size) {
 		mctp_prwarn("invalid RX len 0x%x", len);
 		return;
 	}
 
-	pkt = mctp_pktbuf_alloc(len);
+	pkt = mctp_pktbuf_alloc(&astlpc->binding, len);
 	if (!pkt)
 		goto out_complete;
 
@@ -335,6 +335,8 @@
 	astlpc->binding.name = "astlpc";
 	astlpc->binding.version = 1;
 	astlpc->binding.tx = mctp_binding_astlpc_tx;
+	astlpc->binding.pkt_size = MCTP_BMTU;
+	astlpc->binding.pkt_pad = 0;
 
 	rc = mctp_astlpc_init_lpc(astlpc);
 	if (rc) {