Fix final bugs in the driver so all finally flows through the stack

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24127 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Ruiz Dorantes
2008-02-25 20:29:55 +00:00
parent d7ef4babbb
commit 3b260549b4
@@ -60,7 +60,7 @@ assembly_rx(bt_usb_dev* bdev, bt_packet_t type, void *data, int count)
if ( (type != BT_EVENT && nbuf == NULL) ||
(type == BT_EVENT && snb_completed(snbuf)) ) {
(type == BT_EVENT && (snbuf == NULL || snb_completed(snbuf))) ) {
/* new buffer incoming */
switch (type) {
@@ -121,7 +121,7 @@ assembly_rx(bt_usb_dev* bdev, bt_packet_t type, void *data, int count)
}
else {
/* Continuation */
if (type == BT_EVENT)
if (type != BT_EVENT)
currentPacketLen = get_expected_size(nbuf) - nbuf->size;
else
currentPacketLen = snb_remaining_to_put(snbuf);
@@ -138,17 +138,16 @@ assembly_rx(bt_usb_dev* bdev, bt_packet_t type, void *data, int count)
if (type == BT_EVENT && snb_completed(snbuf)) {
flowf("Frame goes up!\n");
snbuf = bdev->eventRx = NULL;
post_packet_up(bdev, type, snbuf);
snbuf = bdev->eventRx = NULL;
}
if (type != BT_EVENT && (get_expected_size(nbuf) - nbuf->size) == 0 ) {
flowf("Frame goes up!\n");
bdev->nbufferRx[type] = nbuf = NULL;
post_packet_up(bdev, type, nbuf);
bdev->nbufferRx[type] = nbuf = NULL;
}
/* in case in the pipe there is info about the next buffer ... */