[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Do you want to go.. FASTER?!"



Success!  ~10K/sec FTP rates first try!  For those who are interested
(and in case this question ever comes up again), I've included the
diffs below.  Yes, it's ugly; yes, it may be unnecessarily circuitous;
but hey, it works. ;)

						-sbigham
--
*** pppd/main.c.orig	Fri Dec  9 16:44:12 1994
--- pppd/main.c	Sun Dec 15 17:03:28 1996
***************
*** 529,534 ****
--- 529,539 ----
  #define baud_rate_of(speed)	(speed)
  
  #else
+ #ifdef __MINT__
+ /* Sneaky dirty ugly hack, part 1  --dsb */
+ #define B57600	57600
+ #define B115200	115200
+ #endif
  /*
   * List of valid speeds.
   */
***************
*** 687,692 ****
--- 692,707 ----
      if (speed) {
  	cfsetospeed(&tios, speed);
  	cfsetispeed(&tios, speed);
+ #ifdef __MINT__
+     } else if (speed >= B57600) {
+ 	/* Sneaky dirty ugly hack, part 2:  speed_t is an unsigned short
+ 	   in the MiNT library, which won't hold speeds as fast as 115200;
+ 	   we'll temporarily set 38400 baud here, and set the real speed
+ 	   after the tcsetattr().
+ 	*/
+ 	cfsetospeed(&tios, B38400);
+ 	cfsetispeed(&tios, B38400);
+ #endif
      } else {
  	speed = cfgetospeed(&tios);
      }
***************
*** 695,700 ****
--- 710,731 ----
  	syslog(LOG_ERR, "tcsetattr: %m");
  	die(1);
      }
+ #ifdef __MINT__
+     if (speed >= B57600) {
+ 	/* Sneaky dirty ugly hack, part 3:  Now we set the real speed using
+ 	   the TIOC{I,O}BAUD ioctl(). */
+ 	long ispd = speed, ospd = speed;
+ 
+ 	if (ioctl(fd, TIOCIBAUD, &ispd) < 0) {
+ 	    syslog(LOG_ERR, "ioctl(TIOCIBAUD): %m");
+ 	    die(1);
+ 	}
+ 	if (ioctl(fd, TIOCOBAUD, &ospd) < 0) {
+ 	    syslog(LOG_ERR, "ioctl(TIOCOBAUD): %m");
+ 	    die(1);
+ 	}
+     }
+ #endif
  
  #ifdef ultrix
      x = 0;