Lines Matching refs:tx

97 static void sparx5_fdma_tx_add_dcb(struct sparx5_tx *tx,  in sparx5_fdma_tx_add_dcb()  argument
159 static void sparx5_fdma_tx_activate(struct sparx5 *sparx5, struct sparx5_tx *tx) in sparx5_fdma_tx_activate() argument
162 spx5_wr(((u64)tx->dma) & GENMASK(31, 0), sparx5, in sparx5_fdma_tx_activate()
163 FDMA_DCB_LLP(tx->channel_id)); in sparx5_fdma_tx_activate()
164 spx5_wr(((u64)tx->dma) >> 32, sparx5, FDMA_DCB_LLP1(tx->channel_id)); in sparx5_fdma_tx_activate()
170 sparx5, FDMA_CH_CFG(tx->channel_id)); in sparx5_fdma_tx_activate()
177 spx5_wr(BIT(tx->channel_id), sparx5, FDMA_CH_ACTIVATE); in sparx5_fdma_tx_activate()
180 static void sparx5_fdma_tx_deactivate(struct sparx5 *sparx5, struct sparx5_tx *tx) in sparx5_fdma_tx_deactivate() argument
183 spx5_rmw(0, BIT(tx->channel_id) & FDMA_CH_ACTIVATE_CH_ACTIVATE, in sparx5_fdma_tx_deactivate()
193 static void sparx5_fdma_tx_reload(struct sparx5 *sparx5, struct sparx5_tx *tx) in sparx5_fdma_tx_reload() argument
196 spx5_wr(BIT(tx->channel_id), sparx5, FDMA_CH_RELOAD); in sparx5_fdma_tx_reload()
293 static struct sparx5_tx_dcb_hw *sparx5_fdma_next_dcb(struct sparx5_tx *tx, in sparx5_fdma_next_dcb() argument
302 ((unsigned long)tx->first_entry + FDMA_DCB_MAX * sizeof(*dcb))) in sparx5_fdma_next_dcb()
303 next_dcb = tx->first_entry; in sparx5_fdma_next_dcb()
310 struct sparx5_tx *tx = &sparx5->tx; in sparx5_fdma_xmit() local
315 next_dcb_hw = sparx5_fdma_next_dcb(tx, tx->curr_entry); in sparx5_fdma_xmit()
318 tx->dropped++; in sparx5_fdma_xmit()
319 db = list_first_entry(&tx->db_list, struct sparx5_db, list); in sparx5_fdma_xmit()
320 list_move_tail(&db->list, &tx->db_list); in sparx5_fdma_xmit()
322 tx->curr_entry->nextptr = tx->dma + in sparx5_fdma_xmit()
324 (unsigned long)tx->first_entry); in sparx5_fdma_xmit()
325 tx->curr_entry = next_dcb_hw; in sparx5_fdma_xmit()
334 sparx5_fdma_tx_activate(sparx5, tx); in sparx5_fdma_xmit()
337 sparx5_fdma_tx_reload(sparx5, tx); in sparx5_fdma_xmit()
390 struct sparx5_tx *tx = &sparx5->tx; in sparx5_fdma_tx_alloc() local
397 tx->curr_entry = devm_kzalloc(sparx5->dev, size, GFP_KERNEL); in sparx5_fdma_tx_alloc()
398 if (!tx->curr_entry) in sparx5_fdma_tx_alloc()
400 tx->dma = virt_to_phys(tx->curr_entry); in sparx5_fdma_tx_alloc()
401 tx->first_entry = tx->curr_entry; in sparx5_fdma_tx_alloc()
402 INIT_LIST_HEAD(&tx->db_list); in sparx5_fdma_tx_alloc()
405 dcb = &tx->curr_entry[idx]; in sparx5_fdma_tx_alloc()
424 list_add_tail(&db->list, &tx->db_list); in sparx5_fdma_tx_alloc()
426 sparx5_fdma_tx_add_dcb(tx, dcb, tx->dma + sizeof(*dcb) * idx); in sparx5_fdma_tx_alloc()
429 tx->curr_entry = dcb; in sparx5_fdma_tx_alloc()
452 struct sparx5_tx *tx, int channel) in sparx5_fdma_tx_init() argument
454 tx->channel_id = channel; in sparx5_fdma_tx_init()
561 sparx5_fdma_tx_init(sparx5, &sparx5->tx, FDMA_INJ_CHANNEL); in sparx5_fdma_start()
587 sparx5_fdma_tx_deactivate(sparx5, &sparx5->tx); in sparx5_fdma_stop()