From d7be31057456ea5f7badf340f291316a6d6bc2ad Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Thu, 9 Jun 2016 22:46:07 -0400 Subject: [PATCH] I7000: Fixed COM device to work correctly. --- I7000/i7000_chan.c | 18 ++---------------- I7000/i7000_com.c | 2 +- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/I7000/i7000_chan.c b/I7000/i7000_chan.c index 690c064..ea3406d 100644 --- a/I7000/i7000_chan.c +++ b/I7000/i7000_chan.c @@ -69,20 +69,13 @@ chan_set_devs(DEVICE * dptr) for (num = sim_devices[i]->numunits; num > 0; num--) (uptr++)->flags |= UNIT_DIS; goto nextdev; - } else { - /* Set type to highest found */ - for(type = 7; type >=0; type--) - if (ctype >> type) - break; - chan_unit[chan].flags &= ~(CHAN_MODEL); - chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET; } } /* Set channel to highest type */ if ((chan_unit[chan].flags & CHAN_SET) == 0) { /* Set type to highest found */ for(type = 7; type >=0; type--) - if (ctype >> type) + if (ctype & (1 << type)) break; chan_unit[chan].flags &= ~(CHAN_MODEL); chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET; @@ -109,20 +102,13 @@ chan_set_devs(DEVICE * dptr) && num_devs[chan] != 0)) { uptr->flags |= UNIT_DIS; goto next; - } else { - /* Set type to highest found */ - for(type = 7; type >= 0; type--) - if (ctype >> type) - break; - chan_unit[chan].flags &= ~(CHAN_MODEL); - chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET; } } /* Set channel to highest type */ if ((chan_unit[chan].flags & CHAN_SET) == 0) { /* Set type to highest found */ for(type = 7; type >=0; type--) - if (ctype >> type) + if (ctype & (1 << type)) break; chan_unit[chan].flags &= ~(CHAN_MODEL); chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET; diff --git a/I7000/i7000_com.c b/I7000/i7000_com.c index e072841..542ec03 100644 --- a/I7000/i7000_com.c +++ b/I7000/i7000_com.c @@ -328,7 +328,7 @@ DEVICE com_dev = { 3, 10, 31, 1, 16, 8, &tmxr_ex, &tmxr_dep, &com_reset, NULL, &com_attach, &com_detach, - &com_dib, DEV_DIS | DEV_DISABLE| DEV_DEBUG|DEV_NET, 0, dev_debug, + &com_dib, DEV_DISABLE| DEV_DEBUG|DEV_NET, 0, dev_debug, NULL, NULL, &com_help, NULL, NULL, &com_description };