aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/tools/eeprom-id.c
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-02-27 12:05:07 -0800
committerMartin Braun <martin.braun@ettus.com>2018-03-05 15:56:41 -0800
commit9c8edf8fd4b4bb42f5911f7a8240686a69077f80 (patch)
tree14ee1e4c06dd497f3fd6d63e02cb3ecad74d7b27 /mpm/tools/eeprom-id.c
parent7fa1f6ed0726ff0f908245e43a01f50620293e8d (diff)
downloaduhd-9c8edf8fd4b4bb42f5911f7a8240686a69077f80.tar.gz
uhd-9c8edf8fd4b4bb42f5911f7a8240686a69077f80.tar.bz2
uhd-9c8edf8fd4b4bb42f5911f7a8240686a69077f80.zip
mpm: Update EEPROM tools to allow setting PID
Default behaviour is to fall back to writing the N310 PID (0x4242). Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
Diffstat (limited to 'mpm/tools/eeprom-id.c')
-rw-r--r--mpm/tools/eeprom-id.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mpm/tools/eeprom-id.c b/mpm/tools/eeprom-id.c
index 0b2c78f26..151b38aff 100644
--- a/mpm/tools/eeprom-id.c
+++ b/mpm/tools/eeprom-id.c
@@ -1,17 +1,23 @@
//
-// Copyright 2017 Ettus Research, a National Instruments Company
+// Copyright 2017-2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#include <stdio.h>
#include <stdlib.h>
+#include <arpa/inet.h>
#include "eeprom.h"
+#define N310_PID 0x4242
+#define N300_PID 0x4240
+
static void usrp_sulfur_eeprom_print_id(struct usrp_sulfur_eeprom *ep)
{
- if (ep->pid == 0x4242)
+ if (ntohs(ep->pid) == N310_PID)
printf("product=ni,n310-rev%x\n", ntohs(ep->rev)+1);
+ else if (ntohs(ep->pid) == N300_PID)
+ printf("product=ni,n300-rev%x\n", ntohs(ep->rev)+1);
else
printf("product=unknown-(%04x)\n", ntohs(ep->pid));