summaryrefslogtreecommitdiff
path: root/xpp/utils/fpga_load.c
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-18 14:31:07 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-18 14:31:07 +0000
commitcfd61537b47387b0fb5c8228baad6cec16d8f6e6 (patch)
tree108deea65c09c7c273a9b981f8783efcd433eaea /xpp/utils/fpga_load.c
parent4391b4a6ee42bdfd8e097c5ee5485e9eb13f19a0 (diff)
xpp r5151:
* xpd_pri: Basically ready. * PCM synchronization changes: - Each Astribank unit ticks independently. Each with its own PLL. - HOST synchronization is gone. Loading of xpp will no longer cause useless 250 ticks per second if you have no Astribank. - Synchronization from the zaptel sync master requires setting ZAPTEL as sync source (xpp_sync ZAPTEL). * rx_tasklet is now a parameter of the module xpp, rather than of xpp_usb. * New FPGA firmware: 5128 (1151) / 5122 (1141, 1131): - Fixes synchronization issues. - PRI module: E1 should now work. * perl module and utilities: - Modules no longer magically scan system on initialization. - Scanning is by calling explicit methods. - "Serial" has been renamed "Label". It is basically unique, but should be modifieble. - Some basic documentation of zaptel perl modules. * Default sort order of zt_registration is back to SORT_CONNCTOR. * zt_registration proc file now shows the number of span registered to if registered. Try: grep . /proc/xpp/XBUS-*/XPD-*/zt_registration * genzaptelconf: Allow using a custom command instead of /etc/init.d/asterisk to start/stop asterisk. * Fixed the typo "Slagish". git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3506 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/utils/fpga_load.c')
-rw-r--r--xpp/utils/fpga_load.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/xpp/utils/fpga_load.c b/xpp/utils/fpga_load.c
index e28f9a8..92e3c33 100644
--- a/xpp/utils/fpga_load.c
+++ b/xpp/utils/fpga_load.c
@@ -32,7 +32,7 @@ static char *progname;
#define MAX_HEX_LINES 10000
#define PACKET_SIZE 512
#define EEPROM_SIZE 16
-#define SERIAL_SIZE 8
+#define LABEL_SIZE 8
#define TIMEOUT 5000
@@ -99,7 +99,7 @@ struct myeeprom {
uint8_t release_major;
uint8_t release_minor;
uint8_t reserved;
- uint8_t serial[SERIAL_SIZE];
+ uint8_t label[LABEL_SIZE];
} PACKED;
struct fpga_packet_header {
@@ -255,12 +255,12 @@ void my_usb_device_cleanup(struct my_usb_device *mydev, const struct astribank_t
static void show_device_info(const struct my_usb_device *mydev)
{
const struct myeeprom *eeprom;
- uint8_t data[SERIAL_SIZE + 1];
+ uint8_t data[LABEL_SIZE + 1];
assert(mydev != NULL);
eeprom = &mydev->eeprom;
- memset(data, 0, SERIAL_SIZE + 1);
- memcpy(data, eeprom->serial, SERIAL_SIZE);
+ memset(data, 0, LABEL_SIZE + 1);
+ memcpy(data, eeprom->label, LABEL_SIZE);
printf("USB Firmware Type: [%s]\n", mydev->abtype->name);
printf("USB iManufacturer: [%s]\n", mydev->iManufacturer);
printf("USB iProduct: [%s]\n", mydev->iProduct);
@@ -269,7 +269,7 @@ static void show_device_info(const struct my_usb_device *mydev)
printf("EEPROM Vendor: 0x%04X\n", eeprom->vendor);
printf("EEPROM Product: 0x%04X\n", eeprom->product);
printf("EEPROM Release: %d.%03d\n", eeprom->release_major, eeprom->release_minor);
- printf("EEPROM Serial: HEX(%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X) [%s]\n",
+ printf("EEPROM Label: HEX(%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X) [%s]\n",
data[0], data[1], data[2], data[3],
data[4], data[5], data[6], data[7], data);
}
@@ -695,7 +695,7 @@ void usage()
fprintf(stderr, "\t\t[-V vendorid] # Set Vendor id on device\n");
fprintf(stderr, "\t\t[-P productid] # Set Product id on device\n");
fprintf(stderr, "\t\t[-R release] # Set Release. 2 dot separated decimals\n");
- fprintf(stderr, "\t\t[-S serial] # Set Serial. 8 comma separated numbers\n");
+ fprintf(stderr, "\t\t[-L label] # Set label.\n");
#endif
exit(1);
}
@@ -715,7 +715,7 @@ static void eeprom_fill(struct myeeprom *myeeprom,
const char vendor[],
const char product[],
const char release[],
- const char serial[],
+ const char label[],
const char source[])
{
// FF: address source is from device. C0: from eeprom
@@ -735,10 +735,10 @@ static void eeprom_fill(struct myeeprom *myeeprom,
myeeprom->release_major = release_major;
myeeprom->release_minor = release_minor;
}
- if(serial) {
+ if(label) {
/* padding */
- memset(myeeprom->serial, 0, SERIAL_SIZE);
- memcpy(myeeprom->serial, serial, strlen(serial));
+ memset(myeeprom->label, 0, LABEL_SIZE);
+ memcpy(myeeprom->label, label, strlen(label));
}
}
#endif
@@ -763,7 +763,7 @@ int main(int argc, char *argv[])
char *source = NULL;
char *product = NULL;
char *release = NULL;
- char *serial = NULL;
+ char *label = NULL;
const char options[] = "rib:D:ghH:I:vw:C:V:P:R:S:";
#else
const char options[] = "rib:D:ghH:I:vw:";
@@ -828,22 +828,22 @@ int main(int argc, char *argv[])
release = optarg;
break;
case 'S':
- serial = optarg;
+ label = optarg;
{
const char GOOD_CHARS[] =
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"0123456789"
"-_.";
- int len = strlen(serial);
- int goodlen = strspn(serial, GOOD_CHARS);
+ int len = strlen(label);
+ int goodlen = strspn(label, GOOD_CHARS);
- if(len > SERIAL_SIZE) {
- ERR("Serial number too long (%d > %d)\n", len, SERIAL_SIZE);
+ if(len > LABEL_SIZE) {
+ ERR("Label too long (%d > %d)\n", len, LABEL_SIZE);
usage();
}
if(goodlen != len) {
- ERR("Bad character in serial number (pos=%d)\n", goodlen);
+ ERR("Bad character in label number (pos=%d)\n", goodlen);
usage();
}
}
@@ -867,7 +867,7 @@ int main(int argc, char *argv[])
}
if(inhexfile) {
#ifdef XORCOM_INTERNAL
- if(vendor || product || release || serial || source ) {
+ if(vendor || product || release || label || source ) {
ERR("The -I option is exclusive of -[VPRSC]\n");
return 1;
}
@@ -896,7 +896,7 @@ int main(int argc, char *argv[])
}
}
#ifdef XORCOM_INTERNAL
- else if(vendor || product || release || serial || source ) {
+ else if(vendor || product || release || label || source ) {
if(outhexfile) {
FILE *fp;
@@ -907,7 +907,7 @@ int main(int argc, char *argv[])
return 1;
}
memset(&mydev.eeprom, 0, sizeof(struct myeeprom));
- eeprom_fill(&mydev.eeprom, vendor, product, release, serial, source);
+ eeprom_fill(&mydev.eeprom, vendor, product, release, label, source);
gen_hexline((uint8_t *)&mydev.eeprom, 0, sizeof(mydev.eeprom), fp);
gen_hexline(NULL, 0, 0, fp); /* EOF */
return 0;
@@ -935,8 +935,8 @@ int main(int argc, char *argv[])
goto dev_err;
}
#ifdef XORCOM_INTERNAL
- if(vendor || product || release || serial || source ) {
- eeprom_fill(&mydev.eeprom, vendor, product, release, serial, source);
+ if(vendor || product || release || label || source ) {
+ eeprom_fill(&mydev.eeprom, vendor, product, release, label, source);
opt_write_eeprom = 1;
opt_read_eeprom = 1;
}