Commit e8b89bc1 authored by Takashi Sakamoto's avatar Takashi Sakamoto

firewire: core/ohci: minor refactoring for computation of configuration ROM size

The size of space for configuration ROM is defined by IEEE 1212. The start
and end offsets are available as some macros in UAPI header.

This commit uses these macros to compute the size.

Link: https://lore.kernel.org/r/20240814131222.69949-4-o-takashi@sakamocchi.jpSigned-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
parent d4dcb339
...@@ -564,7 +564,8 @@ static int read_rom(struct fw_device *device, ...@@ -564,7 +564,8 @@ static int read_rom(struct fw_device *device,
return rcode; return rcode;
} }
#define MAX_CONFIG_ROM_SIZE 256 // By quadlet unit.
#define MAX_CONFIG_ROM_SIZE ((CSR_CONFIG_ROM_END - CSR_CONFIG_ROM) / sizeof(u32))
/* /*
* Read the bus info block, perform a speed probe, and read all of the rest of * Read the bus info block, perform a speed probe, and read all of the rest of
......
...@@ -174,7 +174,7 @@ struct iso_context { ...@@ -174,7 +174,7 @@ struct iso_context {
u8 tags; u8 tags;
}; };
#define CONFIG_ROM_SIZE 1024 #define CONFIG_ROM_SIZE (CSR_CONFIG_ROM_END - CSR_CONFIG_ROM)
struct fw_ohci { struct fw_ohci {
struct fw_card card; struct fw_card card;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment