/freebsd/crypto/heimdal/appl/telnet/telnet/ |
H A D | ring.c | 39 * This defines a structure for a ring buffer. 64 * There is some trickiness here. Since the ring buffers are initialized 83 ring_init(Ring *ring, unsigned char *buffer, int count) in ring_init() argument 85 memset(ring, 0, sizeof *ring); in ring_init() 87 ring->size = count; in ring_init() 89 ring->supply = ring->consume = ring->bottom = buffer; in ring_init() 91 ring->top = ring->bottom+ring->size; in ring_init() 94 ring->clearto = 0; in ring_init() 107 ring_mark(Ring *ring) in ring_mark() argument 109 ring->mark = ring_decrement(ring, ring->supply, 1); in ring_mark() [all …]
|
H A D | ring.h | 33 * @(#)ring.h 8.1 (Berkeley) 6/6/93 39 * This defines a structure for a ring buffer. 61 } Ring; typedef 63 /* Here are some functions and macros to deal with the ring buffer */ 67 ring_init (Ring *ring, unsigned char *buffer, int count); 71 ring_supply_data (Ring *ring, unsigned char *buffer, int count); 74 ring_consume_data (Ring *ring, unsigned char *buffer, int count); 79 ring_supplied (Ring *ring, int count), 80 ring_consumed (Ring *ring, int count); 84 ring_empty_count (Ring *ring), [all …]
|
/freebsd/contrib/telnet/telnet/ |
H A D | ring.c | 32 static const char sccsid[] = "@(#)ring.c 8.2 (Berkeley) 5/30/95"; 37 * This defines a structure for a ring buffer. 61 #include "ring.h" 83 * There is some trickiness here. Since the ring buffers are initialized 98 ring_init(Ring *ring, unsigned char *buffer, int count) in ring_init() argument 100 memset((char *)ring, 0, sizeof *ring); in ring_init() 102 ring->size = count; in ring_init() 104 ring->supply = ring->consume = ring->bottom = buffer; in ring_init() 106 ring->top = ring->bottom+ring->size; in ring_init() 109 ring->clearto = 0; in ring_init() [all …]
|
H A D | ring.h | 29 * @(#)ring.h 8.1 (Berkeley) 6/6/93 44 * This defines a structure for a ring buffer. 66 } Ring; typedef 68 /* Here are some functions and macros to deal with the ring buffer */ 72 ring_init(Ring *ring, unsigned char *buffer, int count); 76 ring_supply_data(Ring *ring, unsigned char *buffer, int count); 79 ring_consume_data(Ring *ring, unsigned char *buffer, int count); 84 ring_supplied(Ring *ring, int count), 85 ring_consumed(Ring *ring, int count); 89 ring_at_mark(Ring *), [all …]
|
/freebsd/sys/contrib/device-tree/Bindings/net/wireless/ |
H A D | qcom,ath11k.yaml | 109 - description: interrupt event for ring CE0 110 - description: interrupt event for ring CE1 111 - description: interrupt event for ring CE2 112 - description: interrupt event for ring CE3 113 - description: interrupt event for ring CE4 114 - description: interrupt event for ring CE5 115 - description: interrupt event for ring CE6 116 - description: interrupt event for ring CE7 117 - description: interrupt event for ring CE8 118 - description: interrupt event for ring CE9 [all …]
|
/freebsd/sys/dev/mlx4/mlx4_en/ |
H A D | mlx4_en_tx.c | 60 struct mlx4_en_tx_ring *ring; in mlx4_en_create_tx_ring() local 65 ring = kzalloc_node(sizeof(struct mlx4_en_tx_ring), GFP_KERNEL, node); in mlx4_en_create_tx_ring() 66 if (!ring) { in mlx4_en_create_tx_ring() 67 ring = kzalloc(sizeof(struct mlx4_en_tx_ring), GFP_KERNEL); in mlx4_en_create_tx_ring() 68 if (!ring) { in mlx4_en_create_tx_ring() 69 en_err(priv, "Failed allocating TX ring\n"); in mlx4_en_create_tx_ring() 87 &ring->dma_tag))) in mlx4_en_create_tx_ring() 90 ring->size = size; in mlx4_en_create_tx_ring() 91 ring->size_mask = size - 1; in mlx4_en_create_tx_ring() 92 ring->stride = stride; in mlx4_en_create_tx_ring() [all …]
|
H A D | mlx4_en_rx.c | 49 struct mlx4_en_rx_ring *ring, in mlx4_en_init_rx_desc() argument 53 ((struct mlx4_en_rx_desc *)ring->buf) + index; in mlx4_en_init_rx_desc() 61 * If the number of used fragments does not fill up the ring in mlx4_en_init_rx_desc() 74 mlx4_en_alloc_mbuf(struct mlx4_en_rx_ring *ring) in mlx4_en_alloc_mbuf() argument 79 mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, ring->rx_mb_size); in mlx4_en_alloc_mbuf() 81 mb->m_pkthdr.len = mb->m_len = ring->rx_mb_size; in mlx4_en_alloc_mbuf() 92 if (mb_head->m_pkthdr.len >= ring->rx_mb_size) in mlx4_en_alloc_mbuf() 110 mlx4_en_alloc_buf(struct mlx4_en_rx_ring *ring, struct mlx4_en_rx_desc *rx_desc, in mlx4_en_alloc_buf() argument 123 if (unlikely(ring->spare.mbuf == NULL)) { in mlx4_en_alloc_buf() 124 mb = mlx4_en_alloc_mbuf(ring); in mlx4_en_alloc_buf() [all …]
|
/freebsd/sys/dev/qat/qat_common/ |
H A D | adf_transport.c | 52 adf_reserve_ring(struct adf_etr_bank_data *bank, u32 ring) in adf_reserve_ring() argument 55 if (bank->ring_mask & (1 << ring)) { in adf_reserve_ring() 59 bank->ring_mask |= (1 << ring); in adf_reserve_ring() 65 adf_unreserve_ring(struct adf_etr_bank_data *bank, u32 ring) in adf_unreserve_ring() argument 68 bank->ring_mask &= ~(1 << ring); in adf_unreserve_ring() 73 adf_enable_ring_irq(struct adf_etr_bank_data *bank, u32 ring) in adf_enable_ring_irq() argument 82 bank->irq_mask |= (1 << ring); in adf_enable_ring_irq() 94 adf_disable_ring_irq(struct adf_etr_bank_data *bank, u32 ring) in adf_disable_ring_irq() argument 99 bank->irq_mask &= ~(1 << ring); in adf_disable_ring_irq() 107 adf_send_message(struct adf_etr_ring_data *ring, u32 *msg) in adf_send_message() argument [all …]
|
H A D | adf_freebsd_transport_debug.c | 20 struct adf_etr_ring_data *ring = arg1; in adf_ring_show() local 21 struct adf_etr_bank_data *bank = ring->bank; in adf_ring_show() 23 struct resource *csr = ring->bank->csr_addr; in adf_ring_show() 34 ring->ring_number); in adf_ring_show() 37 ring->ring_number); in adf_ring_show() 40 sbuf_cat(&sb, "\n------- Ring configuration -------\n"); in adf_ring_show() 42 "ring name: %s\n", in adf_ring_show() 43 ring->ring_debug->ring_name); in adf_ring_show() 45 "ring num %d, bank num %d\n", in adf_ring_show() 46 ring->ring_number, in adf_ring_show() [all …]
|
/freebsd/sys/dev/qat/qat_api/qat_kernel/src/ |
H A D | qat_transport.c | 95 struct adf_etr_ring_data *ring = trans_handle; in icp_adf_transReleaseHandle() local 97 ICP_CHECK_FOR_NULL_PARAM(ring); in icp_adf_transReleaseHandle() 98 adf_remove_ring(ring); in icp_adf_transReleaseHandle() 115 * get ring number from a transport handle 120 struct adf_etr_ring_data *ring = trans_handle; in icp_adf_transGetRingNum() local 122 ICP_CHECK_FOR_NULL_PARAM(ring); in icp_adf_transGetRingNum() 124 *ringNum = (uint32_t)(ring->ring_number); in icp_adf_transGetRingNum() 139 struct adf_etr_ring_data *ring = trans_handle; in icp_adf_transPutMsg() local 143 ICP_CHECK_FOR_NULL_PARAM(ring); in icp_adf_transPutMsg() 145 error = adf_send_message(ring, inBuf); in icp_adf_transPutMsg() [all …]
|
/freebsd/sys/contrib/dev/athk/ath12k/ |
H A D | dbring.c | 11 struct ath12k_dbring *ring, in ath12k_dbring_bufs_replenish() argument 23 srng = &ab->hal.srng_list[ring->refill_srng.ring_id]; in ath12k_dbring_bufs_replenish() 30 ptr_aligned = PTR_ALIGN(ptr_unaligned, ring->buf_align); in ath12k_dbring_bufs_replenish() 31 paddr = dma_map_single(ab->dev, ptr_aligned, ring->buf_sz, in ath12k_dbring_bufs_replenish() 38 spin_lock_bh(&ring->idr_lock); in ath12k_dbring_bufs_replenish() 39 buf_id = idr_alloc(&ring->bufs_idr, buff, 0, ring->bufs_max, gfp); in ath12k_dbring_bufs_replenish() 40 spin_unlock_bh(&ring->idr_lock); in ath12k_dbring_bufs_replenish() 64 spin_lock_bh(&ring->idr_lock); in ath12k_dbring_bufs_replenish() 65 idr_remove(&ring->bufs_idr, buf_id); in ath12k_dbring_bufs_replenish() 66 spin_unlock_bh(&ring->idr_lock); in ath12k_dbring_bufs_replenish() [all …]
|
/freebsd/sys/contrib/dev/athk/ath11k/ |
H A D | dbring.c | 39 struct ath11k_dbring *ring, in ath11k_dbring_bufs_replenish() argument 51 srng = &ab->hal.srng_list[ring->refill_srng.ring_id]; in ath11k_dbring_bufs_replenish() 58 ptr_aligned = PTR_ALIGN(ptr_unaligned, ring->buf_align); in ath11k_dbring_bufs_replenish() 59 ath11k_dbring_fill_magic_value(ar, ptr_aligned, ring->buf_sz); in ath11k_dbring_bufs_replenish() 60 paddr = dma_map_single(ab->dev, ptr_aligned, ring->buf_sz, in ath11k_dbring_bufs_replenish() 67 spin_lock_bh(&ring->idr_lock); in ath11k_dbring_bufs_replenish() 68 buf_id = idr_alloc(&ring->bufs_idr, buff, 0, ring->bufs_max, GFP_ATOMIC); in ath11k_dbring_bufs_replenish() 69 spin_unlock_bh(&ring->idr_lock); in ath11k_dbring_bufs_replenish() 94 spin_lock_bh(&ring->idr_lock); in ath11k_dbring_bufs_replenish() 95 idr_remove(&ring->bufs_idr, buf_id); in ath11k_dbring_bufs_replenish() [all …]
|
/freebsd/sys/contrib/ck/include/ |
H A D | ck_ring.h | 37 * Concurrent ring buffer. 57 ck_ring_size(const struct ck_ring *ring) in ck_ring_size() argument 61 c = ck_pr_load_uint(&ring->c_head); in ck_ring_size() 62 p = ck_pr_load_uint(&ring->p_tail); in ck_ring_size() 63 return (p - c) & ring->mask; in ck_ring_size() 67 ck_ring_capacity(const struct ck_ring *ring) in ck_ring_capacity() argument 70 return ring->size; in ck_ring_capacity() 75 * on the ring. This is primarily meant for persistent ck_ring use-cases. The 76 * function returns true if any mutations were performed on the ring. 79 ck_ring_repair(struct ck_ring *ring) in ck_ring_repair() argument [all …]
|
/freebsd/sys/dev/enic/ |
H A D | vnic_wq.c | 11 struct vnic_dev_ring *ring, unsigned int desc_count, unsigned int desc_size) in vnic_dev_alloc_desc_ring() argument 32 ring->base_addr = ifdip->idi_paddr; in vnic_dev_alloc_desc_ring() 33 ring->descs = ifdip->idi_vaddr; in vnic_dev_alloc_desc_ring() 34 ring->ifdip = ifdip; in vnic_dev_alloc_desc_ring() 35 ring->desc_size = desc_size; in vnic_dev_alloc_desc_ring() 36 ring->desc_count = desc_count; in vnic_dev_alloc_desc_ring() 37 ring->last_count = 0; in vnic_dev_alloc_desc_ring() 38 ring->desc_avail = ring->desc_count - 1; in vnic_dev_alloc_desc_ring() 40 ring->size = ring->desc_count * ring->desc_size; in vnic_dev_alloc_desc_ring() 41 ring->base_align = 512; in vnic_dev_alloc_desc_ring() [all …]
|
/freebsd/sys/dev/axgbe/ |
H A D | xgbe-txrx.c | 75 axgbe_ctx_desc_setup(struct xgbe_prv_data *pdata, struct xgbe_ring *ring, in axgbe_ctx_desc_setup() argument 82 rdata = XGBE_GET_DESC_DATA(ring, ring->cur); in axgbe_ctx_desc_setup() 86 pi->ipi_tso_segsz, ring->tx.cur_mss, ring->cur); in axgbe_ctx_desc_setup() 89 pi->ipi_vtag, ring->tx.cur_vlan_ctag); in axgbe_ctx_desc_setup() 92 (pi->ipi_tso_segsz != ring->tx.cur_mss)) { in axgbe_ctx_desc_setup() 102 ring->tx.cur_mss = pi->ipi_tso_segsz; in axgbe_ctx_desc_setup() 106 if (pi->ipi_vtag && (pi->ipi_vtag != ring->tx.cur_vlan_ctag)) { in axgbe_ctx_desc_setup() 116 ring in axgbe_ctx_desc_setup() 175 struct xgbe_ring *ring; axgbe_isc_txd_encap() local 374 struct xgbe_ring *ring = channel->tx_ring; axgbe_isc_txd_flush() local 392 struct xgbe_ring *ring = channel->tx_ring; axgbe_isc_txd_credits_update() local 448 struct xgbe_ring *ring = channel->rx_ring; axgbe_isc_rxd_refill() local 539 struct xgbe_ring *ring = channel->rx_ring; axgbe_isc_rxd_flush() local 563 struct xgbe_ring *ring = channel->rx_ring; axgbe_isc_rxd_available() local 701 struct xgbe_ring *ring = channel->rx_ring; axgbe_isc_rxd_pkt_get() local [all...] |
/freebsd/sys/dev/oce/ |
H A D | oce_util.c | 145 * @brief Destroy a ring buffer 147 * @param ring ring buffer 151 oce_destroy_ring_buffer(POCE_SOFTC sc, oce_ring_buffer_t *ring) in oce_destroy_ring_buffer() argument 153 oce_dma_free(sc, &ring->dma); in oce_destroy_ring_buffer() 154 free(ring, M_DEVBUF); in oce_destroy_ring_buffer() 163 oce_ring_buffer_t *ring; in oce_create_ring_buffer() local 165 ring = malloc(sizeof(oce_ring_buffer_t), M_DEVBUF, M_NOWAIT | M_ZERO); in oce_create_ring_buffer() 166 if (ring == NULL) in oce_create_ring_buffer() 169 ring->item_size = item_size; in oce_create_ring_buffer() 170 ring->num_items = q_len; in oce_create_ring_buffer() [all …]
|
/freebsd/sys/contrib/xen/ |
H A D | argo.h | 36 /* The maximum size of an Argo ring is defined to be: 16MB (0x1000000 bytes). */ 81 * Header space reserved for later use. Align the start of the ring to a 85 uint8_t ring[XEN_FLEX_ARRAY_DIM]; member 103 /* Messages on the ring are padded to a multiple of this size. */ 109 /* Ring exists */ 111 /* Ring is shared, not unicast */ 113 /* Ring is empty */ 117 /* Insufficient ring size for space_required bytes */ 119 /* Too many domains waiting for available space signals for this ring */ 124 xen_argo_addr_t ring; member [all …]
|
/freebsd/sys/dev/rtwn/pci/ |
H A D | rtwn_pci_rx.c | 86 struct rtwn_rx_ring *ring = &pc->rx_ring; in rtwn_pci_rx_frame() local 87 struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; in rtwn_pci_rx_frame() 88 struct rtwn_rx_data *rx_data = &ring->rx_data[ring->cur]; in rtwn_pci_rx_frame() 133 bus_dmamap_sync(ring->data_dmat, rx_data->map, BUS_DMASYNC_POSTREAD); in rtwn_pci_rx_frame() 134 bus_dmamap_unload(ring->data_dmat, rx_data->map); in rtwn_pci_rx_frame() 136 error = bus_dmamap_load(ring->data_dmat, rx_data->map, mtod(m1, void *), in rtwn_pci_rx_frame() 141 error = bus_dmamap_load(ring->data_dmat, rx_data->map, in rtwn_pci_rx_frame() 182 struct rtwn_rx_ring *ring = &pc->rx_ring; in rtwn_pci_rx_buf_copy() local 183 struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; in rtwn_pci_rx_buf_copy() 184 struct rtwn_rx_data *rx_data = &ring->rx_data[ring->cur]; in rtwn_pci_rx_buf_copy() [all …]
|
H A D | rtwn_pci_tx.c | 94 struct rtwn_tx_ring *ring; in rtwn_pci_tx_start_frame() local 113 ring = &pc->tx_ring[qid]; in rtwn_pci_tx_start_frame() 114 data = &ring->tx_data[ring->cur]; in rtwn_pci_tx_start_frame() 117 "%s: ring #%u is full (m %p)\n", __func__, qid, data->m); in rtwn_pci_tx_start_frame() 122 ((uint8_t *)ring->desc + sc->txdesc_len * ring->cur); in rtwn_pci_tx_start_frame() 125 "%s: OWN bit is set (tx desc %d, ring %u)!\n", in rtwn_pci_tx_start_frame() 126 __func__, ring->cur, qid); in rtwn_pci_tx_start_frame() 135 error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m, segs, in rtwn_pci_tx_start_frame() 152 error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m, in rtwn_pci_tx_start_frame() 173 bus_dmamap_sync(ring->desc_dmat, ring->desc_map, in rtwn_pci_tx_start_frame() [all …]
|
/freebsd/sys/dev/safexcel/ |
H A D | safexcel.c | 96 safexcel_next_request(struct safexcel_ring *ring) in safexcel_next_request() argument 100 i = ring->cdr.read; in safexcel_next_request() 103 return (&ring->requests[i]); in safexcel_next_request() 107 safexcel_cmd_descr_next(struct safexcel_cmd_descr_ring *ring) in safexcel_cmd_descr_next() argument 111 if (ring->write == ring->read) in safexcel_cmd_descr_next() 113 cdesc = &ring->desc[ring->read]; in safexcel_cmd_descr_next() 114 ring->read = (ring->read + 1) % SAFEXCEL_RING_SIZE; in safexcel_cmd_descr_next() 119 safexcel_res_descr_next(struct safexcel_res_descr_ring *ring) in safexcel_res_descr_next() argument 123 if (ring->write == ring->read) in safexcel_res_descr_next() 125 rdesc = &ring->desc[ring->read]; in safexcel_res_descr_next() [all …]
|
/freebsd/sys/net/ |
H A D | netmap_user.h | 45 * we can access ring->cur, ring->head, ring->tail, etc. 47 * ring->slot[i] gives us the i-th slot (we can access 50 * char *buf = NETMAP_BUF(ring, x) returns a pointer to 53 * All ring indexes (head, cur, tail) should always move forward. 54 * To compute the next index in a circular ring you can use 55 * i = nm_ring_next(ring, i); 118 #define NETMAP_BUF(ring, index) \ argument 119 ((char *)(ring) + (ring)->buf_ofs + ((size_t)(index)*(ring)->nr_buf_size)) 121 #define NETMAP_BUF_IDX(ring, buf) \ argument 122 ( ((char *)(buf) - ((char *)(ring) + (ring)->buf_ofs) ) / \ [all …]
|
/freebsd/usr.sbin/bhyve/ |
H A D | net_backend_netmap.c | 176 struct netmap_ring *ring; in netmap_send() local 184 ring = priv->tx; in netmap_send() 185 head = ring->head; in netmap_send() 186 if (head == ring->tail) { in netmap_send() 190 nm_buf = NETMAP_BUF(ring, ring->slot[head].buf_idx); in netmap_send() 191 nm_buf_size = ring->nr_buf_size; in netmap_send() 220 ring->slot[head].len = nm_buf_len; in netmap_send() 221 ring->slot[head].flags = NS_MOREFRAG; in netmap_send() 222 head = nm_ring_next(ring, head); in netmap_send() 223 if (head == ring->tail) { in netmap_send() [all …]
|
/freebsd/share/man/man4/ |
H A D | iflib.4 | 74 Controls how the transmit ring is serviced. 75 If set to zero, when a frame is submitted to the transmission ring, the same 76 task that is submitting it will service the ring unless there's already a 77 task servicing the TX ring. 79 the transmit ring is being serviced. 82 ring is serviced by a different task. 122 Number of consumer abdications in the MP ring for this queue. 123 An abdication occurs on every ring submission when tx_abdicate is true. 125 Number of consumer restarts in the MP ring for this queue. 126 A restart occurs when an attempt to drain a non-empty ring fails, [all …]
|
/freebsd/sys/dev/qat/include/common/ |
H A D | adf_transport_access_macros.h | 33 /* Valid internal ring size values */ 51 /* Size to bytes conversion macros for ring and msg size values */ 60 /* Minimum ring bufer size for memory allocation */ 79 #define READ_CSR_RING_HEAD(csr_base_addr, bank, ring) \ argument 82 (ring << 2)) 83 #define READ_CSR_RING_TAIL(csr_base_addr, bank, ring) \ argument 86 (ring << 2)) 90 #define WRITE_CSR_RING_CONFIG(csr_base_addr, bank, ring, value) \ argument 93 (ring << 2), \ 95 #define WRITE_CSR_RING_BASE(csr_base_addr, bank, ring, value) \ argument [all …]
|
/freebsd/sys/dev/qat/include/ |
H A D | adf_gen4vf_hw_csr_data.h | 28 #define READ_CSR_RING_HEAD_GEN4VF(csr_base_addr, bank, ring) \ argument 32 ADF_RING_CSR_RING_HEAD + ((ring) << 2)) 33 #define READ_CSR_RING_TAIL_GEN4VF(csr_base_addr, bank, ring) \ argument 37 ADF_RING_CSR_RING_TAIL + ((ring) << 2)) 43 #define WRITE_CSR_RING_CONFIG_GEN4VF(csr_base_addr, bank, ring, value) \ argument 47 ADF_RING_CSR_RING_CONFIG_GEN4 + ((ring) << 2), \ 49 #define WRITE_CSR_RING_BASE_GEN4VF(csr_base_addr, bank, ring, value) \ argument 53 u32 _ring = ring; \ 71 read_base_gen4vf(struct resource *csr_base_addr, u32 bank, u32 ring) in read_base_gen4vf() argument 78 ADF_RING_CSR_RING_LBASE_GEN4 + (ring << 2)); in read_base_gen4vf() [all …]
|