Lines Matching refs:desc

89 static inline u16 next_desc(port_t *port, u16 desc, int transmit)  in next_desc()  argument
91 return (desc + 1) % (transmit ? port_to_card(port)->tx_ring_buffers in next_desc()
95 static inline u16 desc_abs_number(port_t *port, u16 desc, int transmit) in desc_abs_number() argument
100 desc %= (transmit ? tx_buffs : rx_buffs); // called with "X + 1" etc. in desc_abs_number()
102 transmit * rx_buffs + desc; in desc_abs_number()
105 static inline u16 desc_offset(port_t *port, u16 desc, int transmit) in desc_offset() argument
108 return desc_abs_number(port, desc, transmit) * sizeof(pkt_desc); in desc_offset()
111 static inline pkt_desc __iomem *desc_address(port_t *port, u16 desc, in desc_address() argument
116 + desc_offset(port, desc, transmit)); in desc_address()
119 + desc_offset(port, desc, transmit)); in desc_address()
123 static inline u32 buffer_offset(port_t *port, u16 desc, int transmit) in buffer_offset() argument
126 desc_abs_number(port, desc, transmit) * (u32)HDLC_MAX_MRU; in buffer_offset()
165 pkt_desc __iomem *desc = desc_address(port, i, transmit); in sca_init_port() local
169 writew(chain_off, &desc->cp); in sca_init_port()
170 writel(buff_off, &desc->bp); in sca_init_port()
171 writew(0, &desc->len); in sca_init_port()
172 writeb(0, &desc->stat); in sca_init_port()
237 static inline void sca_rx(card_t *card, port_t *port, pkt_desc __iomem *desc, in sca_rx() argument
247 len = readw(&desc->len); in sca_rx()
301 pkt_desc __iomem *desc; in sca_rx_intr() local
307 desc = desc_address(port, port->rxin, 0); in sca_rx_intr()
308 stat = readb(&desc->stat); in sca_rx_intr()
323 sca_rx(card, port, desc, port->rxin); in sca_rx_intr()
352 pkt_desc __iomem *desc; in sca_tx_intr() local
360 desc = desc_address(port, port->txlast, 1); in sca_tx_intr()
362 dev->stats.tx_bytes += readw(&desc->len); in sca_tx_intr()
363 writeb(0, &desc->stat); /* Free descriptor */ in sca_tx_intr()
630 pkt_desc __iomem *desc; in sca_xmit() local
637 desc = desc_address(port, port->txin + 1, 1); in sca_xmit()
638 BUG_ON(readb(&desc->stat)); /* previous xmit should stop queue */ in sca_xmit()
645 desc = desc_address(port, port->txin, 1); in sca_xmit()
664 writew(len, &desc->len); in sca_xmit()
665 writeb(ST_TX_EOM, &desc->stat); in sca_xmit()
673 desc = desc_address(port, port->txin + 1, 1); in sca_xmit()
674 if (readb(&desc->stat)) /* allow 1 packet gap */ in sca_xmit()