diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-10-08 00:41:59 +0200 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-10-14 23:10:48 +0200 |
commit | 8e85973efc87dfae8508f1a3440fd44612897458 (patch) | |
tree | 9b8f0f0d1adf5a2611b58565db4d9da0ebd1cc9c /drivers/firewire/core.h | |
parent | e21fcf798e246202d7b60e864f1d7302ebaaf41c (diff) | |
download | linux-8e85973efc87dfae8508f1a3440fd44612897458.tar.bz2 |
firewire: optimize config ROM creation
The config ROM image of the local node was created in CPU byte order,
then a temporary big endian copy was created to compute the CRC, and
finally the card driver created its own big endian copy.
We now generate it in big endian byte order in the first place to avoid
one byte order conversion and the temporary on-stack copy of the ROM
image (1000 bytes stack usage in process context). Furthermore, two
1000 bytes memset()s are replaced by one 1000 bytes - ROM length sized
memset.
The trivial fw_memcpy_{from,to}_be32() helpers are now superfluous and
removed. The newly added __compute_block_crc() function will be folded
into fw_compute_block_crc() in a subsequent change.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core.h')
-rw-r--r-- | drivers/firewire/core.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h index 7ff6e7585152..7adca7cb9f55 100644 --- a/drivers/firewire/core.h +++ b/drivers/firewire/core.h @@ -40,7 +40,8 @@ struct fw_card_driver { * enable the PHY or set the link_on bit and initiate a bus * reset. */ - int (*enable)(struct fw_card *card, u32 *config_rom, size_t length); + int (*enable)(struct fw_card *card, + const __be32 *config_rom, size_t length); int (*update_phy_reg)(struct fw_card *card, int address, int clear_bits, int set_bits); @@ -48,10 +49,10 @@ struct fw_card_driver { /* * Update the config rom for an enabled card. This function * should change the config rom that is presented on the bus - * an initiate a bus reset. + * and initiate a bus reset. */ int (*set_config_rom)(struct fw_card *card, - u32 *config_rom, size_t length); + const __be32 *config_rom, size_t length); void (*send_request)(struct fw_card *card, struct fw_packet *packet); void (*send_response)(struct fw_card *card, struct fw_packet *packet); |