u32 rx_cnt = priv->plat->rx_queues_to_use;
struct mac_device_info *mac = priv->hw;
struct stmmac_test_priv *tpriv;
+ unsigned int rx_fifo_size;
unsigned int pkt_count;
int i, ret = 0;
if (!(mac->link.caps & MAC_SYM_PAUSE))
return -EOPNOTSUPP;
+ rx_fifo_size = priv->plat->rx_fifo_size;
+ if (!rx_fifo_size)
+ rx_fifo_size = priv->dma_cap.rx_fifo_size;
+
+ /* No pause frame is emitted if we don't have at least 4096 bytes per
+ * queue, except on dwmac100.
+ */
+ if (priv->plat->core_type != DWMAC_CORE_MAC100 &&
+ rx_fifo_size / priv->plat->rx_queues_to_use < 4096)
+ return -EOPNOTSUPP;
+
tpriv = kzalloc_obj(*tpriv);
if (!tpriv)
return -ENOMEM;
dev_add_pack(&tpriv->pt);
/* Compute minimum number of packets to make FIFO full */
- pkt_count = priv->plat->rx_fifo_size;
- if (!pkt_count)
- pkt_count = priv->dma_cap.rx_fifo_size;
+ pkt_count = rx_fifo_size;
pkt_count /= 1400;
pkt_count *= 2;