mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
vio: create routines for inc,dec vio dring indexes
Both sunvdc and sunvnet implemented distinct functionality for incrementing and decrementing dring indexes. Create common functions for use by both from the sunvnet versions, which were chosen since they will still work correctly in case a non power of two ring size is used. Signed-off-by: Dwight Engen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
31f4888f51
commit
fe47c3c262
3 changed files with 25 additions and 26 deletions
|
|
@ -269,7 +269,7 @@ static void vdc_end_one(struct vdc_port *port, struct vio_dring_state *dr,
|
|||
|
||||
ldc_unmap(port->vio.lp, desc->cookies, desc->ncookies);
|
||||
desc->hdr.state = VIO_DESC_FREE;
|
||||
dr->cons = (index + 1) & (VDC_TX_RING_SIZE - 1);
|
||||
dr->cons = vio_dring_next(dr, index);
|
||||
|
||||
req = rqe->req;
|
||||
if (req == NULL) {
|
||||
|
|
@ -472,7 +472,7 @@ static int __send_request(struct request *req)
|
|||
printk(KERN_ERR PFX "vdc_tx_trigger() failure, err=%d\n", err);
|
||||
} else {
|
||||
port->req_id++;
|
||||
dr->prod = (dr->prod + 1) & (VDC_TX_RING_SIZE - 1);
|
||||
dr->prod = vio_dring_next(dr, dr->prod);
|
||||
}
|
||||
|
||||
return err;
|
||||
|
|
@ -626,7 +626,7 @@ static int generic_request(struct vdc_port *port, u8 op, void *buf, int len)
|
|||
err = __vdc_tx_trigger(port);
|
||||
if (err >= 0) {
|
||||
port->req_id++;
|
||||
dr->prod = (dr->prod + 1) & (VDC_TX_RING_SIZE - 1);
|
||||
dr->prod = vio_dring_next(dr, dr->prod);
|
||||
spin_unlock_irqrestore(&port->vio.lock, flags);
|
||||
|
||||
wait_for_completion(&comp.com);
|
||||
|
|
|
|||
Loading…
Reference in a new issue