fall back to internal baud rate constants if the termios module hasn't one. happens for large baudrates on some systems
diff --git a/pyserial/serial/serialposix.py b/pyserial/serial/serialposix.py
index 4d6f36a..61252e2 100644
--- a/pyserial/serial/serialposix.py
+++ b/pyserial/serial/serialposix.py
@@ -13,7 +13,7 @@
 import sys, os, fcntl, termios, struct, select, errno
 from serialutil import *
 
-VERSION = "$Revision: 1.33 $".split()[1]     #extract CVS version
+VERSION = "$Revision: 1.34 $".split()[1]     #extract CVS version
 
 #Do check the Python version as some constants have moved.
 if (sys.hexversion < 0x020100f0):
@@ -121,6 +121,40 @@
 TIOCM_RTS_str = struct.pack('I', TIOCM_RTS)
 TIOCM_DTR_str = struct.pack('I', TIOCM_DTR)
 
+baudrate_constants = {
+    0:       0000000,  # hang up
+    50:      0000001,
+    75:      0000002,
+    110:     0000003,
+    134:     0000004,
+    150:     0000005,
+    200:     0000006,
+    300:     0000007,
+    600:     0000010,
+    1200:    0000011,
+    1800:    0000012,
+    2400:    0000013,
+    4800:    0000014,
+    9600:    0000015,
+    19200:   0000016,
+    38400:   0000017,
+    57600:   0010001,
+    115200:  0010002,
+    230400:  0010003,
+    460800:  0010004,
+    500000:  0010005,
+    576000:  0010006,
+    921600:  0010007,
+    1000000: 0010010,
+    1152000: 0010011,
+    1500000: 0010012,
+    2000000: 0010013,
+    2500000: 0010014,
+    3000000: 0010015,
+    3500000: 0010016,
+    4000000: 0010017
+}
+    
 
 class Serial(SerialBase):
     """Serial port class POSIX implementation. Serial port configuration is 
@@ -180,7 +214,10 @@
         try:
             ispeed = ospeed = getattr(TERMIOS,'B%s' % (self._baudrate))
         except AttributeError:
-            raise ValueError('Invalid baud rate: %r' % self._baudrate)
+            try:
+                ispeed = ospeed = baudrate_constants[self._baudrate]
+            except KeyError:
+                raise ValueError('Invalid baud rate: %r' % self._baudrate)
         #setup char len
         cflag &= ~TERMIOS.CSIZE
         if self._bytesize == 8: