+2008-08-06 Bean <bean123ch@gmail.com>
+
+ * fs/i386/pc/pxe.c (grub_pxe_data): New member block_size.
+ (grub_pxefs_fs_int): Remove dummy definition.
+ (grub_pxefs_open): Use data->block_size to store the current block
+ size setting.
+ (grub_pxefs_read): Use block size stored in data->block_size. As the
+ value of grub_pxe_blksize can be changed after the file is opened.
+
2008-08-06 Bean <bean123ch@gmail.com>
* fs/i386/pc/pxe.c (curr_file): new variable.
struct grub_pxe_data
{
grub_uint32_t packet_number;
+ grub_uint32_t block_size;
char filename[0];
};
return GRUB_ERR_NONE;
}
-static struct grub_fs grub_pxefs_fs_int;
-
static grub_err_t
grub_pxefs_open (struct grub_file *file, const char *name)
{
return grub_errno;
data->packet_number = 0;
+ data->block_size = grub_pxe_blksize;
grub_strcpy (data->filename, name);
file_int = grub_malloc (sizeof (*file_int));
grub_memcpy (file_int, file, sizeof (struct grub_file));
curr_file = file_int;
- bufio = grub_bufio_open (file_int, grub_pxe_blksize);
+ bufio = grub_bufio_open (file_int, data->block_size);
if (! bufio)
{
grub_free (file_int);
data = file->data;
- pn = grub_divmod64 (file->offset, grub_pxe_blksize, &r);
+ pn = grub_divmod64 (file->offset, data->block_size, &r);
if (r)
return grub_error (GRUB_ERR_BAD_FS,
"read access must be aligned to packet size");
o.gateway_ip = grub_pxe_gateway_ip;
grub_strcpy (o.filename, data->filename);
o.tftp_port = grub_cpu_to_be16 (GRUB_PXE_TFTP_PORT);
- o.packet_size = grub_pxe_blksize;
+ o.packet_size = data->block_size;
grub_pxe_call (GRUB_PXENV_TFTP_OPEN, &o);
if (o.status)
return grub_error (GRUB_ERR_BAD_FS, "open fails");