This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM335X: UART driver read API

Part Number: PROCESSOR-SDK-AM335X

My requirement I need to print buffer in tty driver level before coming to user level. For that, 

I am trying to print the buffer coming from /dev/ttyS5 in UART driver level(I am not looking in user level). For that I dig into code I found below is the read sequence for TTY driver.

tty_read <--  ldisc.read <-- tty_flipbuffer_push <--  interrupt <-- Hardware

I added below code in my tty_read API at the end

static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
                                                                                    loff_t *ppos)
{

     "

     "

     "

  if((imajor(inode) == 245) && (iminor(inode) == 5)) {         // I am filtering messages using major and minor number

    printk("Test print\n");   //OK

   printk("Buffer %c\n", buf[0]);   // Kernel panic (segfault)

   }

}

Can you help me how to figure out buffer contents in driver level?

I am using latest SDK AM335X.