~ubuntu-branches/ubuntu/quantal/zaptel/quantal

« back to all changes in this revision

Viewing changes to xpp/utils/fpga_load.c

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2006-10-24 22:41:01 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20061024224101-464p4n2jk16n1jrh
Tags: 1:1.2.10.dfsg-2
* bristuff-0.3.0-PRE-1v
* Remove redundant GPL LICENCE text

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#include <usb.h>
9
9
#include "hexfile.h"
10
10
 
11
 
static const char rcsid[] = "$Id: fpga_load.c 1212 2006-07-08 00:43:31Z tzafrir $";
 
11
static const char rcsid[] = "$Id: fpga_load.c 1457 2006-09-09 15:24:12Z tzafrir $";
12
12
 
13
13
#define ERR(fmt, arg...)        fprintf(stderr, "%s: ERROR: " fmt, progname, ## arg)
14
14
#define INFO(fmt, arg...)       fprintf(stderr, "%s: " fmt, progname, ## arg)
313
313
        phead->d.data_packet.seq = seq;
314
314
        phead->d.data_packet.reserved = 0x00;
315
315
        memcpy(phead->d.data_packet.data, data, len);
316
 
        len += sizeof(phead);
 
316
        len += sizeof(hexline->d.content.header);
317
317
        if(verbose >= LOG_INFO)
318
318
                INFO("%04d+\r", seq);
319
319
        ret = usb_bulk_write(handle, MY_EP_OUT, (char *)phead, len, TIMEOUT);
324
324
                ERR("usb: bulk_write short write (%d)\n", ret);
325
325
                return -EFAULT;
326
326
        }
 
327
        if (verbose >= LOG_DEBUG)
 
328
                dump_packet((char*)phead, len);
327
329
        ret = usb_bulk_read(handle, MY_EP_IN, buf, sizeof(buf), TIMEOUT);
328
330
        if(ret < 0) {
329
331
                ERR("usb: bulk_read failed (%d)\n", ret);
577
579
        fprintf(stderr, "\t\t[-d]               # Get device version from eeprom\n");
578
580
        fprintf(stderr, "\t\t[-I <hexfile>]     # Input from <hexfile>\n");
579
581
        fprintf(stderr, "\t\t[-g]               # Get eeprom from device\n");
 
582
#ifdef XORCOM_INTERNAL
580
583
        fprintf(stderr, "\t\t[-C srC byte]      # Set Address sourCe (default: C0)\n");
581
584
        fprintf(stderr, "\t\t[-V vendorid]      # Set Vendor id on device\n");
582
585
        fprintf(stderr, "\t\t[-P productid]     # Set Product id on device\n");
583
586
        fprintf(stderr, "\t\t[-R release]       # Set Release. 2 dot separated decimals\n");
584
587
        fprintf(stderr, "\t\t[-S serial]        # Set Serial. 8 comma separated numbers\n");
 
588
#endif
585
589
        exit(1);
586
590
}
587
591