Commit 74f2bfe3 authored by Maciej Lipinski's avatar Maciej Lipinski Committed by Grzegorz Daniluk

[toos/wr-streamers] fixed qtagvp command

- for the qtag configuration to be effective, an appropriate override
  bit needs to be set, this was missing, fixed
- the function was first enabling the qtag-ing and then configuring it,
  this is not a good behavior, it is better to be enabled later (when
  the configuration is set, otherwise it will start sending frames
  tagged with some random config), fixed
parent 41353a27
......@@ -454,7 +454,7 @@ int get_set_qtags_param(struct cmd_desc *cmdd, struct atom *atoms)
volatile struct WR_STREAMERS_WB *ptr =
(volatile struct WR_STREAMERS_WB *)wrstm->base;
int argc;
uint32_t vid, prio, txcfg5;
uint32_t vid, prio, txcfg5, cfg;
if (atoms == (struct atom *)VERBOSE_HELP) {
printf("%s - %s\n", cmdd->name, cmdd->help);
......@@ -470,9 +470,6 @@ int get_set_qtags_param(struct cmd_desc *cmdd, struct atom *atoms)
WR_STREAMERS_TX_CFG5_QTAG_PRIO_SHIFT;
}
else { // writing new QTag settings
// first of all enable QTag just in case
txcfg5 |= 0x1;
ptr->TX_CFG5 = iomemw32(wrstm->is_be, txcfg5);
argc = 0; //count provided arguments
if (atoms->type != Numeric)
......@@ -491,7 +488,16 @@ int get_set_qtags_param(struct cmd_desc *cmdd, struct atom *atoms)
txcfg5 &= ~WR_STREAMERS_TX_CFG5_QTAG_PRIO_MASK; // reset prio bit field
txcfg5 |= (prio << WR_STREAMERS_TX_CFG5_QTAG_PRIO_SHIFT); // set new prio
}
// enable QTag just in case it's not yet enabled
txcfg5 |= 0x1;
ptr->TX_CFG5 = iomemw32(wrstm->is_be, txcfg5);
/* read the override register and enable overriding of the
default configuration (set with generics) with the WB
configuration (written above) */
cfg = iomemr32(wrstm->is_be, ptr->CFG);
cfg |= WR_STREAMERS_CFG_OR_TX_QTAG;
ptr->CFG = iomemw32(wrstm->is_be, cfg);
}
fprintf(stderr, "Tagging with QTag: VLAN ID: 0x%x prio: 0x%x\n",
vid, prio);
......
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