36#ifndef __DC_FLASHROM_H
37#define __DC_FLASHROM_H
54#define FLASHROM_PT_SYSTEM 0
55#define FLASHROM_PT_RESERVED 1
56#define FLASHROM_PT_BLOCK_1 2
57#define FLASHROM_PT_SETTINGS 3
58#define FLASHROM_PT_BLOCK_2 4
67#define FLASHROM_B1_SYSCFG 0x05
68#define FLASHROM_B1_PW_SETTINGS_1 0x80
69#define FLASHROM_B1_PW_SETTINGS_2 0x81
70#define FLASHROM_B1_PW_SETTINGS_3 0x82
71#define FLASHROM_B1_PW_SETTINGS_4 0x83
72#define FLASHROM_B1_PW_SETTINGS_5 0x84
73#define FLASHROM_B1_PW_PPP1 0xC0
74#define FLASHROM_B1_PW_PPP2 0xC1
75#define FLASHROM_B1_PW_DNS 0xC2
76#define FLASHROM_B1_PW_EMAIL1 0xC3
77#define FLASHROM_B1_PW_EMAIL2 0xC4
78#define FLASHROM_B1_PW_EMAIL_PROXY 0xC5
79#define FLASHROM_B1_DK_PPP1 0xC6
80#define FLASHROM_B1_DK_PPP2 0xC7
81#define FLASHROM_B1_DK_DNS 0xC8
82#define FLASHROM_B1_IP_SETTINGS 0xE0
83#define FLASHROM_B1_EMAIL 0xE2
84#define FLASHROM_B1_SMTP 0xE4
85#define FLASHROM_B1_POP3 0xE5
86#define FLASHROM_B1_POP3LOGIN 0xE6
87#define FLASHROM_B1_POP3PASSWD 0xE7
88#define FLASHROM_B1_PPPLOGIN 0xE8
89#define FLASHROM_B1_PPPPASSWD 0xE9
90#define FLASHROM_B1_PPPMODEM 0xEB
93#define FLASHROM_OFFSET_CRC 62
100#define FLASHROM_ERR_NONE 0
101#define FLASHROM_ERR_NOT_FOUND -1
102#define FLASHROM_ERR_NO_PARTITION -2
103#define FLASHROM_ERR_READ_PART -3
104#define FLASHROM_ERR_BAD_MAGIC -4
105#define FLASHROM_ERR_BOGUS_PART -5
106#define FLASHROM_ERR_NOMEM -6
107#define FLASHROM_ERR_READ_BITMAP -7
108#define FLASHROM_ERR_EMPTY_PART -8
109#define FLASHROM_ERR_READ_BLOCK -9
126int flashrom_info(uint32_t part_id, uint32_t *start_offset,
size_t *size_out);
205#define FLASHROM_LANG_JAPANESE 0
206#define FLASHROM_LANG_ENGLISH 1
207#define FLASHROM_LANG_GERMAN 2
208#define FLASHROM_LANG_FRENCH 3
209#define FLASHROM_LANG_SPANISH 4
210#define FLASHROM_LANG_ITALIAN 5
221typedef struct flashrom_syscfg {
246#define FLASHROM_REGION_UNKNOWN 0
247#define FLASHROM_REGION_JAPAN 1
248#define FLASHROM_REGION_US 2
249#define FLASHROM_REGION_EUROPE 3
273#define FLASHROM_ISP_DIALUP 0
274#define FLASHROM_ISP_DHCP 1
275#define FLASHROM_ISP_PPPOE 2
276#define FLASHROM_ISP_STATIC 3
289#define FLASHROM_ISP_IP (1 << 0)
290#define FLASHROM_ISP_NETMASK (1 << 1)
291#define FLASHROM_ISP_BROADCAST (1 << 2)
292#define FLASHROM_ISP_GATEWAY (1 << 3)
293#define FLASHROM_ISP_DNS (1 << 4)
294#define FLASHROM_ISP_HOSTNAME (1 << 5)
295#define FLASHROM_ISP_EMAIL (1 << 6)
296#define FLASHROM_ISP_SMTP (1 << 7)
297#define FLASHROM_ISP_POP3 (1 << 8)
298#define FLASHROM_ISP_POP3_USER (1 << 9)
299#define FLASHROM_ISP_POP3_PASS (1 << 10)
300#define FLASHROM_ISP_PROXY_HOST (1 << 11)
301#define FLASHROM_ISP_PROXY_PORT (1 << 12)
302#define FLASHROM_ISP_PPP_USER (1 << 13)
303#define FLASHROM_ISP_PPP_PASS (1 << 14)
304#define FLASHROM_ISP_OUT_PREFIX (1 << 15)
305#define FLASHROM_ISP_CW_PREFIX (1 << 16)
306#define FLASHROM_ISP_REAL_NAME (1 << 17)
307#define FLASHROM_ISP_MODEM_INIT (1 << 18)
308#define FLASHROM_ISP_AREA_CODE (1 << 19)
309#define FLASHROM_ISP_LD_PREFIX (1 << 20)
310#define FLASHROM_ISP_PHONE1 (1 << 21)
311#define FLASHROM_ISP_PHONE2 (1 << 22)
323#define FLASHROM_ISP_DIAL_AREACODE (1 << 0)
324#define FLASHROM_ISP_USE_PROXY (1 << 1)
325#define FLASHROM_ISP_PULSE_DIAL (1 << 2)
326#define FLASHROM_ISP_BLIND_DIAL (1 << 3)
338typedef struct flashrom_ispcfg {
357 char pop3_passwd[32];
int flashrom_get_syscfg(flashrom_syscfg_t *out)
Retrieve the current system configuration settings.
int flashrom_get_ispcfg(flashrom_ispcfg_t *out)
Retrieve DreamPassport's ISP configuration.
int flashrom_info(uint32_t part_id, uint32_t *start_offset, size_t *size_out)
Retrieve information about the given partition.
int flashrom_get_pw_ispcfg(flashrom_ispcfg_t *out)
Retrieve PlanetWeb's ISP configuration.
int flashrom_get_block(uint32_t part_id, uint32_t block_id, uint8_t *buffer_out)
Get a logical block from the specified partition.
int flashrom_get_region(void)
Retrieve the console's region code.
int flashrom_read(uint32_t offset, void *buffer_out, size_t bytes)
Read data from the flashrom.
int flashrom_delete(uint32_t offset)
Delete data from the flashrom.
int flashrom_write(uint32_t offset, const void *buffer, size_t bytes)
Write data to the flashrom.
int modem_init(void)
Initialize the modem.
ISP configuration structure.
Definition flashrom.h:338
int proxy_port
Proxy server port.
Definition flashrom.h:351
uint32_t flags
Various flags that can be set in options.
Definition flashrom.h:343
uint32_t valid_fields
Which fields are valid?
Definition flashrom.h:341
int method
DHCP, Static, dialup(?), PPPoE.
Definition flashrom.h:339
System configuration structure.
Definition flashrom.h:221
uint32_t language
Language setting.
Definition flashrom.h:222
uint32_t audio
Stereo/mono setting.
Definition flashrom.h:224
uint32_t autostart
Autostart discs? 0 == off, 1 == on.
Definition flashrom.h:225