diff options
author | Geoff Levand <geoff@infradead.org> | 2023-12-23 16:28:20 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-01-02 14:16:08 +0000 |
commit | 3ce4f9c3fbb3de675693d178f86284969c146898 (patch) | |
tree | 248d09ed08009adb52cff7b5838c921a3c55a3cf /drivers/net/ethernet/toshiba/ps3_gelic_net.h | |
parent | Merge branch 'bnxt_en-ntuple-fuilter-support' (diff) | |
download | linux-3ce4f9c3fbb3de675693d178f86284969c146898.tar.xz linux-3ce4f9c3fbb3de675693d178f86284969c146898.zip |
net/ps3_gelic_net: Add gelic_descr structures
In an effort to make the PS3 gelic driver easier to maintain, create two
new structures, struct gelic_hw_regs and struct gelic_chain_link, and
replace the corresponding members of struct gelic_descr with the new
structures.
The new struct gelic_hw_regs holds the register variables used by the
gelic hardware device. The new struct gelic_chain_link holds variables
used to manage the driver's linked list of gelic descr structures.
Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/toshiba/ps3_gelic_net.h')
-rw-r--r-- | drivers/net/ethernet/toshiba/ps3_gelic_net.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.h b/drivers/net/ethernet/toshiba/ps3_gelic_net.h index 0d98defb011e..f1f78de7705d 100644 --- a/drivers/net/ethernet/toshiba/ps3_gelic_net.h +++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.h @@ -221,29 +221,35 @@ enum gelic_lv1_phy { GELIC_LV1_PHY_ETHERNET_0 = 0x0000000000000002L, }; -/* size of hardware part of gelic descriptor */ -#define GELIC_DESCR_SIZE (32) - enum gelic_port_type { GELIC_PORT_ETHERNET_0 = 0, GELIC_PORT_WIRELESS = 1, GELIC_PORT_MAX }; -struct gelic_descr { - /* as defined by the hardware */ - __be32 buf_addr; - __be32 buf_size; +/* As defined by the gelic hardware device. */ +struct gelic_hw_regs { + struct { + __be32 dev_addr; + __be32 size; + } __packed payload; __be32 next_descr_addr; __be32 dmac_cmd_status; __be32 result_size; __be32 valid_size; /* all zeroes for tx */ __be32 data_status; __be32 data_error; /* all zeroes for tx */ +} __packed; - /* used in the driver */ +struct gelic_chain_link { + dma_addr_t cpu_addr; + unsigned int size; +}; + +struct gelic_descr { + struct gelic_hw_regs hw_regs; + struct gelic_chain_link link; struct sk_buff *skb; - dma_addr_t bus_addr; struct gelic_descr *next; struct gelic_descr *prev; } __attribute__((aligned(32))); |