diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-07-01 20:56:27 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-07-02 10:52:09 +0200 |
commit | 9f21df049144d3f4244b24e789c9820ca631379e (patch) | |
tree | 72071e7b4f07f844fa34ce3c48aa508914a3e1eb /src/osmo-bts-sysmo/misc/sysmobts_eeprom.h | |
parent | befb0dde93181b4ba43e5e63e01db085162a445a (diff) |
sysmobts: Store a simple network config in the EEPROM as well
Make it possible to store:
* Static vs. DHCP mode
* IPv4 address
* Netmask
* GW IPv4 address
* DNS IPv4 address
Add a simple CRC8 and pick 0xFF as initial value so an all
zero EEPROM will not generate a 0 CRC. The code tries to
differentiate exit code between unreadable EEPROM and CRC error.
This is a reference to see if we want to have store it in the
EEPROM or not.
Change-Id: Ia7c59506d9f6e4cb6acd4bb0e198abd28a90f50f
Diffstat (limited to 'src/osmo-bts-sysmo/misc/sysmobts_eeprom.h')
-rw-r--r-- | src/osmo-bts-sysmo/misc/sysmobts_eeprom.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h index 782f7568..97344f37 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h +++ b/src/osmo-bts-sysmo/misc/sysmobts_eeprom.h @@ -3,6 +3,14 @@ #include <stdint.h> +struct sysmobts_net_cfg { + uint8_t mode; /* 0 */ + uint32_t ip; /* 1 - 4 */ + uint32_t mask; /* 5 - 8 */ + uint32_t gw; /* 9 - 12 */ + uint32_t dns; /* 13 - 16 */ +} __attribute__((packed)); + struct sysmobts_eeprom { /* offset */ uint8_t eth_mac[6]; /* 0-5 */ uint8_t _pad0[10]; /* 6-15 */ @@ -17,13 +25,7 @@ struct sysmobts_eeprom { /* offset */ uint8_t trx_nr; /* 36 */ uint8_t boot_state[48]; /* 37-84 */ uint8_t _pad1[18]; /* 85-102 */ - struct { - uint8_t mode; /* 103 */ - uint32_t ip; /* 104 - 107 */ - uint32_t mask; /* 108 - 111 */ - uint32_t gw; /* 112 - 115 */ - uint32_t dns; /* 116 - 119 */ - } __attribute__((packed)) net_cfg; + struct sysmobts_net_cfg net_cfg;/* 103-119 */ uint8_t crc; /* 120 */ uint8_t gpg_key[128]; /* 121-249 */ } __attribute__((packed)); |