diff options
author | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2006-06-14 19:46:44 +0000 |
---|---|---|
committer | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2006-06-14 19:46:44 +0000 |
commit | 0e95f6a22ad464b7493135c701b722e551d37900 (patch) | |
tree | 961b2c489c7b3890a2947fab100341ced49d49c0 | |
parent | b4c7e5000a71fff560ea6b4620c47d3f9eba4602 (diff) |
fix tx chaining
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1824 e0336214-984f-0b4b-a45f-81c69e1f0ede
-rw-r--r-- | src/rfid_proto_tcl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/rfid_proto_tcl.c b/src/rfid_proto_tcl.c index 66f1edd..b7577e3 100644 --- a/src/rfid_proto_tcl.c +++ b/src/rfid_proto_tcl.c @@ -517,11 +517,6 @@ tcl_transceive(struct rfid_protocol_handle *h, unsigned char ack[10]; unsigned int ack_len; - if (tx_len > max_net_tx_framesize(th)) { - /* slow path: we need to use chaining */ - return -1; - } - tx_buf = malloc(tcl_prlg_len(th) + tx_len); if (!tx_buf) { ret = -ENOMEM; @@ -546,6 +541,12 @@ tcl_transceive(struct rfid_protocol_handle *h, _rx_len = *rx_len; *rx_len = 0; + + if (_tx_len > max_net_tx_framesize(th)+prlg_len) { + /* slow path: we need to use chaining */ + _tx_len = max_net_tx_framesize(th)+prlg_len; + } + do_tx: ret = rfid_layer2_transceive(h->l2h, l2_to_frame(h->l2h->l2->id), _tx, _tx_len, |