From 9c8edf8fd4b4bb42f5911f7a8240686a69077f80 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 27 Feb 2018 12:05:07 -0800 Subject: mpm: Update EEPROM tools to allow setting PID Default behaviour is to fall back to writing the N310 PID (0x4242). Reviewed-by: Moritz Fischer --- mpm/tools/eeprom-id.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'mpm/tools/eeprom-id.c') 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 #include +#include #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)); -- cgit v1.2.3