The patch titled serial: Fix up offenders peering at baud bits directly has been added to the -mm tree. Its filename is serial-fix-up-offenders-peering-at-baud-bits-directly.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: serial: Fix up offenders peering at baud bits directly From: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> Stop some other people peering into the baud bits on their own and make them use the tty_get_baud_rate() helper as a preperation for the move to the new termios. Corrected dependancy previous one had on new termios structs Signed-off-by: Alan Cox <alan@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/char/moxa.c | 82 +++------------------------------------ drivers/char/mxser.c | 66 ------------------------------- drivers/char/riscom8.c | 22 +--------- 3 files changed, 12 insertions(+), 158 deletions(-) diff -puN drivers/char/moxa.c~serial-fix-up-offenders-peering-at-baud-bits-directly drivers/char/moxa.c --- a/drivers/char/moxa.c~serial-fix-up-offenders-peering-at-baud-bits-directly +++ a/drivers/char/moxa.c @@ -260,7 +260,7 @@ static void MoxaPortEnable(int); static void MoxaPortDisable(int); static long MoxaPortGetMaxBaud(int); static long MoxaPortSetBaud(int, long); -static int MoxaPortSetTermio(int, struct termios *); +static int MoxaPortSetTermio(int, struct termios *, speed_t); static int MoxaPortGetLineOut(int, int *, int *); static void MoxaPortLineCtrl(int, int, int); static void MoxaPortFlowCtrl(int, int, int, int, int, int); @@ -986,7 +986,7 @@ static void set_tty_param(struct tty_str if (ts->c_iflag & IXANY) xany = 1; MoxaPortFlowCtrl(ch->port, rts, cts, txflow, rxflow, xany); - MoxaPortSetTermio(ch->port, ts); + MoxaPortSetTermio(ch->port, ts, tty_get_baud_rate(tty)); } static int block_till_ready(struct tty_struct *tty, struct file *filp, @@ -1900,9 +1900,10 @@ int MoxaPortsOfCard(int cardno) * * Function 12: Configure the port. * Syntax: - * int MoxaPortSetTermio(int port, struct termios *termio); + * int MoxaPortSetTermio(int port, struct termios *termio, speed_t baud); * int port : port number (0 - 127) * struct termios * termio : termio structure pointer + * speed_t baud : baud rate * * return: -1 : this port is invalid or termio == NULL * 0 : setting O.K. @@ -2182,11 +2183,10 @@ long MoxaPortSetBaud(int port, long baud return (baud); } -int MoxaPortSetTermio(int port, struct termios *termio) +int MoxaPortSetTermio(int port, struct termios *termio, speed_t baud) { void __iomem *ofsAddr; tcflag_t cflag; - long baud; tcflag_t mode = 0; if (moxaChkPort[port] == 0 || termio == 0) @@ -2221,78 +2221,10 @@ int MoxaPortSetTermio(int port, struct t mode |= MX_PARNONE; moxafunc(ofsAddr, FC_SetDataMode, (ushort) mode); - - cflag &= (CBAUD | CBAUDEX); -#ifndef B921600 -#define B921600 (B460800+1) -#endif - switch (cflag) { - case B921600: - baud = 921600L; - break; - case B460800: - baud = 460800L; - break; - case B230400: - baud = 230400L; - break; - case B115200: - baud = 115200L; - break; - case B57600: - baud = 57600L; - break; - case B38400: - baud = 38400L; - break; - case B19200: - baud = 19200L; - break; - case B9600: - baud = 9600L; - break; - case B4800: - baud = 4800L; - break; - case B2400: - baud = 2400L; - break; - case B1800: - baud = 1800L; - break; - case B1200: - baud = 1200L; - break; - case B600: - baud = 600L; - break; - case B300: - baud = 300L; - break; - case B200: - baud = 200L; - break; - case B150: - baud = 150L; - break; - case B134: - baud = 134L; - break; - case B110: - baud = 110L; - break; - case B75: - baud = 75L; - break; - case B50: - baud = 50L; - break; - default: - baud = 0; - } + if ((moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_ISA) || (moxa_boards[port / MAX_PORTS_PER_BOARD].boardType == MOXA_BOARD_C320_PCI)) { - if (baud == 921600L) + if (baud >= 921600L) return (-1); } MoxaPortSetBaud(port, baud); diff -puN drivers/char/mxser.c~serial-fix-up-offenders-peering-at-baud-bits-directly drivers/char/mxser.c --- a/drivers/char/mxser.c~serial-fix-up-offenders-peering-at-baud-bits-directly +++ a/drivers/char/mxser.c @@ -2540,71 +2540,7 @@ static int mxser_change_speed(struct mxs #define B921600 (B460800 +1) #endif if (mxser_set_baud_method[info->port] == 0) { - switch (cflag & (CBAUD | CBAUDEX)) { - case B921600: - baud = 921600; - break; - case B460800: - baud = 460800; - break; - case B230400: - baud = 230400; - break; - case B115200: - baud = 115200; - break; - case B57600: - baud = 57600; - break; - case B38400: - baud = 38400; - break; - case B19200: - baud = 19200; - break; - case B9600: - baud = 9600; - break; - case B4800: - baud = 4800; - break; - case B2400: - baud = 2400; - break; - case B1800: - baud = 1800; - break; - case B1200: - baud = 1200; - break; - case B600: - baud = 600; - break; - case B300: - baud = 300; - break; - case B200: - baud = 200; - break; - case B150: - baud = 150; - break; - case B134: - baud = 134; - break; - case B110: - baud = 110; - break; - case B75: - baud = 75; - break; - case B50: - baud = 50; - break; - default: - baud = 0; - break; - } + baud = tty_get_baud_rate(info->tty); mxser_set_baud(info, baud); } diff -puN drivers/char/riscom8.c~serial-fix-up-offenders-peering-at-baud-bits-directly drivers/char/riscom8.c --- a/drivers/char/riscom8.c~serial-fix-up-offenders-peering-at-baud-bits-directly +++ a/drivers/char/riscom8.c @@ -675,26 +675,12 @@ static void rc_change_speed(struct risco port->COR2 = 0; port->MSVR = MSVR_RTS; - baud = C_BAUD(tty); - - if (baud & CBAUDEX) { - baud &= ~CBAUDEX; - if (baud < 1 || baud > 2) - port->tty->termios->c_cflag &= ~CBAUDEX; - else - baud += 15; - } - if (baud == 15) { - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) - baud ++; - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) - baud += 2; - } + baud = tty_get_baud_rate(tty); /* Select port on the board */ rc_out(bp, CD180_CAR, port_No(port)); - if (!baud_table[baud]) { + if (!baud) { /* Drop DTR & exit */ bp->DTR |= (1u << port_No(port)); rc_out(bp, RC_DTR, bp->DTR); @@ -710,7 +696,7 @@ static void rc_change_speed(struct risco */ /* Set baud rate for port */ - tmp = (((RC_OSCFREQ + baud_table[baud]/2) / baud_table[baud] + + tmp = (((RC_OSCFREQ + baud/2) / baud + CD180_TPC/2) / CD180_TPC); rc_out(bp, CD180_RBPRH, (tmp >> 8) & 0xff); @@ -718,7 +704,7 @@ static void rc_change_speed(struct risco rc_out(bp, CD180_RBPRL, tmp & 0xff); rc_out(bp, CD180_TBPRL, tmp & 0xff); - baud = (baud_table[baud] + 5) / 10; /* Estimated CPS */ + baud = (baud + 5) / 10; /* Estimated CPS */ /* Two timer ticks seems enough to wakeup something like SLIP driver */ tmp = ((baud + HZ/2) / HZ) * 2 - CD180_NFIFO; _ Patches currently in -mm which might be from alan@xxxxxxxxxxxxxxxxxxx are alim15x3c-m5229-rev-c8-support-for-dma-cd-writer.patch git-libata-all.patch libata-add-40pin-short-cable-support-honour-drive.patch 1-of-2-jmicron-driver.patch 1-of-2-jmicron-driver-fix.patch 2-of-2-jmicron-driver-plumbing-and-quirk.patch non-libata-driver-for-jmicron-devices.patch via-pata-controller-xfer-fixes.patch via-pata-controller-xfer-fixes-fix.patch megaraid-gcc-41-warning-fix.patch voyager-tty-locking.patch uml-tty-locking.patch edac-new-opteron-athlon64-memory-controller-driver.patch edac-new-opteron-athlon64-memory-controller-driver-tidy.patch sanitize-3c589_cs.patch make-prot_write-imply-prot_read.patch remove-unused-tty_struct-variable.patch there-is-no-devfs-there-has-never-been-a-devfs-we-have.patch tty-locking-on-resize.patch ahci-ati-sb600-sata-support-for-various-modes.patch atiixp-ati-sb600-ide-support-for-various-modes.patch dquot-add-proper-locking-when-using-current-signal-tty.patch tty-trivial-kzalloc-opportunity.patch tty-lock-ticogwinsz.patch tty-stop-the-tty-vanishing-under-procfs-access.patch exit-fix-crash-case.patch tty-make-termios_sem-a-mutex.patch tty-make-termios_sem-a-mutex-fix.patch solaris-emulation-incorrect-tty-locking.patch tty-fix-bits-and-note-more-bits-to-fix.patch build-sound-sound_firmwarec-only-for-oss.patch build-sound-sound_firmwarec-only-for-oss-doc.patch generic_serial-remove-private-decoding-of-baud-rate-bits.patch istallion-remove-private-baud-rate-decoding-which-is.patch specialix-remove-private-speed-decoding.patch fix-locking-for-tty-drivers-when-doing-urgent-characters.patch audit-accounting-tty-locking.patch serial-fix-up-offenders-peering-at-baud-bits-directly.patch support-piping-into-commands-in-proc-sys-kernel-core_pattern.patch support-piping-into-commands-in-proc-sys-kernel-core_pattern-fix-2.patch ide-claim-extra-dma-ports-regardless-of-channel.patch ide-always-release-dma-engine.patch ide-error-handling-fixes.patch ide-hpt3xxn-clocking-fixes.patch ide-fix-hpt37x-timing-tables.patch ide-optimize-hpt37x-timing-tables.patch ide-fix-hpt3xx-hotswap-support.patch ide-fix-the-case-of-multiple-hpt3xx-chips-present.patch ide-hpt3xx-fix-pci-clock-detection.patch ide-hpt3xx-fix-pci-clock-detection-fix-2.patch piix-fix-82371mx-enablebits.patch piix-remove-check-for-broken-mw-dma-mode-0.patch piix-slc90e66-pio-mode-fallback-fix.patch make-number-of-ide-interfaces-configurable.patch ide_dma_speed-fixes.patch hpt3xx-rework-rate-filtering.patch hpt3xx-rework-rate-filtering-tidy.patch hpt3xx-print-the-real-chip-name-at-startup.patch hpt3xx-switch-to-using-pci_get_slot.patch hpt3xx-cache-channels-mcr-address.patch hpt3x7-merge-speedproc-handlers.patch hpt370-clean-up-dma-timeout-handling.patch enable-cdrom-dma-access-with-pdc20265_old.patch ide-fix-revision-comparison-in-ide_in_drive_list.patch ide-backport-piix-fixes-from-libata-into-the-legacy-driver.patch hpt3xx-init-code-rewrite.patch move-ide-to-unmaintained-drop-reference-to-old-git-tree.patch drivers-ide-cleanups.patch ide-remove-dma_base2-field-from-ide_hwif_t.patch ide-reprogram-disk-pio-timings-on-resume.patch config_pm=n-slim-drivers-ide-pci-sc1200c.patch ide-fix-crash-on-repeated-reset.patch ide-fix-crash-on-repeated-reset-tidy.patch sstfb-clean-ups.patch pci_module_init-convertion-in-ata_genericc.patch pci_module_init-convertion-in-ata_genericc-fix.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html