23#ifndef __DC_FLASHROM_H
24#define __DC_FLASHROM_H
41#define FLASHROM_PT_SYSTEM 0
42#define FLASHROM_PT_RESERVED 1
43#define FLASHROM_PT_BLOCK_1 2
44#define FLASHROM_PT_SETTINGS 3
45#define FLASHROM_PT_BLOCK_2 4
54#define FLASHROM_B1_SYSCFG 0x05
55#define FLASHROM_B1_PW_SETTINGS_1 0x80
56#define FLASHROM_B1_PW_SETTINGS_2 0x81
57#define FLASHROM_B1_PW_SETTINGS_3 0x82
58#define FLASHROM_B1_PW_SETTINGS_4 0x83
59#define FLASHROM_B1_PW_SETTINGS_5 0x84
60#define FLASHROM_B1_PW_PPP1 0xC0
61#define FLASHROM_B1_PW_PPP2 0xC1
62#define FLASHROM_B1_PW_DNS 0xC2
63#define FLASHROM_B1_PW_EMAIL1 0xC3
64#define FLASHROM_B1_PW_EMAIL2 0xC4
65#define FLASHROM_B1_PW_EMAIL_PROXY 0xC5
66#define FLASHROM_B1_DK_PPP1 0xC6
67#define FLASHROM_B1_DK_PPP2 0xC7
68#define FLASHROM_B1_DK_DNS 0xC8
69#define FLASHROM_B1_IP_SETTINGS 0xE0
70#define FLASHROM_B1_EMAIL 0xE2
71#define FLASHROM_B1_SMTP 0xE4
72#define FLASHROM_B1_POP3 0xE5
73#define FLASHROM_B1_POP3LOGIN 0xE6
74#define FLASHROM_B1_POP3PASSWD 0xE7
75#define FLASHROM_B1_PPPLOGIN 0xE8
76#define FLASHROM_B1_PPPPASSWD 0xE9
77#define FLASHROM_B1_PPPMODEM 0xEB
80#define FLASHROM_OFFSET_CRC 62
87#define FLASHROM_ERR_NONE 0
88#define FLASHROM_ERR_NOT_FOUND -1
89#define FLASHROM_ERR_NO_PARTITION -2
90#define FLASHROM_ERR_READ_PART -3
91#define FLASHROM_ERR_BAD_MAGIC -4
92#define FLASHROM_ERR_BOGUS_PART -5
93#define FLASHROM_ERR_NOMEM -6
94#define FLASHROM_ERR_READ_BITMAP -7
95#define FLASHROM_ERR_EMPTY_PART -8
96#define FLASHROM_ERR_READ_BLOCK -9
190#define FLASHROM_LANG_JAPANESE 0
191#define FLASHROM_LANG_ENGLISH 1
192#define FLASHROM_LANG_GERMAN 2
193#define FLASHROM_LANG_FRENCH 3
194#define FLASHROM_LANG_SPANISH 4
195#define FLASHROM_LANG_ITALIAN 5
206typedef struct flashrom_syscfg {
231#define FLASHROM_REGION_UNKNOWN 0
232#define FLASHROM_REGION_JAPAN 1
233#define FLASHROM_REGION_US 2
234#define FLASHROM_REGION_EUROPE 3
258#define FLASHROM_ISP_DIALUP 0
259#define FLASHROM_ISP_DHCP 1
260#define FLASHROM_ISP_PPPOE 2
261#define FLASHROM_ISP_STATIC 3
274#define FLASHROM_ISP_IP (1 << 0)
275#define FLASHROM_ISP_NETMASK (1 << 1)
276#define FLASHROM_ISP_BROADCAST (1 << 2)
277#define FLASHROM_ISP_GATEWAY (1 << 3)
278#define FLASHROM_ISP_DNS (1 << 4)
279#define FLASHROM_ISP_HOSTNAME (1 << 5)
280#define FLASHROM_ISP_EMAIL (1 << 6)
281#define FLASHROM_ISP_SMTP (1 << 7)
282#define FLASHROM_ISP_POP3 (1 << 8)
283#define FLASHROM_ISP_POP3_USER (1 << 9)
284#define FLASHROM_ISP_POP3_PASS (1 << 10)
285#define FLASHROM_ISP_PROXY_HOST (1 << 11)
286#define FLASHROM_ISP_PROXY_PORT (1 << 12)
287#define FLASHROM_ISP_PPP_USER (1 << 13)
288#define FLASHROM_ISP_PPP_PASS (1 << 14)
289#define FLASHROM_ISP_OUT_PREFIX (1 << 15)
290#define FLASHROM_ISP_CW_PREFIX (1 << 16)
291#define FLASHROM_ISP_REAL_NAME (1 << 17)
292#define FLASHROM_ISP_MODEM_INIT (1 << 18)
293#define FLASHROM_ISP_AREA_CODE (1 << 19)
294#define FLASHROM_ISP_LD_PREFIX (1 << 20)
295#define FLASHROM_ISP_PHONE1 (1 << 21)
296#define FLASHROM_ISP_PHONE2 (1 << 22)
308#define FLASHROM_ISP_DIAL_AREACODE (1 << 0)
309#define FLASHROM_ISP_USE_PROXY (1 << 1)
310#define FLASHROM_ISP_PULSE_DIAL (1 << 2)
311#define FLASHROM_ISP_BLIND_DIAL (1 << 3)
323typedef struct flashrom_ispcfg {
342 char pop3_passwd[32];
int flashrom_write(int offset, void *buffer, int bytes)
Write data to the flashrom.
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_get_pw_ispcfg(flashrom_ispcfg_t *out)
Retrieve PlanetWeb's ISP configuration.
int flashrom_delete(int offset)
Delete data from the flashrom.
int flashrom_get_region(void)
Retrieve the console's region code.
int flashrom_get_block(int partid, int blockid, uint8 *buffer_out)
Get a logical block from the specified partition.
int flashrom_read(int offset, void *buffer_out, int bytes)
Read data from the flashrom.
int flashrom_info(int part, int *start_out, int *size_out)
Retrieve information about the given partition.
int modem_init(void)
Initialize the modem.
unsigned long uint32
32-bit unsigned integer
Definition types.h:33
unsigned char uint8
8-bit unsigned integer
Definition types.h:35
ISP configuration structure.
Definition flashrom.h:323
int proxy_port
Proxy server port.
Definition flashrom.h:336
uint32 flags
Various flags that can be set in options.
Definition flashrom.h:328
int method
DHCP, Static, dialup(?), PPPoE.
Definition flashrom.h:324
uint32 valid_fields
Which fields are valid?
Definition flashrom.h:326
System configuration structure.
Definition flashrom.h:206
int language
Language setting.
Definition flashrom.h:207
int autostart
Autostart discs? 0 == off, 1 == on.
Definition flashrom.h:210
int audio
Stereo/mono setting.
Definition flashrom.h:209