/* Purpose: Let user call ioctl() to get info when the UART physically is emptied. On bus types like RS485, the transmitter must release the bus after transmitting. This must be done when the transmit shift register is empty, not be done when the transmit holding register is empty. This functionality allows an RS485 driver to be written in user space.  */
static int get_lsr_info(struct async_struct *info, unsigned int __user *value)
/* Purpose: Let user call ioctl() to get info when the UART physically is emptied. On bus types like RS485, the transmitter must release the bus after transmitting. This must be done when the transmit shift register is empty, not be done when the transmit holding register is empty. This functionality allows an RS485 driver to be written in user space.  */
static int get_lsr_info(struct async_struct *info, unsigned int __user *value)
{
	unsigned char status;
	unsigned int result;
	unsigned long flags;
	local_irq_save(flags);
	status = custom.serdatr;
	mb();
	local_irq_restore(flags);
	result = ((status & SDR_TSRE) ? TIOCSER_TEMT : 0);
	if (copy_to_user(value, &result, sizeof(int)))
		return -EFAULT;
	return 0;
}