From 89ae806bad05a685c502d638da192d3b57043e22 Mon Sep 17 00:00:00 2001 From: Timo Juhani Lindfors Date: Sat, 6 Nov 2010 11:55:31 -0400 Subject: Bug #17637: /dev/ttySAC1 is always opened in read-only mode More info: 1) /dev/ttySAC1 is a serial port used on samsung s3c2440 (e.g. openmoko freerunner): $ stat /dev/ttySAC1 File: `/dev/ttySAC1' Size: 0 Blocks: 0 IO Block: 4096 character special file Device: ch/12d Inode: 161 Links: 1 Device type: cc,41 Access: (0660/crw-rw----) Uid: ( 0/ root) Gid: ( 20/ dialout) Access: 2010-10-19 01:23:13.893489000 +0300 Modify: 2010-10-18 20:21:22.089934000 +0300 Change: 2010-10-18 20:21:22.089934000 +0300 2) I think the problem is in gpsd_classify(). It assumes that all serial ports have major number of 4. It even links to ftp://ftp.kernel.org/pub/linux/docs/device-list/devices-2.6+.txt as a reference. However, that file nowadays lists also 204 char Low-density serial ports 0 = /dev/ttyLU0 LinkUp Systems L72xx UART - port 0 1 = /dev/ttyLU1 LinkUp Systems L72xx UART - port 1 2 = /dev/ttyLU2 LinkUp Systems L72xx UART - port 2 3 = /dev/ttyLU3 LinkUp Systems L72xx UART - port 3 4 = /dev/ttyFB0 Intel Footbridge (ARM) 5 = /dev/ttySA0 StrongARM builtin serial port 0 6 = /dev/ttySA1 StrongARM builtin serial port 1 ... The patch adds 204 to the list of recognized major numbers. Signed-off-by: Jon Schlueter --- serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'serial.c') diff --git a/serial.c b/serial.c index ec37836a..28c6befc 100644 --- a/serial.c +++ b/serial.c @@ -59,7 +59,7 @@ static sourcetype_t gpsd_classify(const char *path) * ftp://ftp.kernel.org/pub/linux/docs/device-list/devices-2.6+.txt */ int devmajor = major(sb.st_rdev); - if (devmajor == 4) + if (devmajor == 4 || devmajor == 204) devtype = source_rs232; else if (devmajor == 188) devtype = source_usb; -- cgit v1.2.1