3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; version 2 of the License.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <psl1ght/lv2/net.h>
21 #include <lv2_syscall.h>
22 #include <udp_printf.h>
24 #define VFLASH_DEV_ID 0x100000000000001ull
25 #define VFLASH_REGION_START_SECTOR 0x80000ull
26 #define VFLASH_REGION_SECTOR_COUNT 0x5000000ull /* 40GB for my beloved Linux */
27 #define VFLASH_REGION_LAID 0x1070000002000001ull
32 int main(int argc
, char **argv
)
42 PRINTF("%s:%d: start\n", __func__
, __LINE__
);
46 result
= lv2_storage_open(VFLASH_DEV_ID
, &dev_handle
);
48 PRINTF("%s:%d: lv2_storage_open failed (0x%08x)\n", __func__
, __LINE__
, result
);
52 result
= lv2_storage_create_region(dev_handle
, VFLASH_REGION_START_SECTOR
, VFLASH_REGION_SECTOR_COUNT
,
53 0, VFLASH_REGION_LAID
, ®ion_id
);
55 PRINTF("%s:%d: lv2_storage_create_region failed (0x%08x)\n", __func__
, __LINE__
, result
);
59 PRINTF("%s:%d: region_id (%d)\n", __func__
, __LINE__
, region_id
);
61 PRINTF("%s:%d: end\n", __func__
, __LINE__
);
65 result
= lv2_storage_close(dev_handle
);
67 PRINTF("%s:%d: lv2_storage_close failed (0x%08x)\n", __func__
, __LINE__
, result
);