Compare commits

..

1 Commits

Author SHA1 Message Date
Daniel Willmann 70df7678f8 Wait a little longer for the erase to complete
Sometimes the erase operation would timeout, but the new MAC address was
still written:

$ /usr/sbin/rtl8168-eeprom -s 2:0 -m 00:0d:b9:4f:0f:7d
failed: 1

initializing pci access
building filter
starting bus iteration
found matching device (02:00.0), base_addr=0xf7c00000 (len=0)
Existing/Old MAC address: 00:0d:b9:4f:0f:7d
Saving EEPROM backup to 000DB94F0F7D.backup
Writing new MAC address 00:0d:b9:4f:0f:7d...
timeout during ERASE
Error during EEPROM WRITE, MAC address is corrupt!
2019-09-24 09:42:27 +02:00
9 changed files with 3 additions and 69 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
/rtl8168-eeprom
/rtl8168-eeprom.o

18
debian/changelog vendored
View File

@ -1,18 +0,0 @@
rtl8168-eeprom (1.0.2) unstable; urgency=medium
* Query PCI_FILL_{BASES,SIZES} in pci_fill_info too
-- Oliver Smith <osmith@sysmocom.de> Mon, 16 May 2022 14:05:15 +0200
rtl8168-eeprom (1.0.1) unstable; urgency=medium
* Fix missing pci_fill_info()
* Exit with error if no device was found
-- Oliver Smith <osmith@sysmocom.de> Mon, 16 May 2022 10:49:48 +0200
rtl8168-eeprom (1.0.0) unstable; urgency=medium
* Initial debian packaging.
-- Oliver Smith <osmith@sysmocom.de> Mon, 09 May 2022 16:28:19 +0200

1
debian/compat vendored
View File

@ -1 +0,0 @@
10

14
debian/control vendored
View File

@ -1,14 +0,0 @@
Source: rtl8168-eeprom
Section: devel
Priority: optional
Maintainer: Oliver Smith <osmith@sysmocom.de>
Standards-Version: 4.5.0
Build-Depends: debhelper (>= 10),
gcc,
libpci-dev,
pkg-config
Homepage: https://gitea.sysmocom.de/sysmocom/rtl8168-eeprom
Package: rtl8168-eeprom
Architecture: any
Description: Tool to set MAC address in EEPROM of RTL8168/8111E devices

23
debian/copyright vendored
View File

@ -1,23 +0,0 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rtl8168-eeprom
Files: *
Copyright: Copyright 2015 Harald Welte <hwelte@sysmocom.de>
License: GPL-2+
License: GPL-2+
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
.
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
`/usr/share/common-licenses/GPL-2'.

View File

@ -1 +0,0 @@
/rtl8168-eeprom /usr/bin/

4
debian/rules vendored
View File

@ -1,4 +0,0 @@
#!/usr/bin/make -f
%:
dh $@

View File

@ -1 +0,0 @@
3.0 (native)

View File

@ -294,13 +294,13 @@ int at93c46_op_write(struct pci_dev *d, uint8_t addr, uint16_t data)
return 0;
}
/* endable write access */
/* enable write access */
int at93c46_op_ewen(struct pci_dev *d)
{
return at93c46_op(d, AT93_OP_MISC, 0x30, 0);
}
/* endable write access */
/* erase a word */
int at93c46_op_erase(struct pci_dev *d, uint8_t addr)
{
int i, rc;
@ -317,6 +317,7 @@ int at93c46_op_erase(struct pci_dev *d, uint8_t addr)
//rc = rtlspi_xceive_bit(d, 0);
if (rc == 1)
break;
rtlspi_delay();
}
rtlspi_pin_set(d, RTLSPI_CS, 0);
@ -466,7 +467,6 @@ static void iterate_devices(struct pci_access *pa, char *filter_id, char *filter
continue;
/* our own clumsy implementation of filtering */
pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_SIZES);
if (p->vendor_id != 0x10ec || p->device_id != 0x8168)
continue;
@ -498,8 +498,6 @@ static void iterate_devices(struct pci_access *pa, char *filter_id, char *filter
if (new_mac)
exit(0);
}
die("no matching device found!\n");
}
int main(int argc, char **argv)