Browse Source

Some tweaks to reporting and logging.

- Adding fpga number to the ztex string representation
- Removing usb details from the ztex string representation
- First frequency set no longer reports a bogus old freq
nfactor-troky
nelisky 13 years ago
parent
commit
ed60e33a94
  1. 8
      driver-ztex.c
  2. 4
      libztex.c
  3. 2
      libztex.h

8
driver-ztex.c

@ -90,6 +90,7 @@ static void ztex_detect(void) @@ -90,6 +90,7 @@ static void ztex_detect(void)
ztex->threads = 1;
ztex_slave->fpgaNum = j;
ztex_slave->root = ztex_devices[i]->dev;
ztex_slave->repr[strlen(ztex_slave->repr) - 1] = ('1' + j);
add_cgpu(ztex);
}
@ -346,7 +347,7 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work, @@ -346,7 +347,7 @@ static uint64_t ztex_scanhash(struct thr_info *thr, struct work *work,
static void ztex_statline_before(char *buf, struct cgpu_info *cgpu)
{
if (cgpu->deven == DEV_ENABLED) {
tailsprintf(buf, "%s | ", cgpu->device_ztex->snString);
tailsprintf(buf, "%s-%d | ", cgpu->device_ztex->snString, cgpu->device_ztex->fpgaNum+1);
tailsprintf(buf, "%0.2fMhz | ", cgpu->device_ztex->freqM1 * (cgpu->device_ztex->freqM + 1));
}
}
@ -364,8 +365,9 @@ static bool ztex_prepare(struct thr_info *thr) @@ -364,8 +365,9 @@ static bool ztex_prepare(struct thr_info *thr)
if (libztex_configureFpga(ztex) != 0)
return false;
ztex_releaseFpga(ztex);
ztex->freqM = -1;
ztex_updateFreq(ztex);
ztex->freqM = ztex->freqMaxM+1;;
//ztex_updateFreq(ztex);
libztex_setFreq(ztex, ztex->freqMDefault);
applog(LOG_DEBUG, "%s: prepare", ztex->repr);
return true;
}

4
libztex.c

@ -381,7 +381,7 @@ int libztex_setFreq(struct libztex_device *ztex, uint16_t freq) { @@ -381,7 +381,7 @@ int libztex_setFreq(struct libztex_device *ztex, uint16_t freq) {
return cnt;
}
ztex->freqM = freq;
if (oldfreq == -1)
if (oldfreq > ztex->freqMaxM)
applog(LOG_WARNING, "%s: Frequency set to %0.2f Mhz",
ztex->repr, ztex->freqM1 * (ztex->freqM + 1));
else
@ -535,7 +535,7 @@ int libztex_prepare_device(struct libusb_device *dev, struct libztex_device** zt @@ -535,7 +535,7 @@ int libztex_prepare_device(struct libusb_device *dev, struct libztex_device** zt
newdev->usbbus = libusb_get_bus_number(dev);
newdev->usbaddress = libusb_get_device_address(dev);
sprintf(newdev->repr, "ZTEX %.3d:%.3d-%s", newdev->usbbus, newdev->usbaddress, newdev->snString);
sprintf(newdev->repr, "ZTEX %s-1", newdev->snString);
newdev->valid = true;
return 0;
}

2
libztex.h

@ -78,7 +78,7 @@ struct libztex_device { @@ -78,7 +78,7 @@ struct libztex_device {
int selectedFpga;
bool parallelConfigSupport;
char repr[64];
char repr[20];
};
struct libztex_dev_list {

Loading…
Cancel
Save