Lines Matching refs:desc
75 static inline u16 desc_abs_number(port_t *port, u16 desc, int transmit) in desc_abs_number() argument
80 desc %= (transmit ? tx_buffs : rx_buffs); // called with "X + 1" etc. in desc_abs_number()
81 return port->chan * (rx_buffs + tx_buffs) + transmit * rx_buffs + desc; in desc_abs_number()
84 static inline u16 desc_offset(port_t *port, u16 desc, int transmit) in desc_offset() argument
87 return desc_abs_number(port, desc, transmit) * sizeof(pkt_desc); in desc_offset()
90 static inline pkt_desc __iomem *desc_address(port_t *port, u16 desc, in desc_address() argument
94 desc_offset(port, desc, transmit)); in desc_address()
97 static inline u32 buffer_offset(port_t *port, u16 desc, int transmit) in buffer_offset() argument
100 desc_abs_number(port, desc, transmit) * (u32)HDLC_MAX_MRU; in buffer_offset()
135 pkt_desc __iomem *desc = desc_address(port, i, transmit); in sca_init_port() local
139 writel(chain_off, &desc->cp); in sca_init_port()
140 writel(buff_off, &desc->bp); in sca_init_port()
141 writew(0, &desc->len); in sca_init_port()
142 writeb(0, &desc->stat); in sca_init_port()
193 static inline void sca_rx(card_t *card, port_t *port, pkt_desc __iomem *desc, in sca_rx() argument
201 len = readw(&desc->len); in sca_rx()
241 pkt_desc __iomem *desc; in sca_rx_done() local
247 desc = desc_address(port, port->rxin, 0); in sca_rx_done()
248 stat = readb(&desc->stat); in sca_rx_done()
263 sca_rx(card, port, desc, port->rxin); in sca_rx_done()
294 pkt_desc __iomem *desc = desc_address(port, port->txlast, 1); in sca_tx_done() local
295 u8 stat = readb(&desc->stat); in sca_tx_done()
304 dev->stats.tx_bytes += readw(&desc->len); in sca_tx_done()
306 writeb(0, &desc->stat); /* Free descriptor */ in sca_tx_done()
568 pkt_desc __iomem *desc; in sca_xmit() local
573 desc = desc_address(port, port->txin + 1, 1); in sca_xmit()
574 BUG_ON(readb(&desc->stat)); /* previous xmit should stop queue */ in sca_xmit()
581 desc = desc_address(port, port->txin, 1); in sca_xmit()
586 writew(len, &desc->len); in sca_xmit()
587 writeb(ST_TX_EOM, &desc->stat); in sca_xmit()
595 desc = desc_address(port, port->txin + 1, 1); in sca_xmit()
596 if (readb(&desc->stat)) /* allow 1 packet gap */ in sca_xmit()