summaryrefslogtreecommitdiffstats
path: root/juju
diff options
context:
space:
mode:
authorGravatar Kristian Høgsberg 2007-04-12 14:11:48 -0400
committerGravatar Kristian Høgsberg 2007-04-12 14:11:48 -0400
commit7096501f0d4d40ad4df67e250e66e3db16de2832 (patch)
treeab179f22ea7745eb92c0d6fb27d6c03ee933d2e9 /juju
parentWrap receive tail pointer correctly. (diff)
Use power-of-two max packet sizes.
Diffstat (limited to '')
-rw-r--r--juju/raw1394-iso.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/juju/raw1394-iso.c b/juju/raw1394-iso.c
index 06ece9a..a320440 100644
--- a/juju/raw1394-iso.c
+++ b/juju/raw1394-iso.c
@@ -327,6 +327,18 @@ int raw1394_iso_recv_flush(raw1394handle_t handle)
return 0;
}
+static unsigned int
+round_to_power_of_two(unsigned int value)
+{
+ unsigned int pot;
+
+ pot = 1;
+ while (pot < value)
+ pot <<= 1;
+
+ return pot;
+}
+
static int
iso_init(raw1394handle_t handle, int type,
raw1394_iso_xmit_handler_t xmit_handler,
@@ -366,7 +378,7 @@ iso_init(raw1394handle_t handle, int type,
handle->iso.xmit_handler = xmit_handler;
handle->iso.recv_handler = recv_handler;
handle->iso.buf_packets = buf_packets;
- handle->iso.max_packet_size = max_packet_size;
+ handle->iso.max_packet_size = round_to_power_of_two(max_packet_size);
handle->iso.packet_phase = 0;
handle->iso.packet_count = 0;
handle->iso.packets =
6:10:31 -0700'>2021-07-26updatesGravatar John Cowan 1-2/+4 2021-07-26dtd always first argumentGravatar John Cowan 1-9/+9 2021-07-26DTO to DTDGravatar John Cowan 1-55/+52 2021-07-26typoGravatar John Cowan 1-1/+1 2021-07-26switching to explicit dtosGravatar John Cowan 1-88/+102 2021-07-26errorsGravatar John Cowan 1-1/+4 2021-07-26more MN-W reviewGravatar John Cowan 1-5/+5 2021-07-26update preview linkGravatar John Cowan 1-1/+1 2021-07-26MN-W reviewGravatar John Cowan 1-6/+6 2021-07-26paired mutatorsGravatar John Cowan 1-43/+68 2021-07-25exceptionsGravatar John Cowan 1-1/+15 2021-07-25new exampleGravatar John Cowan 1-1/+4 2021-07-25updatesGravatar John Cowan 1-2/+4 2021-07-24dtd always first argumentGravatar John Cowan 1-9/+9 2021-07-23DTO to DTDGravatar John Cowan 1-55/+52 2021-07-22typoGravatar John Cowan 1-1/+1 2021-07-22switching to explicit dtosGravatar John Cowan 1-88/+102 2021-07-22errorsGravatar John Cowan 1-1/+4 2021-07-22more MN-W reviewGravatar John Cowan 1-5/+5 2021-07-20update preview linkGravatar John Cowan 1-1/+1 2021-07-20MN-W reviewGravatar John Cowan 1-6/+6 2021-07-18Fix typo.Gravatar Arthur A. Gleckler 2-4/+4 2021-07-18Add <p> around abstract.Gravatar Arthur A. Gleckler 1-2/+2 2021-07-18Publish first draft.draft-1Gravatar Arthur A. Gleckler 3-0/+114 2021-07-18Ignore trailing whitespace.Gravatar Arthur A. Gleckler 11-129/+129 2021-07-18Ignore "Dictionaries.log".Gravatar Arthur A. Gleckler 1-1/+2 2021-07-18Fix errors reported by W3C HTML Validator.Gravatar Arthur A. Gleckler 1-27/+27 2021-07-18Eliminate unnecessary redirect by using TLS/SSL.Gravatar Arthur A. Gleckler 1-1/+1