Guest User

Untitled

a guest
Jan 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. void serial_interrupt(int irq, void *dev_id)
  2. {
  3. ...
  4.  
  5. // Need to loop through each port to see which port caused the interrupt.
  6. list_for_each(lpNode, &serial_ports)
  7. {
  8. struct serial_port_module *ser_dev = list_entry(lpNode, struct serial_port_module, port_list);
  9.  
  10. lnIsr = ioread8(ser_dev->membase + ser_dev->chan_num * PORT_OFFSET + SERIAL_ISR);
  11.  
  12. if (lnIsr & IPM512_RX_INT)
  13. {
  14. while (serialdata_is_data_available(ser_dev)) // equals a ioread8()
  15. {
  16. lcIn = ioread8(ser_dev->membase + ser_dev->chan_num * PORT_OFFSET + SERIAL_RBR);
  17.  
  18. kfifo_in(&ser_dev->rx_fifo, &lcIn, sizeof(lcIn));
  19.  
  20. // Notify if anyone is doing a blocking read.
  21. wake_up_interruptible(&ser_dev->read_queue);
  22. }
  23. }
  24. }
  25. }
Add Comment
Please, Sign In to add comment