Skip to content

Commit

Permalink
net: cadence_gem: Add macro with max number of descriptor words
Browse files Browse the repository at this point in the history
Add macro with max number of DMA descriptor words.
No functional change.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 20181011021931.4249-5-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
edgarigl authored and pm215 committed Oct 16, 2018
1 parent f023618 commit 8568313
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hw/net/cadence_gem.c
Expand Up @@ -1042,7 +1042,7 @@ static void gem_transmit_updatestats(CadenceGEMState *s, const uint8_t *packet,
*/
static void gem_transmit(CadenceGEMState *s)
{
uint32_t desc[2];
uint32_t desc[DESC_MAX_NUM_WORDS];
hwaddr packet_desc_addr;
uint8_t tx_packet[2048];
uint8_t *p;
Expand Down Expand Up @@ -1108,7 +1108,7 @@ static void gem_transmit(CadenceGEMState *s)

/* Last descriptor for this packet; hand the whole thing off */
if (tx_desc_get_last(desc)) {
uint32_t desc_first[2];
uint32_t desc_first[DESC_MAX_NUM_WORDS];

/* Modify the 1st descriptor of this packet to be owned by
* the processor.
Expand Down
5 changes: 4 additions & 1 deletion include/hw/net/cadence_gem.h
Expand Up @@ -32,6 +32,9 @@

#define CADENCE_GEM_MAXREG (0x00000800 / 4) /* Last valid GEM address */

/* Max number of words in a DMA descriptor. */
#define DESC_MAX_NUM_WORDS 2

#define MAX_PRIORITY_QUEUES 8
#define MAX_TYPE1_SCREENERS 16
#define MAX_TYPE2_SCREENERS 16
Expand Down Expand Up @@ -74,7 +77,7 @@ typedef struct CadenceGEMState {

uint8_t can_rx_state; /* Debug only */

uint32_t rx_desc[MAX_PRIORITY_QUEUES][2];
uint32_t rx_desc[MAX_PRIORITY_QUEUES][DESC_MAX_NUM_WORDS];

bool sar_active[4];
} CadenceGEMState;
Expand Down

0 comments on commit 8568313

Please sign in to comment.